updating configuration

This commit is contained in:
Your Name committed 2026-07-14 14:12:07 +00:00
1 parent 456f43d435
commit 6199c62362
83 files changed
+369 -181

No files matched your search

@@ -1,5 +1,6 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
import os import os
import globals
# #
# App to send notification when doorbell is ringing # App to send notification when doorbell is ringing
@@ -26,10 +27,9 @@ class Doorbell(hass.Hass):
def ha_event(self, event_name, data, kwargs): def ha_event(self, event_name, data, kwargs):
self.log('{}:{}'.format(event_name, data)) self.log('{}:{}'.format(event_name, data))
self.notify("Звонок в дверь!!!", name = self.args['notify']) globals.send_telegram(self, "Звонок в дверь!!!", target = self.args['notify'])
if 'doorbell_pic' in data: if 'doorbell_pic' in data:
extra_data = {'photo': {'url':data['doorbell_pic']}} globals.send_telegram_photo(self, data['doorbell_pic'], target = self.args['notify'], caption = "Фото звонившего")
self.notify("Фото звонившего", name = self.args['notify'], data=extra_data)
self.say('Звонок в дверь') self.say('Звонок в дверь')
+51 -20
View File
@@ -2,22 +2,59 @@ import importlib
import subprocess import subprocess
from typing import Any, Tuple, Union from typing import Any, Tuple, Union
#
# Global module
# contain global functions
#
# Args:
#
# None
#
# Release Notes
#
# Version 1.0:
# Initial Version
"""Define various constants.""" """Define various constants."""
CONF_PEOPLE = 'people' CONF_PEOPLE = 'people'
# --- Telegram notifications -------------------------------------------------
#
# HA 2026.2 deprecated the per-platform notify.telegram* services in favour
# of entity-based targeting (see repairs.issue_registry: telegram/migrate_notify).
# The generic notify.send_message service only supports message/title, so it
# can't carry parse_mode/photo/keyboard payloads our apps rely on - instead we
# target the telegram_bot integration's own (non-deprecated) domain services
# (telegram_bot.send_message / telegram_bot.send_photo) with entity_id, which
# is the current 1:1 replacement for the old chat_id-based notify.telegram*.
#
# Entity ids come from .storage/core.entity_registry (platform: telegram_bot),
# mapped from the friendly names ('telegram', 'telegram_monster',
# 'telegram_sveta') used throughout apps.yaml configs.
TELEGRAM_TARGETS = {
'telegram': 'notify.home_assistant_fonvizina_fonvizina_18_1001567589226',
'telegram_monster': 'notify.home_assistant_fonvizina_monster_123622180',
'telegram_sveta': 'notify.home_assistant_fonvizina_svetlana_205225134',
}
def send_telegram(self, message, target='telegram', parse_mode='html', **kwargs):
"""Send a Telegram text message via telegram_bot.send_message.
Replacement for the deprecated `self.notify(message, name=target)`.
`target` is a friendly name from TELEGRAM_TARGETS (falls back to the
default group chat if unknown). Extra kwargs (title, keyboard, etc.) are
passed straight through to the service call.
"""
entity_id = TELEGRAM_TARGETS.get(target, TELEGRAM_TARGETS['telegram'])
service_data = {'entity_id': entity_id, 'message': message}
if parse_mode:
service_data['parse_mode'] = parse_mode
service_data.update(kwargs)
self.call_service('telegram_bot/send_message', **service_data)
def send_telegram_photo(self, url, target='telegram', caption=None, parse_mode='html', **kwargs):
"""Send a photo via telegram_bot.send_photo.
Replacement for the deprecated `self.notify(msg, name=target,
data={'photo': {'url': url}})`.
"""
entity_id = TELEGRAM_TARGETS.get(target, TELEGRAM_TARGETS['telegram'])
service_data = {'entity_id': entity_id, 'url': url}
if caption:
service_data['caption'] = caption
if parse_mode:
service_data['parse_mode'] = parse_mode
service_data.update(kwargs)
self.call_service('telegram_bot/send_photo', **service_data)
# -----------------------------------------------------------------------------
def most_common(the_list: list) -> Any: def most_common(the_list: list) -> Any:
"""Return the most common element in a list.""" """Return the most common element in a list."""
return max(set(the_list), key=the_list.count) return max(set(the_list), key=the_list.count)
@@ -57,12 +94,8 @@ def get_group_entities(self, group):
return [] return []
if 'attributes' in attributes: if 'attributes' in attributes:
attributes = attributes['attributes'] attributes = attributes['attributes']
#group
if "entity_id" in attributes: if "entity_id" in attributes:
return attributes["entity_id"] return attributes["entity_id"]
#simple item
return [group] return [group]
def turn_on(self, entity_id, state): def turn_on(self, entity_id, state):
@@ -78,14 +111,12 @@ def turn_off(self, entity_id, state):
self.turn_off(entity_id, state) self.turn_off(entity_id, state)
def notification(self, to, message): def notification(self, to, message):
self.notify(message, name = "telegram") send_telegram(self, message, target = "telegram")
def get_arg(args, key): def get_arg(args, key):
key = args[key] key = args[key]
return key return key
def get_arg_list(args, key): def get_arg_list(args, key):
arg_list = [] arg_list = []
if isinstance(args[key], list): if isinstance(args[key], list):
+2 -2
View File
@@ -1,4 +1,5 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
import globals
# #
# Aqara lock notifications # Aqara lock notifications
@@ -51,5 +52,4 @@ class AqaraLock(hass.Hass):
self.notify_tg("Неизвестное событие замка: {}".format(eventname)) self.notify_tg("Неизвестное событие замка: {}".format(eventname))
def notify_tg(self, msg): def notify_tg(self, msg):
extra_data = {'parse_mode': 'html'} globals.send_telegram(self, msg, target = self.args['notify'])
self.notify(msg, name = self.args['notify'], data=extra_data)
+2 -2
View File
@@ -1,4 +1,5 @@
import datetime import datetime
import globals
from automation import Automation, Base # type: ignore from automation import Automation, Base # type: ignore
# #
@@ -61,5 +62,4 @@ class Balance(Base):
def notify_tg(self, msg): def notify_tg(self, msg):
if not 'notify' in self.args: if not 'notify' in self.args:
return return
extra_data = {'parse_mode': 'html'} globals.send_telegram(self, msg, target = self.args['notify'])
self.notify(msg, name = self.args['notify'], data=extra_data)
+2 -1
View File
@@ -1,5 +1,6 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
import datetime import datetime
import globals
# #
# App to send email report for devices running low on battery # App to send email report for devices running low on battery
@@ -62,4 +63,4 @@ class Battery(hass.Hass):
if low: # or ("always_send" in self.args and self.args["always_send"] == 1) or ("force" in kwargs and kwargs["force"] == 1): if low: # or ("always_send" in self.args and self.args["always_send"] == 1) or ("force" in kwargs and kwargs["force"] == 1):
if message != "": if message != "":
self.notify(message, name = "telegram") globals.send_telegram(self, message)
@@ -1,5 +1,6 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
import datetime import datetime
import globals
class BMSMonitor(hass.Hass): class BMSMonitor(hass.Hass):
def initialize(self): def initialize(self):
@@ -159,7 +160,6 @@ class BMSMonitor(hass.Hass):
def send_telegram(self, message, parse_mode="html"): def send_telegram(self, message, parse_mode="html"):
try: try:
extra_data = {'parse_mode': parse_mode} globals.send_telegram(self, message, target = self.notification_target, parse_mode = parse_mode)
self.notify(message, name = self.notification_target, data=extra_data)
except Exception as e: except Exception as e:
self.log(f"Ошибка отправки Telegram: {e}") self.log(f"Ошибка отправки Telegram: {e}")
+44 -29
View File
@@ -1,6 +1,4 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
from datetime import timedelta
import datetime
# #
# App to show dishwasher state # App to show dishwasher state
@@ -18,58 +16,75 @@ import datetime
class Dishwasher(hass.Hass): class Dishwasher(hass.Hass):
listen_event_handle_list = [] listen_event_handle_list = []
run_state = ""
def initialize(self): def initialize(self):
if 'run_state' not in self.args or 'door_sensor' not in self.args or 'counter' not in self.args: if 'run_state' not in self.args or 'door_sensor' not in self.args or 'counter' not in self.args or 'state_extended' not in self.args:
self.log("Please define all args") self.log("Please define all args")
return return
self.listen_event_handle_list.append(self.listen_state(self.door_state_change, self.args['door_sensor'])) #, attribute='action' self.listen_event_handle_list.append(self.listen_state(self.door_state_change, self.args['door_sensor']))
self.listen_event_handle_list.append(self.listen_state(self.run_state_change, self.args['run_state'])) #, attribute='action' self.listen_event_handle_list.append(self.listen_state(self.run_state_change, self.args['run_state']))
def get_extended_state(self):
return self.get_state(self.args['state_extended'])
def set_extended_state(self, state):
self.call_service("input_select/select_option", entity_id = self.args['state_extended'], option = state)
def door_state_change(self, entity, attribute, old, new, kwargs): def door_state_change(self, entity, attribute, old, new, kwargs):
if (new == "on"): if new != "on":
self.call_service("counter/increment", entity_id = self.args['counter']) return
if (self.run_state == "finished"):
self.run_state = "collecting" self.call_service("counter/increment", entity_id = self.args['counter'])
self.set_light_state_by_counter() extended_state = self.get_extended_state()
open_count = int(self.get_state(self.args['counter']))
if extended_state == "Washed":
self.set_extended_state("Empty")
elif extended_state == "Empty":
if open_count < 10:
self.set_extended_state("Collecting Dishes")
elif open_count > 10:
self.set_extended_state("Ready to wash")
elif extended_state == "Collecting Dishes" and open_count > 10:
self.set_extended_state("Ready to wash")
self.set_light_state_by_counter()
def run_state_change(self, entity, attribute, old, new, kwargs): def run_state_change(self, entity, attribute, old, new, kwargs):
self.log("event: {}: {}->{}".format(attribute,old,new)) self.log("event: {}: {}->{}".format(attribute, old, new))
if (new == "Run"): if new == "Run":
self.log('resetting counter') self.log('resetting counter')
self.call_service("counter/reset", entity_id = self.args['counter']) self.call_service("counter/reset", entity_id = self.args['counter'])
self.run_state = "washing" self.set_extended_state("Washing")
if (new == "Finished"): elif new == "Finished":
self.log('resetting counter') self.log('resetting counter')
self.call_service("counter/reset", entity_id = self.args['counter']) self.call_service("counter/reset", entity_id = self.args['counter'])
self.run_state = "finished" self.set_extended_state("Washed")
self.log('Current state is: {}'.format(self.run_state)) self.log('Current state is: {}'.format(self.get_extended_state()))
self.set_light_state_by_counter() self.set_light_state_by_counter()
def set_light_state_by_counter(self): def set_light_state_by_counter(self):
state = self.get_state(self.args['counter']) open_count = self.get_state(self.args['counter'])
open_count = int(state) extended_state = self.get_extended_state()
self.log('counter state={}, machine state = {}'.format(state, self.run_state)) self.log('counter state={}, machine state = {}'.format(open_count, extended_state))
if (self.run_state == "finished"): if extended_state == "Washed":
# Есть посуда, которую нужно разобрать
# red color
self.log('Time to take dishes out.') self.log('Time to take dishes out.')
if 'lamp' in self.args: if 'lamp' in self.args:
self.call_service("light/turn_on", entity_id = self.args['lamp'], rgb_color=[255, 0, 0]) #red self.call_service("light/turn_on", entity_id = self.args['lamp'], rgb_color=[255, 0, 0])
elif (self.run_state == "washing"): elif extended_state == "Washing":
self.log('washing in progress') self.log('washing in progress')
self.call_service("light/turn_off", entity_id = self.args['lamp']) if 'lamp' in self.args:
self.call_service("light/turn_off", entity_id = self.args['lamp'])
elif (open_count > 10): elif extended_state == "Ready to wash":
self.log('Time to run dishwasher.') self.log('Time to run dishwasher.')
if 'lamp' in self.args: if 'lamp' in self.args:
self.call_service("light/turn_on", entity_id = self.args['lamp'], rgb_color=[245, 236, 0]) #yellow self.call_service("light/turn_on", entity_id = self.args['lamp'], rgb_color=[245, 236, 0])
else: elif 'lamp' in self.args:
self.call_service("light/turn_off", entity_id = self.args['lamp']) self.call_service("light/turn_off", entity_id = self.args['lamp'])
@@ -5,9 +5,10 @@ dishwasher:
class: Dishwasher class: Dishwasher
module: dishwasher module: dishwasher
constraint: input_boolean.dishwasher_state_light constraint: input_boolean.dishwasher_state_light
counter: counter.dishwasher_door_open_count counter: counter.bosch_dishwasher_door_open_count
door_sensor: binary_sensor.hc_dishwasher_door door_sensor: binary_sensor.bosch_dishwasher_door
run_state: sensor.hc_dishwasher_state run_state: sensor.bosch_dishwasher_operation_state
state_extended: input_select.bosch_dishwasher_state_extended
lamp: light.espresense_kitchen_led_1 lamp: light.espresense_kitchen_led_1
global_dependencies: global_dependencies:
- globals - globals
@@ -0,0 +1,90 @@
import appdaemon.plugins.hass.hassapi as hass
import random
#
# App to remind about dishwasher when someone enters the kitchen
#
# Args:
#
# state_extended = input_select with extended dishwasher state
# motion_sensors = list of motion sensors to watch
# alice = Yandex Station media_player entity
# cooldown (optional) = seconds between reminders, default 1800
# constraint (optional) = input_boolean to enable/disable the app
#
# Release Notes
#
# Version 1.0:
# Initial Version
# Version 1.1:
# Added "Ready to wash" reminders
class DishwasherReminder(hass.Hass):
PHRASES_WASHED = [
"Посудомойка готова! Пора разобрать посуду.",
"Чистая посуда сидит в посудомойке как в Open Space — пора выпустить на волю.",
"Посудомойка отработала, теперь твоя очередь — разгрузить.",
"Тарелки уже высохли и скучают, спаси их из посудомойки.",
"Посудомойка не склад для чистого, разгрузи уже.",
"Грязной посуды нет, а чистая застряла внутри — спасательная операция!",
"Посудомойка помыла всё, осталось только разобрать. Ну же!",
"Чистые тарелки устроили вечеринку в посудомойке — пора их разогнать.",
"Не забудь разобрать посудомойку, иначе завтра некуда будет класть грязное.",
"Посудомойка ждёт разгрузки — всё помыто, высушено и нетерпеливо дребезжит.",
]
PHRASES_READY_TO_WASH = [
"Посудомойка скучает без работы — пора её запустить.",
"Гора посуды накопилась, посудомойка просит смелости нажать пуск.",
"Тарелки в посудомойке собрались на митинг — жми старт и отпусти их мыться.",
"Посудомойка готова к бою, осталось только нажать кнопку.",
"Хватит кормить посудомойку тарелками — пора включить и отдохнуть.",
"Посудомойка смотрит на тебя с надеждой — запускай программу.",
"Грязная посуда накопилась как снежный ком — время пустить посудомойку в ход.",
"Твои тарелки ждут водных процедур — включай посудомойку!",
"Посудомойка обидится, если её ещё раз оставят без дела — жми пуск.",
"Посуда застряла в посудомойке без мытья — самое время нажать старт и уйти пить чай.",
]
STATE_PHRASES = {
"Washed": PHRASES_WASHED,
"Ready to wash": PHRASES_READY_TO_WASH,
}
def initialize(self):
if 'state_extended' not in self.args or 'motion_sensors' not in self.args or 'alice' not in self.args:
self.log("Please define state_extended, motion_sensors and alice")
return
self.cooldown = self.args.get('cooldown', 1800)
self.last_announced = {}
for sensor in self.args['motion_sensors']:
self.listen_state(self.motion_detected, sensor)
def motion_detected(self, entity, attribute, old, new, kwargs):
if new != "on" or old == "on":
return
# if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
# self.log('disabled by constraint')
# return
state = self.get_state(self.args['state_extended'])
phrases = self.STATE_PHRASES.get(state)
if phrases is None:
return
last = self.last_announced.get(state)
if last is not None:
elapsed = (self.datetime() - last).total_seconds()
if elapsed < self.cooldown:
self.log('cooldown active for {}, skipping'.format(state))
return
self.say(random.choice(phrases))
self.last_announced[state] = self.datetime()
def say(self, command):
self.log('command = {}'.format(command))
self.call_service('media_player/play_media', entity_id=self.args['alice'], media_content_type='text', media_content_id=command)
@@ -0,0 +1,15 @@
#################################
# DISHWASHER REMINDER #
#################################
dishwasher_reminder:
class: DishwasherReminder
module: dishwasher_reminder
# constraint: input_boolean.dishwasher_reminder
state_extended: input_select.bosch_dishwasher_state_extended
motion_sensors:
- binary_sensor.motion_kitchenset_left_occupancy
- binary_sensor.motion_kitchenset_right_occupancy
alice: media_player.yandex_station_m00r46000m53db
cooldown: 3600
global_dependencies:
- globals
@@ -1,5 +1,6 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
import datetime import datetime
import globals
# #
# App to send reports about unsuccessfull auths # App to send reports about unsuccessfull auths
@@ -24,5 +25,5 @@ class Security(hass.Hass):
def state_change(self, entity, attribute, old, new, kwargs): def state_change(self, entity, attribute, old, new, kwargs):
notifier = self.args.get('notify', 'telegram') notifier = self.args.get('notify', 'telegram')
self.notify(new, name = notifier) globals.send_telegram(self, new, target = notifier)
self.log(new) self.log(new)
@@ -1,6 +1,7 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
from datetime import timedelta from datetime import timedelta
import datetime import datetime
import globals
# #
# App to send email report for devices running low on battery # App to send email report for devices running low on battery
@@ -78,5 +79,4 @@ class Teeth(hass.Hass):
notify = self.args["notify"] notify = self.args["notify"]
now = datetime.datetime.now()+timedelta(hours=3) now = datetime.datetime.now()+timedelta(hours=3)
message="Уже {}, а ты еще не почистил зубы. Самое время =)".format(now.strftime("%H:%M")) message="Уже {}, а ты еще не почистил зубы. Самое время =)".format(now.strftime("%H:%M"))
self.notify(message, name = notify) globals.send_telegram(self, message, target = notify)
@@ -69,7 +69,7 @@ class WaterCountersAlarm(hass.Hass):
if send_devices or ("always_send" in self.args and self.args["always_send"] == 1) or ("force" in kwargs and kwargs["force"] == 1): if send_devices or ("always_send" in self.args and self.args["always_send"] == 1) or ("force" in kwargs and kwargs["force"] == 1):
if message != "": if message != "":
self.notify(message, name = "telegram") globals.send_telegram(self, message)
def check_checkup_dates(self, kwargs): def check_checkup_dates(self, kwargs):
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']): if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
@@ -106,4 +106,4 @@ class WaterCountersAlarm(hass.Hass):
if checkup_devices or ("always_send" in self.args and self.args["always_send"] == 1) or ("force" in kwargs and kwargs["force"] == 1): if checkup_devices or ("always_send" in self.args and self.args["always_send"] == 1) or ("force" in kwargs and kwargs["force"] == 1):
if message != "": if message != "":
self.notify(message, name = "telegram") globals.send_telegram(self, message)
+2 -1
View File
@@ -1,4 +1,5 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
import globals
# #
# Notification system # Notification system
@@ -42,7 +43,7 @@ class TelegramNotifyTarget(BaseNotifyTarget):
target = self.target_sveta target = self.target_sveta
hass.log('notifying over telegram person {} with message: {}'.format(target, message)) hass.log('notifying over telegram person {} with message: {}'.format(target, message))
hass.notify(message, name=target) globals.send_telegram(hass, message, target=target)
class Notification(hass.Hass): class Notification(hass.Hass):
home_targets = [AliceNotifyTarget()] home_targets = [AliceNotifyTarget()]
@@ -32,7 +32,7 @@ class ReportByPresence(hass.Hass):
def return_home_mode(self, event_id, event_args, kwargs): def return_home_mode(self, event_id, event_args, kwargs):
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']): if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
return return
self.notify("Добро пожаловать домой!", name = self.args['notify']) globals.send_telegram(self, "Добро пожаловать домой!", target = self.args['notify'])
############# AWAY REPORT ########################## ############# AWAY REPORT ##########################
def send_report(self, kwargs): def send_report(self, kwargs):
@@ -46,6 +46,6 @@ class ReportByPresence(hass.Hass):
message += '{} ({}) = {}\n'.format(self.friendly_name(entity), entity, self.get_state(entity)) message += '{} ({}) = {}\n'.format(self.friendly_name(entity), entity, self.get_state(entity))
if any: if any:
message = "В доме остались работать следующие устройства:\n" + message message = "В доме остались работать следующие устройства:\n" + message
self.notify(message, name = self.args['notify']) globals.send_telegram(self, message, target = self.args['notify'])
else: else:
self.notify("Все устройства в доме выключены.", name = self.args['notify']) globals.send_telegram(self, "Все устройства в доме выключены.", target = self.args['notify'])
@@ -1,5 +1,6 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
import datetime import datetime
import globals
# #
# Water control application. # Water control application.
@@ -56,11 +57,11 @@ class WaterValveControl(hass.Hass):
if name is None: if name is None:
name = device name = device
device_names += name device_names += name
self.notify('В доме остались требующие воды устройства ({}), подача воды не будет отключена.'.format(device_names), name = self.args['notify']) globals.send_telegram(self, 'В доме остались требующие воды устройства ({}), подача воды не будет отключена.'.format(device_names), target = self.args['notify'])
self.cancel_current_timer() self.cancel_current_timer()
self.timers.append(self.run_every(self.wait_when_device_is_done, self.datetime()+datetime.timedelta(seconds=5), 5*60)) self.timers.append(self.run_every(self.wait_when_device_is_done, self.datetime()+datetime.timedelta(seconds=5), 5*60))
else: else:
self.notify('Отключаю подачу воды.', name = self.args['notify']) globals.send_telegram(self, 'Отключаю подачу воды.', target = self.args['notify'])
self.turn_off(self.args['water_valve']) self.turn_off(self.args['water_valve'])
# for device in self.args['water_devices']: # for device in self.args['water_devices']:
# self.turn_off(device) # self.turn_off(device)
@@ -77,7 +78,7 @@ class WaterValveControl(hass.Hass):
self.current_wait_cycle = self.current_wait_cycle+1 self.current_wait_cycle = self.current_wait_cycle+1
elif len(powered_on) == 0 and self.current_wait_cycle>=self.wait_cycles: elif len(powered_on) == 0 and self.current_wait_cycle>=self.wait_cycles:
self.current_wait_cycle = 0 self.current_wait_cycle = 0
self.notify('Устройства требующие воды закончили свою работу, отключаю подачу воды.', name = self.args['notify']) globals.send_telegram(self, 'Устройства требующие воды закончили свою работу, отключаю подачу воды.', target = self.args['notify'])
self.turn_off_water_devices() self.turn_off_water_devices()
self.cancel_current_timer() self.cancel_current_timer()
@@ -9,6 +9,6 @@ water_action:
constraint: input_boolean.water_control constraint: input_boolean.water_control
water_devices: water_devices:
- binary_sensor.washer_running # стиралка - binary_sensor.washer_running # стиралка
- binary_sensor.hc_dishwasher_running # посудомойка - binary_sensor.bosch_dishwasher_running # посудомойка
global_dependencies: global_dependencies:
- globals - globals
+4 -6
View File
@@ -1,5 +1,6 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
import requests import requests
import globals
from datetime import datetime from datetime import datetime
class TelegramInternetControl(hass.Hass): class TelegramInternetControl(hass.Hass):
@@ -39,8 +40,8 @@ class TelegramInternetControl(hass.Hass):
"event.home_assistant_fonvizina_update_event" "event.home_assistant_fonvizina_update_event"
) )
# Сервис для отправки ответов в Telegram # Цель (friendly name из globals.TELEGRAM_TARGETS) для отправки ответов в Telegram
self.notify_service = self.args.get("notify_service", "notify/telegram") self.notify_target = self.args.get("notify_target", "telegram")
# Сохраняем последнее обработанное время (для пропуска дублей) # Сохраняем последнее обработанное время (для пропуска дублей)
self.last_processed_time = None self.last_processed_time = None
@@ -257,10 +258,7 @@ class TelegramInternetControl(hass.Hass):
Отправка ответа в Telegram. Отправка ответа в Telegram.
""" """
try: try:
self.call_service( globals.send_telegram(self, message, target = self.notify_target)
self.notify_service,
message=message
)
self.log(f"Telegram message sent: {message}") self.log(f"Telegram message sent: {message}")
except Exception as e: except Exception as e:
self.log(f"Error sending Telegram message: {str(e)}") self.log(f"Error sending Telegram message: {str(e)}")
+4 -2
View File
@@ -23,5 +23,7 @@ keenetic:
# Entity для прослушивания событий # Entity для прослушивания событий
telegram_event_entity: "event.home_assistant_fonvizina_update_event" telegram_event_entity: "event.home_assistant_fonvizina_update_event"
# Сервис для отправки уведомлений в Telegram # Цель отправки уведомлений (friendly name из globals.TELEGRAM_TARGETS,
notify_service: "notify/telegram" # см. appdaemon/settings/apps/globals.py). Раньше здесь был deprecated
# notify_service: "notify/telegram".
notify_target: "telegram"
@@ -1,5 +1,6 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
import fnmatch import fnmatch
import globals
# #
# Fire sensors alarm notification # Fire sensors alarm notification
@@ -45,4 +46,4 @@ class FireSensorsReport(hass.Hass):
friendly_name = self.friendly_name(entity) friendly_name = self.friendly_name(entity)
entity = entity.replace('_', '-') entity = entity.replace('_', '-')
message = "Сработал датчик пожарной сигнализации {} ({}) = {}-{}!".format(friendly_name, entity, old, new) message = "Сработал датчик пожарной сигнализации {} ({}) = {}-{}!".format(friendly_name, entity, old, new)
self.notify(message, name = self.args['notify']) globals.send_telegram(self, message, target = self.args['notify'])
@@ -1,5 +1,6 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
import fnmatch import fnmatch
import globals
# #
# Security sensors alarm notification # Security sensors alarm notification
@@ -56,4 +57,4 @@ class SecuritySensorsReport(hass.Hass):
friendly_name = self.friendly_name(entity) friendly_name = self.friendly_name(entity)
entity = entity.replace('_', '-') entity = entity.replace('_', '-')
message = "В ваше отсутствие сработал датчик безопастности {} ({}) = {}->{}!".format(friendly_name, entity, old, new) message = "В ваше отсутствие сработал датчик безопастности {} ({}) = {}->{}!".format(friendly_name, entity, old, new)
self.notify(message, name = self.args['notify']) globals.send_telegram(self, message, target = self.args['notify'])
@@ -1,4 +1,5 @@
import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.hass.hassapi as hass
import globals
# #
# Water leak detector # Water leak detector
@@ -54,9 +55,9 @@ class WaterLeak(hass.Hass):
self.call_service("mqtt/publish", topic = 'home/watercontrol/bath/valve/set', payload = 'close') self.call_service("mqtt/publish", topic = 'home/watercontrol/bath/valve/set', payload = 'close')
message = "ВНИМАНИЕ! В ваше отстутствие сработал датчик протечки воды ({})!!! Выключаю подачу воды.".format(self.friendly_name(entity_id)) message = "ВНИМАНИЕ! В ваше отстутствие сработал датчик протечки воды ({})!!! Выключаю подачу воды.".format(self.friendly_name(entity_id))
self.notify(message, name = self.args['notify']) globals.send_telegram(self, message, target = self.args['notify'])
message = "Состояние датчиков протечки:\n" message = "Состояние датчиков протечки:\n"
for entity_id in self.sensors: for entity_id in self.sensors:
message += '{} ({}) = {}\n'.format(self.friendly_name(entity_id), entity_id, self.get_state(entity_id)) message += '{} ({}) = {}\n'.format(self.friendly_name(entity_id), entity_id, self.get_state(entity_id))
self.notify(message, name = self.args['notify']) globals.send_telegram(self, message, target = self.args['notify'])
@@ -167,5 +167,4 @@ class EpdBalanceSensor(hass.Hass):
def notify_tg(self, msg): def notify_tg(self, msg):
if not 'notify' in self.args: if not 'notify' in self.args:
return return
extra_data = {'parse_mode': 'html'} globals.send_telegram(self, msg, target = self.args['notify'])
self.notify(msg, name = self.args['notify'], data=extra_data)
+11 -8
View File
@@ -7,14 +7,17 @@ Arguments:
- events: List of events to monitor - events: List of events to monitor
""" """
class Test(hass.Hass): class Test(hass.Hass):
notify = None # notify = None
def initialize(self) -> None: def initialize(self) -> None:
self.listen_state(self.sensor_trigger, 'sensor.0x00158d0003a361d8_action') self.log("hello")
self.listen_state(self.sensor_trigger, 'binary_sensor.0x00158d0003f26d61_occupancy') # notifier = self.args.get("notify", "telegram")
# self.listen_state(self.sensor_trigger, 'sensor.remote20_action') # self.notify("hello world", name = "telegram")
# self.listen_state(self.sensor_trigger, "sensor.0x00158d0003a361d8_action")
# self.listen_state(self.sensor_trigger, "binary_sensor.0x00158d0003f26d61_occupancy")
# self.listen_state(self.sensor_trigger, "sensor.remote20_action")
def sensor_trigger(self, entity, attribute, old, new, kwargs): # def sensor_trigger(self, entity, attribute, old, new, kwargs):
if new != "" and new != "unknown": # if new != "" and new != "unknown":
self.log("doorbell call") # self.log("doorbell call")
self.toggle("switch.0x00158d00020f3a29_switch") # self.toggle("switch.0x00158d00020f3a29_switch")
+20 -18
View File
@@ -32,7 +32,7 @@ services:
max-size: 50m max-size: 50m
hass: hass:
image: "homeassistant/home-assistant:stable" #stable image: "homeassistant/home-assistant:stable" #2026.4.2
#image: ghcr.io/home-assistant/home-assistant:stable #image: ghcr.io/home-assistant/home-assistant:stable
container_name: hass container_name: hass
volumes: volumes:
@@ -121,10 +121,12 @@ services:
volumes: volumes:
- ./zigbee2mqtt/settings:/app/data - ./zigbee2mqtt/settings:/app/data
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"] # в образе нет curl (Alpine), используем wget --spider
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8080"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 6 retries: 6
start_period: 60s
restart: always restart: always
logging: logging:
driver: json-file driver: json-file
@@ -184,22 +186,22 @@ services:
max-size: "10m" max-size: "10m"
max-file: "5" max-file: "5"
homeconnect2mqtt: #homeconnect2mqtt:
build: # build:
context: ./homeconnect2mqtt/docker # context: ./homeconnect2mqtt/docker
dockerfile: Dockerfile # dockerfile: Dockerfile
restart: always # restart: always
container_name: homeconnect2mqtt # container_name: homeconnect2mqtt
ports: # ports:
- "5001:5000" # - "5001:5000"
env_file: ./homeconnect2mqtt/settings/homeconnect2mqtt.env # env_file: ./homeconnect2mqtt/settings/homeconnect2mqtt.env
volumes: # volumes:
- ./homeconnect2mqtt/settings/config.json:/app/config.json:ro # - ./homeconnect2mqtt/settings/config.json:/app/config.json:ro
logging: # logging:
driver: json-file # driver: json-file
options: # options:
max-size: "10m" # max-size: "10m"
max-file: "5" # max-file: "5"
matter-bridge: matter-bridge:
image: ghcr.io/t0bst4r/home-assistant-matter-hub:latest image: ghcr.io/t0bst4r/home-assistant-matter-hub:latest
+1 -1
View File
@@ -1 +1 @@
2026.4.2 2026.7.2
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

