diff --git a/.coveragerc b/.coveragerc
index 75f4cbd20fd..06cfc7d7471 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -6,10 +6,17 @@ omit =
# omit pieces of code that rely on external devices being present
homeassistant/components/alarm_control_panel/alarmdotcom.py
+ homeassistant/components/alarm_control_panel/nx584.py
homeassistant/components/arduino.py
homeassistant/components/*/arduino.py
+ homeassistant/components/apcupsd.py
+ homeassistant/components/*/apcupsd.py
+
+ homeassistant/components/bloomsky.py
+ homeassistant/components/*/bloomsky.py
+
homeassistant/components/insteon_hub.py
homeassistant/components/*/insteon_hub.py
@@ -53,6 +60,9 @@ omit =
homeassistant/components/rpi_gpio.py
homeassistant/components/*/rpi_gpio.py
+ homeassistant/components/scsgate.py
+ homeassistant/components/*/scsgate.py
+
homeassistant/components/binary_sensor/arest.py
homeassistant/components/binary_sensor/rest.py
homeassistant/components/browser.py
@@ -73,9 +83,8 @@ omit =
homeassistant/components/device_tracker/ubus.py
homeassistant/components/discovery.py
homeassistant/components/downloader.py
+ homeassistant/components/garage_door/wink.py
homeassistant/components/ifttt.py
- homeassistant/components/statsd.py
- homeassistant/components/influxdb.py
homeassistant/components/keyboard.py
homeassistant/components/light/blinksticklight.py
homeassistant/components/light/hue.py
@@ -89,21 +98,24 @@ omit =
homeassistant/components/media_player/kodi.py
homeassistant/components/media_player/mpd.py
homeassistant/components/media_player/plex.py
+ homeassistant/components/media_player/samsungtv.py
+ homeassistant/components/media_player/snapcast.py
homeassistant/components/media_player/sonos.py
homeassistant/components/media_player/squeezebox.py
homeassistant/components/notify/free_mobile.py
+ homeassistant/components/notify/googlevoice.py
homeassistant/components/notify/instapush.py
homeassistant/components/notify/nma.py
homeassistant/components/notify/pushbullet.py
homeassistant/components/notify/pushetta.py
homeassistant/components/notify/pushover.py
+ homeassistant/components/notify/rest.py
homeassistant/components/notify/slack.py
homeassistant/components/notify/smtp.py
homeassistant/components/notify/syslog.py
homeassistant/components/notify/telegram.py
homeassistant/components/notify/twitter.py
homeassistant/components/notify/xmpp.py
- homeassistant/components/notify/googlevoice.py
homeassistant/components/sensor/arest.py
homeassistant/components/sensor/bitcoin.py
homeassistant/components/sensor/cpuspeed.py
@@ -118,6 +130,7 @@ omit =
homeassistant/components/sensor/openweathermap.py
homeassistant/components/sensor/rest.py
homeassistant/components/sensor/sabnzbd.py
+ homeassistant/components/sensor/speedtest.py
homeassistant/components/sensor/swiss_public_transport.py
homeassistant/components/sensor/systemmonitor.py
homeassistant/components/sensor/temper.py
@@ -140,7 +153,6 @@ omit =
homeassistant/components/thermostat/proliphix.py
homeassistant/components/thermostat/radiotherm.py
-
[report]
# Regexes for lines to exclude from consideration
exclude_lines =
diff --git a/homeassistant/__main__.py b/homeassistant/__main__.py
index e97ed0c6386..5351bcf7983 100644
--- a/homeassistant/__main__.py
+++ b/homeassistant/__main__.py
@@ -1,13 +1,18 @@
""" Starts home assistant. """
from __future__ import print_function
+from multiprocessing import Process
+import signal
import sys
+import threading
import os
import argparse
+import time
from homeassistant import bootstrap
import homeassistant.config as config_util
-from homeassistant.const import __version__, EVENT_HOMEASSISTANT_START
+from homeassistant.const import (__version__, EVENT_HOMEASSISTANT_START,
+ RESTART_EXIT_CODE)
def validate_python():
@@ -73,6 +78,11 @@ def get_arguments():
'--demo-mode',
action='store_true',
help='Start Home Assistant in demo mode')
+ parser.add_argument(
+ '--debug',
+ action='store_true',
+ help='Start Home Assistant in debug mode. Runs in single process to '
+ 'enable use of interactive debuggers.')
parser.add_argument(
'--open-ui',
action='store_true',
@@ -204,35 +214,11 @@ def uninstall_osx():
print("Home Assistant has been uninstalled.")
-def main():
- """ Starts Home Assistant. """
- validate_python()
-
- args = get_arguments()
-
- config_dir = os.path.join(os.getcwd(), args.config)
- ensure_config_path(config_dir)
-
- # os x launchd functions
- if args.install_osx:
- install_osx()
- return
- if args.uninstall_osx:
- uninstall_osx()
- return
- if args.restart_osx:
- uninstall_osx()
- install_osx()
- return
-
- # daemon functions
- if args.pid_file:
- check_pid(args.pid_file)
- if args.daemon:
- daemonize()
- if args.pid_file:
- write_pid(args.pid_file)
-
+def setup_and_run_hass(config_dir, args, top_process=False):
+ """
+ Setup HASS and run. Block until stopped. Will assume it is running in a
+ subprocess unless top_process is set to true.
+ """
if args.demo_mode:
config = {
'frontend': {},
@@ -259,7 +245,91 @@ def main():
hass.bus.listen_once(EVENT_HOMEASSISTANT_START, open_browser)
hass.start()
- hass.block_till_stopped()
+ exit_code = int(hass.block_till_stopped())
+
+ if not top_process:
+ sys.exit(exit_code)
+ return exit_code
+
+
+def run_hass_process(hass_proc):
+ """ Runs a child hass process. Returns True if it should be restarted. """
+ requested_stop = threading.Event()
+ hass_proc.daemon = True
+
+ def request_stop(*args):
+ """ request hass stop, *args is for signal handler callback """
+ requested_stop.set()
+ hass_proc.terminate()
+
+ try:
+ signal.signal(signal.SIGTERM, request_stop)
+ except ValueError:
+ print('Could not bind to SIGTERM. Are you running in a thread?')
+
+ hass_proc.start()
+ try:
+ hass_proc.join()
+ except KeyboardInterrupt:
+ request_stop()
+ try:
+ hass_proc.join()
+ except KeyboardInterrupt:
+ return False
+
+ return (not requested_stop.isSet() and
+ hass_proc.exitcode == RESTART_EXIT_CODE,
+ hass_proc.exitcode)
+
+
+def main():
+ """ Starts Home Assistant. """
+ validate_python()
+
+ args = get_arguments()
+
+ config_dir = os.path.join(os.getcwd(), args.config)
+ ensure_config_path(config_dir)
+
+ # os x launchd functions
+ if args.install_osx:
+ install_osx()
+ return 0
+ if args.uninstall_osx:
+ uninstall_osx()
+ return 0
+ if args.restart_osx:
+ uninstall_osx()
+ # A small delay is needed on some systems to let the unload finish.
+ time.sleep(0.5)
+ install_osx()
+ return 0
+
+ # daemon functions
+ if args.pid_file:
+ check_pid(args.pid_file)
+ if args.daemon:
+ daemonize()
+ if args.pid_file:
+ write_pid(args.pid_file)
+
+ # Run hass in debug mode if requested
+ if args.debug:
+ sys.stderr.write('Running in debug mode. '
+ 'Home Assistant will not be able to restart.\n')
+ exit_code = setup_and_run_hass(config_dir, args, top_process=True)
+ if exit_code == RESTART_EXIT_CODE:
+ sys.stderr.write('Home Assistant requested a '
+ 'restart in debug mode.\n')
+ return exit_code
+
+ # Run hass as child process. Restart if necessary.
+ keep_running = True
+ while keep_running:
+ hass_proc = Process(target=setup_and_run_hass, args=(config_dir, args))
+ keep_running, exit_code = run_hass_process(hass_proc)
+ return exit_code
+
if __name__ == "__main__":
- main()
+ sys.exit(main())
diff --git a/homeassistant/components/alarm_control_panel/__init__.py b/homeassistant/components/alarm_control_panel/__init__.py
index 3f5e6362fb6..310a65c6184 100644
--- a/homeassistant/components/alarm_control_panel/__init__.py
+++ b/homeassistant/components/alarm_control_panel/__init__.py
@@ -61,6 +61,8 @@ def setup(hass, config):
for alarm in target_alarms:
getattr(alarm, method)(code)
+ if alarm.should_poll:
+ alarm.update_ha_state(True)
descriptions = load_yaml_config_file(
os.path.join(os.path.dirname(__file__), 'services.yaml'))
diff --git a/homeassistant/components/alarm_control_panel/alarmdotcom.py b/homeassistant/components/alarm_control_panel/alarmdotcom.py
index 7f76680feb7..da74c02da54 100644
--- a/homeassistant/components/alarm_control_panel/alarmdotcom.py
+++ b/homeassistant/components/alarm_control_panel/alarmdotcom.py
@@ -57,10 +57,12 @@ class AlarmDotCom(alarm.AlarmControlPanel):
@property
def should_poll(self):
+ """ No polling needed. """
return True
@property
def name(self):
+ """ Returns the name of the device. """
return self._name
@property
@@ -88,7 +90,6 @@ class AlarmDotCom(alarm.AlarmControlPanel):
# Open another session to alarm.com to fire off the command
_alarm = Alarmdotcom(self._username, self._password, timeout=10)
_alarm.disarm()
- self.update_ha_state()
def alarm_arm_home(self, code=None):
""" Send arm home command. """
@@ -98,7 +99,6 @@ class AlarmDotCom(alarm.AlarmControlPanel):
# Open another session to alarm.com to fire off the command
_alarm = Alarmdotcom(self._username, self._password, timeout=10)
_alarm.arm_stay()
- self.update_ha_state()
def alarm_arm_away(self, code=None):
""" Send arm away command. """
@@ -108,7 +108,6 @@ class AlarmDotCom(alarm.AlarmControlPanel):
# Open another session to alarm.com to fire off the command
_alarm = Alarmdotcom(self._username, self._password, timeout=10)
_alarm.arm_away()
- self.update_ha_state()
def _validate_code(self, code, state):
""" Validate given code. """
diff --git a/homeassistant/components/alarm_control_panel/nx584.py b/homeassistant/components/alarm_control_panel/nx584.py
new file mode 100644
index 00000000000..55ad9b25b9f
--- /dev/null
+++ b/homeassistant/components/alarm_control_panel/nx584.py
@@ -0,0 +1,105 @@
+"""
+homeassistant.components.alarm_control_panel.nx584
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Support for NX584 alarm control panels.
+
+For more details about this platform, please refer to the documentation at
+https://home-assistant.io/components/alarm_control_panel.nx584/
+"""
+import logging
+import requests
+
+from homeassistant.const import (STATE_UNKNOWN, STATE_ALARM_DISARMED,
+ STATE_ALARM_ARMED_HOME,
+ STATE_ALARM_ARMED_AWAY)
+import homeassistant.components.alarm_control_panel as alarm
+
+REQUIREMENTS = ['pynx584==0.1']
+
+_LOGGER = logging.getLogger(__name__)
+
+
+def setup_platform(hass, config, add_devices, discovery_info=None):
+ """ Setup nx584. """
+ host = config.get('host', 'localhost:5007')
+
+ try:
+ add_devices([NX584Alarm(hass, host, config.get('name', 'NX584'))])
+ except requests.exceptions.ConnectionError as ex:
+ _LOGGER.error('Unable to connect to NX584: %s', str(ex))
+ return False
+
+
+class NX584Alarm(alarm.AlarmControlPanel):
+ """ NX584-based alarm panel. """
+ def __init__(self, hass, host, name):
+ from nx584 import client
+ self._hass = hass
+ self._host = host
+ self._name = name
+ self._alarm = client.Client('http://%s' % host)
+ # Do an initial list operation so that we will try to actually
+ # talk to the API and trigger a requests exception for setup_platform()
+ # to catch
+ self._alarm.list_zones()
+
+ @property
+ def should_poll(self):
+ """ Polling needed. """
+ return True
+
+ @property
+ def name(self):
+ """ Returns the name of the device. """
+ return self._name
+
+ @property
+ def code_format(self):
+ """ Characters if code is defined. """
+ return '[0-9]{4}([0-9]{2})?'
+
+ @property
+ def state(self):
+ """ Returns the state of the device. """
+ try:
+ part = self._alarm.list_partitions()[0]
+ zones = self._alarm.list_zones()
+ except requests.exceptions.ConnectionError as ex:
+ _LOGGER.error('Unable to connect to %(host)s: %(reason)s',
+ dict(host=self._host, reason=ex))
+ return STATE_UNKNOWN
+ except IndexError:
+ _LOGGER.error('nx584 reports no partitions')
+ return STATE_UNKNOWN
+
+ bypassed = False
+ for zone in zones:
+ if zone['bypassed']:
+ _LOGGER.debug('Zone %(zone)s is bypassed, '
+ 'assuming HOME',
+ dict(zone=zone['number']))
+ bypassed = True
+ break
+
+ if not part['armed']:
+ return STATE_ALARM_DISARMED
+ elif bypassed:
+ return STATE_ALARM_ARMED_HOME
+ else:
+ return STATE_ALARM_ARMED_AWAY
+
+ def alarm_disarm(self, code=None):
+ """ Send disarm command. """
+ self._alarm.disarm(code)
+
+ def alarm_arm_home(self, code=None):
+ """ Send arm home command. """
+ self._alarm.arm('home')
+
+ def alarm_arm_away(self, code=None):
+ """ Send arm away command. """
+ self._alarm.arm('auto')
+
+ def alarm_trigger(self, code=None):
+ """ Alarm trigger command. """
+ raise NotImplementedError()
diff --git a/homeassistant/components/apcupsd.py b/homeassistant/components/apcupsd.py
new file mode 100644
index 00000000000..b7c22b3a7d9
--- /dev/null
+++ b/homeassistant/components/apcupsd.py
@@ -0,0 +1,84 @@
+"""
+homeassistant.components.apcupsd
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Sets up and provides access to the status output of APCUPSd via its Network
+Information Server (NIS).
+
+For more details about this component, please refer to the documentation at
+https://home-assistant.io/components/apcupsd/
+"""
+import logging
+from datetime import timedelta
+
+from homeassistant.util import Throttle
+
+DOMAIN = "apcupsd"
+REQUIREMENTS = ("apcaccess==0.0.4",)
+
+CONF_HOST = "host"
+CONF_PORT = "port"
+CONF_TYPE = "type"
+
+DEFAULT_HOST = "localhost"
+DEFAULT_PORT = 3551
+
+KEY_STATUS = "STATUS"
+
+VALUE_ONLINE = "ONLINE"
+
+MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
+
+DATA = None
+
+_LOGGER = logging.getLogger(__name__)
+
+
+def setup(hass, config):
+ """ Use config values to set up a function enabling status retrieval. """
+ global DATA
+
+ host = config[DOMAIN].get(CONF_HOST, DEFAULT_HOST)
+ port = config[DOMAIN].get(CONF_PORT, DEFAULT_PORT)
+
+ DATA = APCUPSdData(host, port)
+
+ # It doesn't really matter why we're not able to get the status, just that
+ # we can't.
+ # pylint: disable=broad-except
+ try:
+ DATA.update(no_throttle=True)
+ except Exception:
+ _LOGGER.exception("Failure while testing APCUPSd status retrieval.")
+ return False
+ return True
+
+
+class APCUPSdData(object):
+ """
+ Stores the data retrieved from APCUPSd for each entity to use, acts as the
+ single point responsible for fetching updates from the server.
+ """
+ def __init__(self, host, port):
+ from apcaccess import status
+ self._host = host
+ self._port = port
+ self._status = None
+ self._get = status.get
+ self._parse = status.parse
+
+ @property
+ def status(self):
+ """ Get latest update if throttle allows. Return status. """
+ self.update()
+ return self._status
+
+ def _get_status(self):
+ """ Get the status from APCUPSd and parse it into a dict. """
+ return self._parse(self._get(host=self._host, port=self._port))
+
+ @Throttle(MIN_TIME_BETWEEN_UPDATES)
+ def update(self, **kwargs):
+ """
+ Fetch the latest status from APCUPSd and store it in self._status.
+ """
+ self._status = self._get_status()
diff --git a/homeassistant/components/binary_sensor/apcupsd.py b/homeassistant/components/binary_sensor/apcupsd.py
new file mode 100644
index 00000000000..796a2a0df70
--- /dev/null
+++ b/homeassistant/components/binary_sensor/apcupsd.py
@@ -0,0 +1,44 @@
+"""
+homeassistant.components.binary_sensor.apcupsd
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Provides a binary sensor to track online status of a UPS.
+
+For more details about this platform, please refer to the documentation at
+https://home-assistant.io/components/binary_sensor.apcupsd/
+"""
+from homeassistant.components.binary_sensor import BinarySensorDevice
+from homeassistant.components import apcupsd
+
+DEPENDENCIES = [apcupsd.DOMAIN]
+DEFAULT_NAME = "UPS Online Status"
+
+
+def setup_platform(hass, config, add_entities, discovery_info=None):
+ """ Instantiate an OnlineStatus binary sensor entity and add it to HA. """
+ add_entities((OnlineStatus(config, apcupsd.DATA),))
+
+
+class OnlineStatus(BinarySensorDevice):
+ """ Binary sensor to represent UPS online status. """
+ def __init__(self, config, data):
+ self._config = config
+ self._data = data
+ self._state = None
+ self.update()
+
+ @property
+ def name(self):
+ """ The name of the UPS online status sensor. """
+ return self._config.get("name", DEFAULT_NAME)
+
+ @property
+ def is_on(self):
+ """ True if the UPS is online, else False. """
+ return self._state == apcupsd.VALUE_ONLINE
+
+ def update(self):
+ """
+ Get the status report from APCUPSd (or cache) and set this entity's
+ state.
+ """
+ self._state = self._data.status[apcupsd.KEY_STATUS]
diff --git a/homeassistant/components/binary_sensor/command_sensor.py b/homeassistant/components/binary_sensor/command_sensor.py
index 8798e457e71..d69417a6a73 100644
--- a/homeassistant/components/binary_sensor/command_sensor.py
+++ b/homeassistant/components/binary_sensor/command_sensor.py
@@ -1,8 +1,11 @@
"""
homeassistant.components.binary_sensor.command_sensor
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows to configure custom shell commands to turn a value
into a logical value for a binary sensor.
+
+For more details about this platform, please refer to the documentation at
+https://home-assistant.io/components/binary_sensor.command/
"""
import logging
from datetime import timedelta
diff --git a/homeassistant/components/binary_sensor/nest.py b/homeassistant/components/binary_sensor/nest.py
index 23925a1805b..0c250dcde67 100644
--- a/homeassistant/components/binary_sensor/nest.py
+++ b/homeassistant/components/binary_sensor/nest.py
@@ -13,10 +13,11 @@ import homeassistant.components.nest as nest
from homeassistant.components.sensor.nest import NestSensor
from homeassistant.components.binary_sensor import BinarySensorDevice
-
+DEPENDENCIES = ['nest']
BINARY_TYPES = ['fan',
'hvac_ac_state',
'hvac_aux_heater_state',
+ 'hvac_heater_state',
'hvac_heat_x2_state',
'hvac_heat_x3_state',
'hvac_alt_heat_state',
diff --git a/homeassistant/components/binary_sensor/rest.py b/homeassistant/components/binary_sensor/rest.py
index 4d82d25e473..1a592cd905a 100644
--- a/homeassistant/components/binary_sensor/rest.py
+++ b/homeassistant/components/binary_sensor/rest.py
@@ -21,7 +21,7 @@ DEFAULT_METHOD = 'GET'
# pylint: disable=unused-variable
def setup_platform(hass, config, add_devices, discovery_info=None):
- """Setup REST binary sensors."""
+ """ Setup REST binary sensors. """
resource = config.get('resource', None)
method = config.get('method', DEFAULT_METHOD)
payload = config.get('payload', None)
@@ -41,10 +41,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
# pylint: disable=too-many-arguments
class RestBinarySensor(BinarySensorDevice):
- """REST binary sensor."""
+ """ A REST binary sensor. """
def __init__(self, hass, rest, name, value_template):
- """Initialize a REST binary sensor."""
+ """ Initialize a REST binary sensor. """
self._hass = hass
self.rest = rest
self._name = name
@@ -54,12 +54,12 @@ class RestBinarySensor(BinarySensorDevice):
@property
def name(self):
- """Name of the binary sensor."""
+ """ Name of the binary sensor. """
return self._name
@property
def is_on(self):
- """Return if the binary sensor is on."""
+ """ Return if the binary sensor is on. """
if self.rest.data is None:
return False
@@ -69,5 +69,5 @@ class RestBinarySensor(BinarySensorDevice):
return bool(int(self.rest.data))
def update(self):
- """Get the latest data from REST API and updates the state."""
+ """ Get the latest data from REST API and updates the state. """
self.rest.update()
diff --git a/homeassistant/components/binary_sensor/zigbee.py b/homeassistant/components/binary_sensor/zigbee.py
index 72b2499b190..1597cd5004f 100644
--- a/homeassistant/components/binary_sensor/zigbee.py
+++ b/homeassistant/components/binary_sensor/zigbee.py
@@ -1,9 +1,11 @@
"""
homeassistant.components.binary_sensor.zigbee
-
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Contains functionality to use a ZigBee device as a binary sensor.
-"""
+For more details about this platform, please refer to the documentation at
+https://home-assistant.io/components/binary_sensor.zigbee/
+"""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.zigbee import (
ZigBeeDigitalIn, ZigBeeDigitalInConfig)
@@ -13,9 +15,7 @@ DEPENDENCIES = ["zigbee"]
def setup_platform(hass, config, add_entities, discovery_info=None):
- """
- Create and add an entity based on the configuration.
- """
+ """ Create and add an entity based on the configuration. """
add_entities([
ZigBeeBinarySensor(hass, ZigBeeDigitalInConfig(config))
])
diff --git a/homeassistant/components/bloomsky.py b/homeassistant/components/bloomsky.py
new file mode 100644
index 00000000000..fe2ae1cf3ba
--- /dev/null
+++ b/homeassistant/components/bloomsky.py
@@ -0,0 +1,77 @@
+"""
+homeassistant.components.bloomsky
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Support for BloomSky weather station.
+
+For more details about this component, please refer to the documentation at
+https://home-assistant.io/components/bloomsky/
+"""
+import logging
+from datetime import timedelta
+import requests
+from homeassistant.util import Throttle
+from homeassistant.helpers import validate_config
+from homeassistant.const import CONF_API_KEY
+
+DOMAIN = "bloomsky"
+BLOOMSKY = None
+
+_LOGGER = logging.getLogger(__name__)
+
+# The BloomSky only updates every 5-8 minutes as per the API spec so there's
+# no point in polling the API more frequently
+MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=300)
+
+
+# pylint: disable=unused-argument,too-few-public-methods
+def setup(hass, config):
+ """ Setup BloomSky component. """
+ if not validate_config(
+ config,
+ {DOMAIN: [CONF_API_KEY]},
+ _LOGGER):
+ return False
+
+ api_key = config[DOMAIN][CONF_API_KEY]
+
+ global BLOOMSKY
+ try:
+ BLOOMSKY = BloomSky(api_key)
+ except RuntimeError:
+ return False
+
+ return True
+
+
+class BloomSky(object):
+ """ Handle all communication with the BloomSky API. """
+
+ # API documentation at http://weatherlution.com/bloomsky-api/
+
+ API_URL = "https://api.bloomsky.com/api/skydata"
+
+ def __init__(self, api_key):
+ self._api_key = api_key
+ self.devices = {}
+ _LOGGER.debug("Initial bloomsky device load...")
+ self.refresh_devices()
+
+ @Throttle(MIN_TIME_BETWEEN_UPDATES)
+ def refresh_devices(self):
+ """
+ Uses the API to retreive a list of devices associated with an
+ account along with all the sensors on the device.
+ """
+ _LOGGER.debug("Fetching bloomsky update")
+ response = requests.get(self.API_URL,
+ headers={"Authorization": self._api_key},
+ timeout=10)
+ if response.status_code == 401:
+ raise RuntimeError("Invalid API_KEY")
+ elif response.status_code != 200:
+ _LOGGER.error("Invalid HTTP response: %s", response.status_code)
+ return
+ # create dictionary keyed off of the device unique id
+ self.devices.update({
+ device["DeviceID"]: device for device in response.json()
+ })
diff --git a/homeassistant/components/camera/__init__.py b/homeassistant/components/camera/__init__.py
index fc5c739c888..9aefe4b3b66 100644
--- a/homeassistant/components/camera/__init__.py
+++ b/homeassistant/components/camera/__init__.py
@@ -33,8 +33,6 @@ SWITCH_ACTION_SNAPSHOT = 'snapshot'
SERVICE_CAMERA = 'camera_service'
-STATE_RECORDING = 'recording'
-
DEFAULT_RECORDING_SECONDS = 30
# Maps discovered services to their platforms
@@ -46,6 +44,7 @@ DIR_DATETIME_FORMAT = '%Y-%m-%d_%H-%M-%S'
REC_DIR_PREFIX = 'recording-'
REC_IMG_PREFIX = 'recording_image-'
+STATE_RECORDING = 'recording'
STATE_STREAMING = 'streaming'
STATE_IDLE = 'idle'
@@ -121,33 +120,7 @@ def setup(hass, config):
try:
camera.is_streaming = True
camera.update_ha_state()
-
- handler.request.sendall(bytes('HTTP/1.1 200 OK\r\n', 'utf-8'))
- handler.request.sendall(bytes(
- 'Content-type: multipart/x-mixed-replace; \
- boundary=--jpgboundary\r\n\r\n', 'utf-8'))
- handler.request.sendall(bytes('--jpgboundary\r\n', 'utf-8'))
-
- # MJPEG_START_HEADER.format()
-
- while True:
- img_bytes = camera.camera_image()
- if img_bytes is None:
- continue
- headers_str = '\r\n'.join((
- 'Content-length: {}'.format(len(img_bytes)),
- 'Content-type: image/jpeg',
- )) + '\r\n\r\n'
-
- handler.request.sendall(
- bytes(headers_str, 'utf-8') +
- img_bytes +
- bytes('\r\n', 'utf-8'))
-
- handler.request.sendall(
- bytes('--jpgboundary\r\n', 'utf-8'))
-
- time.sleep(0.5)
+ camera.mjpeg_stream(handler)
except (requests.RequestException, IOError):
camera.is_streaming = False
@@ -190,6 +163,34 @@ class Camera(Entity):
""" Return bytes of camera image. """
raise NotImplementedError()
+ def mjpeg_stream(self, handler):
+ """ Generate an HTTP MJPEG stream from camera images. """
+ handler.request.sendall(bytes('HTTP/1.1 200 OK\r\n', 'utf-8'))
+ handler.request.sendall(bytes(
+ 'Content-type: multipart/x-mixed-replace; \
+ boundary=--jpgboundary\r\n\r\n', 'utf-8'))
+ handler.request.sendall(bytes('--jpgboundary\r\n', 'utf-8'))
+
+ # MJPEG_START_HEADER.format()
+ while True:
+ img_bytes = self.camera_image()
+ if img_bytes is None:
+ continue
+ headers_str = '\r\n'.join((
+ 'Content-length: {}'.format(len(img_bytes)),
+ 'Content-type: image/jpeg',
+ )) + '\r\n\r\n'
+
+ handler.request.sendall(
+ bytes(headers_str, 'utf-8') +
+ img_bytes +
+ bytes('\r\n', 'utf-8'))
+
+ handler.request.sendall(
+ bytes('--jpgboundary\r\n', 'utf-8'))
+
+ time.sleep(0.5)
+
@property
def state(self):
""" Returns the state of the entity. """
diff --git a/homeassistant/components/camera/bloomsky.py b/homeassistant/components/camera/bloomsky.py
new file mode 100644
index 00000000000..5c9314963bd
--- /dev/null
+++ b/homeassistant/components/camera/bloomsky.py
@@ -0,0 +1,60 @@
+"""
+homeassistant.components.camera.bloomsky
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Support for a camera of a BloomSky weather station.
+
+For more details about this component, please refer to the documentation at
+https://home-assistant.io/components/camera.bloomsky/
+"""
+import logging
+import requests
+import homeassistant.components.bloomsky as bloomsky
+from homeassistant.components.camera import Camera
+
+DEPENDENCIES = ["bloomsky"]
+
+
+# pylint: disable=unused-argument
+def setup_platform(hass, config, add_devices_callback, discovery_info=None):
+ """ set up access to BloomSky cameras """
+ for device in bloomsky.BLOOMSKY.devices.values():
+ add_devices_callback([BloomSkyCamera(bloomsky.BLOOMSKY, device)])
+
+
+class BloomSkyCamera(Camera):
+ """ Represents the images published from the BloomSky's camera. """
+
+ def __init__(self, bs, device):
+ """ set up for access to the BloomSky camera images """
+ super(BloomSkyCamera, self).__init__()
+ self._name = device["DeviceName"]
+ self._id = device["DeviceID"]
+ self._bloomsky = bs
+ self._url = ""
+ self._last_url = ""
+ # _last_image will store images as they are downloaded so that the
+ # frequent updates in home-assistant don't keep poking the server
+ # to download the same image over and over
+ self._last_image = ""
+ self._logger = logging.getLogger(__name__)
+
+ def camera_image(self):
+ """ Update the camera's image if it has changed. """
+ try:
+ self._url = self._bloomsky.devices[self._id]["Data"]["ImageURL"]
+ self._bloomsky.refresh_devices()
+ # if the url hasn't changed then the image hasn't changed
+ if self._url != self._last_url:
+ response = requests.get(self._url, timeout=10)
+ self._last_url = self._url
+ self._last_image = response.content
+ except requests.exceptions.RequestException as error:
+ self._logger.error("Error getting bloomsky image: %s", error)
+ return None
+
+ return self._last_image
+
+ @property
+ def name(self):
+ """ The name of this BloomSky device. """
+ return self._name
diff --git a/homeassistant/components/camera/mjpeg.py b/homeassistant/components/camera/mjpeg.py
index 0d59c8d60c7..7bbaa4846b5 100644
--- a/homeassistant/components/camera/mjpeg.py
+++ b/homeassistant/components/camera/mjpeg.py
@@ -14,6 +14,9 @@ from requests.auth import HTTPBasicAuth
from homeassistant.helpers import validate_config
from homeassistant.components.camera import DOMAIN, Camera
+from homeassistant.const import HTTP_OK
+
+CONTENT_TYPE_HEADER = 'Content-Type'
_LOGGER = logging.getLogger(__name__)
@@ -41,6 +44,17 @@ class MjpegCamera(Camera):
self._password = device_info.get('password')
self._mjpeg_url = device_info['mjpeg_url']
+ def camera_stream(self):
+ """ Return a mjpeg stream image response directly from the camera. """
+ if self._username and self._password:
+ return requests.get(self._mjpeg_url,
+ auth=HTTPBasicAuth(self._username,
+ self._password),
+ stream=True)
+ else:
+ return requests.get(self._mjpeg_url,
+ stream=True)
+
def camera_image(self):
""" Return a still image response from the camera. """
@@ -55,16 +69,22 @@ class MjpegCamera(Camera):
jpg = data[jpg_start:jpg_end + 2]
return jpg
- if self._username and self._password:
- with closing(requests.get(self._mjpeg_url,
- auth=HTTPBasicAuth(self._username,
- self._password),
- stream=True)) as response:
- return process_response(response)
- else:
- with closing(requests.get(self._mjpeg_url,
- stream=True)) as response:
- return process_response(response)
+ with closing(self.camera_stream()) as response:
+ return process_response(response)
+
+ def mjpeg_stream(self, handler):
+ """ Generate an HTTP MJPEG stream from the camera. """
+ response = self.camera_stream()
+ content_type = response.headers[CONTENT_TYPE_HEADER]
+
+ handler.send_response(HTTP_OK)
+ handler.send_header(CONTENT_TYPE_HEADER, content_type)
+ handler.end_headers()
+
+ for chunk in response.iter_content(chunk_size=1024):
+ if not chunk:
+ break
+ handler.wfile.write(chunk)
@property
def name(self):
diff --git a/homeassistant/components/camera/uvc.py b/homeassistant/components/camera/uvc.py
new file mode 100644
index 00000000000..eeb447be05a
--- /dev/null
+++ b/homeassistant/components/camera/uvc.py
@@ -0,0 +1,91 @@
+"""
+homeassistant.components.camera.uvc
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Support for Ubiquiti's UVC cameras.
+
+For more details about this platform, please refer to the documentation at
+https://home-assistant.io/components/camera.uvc/
+"""
+import logging
+import socket
+
+import requests
+
+from homeassistant.helpers import validate_config
+from homeassistant.components.camera import DOMAIN, Camera
+
+REQUIREMENTS = ['uvcclient==0.5']
+
+_LOGGER = logging.getLogger(__name__)
+
+
+def setup_platform(hass, config, add_devices, discovery_info=None):
+ """ Discover cameras on a Unifi NVR. """
+ if not validate_config({DOMAIN: config}, {DOMAIN: ['nvr', 'key']},
+ _LOGGER):
+ return None
+
+ addr = config.get('nvr')
+ port = int(config.get('port', 7080))
+ key = config.get('key')
+
+ from uvcclient import nvr
+ nvrconn = nvr.UVCRemote(addr, port, key)
+ try:
+ cameras = nvrconn.index()
+ except nvr.NotAuthorized:
+ _LOGGER.error('Authorization failure while connecting to NVR')
+ return False
+ except nvr.NvrError:
+ _LOGGER.error('NVR refuses to talk to me')
+ return False
+ except requests.exceptions.ConnectionError as ex:
+ _LOGGER.error('Unable to connect to NVR: %s', str(ex))
+ return False
+
+ for camera in cameras:
+ add_devices([UnifiVideoCamera(nvrconn,
+ camera['uuid'],
+ camera['name'])])
+
+
+class UnifiVideoCamera(Camera):
+ """ A Ubiquiti Unifi Video Camera. """
+
+ def __init__(self, nvr, uuid, name):
+ super(UnifiVideoCamera, self).__init__()
+ self._nvr = nvr
+ self._uuid = uuid
+ self._name = name
+ self.is_streaming = False
+
+ @property
+ def name(self):
+ return self._name
+
+ @property
+ def is_recording(self):
+ caminfo = self._nvr.get_camera(self._uuid)
+ return caminfo['recordingSettings']['fullTimeRecordEnabled']
+
+ def camera_image(self):
+ from uvcclient import camera as uvc_camera
+
+ caminfo = self._nvr.get_camera(self._uuid)
+ camera = None
+ for addr in [caminfo['host'], caminfo['internalHost']]:
+ try:
+ camera = uvc_camera.UVCCameraClient(addr,
+ caminfo['username'],
+ 'ubnt')
+ _LOGGER.debug('Logged into UVC camera %(name)s via %(addr)s',
+ dict(name=self._name, addr=addr))
+ except socket.error:
+ pass
+
+ if not camera:
+ _LOGGER.error('Unable to login to camera')
+ return None
+
+ camera.login()
+ return camera.get_snapshot()
diff --git a/homeassistant/components/configurator.py b/homeassistant/components/configurator.py
index 6fb584635f9..591cdc0dc61 100644
--- a/homeassistant/components/configurator.py
+++ b/homeassistant/components/configurator.py
@@ -141,7 +141,7 @@ class Configurator(object):
state = self.hass.states.get(entity_id)
- new_data = state.attributes
+ new_data = dict(state.attributes)
new_data[ATTR_ERRORS] = error
self.hass.states.set(entity_id, STATE_CONFIGURE, new_data)
diff --git a/homeassistant/components/demo.py b/homeassistant/components/demo.py
index 37f93c0625d..e63f5f49551 100644
--- a/homeassistant/components/demo.py
+++ b/homeassistant/components/demo.py
@@ -21,6 +21,7 @@ COMPONENTS_WITH_DEMO_PLATFORM = [
'binary_sensor',
'camera',
'device_tracker',
+ 'garage_door',
'light',
'lock',
'media_player',
diff --git a/homeassistant/components/device_tracker/aruba.py b/homeassistant/components/device_tracker/aruba.py
index 82183e1495c..6d94ad30d04 100644
--- a/homeassistant/components/device_tracker/aruba.py
+++ b/homeassistant/components/device_tracker/aruba.py
@@ -11,7 +11,6 @@ import logging
from datetime import timedelta
import re
import threading
-import telnetlib
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
from homeassistant.helpers import validate_config
@@ -21,6 +20,7 @@ from homeassistant.components.device_tracker import DOMAIN
# Return cached results if last scan was less then this time ago
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
+REQUIREMENTS = ['pexpect==4.0.1']
_LOGGER = logging.getLogger(__name__)
_DEVICES_REGEX = re.compile(
@@ -44,6 +44,7 @@ def get_scanner(hass, config):
class ArubaDeviceScanner(object):
""" This class queries a Aruba Acces Point for connected devices. """
+
def __init__(self, config):
self.host = config[CONF_HOST]
self.username = config[CONF_USERNAME]
@@ -93,23 +94,39 @@ class ArubaDeviceScanner(object):
def get_aruba_data(self):
""" Retrieve data from Aruba Access Point and return parsed result. """
- try:
- telnet = telnetlib.Telnet(self.host)
- telnet.read_until(b'User: ')
- telnet.write((self.username + '\r\n').encode('ascii'))
- telnet.read_until(b'Password: ')
- telnet.write((self.password + '\r\n').encode('ascii'))
- telnet.read_until(b'#')
- telnet.write(('show clients\r\n').encode('ascii'))
- devices_result = telnet.read_until(b'#').split(b'\r\n')
- telnet.write('exit\r\n'.encode('ascii'))
- except EOFError:
- _LOGGER.exception("Unexpected response from router")
+
+ import pexpect
+ connect = "ssh {}@{}"
+ ssh = pexpect.spawn(connect.format(self.username, self.host))
+ query = ssh.expect(['password:', pexpect.TIMEOUT, pexpect.EOF,
+ 'continue connecting (yes/no)?',
+ 'Host key verification failed.',
+ 'Connection refused',
+ 'Connection timed out'], timeout=120)
+ if query == 1:
+ _LOGGER.error("Timeout")
return
- except ConnectionRefusedError:
- _LOGGER.exception("Connection refused by router," +
- " is telnet enabled?")
+ elif query == 2:
+ _LOGGER.error("Unexpected response from router")
return
+ elif query == 3:
+ ssh.sendline('yes')
+ ssh.expect('password:')
+ elif query == 4:
+ _LOGGER.error("Host key Changed")
+ return
+ elif query == 5:
+ _LOGGER.error("Connection refused by server")
+ return
+ elif query == 6:
+ _LOGGER.error("Connection timed out")
+ return
+ ssh.sendline(self.password)
+ ssh.expect('#')
+ ssh.sendline('show clients')
+ ssh.expect('#')
+ devices_result = ssh.before.split(b'\r\n')
+ ssh.sendline('exit')
devices = {}
for device in devices_result:
@@ -119,5 +136,5 @@ class ArubaDeviceScanner(object):
'ip': match.group('ip'),
'mac': match.group('mac').upper(),
'name': match.group('name')
- }
+ }
return devices
diff --git a/homeassistant/components/device_tracker/owntracks.py b/homeassistant/components/device_tracker/owntracks.py
index 0a924126b11..2b8e612030b 100644
--- a/homeassistant/components/device_tracker/owntracks.py
+++ b/homeassistant/components/device_tracker/owntracks.py
@@ -95,7 +95,8 @@ def setup_scanner(hass, config, see):
MOBILE_BEACONS_ACTIVE[dev_id].append(location)
else:
# Normal region
- kwargs['location_name'] = location
+ if not zone.attributes.get('passive'):
+ kwargs['location_name'] = location
regions = REGIONS_ENTERED[dev_id]
if location not in regions:
@@ -115,7 +116,8 @@ def setup_scanner(hass, config, see):
if new_region:
# Exit to previous region
zone = hass.states.get("zone.{}".format(new_region))
- kwargs['location_name'] = new_region
+ if not zone.attributes.get('passive'):
+ kwargs['location_name'] = new_region
_set_gps_from_zone(kwargs, zone)
_LOGGER.info("Exit from to %s", new_region)
diff --git a/homeassistant/components/frontend/mdi_version.py b/homeassistant/components/frontend/mdi_version.py
index 4fa9a33b78c..90765572d2c 100644
--- a/homeassistant/components/frontend/mdi_version.py
+++ b/homeassistant/components/frontend/mdi_version.py
@@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by update_mdi script """
-VERSION = "a2605736c8d959d50c4bcbba1e6a6aa5"
+VERSION = "a1a203680639ff1abcc7b68cdb29c57a"
diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py
index ed2461d04a6..f207bcae379 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 = "1e89871aaae43c91b2508f52bc161b69"
+VERSION = "833d09737fec24f9219efae87c5bfd2a"
diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html
index 0a2643facff..09d82fce309 100644
--- a/homeassistant/components/frontend/www_static/frontend.html
+++ b/homeassistant/components/frontend/www_static/frontend.html
@@ -1,6 +1,7 @@
-
[[relativeTime]][[stateObj.entityDisplay]]
[[stateObj.stateDisplay]]
[[_charCounterStr]][[errorMessage]]
[[computePrimaryText(stateObj, isPlaying)]]
[[computeSecondaryText(stateObj)]]
[[computeTargetTemperature(stateObj)]]
Currently: [[stateObj.attributes.current_temperature]] [[stateObj.attributes.unit_of_measurement]]
[[stateObj.entityDisplay]]
To install Home Assistant, run:
pip3 install homeassistant
hass --open-ui
Here are some resources to get started.
To remove this card, edit your config in configuration.yaml
and disable the introduction
component. [[locationName]]
[[locationName]][[item.entityDisplay]]
[[computeTime(dateObj)]]No logbook entries found.Updating history data
No state history found.
History-[[value]]
[[relativeTime]][[stateObj.entityDisplay]]
[[stateObj.stateDisplay]]
[[computeTargetTemperature(stateObj)]]
Currently: [[stateObj.attributes.current_temperature]] [[stateObj.attributes.unit_of_measurement]]
[[computePrimaryText(stateObj, isPlaying)]]
[[computeSecondaryText(stateObj)]]
To install Home Assistant, run:
pip3 install homeassistant
hass --open-ui
Here are some resources to get started.
To remove this card, edit your config in configuration.yaml
and disable the introduction
component. [[locationName]]
[[locationName]][[item.entityDisplay]]
[[_charCounterStr]][[errorMessage]]
[[computeTime(dateObj)]]No logbook entries found.LogbookUpdating history data
No state history found.
History-
[[value]]
[[_text]]
[[_text]]
{{text}}{{text}}[[stateObj.attributes.description]]
[[stateObj.attributes.errors]]
[[submitCaption]]Configuring
[[stateObj.attributes.description]]
[[stateObj.attributes.errors]]
[[submitCaption]]Configuring
{{finalTranscript}} [[interimTranscript]] …
{{finalTranscript}} [[interimTranscript]] …
Home Assistant
Home Assistant
\ No newline at end of file
+value:function(t,e){if(0===this.__batchDepth){if(h.getOption(this.reactorState,"throwOnDispatchInDispatch")&&this.__isDispatching)throw this.__isDispatching=!1,new Error("Dispatch may not be called while a dispatch is in progress");this.__isDispatching=!0}try{this.reactorState=h.dispatch(this.reactorState,t,e)}catch(n){throw this.__isDispatching=!1,n}try{this.__notify()}finally{this.__isDispatching=!1}}},{key:"batch",value:function(t){this.batchStart(),t(),this.batchEnd()}},{key:"registerStore",value:function(t,e){console.warn("Deprecation warning: `registerStore` will no longer be supported in 1.1, use `registerStores` instead"),this.registerStores(o({},t,e))}},{key:"registerStores",value:function(t){this.reactorState=h.registerStores(this.reactorState,t),this.__notify()}},{key:"replaceStores",value:function(t){this.reactorState=h.replaceStores(this.reactorState,t)}},{key:"serialize",value:function(){return h.serialize(this.reactorState)}},{key:"loadState",value:function(t){this.reactorState=h.loadState(this.reactorState,t),this.__notify()}},{key:"reset",value:function(){var t=h.reset(this.reactorState);this.reactorState=t,this.prevReactorState=t,this.observerState=new m.ObserverState}},{key:"__notify",value:function(){var t=this;if(!(this.__batchDepth>0)){var e=this.reactorState.get("dirtyStores");if(0!==e.size){var n=c["default"].Set().withMutations(function(n){n.union(t.observerState.get("any")),e.forEach(function(e){var r=t.observerState.getIn(["stores",e]);r&&n.union(r)})});n.forEach(function(e){var n=t.observerState.getIn(["observersMap",e]);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 u=o.result,s=a.result;c["default"].is(u,s)||i.call(null,s)}});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 A({result:t,reactorState:e})}function o(t,e){return t.withMutations(function(t){(0,P.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,D.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,P.each)(e,function(e,n){t.update("stores",function(t){return t.set(n,e)})})})}function u(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){T["default"].dispatchStart(t,e,n),t.get("stores").forEach(function(o,a){var u=r.get(a),s=void 0;try{s=o.handle(u,e,n)}catch(c){throw T["default"].dispatchError(t,c.message),c}if(void 0===s&&l(t,"throwOnUndefinedStoreReturnValue")){var f="Store handler must return a value, did you forget a return statement";throw T["default"].dispatchError(t,f),new Error(f)}r.set(a,s),u!==s&&(i=i.add(a))}),T["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 s(t,e){var n=[],r=(0,D.toImmutable)({}).withMutations(function(r){(0,P.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=I["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,j.isKeyPath)(e)&&(e=(0,C.fromKeyPath)(e));var i=t.get("nextId"),o=(0,C.getStoreDeps)(e),a=I["default"].Map({id:i,storeDeps:o,getterKey:r,getter:e,handler:n}),u=void 0;return u=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,I["default"].Set()),t.updateIn(["stores",e],function(t){return t.add(i)})})}),u=u.set("nextId",i+1).setIn(["observersMap",i],a),{observerState:u,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,j.isKeyPath)(e)&&(0,j.isKeyPath)(r)?(0,j.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,D.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)}),v(t)})}function p(t,e){var n=t.get("state");if((0,j.isKeyPath)(e))return i(n.getIn(e),t);if(!(0,C.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,C.getDeps)(e).map(function(e){return p(t,e).result}),o=(0,C.getComputeFn)(e).apply(null,r);return i(o,b(t,e,o))}function _(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 v(t){return t.set("dirtyStores",I["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,C.getStoreDeps)(e),a=(0,D.toImmutable)({}).withMutations(function(e){o.forEach(function(n){var r=t.getIn(["storeStates",n]);e.set(n,r)})});return t.setIn(["cache",r],I["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=u,e.loadState=s,e.addObserver=c,e.getOption=l,e.removeObserver=f,e.removeObserverByEntry=d,e.reset=h,e.evaluate=p,e.serialize=_,e.resetDirtyStores=v;var M=n(3),I=r(M),E=n(9),T=r(E),D=n(5),C=n(10),j=n(11),P=n(4),A=I["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 u(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(u(t))}})});return e.union(n)}function s(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=u(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:u,getStoreDeps:c,getDeps:a,fromKeyPath:s},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,s.isArray)(t)&&!(0,s.isFunction)(t[t.length-1])}function o(t,e){var n=u["default"].List(t),r=u["default"].List(e);return u["default"].is(n,r)}Object.defineProperty(e,"__esModule",{value:!0}),e.isKeyPath=i,e.isEqual=o;var a=n(3),u=r(a),s=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 u=(0,r.Record)({any:(0,r.Set)(),stores:(0,r.Map)({}),observersMap:(0,r.Map)({}),nextId:1});e.ObserverState=u}])})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(124),u=r(a);e["default"]=(0,u["default"])(o["default"].reactor)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.callApi=void 0;var i=n(128),o=r(i);e.callApi=o["default"]},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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(77),n(37),e["default"]=new o["default"]({is:"state-info",properties:{stateObj:{type:Object}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({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){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0;var o=n(144),a=i(o),u=n(145),s=r(u);e.actions=a["default"],e.getters=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){t.registerStores({restApiCache:l["default"]})}function o(t){return[["restApiCache",t.entity],function(t){return!!t}]}function a(t){return[["restApiCache",t.entity],function(t){return t||(0,s.toImmutable)({})}]}function u(t){return function(e){return["restApiCache",t.entity,e]}}Object.defineProperty(e,"__esModule",{value:!0}),e.createApiActions=void 0,e.register=i,e.createHasDataGetter=o,e.createEntityMapGetter=a,e.createByIdGetter=u;var s=n(3),c=n(170),l=r(c),f=n(169),d=r(f);e.createApiActions=d["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i);e["default"]=(0,o["default"])({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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i);e["default"]=(0,o["default"])({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";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0;var o=n(171),a=i(o),u=n(53),s=r(u);e.actions=a["default"],e.getters=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i);e["default"]=(0,o["default"])({VALIDATING_AUTH_TOKEN:null,VALID_AUTH_TOKEN:null,INVALID_AUTH_TOKEN:null,LOG_OUT:null})},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({authAttempt:u["default"],authCurrent:c["default"],rememberAuth:f["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0,e.register=o;var a=n(131),u=i(a),s=n(132),c=i(s),l=n(133),f=i(l),d=n(129),h=r(d),p=n(130),_=r(p);e.actions=h,e.getters=_},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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 a(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 u=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&u["return"]&&u["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")}}(),s=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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"loading-box"})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(125),u=r(a);n(116),n(39),n(117),n(118),n(120),n(119),n(121),n(122),n(123),e["default"]=new o["default"]({is:"state-card-content",properties:{stateObj:{type:Object,observer:"stateObjChanged"}},stateObjChanged:function(t,e){var n=o["default"].dom(this);if(!t)return void(n.lastChild&&n.removeChild(n.lastChild));var r=(0,u["default"])(t);if(e&&(0,u["default"])(e)===r)n.lastChild.stateObj=t;else{n.lastChild&&n.removeChild(n.lastChild);var i=document.createElement("state-card-"+r);i.stateObj=t,n.appendChild(i)}}})},function(t,e){"use strict";function n(t,e){return t?e.map(function(e){return e in t.attributes?"has-"+e:""}).join(" "):""}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return u.evaluate(s.canToggleEntity(t))}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(2),a=r(o),u=a["default"].reactor,s=a["default"].serviceGetters},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(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"input_boolean":return"mdi:drawing";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+")"),a["default"]}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(40),a=r(o)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i);e["default"]=(0,o["default"])({SERVER_CONFIG_LOADED:null,COMPONENT_LOADED:null,LOG_OUT:null})},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({serverComponent:u["default"],serverConfig:c["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0,e.register=o;var a=n(136),u=i(a),s=n(137),c=i(s),l=n(134),f=r(l),d=n(135),h=r(d);e.actions=f,e.getters=h},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0;var o=n(148),a=i(o),u=n(149),s=r(u);e.actions=a["default"],e.getters=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i);e["default"]=(0,o["default"])({NAVIGATE:null,SHOW_SIDEBAR:null,LOG_OUT:null})},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({notifications:u["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0,e.register=o;var a=n(166),u=i(a),s=n(164),c=r(s),l=n(165),f=r(l);e.actions=c,e.getters=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i);e["default"]=(0,o["default"])({API_FETCH_SUCCESS:null,API_FETCH_START:null,API_FETCH_FAIL:null,API_SAVE_SUCCESS:null,API_SAVE_START:null,API_SAVE_FAIL:null,API_DELETE_SUCCESS:null,API_DELETE_START:null,API_DELETE_FAIL:null,LOG_OUT:null})},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({streamStatus:u["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0,e.register=o;var a=n(178),u=i(a),s=n(174),c=r(s),l=n(175),f=r(l);e.actions=c,e.getters=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i);e["default"]=(0,o["default"])({API_FETCH_ALL_START:null,API_FETCH_ALL_SUCCESS:null,API_FETCH_ALL_FAIL:null,SYNC_SCHEDULED:null,SYNC_SCHEDULE_CANCELLED:null})},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({isFetchingData:u["default"],isSyncScheduled:c["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0,e.register=o;var a=n(180),u=i(a),s=n(181),c=i(s),l=n(179),f=r(l),d=n(56),h=r(d);e.actions=f,e.getters=h},function(t,e){"use strict";function n(t){return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e){"use strict";function n(t){var e=t.split(" "),n=r(e,2),i=n[0],o=n[1],a=i.split(":"),u=r(a,3),s=u[0],c=u[1],l=u[2],f=o.split("-"),d=r(f,3),h=d[0],p=d[1],_=d[2];return new Date(Date.UTC(_,parseInt(p,10)-1,h,s,c,l))}var r=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&u["return"]&&u["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")}}();Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(22),u=r(a);e["default"]=new o["default"]({is:"domain-icon",properties:{domain:{type:String,value:""},state:{type:String,value:""}},computeIcon:function(t,e){return(0,u["default"])(t,e)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=o["default"].serviceActions;e["default"]=new u["default"]({is:"ha-entity-toggle",properties:{stateObj:{type:Object,observer:"stateObjChanged"},toggleChecked:{type:Boolean,value:!1}},ready:function(){this.forceStateChange()},toggleChanged:function(t){var e=t.target.checked,n=this._checkToggle(this.stateObj);e&&!n?this._call_service(!0):!e&&n&&this._call_service(!1)},stateObjChanged:function(t){t&&this.updateToggle(t)},updateToggle:function(t){this.toggleChecked=this._checkToggle(t)},forceStateChange:function(){var t=this._checkToggle(this.stateObj);this.toggleChecked===t&&(this.toggleChecked=!this.toggleChecked),this.toggleChecked=t},_checkToggle:function(t){return t&&"off"!==t.state&&"unlocked"!==t.state&&"closed"!==t.state},_call_service:function(t){var e=this,n=void 0,r=void 0;"lock"===this.stateObj.domain?(n="lock",r=t?"lock":"unlock"):"garage_door"===this.stateObj.domain?(n="garage_door",r=t?"open":"close"):(n="homeassistant",r=t?"turn_on":"turn_off"),s.callService(n,r,{entity_id:this.stateObj.entityId}).then(function(){return e.forceStateChange()})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"ha-card",properties:{header:{type:String},elevation:{type:Number,value:1,reflectToAttribute:!0}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(66),o=r(i),a=n(2),u=r(a),s=n(1),c=r(s),l=6e4,f=u["default"].util.parseDateTime;e["default"]=new c["default"]({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._interval=setInterval(this.updateRelative,l)},detached:function(){clearInterval(this._interval)},datetimeChanged:function(t){this.parsedDateTime=t?f(t):null,this.updateRelative()},datetimeObjChanged:function(t){this.parsedDateTime=t,this.updateRelative()},updateRelative:function(){this.relativeTime=this.parsedDateTime?(0,o["default"])(this.parsedDateTime).fromNow():""}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(18),n(87),n(86),e["default"]=new o["default"]({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(){return 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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),e["default"]=new o["default"]({is:"state-card-display",properties:{stateObj:{type:Object}}})},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]="bookmark"},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return(0,a["default"])(t).format("LT")}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(66),a=r(o)},function(t,e){"use strict";function n(){var t=document.getElementById("ha-init-skeleton");t&&t.parentElement.removeChild(t)}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t,e){a.validate(t,{rememberAuth:e,useStreaming:u.useStreaming})};var i=n(2),o=r(i),a=o["default"].authActions,u=o["default"].localStoragePreferences},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.recentEntityHistoryUpdatedMap=e.recentEntityHistoryMap=e.hasDataForCurrentDate=e.entityHistoryForCurrentDate=e.entityHistoryMap=e.currentDate=e.isLoadingEntityHistory=void 0;var r=n(3),i=(e.isLoadingEntityHistory=["isLoadingEntityHistory"],e.currentDate=["currentEntityHistoryDate"]),o=e.entityHistoryMap=["entityHistory"];e.entityHistoryForCurrentDate=[i,o,function(t,e){return e.get(t)||(0,r.toImmutable)({})}],e.hasDataForCurrentDate=[i,o,function(t,e){
+return!!e.get(t)}],e.recentEntityHistoryMap=["recentEntityHistory"],e.recentEntityHistoryUpdatedMap=["recentEntityHistory"]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({currentEntityHistoryDate:u["default"],entityHistory:c["default"],isLoadingEntityHistory:f["default"],recentEntityHistory:h["default"],recentEntityHistoryUpdated:_["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0,e.register=o;var a=n(139),u=i(a),s=n(140),c=i(s),l=n(141),f=i(l),d=n(142),h=i(d),p=n(143),_=i(p),v=n(138),y=r(v),m=n(44),g=r(m);e.actions=y,e.getters=g},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=function(){function t(t,e){for(var n=0;n6e4}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){function r(t,e,n){function r(){y&&clearTimeout(y),h&&clearTimeout(h),g=0,h=y=m=void 0}function s(e,n){n&&clearTimeout(n),h=y=m=void 0,e&&(g=o(),p=t.apply(v,d),y||h||(d=v=void 0))}function c(){var t=e-(o()-_);0>=t||t>e?s(m,h):y=setTimeout(c,t)}function l(){s(S,y)}function f(){if(d=arguments,_=o(),v=this,m=S&&(y||!w),b===!1)var n=w&&!y;else{h||w||(g=_);var r=b-(_-g),i=0>=r||r>b;i?(h&&(h=clearTimeout(h)),g=_,p=t.apply(v,d)):h||(h=setTimeout(l,r))}return i&&y?y=clearTimeout(y):y||e===b||(y=setTimeout(c,e)),n&&(i=!0,p=t.apply(v,d)),!i||y||h||(d=v=void 0),p}var d,h,p,_,v,y,m,g=0,b=!1,S=!0;if("function"!=typeof t)throw new TypeError(a);if(e=0>e?0:+e||0,n===!0){var w=!0;S=!1}else i(n)&&(w=!!n.leading,b="maxWait"in n&&u(+n.maxWait||0,e),S="trailing"in n?!!n.trailing:S);return f.cancel=r,f}var i=n(65),o=n(198),a="Expected a function",u=Math.max;t.exports=r},function(t,e,n){function r(t,e){var n=null==t?void 0:t[e];return i(n)?n:void 0}var i=n(201);t.exports=r},function(t,e){function n(t){return!!t&&"object"==typeof t}t.exports=n},function(t,e,n){function r(t){return i(t)&&u.call(t)==o}var i=n(65),o="[object Function]",a=Object.prototype,u=a.toString;t.exports=r},function(t,e){function n(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){(function(t){!function(e,n){t.exports=n()}(this,function(){"use strict";function e(){return Kn.apply(null,arguments)}function n(t){Kn=t}function r(t){return"[object Array]"===Object.prototype.toString.call(t)}function i(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function o(t,e){var n,r=[];for(n=0;n0)for(n in $n)r=$n[n],i=e[r],h(i)||(t[r]=i);return t}function _(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),Zn===!1&&(Zn=!0,e.updateOffset(this),Zn=!1)}function v(t){return t instanceof _||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(){}function S(t){return t?t.toLowerCase().replace("_","-"):t}function w(t){for(var e,n,r,i,o=0;o0;){if(r=O(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&g(i,n,!0)>=e-1)break;e--}o++}return null}function O(e){var n=null;if(!Xn[e]&&"undefined"!=typeof t&&t&&t.exports)try{n=Jn._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),M(n)}catch(r){}return Xn[e]}function M(t,e){var n;return t&&(n=h(e)?E(t):I(t,e),n&&(Jn=n)),Jn._abbr}function I(t,e){return null!==e?(e.abbr=t,Xn[t]=Xn[t]||new b,Xn[t].set(e),M(t),Xn[t]):(delete Xn[t],null)}function E(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Jn;if(!r(t)){if(e=O(t))return e;t=[t]}return w(t)}function T(t,e){var n=t.toLowerCase();Qn[n]=Qn[n+"s"]=Qn[e]=t}function D(t){return"string"==typeof t?Qn[t]||Qn[t.toLowerCase()]:void 0}function C(t){var e,n,r={};for(n in t)a(t,n)&&(e=D(n),e&&(r[e]=t[n]));return r}function j(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function P(t,n){return function(r){return null!=r?(k(this,t,r),e.updateOffset(this,n),this):A(this,t)}}function A(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function k(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function L(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=D(t),j(this[t]))return this[t](e);return this}function N(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 R(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(rr[t]=i),e&&(rr[e[0]]=function(){return N(i.apply(this,arguments),e[1],e[2])}),n&&(rr[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function x(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function H(t){var e,n,r=t.match(tr);for(e=0,n=r.length;n>e;e++)rr[r[e]]?r[e]=rr[r[e]]:r[e]=x(r[e]);return function(i){var o="";for(e=0;n>e;e++)o+=r[e]instanceof Function?r[e].call(i,t):r[e];return o}}function Y(t,e){return t.isValid()?(e=z(e,t.localeData()),nr[e]=nr[e]||H(e),nr[e](t)):t.localeData().invalidDate()}function z(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(er.lastIndex=0;r>=0&&er.test(t);)t=t.replace(er,n),er.lastIndex=0,r-=1;return t}function U(t,e,n){Sr[t]=j(e)?e:function(t,r){return t&&n?n:e}}function V(t,e){return a(Sr,t)?Sr[t](e._strict,e._locale):new RegExp(G(t))}function G(t){return F(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}))}function F(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function B(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++){if(i=s([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 X(t,e){var n;return t.isValid()?"string"==typeof e&&(e=t.localeData().monthsParse(e),"number"!=typeof e)?t:(n=Math.min(t.date(),K(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t):t}function Q(t){return null!=t?(X(this,t),e.updateOffset(this,!0),this):A(this,"Month")}function tt(){return K(this.year(),this.month())}function et(t){return this._monthsParseExact?(a(this,"_monthsRegex")||rt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function nt(t){return this._monthsParseExact?(a(this,"_monthsRegex")||rt.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function rt(){function t(t,e){return e.length-t.length}var e,n,r=[],i=[],o=[];for(e=0;12>e;e++)n=s([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]=F(r[e]),i[e]=F(i[e]),o[e]=F(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 it(t){var e,n=t._a;return n&&-2===l(t).overflow&&(e=n[Mr]<0||n[Mr]>11?Mr:n[Ir]<1||n[Ir]>K(n[Or],n[Mr])?Ir:n[Er]<0||n[Er]>24||24===n[Er]&&(0!==n[Tr]||0!==n[Dr]||0!==n[Cr])?Er:n[Tr]<0||n[Tr]>59?Tr:n[Dr]<0||n[Dr]>59?Dr:n[Cr]<0||n[Cr]>999?Cr:-1,l(t)._overflowDayOfYear&&(Or>e||e>Ir)&&(e=Ir),l(t)._overflowWeeks&&-1===e&&(e=jr),l(t)._overflowWeekday&&-1===e&&(e=Pr),l(t).overflow=e),t}function ot(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function at(t,e){var n=!0;return u(function(){return n&&(ot(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function ut(t,e){xr[t]||(ot(e),xr[t]=!0)}function st(t){var e,n,r,i,o,a,u=t._i,s=Hr.exec(u)||Yr.exec(u);if(s){for(l(t).iso=!0,e=0,n=Ur.length;n>e;e++)if(Ur[e][1].exec(s[1])){i=Ur[e][0],r=Ur[e][2]!==!1;break}if(null==i)return void(t._isValid=!1);if(s[3]){for(e=0,n=Vr.length;n>e;e++)if(Vr[e][1].exec(s[3])){o=(s[2]||" ")+Vr[e][0];break}if(null==o)return void(t._isValid=!1)}if(!r&&null!=o)return void(t._isValid=!1);if(s[4]){if(!zr.exec(s[4]))return void(t._isValid=!1);a="Z"}t._f=i+(o||"")+(a||""),Ot(t)}else t._isValid=!1}function ct(t){var n=Gr.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(st(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function lt(t,e,n,r,i,o,a){var u=new Date(t,e,n,r,i,o,a);return 100>t&&t>=0&&isFinite(u.getFullYear())&&u.setFullYear(t),u}function ft(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function dt(t){return ht(t)?366:365}function ht(t){return t%4===0&&t%100!==0||t%400===0}function pt(){return ht(this.year())}function _t(t,e,n){var r=7+e-n,i=(7+ft(t,0,r).getUTCDay()-e)%7;return-i+r-1}function vt(t,e,n,r,i){var o,a,u=(7+n-r)%7,s=_t(t,r,i),c=1+7*(e-1)+u+s;return 0>=c?(o=t-1,a=dt(o)+c):c>dt(t)?(o=t+1,a=c-dt(t)):(o=t,a=c),{year:o,dayOfYear:a}}function yt(t,e,n){var r,i,o=_t(t.year(),e,n),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return 1>a?(i=t.year()-1,r=a+mt(i,e,n)):a>mt(t.year(),e,n)?(r=a-mt(t.year(),e,n),i=t.year()+1):(i=t.year(),r=a),{week:r,year:i}}function mt(t,e,n){var r=_t(t,e,n),i=_t(t+1,e,n);return(dt(t)-r+i)/7}function gt(t,e,n){return null!=t?t:null!=e?e:n}function bt(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function St(t){var e,n,r,i,o=[];if(!t._d){for(r=bt(t),t._w&&null==t._a[Ir]&&null==t._a[Mr]&&wt(t),t._dayOfYear&&(i=gt(t._a[Or],r[Or]),t._dayOfYear>dt(i)&&(l(t)._overflowDayOfYear=!0),n=ft(i,0,t._dayOfYear),t._a[Mr]=n.getUTCMonth(),t._a[Ir]=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[Er]&&0===t._a[Tr]&&0===t._a[Dr]&&0===t._a[Cr]&&(t._nextDay=!0,t._a[Er]=0),t._d=(t._useUTC?ft:lt).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Er]=24)}}function wt(t){var e,n,r,i,o,a,u,s;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,a=4,n=gt(e.GG,t._a[Or],yt(Pt(),1,4).year),r=gt(e.W,1),i=gt(e.E,1),(1>i||i>7)&&(s=!0)):(o=t._locale._week.dow,a=t._locale._week.doy,n=gt(e.gg,t._a[Or],yt(Pt(),o,a).year),r=gt(e.w,1),null!=e.d?(i=e.d,(0>i||i>6)&&(s=!0)):null!=e.e?(i=e.e+o,(e.e<0||e.e>6)&&(s=!0)):i=o),1>r||r>mt(n,o,a)?l(t)._overflowWeeks=!0:null!=s?l(t)._overflowWeekday=!0:(u=vt(n,r,i,o,a),t._a[Or]=u.year,t._dayOfYear=u.dayOfYear)}function Ot(t){if(t._f===e.ISO_8601)return void st(t);t._a=[],l(t).empty=!0;var n,r,i,o,a,u=""+t._i,s=u.length,c=0;for(i=z(t._f,t._locale).match(tr)||[],n=0;n0&&l(t).unusedInput.push(a),u=u.slice(u.indexOf(r)+r.length),c+=r.length),rr[o]?(r?l(t).empty=!1:l(t).unusedTokens.push(o),q(o,r,t)):t._strict&&!r&&l(t).unusedTokens.push(o);l(t).charsLeftOver=s-c,u.length>0&&l(t).unusedInput.push(u),l(t).bigHour===!0&&t._a[Er]<=12&&t._a[Er]>0&&(l(t).bigHour=void 0),t._a[Er]=Mt(t._locale,t._a[Er],t._meridiem),St(t),it(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 It(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));u(t,n||e)}function Et(t){if(!t._d){var e=C(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)}),St(t)}}function Tt(t){var e=new _(it(Dt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Dt(t){var e=t._i,n=t._f;return t._locale=t._locale||E(t._l),null===e||void 0===n&&""===e?d({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),v(e)?new _(it(e)):(r(n)?It(t):n?Ot(t):i(e)?t._d=e:Ct(t),f(t)||(t._d=null),t))}function Ct(t){var n=t._i;void 0===n?t._d=new Date(e.now()):i(n)?t._d=new Date(+n):"string"==typeof n?ct(t):r(n)?(t._a=o(n.slice(0),function(t){return parseInt(t,10)}),St(t)):"object"==typeof n?Et(t):"number"==typeof n?t._d=new Date(n):e.createFromInputFallback(t)}function jt(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,Tt(o)}function Pt(t,e,n,r){return jt(t,e,n,r,!1)}function At(t,e){var n,i;if(1===e.length&&r(e[0])&&(e=e[0]),!e.length)return Pt();for(n=e[0],i=1;it&&(t=-t,n="-"),n+N(~~(t/60),2)+e+N(~~t%60,2)})}function Ht(t,e){var n=(e||"").match(t)||[],r=n[n.length-1]||[],i=(r+"").match(Kr)||["-",0,0],o=+(60*i[1])+m(i[2]);return"+"===i[0]?o:-o}function Yt(t,n){var r,o;return n._isUTC?(r=n.clone(),o=(v(t)||i(t)?+t:+Pt(t))-+r,r._d.setTime(+r._d+o),e.updateOffset(r,!1),r):Pt(t).local()}function zt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ut(t,n){var r,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Ht(mr,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(r=zt(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!n||this._changeInProgress?re(this,Xt(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:zt(this):null!=t?this:NaN}function Vt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Gt(t){return this.utcOffset(0,t)}function Ft(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(zt(this),"m")),this}function Bt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ht(yr,this._i)),this}function Wt(t){return this.isValid()?(t=t?Pt(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 Kt(){if(!h(this._isDSTShifted))return this._isDSTShifted;var t={};if(p(t,this),t=Dt(t),t._a){var e=t._isUTC?s(t._a):Pt(t._a);this._isDSTShifted=this.isValid()&&g(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Jt(){return this.isValid()?!this._isUTC:!1}function $t(){return this.isValid()?this._isUTC:!1}function Zt(){return this.isValid()?this._isUTC&&0===this._offset:!1}function Xt(t,e){var n,r,i,o=t,u=null;return Rt(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(o={},e?o[e]=t:o.milliseconds=t):(u=Jr.exec(t))?(n="-"===u[1]?-1:1,o={y:0,d:m(u[Ir])*n,h:m(u[Er])*n,m:m(u[Tr])*n,s:m(u[Dr])*n,ms:m(u[Cr])*n}):(u=$r.exec(t))?(n="-"===u[1]?-1:1,o={y:Qt(u[2],n),M:Qt(u[3],n),d:Qt(u[4],n),h:Qt(u[5],n),m:Qt(u[6],n),s:Qt(u[7],n),w:Qt(u[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(i=ee(Pt(o.from),Pt(o.to)),o={},o.ms=i.milliseconds,o.M=i.months),r=new Nt(o),Rt(t)&&a(t,"_locale")&&(r._locale=t._locale),r}function Qt(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function te(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 ee(t,e){var n;return t.isValid()&&e.isValid()?(e=Yt(e,t),t.isBefore(e)?n=te(t,e):(n=te(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ne(t,e){return function(n,r){var i,o;return null===r||isNaN(+r)||(ut(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=Xt(n,r),re(this,i,t),this}}function re(t,n,r,i){var o=n._milliseconds,a=n._days,u=n._months;t.isValid()&&(i=null==i?!0:i,o&&t._d.setTime(+t._d+o*r),a&&k(t,"Date",A(t,"Date")+a*r),u&&X(t,A(t,"Month")+u*r),i&&e.updateOffset(t,a||u))}function ie(t,e){var n=t||Pt(),r=Yt(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&&(j(e[o])?e[o]():e[o]);return this.format(a||this.localeData().calendar(o,this,Pt(n)))}function oe(){return new _(this)}function ae(t,e){var n=v(t)?t:Pt(t);return this.isValid()&&n.isValid()?(e=D(h(e)?"millisecond":e),"millisecond"===e?+this>+n:+n<+this.clone().startOf(e)):!1}function ue(t,e){var n=v(t)?t:Pt(t);return this.isValid()&&n.isValid()?(e=D(h(e)?"millisecond":e),"millisecond"===e?+n>+this:+this.clone().endOf(e)<+n):!1}function se(t,e,n){return this.isAfter(t,n)&&this.isBefore(e,n)}function ce(t,e){var n,r=v(t)?t:Pt(t);return this.isValid()&&r.isValid()?(e=D(e||"millisecond"),"millisecond"===e?+this===+r:(n=+r,+this.clone().startOf(e)<=n&&n<=+this.clone().endOf(e))):!1}function le(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function fe(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function de(t,e,n){var r,i,o,a;return this.isValid()?(r=Yt(t,this),r.isValid()?(i=6e4*(r.utcOffset()-this.utcOffset()),e=D(e),"year"===e||"month"===e||"quarter"===e?(a=he(this,r),"quarter"===e?a/=3:"year"===e&&(a/=12)):(o=this-r,a="second"===e?o/1e3:"minute"===e?o/6e4:"hour"===e?o/36e5:"day"===e?(o-i)/864e5:"week"===e?(o-i)/6048e5:o),n?a:y(a)):NaN):NaN}function he(t,e){var n,r,i=12*(e.year()-t.year())+(e.month()-t.month()),o=t.clone().add(i,"months");return 0>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)}function pe(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function _e(){var t=this.clone().utc();return 0o&&(e=o),Ue.call(this,t,e,n,r,i))}function Ue(t,e,n,r,i){var o=vt(t,e,n,r,i),a=ft(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Ve(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ge(t){return yt(t,this._week.dow,this._week.doy).week}function Fe(){return this._week.dow}function Be(){return this._week.doy}function We(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function qe(t){var e=yt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Ke(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Je(t,e){return r(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function $e(t){return this._weekdaysShort[t.day()]}function Ze(t){return this._weekdaysMin[t.day()]}function Xe(t,e,n){var r,i,o;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;7>r;r++){if(i=Pt([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 Qe(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ke(t,this.localeData()),this.add(t-e,"d")):e}function tn(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 en(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN}function nn(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 rn(){return this.hours()%12||12}function on(t,e){R(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function an(t,e){return e._meridiemParse}function un(t){return"p"===(t+"").toLowerCase().charAt(0)}function sn(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function cn(t,e){e[Cr]=m(1e3*("0."+t))}function ln(){return this._isUTC?"UTC":""}function fn(){return this._isUTC?"Coordinated Universal Time":""}function dn(t){return Pt(1e3*t)}function hn(){return Pt.apply(null,arguments).parseZone()}function pn(t,e,n){var r=this._calendar[t];return j(r)?r.call(e,n):r}function _n(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 vn(){return this._invalidDate}function yn(t){return this._ordinal.replace("%d",t)}function mn(t){return t}function gn(t,e,n,r){var i=this._relativeTime[n];return j(i)?i(t,e,n,r):i.replace(/%d/i,t)}function bn(t,e){var n=this._relativeTime[t>0?"future":"past"];return j(n)?n(e):n.replace(/%s/i,e)}function Sn(t){var e,n;for(n in t)e=t[n],j(e)?this[n]=e:this["_"+n]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function wn(t,e,n,r){var i=E(),o=s().set(r,e);return i[n](o,t)}function On(t,e,n,r,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return wn(t,e,n,i);var o,a=[];for(o=0;r>o;o++)a[o]=wn(t,o,n,i);return a}function Mn(t,e){return On(t,e,"months",12,"month")}function In(t,e){return On(t,e,"monthsShort",12,"month")}function En(t,e){return On(t,e,"weekdays",7,"day")}function Tn(t,e){return On(t,e,"weekdaysShort",7,"day")}function Dn(t,e){return On(t,e,"weekdaysMin",7,"day")}function Cn(){var t=this._data;return this._milliseconds=bi(this._milliseconds),this._days=bi(this._days),this._months=bi(this._months),t.milliseconds=bi(t.milliseconds),t.seconds=bi(t.seconds),t.minutes=bi(t.minutes),t.hours=bi(t.hours),t.months=bi(t.months),t.years=bi(t.years),this}function jn(t,e,n,r){var i=Xt(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Pn(t,e){return jn(this,t,e,1)}function An(t,e){return jn(this,t,e,-1)}function kn(t){return 0>t?Math.floor(t):Math.ceil(t)}function Ln(){var t,e,n,r,i,o=this._milliseconds,a=this._days,u=this._months,s=this._data;return o>=0&&a>=0&&u>=0||0>=o&&0>=a&&0>=u||(o+=864e5*kn(Rn(u)+a),a=0,u=0),s.milliseconds=o%1e3,t=y(o/1e3),s.seconds=t%60,e=y(t/60),s.minutes=e%60,n=y(e/60),s.hours=n%24,a+=y(n/24),i=y(Nn(a)),u+=i,a-=kn(Rn(i)),r=y(u/12),u%=12,s.days=a,s.months=u,s.years=r,this}function Nn(t){return 4800*t/146097}function Rn(t){return 146097*t/4800}function xn(t){var e,n,r=this._milliseconds;if(t=D(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+Nn(e),"month"===t?n:n/12;switch(e=this._days+Math.round(Rn(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 Hn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*m(this._months/12)}function Yn(t){return function(){return this.as(t)}}function zn(t){return t=D(t),this[t+"s"]()}function Un(t){return function(){return this._data[t]}}function Vn(){return y(this.days()/7)}function Gn(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function Fn(t,e,n){var r=Xt(t).abs(),i=Ri(r.as("s")),o=Ri(r.as("m")),a=Ri(r.as("h")),u=Ri(r.as("d")),s=Ri(r.as("M")),c=Ri(r.as("y")),l=i=o&&["m"]||o=a&&["h"]||a=u&&["d"]||u=s&&["M"]||s=c&&["y"]||["yy",c];return l[2]=e,l[3]=+t>0,l[4]=n,Gn.apply(null,l)}function Bn(t,e){return void 0===xi[t]?!1:void 0===e?xi[t]:(xi[t]=e,!0)}function Wn(t){var e=this.localeData(),n=Fn(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function qn(){var t,e,n,r=Hi(this._milliseconds)/1e3,i=Hi(this._days),o=Hi(this._months);t=y(r/60),e=y(t/60),r%=60,t%=60,n=y(o/12),o%=12;var a=n,u=o,s=i,c=e,l=t,f=r,d=this.asSeconds();return d?(0>d?"-":"")+"P"+(a?a+"Y":"")+(u?u+"M":"")+(s?s+"D":"")+(c||l||f?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(f?f+"S":""):"P0D"}var Kn,Jn,$n=e.momentProperties=[],Zn=!1,Xn={},Qn={},tr=/(\[[^\[]*\])|(\\)?([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?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,er=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,nr={},rr={},ir=/\d/,or=/\d\d/,ar=/\d{3}/,ur=/\d{4}/,sr=/[+-]?\d{6}/,cr=/\d\d?/,lr=/\d\d\d\d?/,fr=/\d\d\d\d\d\d?/,dr=/\d{1,3}/,hr=/\d{1,4}/,pr=/[+-]?\d{1,6}/,_r=/\d+/,vr=/[+-]?\d+/,yr=/Z|[+-]\d\d:?\d\d/gi,mr=/Z|[+-]\d\d(?::?\d\d)?/gi,gr=/[+-]?\d+(\.\d{1,3})?/,br=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Sr={},wr={},Or=0,Mr=1,Ir=2,Er=3,Tr=4,Dr=5,Cr=6,jr=7,Pr=8;R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),R("MMMM",0,0,function(t){return this.localeData().months(this,t)}),T("month","M"),U("M",cr),U("MM",cr,or),U("MMM",function(t,e){return e.monthsShortRegex(t)}),U("MMMM",function(t,e){return e.monthsRegex(t)}),B(["M","MM"],function(t,e){e[Mr]=m(t)-1}),B(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);null!=i?e[Mr]=i:l(n).invalidMonth=t});var Ar=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,kr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Lr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Nr=br,Rr=br,xr={};e.suppressDeprecationWarnings=!1;var Hr=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Yr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,zr=/Z|[+-]\d\d(?::?\d\d)?/,Ur=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Vr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Gr=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=at("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),R("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),T("year","y"),U("Y",vr),U("YY",cr,or),U("YYYY",hr,ur),U("YYYYY",pr,sr),U("YYYYYY",pr,sr),B(["YYYYY","YYYYYY"],Or),B("YYYY",function(t,n){n[Or]=2===t.length?e.parseTwoDigitYear(t):m(t)}),B("YY",function(t,n){n[Or]=e.parseTwoDigitYear(t)}),B("Y",function(t,e){e[Or]=parseInt(t,10)}),e.parseTwoDigitYear=function(t){return m(t)+(m(t)>68?1900:2e3)};var Fr=P("FullYear",!1);e.ISO_8601=function(){};var Br=at("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Pt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:d()}),Wr=at("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Pt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:d()}),qr=function(){return Date.now?Date.now():+new Date};xt("Z",":"),xt("ZZ",""),U("Z",mr),U("ZZ",mr),B(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Ht(mr,t)});var Kr=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Jr=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,$r=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Xt.fn=Nt.prototype;var Zr=ne(1,"add"),Xr=ne(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Qr=at("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)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ne("gggg","weekYear"),Ne("ggggg","weekYear"),Ne("GGGG","isoWeekYear"),Ne("GGGGG","isoWeekYear"),T("weekYear","gg"),T("isoWeekYear","GG"),U("G",vr),U("g",vr),U("GG",cr,or),U("gg",cr,or),U("GGGG",hr,ur),U("gggg",hr,ur),U("GGGGG",pr,sr),U("ggggg",pr,sr),W(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=m(t)}),W(["gg","GG"],function(t,n,r,i){n[i]=e.parseTwoDigitYear(t)}),R("Q",0,"Qo","quarter"),T("quarter","Q"),U("Q",ir),B("Q",function(t,e){e[Mr]=3*(m(t)-1)}),R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),T("week","w"),T("isoWeek","W"),U("w",cr),U("ww",cr,or),U("W",cr),U("WW",cr,or),W(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=m(t)});var ti={dow:0,doy:6};R("D",["DD",2],"Do","date"),T("date","D"),U("D",cr),U("DD",cr,or),U("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),B(["D","DD"],Ir),B("Do",function(t,e){e[Ir]=m(t.match(cr)[0],10)});var ei=P("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),R("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),R("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),T("day","d"),T("weekday","e"),T("isoWeekday","E"),U("d",cr),U("e",cr),U("E",cr),U("dd",br),U("ddd",br),U("dddd",br),W(["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}),W(["d","e","E"],function(t,e,n,r){e[r]=m(t)});var ni="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ri="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ii="Su_Mo_Tu_We_Th_Fr_Sa".split("_");R("DDD",["DDDD",3],"DDDo","dayOfYear"),T("dayOfYear","DDD"),U("DDD",dr),U("DDDD",ar),B(["DDD","DDDD"],function(t,e,n){n._dayOfYear=m(t)}),R("H",["HH",2],0,"hour"),R("h",["hh",2],0,rn),R("hmm",0,0,function(){return""+rn.apply(this)+N(this.minutes(),2)}),R("hmmss",0,0,function(){return""+rn.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+N(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)}),on("a",!0),on("A",!1),T("hour","h"),U("a",an),U("A",an),U("H",cr),U("h",cr),U("HH",cr,or),U("hh",cr,or),U("hmm",lr),U("hmmss",fr),U("Hmm",lr),U("Hmmss",fr),B(["H","HH"],Er),B(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),B(["h","hh"],function(t,e,n){e[Er]=m(t),l(n).bigHour=!0}),B("hmm",function(t,e,n){var r=t.length-2;e[Er]=m(t.substr(0,r)),e[Tr]=m(t.substr(r)),l(n).bigHour=!0}),B("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Er]=m(t.substr(0,r)),e[Tr]=m(t.substr(r,2)),e[Dr]=m(t.substr(i)),l(n).bigHour=!0}),B("Hmm",function(t,e,n){var r=t.length-2;e[Er]=m(t.substr(0,r)),e[Tr]=m(t.substr(r))}),B("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Er]=m(t.substr(0,r)),e[Tr]=m(t.substr(r,2)),e[Dr]=m(t.substr(i))});var oi=/[ap]\.?m?\.?/i,ai=P("Hours",!0);R("m",["mm",2],0,"minute"),T("minute","m"),U("m",cr),U("mm",cr,or),B(["m","mm"],Tr);var ui=P("Minutes",!1);R("s",["ss",2],0,"second"),T("second","s"),U("s",cr),U("ss",cr,or),B(["s","ss"],Dr);var si=P("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),T("millisecond","ms"),U("S",dr,ir),U("SS",dr,or),U("SSS",dr,ar);var ci;for(ci="SSSS";ci.length<=9;ci+="S")U(ci,_r);for(ci="S";ci.length<=9;ci+="S")B(ci,cn);var li=P("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var fi=_.prototype;fi.add=Zr,fi.calendar=ie,fi.clone=oe,fi.diff=de,fi.endOf=Me,fi.format=ve,fi.from=ye,fi.fromNow=me,fi.to=ge,fi.toNow=be,fi.get=L,fi.invalidAt=ke,fi.isAfter=ae,fi.isBefore=ue,fi.isBetween=se,fi.isSame=ce,fi.isSameOrAfter=le,fi.isSameOrBefore=fe,fi.isValid=Pe,fi.lang=Qr,fi.locale=Se,fi.localeData=we,fi.max=Wr,fi.min=Br,fi.parsingFlags=Ae,fi.set=L,fi.startOf=Oe,fi.subtract=Xr,fi.toArray=De,fi.toObject=Ce,fi.toDate=Te,fi.toISOString=_e,fi.toJSON=je,fi.toString=pe,fi.unix=Ee,fi.valueOf=Ie,fi.creationData=Le,fi.year=Fr,fi.isLeapYear=pt,fi.weekYear=Re,fi.isoWeekYear=xe,fi.quarter=fi.quarters=Ve,fi.month=Q,fi.daysInMonth=tt,fi.week=fi.weeks=We,fi.isoWeek=fi.isoWeeks=qe,fi.weeksInYear=Ye,fi.isoWeeksInYear=He,fi.date=ei,fi.day=fi.days=Qe,fi.weekday=tn,fi.isoWeekday=en,fi.dayOfYear=nn,fi.hour=fi.hours=ai,fi.minute=fi.minutes=ui,fi.second=fi.seconds=si,fi.millisecond=fi.milliseconds=li,fi.utcOffset=Ut,fi.utc=Gt,fi.local=Ft,fi.parseZone=Bt,fi.hasAlignedHourOffset=Wt,fi.isDST=qt,fi.isDSTShifted=Kt,fi.isLocal=Jt,fi.isUtcOffset=$t,fi.isUtc=Zt,fi.isUTC=Zt,fi.zoneAbbr=ln,fi.zoneName=fn,fi.dates=at("dates accessor is deprecated. Use date instead.",ei),fi.months=at("months accessor is deprecated. Use month instead",Q),fi.years=at("years accessor is deprecated. Use year instead",Fr),fi.zone=at("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Vt);var di=fi,hi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},pi={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"},_i="Invalid date",vi="%d",yi=/\d{1,2}/,mi={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"},gi=b.prototype;gi._calendar=hi,gi.calendar=pn,gi._longDateFormat=pi,gi.longDateFormat=_n,gi._invalidDate=_i,gi.invalidDate=vn,gi._ordinal=vi,gi.ordinal=yn,gi._ordinalParse=yi,gi.preparse=mn,gi.postformat=mn,gi._relativeTime=mi,gi.relativeTime=gn,gi.pastFuture=bn,gi.set=Sn,gi.months=J,gi._months=kr,gi.monthsShort=$,gi._monthsShort=Lr,gi.monthsParse=Z,gi._monthsRegex=Rr,gi.monthsRegex=nt,gi._monthsShortRegex=Nr,gi.monthsShortRegex=et,gi.week=Ge,gi._week=ti,gi.firstDayOfYear=Be,gi.firstDayOfWeek=Fe,gi.weekdays=Je,gi._weekdays=ni,gi.weekdaysMin=Ze,gi._weekdaysMin=ii,gi.weekdaysShort=$e,gi._weekdaysShort=ri,gi.weekdaysParse=Xe,gi.isPM=un,gi._meridiemParse=oi,gi.meridiem=sn,M("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=at("moment.lang is deprecated. Use moment.locale instead.",M),e.langData=at("moment.langData is deprecated. Use moment.localeData instead.",E);var bi=Math.abs,Si=Yn("ms"),wi=Yn("s"),Oi=Yn("m"),Mi=Yn("h"),Ii=Yn("d"),Ei=Yn("w"),Ti=Yn("M"),Di=Yn("y"),Ci=Un("milliseconds"),ji=Un("seconds"),Pi=Un("minutes"),Ai=Un("hours"),ki=Un("days"),Li=Un("months"),Ni=Un("years"),Ri=Math.round,xi={s:45,m:45,h:22,d:26,M:11},Hi=Math.abs,Yi=Nt.prototype;Yi.abs=Cn,Yi.add=Pn,Yi.subtract=An,Yi.as=xn,Yi.asMilliseconds=Si,Yi.asSeconds=wi,Yi.asMinutes=Oi,Yi.asHours=Mi,Yi.asDays=Ii,Yi.asWeeks=Ei,Yi.asMonths=Ti,Yi.asYears=Di,Yi.valueOf=Hn,Yi._bubble=Ln,Yi.get=zn,Yi.milliseconds=Ci,Yi.seconds=ji,Yi.minutes=Pi,Yi.hours=Ai,Yi.days=ki,Yi.weeks=Vn,Yi.months=Li,Yi.years=Ni,Yi.humanize=Wn,Yi.toISOString=qn,Yi.toString=qn,Yi.toJSON=qn,Yi.locale=Se,Yi.localeData=we,Yi.toIsoString=at("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",qn),Yi.lang=Qr,R("X",0,0,"unix"),R("x",0,0,"valueOf"),U("x",vr),U("X",gr),B("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),B("x",function(t,e,n){n._d=new Date(m(t))}),e.version="2.11.2",n(Pt),e.fn=di,e.min=kt,e.max=Lt,e.now=qr,e.utc=s,e.unix=dn,e.months=Mn,e.isDate=i,e.locale=M,e.invalid=d,e.duration=Xt,e.isMoment=v,e.weekdays=En,e.parseZone=hn,e.localeData=E,e.isDuration=Rt,e.monthsShort=In,e.weekdaysMin=Dn,e.defineLocale=I,e.weekdaysShort=Tn,e.normalizeUnits=D,e.relativeTimeThreshold=Bn,e.prototype=di;var zi=e;return zi})}).call(e,n(67)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=n(167),u=n(192),s=i(u),c=n(194),l=i(c),f=n(196),d=i(f),h=n(15),p=r(h),_=n(24),v=r(_),y=n(9),m=r(y),g=n(45),b=r(g),S=n(147),w=r(S),O=n(25),M=r(O),I=n(152),E=r(I),T=n(48),D=r(T),C=n(51),j=r(C),P=n(27),A=r(P),k=n(58),L=r(k),N=n(13),R=r(N),x=n(29),H=r(x),Y=n(31),z=r(Y),U=n(183),V=r(U),G=n(189),F=r(G),B=n(10),W=r(B),q=function K(){o(this,K);var t=(0,s["default"])();Object.defineProperties(this,{demo:{value:!1,enumerable:!0},localStoragePreferences:{value:a.localStoragePreferences,enumerable:!0},reactor:{value:t,enumerable:!0},util:{value:d["default"],enumerable:!0},startLocalStoragePreferencesSync:{value:a.localStoragePreferences.startSync.bind(a.localStoragePreferences,t)},startUrlSync:{value:j.urlSync.startSync.bind(null,t)},stopUrlSync:{value:j.urlSync.stopSync.bind(null,t)}}),(0,l["default"])(this,t,{auth:p,config:v,entity:m,entityHistory:b,errorLog:w,event:M,logbook:E,moreInfo:D,navigation:j,notification:A,view:L,service:R,stream:H,sync:z,template:V,voice:F,restApi:W})};e["default"]=q},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(76),e["default"]=new o["default"]({is:"ha-badges-card",properties:{states:{type:Array}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(21),c=r(s);n(36),n(35),n(19);var l=u["default"].moreInfoActions;e["default"]=new o["default"]({is:"ha-domain-card",properties:{domain:{type:String},states:{type:Array},groupEntity:{type:Object}},computeDomainTitle:function(t){return t.replace(/_/g," ")},entityTapped:function(t){if(!t.target.classList.contains("paper-toggle-button")&&!t.target.classList.contains("paper-icon-button")){t.stopPropagation();var e=t.model.item.entityId;this.async(function(){return l.selectEntity(e)},1)}},showGroupToggle:function(t,e){return!t||!e||"on"!==t.state&&"off"!==t.state?!1:e.reduce(function(t,e){return t+(0,c["default"])(e.entityId)},0)>1}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(36),e["default"]=new o["default"]({is:"ha-introduction-card",properties:{showInstallInstruction:{type:Boolean,value:!1},showHideInstruction:{type:Boolean,value:!0}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(41),u=r(a);e["default"]=new o["default"]({is:"display-time",properties:{dateObj:{type:Object}},computeTime:function(t){return t?(0,u["default"])(t):""}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].entityGetters;e["default"]=new u["default"]({is:"entity-list",behaviors:[c["default"]],properties:{entities:{type:Array,bindNuclear:[l.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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a);n(17);var s=u["default"].reactor,c=u["default"].entityGetters,l=u["default"].moreInfoActions;e["default"]=new o["default"]({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 l.selectEntity(e.entityId)},1)},computeState:function(t){return t&&s.evaluate(c.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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(126),u=r(a);e["default"]=new o["default"]({is:"ha-state-icon",properties:{stateObj:{type:Object}},computeIcon:function(t){return(0,u["default"])(t)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(22),c=r(s),l=n(21),f=r(l);n(17);var d=u["default"].moreInfoActions,h=u["default"].serviceActions;e["default"]=new o["default"]({is:"ha-state-label-badge",properties:{state:{type:Object,observer:"stateChanged"}},listeners:{tap:"badgeTap"},badgeTap:function(t){var e=this;return t.stopPropagation(),(0,f["default"])(this.state.entityId)?void("scene"===this.state.domain||"off"===this.state.state?h.callTurnOn(this.state.entityId):h.callTurnOff(this.state.entityId)):void this.async(function(){return d.selectEntity(e.state.entityId)},1)},computeClasses:function(t){switch(t.domain){case"scene":return"green";case"binary_sensor":case"script":return"on"===t.state?"blue":"grey";case"updater":return"blue";default:return""}},computeValue:function(t){switch(t.domain){case"binary_sensor":case"device_tracker":case"updater":case"sun":case"scene":case"script":case"alarm_control_panel":return null;case"sensor":default:return"unknown"===t.state?"-":t.state}},computeIcon:function(t){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":(0,c["default"])(t.domain,t.state);case"binary_sensor":case"device_tracker":case"scene":case"updater":case"script":return(0,c["default"])(t.domain,t.state);case"sun":return"above_horizon"===t.state?(0,c["default"])(t.domain):"mdi:brightness-3";default:return null}},computeImage:function(t){return t.attributes.entity_picture||null},computeLabel:function(t){switch(t.domain){case"scene":case"script":return 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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(75),e["default"]=new o["default"]({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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].eventGetters;e["default"]=new u["default"]({is:"events-list",behaviors:[c["default"]],properties:{events:{type:Array,bindNuclear:[l.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&&t.__esModule?t:{"default":t}}function i(t){return t in f?f[t]:30}function o(t){return"group"===t.domain?t.attributes.order:t.entityDisplay.toLowerCase()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(1),u=r(a),s=n(2),c=r(s);n(81),n(69),n(70),n(71);var l=c["default"].util,f={configurator:-20,group:-10,a:-1,updater:0,sun:1,device_tracker:2,alarm_control_panel:3,camera:4,sensor:5,binary_sensor:6,scene:7,script:8};e["default"]=new u["default"]({is:"ha-cards",properties:{showIntroduction:{type:Boolean,value:!1},columns:{type:Number,value:2},states:{type:Object},cards:{type:Object,computed:"computeCards(columns, states, showIntroduction)"}},computeCards:function(t,e,n){function r(t){return t.filter(function(t){return!(t.entityId in c)})}function a(){var e=h;return h=(h+1)%t,e}function u(t,e){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];0!==e.length&&(f._columns[a()].push(t),f[t]={entities:e,groupEntity:n})}for(var s=e.groupBy(function(t){return t.domain}),c={},f={_demo:!1,_badges:[],_columns:[]},d=0;t>d;d++)f._columns[d]=[];var h=0;return n&&a(),s.keySeq().sortBy(function(t){return i(t)}).forEach(function(t){if("a"===t)return void(f._demo=!0);var n=i(t);n>=0&&10>n?f._badges.push.apply(f._badges,r(s.get(t)).sortBy(o).toArray()):"group"===t?s.get(t).sortBy(o).forEach(function(t){var n=l.expandGroup(t,e);n.forEach(function(t){return c[t.entityId]=!0}),u(t.entityDisplay,n.toArray(),t)}):u(t,r(s.get(t)).sortBy(o).toArray())}),f},computeShouldRenderColumn:function(t,e){return 0===t||e.length},computeShowIntroduction:function(t,e,n){return 0===t&&(e||n._demo)},computeShowHideInstruction:function(t,e){return t.size>0&&!0&&!e._demo},computeGroupEntityOfCard:function(t,e){return e in t&&t[e].groupEntity},computeStatesOfCard:function(t,e){return e in t&&t[e].entities}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({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(){return e.mouseMoveIsThrottled=!0},100))},onMouseMove:function(t){var e=this;this.mouseMoveIsThrottled&&(this.mouseMoveIsThrottled=!1,this.processColorSelect(t),this.async(function(){return 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(){var t=this;this.setColor=this.setColor.bind(this),this.mouseMoveIsThrottled=!0,this.canvas=this.children[0],this.context=this.canvas.getContext("2d"),this.debounce("drawGradient",function(){var e=void 0;t.width&&t.height||(e=getComputedStyle(t));var n=t.width||parseInt(e.width,10),r=t.height||parseInt(e.height,10),i=t.context.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgb(255,0,0)"),i.addColorStop(.16,"rgb(255,0,255)"),i.addColorStop(.32,"rgb(0,0,255)"),i.addColorStop(.48,"rgb(0,255,255)"),i.addColorStop(.64,"rgb(0,255,0)"),i.addColorStop(.8,"rgb(255,255,0)"),i.addColorStop(1,"rgb(255,0,0)"),t.context.fillStyle=i,t.context.fillRect(0,0,n,r);var o=t.context.createLinearGradient(0,0,0,r);o.addColorStop(0,"rgba(255,255,255,1)"),o.addColorStop(.5,"rgba(255,255,255,0)"),o.addColorStop(.5,"rgba(0,0,0,0)"),o.addColorStop(1,"rgba(0,0,0,1)"),t.context.fillStyle=o,t.context.fillRect(0,0,n,r)},100)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(17),e["default"]=new o["default"]({is:"ha-demo-badge"})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(84),e["default"]=new o["default"]({is:"ha-logbook",properties:{entries:{type:Object,value:[]}},noEntries:function(t){return!t.length}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(88);var l=o["default"].configGetters,f=o["default"].navigationGetters,d=o["default"].authActions,h=o["default"].navigationActions;e["default"]=new u["default"]({is:"ha-sidebar",behaviors:[c["default"]],properties:{menuShown:{type:Boolean},menuSelected:{type:String},selected:{type:String,bindNuclear:f.activePane,observer:"selectedChanged"},hasHistoryComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("history")},hasLogbookComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("logbook")}},selectedChanged:function(t){document.activeElement&&document.activeElement.blur();for(var e=this.querySelectorAll(".menu [data-panel]"),n=0;nnew Date&&(o=new Date);var u=e.map(function(t){function e(t,e){c&&e&&s.push([t[0]].concat(c.slice(1).map(function(t,n){return e[n]?t:null}))),s.push(t),c=t}var n=t[t.length-1],r=n.domain,a=n.entityDisplay,u=new window.google.visualization.DataTable;u.addColumn({type:"datetime",id:"Time"});var s=[],c=void 0;if("thermostat"===r){var l=t.reduce(function(t,e){return t||e.attributes.target_temp_high!==e.attributes.target_temp_low},!1);u.addColumn("number",a+" current temperature");var f=void 0;l?!function(){u.addColumn("number",a+" target temperature high"),u.addColumn("number",a+" target temperature low");var t=[!1,!0,!0];f=function(n){var r=i(n.attributes.current_temperature),o=i(n.attributes.target_temp_high),a=i(n.attributes.target_temp_low);e([n.lastUpdatedAsDate,r,o,a],t)}}():!function(){u.addColumn("number",a+" target temperature");var t=[!1,!0];f=function(n){var r=i(n.attributes.current_temperature),o=i(n.attributes.temperature);e([n.lastUpdatedAsDate,r,o],t)}}(),t.forEach(f)}else!function(){u.addColumn("number",a);var n="sensor"!==r&&[!0];t.forEach(function(t){var r=i(t.state);e([t.lastChangedAsDate,r],n)})}();return e([o].concat(c.slice(1)),!1),u.addRows(s),u}),s=void 0;s=1===u.length?u[0]:u.slice(1).reduce(function(t,e){return window.google.visualization.data.join(t,e,"full",[[0,0]],(0,a["default"])(1,t.getNumberOfColumns()),(0,a["default"])(1,e.getNumberOfColumns()))},u[0]),this.chartEngine.draw(s,n)}}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({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 o=e.replace(/_/g," ");i.addRow([t,o,n,r])}if(this.isAttached){for(var e=o["default"].dom(this),n=this.data;e.node.lastChild;)e.node.removeChild(e.node.lastChild);if(n&&0!==n.length){var r=new window.google.visualization.Timeline(this),i=new window.google.visualization.DataTable;i.addColumn({type:"string",id:"Entity"}),i.addColumn({type:"string",id:"State"}),i.addColumn({type:"date",id:"Start"}),i.addColumn({type:"date",id:"End"});var a=new Date(n.reduce(function(t,e){return Math.min(t,e[0].lastChangedAsDate)},new Date)),u=new Date(a);u.setDate(u.getDate()+1),u>new Date&&(u=new Date);var s=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,u),s++}}),r.draw(i,{height:55+42*s,timeline:{showRowLabels:n.length>1},hAxis:{format:"H:mm"}})}}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].streamGetters,f=o["default"].streamActions;e["default"]=new u["default"]({is:"stream-status",behaviors:[c["default"]],properties:{isStreaming:{type:Boolean,bindNuclear:l.isStreamingEvents},hasError:{type:Boolean,bindNuclear:l.hasStreamingEventsError}},toggleChanged:function(){this.isStreaming?f.stop():f.start()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].voiceActions,f=o["default"].voiceGetters;e["default"]=new u["default"]({is:"ha-voice-command-dialog",behaviors:[c["default"]],properties:{dialogOpen:{type:Boolean,value:!1,observer:"dialogOpenChanged"},finalTranscript:{type:String,bindNuclear:f.finalTranscript},interimTranscript:{type:String,bindNuclear:f.extraInterimTranscript},isTransmitting:{type:Boolean,bindNuclear:f.isTransmitting},isListening:{type:Boolean,bindNuclear:f.isListening},showListenInterface:{type:Boolean,computed:"computeShowListenInterface(isListening, isTransmitting)",observer:"showListenInterfaceChanged"}},computeShowListenInterface:function(t,e){return t||e},dialogOpenChanged:function(t){!t&&this.isListening&&l.stop()},showListenInterfaceChanged:function(t){!t&&this.dialogOpen?this.dialogOpen=!1:t&&(this.dialogOpen=!0)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(19),n(38),n(106);var l=o["default"].configGetters,f=o["default"].entityHistoryGetters,d=o["default"].entityHistoryActions,h=o["default"].moreInfoGetters,p=o["default"].moreInfoActions,_=["camera","configurator","scene"];e["default"]=new u["default"]({is:"more-info-dialog",behaviors:[c["default"]],properties:{stateObj:{type:Object,bindNuclear:h.currentEntity,observer:"stateObjChanged"},stateHistory:{type:Object,bindNuclear:[h.currentEntityHistory,function(t){return t?[t]:!1}]},isLoadingHistoryData:{type:Boolean,computed:"computeIsLoadingHistoryData(_delayedDialogOpen, _isLoadingHistoryData)"},_isLoadingHistoryData:{type:Boolean,bindNuclear:f.isLoadingEntityHistory},hasHistoryComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("history"),observer:"fetchHistoryData"},shouldFetchHistory:{type:Boolean,bindNuclear:h.isCurrentEntityHistoryStale,observer:"fetchHistoryData"},showHistoryComponent:{type:Boolean,value:!1},dialogOpen:{type:Boolean,value:!1,observer:"dialogOpenChanged"},_delayedDialogOpen:{type:Boolean,value:!1}},computeIsLoadingHistoryData:function(t,e){return!t||e},fetchHistoryData:function(){this.stateObj&&this.hasHistoryComponent&&this.shouldFetchHistory&&d.fetchRecent(this.stateObj.entityId)},stateObjChanged:function(t){var e=this;return t?(this.showHistoryComponent=this.hasHistoryComponent&&-1===_.indexOf(this.stateObj.domain),void this.async(function(){e.fetchHistoryData(),e.dialogOpen=!0},10)):void(this.dialogOpen=!1)},dialogOpenChanged:function(t){var e=this;t?this.async(function(){return e._delayedDialogOpen=!0},10):!t&&this.stateObj&&(this.async(function(){return p.deselectEntity()},10),this._delayedDialogOpen=!1)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(4),c=r(s),l=n(42),f=r(l);n(83),n(93),n(100),n(99),n(101),n(94),n(95),n(97),n(98),n(96),n(102),n(90),n(89);var d=u["default"].navigationActions,h=u["default"].navigationGetters,p=u["default"].startUrlSync,_=u["default"].stopUrlSync;e["default"]=new o["default"]({is:"home-assistant-main",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},activePane:{type:String,bindNuclear:h.activePane,observer:"activePaneChanged"},isSelectedStates:{type:Boolean,bindNuclear:h.isActivePane("states")},isSelectedHistory:{type:Boolean,bindNuclear:h.isActivePane("history")},isSelectedMap:{type:Boolean,bindNuclear:h.isActivePane("map")},isSelectedLogbook:{type:Boolean,bindNuclear:h.isActivePane("logbook")},isSelectedDevEvent:{type:Boolean,bindNuclear:h.isActivePane("devEvent")},isSelectedDevState:{type:Boolean,bindNuclear:h.isActivePane("devState")},isSelectedDevTemplate:{type:Boolean,bindNuclear:h.isActivePane("devTemplate")},isSelectedDevService:{type:Boolean,bindNuclear:h.isActivePane("devService")},isSelectedDevInfo:{type:Boolean,bindNuclear:h.isActivePane("devInfo")},showSidebar:{type:Boolean,bindNuclear:h.showSidebar}},listeners:{"open-menu":"openMenu","close-menu":"closeMenu"},openMenu:function(){this.narrow?this.$.drawer.openDrawer():d.showSidebar(!0)},closeMenu:function(){this.$.drawer.closeDrawer(),this.showSidebar&&d.showSidebar(!1)},activePaneChanged:function(){this.narrow&&this.$.drawer.closeDrawer()},attached:function(){(0,f["default"])(),p()},computeForceNarrow:function(t,e){return t||!e},detached:function(){_()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(4),c=r(s),l=n(43),f=r(l),d=n(42),h=r(d),p=u["default"].authGetters;e["default"]=new o["default"]({is:"login-form",behaviors:[c["default"]],properties:{errorMessage:{type:String,bindNuclear:p.attemptErrorMessage},isInvalid:{type:Boolean,bindNuclear:p.isInvalidAttempt},isValidating:{type:Boolean,observer:"isValidatingChanged",bindNuclear:p.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(){(0,h["default"])()},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(),(0,f["default"])(this.$.passwordInput.value,this.$.rememberLogin.checked)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(8),n(79);var l=o["default"].configGetters,f=o["default"].viewActions,d=o["default"].viewGetters,h=o["default"].voiceGetters,p=o["default"].streamGetters,_=o["default"].syncGetters,v=o["default"].syncActions,y=o["default"].voiceActions;e["default"]=new u["default"]({is:"partial-cards",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},isFetching:{type:Boolean,bindNuclear:_.isFetching},isStreaming:{type:Boolean,bindNuclear:p.isStreamingEvents},canListen:{type:Boolean,bindNuclear:[h.isVoiceSupported,l.isComponentLoaded("conversation"),function(t,e){return t&&e}]},introductionLoaded:{type:Boolean,bindNuclear:l.isComponentLoaded("introduction")},locationName:{type:String,bindNuclear:l.locationName},showMenu:{type:Boolean,value:!1,observer:"windowChange"},currentView:{type:String,bindNuclear:[d.currentView,function(t){return t||""}],observer:"removeFocus"},views:{type:Array,bindNuclear:[d.views,function(t){return t.valueSeq().sortBy(function(t){return t.attributes.order}).toArray()}]},hasViews:{type:Boolean,computed:"computeHasViews(views)"},states:{type:Object,bindNuclear:d.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.showMenu)},removeFocus:function(){document.activeElement&&document.activeElement.blur()},handleRefresh:function(){v.fetchAll()},handleListenClick:function(){y.listen()},computeMenuButtonClass:function(t,e){return!t&&e?"invisible":""},computeRefreshButtonClass:function(t){return t?"ha-spin":void 0},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 f.selectView(e)},0)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(8),n(85);var s=o["default"].reactor,c=o["default"].serviceActions,l=o["default"].serviceGetters;e["default"]=new u["default"]({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 s.evaluate([l.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)}c.callService(this.domain,this.service,t)},computeFormClasses:function(t){return"layout "+(t?"vertical":"horizontal")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(8),n(78);var s=o["default"].eventActions;e["default"]=new u["default"]({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)}s.fireEvent(this.eventType,t)},computeFormClasses:function(t){return"layout "+(t?"vertical":"horizontal")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(8);var l=o["default"].configGetters,f=o["default"].errorLogActions;e["default"]=new u["default"]({is:"partial-dev-info",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},hassVersion:{type:String,bindNuclear:l.serverVersion},polymerVersion:{type:String,value:u["default"].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…",f.fetchErrorLog().then(function(t){return e.errorLog=t||"No errors have been reported."})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(8),n(73);var s=o["default"].reactor,c=o["default"].entityGetters,l=o["default"].entityActions;e["default"]=new u["default"]({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=s.evaluate(c.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)}l.save({entityId:this.entityId,state:this.state,attributes:t})},computeFormClasses:function(t){return"layout "+(t?"vertical":"horizontal")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(8);var l=o["default"].templateActions;e["default"]=new u["default"]({is:"partial-dev-template",behaviors:[c["default"]],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 layout "+(t?"vertical":"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,l.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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(8),n(38);var l=o["default"].entityHistoryGetters,f=o["default"].entityHistoryActions;e["default"]=new u["default"]({is:"partial-history",behaviors:[c["default"]],properties:{narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},isDataLoaded:{type:Boolean,bindNuclear:l.hasDataForCurrentDate,observer:"isDataLoadedChanged"},stateHistory:{type:Object,bindNuclear:l.entityHistoryForCurrentDate},isLoadingData:{type:Boolean,bindNuclear:l.isLoadingEntityHistory},selectedDate:{type:String,value:null,bindNuclear:l.currentDate}},isDataLoadedChanged:function(t){t||this.async(function(){return f.fetchSelectedDate()},1)},handleRefreshClick:function(){f.fetchSelectedDate()},datepickerFocus:function(){this.datePicker.adjustPosition()},attached:function(){this.datePicker=new window.Pikaday({field:this.$.datePicker.inputElement,onSelect:f.changeCurrentDate})},detached:function(){this.datePicker.destroy()},computeContentClasses:function(t){return"flex content "+(t?"narrow":"wide")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(8),n(82),n(18);var l=o["default"].logbookGetters,f=o["default"].logbookActions;e["default"]=new u["default"]({is:"partial-logbook",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},selectedDate:{type:String,bindNuclear:l.currentDate},isLoading:{type:Boolean,bindNuclear:l.isLoadingEntries},isStale:{type:Boolean,bindNuclear:l.isCurrentStale,observer:"isStaleChanged"},entries:{type:Array,bindNuclear:[l.currentEntries,function(t){return t.reverse().toArray()}]},datePicker:{type:Object}},isStaleChanged:function(t){var e=this;t&&this.async(function(){return f.fetchDate(e.selectedDate)},1)},handleRefresh:function(){f.fetchDate(this.selectedDate)},datepickerFocus:function(){this.datePicker.adjustPosition()},attached:function(){this.datePicker=new window.Pikaday({field:this.$.datePicker.inputElement,onSelect:f.changeCurrentDate})},detached:function(){this.datePicker.destroy()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(74);var l=o["default"].configGetters,f=o["default"].entityGetters;window.L.Icon.Default.imagePath="/static/images/leaflet",e["default"]=new u["default"]({is:"partial-map",behaviors:[c["default"]],properties:{locationGPS:{type:Number,bindNuclear:l.locationGPS},locationName:{type:String,bindNuclear:l.locationName},locationEntities:{type:Array,bindNuclear:[f.visibleEntityMap,function(t){return t.valueSeq().filter(function(t){return t.attributes.latitude&&"home"!==t.state}).toArray()}]},zoneEntities:{type:Array,bindNuclear:[f.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&&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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].notificationGetters;e["default"]=new u["default"]({is:"notification-manager",behaviors:[c["default"]],properties:{text:{type:String,bindNuclear:l.lastNotificationMessage,observer:"showNotification"}},showNotification:function(t){t&&this.$.toast.show()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=o["default"].serviceActions;e["default"]=new u["default"]({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,s.callService("alarm_control_panel",t,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"more-info-camera",properties:{stateObj:{type:Object},dialogOpen:{type:Boolean}},imageLoaded:function(){this.fire("iron-resize")},computeCameraImageUrl:function(t){return t?"/api/camera_proxy_stream/"+this.stateObj.entityId:"data:image/gif;base64,R0lGODlhAQABAAAAACw="}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(18);var l=o["default"].streamGetters,f=o["default"].syncActions,d=o["default"].serviceActions;e["default"]=new u["default"]({is:"more-info-configurator",behaviors:[c["default"]],properties:{stateObj:{type:Object},action:{type:String,value:"display"},isStreaming:{type:Boolean,bindNuclear:l.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};d.callService("configurator","configure",e).then(function(){t.isConfiguring=!1,t.isStreaming||f.fetchAll()},function(){t.isConfiguring=!1})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(127),u=r(a);n(107),n(108),n(113),n(105),n(114),n(112),n(109),n(111),n(104),n(115),n(103),n(110),e["default"]=new o["default"]({is:"more-info-content",properties:{stateObj:{type:Object,observer:"stateObjChanged"},dialogOpen:{type:Boolean,value:!1,observer:"dialogOpenChanged"}},dialogOpenChanged:function(t){var e=o["default"].dom(this);e.lastChild&&(e.lastChild.dialogOpen=t)},stateObjChanged:function(t,e){var n=o["default"].dom(this);if(!t)return void(n.lastChild&&n.removeChild(n.lastChild));var r=(0,u["default"])(t);if(e&&(0,u["default"])(e)===r)n.lastChild.dialogOpen=this.dialogOpen,n.lastChild.stateObj=t;else{n.lastChild&&n.removeChild(n.lastChild);var i=document.createElement("more-info-"+r);i.stateObj=t,i.dialogOpen=this.dialogOpen,n.appendChild(i)}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=["entity_picture","friendly_name","icon","unit_of_measurement"];e["default"]=new o["default"]({is:"more-info-default",properties:{stateObj:{type:Object}},computeDisplayAttributes:function(t){return t?Object.keys(t.attributes).filter(function(t){return-1===a.indexOf(t)}):[]},getAttributeValue:function(t,e){var n=t.attributes[e];return Array.isArray(n)?n.join(", "):n}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(19);var l=o["default"].entityGetters,f=o["default"].moreInfoGetters;e["default"]=new u["default"]({is:"more-info-group",behaviors:[c["default"]],properties:{stateObj:{type:Object},states:{type:Array,bindNuclear:[f.currentEntity,l.entityMap,function(t,e){return t?t.attributes.entity_id.map(e.get.bind(e)):[]}]}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){f.callService("light","turn_on",{entity_id:t,rgb_color:[e.r,e.g,e.b]})}Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),a=r(o),u=n(1),s=r(u),c=n(20),l=r(c);n(80);var f=a["default"].serviceActions,d=["brightness","rgb_color","color_temp"];e["default"]=new s["default"]({is:"more-info-light",properties:{stateObj:{type:Object,observer:"stateObjChanged"},brightnessSliderValue:{type:Number,value:0},ctSliderValue:{type:Number,value:0}},stateObjChanged:function(t){var e=this;t&&"on"===t.state&&(this.brightnessSliderValue=t.attributes.brightness,this.ctSliderValue=t.attributes.color_temp),this.async(function(){return e.fire("iron-resize")},500)},computeClassNames:function(t){return(0,l["default"])(t,d)},brightnessSliderChanged:function(t){var e=parseInt(t.target.value,10);isNaN(e)||(0===e?f.callTurnOff(this.stateObj.entityId):f.callService("light","turn_on",{entity_id:this.stateObj.entityId,brightness:e}))},ctSliderChanged:function(t){var e=parseInt(t.target.value,10);isNaN(e)||f.callService("light","turn_on",{entity_id:this.stateObj.entityId,color_temp:e})},colorPicked:function(t){var e=this;return this.skipColorPicked?void(this.colorChanged=!0):(this.color=t.detail.rgb,i(this.stateObj.entityId,this.color),this.colorChanged=!1,this.skipColorPicked=!0,void(this.colorDebounce=setTimeout(function(){e.colorChanged&&i(e.stateObj.entityId,e.color),e.skipColorPicked=!1},500)))}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=o["default"].serviceActions;e["default"]=new u["default"]({is:"more-info-lock",properties:{stateObj:{type:Object,observer:"stateObjChanged"},enteredCode:{type:String,value:""},unlockButtonVisible:{type:Boolean,value:!1},lockButtonVisible:{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)"}},handleUnlockTap:function(){this.callService("unlock",{code:this.enteredCode})},handleLockTap:function(){this.callService("lock",{code:this.enteredCode})},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="locked"===t.state||"unlocked"===t.state,this.unlockButtonVisible="locked"===t.state,this.lockButtonVisible="unlocked"===t.state),this.async(function(){return e.fire("iron-resize")},500)},callService:function(t,e){var n=e||{};n.entity_id=this.stateObj.entityId,s.callService("lock",t,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(20),c=r(s),l=o["default"].serviceActions,f=["volume_level"];e["default"]=new u["default"]({is:"more-info-media_player",properties:{stateObj:{type:Object,observer:"stateObjChanged"},isOff:{type:Boolean,value:!1},isPlaying:{type:Boolean,value:!1},isMuted:{type:Boolean,value:!1},volumeSliderValue:{type:Number,value:0},supportsPause:{type:Boolean,value:!1},supportsVolumeSet:{
+type:Boolean,value:!1},supportsVolumeMute:{type:Boolean,value:!1},supportsPreviousTrack:{type:Boolean,value:!1},supportsNextTrack:{type:Boolean,value:!1},supportsTurnOn:{type:Boolean,value:!1},supportsTurnOff:{type:Boolean,value:!1},supportsVolumeButtons:{type:Boolean,value:!1},hasMediaControl:{type:Boolean,value:!1}},stateObjChanged:function(t){var e=this;if(t){var n=["playing","paused","unknown"];this.isOff="off"===t.state,this.isPlaying="playing"===t.state,this.hasMediaControl=-1!==n.indexOf(t.state),this.volumeSliderValue=100*t.attributes.volume_level,this.isMuted=t.attributes.is_volume_muted,this.supportsPause=0!==(1&t.attributes.supported_media_commands),this.supportsVolumeSet=0!==(4&t.attributes.supported_media_commands),this.supportsVolumeMute=0!==(8&t.attributes.supported_media_commands),this.supportsPreviousTrack=0!==(16&t.attributes.supported_media_commands),this.supportsNextTrack=0!==(32&t.attributes.supported_media_commands),this.supportsTurnOn=0!==(128&t.attributes.supported_media_commands),this.supportsTurnOff=0!==(256&t.attributes.supported_media_commands),this.supportsVolumeButtons=0!==(1024&t.attributes.supported_media_commands)}this.async(function(){return e.fire("iron-resize")},500)},computeClassNames:function(t){return(0,c["default"])(t,f)},computeIsOff:function(t){return"off"===t.state},computeMuteVolumeIcon:function(t){return t?"mdi:volume-off":"mdi:volume-high"},computeHideVolumeButtons:function(t,e){return!e||t},computeShowPlaybackControls:function(t,e){return!t&&e},computePlaybackControlIcon:function(){return this.isPlaying?this.supportsPause?"mdi:pause":"mdi:stop":"mdi:play"},computeHidePowerButton:function(t,e,n){return t?!e:!n},handleTogglePower:function(){this.callService(this.isOff?"turn_on":"turn_off")},handlePrevious:function(){this.callService("media_previous_track")},handlePlaybackControl:function(){this.callService("media_play_pause")},handleNext:function(){this.callService("media_next_track")},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,l.callService("media_player",t,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"more-info-script",properties:{stateObj:{type:Object}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(41),c=r(s),l=u["default"].util.parseDateTime;e["default"]=new o["default"]({is:"more-info-sun",properties:{stateObj:{type:Object},risingDate:{type:Object,computed:"computeRising(stateObj)"},settingDate:{type:Object,computed:"computeSetting(stateObj)"}},computeRising:function(t){return l(t.attributes.next_rising)},computeSetting:function(t){return l(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(0,c["default"])(this.itemDate(t))}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(20),c=r(s),l=o["default"].serviceActions,f=["away_mode"];e["default"]=new u["default"]({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(0,c["default"])(t,f)},targetTemperatureSliderChanged:function(t){l.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;l.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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"more-info-updater",properties:{}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),n(39),e["default"]=new o["default"]({is:"state-card-configurator",properties:{stateObj:{type:Object}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(7);var s=o["default"].serviceActions;e["default"]=new u["default"]({is:"state-card-input_select",properties:{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&&s.callService("input_select","select_option",{option:t,entity_id:this.stateObj.entityId})},stopPropagation:function(t){t.stopPropagation()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7);var a=["playing","paused"];e["default"]=new o["default"]({is:"state-card-media_player",properties:{stateObj:{type:Object},isPlaying:{type:Boolean,computed:"computeIsPlaying(stateObj)"}},computeIsPlaying:function(t){return-1!==a.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";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(7);var s=o["default"].serviceActions;e["default"]=new u["default"]({is:"state-card-rollershutter",properties:{stateObj:{type:Object}},computeIsFullyOpen:function(t){return 100===t.attributes.current_position},computeIsFullyClosed:function(t){return 0===t.attributes.current_position},onMoveUpTap:function(){s.callService("rollershutter","move_up",{entity_id:this.stateObj.entityId})},onMoveDownTap:function(){s.callService("rollershutter","move_down",{entity_id:this.stateObj.entityId})},onStopTap:function(){s.callService("rollershutter","stop",{entity_id:this.stateObj.entityId})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a);n(7);var s=u["default"].serviceActions;e["default"]=new o["default"]({is:"state-card-scene",properties:{stateObj:{type:Object}},activateScene:function(){s.callTurnOn(this.stateObj.entityId)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),e["default"]=new o["default"]({is:"state-card-thermostat",properties:{stateObj:{type:Object}},computeTargetTemperature:function(t){return t.attributes.temperature+" "+t.attributes.unit_of_measurement}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),n(35),e["default"]=new o["default"]({is:"state-card-toggle"})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),e["default"]=new o["default"]({is:"state-card-weblink",properties:{stateObj:{type:Object}},listeners:{tap:"onTap"},onTap:function(t){t.stopPropagation(),window.open(this.stateObj.state,"_blank")}})},function(t,e){"use strict";function n(t){return{attached:function(){var e=this;this.__unwatchFns=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.__unwatchFns.length;)this.__unwatchFns.shift()()}}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return-1!==u.indexOf(t.domain)?t.domain:(0,a["default"])(t.entityId)?"toggle":"display"}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(21),a=r(o),u=["configurator","input_select","media_player","rollershutter","scene","thermostat","weblink"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(!t)return a["default"];if(t.attributes.icon)return t.attributes.icon;var e=t.attributes.unit_of_measurement;return!e||"sensor"!==t.domain||e!==f.UNIT_TEMP_C&&e!==f.UNIT_TEMP_F?(0,s["default"])(t.domain,t.state):"mdi:thermometer"}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(40),a=r(o),u=n(22),s=r(u),c=n(2),l=r(c),f=l["default"].util.temperatureUnits},function(t,e){"use strict";function n(t){return-1!==r.indexOf(t.domain)?t.domain:"default"}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n;var r=["light","group","sun","configurator","thermostat","script","media_player","camera","updater","alarm_control_panel","lock"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(197),i=n(15),o=function(t,e,n){var o=arguments.length<=3||void 0===arguments[3]?null:arguments[3],a=t.evaluate(i.getters.authInfo),u=a.host+"/api/"+n;return new r.Promise(function(t,n){var r=new XMLHttpRequest;r.open(e,u,!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({})},o?r.send(JSON.stringify(o)):r.send()})};e["default"]=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=n.useStreaming,i=void 0===r?t.evaluate(c.getters.isSupported):r,o=n.rememberAuth,a=void 0===o?!1:o,s=n.host,d=void 0===s?"":s;t.dispatch(u["default"].VALIDATING_AUTH_TOKEN,{authToken:e,host:d}),l.actions.fetchAll(t).then(function(){t.dispatch(u["default"].VALID_AUTH_TOKEN,{authToken:e,host:d,rememberAuth:a}),i?c.actions.start(t,{syncOnInitialConnect:!1}):l.actions.start(t,{skipInitialSync:!0})},function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.message,r=void 0===n?f:n;t.dispatch(u["default"].INVALID_AUTH_TOKEN,{errorMessage:r})})}function o(t){(0,s.callApi)(t,"POST","log_out"),t.dispatch(u["default"].LOG_OUT,{})}Object.defineProperty(e,"__esModule",{value:!0}),e.validate=i,e.logOut=o;var a=n(14),u=r(a),s=n(5),c=n(29),l=n(31),f="Unexpected result from API"},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=e.isValidating=["authAttempt","isValidating"],r=(e.isInvalidAttempt=["authAttempt","isInvalid"],e.attemptErrorMessage=["authAttempt","errorMessage"],e.rememberAuth=["rememberAuth"],e.attemptAuthInfo=[["authAttempt","authToken"],["authAttempt","host"],function(t,e){return{authToken:t,host:e}}]),i=e.currentAuthToken=["authCurrent","authToken"],o=e.currentAuthInfo=[i,["authCurrent","host"],function(t,e){return{authToken:t,host:e}}];e.authToken=[n,["authAttempt","authToken"],["authCurrent","authToken"],function(t,e,n){return t?e:n}],e.authInfo=[n,r,o,function(t,e,n){return t?e:n}]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(null==t)throw new TypeError("Cannot destructure undefined")}function o(t,e){var n=e.authToken,r=e.host;return(0,s.toImmutable)({authToken:n,host:r,isValidating:!0,isInvalid:!1,errorMessage:""})}function a(t,e){return i(e),f.getInitialState()}function u(t,e){var n=e.errorMessage;return t.withMutations(function(t){return t.set("isValidating",!1).set("isInvalid",!0).set("errorMessage",n)})}Object.defineProperty(e,"__esModule",{value:!0});var s=n(3),c=n(14),l=r(c),f=new s.Store({getInitialState:function(){return(0,s.toImmutable)({isValidating:!1,authToken:!1,host:null,isInvalid:!1,errorMessage:""})},initialize:function(){this.on(l["default"].VALIDATING_AUTH_TOKEN,o),this.on(l["default"].VALID_AUTH_TOKEN,a),this.on(l["default"].INVALID_AUTH_TOKEN,u)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.authToken,r=e.host;return(0,a.toImmutable)({authToken:n,host:r})}function o(){return c.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(14),s=r(u),c=new a.Store({getInitialState:function(){return(0,a.toImmutable)({authToken:null,host:""})},initialize:function(){this.on(s["default"].VALID_AUTH_TOKEN,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.rememberAuth;return n}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),a=n(14),u=r(a),s=new o.Store({getInitialState:function(){return!0},initialize:function(){this.on(u["default"].VALID_AUTH_TOKEN,i)}});e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){t.dispatch(c["default"].SERVER_CONFIG_LOADED,e)}function o(t){(0,u.callApi)(t,"GET","config").then(function(e){return i(t,e)})}function a(t,e){t.dispatch(c["default"].COMPONENT_LOADED,{component:e})}Object.defineProperty(e,"__esModule",{value:!0}),e.configLoaded=i,e.fetchAll=o,e.componentLoaded=a;var u=n(5),s=n(23),c=r(s)},function(t,e){"use strict";function n(t){return[["serverComponent"],function(e){return e.contains(t)}]}Object.defineProperty(e,"__esModule",{value:!0}),e.isComponentLoaded=n,e.locationGPS=[["serverConfig","latitude"],["serverConfig","longitude"],function(t,e){return{latitude:t,longitude:e}}],e.locationName=["serverConfig","location_name"],e.serverVersion=["serverConfig","serverVersion"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.component;return t.push(n)}function o(t,e){var n=e.components;return(0,u.toImmutable)(n)}function a(){return l.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var u=n(3),s=n(23),c=r(s),l=new u.Store({getInitialState:function(){return(0,u.toImmutable)([])},initialize:function(){this.on(c["default"].COMPONENT_LOADED,i),this.on(c["default"].SERVER_CONFIG_LOADED,o),this.on(c["default"].LOG_OUT,a)}});e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.latitude,r=e.longitude,i=e.location_name,o=e.temperature_unit,u=e.time_zone,s=e.version;return(0,a.toImmutable)({latitude:n,longitude:r,location_name:i,temperature_unit:o,time_zone:u,serverVersion:s})}function o(){return c.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(23),s=r(u),c=new a.Store({getInitialState:function(){return(0,a.toImmutable)({latitude:null,longitude:null,location_name:"Home",temperature_unit:"°C",time_zone:"UTC",serverVersion:"unknown"})},initialize:function(){this.on(s["default"].SERVER_CONFIG_LOADED,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=c},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){t.dispatch(f["default"].ENTITY_HISTORY_DATE_SELECTED,{date:e})}function a(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];t.dispatch(f["default"].RECENT_ENTITY_HISTORY_FETCH_START,{});var n="history/period";return null!==e&&(n+="?filter_entity_id="+e),(0,c.callApi)(t,"GET",n).then(function(e){return t.dispatch(f["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,{stateHistory:e})},function(){return t.dispatch(f["default"].RECENT_ENTITY_HISTORY_FETCH_ERROR,{})})}function u(t,e){return t.dispatch(f["default"].ENTITY_HISTORY_FETCH_START,{date:e}),(0,c.callApi)(t,"GET","history/period/"+e).then(function(n){return t.dispatch(f["default"].ENTITY_HISTORY_FETCH_SUCCESS,{date:e,stateHistory:n})},function(){return t.dispatch(f["default"].ENTITY_HISTORY_FETCH_ERROR,{})})}function s(t){var e=t.evaluate(h.currentDate);return u(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.changeCurrentDate=o,e.fetchRecent=a,e.fetchDate=u,e.fetchSelectedDate=s;var c=n(5),l=n(11),f=i(l),d=n(44),h=r(d)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.date;return(0,s["default"])(n)}function o(){return f.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(32),s=r(u),c=n(11),l=r(c),f=new a.Store({getInitialState:function(){var t=new Date;return t.setDate(t.getDate()-1),(0,s["default"])(t)},initialize:function(){this.on(l["default"].ENTITY_HISTORY_DATE_SELECTED,i),this.on(l["default"].LOG_OUT,o)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.date,r=e.stateHistory;return 0===r.length?t.set(n,(0,a.toImmutable)({})):t.withMutations(function(t){r.forEach(function(e){return t.setIn([n,e[0].entity_id],(0,a.toImmutable)(e.map(l["default"].fromJSON)))})})}function o(){return f.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(11),s=r(u),c=n(16),l=r(c),f=new a.Store({getInitialState:function(){return(0,a.toImmutable)({})},initialize:function(){this.on(s["default"].ENTITY_HISTORY_FETCH_SUCCESS,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(11),a=r(o),u=new i.Store({getInitialState:function(){return!1},initialize:function(){this.on(a["default"].ENTITY_HISTORY_FETCH_START,function(){return!0}),this.on(a["default"].ENTITY_HISTORY_FETCH_SUCCESS,function(){return!1}),this.on(a["default"].ENTITY_HISTORY_FETCH_ERROR,function(){return!1}),this.on(a["default"].RECENT_ENTITY_HISTORY_FETCH_START,function(){return!0}),this.on(a["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,function(){return!1}),this.on(a["default"].RECENT_ENTITY_HISTORY_FETCH_ERROR,function(){return!1}),this.on(a["default"].LOG_OUT,function(){return!1})}});e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.stateHistory;return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,(0,a.toImmutable)(e.map(l["default"].fromJSON)))})})}function o(){return f.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(11),s=r(u),c=n(16),l=r(c),f=new a.Store({getInitialState:function(){return(0,a.toImmutable)({})},initialize:function(){this.on(s["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(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(c,r)})}function o(){return l.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(11),s=r(u),c="ALL_ENTRY_FETCH",l=new a.Store({getInitialState:function(){return(0,a.toImmutable)({})},initialize:function(){this.on(s["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),o=n(16),a=r(o),u=(0,i.createApiActions)(a["default"]);e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.visibleEntityMap=e.byId=e.entityMap=e.hasData=void 0;var i=n(10),o=n(16),a=r(o),u=(e.hasData=(0,i.createHasDataGetter)(a["default"]),e.entityMap=(0,i.createEntityMapGetter)(a["default"]));e.byId=(0,i.createByIdGetter)(a["default"]),e.visibleEntityMap=[u,function(t){return t.filter(function(t){return!t.attributes.hidden})}]},function(t,e,n){"use strict";function r(t){return(0,i.callApi)(t,"GET","error_log")}Object.defineProperty(e,"__esModule",{value:!0}),e.fetchErrorLog=r;var i=n(5)},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}Object.defineProperty(e,"__esModule",{value:!0}),e.actions=void 0;var i=n(146),o=r(i);e.actions=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(5),o=n(10),a=n(27),u=n(46),s=r(u),c=(0,o.createApiActions)(s["default"]);c.fireEvent=function(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return(0,i.callApi)(t,"POST","events/"+e,n).then(function(){a.actions.createNotification(t,"Event "+e+" successful fired!")})},e["default"]=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.byId=e.entityMap=e.hasData=void 0;var i=n(10),o=n(46),a=r(o);e.hasData=(0,i.createHasDataGetter)(a["default"]),e.entityMap=(0,i.createEntityMapGetter)(a["default"]),e.byId=(0,i.createByIdGetter)(a["default"])},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){t.dispatch(s["default"].LOGBOOK_DATE_SELECTED,{date:e})}function o(t,e){t.dispatch(s["default"].LOGBOOK_ENTRIES_FETCH_START,{date:e}),(0,a.callApi)(t,"GET","logbook/"+e).then(function(n){return t.dispatch(s["default"].LOGBOOK_ENTRIES_FETCH_SUCCESS,{date:e,entries:n})},function(){return t.dispatch(s["default"].LOGBOOK_ENTRIES_FETCH_ERROR,{})})}Object.defineProperty(e,"__esModule",{value:!0}),e.changeCurrentDate=i,e.fetchDate=o;var a=n(5),u=n(12),s=r(u)},function(t,e,n){"use strict";function r(t){return!t||(new Date).getTime()-t>o}Object.defineProperty(e,"__esModule",{value:!0}),e.isLoadingEntries=e.currentEntries=e.isCurrentStale=e.currentDate=void 0;var i=n(3),o=6e4,a=e.currentDate=["currentLogbookDate"];e.isCurrentStale=[a,["logbookEntriesUpdated"],function(t,e){return r(e.get(t))}],e.currentEntries=[a,["logbookEntries"],function(t,e){return e.get(t)||(0,i.toImmutable)([])}],e.isLoadingEntries=["isLoadingLogbookEntries"]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({currentLogbookDate:u["default"],isLoadingLogbookEntries:c["default"],logbookEntries:f["default"],logbookEntriesUpdated:h["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0,e.register=o;var a=n(154),u=i(a),s=n(155),c=i(s),l=n(156),f=i(l),d=n(157),h=i(d),p=n(150),_=r(p),v=n(151),y=r(v);e.actions=_,e.getters=y},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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 a(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 u=function(){function t(t,e){for(var n=0;nt;t+=2){var e=rt[t],n=rt[t+1];e(n),rt[t]=void 0,rt[t+1]=void 0}$=0}function y(){try{var t=n(213);return W=t.runOnLoop||t.runOnContext,d()}catch(e){return _()}}function m(){}function g(){return new TypeError("You cannot resolve a promise with itself")}function b(){return new TypeError("A promises callback cannot return that same promise.")}function S(t){try{return t.then}catch(e){return ut.error=e,ut}}function w(t,e,n,r){try{t.call(e,n,r)}catch(i){return i}}function O(t,e,n){Z(function(t){var r=!1,i=w(n,e,function(n){r||(r=!0,e!==n?E(t,n):D(t,n))},function(e){r||(r=!0,C(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,C(t,i))},t)}function M(t,e){e._state===ot?D(t,e._result):e._state===at?C(t,e._result):j(e,void 0,function(e){E(t,e)},function(e){C(t,e)})}function I(t,e){if(e.constructor===t.constructor)M(t,e);else{var n=S(e);n===ut?C(t,ut.error):void 0===n?D(t,e):u(n)?O(t,e,n):D(t,e)}}function E(t,e){t===e?C(t,g()):a(e)?I(t,e):D(t,e)}function T(t){t._onerror&&t._onerror(t._result),P(t)}function D(t,e){t._state===it&&(t._result=e,t._state=ot,0!==t._subscribers.length&&Z(P,t))}function C(t,e){t._state===it&&(t._state=at,t._result=e,Z(T,t))}function j(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+ot]=n,i[o+at]=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++)j(r.resolve(t[a]),void 0,e,n);return i}function Y(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(m);return E(n,t),n}function z(t){var e=this,n=new e(m);return C(n,t),n}function U(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function V(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function G(t){this._id=pt++,this._state=void 0,this._result=void 0,this._subscribers=[],m!==t&&(u(t)||U(),this instanceof G||V(),N(this,t))}function F(){var t;if("undefined"!=typeof i)t=i;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=_t)}var B;B=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var W,q,K,J=B,$=0,Z=({}.toString,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?f():tt?h():nt?p():void 0===X?y():_();var it=void 0,ot=1,at=2,ut=new A,st=new A;R.prototype._validateInput=function(t){return J(t)},R.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},R.prototype._init=function(){this._result=new Array(this.length)};var ct=R;R.prototype._enumerate=function(){for(var t=this,e=t.length,n=t.promise,r=t._input,i=0;n._state===it&&e>i;i++)t._eachEntry(r[i],i)},R.prototype._eachEntry=function(t,e){var n=this,r=n._instanceConstructor;s(t)?t.constructor===r&&t._state!==it?(t._onerror=null,n._settledAt(t._state,e,t._result)):n._willSettleAt(r.resolve(t),e):(n._remaining--,n._result[e]=t)},R.prototype._settledAt=function(t,e,n){var r=this,i=r.promise;i._state===it&&(r._remaining--,t===at?C(i,n):r._result[e]=n),0===r._remaining&&D(i,r._result)},R.prototype._willSettleAt=function(t,e){var n=this;j(t,void 0,function(t){n._settledAt(ot,e,t)},function(t){n._settledAt(at,e,t)})};var lt=x,ft=H,dt=Y,ht=z,pt=0,_t=G;G.all=lt,G.race=ft,G.resolve=dt,G.reject=ht,G._setScheduler=c,G._setAsap=l,G._asap=Z,G.prototype={constructor:G,then:function(t,e){var n=this,r=n._state;if(r===ot&&!t||r===at&&!e)return this;var i=new this.constructor(m),o=n._result;if(r){var a=arguments[r-1];Z(function(){L(r,i,a,o)})}else j(n,i,t,e);return i},"catch":function(t){return this.then(null,t)}};var vt=F,yt={Promise:_t,polyfill:vt};n(211).amd?(r=function(){return yt}.call(e,n,e,o),!(void 0!==r&&(o.exports=r))):"undefined"!=typeof o&&o.exports?o.exports=yt:"undefined"!=typeof this&&(this.ES6Promise=yt),vt()}).call(this)}).call(e,n(212),function(){return this}(),n(67)(t))},function(t,e,n){var r=n(62),i=r(Date,"now"),o=i||function(){return(new Date).getTime()};t.exports=o},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,n){var r=n(62),i=n(199),o=n(63),a="[object Array]",u=Object.prototype,s=u.toString,c=r(Array,"isArray"),l=c||function(t){return o(t)&&i(t.length)&&s.call(t)==a};t.exports=l},function(t,e,n){function r(t){return null==t?!1:i(t)?l.test(s.call(t)):o(t)&&a.test(t)}var i=n(64),o=n(63),a=/^\[object .+?Constructor\]$/,u=Object.prototype,s=Function.prototype.toString,c=u.hasOwnProperty,l=RegExp("^"+s.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");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,n){var r=n(202),i=r("length");t.exports=i},function(t,e,n){function r(t){return null!=t&&o(i(t))}var i=n(203),o=n(207);t.exports=r},function(t,e){function n(t,e){return t="number"==typeof t||r.test(t)?+t:-1,e=null==e?i:e,t>-1&&t%1==0&&e>t}var r=/^\d+$/,i=9007199254740991;t.exports=n},function(t,e,n){function r(t,e,n){if(!a(n))return!1;var r=typeof e;if("number"==r?i(n)&&o(e,n.length):"string"==r&&e in n){var u=n[e];return t===t?t===u:u!==u}return!1}var i=n(204),o=n(205),a=n(208);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){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){function r(t,e,n){n&&i(t,e,n)&&(e=n=void 0),t=+t||0,n=null==n?1:+n||0,null==e?(e=t,t=0):e=+e||0;for(var r=-1,u=a(o((e-t)/(n||1)),0),s=Array(u);++r1)for(var n=1;n