+1 -1
View File
@@ -1 +1 @@
{"pid": 238780, "version": 1, "ha_version": "2026.4.2", "start_ts": 1781684834.86627} {"pid": 71, "version": 1, "ha_version": "2026.7.2", "start_ts": 1784034083.5601983}
+48 -38
View File
@@ -21,55 +21,65 @@
# {{ states('sensor.dishwasher_program_progress') + "%" }} # {{ states('sensor.dishwasher_program_progress') + "%" }}
# {% endif %} # {% endif %}
mqtt: # mqtt:
sensor: # sensor:
- name: hc_dishwasher_state # - name: hc_dishwasher_state
unique_id: hc_dishwasher_state # unique_id: hc_dishwasher_state
state_topic: "homeconnect/dishwasher/state" # state_topic: "homeconnect/dishwasher/state"
value_template: "{{ value_json.state }}" # value_template: "{{ value_json.state }}"
json_attributes_topic: "homeconnect/dishwasher/state" # json_attributes_topic: "homeconnect/dishwasher/state"
- name: hc_dishwasher_remaining # - name: hc_dishwasher_remaining
unique_id: hc_dishwasher_remaining # unique_id: hc_dishwasher_remaining
state_topic: "homeconnect/dishwasher/state" # state_topic: "homeconnect/dishwasher/state"
value_template: "{{ value_json.remaining }}" # value_template: "{{ value_json.remaining }}"
json_attributes_topic: "homeconnect/dishwasher/state" # json_attributes_topic: "homeconnect/dishwasher/state"
binary_sensor: # binary_sensor:
- state_topic: "homeconnect/dishwasher/state" # - state_topic: "homeconnect/dishwasher/state"
name: hc_dishwasher_door # name: hc_dishwasher_door
unique_id: hc_dishwasher_door # unique_id: hc_dishwasher_door
device_class: opening # device_class: opening
payload_on: "Open" # payload_on: "Open"
payload_off: "Closed" # payload_off: "Closed"
value_template: "{{ value_json.door }}" # value_template: "{{ value_json.door }}"
json_attributes_topic: "homeconnect/dishwasher/state" # json_attributes_topic: "homeconnect/dishwasher/state"
- state_topic: "homeconnect/dishwasher/state" # - state_topic: "homeconnect/dishwasher/state"
name: hc_dishwasher_power # name: hc_dishwasher_power
unique_id: hc_dishwasher_power # unique_id: hc_dishwasher_power
payload_on: true # payload_on: true
payload_off: false # payload_off: false
value_template: "{{ value_json.power }}" # value_template: "{{ value_json.power }}"
json_attributes_topic: "homeconnect/dishwasher/state" # json_attributes_topic: "homeconnect/dishwasher/state"
template: template:
binary_sensor: binary_sensor:
- name: hc_dishwasher_running - name: bosch_dishwasher_running
unique_id: hc_dishwasher_running unique_id: bosch_dishwasher_running
state: "{{ is_state('sensor.hc_dishwasher_state', 'Run') }}" state: "{{ is_state('sensor.bosch_dishwasher_operation_state', 'Run') }}"
counter: counter:
dishwasher_door_open_count: bosch_dishwasher_door_open_count:
name: dishwasher_door_open_count name: bosch_dishwasher_door_open_count
input_select:
bosch_dishwasher_state_extended:
name: bosch_dishwasher_state_extended
options:
- 'Empty'
- 'Washing'
- 'Washed'
- 'Collecting Dishes'
- 'Ready to wash'
homeassistant: homeassistant:
customize: customize:
sensor.hc_dishwasher_state: sensor.bosch_dishwasher_state:
friendly_name: Посудомойка Статус friendly_name: Посудомойка Статус
binary_sensor.hc_dishwasher_door: binary_sensor.bosch_dishwasher_door:
friendly_name: Посудомойка Дверца friendly_name: Посудомойка Дверца
binary_sensor.hc_dishwasher_remaining: binary_sensor.bosch_dishwasher_remaining:
friendly_name: Посудомойка До конца программы friendly_name: Посудомойка До конца программы
sensor.hc_dishwasher_running: sensor.bosch_dishwasher_running:
friendly_name: Посудомоечная машина friendly_name: Посудомоечная машина
binary_sensor.hc_dishwasher_power: binary_sensor.bosch_dishwasher_power:
friendly_name: Посудомойка Питание friendly_name: Посудомойка Питание
@@ -1,21 +1,14 @@
telegram_bot: # telegram_bot: секция удалена — интеграция уже настроена через config entry
- platform: polling # (UI, импортирован 2025-12-28), YAML-платформа с ней конфликтовала:
api_key: !secret telegram_key # ERROR integration telegram_bot cannot be merged, expected a dict
allowed_chat_ids: #
- !secret telegram_group_chat # notify: платформы (legacy, deprecated) тоже убраны — все appdaemon-скрипты
- !secret telegram_monster_chat # мигрированы на entity-based telegram_bot.send_message/send_photo (см.
- !secret telegram_sveta_chat # appdaemon/settings/apps/globals.py: TELEGRAM_TARGETS, send_telegram(),
# send_telegram_photo()). Проверено: тестовые сообщения через новый механизм
notify: # успешно доставлены во все 3 чата (группа, Monster, Svetlana) 2026-07-14.
- platform: telegram #
name: telegram # Telegram bot notify-сущности теперь берутся из config entry:
chat_id: !secret telegram_group_chat # notify.home_assistant_fonvizina_fonvizina_18_1001567589226
parse_mode: html # notify.home_assistant_fonvizina_monster_123622180
- platform: telegram # notify.home_assistant_fonvizina_svetlana_205225134
name: telegram_monster
chat_id: !secret telegram_monster_chat
parse_mode: html
- platform: telegram
name: telegram_sveta
chat_id: !secret telegram_sveta_chat
parse_mode: html
@@ -0,0 +1,21 @@
telegram_bot:
- platform: polling
api_key: !secret telegram_key
allowed_chat_ids:
- !secret telegram_group_chat
- !secret telegram_monster_chat
- !secret telegram_sveta_chat
notify:
- platform: telegram
name: telegram
chat_id: !secret telegram_group_chat
parse_mode: html
- platform: telegram
name: telegram_monster
chat_id: !secret telegram_monster_chat
parse_mode: html
- platform: telegram
name: telegram_sveta
chat_id: !secret telegram_sveta_chat
parse_mode: html
@@ -9,13 +9,13 @@ const n=globalThis,a=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow
* @license * @license
* Copyright 2017 Google LLC * Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/,{is:c,defineProperty:_,getOwnPropertyDescriptor:h,getOwnPropertyNames:d,getOwnPropertySymbols:g,getPrototypeOf:p}=Object,m=globalThis,u=m.trustedTypes,v=u?u.emptyScript:"",f=m.reactiveElementPolyfillSupport,b=(e,t)=>e,y={toAttribute(e,t){switch(t){case Boolean:e=e?v:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},w=(e,t)=>!c(e,t),C={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;let x=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=C){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),a=this.getPropertyDescriptor(e,n,t);void 0!==a&&_(this.prototype,e,a)}}static getPropertyDescriptor(e,t,n){const{get:a,set:l}=h(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:a,set(t){const s=a?.call(this);l?.call(this,t),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??C}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const e=p(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const e=this.properties,t=[...d(e),...g(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(r(e))}else void 0!==e&&t.push(r(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(a)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const a of t){const t=document.createElement("style"),l=n.litNonce;void 0!==l&&t.setAttribute("nonce",l),t.textContent=a.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),a=this.constructor._$Eu(e,n);if(void 0!==a&&!0===n.reflect){const l=(void 0!==n.converter?.toAttribute?n.converter:y).toAttribute(t,n.type);this._$Em=e,null==l?this.removeAttribute(a):this.setAttribute(a,l),this._$Em=null}}_$AK(e,t){const n=this.constructor,a=n._$Eh.get(e);if(void 0!==a&&this._$Em!==a){const e=n.getPropertyOptions(a),l="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:y;this._$Em=a,this[a]=l.fromAttribute(t,e.type)??this._$Ej?.get(a)??null,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){const a=this.constructor,l=this[e];if(n??=a.getPropertyOptions(e),!((n.hasChanged??w)(l,t)||n.useDefault&&n.reflect&&l===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:a,wrapped:l},s){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),!0!==l||void 0!==s)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===a&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return thLine truncated */,{is:c,defineProperty:h,getOwnPropertyDescriptor:_,getOwnPropertyNames:d,getOwnPropertySymbols:g,getPrototypeOf:p}=Object,m=globalThis,u=m.trustedTypes,v=u?u.emptyScript:"",f=m.reactiveElementPolyfillSupport,b=(e,t)=>e,y={toAttribute(e,t){switch(t){case Boolean:e=e?v:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},w=(e,t)=>!c(e,t),C={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;let x=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=C){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),a=this.getPropertyDescriptor(e,n,t);void 0!==a&&h(this.prototype,e,a)}}static getPropertyDescriptor(e,t,n){const{get:a,set:l}=_(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:a,set(t){const s=a?.call(this);l?.call(this,t),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??C}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const e=p(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const e=this.properties,t=[...d(e),...g(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(r(e))}else void 0!==e&&t.push(r(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(a)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const a of t){const t=document.createElement("style"),l=n.litNonce;void 0!==l&&t.setAttribute("nonce",l),t.textContent=a.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),a=this.constructor._$Eu(e,n);if(void 0!==a&&!0===n.reflect){const l=(void 0!==n.converter?.toAttribute?n.converter:y).toAttribute(t,n.type);this._$Em=e,null==l?this.removeAttribute(a):this.setAttribute(a,l),this._$Em=null}}_$AK(e,t){const n=this.constructor,a=n._$Eh.get(e);if(void 0!==a&&this._$Em!==a){const e=n.getPropertyOptions(a),l="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:y;this._$Em=a,this[a]=l.fromAttribute(t,e.type)??this._$Ej?.get(a)??null,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){const a=this.constructor,l=this[e];if(n??=a.getPropertyOptions(e),!((n.hasChanged??w)(l,t)||n.useDefault&&n.reflect&&l===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:a,wrapped:l},s){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),!0!==l||void 0!==s)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===a&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return thLine truncated
/** /**
* @license * @license
* Copyright 2017 Google LLC * Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
const S=globalThis,k=S.trustedTypes,A=k?k.createPolicy("lit-html",{createHTML:e=>e}):void 0,M="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,V="?"+$,T=`<${V}>`,E=document,O=()=>E.createComment(""),z=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,N="[ \t\n\f\r]",U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,B=/>/g,P=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),j=/'/g,L=/"/g,H=/^(?:script|style|textarea|title)$/i,I=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),F=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),J=new WeakMap,q=E.createTreeWalker(E,129);function W(e,t){if(!D(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==A?A.createHTML(t):t}const Z=(e,t)=>{const n=e.length-1,a=[];let l,s=2===t?"<svg>":3===t?"<math>":"",i=U;for(let t=0;t<n;t++){const n=e[t];let o,r,c=-1,_=0;for(;_<n.length&&(i.lastIndex=_,r=i.exec(n),null!==r);)_=i.lastIndex,i===U?"!--"===r[1]?i=R:void 0!==r[1]?i=B:void 0!==r[2]?(H.test(r[2])&&(l=RegExp("</"+r[2],"g")),i=P):void 0!==r[3]&&(i=P):i===P?">"===r[0]?(i=l??U,c=-1):void 0===r[1]?c=-2:(c=i.lastIndex-r[2].length,o=r[1],i=void 0===r[3]?P:'"'===r[3]?L:j):i===L||i===j?i=P:i===R||i===B?i=U:(i=P,l=void 0);const h=i===P&&e[t+1].startsWith("/>")?" ":"";s+=i===U?n+T:c>=0?(a.push(o),n.slice(0,c)+M+n.slice(c)+$+h):n+$+(-2===c?t:h)}return[W(e,s+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),a]};class G{constructor({strings:e,_$litType$:t},n){let a;this.parts=[];let l=0,s=0;const i=e.length-1,o=this.parts,[r,c]=Z(e,t);if(this.el=G.createElement(r,n),q.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(a=q.nextNode())&&o.length<i;){if(1===a.nodeType){if(a.hasAttributes())for(const e of a.getAttributeNames())if(e.endsWith(M)){const t=c[s++],n=a.getAttribute(e).split($),i=/([.?@])?(.*)/.exec(t);o.push({type:1,index:l,name:i[2],strings:n,ctor:"."===i[1]?te:"?"===i[1]?ne:"@"===i[1]?ae:ee}),a.removeAttribute(e)}else e.startsWith($)&&(o.push({type:6,index:l}),a.removeAttribute(e));if(H.test(a.tagName)){const e=a.textContent.split($),t=e.length-1;if(t>0){a.textContent=k?k.emptyScript:"";for(let n=0;n<t;n++)a.append(e[n],O()),q.nextNode(),o.push({type:2,index:++l});a.append(e[t],O())}}}else if(8===a.nodeType)if(a.data===V)o.push({type:2,index:l});else{let e=-1;for(;-1!==(e=a.data.indexOf($,e+1));)o.push({type:7,index:l}),e+=$.length-1}l++}}static createElement(e,t){const n=E.createElement("template");return n.innerHTML=e,n}}function Y(e,t,n=e,a){if(t===F)return t;let l=void 0!==a?n._$Co?.[a]:n._$Cl;const s=z(t)?void 0:t._$litDirective$;return l?.constructor!==s&&(l?._$AO?.(!1),void 0===s?l=void 0:(l=new s(e),l._$AT(e,n,a)),void 0!==a?(n._$Co??=[])[a]=l:n._$Cl=l),void 0!==l&&(t=Y(e,l._$AS(e,t.values),l,a)),t}class Q{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,a=(e?.creationScope??E).importNode(t,!0);q.currentNode=a;let l=q.nextNode(),s=0,i=0,o=n[0];for(;void 0!==o;){if(s===o.index){let t;2===o.type?t=new X(l,l.nextSibling,this,e):1===o.type?t=new o.ctor(l,o.name,o.strings,this,e):6===o.type&&(t=new le(l,this,e)),this._$AV.push(t),o=n[++i]}s!==o?.index&&(l=q.nextNode(),s++)}return q.currentNode=E,a}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class X{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,a){this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=a,this._$Cv=a?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Y(this,e,t),z(e)?e===K||null==e||""===e?(this._$AH!==K&&this._$AR(),this._$AH=K):e!==this._$AH&&e!==F&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>D(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==K&&z(this._$AH)?this._$AA.nextSibling.data=e:this.T(E.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,a="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=G.createElement(W(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===a)this._$AH.p(t);else{const e=new Q(a,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=J.get(e.strings);return void 0===t&&J.set(e.strings,t=new G(e)),t}k(e){D(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,a=0;for(const l of e)a===t.length?t.push(n=new X(this.O(O()),this.O(O()),this,this.options)):n=t[a],n._$AI(l),a++;a<t.length&&(this._$AR(n&&n._$AB.nextSibling,a),t.length=a)}_$AR(e=this._$Line truncated const S=globalThis,k=S.trustedTypes,A=k?k.createPolicy("lit-html",{createHTML:e=>e}):void 0,$="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,V="?"+M,T=`<${V}>`,E=document,O=()=>E.createComment(""),z=e=>null===e||"object"!=typeof e&&"function"!=typeof e,B=Array.isArray,R="[ \t\n\f\r]",D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,N=/-->/g,U=/>/g,L=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),P=/'/g,j=/"/g,H=/^(?:script|style|textarea|title)$/i,I=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),F=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),q=new WeakMap,J=E.createTreeWalker(E,129);function W(e,t){if(!B(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==A?A.createHTML(t):t}const Z=(e,t)=>{const n=e.length-1,a=[];let l,s=2===t?"<svg>":3===t?"<math>":"",i=D;for(let t=0;t<n;t++){const n=e[t];let o,r,c=-1,h=0;for(;h<n.length&&(i.lastIndex=h,r=i.exec(n),null!==r);)h=i.lastIndex,i===D?"!--"===r[1]?i=N:void 0!==r[1]?i=U:void 0!==r[2]?(H.test(r[2])&&(l=RegExp("</"+r[2],"g")),i=L):void 0!==r[3]&&(i=L):i===L?">"===r[0]?(i=l??D,c=-1):void 0===r[1]?c=-2:(c=i.lastIndex-r[2].length,o=r[1],i=void 0===r[3]?L:'"'===r[3]?j:P):i===j||i===P?i=L:i===N||i===U?i=D:(i=L,l=void 0);const _=i===L&&e[t+1].startsWith("/>")?" ":"";s+=i===D?n+T:c>=0?(a.push(o),n.slice(0,c)+$+n.slice(c)+M+_):n+M+(-2===c?t:_)}return[W(e,s+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),a]};class G{constructor({strings:e,_$litType$:t},n){let a;this.parts=[];let l=0,s=0;const i=e.length-1,o=this.parts,[r,c]=Z(e,t);if(this.el=G.createElement(r,n),J.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(a=J.nextNode())&&o.length<i;){if(1===a.nodeType){if(a.hasAttributes())for(const e of a.getAttributeNames())if(e.endsWith($)){const t=c[s++],n=a.getAttribute(e).split(M),i=/([.?@])?(.*)/.exec(t);o.push({type:1,index:l,name:i[2],strings:n,ctor:"."===i[1]?te:"?"===i[1]?ne:"@"===i[1]?ae:ee}),a.removeAttribute(e)}else e.startsWith(M)&&(o.push({type:6,index:l}),a.removeAttribute(e));if(H.test(a.tagName)){const e=a.textContent.split(M),t=e.length-1;if(t>0){a.textContent=k?k.emptyScript:"";for(let n=0;n<t;n++)a.append(e[n],O()),J.nextNode(),o.push({type:2,index:++l});a.append(e[t],O())}}}else if(8===a.nodeType)if(a.data===V)o.push({type:2,index:l});else{let e=-1;for(;-1!==(e=a.data.indexOf(M,e+1));)o.push({type:7,index:l}),e+=M.length-1}l++}}static createElement(e,t){const n=E.createElement("template");return n.innerHTML=e,n}}function Y(e,t,n=e,a){if(t===F)return t;let l=void 0!==a?n._$Co?.[a]:n._$Cl;const s=z(t)?void 0:t._$litDirective$;return l?.constructor!==s&&(l?._$AO?.(!1),void 0===s?l=void 0:(l=new s(e),l._$AT(e,n,a)),void 0!==a?(n._$Co??=[])[a]=l:n._$Cl=l),void 0!==l&&(t=Y(e,l._$AS(e,t.values),l,a)),t}class Q{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,a=(e?.creationScope??E).importNode(t,!0);J.currentNode=a;let l=J.nextNode(),s=0,i=0,o=n[0];for(;void 0!==o;){if(s===o.index){let t;2===o.type?t=new X(l,l.nextSibling,this,e):1===o.type?t=new o.ctor(l,o.name,o.strings,this,e):6===o.type&&(t=new le(l,this,e)),this._$AV.push(t),o=n[++i]}s!==o?.index&&(l=J.nextNode(),s++)}return J.currentNode=E,a}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class X{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,a){this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=a,this._$Cv=a?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Y(this,e,t),z(e)?e===K||null==e||""===e?(this._$AH!==K&&this._$AR(),this._$AH=K):e!==this._$AH&&e!==F&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>B(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==K&&z(this._$AH)?this._$AA.nextSibling.data=e:this.T(E.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,a="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=G.createElement(W(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===a)this._$AH.p(t);else{const e=new Q(a,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=q.get(e.strings);return void 0===t&&q.set(e.strings,t=new G(e)),t}k(e){B(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,a=0;for(const l of e)a===t.length?t.push(n=new X(this.O(O()),this.O(O()),this,this.options)):n=t[a],n._$AI(l),a++;a<t.length&&(this._$AR(n&&n._$AB.nextSibling,a),t.length=a)}_$AR(e=this._$Line truncated
/** /**
* @license * @license
* Copyright 2017 Google LLC * Copyright 2017 Google LLC
@@ -31,9 +31,9 @@ const ce=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)
* @license * @license
* Copyright 2017 Google LLC * Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/,_e={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:w},he=(e=_e,t,n)=>{const{kind:a,metadata:l}=n;let s=globalThis.litPropertyMetadata.get(l);if(void 0===s&&globalThis.litPropertyMetadata.set(l,s=new Map),"setter"===a&&((e=Object.create(e)).wrapped=!0),s.set(n.name,e),"accessor"===a){const{name:a}=n;return{set(n){const l=t.get.call(this);t.set.call(this,n),this.requestUpdate(a,l,e)},init(t){return void 0!==t&&this.C(a,void 0,e,t),t}}}if("setter"===a){const{name:a}=n;return function(n){const l=this[a];t.call(this,n),this.requestUpdate(a,l,e)}}throw Error("Unsupported decorator location: "+a)};function de(e){return(t,n)=>"object"==typeof n?he(e,t,n):((e,t,n)=>{const a=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),a?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n) */,he={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:w},_e=(e=he,t,n)=>{const{kind:a,metadata:l}=n;let s=globalThis.litPropertyMetadata.get(l);if(void 0===s&&globalThis.litPropertyMetadata.set(l,s=new Map),"setter"===a&&((e=Object.create(e)).wrapped=!0),s.set(n.name,e),"accessor"===a){const{name:a}=n;return{set(n){const l=t.get.call(this);t.set.call(this,n),this.requestUpdate(a,l,e)},init(t){return void 0!==t&&this.C(a,void 0,e,t),t}}}if("setter"===a){const{name:a}=n;return function(n){const l=this[a];t.call(this,n),this.requestUpdate(a,l,e)}}throw Error("Unsupported decorator location: "+a)};function de(e){return(t,n)=>"object"==typeof n?_e(e,t,n):((e,t,n)=>{const a=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),a?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)
/** /**
* @license * @license
* Copyright 2017 Google LLC * Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/}const ge="jk-bms-content-card-editor",pe="jk-bms-card";var me;!function(e){e.delta_cell_voltage="delta_cell_voltage",e.balancing="balancing",e.balancing_current="balancing_current",e.power="power",e.balance_trigger_voltage="balance_trigger_voltage",e.balance_starting_voltage="balance_starting_voltage",e.total_runtime_formatted="total_runtime_formatted",e.charging="charging",e.charging_power="charging_power",e.discharging="discharging",e.discharging_power="discharging_power",e.balancer="balancer",e.heater="heater",e.total_voltage="total_voltage",e.total_battery_capacity_setting="total_battery_capacity_setting",e.total_charging_cycle_capacity="total_charging_cycle_capacity",e.average_cell_voltage="average_cell_voltage",e.current="current",e.state_of_charge="state_of_charge",e.capacity_remaining="capacity_remaining",e.charging_cycles="charging_cycles",e.power_tube_temperature="power_tube_temperature",e.min_voltage_cell="min_voltage_cell",e.max_voltage_cell="max_voltage_cell",e.min_cell_voltage="min_cell_voltage",e.max_cell_voltage="max_cell_voltage",e.errors="errors",e.software_version="software_version",e.hardware_version="hardware_version",e.cell_voltage_1="cell_voltage_1",e.cell_voltage_2="cell_voltage_2",e.cell_voltage_3="cell_voltage_3",e.cell_voltage_4="cell_voltage_4",e.cell_voltage_5="cell_voltage_5",e.cell_voltage_6="cell_voltage_6",e.cell_voltage_7="cell_voltage_7",e.cell_voltage_8="cell_voltage_8",e.cell_voltage_9="cell_voltage_9",e.cell_voltage_10="cell_voltage_10",e.cell_voltage_11="cell_voltage_11",e.cell_voltage_12="cell_voltage_12",e.cell_voltage_13="cell_voltage_13",e.cell_voltage_14="cell_voltage_14",e.cell_voltage_15="cell_voltage_15",e.cell_voltage_16="cell_voltage_16",e.cell_voltage_17="cell_voltage_17",e.cell_voltage_18="cell_voltage_18",e.cell_voltage_19="cell_voltage_19",e.cell_voltage_20="cell_voltage_20",e.cell_voltage_21="cell_voltage_21",e.cell_voltage_22="cell_voltage_22",e.cell_voltage_23="cell_voltage_23",e.cell_voltage_24="cell_voltage_24",e.cell_voltage_25="cell_voltage_25",e.cell_voltage_26="cell_voltage_26",e.cell_voltage_27="cell_voltage_27",e.cell_voltage_28="cell_voltage_28",e.cell_voltage_29="cell_voltage_29",e.cell_voltage_30="cell_voltage_30",e.cell_voltage_31="cell_voltage_31",e.cell_voltage_32="cell_voltage_32",e.cell_voltage_33="cell_voltage_33",e.cell_voltage_34="cell_voltage_34",e.cell_voltage_35="cell_voltage_35",e.cell_voltage_36="cell_voltage_36",e.cell_voltage_37="cell_voltage_37",e.cell_voltage_38="cell_voltage_38",e.cell_voltage_39="cell_voltage_39",e.cell_voltage_40="cell_voltage_40",e.cell_voltage_41="cell_voltage_41",e.cell_voltage_42="cell_voltage_42",e.cell_voltage_43="cell_voltage_43",e.cell_voltage_44="cell_voltage_44",e.cell_voltage_45="cell_voltage_45",e.cell_voltage_46="cell_voltage_46",e.cell_voltage_47="cell_voltage_47",e.cell_voltage_48="cell_voltage_48",e.cell_voltage_49="cell_voltage_49",e.cell_voltage_50="cell_voltage_50",e.cell_voltage_51="cell_voltage_51",e.cell_voltage_52="cell_voltage_52",e.cell_voltage_53="cell_voltage_53",e.cell_voltage_54="cell_voltage_54",e.cell_voltage_55="cell_voltage_55",e.cell_voltage_56="cell_voltage_56",e.cell_voltage_57="cell_voltage_57",e.cell_voltage_58="cell_voltage_58",e.cell_voltage_59="cell_voltage_59",e.cell_voltage_60="cell_voltage_60",e.cell_voltage_61="cell_voltage_61",e.cell_voltage_62="cell_voltage_62",e.cell_voltage_63="cell_voltage_63",e.cell_voltage_64="cell_voltage_64",e.cell_voltage_65="cell_voltage_65",e.cell_voltage_66="cell_voltage_66",e.cell_voltage_67="cell_voltage_67",e.cell_voltage_68="cell_voltage_68",e.cell_voltage_69="cell_voltage_69",e.cell_voltage_70="cell_voltage_70",e.cell_voltage_71="cell_voltage_71",e.cell_voltage_72="cell_voltage_72",e.cell_voltage_73="cell_voltage_73",e.cell_voltage_74="cell_voltage_74",e.cell_voltage_75="cell_voltage_75",e.cell_voltage_76="cell_voltage_76",e.cell_voltage_77="cell_voltage_77",e.cell_voltage_78="cell_voltage_78",e.cell_voltage_79="cell_voltage_79",e.cell_voltage_80="cell_voltage_80",e.cell_voltage_81="cell_voltage_81",e.cell_voltage_82="cell_voltage_82",e.cell_voltage_83="cell_voltage_83",e.cell_voltage_84="cell_voltage_84",e.cell_voltage_85="cell_voltage_85",e.cell_voltage_86="cell_voltage_86",e.cell_voltage_87="cell_voltage_87",e.cell_voltage_88="cell_voltage_88",e.cell_voltage_89="cell_voltage_89",e.cell_voltage_90="cell_voltage_90",e.cell_voltage_91="cell_voltage_91",e.cell_voltage_92="cell_voltage_92",e.cell_voltage_93="cell_voltage_93",e.cell_voltage_94="cell_voltage_94",e.cell_voltage_95="cell_voltage_95",e.cell_voltage_96="cell_voltage_96",e.cell_resistance_1="cell_resistance_1",e.cell_resistance_2="cell_resistance_2",e.cell_resistance_3="cell_resistance_3",e.cell_resistance_4="cell_resistance_4",e.cell_resistance_5="cell_resistance_5",e.cell_resistance_6="cell_resistance_6",e.cell_resistance_7="cell_resistance_7",e.cell_resistance_8="cell_resistance_8",e.cell_resistance_9="cell_resistance_9",e.cell_resistance_10="cell_resistance_10Line truncated */}const ge="jk-bms-content-card-editor",pe="jk-bms-card";var me;!function(e){e.delta_cell_voltage="delta_cell_voltage",e.balancing="balancing",e.balancing_current="balancing_current",e.balancer_status_bitmask="balancer_status_bitmask",e.power="power",e.balance_trigger_voltage="balance_trigger_voltage",e.balance_starting_voltage="balance_starting_voltage",e.total_runtime_formatted="total_runtime_formatted",e.charging="charging",e.charging_power="charging_power",e.discharging="discharging",e.discharging_power="discharging_power",e.balancer="balancer",e.heater="heater",e.total_voltage="total_voltage",e.total_battery_capacity_setting="total_battery_capacity_setting",e.total_charging_cycle_capacity="total_charging_cycle_capacity",e.average_cell_voltage="average_cell_voltage",e.current="current",e.state_of_charge="state_of_charge",e.capacity_remaining="capacity_remaining",e.charging_cycles="charging_cycles",e.power_tube_temperature="power_tube_temperature",e.min_voltage_cell="min_voltage_cell",e.max_voltage_cell="max_voltage_cell",e.min_cell_voltage="min_cell_voltage",e.max_cell_voltage="max_cell_voltage",e.errors="errors",e.software_version="software_version",e.hardware_version="hardware_version",e.cell_voltage_1="cell_voltage_1",e.cell_voltage_2="cell_voltage_2",e.cell_voltage_3="cell_voltage_3",e.cell_voltage_4="cell_voltage_4",e.cell_voltage_5="cell_voltage_5",e.cell_voltage_6="cell_voltage_6",e.cell_voltage_7="cell_voltage_7",e.cell_voltage_8="cell_voltage_8",e.cell_voltage_9="cell_voltage_9",e.cell_voltage_10="cell_voltage_10",e.cell_voltage_11="cell_voltage_11",e.cell_voltage_12="cell_voltage_12",e.cell_voltage_13="cell_voltage_13",e.cell_voltage_14="cell_voltage_14",e.cell_voltage_15="cell_voltage_15",e.cell_voltage_16="cell_voltage_16",e.cell_voltage_17="cell_voltage_17",e.cell_voltage_18="cell_voltage_18",e.cell_voltage_19="cell_voltage_19",e.cell_voltage_20="cell_voltage_20",e.cell_voltage_21="cell_voltage_21",e.cell_voltage_22="cell_voltage_22",e.cell_voltage_23="cell_voltage_23",e.cell_voltage_24="cell_voltage_24",e.cell_voltage_25="cell_voltage_25",e.cell_voltage_26="cell_voltage_26",e.cell_voltage_27="cell_voltage_27",e.cell_voltage_28="cell_voltage_28",e.cell_voltage_29="cell_voltage_29",e.cell_voltage_30="cell_voltage_30",e.cell_voltage_31="cell_voltage_31",e.cell_voltage_32="cell_voltage_32",e.cell_voltage_33="cell_voltage_33",e.cell_voltage_34="cell_voltage_34",e.cell_voltage_35="cell_voltage_35",e.cell_voltage_36="cell_voltage_36",e.cell_voltage_37="cell_voltage_37",e.cell_voltage_38="cell_voltage_38",e.cell_voltage_39="cell_voltage_39",e.cell_voltage_40="cell_voltage_40",e.cell_voltage_41="cell_voltage_41",e.cell_voltage_42="cell_voltage_42",e.cell_voltage_43="cell_voltage_43",e.cell_voltage_44="cell_voltage_44",e.cell_voltage_45="cell_voltage_45",e.cell_voltage_46="cell_voltage_46",e.cell_voltage_47="cell_voltage_47",e.cell_voltage_48="cell_voltage_48",e.cell_voltage_49="cell_voltage_49",e.cell_voltage_50="cell_voltage_50",e.cell_voltage_51="cell_voltage_51",e.cell_voltage_52="cell_voltage_52",e.cell_voltage_53="cell_voltage_53",e.cell_voltage_54="cell_voltage_54",e.cell_voltage_55="cell_voltage_55",e.cell_voltage_56="cell_voltage_56",e.cell_voltage_57="cell_voltage_57",e.cell_voltage_58="cell_voltage_58",e.cell_voltage_59="cell_voltage_59",e.cell_voltage_60="cell_voltage_60",e.cell_voltage_61="cell_voltage_61",e.cell_voltage_62="cell_voltage_62",e.cell_voltage_63="cell_voltage_63",e.cell_voltage_64="cell_voltage_64",e.cell_voltage_65="cell_voltage_65",e.cell_voltage_66="cell_voltage_66",e.cell_voltage_67="cell_voltage_67",e.cell_voltage_68="cell_voltage_68",e.cell_voltage_69="cell_voltage_69",e.cell_voltage_70="cell_voltage_70",e.cell_voltage_71="cell_voltage_71",e.cell_voltage_72="cell_voltage_72",e.cell_voltage_73="cell_voltage_73",e.cell_voltage_74="cell_voltage_74",e.cell_voltage_75="cell_voltage_75",e.cell_voltage_76="cell_voltage_76",e.cell_voltage_77="cell_voltage_77",e.cell_voltage_78="cell_voltage_78",e.cell_voltage_79="cell_voltage_79",e.cell_voltage_80="cell_voltage_80",e.cell_voltage_81="cell_voltage_81",e.cell_voltage_82="cell_voltage_82",e.cell_voltage_83="cell_voltage_83",e.cell_voltage_84="cell_voltage_84",e.cell_voltage_85="cell_voltage_85",e.cell_voltage_86="cell_voltage_86",e.cell_voltage_87="cell_voltage_87",e.cell_voltage_88="cell_voltage_88",e.cell_voltage_89="cell_voltage_89",e.cell_voltage_90="cell_voltage_90",e.cell_voltage_91="cell_voltage_91",e.cell_voltage_92="cell_voltage_92",e.cell_voltage_93="cell_voltage_93",e.cell_voltage_94="cell_voltage_94",e.cell_voltage_95="cell_voltage_95",e.cell_voltage_96="cell_voltage_96",e.cell_resistance_1="cell_resistance_1",e.cell_resistance_2="cell_resistance_2",e.cell_resistance_3="cell_resistance_3",e.cell_resistance_4="cell_resistance_4",e.cell_resistance_5="cell_resistance_5",e.cell_resistance_6="cell_resistance_6",e.cell_resistance_7="cell_resistance_7",e.cell_resistance_8="cell_resistance_8",e.cell_resistance_9="cell_reLine truncated
@@ -1 +1,2 @@
(()=>{"use strict";const t=window,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),i=new WeakMap;class r{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const n=this.t;if(e&&void 0===t){const e=void 0!==n&&1===n.length;e&&(t=i.get(n)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(n,t))}return t}toString(){return this.cssText}}const o=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,n,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[i+1]),t[0]);return new r(i,t,n)},s=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,n))(e)})(t):t;var a;const c=window,l=c.trustedTypes,u=l?l.emptyScript:"",h=c.reactiveElementPolyfillSupport,f={toAttribute(t,e){switch(e){case Boolean:t=t?u:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},d=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:f,reflect:!1,hasChanged:d};class m extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,n)=>{const i=this._$Ep(n,e);void 0!==i&&(this._$Ev.set(i,n),t.push(i))})),t}static createProperty(t,e=p){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,n,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(i){const r=this[t];this[e]=i,this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const n of e)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(s(t))}else void 0!==t&&e.push(s(t));return e}static _$Ep(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,n;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var n;const i=null!==(n=this.shadowRoot)&&void 0!==n?n:this.attachShadow(this.constructor.shadowRootOptions);return((n,i)=>{e?n.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):i.forEach((e=>{const i=document.createElement("style"),r=t.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,n.appendChild(i)}))})(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e,n=p){var i;const r=this.constructor._$Ep(t,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:f).toAttribute(e,n.type);this._$El=t,null==o?this.removeAttribute(r):this.setAttribute(r,o)Line truncated /*! For license information please see multiple-entity-row.js.LICENSE.txt */
(()=>{"use strict";const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),i=new WeakMap;class o{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const n=this.t;if(e&&void 0===t){const e=void 0!==n&&1===n.length;e&&(t=i.get(n)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(n,t))}return t}toString(){return this.cssText}}const r=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,n,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[i+1],t[0]);return new o(i,t,n)},a=(n,i)=>{if(e)n.adoptedStyleSheets=i.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of i){const i=document.createElement("style"),o=t.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=e.cssText,n.appendChild(i)}},s=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,n))(e)})(t):t,{is:c,defineProperty:l,getOwnPropertyDescriptor:u,getOwnPropertyNames:d,getOwnPropertySymbols:f,getPrototypeOf:h}=Object,p=globalThis,m=p.trustedTypes,v=m?m.emptyScript:"",y=p.reactiveElementPolyfillSupport,b=(t,e)=>t,_={toAttribute(t,e){switch(e){case Boolean:t=t?v:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},g=(t,e)=>!c(t,e),w={attribute:!0,type:String,converter:_,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;class A extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(t,n,e);void 0!==i&&l(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){const{get:i,set:o}=u(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const r=i?.call(this);o?.call(this,e),this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=h(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...d(t),...f(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(s(t))}else void 0!==t&&e.push(s(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return a(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$ET(t,e){const n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(void 0!==i&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:_).toAttribute(e,n.type);this._$Em=t,null==o?thiLine truncated