200 files
This commit is contained in:
1 parent
ff4156dc89
commit
8769f3b12b
201 files changed
+5190
-24141
No files matched your search
+1
-1
@@ -1 +1 @@
|
|||||||
{"pid": 71, "version": 1, "ha_version": "2026.9.1", "start_ts": 1788961324.2634702}
|
{"pid": 71, "version": 1, "ha_version": "2026.9.1", "start_ts": 1789128360.9194858}
|
||||||
@@ -261,7 +261,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "6c3f7d87683d4473b5dc8fe8177535f6",
|
"id": "6c3f7d87683d4473b5dc8fe8177535f6",
|
||||||
"url": "/hacsfiles/simple-thermostat/simple-thermostat.js?hacstag=1230152807430",
|
"url": "/hacsfiles/simple-thermostat/simple-thermostat.js?hacstag=1230152807440",
|
||||||
"type": "module"
|
"type": "module"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -305,19 +305,19 @@
|
|||||||
"type": "module"
|
"type": "module"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "75cbbb4f553146d7b9b35969734b96b8",
|
"id": "6f76aeefdbb14d87a0da4c28957efb47",
|
||||||
"url": "/album_slideshow_static/album-slideshow-card.js?v=1.9.0",
|
"url": "/album_slideshow_static/album-slideshow-card.js?v=1.9.1",
|
||||||
"type": "module"
|
"type": "module"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "2a737f5a60524eba889646bb76875dbc",
|
"id": "793e9c66f5e349949e23fe3e64088352",
|
||||||
"url": "/my_music_library/my-music-library-card.js?v=3.12.5",
|
|
||||||
"type": "module"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "0dac2fceea134f918b9b93cc064a6199",
|
|
||||||
"url": "/climate_scheduler/static/climate-scheduler-card.js?v=1.15.1",
|
"url": "/climate_scheduler/static/climate-scheduler-card.js?v=1.15.1",
|
||||||
"type": "module"
|
"type": "module"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "aafb0bb764874be384629a0ca0a18c53",
|
||||||
|
"url": "/my_music_library/my-music-library-card.js?v=3.14.0",
|
||||||
|
"type": "module"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -383,6 +383,8 @@ async def async_maybe_send_lead_reminders(hass: HomeAssistant) -> None:
|
|||||||
continue
|
continue
|
||||||
if task_data.get("archived_at") is not None:
|
if task_data.get("archived_at") is not None:
|
||||||
continue
|
continue
|
||||||
|
if task_data.get("notify_enabled") is False:
|
||||||
|
continue # #173: muted task — no lead reminders either
|
||||||
task = MaintenanceTask.from_dict(task_data)
|
task = MaintenanceTask.from_dict(task_data)
|
||||||
days = task.days_until_due
|
days = task.days_until_due
|
||||||
# days == 0 is a valid lead ("on the due date"); negatives are the
|
# days == 0 is a valid lead ("on the due date"); negatives are the
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ from .const import (
|
|||||||
CONF_NOTIFICATIONS_ENABLED,
|
CONF_NOTIFICATIONS_ENABLED,
|
||||||
CONF_NOTIFY_DUE_SOON_ENABLED,
|
CONF_NOTIFY_DUE_SOON_ENABLED,
|
||||||
CONF_NOTIFY_DUE_SOON_INTERVAL,
|
CONF_NOTIFY_DUE_SOON_INTERVAL,
|
||||||
|
CONF_NOTIFY_EVENT_ONLY,
|
||||||
|
CONF_NOTIFY_EXTRA_DATA,
|
||||||
CONF_NOTIFY_OVERDUE_ENABLED,
|
CONF_NOTIFY_OVERDUE_ENABLED,
|
||||||
CONF_NOTIFY_OVERDUE_INTERVAL,
|
CONF_NOTIFY_OVERDUE_INTERVAL,
|
||||||
CONF_NOTIFY_SERVICE,
|
CONF_NOTIFY_SERVICE,
|
||||||
@@ -61,6 +63,7 @@ from .const import (
|
|||||||
DEFAULT_PANEL_ENABLED,
|
DEFAULT_PANEL_ENABLED,
|
||||||
DEFAULT_SNOOZE_DURATION_HOURS,
|
DEFAULT_SNOOZE_DURATION_HOURS,
|
||||||
DEFAULT_WARNING_DAYS,
|
DEFAULT_WARNING_DAYS,
|
||||||
|
MAX_NOTIFY_EXTRA_DATA_LENGTH,
|
||||||
MAX_PANEL_TITLE_LENGTH,
|
MAX_PANEL_TITLE_LENGTH,
|
||||||
TIME_HHMMSS_PATTERN,
|
TIME_HHMMSS_PATTERN,
|
||||||
)
|
)
|
||||||
@@ -351,6 +354,10 @@ async def send_test_notification(
|
|||||||
|
|
||||||
notify_service = str(options.get(CONF_NOTIFY_SERVICE, ""))
|
notify_service = str(options.get(CONF_NOTIFY_SERVICE, ""))
|
||||||
if not notify_service:
|
if not notify_service:
|
||||||
|
if options.get(CONF_NOTIFY_EVENT_ONLY, False):
|
||||||
|
# #173: event-only needs no service — the test fires the event
|
||||||
|
# so the user's automation can be checked from Settings.
|
||||||
|
return await _send_test_to(hass, options, [""])
|
||||||
return "no_service"
|
return "no_service"
|
||||||
|
|
||||||
# Format-only validation — existence is left to the async_call below so
|
# Format-only validation — existence is left to the async_call below so
|
||||||
@@ -670,6 +677,10 @@ class GlobalOptionsFlow(OptionsFlow):
|
|||||||
async def async_step_notification_settings(self, user_input: dict[str, Any] | None = None) -> ConfigFlowResult:
|
async def async_step_notification_settings(self, user_input: dict[str, Any] | None = None) -> ConfigFlowResult:
|
||||||
"""Per-status notification toggles, intervals, quiet hours, daily limit."""
|
"""Per-status notification toggles, intervals, quiet hours, daily limit."""
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
|
# Same cap as the WS settings path (settings registry max_len).
|
||||||
|
extra = user_input.get(CONF_NOTIFY_EXTRA_DATA)
|
||||||
|
if isinstance(extra, str):
|
||||||
|
user_input[CONF_NOTIFY_EXTRA_DATA] = extra[:MAX_NOTIFY_EXTRA_DATA_LENGTH]
|
||||||
return self._save_and_return(user_input)
|
return self._save_and_return(user_input)
|
||||||
|
|
||||||
current = self._current
|
current = self._current
|
||||||
@@ -770,6 +781,18 @@ class GlobalOptionsFlow(OptionsFlow):
|
|||||||
translation_key="notification_title_style",
|
translation_key="notification_title_style",
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
# 2.80 (#165) / #173: your own notification rule — the same
|
||||||
|
# two settings the panel's Settings tab offers.
|
||||||
|
vol.Optional(
|
||||||
|
CONF_NOTIFY_EVENT_ONLY,
|
||||||
|
default=current.get(CONF_NOTIFY_EVENT_ONLY, False),
|
||||||
|
): selector.BooleanSelector(),
|
||||||
|
vol.Optional(
|
||||||
|
CONF_NOTIFY_EXTRA_DATA,
|
||||||
|
description={"suggested_value": current.get(CONF_NOTIFY_EXTRA_DATA, "")},
|
||||||
|
): selector.TextSelector(
|
||||||
|
selector.TextSelectorConfig(type=selector.TextSelectorType.TEXT, multiline=True)
|
||||||
|
),
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -747,6 +747,11 @@ class MaintenanceCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
|||||||
for row in notifiable
|
for row in notifiable
|
||||||
if nm._is_status_enabled(row[2]) and not nm._is_snoozed(f"{self.entry.entry_id}_{row[0]}_{row[2]}")
|
if nm._is_status_enabled(row[2]) and not nm._is_snoozed(f"{self.entry.entry_id}_{row[0]}_{row[2]}")
|
||||||
]
|
]
|
||||||
|
# #173: a task muted in its own settings sends nothing — neither on
|
||||||
|
# its own nor inside a bundle. The flag lives in the task's config
|
||||||
|
# (entry.data), which the computed task_result (model dict) drops.
|
||||||
|
task_configs = self.entry.data.get(CONF_TASKS) or {}
|
||||||
|
notifiable = [row for row in notifiable if (task_configs.get(row[0]) or {}).get("notify_enabled") is not False]
|
||||||
|
|
||||||
# v2.26 notification routing: a saved-view scope ("only notify about
|
# v2.26 notification routing: a saved-view scope ("only notify about
|
||||||
# view X") drops tasks the view's label/user filters don't match —
|
# view X") drops tasks the view's label/user filters don't match —
|
||||||
@@ -1521,6 +1526,19 @@ class MaintenanceCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def note_trigger_edge(self, task_id: str) -> None:
|
||||||
|
"""A trigger just latched on a REAL state edge — lift the post-completion
|
||||||
|
cooldown for that task.
|
||||||
|
|
||||||
|
The cooldown (``_recently_completed``, 10 min) exists so the fallback
|
||||||
|
sweep does not re-activate a task off the still-low sensor value right
|
||||||
|
after a completion; the event-driven trigger itself is reset on
|
||||||
|
completion, so a new activation from it is a genuine edge. Without
|
||||||
|
this, the refresh a flip now requests (#175) — and before that, any
|
||||||
|
5-minute tick inside the window — wiped the fresh latch again.
|
||||||
|
"""
|
||||||
|
self._recently_completed.pop(task_id, None)
|
||||||
|
|
||||||
async def async_refresh_now(self) -> None:
|
async def async_refresh_now(self) -> None:
|
||||||
"""Recompute immediately — for changes a person just made.
|
"""Recompute immediately — for changes a person just made.
|
||||||
|
|
||||||
|
|||||||
@@ -220,6 +220,17 @@ class BaseTrigger(ABC):
|
|||||||
Returns True if trigger should be active.
|
Returns True if trigger should be active.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
def _request_coordinator_refresh(self) -> None:
|
||||||
|
"""#175: a trigger flip must reach the coordinator now, not on the
|
||||||
|
next 5-minute tick. Notifications (and the ``maintenance_supporter_
|
||||||
|
notification`` event) are decided in the coordinator's refresh from the
|
||||||
|
status change, so without this the reminder trailed the flip by up to a
|
||||||
|
full update interval — 30 s once, 4 min the next time. Debounced on
|
||||||
|
purpose (HA's ten-second window): a noisy sensor must not recompute the
|
||||||
|
object on every state change; user actions use async_refresh_now."""
|
||||||
|
self.hass.async_create_task(self._coordinator.async_request_refresh())
|
||||||
|
|
||||||
def _on_trigger_activated(self, value: float) -> None:
|
def _on_trigger_activated(self, value: float) -> None:
|
||||||
"""Handle trigger activation."""
|
"""Handle trigger activation."""
|
||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
@@ -238,6 +249,8 @@ class BaseTrigger(ABC):
|
|||||||
|
|
||||||
# Add history entry for the trigger activation
|
# Add history entry for the trigger activation
|
||||||
self.hass.async_create_task(self._coordinator.async_add_trigger_history_entry(self._task_id, trigger_value=value))
|
self.hass.async_create_task(self._coordinator.async_add_trigger_history_entry(self._task_id, trigger_value=value))
|
||||||
|
self._coordinator.note_trigger_edge(self._task_id)
|
||||||
|
self._request_coordinator_refresh()
|
||||||
|
|
||||||
# Fire event
|
# Fire event
|
||||||
self.hass.bus.async_fire(
|
self.hass.bus.async_fire(
|
||||||
@@ -267,6 +280,8 @@ class BaseTrigger(ABC):
|
|||||||
trigger_entity_id=self.entity_id,
|
trigger_entity_id=self.entity_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self._request_coordinator_refresh()
|
||||||
|
|
||||||
# Fire event
|
# Fire event
|
||||||
self.hass.bus.async_fire(
|
self.hass.bus.async_fire(
|
||||||
EVENT_TRIGGER_DEACTIVATED,
|
EVENT_TRIGGER_DEACTIVATED,
|
||||||
|
|||||||
@@ -248,6 +248,8 @@ class CompoundTrigger(BaseTrigger):
|
|||||||
trigger_entity_id=None,
|
trigger_entity_id=None,
|
||||||
)
|
)
|
||||||
self.hass.async_create_task(self._coordinator.async_add_trigger_history_entry(self._task_id, trigger_value=None))
|
self.hass.async_create_task(self._coordinator.async_add_trigger_history_entry(self._task_id, trigger_value=None))
|
||||||
|
self._coordinator.note_trigger_edge(self._task_id)
|
||||||
|
self._request_coordinator_refresh()
|
||||||
self.hass.bus.async_fire(
|
self.hass.bus.async_fire(
|
||||||
EVENT_TRIGGER_ACTIVATED,
|
EVENT_TRIGGER_ACTIVATED,
|
||||||
{
|
{
|
||||||
@@ -271,6 +273,7 @@ class CompoundTrigger(BaseTrigger):
|
|||||||
current_value=None,
|
current_value=None,
|
||||||
trigger_entity_id=None,
|
trigger_entity_id=None,
|
||||||
)
|
)
|
||||||
|
self._request_coordinator_refresh()
|
||||||
self.hass.bus.async_fire(
|
self.hass.bus.async_fire(
|
||||||
EVENT_TRIGGER_DEACTIVATED,
|
EVENT_TRIGGER_DEACTIVATED,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -126,6 +126,8 @@ def _build_export_object(
|
|||||||
"require_tag_scan": tdata.get("require_tag_scan"),
|
"require_tag_scan": tdata.get("require_tag_scan"),
|
||||||
# #150: per-task skip lock.
|
# #150: per-task skip lock.
|
||||||
"allow_skip": tdata.get("allow_skip"),
|
"allow_skip": tdata.get("allow_skip"),
|
||||||
|
# #173: per-task notification mute.
|
||||||
|
"notify_enabled": tdata.get("notify_enabled"),
|
||||||
"responsible_user_id": tdata.get("responsible_user_id"),
|
"responsible_user_id": tdata.get("responsible_user_id"),
|
||||||
"entity_slug": tdata.get("entity_slug"),
|
"entity_slug": tdata.get("entity_slug"),
|
||||||
"adaptive_config": tdata.get("adaptive_config"),
|
"adaptive_config": tdata.get("adaptive_config"),
|
||||||
|
|||||||
+13
-6
@@ -186,18 +186,25 @@ describe("task-detail renderer", () => {
|
|||||||
toggleArchive: () => calls.push("archive"),
|
toggleArchive: () => calls.push("archive"),
|
||||||
}));
|
}));
|
||||||
const items = [...host.querySelectorAll(".popup-menu-item")];
|
const items = [...host.querySelectorAll(".popup-menu-item")];
|
||||||
// edit, qr, worksheet, duplicate, reset, postpone, snooze, archive, delete
|
// edit, qr, worksheet, duplicate, move (#23), reset, postpone, snooze, archive, delete
|
||||||
expect(items.length).to.equal(9);
|
expect(items.length).to.equal(10);
|
||||||
(items[5] as HTMLElement).click(); // postpone
|
(items[6] as HTMLElement).click(); // postpone
|
||||||
(items[6] as HTMLElement).click(); // snooze
|
(items[7] as HTMLElement).click(); // snooze
|
||||||
(items[2] as HTMLElement).click(); // work sheet (v2.21)
|
(items[2] as HTMLElement).click(); // work sheet (v2.21)
|
||||||
(items[7] as HTMLElement).click(); // archive (demoted from the header)
|
(items[8] as HTMLElement).click(); // archive (demoted from the header)
|
||||||
(items[8] as HTMLElement).click(); // delete (danger)
|
(items[9] as HTMLElement).click(); // delete (danger)
|
||||||
expect(calls).to.deep.equal([
|
expect(calls).to.deep.equal([
|
||||||
"close", "postpone", "close", "snooze", "close", "worksheet", "close", "archive", "close", "delete",
|
"close", "postpone", "close", "snooze", "close", "worksheet", "close", "archive", "close", "delete",
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("shows a bell-off badge for a muted task (#173), and none otherwise", () => {
|
||||||
|
const muted = mount(task({ notify_enabled: false }), ctx());
|
||||||
|
expect(muted.querySelector(".muted-badge")).to.exist;
|
||||||
|
const loud = mount(task(), ctx());
|
||||||
|
expect(loud.querySelector(".muted-badge")).to.not.exist;
|
||||||
|
});
|
||||||
|
|
||||||
it("shows a postponed badge when the task has a due_override, and none otherwise", () => {
|
it("shows a postponed badge when the task has a due_override, and none otherwise", () => {
|
||||||
const plain = mount(task(), ctx());
|
const plain = mount(task(), ctx());
|
||||||
expect(plain.querySelector(".postponed-badge")).to.be.null;
|
expect(plain.querySelector(".postponed-badge")).to.be.null;
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ export interface PromptOptions extends ConfirmOptions {
|
|||||||
inputLabel?: string;
|
inputLabel?: string;
|
||||||
inputType?: string; // "text" | "date" etc.
|
inputType?: string; // "text" | "date" etc.
|
||||||
inputValue?: string;
|
inputValue?: string;
|
||||||
|
/** Render a <select> instead of a text input (task/move picks an object). */
|
||||||
|
options?: { value: string; label: string }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PromptResult {
|
export interface PromptResult {
|
||||||
@@ -33,6 +35,7 @@ export class MaintenanceConfirmDialog extends LitElement {
|
|||||||
@state() private _danger = false;
|
@state() private _danger = false;
|
||||||
@state() private _inputLabel = "";
|
@state() private _inputLabel = "";
|
||||||
@state() private _inputType = "";
|
@state() private _inputType = "";
|
||||||
|
@state() private _options: { value: string; label: string }[] | null = null;
|
||||||
@state() private _inputValue = "";
|
@state() private _inputValue = "";
|
||||||
|
|
||||||
private _resolve: ((value: boolean) => void) | null = null;
|
private _resolve: ((value: boolean) => void) | null = null;
|
||||||
@@ -45,6 +48,7 @@ export class MaintenanceConfirmDialog extends LitElement {
|
|||||||
this._danger = opts.danger || false;
|
this._danger = opts.danger || false;
|
||||||
this._inputLabel = "";
|
this._inputLabel = "";
|
||||||
this._inputType = "";
|
this._inputType = "";
|
||||||
|
this._options = null;
|
||||||
this._inputValue = "";
|
this._inputValue = "";
|
||||||
this._open = true;
|
this._open = true;
|
||||||
return new Promise<boolean>((resolve) => {
|
return new Promise<boolean>((resolve) => {
|
||||||
@@ -60,6 +64,7 @@ export class MaintenanceConfirmDialog extends LitElement {
|
|||||||
this._danger = opts.danger || false;
|
this._danger = opts.danger || false;
|
||||||
this._inputLabel = opts.inputLabel || "";
|
this._inputLabel = opts.inputLabel || "";
|
||||||
this._inputType = opts.inputType || "text";
|
this._inputType = opts.inputType || "text";
|
||||||
|
this._options = opts.options && opts.options.length ? opts.options : null;
|
||||||
this._inputValue = opts.inputValue || "";
|
this._inputValue = opts.inputValue || "";
|
||||||
this._open = true;
|
this._open = true;
|
||||||
return new Promise<PromptResult>((resolve) => {
|
return new Promise<PromptResult>((resolve) => {
|
||||||
@@ -104,10 +109,15 @@ export class MaintenanceConfirmDialog extends LitElement {
|
|||||||
the pause/replace prompts; same fix as complete-dialog). -->
|
the pause/replace prompts; same fix as complete-dialog). -->
|
||||||
<label class="field">
|
<label class="field">
|
||||||
<span class="field-label">${this._inputLabel}</span>
|
<span class="field-label">${this._inputLabel}</span>
|
||||||
<input class="field-input"
|
${this._options
|
||||||
type="${this._inputType || "text"}"
|
? html`<select class="field-input field-select"
|
||||||
.value=${this._inputValue}
|
@change=${(e: Event) => (this._inputValue = (e.target as HTMLSelectElement).value)}>
|
||||||
@input=${(e: Event) => (this._inputValue = (e.target as HTMLInputElement).value)} />
|
${this._options.map((o) => html`<option value=${o.value} ?selected=${o.value === this._inputValue}>${o.label}</option>`)}
|
||||||
|
</select>`
|
||||||
|
: html`<input class="field-input"
|
||||||
|
type="${this._inputType || "text"}"
|
||||||
|
.value=${this._inputValue}
|
||||||
|
@input=${(e: Event) => (this._inputValue = (e.target as HTMLInputElement).value)} />`}
|
||||||
</label>
|
</label>
|
||||||
` : nothing}
|
` : nothing}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -982,7 +982,9 @@ export class MaintenanceSettingsView extends LitElement {
|
|||||||
<div class="setting-hint">${t("settings_notify_event_only_hint", L)}</div>
|
<div class="setting-hint">${t("settings_notify_event_only_hint", L)}</div>
|
||||||
<label class="setting-row setting-row-block">
|
<label class="setting-row setting-row-block">
|
||||||
<span class="setting-label">${t("settings_notify_extra_data", L)}</span>
|
<span class="setting-label">${t("settings_notify_extra_data", L)}</span>
|
||||||
<textarea class="import-area notify-extra" .value=${live(n.extra_data || "")} maxlength="2000" spellcheck="false"
|
<!-- No live(): the view re-renders on every hass update and live()
|
||||||
|
would snap the DOM back to the stored value mid-typing (#176). -->
|
||||||
|
<textarea class="import-area notify-extra" .value=${n.extra_data || ""} maxlength="2000" spellcheck="false"
|
||||||
placeholder=${'{"category": "maintenance", "critical": {{ priority == "high" }}, "navigate_to": "{{ url }}"}'}
|
placeholder=${'{"category": "maintenance", "critical": {{ priority == "high" }}, "navigate_to": "{{ url }}"}'}
|
||||||
@change=${(e: Event) => this._updateSetting("notify_extra_data", (e.target as HTMLTextAreaElement).value)}
|
@change=${(e: Event) => this._updateSetting("notify_extra_data", (e.target as HTMLTextAreaElement).value)}
|
||||||
></textarea>
|
></textarea>
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ export class MaintenanceTaskDialog extends LitElement {
|
|||||||
@state() private _nfcTagId = "";
|
@state() private _nfcTagId = "";
|
||||||
@state() private _requireTagScan = false;
|
@state() private _requireTagScan = false;
|
||||||
@state() private _allowSkip = true;
|
@state() private _allowSkip = true;
|
||||||
|
@state() private _notifyEnabled = true;
|
||||||
// v2.20 (#83): unit for `reading`-type tasks ("kWh", "m³", ...)
|
// v2.20 (#83): unit for `reading`-type tasks ("kWh", "m³", ...)
|
||||||
@state() private _readingUnit = "";
|
@state() private _readingUnit = "";
|
||||||
// #161 phase 2: named reading slots — several values per completion.
|
// #161 phase 2: named reading slots — several values per completion.
|
||||||
@@ -412,6 +413,7 @@ export class MaintenanceTaskDialog extends LitElement {
|
|||||||
this._nfcTagId = task.nfc_tag_id || "";
|
this._nfcTagId = task.nfc_tag_id || "";
|
||||||
this._requireTagScan = !!task.require_tag_scan;
|
this._requireTagScan = !!task.require_tag_scan;
|
||||||
this._allowSkip = task.allow_skip !== false;
|
this._allowSkip = task.allow_skip !== false;
|
||||||
|
this._notifyEnabled = task.notify_enabled !== false;
|
||||||
this._readingUnit = task.reading_unit || "";
|
this._readingUnit = task.reading_unit || "";
|
||||||
this._readings = (task.readings || []).map((s) => ({ ...s }));
|
this._readings = (task.readings || []).map((s) => ({ ...s }));
|
||||||
// Whole link, entry_id included — hydrating only part_id would turn every
|
// Whole link, entry_id included — hydrating only part_id would turn every
|
||||||
@@ -1318,6 +1320,7 @@ export class MaintenanceTaskDialog extends LitElement {
|
|||||||
data.nfc_tag_id = this._nfcTagId || null;
|
data.nfc_tag_id = this._nfcTagId || null;
|
||||||
data.require_tag_scan = this._requireTagScan;
|
data.require_tag_scan = this._requireTagScan;
|
||||||
data.allow_skip = this._allowSkip;
|
data.allow_skip = this._allowSkip;
|
||||||
|
data.notify_enabled = this._notifyEnabled;
|
||||||
data.reading_unit = this._readingUnit.trim() || null;
|
data.reading_unit = this._readingUnit.trim() || null;
|
||||||
// #161 phase 2: always sent — [] clears the slots (single-value task).
|
// #161 phase 2: always sent — [] clears the slots (single-value task).
|
||||||
// Sent as hydrated even when the editor is hidden (type != reading), so
|
// Sent as hydrated even when the editor is hidden (type != reading), so
|
||||||
@@ -2953,6 +2956,15 @@ export class MaintenanceTaskDialog extends LitElement {
|
|||||||
<span>${t("disallow_skip", L)}</span>
|
<span>${t("disallow_skip", L)}</span>
|
||||||
</label>
|
</label>
|
||||||
${!this._allowSkip ? html`<div class="field-help">${t("disallow_skip_help", L)}</div>` : nothing}
|
${!this._allowSkip ? html`<div class="field-help">${t("disallow_skip_help", L)}</div>` : nothing}
|
||||||
|
<label class="req-option">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
.checked=${!this._notifyEnabled}
|
||||||
|
@change=${(e: Event) => (this._notifyEnabled = !(e.target as HTMLInputElement).checked)}
|
||||||
|
/>
|
||||||
|
<span>${t("no_notifications", L)}</span>
|
||||||
|
</label>
|
||||||
|
${!this._notifyEnabled ? html`<div class="field-help">${t("no_notifications_help", L)}</div>` : nothing}
|
||||||
<label class="toggle-row">
|
<label class="toggle-row">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
|
|||||||
+3
-1
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
import { LitElement, html, css, nothing } from "lit";
|
import { LitElement, html, css, nothing } from "lit";
|
||||||
import { property, state } from "lit/decorators.js";
|
import { property, state } from "lit/decorators.js";
|
||||||
import { t, ensureLocale, langOf } from "../styles";
|
import { t, ensureLocale, langOf, syncLocaleFromHass } from "../styles";
|
||||||
import { registerCustomCard } from "../helpers/register-card";
|
import { registerCustomCard } from "../helpers/register-card";
|
||||||
import { describeWsError } from "../ws-errors";
|
import { describeWsError } from "../ws-errors";
|
||||||
import { sectionCardSharedStyles } from "./section-card-shared-styles";
|
import { sectionCardSharedStyles } from "./section-card-shared-styles";
|
||||||
@@ -66,6 +66,8 @@ export class MaintenanceVacationSectionCard extends LitElement {
|
|||||||
|
|
||||||
updated(changedProps: Map<string, unknown>): void {
|
updated(changedProps: Map<string, unknown>): void {
|
||||||
super.updated(changedProps);
|
super.updated(changedProps);
|
||||||
|
// #163 tripwire: the date field's typed-entry placeholder formats a date.
|
||||||
|
syncLocaleFromHass(this, changedProps);
|
||||||
if (changedProps.has("hass") && this.hass && !this._loaded) {
|
if (changedProps.has("hass") && this.hass && !this._loaded) {
|
||||||
this._loaded = true;
|
this._loaded = true;
|
||||||
void this._load();
|
void this._load();
|
||||||
|
|||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Upravit",
|
"edit": "Upravit",
|
||||||
"duplicate": "Duplikovat",
|
"duplicate": "Duplikovat",
|
||||||
"task_duplicated": "Úkol duplikován",
|
"task_duplicated": "Úkol duplikován",
|
||||||
|
"task_moved": "Úkol přesunut",
|
||||||
|
"move_task_target": "Cílový objekt",
|
||||||
|
"move_task_message": "Vyberte objekt, ke kterému má tento úkol patřit. Historie, odečty a stav spouštěče se přesunou s ním; dostane nové referenční číslo a jeho entity se vytvoří znovu pod novým objektem. Propojené dokumenty zůstanou u aktuálního objektu.",
|
||||||
|
"move_task_title": "Přesunout úkol",
|
||||||
|
"move_task": "Přesunout do jiného objektu…",
|
||||||
"object_duplicated": "Objekt duplikován",
|
"object_duplicated": "Objekt duplikován",
|
||||||
"delete": "Smazat",
|
"delete": "Smazat",
|
||||||
"add_task": "+ Přidat úkol",
|
"add_task": "+ Přidat úkol",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Faktor musí být mezi 0.1 a 5.0",
|
"seasonal_override_range": "Faktor musí být mezi 0.1 a 5.0",
|
||||||
"clear_all": "Vymazat vše",
|
"clear_all": "Vymazat vše",
|
||||||
"clear": "Vymazat",
|
"clear": "Vymazat",
|
||||||
|
"date_type_toggle": "Zadat datum",
|
||||||
|
"date_type_invalid": "Neplatné datum — zkuste 1978-03-15, rok jako 1978 nebo svůj formát data",
|
||||||
"seasonal_chart_title": "Sezónní faktory",
|
"seasonal_chart_title": "Sezónní faktory",
|
||||||
"seasonal_learned": "Naučené",
|
"seasonal_learned": "Naučené",
|
||||||
"seasonal_manual": "Manuální",
|
"seasonal_manual": "Manuální",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Důkaz přítomnosti: „Hotovo“ je všude blokováno, dokud nenaskenujete NFC štítek nebo QR kód na zařízení. Automatizace mohou službě complete předat 'via_tag_scan'.",
|
"require_tag_scan_help": "Důkaz přítomnosti: „Hotovo“ je všude blokováno, dokud nenaskenujete NFC štítek nebo QR kód na zařízení. Automatizace mohou službě complete předat 'via_tag_scan'.",
|
||||||
"disallow_skip": "Nepovolit přeskočení",
|
"disallow_skip": "Nepovolit přeskočení",
|
||||||
"disallow_skip_help": "Akce Přeskočit zmizí ze všech ploch a server odmítne přeskočení i z automatizací a hlasu.",
|
"disallow_skip_help": "Akce Přeskočit zmizí ze všech ploch a server odmítne přeskočení i z automatizací a hlasu.",
|
||||||
|
"no_notifications": "Bez oznámení pro tento úkol",
|
||||||
|
"no_notifications_help": "Bez připomínek pro tento úkol — žádná oznámení o stavu, opakování, předstihové připomínky ani souhrny. Zůstává vidět na přehledu a ve svých entitách; týdenní přehled ho stále počítá.",
|
||||||
"require_tag_scan_hint": "Tento úkol lze dokončit pouze naskenováním jeho NFC štítku nebo QR kódu na zařízení — uložení zde bude odmítnuto."
|
"require_tag_scan_hint": "Tento úkol lze dokončit pouze naskenováním jeho NFC štítku nebo QR kódu na zařízení — uložení zde bude odmítnuto."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Rediger",
|
"edit": "Rediger",
|
||||||
"duplicate": "Dupliker",
|
"duplicate": "Dupliker",
|
||||||
"task_duplicated": "Opgave duplikeret",
|
"task_duplicated": "Opgave duplikeret",
|
||||||
|
"task_moved": "Opgave flyttet",
|
||||||
|
"move_task_target": "Målobjekt",
|
||||||
|
"move_task_message": "Vælg det objekt, opgaven skal høre til. Historik, aflæsninger og triggerstatus flytter med; den får et nyt referencenummer, og dens entiteter oprettes igen under det nye objekt. Tilknyttede dokumenter bliver hos det nuværende objekt.",
|
||||||
|
"move_task_title": "Flyt opgave",
|
||||||
|
"move_task": "Flyt til et andet objekt…",
|
||||||
"object_duplicated": "Objekt duplikeret",
|
"object_duplicated": "Objekt duplikeret",
|
||||||
"delete": "Slet",
|
"delete": "Slet",
|
||||||
"add_task": "+ Tilføj opgave",
|
"add_task": "+ Tilføj opgave",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Faktor skal være mellem 0.1 og 5.0",
|
"seasonal_override_range": "Faktor skal være mellem 0.1 og 5.0",
|
||||||
"clear_all": "Ryd alle",
|
"clear_all": "Ryd alle",
|
||||||
"clear": "Ryd",
|
"clear": "Ryd",
|
||||||
|
"date_type_toggle": "Indtast datoen",
|
||||||
|
"date_type_invalid": "Ugyldig dato — prøv 1978-03-15, et år som 1978 eller dit eget datoformat",
|
||||||
"seasonal_chart_title": "Sæsonfaktorer",
|
"seasonal_chart_title": "Sæsonfaktorer",
|
||||||
"seasonal_learned": "Lært",
|
"seasonal_learned": "Lært",
|
||||||
"seasonal_manual": "Manuel",
|
"seasonal_manual": "Manuel",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Tilstedeværelsesbevis: „Udført“ er blokeret overalt, indtil NFC-tagget eller QR-koden på selve tingen er scannet. Automatiseringer kan give 'via_tag_scan' til complete-tjenesten.",
|
"require_tag_scan_help": "Tilstedeværelsesbevis: „Udført“ er blokeret overalt, indtil NFC-tagget eller QR-koden på selve tingen er scannet. Automatiseringer kan give 'via_tag_scan' til complete-tjenesten.",
|
||||||
"disallow_skip": "Tillad ikke at springe over",
|
"disallow_skip": "Tillad ikke at springe over",
|
||||||
"disallow_skip_help": "Handlingen Spring over forsvinder fra alle flader, og serveren afviser også spring fra automatiseringer og stemme.",
|
"disallow_skip_help": "Handlingen Spring over forsvinder fra alle flader, og serveren afviser også spring fra automatiseringer og stemme.",
|
||||||
|
"no_notifications": "Ingen notifikationer for denne opgave",
|
||||||
|
"no_notifications_help": "Ingen påmindelser for denne opgave — ingen statusnotifikationer, gentagelser, forudpåmindelser eller bundter. Den vises stadig på dashboardet og i sine entiteter; ugeoversigten tæller den stadig med.",
|
||||||
"require_tag_scan_hint": "Denne opgave udføres kun ved at scanne dens NFC-tag eller QR-kode på selve tingen — at gemme her vil blive afvist."
|
"require_tag_scan_hint": "Denne opgave udføres kun ved at scanne dens NFC-tag eller QR-kode på selve tingen — at gemme her vil blive afvist."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Bearbeiten",
|
"edit": "Bearbeiten",
|
||||||
"duplicate": "Duplizieren",
|
"duplicate": "Duplizieren",
|
||||||
"task_duplicated": "Aufgabe dupliziert",
|
"task_duplicated": "Aufgabe dupliziert",
|
||||||
|
"task_moved": "Aufgabe verschoben",
|
||||||
|
"move_task_target": "Zielobjekt",
|
||||||
|
"move_task_message": "Wähle das Objekt, zu dem diese Aufgabe gehören soll. Historie, Zählerstände und Trigger-Zustand wandern mit; sie bekommt eine neue Referenznummer und ihre Entitäten werden unter dem neuen Objekt neu angelegt. Verknüpfte Dokumente bleiben beim aktuellen Objekt.",
|
||||||
|
"move_task_title": "Aufgabe verschieben",
|
||||||
|
"move_task": "In anderes Objekt verschieben…",
|
||||||
"object_duplicated": "Objekt dupliziert",
|
"object_duplicated": "Objekt dupliziert",
|
||||||
"delete": "Löschen",
|
"delete": "Löschen",
|
||||||
"add_task": "+ Aufgabe",
|
"add_task": "+ Aufgabe",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Faktor muss zwischen 0.1 und 5.0 liegen",
|
"seasonal_override_range": "Faktor muss zwischen 0.1 und 5.0 liegen",
|
||||||
"clear_all": "Alle zurücksetzen",
|
"clear_all": "Alle zurücksetzen",
|
||||||
"clear": "Leeren",
|
"clear": "Leeren",
|
||||||
|
"date_type_toggle": "Datum eintippen",
|
||||||
|
"date_type_invalid": "Kein gültiges Datum — versuche 1978-03-15, ein Jahr wie 1978 oder dein Datumsformat",
|
||||||
"seasonal_chart_title": "Saisonale Faktoren",
|
"seasonal_chart_title": "Saisonale Faktoren",
|
||||||
"seasonal_learned": "Gelernt",
|
"seasonal_learned": "Gelernt",
|
||||||
"seasonal_manual": "Manuell",
|
"seasonal_manual": "Manuell",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Anwesenheitsnachweis: „Erledigt“ ist überall blockiert, bis das NFC-Tag oder der QR-Code am Gerät gescannt wurde. Automationen können 'via_tag_scan' an den complete-Dienst übergeben.",
|
"require_tag_scan_help": "Anwesenheitsnachweis: „Erledigt“ ist überall blockiert, bis das NFC-Tag oder der QR-Code am Gerät gescannt wurde. Automationen können 'via_tag_scan' an den complete-Dienst übergeben.",
|
||||||
"disallow_skip": "Überspringen nicht erlauben",
|
"disallow_skip": "Überspringen nicht erlauben",
|
||||||
"disallow_skip_help": "Die Aktion Überspringen verschwindet von allen Oberflächen; auch Automationen und Sprachbefehle werden abgewiesen.",
|
"disallow_skip_help": "Die Aktion Überspringen verschwindet von allen Oberflächen; auch Automationen und Sprachbefehle werden abgewiesen.",
|
||||||
|
"no_notifications": "Keine Benachrichtigungen für diese Aufgabe",
|
||||||
|
"no_notifications_help": "Keine Erinnerungen für diese Aufgabe — keine Status-Benachrichtigungen, Wiederholungen, Vorlauf-Erinnerungen oder Bündel. Sie erscheint weiterhin im Dashboard und in ihren Entitäten; der Wochen-Digest zählt sie weiterhin mit.",
|
||||||
"require_tag_scan_hint": "Diese Aufgabe kann nur per Scan des NFC-Tags oder QR-Codes am Gerät erledigt werden — Speichern hier wird abgelehnt."
|
"require_tag_scan_hint": "Diese Aufgabe kann nur per Scan des NFC-Tags oder QR-Codes am Gerät erledigt werden — Speichern hier wird abgelehnt."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Edit",
|
"edit": "Edit",
|
||||||
"duplicate": "Duplicate",
|
"duplicate": "Duplicate",
|
||||||
"task_duplicated": "Task duplicated",
|
"task_duplicated": "Task duplicated",
|
||||||
|
"task_moved": "Task moved",
|
||||||
|
"move_task_target": "Target object",
|
||||||
|
"move_task_message": "Choose the object this task should belong to. Its history, readings and trigger state move with it; it gets a new reference number and its entities are recreated under the new object. Linked documents stay with the current object.",
|
||||||
|
"move_task_title": "Move task",
|
||||||
|
"move_task": "Move to another object…",
|
||||||
"object_duplicated": "Object duplicated",
|
"object_duplicated": "Object duplicated",
|
||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"add_task": "+ Add Task",
|
"add_task": "+ Add Task",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Factor must be between 0.1 and 5.0",
|
"seasonal_override_range": "Factor must be between 0.1 and 5.0",
|
||||||
"clear_all": "Clear all",
|
"clear_all": "Clear all",
|
||||||
"clear": "Clear",
|
"clear": "Clear",
|
||||||
|
"date_type_toggle": "Type the date",
|
||||||
|
"date_type_invalid": "Not a valid date — try 1978-03-15, a year like 1978, or your own date format",
|
||||||
"seasonal_chart_title": "Seasonal Factors",
|
"seasonal_chart_title": "Seasonal Factors",
|
||||||
"seasonal_learned": "Learned",
|
"seasonal_learned": "Learned",
|
||||||
"seasonal_manual": "Manual",
|
"seasonal_manual": "Manual",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Proof of presence: Done is blocked on every surface until the NFC tag or QR code on the thing itself is scanned. Automations can pass 'via_tag_scan' to the complete service.",
|
"require_tag_scan_help": "Proof of presence: Done is blocked on every surface until the NFC tag or QR code on the thing itself is scanned. Automations can pass 'via_tag_scan' to the complete service.",
|
||||||
"disallow_skip": "Don't allow skipping",
|
"disallow_skip": "Don't allow skipping",
|
||||||
"disallow_skip_help": "The Skip action disappears from every surface, and the server refuses a skip from automations and voice too.",
|
"disallow_skip_help": "The Skip action disappears from every surface, and the server refuses a skip from automations and voice too.",
|
||||||
|
"no_notifications": "No notifications for this task",
|
||||||
|
"no_notifications_help": "No reminders for this task — no status notifications, repeats, lead-time reminders or bundles. It still shows on the dashboard and in its entities; the weekly digest still counts it.",
|
||||||
"require_tag_scan_hint": "This task completes only by scanning its NFC tag or QR code on the thing itself — saving here will be refused."
|
"require_tag_scan_hint": "This task completes only by scanning its NFC tag or QR code on the thing itself — saving here will be refused."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"duplicate": "Duplicar",
|
"duplicate": "Duplicar",
|
||||||
"task_duplicated": "Tarea duplicada",
|
"task_duplicated": "Tarea duplicada",
|
||||||
|
"task_moved": "Tarea movida",
|
||||||
|
"move_task_target": "Objeto de destino",
|
||||||
|
"move_task_message": "Elige el objeto al que debe pertenecer esta tarea. Su historial, lecturas y estado del disparador se mueven con ella; recibe un nuevo número de referencia y sus entidades se recrean bajo el nuevo objeto. Los documentos vinculados se quedan con el objeto actual.",
|
||||||
|
"move_task_title": "Mover tarea",
|
||||||
|
"move_task": "Mover a otro objeto…",
|
||||||
"object_duplicated": "Objeto duplicado",
|
"object_duplicated": "Objeto duplicado",
|
||||||
"delete": "Eliminar",
|
"delete": "Eliminar",
|
||||||
"add_task": "+ Tarea",
|
"add_task": "+ Tarea",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "El factor debe estar entre 0.1 y 5.0",
|
"seasonal_override_range": "El factor debe estar entre 0.1 y 5.0",
|
||||||
"clear_all": "Borrar todo",
|
"clear_all": "Borrar todo",
|
||||||
"clear": "Borrar",
|
"clear": "Borrar",
|
||||||
|
"date_type_toggle": "Escribir la fecha",
|
||||||
|
"date_type_invalid": "Fecha no válida — prueba 1978-03-15, un año como 1978 o tu formato de fecha",
|
||||||
"seasonal_chart_title": "Factores estacionales",
|
"seasonal_chart_title": "Factores estacionales",
|
||||||
"seasonal_learned": "Aprendido",
|
"seasonal_learned": "Aprendido",
|
||||||
"seasonal_manual": "Manual",
|
"seasonal_manual": "Manual",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Prueba de presencia: «Hecho» queda bloqueado en todas partes hasta escanear la etiqueta NFC o el código QR del propio objeto. Las automatizaciones pueden pasar 'via_tag_scan' al servicio complete.",
|
"require_tag_scan_help": "Prueba de presencia: «Hecho» queda bloqueado en todas partes hasta escanear la etiqueta NFC o el código QR del propio objeto. Las automatizaciones pueden pasar 'via_tag_scan' al servicio complete.",
|
||||||
"disallow_skip": "No permitir omitir",
|
"disallow_skip": "No permitir omitir",
|
||||||
"disallow_skip_help": "La acción Omitir desaparece de todas las superficies y el servidor también rechaza omisiones desde automatizaciones y voz.",
|
"disallow_skip_help": "La acción Omitir desaparece de todas las superficies y el servidor también rechaza omisiones desde automatizaciones y voz.",
|
||||||
|
"no_notifications": "Sin notificaciones para esta tarea",
|
||||||
|
"no_notifications_help": "Sin recordatorios para esta tarea — ni notificaciones de estado, ni repeticiones, ni avisos anticipados, ni agrupaciones. Sigue apareciendo en el panel y en sus entidades; el resumen semanal la sigue contando.",
|
||||||
"require_tag_scan_hint": "Esta tarea solo se completa escaneando su etiqueta NFC o código QR en el propio objeto; guardar aquí será rechazado."
|
"require_tag_scan_hint": "Esta tarea solo se completa escaneando su etiqueta NFC o código QR en el propio objeto; guardar aquí será rechazado."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Muokkaa",
|
"edit": "Muokkaa",
|
||||||
"duplicate": "Monista",
|
"duplicate": "Monista",
|
||||||
"task_duplicated": "Tehtävä monistettu",
|
"task_duplicated": "Tehtävä monistettu",
|
||||||
|
"task_moved": "Tehtävä siirretty",
|
||||||
|
"move_task_target": "Kohde",
|
||||||
|
"move_task_message": "Valitse kohde, johon tämän tehtävän tulee kuulua. Historia, lukemat ja liipaisimen tila siirtyvät mukana; tehtävä saa uuden viitenumeron ja sen entiteetit luodaan uudelleen uuden kohteen alle. Linkitetyt asiakirjat jäävät nykyiseen kohteeseen.",
|
||||||
|
"move_task_title": "Siirrä tehtävä",
|
||||||
|
"move_task": "Siirrä toiseen kohteeseen…",
|
||||||
"object_duplicated": "Kohde monistettu",
|
"object_duplicated": "Kohde monistettu",
|
||||||
"delete": "Poista",
|
"delete": "Poista",
|
||||||
"add_task": "+ Lisää tehtävä",
|
"add_task": "+ Lisää tehtävä",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Kertoimen on oltava välillä 0,1–5,0",
|
"seasonal_override_range": "Kertoimen on oltava välillä 0,1–5,0",
|
||||||
"clear_all": "Tyhjennä kaikki",
|
"clear_all": "Tyhjennä kaikki",
|
||||||
"clear": "Tyhjennä",
|
"clear": "Tyhjennä",
|
||||||
|
"date_type_toggle": "Kirjoita päivämäärä",
|
||||||
|
"date_type_invalid": "Virheellinen päivämäärä — kokeile 1978-03-15, vuotta kuten 1978 tai omaa päivämäärämuotoasi",
|
||||||
"seasonal_chart_title": "Kausikertoimet",
|
"seasonal_chart_title": "Kausikertoimet",
|
||||||
"seasonal_learned": "Opittu",
|
"seasonal_learned": "Opittu",
|
||||||
"seasonal_manual": "Manuaalinen",
|
"seasonal_manual": "Manuaalinen",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Läsnäolotodistus: ”Valmis” on estetty kaikkialla, kunnes laitteen NFC-tunniste tai QR-koodi on skannattu. Automaatiot voivat välittää 'via_tag_scan' complete-palvelulle.",
|
"require_tag_scan_help": "Läsnäolotodistus: ”Valmis” on estetty kaikkialla, kunnes laitteen NFC-tunniste tai QR-koodi on skannattu. Automaatiot voivat välittää 'via_tag_scan' complete-palvelulle.",
|
||||||
"disallow_skip": "Estä ohittaminen",
|
"disallow_skip": "Estä ohittaminen",
|
||||||
"disallow_skip_help": "Ohita-toiminto katoaa kaikista näkymistä, ja palvelin hylkää ohituksen myös automaatioista ja puheesta.",
|
"disallow_skip_help": "Ohita-toiminto katoaa kaikista näkymistä, ja palvelin hylkää ohituksen myös automaatioista ja puheesta.",
|
||||||
|
"no_notifications": "Ei ilmoituksia tästä tehtävästä",
|
||||||
|
"no_notifications_help": "Ei muistutuksia tästä tehtävästä — ei tilailmoituksia, toistoja, ennakkomuistutuksia eikä niputuksia. Se näkyy yhä kojelaudalla ja entiteeteissään; viikkokooste laskee sen edelleen mukaan.",
|
||||||
"require_tag_scan_hint": "Tämä tehtävä valmistuu vain skannaamalla sen NFC-tunniste tai QR-koodi itse laitteesta — tallennus tässä estetään."
|
"require_tag_scan_hint": "Tämä tehtävä valmistuu vain skannaamalla sen NFC-tunniste tai QR-koodi itse laitteesta — tallennus tässä estetään."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Modifier",
|
"edit": "Modifier",
|
||||||
"duplicate": "Dupliquer",
|
"duplicate": "Dupliquer",
|
||||||
"task_duplicated": "Tâche dupliquée",
|
"task_duplicated": "Tâche dupliquée",
|
||||||
|
"task_moved": "Tâche déplacée",
|
||||||
|
"move_task_target": "Objet cible",
|
||||||
|
"move_task_message": "Choisissez l'objet auquel cette tâche doit appartenir. Son historique, ses relevés et l'état de son déclencheur la suivent ; elle reçoit un nouveau numéro de référence et ses entités sont recréées sous le nouvel objet. Les documents liés restent avec l'objet actuel.",
|
||||||
|
"move_task_title": "Déplacer la tâche",
|
||||||
|
"move_task": "Déplacer vers un autre objet…",
|
||||||
"object_duplicated": "Objet dupliqué",
|
"object_duplicated": "Objet dupliqué",
|
||||||
"delete": "Supprimer",
|
"delete": "Supprimer",
|
||||||
"add_task": "+ Tâche",
|
"add_task": "+ Tâche",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Le facteur doit être entre 0.1 et 5.0",
|
"seasonal_override_range": "Le facteur doit être entre 0.1 et 5.0",
|
||||||
"clear_all": "Tout effacer",
|
"clear_all": "Tout effacer",
|
||||||
"clear": "Effacer",
|
"clear": "Effacer",
|
||||||
|
"date_type_toggle": "Saisir la date",
|
||||||
|
"date_type_invalid": "Date invalide — essayez 1978-03-15, une année comme 1978 ou votre format de date",
|
||||||
"seasonal_chart_title": "Facteurs saisonniers",
|
"seasonal_chart_title": "Facteurs saisonniers",
|
||||||
"seasonal_learned": "Appris",
|
"seasonal_learned": "Appris",
|
||||||
"seasonal_manual": "Manuel",
|
"seasonal_manual": "Manuel",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Preuve de présence : « Terminé » est bloqué partout tant que le tag NFC ou le QR code sur l'objet n'a pas été scanné. Les automatisations peuvent passer 'via_tag_scan' au service complete.",
|
"require_tag_scan_help": "Preuve de présence : « Terminé » est bloqué partout tant que le tag NFC ou le QR code sur l'objet n'a pas été scanné. Les automatisations peuvent passer 'via_tag_scan' au service complete.",
|
||||||
"disallow_skip": "Ne pas autoriser à ignorer",
|
"disallow_skip": "Ne pas autoriser à ignorer",
|
||||||
"disallow_skip_help": "L'action Ignorer disparaît de toutes les surfaces et le serveur refuse aussi un saut via les automatisations et la voix.",
|
"disallow_skip_help": "L'action Ignorer disparaît de toutes les surfaces et le serveur refuse aussi un saut via les automatisations et la voix.",
|
||||||
|
"no_notifications": "Aucune notification pour cette tâche",
|
||||||
|
"no_notifications_help": "Aucun rappel pour cette tâche — ni notifications de statut, ni répétitions, ni rappels anticipés, ni regroupements. Elle reste visible sur le tableau de bord et dans ses entités ; le résumé hebdomadaire la compte toujours.",
|
||||||
"require_tag_scan_hint": "Cette tâche ne se termine qu'en scannant son tag NFC ou son QR code sur l'objet — l'enregistrement ici sera refusé."
|
"require_tag_scan_hint": "Cette tâche ne se termine qu'en scannant son tag NFC ou son QR code sur l'objet — l'enregistrement ici sera refusé."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "संपादित करें",
|
"edit": "संपादित करें",
|
||||||
"duplicate": "डुप्लिकेट करें",
|
"duplicate": "डुप्लिकेट करें",
|
||||||
"task_duplicated": "कार्य डुप्लिकेट किया गया",
|
"task_duplicated": "कार्य डुप्लिकेट किया गया",
|
||||||
|
"task_moved": "कार्य ले जाया गया",
|
||||||
|
"move_task_target": "लक्ष्य ऑब्जेक्ट",
|
||||||
|
"move_task_message": "वह ऑब्जेक्ट चुनें जिससे यह कार्य जुड़ा होना चाहिए। इतिहास, रीडिंग और ट्रिगर स्थिति साथ जाएँगे; इसे नया संदर्भ नंबर मिलेगा और इसकी एंटिटी नए ऑब्जेक्ट के अंतर्गत फिर से बनेंगी। जुड़े दस्तावेज़ वर्तमान ऑब्जेक्ट के पास रहेंगे।",
|
||||||
|
"move_task_title": "कार्य ले जाएँ",
|
||||||
|
"move_task": "दूसरे ऑब्जेक्ट में ले जाएँ…",
|
||||||
"object_duplicated": "ऑब्जेक्ट डुप्लिकेट किया गया",
|
"object_duplicated": "ऑब्जेक्ट डुप्लिकेट किया गया",
|
||||||
"delete": "हटाएँ",
|
"delete": "हटाएँ",
|
||||||
"add_task": "+ कार्य जोड़ें",
|
"add_task": "+ कार्य जोड़ें",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "कारक 0.1 और 5.0 के बीच होना चाहिए",
|
"seasonal_override_range": "कारक 0.1 और 5.0 के बीच होना चाहिए",
|
||||||
"clear_all": "सभी साफ़ करें",
|
"clear_all": "सभी साफ़ करें",
|
||||||
"clear": "साफ़ करें",
|
"clear": "साफ़ करें",
|
||||||
|
"date_type_toggle": "तारीख टाइप करें",
|
||||||
|
"date_type_invalid": "मान्य तारीख नहीं — 1978-03-15, 1978 जैसा वर्ष या अपना तारीख प्रारूप आज़माएँ",
|
||||||
"seasonal_chart_title": "मौसमी कारक",
|
"seasonal_chart_title": "मौसमी कारक",
|
||||||
"seasonal_learned": "सीखा गया",
|
"seasonal_learned": "सीखा गया",
|
||||||
"seasonal_manual": "मैनुअल",
|
"seasonal_manual": "मैनुअल",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "उपस्थिति प्रमाण: जब तक वस्तु पर लगा NFC टैग या QR कोड स्कैन न हो, हर जगह “पूर्ण” अवरुद्ध रहता है। ऑटोमेशन complete सेवा को 'via_tag_scan' दे सकते हैं।",
|
"require_tag_scan_help": "उपस्थिति प्रमाण: जब तक वस्तु पर लगा NFC टैग या QR कोड स्कैन न हो, हर जगह “पूर्ण” अवरुद्ध रहता है। ऑटोमेशन complete सेवा को 'via_tag_scan' दे सकते हैं।",
|
||||||
"disallow_skip": "छोड़ने की अनुमति न दें",
|
"disallow_skip": "छोड़ने की अनुमति न दें",
|
||||||
"disallow_skip_help": "छोड़ें क्रिया सभी सतहों से हट जाती है, और सर्वर ऑटोमेशन व वॉयस से छोड़ने को भी अस्वीकार करता है।",
|
"disallow_skip_help": "छोड़ें क्रिया सभी सतहों से हट जाती है, और सर्वर ऑटोमेशन व वॉयस से छोड़ने को भी अस्वीकार करता है।",
|
||||||
|
"no_notifications": "इस कार्य के लिए कोई सूचना नहीं",
|
||||||
|
"no_notifications_help": "इस कार्य के लिए कोई रिमाइंडर नहीं — न स्थिति सूचनाएँ, न दोहराव, न अग्रिम रिमाइंडर, न बंडल। यह डैशबोर्ड और अपनी एंटिटी में दिखता रहेगा; साप्ताहिक सारांश इसे अब भी गिनेगा।",
|
||||||
"require_tag_scan_hint": "यह कार्य केवल वस्तु पर लगे NFC टैग या QR कोड को स्कैन करके ही पूर्ण होता है — यहाँ सहेजना अस्वीकार होगा।"
|
"require_tag_scan_hint": "यह कार्य केवल वस्तु पर लगे NFC टैग या QR कोड को स्कैन करके ही पूर्ण होता है — यहाँ सहेजना अस्वीकार होगा।"
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Szerkesztés",
|
"edit": "Szerkesztés",
|
||||||
"duplicate": "Duplikálás",
|
"duplicate": "Duplikálás",
|
||||||
"task_duplicated": "Feladat duplikálva",
|
"task_duplicated": "Feladat duplikálva",
|
||||||
|
"task_moved": "Feladat áthelyezve",
|
||||||
|
"move_task_target": "Célobjektum",
|
||||||
|
"move_task_message": "Válaszd ki, melyik objektumhoz tartozzon ez a feladat. Az előzmények, a mérőállások és a trigger állapota vele költöznek; új hivatkozási számot kap, és az entitásai az új objektum alatt jönnek létre újra. A csatolt dokumentumok a jelenlegi objektumnál maradnak.",
|
||||||
|
"move_task_title": "Feladat áthelyezése",
|
||||||
|
"move_task": "Áthelyezés másik objektumba…",
|
||||||
"object_duplicated": "Objektum duplikálva",
|
"object_duplicated": "Objektum duplikálva",
|
||||||
"delete": "Törlés",
|
"delete": "Törlés",
|
||||||
"add_task": "+ Új feladat",
|
"add_task": "+ Új feladat",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "A tényezőnek 0,1 és 5,0 között kell lennie",
|
"seasonal_override_range": "A tényezőnek 0,1 és 5,0 között kell lennie",
|
||||||
"clear_all": "Összes törlése",
|
"clear_all": "Összes törlése",
|
||||||
"clear": "Törlés",
|
"clear": "Törlés",
|
||||||
|
"date_type_toggle": "Dátum beírása",
|
||||||
|
"date_type_invalid": "Érvénytelen dátum — próbáld 1978-03-15 formában, egy évszámmal (1978) vagy a saját dátumformátumoddal",
|
||||||
"seasonal_chart_title": "Szezonális tényezők",
|
"seasonal_chart_title": "Szezonális tényezők",
|
||||||
"seasonal_learned": "Tanult",
|
"seasonal_learned": "Tanult",
|
||||||
"seasonal_manual": "Kézi",
|
"seasonal_manual": "Kézi",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Jelenlét-igazolás: a „Kész” mindenhol blokkolva van, amíg be nem olvasod az eszközön lévő NFC-címkét vagy QR-kódot. Az automatizálások 'via_tag_scan' értéket adhatnak át a complete szolgáltatásnak.",
|
"require_tag_scan_help": "Jelenlét-igazolás: a „Kész” mindenhol blokkolva van, amíg be nem olvasod az eszközön lévő NFC-címkét vagy QR-kódot. Az automatizálások 'via_tag_scan' értéket adhatnak át a complete szolgáltatásnak.",
|
||||||
"disallow_skip": "Kihagyás tiltása",
|
"disallow_skip": "Kihagyás tiltása",
|
||||||
"disallow_skip_help": "A Kihagyás művelet minden felületről eltűnik, és a szerver az automatizálásokból és hangból érkező kihagyást is elutasítja.",
|
"disallow_skip_help": "A Kihagyás művelet minden felületről eltűnik, és a szerver az automatizálásokból és hangból érkező kihagyást is elutasítja.",
|
||||||
|
"no_notifications": "Nincs értesítés ehhez a feladathoz",
|
||||||
|
"no_notifications_help": "Nincs emlékeztető ehhez a feladathoz — sem állapotértesítés, sem ismétlés, sem előzetes emlékeztető, sem csoportos üzenet. Továbbra is látszik a műszerfalon és az entitásaiban; a heti összefoglaló továbbra is számolja.",
|
||||||
"require_tag_scan_hint": "Ez a feladat csak az eszközön lévő NFC-címke vagy QR-kód beolvasásával fejezhető be — az itteni mentés el lesz utasítva."
|
"require_tag_scan_hint": "Ez a feladat csak az eszközön lévő NFC-címke vagy QR-kód beolvasásával fejezhető be — az itteni mentés el lesz utasítva."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Modifica",
|
"edit": "Modifica",
|
||||||
"duplicate": "Duplica",
|
"duplicate": "Duplica",
|
||||||
"task_duplicated": "Attività duplicata",
|
"task_duplicated": "Attività duplicata",
|
||||||
|
"task_moved": "Attività spostata",
|
||||||
|
"move_task_target": "Oggetto di destinazione",
|
||||||
|
"move_task_message": "Scegli l'oggetto a cui deve appartenere questa attività. Storico, letture e stato del trigger si spostano con lei; riceve un nuovo numero di riferimento e le sue entità vengono ricreate sotto il nuovo oggetto. I documenti collegati restano con l'oggetto attuale.",
|
||||||
|
"move_task_title": "Sposta attività",
|
||||||
|
"move_task": "Sposta in un altro oggetto…",
|
||||||
"object_duplicated": "Oggetto duplicato",
|
"object_duplicated": "Oggetto duplicato",
|
||||||
"delete": "Elimina",
|
"delete": "Elimina",
|
||||||
"add_task": "+ Attività",
|
"add_task": "+ Attività",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Il fattore deve essere tra 0.1 e 5.0",
|
"seasonal_override_range": "Il fattore deve essere tra 0.1 e 5.0",
|
||||||
"clear_all": "Cancella tutto",
|
"clear_all": "Cancella tutto",
|
||||||
"clear": "Cancella",
|
"clear": "Cancella",
|
||||||
|
"date_type_toggle": "Digita la data",
|
||||||
|
"date_type_invalid": "Data non valida — prova 1978-03-15, un anno come 1978 o il tuo formato di data",
|
||||||
"seasonal_chart_title": "Fattori stagionali",
|
"seasonal_chart_title": "Fattori stagionali",
|
||||||
"seasonal_learned": "Appreso",
|
"seasonal_learned": "Appreso",
|
||||||
"seasonal_manual": "Manuale",
|
"seasonal_manual": "Manuale",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Prova di presenza: «Fatto» è bloccato ovunque finché non viene scansionato il tag NFC o il codice QR sull'oggetto. Le automazioni possono passare 'via_tag_scan' al servizio complete.",
|
"require_tag_scan_help": "Prova di presenza: «Fatto» è bloccato ovunque finché non viene scansionato il tag NFC o il codice QR sull'oggetto. Le automazioni possono passare 'via_tag_scan' al servizio complete.",
|
||||||
"disallow_skip": "Non consentire di saltare",
|
"disallow_skip": "Non consentire di saltare",
|
||||||
"disallow_skip_help": "L'azione Salta scompare da tutte le superfici e il server rifiuta anche i salti da automazioni e voce.",
|
"disallow_skip_help": "L'azione Salta scompare da tutte le superfici e il server rifiuta anche i salti da automazioni e voce.",
|
||||||
|
"no_notifications": "Nessuna notifica per questa attività",
|
||||||
|
"no_notifications_help": "Nessun promemoria per questa attività — niente notifiche di stato, ripetizioni, promemoria anticipati o raggruppamenti. Resta visibile nella dashboard e nelle sue entità; il riepilogo settimanale la conta ancora.",
|
||||||
"require_tag_scan_hint": "Questa attività si completa solo scansionando il suo tag NFC o codice QR sull'oggetto — il salvataggio qui verrà rifiutato."
|
"require_tag_scan_hint": "Questa attività si completa solo scansionando il suo tag NFC o codice QR sull'oggetto — il salvataggio qui verrà rifiutato."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "編集",
|
"edit": "編集",
|
||||||
"duplicate": "複製",
|
"duplicate": "複製",
|
||||||
"task_duplicated": "タスクを複製しました",
|
"task_duplicated": "タスクを複製しました",
|
||||||
|
"task_moved": "タスクを移動しました",
|
||||||
|
"move_task_target": "移動先オブジェクト",
|
||||||
|
"move_task_message": "このタスクを所属させるオブジェクトを選んでください。履歴・検針値・トリガー状態は一緒に移動し、新しい参照番号が付き、エンティティは新しいオブジェクトの下で作り直されます。関連付けた文書は現在のオブジェクトに残ります。",
|
||||||
|
"move_task_title": "タスクを移動",
|
||||||
|
"move_task": "別のオブジェクトへ移動…",
|
||||||
"object_duplicated": "オブジェクトを複製しました",
|
"object_duplicated": "オブジェクトを複製しました",
|
||||||
"delete": "削除",
|
"delete": "削除",
|
||||||
"add_task": "+ タスク追加",
|
"add_task": "+ タスク追加",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "係数は0.1〜5.0の範囲で指定してください",
|
"seasonal_override_range": "係数は0.1〜5.0の範囲で指定してください",
|
||||||
"clear_all": "すべてクリア",
|
"clear_all": "すべてクリア",
|
||||||
"clear": "クリア",
|
"clear": "クリア",
|
||||||
|
"date_type_toggle": "日付を入力",
|
||||||
|
"date_type_invalid": "日付として無効です — 1978-03-15、1978 のような年、または設定中の日付形式で入力してください",
|
||||||
"seasonal_chart_title": "季節係数",
|
"seasonal_chart_title": "季節係数",
|
||||||
"seasonal_learned": "学習値",
|
"seasonal_learned": "学習値",
|
||||||
"seasonal_manual": "手動",
|
"seasonal_manual": "手動",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "在席証明:対象物のNFCタグまたはQRコードをスキャンするまで、どの画面でも「完了」はブロックされます。オートメーションはcompleteサービスに 'via_tag_scan' を渡せます。",
|
"require_tag_scan_help": "在席証明:対象物のNFCタグまたはQRコードをスキャンするまで、どの画面でも「完了」はブロックされます。オートメーションはcompleteサービスに 'via_tag_scan' を渡せます。",
|
||||||
"disallow_skip": "スキップを許可しない",
|
"disallow_skip": "スキップを許可しない",
|
||||||
"disallow_skip_help": "スキップ操作はすべての画面から消え、オートメーションや音声からのスキップもサーバーが拒否します。",
|
"disallow_skip_help": "スキップ操作はすべての画面から消え、オートメーションや音声からのスキップもサーバーが拒否します。",
|
||||||
|
"no_notifications": "このタスクは通知しない",
|
||||||
|
"no_notifications_help": "このタスクのリマインダーを止めます。ステータス通知・繰り返し・事前リマインダー・まとめ通知は送られません。ダッシュボードやエンティティには引き続き表示され、週次ダイジェストにも数えられます。",
|
||||||
"require_tag_scan_hint": "このタスクは対象物のNFCタグまたはQRコードをスキャンしないと完了できません。ここでの保存は拒否されます。"
|
"require_tag_scan_hint": "このタスクは対象物のNFCタグまたはQRコードをスキャンしないと完了できません。ここでの保存は拒否されます。"
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "편집",
|
"edit": "편집",
|
||||||
"duplicate": "복제",
|
"duplicate": "복제",
|
||||||
"task_duplicated": "작업이 복제되었습니다",
|
"task_duplicated": "작업이 복제되었습니다",
|
||||||
|
"task_moved": "작업을 이동했습니다",
|
||||||
|
"move_task_target": "대상 개체",
|
||||||
|
"move_task_message": "이 작업이 속할 개체를 선택하세요. 이력, 검침값, 트리거 상태가 함께 이동하며 새 참조 번호를 받고 엔티티는 새 개체 아래에 다시 생성됩니다. 연결된 문서는 현재 개체에 남습니다.",
|
||||||
|
"move_task_title": "작업 이동",
|
||||||
|
"move_task": "다른 개체로 이동…",
|
||||||
"object_duplicated": "객체가 복제되었습니다",
|
"object_duplicated": "객체가 복제되었습니다",
|
||||||
"delete": "삭제",
|
"delete": "삭제",
|
||||||
"add_task": "+ 작업 추가",
|
"add_task": "+ 작업 추가",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "계수는 0.1에서 5.0 사이여야 합니다",
|
"seasonal_override_range": "계수는 0.1에서 5.0 사이여야 합니다",
|
||||||
"clear_all": "모두 지우기",
|
"clear_all": "모두 지우기",
|
||||||
"clear": "지우기",
|
"clear": "지우기",
|
||||||
|
"date_type_toggle": "날짜 직접 입력",
|
||||||
|
"date_type_invalid": "올바른 날짜가 아닙니다 — 1978-03-15, 1978 같은 연도 또는 사용 중인 날짜 형식으로 입력하세요",
|
||||||
"seasonal_chart_title": "계절 계수",
|
"seasonal_chart_title": "계절 계수",
|
||||||
"seasonal_learned": "학습됨",
|
"seasonal_learned": "학습됨",
|
||||||
"seasonal_manual": "수동",
|
"seasonal_manual": "수동",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "현장 확인: 기기의 NFC 태그나 QR 코드를 스캔할 때까지 모든 화면에서 '완료'가 차단됩니다. 자동화는 complete 서비스에 'via_tag_scan'을 전달할 수 있습니다.",
|
"require_tag_scan_help": "현장 확인: 기기의 NFC 태그나 QR 코드를 스캔할 때까지 모든 화면에서 '완료'가 차단됩니다. 자동화는 complete 서비스에 'via_tag_scan'을 전달할 수 있습니다.",
|
||||||
"disallow_skip": "건너뛰기 허용 안 함",
|
"disallow_skip": "건너뛰기 허용 안 함",
|
||||||
"disallow_skip_help": "건너뛰기 동작이 모든 화면에서 사라지며, 서버는 자동화와 음성의 건너뛰기도 거부합니다.",
|
"disallow_skip_help": "건너뛰기 동작이 모든 화면에서 사라지며, 서버는 자동화와 음성의 건너뛰기도 거부합니다.",
|
||||||
|
"no_notifications": "이 작업은 알림 없음",
|
||||||
|
"no_notifications_help": "이 작업에는 리마인더가 없습니다. 상태 알림, 반복, 사전 알림, 묶음 알림이 모두 꺼집니다. 대시보드와 엔티티에는 계속 표시되며 주간 요약에는 계속 포함됩니다.",
|
||||||
"require_tag_scan_hint": "이 작업은 기기의 NFC 태그나 QR 코드를 스캔해야만 완료됩니다. 여기서 저장하면 거부됩니다."
|
"require_tag_scan_hint": "이 작업은 기기의 NFC 태그나 QR 코드를 스캔해야만 완료됩니다. 여기서 저장하면 거부됩니다."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Rediger",
|
"edit": "Rediger",
|
||||||
"duplicate": "Dupliser",
|
"duplicate": "Dupliser",
|
||||||
"task_duplicated": "Oppgave duplisert",
|
"task_duplicated": "Oppgave duplisert",
|
||||||
|
"task_moved": "Oppgave flyttet",
|
||||||
|
"move_task_target": "Målobjekt",
|
||||||
|
"move_task_message": "Velg objektet denne oppgaven skal tilhøre. Historikk, avlesninger og utløserstatus følger med; den får et nytt referansenummer, og entitetene opprettes på nytt under det nye objektet. Tilknyttede dokumenter blir hos det nåværende objektet.",
|
||||||
|
"move_task_title": "Flytt oppgave",
|
||||||
|
"move_task": "Flytt til et annet objekt…",
|
||||||
"object_duplicated": "Objekt duplisert",
|
"object_duplicated": "Objekt duplisert",
|
||||||
"delete": "Slett",
|
"delete": "Slett",
|
||||||
"add_task": "+ Legg til oppgave",
|
"add_task": "+ Legg til oppgave",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Faktor må være mellom 0,1 og 5,0",
|
"seasonal_override_range": "Faktor må være mellom 0,1 og 5,0",
|
||||||
"clear_all": "Fjern alle",
|
"clear_all": "Fjern alle",
|
||||||
"clear": "Tøm",
|
"clear": "Tøm",
|
||||||
|
"date_type_toggle": "Skriv inn datoen",
|
||||||
|
"date_type_invalid": "Ugyldig dato — prøv 1978-03-15, et år som 1978 eller ditt eget datoformat",
|
||||||
"seasonal_chart_title": "Sesongfaktorer",
|
"seasonal_chart_title": "Sesongfaktorer",
|
||||||
"seasonal_learned": "Lært",
|
"seasonal_learned": "Lært",
|
||||||
"seasonal_manual": "Manuell",
|
"seasonal_manual": "Manuell",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Tilstedeværelsesbevis: «Fullført» er blokkert overalt til NFC-taggen eller QR-koden på selve tingen er skannet. Automatiseringer kan sende 'via_tag_scan' til complete-tjenesten.",
|
"require_tag_scan_help": "Tilstedeværelsesbevis: «Fullført» er blokkert overalt til NFC-taggen eller QR-koden på selve tingen er skannet. Automatiseringer kan sende 'via_tag_scan' til complete-tjenesten.",
|
||||||
"disallow_skip": "Ikke tillat å hoppe over",
|
"disallow_skip": "Ikke tillat å hoppe over",
|
||||||
"disallow_skip_help": "Handlingen Hopp over forsvinner fra alle flater, og serveren avviser også hopp fra automatiseringer og tale.",
|
"disallow_skip_help": "Handlingen Hopp over forsvinner fra alle flater, og serveren avviser også hopp fra automatiseringer og tale.",
|
||||||
|
"no_notifications": "Ingen varsler for denne oppgaven",
|
||||||
|
"no_notifications_help": "Ingen påminnelser for denne oppgaven — ingen statusvarsler, gjentakelser, forhåndspåminnelser eller bunter. Den vises fortsatt på dashbordet og i entitetene sine; ukesoppsummeringen teller den fortsatt med.",
|
||||||
"require_tag_scan_hint": "Denne oppgaven fullføres bare ved å skanne NFC-taggen eller QR-koden på selve tingen — lagring her vil bli avvist."
|
"require_tag_scan_hint": "Denne oppgaven fullføres bare ved å skanne NFC-taggen eller QR-koden på selve tingen — lagring her vil bli avvist."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Bewerken",
|
"edit": "Bewerken",
|
||||||
"duplicate": "Dupliceren",
|
"duplicate": "Dupliceren",
|
||||||
"task_duplicated": "Taak gedupliceerd",
|
"task_duplicated": "Taak gedupliceerd",
|
||||||
|
"task_moved": "Taak verplaatst",
|
||||||
|
"move_task_target": "Doelobject",
|
||||||
|
"move_task_message": "Kies het object waar deze taak bij hoort. Geschiedenis, meterstanden en triggerstatus verhuizen mee; de taak krijgt een nieuw referentienummer en haar entiteiten worden onder het nieuwe object opnieuw aangemaakt. Gekoppelde documenten blijven bij het huidige object.",
|
||||||
|
"move_task_title": "Taak verplaatsen",
|
||||||
|
"move_task": "Naar ander object verplaatsen…",
|
||||||
"object_duplicated": "Object gedupliceerd",
|
"object_duplicated": "Object gedupliceerd",
|
||||||
"delete": "Verwijderen",
|
"delete": "Verwijderen",
|
||||||
"add_task": "+ Taak",
|
"add_task": "+ Taak",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Factor moet tussen 0.1 en 5.0 liggen",
|
"seasonal_override_range": "Factor moet tussen 0.1 en 5.0 liggen",
|
||||||
"clear_all": "Alles wissen",
|
"clear_all": "Alles wissen",
|
||||||
"clear": "Wissen",
|
"clear": "Wissen",
|
||||||
|
"date_type_toggle": "Datum typen",
|
||||||
|
"date_type_invalid": "Geen geldige datum — probeer 1978-03-15, een jaar zoals 1978 of je eigen datumnotatie",
|
||||||
"seasonal_chart_title": "Seizoensfactoren",
|
"seasonal_chart_title": "Seizoensfactoren",
|
||||||
"seasonal_learned": "Geleerd",
|
"seasonal_learned": "Geleerd",
|
||||||
"seasonal_manual": "Handmatig",
|
"seasonal_manual": "Handmatig",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Aanwezigheidsbewijs: „Klaar” is overal geblokkeerd totdat de NFC-tag of QR-code op het apparaat zelf is gescand. Automatiseringen kunnen 'via_tag_scan' aan de complete-service meegeven.",
|
"require_tag_scan_help": "Aanwezigheidsbewijs: „Klaar” is overal geblokkeerd totdat de NFC-tag of QR-code op het apparaat zelf is gescand. Automatiseringen kunnen 'via_tag_scan' aan de complete-service meegeven.",
|
||||||
"disallow_skip": "Overslaan niet toestaan",
|
"disallow_skip": "Overslaan niet toestaan",
|
||||||
"disallow_skip_help": "De actie Overslaan verdwijnt overal, en de server weigert ook een skip via automatiseringen en spraak.",
|
"disallow_skip_help": "De actie Overslaan verdwijnt overal, en de server weigert ook een skip via automatiseringen en spraak.",
|
||||||
|
"no_notifications": "Geen notificaties voor deze taak",
|
||||||
|
"no_notifications_help": "Geen herinneringen voor deze taak — geen statusnotificaties, herhalingen, vooraankondigingen of bundels. Ze blijft zichtbaar op het dashboard en in haar entiteiten; het weekoverzicht telt haar nog mee.",
|
||||||
"require_tag_scan_hint": "Deze taak wordt alleen afgerond door de NFC-tag of QR-code op het apparaat te scannen — opslaan hier wordt geweigerd."
|
"require_tag_scan_hint": "Deze taak wordt alleen afgerond door de NFC-tag of QR-code op het apparaat te scannen — opslaan hier wordt geweigerd."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Edytuj",
|
"edit": "Edytuj",
|
||||||
"duplicate": "Duplikuj",
|
"duplicate": "Duplikuj",
|
||||||
"task_duplicated": "Zadanie zduplikowane",
|
"task_duplicated": "Zadanie zduplikowane",
|
||||||
|
"task_moved": "Zadanie przeniesione",
|
||||||
|
"move_task_target": "Obiekt docelowy",
|
||||||
|
"move_task_message": "Wybierz obiekt, do którego ma należeć to zadanie. Historia, odczyty i stan wyzwalacza przenoszą się razem z nim; dostaje nowy numer referencyjny, a jego encje są tworzone na nowo pod nowym obiektem. Powiązane dokumenty zostają przy obecnym obiekcie.",
|
||||||
|
"move_task_title": "Przenieś zadanie",
|
||||||
|
"move_task": "Przenieś do innego obiektu…",
|
||||||
"object_duplicated": "Obiekt zduplikowany",
|
"object_duplicated": "Obiekt zduplikowany",
|
||||||
"delete": "Usuń",
|
"delete": "Usuń",
|
||||||
"add_task": "+ Dodaj zadanie",
|
"add_task": "+ Dodaj zadanie",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Czynnik musi być między 0.1 a 5.0",
|
"seasonal_override_range": "Czynnik musi być między 0.1 a 5.0",
|
||||||
"clear_all": "Wyczyść wszystko",
|
"clear_all": "Wyczyść wszystko",
|
||||||
"clear": "Wyczyść",
|
"clear": "Wyczyść",
|
||||||
|
"date_type_toggle": "Wpisz datę",
|
||||||
|
"date_type_invalid": "Nieprawidłowa data — wpisz 1978-03-15, rok jak 1978 albo swój format daty",
|
||||||
"seasonal_chart_title": "Czynniki sezonowe",
|
"seasonal_chart_title": "Czynniki sezonowe",
|
||||||
"seasonal_learned": "Wyuczone",
|
"seasonal_learned": "Wyuczone",
|
||||||
"seasonal_manual": "Ręczne",
|
"seasonal_manual": "Ręczne",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Dowód obecności: „Gotowe” jest wszędzie zablokowane, dopóki nie zeskanujesz tagu NFC lub kodu QR na urządzeniu. Automatyzacje mogą przekazać 'via_tag_scan' do usługi complete.",
|
"require_tag_scan_help": "Dowód obecności: „Gotowe” jest wszędzie zablokowane, dopóki nie zeskanujesz tagu NFC lub kodu QR na urządzeniu. Automatyzacje mogą przekazać 'via_tag_scan' do usługi complete.",
|
||||||
"disallow_skip": "Nie zezwalaj na pomijanie",
|
"disallow_skip": "Nie zezwalaj na pomijanie",
|
||||||
"disallow_skip_help": "Akcja Pomiń znika ze wszystkich widoków, a serwer odrzuca pominięcie także z automatyzacji i głosu.",
|
"disallow_skip_help": "Akcja Pomiń znika ze wszystkich widoków, a serwer odrzuca pominięcie także z automatyzacji i głosu.",
|
||||||
|
"no_notifications": "Bez powiadomień dla tego zadania",
|
||||||
|
"no_notifications_help": "Bez przypomnień dla tego zadania — bez powiadomień o statusie, powtórzeń, wcześniejszych przypomnień i pakietów. Nadal widać je na pulpicie i w jego encjach; tygodniowe podsumowanie wciąż je liczy.",
|
||||||
"require_tag_scan_hint": "To zadanie można ukończyć tylko skanując jego tag NFC lub kod QR na urządzeniu — zapis tutaj zostanie odrzucony."
|
"require_tag_scan_hint": "To zadanie można ukończyć tylko skanując jego tag NFC lub kod QR na urządzeniu — zapis tutaj zostanie odrzucony."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"duplicate": "Duplicar",
|
"duplicate": "Duplicar",
|
||||||
"task_duplicated": "Tarefa duplicada",
|
"task_duplicated": "Tarefa duplicada",
|
||||||
|
"task_moved": "Tarefa movida",
|
||||||
|
"move_task_target": "Objeto de destino",
|
||||||
|
"move_task_message": "Escolha o objeto ao qual esta tarefa deve pertencer. Histórico, leituras e estado do gatilho vão junto; ela recebe um novo número de referência e suas entidades são recriadas no novo objeto. Documentos vinculados permanecem no objeto atual.",
|
||||||
|
"move_task_title": "Mover tarefa",
|
||||||
|
"move_task": "Mover para outro objeto…",
|
||||||
"object_duplicated": "Objeto duplicado",
|
"object_duplicated": "Objeto duplicado",
|
||||||
"delete": "Excluir",
|
"delete": "Excluir",
|
||||||
"add_task": "+ Adicionar tarefa",
|
"add_task": "+ Adicionar tarefa",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "O fator deve estar entre 0,1 e 5,0",
|
"seasonal_override_range": "O fator deve estar entre 0,1 e 5,0",
|
||||||
"clear_all": "Limpar tudo",
|
"clear_all": "Limpar tudo",
|
||||||
"clear": "Limpar",
|
"clear": "Limpar",
|
||||||
|
"date_type_toggle": "Digitar a data",
|
||||||
|
"date_type_invalid": "Data inválida — tente 1978-03-15, um ano como 1978 ou seu formato de data",
|
||||||
"seasonal_chart_title": "Fatores sazonais",
|
"seasonal_chart_title": "Fatores sazonais",
|
||||||
"seasonal_learned": "Aprendido",
|
"seasonal_learned": "Aprendido",
|
||||||
"seasonal_manual": "Manual",
|
"seasonal_manual": "Manual",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Prova de presença: “Concluído” fica bloqueado em toda parte até escanear a etiqueta NFC ou o código QR no próprio objeto. Automações podem passar 'via_tag_scan' ao serviço complete.",
|
"require_tag_scan_help": "Prova de presença: “Concluído” fica bloqueado em toda parte até escanear a etiqueta NFC ou o código QR no próprio objeto. Automações podem passar 'via_tag_scan' ao serviço complete.",
|
||||||
"disallow_skip": "Não permitir pular",
|
"disallow_skip": "Não permitir pular",
|
||||||
"disallow_skip_help": "A ação Pular desaparece de todas as telas e o servidor também recusa pular via automações e voz.",
|
"disallow_skip_help": "A ação Pular desaparece de todas as telas e o servidor também recusa pular via automações e voz.",
|
||||||
|
"no_notifications": "Sem notificações para esta tarefa",
|
||||||
|
"no_notifications_help": "Sem lembretes para esta tarefa — sem notificações de status, repetições, avisos antecipados ou agrupamentos. Ela continua aparecendo no painel e em suas entidades; o resumo semanal ainda a conta.",
|
||||||
"require_tag_scan_hint": "Esta tarefa só é concluída escaneando sua etiqueta NFC ou código QR no próprio objeto — salvar aqui será recusado."
|
"require_tag_scan_hint": "Esta tarefa só é concluída escaneando sua etiqueta NFC ou código QR no próprio objeto — salvar aqui será recusado."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"duplicate": "Duplicar",
|
"duplicate": "Duplicar",
|
||||||
"task_duplicated": "Tarefa duplicada",
|
"task_duplicated": "Tarefa duplicada",
|
||||||
|
"task_moved": "Tarefa movida",
|
||||||
|
"move_task_target": "Objeto de destino",
|
||||||
|
"move_task_message": "Escolha o objeto a que esta tarefa deve pertencer. O histórico, as leituras e o estado do gatilho vão com ela; recebe um novo número de referência e as suas entidades são recriadas no novo objeto. Os documentos ligados ficam no objeto atual.",
|
||||||
|
"move_task_title": "Mover tarefa",
|
||||||
|
"move_task": "Mover para outro objeto…",
|
||||||
"object_duplicated": "Objeto duplicado",
|
"object_duplicated": "Objeto duplicado",
|
||||||
"delete": "Eliminar",
|
"delete": "Eliminar",
|
||||||
"add_task": "+ Tarefa",
|
"add_task": "+ Tarefa",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "O fator deve estar entre 0.1 e 5.0",
|
"seasonal_override_range": "O fator deve estar entre 0.1 e 5.0",
|
||||||
"clear_all": "Limpar tudo",
|
"clear_all": "Limpar tudo",
|
||||||
"clear": "Limpar",
|
"clear": "Limpar",
|
||||||
|
"date_type_toggle": "Escrever a data",
|
||||||
|
"date_type_invalid": "Data inválida — tente 1978-03-15, um ano como 1978 ou o seu formato de data",
|
||||||
"seasonal_chart_title": "Fatores sazonais",
|
"seasonal_chart_title": "Fatores sazonais",
|
||||||
"seasonal_learned": "Aprendido",
|
"seasonal_learned": "Aprendido",
|
||||||
"seasonal_manual": "Manual",
|
"seasonal_manual": "Manual",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Prova de presença: «Concluído» fica bloqueado em todo o lado até ler a etiqueta NFC ou o código QR no próprio objeto. As automações podem passar 'via_tag_scan' ao serviço complete.",
|
"require_tag_scan_help": "Prova de presença: «Concluído» fica bloqueado em todo o lado até ler a etiqueta NFC ou o código QR no próprio objeto. As automações podem passar 'via_tag_scan' ao serviço complete.",
|
||||||
"disallow_skip": "Não permitir ignorar",
|
"disallow_skip": "Não permitir ignorar",
|
||||||
"disallow_skip_help": "A ação Ignorar desaparece de todas as superfícies e o servidor também recusa ignorar via automações e voz.",
|
"disallow_skip_help": "A ação Ignorar desaparece de todas as superfícies e o servidor também recusa ignorar via automações e voz.",
|
||||||
|
"no_notifications": "Sem notificações para esta tarefa",
|
||||||
|
"no_notifications_help": "Sem lembretes para esta tarefa — sem notificações de estado, repetições, avisos antecipados ou agrupamentos. Continua a aparecer no painel e nas suas entidades; o resumo semanal continua a contá-la.",
|
||||||
"require_tag_scan_hint": "Esta tarefa só é concluída lendo a sua etiqueta NFC ou código QR no próprio objeto — guardar aqui será recusado."
|
"require_tag_scan_hint": "Esta tarefa só é concluída lendo a sua etiqueta NFC ou código QR no próprio objeto — guardar aqui será recusado."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Изменить",
|
"edit": "Изменить",
|
||||||
"duplicate": "Дублировать",
|
"duplicate": "Дублировать",
|
||||||
"task_duplicated": "Задача продублирована",
|
"task_duplicated": "Задача продублирована",
|
||||||
|
"task_moved": "Задача перемещена",
|
||||||
|
"move_task_target": "Целевой объект",
|
||||||
|
"move_task_message": "Выберите объект, к которому должна относиться эта задача. История, показания и состояние триггера переедут вместе с ней; она получит новый номер, а её сущности будут созданы заново под новым объектом. Привязанные документы остаются у текущего объекта.",
|
||||||
|
"move_task_title": "Переместить задачу",
|
||||||
|
"move_task": "Переместить в другой объект…",
|
||||||
"object_duplicated": "Объект продублирован",
|
"object_duplicated": "Объект продублирован",
|
||||||
"delete": "Удалить",
|
"delete": "Удалить",
|
||||||
"add_task": "+ Добавить задачу",
|
"add_task": "+ Добавить задачу",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Коэффициент должен быть от 0.1 до 5.0",
|
"seasonal_override_range": "Коэффициент должен быть от 0.1 до 5.0",
|
||||||
"clear_all": "Очистить все",
|
"clear_all": "Очистить все",
|
||||||
"clear": "Очистить",
|
"clear": "Очистить",
|
||||||
|
"date_type_toggle": "Ввести дату",
|
||||||
|
"date_type_invalid": "Некорректная дата — попробуйте 1978-03-15, год вроде 1978 или ваш формат даты",
|
||||||
"seasonal_chart_title": "Сезонные факторы",
|
"seasonal_chart_title": "Сезонные факторы",
|
||||||
"seasonal_learned": "Изученные",
|
"seasonal_learned": "Изученные",
|
||||||
"seasonal_manual": "Ручные",
|
"seasonal_manual": "Ручные",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Подтверждение присутствия: «Готово» заблокировано везде, пока не отсканирована NFC-метка или QR-код на самом устройстве. Автоматизации могут передавать 'via_tag_scan' в службу complete.",
|
"require_tag_scan_help": "Подтверждение присутствия: «Готово» заблокировано везде, пока не отсканирована NFC-метка или QR-код на самом устройстве. Автоматизации могут передавать 'via_tag_scan' в службу complete.",
|
||||||
"disallow_skip": "Запретить пропуск",
|
"disallow_skip": "Запретить пропуск",
|
||||||
"disallow_skip_help": "Действие «Пропустить» исчезает со всех экранов, а сервер отклоняет пропуск из автоматизаций и голосовых команд.",
|
"disallow_skip_help": "Действие «Пропустить» исчезает со всех экранов, а сервер отклоняет пропуск из автоматизаций и голосовых команд.",
|
||||||
|
"no_notifications": "Без уведомлений для этой задачи",
|
||||||
|
"no_notifications_help": "Без напоминаний для этой задачи — ни уведомлений о статусе, ни повторов, ни заблаговременных напоминаний, ни объединённых сообщений. Она по-прежнему видна на панели и в своих сущностях; еженедельная сводка её учитывает.",
|
||||||
"require_tag_scan_hint": "Эта задача завершается только сканированием её NFC-метки или QR-кода на самом устройстве — сохранение здесь будет отклонено."
|
"require_tag_scan_hint": "Эта задача завершается только сканированием её NFC-метки или QR-кода на самом устройстве — сохранение здесь будет отклонено."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Redigera",
|
"edit": "Redigera",
|
||||||
"duplicate": "Duplicera",
|
"duplicate": "Duplicera",
|
||||||
"task_duplicated": "Uppgift duplicerad",
|
"task_duplicated": "Uppgift duplicerad",
|
||||||
|
"task_moved": "Uppgift flyttad",
|
||||||
|
"move_task_target": "Målobjekt",
|
||||||
|
"move_task_message": "Välj vilket objekt uppgiften ska tillhöra. Historik, avläsningar och utlösarstatus följer med; den får ett nytt referensnummer och dess entiteter skapas om under det nya objektet. Länkade dokument stannar hos det nuvarande objektet.",
|
||||||
|
"move_task_title": "Flytta uppgift",
|
||||||
|
"move_task": "Flytta till ett annat objekt…",
|
||||||
"object_duplicated": "Objekt duplicerat",
|
"object_duplicated": "Objekt duplicerat",
|
||||||
"delete": "Ta bort",
|
"delete": "Ta bort",
|
||||||
"add_task": "+ Lägg till uppgift",
|
"add_task": "+ Lägg till uppgift",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Faktor måste vara mellan 0.1 och 5.0",
|
"seasonal_override_range": "Faktor måste vara mellan 0.1 och 5.0",
|
||||||
"clear_all": "Rensa alla",
|
"clear_all": "Rensa alla",
|
||||||
"clear": "Rensa",
|
"clear": "Rensa",
|
||||||
|
"date_type_toggle": "Skriv datumet",
|
||||||
|
"date_type_invalid": "Ogiltigt datum — prova 1978-03-15, ett år som 1978 eller ditt eget datumformat",
|
||||||
"seasonal_chart_title": "Säsongsfaktorer",
|
"seasonal_chart_title": "Säsongsfaktorer",
|
||||||
"seasonal_learned": "Lärt",
|
"seasonal_learned": "Lärt",
|
||||||
"seasonal_manual": "Manuell",
|
"seasonal_manual": "Manuell",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Närvarobevis: ”Klar” är blockerad överallt tills NFC-taggen eller QR-koden på själva saken har skannats. Automationer kan skicka 'via_tag_scan' till complete-tjänsten.",
|
"require_tag_scan_help": "Närvarobevis: ”Klar” är blockerad överallt tills NFC-taggen eller QR-koden på själva saken har skannats. Automationer kan skicka 'via_tag_scan' till complete-tjänsten.",
|
||||||
"disallow_skip": "Tillåt inte att hoppa över",
|
"disallow_skip": "Tillåt inte att hoppa över",
|
||||||
"disallow_skip_help": "Åtgärden Hoppa över försvinner från alla ytor och servern nekar även hopp från automationer och röst.",
|
"disallow_skip_help": "Åtgärden Hoppa över försvinner från alla ytor och servern nekar även hopp från automationer och röst.",
|
||||||
|
"no_notifications": "Inga aviseringar för den här uppgiften",
|
||||||
|
"no_notifications_help": "Inga påminnelser för den här uppgiften — inga statusaviseringar, upprepningar, förhandspåminnelser eller buntar. Den syns fortfarande på instrumentpanelen och i sina entiteter; veckosammanfattningen räknar den fortfarande.",
|
||||||
"require_tag_scan_hint": "Den här uppgiften slutförs endast genom att skanna dess NFC-tagg eller QR-kod på själva saken — att spara här kommer att nekas."
|
"require_tag_scan_hint": "Den här uppgiften slutförs endast genom att skanna dess NFC-tagg eller QR-kod på själva saken — att spara här kommer att nekas."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Düzenle",
|
"edit": "Düzenle",
|
||||||
"duplicate": "Çoğalt",
|
"duplicate": "Çoğalt",
|
||||||
"task_duplicated": "Görev çoğaltıldı",
|
"task_duplicated": "Görev çoğaltıldı",
|
||||||
|
"task_moved": "Görev taşındı",
|
||||||
|
"move_task_target": "Hedef nesne",
|
||||||
|
"move_task_message": "Bu görevin ait olacağı nesneyi seçin. Geçmiş, okumalar ve tetikleyici durumu birlikte taşınır; yeni bir referans numarası alır ve varlıkları yeni nesne altında yeniden oluşturulur. Bağlı belgeler mevcut nesnede kalır.",
|
||||||
|
"move_task_title": "Görevi taşı",
|
||||||
|
"move_task": "Başka bir nesneye taşı…",
|
||||||
"object_duplicated": "Nesne çoğaltıldı",
|
"object_duplicated": "Nesne çoğaltıldı",
|
||||||
"delete": "Sil",
|
"delete": "Sil",
|
||||||
"add_task": "+ Görev Ekle",
|
"add_task": "+ Görev Ekle",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Faktör 0.1 ile 5.0 arasında olmalıdır",
|
"seasonal_override_range": "Faktör 0.1 ile 5.0 arasında olmalıdır",
|
||||||
"clear_all": "Tümünü temizle",
|
"clear_all": "Tümünü temizle",
|
||||||
"clear": "Temizle",
|
"clear": "Temizle",
|
||||||
|
"date_type_toggle": "Tarihi yazın",
|
||||||
|
"date_type_invalid": "Geçersiz tarih — 1978-03-15, 1978 gibi bir yıl ya da kendi tarih biçiminizi deneyin",
|
||||||
"seasonal_chart_title": "Mevsimsel Faktörler",
|
"seasonal_chart_title": "Mevsimsel Faktörler",
|
||||||
"seasonal_learned": "Öğrenilmiş",
|
"seasonal_learned": "Öğrenilmiş",
|
||||||
"seasonal_manual": "Manuel",
|
"seasonal_manual": "Manuel",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Yerinde olma kanıtı: Cihazın üzerindeki NFC etiketi veya QR kodu taranana kadar 'Tamamlandı' her yerde engellenir. Otomasyonlar complete servisine 'via_tag_scan' iletebilir.",
|
"require_tag_scan_help": "Yerinde olma kanıtı: Cihazın üzerindeki NFC etiketi veya QR kodu taranana kadar 'Tamamlandı' her yerde engellenir. Otomasyonlar complete servisine 'via_tag_scan' iletebilir.",
|
||||||
"disallow_skip": "Atlamaya izin verme",
|
"disallow_skip": "Atlamaya izin verme",
|
||||||
"disallow_skip_help": "Atla eylemi tüm yüzeylerden kaybolur; sunucu otomasyonlardan ve sesten gelen atlamayı da reddeder.",
|
"disallow_skip_help": "Atla eylemi tüm yüzeylerden kaybolur; sunucu otomasyonlardan ve sesten gelen atlamayı da reddeder.",
|
||||||
|
"no_notifications": "Bu görev için bildirim yok",
|
||||||
|
"no_notifications_help": "Bu görev için hatırlatma yok — durum bildirimi, tekrar, önceden hatırlatma veya toplu bildirim gönderilmez. Panoda ve varlıklarında görünmeye devam eder; haftalık özet onu saymaya devam eder.",
|
||||||
"require_tag_scan_hint": "Bu görev yalnızca cihazın üzerindeki NFC etiketi veya QR kodu taranarak tamamlanır — buradan kaydetme reddedilecektir."
|
"require_tag_scan_hint": "Bu görev yalnızca cihazın üzerindeki NFC etiketi veya QR kodu taranarak tamamlanır — buradan kaydetme reddedilecektir."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Редагувати",
|
"edit": "Редагувати",
|
||||||
"duplicate": "Дублювати",
|
"duplicate": "Дублювати",
|
||||||
"task_duplicated": "Завдання продубльовано",
|
"task_duplicated": "Завдання продубльовано",
|
||||||
|
"task_moved": "Завдання переміщено",
|
||||||
|
"move_task_target": "Цільовий об'єкт",
|
||||||
|
"move_task_message": "Виберіть об'єкт, до якого має належати це завдання. Історія, показники та стан тригера переїдуть разом із ним; воно отримає новий номер, а його сутності буде створено заново під новим об'єктом. Прив'язані документи залишаться в поточному об'єкті.",
|
||||||
|
"move_task_title": "Перемістити завдання",
|
||||||
|
"move_task": "Перемістити до іншого об'єкта…",
|
||||||
"object_duplicated": "Об'єкт продубльовано",
|
"object_duplicated": "Об'єкт продубльовано",
|
||||||
"delete": "Видалити",
|
"delete": "Видалити",
|
||||||
"add_task": "+ Додати завдання",
|
"add_task": "+ Додати завдання",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Коефіцієнт має бути між 0.1 та 5.0",
|
"seasonal_override_range": "Коефіцієнт має бути між 0.1 та 5.0",
|
||||||
"clear_all": "Очистити все",
|
"clear_all": "Очистити все",
|
||||||
"clear": "Очистити",
|
"clear": "Очистити",
|
||||||
|
"date_type_toggle": "Ввести дату",
|
||||||
|
"date_type_invalid": "Некоректна дата — спробуйте 1978-03-15, рік на кшталт 1978 або ваш формат дати",
|
||||||
"seasonal_chart_title": "Сезонні коефіцієнти",
|
"seasonal_chart_title": "Сезонні коефіцієнти",
|
||||||
"seasonal_learned": "Навчена",
|
"seasonal_learned": "Навчена",
|
||||||
"seasonal_manual": "Ручна",
|
"seasonal_manual": "Ручна",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Підтвердження присутності: «Готово» заблоковано всюди, доки не відскановано NFC-мітку або QR-код на самому пристрої. Автоматизації можуть передати 'via_tag_scan' службі complete.",
|
"require_tag_scan_help": "Підтвердження присутності: «Готово» заблоковано всюди, доки не відскановано NFC-мітку або QR-код на самому пристрої. Автоматизації можуть передати 'via_tag_scan' службі complete.",
|
||||||
"disallow_skip": "Заборонити пропуск",
|
"disallow_skip": "Заборонити пропуск",
|
||||||
"disallow_skip_help": "Дія «Пропустити» зникає з усіх поверхонь, а сервер відхиляє пропуск з автоматизацій і голосу.",
|
"disallow_skip_help": "Дія «Пропустити» зникає з усіх поверхонь, а сервер відхиляє пропуск з автоматизацій і голосу.",
|
||||||
|
"no_notifications": "Без сповіщень для цього завдання",
|
||||||
|
"no_notifications_help": "Без нагадувань для цього завдання — ні сповіщень про статус, ні повторів, ні завчасних нагадувань, ні об'єднаних повідомлень. Воно й далі видиме на панелі та у своїх сутностях; тижневий підсумок його враховує.",
|
||||||
"require_tag_scan_hint": "Це завдання завершується лише скануванням його NFC-мітки або QR-коду на самому пристрої — збереження тут буде відхилено."
|
"require_tag_scan_hint": "Це завдання завершується лише скануванням його NFC-мітки або QR-коду на самому пристрої — збереження тут буде відхилено."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "编辑",
|
"edit": "编辑",
|
||||||
"duplicate": "复制",
|
"duplicate": "复制",
|
||||||
"task_duplicated": "任务已复制",
|
"task_duplicated": "任务已复制",
|
||||||
|
"task_moved": "任务已移动",
|
||||||
|
"move_task_target": "目标对象",
|
||||||
|
"move_task_message": "选择此任务应归属的对象。历史记录、读数和触发器状态会一并迁移;任务将获得新的编号,其实体会在新对象下重新创建。关联的文档仍留在当前对象。",
|
||||||
|
"move_task_title": "移动任务",
|
||||||
|
"move_task": "移动到其他对象…",
|
||||||
"object_duplicated": "对象已复制",
|
"object_duplicated": "对象已复制",
|
||||||
"delete": "删除",
|
"delete": "删除",
|
||||||
"add_task": "+ 添加任务",
|
"add_task": "+ 添加任务",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "系数必须介于 0.1 到 5.0 之间",
|
"seasonal_override_range": "系数必须介于 0.1 到 5.0 之间",
|
||||||
"clear_all": "全部清除",
|
"clear_all": "全部清除",
|
||||||
"clear": "清除",
|
"clear": "清除",
|
||||||
|
"date_type_toggle": "输入日期",
|
||||||
|
"date_type_invalid": "日期无效 — 请试试 1978-03-15、年份如 1978 或你的日期格式",
|
||||||
"seasonal_chart_title": "季节性因素",
|
"seasonal_chart_title": "季节性因素",
|
||||||
"seasonal_learned": "自动学习",
|
"seasonal_learned": "自动学习",
|
||||||
"seasonal_manual": "手动设置",
|
"seasonal_manual": "手动设置",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "在场证明:在扫描设备上的 NFC 标签或二维码之前,所有界面的“完成”均被阻止。自动化可向 complete 服务传递 'via_tag_scan'。",
|
"require_tag_scan_help": "在场证明:在扫描设备上的 NFC 标签或二维码之前,所有界面的“完成”均被阻止。自动化可向 complete 服务传递 'via_tag_scan'。",
|
||||||
"disallow_skip": "不允许跳过",
|
"disallow_skip": "不允许跳过",
|
||||||
"disallow_skip_help": "跳过操作将从所有界面消失,服务器也会拒绝来自自动化和语音的跳过。",
|
"disallow_skip_help": "跳过操作将从所有界面消失,服务器也会拒绝来自自动化和语音的跳过。",
|
||||||
|
"no_notifications": "此任务不发送通知",
|
||||||
|
"no_notifications_help": "此任务不再提醒——没有状态通知、重复、提前提醒或合并通知。它仍显示在仪表板和其实体中;每周摘要仍会统计它。",
|
||||||
"require_tag_scan_hint": "此任务只能通过扫描设备上的 NFC 标签或二维码来完成——在此保存将被拒绝。"
|
"require_tag_scan_hint": "此任务只能通过扫描设备上的 NFC 标签或二维码来完成——在此保存将被拒绝。"
|
||||||
}
|
}
|
||||||
@@ -1091,6 +1091,7 @@ export class MaintenanceSupporterPanel extends LitElement {
|
|||||||
task_id: task.id,
|
task_id: task.id,
|
||||||
object_name: obj.object.name,
|
object_name: obj.object.name,
|
||||||
allow_skip: task.allow_skip !== false,
|
allow_skip: task.allow_skip !== false,
|
||||||
|
notify_enabled: task.notify_enabled !== false,
|
||||||
task_name: task.name,
|
task_name: task.name,
|
||||||
type: task.type,
|
type: task.type,
|
||||||
schedule_type: task.schedule_type,
|
schedule_type: task.schedule_type,
|
||||||
@@ -2048,6 +2049,32 @@ export class MaintenanceSupporterPanel extends LitElement {
|
|||||||
if (res?.task_id) this._showTask(entryId, res.task_id);
|
if (res?.task_id) this._showTask(entryId, res.task_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forum #23: a task created on the wrong object — move it instead of
|
||||||
|
// re-creating it. Config, history, readings and trigger state travel with
|
||||||
|
// the task; it gets a new reference number and entities under the target.
|
||||||
|
private async _moveTask(entryId: string, taskId: string): Promise<void> {
|
||||||
|
this._moreMenuOpen = false;
|
||||||
|
const others = this._objects
|
||||||
|
.filter((o) => o.entry_id !== entryId && !o.object.archived_at)
|
||||||
|
.sort((a, b) => (a.object.name || "").localeCompare(b.object.name || ""));
|
||||||
|
if (!others.length) return;
|
||||||
|
const dlg = this.shadowRoot!.querySelector<MaintenanceConfirmDialog>("maintenance-confirm-dialog");
|
||||||
|
const result = await dlg?.prompt({
|
||||||
|
title: t("move_task_title", this._lang),
|
||||||
|
message: t("move_task_message", this._lang),
|
||||||
|
confirmText: t("move_task_title", this._lang),
|
||||||
|
inputLabel: t("move_task_target", this._lang),
|
||||||
|
inputValue: others[0].entry_id,
|
||||||
|
options: others.map((o) => ({ value: o.entry_id, label: o.object.name || o.entry_id })),
|
||||||
|
});
|
||||||
|
if (!result?.confirmed || !result.value) return;
|
||||||
|
const res = await this._runAction<{ task_id?: string; entry_id?: string }>(
|
||||||
|
{ type: "maintenance_supporter/task/move", entry_id: entryId, task_id: taskId, target_entry_id: result.value },
|
||||||
|
{ successToast: t("task_moved", this._lang) },
|
||||||
|
);
|
||||||
|
if (res?.entry_id && res.task_id) this._showTask(res.entry_id, res.task_id);
|
||||||
|
}
|
||||||
|
|
||||||
private async _toggleArchiveTask(entryId: string, taskId: string, archived: boolean): Promise<void> {
|
private async _toggleArchiveTask(entryId: string, taskId: string, archived: boolean): Promise<void> {
|
||||||
const res = await this._runAction({
|
const res = await this._runAction({
|
||||||
type: archived
|
type: archived
|
||||||
@@ -4353,6 +4380,7 @@ export class MaintenanceSupporterPanel extends LitElement {
|
|||||||
toggleArchive: (archived) => this._toggleArchiveTask(entryId, taskId, archived),
|
toggleArchive: (archived) => this._toggleArchiveTask(entryId, taskId, archived),
|
||||||
openQr: (taskName) => this._openQrForTask(entryId, taskId, obj?.object.name || "", taskName),
|
openQr: (taskName) => this._openQrForTask(entryId, taskId, obj?.object.name || "", taskName),
|
||||||
duplicateTask: () => this._duplicateTask(entryId, taskId),
|
duplicateTask: () => this._duplicateTask(entryId, taskId),
|
||||||
|
moveTask: () => this._moveTask(entryId, taskId),
|
||||||
promptReset: () => this._promptResetTask(entryId, taskId),
|
promptReset: () => this._promptResetTask(entryId, taskId),
|
||||||
promptPostpone: () => this._promptPostponeTask(entryId, taskId),
|
promptPostpone: () => this._promptPostponeTask(entryId, taskId),
|
||||||
snoozeTask: () => this._snoozeTask(entryId, taskId),
|
snoozeTask: () => this._snoozeTask(entryId, taskId),
|
||||||
|
|||||||
@@ -4480,9 +4480,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/nanoid": {
|
"node_modules/nanoid": {
|
||||||
"version": "3.3.11",
|
"version": "3.3.18",
|
||||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
|
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",
|
||||||
"integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
|
"integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ export interface TaskDetailContext {
|
|||||||
toggleArchive: (archived: boolean) => void;
|
toggleArchive: (archived: boolean) => void;
|
||||||
openQr: (taskName: string) => void;
|
openQr: (taskName: string) => void;
|
||||||
duplicateTask: () => void;
|
duplicateTask: () => void;
|
||||||
|
/** Forum #23: move the task to another object. */
|
||||||
|
moveTask: () => void;
|
||||||
promptReset: () => void;
|
promptReset: () => void;
|
||||||
promptPostpone: () => void;
|
promptPostpone: () => void;
|
||||||
snoozeTask: () => void;
|
snoozeTask: () => void;
|
||||||
@@ -133,6 +135,9 @@ function renderTaskHeader(task: MaintenanceTask, ctx: TaskDetailContext) {
|
|||||||
<ha-icon icon="mdi:calendar-arrow-right"></ha-icon>${formatDate(task.due_override, L)}
|
<ha-icon icon="mdi:calendar-arrow-right"></ha-icon>${formatDate(task.due_override, L)}
|
||||||
</span>` : nothing}
|
</span>` : nothing}
|
||||||
${renderUserBadge(task, ctx.getUserName, ctx.getPerson)}
|
${renderUserBadge(task, ctx.getUserName, ctx.getPerson)}
|
||||||
|
${task.notify_enabled === false
|
||||||
|
? html`<span class="nfc-badge muted-badge" title="${t("no_notifications", L)}"><ha-icon icon="mdi:bell-off-outline"></ha-icon></span>`
|
||||||
|
: nothing}
|
||||||
${task.nfc_tag_id
|
${task.nfc_tag_id
|
||||||
? html`<span class="nfc-badge" title="${t("nfc_tag_id", L)}: ${task.nfc_tag_id}"><ha-icon icon="mdi:nfc-variant"></ha-icon> NFC</span>`
|
? html`<span class="nfc-badge" title="${t("nfc_tag_id", L)}: ${task.nfc_tag_id}"><ha-icon icon="mdi:nfc-variant"></ha-icon> NFC</span>`
|
||||||
: !isOperator ? html`<span class="nfc-badge unlinked" title="${t("nfc_link_hint", L)}"
|
: !isOperator ? html`<span class="nfc-badge unlinked" title="${t("nfc_link_hint", L)}"
|
||||||
@@ -157,6 +162,7 @@ function renderTaskHeader(task: MaintenanceTask, ctx: TaskDetailContext) {
|
|||||||
<div class="popup-menu-item" @click=${() => { ctx.closeMoreMenu(); ctx.printWorksheet(); }}>${t("worksheet", L)}</div>
|
<div class="popup-menu-item" @click=${() => { ctx.closeMoreMenu(); ctx.printWorksheet(); }}>${t("worksheet", L)}</div>
|
||||||
${!isOperator ? html`
|
${!isOperator ? html`
|
||||||
<div class="popup-menu-item" @click=${() => ctx.duplicateTask()}>${t("duplicate", L)}</div>
|
<div class="popup-menu-item" @click=${() => ctx.duplicateTask()}>${t("duplicate", L)}</div>
|
||||||
|
<div class="popup-menu-item" @click=${() => ctx.moveTask()}>${t("move_task", L)}</div>
|
||||||
<div class="popup-menu-item" @click=${() => { ctx.closeMoreMenu(); ctx.promptReset(); }}>${t("reset", L)}</div>
|
<div class="popup-menu-item" @click=${() => { ctx.closeMoreMenu(); ctx.promptReset(); }}>${t("reset", L)}</div>
|
||||||
<div class="popup-menu-item" @click=${() => { ctx.closeMoreMenu(); ctx.promptPostpone(); }}>${t("postpone", L)}…</div>
|
<div class="popup-menu-item" @click=${() => { ctx.closeMoreMenu(); ctx.promptPostpone(); }}>${t("postpone", L)}…</div>
|
||||||
<div class="popup-menu-item" @click=${() => { ctx.closeMoreMenu(); ctx.snoozeTask(); }}>${t("snooze", L)}</div>
|
<div class="popup-menu-item" @click=${() => { ctx.closeMoreMenu(); ctx.snoozeTask(); }}>${t("snooze", L)}</div>
|
||||||
|
|||||||
@@ -410,6 +410,14 @@ interface RecurrenceLike {
|
|||||||
* day_of_month / one_time / manual. Used by the panel, card, and quick-actions. */
|
* day_of_month / one_time / manual. Used by the panel, card, and quick-actions. */
|
||||||
export function formatRecurrence(task: RecurrenceLike, lang?: string): string {
|
export function formatRecurrence(task: RecurrenceLike, lang?: string): string {
|
||||||
const s = task.schedule;
|
const s = task.schedule;
|
||||||
|
// A sensor-driven task is not "Manual": say so, and append the safety
|
||||||
|
// interval when one is set (the KPI card read "Manual" for the HVAC filter
|
||||||
|
// in the docs shot — reported as "schief").
|
||||||
|
if (task.schedule_type === "sensor_based") {
|
||||||
|
const base = t("sensor_based", lang);
|
||||||
|
const every = s && s.kind === "interval" && s.every ? s.every : task.interval_days;
|
||||||
|
return every ? `${base} · ${formatInterval(every, (s && s.kind === "interval" ? s.unit : task.interval_unit) || "days", lang)}` : base;
|
||||||
|
}
|
||||||
// (#83) ±N-day shift suffix shared by the calendar kinds.
|
// (#83) ±N-day shift suffix shared by the calendar kinds.
|
||||||
const off = s?.offset ? ` ${s.offset > 0 ? "+" : "−"}${Math.abs(s.offset)}d` : "";
|
const off = s?.offset ? ` ${s.offset > 0 ? "+" : "−"}${Math.abs(s.offset)}d` : "";
|
||||||
switch (s?.kind) {
|
switch (s?.kind) {
|
||||||
|
|||||||
@@ -204,6 +204,8 @@ export interface MaintenanceTask {
|
|||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
/** #150: false = the skip lock — Skip hidden everywhere, server refuses. */
|
/** #150: false = the skip lock — Skip hidden everywhere, server refuses. */
|
||||||
allow_skip?: boolean;
|
allow_skip?: boolean;
|
||||||
|
/** #173: false = this task sends no reminders (dashboard/entities unaffected). */
|
||||||
|
notify_enabled?: boolean;
|
||||||
schedule_type: string; // "time_based" | "sensor_based" | "one_time" | "manual" | calendar kind
|
schedule_type: string; // "time_based" | "sensor_based" | "one_time" | "manual" | calendar kind
|
||||||
interval_days?: number | null;
|
interval_days?: number | null;
|
||||||
interval_unit?: string; // "days" | "weeks" | "months" | "years"
|
interval_unit?: string; // "days" | "weeks" | "months" | "years"
|
||||||
@@ -544,6 +546,8 @@ export interface TaskRow {
|
|||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
/** #150: false = skip locked for this task. */
|
/** #150: false = skip locked for this task. */
|
||||||
allow_skip: boolean;
|
allow_skip: boolean;
|
||||||
|
/** #173: false = no reminders for this task. */
|
||||||
|
notify_enabled: boolean;
|
||||||
nfc_tag_id: string | null;
|
nfc_tag_id: string | null;
|
||||||
priority: string;
|
priority: string;
|
||||||
labels: string[];
|
labels: string[];
|
||||||
|
|||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Upravit",
|
"edit": "Upravit",
|
||||||
"duplicate": "Duplikovat",
|
"duplicate": "Duplikovat",
|
||||||
"task_duplicated": "Úkol duplikován",
|
"task_duplicated": "Úkol duplikován",
|
||||||
|
"task_moved": "Úkol přesunut",
|
||||||
|
"move_task_target": "Cílový objekt",
|
||||||
|
"move_task_message": "Vyberte objekt, ke kterému má tento úkol patřit. Historie, odečty a stav spouštěče se přesunou s ním; dostane nové referenční číslo a jeho entity se vytvoří znovu pod novým objektem. Propojené dokumenty zůstanou u aktuálního objektu.",
|
||||||
|
"move_task_title": "Přesunout úkol",
|
||||||
|
"move_task": "Přesunout do jiného objektu…",
|
||||||
"object_duplicated": "Objekt duplikován",
|
"object_duplicated": "Objekt duplikován",
|
||||||
"delete": "Smazat",
|
"delete": "Smazat",
|
||||||
"add_task": "+ Přidat úkol",
|
"add_task": "+ Přidat úkol",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Faktor musí být mezi 0.1 a 5.0",
|
"seasonal_override_range": "Faktor musí být mezi 0.1 a 5.0",
|
||||||
"clear_all": "Vymazat vše",
|
"clear_all": "Vymazat vše",
|
||||||
"clear": "Vymazat",
|
"clear": "Vymazat",
|
||||||
|
"date_type_toggle": "Zadat datum",
|
||||||
|
"date_type_invalid": "Neplatné datum — zkuste 1978-03-15, rok jako 1978 nebo svůj formát data",
|
||||||
"seasonal_chart_title": "Sezónní faktory",
|
"seasonal_chart_title": "Sezónní faktory",
|
||||||
"seasonal_learned": "Naučené",
|
"seasonal_learned": "Naučené",
|
||||||
"seasonal_manual": "Manuální",
|
"seasonal_manual": "Manuální",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Důkaz přítomnosti: „Hotovo“ je všude blokováno, dokud nenaskenujete NFC štítek nebo QR kód na zařízení. Automatizace mohou službě complete předat 'via_tag_scan'.",
|
"require_tag_scan_help": "Důkaz přítomnosti: „Hotovo“ je všude blokováno, dokud nenaskenujete NFC štítek nebo QR kód na zařízení. Automatizace mohou službě complete předat 'via_tag_scan'.",
|
||||||
"disallow_skip": "Nepovolit přeskočení",
|
"disallow_skip": "Nepovolit přeskočení",
|
||||||
"disallow_skip_help": "Akce Přeskočit zmizí ze všech ploch a server odmítne přeskočení i z automatizací a hlasu.",
|
"disallow_skip_help": "Akce Přeskočit zmizí ze všech ploch a server odmítne přeskočení i z automatizací a hlasu.",
|
||||||
|
"no_notifications": "Bez oznámení pro tento úkol",
|
||||||
|
"no_notifications_help": "Bez připomínek pro tento úkol — žádná oznámení o stavu, opakování, předstihové připomínky ani souhrny. Zůstává vidět na přehledu a ve svých entitách; týdenní přehled ho stále počítá.",
|
||||||
"require_tag_scan_hint": "Tento úkol lze dokončit pouze naskenováním jeho NFC štítku nebo QR kódu na zařízení — uložení zde bude odmítnuto."
|
"require_tag_scan_hint": "Tento úkol lze dokončit pouze naskenováním jeho NFC štítku nebo QR kódu na zařízení — uložení zde bude odmítnuto."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Rediger",
|
"edit": "Rediger",
|
||||||
"duplicate": "Dupliker",
|
"duplicate": "Dupliker",
|
||||||
"task_duplicated": "Opgave duplikeret",
|
"task_duplicated": "Opgave duplikeret",
|
||||||
|
"task_moved": "Opgave flyttet",
|
||||||
|
"move_task_target": "Målobjekt",
|
||||||
|
"move_task_message": "Vælg det objekt, opgaven skal høre til. Historik, aflæsninger og triggerstatus flytter med; den får et nyt referencenummer, og dens entiteter oprettes igen under det nye objekt. Tilknyttede dokumenter bliver hos det nuværende objekt.",
|
||||||
|
"move_task_title": "Flyt opgave",
|
||||||
|
"move_task": "Flyt til et andet objekt…",
|
||||||
"object_duplicated": "Objekt duplikeret",
|
"object_duplicated": "Objekt duplikeret",
|
||||||
"delete": "Slet",
|
"delete": "Slet",
|
||||||
"add_task": "+ Tilføj opgave",
|
"add_task": "+ Tilføj opgave",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Faktor skal være mellem 0.1 og 5.0",
|
"seasonal_override_range": "Faktor skal være mellem 0.1 og 5.0",
|
||||||
"clear_all": "Ryd alle",
|
"clear_all": "Ryd alle",
|
||||||
"clear": "Ryd",
|
"clear": "Ryd",
|
||||||
|
"date_type_toggle": "Indtast datoen",
|
||||||
|
"date_type_invalid": "Ugyldig dato — prøv 1978-03-15, et år som 1978 eller dit eget datoformat",
|
||||||
"seasonal_chart_title": "Sæsonfaktorer",
|
"seasonal_chart_title": "Sæsonfaktorer",
|
||||||
"seasonal_learned": "Lært",
|
"seasonal_learned": "Lært",
|
||||||
"seasonal_manual": "Manuel",
|
"seasonal_manual": "Manuel",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Tilstedeværelsesbevis: „Udført“ er blokeret overalt, indtil NFC-tagget eller QR-koden på selve tingen er scannet. Automatiseringer kan give 'via_tag_scan' til complete-tjenesten.",
|
"require_tag_scan_help": "Tilstedeværelsesbevis: „Udført“ er blokeret overalt, indtil NFC-tagget eller QR-koden på selve tingen er scannet. Automatiseringer kan give 'via_tag_scan' til complete-tjenesten.",
|
||||||
"disallow_skip": "Tillad ikke at springe over",
|
"disallow_skip": "Tillad ikke at springe over",
|
||||||
"disallow_skip_help": "Handlingen Spring over forsvinder fra alle flader, og serveren afviser også spring fra automatiseringer og stemme.",
|
"disallow_skip_help": "Handlingen Spring over forsvinder fra alle flader, og serveren afviser også spring fra automatiseringer og stemme.",
|
||||||
|
"no_notifications": "Ingen notifikationer for denne opgave",
|
||||||
|
"no_notifications_help": "Ingen påmindelser for denne opgave — ingen statusnotifikationer, gentagelser, forudpåmindelser eller bundter. Den vises stadig på dashboardet og i sine entiteter; ugeoversigten tæller den stadig med.",
|
||||||
"require_tag_scan_hint": "Denne opgave udføres kun ved at scanne dens NFC-tag eller QR-kode på selve tingen — at gemme her vil blive afvist."
|
"require_tag_scan_hint": "Denne opgave udføres kun ved at scanne dens NFC-tag eller QR-kode på selve tingen — at gemme her vil blive afvist."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Bearbeiten",
|
"edit": "Bearbeiten",
|
||||||
"duplicate": "Duplizieren",
|
"duplicate": "Duplizieren",
|
||||||
"task_duplicated": "Aufgabe dupliziert",
|
"task_duplicated": "Aufgabe dupliziert",
|
||||||
|
"task_moved": "Aufgabe verschoben",
|
||||||
|
"move_task_target": "Zielobjekt",
|
||||||
|
"move_task_message": "Wähle das Objekt, zu dem diese Aufgabe gehören soll. Historie, Zählerstände und Trigger-Zustand wandern mit; sie bekommt eine neue Referenznummer und ihre Entitäten werden unter dem neuen Objekt neu angelegt. Verknüpfte Dokumente bleiben beim aktuellen Objekt.",
|
||||||
|
"move_task_title": "Aufgabe verschieben",
|
||||||
|
"move_task": "In anderes Objekt verschieben…",
|
||||||
"object_duplicated": "Objekt dupliziert",
|
"object_duplicated": "Objekt dupliziert",
|
||||||
"delete": "Löschen",
|
"delete": "Löschen",
|
||||||
"add_task": "+ Aufgabe",
|
"add_task": "+ Aufgabe",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Faktor muss zwischen 0.1 und 5.0 liegen",
|
"seasonal_override_range": "Faktor muss zwischen 0.1 und 5.0 liegen",
|
||||||
"clear_all": "Alle zurücksetzen",
|
"clear_all": "Alle zurücksetzen",
|
||||||
"clear": "Leeren",
|
"clear": "Leeren",
|
||||||
|
"date_type_toggle": "Datum eintippen",
|
||||||
|
"date_type_invalid": "Kein gültiges Datum — versuche 1978-03-15, ein Jahr wie 1978 oder dein Datumsformat",
|
||||||
"seasonal_chart_title": "Saisonale Faktoren",
|
"seasonal_chart_title": "Saisonale Faktoren",
|
||||||
"seasonal_learned": "Gelernt",
|
"seasonal_learned": "Gelernt",
|
||||||
"seasonal_manual": "Manuell",
|
"seasonal_manual": "Manuell",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Anwesenheitsnachweis: „Erledigt“ ist überall blockiert, bis das NFC-Tag oder der QR-Code am Gerät gescannt wurde. Automationen können 'via_tag_scan' an den complete-Dienst übergeben.",
|
"require_tag_scan_help": "Anwesenheitsnachweis: „Erledigt“ ist überall blockiert, bis das NFC-Tag oder der QR-Code am Gerät gescannt wurde. Automationen können 'via_tag_scan' an den complete-Dienst übergeben.",
|
||||||
"disallow_skip": "Überspringen nicht erlauben",
|
"disallow_skip": "Überspringen nicht erlauben",
|
||||||
"disallow_skip_help": "Die Aktion Überspringen verschwindet von allen Oberflächen; auch Automationen und Sprachbefehle werden abgewiesen.",
|
"disallow_skip_help": "Die Aktion Überspringen verschwindet von allen Oberflächen; auch Automationen und Sprachbefehle werden abgewiesen.",
|
||||||
|
"no_notifications": "Keine Benachrichtigungen für diese Aufgabe",
|
||||||
|
"no_notifications_help": "Keine Erinnerungen für diese Aufgabe — keine Status-Benachrichtigungen, Wiederholungen, Vorlauf-Erinnerungen oder Bündel. Sie erscheint weiterhin im Dashboard und in ihren Entitäten; der Wochen-Digest zählt sie weiterhin mit.",
|
||||||
"require_tag_scan_hint": "Diese Aufgabe kann nur per Scan des NFC-Tags oder QR-Codes am Gerät erledigt werden — Speichern hier wird abgelehnt."
|
"require_tag_scan_hint": "Diese Aufgabe kann nur per Scan des NFC-Tags oder QR-Codes am Gerät erledigt werden — Speichern hier wird abgelehnt."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Edit",
|
"edit": "Edit",
|
||||||
"duplicate": "Duplicate",
|
"duplicate": "Duplicate",
|
||||||
"task_duplicated": "Task duplicated",
|
"task_duplicated": "Task duplicated",
|
||||||
|
"task_moved": "Task moved",
|
||||||
|
"move_task_target": "Target object",
|
||||||
|
"move_task_message": "Choose the object this task should belong to. Its history, readings and trigger state move with it; it gets a new reference number and its entities are recreated under the new object. Linked documents stay with the current object.",
|
||||||
|
"move_task_title": "Move task",
|
||||||
|
"move_task": "Move to another object…",
|
||||||
"object_duplicated": "Object duplicated",
|
"object_duplicated": "Object duplicated",
|
||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"add_task": "+ Add Task",
|
"add_task": "+ Add Task",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Factor must be between 0.1 and 5.0",
|
"seasonal_override_range": "Factor must be between 0.1 and 5.0",
|
||||||
"clear_all": "Clear all",
|
"clear_all": "Clear all",
|
||||||
"clear": "Clear",
|
"clear": "Clear",
|
||||||
|
"date_type_toggle": "Type the date",
|
||||||
|
"date_type_invalid": "Not a valid date — try 1978-03-15, a year like 1978, or your own date format",
|
||||||
"seasonal_chart_title": "Seasonal Factors",
|
"seasonal_chart_title": "Seasonal Factors",
|
||||||
"seasonal_learned": "Learned",
|
"seasonal_learned": "Learned",
|
||||||
"seasonal_manual": "Manual",
|
"seasonal_manual": "Manual",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Proof of presence: Done is blocked on every surface until the NFC tag or QR code on the thing itself is scanned. Automations can pass 'via_tag_scan' to the complete service.",
|
"require_tag_scan_help": "Proof of presence: Done is blocked on every surface until the NFC tag or QR code on the thing itself is scanned. Automations can pass 'via_tag_scan' to the complete service.",
|
||||||
"disallow_skip": "Don't allow skipping",
|
"disallow_skip": "Don't allow skipping",
|
||||||
"disallow_skip_help": "The Skip action disappears from every surface, and the server refuses a skip from automations and voice too.",
|
"disallow_skip_help": "The Skip action disappears from every surface, and the server refuses a skip from automations and voice too.",
|
||||||
|
"no_notifications": "No notifications for this task",
|
||||||
|
"no_notifications_help": "No reminders for this task — no status notifications, repeats, lead-time reminders or bundles. It still shows on the dashboard and in its entities; the weekly digest still counts it.",
|
||||||
"require_tag_scan_hint": "This task completes only by scanning its NFC tag or QR code on the thing itself — saving here will be refused."
|
"require_tag_scan_hint": "This task completes only by scanning its NFC tag or QR code on the thing itself — saving here will be refused."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"duplicate": "Duplicar",
|
"duplicate": "Duplicar",
|
||||||
"task_duplicated": "Tarea duplicada",
|
"task_duplicated": "Tarea duplicada",
|
||||||
|
"task_moved": "Tarea movida",
|
||||||
|
"move_task_target": "Objeto de destino",
|
||||||
|
"move_task_message": "Elige el objeto al que debe pertenecer esta tarea. Su historial, lecturas y estado del disparador se mueven con ella; recibe un nuevo número de referencia y sus entidades se recrean bajo el nuevo objeto. Los documentos vinculados se quedan con el objeto actual.",
|
||||||
|
"move_task_title": "Mover tarea",
|
||||||
|
"move_task": "Mover a otro objeto…",
|
||||||
"object_duplicated": "Objeto duplicado",
|
"object_duplicated": "Objeto duplicado",
|
||||||
"delete": "Eliminar",
|
"delete": "Eliminar",
|
||||||
"add_task": "+ Tarea",
|
"add_task": "+ Tarea",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "El factor debe estar entre 0.1 y 5.0",
|
"seasonal_override_range": "El factor debe estar entre 0.1 y 5.0",
|
||||||
"clear_all": "Borrar todo",
|
"clear_all": "Borrar todo",
|
||||||
"clear": "Borrar",
|
"clear": "Borrar",
|
||||||
|
"date_type_toggle": "Escribir la fecha",
|
||||||
|
"date_type_invalid": "Fecha no válida — prueba 1978-03-15, un año como 1978 o tu formato de fecha",
|
||||||
"seasonal_chart_title": "Factores estacionales",
|
"seasonal_chart_title": "Factores estacionales",
|
||||||
"seasonal_learned": "Aprendido",
|
"seasonal_learned": "Aprendido",
|
||||||
"seasonal_manual": "Manual",
|
"seasonal_manual": "Manual",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Prueba de presencia: «Hecho» queda bloqueado en todas partes hasta escanear la etiqueta NFC o el código QR del propio objeto. Las automatizaciones pueden pasar 'via_tag_scan' al servicio complete.",
|
"require_tag_scan_help": "Prueba de presencia: «Hecho» queda bloqueado en todas partes hasta escanear la etiqueta NFC o el código QR del propio objeto. Las automatizaciones pueden pasar 'via_tag_scan' al servicio complete.",
|
||||||
"disallow_skip": "No permitir omitir",
|
"disallow_skip": "No permitir omitir",
|
||||||
"disallow_skip_help": "La acción Omitir desaparece de todas las superficies y el servidor también rechaza omisiones desde automatizaciones y voz.",
|
"disallow_skip_help": "La acción Omitir desaparece de todas las superficies y el servidor también rechaza omisiones desde automatizaciones y voz.",
|
||||||
|
"no_notifications": "Sin notificaciones para esta tarea",
|
||||||
|
"no_notifications_help": "Sin recordatorios para esta tarea — ni notificaciones de estado, ni repeticiones, ni avisos anticipados, ni agrupaciones. Sigue apareciendo en el panel y en sus entidades; el resumen semanal la sigue contando.",
|
||||||
"require_tag_scan_hint": "Esta tarea solo se completa escaneando su etiqueta NFC o código QR en el propio objeto; guardar aquí será rechazado."
|
"require_tag_scan_hint": "Esta tarea solo se completa escaneando su etiqueta NFC o código QR en el propio objeto; guardar aquí será rechazado."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Muokkaa",
|
"edit": "Muokkaa",
|
||||||
"duplicate": "Monista",
|
"duplicate": "Monista",
|
||||||
"task_duplicated": "Tehtävä monistettu",
|
"task_duplicated": "Tehtävä monistettu",
|
||||||
|
"task_moved": "Tehtävä siirretty",
|
||||||
|
"move_task_target": "Kohde",
|
||||||
|
"move_task_message": "Valitse kohde, johon tämän tehtävän tulee kuulua. Historia, lukemat ja liipaisimen tila siirtyvät mukana; tehtävä saa uuden viitenumeron ja sen entiteetit luodaan uudelleen uuden kohteen alle. Linkitetyt asiakirjat jäävät nykyiseen kohteeseen.",
|
||||||
|
"move_task_title": "Siirrä tehtävä",
|
||||||
|
"move_task": "Siirrä toiseen kohteeseen…",
|
||||||
"object_duplicated": "Kohde monistettu",
|
"object_duplicated": "Kohde monistettu",
|
||||||
"delete": "Poista",
|
"delete": "Poista",
|
||||||
"add_task": "+ Lisää tehtävä",
|
"add_task": "+ Lisää tehtävä",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Kertoimen on oltava välillä 0,1–5,0",
|
"seasonal_override_range": "Kertoimen on oltava välillä 0,1–5,0",
|
||||||
"clear_all": "Tyhjennä kaikki",
|
"clear_all": "Tyhjennä kaikki",
|
||||||
"clear": "Tyhjennä",
|
"clear": "Tyhjennä",
|
||||||
|
"date_type_toggle": "Kirjoita päivämäärä",
|
||||||
|
"date_type_invalid": "Virheellinen päivämäärä — kokeile 1978-03-15, vuotta kuten 1978 tai omaa päivämäärämuotoasi",
|
||||||
"seasonal_chart_title": "Kausikertoimet",
|
"seasonal_chart_title": "Kausikertoimet",
|
||||||
"seasonal_learned": "Opittu",
|
"seasonal_learned": "Opittu",
|
||||||
"seasonal_manual": "Manuaalinen",
|
"seasonal_manual": "Manuaalinen",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Läsnäolotodistus: ”Valmis” on estetty kaikkialla, kunnes laitteen NFC-tunniste tai QR-koodi on skannattu. Automaatiot voivat välittää 'via_tag_scan' complete-palvelulle.",
|
"require_tag_scan_help": "Läsnäolotodistus: ”Valmis” on estetty kaikkialla, kunnes laitteen NFC-tunniste tai QR-koodi on skannattu. Automaatiot voivat välittää 'via_tag_scan' complete-palvelulle.",
|
||||||
"disallow_skip": "Estä ohittaminen",
|
"disallow_skip": "Estä ohittaminen",
|
||||||
"disallow_skip_help": "Ohita-toiminto katoaa kaikista näkymistä, ja palvelin hylkää ohituksen myös automaatioista ja puheesta.",
|
"disallow_skip_help": "Ohita-toiminto katoaa kaikista näkymistä, ja palvelin hylkää ohituksen myös automaatioista ja puheesta.",
|
||||||
|
"no_notifications": "Ei ilmoituksia tästä tehtävästä",
|
||||||
|
"no_notifications_help": "Ei muistutuksia tästä tehtävästä — ei tilailmoituksia, toistoja, ennakkomuistutuksia eikä niputuksia. Se näkyy yhä kojelaudalla ja entiteeteissään; viikkokooste laskee sen edelleen mukaan.",
|
||||||
"require_tag_scan_hint": "Tämä tehtävä valmistuu vain skannaamalla sen NFC-tunniste tai QR-koodi itse laitteesta — tallennus tässä estetään."
|
"require_tag_scan_hint": "Tämä tehtävä valmistuu vain skannaamalla sen NFC-tunniste tai QR-koodi itse laitteesta — tallennus tässä estetään."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Modifier",
|
"edit": "Modifier",
|
||||||
"duplicate": "Dupliquer",
|
"duplicate": "Dupliquer",
|
||||||
"task_duplicated": "Tâche dupliquée",
|
"task_duplicated": "Tâche dupliquée",
|
||||||
|
"task_moved": "Tâche déplacée",
|
||||||
|
"move_task_target": "Objet cible",
|
||||||
|
"move_task_message": "Choisissez l'objet auquel cette tâche doit appartenir. Son historique, ses relevés et l'état de son déclencheur la suivent ; elle reçoit un nouveau numéro de référence et ses entités sont recréées sous le nouvel objet. Les documents liés restent avec l'objet actuel.",
|
||||||
|
"move_task_title": "Déplacer la tâche",
|
||||||
|
"move_task": "Déplacer vers un autre objet…",
|
||||||
"object_duplicated": "Objet dupliqué",
|
"object_duplicated": "Objet dupliqué",
|
||||||
"delete": "Supprimer",
|
"delete": "Supprimer",
|
||||||
"add_task": "+ Tâche",
|
"add_task": "+ Tâche",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Le facteur doit être entre 0.1 et 5.0",
|
"seasonal_override_range": "Le facteur doit être entre 0.1 et 5.0",
|
||||||
"clear_all": "Tout effacer",
|
"clear_all": "Tout effacer",
|
||||||
"clear": "Effacer",
|
"clear": "Effacer",
|
||||||
|
"date_type_toggle": "Saisir la date",
|
||||||
|
"date_type_invalid": "Date invalide — essayez 1978-03-15, une année comme 1978 ou votre format de date",
|
||||||
"seasonal_chart_title": "Facteurs saisonniers",
|
"seasonal_chart_title": "Facteurs saisonniers",
|
||||||
"seasonal_learned": "Appris",
|
"seasonal_learned": "Appris",
|
||||||
"seasonal_manual": "Manuel",
|
"seasonal_manual": "Manuel",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Preuve de présence : « Terminé » est bloqué partout tant que le tag NFC ou le QR code sur l'objet n'a pas été scanné. Les automatisations peuvent passer 'via_tag_scan' au service complete.",
|
"require_tag_scan_help": "Preuve de présence : « Terminé » est bloqué partout tant que le tag NFC ou le QR code sur l'objet n'a pas été scanné. Les automatisations peuvent passer 'via_tag_scan' au service complete.",
|
||||||
"disallow_skip": "Ne pas autoriser à ignorer",
|
"disallow_skip": "Ne pas autoriser à ignorer",
|
||||||
"disallow_skip_help": "L'action Ignorer disparaît de toutes les surfaces et le serveur refuse aussi un saut via les automatisations et la voix.",
|
"disallow_skip_help": "L'action Ignorer disparaît de toutes les surfaces et le serveur refuse aussi un saut via les automatisations et la voix.",
|
||||||
|
"no_notifications": "Aucune notification pour cette tâche",
|
||||||
|
"no_notifications_help": "Aucun rappel pour cette tâche — ni notifications de statut, ni répétitions, ni rappels anticipés, ni regroupements. Elle reste visible sur le tableau de bord et dans ses entités ; le résumé hebdomadaire la compte toujours.",
|
||||||
"require_tag_scan_hint": "Cette tâche ne se termine qu'en scannant son tag NFC ou son QR code sur l'objet — l'enregistrement ici sera refusé."
|
"require_tag_scan_hint": "Cette tâche ne se termine qu'en scannant son tag NFC ou son QR code sur l'objet — l'enregistrement ici sera refusé."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "संपादित करें",
|
"edit": "संपादित करें",
|
||||||
"duplicate": "डुप्लिकेट करें",
|
"duplicate": "डुप्लिकेट करें",
|
||||||
"task_duplicated": "कार्य डुप्लिकेट किया गया",
|
"task_duplicated": "कार्य डुप्लिकेट किया गया",
|
||||||
|
"task_moved": "कार्य ले जाया गया",
|
||||||
|
"move_task_target": "लक्ष्य ऑब्जेक्ट",
|
||||||
|
"move_task_message": "वह ऑब्जेक्ट चुनें जिससे यह कार्य जुड़ा होना चाहिए। इतिहास, रीडिंग और ट्रिगर स्थिति साथ जाएँगे; इसे नया संदर्भ नंबर मिलेगा और इसकी एंटिटी नए ऑब्जेक्ट के अंतर्गत फिर से बनेंगी। जुड़े दस्तावेज़ वर्तमान ऑब्जेक्ट के पास रहेंगे।",
|
||||||
|
"move_task_title": "कार्य ले जाएँ",
|
||||||
|
"move_task": "दूसरे ऑब्जेक्ट में ले जाएँ…",
|
||||||
"object_duplicated": "ऑब्जेक्ट डुप्लिकेट किया गया",
|
"object_duplicated": "ऑब्जेक्ट डुप्लिकेट किया गया",
|
||||||
"delete": "हटाएँ",
|
"delete": "हटाएँ",
|
||||||
"add_task": "+ कार्य जोड़ें",
|
"add_task": "+ कार्य जोड़ें",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "कारक 0.1 और 5.0 के बीच होना चाहिए",
|
"seasonal_override_range": "कारक 0.1 और 5.0 के बीच होना चाहिए",
|
||||||
"clear_all": "सभी साफ़ करें",
|
"clear_all": "सभी साफ़ करें",
|
||||||
"clear": "साफ़ करें",
|
"clear": "साफ़ करें",
|
||||||
|
"date_type_toggle": "तारीख टाइप करें",
|
||||||
|
"date_type_invalid": "मान्य तारीख नहीं — 1978-03-15, 1978 जैसा वर्ष या अपना तारीख प्रारूप आज़माएँ",
|
||||||
"seasonal_chart_title": "मौसमी कारक",
|
"seasonal_chart_title": "मौसमी कारक",
|
||||||
"seasonal_learned": "सीखा गया",
|
"seasonal_learned": "सीखा गया",
|
||||||
"seasonal_manual": "मैनुअल",
|
"seasonal_manual": "मैनुअल",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "उपस्थिति प्रमाण: जब तक वस्तु पर लगा NFC टैग या QR कोड स्कैन न हो, हर जगह “पूर्ण” अवरुद्ध रहता है। ऑटोमेशन complete सेवा को 'via_tag_scan' दे सकते हैं।",
|
"require_tag_scan_help": "उपस्थिति प्रमाण: जब तक वस्तु पर लगा NFC टैग या QR कोड स्कैन न हो, हर जगह “पूर्ण” अवरुद्ध रहता है। ऑटोमेशन complete सेवा को 'via_tag_scan' दे सकते हैं।",
|
||||||
"disallow_skip": "छोड़ने की अनुमति न दें",
|
"disallow_skip": "छोड़ने की अनुमति न दें",
|
||||||
"disallow_skip_help": "छोड़ें क्रिया सभी सतहों से हट जाती है, और सर्वर ऑटोमेशन व वॉयस से छोड़ने को भी अस्वीकार करता है।",
|
"disallow_skip_help": "छोड़ें क्रिया सभी सतहों से हट जाती है, और सर्वर ऑटोमेशन व वॉयस से छोड़ने को भी अस्वीकार करता है।",
|
||||||
|
"no_notifications": "इस कार्य के लिए कोई सूचना नहीं",
|
||||||
|
"no_notifications_help": "इस कार्य के लिए कोई रिमाइंडर नहीं — न स्थिति सूचनाएँ, न दोहराव, न अग्रिम रिमाइंडर, न बंडल। यह डैशबोर्ड और अपनी एंटिटी में दिखता रहेगा; साप्ताहिक सारांश इसे अब भी गिनेगा।",
|
||||||
"require_tag_scan_hint": "यह कार्य केवल वस्तु पर लगे NFC टैग या QR कोड को स्कैन करके ही पूर्ण होता है — यहाँ सहेजना अस्वीकार होगा।"
|
"require_tag_scan_hint": "यह कार्य केवल वस्तु पर लगे NFC टैग या QR कोड को स्कैन करके ही पूर्ण होता है — यहाँ सहेजना अस्वीकार होगा।"
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Szerkesztés",
|
"edit": "Szerkesztés",
|
||||||
"duplicate": "Duplikálás",
|
"duplicate": "Duplikálás",
|
||||||
"task_duplicated": "Feladat duplikálva",
|
"task_duplicated": "Feladat duplikálva",
|
||||||
|
"task_moved": "Feladat áthelyezve",
|
||||||
|
"move_task_target": "Célobjektum",
|
||||||
|
"move_task_message": "Válaszd ki, melyik objektumhoz tartozzon ez a feladat. Az előzmények, a mérőállások és a trigger állapota vele költöznek; új hivatkozási számot kap, és az entitásai az új objektum alatt jönnek létre újra. A csatolt dokumentumok a jelenlegi objektumnál maradnak.",
|
||||||
|
"move_task_title": "Feladat áthelyezése",
|
||||||
|
"move_task": "Áthelyezés másik objektumba…",
|
||||||
"object_duplicated": "Objektum duplikálva",
|
"object_duplicated": "Objektum duplikálva",
|
||||||
"delete": "Törlés",
|
"delete": "Törlés",
|
||||||
"add_task": "+ Új feladat",
|
"add_task": "+ Új feladat",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "A tényezőnek 0,1 és 5,0 között kell lennie",
|
"seasonal_override_range": "A tényezőnek 0,1 és 5,0 között kell lennie",
|
||||||
"clear_all": "Összes törlése",
|
"clear_all": "Összes törlése",
|
||||||
"clear": "Törlés",
|
"clear": "Törlés",
|
||||||
|
"date_type_toggle": "Dátum beírása",
|
||||||
|
"date_type_invalid": "Érvénytelen dátum — próbáld 1978-03-15 formában, egy évszámmal (1978) vagy a saját dátumformátumoddal",
|
||||||
"seasonal_chart_title": "Szezonális tényezők",
|
"seasonal_chart_title": "Szezonális tényezők",
|
||||||
"seasonal_learned": "Tanult",
|
"seasonal_learned": "Tanult",
|
||||||
"seasonal_manual": "Kézi",
|
"seasonal_manual": "Kézi",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Jelenlét-igazolás: a „Kész” mindenhol blokkolva van, amíg be nem olvasod az eszközön lévő NFC-címkét vagy QR-kódot. Az automatizálások 'via_tag_scan' értéket adhatnak át a complete szolgáltatásnak.",
|
"require_tag_scan_help": "Jelenlét-igazolás: a „Kész” mindenhol blokkolva van, amíg be nem olvasod az eszközön lévő NFC-címkét vagy QR-kódot. Az automatizálások 'via_tag_scan' értéket adhatnak át a complete szolgáltatásnak.",
|
||||||
"disallow_skip": "Kihagyás tiltása",
|
"disallow_skip": "Kihagyás tiltása",
|
||||||
"disallow_skip_help": "A Kihagyás művelet minden felületről eltűnik, és a szerver az automatizálásokból és hangból érkező kihagyást is elutasítja.",
|
"disallow_skip_help": "A Kihagyás művelet minden felületről eltűnik, és a szerver az automatizálásokból és hangból érkező kihagyást is elutasítja.",
|
||||||
|
"no_notifications": "Nincs értesítés ehhez a feladathoz",
|
||||||
|
"no_notifications_help": "Nincs emlékeztető ehhez a feladathoz — sem állapotértesítés, sem ismétlés, sem előzetes emlékeztető, sem csoportos üzenet. Továbbra is látszik a műszerfalon és az entitásaiban; a heti összefoglaló továbbra is számolja.",
|
||||||
"require_tag_scan_hint": "Ez a feladat csak az eszközön lévő NFC-címke vagy QR-kód beolvasásával fejezhető be — az itteni mentés el lesz utasítva."
|
"require_tag_scan_hint": "Ez a feladat csak az eszközön lévő NFC-címke vagy QR-kód beolvasásával fejezhető be — az itteni mentés el lesz utasítva."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Modifica",
|
"edit": "Modifica",
|
||||||
"duplicate": "Duplica",
|
"duplicate": "Duplica",
|
||||||
"task_duplicated": "Attività duplicata",
|
"task_duplicated": "Attività duplicata",
|
||||||
|
"task_moved": "Attività spostata",
|
||||||
|
"move_task_target": "Oggetto di destinazione",
|
||||||
|
"move_task_message": "Scegli l'oggetto a cui deve appartenere questa attività. Storico, letture e stato del trigger si spostano con lei; riceve un nuovo numero di riferimento e le sue entità vengono ricreate sotto il nuovo oggetto. I documenti collegati restano con l'oggetto attuale.",
|
||||||
|
"move_task_title": "Sposta attività",
|
||||||
|
"move_task": "Sposta in un altro oggetto…",
|
||||||
"object_duplicated": "Oggetto duplicato",
|
"object_duplicated": "Oggetto duplicato",
|
||||||
"delete": "Elimina",
|
"delete": "Elimina",
|
||||||
"add_task": "+ Attività",
|
"add_task": "+ Attività",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Il fattore deve essere tra 0.1 e 5.0",
|
"seasonal_override_range": "Il fattore deve essere tra 0.1 e 5.0",
|
||||||
"clear_all": "Cancella tutto",
|
"clear_all": "Cancella tutto",
|
||||||
"clear": "Cancella",
|
"clear": "Cancella",
|
||||||
|
"date_type_toggle": "Digita la data",
|
||||||
|
"date_type_invalid": "Data non valida — prova 1978-03-15, un anno come 1978 o il tuo formato di data",
|
||||||
"seasonal_chart_title": "Fattori stagionali",
|
"seasonal_chart_title": "Fattori stagionali",
|
||||||
"seasonal_learned": "Appreso",
|
"seasonal_learned": "Appreso",
|
||||||
"seasonal_manual": "Manuale",
|
"seasonal_manual": "Manuale",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Prova di presenza: «Fatto» è bloccato ovunque finché non viene scansionato il tag NFC o il codice QR sull'oggetto. Le automazioni possono passare 'via_tag_scan' al servizio complete.",
|
"require_tag_scan_help": "Prova di presenza: «Fatto» è bloccato ovunque finché non viene scansionato il tag NFC o il codice QR sull'oggetto. Le automazioni possono passare 'via_tag_scan' al servizio complete.",
|
||||||
"disallow_skip": "Non consentire di saltare",
|
"disallow_skip": "Non consentire di saltare",
|
||||||
"disallow_skip_help": "L'azione Salta scompare da tutte le superfici e il server rifiuta anche i salti da automazioni e voce.",
|
"disallow_skip_help": "L'azione Salta scompare da tutte le superfici e il server rifiuta anche i salti da automazioni e voce.",
|
||||||
|
"no_notifications": "Nessuna notifica per questa attività",
|
||||||
|
"no_notifications_help": "Nessun promemoria per questa attività — niente notifiche di stato, ripetizioni, promemoria anticipati o raggruppamenti. Resta visibile nella dashboard e nelle sue entità; il riepilogo settimanale la conta ancora.",
|
||||||
"require_tag_scan_hint": "Questa attività si completa solo scansionando il suo tag NFC o codice QR sull'oggetto — il salvataggio qui verrà rifiutato."
|
"require_tag_scan_hint": "Questa attività si completa solo scansionando il suo tag NFC o codice QR sull'oggetto — il salvataggio qui verrà rifiutato."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "編集",
|
"edit": "編集",
|
||||||
"duplicate": "複製",
|
"duplicate": "複製",
|
||||||
"task_duplicated": "タスクを複製しました",
|
"task_duplicated": "タスクを複製しました",
|
||||||
|
"task_moved": "タスクを移動しました",
|
||||||
|
"move_task_target": "移動先オブジェクト",
|
||||||
|
"move_task_message": "このタスクを所属させるオブジェクトを選んでください。履歴・検針値・トリガー状態は一緒に移動し、新しい参照番号が付き、エンティティは新しいオブジェクトの下で作り直されます。関連付けた文書は現在のオブジェクトに残ります。",
|
||||||
|
"move_task_title": "タスクを移動",
|
||||||
|
"move_task": "別のオブジェクトへ移動…",
|
||||||
"object_duplicated": "オブジェクトを複製しました",
|
"object_duplicated": "オブジェクトを複製しました",
|
||||||
"delete": "削除",
|
"delete": "削除",
|
||||||
"add_task": "+ タスク追加",
|
"add_task": "+ タスク追加",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "係数は0.1〜5.0の範囲で指定してください",
|
"seasonal_override_range": "係数は0.1〜5.0の範囲で指定してください",
|
||||||
"clear_all": "すべてクリア",
|
"clear_all": "すべてクリア",
|
||||||
"clear": "クリア",
|
"clear": "クリア",
|
||||||
|
"date_type_toggle": "日付を入力",
|
||||||
|
"date_type_invalid": "日付として無効です — 1978-03-15、1978 のような年、または設定中の日付形式で入力してください",
|
||||||
"seasonal_chart_title": "季節係数",
|
"seasonal_chart_title": "季節係数",
|
||||||
"seasonal_learned": "学習値",
|
"seasonal_learned": "学習値",
|
||||||
"seasonal_manual": "手動",
|
"seasonal_manual": "手動",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "在席証明:対象物のNFCタグまたはQRコードをスキャンするまで、どの画面でも「完了」はブロックされます。オートメーションはcompleteサービスに 'via_tag_scan' を渡せます。",
|
"require_tag_scan_help": "在席証明:対象物のNFCタグまたはQRコードをスキャンするまで、どの画面でも「完了」はブロックされます。オートメーションはcompleteサービスに 'via_tag_scan' を渡せます。",
|
||||||
"disallow_skip": "スキップを許可しない",
|
"disallow_skip": "スキップを許可しない",
|
||||||
"disallow_skip_help": "スキップ操作はすべての画面から消え、オートメーションや音声からのスキップもサーバーが拒否します。",
|
"disallow_skip_help": "スキップ操作はすべての画面から消え、オートメーションや音声からのスキップもサーバーが拒否します。",
|
||||||
|
"no_notifications": "このタスクは通知しない",
|
||||||
|
"no_notifications_help": "このタスクのリマインダーを止めます。ステータス通知・繰り返し・事前リマインダー・まとめ通知は送られません。ダッシュボードやエンティティには引き続き表示され、週次ダイジェストにも数えられます。",
|
||||||
"require_tag_scan_hint": "このタスクは対象物のNFCタグまたはQRコードをスキャンしないと完了できません。ここでの保存は拒否されます。"
|
"require_tag_scan_hint": "このタスクは対象物のNFCタグまたはQRコードをスキャンしないと完了できません。ここでの保存は拒否されます。"
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "편집",
|
"edit": "편집",
|
||||||
"duplicate": "복제",
|
"duplicate": "복제",
|
||||||
"task_duplicated": "작업이 복제되었습니다",
|
"task_duplicated": "작업이 복제되었습니다",
|
||||||
|
"task_moved": "작업을 이동했습니다",
|
||||||
|
"move_task_target": "대상 개체",
|
||||||
|
"move_task_message": "이 작업이 속할 개체를 선택하세요. 이력, 검침값, 트리거 상태가 함께 이동하며 새 참조 번호를 받고 엔티티는 새 개체 아래에 다시 생성됩니다. 연결된 문서는 현재 개체에 남습니다.",
|
||||||
|
"move_task_title": "작업 이동",
|
||||||
|
"move_task": "다른 개체로 이동…",
|
||||||
"object_duplicated": "객체가 복제되었습니다",
|
"object_duplicated": "객체가 복제되었습니다",
|
||||||
"delete": "삭제",
|
"delete": "삭제",
|
||||||
"add_task": "+ 작업 추가",
|
"add_task": "+ 작업 추가",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "계수는 0.1에서 5.0 사이여야 합니다",
|
"seasonal_override_range": "계수는 0.1에서 5.0 사이여야 합니다",
|
||||||
"clear_all": "모두 지우기",
|
"clear_all": "모두 지우기",
|
||||||
"clear": "지우기",
|
"clear": "지우기",
|
||||||
|
"date_type_toggle": "날짜 직접 입력",
|
||||||
|
"date_type_invalid": "올바른 날짜가 아닙니다 — 1978-03-15, 1978 같은 연도 또는 사용 중인 날짜 형식으로 입력하세요",
|
||||||
"seasonal_chart_title": "계절 계수",
|
"seasonal_chart_title": "계절 계수",
|
||||||
"seasonal_learned": "학습됨",
|
"seasonal_learned": "학습됨",
|
||||||
"seasonal_manual": "수동",
|
"seasonal_manual": "수동",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "현장 확인: 기기의 NFC 태그나 QR 코드를 스캔할 때까지 모든 화면에서 '완료'가 차단됩니다. 자동화는 complete 서비스에 'via_tag_scan'을 전달할 수 있습니다.",
|
"require_tag_scan_help": "현장 확인: 기기의 NFC 태그나 QR 코드를 스캔할 때까지 모든 화면에서 '완료'가 차단됩니다. 자동화는 complete 서비스에 'via_tag_scan'을 전달할 수 있습니다.",
|
||||||
"disallow_skip": "건너뛰기 허용 안 함",
|
"disallow_skip": "건너뛰기 허용 안 함",
|
||||||
"disallow_skip_help": "건너뛰기 동작이 모든 화면에서 사라지며, 서버는 자동화와 음성의 건너뛰기도 거부합니다.",
|
"disallow_skip_help": "건너뛰기 동작이 모든 화면에서 사라지며, 서버는 자동화와 음성의 건너뛰기도 거부합니다.",
|
||||||
|
"no_notifications": "이 작업은 알림 없음",
|
||||||
|
"no_notifications_help": "이 작업에는 리마인더가 없습니다. 상태 알림, 반복, 사전 알림, 묶음 알림이 모두 꺼집니다. 대시보드와 엔티티에는 계속 표시되며 주간 요약에는 계속 포함됩니다.",
|
||||||
"require_tag_scan_hint": "이 작업은 기기의 NFC 태그나 QR 코드를 스캔해야만 완료됩니다. 여기서 저장하면 거부됩니다."
|
"require_tag_scan_hint": "이 작업은 기기의 NFC 태그나 QR 코드를 스캔해야만 완료됩니다. 여기서 저장하면 거부됩니다."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Rediger",
|
"edit": "Rediger",
|
||||||
"duplicate": "Dupliser",
|
"duplicate": "Dupliser",
|
||||||
"task_duplicated": "Oppgave duplisert",
|
"task_duplicated": "Oppgave duplisert",
|
||||||
|
"task_moved": "Oppgave flyttet",
|
||||||
|
"move_task_target": "Målobjekt",
|
||||||
|
"move_task_message": "Velg objektet denne oppgaven skal tilhøre. Historikk, avlesninger og utløserstatus følger med; den får et nytt referansenummer, og entitetene opprettes på nytt under det nye objektet. Tilknyttede dokumenter blir hos det nåværende objektet.",
|
||||||
|
"move_task_title": "Flytt oppgave",
|
||||||
|
"move_task": "Flytt til et annet objekt…",
|
||||||
"object_duplicated": "Objekt duplisert",
|
"object_duplicated": "Objekt duplisert",
|
||||||
"delete": "Slett",
|
"delete": "Slett",
|
||||||
"add_task": "+ Legg til oppgave",
|
"add_task": "+ Legg til oppgave",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Faktor må være mellom 0,1 og 5,0",
|
"seasonal_override_range": "Faktor må være mellom 0,1 og 5,0",
|
||||||
"clear_all": "Fjern alle",
|
"clear_all": "Fjern alle",
|
||||||
"clear": "Tøm",
|
"clear": "Tøm",
|
||||||
|
"date_type_toggle": "Skriv inn datoen",
|
||||||
|
"date_type_invalid": "Ugyldig dato — prøv 1978-03-15, et år som 1978 eller ditt eget datoformat",
|
||||||
"seasonal_chart_title": "Sesongfaktorer",
|
"seasonal_chart_title": "Sesongfaktorer",
|
||||||
"seasonal_learned": "Lært",
|
"seasonal_learned": "Lært",
|
||||||
"seasonal_manual": "Manuell",
|
"seasonal_manual": "Manuell",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Tilstedeværelsesbevis: «Fullført» er blokkert overalt til NFC-taggen eller QR-koden på selve tingen er skannet. Automatiseringer kan sende 'via_tag_scan' til complete-tjenesten.",
|
"require_tag_scan_help": "Tilstedeværelsesbevis: «Fullført» er blokkert overalt til NFC-taggen eller QR-koden på selve tingen er skannet. Automatiseringer kan sende 'via_tag_scan' til complete-tjenesten.",
|
||||||
"disallow_skip": "Ikke tillat å hoppe over",
|
"disallow_skip": "Ikke tillat å hoppe over",
|
||||||
"disallow_skip_help": "Handlingen Hopp over forsvinner fra alle flater, og serveren avviser også hopp fra automatiseringer og tale.",
|
"disallow_skip_help": "Handlingen Hopp over forsvinner fra alle flater, og serveren avviser også hopp fra automatiseringer og tale.",
|
||||||
|
"no_notifications": "Ingen varsler for denne oppgaven",
|
||||||
|
"no_notifications_help": "Ingen påminnelser for denne oppgaven — ingen statusvarsler, gjentakelser, forhåndspåminnelser eller bunter. Den vises fortsatt på dashbordet og i entitetene sine; ukesoppsummeringen teller den fortsatt med.",
|
||||||
"require_tag_scan_hint": "Denne oppgaven fullføres bare ved å skanne NFC-taggen eller QR-koden på selve tingen — lagring her vil bli avvist."
|
"require_tag_scan_hint": "Denne oppgaven fullføres bare ved å skanne NFC-taggen eller QR-koden på selve tingen — lagring her vil bli avvist."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Bewerken",
|
"edit": "Bewerken",
|
||||||
"duplicate": "Dupliceren",
|
"duplicate": "Dupliceren",
|
||||||
"task_duplicated": "Taak gedupliceerd",
|
"task_duplicated": "Taak gedupliceerd",
|
||||||
|
"task_moved": "Taak verplaatst",
|
||||||
|
"move_task_target": "Doelobject",
|
||||||
|
"move_task_message": "Kies het object waar deze taak bij hoort. Geschiedenis, meterstanden en triggerstatus verhuizen mee; de taak krijgt een nieuw referentienummer en haar entiteiten worden onder het nieuwe object opnieuw aangemaakt. Gekoppelde documenten blijven bij het huidige object.",
|
||||||
|
"move_task_title": "Taak verplaatsen",
|
||||||
|
"move_task": "Naar ander object verplaatsen…",
|
||||||
"object_duplicated": "Object gedupliceerd",
|
"object_duplicated": "Object gedupliceerd",
|
||||||
"delete": "Verwijderen",
|
"delete": "Verwijderen",
|
||||||
"add_task": "+ Taak",
|
"add_task": "+ Taak",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Factor moet tussen 0.1 en 5.0 liggen",
|
"seasonal_override_range": "Factor moet tussen 0.1 en 5.0 liggen",
|
||||||
"clear_all": "Alles wissen",
|
"clear_all": "Alles wissen",
|
||||||
"clear": "Wissen",
|
"clear": "Wissen",
|
||||||
|
"date_type_toggle": "Datum typen",
|
||||||
|
"date_type_invalid": "Geen geldige datum — probeer 1978-03-15, een jaar zoals 1978 of je eigen datumnotatie",
|
||||||
"seasonal_chart_title": "Seizoensfactoren",
|
"seasonal_chart_title": "Seizoensfactoren",
|
||||||
"seasonal_learned": "Geleerd",
|
"seasonal_learned": "Geleerd",
|
||||||
"seasonal_manual": "Handmatig",
|
"seasonal_manual": "Handmatig",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Aanwezigheidsbewijs: „Klaar” is overal geblokkeerd totdat de NFC-tag of QR-code op het apparaat zelf is gescand. Automatiseringen kunnen 'via_tag_scan' aan de complete-service meegeven.",
|
"require_tag_scan_help": "Aanwezigheidsbewijs: „Klaar” is overal geblokkeerd totdat de NFC-tag of QR-code op het apparaat zelf is gescand. Automatiseringen kunnen 'via_tag_scan' aan de complete-service meegeven.",
|
||||||
"disallow_skip": "Overslaan niet toestaan",
|
"disallow_skip": "Overslaan niet toestaan",
|
||||||
"disallow_skip_help": "De actie Overslaan verdwijnt overal, en de server weigert ook een skip via automatiseringen en spraak.",
|
"disallow_skip_help": "De actie Overslaan verdwijnt overal, en de server weigert ook een skip via automatiseringen en spraak.",
|
||||||
|
"no_notifications": "Geen notificaties voor deze taak",
|
||||||
|
"no_notifications_help": "Geen herinneringen voor deze taak — geen statusnotificaties, herhalingen, vooraankondigingen of bundels. Ze blijft zichtbaar op het dashboard en in haar entiteiten; het weekoverzicht telt haar nog mee.",
|
||||||
"require_tag_scan_hint": "Deze taak wordt alleen afgerond door de NFC-tag of QR-code op het apparaat te scannen — opslaan hier wordt geweigerd."
|
"require_tag_scan_hint": "Deze taak wordt alleen afgerond door de NFC-tag of QR-code op het apparaat te scannen — opslaan hier wordt geweigerd."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Edytuj",
|
"edit": "Edytuj",
|
||||||
"duplicate": "Duplikuj",
|
"duplicate": "Duplikuj",
|
||||||
"task_duplicated": "Zadanie zduplikowane",
|
"task_duplicated": "Zadanie zduplikowane",
|
||||||
|
"task_moved": "Zadanie przeniesione",
|
||||||
|
"move_task_target": "Obiekt docelowy",
|
||||||
|
"move_task_message": "Wybierz obiekt, do którego ma należeć to zadanie. Historia, odczyty i stan wyzwalacza przenoszą się razem z nim; dostaje nowy numer referencyjny, a jego encje są tworzone na nowo pod nowym obiektem. Powiązane dokumenty zostają przy obecnym obiekcie.",
|
||||||
|
"move_task_title": "Przenieś zadanie",
|
||||||
|
"move_task": "Przenieś do innego obiektu…",
|
||||||
"object_duplicated": "Obiekt zduplikowany",
|
"object_duplicated": "Obiekt zduplikowany",
|
||||||
"delete": "Usuń",
|
"delete": "Usuń",
|
||||||
"add_task": "+ Dodaj zadanie",
|
"add_task": "+ Dodaj zadanie",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Czynnik musi być między 0.1 a 5.0",
|
"seasonal_override_range": "Czynnik musi być między 0.1 a 5.0",
|
||||||
"clear_all": "Wyczyść wszystko",
|
"clear_all": "Wyczyść wszystko",
|
||||||
"clear": "Wyczyść",
|
"clear": "Wyczyść",
|
||||||
|
"date_type_toggle": "Wpisz datę",
|
||||||
|
"date_type_invalid": "Nieprawidłowa data — wpisz 1978-03-15, rok jak 1978 albo swój format daty",
|
||||||
"seasonal_chart_title": "Czynniki sezonowe",
|
"seasonal_chart_title": "Czynniki sezonowe",
|
||||||
"seasonal_learned": "Wyuczone",
|
"seasonal_learned": "Wyuczone",
|
||||||
"seasonal_manual": "Ręczne",
|
"seasonal_manual": "Ręczne",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Dowód obecności: „Gotowe” jest wszędzie zablokowane, dopóki nie zeskanujesz tagu NFC lub kodu QR na urządzeniu. Automatyzacje mogą przekazać 'via_tag_scan' do usługi complete.",
|
"require_tag_scan_help": "Dowód obecności: „Gotowe” jest wszędzie zablokowane, dopóki nie zeskanujesz tagu NFC lub kodu QR na urządzeniu. Automatyzacje mogą przekazać 'via_tag_scan' do usługi complete.",
|
||||||
"disallow_skip": "Nie zezwalaj na pomijanie",
|
"disallow_skip": "Nie zezwalaj na pomijanie",
|
||||||
"disallow_skip_help": "Akcja Pomiń znika ze wszystkich widoków, a serwer odrzuca pominięcie także z automatyzacji i głosu.",
|
"disallow_skip_help": "Akcja Pomiń znika ze wszystkich widoków, a serwer odrzuca pominięcie także z automatyzacji i głosu.",
|
||||||
|
"no_notifications": "Bez powiadomień dla tego zadania",
|
||||||
|
"no_notifications_help": "Bez przypomnień dla tego zadania — bez powiadomień o statusie, powtórzeń, wcześniejszych przypomnień i pakietów. Nadal widać je na pulpicie i w jego encjach; tygodniowe podsumowanie wciąż je liczy.",
|
||||||
"require_tag_scan_hint": "To zadanie można ukończyć tylko skanując jego tag NFC lub kod QR na urządzeniu — zapis tutaj zostanie odrzucony."
|
"require_tag_scan_hint": "To zadanie można ukończyć tylko skanując jego tag NFC lub kod QR na urządzeniu — zapis tutaj zostanie odrzucony."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"duplicate": "Duplicar",
|
"duplicate": "Duplicar",
|
||||||
"task_duplicated": "Tarefa duplicada",
|
"task_duplicated": "Tarefa duplicada",
|
||||||
|
"task_moved": "Tarefa movida",
|
||||||
|
"move_task_target": "Objeto de destino",
|
||||||
|
"move_task_message": "Escolha o objeto ao qual esta tarefa deve pertencer. Histórico, leituras e estado do gatilho vão junto; ela recebe um novo número de referência e suas entidades são recriadas no novo objeto. Documentos vinculados permanecem no objeto atual.",
|
||||||
|
"move_task_title": "Mover tarefa",
|
||||||
|
"move_task": "Mover para outro objeto…",
|
||||||
"object_duplicated": "Objeto duplicado",
|
"object_duplicated": "Objeto duplicado",
|
||||||
"delete": "Excluir",
|
"delete": "Excluir",
|
||||||
"add_task": "+ Adicionar tarefa",
|
"add_task": "+ Adicionar tarefa",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "O fator deve estar entre 0,1 e 5,0",
|
"seasonal_override_range": "O fator deve estar entre 0,1 e 5,0",
|
||||||
"clear_all": "Limpar tudo",
|
"clear_all": "Limpar tudo",
|
||||||
"clear": "Limpar",
|
"clear": "Limpar",
|
||||||
|
"date_type_toggle": "Digitar a data",
|
||||||
|
"date_type_invalid": "Data inválida — tente 1978-03-15, um ano como 1978 ou seu formato de data",
|
||||||
"seasonal_chart_title": "Fatores sazonais",
|
"seasonal_chart_title": "Fatores sazonais",
|
||||||
"seasonal_learned": "Aprendido",
|
"seasonal_learned": "Aprendido",
|
||||||
"seasonal_manual": "Manual",
|
"seasonal_manual": "Manual",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Prova de presença: “Concluído” fica bloqueado em toda parte até escanear a etiqueta NFC ou o código QR no próprio objeto. Automações podem passar 'via_tag_scan' ao serviço complete.",
|
"require_tag_scan_help": "Prova de presença: “Concluído” fica bloqueado em toda parte até escanear a etiqueta NFC ou o código QR no próprio objeto. Automações podem passar 'via_tag_scan' ao serviço complete.",
|
||||||
"disallow_skip": "Não permitir pular",
|
"disallow_skip": "Não permitir pular",
|
||||||
"disallow_skip_help": "A ação Pular desaparece de todas as telas e o servidor também recusa pular via automações e voz.",
|
"disallow_skip_help": "A ação Pular desaparece de todas as telas e o servidor também recusa pular via automações e voz.",
|
||||||
|
"no_notifications": "Sem notificações para esta tarefa",
|
||||||
|
"no_notifications_help": "Sem lembretes para esta tarefa — sem notificações de status, repetições, avisos antecipados ou agrupamentos. Ela continua aparecendo no painel e em suas entidades; o resumo semanal ainda a conta.",
|
||||||
"require_tag_scan_hint": "Esta tarefa só é concluída escaneando sua etiqueta NFC ou código QR no próprio objeto — salvar aqui será recusado."
|
"require_tag_scan_hint": "Esta tarefa só é concluída escaneando sua etiqueta NFC ou código QR no próprio objeto — salvar aqui será recusado."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"duplicate": "Duplicar",
|
"duplicate": "Duplicar",
|
||||||
"task_duplicated": "Tarefa duplicada",
|
"task_duplicated": "Tarefa duplicada",
|
||||||
|
"task_moved": "Tarefa movida",
|
||||||
|
"move_task_target": "Objeto de destino",
|
||||||
|
"move_task_message": "Escolha o objeto a que esta tarefa deve pertencer. O histórico, as leituras e o estado do gatilho vão com ela; recebe um novo número de referência e as suas entidades são recriadas no novo objeto. Os documentos ligados ficam no objeto atual.",
|
||||||
|
"move_task_title": "Mover tarefa",
|
||||||
|
"move_task": "Mover para outro objeto…",
|
||||||
"object_duplicated": "Objeto duplicado",
|
"object_duplicated": "Objeto duplicado",
|
||||||
"delete": "Eliminar",
|
"delete": "Eliminar",
|
||||||
"add_task": "+ Tarefa",
|
"add_task": "+ Tarefa",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "O fator deve estar entre 0.1 e 5.0",
|
"seasonal_override_range": "O fator deve estar entre 0.1 e 5.0",
|
||||||
"clear_all": "Limpar tudo",
|
"clear_all": "Limpar tudo",
|
||||||
"clear": "Limpar",
|
"clear": "Limpar",
|
||||||
|
"date_type_toggle": "Escrever a data",
|
||||||
|
"date_type_invalid": "Data inválida — tente 1978-03-15, um ano como 1978 ou o seu formato de data",
|
||||||
"seasonal_chart_title": "Fatores sazonais",
|
"seasonal_chart_title": "Fatores sazonais",
|
||||||
"seasonal_learned": "Aprendido",
|
"seasonal_learned": "Aprendido",
|
||||||
"seasonal_manual": "Manual",
|
"seasonal_manual": "Manual",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Prova de presença: «Concluído» fica bloqueado em todo o lado até ler a etiqueta NFC ou o código QR no próprio objeto. As automações podem passar 'via_tag_scan' ao serviço complete.",
|
"require_tag_scan_help": "Prova de presença: «Concluído» fica bloqueado em todo o lado até ler a etiqueta NFC ou o código QR no próprio objeto. As automações podem passar 'via_tag_scan' ao serviço complete.",
|
||||||
"disallow_skip": "Não permitir ignorar",
|
"disallow_skip": "Não permitir ignorar",
|
||||||
"disallow_skip_help": "A ação Ignorar desaparece de todas as superfícies e o servidor também recusa ignorar via automações e voz.",
|
"disallow_skip_help": "A ação Ignorar desaparece de todas as superfícies e o servidor também recusa ignorar via automações e voz.",
|
||||||
|
"no_notifications": "Sem notificações para esta tarefa",
|
||||||
|
"no_notifications_help": "Sem lembretes para esta tarefa — sem notificações de estado, repetições, avisos antecipados ou agrupamentos. Continua a aparecer no painel e nas suas entidades; o resumo semanal continua a contá-la.",
|
||||||
"require_tag_scan_hint": "Esta tarefa só é concluída lendo a sua etiqueta NFC ou código QR no próprio objeto — guardar aqui será recusado."
|
"require_tag_scan_hint": "Esta tarefa só é concluída lendo a sua etiqueta NFC ou código QR no próprio objeto — guardar aqui será recusado."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Изменить",
|
"edit": "Изменить",
|
||||||
"duplicate": "Дублировать",
|
"duplicate": "Дублировать",
|
||||||
"task_duplicated": "Задача продублирована",
|
"task_duplicated": "Задача продублирована",
|
||||||
|
"task_moved": "Задача перемещена",
|
||||||
|
"move_task_target": "Целевой объект",
|
||||||
|
"move_task_message": "Выберите объект, к которому должна относиться эта задача. История, показания и состояние триггера переедут вместе с ней; она получит новый номер, а её сущности будут созданы заново под новым объектом. Привязанные документы остаются у текущего объекта.",
|
||||||
|
"move_task_title": "Переместить задачу",
|
||||||
|
"move_task": "Переместить в другой объект…",
|
||||||
"object_duplicated": "Объект продублирован",
|
"object_duplicated": "Объект продублирован",
|
||||||
"delete": "Удалить",
|
"delete": "Удалить",
|
||||||
"add_task": "+ Добавить задачу",
|
"add_task": "+ Добавить задачу",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Коэффициент должен быть от 0.1 до 5.0",
|
"seasonal_override_range": "Коэффициент должен быть от 0.1 до 5.0",
|
||||||
"clear_all": "Очистить все",
|
"clear_all": "Очистить все",
|
||||||
"clear": "Очистить",
|
"clear": "Очистить",
|
||||||
|
"date_type_toggle": "Ввести дату",
|
||||||
|
"date_type_invalid": "Некорректная дата — попробуйте 1978-03-15, год вроде 1978 или ваш формат даты",
|
||||||
"seasonal_chart_title": "Сезонные факторы",
|
"seasonal_chart_title": "Сезонные факторы",
|
||||||
"seasonal_learned": "Изученные",
|
"seasonal_learned": "Изученные",
|
||||||
"seasonal_manual": "Ручные",
|
"seasonal_manual": "Ручные",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Подтверждение присутствия: «Готово» заблокировано везде, пока не отсканирована NFC-метка или QR-код на самом устройстве. Автоматизации могут передавать 'via_tag_scan' в службу complete.",
|
"require_tag_scan_help": "Подтверждение присутствия: «Готово» заблокировано везде, пока не отсканирована NFC-метка или QR-код на самом устройстве. Автоматизации могут передавать 'via_tag_scan' в службу complete.",
|
||||||
"disallow_skip": "Запретить пропуск",
|
"disallow_skip": "Запретить пропуск",
|
||||||
"disallow_skip_help": "Действие «Пропустить» исчезает со всех экранов, а сервер отклоняет пропуск из автоматизаций и голосовых команд.",
|
"disallow_skip_help": "Действие «Пропустить» исчезает со всех экранов, а сервер отклоняет пропуск из автоматизаций и голосовых команд.",
|
||||||
|
"no_notifications": "Без уведомлений для этой задачи",
|
||||||
|
"no_notifications_help": "Без напоминаний для этой задачи — ни уведомлений о статусе, ни повторов, ни заблаговременных напоминаний, ни объединённых сообщений. Она по-прежнему видна на панели и в своих сущностях; еженедельная сводка её учитывает.",
|
||||||
"require_tag_scan_hint": "Эта задача завершается только сканированием её NFC-метки или QR-кода на самом устройстве — сохранение здесь будет отклонено."
|
"require_tag_scan_hint": "Эта задача завершается только сканированием её NFC-метки или QR-кода на самом устройстве — сохранение здесь будет отклонено."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Redigera",
|
"edit": "Redigera",
|
||||||
"duplicate": "Duplicera",
|
"duplicate": "Duplicera",
|
||||||
"task_duplicated": "Uppgift duplicerad",
|
"task_duplicated": "Uppgift duplicerad",
|
||||||
|
"task_moved": "Uppgift flyttad",
|
||||||
|
"move_task_target": "Målobjekt",
|
||||||
|
"move_task_message": "Välj vilket objekt uppgiften ska tillhöra. Historik, avläsningar och utlösarstatus följer med; den får ett nytt referensnummer och dess entiteter skapas om under det nya objektet. Länkade dokument stannar hos det nuvarande objektet.",
|
||||||
|
"move_task_title": "Flytta uppgift",
|
||||||
|
"move_task": "Flytta till ett annat objekt…",
|
||||||
"object_duplicated": "Objekt duplicerat",
|
"object_duplicated": "Objekt duplicerat",
|
||||||
"delete": "Ta bort",
|
"delete": "Ta bort",
|
||||||
"add_task": "+ Lägg till uppgift",
|
"add_task": "+ Lägg till uppgift",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Faktor måste vara mellan 0.1 och 5.0",
|
"seasonal_override_range": "Faktor måste vara mellan 0.1 och 5.0",
|
||||||
"clear_all": "Rensa alla",
|
"clear_all": "Rensa alla",
|
||||||
"clear": "Rensa",
|
"clear": "Rensa",
|
||||||
|
"date_type_toggle": "Skriv datumet",
|
||||||
|
"date_type_invalid": "Ogiltigt datum — prova 1978-03-15, ett år som 1978 eller ditt eget datumformat",
|
||||||
"seasonal_chart_title": "Säsongsfaktorer",
|
"seasonal_chart_title": "Säsongsfaktorer",
|
||||||
"seasonal_learned": "Lärt",
|
"seasonal_learned": "Lärt",
|
||||||
"seasonal_manual": "Manuell",
|
"seasonal_manual": "Manuell",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Närvarobevis: ”Klar” är blockerad överallt tills NFC-taggen eller QR-koden på själva saken har skannats. Automationer kan skicka 'via_tag_scan' till complete-tjänsten.",
|
"require_tag_scan_help": "Närvarobevis: ”Klar” är blockerad överallt tills NFC-taggen eller QR-koden på själva saken har skannats. Automationer kan skicka 'via_tag_scan' till complete-tjänsten.",
|
||||||
"disallow_skip": "Tillåt inte att hoppa över",
|
"disallow_skip": "Tillåt inte att hoppa över",
|
||||||
"disallow_skip_help": "Åtgärden Hoppa över försvinner från alla ytor och servern nekar även hopp från automationer och röst.",
|
"disallow_skip_help": "Åtgärden Hoppa över försvinner från alla ytor och servern nekar även hopp från automationer och röst.",
|
||||||
|
"no_notifications": "Inga aviseringar för den här uppgiften",
|
||||||
|
"no_notifications_help": "Inga påminnelser för den här uppgiften — inga statusaviseringar, upprepningar, förhandspåminnelser eller buntar. Den syns fortfarande på instrumentpanelen och i sina entiteter; veckosammanfattningen räknar den fortfarande.",
|
||||||
"require_tag_scan_hint": "Den här uppgiften slutförs endast genom att skanna dess NFC-tagg eller QR-kod på själva saken — att spara här kommer att nekas."
|
"require_tag_scan_hint": "Den här uppgiften slutförs endast genom att skanna dess NFC-tagg eller QR-kod på själva saken — att spara här kommer att nekas."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "Düzenle",
|
"edit": "Düzenle",
|
||||||
"duplicate": "Çoğalt",
|
"duplicate": "Çoğalt",
|
||||||
"task_duplicated": "Görev çoğaltıldı",
|
"task_duplicated": "Görev çoğaltıldı",
|
||||||
|
"task_moved": "Görev taşındı",
|
||||||
|
"move_task_target": "Hedef nesne",
|
||||||
|
"move_task_message": "Bu görevin ait olacağı nesneyi seçin. Geçmiş, okumalar ve tetikleyici durumu birlikte taşınır; yeni bir referans numarası alır ve varlıkları yeni nesne altında yeniden oluşturulur. Bağlı belgeler mevcut nesnede kalır.",
|
||||||
|
"move_task_title": "Görevi taşı",
|
||||||
|
"move_task": "Başka bir nesneye taşı…",
|
||||||
"object_duplicated": "Nesne çoğaltıldı",
|
"object_duplicated": "Nesne çoğaltıldı",
|
||||||
"delete": "Sil",
|
"delete": "Sil",
|
||||||
"add_task": "+ Görev Ekle",
|
"add_task": "+ Görev Ekle",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "Faktör 0.1 ile 5.0 arasında olmalıdır",
|
"seasonal_override_range": "Faktör 0.1 ile 5.0 arasında olmalıdır",
|
||||||
"clear_all": "Tümünü temizle",
|
"clear_all": "Tümünü temizle",
|
||||||
"clear": "Temizle",
|
"clear": "Temizle",
|
||||||
|
"date_type_toggle": "Tarihi yazın",
|
||||||
|
"date_type_invalid": "Geçersiz tarih — 1978-03-15, 1978 gibi bir yıl ya da kendi tarih biçiminizi deneyin",
|
||||||
"seasonal_chart_title": "Mevsimsel Faktörler",
|
"seasonal_chart_title": "Mevsimsel Faktörler",
|
||||||
"seasonal_learned": "Öğrenilmiş",
|
"seasonal_learned": "Öğrenilmiş",
|
||||||
"seasonal_manual": "Manuel",
|
"seasonal_manual": "Manuel",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Yerinde olma kanıtı: Cihazın üzerindeki NFC etiketi veya QR kodu taranana kadar 'Tamamlandı' her yerde engellenir. Otomasyonlar complete servisine 'via_tag_scan' iletebilir.",
|
"require_tag_scan_help": "Yerinde olma kanıtı: Cihazın üzerindeki NFC etiketi veya QR kodu taranana kadar 'Tamamlandı' her yerde engellenir. Otomasyonlar complete servisine 'via_tag_scan' iletebilir.",
|
||||||
"disallow_skip": "Atlamaya izin verme",
|
"disallow_skip": "Atlamaya izin verme",
|
||||||
"disallow_skip_help": "Atla eylemi tüm yüzeylerden kaybolur; sunucu otomasyonlardan ve sesten gelen atlamayı da reddeder.",
|
"disallow_skip_help": "Atla eylemi tüm yüzeylerden kaybolur; sunucu otomasyonlardan ve sesten gelen atlamayı da reddeder.",
|
||||||
|
"no_notifications": "Bu görev için bildirim yok",
|
||||||
|
"no_notifications_help": "Bu görev için hatırlatma yok — durum bildirimi, tekrar, önceden hatırlatma veya toplu bildirim gönderilmez. Panoda ve varlıklarında görünmeye devam eder; haftalık özet onu saymaya devam eder.",
|
||||||
"require_tag_scan_hint": "Bu görev yalnızca cihazın üzerindeki NFC etiketi veya QR kodu taranarak tamamlanır — buradan kaydetme reddedilecektir."
|
"require_tag_scan_hint": "Bu görev yalnızca cihazın üzerindeki NFC etiketi veya QR kodu taranarak tamamlanır — buradan kaydetme reddedilecektir."
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,11 @@
|
|||||||
"edit": "Редагувати",
|
"edit": "Редагувати",
|
||||||
"duplicate": "Дублювати",
|
"duplicate": "Дублювати",
|
||||||
"task_duplicated": "Завдання продубльовано",
|
"task_duplicated": "Завдання продубльовано",
|
||||||
|
"task_moved": "Завдання переміщено",
|
||||||
|
"move_task_target": "Цільовий об'єкт",
|
||||||
|
"move_task_message": "Виберіть об'єкт, до якого має належати це завдання. Історія, показники та стан тригера переїдуть разом із ним; воно отримає новий номер, а його сутності буде створено заново під новим об'єктом. Прив'язані документи залишаться в поточному об'єкті.",
|
||||||
|
"move_task_title": "Перемістити завдання",
|
||||||
|
"move_task": "Перемістити до іншого об'єкта…",
|
||||||
"object_duplicated": "Об'єкт продубльовано",
|
"object_duplicated": "Об'єкт продубльовано",
|
||||||
"delete": "Видалити",
|
"delete": "Видалити",
|
||||||
"add_task": "+ Додати завдання",
|
"add_task": "+ Додати завдання",
|
||||||
@@ -289,6 +294,8 @@
|
|||||||
"seasonal_override_range": "Коефіцієнт має бути між 0.1 та 5.0",
|
"seasonal_override_range": "Коефіцієнт має бути між 0.1 та 5.0",
|
||||||
"clear_all": "Очистити все",
|
"clear_all": "Очистити все",
|
||||||
"clear": "Очистити",
|
"clear": "Очистити",
|
||||||
|
"date_type_toggle": "Ввести дату",
|
||||||
|
"date_type_invalid": "Некоректна дата — спробуйте 1978-03-15, рік на кшталт 1978 або ваш формат дати",
|
||||||
"seasonal_chart_title": "Сезонні коефіцієнти",
|
"seasonal_chart_title": "Сезонні коефіцієнти",
|
||||||
"seasonal_learned": "Навчена",
|
"seasonal_learned": "Навчена",
|
||||||
"seasonal_manual": "Ручна",
|
"seasonal_manual": "Ручна",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "Підтвердження присутності: «Готово» заблоковано всюди, доки не відскановано NFC-мітку або QR-код на самому пристрої. Автоматизації можуть передати 'via_tag_scan' службі complete.",
|
"require_tag_scan_help": "Підтвердження присутності: «Готово» заблоковано всюди, доки не відскановано NFC-мітку або QR-код на самому пристрої. Автоматизації можуть передати 'via_tag_scan' службі complete.",
|
||||||
"disallow_skip": "Заборонити пропуск",
|
"disallow_skip": "Заборонити пропуск",
|
||||||
"disallow_skip_help": "Дія «Пропустити» зникає з усіх поверхонь, а сервер відхиляє пропуск з автоматизацій і голосу.",
|
"disallow_skip_help": "Дія «Пропустити» зникає з усіх поверхонь, а сервер відхиляє пропуск з автоматизацій і голосу.",
|
||||||
|
"no_notifications": "Без сповіщень для цього завдання",
|
||||||
|
"no_notifications_help": "Без нагадувань для цього завдання — ні сповіщень про статус, ні повторів, ні завчасних нагадувань, ні об'єднаних повідомлень. Воно й далі видиме на панелі та у своїх сутностях; тижневий підсумок його враховує.",
|
||||||
"require_tag_scan_hint": "Це завдання завершується лише скануванням його NFC-мітки або QR-коду на самому пристрої — збереження тут буде відхилено."
|
"require_tag_scan_hint": "Це завдання завершується лише скануванням його NFC-мітки або QR-коду на самому пристрої — збереження тут буде відхилено."
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
"edit": "编辑",
|
"edit": "编辑",
|
||||||
"duplicate": "复制",
|
"duplicate": "复制",
|
||||||
"task_duplicated": "任务已复制",
|
"task_duplicated": "任务已复制",
|
||||||
|
"task_moved": "任务已移动",
|
||||||
|
"move_task_target": "目标对象",
|
||||||
|
"move_task_message": "选择此任务应归属的对象。历史记录、读数和触发器状态会一并迁移;任务将获得新的编号,其实体会在新对象下重新创建。关联的文档仍留在当前对象。",
|
||||||
|
"move_task_title": "移动任务",
|
||||||
|
"move_task": "移动到其他对象…",
|
||||||
"object_duplicated": "对象已复制",
|
"object_duplicated": "对象已复制",
|
||||||
"delete": "删除",
|
"delete": "删除",
|
||||||
"add_task": "+ 添加任务",
|
"add_task": "+ 添加任务",
|
||||||
@@ -291,6 +296,8 @@
|
|||||||
"seasonal_override_range": "系数必须介于 0.1 到 5.0 之间",
|
"seasonal_override_range": "系数必须介于 0.1 到 5.0 之间",
|
||||||
"clear_all": "全部清除",
|
"clear_all": "全部清除",
|
||||||
"clear": "清除",
|
"clear": "清除",
|
||||||
|
"date_type_toggle": "输入日期",
|
||||||
|
"date_type_invalid": "日期无效 — 请试试 1978-03-15、年份如 1978 或你的日期格式",
|
||||||
"seasonal_chart_title": "季节性因素",
|
"seasonal_chart_title": "季节性因素",
|
||||||
"seasonal_learned": "自动学习",
|
"seasonal_learned": "自动学习",
|
||||||
"seasonal_manual": "手动设置",
|
"seasonal_manual": "手动设置",
|
||||||
@@ -995,5 +1002,7 @@
|
|||||||
"require_tag_scan_help": "在场证明:在扫描设备上的 NFC 标签或二维码之前,所有界面的“完成”均被阻止。自动化可向 complete 服务传递 'via_tag_scan'。",
|
"require_tag_scan_help": "在场证明:在扫描设备上的 NFC 标签或二维码之前,所有界面的“完成”均被阻止。自动化可向 complete 服务传递 'via_tag_scan'。",
|
||||||
"disallow_skip": "不允许跳过",
|
"disallow_skip": "不允许跳过",
|
||||||
"disallow_skip_help": "跳过操作将从所有界面消失,服务器也会拒绝来自自动化和语音的跳过。",
|
"disallow_skip_help": "跳过操作将从所有界面消失,服务器也会拒绝来自自动化和语音的跳过。",
|
||||||
|
"no_notifications": "此任务不发送通知",
|
||||||
|
"no_notifications_help": "此任务不再提醒——没有状态通知、重复、提前提醒或合并通知。它仍显示在仪表板和其实体中;每周摘要仍会统计它。",
|
||||||
"require_tag_scan_hint": "此任务只能通过扫描设备上的 NFC 标签或二维码来完成——在此保存将被拒绝。"
|
"require_tag_scan_hint": "此任务只能通过扫描设备上的 NFC 标签或二维码来完成——在此保存将被拒绝。"
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
var Wt=Object.defineProperty;var Kr=Object.getOwnPropertyDescriptor;var w=(s,r,e)=>()=>{if(e)throw e[0];try{return s&&(r=s(s=0)),r}catch(t){throw e=[t],t}};var Yr=(s,r)=>{for(var e in r)Wt(s,e,{get:r[e],enumerable:!0})};var d=(s,r,e,t)=>{for(var i=t>1?void 0:t?Kr(r,e):r,a=s.length-1,o;a>=0;a--)(o=s[a])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Wt(r,e,i),i};var Ge,Qe,ut,Kt,Le,Yt,E,Gt,_t,gt=w(()=>{Ge=globalThis,Qe=Ge.ShadowRoot&&(Ge.ShadyCSS===void 0||Ge.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ut=Symbol(),Kt=new WeakMap,Le=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==ut)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o,e=this.t;if(Qe&&r===void 0){let t=e!==void 0&&e.length===1;t&&(r=Kt.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&Kt.set(e,r))}return r}toString(){return this.cssText}},Yt=s=>new Le(typeof s=="string"?s:s+"",void 0,ut),E=(s,...r)=>{let e=s.length===1?s[0]:r.reduce((t,i,a)=>t+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[a+1],s[0]);return new Le(e,s,ut)},Gt=(s,r)=>{if(Qe)s.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of r){let t=document.createElement("style"),i=Ge.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,s.appendChild(t)}},_t=Qe?s=>s:s=>s instanceof CSSStyleSheet?(r=>{let e="";for(let t of r.cssRules)e+=t.cssText;return Yt(e)})(s):s});var Gr,Qr,Jr,Zr,Xr,es,Je,Qt,ts,is,Re,qe,Ze,Jt,X,Ne=w(()=>{gt();gt();({is:Gr,defineProperty:Qr,getOwnPropertyDescriptor:Jr,getOwnPropertyNames:Zr,getOwnPropertySymbols:Xr,getPrototypeOf:es}=Object),Je=globalThis,Qt=Je.trustedTypes,ts=Qt?Qt.emptyScript:"",is=Je.reactiveElementPolyfillSupport,Re=(s,r)=>s,qe={toAttribute(s,r){switch(r){case Boolean:s=s?ts:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,r){let e=s;switch(r){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},Ze=(s,r)=>!Gr(s,r),Jt={attribute:!0,type:String,converter:qe,reflect:!1,useDefault:!1,hasChanged:Ze};Symbol.metadata??=Symbol("metadata"),Je.litPropertyMetadata??=new WeakMap;X=class extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??=[]).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,e=Jt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(r)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(r,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(r,t,e);i!==void 0&&Qr(this.prototype,r,i)}}static getPropertyDescriptor(r,e,t){let{get:i,set:a}=Jr(this.prototype,r)??{get(){return this[e]},set(o){this[e]=o}};return{get:i,set(o){let p=i?.call(this);a?.call(this,o),this.requestUpdate(r,p,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??Jt}static _$Ei(){if(this.hasOwnProperty(Re("elementProperties")))return;let r=es(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(Re("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Re("properties"))){let e=this.properties,t=[...Zr(e),...Xr(e)];for(let i of t)this.createProperty(i,e[i])}let r=this[Symbol.metadata];if(r!==null){let e=litPropertyMetadata.get(r);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){let e=[];if(Array.isArray(r)){let t=new Set(r.flat(1/0).reverse());for(let i of t)e.unshift(_t(i))}else r!==void 0&&e.push(_t(r));return e}static _$Eu(r,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof r=="string"?r.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(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(r=>r(this))}addController(r){(this._$EO??=new Set).add(r),this.renderRoot!==void 0&&this.isConnected&&r.hostConnected?.()}removeController(r){this._$EO?.delete(r)}_$E_(){let r=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(r.set(t,this[t]),delete this[t]);r.size>0&&(this._$Ep=r)}createRenderRoot(){let r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Gt(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=thiLine truncated
|
var Kt=Object.defineProperty;var Qr=Object.getOwnPropertyDescriptor;var w=(s,r,e)=>()=>{if(e)throw e[0];try{return s&&(r=s(s=0)),r}catch(t){throw e=[t],t}};var Jr=(s,r)=>{for(var e in r)Kt(s,e,{get:r[e],enumerable:!0})};var d=(s,r,e,t)=>{for(var i=t>1?void 0:t?Qr(r,e):r,a=s.length-1,o;a>=0;a--)(o=s[a])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Kt(r,e,i),i};var Je,Ze,_t,Yt,Re,Gt,E,Qt,gt,mt=w(()=>{Je=globalThis,Ze=Je.ShadowRoot&&(Je.ShadyCSS===void 0||Je.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_t=Symbol(),Yt=new WeakMap,Re=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==_t)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o,e=this.t;if(Ze&&r===void 0){let t=e!==void 0&&e.length===1;t&&(r=Yt.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&Yt.set(e,r))}return r}toString(){return this.cssText}},Gt=s=>new Re(typeof s=="string"?s:s+"",void 0,_t),E=(s,...r)=>{let e=s.length===1?s[0]:r.reduce((t,i,a)=>t+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[a+1],s[0]);return new Re(e,s,_t)},Qt=(s,r)=>{if(Ze)s.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of r){let t=document.createElement("style"),i=Je.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,s.appendChild(t)}},gt=Ze?s=>s:s=>s instanceof CSSStyleSheet?(r=>{let e="";for(let t of r.cssRules)e+=t.cssText;return Gt(e)})(s):s});var Zr,Xr,es,ts,is,rs,Xe,Jt,ss,ns,Ne,qe,et,Zt,ee,je=w(()=>{mt();mt();({is:Zr,defineProperty:Xr,getOwnPropertyDescriptor:es,getOwnPropertyNames:ts,getOwnPropertySymbols:is,getPrototypeOf:rs}=Object),Xe=globalThis,Jt=Xe.trustedTypes,ss=Jt?Jt.emptyScript:"",ns=Xe.reactiveElementPolyfillSupport,Ne=(s,r)=>s,qe={toAttribute(s,r){switch(r){case Boolean:s=s?ss:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,r){let e=s;switch(r){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},et=(s,r)=>!Zr(s,r),Zt={attribute:!0,type:String,converter:qe,reflect:!1,useDefault:!1,hasChanged:et};Symbol.metadata??=Symbol("metadata"),Xe.litPropertyMetadata??=new WeakMap;ee=class extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??=[]).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,e=Zt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(r)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(r,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(r,t,e);i!==void 0&&Xr(this.prototype,r,i)}}static getPropertyDescriptor(r,e,t){let{get:i,set:a}=es(this.prototype,r)??{get(){return this[e]},set(o){this[e]=o}};return{get:i,set(o){let p=i?.call(this);a?.call(this,o),this.requestUpdate(r,p,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??Zt}static _$Ei(){if(this.hasOwnProperty(Ne("elementProperties")))return;let r=rs(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(Ne("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ne("properties"))){let e=this.properties,t=[...ts(e),...is(e)];for(let i of t)this.createProperty(i,e[i])}let r=this[Symbol.metadata];if(r!==null){let e=litPropertyMetadata.get(r);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){let e=[];if(Array.isArray(r)){let t=new Set(r.flat(1/0).reverse());for(let i of t)e.unshift(gt(i))}else r!==void 0&&e.push(gt(r));return e}static _$Eu(r,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof r=="string"?r.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(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(r=>r(this))}addController(r){(this._$EO??=new Set).add(r),this.renderRoot!==void 0&&this.isConnected&&r.hostConnected?.()}removeController(r){this._$EO?.delete(r)}_$E_(){let r=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(r.set(t,this[t]),delete this[t]);r.size>0&&(this._$Ep=r)}createRenderRoot(){let r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Qt(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=tLine truncated
|
||||||
\f\r]`,je=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ei=/-->/g,ti=/>/g,pe=RegExp(`>|${mt}(?:([^\\s"'>=/]+)(${mt}*=${mt}*(?:[^
|
\f\r]`,He=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ti=/-->/g,ii=/>/g,pe=RegExp(`>|${ft}(?:([^\\s"'>=/]+)(${ft}*=${ft}*(?:[^
|
||||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),ii=/'/g,ri=/"/g,oi=/^(?:script|style|textarea|title)$/i,kt=s=>(r,...e)=>({_$litType$:s,strings:r,values:e}),l=kt(1),xe=kt(2),yn=kt(3),_e=Symbol.for("lit-noChange"),_=Symbol.for("lit-nothing"),si=new WeakMap,he=ue.createTreeWalker(ue,129);ns=(s,r)=>{let e=s.length-1,t=[],i,a=r===2?"<svg>":r===3?"<math>":"",o=je;for(let p=0;p<e;p++){let c=s[p],h,m,f=-1,x=0;for(;x<c.length&&(o.lastIndex=x,m=o.exec(c),m!==null);)x=o.lastIndex,o===je?m[1]==="!--"?o=ei:m[1]!==void 0?o=ti:m[2]!==void 0?(oi.test(m[2])&&(i=RegExp("</"+m[2],"g")),o=pe):m[3]!==void 0&&(o=pe):o===pe?m[0]===">"?(o=i??je,f=-1):m[1]===void 0?f=-2:(f=o.lastIndex-m[2].length,h=m[1],o=m[3]===void 0?pe:m[3]==='"'?ri:ii):o===ri||o===ii?o=pe:o===ei||o===ti?o=je:(o=pe,i=void 0);let v=o===pe&&s[p+1].startsWith("/>")?" ":"";a+=o===je?c+rs:f>=0?(t.push(h),c.slice(0,f)+ni+c.slice(f)+le+v):c+le+(f===-2?p:v)}return[li(s,a+(s[e]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),t]},De=class s{constructor({strings:r,_$litType$:e},t){let i;this.parts=[];let a=0,o=0,p=r.length-1,c=this.parts,[h,m]=ns(r,e);if(this.el=s.createElement(h,t),he.currentNode=this.el.content,e===2||e===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=he.nextNode())!==null&&c.length<p;){if(i.nodeType===1){if(i.hasAttributes())for(let f of i.getAttributeNames())if(f.endsWith(ni)){let x=m[o++],v=i.getAttribute(f).split(le),k=/([.?@])?(.*)/.exec(x);c.push({type:1,index:a,name:k[2],strings:v,ctor:k[1]==="."?vt:k[1]==="?"?yt:k[1]==="@"?bt:be}),i.removeAttribute(f)}else f.startsWith(le)&&(c.push({type:6,index:a}),i.removeAttribute(f));if(oi.test(i.tagName)){let f=i.textContent.split(le),x=f.length-1;if(x>0){i.textContent=Xe?Xe.emptyScript:"";for(let v=0;v<x;v++)i.append(f[v],He()),he.nextNode(),c.push({type:2,index:++a});i.append(f[x],He())}}}else if(i.nodeType===8)if(i.data===ai)c.push({type:2,index:a});else{let f=-1;for(;(f=i.data.indexOf(le,f+1))!==-1;)c.push({type:7,index:a}),f+=le.length-1}a++}}static createElement(r,e){let t=ue.createElement("template");return t.innerHTML=r,t}};ft=class{constructor(r,e){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){let{el:{content:e},parts:t}=this._$AD,i=(r?.creationScope??ue).importNode(e,!0);he.currentNode=i;let a=he.nextNode(),o=0,p=0,c=t[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new Me(a,a.nextSibling,this,r):c.type===1?h=new c.ctor(a,c.name,c.strings,this,r):c.type===6&&(h=new xt(a,this,r)),this._$AV.push(h),c=t[++p]}o!==c?.index&&(a=he.nextNode(),o++)}return he.currentNode=ue,i}p(r){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(r,t,e),e+=t.strings.length-2):t._$AI(r[e])),e++}},Me=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(r,e,t,i){this.type=2,this._$AH=_,this._$AN=void 0,this._$AA=r,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let r=this._$AA.parentNode,e=this._$AM;return e!==void 0&&r?.nodeType===11&&(r=e.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,e=this){r=ye(this,r,e),Oe(r)?r===_||r==null||r===""?(this._$AH!==_&&this._$AR(),this._$AH=_):r!==this._$AH&&r!==_e&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):ss(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==_&&Oe(this._$AH)?this._$AA.nextSibling.data=r:this.T(ue.createTextNode(r)),this._$AH=r}$(r){let{values:e,_$litType$:t}=r,i=typeof t=="number"?this._$AC(r):(t.el===void 0&&(t.el=De.createElement(li(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let a=new ft(i,this),o=a.u(this.options);a.p(e),this.T(o),this._$AH=a}}_$AC(r){let e=si.get(r.strings);return e===void 0&&si.set(r.strings,e=new De(r)),e}k(r){$t(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let a of r)i===e.length?e.push(t=new s(this.O(He()),this.O(He()),this,this.options)):t=e[i],t._$AI(a),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(r=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);r!==this._$AB;){let t=Zt(r).nextSibling;Zt(r).remove(),r=t}}setConnected(r){this._$AM===void 0&&(this._$Cv=r,this._$AP?.(r))}},be=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,e,t,i,a){this.type=1,this._$AH=_,this._$AN=void 0,this.element=r,this.name=e,this._$AM=i,this.options=a,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=_}_$AI(r,e=this,t,i){let a=this.strings,o=!1;if(a===void 0)r=ye(this,r,e,0),o=!Oe(r)||r!==this._$AH&&r!==_e,o&&(this._$AH=r);else{let p=r,c,h;for(r=a[0],c=0;c<a.length-1;c++)h=ye(this,p[t+c],e,c),h===_e&&(h=this._$AH[c]),o||=!Oe(h)||h!==this._$AH[c],h===_?r=_:r!==_&&(r+=(h??"")+a[c+1]),this._$AH[c]=h}o&&!i&&this.j(r)}j(r){r===_?this.element.removeAttribute(this.naLine truncated
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),ri=/'/g,si=/"/g,li=/^(?:script|style|textarea|title)$/i,Et=s=>(r,...e)=>({_$litType$:s,strings:r,values:e}),l=Et(1),xe=Et(2),$n=Et(3),_e=Symbol.for("lit-noChange"),_=Symbol.for("lit-nothing"),ni=new WeakMap,he=ue.createTreeWalker(ue,129);ls=(s,r)=>{let e=s.length-1,t=[],i,a=r===2?"<svg>":r===3?"<math>":"",o=He;for(let p=0;p<e;p++){let c=s[p],h,m,f=-1,x=0;for(;x<c.length&&(o.lastIndex=x,m=o.exec(c),m!==null);)x=o.lastIndex,o===He?m[1]==="!--"?o=ti:m[1]!==void 0?o=ii:m[2]!==void 0?(li.test(m[2])&&(i=RegExp("</"+m[2],"g")),o=pe):m[3]!==void 0&&(o=pe):o===pe?m[0]===">"?(o=i??He,f=-1):m[1]===void 0?f=-2:(f=o.lastIndex-m[2].length,h=m[1],o=m[3]===void 0?pe:m[3]==='"'?si:ri):o===si||o===ri?o=pe:o===ti||o===ii?o=He:(o=pe,i=void 0);let v=o===pe&&s[p+1].startsWith("/>")?" ":"";a+=o===He?c+as:f>=0?(t.push(h),c.slice(0,f)+ai+c.slice(f)+le+v):c+le+(f===-2?p:v)}return[di(s,a+(s[e]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),t]},Me=class s{constructor({strings:r,_$litType$:e},t){let i;this.parts=[];let a=0,o=0,p=r.length-1,c=this.parts,[h,m]=ls(r,e);if(this.el=s.createElement(h,t),he.currentNode=this.el.content,e===2||e===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=he.nextNode())!==null&&c.length<p;){if(i.nodeType===1){if(i.hasAttributes())for(let f of i.getAttributeNames())if(f.endsWith(ai)){let x=m[o++],v=i.getAttribute(f).split(le),k=/([.?@])?(.*)/.exec(x);c.push({type:1,index:a,name:k[2],strings:v,ctor:k[1]==="."?yt:k[1]==="?"?bt:k[1]==="@"?xt:be}),i.removeAttribute(f)}else f.startsWith(le)&&(c.push({type:6,index:a}),i.removeAttribute(f));if(li.test(i.tagName)){let f=i.textContent.split(le),x=f.length-1;if(x>0){i.textContent=tt?tt.emptyScript:"";for(let v=0;v<x;v++)i.append(f[v],Oe()),he.nextNode(),c.push({type:2,index:++a});i.append(f[x],Oe())}}}else if(i.nodeType===8)if(i.data===oi)c.push({type:2,index:a});else{let f=-1;for(;(f=i.data.indexOf(le,f+1))!==-1;)c.push({type:7,index:a}),f+=le.length-1}a++}}static createElement(r,e){let t=ue.createElement("template");return t.innerHTML=r,t}};vt=class{constructor(r,e){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){let{el:{content:e},parts:t}=this._$AD,i=(r?.creationScope??ue).importNode(e,!0);he.currentNode=i;let a=he.nextNode(),o=0,p=0,c=t[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new ze(a,a.nextSibling,this,r):c.type===1?h=new c.ctor(a,c.name,c.strings,this,r):c.type===6&&(h=new wt(a,this,r)),this._$AV.push(h),c=t[++p]}o!==c?.index&&(a=he.nextNode(),o++)}return he.currentNode=ue,i}p(r){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(r,t,e),e+=t.strings.length-2):t._$AI(r[e])),e++}},ze=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(r,e,t,i){this.type=2,this._$AH=_,this._$AN=void 0,this._$AA=r,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let r=this._$AA.parentNode,e=this._$AM;return e!==void 0&&r?.nodeType===11&&(r=e.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,e=this){r=ye(this,r,e),De(r)?r===_||r==null||r===""?(this._$AH!==_&&this._$AR(),this._$AH=_):r!==this._$AH&&r!==_e&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):os(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==_&&De(this._$AH)?this._$AA.nextSibling.data=r:this.T(ue.createTextNode(r)),this._$AH=r}$(r){let{values:e,_$litType$:t}=r,i=typeof t=="number"?this._$AC(r):(t.el===void 0&&(t.el=Me.createElement(di(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let a=new vt(i,this),o=a.u(this.options);a.p(e),this.T(o),this._$AH=a}}_$AC(r){let e=ni.get(r.strings);return e===void 0&&ni.set(r.strings,e=new Me(r)),e}k(r){kt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let a of r)i===e.length?e.push(t=new s(this.O(Oe()),this.O(Oe()),this,this.options)):t=e[i],t._$AI(a),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(r=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);r!==this._$AB;){let t=Xt(r).nextSibling;Xt(r).remove(),r=t}}setConnected(r){this._$AM===void 0&&(this._$Cv=r,this._$AP?.(r))}},be=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,e,t,i,a){this.type=1,this._$AH=_,this._$AN=void 0,this.element=r,this.name=e,this._$AM=i,this.options=a,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=_}_$AI(r,e=this,t,i){let a=this.strings,o=!1;if(a===void 0)r=ye(this,r,e,0),o=!De(r)||r!==this._$AH&&r!==_e,o&&(this._$AH=r);else{let p=r,c,h;for(r=a[0],c=0;c<a.length-1;c++)h=ye(this,p[t+c],e,c),h===_e&&(h=this._$AH[c]),o||=!De(h)||h!==this._$AH[c],h===_?r=_:r!==_&&(r+=(h??"")+a[c+1]),this._$AH[c]=h}o&&!i&&this.j(r)}j(r){r===_?this.element.removeAttribute(this.naLine truncated
|
||||||
Replace seal
|
Replace seal
|
||||||
Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_toggle:"Due at a specific time",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",notes_markdown_hint:"Markdown is supported \u2014 **bold**, lists, [links](\u2026)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",completed_at_optional:"Completed at (optional, empty = now)",completed_at_pick:"Set date & time",completed_at_future_error:"The completion date cannot be in the future.",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",confirm_delete_object:"Delete this object and all its tasks?",confirm_delete_task:"Delete this task?",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",all_priorities:"All priorities",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",all_parts:"All parts",tasks_lower:"tasks",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all:"All entities must trigger",entities:"entities",attribute_optional:"Attribute (optional, blank = state)",use_entity_state:"Use entity state (no attribute)",trigger_above:"Trigger above",trigger_below:"Trigger below",trigger_equals:"Trigger when equal to (=)",trigger_not_equals:"Trigger when different from (\u2260)",for_at_least_minutes:"For at least (minutes)",safety_interval_days:"Safety interval (days, optional)",safety_interval:"Safety interval (optional)",trigger_combinator:"Combine trigger and interval",trigger_combinator_any:"Trigger or interval (whichever first)",trigger_combinator_all:"Trigger and interval (both required)",delta_mode:"Delta mode",from_state_optional:"From state (optional)",to_state_optional:"To state (optional)",documentation_url_optional:"Documentation URL (optional)",object_notes_optional:"Notes (optional)",nfc_tag_id_optional:"NFC Tag ID (optional)",nfc_tags_empty_help:"No NFC tags registered in Home Assistant yet.",nfc_tags_open_settings:"Open Tags settings",nfc_tags_refresh:"Refresh",environmental_entity_optional:"Environmental sensor (optional)",environmental_entity_helper:"e.g. sensor.outdoor_temperature \u2014 adjusts the interval based on environmental conditions",adaptive_prediction_enabled:"Enable sensor-driven predictions",adaptive_seasonal_enabled:"Enable seasonal awareness",adaptive_max_interval:"Maximum interval (days)",adaptive_min_interval:"Minimum interval (days)",adaptive_ewa_alpha:"Learning rate (alpha)",adaptive_enabled:"Enable adaptive scheduling",adaptive_section_title:"Adaptive Scheduling",environmental_attribute_optional:"Environmental attribute (optional)",nfc_tag_id:"NFC Tag ID",nfc_linked:"NFC tag linked",nfc_link_hint:"Click to link NFC tag",responsible_user:"Responsible User",shared_with:"Shared with (rotation)",shared_with_help:"Pick multiple people to share this task; the responsible person rotates on each completion.",rotation_strategy:"Rotation",rotation_none:"No rotation",rotation_round_robin:"Round-robin",rotation_least_com
Line truncated
|
Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_toggle:"Due at a specific time",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",notes_markdown_hint:"Markdown is supported \u2014 **bold**, lists, [links](\u2026)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",completed_at_optional:"Completed at (optional, empty = now)",completed_at_pick:"Set date & time",completed_at_future_error:"The completion date cannot be in the future.",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",confirm_delete_object:"Delete this object and all its tasks?",confirm_delete_task:"Delete this task?",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",all_priorities:"All priorities",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",all_parts:"All parts",tasks_lower:"tasks",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all:"All entities must trigger",entities:"entities",attribute_optional:"Attribute (optional, blank = state)",use_entity_state:"Use entity state (no attribute)",trigger_above:"Trigger above",trigger_below:"Trigger below",trigger_equals:"Trigger when equal to (=)",trigger_not_equals:"Trigger when different from (\u2260)",for_at_least_minutes:"For at least (minutes)",safety_interval_days:"Safety interval (days, optional)",safety_interval:"Safety interval (optional)",trigger_combinator:"Combine trigger and interval",trigger_combinator_any:"Trigger or interval (whichever first)",trigger_combinator_all:"Trigger and interval (both required)",delta_mode:"Delta mode",from_state_optional:"From state (optional)",to_state_optional:"To state (optional)",documentation_url_optional:"Documentation URL (optional)",object_notes_optional:"Notes (optional)",nfc_tag_id_optional:"NFC Tag ID (optional)",nfc_tags_empty_help:"No NFC tags registered in Home Assistant yet.",nfc_tags_open_settings:"Open Tags settings",nfc_tags_refresh:"Refresh",environmental_entity_optional:"Environmental sensor (optional)",environmental_entity_helper:"e.g. sensor.outdoor_temperature \u2014 adjusts the interval based on environmental conditions",adaptive_prediction_enabled:"Enable sensor-driven predictions",adaptive_seasonal_enabled:"Enable seasonal awareness",adaptive_max_interval:"Maximum interval (days)",adaptive_min_interval:"Minimum interval (days)",adaptive_ewa_alpha:"Learning rate (alpha)",adaptive_enabled:"Enable adaptive scheduling",adaptive_section_title:"Adaptive Scheduling",environmental_attribute_optional:"Environmental attribute (optional)",nfc_tag_id:"NFC Tag ID",nfc_linked:"NFC tag linked",nfc_link_hint:"Click to link NFC tag",responsible_user:"Responsible User",shared_with:"Shared with (rotation)",shared_with_help:"Pick multiple people to share this task; the responsible person rotates on each completion.",rotation_strategy:"Rotation",rotation_none:"No rotation",rotation_round_robin:"Round-robin",rotation_least_com
Line truncated
|
||||||
.field { display: flex; flex-direction: column; gap: 4px; }
|
.field { display: flex; flex-direction: column; gap: 4px; }
|
||||||
.field-label { font-size: 12px; color: var(--secondary-text-color); }
|
.field-label { font-size: 12px; color: var(--secondary-text-color); }
|
||||||
.field-input {
|
.field-input {
|
||||||
@@ -14,7 +14,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
font-family: inherit; width: 100%; box-sizing: border-box;
|
font-family: inherit; width: 100%; box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.field-input:focus { outline: none; border-color: var(--primary-color); }
|
.field-input:focus { outline: none; border-color: var(--primary-color); }
|
||||||
`,ws=E`
|
`,Es=E`
|
||||||
.person-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; vertical-align: middle; }
|
.person-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; vertical-align: middle; }
|
||||||
.person-avatar {
|
.person-avatar {
|
||||||
width: 22px; height: 22px; border-radius: 50%; flex: none;
|
width: 22px; height: 22px; border-radius: 50%; flex: none;
|
||||||
@@ -24,16 +24,16 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
}
|
}
|
||||||
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
||||||
`,$s=E`
|
`,Ss=E`
|
||||||
.ref-chip {
|
.ref-chip {
|
||||||
display: inline-block; font-size: 11.5px; font-weight: 500; line-height: 1; padding: 3px 6px;
|
display: inline-block; font-size: 11.5px; font-weight: 500; line-height: 1; padding: 3px 6px;
|
||||||
border-radius: 6px; border: 1px solid var(--divider-color); color: var(--secondary-text-color);
|
border-radius: 6px; border: 1px solid var(--divider-color); color: var(--secondary-text-color);
|
||||||
font-variant-numeric: tabular-nums; letter-spacing: .02em; vertical-align: middle; white-space: nowrap;
|
font-variant-numeric: tabular-nums; letter-spacing: .02em; vertical-align: middle; white-space: nowrap;
|
||||||
user-select: all;
|
user-select: all;
|
||||||
}
|
}
|
||||||
`,nt=E`
|
`,at=E`
|
||||||
${ws}
|
${Es}
|
||||||
${$s}
|
${Ss}
|
||||||
:host {
|
:host {
|
||||||
--maint-ok-color: var(--success-color, #4caf50);
|
--maint-ok-color: var(--success-color, #4caf50);
|
||||||
--maint-due-soon-color: var(--warning-color, #ff9800);
|
--maint-due-soon-color: var(--warning-color, #ff9800);
|
||||||
@@ -1237,7 +1237,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.stat-item .stat-label { font-size: 11px; white-space: normal; text-align: center; line-height: 1.2; hyphens: auto; overflow-wrap: anywhere; }
|
.stat-item .stat-label { font-size: 11px; white-space: normal; text-align: center; line-height: 1.2; hyphens: auto; overflow-wrap: anywhere; }
|
||||||
.stat-value { font-size: 20px; }
|
.stat-value { font-size: 20px; }
|
||||||
}
|
}
|
||||||
`});function We(s){if(!s)return[];let r=[],e=s.photo_doc_id;typeof e=="string"&&r.push(e);let t=s.photo_doc_ids;Array.isArray(t)&&r.push(...t);let i=[];for(let a of r){if(typeof a!="string")continue;let o=a.trim();if(!(!o||i.includes(o))&&(i.push(o),i.length>=10))break}return i}var at=w(()=>{"use strict"});function Wi(){let s=new Uint8Array(4);return(globalThis.crypto??{getRandomValues:r=>r.map(()=>Math.floor(Math.random()*256))}).getRandomValues(s),Array.from(s,r=>r.toString(16).padStart(2,"0")).join("")}function ie(s){let r=s?.reading_values;if(!Array.isArray(r))return[];let e=[],t=new Set;for(let i of r){if(!i||typeof i!="object")continue;let a=i;typeof a.id!="string"||!a.id||t.has(a.id)||typeof a.value!="number"||!Number.isFinite(a.value)||(t.add(a.id),e.push({id:a.id,name:typeof a.name=="string"?a.name:a.id,unit:typeof a.unit=="string"?a.unit:null,value:a.value}))}return e}function Ki(s){return s.filter(r=>r.type==="completed"&&(r.reading_value!=null||ie(r).length>0)).sort((r,e)=>r.timestamp.localeCompare(e.timestamp))}function Yi(s){return Ki(s??[]).map(r=>({timestamp:r.timestamp,values:ie(r)})).filter(r=>r.values.length>0)}function Gi(s,r,e){let t;for(let i of s){if(e!==void 0){let o=new Date(i.timestamp).getTime();if(!isNaN(o)&&o>=e)break}let a=i.values.find(o=>o.id===r);a&&(t=a)}return t}function Qi(s,r,e){let t=ie(r).find(a=>a.id===e);if(!t)return null;let i=null;for(let a of Ki(s)){if(a.timestamp>=r.timestamp)break;let o=ie(a).find(p=>p.id===e);o&&(i=o.value)}return i==null?null:t.value-i}function Ji(s){let r=new Set,e=new Set;for(let t of s){let i=(t.name||"").trim().toLowerCase();i&&(r.has(i)?e.add(t.id):r.add(i))}return e}function Zi(s){let r=[],e=new Set,t=new Set;for(let i of s){let a=(i.name||"").trim();if(!(!a||e.has(i.id)||t.has(a.toLowerCase()))&&(e.add(i.id),t.add(a.toLowerCase()),r.push({id:i.id,name:a,unit:(i.unit||"").trim()||null}),r.length>=20))break}return r}var Ee=w(()=>{"use strict"});function Es(s,r){let e=ks[s];if(!e)return s;let t=n(e,r);return t&&t!==e?t:s}function Ss(s){let e=s.match(/data\['([^']+)'\]/)?.[1],t;return(t=s.match(/length of value must be at most (\d+)/))?{field:e,rule:"too_long",param:t[1]}:(t=s.match(/length of value must be at least (\d+)/))?{field:e,rule:"too_short",param:t[1]}:(t=s.match(/value must be at most (\S+)/))?{field:e,rule:"value_too_high",param:t[1]}:(t=s.match(/value must be at least (\S+)/))?{field:e,rule:"value_too_low",param:t[1]}:/required key not provided/.test(s)?{field:e,rule:"required"}:(t=s.match(/expected (\w+)/))?{field:e,rule:"wrong_type",param:t[1]}:/value must be one of/.test(s)?{field:e,rule:"invalid_choice"}:/not a valid value/.test(s)?{field:e,rule:"invalid_value"}:{field:e,rule:"unknown"}}function O(s,r,e){if(e=e??n("action_error",r),typeof s=="string")return s;if(typeof s!="object"||s===null)return e;let t=s,i=t.message||t.error?.message||"";if(!i)return e;let a=Ss(i),o=a.field?Es(a.field,r):"",p=c=>n(c,r).replace("{field}",o).replace("{n}",a.param??"");switch(a.rule){case"too_long":return p("err_too_long");case"too_short":return p("err_too_short");case"value_too_high":return p("err_value_too_high");case"value_too_low":return p("err_value_too_low");case"required":return p("err_required");case"wrong_type":return p("err_wrong_type").replace("{type}",a.param??"");case"invalid_choice":return p("err_invalid_choice");case"invalid_value":return p("err_invalid_value");default:return i||e}}var ks,fe=w(()=>{"use strict";q();ks={entry_id:"object",name:"name",task_type:"maintenance_type",schedule_type:"schedule_type",interval_days:"interval_days",interval_anchor:"interval_anchor",warning_days:"warning_days",last_performed:"last_performed_optional",notes:"notes_optional",documentation_url:"documentation_url_optional",custom_icon:"custom_icon_optional",nfc_tag_id:"nfc_tag_id_optional",responsible_user_id:"responsible_user",entity_slug:"entity_slug",entity_id:"entity_id",area_id:"area_id_optional",manufacturer:"manufacturer_optional",model:"model_optional",serial_number:"serial_number_optional",installation_date:"installation_date_optional",warranty_expiry:"warranty_expiry_optional",checklist:"checklist_steps_optional",reason:"reason",feedback:"feedback",cost:"cost",duration:"duration",description:"description_optional",group_name:"name",group_description:"description_optional",environmental_entity:"environmental_entity_optional",environmental_attribute:"environmental_attribute_optional",trigger_above:"trigger_above",trigger_below:"trigger_below",trigger_equals:"trigger_equals",trigger_not_equals:"trigger_not_equals",trigger_for_minutes:"trigger_for_minutes"}});var N,Pt=w(()=>{"use strict";I();V();N=class extends A{constructor(){super(...arguments);this.label="";this.value="";this.placeholder="";this.type="text";this.required=!1;this.disabled=!1;this.multiline=!1;this.rows=3}_onInput(e){let t=e.target.value;this.value=t,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:t}}))}render(){return l`
|
`});function Ye(s){if(!s)return[];let r=[],e=s.photo_doc_id;typeof e=="string"&&r.push(e);let t=s.photo_doc_ids;Array.isArray(t)&&r.push(...t);let i=[];for(let a of r){if(typeof a!="string")continue;let o=a.trim();if(!(!o||i.includes(o))&&(i.push(o),i.length>=10))break}return i}var ot=w(()=>{"use strict"});function Ki(){let s=new Uint8Array(4);return(globalThis.crypto??{getRandomValues:r=>r.map(()=>Math.floor(Math.random()*256))}).getRandomValues(s),Array.from(s,r=>r.toString(16).padStart(2,"0")).join("")}function ie(s){let r=s?.reading_values;if(!Array.isArray(r))return[];let e=[],t=new Set;for(let i of r){if(!i||typeof i!="object")continue;let a=i;typeof a.id!="string"||!a.id||t.has(a.id)||typeof a.value!="number"||!Number.isFinite(a.value)||(t.add(a.id),e.push({id:a.id,name:typeof a.name=="string"?a.name:a.id,unit:typeof a.unit=="string"?a.unit:null,value:a.value}))}return e}function Yi(s){return s.filter(r=>r.type==="completed"&&(r.reading_value!=null||ie(r).length>0)).sort((r,e)=>r.timestamp.localeCompare(e.timestamp))}function Gi(s){return Yi(s??[]).map(r=>({timestamp:r.timestamp,values:ie(r)})).filter(r=>r.values.length>0)}function Qi(s,r,e){let t;for(let i of s){if(e!==void 0){let o=new Date(i.timestamp).getTime();if(!isNaN(o)&&o>=e)break}let a=i.values.find(o=>o.id===r);a&&(t=a)}return t}function Ji(s,r,e){let t=ie(r).find(a=>a.id===e);if(!t)return null;let i=null;for(let a of Yi(s)){if(a.timestamp>=r.timestamp)break;let o=ie(a).find(p=>p.id===e);o&&(i=o.value)}return i==null?null:t.value-i}function Zi(s){let r=new Set,e=new Set;for(let t of s){let i=(t.name||"").trim().toLowerCase();i&&(r.has(i)?e.add(t.id):r.add(i))}return e}function Xi(s){let r=[],e=new Set,t=new Set;for(let i of s){let a=(i.name||"").trim();if(!(!a||e.has(i.id)||t.has(a.toLowerCase()))&&(e.add(i.id),t.add(a.toLowerCase()),r.push({id:i.id,name:a,unit:(i.unit||"").trim()||null}),r.length>=20))break}return r}var Ee=w(()=>{"use strict"});function Ts(s,r){let e=As[s];if(!e)return s;let t=n(e,r);return t&&t!==e?t:s}function Is(s){let e=s.match(/data\['([^']+)'\]/)?.[1],t;return(t=s.match(/length of value must be at most (\d+)/))?{field:e,rule:"too_long",param:t[1]}:(t=s.match(/length of value must be at least (\d+)/))?{field:e,rule:"too_short",param:t[1]}:(t=s.match(/value must be at most (\S+)/))?{field:e,rule:"value_too_high",param:t[1]}:(t=s.match(/value must be at least (\S+)/))?{field:e,rule:"value_too_low",param:t[1]}:/required key not provided/.test(s)?{field:e,rule:"required"}:(t=s.match(/expected (\w+)/))?{field:e,rule:"wrong_type",param:t[1]}:/value must be one of/.test(s)?{field:e,rule:"invalid_choice"}:/not a valid value/.test(s)?{field:e,rule:"invalid_value"}:{field:e,rule:"unknown"}}function O(s,r,e){if(e=e??n("action_error",r),typeof s=="string")return s;if(typeof s!="object"||s===null)return e;let t=s,i=t.message||t.error?.message||"";if(!i)return e;let a=Is(i),o=a.field?Ts(a.field,r):"",p=c=>n(c,r).replace("{field}",o).replace("{n}",a.param??"");switch(a.rule){case"too_long":return p("err_too_long");case"too_short":return p("err_too_short");case"value_too_high":return p("err_value_too_high");case"value_too_low":return p("err_value_too_low");case"required":return p("err_required");case"wrong_type":return p("err_wrong_type").replace("{type}",a.param??"");case"invalid_choice":return p("err_invalid_choice");case"invalid_value":return p("err_invalid_value");default:return i||e}}var As,fe=w(()=>{"use strict";R();As={entry_id:"object",name:"name",task_type:"maintenance_type",schedule_type:"schedule_type",interval_days:"interval_days",interval_anchor:"interval_anchor",warning_days:"warning_days",last_performed:"last_performed_optional",notes:"notes_optional",documentation_url:"documentation_url_optional",custom_icon:"custom_icon_optional",nfc_tag_id:"nfc_tag_id_optional",responsible_user_id:"responsible_user",entity_slug:"entity_slug",entity_id:"entity_id",area_id:"area_id_optional",manufacturer:"manufacturer_optional",model:"model_optional",serial_number:"serial_number_optional",installation_date:"installation_date_optional",warranty_expiry:"warranty_expiry_optional",checklist:"checklist_steps_optional",reason:"reason",feedback:"feedback",cost:"cost",duration:"duration",description:"description_optional",group_name:"name",group_description:"description_optional",environmental_entity:"environmental_entity_optional",environmental_attribute:"environmental_attribute_optional",trigger_above:"trigger_above",trigger_below:"trigger_below",trigger_equals:"trigger_equals",trigger_not_equals:"trigger_not_equals",trigger_for_minutes:"trigger_for_minutes"}});var q,Lt=w(()=>{"use strict";C();W();q=class extends A{constructor(){super(...arguments);this.label="";this.value="";this.placeholder="";this.type="text";this.required=!1;this.disabled=!1;this.multiline=!1;this.rows=3}_onInput(e){let t=e.target.value;this.value=t,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:t}}))}render(){return l`
|
||||||
<label class="field">
|
<label class="field">
|
||||||
${this.label?l`<span class="label">${this.label}${this.required?l`<span class="req">*</span>`:_}</span>`:_}
|
${this.label?l`<span class="label">${this.label}${this.required?l`<span class="req">*</span>`:_}</span>`:_}
|
||||||
${this.multiline?l`
|
${this.multiline?l`
|
||||||
@@ -1265,7 +1265,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
/>`}
|
/>`}
|
||||||
${this.helper?l`<span class="helper">${this.helper}</span>`:_}
|
${this.helper?l`<span class="helper">${this.helper}</span>`:_}
|
||||||
</label>
|
</label>
|
||||||
`}};N.styles=E`
|
`}};q.styles=E`
|
||||||
:host { display: block; }
|
:host { display: block; }
|
||||||
.field {
|
.field {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -1314,25 +1314,34 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
`,d([y()],N.prototype,"label",2),d([y()],N.prototype,"value",2),d([y()],N.prototype,"placeholder",2),d([y()],N.prototype,"type",2),d([y({type:Boolean})],N.prototype,"required",2),d([y({type:Boolean})],N.prototype,"disabled",2),d([y()],N.prototype,"step",2),d([y()],N.prototype,"min",2),d([y()],N.prototype,"max",2),d([y()],N.prototype,"pattern",2),d([y()],N.prototype,"helper",2),d([y({type:Boolean})],N.prototype,"multiline",2),d([y({type:Number})],N.prototype,"rows",2);customElements.get("ms-textfield")||customElements.define("ms-textfield",N)});function As(s,r){if(r)switch(s){case"date":return r.split("T")[0];case"time":return r.length===5?`${r}:00`:r;case"datetime":{let[e,t="00:00:00"]=r.split("T");return`${e} ${t.length===5?`${t}:00`:t}`}}}function Ts(s,r){if(typeof r!="string"||!r)return"";switch(s){case"date":return r.slice(0,10);case"time":return r.slice(0,5);case"datetime":{let[e,t="00:00:00"]=r.split(" ");return`${e}T${t.length===5?`${t}:00`:t}`}}}var U,Se=w(()=>{"use strict";I();V();q();U=class extends A{constructor(){super(...arguments);this.kind="date";this.label="";this.value="";this.clearable=!1;this.disabled=!1;this.required=!1;this.lang="en"}_selector(){switch(this.kind){case"date":return{date:{}};case"time":return{time:{no_second:!0}};case"datetime":return{datetime:{}}}}_onSelectorChange(e){e.stopPropagation(),this._emit(Ts(this.kind,e.detail?.value))}_clear(){this._emit("")}_emit(e){e!==this.value&&(this.value=e,this.dispatchEvent(new CustomEvent("value-changed",{bubbles:!0,composed:!0,detail:{value:e}})))}render(){return l`
|
`,d([y()],q.prototype,"label",2),d([y()],q.prototype,"value",2),d([y()],q.prototype,"placeholder",2),d([y()],q.prototype,"type",2),d([y({type:Boolean})],q.prototype,"required",2),d([y({type:Boolean})],q.prototype,"disabled",2),d([y()],q.prototype,"step",2),d([y()],q.prototype,"min",2),d([y()],q.prototype,"max",2),d([y()],q.prototype,"pattern",2),d([y()],q.prototype,"helper",2),d([y({type:Boolean})],q.prototype,"multiline",2),d([y({type:Number})],q.prototype,"rows",2);customElements.get("ms-textfield")||customElements.define("ms-textfield",q)});function Cs(s){let e=B("2001-02-03",s).match(/\d+/g)||[],t=p=>e.findIndex(c=>Number(c)===p),i=t(2001),a=t(2),o=t(3);return i===0?"YMD":a>=0&&o>=0&&a<o?"MDY":"DMY"}function Se(s,r,e){if(s<1e3||s>9999||r<1||r>12||e<1||e>31)return null;let t=new Date(s,r-1,e);return t.getFullYear()!==s||t.getMonth()!==r-1||t.getDate()!==e?null:`${s}-${String(r).padStart(2,"0")}-${String(e).padStart(2,"0")}`}function er(s,r){let e=s.trim(),t;if(t=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/))return Se(+t[1],+t[2],+t[3]);if(t=e.match(/^(\d{4})$/))return Se(+t[1],1,1);if(t=e.match(/^(\d{1,2})[./](\d{4})$/))return Se(+t[2],+t[1],1);if(t=e.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/))return Se(+t[3],+t[2],+t[1]);if(t=e.match(/^(\d{1,2})[/-](\d{1,2})[/-](\d{4})$/)){let i=+t[1],a=+t[2],o=+t[3];return Cs(r)==="MDY"?Se(o,i,a):Se(o,a,i)}return null}var tr=w(()=>{"use strict";R()});function Ps(s,r){if(r)switch(s){case"date":return r.split("T")[0];case"time":return r.length===5?`${r}:00`:r;case"datetime":{let[e,t="00:00:00"]=r.split("T");return`${e} ${t.length===5?`${t}:00`:t}`}}}function Ls(s,r){if(typeof r!="string"||!r)return"";switch(s){case"date":return r.slice(0,10);case"time":return r.slice(0,5);case"datetime":{let[e,t="00:00:00"]=r.split(" ");return`${e}T${t.length===5?`${t}:00`:t}`}}}var D,Ae=w(()=>{"use strict";C();W();R();tr();D=class extends A{constructor(){super(...arguments);this.kind="date";this.label="";this.value="";this.clearable=!1;this.disabled=!1;this.required=!1;this.lang="en";this._typing=!1;this._typed="";this._typedInvalid=!1}_startTyping(){this._typed=this.value,this._typedInvalid=!1,this._typing=!0,this.updateComplete.then(()=>this.shadowRoot?.querySelector("input.typed")?.focus())}_commitTyped(){if(!this._typed.trim()){this._typing=!1;return}let e=er(this._typed,this.lang);if(!e){this._typedInvalid=!0;return}this._typing=!1,this._typedInvalid=!1,this._emit(e)}_onTypedKey(e){e.key==="Enter"?(e.preventDefault(),this._commitTyped()):e.key==="Escape"&&(e.preventDefault(),this._typing=!1,this._typedInvalid=!1)}_selector(){switch(this.kind){case"date":return{date:{}};case"time":return{time:{no_second:!0}};case"datetime":return{datetime:{}}}}_onSelectorChange(e){e.stopPropagation(),this._emit(Ls(this.kind,e.detail?.value))}_clear(){this._emit("")}_emit(e){e!==this.value&&(this.value=e,this.dispatchEvent(new CustomEvent("value-changed",{bubbles:!0,composed:!0,detail:{value:e}})))}render(){return l`
|
||||||
<div class="field">
|
<div class="field">
|
||||||
${this.label?l`<span class="label">${this.label}${this.required?l`<span class="req">*</span>`:_}</span>`:_}
|
${this.label?l`<span class="label">${this.label}${this.required?l`<span class="req">*</span>`:_}</span>`:_}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<ha-selector
|
${this._typing?l`<input class="typed" type="text" inputmode="numeric" autocomplete="off"
|
||||||
.hass=${this.hass}
|
.value=${this._typed}
|
||||||
.selector=${this._selector()}
|
placeholder=${B("1978-03-15",this.lang)}
|
||||||
.value=${As(this.kind,this.value)}
|
aria-invalid=${this._typedInvalid?"true":"false"}
|
||||||
.required=${this.required}
|
@input=${e=>{this._typed=e.target.value,this._typedInvalid=!1}}
|
||||||
.disabled=${this.disabled}
|
@keydown=${this._onTypedKey}
|
||||||
@value-changed=${this._onSelectorChange}
|
@blur=${this._commitTyped} />`:l`<ha-selector
|
||||||
></ha-selector>
|
.hass=${this.hass}
|
||||||
${this.clearable&&this.value&&!this.disabled?l`<button type="button" class="clear" title=${n("clear",this.lang)} aria-label=${n("clear",this.lang)} @click=${this._clear}>
|
.selector=${this._selector()}
|
||||||
|
.value=${Ps(this.kind,this.value)}
|
||||||
|
.required=${this.required}
|
||||||
|
.disabled=${this.disabled}
|
||||||
|
@value-changed=${this._onSelectorChange}
|
||||||
|
></ha-selector>`}
|
||||||
|
${this.kind==="date"&&!this.disabled&&!this._typing?l`<button type="button" class="type-toggle" title=${n("date_type_toggle",this.lang)} aria-label=${n("date_type_toggle",this.lang)} @click=${this._startTyping}>
|
||||||
|
<ha-icon icon="mdi:keyboard-outline"></ha-icon>
|
||||||
|
</button>`:_}
|
||||||
|
${this.clearable&&this.value&&!this.disabled&&!this._typing?l`<button type="button" class="clear" title=${n("clear",this.lang)} aria-label=${n("clear",this.lang)} @click=${this._clear}>
|
||||||
<ha-icon icon="mdi:close"></ha-icon>
|
<ha-icon icon="mdi:close"></ha-icon>
|
||||||
</button>`:_}
|
</button>`:_}
|
||||||
</div>
|
</div>
|
||||||
${this.helper?l`<span class="helper">${this.helper}</span>`:_}
|
${this._typedInvalid?l`<span class="helper invalid">${n("date_type_invalid",this.lang)}</span>`:this.helper?l`<span class="helper">${this.helper}</span>`:_}
|
||||||
</div>
|
</div>
|
||||||
`}};U.styles=E`
|
`}};D.styles=E`
|
||||||
:host { display: block; }
|
:host { display: block; }
|
||||||
.field {
|
.field {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -1354,7 +1363,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
.clear {
|
.clear, .type-toggle {
|
||||||
flex: none;
|
flex: none;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -1369,14 +1378,29 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
--mdc-icon-size: 20px;
|
--mdc-icon-size: 20px;
|
||||||
}
|
}
|
||||||
.clear:hover { background: rgba(var(--rgb-primary-text-color, 0, 0, 0), 0.08); }
|
.clear:hover, .type-toggle:hover { background: rgba(var(--rgb-primary-text-color, 0, 0, 0), 0.08); }
|
||||||
.clear:focus-visible { outline: 2px solid var(--primary-color); }
|
.clear:focus-visible, .type-toggle:focus-visible { outline: 2px solid var(--primary-color); }
|
||||||
.helper {
|
.helper {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
`,d([y({attribute:!1})],U.prototype,"hass",2),d([y()],U.prototype,"kind",2),d([y()],U.prototype,"label",2),d([y()],U.prototype,"value",2),d([y()],U.prototype,"helper",2),d([y({type:Boolean})],U.prototype,"clearable",2),d([y({type:Boolean})],U.prototype,"disabled",2),d([y({type:Boolean})],U.prototype,"required",2),d([y()],U.prototype,"lang",2);customElements.get("ms-date-field")||customElements.define("ms-date-field",U)});var C,Xi=w(()=>{"use strict";I();V();q();fe();Pt();Se();C=class extends A{constructor(){super(...arguments);this.objects=[];this._open=!1;this._loading=!1;this._error="";this._name="";this._manufacturer="";this._model="";this._serialNumber="";this._areaId="";this._installationDate="";this._warrantyExpiry="";this._documentationUrl="";this._notes="";this._haDeviceId="";this._parentEntryId="";this._entryId=null}get _lang(){return M(this.hass)}openCreate(){this._entryId=null,this._name="",this._manufacturer="",this._model="",this._serialNumber="",this._areaId="",this._installationDate="",this._warrantyExpiry="",this._documentationUrl="",this._notes="",this._haDeviceId="",this._parentEntryId="",this._error="",this._open=!0}openEdit(e,t){this._entryId=e,this._name=t.name||"",this._manufacturer=t.manufacturer||"",this._model=t.model||"",this._serialNumber=t.serial_number||"",this._areaId=t.area_id||"",this._installationDate=t.installation_date||"",this._warrantyExpiry=t.warranty_expiry||"",this._documentationUrl=t.documentation_url||"",this._notes=t.notes||"",this._haDeviceId=t.ha_device_id||"",this._parentEntryId=t.parent_entry_id||"",this._error="",this._open=!0}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{this._entryId?await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/update",entry_id:this._entryId,name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}):await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/create",name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}),this._open=!1,this.dispatchEvent(new CustomEvent("object-saved"))}catch(e){this._error=O(e,this._lang,n("save_error",this._lang))}finally{this._loading=!1}}}_parentChoices(){return(this.objects||[]).filter(e=>e.entry_id!==this._entryId)}_close(){this._open=!1}render(){if(!this._open)return l``;let e=this._lang,t=this._entryId?n("edit_object",e):n("new_object",e);return l`
|
.helper.invalid { color: var(--error-color, #f44336); font-style: normal; }
|
||||||
|
input.typed {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
height: 40px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 12px;
|
||||||
|
border: 1px solid var(--divider-color, #ccc);
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--card-background-color, #fff);
|
||||||
|
color: var(--primary-text-color);
|
||||||
|
font: inherit;
|
||||||
|
}
|
||||||
|
input.typed[aria-invalid="true"] { border-color: var(--error-color, #f44336); }
|
||||||
|
input.typed:focus { outline: 2px solid var(--primary-color); outline-offset: -1px; }
|
||||||
|
`,d([y({attribute:!1})],D.prototype,"hass",2),d([y()],D.prototype,"kind",2),d([y()],D.prototype,"label",2),d([y()],D.prototype,"value",2),d([y()],D.prototype,"helper",2),d([y({type:Boolean})],D.prototype,"clearable",2),d([y({type:Boolean})],D.prototype,"disabled",2),d([y({type:Boolean})],D.prototype,"required",2),d([y()],D.prototype,"lang",2),d([u()],D.prototype,"_typing",2),d([u()],D.prototype,"_typed",2),d([u()],D.prototype,"_typedInvalid",2);customElements.get("ms-date-field")||customElements.define("ms-date-field",D)});var I,ir=w(()=>{"use strict";C();W();R();fe();Lt();Ae();I=class extends A{constructor(){super(...arguments);this.objects=[];this._open=!1;this._loading=!1;this._error="";this._name="";this._manufacturer="";this._model="";this._serialNumber="";this._areaId="";this._installationDate="";this._warrantyExpiry="";this._documentationUrl="";this._notes="";this._haDeviceId="";this._parentEntryId="";this._entryId=null}get _lang(){return z(this.hass)}openCreate(){this._entryId=null,this._name="",this._manufacturer="",this._model="",this._serialNumber="",this._areaId="",this._installationDate="",this._warrantyExpiry="",this._documentationUrl="",this._notes="",this._haDeviceId="",this._parentEntryId="",this._error="",this._open=!0}openEdit(e,t){this._entryId=e,this._name=t.name||"",this._manufacturer=t.manufacturer||"",this._model=t.model||"",this._serialNumber=t.serial_number||"",this._areaId=t.area_id||"",this._installationDate=t.installation_date||"",this._warrantyExpiry=t.warranty_expiry||"",this._documentationUrl=t.documentation_url||"",this._notes=t.notes||"",this._haDeviceId=t.ha_device_id||"",this._parentEntryId=t.parent_entry_id||"",this._error="",this._open=!0}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{this._entryId?await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/update",entry_id:this._entryId,name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}):await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/create",name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}),this._open=!1,this.dispatchEvent(new CustomEvent("object-saved"))}catch(e){this._error=O(e,this._lang,n("save_error",this._lang))}finally{this._loading=!1}}}_parentChoices(){return(this.objects||[]).filter(e=>e.entry_id!==this._entryId)}_close(){this._open=!1}render(){if(!this._open)return l``;let e=this._lang,t=this._entryId?n("edit_object",e):n("new_object",e);return l`
|
||||||
<ha-dialog open @closed=${this._close}>
|
<ha-dialog open @closed=${this._close}>
|
||||||
<div class="dialog-title">${t}</div>
|
<div class="dialog-title">${t}</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -1477,7 +1501,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
</ha-button>
|
</ha-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
`}};C.styles=E`
|
`}};I.styles=E`
|
||||||
.dialog-title {
|
.dialog-title {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -1527,9 +1551,9 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
color: var(--error-color, #f44336);
|
color: var(--error-color, #f44336);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
`,d([y({attribute:!1})],C.prototype,"hass",2),d([y({attribute:!1})],C.prototype,"objects",2),d([u()],C.prototype,"_open",2),d([u()],C.prototype,"_loading",2),d([u()],C.prototype,"_error",2),d([u()],C.prototype,"_name",2),d([u()],C.prototype,"_manufacturer",2),d([u()],C.prototype,"_model",2),d([u()],C.prototype,"_serialNumber",2),d([u()],C.prototype,"_areaId",2),d([u()],C.prototype,"_installationDate",2),d([u()],C.prototype,"_warrantyExpiry",2),d([u()],C.prototype,"_documentationUrl",2),d([u()],C.prototype,"_notes",2),d([u()],C.prototype,"_haDeviceId",2),d([u()],C.prototype,"_parentEntryId",2),d([u()],C.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",C)});function Cs(s){let r=(s||"").split(/\s+/).filter(Boolean);return r.length===0?"?":r.length===1?r[0][0].toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function Is(s){let r=0;for(let e of s)r=r*31+e.charCodeAt(0)>>>0;return er[r%er.length]}function tr(s){return s?{id:s.id,name:s.name,initials:s.initials||Cs(s.name),color:s.color||Is(s.id)}:null}var er,ir=w(()=>{"use strict";I();er=["#c62828","#ad1457","#6a1b9a","#4527a0","#283593","#1565c0","#00838f","#2e7d32","#558b2f","#ef6c00","#6d4c41","#546e7a"]});var ot,rr=w(()=>{"use strict";ir();ot=class{constructor(r){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=r}updateHass(r){this.hass=r}async getUsers(r=!1){let e=Date.now();if(!r&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(r,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:r,task_id:e,user_id:t})}async getTasksByUser(r){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:r})).tasks}getUserName(r){return!r||!this.usersCache?null:this.usersCache.find(t=>t.id===r)?.name||null}getPerson(r){return tr(this.getUser(r))}getUser(r){return!r||!this.usersCache?null:this.usersCache.find(e=>e.id===r)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(r){return r?r===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}}});function G(s){return`${s.entry_id??""}\0${s.part_id}`}function sr(s,r,e,t){let i=!!s.entry_id&&s.entry_id!==r,a=i?s.entry_id:r,o=e.find(m=>m.entry_id===a),p=(o?.parts||[]).find(m=>m.id===s.part_id)||null,c=i&&o?.object?.name||"",h=p?.name||n("shared_part_unknown",t);return{part:p,foreign:i,ownerName:c,label:c?`${h} (${c})`:h}}function nr(s,r,e,t){let{part:i,label:a}=sr(s,r,e,t),o=i&&i.stock!==null&&i.stock!==void 0?` (${i.stock}${i.unit?" "+i.unit:""})`:"",p=i?.storage_location?` \u2014 ${i.storage_location}`:"";return`${s.quantity}\xD7 ${a}${o}${p}`}function ar(s,r,e,t){let a=(e.find(p=>p.entry_id===r)?.parts||[]).map(p=>({...p})),o=new Set(a.map(p=>G({part_id:p.id})));for(let p of s?.consumes_parts||[]){if(!p.entry_id||p.entry_id===r)continue;let c=G(p);if(o.has(c))continue;o.add(c);let{part:h,ownerName:m}=sr(p,r,e,t);a.push({id:p.part_id,name:h?.name||n("shared_part_unknown",t),unit:h?.unit,stock:h?.stock??null,storage_location:h?.storage_location,entry_id:p.entry_id,owner_name:m})}return a}var lt=w(()=>{"use strict";q()});var Lt,or,lr,dr=w(()=>{"use strict";Lt=["sensor","binary_sensor","number","input_number","input_boolean","switch","climate","vacuum","cover","fan","light","water_heater","humidifier","media_player","weather","air_quality","valve","lawn_mower","lock"],or=["sensor"],lr=["temperature","humidity","pressure"]});var Rt,Ke,qt=w(()=>{"use strict";Rt=["notes","cost","duration","photo","user"],Ke={notes:"notes_label",cost:"cost",duration:"duration",photo:"photo_label",user:"user_label"}});function js(){return{entityIds:"",type:"threshold",attribute:"",above:"",below:"",equals:"",notEquals:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}function Os(s){return{entityIds:(s.entity_ids||(s.entity_id?[s.entity_id]:[])).join(", "),type:s.type||"threshold",attribute:s.attribute||"",above:s.trigger_above?.toString()??"",below:s.trigger_below?.toString()??"",equals:s.trigger_equals?.toString()??"",notEquals:s.trigger_not_equals?.toString()??"",forMinutes:s.trigger_for_minutes?.toString()??"0",targetValue:s.trigger_target_value?.toString()??"",deltaMode:s.trigger_delta_mode||!1,fromState:s.trigger_from_state||"",toState:s.trigger_to_state||"",targetChanges:s.trigger_target_changes?.toString()??"",runtimeHours:s.trigger_runtime_hours?.toString()??"",onStates:(s.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(s).filter(([e])=>!Hs.has(e)&&!e.startsWith("_")))}}function Ds(s){let r=s.entityIds.
Line truncated
|
`,d([y({attribute:!1})],I.prototype,"hass",2),d([y({attribute:!1})],I.prototype,"objects",2),d([u()],I.prototype,"_open",2),d([u()],I.prototype,"_loading",2),d([u()],I.prototype,"_error",2),d([u()],I.prototype,"_name",2),d([u()],I.prototype,"_manufacturer",2),d([u()],I.prototype,"_model",2),d([u()],I.prototype,"_serialNumber",2),d([u()],I.prototype,"_areaId",2),d([u()],I.prototype,"_installationDate",2),d([u()],I.prototype,"_warrantyExpiry",2),d([u()],I.prototype,"_documentationUrl",2),d([u()],I.prototype,"_notes",2),d([u()],I.prototype,"_haDeviceId",2),d([u()],I.prototype,"_parentEntryId",2),d([u()],I.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",I)});function Rs(s){let r=(s||"").split(/\s+/).filter(Boolean);return r.length===0?"?":r.length===1?r[0][0].toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function Ns(s){let r=0;for(let e of s)r=r*31+e.charCodeAt(0)>>>0;return rr[r%rr.length]}function sr(s){return s?{id:s.id,name:s.name,initials:s.initials||Rs(s.name),color:s.color||Ns(s.id)}:null}var rr,nr=w(()=>{"use strict";C();rr=["#c62828","#ad1457","#6a1b9a","#4527a0","#283593","#1565c0","#00838f","#2e7d32","#558b2f","#ef6c00","#6d4c41","#546e7a"]});var lt,ar=w(()=>{"use strict";nr();lt=class{constructor(r){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=r}updateHass(r){this.hass=r}async getUsers(r=!1){let e=Date.now();if(!r&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(r,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:r,task_id:e,user_id:t})}async getTasksByUser(r){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:r})).tasks}getUserName(r){return!r||!this.usersCache?null:this.usersCache.find(t=>t.id===r)?.name||null}getPerson(r){return sr(this.getUser(r))}getUser(r){return!r||!this.usersCache?null:this.usersCache.find(e=>e.id===r)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(r){return r?r===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}}});function Q(s){return`${s.entry_id??""}\0${s.part_id}`}function or(s,r,e,t){let i=!!s.entry_id&&s.entry_id!==r,a=i?s.entry_id:r,o=e.find(m=>m.entry_id===a),p=(o?.parts||[]).find(m=>m.id===s.part_id)||null,c=i&&o?.object?.name||"",h=p?.name||n("shared_part_unknown",t);return{part:p,foreign:i,ownerName:c,label:c?`${h} (${c})`:h}}function lr(s,r,e,t){let{part:i,label:a}=or(s,r,e,t),o=i&&i.stock!==null&&i.stock!==void 0?` (${i.stock}${i.unit?" "+i.unit:""})`:"",p=i?.storage_location?` \u2014 ${i.storage_location}`:"";return`${s.quantity}\xD7 ${a}${o}${p}`}function dr(s,r,e,t){let a=(e.find(p=>p.entry_id===r)?.parts||[]).map(p=>({...p})),o=new Set(a.map(p=>Q({part_id:p.id})));for(let p of s?.consumes_parts||[]){if(!p.entry_id||p.entry_id===r)continue;let c=Q(p);if(o.has(c))continue;o.add(c);let{part:h,ownerName:m}=or(p,r,e,t);a.push({id:p.part_id,name:h?.name||n("shared_part_unknown",t),unit:h?.unit,stock:h?.stock??null,storage_location:h?.storage_location,entry_id:p.entry_id,owner_name:m})}return a}var dt=w(()=>{"use strict";R()});var Rt,cr,pr,hr=w(()=>{"use strict";Rt=["sensor","binary_sensor","number","input_number","input_boolean","switch","climate","vacuum","cover","fan","light","water_heater","humidifier","media_player","weather","air_quality","valve","lawn_mower","lock"],cr=["sensor"],pr=["temperature","humidity","pressure"]});var Nt,Ge,qt=w(()=>{"use strict";Nt=["notes","cost","duration","photo","user"],Ge={notes:"notes_label",cost:"cost",duration:"duration",photo:"photo_label",user:"user_label"}});function Ms(){return{entityIds:"",type:"threshold",attribute:"",above:"",below:"",equals:"",notEquals:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}function Us(s){return{entityIds:(s.entity_ids||(s.entity_id?[s.entity_id]:[])).join(", "),type:s.type||"threshold",attribute:s.attribute||"",above:s.trigger_above?.toString()??"",below:s.trigger_below?.toString()??"",equals:s.trigger_equals?.toString()??"",notEquals:s.trigger_not_equals?.toString()??"",forMinutes:s.trigger_for_minutes?.toString()??"0",targetValue:s.trigger_target_value?.toString()??"",deltaMode:s.trigger_delta_mode||!1,fromState:s.trigger_from_state||"",toState:s.trigger_to_state||"",targetChanges:s.trigger_target_changes?.toString()??"",runtimeHours:s.trigger_runtime_hours?.toString()??"",onStates:(s.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(s).filter(([e])=>!zs.has(e)&&!e.startsWith("_")))}}function Fs(s){let r=s.entityIds.
Line truncated
|
||||||
`),this._phaseDefs=Object.entries(t.phases||{}).map(([h,m])=>{let{name:f,checklist:x,consumes_parts:v,required_completion_fields:k,...T}=m,D=m.consumes_parts||[],F=D.findIndex(K=>!K.entry_id),j=F>=0?D[F]:void 0;return{id:h,name:m.name||h,checklistText:(m.checklist||[]).join(`
|
`),this._phaseDefs=Object.entries(t.phases||{}).map(([h,m])=>{let{name:f,checklist:x,consumes_parts:v,required_completion_fields:k,...T}=m,M=m.consumes_parts||[],F=M.findIndex(Y=>!Y.entry_id),j=F>=0?M[F]:void 0;return{id:h,name:m.name||h,checklistText:(m.checklist||[]).join(`
|
||||||
`),partId:j?.part_id||"",partQty:j?.quantity!=null?String(j.quantity):"",reqOverride:m.required_completion_fields!==void 0,reqFields:[...m.required_completion_fields||[]],extraParts:D.filter((K,oe)=>oe!==F).map(K=>({...K})),carry:T}}),this._phaseSeq=[...t.phase_sequence||[]],this._requiredCompletion=[...t.required_completion_fields||[]],this._scheduleTime=t.schedule_time||"",this._scheduleTimeOn=!!t.schedule_time;let o=t.on_complete_action;if(o&&o.service){this._actionService=o.service;let h=o.target?.entity_id;this._actionTargetEntity=Array.isArray(h)?h[0]||"":h||"",this._actionData=o.data&&typeof o.data=="object"?{...o.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let p=t.quick_complete_defaults;this._qcNotes=p?.notes||"",this._qcCost=p?.cost!=null?String(p.cost):"",this._qcDuration=p?.duration!=null?String(p.duration):"",this._qcFeedback=p?.feedback||"";let c=t.adaptive_config||{};if(this._environmentalEntity=c.environmental_entity||"",this._environmentalAttribute=c.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,this._adaptiveEnabled=!!c.enabled,this._adaptiveAlpha=c.ewa_alpha?.toString()??re.alpha,this._adaptiveMin=c.min_interval_days?.toString()??re.min,this._adaptiveMax=c.max_interval_days?.toString()??re.max,this._adaptiveSeasonal=c.seasonal_enabled!==!1,this._adaptivePrediction=c.sensor_prediction_enabled!==!1,this._adaptiveInitial=this._adaptiveSnapshot(),t.trigger_config){let h=t.trigger_config;this._triggerEntityId=h.entity_id||h.entity_ids&&h.entity_ids[0]||"",this._triggerEntityIds=h.entity_ids||(h.entity_id?[h.entity_id]:[]),this._triggerEntityLogic=h.entity_logic||"any",this._triggerAttribute=h.attribute||"",this._triggerType=h.type||"threshold",this._triggerAbove=h.trigger_above?.toString()||"",this._triggerBelow=h.trigger_below?.toString()||"",this._triggerEquals=h.trigger_equals?.toString()||"",this._triggerNotEquals=h.trigger_not_equals?.toString()||"",this._triggerForMinutes=h.trigger_for_minutes?.toString()||"0",this._triggerCombinator=h.trigger_combinator==="all"?"all":"any",this._triggerTargetValue=h.trigger_target_value?.toString()||"",this._triggerDeltaMode=h.trigger_delta_mode||!1,this._triggerBaselineValue=h.trigger_baseline_value?.toString()||"",this._liveBaselineValue=t.trigger_baseline_value??null,this._autoCompleteOnRecovery=h.auto_complete_on_recovery||!1,this._triggerFromState=h.trigger_from_state||"",this._triggerToState=h.trigger_to_state||"",this._triggerTargetChanges=h.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=h.trigger_runtime_hours?.toString()||"",this._triggerRuntimeMaxSession=h.trigger_runtime_max_session_seconds?.toString()||"",this._triggerOnStates=(h.trigger_on_states||[]).join(", "),h.type==="compound"?(this._compoundLogic=h.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(h.conditions||[]).map(Os)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._requireTagScan=!1,this._allowSkip=!0,this._readingUnit="",this._readings=[],this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._phaseDefs=[],this._phaseSeq=[],this._requiredCompletion=[],this._scheduleTime="",this._scheduleTimeOn=!1,this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._adaptiveEnabled=!1,this._adaptiveAlpha=re.alpha,this._adaptiveMin=re.min,this._adaptiveMax=re.max,this._adaptiveSeasonal=!0,this._adaptivePrediction=!0,this._adaptiveInitial=this._adaptiveSnapshot(),this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute="",this._suggestedAttributes
Line truncated
|
`),partId:j?.part_id||"",partQty:j?.quantity!=null?String(j.quantity):"",reqOverride:m.required_completion_fields!==void 0,reqFields:[...m.required_completion_fields||[]],extraParts:M.filter((Y,oe)=>oe!==F).map(Y=>({...Y})),carry:T}}),this._phaseSeq=[...t.phase_sequence||[]],this._requiredCompletion=[...t.required_completion_fields||[]],this._scheduleTime=t.schedule_time||"",this._scheduleTimeOn=!!t.schedule_time;let o=t.on_complete_action;if(o&&o.service){this._actionService=o.service;let h=o.target?.entity_id;this._actionTargetEntity=Array.isArray(h)?h[0]||"":h||"",this._actionData=o.data&&typeof o.data=="object"?{...o.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let p=t.quick_complete_defaults;this._qcNotes=p?.notes||"",this._qcCost=p?.cost!=null?String(p.cost):"",this._qcDuration=p?.duration!=null?String(p.duration):"",this._qcFeedback=p?.feedback||"";let c=t.adaptive_config||{};if(this._environmentalEntity=c.environmental_entity||"",this._environmentalAttribute=c.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,this._adaptiveEnabled=!!c.enabled,this._adaptiveAlpha=c.ewa_alpha?.toString()??re.alpha,this._adaptiveMin=c.min_interval_days?.toString()??re.min,this._adaptiveMax=c.max_interval_days?.toString()??re.max,this._adaptiveSeasonal=c.seasonal_enabled!==!1,this._adaptivePrediction=c.sensor_prediction_enabled!==!1,this._adaptiveInitial=this._adaptiveSnapshot(),t.trigger_config){let h=t.trigger_config;this._triggerEntityId=h.entity_id||h.entity_ids&&h.entity_ids[0]||"",this._triggerEntityIds=h.entity_ids||(h.entity_id?[h.entity_id]:[]),this._triggerEntityLogic=h.entity_logic||"any",this._triggerAttribute=h.attribute||"",this._triggerType=h.type||"threshold",this._triggerAbove=h.trigger_above?.toString()||"",this._triggerBelow=h.trigger_below?.toString()||"",this._triggerEquals=h.trigger_equals?.toString()||"",this._triggerNotEquals=h.trigger_not_equals?.toString()||"",this._triggerForMinutes=h.trigger_for_minutes?.toString()||"0",this._triggerCombinator=h.trigger_combinator==="all"?"all":"any",this._triggerTargetValue=h.trigger_target_value?.toString()||"",this._triggerDeltaMode=h.trigger_delta_mode||!1,this._triggerBaselineValue=h.trigger_baseline_value?.toString()||"",this._liveBaselineValue=t.trigger_baseline_value??null,this._autoCompleteOnRecovery=h.auto_complete_on_recovery||!1,this._triggerFromState=h.trigger_from_state||"",this._triggerToState=h.trigger_to_state||"",this._triggerTargetChanges=h.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=h.trigger_runtime_hours?.toString()||"",this._triggerRuntimeMaxSession=h.trigger_runtime_max_session_seconds?.toString()||"",this._triggerOnStates=(h.trigger_on_states||[]).join(", "),h.type==="compound"?(this._compoundLogic=h.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(h.conditions||[]).map(Us)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._requireTagScan=!1,this._allowSkip=!0,this._readingUnit="",this._readings=[],this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._phaseDefs=[],this._phaseSeq=[],this._requiredCompletion=[],this._scheduleTime="",this._scheduleTimeOn=!1,this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._adaptiveEnabled=!1,this._adaptiveAlpha=re.alpha,this._adaptiveMin=re.min,this._adaptiveMax=re.max,this._adaptiveSeasonal=!0,this._adaptivePrediction=!0,this._adaptiveInitial=this._adaptiveSnapshot(),this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute="",this._suggestedAttributes
Line truncated
|
||||||
<details class="ca-section">
|
<details class="ca-section">
|
||||||
<summary>${n("on_complete_action_title",e)}</summary>
|
<summary>${n("on_complete_action_title",e)}</summary>
|
||||||
<p class="field-help">${n("on_complete_action_desc",e)}</p>
|
<p class="field-help">${n("on_complete_action_desc",e)}</p>
|
||||||
@@ -1605,7 +1629,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<option value="not_needed">${n("quick_complete_defaults_feedback_not_needed",e)}</option>
|
<option value="not_needed">${n("quick_complete_defaults_feedback_not_needed",e)}</option>
|
||||||
</select>
|
</select>
|
||||||
</details>
|
</details>
|
||||||
`}async _loadParts(){if(this.parts=[],!!this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this.parts=e.parts||[],this._partsLoadFailed=!1}catch{this.parts=[],this._partsLoadFailed=!0}}async _loadForeignPools(){if(this._foreignOwners=[],!!this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects"});this._foreignOwners=(e.objects||[]).filter(t=>t.entry_id!==this._entryId&&(t.parts||[]).length>0).map(t=>({entry_id:t.entry_id,name:t.object?.name||t.entry_id,parts:t.parts||[]})).sort((t,i)=>t.name.localeCompare(i.name))}catch{this._foreignOwners=[]}}async _loadTags(){try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tags/list"});this._availableTags=e.tags||[]}catch{this._availableTags=[]}}_fetchConditionAttributes(e){!e||!this.hass||this._conditionAttrOptions[e]||this._conditionAttrPending.has(e)||(this._conditionAttrPending.add(e),this.hass.connection.sendMessagePromise({type:"maintenance_supporter/entity/attributes",entity_id:e}).then(t=>{let i=t;this._conditionAttrOptions={...this._conditionAttrOptions,[e]:{suggested:i.suggested_attributes||[],available:i.available_attributes||[]}}}).catch(()=>{this._conditionAttrOptions={...this._conditionAttrOptions,[e]:{suggested:[],available:[]}}}))}async _fetchEntityAttributes(e){if(!e||!this.hass){this._suggestedAttributes=[],this._availableAttributes=[],this._entityDomain="";return}try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/entity/attributes",entity_id:e});this._entityDomain=t.domain||"",this._suggestedAttributes=t.suggested_attributes||[],this._availableAttributes=t.available_attributes||[]}catch{this._suggestedAttributes=[],this._availableAttributes=[],this._entityDomain=""}}get _hasForeignPick(){return Object.values(this._consumesParts).some(e=>!!e.entry_id)}_renderConsumesRow(e,t){let i=G({part_id:e.id,entry_id:t}),a=this._consumesParts[i],o=t?{part_id:e.id,quantity:1,entry_id:t}:{part_id:e.id,quantity:1};return l`
|
`}async _loadParts(){if(this.parts=[],!!this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this.parts=e.parts||[],this._partsLoadFailed=!1}catch{this.parts=[],this._partsLoadFailed=!0}}async _loadForeignPools(){if(this._foreignOwners=[],!!this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects"});this._foreignOwners=(e.objects||[]).filter(t=>t.entry_id!==this._entryId&&(t.parts||[]).length>0).map(t=>({entry_id:t.entry_id,name:t.object?.name||t.entry_id,parts:t.parts||[]})).sort((t,i)=>t.name.localeCompare(i.name))}catch{this._foreignOwners=[]}}async _loadTags(){try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tags/list"});this._availableTags=e.tags||[]}catch{this._availableTags=[]}}_fetchConditionAttributes(e){!e||!this.hass||this._conditionAttrOptions[e]||this._conditionAttrPending.has(e)||(this._conditionAttrPending.add(e),this.hass.connection.sendMessagePromise({type:"maintenance_supporter/entity/attributes",entity_id:e}).then(t=>{let i=t;this._conditionAttrOptions={...this._conditionAttrOptions,[e]:{suggested:i.suggested_attributes||[],available:i.available_attributes||[]}}}).catch(()=>{this._conditionAttrOptions={...this._conditionAttrOptions,[e]:{suggested:[],available:[]}}}))}async _fetchEntityAttributes(e){if(!e||!this.hass){this._suggestedAttributes=[],this._availableAttributes=[],this._entityDomain="";return}try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/entity/attributes",entity_id:e});this._entityDomain=t.domain||"",this._suggestedAttributes=t.suggested_attributes||[],this._availableAttributes=t.available_attributes||[]}catch{this._suggestedAttributes=[],this._availableAttributes=[],this._entityDomain=""}}get _hasForeignPick(){return Object.values(this._consumesParts).some(e=>!!e.entry_id)}_renderConsumesRow(e,t){let i=Q({part_id:e.id,entry_id:t}),a=this._consumesParts[i],o=t?{part_id:e.id,quantity:1,entry_id:t}:{part_id:e.id,quantity:1};return l`
|
||||||
<div class="consumes-row">
|
<div class="consumes-row">
|
||||||
<label class="consumes-check">
|
<label class="consumes-check">
|
||||||
<input
|
<input
|
||||||
@@ -1625,7 +1649,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
@input=${p=>{let c=parseFloat(p.target.value);this._consumesParts={...this._consumesParts,[i]:{...o,quantity:Number.isFinite(c)&&c>=.01?c:1}}}}
|
@input=${p=>{let c=parseFloat(p.target.value);this._consumesParts={...this._consumesParts,[i]:{...o,quantity:Number.isFinite(c)&&c>=.01?c:1}}}}
|
||||||
/>`:_}
|
/>`:_}
|
||||||
</div>
|
</div>
|
||||||
`}_toggleRequired(e,t){let i=new Set(this._requiredCompletion);t?i.add(e):i.delete(e),this._requiredCompletion=[...i]}_patchReading(e,t){this._readings=this._readings.map(i=>i.id===e?{...i,...t}:i)}_renderReadingsEditor(e){let t=Ji(this._readings);return l`
|
`}_toggleRequired(e,t){let i=new Set(this._requiredCompletion);t?i.add(e):i.delete(e),this._requiredCompletion=[...i]}_patchReading(e,t){this._readings=this._readings.map(i=>i.id===e?{...i,...t}:i)}_renderReadingsEditor(e){let t=Zi(this._readings);return l`
|
||||||
<div class="readings-editor">
|
<div class="readings-editor">
|
||||||
<div class="field-label">${n("readings_section",e)}</div>
|
<div class="field-label">${n("readings_section",e)}</div>
|
||||||
<div class="field-help">${n("readings_hint",e)}</div>
|
<div class="field-help">${n("readings_hint",e)}</div>
|
||||||
@@ -1651,7 +1675,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
`)}
|
`)}
|
||||||
${this._readings.length<20?l`
|
${this._readings.length<20?l`
|
||||||
<ha-button appearance="plain" class="reading-add"
|
<ha-button appearance="plain" class="reading-add"
|
||||||
@click=${()=>this._readings=[...this._readings,{id:Wi(),name:"",unit:this._readings.length?this._readings[this._readings.length-1].unit:this._readingUnit}]}>
|
@click=${()=>this._readings=[...this._readings,{id:Ki(),name:"",unit:this._readings.length?this._readings[this._readings.length-1].unit:this._readingUnit}]}>
|
||||||
<ha-icon icon="mdi:plus"></ha-icon> ${n("reading_add",e)}
|
<ha-icon icon="mdi:plus"></ha-icon> ${n("reading_add",e)}
|
||||||
</ha-button>`:_}
|
</ha-button>`:_}
|
||||||
</div>
|
</div>
|
||||||
@@ -1703,14 +1727,14 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
</label>
|
</label>
|
||||||
${i.reqOverride?l`
|
${i.reqOverride?l`
|
||||||
<div class="required-completion phase-req-fields">
|
<div class="required-completion phase-req-fields">
|
||||||
${Rt.map(a=>l`
|
${Nt.map(a=>l`
|
||||||
<label class="req-option">
|
<label class="req-option">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
.checked=${i.reqFields.includes(a)}
|
.checked=${i.reqFields.includes(a)}
|
||||||
@change=${o=>{let p=o.target.checked,c=new Set(i.reqFields);p?c.add(a):c.delete(a),this._patchPhaseDef(i.id,{reqFields:[...c]})}}
|
@change=${o=>{let p=o.target.checked,c=new Set(i.reqFields);p?c.add(a):c.delete(a),this._patchPhaseDef(i.id,{reqFields:[...c]})}}
|
||||||
/>
|
/>
|
||||||
<span>${n(Ke[a],e)}</span>
|
<span>${n(Ge[a],e)}</span>
|
||||||
</label>
|
</label>
|
||||||
`)}
|
`)}
|
||||||
</div>
|
</div>
|
||||||
@@ -1739,8 +1763,8 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
`:_}
|
`:_}
|
||||||
`}async _save(){if(!this._loading&&this._name.trim()){if(this._adaptiveSnapshot()!==this._adaptiveInitial){let e=parseInt(this._adaptiveMin,10),t=parseInt(this._adaptiveMax,10);if(!isNaN(e)&&!isNaN(t)&&e>t){this._error=`${n("adaptive_min_interval",this._lang)} > ${n("adaptive_max_interval",this._lang)}`;return}}if(this._triggerType==="threshold"&&this._thresholdLimitsOverlap()){this._error=n("trigger_hint_overlap",this._lang);return}this._loading=!0,this._error="";try{let e={type:this._taskId?"maintenance_supporter/task/update":"maintenance_supporter/task/create",entry_id:this._entryId,name:this._name,task_type:this._type,schedule_type:this._scheduleType,warning_days:Number.isNaN(parseInt(this._warningDays,10))?this.defaultWarningDays:Math.max(0,parseInt(this._warningDays,10))},t=this._earliestCompletionDays.trim();e.earliest_completion_days=t===""?null:Math.max(0,parseInt(t,10)||0),this._taskId&&(e.task_id=this._taskId),this._scheduleType==="one_time"?(e.due_date=this._dueDate||null,e.interval_days=null):dt.includes(this._scheduleType)?(e.schedule={...this._buildSchedule(),...this._recurrenceExtras()},e.interval_days=null,this._taskId&&(e.due_date=null)):(this._taskId&&(e.due_date=null),this._scheduleType!=="manual"&&this._intervalDays?(e.interval_days=parseInt(this._intervalDays,10),e.interval_unit=this._intervalUnit,e.interval_anchor=this._intervalAnchor,this._scheduleType==="time_based"&&(e.schedule={kind:"interval",...this._recurrenceExtras()})):this._taskId&&(e.interval_days=null,e.interval_anchor="completion")),e.notes=this._notes||null,e.documentation_url=this._documentationUrl||null,e.custom_icon=this._customIcon||null,e.priority=this._priority,e.labels=this._labels.split(",").map(p=>p.trim()).filter(Boolean),e.enabled=this._enabled,e.last_performed=this._lastPerformed||null,e.nfc_tag_id=this._nfcTagId||null,e.require_tag_scan=this._requireTagScan,e.allow_skip=this._allowSkip,e.reading_unit=this._readingUnit.trim()||null,e.readings=Zi(this._readings);{let p={};for(let h of this._phaseDefs){if(!h.name.trim())continue;let m={...h.carry,name:h.name.trim()},f=h.checklistText.split(`
|
`}async _save(){if(!this._loading&&this._name.trim()){if(this._adaptiveSnapshot()!==this._adaptiveInitial){let e=parseInt(this._adaptiveMin,10),t=parseInt(this._adaptiveMax,10);if(!isNaN(e)&&!isNaN(t)&&e>t){this._error=`${n("adaptive_min_interval",this._lang)} > ${n("adaptive_max_interval",this._lang)}`;return}}if(this._triggerType==="threshold"&&this._thresholdLimitsOverlap()){this._error=n("trigger_hint_overlap",this._lang);return}this._loading=!0,this._error="";try{let e={type:this._taskId?"maintenance_supporter/task/update":"maintenance_supporter/task/create",entry_id:this._entryId,name:this._name,task_type:this._type,schedule_type:this._scheduleType,warning_days:Number.isNaN(parseInt(this._warningDays,10))?this.defaultWarningDays:Math.max(0,parseInt(this._warningDays,10))},t=this._earliestCompletionDays.trim();e.earliest_completion_days=t===""?null:Math.max(0,parseInt(t,10)||0),this._taskId&&(e.task_id=this._taskId),this._scheduleType==="one_time"?(e.due_date=this._dueDate||null,e.interval_days=null):ct.includes(this._scheduleType)?(e.schedule={...this._buildSchedule(),...this._recurrenceExtras()},e.interval_days=null,this._taskId&&(e.due_date=null)):(this._taskId&&(e.due_date=null),this._scheduleType!=="manual"&&this._intervalDays?(e.interval_days=parseInt(this._intervalDays,10),e.interval_unit=this._intervalUnit,e.interval_anchor=this._intervalAnchor,this._scheduleType==="time_based"&&(e.schedule={kind:"interval",...this._recurrenceExtras()})):this._taskId&&(e.interval_days=null,e.interval_anchor="completion")),e.notes=this._notes||null,e.documentation_url=this._documentationUrl||null,e.custom_icon=this._customIcon||null,e.priority=this._priority,e.labels=this._labels.split(",").map(p=>p.trim()).filter(Boolean),e.enabled=this._enabled,e.last_performed=this._lastPerformed||null,e.nfc_tag_id=this._nfcTagId||null,e.require_tag_scan=this._requireTagScan,e.allow_skip=this._allowSkip,e.notify_enabled=this._notifyEnabled,e.reading_unit=this._readingUnit.trim()||null,e.readings=Xi(this._readings);{let p={};for(let h of this._phaseDefs){if(!h.name.trim())continue;let m={...h.carry,name:h.name.trim()},f=h.checklistText.split(`
|
||||||
`).map(v=>v.trim()).filter(Boolean);f.length&&(m.checklist=f);let x=[];if(h.partId){let v=parseFloat(h.partQty);x.push({part_id:h.partId,quantity:Number.isFinite(v)&&v>0?v:1})}for(let v of h.extraParts)x.push(v.entry_id?{part_id:v.part_id,quantity:v.quantity,entry_id:v.entry_id}:{part_id:v.part_id,quantity:v.quantity});x.length&&(m.consumes_parts=x),h.reqOverride&&(m.required_completion_fields=[...h.reqFields]),p[h.id]=m}let c=this._phaseSeq.filter(h=>h in p);e.phases=Object.keys(p).length&&c.length?p:null,e.phase_sequence=e.phases?c:null}if((this.parts.length||this._foreignOwners.length)&&(e.consumes_parts=Object.values(this._consumesParts).map(p=>p.entry_id?{part_id:p.part_id,quantity:p.quantity,entry_id:p.entry_id}:{part_id:p.part_id,quantity:p.quantity})),e.responsible_user_id=this._responsibleUserId,e.assignee_pool=this._assigneePool,e.required_completion_fields=this._requiredCompletion,e.rotation_strategy=this._assigneePool.length>=2&&this._rotationStrategy?this._rotationStrategy:null,this._scheduleType==="sensor_based"&&this._triggerType==="compound"){let p=this._compoundConditions.map(Ds).filter(c=>c!==null);if(p.length>0){let c={type:"compound",compound_logic:this._compoundLogic,conditions:p};this._autoCompleteOnRecovery&&(c.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(c.trigger_combinator="all"),e.trigger_config=c}else this._taskId&&(e.trigger_config=null)}else if(this._scheduleType==="sensor_based"&&this._triggerEntityId){let p=this._triggerEntityIds.length>0?this._triggerEntityIds:[this._triggerEntityId],c={entity_id:p[0],entity_ids:p,type:this._triggerType};if(this._triggerAttribute&&(c.attribute=this._triggerAttribute),this._autoCompleteOnRecovery&&(c.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(c.trigger_combinator="all"),p.length>1&&(c.entity_logic=this._triggerEntityLogic),this._triggerType==="threshold"){if(this._triggerAbove){let h=parseFloat(this._triggerAbove);isNaN(h)||(c.trigger_above=h)}if(this._triggerBelow){let h=parseFloat(this._triggerBelow);isNaN(h)||(c.trigger_below=h)}if(this._triggerEquals){let h=parseFloat(this._triggerEquals);isNaN(h)||(c.trigger_equals=h)}if(this._triggerNotEquals){let h=parseFloat(this._triggerNotEquals);isNaN(h)||(c.trigger_not_equals=h)}if(this._triggerForMinutes){let h=parseInt(this._triggerForMinutes,10);isNaN(h)||(c.trigger_for_minutes=h)}}else if(this._triggerType==="counter"){if(this._triggerTargetValue){let h=parseFloat(this._triggerTargetValue);isNaN(h)||(c.trigger_target_value=h)}if(c.trigger_delta_mode=this._triggerDeltaMode,this._triggerDeltaMode&&this._triggerBaselineValue){let h=parseFloat(this._triggerBaselineValue);!isNaN(h)&&h>=0&&(c.trigger_baseline_value=h)}}else if(this._triggerType==="state_change"){if(this._triggerFromState&&(c.trigger_from_state=this._triggerFromState),this._triggerToState&&(c.trigger_to_state=this._triggerToState),this._triggerTargetChanges){let h=parseInt(this._triggerTargetChanges,10);isNaN(h)||(c.trigger_target_changes=h)}if(this._triggerForMinutes){let h=parseInt(this._triggerForMinutes,10);isNaN(h)||(c.trigger_for_minutes=h)}}else if(this._triggerType==="runtime"){if(this._triggerRuntimeHours){let m=parseFloat(this._triggerRuntimeHours);isNaN(m)||(c.trigger_runtime_hours=m)}if(this._triggerRuntimeMaxSession){let m=parseInt(this._triggerRuntimeMaxSession,10);!isNaN(m)&&m>0&&(c.trigger_runtime_max_session_seconds=m)}let h=this._triggerOnStates.split(",").map(m=>m.trim()).filter(Boolean);h.length>0&&(c.trigger_on_states=h)}e.trigger_config=c}else this._taskId&&(e.trigger_config=null);if(this.scheduleTimeEnabled&&cr.includes(this._scheduleType)){let p=this._scheduleTimeOn?this._scheduleTime.trim():"";e.schedule_time=/^([01]\d|2[0-3]):[0-5]\d$/.test(p)?p:null}if(this.checklistsEnabled){let p=this._checklistText.split(`
|
`).map(v=>v.trim()).filter(Boolean);f.length&&(m.checklist=f);let x=[];if(h.partId){let v=parseFloat(h.partQty);x.push({part_id:h.partId,quantity:Number.isFinite(v)&&v>0?v:1})}for(let v of h.extraParts)x.push(v.entry_id?{part_id:v.part_id,quantity:v.quantity,entry_id:v.entry_id}:{part_id:v.part_id,quantity:v.quantity});x.length&&(m.consumes_parts=x),h.reqOverride&&(m.required_completion_fields=[...h.reqFields]),p[h.id]=m}let c=this._phaseSeq.filter(h=>h in p);e.phases=Object.keys(p).length&&c.length?p:null,e.phase_sequence=e.phases?c:null}if((this.parts.length||this._foreignOwners.length)&&(e.consumes_parts=Object.values(this._consumesParts).map(p=>p.entry_id?{part_id:p.part_id,quantity:p.quantity,entry_id:p.entry_id}:{part_id:p.part_id,quantity:p.quantity})),e.responsible_user_id=this._responsibleUserId,e.assignee_pool=this._assigneePool,e.required_completion_fields=this._requiredCompletion,e.rotation_strategy=this._assigneePool.length>=2&&this._rotationStrategy?this._rotationStrategy:null,this._scheduleType==="sensor_based"&&this._triggerType==="compound"){let p=this._compoundConditions.map(Fs).filter(c=>c!==null);if(p.length>0){let c={type:"compound",compound_logic:this._compoundLogic,conditions:p};this._autoCompleteOnRecovery&&(c.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(c.trigger_combinator="all"),e.trigger_config=c}else this._taskId&&(e.trigger_config=null)}else if(this._scheduleType==="sensor_based"&&this._triggerEntityId){let p=this._triggerEntityIds.length>0?this._triggerEntityIds:[this._triggerEntityId],c={entity_id:p[0],entity_ids:p,type:this._triggerType};if(this._triggerAttribute&&(c.attribute=this._triggerAttribute),this._autoCompleteOnRecovery&&(c.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(c.trigger_combinator="all"),p.length>1&&(c.entity_logic=this._triggerEntityLogic),this._triggerType==="threshold"){if(this._triggerAbove){let h=parseFloat(this._triggerAbove);isNaN(h)||(c.trigger_above=h)}if(this._triggerBelow){let h=parseFloat(this._triggerBelow);isNaN(h)||(c.trigger_below=h)}if(this._triggerEquals){let h=parseFloat(this._triggerEquals);isNaN(h)||(c.trigger_equals=h)}if(this._triggerNotEquals){let h=parseFloat(this._triggerNotEquals);isNaN(h)||(c.trigger_not_equals=h)}if(this._triggerForMinutes){let h=parseInt(this._triggerForMinutes,10);isNaN(h)||(c.trigger_for_minutes=h)}}else if(this._triggerType==="counter"){if(this._triggerTargetValue){let h=parseFloat(this._triggerTargetValue);isNaN(h)||(c.trigger_target_value=h)}if(c.trigger_delta_mode=this._triggerDeltaMode,this._triggerDeltaMode&&this._triggerBaselineValue){let h=parseFloat(this._triggerBaselineValue);!isNaN(h)&&h>=0&&(c.trigger_baseline_value=h)}}else if(this._triggerType==="state_change"){if(this._triggerFromState&&(c.trigger_from_state=this._triggerFromState),this._triggerToState&&(c.trigger_to_state=this._triggerToState),this._triggerTargetChanges){let h=parseInt(this._triggerTargetChanges,10);isNaN(h)||(c.trigger_target_changes=h)}if(this._triggerForMinutes){let h=parseInt(this._triggerForMinutes,10);isNaN(h)||(c.trigger_for_minutes=h)}}else if(this._triggerType==="runtime"){if(this._triggerRuntimeHours){let m=parseFloat(this._triggerRuntimeHours);isNaN(m)||(c.trigger_runtime_hours=m)}if(this._triggerRuntimeMaxSession){let m=parseInt(this._triggerRuntimeMaxSession,10);!isNaN(m)&&m>0&&(c.trigger_runtime_max_session_seconds=m)}let h=this._triggerOnStates.split(",").map(m=>m.trim()).filter(Boolean);h.length>0&&(c.trigger_on_states=h)}e.trigger_config=c}else this._taskId&&(e.trigger_config=null);if(this.scheduleTimeEnabled&&ur.includes(this._scheduleType)){let p=this._scheduleTimeOn?this._scheduleTime.trim():"";e.schedule_time=/^([01]\d|2[0-3]):[0-5]\d$/.test(p)?p:null}if(this.checklistsEnabled){let p=this._checklistText.split(`
|
||||||
`).map(c=>c.trim()).filter(Boolean).slice(0,100);e.checklist=p.length?p:null}if(this.completionActionsEnabled){let p=this._actionService.trim();if(p&&/^[a-z][a-z0-9_]*\.[a-z0-9_]+$/.test(p)){let f={service:p},x=this._actionTargetEntity.trim();x&&(f.target={entity_id:x});let v=this._buildActionData();Object.keys(v).length>0&&(f.data=v),e.on_complete_action=f}else e.on_complete_action=null;let c={};this._qcNotes.trim()&&(c.notes=this._qcNotes.trim());let h=parseFloat(this._qcCost);!isNaN(h)&&h>=0&&(c.cost=h);let m=parseInt(this._qcDuration,10);!isNaN(m)&&m>=0&&(c.duration=m),this._qcFeedback&&(c.feedback=this._qcFeedback),e.quick_complete_defaults=Object.keys(c).length?c:null}let i=await this.hass.connection.sendMessagePromise(e),a=this._taskId||i?.task_id,o=this._environmentalEntity!==this._environmentalInitial||this._environmentalAttribute!==this._environmentalAttributeInitial;if(a&&this._scheduleType==="sensor_based"&&o)try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_environmental_entity",entry_id:this._entryId,task_id:a,environmental_entity:this._environmentalEntity||null,environmental_attribute:this._environmentalAttribute||null}),this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute}catch{}if(a&&this._adaptiveSnapshot()!==this._adaptiveInitial){let p=parseFloat(this._adaptiveAlpha),c=parseInt(this._adaptiveMin,10),h=parseInt(this._adaptiveMax,10);try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_adaptive",entry_id:this._entryId,task_id:a,enabled:this._adaptiveEnabled,...p>=.1&&p<=.9?{ewa_alpha:p}:{},...!isNaN(c)&&c>=1?{min_interval_days:c}:{},...!isNaN(h)&&h>=1?{max_interval_days:h}:{},seasonal_enabled:this._adaptiveSeasonal,sensor_prediction_enabled:this._adaptivePrediction}),this._adaptiveInitial=this._adaptiveSnapshot()}catch{}}this._open=!1,this.dispatchEvent(new CustomEvent("task-saved"))}catch(e){this._error=O(e,this._lang,n("save_error",this._lang))}finally{this._loading=!1}}}_close(){this._open=!1,this._pickerProbeTimer!==void 0&&(clearTimeout(this._pickerProbeTimer),this._pickerProbeTimer=void 0),this._pickerProbeStrikes=0}_renderTriggerFields(){if(this._scheduleType!=="sensor_based")return _;let e=this._lang,t=this._triggerType==="compound";return l`
|
`).map(c=>c.trim()).filter(Boolean).slice(0,100);e.checklist=p.length?p:null}if(this.completionActionsEnabled){let p=this._actionService.trim();if(p&&/^[a-z][a-z0-9_]*\.[a-z0-9_]+$/.test(p)){let f={service:p},x=this._actionTargetEntity.trim();x&&(f.target={entity_id:x});let v=this._buildActionData();Object.keys(v).length>0&&(f.data=v),e.on_complete_action=f}else e.on_complete_action=null;let c={};this._qcNotes.trim()&&(c.notes=this._qcNotes.trim());let h=parseFloat(this._qcCost);!isNaN(h)&&h>=0&&(c.cost=h);let m=parseInt(this._qcDuration,10);!isNaN(m)&&m>=0&&(c.duration=m),this._qcFeedback&&(c.feedback=this._qcFeedback),e.quick_complete_defaults=Object.keys(c).length?c:null}let i=await this.hass.connection.sendMessagePromise(e),a=this._taskId||i?.task_id,o=this._environmentalEntity!==this._environmentalInitial||this._environmentalAttribute!==this._environmentalAttributeInitial;if(a&&this._scheduleType==="sensor_based"&&o)try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_environmental_entity",entry_id:this._entryId,task_id:a,environmental_entity:this._environmentalEntity||null,environmental_attribute:this._environmentalAttribute||null}),this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute}catch{}if(a&&this._adaptiveSnapshot()!==this._adaptiveInitial){let p=parseFloat(this._adaptiveAlpha),c=parseInt(this._adaptiveMin,10),h=parseInt(this._adaptiveMax,10);try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_adaptive",entry_id:this._entryId,task_id:a,enabled:this._adaptiveEnabled,...p>=.1&&p<=.9?{ewa_alpha:p}:{},...!isNaN(c)&&c>=1?{min_interval_days:c}:{},...!isNaN(h)&&h>=1?{max_interval_days:h}:{},seasonal_enabled:this._adaptiveSeasonal,sensor_prediction_enabled:this._adaptivePrediction}),this._adaptiveInitial=this._adaptiveSnapshot()}catch{}}this._open=!1,this.dispatchEvent(new CustomEvent("task-saved"))}catch(e){this._error=O(e,this._lang,n("save_error",this._lang))}finally{this._loading=!1}}}_close(){this._open=!1,this._pickerProbeTimer!==void 0&&(clearTimeout(this._pickerProbeTimer),this._pickerProbeTimer=void 0),this._pickerProbeStrikes=0}_renderTriggerFields(){if(this._scheduleType!=="sensor_based")return _;let e=this._lang,t=this._triggerType==="compound";return l`
|
||||||
<h3>${n("trigger_configuration",e)}</h3>
|
<h3>${n("trigger_configuration",e)}</h3>
|
||||||
<div class="select-row">
|
<div class="select-row">
|
||||||
@@ -1749,7 +1773,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._triggerType}
|
.value=${this._triggerType}
|
||||||
@change=${i=>this._triggerType=i.target.value}
|
@change=${i=>this._triggerType=i.target.value}
|
||||||
>
|
>
|
||||||
${Ns.map(i=>l`<option value=${i} ?selected=${i===this._triggerType}>${n(i,e)}</option>`)}
|
${Ds.map(i=>l`<option value=${i} ?selected=${i===this._triggerType}>${n(i,e)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
${t?this._renderCompoundEditor():l`
|
${t?this._renderCompoundEditor():l`
|
||||||
@@ -1763,7 +1787,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<ha-form
|
<ha-form
|
||||||
class="entity-picker-form"
|
class="entity-picker-form"
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.schema=${[{name:"trigger_entities",selector:{entity:{multiple:!0,domain:Lt}}}]}
|
.schema=${[{name:"trigger_entities",selector:{entity:{multiple:!0,domain:Rt}}}]}
|
||||||
.data=${{trigger_entities:this._triggerEntityIds.length>0?this._triggerEntityIds:this._triggerEntityId?[this._triggerEntityId]:[]}}
|
.data=${{trigger_entities:this._triggerEntityIds.length>0?this._triggerEntityIds:this._triggerEntityId?[this._triggerEntityId]:[]}}
|
||||||
.computeLabel=${()=>n("entity_id",e)}
|
.computeLabel=${()=>n("entity_id",e)}
|
||||||
@value-changed=${i=>{let a=(i.detail.value.trigger_entities||[]).filter(Boolean);this._triggerEntityId=a[0]||"",this._triggerEntityIds=a,a[0]?this._fetchEntityAttributes(a[0]):this._fetchEntityAttributes("")}}
|
@value-changed=${i=>{let a=(i.detail.value.trigger_entities||[]).filter(Boolean);this._triggerEntityId=a[0]||"",this._triggerEntityIds=a,a[0]?this._fetchEntityAttributes(a[0]):this._fetchEntityAttributes("")}}
|
||||||
@@ -1811,7 +1835,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
`:_}
|
`:_}
|
||||||
`}_patchCondition(e,t){this._compoundConditions=this._compoundConditions.map((i,a)=>a===e?{...i,...t}:i)}_addCondition(){this._compoundConditions=[...this._compoundConditions,js()]}_removeCondition(e){this._compoundConditions=this._compoundConditions.filter((t,i)=>i!==e)}_renderCompoundEditor(){let e=this._lang;return l`
|
`}_patchCondition(e,t){this._compoundConditions=this._compoundConditions.map((i,a)=>a===e?{...i,...t}:i)}_addCondition(){this._compoundConditions=[...this._compoundConditions,Ms()]}_removeCondition(e){this._compoundConditions=this._compoundConditions.filter((t,i)=>i!==e)}_renderCompoundEditor(){let e=this._lang;return l`
|
||||||
<div class="select-row">
|
<div class="select-row">
|
||||||
<label>${n("compound_logic",e)}</label>
|
<label>${n("compound_logic",e)}</label>
|
||||||
<select
|
<select
|
||||||
@@ -1848,7 +1872,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<ha-form
|
<ha-form
|
||||||
class="entity-picker-form"
|
class="entity-picker-form"
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.schema=${[{name:"condition_entities",selector:{entity:{multiple:!0,domain:Lt}}}]}
|
.schema=${[{name:"condition_entities",selector:{entity:{multiple:!0,domain:Rt}}}]}
|
||||||
.data=${{condition_entities:e.entityIds.split(",").map(o=>o.trim()).filter(Boolean)}}
|
.data=${{condition_entities:e.entityIds.split(",").map(o=>o.trim()).filter(Boolean)}}
|
||||||
.computeLabel=${()=>n("entity_id",i)}
|
.computeLabel=${()=>n("entity_id",i)}
|
||||||
@value-changed=${o=>{let p=(o.detail.value.condition_entities||[]).filter(Boolean);this._patchCondition(t,{entityIds:p.join(", ")})}}
|
@value-changed=${o=>{let p=(o.detail.value.condition_entities||[]).filter(Boolean);this._patchCondition(t,{entityIds:p.join(", ")})}}
|
||||||
@@ -1860,7 +1884,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${e.type}
|
.value=${e.type}
|
||||||
@change=${o=>this._patchCondition(t,{type:o.target.value})}
|
@change=${o=>this._patchCondition(t,{type:o.target.value})}
|
||||||
>
|
>
|
||||||
${pr.map(o=>l`<option value=${o} ?selected=${o===e.type}>${n(o,i)}</option>`)}
|
${_r.map(o=>l`<option value=${o} ?selected=${o===e.type}>${n(o,i)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
${this._renderConditionTypeFields(e,t)}
|
${this._renderConditionTypeFields(e,t)}
|
||||||
@@ -2004,12 +2028,12 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
>
|
>
|
||||||
${["days","weeks","months","years"].map(t=>l`<option value=${t} ?selected=${t===this._intervalUnit}>${n("unit_"+t,e)}</option>`)}
|
${["days","weeks","months","years"].map(t=>l`<option value=${t} ?selected=${t===this._intervalUnit}>${n("unit_"+t,e)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>`}_toggleWeekday(e){this._weekdays=this._weekdays.includes(e)?this._weekdays.filter(t=>t!==e):[...this._weekdays,e]}_previewScheduleDict(){if(this._scheduleType==="one_time")return this._dueDate?{kind:"one_time",due_date:this._dueDate}:null;if(dt.includes(this._scheduleType))return{...this._buildSchedule(),...this._recurrenceExtras()};let e=parseInt(this._intervalDays,10);return this._scheduleType==="manual"||!e||e<=0?null:{kind:"interval",every:e,unit:this._intervalUnit,anchor:this._intervalAnchor,...this._recurrenceExtras()}}updated(e){super.updated?.(e),this._scheduleEntityPickerProbe();for(let t of e.keys())if(g._PREVIEW_RELEVANT.has(String(t))){this._schedulePreviewRefresh();return}}_scheduleEntityPickerProbe(){this._entityPickerFallback||this._pickerProbeTimer!==void 0||!this._open||this._scheduleType!=="sensor_based"||(this._pickerProbeTimer=setTimeout(()=>this._probeEntityPickers(),1500))}_probeEntityPickers(){if(this._pickerProbeTimer=void 0,this._entityPickerFallback||!this._open)return;let e=this.shadowRoot?.querySelector("ha-form.entity-picker-form"),t=(this.shadowRoot?.querySelector(".content")?.offsetHeight??0)>0;if(!e||!t){this._pickerProbeStrikes=0;return}let i=(c,h,m=0)=>{if(!(!c||m>10)){(c.tagName?.toLowerCase()??"")==="ha-entity-picker"&&h.push(c);for(let f of[c.shadowRoot,c])if(f)for(let x of Array.from(f.children??[]))i(x,h,m+1)}},a=[...this.shadowRoot?.querySelectorAll("ha-form.entity-picker-form")??[]],o=[];for(let c of a)i(c,o);let p=o.length===0||o.some(c=>c.offsetHeight===0);if(e.offsetHeight===0||p){if(this._pickerProbeStrikes+=1,this._pickerProbeStrikes>=2){this._entityPickerFallback=!0;return}this._pickerProbeTimer=setTimeout(()=>this._probeEntityPickers(),700)}else this._pickerProbeStrikes=0}_schedulePreviewRefresh(){this._previewTimer&&clearTimeout(this._previewTimer),this._previewTimer=setTimeout(()=>{this._fetchSchedulePreview()},300)}async _fetchSchedulePreview(){let e=this._open?this._previewScheduleDict():null;if(!e){this._schedulePreview=[],this._schedulePreviewEnded=!1;return}let t=++this._previewSeq;try{let i=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/schedule/preview",schedule:e,...this._lastPerformed?{last_performed:this._lastPerformed}:{}});if(t!==this._previewSeq)return;this._schedulePreview=i.occurrences||[],this._schedulePreviewEnded=!!i.series_ended}catch{}}_renderSchedulePreview(){if(this._schedulePreview.length===0)return _;let e=this._lang,t=this.scheduleTimeEnabled&&this._scheduleTimeOn&&this._scheduleTime?` ${this._scheduleTime}`:"",i=this._schedulePreview.map((o,p)=>{let c=new Date(`${o}T12:00:00`).getDay();return`${ke(c===0?6:c-1,e,"short")} ${te(o,e)}${p===0?t:""}`}).join(" \xB7 "),a=this._scheduleType==="time_based"&&this._intervalAnchor==="completion"?l`<div class="field-help">${n("schedule_preview_ontime",e)}</div>`:_;return l`
|
</div>`}_toggleWeekday(e){this._weekdays=this._weekdays.includes(e)?this._weekdays.filter(t=>t!==e):[...this._weekdays,e]}_previewScheduleDict(){if(this._scheduleType==="one_time")return this._dueDate?{kind:"one_time",due_date:this._dueDate}:null;if(ct.includes(this._scheduleType))return{...this._buildSchedule(),...this._recurrenceExtras()};let e=parseInt(this._intervalDays,10);return this._scheduleType==="manual"||!e||e<=0?null:{kind:"interval",every:e,unit:this._intervalUnit,anchor:this._intervalAnchor,...this._recurrenceExtras()}}updated(e){super.updated?.(e),this._scheduleEntityPickerProbe();for(let t of e.keys())if(g._PREVIEW_RELEVANT.has(String(t))){this._schedulePreviewRefresh();return}}_scheduleEntityPickerProbe(){this._entityPickerFallback||this._pickerProbeTimer!==void 0||!this._open||this._scheduleType!=="sensor_based"||(this._pickerProbeTimer=setTimeout(()=>this._probeEntityPickers(),1500))}_probeEntityPickers(){if(this._pickerProbeTimer=void 0,this._entityPickerFallback||!this._open)return;let e=this.shadowRoot?.querySelector("ha-form.entity-picker-form"),t=(this.shadowRoot?.querySelector(".content")?.offsetHeight??0)>0;if(!e||!t){this._pickerProbeStrikes=0;return}let i=(c,h,m=0)=>{if(!(!c||m>10)){(c.tagName?.toLowerCase()??"")==="ha-entity-picker"&&h.push(c);for(let f of[c.shadowRoot,c])if(f)for(let x of Array.from(f.children??[]))i(x,h,m+1)}},a=[...this.shadowRoot?.querySelectorAll("ha-form.entity-picker-form")??[]],o=[];for(let c of a)i(c,o);let p=o.length===0||o.some(c=>c.offsetHeight===0);if(e.offsetHeight===0||p){if(this._pickerProbeStrikes+=1,this._pickerProbeStrikes>=2){this._entityPickerFallback=!0;return}this._pickerProbeTimer=setTimeout(()=>this._probeEntityPickers(),700)}else this._pickerProbeStrikes=0}_schedulePreviewRefresh(){this._previewTimer&&clearTimeout(this._previewTimer),this._previewTimer=setTimeout(()=>{this._fetchSchedulePreview()},300)}async _fetchSchedulePreview(){let e=this._open?this._previewScheduleDict():null;if(!e){this._schedulePreview=[],this._schedulePreviewEnded=!1;return}let t=++this._previewSeq;try{let i=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/schedule/preview",schedule:e,...this._lastPerformed?{last_performed:this._lastPerformed}:{}});if(t!==this._previewSeq)return;this._schedulePreview=i.occurrences||[],this._schedulePreviewEnded=!!i.series_ended}catch{}}_renderSchedulePreview(){if(this._schedulePreview.length===0)return _;let e=this._lang,t=this.scheduleTimeEnabled&&this._scheduleTimeOn&&this._scheduleTime?` ${this._scheduleTime}`:"",i=this._schedulePreview.map((o,p)=>{let c=new Date(`${o}T12:00:00`).getDay();return`${ke(c===0?6:c-1,e,"short")} ${B(o,e)}${p===0?t:""}`}).join(" \xB7 "),a=this._scheduleType==="time_based"&&this._intervalAnchor==="completion"?l`<div class="field-help">${n("schedule_preview_ontime",e)}</div>`:_;return l`
|
||||||
<div class="trigger-live-hint schedule-preview">
|
<div class="trigger-live-hint schedule-preview">
|
||||||
${n("schedule_preview_title",e)}: ${i}${this._schedulePreviewEnded?l` <span class="field-help">${n("schedule_preview_ends",e)}</span>`:_}
|
${n("schedule_preview_title",e)}: ${i}${this._schedulePreviewEnded?l` <span class="field-help">${n("schedule_preview_ends",e)}</span>`:_}
|
||||||
${a}
|
${a}
|
||||||
</div>
|
</div>
|
||||||
`}_buildSchedule(){let e=i=>{let a=parseInt(this._calOffset,10)||0;return a&&(i.offset=Math.max(-15,Math.min(a,15))),i};if(this._scheduleType==="weekdays")return e({kind:"weekdays",weekdays:[...this._weekdays].sort((i,a)=>i-a)});if(this._scheduleType==="nth_weekday")return e({kind:"nth_weekday",nth:parseInt(this._nth,10),weekday:parseInt(this._nthWeekday,10)});let t={kind:"day_of_month",day:this._domLastDay?-1:parseInt(this._domDay,10)||1};return this._domBusiness&&(t.business=!0),e(t)}_recurrenceExtras(){let e={};if(this._seasonMonths.length&&(e.season_months=[...this._seasonMonths].sort((t,i)=>t-i)),this._endsMode==="count"){let t=parseInt(this._endsCount,10);t>=1&&(e.ends={count:t})}else this._endsMode==="until"&&this._endsUntil&&(e.ends={until:this._endsUntil});return e}_toggleSeasonMonth(e){this._seasonMonths=this._seasonMonths.includes(e)?this._seasonMonths.filter(t=>t!==e):[...this._seasonMonths,e]}_renderRecurrenceExtras(){let e=this._lang;if(!(this._scheduleType==="time_based"||dt.includes(this._scheduleType)))return _;let i=zs(e);return l`
|
`}_buildSchedule(){let e=i=>{let a=parseInt(this._calOffset,10)||0;return a&&(i.offset=Math.max(-15,Math.min(a,15))),i};if(this._scheduleType==="weekdays")return e({kind:"weekdays",weekdays:[...this._weekdays].sort((i,a)=>i-a)});if(this._scheduleType==="nth_weekday")return e({kind:"nth_weekday",nth:parseInt(this._nth,10),weekday:parseInt(this._nthWeekday,10)});let t={kind:"day_of_month",day:this._domLastDay?-1:parseInt(this._domDay,10)||1};return this._domBusiness&&(t.business=!0),e(t)}_recurrenceExtras(){let e={};if(this._seasonMonths.length&&(e.season_months=[...this._seasonMonths].sort((t,i)=>t-i)),this._endsMode==="count"){let t=parseInt(this._endsCount,10);t>=1&&(e.ends={count:t})}else this._endsMode==="until"&&this._endsUntil&&(e.ends={until:this._endsUntil});return e}_toggleSeasonMonth(e){this._seasonMonths=this._seasonMonths.includes(e)?this._seasonMonths.filter(t=>t!==e):[...this._seasonMonths,e]}_renderRecurrenceExtras(){let e=this._lang;if(!(this._scheduleType==="time_based"||ct.includes(this._scheduleType)))return _;let i=Vs(e);return l`
|
||||||
<label class="field-label">${n("season_window_label",e)}</label>
|
<label class="field-label">${n("season_window_label",e)}</label>
|
||||||
<div class="field-help">${n("season_window_hint",e)}</div>
|
<div class="field-help">${n("season_window_hint",e)}</div>
|
||||||
<div class="weekday-chips season-chips">
|
<div class="weekday-chips season-chips">
|
||||||
@@ -2046,7 +2070,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._endsUntil}
|
.value=${this._endsUntil}
|
||||||
@value-changed=${a=>this._endsUntil=a.detail.value}
|
@value-changed=${a=>this._endsUntil=a.detail.value}
|
||||||
></ms-date-field>`:_}
|
></ms-date-field>`:_}
|
||||||
`}_renderCalendarFields(){let e=this._lang,t=Ms(e);if(this._scheduleType==="weekdays")return l`
|
`}_renderCalendarFields(){let e=this._lang,t=Bs(e);if(this._scheduleType==="weekdays")return l`
|
||||||
<label class="field-label">${n("recurrence_on_days",e)}</label>
|
<label class="field-label">${n("recurrence_on_days",e)}</label>
|
||||||
<div class="weekday-chips">
|
<div class="weekday-chips">
|
||||||
${t.map((i,a)=>l`
|
${t.map((i,a)=>l`
|
||||||
@@ -2231,7 +2255,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._type}
|
.value=${this._type}
|
||||||
@change=${i=>this._type=i.target.value}
|
@change=${i=>this._type=i.target.value}
|
||||||
>
|
>
|
||||||
${Ls.map(i=>l`<option value=${i} ?selected=${i===this._type}>${n(i,e)}</option>`)}
|
${js.map(i=>l`<option value=${i} ?selected=${i===this._type}>${n(i,e)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
${this._type==="reading"?l`
|
${this._type==="reading"?l`
|
||||||
@@ -2266,7 +2290,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._priority}
|
.value=${this._priority}
|
||||||
@change=${i=>this._priority=i.target.value}
|
@change=${i=>this._priority=i.target.value}
|
||||||
>
|
>
|
||||||
${Rs.map(i=>l`<option value=${i} ?selected=${i===this._priority}>${n("priority_"+i,e)}</option>`)}
|
${Hs.map(i=>l`<option value=${i} ?selected=${i===this._priority}>${n("priority_"+i,e)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
@@ -2285,7 +2309,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._scheduleType}
|
.value=${this._scheduleType}
|
||||||
@change=${i=>this._scheduleType=i.target.value}
|
@change=${i=>this._scheduleType=i.target.value}
|
||||||
>
|
>
|
||||||
${qs.map(i=>l`<option value=${i} ?selected=${i===this._scheduleType}>${n(i,e)}</option>`)}
|
${Os.map(i=>l`<option value=${i} ?selected=${i===this._scheduleType}>${n(i,e)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
${this._scheduleType==="time_based"?l`
|
${this._scheduleType==="time_based"?l`
|
||||||
@@ -2318,7 +2342,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
@value-changed=${i=>this._dueDate=i.detail.value}
|
@value-changed=${i=>this._dueDate=i.detail.value}
|
||||||
></ms-date-field>
|
></ms-date-field>
|
||||||
`:_}
|
`:_}
|
||||||
${this.scheduleTimeEnabled&&cr.includes(this._scheduleType)?l`
|
${this.scheduleTimeEnabled&&ur.includes(this._scheduleType)?l`
|
||||||
<label class="checkbox-row schedule-time-toggle">
|
<label class="checkbox-row schedule-time-toggle">
|
||||||
<input type="checkbox" .checked=${this._scheduleTimeOn}
|
<input type="checkbox" .checked=${this._scheduleTimeOn}
|
||||||
@change=${i=>this._scheduleTimeOn=i.target.checked} />
|
@change=${i=>this._scheduleTimeOn=i.target.checked} />
|
||||||
@@ -2367,14 +2391,14 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
${this._renderPhasesEditor(e)}
|
${this._renderPhasesEditor(e)}
|
||||||
<h3>${n("require_on_completion",e)}</h3>
|
<h3>${n("require_on_completion",e)}</h3>
|
||||||
<div class="required-completion">
|
<div class="required-completion">
|
||||||
${Rt.map(i=>l`
|
${Nt.map(i=>l`
|
||||||
<label class="req-option">
|
<label class="req-option">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
.checked=${this._requiredCompletion.includes(i)}
|
.checked=${this._requiredCompletion.includes(i)}
|
||||||
@change=${a=>this._toggleRequired(i,a.target.checked)}
|
@change=${a=>this._toggleRequired(i,a.target.checked)}
|
||||||
/>
|
/>
|
||||||
<span>${n(Ke[i],e)}</span>
|
<span>${n(Ge[i],e)}</span>
|
||||||
</label>
|
</label>
|
||||||
`)}
|
`)}
|
||||||
</div>
|
</div>
|
||||||
@@ -2436,7 +2460,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<ha-form
|
<ha-form
|
||||||
class="entity-picker-form"
|
class="entity-picker-form"
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.schema=${[{name:"environmental_entity",selector:{entity:{domain:or,device_class:lr}}}]}
|
.schema=${[{name:"environmental_entity",selector:{entity:{domain:cr,device_class:pr}}}]}
|
||||||
.data=${{environmental_entity:this._environmentalEntity}}
|
.data=${{environmental_entity:this._environmentalEntity}}
|
||||||
.computeLabel=${()=>n("environmental_entity_optional",e)}
|
.computeLabel=${()=>n("environmental_entity_optional",e)}
|
||||||
.computeHelper=${()=>n("environmental_entity_helper",e)}
|
.computeHelper=${()=>n("environmental_entity_helper",e)}
|
||||||
@@ -2510,6 +2534,15 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<span>${n("disallow_skip",e)}</span>
|
<span>${n("disallow_skip",e)}</span>
|
||||||
</label>
|
</label>
|
||||||
${this._allowSkip?_:l`<div class="field-help">${n("disallow_skip_help",e)}</div>`}
|
${this._allowSkip?_:l`<div class="field-help">${n("disallow_skip_help",e)}</div>`}
|
||||||
|
<label class="req-option">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
.checked=${!this._notifyEnabled}
|
||||||
|
@change=${i=>this._notifyEnabled=!i.target.checked}
|
||||||
|
/>
|
||||||
|
<span>${n("no_notifications",e)}</span>
|
||||||
|
</label>
|
||||||
|
${this._notifyEnabled?_:l`<div class="field-help">${n("no_notifications_help",e)}</div>`}
|
||||||
<label class="toggle-row">
|
<label class="toggle-row">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -2926,7 +2959,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
`,d([y({attribute:!1})],g.prototype,"hass",2),d([y({type:Boolean,attribute:"checklists-enabled"})],g.prototype,"checklistsEnabled",2),d([y({type:Boolean,attribute:"schedule-time-enabled"})],g.prototype,"scheduleTimeEnabled",2),d([y({type:Boolean,attribute:"completion-actions-enabled"})],g.prototype,"completionActionsEnabled",2),d([y({type:Number,attribute:"default-warning-days"})],g.prototype,"defaultWarningDays",2),d([u()],g.prototype,"parts",2),d([u()],g.prototype,"_foreignOwners",2),d([u()],g.prototype,"_open",2),d([u()],g.prototype,"_entityPickerFallback",2),d([u()],g.prototype,"_loading",2),d([u()],g.prototype,"_error",2),d([u()],g.prototype,"_entryId",2),d([u()],g.prototype,"_taskId",2),d([u()],g.prototype,"_objectChoices",2),d([u()],g.prototype,"_name",2),d([u()],g.prototype,"_type",2),d([u()],g.prototype,"_scheduleType",2),d([u()],g.prototype,"_intervalDays",2),d([u()],g.prototype,"_intervalUnit",2),d([u()],g.prototype,"_dueDate",2),d([u()],g.prototype,"_warningDays",2),d([u()],g.prototype,"_earliestCompletionDays",2),d([u()],g.prototype,"_intervalAnchor",2),d([u()],g.prototype,"_weekdays",2),d([u()],g.prototype,"_nth",2),d([u()],g.prototype,"_nthWeekday",2),d([u()],g.prototype,"_domDay",2),d([u()],g.prototype,"_domLastDay",2),d([u()],g.prototype,"_domBusiness",2),d([u()],g.prototype,"_calOffset",2),d([u()],g.prototype,"_seasonMonths",2),d([u()],g.prototype,"_endsMode",2),d([u()],g.prototype,"_endsCount",2),d([u()],g.prototype,"_endsUntil",2),d([u()],g.prototype,"_schedulePreview",2),d([u()],g.prototype,"_schedulePreviewEnded",2),d([u()],g.prototype,"_notes",2),d([u()],g.prototype,"_documentationUrl",2),d([u()],g.prototype,"_customIcon",2),d([u()],g.prototype,"_priority",2),d([u()],g.prototype,"_labels",2),d([u()],g.prototype,"_enabled",2),d([u()],g.prototype,"_triggerEntityId",2),d([u()],g.prototype,"_triggerEntityIds",2),d([u()],g.prototype,"_triggerEntityLogic",2),d([u()],g.prototype,"_triggerAttribute",2),d([u()],g.prototype,"_triggerType",2),d([u()],g.prototype,"_triggerAbove",2),d([u()],g.prototype,"_triggerBelow",2),d([u()],g.prototype,"_triggerEquals",2),d([u()],g.prototype,"_triggerNotEquals",2),d([u()],g.prototype,"_triggerForMinutes",2),d([u()],g.prototype,"_triggerCombinator",2),d([u()],g.prototype,"_triggerTargetValue",2),d([u()],g.prototype,"_triggerDeltaMode",2),d([u()],g.prototype,"_triggerBaselineValue",2),d([u()],g.prototype,"_liveBaselineValue",2),d([u()],g.prototype,"_autoCompleteOnRecovery",2),d([u()],g.prototype,"_triggerFromState",2),d([u()],g.prototype,"_triggerToState",2),d([u()],g.prototype,"_triggerTargetChanges",2),d([u()],g.prototype,"_triggerRuntimeHours",2),d([u()],g.prototype,"_triggerRuntimeMaxSession",2),d([u()],g.prototype,"_triggerOnStates",2),d([u()],g.prototype,"_compoundLogic",2),d([u()],g.prototype,"_compoundConditions",2),d([u()],g.prototype,"_suggestedAttributes",2),d([u()],g.prototype,"_availableAttributes",2),d([u()],g.prototype,"_entityDomain",2),d([u()],g.prototype,"_lastPerformed",2),d([u()],g.prototype,"_nfcTagId",2),d([u()],g.prototype,"_requireTagScan",2),d([u()],g.prototype,"_allowSkip",2),d([u()],g.prototype,"_readingUnit",2),d([u()],g.prototype,"_readings",2),d([u()],g.prototype,"_consumesParts",2),d([u()],g.prototype,"_partsLoadFailed",2),d([u()],g.prototype,"_availableTags",2),d([u()],g.prototype,"_responsibleUserId",2),d([u()],g.prototype,"_assigneePool",2),d([u()],g.prototype,"_rotationStrategy",2),d([u()],g.prototype,"_availableUsers",2),d([u()],g.prototype,"_checklistText",2),d([u()],g.prototype,"_phaseDefs",2),d([u()],g.prototype,"_phaseSeq",2),d([u()],g.prototype,"_requiredCompletion",2),d([u()],g.prototype,"_scheduleTime",2),d([u()],g.prototype,"_scheduleTimeOn",2),d([u()],g.prototype,"_actionService",2),d([u()],g.prototype,"_actionTargetEntity",2),d([u()],g.prototype,"_actionData",2),d([u()],g.prototype,"_actionDataJsonFallback",2),d([u()],g.prototype,"_actionTesting",2),d([u()],g.prototype,"_actionTestResult",2),d([u()],g.prototype,"_actionTestError",2),d([u()],g.prototype,"_qcNotes",2),d([u()],g.prototype,"_qcCost",2),d([u()],g.prototype,"_qcDuration",2),d([u()],g.prototype,"_qcFeedback",2),d([u()],g.prototype,"_environmentalEntity",2),d([u()],g.prototype,"_environmentalAttribute",2),d([u()],g.prototype,"_adaptiveEnabled",2),d([u()],g.prototype,"_adaptiveAlpha",2),d([u()],g.prototype,"_adaptiveMin",2),d([u()],g.prototype,"_adaptiveMax",2),d([u()],g.prototype,"_adaptiveSeasonal",2),d([u()],g.prototype,"_adaptivePrediction",2),d([u()],g.prototype,"_conditionAttrOptions",2);Nt=g;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",Nt)});function ur(){if(window.externalApp!==void 0)return!0;let r=typeof navigator<"u"&&navigator.userAgent||"";return/Home Assistant\//.test(r)&&/Android/.test(r)}var _r=w(()=>{"use strict"});async function ct(s,r,e){let t=new FormData;t.append("entry_id",r),t.append("tags","photo"),t.append("file",e,e.name);let i=await fetch("/api/maintenance_supporter/document/uplo
Line truncated
|
`,d([y({attribute:!1})],g.prototype,"hass",2),d([y({type:Boolean,attribute:"checklists-enabled"})],g.prototype,"checklistsEnabled",2),d([y({type:Boolean,attribute:"schedule-time-enabled"})],g.prototype,"scheduleTimeEnabled",2),d([y({type:Boolean,attribute:"completion-actions-enabled"})],g.prototype,"completionActionsEnabled",2),d([y({type:Number,attribute:"default-warning-days"})],g.prototype,"defaultWarningDays",2),d([u()],g.prototype,"parts",2),d([u()],g.prototype,"_foreignOwners",2),d([u()],g.prototype,"_open",2),d([u()],g.prototype,"_entityPickerFallback",2),d([u()],g.prototype,"_loading",2),d([u()],g.prototype,"_error",2),d([u()],g.prototype,"_entryId",2),d([u()],g.prototype,"_taskId",2),d([u()],g.prototype,"_objectChoices",2),d([u()],g.prototype,"_name",2),d([u()],g.prototype,"_type",2),d([u()],g.prototype,"_scheduleType",2),d([u()],g.prototype,"_intervalDays",2),d([u()],g.prototype,"_intervalUnit",2),d([u()],g.prototype,"_dueDate",2),d([u()],g.prototype,"_warningDays",2),d([u()],g.prototype,"_earliestCompletionDays",2),d([u()],g.prototype,"_intervalAnchor",2),d([u()],g.prototype,"_weekdays",2),d([u()],g.prototype,"_nth",2),d([u()],g.prototype,"_nthWeekday",2),d([u()],g.prototype,"_domDay",2),d([u()],g.prototype,"_domLastDay",2),d([u()],g.prototype,"_domBusiness",2),d([u()],g.prototype,"_calOffset",2),d([u()],g.prototype,"_seasonMonths",2),d([u()],g.prototype,"_endsMode",2),d([u()],g.prototype,"_endsCount",2),d([u()],g.prototype,"_endsUntil",2),d([u()],g.prototype,"_schedulePreview",2),d([u()],g.prototype,"_schedulePreviewEnded",2),d([u()],g.prototype,"_notes",2),d([u()],g.prototype,"_documentationUrl",2),d([u()],g.prototype,"_customIcon",2),d([u()],g.prototype,"_priority",2),d([u()],g.prototype,"_labels",2),d([u()],g.prototype,"_enabled",2),d([u()],g.prototype,"_triggerEntityId",2),d([u()],g.prototype,"_triggerEntityIds",2),d([u()],g.prototype,"_triggerEntityLogic",2),d([u()],g.prototype,"_triggerAttribute",2),d([u()],g.prototype,"_triggerType",2),d([u()],g.prototype,"_triggerAbove",2),d([u()],g.prototype,"_triggerBelow",2),d([u()],g.prototype,"_triggerEquals",2),d([u()],g.prototype,"_triggerNotEquals",2),d([u()],g.prototype,"_triggerForMinutes",2),d([u()],g.prototype,"_triggerCombinator",2),d([u()],g.prototype,"_triggerTargetValue",2),d([u()],g.prototype,"_triggerDeltaMode",2),d([u()],g.prototype,"_triggerBaselineValue",2),d([u()],g.prototype,"_liveBaselineValue",2),d([u()],g.prototype,"_autoCompleteOnRecovery",2),d([u()],g.prototype,"_triggerFromState",2),d([u()],g.prototype,"_triggerToState",2),d([u()],g.prototype,"_triggerTargetChanges",2),d([u()],g.prototype,"_triggerRuntimeHours",2),d([u()],g.prototype,"_triggerRuntimeMaxSession",2),d([u()],g.prototype,"_triggerOnStates",2),d([u()],g.prototype,"_compoundLogic",2),d([u()],g.prototype,"_compoundConditions",2),d([u()],g.prototype,"_suggestedAttributes",2),d([u()],g.prototype,"_availableAttributes",2),d([u()],g.prototype,"_entityDomain",2),d([u()],g.prototype,"_lastPerformed",2),d([u()],g.prototype,"_nfcTagId",2),d([u()],g.prototype,"_requireTagScan",2),d([u()],g.prototype,"_allowSkip",2),d([u()],g.prototype,"_notifyEnabled",2),d([u()],g.prototype,"_readingUnit",2),d([u()],g.prototype,"_readings",2),d([u()],g.prototype,"_consumesParts",2),d([u()],g.prototype,"_partsLoadFailed",2),d([u()],g.prototype,"_availableTags",2),d([u()],g.prototype,"_responsibleUserId",2),d([u()],g.prototype,"_assigneePool",2),d([u()],g.prototype,"_rotationStrategy",2),d([u()],g.prototype,"_availableUsers",2),d([u()],g.prototype,"_checklistText",2),d([u()],g.prototype,"_phaseDefs",2),d([u()],g.prototype,"_phaseSeq",2),d([u()],g.prototype,"_requiredCompletion",2),d([u()],g.prototype,"_scheduleTime",2),d([u()],g.prototype,"_scheduleTimeOn",2),d([u()],g.prototype,"_actionService",2),d([u()],g.prototype,"_actionTargetEntity",2),d([u()],g.prototype,"_actionData",2),d([u()],g.prototype,"_actionDataJsonFallback",2),d([u()],g.prototype,"_actionTesting",2),d([u()],g.prototype,"_actionTestResult",2),d([u()],g.prototype,"_actionTestError",2),d([u()],g.prototype,"_qcNotes",2),d([u()],g.prototype,"_qcCost",2),d([u()],g.prototype,"_qcDuration",2),d([u()],g.prototype,"_qcFeedback",2),d([u()],g.prototype,"_environmentalEntity",2),d([u()],g.prototype,"_environmentalAttribute",2),d([u()],g.prototype,"_adaptiveEnabled",2),d([u()],g.prototype,"_adaptiveAlpha",2),d([u()],g.prototype,"_adaptiveMin",2),d([u()],g.prototype,"_adaptiveMax",2),d([u()],g.prototype,"_adaptiveSeasonal",2),d([u()],g.prototype,"_adaptivePrediction",2),d([u()],g.prototype,"_conditionAttrOptions",2);jt=g;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",jt)});function mr(){if(window.externalApp!==void 0)return!0;let r=typeof navigator<"u"&&navigator.userAgent||"";return/Home Assistant\//.test(r)&&/Android/.test(r)}var fr=w(()=>{"use strict"});async function pt(s,r,e){let t=new FormData;t.append("entry_id",r),t.append("tags","photo"),t.append("file",e,e.name);let i=await fetch("
Line truncated
|
||||||
<label class="field reading-field">
|
<label class="field reading-field">
|
||||||
<span class="field-label">${e.name}${o?` (${o})`:""}</span>
|
<span class="field-label">${e.name}${o?` (${o})`:""}</span>
|
||||||
<input type="text" inputmode="decimal" class="field-input"
|
<input type="text" inputmode="decimal" class="field-input"
|
||||||
@@ -2934,11 +2967,11 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._readingValues[e.id]??""}
|
.value=${this._readingValues[e.id]??""}
|
||||||
@input=${f=>{this._readingValues={...this._readingValues,[e.id]:f.target.value}}} />
|
@input=${f=>{this._readingValues={...this._readingValues,[e.id]:f.target.value}}} />
|
||||||
${h?l`<span class="reading-warn">${n("reading_below_last",t).replace("{value}",m)}</span>`:_}
|
${h?l`<span class="reading-warn">${n("reading_below_last",t).replace("{value}",m)}</span>`:_}
|
||||||
</label>`}get _missingRequired(){let e={notes:this._notes.trim()!=="",cost:this._cost.trim()!=="",duration:this._duration.trim()!=="",photo:this._photos.length>0,user:!!this.hass?.user};return this.requiredFields.filter(t=>!e[t])}_req(e){return this.requiredFields.includes(e)?l`<span class="req-mark" aria-hidden="true">*</span>`:_}_partsCostSuggestion(){if(this.restockDefault!==null){let i=parseFloat(this._restockQty);return this.restockUnitCost==null||!Number.isFinite(i)||i<=0?null:Math.round(this.restockUnitCost*i*100)/100}if(!this.parts.length)return null;let e=0,t=!1;for(let i of Object.values(this._usedParts)){let a=this.parts.find(o=>G({part_id:o.id,entry_id:o.entry_id})===G(i));a?.cost!=null&&(e+=a.cost*(i.quantity||1),t=!0)}return t?Math.round(e*100)/100:null}_renderCostSuggestion(e){if(this._cost.trim()!=="")return _;let t=this._partsCostSuggestion();if(t==null||t<=0)return _;let i=st(t,this.currencySymbol,e);return l`<button
|
</label>`}get _missingRequired(){let e={notes:this._notes.trim()!=="",cost:this._cost.trim()!=="",duration:this._duration.trim()!=="",photo:this._photos.length>0,user:!!this.hass?.user};return this.requiredFields.filter(t=>!e[t])}_req(e){return this.requiredFields.includes(e)?l`<span class="req-mark" aria-hidden="true">*</span>`:_}_partsCostSuggestion(){if(this.restockDefault!==null){let i=parseFloat(this._restockQty);return this.restockUnitCost==null||!Number.isFinite(i)||i<=0?null:Math.round(this.restockUnitCost*i*100)/100}if(!this.parts.length)return null;let e=0,t=!1;for(let i of Object.values(this._usedParts)){let a=this.parts.find(o=>Q({part_id:o.id,entry_id:o.entry_id})===Q(i));a?.cost!=null&&(e+=a.cost*(i.quantity||1),t=!0)}return t?Math.round(e*100)/100:null}_renderCostSuggestion(e){if(this._cost.trim()!=="")return _;let t=this._partsCostSuggestion();if(t==null||t<=0)return _;let i=nt(t,this.currencySymbol,e);return l`<button
|
||||||
type="button"
|
type="button"
|
||||||
class="cost-suggestion"
|
class="cost-suggestion"
|
||||||
@click=${()=>this._cost=String(Math.round(t*100)/100)}
|
@click=${()=>this._cost=String(Math.round(t*100)/100)}
|
||||||
>${n("cost_from_parts",e).replace("{amount}",i)}</button>`}_close(){if(this._open=!1,this._uploadedIds.length>0){let e=this._uploadedIds;this._uploadedIds=[],Ae(this.hass,e)}}_pickCompletedAt(){let e=new Date,t=i=>String(i).padStart(2,"0");this._completedAt=`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:00`}render(){if(!this._open)return l``;let e=this.lang||this.hass?.language||"en";return l`
|
>${n("cost_from_parts",e).replace("{amount}",i)}</button>`}_close(){if(this._open=!1,this._uploadedIds.length>0){let e=this._uploadedIds;this._uploadedIds=[],Te(this.hass,e)}}_pickCompletedAt(){let e=new Date,t=i=>String(i).padStart(2,"0");this._completedAt=`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:00`}render(){if(!this._open)return l``;let e=this.lang||this.hass?.language||"en";return l`
|
||||||
<ha-dialog open @closed=${this._close}>
|
<ha-dialog open @closed=${this._close}>
|
||||||
<div class="dialog-title">${n("complete_title",e)}${this.taskName}</div>
|
<div class="dialog-title">${n("complete_title",e)}${this.taskName}</div>
|
||||||
${this.phaseLabel?l`<div class="phase-line">${n("phase_current",e)}: ${this.phaseLabel}</div>`:_}
|
${this.phaseLabel?l`<div class="phase-line">${n("phase_current",e)}: ${this.phaseLabel}</div>`:_}
|
||||||
@@ -2968,7 +3001,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
</label>`:_}
|
</label>`:_}
|
||||||
${this.parts.length?l`<div class="used-parts">
|
${this.parts.length?l`<div class="used-parts">
|
||||||
<span class="field-label">${n("complete_parts_used",e)}</span>
|
<span class="field-label">${n("complete_parts_used",e)}</span>
|
||||||
${this.parts.map(t=>{let i=G({part_id:t.id,entry_id:t.entry_id}),a=this._usedParts[i],o=a!==void 0,p=t.entry_id?{part_id:t.id,quantity:1,entry_id:t.entry_id}:{part_id:t.id,quantity:1};return l`<div class="used-part-row">
|
${this.parts.map(t=>{let i=Q({part_id:t.id,entry_id:t.entry_id}),a=this._usedParts[i],o=a!==void 0,p=t.entry_id?{part_id:t.id,quantity:1,entry_id:t.entry_id}:{part_id:t.id,quantity:1};return l`<div class="used-part-row">
|
||||||
<label class="used-part-check">
|
<label class="used-part-check">
|
||||||
<input type="checkbox" .checked=${o}
|
<input type="checkbox" .checked=${o}
|
||||||
@change=${c=>{let h={...this._usedParts};c.target.checked?h[i]=h[i]||p:delete h[i],this._usedParts=h}} />
|
@change=${c=>{let h={...this._usedParts};c.target.checked?h[i]=h[i]||p:delete h[i],this._usedParts=h}} />
|
||||||
@@ -3083,13 +3116,13 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<ha-button
|
<ha-button
|
||||||
@click=${this._complete}
|
@click=${this._complete}
|
||||||
.disabled=${this._loading||this._missingRequired.length>0}
|
.disabled=${this._loading||this._missingRequired.length>0}
|
||||||
title=${this._missingRequired.length?this._missingRequired.map(t=>n("err_required",e).replace("{field}",n(Ke[t]??t,e))).join(" \xB7 "):""}
|
title=${this._missingRequired.length?this._missingRequired.map(t=>n("err_required",e).replace("{field}",n(Ge[t]??t,e))).join(" \xB7 "):""}
|
||||||
>
|
>
|
||||||
${this._loading?n("completing",e):n("complete",e)}
|
${this._loading?n("completing",e):n("complete",e)}
|
||||||
</ha-button>
|
</ha-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
`}};$.styles=[Bi,E`
|
`}};$.styles=[Vi,E`
|
||||||
.req-mark {
|
.req-mark {
|
||||||
color: var(--error-color, #f44336);
|
color: var(--error-color, #f44336);
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
@@ -3317,7 +3350,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
color: var(--text-primary-color, #fff);
|
color: var(--text-primary-color, #fff);
|
||||||
border-color: var(--primary-color);
|
border-color: var(--primary-color);
|
||||||
}
|
}
|
||||||
`],d([y({attribute:!1})],$.prototype,"hass",2),d([y()],$.prototype,"entryId",2),d([y()],$.prototype,"taskId",2),d([y()],$.prototype,"taskName",2),d([y()],$.prototype,"lang",2),d([y({type:Array})],$.prototype,"checklist",2),d([y({type:Boolean})],$.prototype,"adaptiveEnabled",2),d([y()],$.prototype,"taskType",2),d([y()],$.prototype,"readingUnit",2),d([y({attribute:!1})],$.prototype,"readings",2),d([y({attribute:!1})],$.prototype,"readingHistory",2),d([y({attribute:!1})],$.prototype,"restockDefault",2),d([y({attribute:!1})],$.prototype,"restockUnitCost",2),d([y()],$.prototype,"currencySymbol",2),d([y({attribute:!1})],$.prototype,"parts",2),d([y({attribute:!1})],$.prototype,"consumesParts",2),d([y({type:Array})],$.prototype,"consumesInfo",2),d([y({type:Array})],$.prototype,"requiredFields",2),d([y()],$.prototype,"phaseLabel",2),d([y({type:Boolean})],$.prototype,"requireTagScan",2),d([y({type:Boolean})],$.prototype,"viaTagScan",2),d([u()],$.prototype,"_open",2),d([u()],$.prototype,"_notes",2),d([u()],$.prototype,"_cost",2),d([u()],$.prototype,"_duration",2),d([u()],$.prototype,"_loading",2),d([u()],$.prototype,"_error",2),d([u()],$.prototype,"_checklistState",2),d([u()],$.prototype,"_feedback",2),d([u()],$.prototype,"_photos",2),d([u()],$.prototype,"_photoUploading",2),d([u()],$.prototype,"_readingValue",2),d([u()],$.prototype,"_readingValues",2),d([u()],$.prototype,"_restockQty",2),d([u()],$.prototype,"_completedAt",2),d([u()],$.prototype,"_usedParts",2),d([y({attribute:!1})],$.prototype,"checklistPrefill",2);customElements.get("maintenance-complete-dialog")||customElements.define("maintenance-complete-dialog",$)});function mr(s,r,e){let t=new Blob([s],{type:e}),i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=r,a.target="_blank",a.rel="noopener",a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(i),6e4)}var Ht=w(()=>{"use strict"});async function Fs(s,r,e=300){return(await s.connection.sendMessagePromise({type:"auth/sign_path",path:r,expires:e})).path}async function fr(s,r,e=300){return Fs(s,`/api/maintenance_supporter/document/${r}`,e)}var vr=w(()=>{"use strict";Ht()});var de,Ot=w(()=>{"use strict";I();V();vr();de=class extends A{constructor(){super(...arguments);this.docId="";this._url="";this._failed=!1;this._signedFor=""}updated(){this.hass&&this.docId&&this._signedFor!==this.docId&&(this._signedFor=this.docId,this._url="",this._failed=!1,this._sign())}async _sign(){try{this._url=await fr(this.hass,this.docId)}catch{this._failed=!0}}render(){return this._failed||!this.docId?_:this._url?l`
|
`],d([y({attribute:!1})],$.prototype,"hass",2),d([y()],$.prototype,"entryId",2),d([y()],$.prototype,"taskId",2),d([y()],$.prototype,"taskName",2),d([y()],$.prototype,"lang",2),d([y({type:Array})],$.prototype,"checklist",2),d([y({type:Boolean})],$.prototype,"adaptiveEnabled",2),d([y()],$.prototype,"taskType",2),d([y()],$.prototype,"readingUnit",2),d([y({attribute:!1})],$.prototype,"readings",2),d([y({attribute:!1})],$.prototype,"readingHistory",2),d([y({attribute:!1})],$.prototype,"restockDefault",2),d([y({attribute:!1})],$.prototype,"restockUnitCost",2),d([y()],$.prototype,"currencySymbol",2),d([y({attribute:!1})],$.prototype,"parts",2),d([y({attribute:!1})],$.prototype,"consumesParts",2),d([y({type:Array})],$.prototype,"consumesInfo",2),d([y({type:Array})],$.prototype,"requiredFields",2),d([y()],$.prototype,"phaseLabel",2),d([y({type:Boolean})],$.prototype,"requireTagScan",2),d([y({type:Boolean})],$.prototype,"viaTagScan",2),d([u()],$.prototype,"_open",2),d([u()],$.prototype,"_notes",2),d([u()],$.prototype,"_cost",2),d([u()],$.prototype,"_duration",2),d([u()],$.prototype,"_loading",2),d([u()],$.prototype,"_error",2),d([u()],$.prototype,"_checklistState",2),d([u()],$.prototype,"_feedback",2),d([u()],$.prototype,"_photos",2),d([u()],$.prototype,"_photoUploading",2),d([u()],$.prototype,"_readingValue",2),d([u()],$.prototype,"_readingValues",2),d([u()],$.prototype,"_restockQty",2),d([u()],$.prototype,"_completedAt",2),d([u()],$.prototype,"_usedParts",2),d([y({attribute:!1})],$.prototype,"checklistPrefill",2);customElements.get("maintenance-complete-dialog")||customElements.define("maintenance-complete-dialog",$)});function yr(s,r,e){let t=new Blob([s],{type:e}),i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=r,a.target="_blank",a.rel="noopener",a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(i),6e4)}var Ot=w(()=>{"use strict"});async function Ws(s,r,e=300){return(await s.connection.sendMessagePromise({type:"auth/sign_path",path:r,expires:e})).path}async function br(s,r,e=300){return Ws(s,`/api/maintenance_supporter/document/${r}`,e)}var xr=w(()=>{"use strict";Ot()});var de,Dt=w(()=>{"use strict";C();W();xr();de=class extends A{constructor(){super(...arguments);this.docId="";this._url="";this._failed=!1;this._signedFor=""}updated(){this.hass&&this.docId&&this._signedFor!==this.docId&&(this._signedFor=this.docId,this._url="",this._failed=!1,this._sign())}async _sign(){try{this._url=await br(this.hass,this.docId)}catch{this._failed=!0}}render(){return this._failed||!this.docId?_:this._url?l`
|
||||||
<a href=${this._url} target="_blank" rel="noopener" class="wrap">
|
<a href=${this._url} target="_blank" rel="noopener" class="wrap">
|
||||||
<img src=${this._url} alt="" loading="lazy"
|
<img src=${this._url} alt="" loading="lazy"
|
||||||
@error=${()=>this._failed=!0} />
|
@error=${()=>this._failed=!0} />
|
||||||
@@ -3341,7 +3374,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
`,d([y({attribute:!1})],de.prototype,"hass",2),d([y()],de.prototype,"docId",2),d([u()],de.prototype,"_url",2),d([u()],de.prototype,"_failed",2);customElements.get("maintenance-history-photo")||customElements.define("maintenance-history-photo",de)});var z,yr=w(()=>{"use strict";I();V();q();fe();jt();Se();Ot();z=class extends A{constructor(){super(...arguments);this._open=!1;this._saving=!1;this._error="";this._draft=null;this._originalSnapshot=null;this._partOptions=null;this._partQty={};this._partQtyOriginal="";this._photos=[];this._photosOriginal="";this._readingRows=[];this._readingText={};this._readingsOriginal="";this._uploadedIds=[];this._photoUploading=!1}get _lang(){return M(this.hass)}openEdit(e){this._draft={...e},this._originalSnapshot={...e},this._error="",this._open=!0,this._partOptions=null,this._partQty={},this._partQtyOriginal="",this._photos=[...e.photo_doc_ids??[]],this._photosOriginal=JSON.stringify(this._photos),this._uploadedIds=[],this._photoUploading=!1,this._seedReadings(e),this._loadPartOptions()}_seedReadings(e){let t=[],i=new Set;for(let o of e.readings??[])i.has(o.id)||(i.add(o.id),t.push({id:o.id,name:o.name,unit:o.unit??null}));for(let o of e.reading_values??[])i.has(o.id)||(i.add(o.id),t.push({id:o.id,name:o.name,unit:o.unit??null}));this._readingRows=t;let a={};for(let o of e.reading_values??[])a[o.id]=String(o.value);this._readingText=a,this._readingsOriginal=JSON.stringify(this._readingNumbers())}_readingNumbers(){let e={};for(let t of this._readingRows){let i=(this._readingText[t.id]??"").trim();if(i==="")continue;let a=parseFloat(i.replace(",","."));isNaN(a)||(e[t.id]=a)}return e}async _onPhotoInput(e){let t=e.target,i=Array.from(t.files??[]);t.value="";let a=this._draft;if(i.length===0||!a)return;let o=10-this._photos.length,p=i.slice(0,Math.max(o,0));this._photoUploading=!0,this._error="";try{for(let c of p){let h=await ct(this.hass,a.entry_id,c);this._uploadedIds=[...this._uploadedIds,h],this._photos=[...this._photos,h]}i.length>p.length&&(this._error=n("photos_limit",this._lang).replace("{max}",String(10)))}catch(c){let h=c instanceof Error&&c.message==="doc_too_large"?"doc_too_large":"doc_upload_failed";this._error=n(h,this._lang)}finally{this._photoUploading=!1}}_removePhoto(e){this._photos=this._photos.filter(t=>t!==e),this._uploadedIds.includes(e)&&(this._uploadedIds=this._uploadedIds.filter(t=>t!==e),Ae(this.hass,[e]))}async _loadPartOptions(){let e=this._draft;if(e)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/parts/overview"}),i=[];for(let o of t.parts||[]){let p=o.entry_id===e.entry_id,c=o.consumers.some(h=>h.entry_id===e.entry_id&&h.task_id===e.task_id);!p&&!c||i.push({part_id:o.part_id,name:o.name,entry_id:o.entry_id,foreign:!p,object_name:o.object_name})}for(let o of e.used_parts||[]){let p=o.entry_id||e.entry_id;i.some(c=>c.part_id===o.part_id&&c.entry_id===p)||i.push({part_id:o.part_id,name:o.name||o.part_id,entry_id:p,foreign:p!==e.entry_id,object_name:null})}let a={};for(let o of e.used_parts||[])a[`${o.entry_id||e.entry_id}:${o.part_id}`]=o.quantity??1;this._partOptions=i,this._partQty=a,this._partQtyOriginal=this._partSelectionKey()}catch{this._partOptions=[]}}_partSelectionKey(){return JSON.stringify(Object.entries(this._partQty).filter(([,e])=>e>0).sort(([e],[t])=>e.localeCompare(t)))}close(){if(this._open=!1,this._error="",this._draft=null,this._originalSnapshot=null,this._uploadedIds.length>0){let e=this._uploadedIds;this._uploadedIds=[],Ae(this.hass,e)}}_set(e,t){this._draft&&(this._draft={...this._draft,[e]:t})}async _save(){if(!(!this._draft||!this._originalSnapshot)){this._saving=!0,this._error="";try{let e={type:"maintenance_supporter/task/history/update",entry_id:this._draft.entry_id,task_id:this._draft.task_id,original_timestamp:this._originalSnapshot.original_timestamp};if(this._draft.timestamp!==this._originalSnapshot.timestamp&&(e.timestamp=this._draft.timestamp),this._draft.notes!==this._originalSnapshot.notes&&(e.notes=this._draft.notes),this._draft.cost!==this._originalSnapshot.cost&&(e.cost=this._draft.cost),this._draft.duration!==this._originalSnapshot.duration&&(e.duration=this._draft.duration),this._draft.completed_by!==this._originalSnapshot.completed_by&&(e.completed_by=this._draft.completed_by),this._partOptions!==null&&this._partSelectionKey()!==this._partQtyOriginal&&(e.used_parts=(this._partOptions||[]).filter(i=>(this._partQty[`${i.entry_id}:${i.part_id}`]||0)>0).map(i=>({part_id:i.part_id,quantity:this._partQty[`${i.entry_id}:${i.part_id}`],...i.foreign?{entry_id:i.entry_id}:{}}))),this._draft.reading_value!==this._originalSnapshot.reading_value&&(e.reading_value=this._draft.reading_value??null),this._readingRows.length>0&&JSON.stringify(this._readingNumbers())!==this._readingsOriginal){let i=this._readingNumbers(),a={};for(let o of this._readingRows)a[o.id]=i[o.id]??null;e.reading_values=a}if(JSON.stringify(this._photos)!==this._photosOriginal&&(e.photo_doc_ids=[...this._photos]),O
Line truncated
|
`,d([y({attribute:!1})],de.prototype,"hass",2),d([y()],de.prototype,"docId",2),d([u()],de.prototype,"_url",2),d([u()],de.prototype,"_failed",2);customElements.get("maintenance-history-photo")||customElements.define("maintenance-history-photo",de)});var U,wr=w(()=>{"use strict";C();W();R();fe();Ht();Ae();Dt();U=class extends A{constructor(){super(...arguments);this._open=!1;this._saving=!1;this._error="";this._draft=null;this._originalSnapshot=null;this._partOptions=null;this._partQty={};this._partQtyOriginal="";this._photos=[];this._photosOriginal="";this._readingRows=[];this._readingText={};this._readingsOriginal="";this._uploadedIds=[];this._photoUploading=!1}get _lang(){return z(this.hass)}openEdit(e){this._draft={...e},this._originalSnapshot={...e},this._error="",this._open=!0,this._partOptions=null,this._partQty={},this._partQtyOriginal="",this._photos=[...e.photo_doc_ids??[]],this._photosOriginal=JSON.stringify(this._photos),this._uploadedIds=[],this._photoUploading=!1,this._seedReadings(e),this._loadPartOptions()}_seedReadings(e){let t=[],i=new Set;for(let o of e.readings??[])i.has(o.id)||(i.add(o.id),t.push({id:o.id,name:o.name,unit:o.unit??null}));for(let o of e.reading_values??[])i.has(o.id)||(i.add(o.id),t.push({id:o.id,name:o.name,unit:o.unit??null}));this._readingRows=t;let a={};for(let o of e.reading_values??[])a[o.id]=String(o.value);this._readingText=a,this._readingsOriginal=JSON.stringify(this._readingNumbers())}_readingNumbers(){let e={};for(let t of this._readingRows){let i=(this._readingText[t.id]??"").trim();if(i==="")continue;let a=parseFloat(i.replace(",","."));isNaN(a)||(e[t.id]=a)}return e}async _onPhotoInput(e){let t=e.target,i=Array.from(t.files??[]);t.value="";let a=this._draft;if(i.length===0||!a)return;let o=10-this._photos.length,p=i.slice(0,Math.max(o,0));this._photoUploading=!0,this._error="";try{for(let c of p){let h=await pt(this.hass,a.entry_id,c);this._uploadedIds=[...this._uploadedIds,h],this._photos=[...this._photos,h]}i.length>p.length&&(this._error=n("photos_limit",this._lang).replace("{max}",String(10)))}catch(c){let h=c instanceof Error&&c.message==="doc_too_large"?"doc_too_large":"doc_upload_failed";this._error=n(h,this._lang)}finally{this._photoUploading=!1}}_removePhoto(e){this._photos=this._photos.filter(t=>t!==e),this._uploadedIds.includes(e)&&(this._uploadedIds=this._uploadedIds.filter(t=>t!==e),Te(this.hass,[e]))}async _loadPartOptions(){let e=this._draft;if(e)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/parts/overview"}),i=[];for(let o of t.parts||[]){let p=o.entry_id===e.entry_id,c=o.consumers.some(h=>h.entry_id===e.entry_id&&h.task_id===e.task_id);!p&&!c||i.push({part_id:o.part_id,name:o.name,entry_id:o.entry_id,foreign:!p,object_name:o.object_name})}for(let o of e.used_parts||[]){let p=o.entry_id||e.entry_id;i.some(c=>c.part_id===o.part_id&&c.entry_id===p)||i.push({part_id:o.part_id,name:o.name||o.part_id,entry_id:p,foreign:p!==e.entry_id,object_name:null})}let a={};for(let o of e.used_parts||[])a[`${o.entry_id||e.entry_id}:${o.part_id}`]=o.quantity??1;this._partOptions=i,this._partQty=a,this._partQtyOriginal=this._partSelectionKey()}catch{this._partOptions=[]}}_partSelectionKey(){return JSON.stringify(Object.entries(this._partQty).filter(([,e])=>e>0).sort(([e],[t])=>e.localeCompare(t)))}close(){if(this._open=!1,this._error="",this._draft=null,this._originalSnapshot=null,this._uploadedIds.length>0){let e=this._uploadedIds;this._uploadedIds=[],Te(this.hass,e)}}_set(e,t){this._draft&&(this._draft={...this._draft,[e]:t})}async _save(){if(!(!this._draft||!this._originalSnapshot)){this._saving=!0,this._error="";try{let e={type:"maintenance_supporter/task/history/update",entry_id:this._draft.entry_id,task_id:this._draft.task_id,original_timestamp:this._originalSnapshot.original_timestamp};if(this._draft.timestamp!==this._originalSnapshot.timestamp&&(e.timestamp=this._draft.timestamp),this._draft.notes!==this._originalSnapshot.notes&&(e.notes=this._draft.notes),this._draft.cost!==this._originalSnapshot.cost&&(e.cost=this._draft.cost),this._draft.duration!==this._originalSnapshot.duration&&(e.duration=this._draft.duration),this._draft.completed_by!==this._originalSnapshot.completed_by&&(e.completed_by=this._draft.completed_by),this._partOptions!==null&&this._partSelectionKey()!==this._partQtyOriginal&&(e.used_parts=(this._partOptions||[]).filter(i=>(this._partQty[`${i.entry_id}:${i.part_id}`]||0)>0).map(i=>({part_id:i.part_id,quantity:this._partQty[`${i.entry_id}:${i.part_id}`],...i.foreign?{entry_id:i.entry_id}:{}}))),this._draft.reading_value!==this._originalSnapshot.reading_value&&(e.reading_value=this._draft.reading_value??null),this._readingRows.length>0&&JSON.stringify(this._readingNumbers())!==this._readingsOriginal){let i=this._readingNumbers(),a={};for(let o of this._readingRows)a[o.id]=i[o.id]??null;e.reading_values=a}if(JSON.stringify(this._photos)!==this._photosOriginal&&(e.photo_doc_ids=[...this._photos]),O
Line truncated
|
||||||
<div class="backdrop" @click=${this.close}></div>
|
<div class="backdrop" @click=${this.close}></div>
|
||||||
<div class="dialog" role="dialog" aria-modal="true">
|
<div class="dialog" role="dialog" aria-modal="true">
|
||||||
<h2>${n("history_edit_title",e)||"Edit history entry"}</h2>
|
<h2>${n("history_edit_title",e)||"Edit history entry"}</h2>
|
||||||
@@ -3445,7 +3478,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<input type="number" step="any"
|
<input type="number" step="any"
|
||||||
.value=${e.reading_value!=null?String(e.reading_value):""}
|
.value=${e.reading_value!=null?String(e.reading_value):""}
|
||||||
@input=${i=>{let a=i.target.value,o=a===""?NaN:Number(a);this._set("reading_value",isNaN(o)?null:o)}} />
|
@input=${i=>{let a=i.target.value,o=a===""?NaN:Number(a);this._set("reading_value",isNaN(o)?null:o)}} />
|
||||||
</label>`}};z.styles=E`
|
</label>`}};U.styles=E`
|
||||||
:host { display: contents; }
|
:host { display: contents; }
|
||||||
.backdrop {
|
.backdrop {
|
||||||
position: fixed; inset: 0;
|
position: fixed; inset: 0;
|
||||||
@@ -3557,7 +3590,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.photo-add:hover { border-color: var(--primary-color); }
|
.photo-add:hover { border-color: var(--primary-color); }
|
||||||
.photo-add input[type="file"] { display: none; }
|
.photo-add input[type="file"] { display: none; }
|
||||||
.photos-hint { font-size: 12px; color: var(--secondary-text-color); }
|
.photos-hint { font-size: 12px; color: var(--secondary-text-color); }
|
||||||
`,d([y({attribute:!1})],z.prototype,"hass",2),d([u()],z.prototype,"_open",2),d([u()],z.prototype,"_saving",2),d([u()],z.prototype,"_error",2),d([u()],z.prototype,"_draft",2),d([u()],z.prototype,"_partOptions",2),d([u()],z.prototype,"_partQty",2),d([u()],z.prototype,"_photos",2),d([u()],z.prototype,"_readingRows",2),d([u()],z.prototype,"_readingText",2),d([u()],z.prototype,"_photoUploading",2);customElements.get("maintenance-history-edit-dialog")||customElements.define("maintenance-history-edit-dialog",z)});function Te(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function br(s){return!s.startsWith("data:image/svg+xml,")&&!s.startsWith("data:image/png;base64,")?"":Te(s)}function Us(s){return s.replace(/[/\\:*?"<>|#%]+/g,"").replace(/\s+/g,"-").toLowerCase().substring(0,100)}var W,xr=w(()=>{"use strict";I();V();q();Ht();W=class extends A{constructor(){super(...arguments);this.lang="en";this._open=!1;this._loading=!1;this._error="";this._viewResult=null;this._completeResult=null;this._urlMode="companion";this._entryId="";this._taskId=null;this._objectName="";this._taskName="";this._generateSeq=0}openForObject(e,t){this._entryId=e,this._taskId=null,this._objectName=t,this._taskName="",this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}openForTask(e,t,i,a){this._entryId=e,this._taskId=t,this._objectName=i,this._taskName=a,this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}async _generate(){let e=++this._generateSeq;this._loading=!0,this._error="",this._viewResult=null,this._completeResult=null;try{let t={type:"maintenance_supporter/qr/generate",entry_id:this._entryId,url_mode:this._urlMode};this._taskId&&(t.task_id=this._taskId);let i=[this.hass.connection.sendMessagePromise({...t,action:"view"})];this._taskId&&i.push(this.hass.connection.sendMessagePromise({...t,action:"complete"}));let a=await Promise.all(i);if(e!==this._generateSeq)return;this._viewResult=a[0],a.length>1&&(this._completeResult=a[1])}catch(t){if(e!==this._generateSeq)return;let i=t?.code,a=t?.message;this._error=i==="no_url"||typeof a=="string"&&a.includes("No Home Assistant URL")?n("qr_error_no_url",this.lang):n("qr_error",this.lang)}finally{e===this._generateSeq&&(this._loading=!1)}}_setUrlMode(e){this._urlMode!==e&&(this._urlMode=e,this._generate())}_print(){if(!this._viewResult)return;let e=this._viewResult,t=e.label.task_name?`${e.label.object_name} \u2014 ${e.label.task_name}`:e.label.object_name,i=[e.label.manufacturer,e.label.model].filter(Boolean).join(" "),a=window.open("","_blank","width=600,height=500");if(!a)return;let o=this.lang||"en",p=Te(t),c=Te(i),h=!!this._completeResult,m=Te(n("qr_action_view",o)),f=Te(n("qr_action_complete",o));a.document.write(`<!DOCTYPE html><html><head><meta charset="utf-8">
|
`,d([y({attribute:!1})],U.prototype,"hass",2),d([u()],U.prototype,"_open",2),d([u()],U.prototype,"_saving",2),d([u()],U.prototype,"_error",2),d([u()],U.prototype,"_draft",2),d([u()],U.prototype,"_partOptions",2),d([u()],U.prototype,"_partQty",2),d([u()],U.prototype,"_photos",2),d([u()],U.prototype,"_readingRows",2),d([u()],U.prototype,"_readingText",2),d([u()],U.prototype,"_photoUploading",2);customElements.get("maintenance-history-edit-dialog")||customElements.define("maintenance-history-edit-dialog",U)});function Ie(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function $r(s){return!s.startsWith("data:image/svg+xml,")&&!s.startsWith("data:image/png;base64,")?"":Ie(s)}function Ks(s){return s.replace(/[/\\:*?"<>|#%]+/g,"").replace(/\s+/g,"-").toLowerCase().substring(0,100)}var K,kr=w(()=>{"use strict";C();W();R();Ot();K=class extends A{constructor(){super(...arguments);this.lang="en";this._open=!1;this._loading=!1;this._error="";this._viewResult=null;this._completeResult=null;this._urlMode="companion";this._entryId="";this._taskId=null;this._objectName="";this._taskName="";this._generateSeq=0}openForObject(e,t){this._entryId=e,this._taskId=null,this._objectName=t,this._taskName="",this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}openForTask(e,t,i,a){this._entryId=e,this._taskId=t,this._objectName=i,this._taskName=a,this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}async _generate(){let e=++this._generateSeq;this._loading=!0,this._error="",this._viewResult=null,this._completeResult=null;try{let t={type:"maintenance_supporter/qr/generate",entry_id:this._entryId,url_mode:this._urlMode};this._taskId&&(t.task_id=this._taskId);let i=[this.hass.connection.sendMessagePromise({...t,action:"view"})];this._taskId&&i.push(this.hass.connection.sendMessagePromise({...t,action:"complete"}));let a=await Promise.all(i);if(e!==this._generateSeq)return;this._viewResult=a[0],a.length>1&&(this._completeResult=a[1])}catch(t){if(e!==this._generateSeq)return;let i=t?.code,a=t?.message;this._error=i==="no_url"||typeof a=="string"&&a.includes("No Home Assistant URL")?n("qr_error_no_url",this.lang):n("qr_error",this.lang)}finally{e===this._generateSeq&&(this._loading=!1)}}_setUrlMode(e){this._urlMode!==e&&(this._urlMode=e,this._generate())}_print(){if(!this._viewResult)return;let e=this._viewResult,t=e.label.task_name?`${e.label.object_name} \u2014 ${e.label.task_name}`:e.label.object_name,i=[e.label.manufacturer,e.label.model].filter(Boolean).join(" "),a=window.open("","_blank","width=600,height=500");if(!a)return;let o=this.lang||"en",p=Ie(t),c=Ie(i),h=!!this._completeResult,m=Ie(n("qr_action_view",o)),f=Ie(n("qr_action_complete",o));a.document.write(`<!DOCTYPE html><html><head><meta charset="utf-8">
|
||||||
<meta name="color-scheme" content="light">
|
<meta name="color-scheme" content="light">
|
||||||
<title>${p}</title>
|
<title>${p}</title>
|
||||||
<style>
|
<style>
|
||||||
@@ -3579,17 +3612,17 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
${c?`<div class="sub">${c}</div>`:""}
|
${c?`<div class="sub">${c}</div>`:""}
|
||||||
<div class="qr-row">
|
<div class="qr-row">
|
||||||
<div class="qr-col">
|
<div class="qr-col">
|
||||||
<img src="${br(this._viewResult.svg_data_uri)}" alt="QR Info" />
|
<img src="${$r(this._viewResult.svg_data_uri)}" alt="QR Info" />
|
||||||
<div class="qr-label">${m}</div>
|
<div class="qr-label">${m}</div>
|
||||||
</div>
|
</div>
|
||||||
${h?`<div class="qr-col">
|
${h?`<div class="qr-col">
|
||||||
<img src="${br(this._completeResult.svg_data_uri)}" alt="QR Complete" />
|
<img src="${$r(this._completeResult.svg_data_uri)}" alt="QR Complete" />
|
||||||
<div class="qr-label">${f}</div>
|
<div class="qr-label">${f}</div>
|
||||||
</div>`:""}
|
</div>`:""}
|
||||||
</div>
|
</div>
|
||||||
<div class="url">${Te(this._viewResult.url)}</div>
|
<div class="url">${Ie(this._viewResult.url)}</div>
|
||||||
<script>setTimeout(()=>window.print(),300)<\/script>
|
<script>setTimeout(()=>window.print(),300)<\/script>
|
||||||
</body></html>`),a.document.close()}_downloadSvg(e,t){let i=decodeURIComponent(e.svg_data_uri.replace("data:image/svg+xml,","")),a=this._taskName?`${this._objectName}-${this._taskName}`:this._objectName;mr(i,`qr-${Us(a)}-${t}.svg`,"image/svg+xml")}_close(){this._open=!1,this._viewResult=null,this._completeResult=null,this._error="",this._loading=!1}render(){if(!this._open)return l``;let e=this.lang||this.hass?.language||"en",t=this._taskName?`${n("qr_code",e)}: ${this._objectName} \u2014 ${this._taskName}`:`${n("qr_code",e)}: ${this._objectName}`,i=!!this._viewResult;return l`
|
</body></html>`),a.document.close()}_downloadSvg(e,t){let i=decodeURIComponent(e.svg_data_uri.replace("data:image/svg+xml,","")),a=this._taskName?`${this._objectName}-${this._taskName}`:this._objectName;yr(i,`qr-${Ks(a)}-${t}.svg`,"image/svg+xml")}_close(){this._open=!1,this._viewResult=null,this._completeResult=null,this._error="",this._loading=!1}render(){if(!this._open)return l``;let e=this.lang||this.hass?.language||"en",t=this._taskName?`${n("qr_code",e)}: ${this._objectName} \u2014 ${this._taskName}`:`${n("qr_code",e)}: ${this._objectName}`,i=!!this._viewResult;return l`
|
||||||
<ha-dialog open @closed=${this._close}>
|
<ha-dialog open @closed=${this._close}>
|
||||||
<div class="dialog-title">${t}</div>
|
<div class="dialog-title">${t}</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -3650,7 +3683,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
</ha-button>
|
</ha-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
`}};W.styles=E`
|
`}};K.styles=E`
|
||||||
.dialog-title {
|
.dialog-title {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -3768,30 +3801,30 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
color: var(--text-primary-color, #fff);
|
color: var(--text-primary-color, #fff);
|
||||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
`,d([y({attribute:!1})],W.prototype,"hass",2),d([y()],W.prototype,"lang",2),d([u()],W.prototype,"_open",2),d([u()],W.prototype,"_loading",2),d([u()],W.prototype,"_error",2),d([u()],W.prototype,"_viewResult",2),d([u()],W.prototype,"_completeResult",2),d([u()],W.prototype,"_urlMode",2);customElements.get("maintenance-qr-dialog")||customElements.define("maintenance-qr-dialog",W)});function Bs(s,r){if(r<=0)return 0;let e=typeof s=="number"&&Number.isFinite(s)?Math.trunc(s):0;return e<0?0:e%r}function Vs(s){return!!(s?.phases&&s.phase_sequence&&s.phase_sequence.length>0)}function Dt(s){if(!s||!Vs(s))return null;let r=s.phase_sequence,e=Bs(s.phase_cursor,r.length),t=r[e],i=s.phases?.[t];return i?{id:t,name:i.name,index:e,count:r.length,notes:i.notes,checklist:i.checklist!==void 0?i.checklist:s.checklist??[],consumesParts:i.consumes_parts!==void 0?i.consumes_parts:s.consumes_parts??[],requiredFields:i.required_completion_fields!==void 0?i.required_completion_fields:s.required_completion_fields??[]}:null}function Ye(s){let r=Dt(s);return r?`${r.index+1}/${r.count} \xB7 ${r.name}`:""}var Mt=w(()=>{"use strict"});function wr(s){let r=s.task??null,e=r?Dt(r):null,t=e?e.consumesParts:r?.consumes_parts||[],i=!!r?.part_ref,a=s.objects.find(c=>c.entry_id===s.entryId)?.parts||[],o=i?a.find(c=>c.id===r.part_ref.part_id):void 0,p=s.checklistsEnabled??!0;return{entry_id:s.entryId,task_id:s.taskId,task_name:s.taskName,checklist:e?p?e.checklist:[]:s.checklist??[],adaptive_enabled:!!s.adaptiveEnabled,required_completion_fields:e?e.requiredFields:r?.required_completion_fields||[],task_type:r?.type||"",reading_unit:r?.reading_unit||"",readings:r?.readings||[],reading_history:Yi(r?.history),parts:i?[]:ar({consumes_parts:t},s.entryId,s.objects,s.lang),consumes_parts:i?[]:t,phase_label:e?Ye(r):"",require_tag_scan:!!r?.require_tag_scan,restock_default:i?o?.restock_quantity??1:null,restock_unit_cost:i?o?.cost??null:null,currency_symbol:s.currencySymbol??"",consumes_info:t.map(c=>nr(c,s.entryId,s.objects,s.lang)),checklist_prefill:r?.checklist_progress||{},via_tag_scan:!!s.viaTagScan}}function $r(s,r,e){s.entryId=r.entry_id,s.taskId=r.task_id,s.taskName=r.task_name,s.lang=e,s.checklist=r.checklist??[],s.adaptiveEnabled=!!r.adaptive_enabled,s.requiredFields=r.required_completion_fields??[],s.taskType=r.task_type??"",s.readingUnit=r.reading_unit??"",s.readings=r.readings??[],s.readingHistory=r.reading_history??[],s.parts=r.parts??[],s.consumesParts=r.consumes_parts??[],s.phaseLabel=r.phase_label??"",s.requireTagScan=!!r.require_tag_scan,s.restockDefault=r.restock_default??null,s.restockUnitCost=r.restock_unit_cost??null,s.currencySymbol=r.currency_symbol??"",s.consumesInfo=r.consumes_info??[],s.checklistPrefill=r.checklist_prefill??{},s.viaTagScan=!!r.via_tag_scan,s.open({viaTagScan:!!r.via_tag_scan})}var zt=w(()=>{"use strict";Ee();lt();Mt()});function S(s){return s.toFixed(1)}var Ft=w(()=>{"use strict";q()});function kr(s,r){let e=s.interval_analysis,t=e?.weibull_beta,i=e?.weibull_eta;if(t==null||i==null||i<=0)return _;let a=s.interval_days??0,o=s.suggested_interval??a;return l`
|
`,d([y({attribute:!1})],K.prototype,"hass",2),d([y()],K.prototype,"lang",2),d([u()],K.prototype,"_open",2),d([u()],K.prototype,"_loading",2),d([u()],K.prototype,"_error",2),d([u()],K.prototype,"_viewResult",2),d([u()],K.prototype,"_completeResult",2),d([u()],K.prototype,"_urlMode",2);customElements.get("maintenance-qr-dialog")||customElements.define("maintenance-qr-dialog",K)});function Ys(s,r){if(r<=0)return 0;let e=typeof s=="number"&&Number.isFinite(s)?Math.trunc(s):0;return e<0?0:e%r}function Gs(s){return!!(s?.phases&&s.phase_sequence&&s.phase_sequence.length>0)}function Mt(s){if(!s||!Gs(s))return null;let r=s.phase_sequence,e=Ys(s.phase_cursor,r.length),t=r[e],i=s.phases?.[t];return i?{id:t,name:i.name,index:e,count:r.length,notes:i.notes,checklist:i.checklist!==void 0?i.checklist:s.checklist??[],consumesParts:i.consumes_parts!==void 0?i.consumes_parts:s.consumes_parts??[],requiredFields:i.required_completion_fields!==void 0?i.required_completion_fields:s.required_completion_fields??[]}:null}function Qe(s){let r=Mt(s);return r?`${r.index+1}/${r.count} \xB7 ${r.name}`:""}var zt=w(()=>{"use strict"});function Er(s){let r=s.task??null,e=r?Mt(r):null,t=e?e.consumesParts:r?.consumes_parts||[],i=!!r?.part_ref,a=s.objects.find(c=>c.entry_id===s.entryId)?.parts||[],o=i?a.find(c=>c.id===r.part_ref.part_id):void 0,p=s.checklistsEnabled??!0;return{entry_id:s.entryId,task_id:s.taskId,task_name:s.taskName,checklist:e?p?e.checklist:[]:s.checklist??[],adaptive_enabled:!!s.adaptiveEnabled,required_completion_fields:e?e.requiredFields:r?.required_completion_fields||[],task_type:r?.type||"",reading_unit:r?.reading_unit||"",readings:r?.readings||[],reading_history:Gi(r?.history),parts:i?[]:dr({consumes_parts:t},s.entryId,s.objects,s.lang),consumes_parts:i?[]:t,phase_label:e?Qe(r):"",require_tag_scan:!!r?.require_tag_scan,restock_default:i?o?.restock_quantity??1:null,restock_unit_cost:i?o?.cost??null:null,currency_symbol:s.currencySymbol??"",consumes_info:t.map(c=>lr(c,s.entryId,s.objects,s.lang)),checklist_prefill:r?.checklist_progress||{},via_tag_scan:!!s.viaTagScan}}function Sr(s,r,e){s.entryId=r.entry_id,s.taskId=r.task_id,s.taskName=r.task_name,s.lang=e,s.checklist=r.checklist??[],s.adaptiveEnabled=!!r.adaptive_enabled,s.requiredFields=r.required_completion_fields??[],s.taskType=r.task_type??"",s.readingUnit=r.reading_unit??"",s.readings=r.readings??[],s.readingHistory=r.reading_history??[],s.parts=r.parts??[],s.consumesParts=r.consumes_parts??[],s.phaseLabel=r.phase_label??"",s.requireTagScan=!!r.require_tag_scan,s.restockDefault=r.restock_default??null,s.restockUnitCost=r.restock_unit_cost??null,s.currencySymbol=r.currency_symbol??"",s.consumesInfo=r.consumes_info??[],s.checklistPrefill=r.checklist_prefill??{},s.viaTagScan=!!r.via_tag_scan,s.open({viaTagScan:!!r.via_tag_scan})}var Ut=w(()=>{"use strict";Ee();dt();zt()});function S(s){return s.toFixed(1)}var Ft=w(()=>{"use strict";R()});function Ar(s,r){let e=s.interval_analysis,t=e?.weibull_beta,i=e?.weibull_eta;if(t==null||i==null||i<=0)return _;let a=s.interval_days??0,o=s.suggested_interval??a;return l`
|
||||||
<div class="weibull-section">
|
<div class="weibull-section">
|
||||||
<div class="weibull-title">
|
<div class="weibull-title">
|
||||||
<ha-svg-icon aria-hidden="true" path="M3,14L3.5,14.07L8.07,9.5C7.89,8.85 8.06,8.11 8.59,7.59C9.37,6.8 10.63,6.8 11.41,7.59C11.94,8.11 12.11,8.85 11.93,9.5L14.5,12.07L15,12C15.18,12 15.35,12 15.5,12.07L19.07,8.5C19,8.35 19,8.18 19,8A2,2 0 0,1 21,6A2,2 0 0,1 23,8A2,2 0 0,1 21,10C20.82,10 20.65,10 20.5,9.93L16.93,13.5C17,13.65 17,13.82 17,14A2,2 0 0,1 15,16A2,2 0 0,1 13,14L13.07,13.5L10.5,10.93C10.18,11 9.82,11 9.5,10.93L4.93,15.5L5,16A2,2 0 0,1 3,18A2,2 0 0,1 1,16A2,2 0 0,1 3,14Z"></ha-svg-icon>
|
<ha-svg-icon aria-hidden="true" path="M3,14L3.5,14.07L8.07,9.5C7.89,8.85 8.06,8.11 8.59,7.59C9.37,6.8 10.63,6.8 11.41,7.59C11.94,8.11 12.11,8.85 11.93,9.5L14.5,12.07L15,12C15.18,12 15.35,12 15.5,12.07L19.07,8.5C19,8.35 19,8.18 19,8A2,2 0 0,1 21,6A2,2 0 0,1 23,8A2,2 0 0,1 21,10C20.82,10 20.65,10 20.5,9.93L16.93,13.5C17,13.65 17,13.82 17,14A2,2 0 0,1 15,16A2,2 0 0,1 13,14L13.07,13.5L10.5,10.93C10.18,11 9.82,11 9.5,10.93L4.93,15.5L5,16A2,2 0 0,1 3,18A2,2 0 0,1 1,16A2,2 0 0,1 3,14Z"></ha-svg-icon>
|
||||||
${n("weibull_reliability_curve",r)}
|
${n("weibull_reliability_curve",r)}
|
||||||
${Ws(t,r)}
|
${Qs(t,r)}
|
||||||
</div>
|
</div>
|
||||||
${Ks(t,i,a,o,r)}
|
${Js(t,i,a,o,r)}
|
||||||
${Ys(e,r)}
|
${Zs(e,r)}
|
||||||
${e?.confidence_interval_low!=null?Gs(e,s,r):_}
|
${e?.confidence_interval_low!=null?Xs(e,s,r):_}
|
||||||
</div>
|
</div>
|
||||||
`}function Ws(s,r){let e,t,i;return s<.8?(e="early_failures",t="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z",i="beta_early_failures"):s<=1.2?(e="random_failures",t="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,17H11V15H13V17M13,13H11V7H13V13Z",i="beta_random_failures"):s<=3.5?(e="wear_out",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,6A6,6 0 0,1 18,12H12V6Z",i="beta_wear_out"):(e="highly_predictable",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z",i="beta_highly_predictable"),l`
|
`}function Qs(s,r){let e,t,i;return s<.8?(e="early_failures",t="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z",i="beta_early_failures"):s<=1.2?(e="random_failures",t="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,17H11V15H13V17M13,13H11V7H13V13Z",i="beta_random_failures"):s<=3.5?(e="wear_out",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,6A6,6 0 0,1 18,12H12V6Z",i="beta_wear_out"):(e="highly_predictable",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z",i="beta_highly_predictable"),l`
|
||||||
<span class="beta-badge ${e}">
|
<span class="beta-badge ${e}">
|
||||||
<ha-svg-icon path="${t}"></ha-svg-icon>
|
<ha-svg-icon path="${t}"></ha-svg-icon>
|
||||||
${n(i,r)} (\u03B2=${P(s,r,2)})
|
${n(i,r)} (\u03B2=${P(s,r,2)})
|
||||||
</span>
|
</span>
|
||||||
`}function Ks(s,r,e,t,i){let v=Math.max(e,t,r,1)*1.3,k=50,T=[];for(let R=0;R<=k;R++){let H=R/k*v,ce=1-Math.exp(-Math.pow(H/r,s)),Ie=32+H/v*260,Pe=136-ce*128;T.push([Ie,Pe])}let D=T.map(([R,H])=>`${S(R)},${S(H)}`).join(" "),F="M32,136 "+T.map(([R,H])=>`L${S(R)},${S(H)}`).join(" ")+` L${S(T[k][0])},136 Z`,j=32+e/v*260,K=1-Math.exp(-Math.pow(e/r,s)),oe=136-K*128,b=P((1-K)*100,i,0),Y=32+t/v*260,ve=[0,.25,.5,.75,1];return l`
|
`}function Js(s,r,e,t,i){let v=Math.max(e,t,r,1)*1.3,k=50,T=[];for(let N=0;N<=k;N++){let H=N/k*v,ce=1-Math.exp(-Math.pow(H/r,s)),Pe=32+H/v*260,Le=136-ce*128;T.push([Pe,Le])}let M=T.map(([N,H])=>`${S(N)},${S(H)}`).join(" "),F="M32,136 "+T.map(([N,H])=>`L${S(N)},${S(H)}`).join(" ")+` L${S(T[k][0])},136 Z`,j=32+e/v*260,Y=1-Math.exp(-Math.pow(e/r,s)),oe=136-Y*128,b=P((1-Y)*100,i,0),G=32+t/v*260,ve=[0,.25,.5,.75,1];return l`
|
||||||
<div class="weibull-chart">
|
<div class="weibull-chart">
|
||||||
<svg viewBox="0 0 ${300} ${160}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${n("chart_weibull",i)}">
|
<svg viewBox="0 0 ${300} ${160}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${n("chart_weibull",i)}">
|
||||||
${ve.map(R=>{let H=136-R*128;return xe`
|
${ve.map(N=>{let H=136-N*128;return xe`
|
||||||
<line x1="${32}" y1="${S(H)}" x2="${292}" y2="${S(H)}"
|
<line x1="${32}" y1="${S(H)}" x2="${292}" y2="${S(H)}"
|
||||||
stroke="var(--divider-color)" stroke-width="0.5" stroke-dasharray="${R===.5?"4,3":_}" />
|
stroke="var(--divider-color)" stroke-width="0.5" stroke-dasharray="${N===.5?"4,3":_}" />
|
||||||
<text x="${28}" y="${S(H+3)}" fill="var(--secondary-text-color)"
|
<text x="${28}" y="${S(H+3)}" fill="var(--secondary-text-color)"
|
||||||
font-size="8" text-anchor="end">${P(R*100,i,0)}%</text>
|
font-size="8" text-anchor="end">${P(N*100,i,0)}%</text>
|
||||||
`})}
|
`})}
|
||||||
|
|
||||||
<text x="${32}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">0</text>
|
<text x="${32}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">0</text>
|
||||||
@@ -3799,7 +3832,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
<text x="${292}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">${Math.round(v)}</text>
|
<text x="${292}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">${Math.round(v)}</text>
|
||||||
|
|
||||||
<path d="${F}" fill="var(--primary-color, #03a9f4)" opacity="0.08" />
|
<path d="${F}" fill="var(--primary-color, #03a9f4)" opacity="0.08" />
|
||||||
<polyline points="${D}" fill="none"
|
<polyline points="${M}" fill="none"
|
||||||
stroke="var(--primary-color, #03a9f4)" stroke-width="2" />
|
stroke="var(--primary-color, #03a9f4)" stroke-width="2" />
|
||||||
|
|
||||||
${e>0?xe`
|
${e>0?xe`
|
||||||
@@ -3812,7 +3845,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
`:_}
|
`:_}
|
||||||
|
|
||||||
${t>0&&t!==e?xe`
|
${t>0&&t!==e?xe`
|
||||||
<line x1="${S(Y)}" y1="${8}" x2="${S(Y)}" y2="${S(136)}"
|
<line x1="${S(G)}" y1="${8}" x2="${S(G)}" y2="${S(136)}"
|
||||||
stroke="var(--success-color, #4caf50)" stroke-width="1.5" stroke-dasharray="4,3" />
|
stroke="var(--success-color, #4caf50)" stroke-width="1.5" stroke-dasharray="4,3" />
|
||||||
`:_}
|
`:_}
|
||||||
|
|
||||||
@@ -3827,7 +3860,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
${e>0?l`<span class="legend-item"><span class="legend-swatch" style="background:var(--primary-color, #03a9f4); opacity:0.5"></span> ${n("current_interval_marker",i)}</span>`:_}
|
${e>0?l`<span class="legend-item"><span class="legend-swatch" style="background:var(--primary-color, #03a9f4); opacity:0.5"></span> ${n("current_interval_marker",i)}</span>`:_}
|
||||||
${t>0&&t!==e?l`<span class="legend-item"><span class="legend-swatch" style="background:var(--success-color, #4caf50)"></span> ${n("recommended_marker",i)}</span>`:_}
|
${t>0&&t!==e?l`<span class="legend-item"><span class="legend-swatch" style="background:var(--success-color, #4caf50)"></span> ${n("recommended_marker",i)}</span>`:_}
|
||||||
</div>
|
</div>
|
||||||
`}function Ys(s,r){return l`
|
`}function Zs(s,r){return l`
|
||||||
<div class="weibull-info-row">
|
<div class="weibull-info-row">
|
||||||
<div class="weibull-info-item">
|
<div class="weibull-info-item">
|
||||||
<span>${n("characteristic_life",r)}</span>
|
<span>${n("characteristic_life",r)}</span>
|
||||||
@@ -3840,7 +3873,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
</div>
|
</div>
|
||||||
`:_}
|
`:_}
|
||||||
</div>
|
</div>
|
||||||
`}function Gs(s,r,e){let t=s.confidence_interval_low,i=s.confidence_interval_high,a=r.suggested_interval??r.interval_days??0,o=r.interval_days??0,p=Math.max(0,t-5),h=i+5-p,m=(t-p)/h*100,f=(i-t)/h*100,x=(a-p)/h*100,v=o>0?(o-p)/h*100:-1;return l`
|
`}function Xs(s,r,e){let t=s.confidence_interval_low,i=s.confidence_interval_high,a=r.suggested_interval??r.interval_days??0,o=r.interval_days??0,p=Math.max(0,t-5),h=i+5-p,m=(t-p)/h*100,f=(i-t)/h*100,x=(a-p)/h*100,v=o>0?(o-p)/h*100:-1;return l`
|
||||||
<div class="confidence-range">
|
<div class="confidence-range">
|
||||||
<div class="confidence-range-title">
|
<div class="confidence-range-title">
|
||||||
${n("confidence_interval",e)}: ${a} ${n("days",e)} (${t}\u2013${i})
|
${n("confidence_interval",e)}: ${a} ${n("days",e)} (${t}\u2013${i})
|
||||||
@@ -3855,7 +3888,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
<span class="confidence-text high">${n("confidence_aggressive",e)} (${i}${n("days",e).charAt(0)})</span>
|
<span class="confidence-text high">${n("confidence_aggressive",e)} (${i}${n("days",e).charAt(0)})</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}var Er=w(()=>{"use strict";I();q();Ft()});function Sr(s,r,e){let t=s.degradation_trend!=null&&s.degradation_trend!=="insufficient_data",i=s.days_until_threshold!=null,a=s.environmental_factor!=null&&s.environmental_factor!==1;if(!t&&!i&&!a)return _;let o=s.degradation_trend==="rising"?"M16,6L18.29,8.29L13.41,13.17L9.41,9.17L2,16.59L3.41,18L9.41,12L13.41,16L19.71,9.71L22,12V6H16Z":s.degradation_trend==="falling"?"M16,18L18.29,15.71L13.41,10.83L9.41,14.83L2,7.41L3.41,6L9.41,12L13.41,8L19.71,14.29L22,12V18H16Z":"M22,12L18,8V11H3V13H18V16L22,12Z";return l`
|
`}var Tr=w(()=>{"use strict";C();R();Ft()});function Ir(s,r,e){let t=s.degradation_trend!=null&&s.degradation_trend!=="insufficient_data",i=s.days_until_threshold!=null,a=s.environmental_factor!=null&&s.environmental_factor!==1;if(!t&&!i&&!a)return _;let o=s.degradation_trend==="rising"?"M16,6L18.29,8.29L13.41,13.17L9.41,9.17L2,16.59L3.41,18L9.41,12L13.41,16L19.71,9.71L22,12V6H16Z":s.degradation_trend==="falling"?"M16,18L18.29,15.71L13.41,10.83L9.41,14.83L2,7.41L3.41,6L9.41,12L13.41,8L19.71,14.29L22,12V18H16Z":"M22,12L18,8V11H3V13H18V16L22,12Z";return l`
|
||||||
<div class="prediction-section">
|
<div class="prediction-section">
|
||||||
${s.sensor_prediction_urgency?l`
|
${s.sensor_prediction_urgency?l`
|
||||||
<div class="prediction-urgency-banner">
|
<div class="prediction-urgency-banner">
|
||||||
@@ -3881,7 +3914,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
<ha-svg-icon path="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z"></ha-svg-icon>
|
<ha-svg-icon path="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z"></ha-svg-icon>
|
||||||
<span class="prediction-label">${n("days_until_threshold",r)}</span>
|
<span class="prediction-label">${n("days_until_threshold",r)}</span>
|
||||||
<span class="prediction-value prediction-days${s.days_until_threshold===0?" exceeded":s.sensor_prediction_urgency?" urgent":""}">${s.days_until_threshold===0?n("threshold_exceeded",r):"~"+Math.round(s.days_until_threshold)+" "+n("days",r)}</span>
|
<span class="prediction-value prediction-days${s.days_until_threshold===0?" exceeded":s.sensor_prediction_urgency?" urgent":""}">${s.days_until_threshold===0?n("threshold_exceeded",r):"~"+Math.round(s.days_until_threshold)+" "+n("days",r)}</span>
|
||||||
${s.threshold_prediction_date?l`<span class="prediction-date">${te(s.threshold_prediction_date,r)}</span>`:_}
|
${s.threshold_prediction_date?l`<span class="prediction-date">${B(s.threshold_prediction_date,r)}</span>`:_}
|
||||||
${s.threshold_prediction_confidence?l`<span class="confidence-dot ${s.threshold_prediction_confidence}"></span>`:_}
|
${s.threshold_prediction_confidence?l`<span class="confidence-dot ${s.threshold_prediction_confidence}"></span>`:_}
|
||||||
${(s.prediction_cycles??0)>0?l`<span class="prediction-cycles">${n("prediction_cycles",r)}: ${s.prediction_cycles}</span>`:_}
|
${(s.prediction_cycles??0)>0?l`<span class="prediction-cycles">${n("prediction_cycles",r)}: ${s.prediction_cycles}</span>`:_}
|
||||||
</div>
|
</div>
|
||||||
@@ -3891,12 +3924,12 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
<ha-svg-icon path="M15,13V5A3,3 0 0,0 12,2A3,3 0 0,0 9,5V13A5,5 0 0,0 7,17A5,5 0 0,0 12,22A5,5 0 0,0 17,17A5,5 0 0,0 15,13M12,4A1,1 0 0,1 13,5V8H11V5A1,1 0 0,1 12,4Z"></ha-svg-icon>
|
<ha-svg-icon path="M15,13V5A3,3 0 0,0 12,2A3,3 0 0,0 9,5V13A5,5 0 0,0 7,17A5,5 0 0,0 12,22A5,5 0 0,0 17,17A5,5 0 0,0 15,13M12,4A1,1 0 0,1 13,5V8H11V5A1,1 0 0,1 12,4Z"></ha-svg-icon>
|
||||||
<span class="prediction-label">${n("environmental_adjustment",r)}</span>
|
<span class="prediction-label">${n("environmental_adjustment",r)}</span>
|
||||||
<span class="prediction-value">${P(s.environmental_factor,r,2)}x</span>
|
<span class="prediction-value">${P(s.environmental_factor,r,2)}x</span>
|
||||||
${s.environmental_entity?l`<span class="prediction-entity entity-link" @click=${p=>Ui(p,s.environmental_entity)}>${s.environmental_entity}</span>`:_}
|
${s.environmental_entity?l`<span class="prediction-entity entity-link" @click=${p=>Bi(p,s.environmental_entity)}>${s.environmental_entity}</span>`:_}
|
||||||
</div>
|
</div>
|
||||||
`:_}
|
`:_}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}var Ar=w(()=>{"use strict";I();q()});function Tr(s,r,e,t){let i=Math.max(s||1,r);return l`
|
`}var Cr=w(()=>{"use strict";C();R()});function Pr(s,r,e,t){let i=Math.max(s||1,r);return l`
|
||||||
<div class="interval-comparison">
|
<div class="interval-comparison">
|
||||||
<div class="interval-bar">
|
<div class="interval-bar">
|
||||||
<div class="interval-label">
|
<div class="interval-label">
|
||||||
@@ -3914,7 +3947,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
style="width: ${Math.min(r/i*100,100)}%"></div>
|
style="width: ${Math.min(r/i*100,100)}%"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}var Cr=w(()=>{"use strict";I();q()});function Pr(s,r,e){if(!e.seasonal||!s.seasonal_factor||s.seasonal_factor===1)return _;let t=Ir.map(p=>n(p,r)),i=new Date().getMonth(),a=s.seasonal_factors||s.interval_analysis?.seasonal_factors||null,o=a&&a.length===12?a:t.map((p,c)=>{let h=s.seasonal_factor||1,m=Math.sin((c-6)*Math.PI/6)*.3;return Math.max(.7,Math.min(1.3,h+m))});return l`
|
`}var Lr=w(()=>{"use strict";C();R()});function Nr(s,r,e){if(!e.seasonal||!s.seasonal_factor||s.seasonal_factor===1)return _;let t=Rr.map(p=>n(p,r)),i=new Date().getMonth(),a=s.seasonal_factors||s.interval_analysis?.seasonal_factors||null,o=a&&a.length===12?a:t.map((p,c)=>{let h=s.seasonal_factor||1,m=Math.sin((c-6)*Math.PI/6)*.3;return Math.max(.7,Math.min(1.3,h+m))});return l`
|
||||||
<div class="seasonal-card-compact">
|
<div class="seasonal-card-compact">
|
||||||
<h4>${n("seasonal_awareness",r)}</h4>
|
<h4>${n("seasonal_awareness",r)}</h4>
|
||||||
<div class="seasonal-mini-chart">
|
<div class="seasonal-mini-chart">
|
||||||
@@ -3931,7 +3964,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
<span class="legend-item"><span class="dot high"></span> ${n("longer",r)||"L\xE4nger"}</span>
|
<span class="legend-item"><span class="dot high"></span> ${n("longer",r)||"L\xE4nger"}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}function Lr(s,r){return Qs(s,r)}function Qs(s,r){let e=s.seasonal_factors??s.interval_analysis?.seasonal_factors;if(!e||e.length!==12)return _;let t=s.interval_analysis?.seasonal_reason,i=new Date().getMonth(),a=300,o=100,p=8,h=o-p-4,m=Math.max(...e,1.5),f=a/12,x=f*.65,v=p+h-1/m*h;return l`
|
`}function qr(s,r){return en(s,r)}function en(s,r){let e=s.seasonal_factors??s.interval_analysis?.seasonal_factors;if(!e||e.length!==12)return _;let t=s.interval_analysis?.seasonal_reason,i=new Date().getMonth(),a=300,o=100,p=8,h=o-p-4,m=Math.max(...e,1.5),f=a/12,x=f*.65,v=p+h-1/m*h;return l`
|
||||||
<div class="seasonal-chart">
|
<div class="seasonal-chart">
|
||||||
<div class="seasonal-chart-title">
|
<div class="seasonal-chart-title">
|
||||||
<ha-svg-icon aria-hidden="true" path="M17.75 4.09L15.22 6.03L16.13 9.09L13.5 7.28L10.87 9.09L11.78 6.03L9.25 4.09L12.44 4L13.5 1L14.56 4L17.75 4.09M21.25 11L19.61 12.25L20.2 14.23L18.5 13.06L16.8 14.23L17.39 12.25L15.75 11L17.81 10.95L18.5 9L19.19 10.95L21.25 11M18.97 15.95C19.8 15.87 20.69 17.05 20.16 17.8C19.84 18.25 19.5 18.67 19.08 19.07C15.17 23 8.84 23 4.94 19.07C1.03 15.17 1.03 8.83 4.94 4.93C5.34 4.53 5.76 4.17 6.21 3.85C6.96 3.32 8.14 4.21 8.06 5.04C7.79 7.9 8.75 10.87 10.95 13.06C13.14 15.26 16.1 16.22 18.97 15.95Z"></ha-svg-icon>
|
<ha-svg-icon aria-hidden="true" path="M17.75 4.09L15.22 6.03L16.13 9.09L13.5 7.28L10.87 9.09L11.78 6.03L9.25 4.09L12.44 4L13.5 1L14.56 4L17.75 4.09M21.25 11L19.61 12.25L20.2 14.23L18.5 13.06L16.8 14.23L17.39 12.25L15.75 11L17.81 10.95L18.5 9L19.19 10.95L21.25 11M18.97 15.95C19.8 15.87 20.69 17.05 20.16 17.8C19.84 18.25 19.5 18.67 19.08 19.07C15.17 23 8.84 23 4.94 19.07C1.03 15.17 1.03 8.83 4.94 4.93C5.34 4.53 5.76 4.17 6.21 3.85C6.96 3.32 8.14 4.21 8.06 5.04C7.79 7.9 8.75 10.87 10.95 13.06C13.14 15.26 16.1 16.22 18.97 15.95Z"></ha-svg-icon>
|
||||||
@@ -3941,20 +3974,20 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
<svg viewBox="0 0 ${a} ${o}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${n("chart_seasonal",r)}">
|
<svg viewBox="0 0 ${a} ${o}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${n("chart_seasonal",r)}">
|
||||||
<line x1="0" y1="${S(v)}" x2="${a}" y2="${S(v)}"
|
<line x1="0" y1="${S(v)}" x2="${a}" y2="${S(v)}"
|
||||||
stroke="var(--divider-color)" stroke-width="1" stroke-dasharray="4,3" />
|
stroke="var(--divider-color)" stroke-width="1" stroke-dasharray="4,3" />
|
||||||
${e.map((k,T)=>{let D=k/m*h,F=T*f+(f-x)/2,j=p+h-D,K=T===i,oe=k<1?"var(--success-color, #4caf50)":k>1?"var(--warning-color, #ff9800)":"var(--secondary-text-color)";return xe`
|
${e.map((k,T)=>{let M=k/m*h,F=T*f+(f-x)/2,j=p+h-M,Y=T===i,oe=k<1?"var(--success-color, #4caf50)":k>1?"var(--warning-color, #ff9800)":"var(--secondary-text-color)";return xe`
|
||||||
<rect x="${S(F)}" y="${S(j)}"
|
<rect x="${S(F)}" y="${S(j)}"
|
||||||
width="${S(x)}" height="${S(D)}"
|
width="${S(x)}" height="${S(M)}"
|
||||||
fill="${oe}" opacity="${K?1:.5}" rx="2" />
|
fill="${oe}" opacity="${Y?1:.5}" rx="2" />
|
||||||
`})}
|
`})}
|
||||||
</svg>
|
</svg>
|
||||||
<div class="seasonal-labels">
|
<div class="seasonal-labels">
|
||||||
${Ir.map((k,T)=>l`<span class="seasonal-label ${T===i?"active-month":""}">${n(k,r)}</span>`)}
|
${Rr.map((k,T)=>l`<span class="seasonal-label ${T===i?"active-month":""}">${n(k,r)}</span>`)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}var Ir,Rr=w(()=>{"use strict";I();q();Ft();Ir=["month_jan","month_feb","month_mar","month_apr","month_may","month_jun","month_jul","month_aug","month_sep","month_oct","month_nov","month_dec"]});var L,qr=w(()=>{"use strict";I();V();q();fe();At();zt();Mt();at();Ee();Ot();Er();Ar();Cr();Se();Rr();L=class extends A{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1;this._currencySymbol=""}get _lang(){return M(this.hass)}async openFor(e,t){this._entryId=e,this._taskId=t,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=ge(new Date),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});e?.features&&(this._features={...this._features,...e.features}),this._currencySymbol=e?.budget?.currency_symbol||"",this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=e.object?.name||"";let t=(e.tasks||[]).find(i=>i.id===this._taskId);this._task=t??null}catch(e){this._error=O(e,this._lang)}}async _runWs(e){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(e),this._busy=!1,!0}catch(t){return this._error=O(t,this._lang),this._busy=!1,!1}}_notifyChanged(e){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:e},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(J(),se)).then(async({openCompleteDialog:e})=>{let t=this._task,i=[];try{i=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0})).objects||[]}catch{}e(wr({entryId:this._entryId,taskId:this._taskId,taskName:t.name,task:t,objects:i,lang:this._lang,checklist:t.checklist||[],adaptiveEnabled:!!t.adaptive_config?.enabled,currencySymbol:this._currencySymbol}))&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||Promise.resolve().then(()=>(J(),se)).then(({openEditTaskDialog:e})=>{e(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(J(),se)).then(({openQrDialog:e})=>{e({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let e=n("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(e))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let e=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",e),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=n("suggestion_applied",this._lang)||"Applied",this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){if(!(!this._entryId||!this._taskId)){thi
Line truncated
|
`}var Rr,jr=w(()=>{"use strict";C();R();Ft();Rr=["month_jan","month_feb","month_mar","month_apr","month_may","month_jun","month_jul","month_aug","month_sep","month_oct","month_nov","month_dec"]});var L,Hr=w(()=>{"use strict";C();W();R();fe();Tt();Ut();zt();ot();Ee();Dt();Tr();Cr();Lr();Ae();jr();L=class extends A{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1;this._currencySymbol=""}get _lang(){return z(this.hass)}async openFor(e,t){this._entryId=e,this._taskId=t,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=ge(new Date),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});e?.features&&(this._features={...this._features,...e.features}),this._currencySymbol=e?.budget?.currency_symbol||"",this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=e.object?.name||"";let t=(e.tasks||[]).find(i=>i.id===this._taskId);this._task=t??null}catch(e){this._error=O(e,this._lang)}}async _runWs(e){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(e),this._busy=!1,!0}catch(t){return this._error=O(t,this._lang),this._busy=!1,!1}}_notifyChanged(e){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:e},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(Z(),se)).then(async({openCompleteDialog:e})=>{let t=this._task,i=[];try{i=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0})).objects||[]}catch{}e(Er({entryId:this._entryId,taskId:this._taskId,taskName:t.name,task:t,objects:i,lang:this._lang,checklist:t.checklist||[],adaptiveEnabled:!!t.adaptive_config?.enabled,currencySymbol:this._currencySymbol}))&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||Promise.resolve().then(()=>(Z(),se)).then(({openEditTaskDialog:e})=>{e(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(Z(),se)).then(({openQrDialog:e})=>{e({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let e=n("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(e))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let e=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",e),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=n("suggestion_applied",this._lang)||"Applied",this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){if(!(!this._entryId||!this._taskId)){thi
Line truncated
|
||||||
<div class="recommendation-card">
|
<div class="recommendation-card">
|
||||||
<h4>${n("suggested_interval",t)}</h4>
|
<h4>${n("suggested_interval",t)}</h4>
|
||||||
${Tr(e.interval_days,e.suggested_interval,e.interval_confidence||"medium",t)}
|
${Pr(e.interval_days,e.suggested_interval,e.interval_confidence||"medium",t)}
|
||||||
<div class="recommendation-actions">
|
<div class="recommendation-actions">
|
||||||
<button class="btn primary"
|
<button class="btn primary"
|
||||||
@click=${this._applySuggestion} ?disabled=${this._busy}>
|
@click=${this._applySuggestion} ?disabled=${this._busy}>
|
||||||
@@ -3974,15 +4007,15 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
<div class="adaptive-stack">
|
<div class="adaptive-stack">
|
||||||
${this._toast?l`<div class="toast">${this._toast}</div>`:_}
|
${this._toast?l`<div class="toast">${this._toast}</div>`:_}
|
||||||
${i?this._renderRecommendation(e):_}
|
${i?this._renderRecommendation(e):_}
|
||||||
${a?Sr(e,t,this._features):_}
|
${a?Ir(e,t,this._features):_}
|
||||||
${o?kr(e,t):_}
|
${o?Ar(e,t):_}
|
||||||
${p?l`
|
${p?l`
|
||||||
${Pr(e,t,this._features)}
|
${Nr(e,t,this._features)}
|
||||||
${e.seasonal_factors?.length===12||e.interval_analysis?.seasonal_factors?.length===12?Lr(e,t):_}
|
${e.seasonal_factors?.length===12||e.interval_analysis?.seasonal_factors?.length===12?qr(e,t):_}
|
||||||
`:_}
|
`:_}
|
||||||
</div>
|
</div>
|
||||||
`}_renderHistoryReadings(e,t,i){let a=ie(e),o=p=>P(p,i,{maximumFractionDigits:3});if(a.length>0)return l`<div class="history-readings">
|
`}_renderHistoryReadings(e,t,i){let a=ie(e),o=p=>P(p,i,{maximumFractionDigits:3});if(a.length>0)return l`<div class="history-readings">
|
||||||
${a.map(p=>{let c=Qi(t,e,p.id);return l`<span class="history-reading"><span class="history-reading-name">${p.name}</span>
|
${a.map(p=>{let c=Ji(t,e,p.id);return l`<span class="history-reading"><span class="history-reading-name">${p.name}</span>
|
||||||
<span class="history-reading-value">${o(p.value)}${p.unit?` ${p.unit}`:""}${c==null?"":` (${c>=0?"+":""}${o(c)})`}</span></span>`})}
|
<span class="history-reading-value">${o(p.value)}${p.unit?` ${p.unit}`:""}${c==null?"":` (${c>=0?"+":""}${o(c)})`}</span></span>`})}
|
||||||
</div>`;if(e.reading_value!=null){let p=this._task?.reading_unit?` ${this._task.reading_unit}`:"";return l`<div class="history-readings"><span class="history-reading">
|
</div>`;if(e.reading_value!=null){let p=this._task?.reading_unit?` ${this._task.reading_unit}`:"";return l`<div class="history-readings"><span class="history-reading">
|
||||||
<span class="history-reading-name">${n("reading_label",i)}</span>
|
<span class="history-reading-name">${n("reading_label",i)}</span>
|
||||||
@@ -4012,7 +4045,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
<div class="history-entry">
|
<div class="history-entry">
|
||||||
<div class="history-line">
|
<div class="history-line">
|
||||||
<span class="history-type type-${c.type}">${n(c.type,t)}</span>
|
<span class="history-type type-${c.type}">${n(c.type,t)}</span>
|
||||||
<span class="history-date">${Oi(c.timestamp,t)}</span>
|
<span class="history-date">${Di(c.timestamp,t)}</span>
|
||||||
${h?l`<button class="history-edit"
|
${h?l`<button class="history-edit"
|
||||||
title="${n("history_edit_button",t)||"Edit"}"
|
title="${n("history_edit_button",t)||"Edit"}"
|
||||||
@click=${()=>this._onEditHistoryEntry(c)}>
|
@click=${()=>this._onEditHistoryEntry(c)}>
|
||||||
@@ -4021,7 +4054,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
</div>
|
</div>
|
||||||
${c.notes?l`<div class="history-notes">${c.notes}</div>`:_}
|
${c.notes?l`<div class="history-notes">${c.notes}</div>`:_}
|
||||||
${this._renderHistoryReadings(c,i,t)}
|
${this._renderHistoryReadings(c,i,t)}
|
||||||
${(()=>{let m=We(c);return m.length?l`<div class="history-photos">
|
${(()=>{let m=Ye(c);return m.length?l`<div class="history-photos">
|
||||||
${m.map(f=>l`<maintenance-history-photo .hass=${this.hass} .docId=${f}></maintenance-history-photo>`)}
|
${m.map(f=>l`<maintenance-history-photo .hass=${this.hass} .docId=${f}></maintenance-history-photo>`)}
|
||||||
</div>`:_})()}
|
</div>`:_})()}
|
||||||
${c.cost!=null||c.duration!=null?l`<div class="history-meta">
|
${c.cost!=null||c.duration!=null?l`<div class="history-meta">
|
||||||
@@ -4040,17 +4073,17 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
${t?l`
|
${t?l`
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<span class="status-dot" style="background: ${ze[t.status]||"#ccc"}"></span>
|
<span class="status-dot" style="background: ${Ue[t.status]||"#ccc"}"></span>
|
||||||
<span class="task-name">${t.name}</span>
|
<span class="task-name">${t.name}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="object">
|
<div class="object">
|
||||||
<button class="link-inline" @click=${()=>{this._entryId&&Promise.resolve().then(()=>(J(),se)).then(({openObjectQuickActions:a})=>{a(this._entryId),this.close()})}}>${this._objectName}</button>
|
<button class="link-inline" @click=${()=>{this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openObjectQuickActions:a})=>{a(this._entryId),this.close()})}}>${this._objectName}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="quick-info">
|
<div class="quick-info">
|
||||||
${t.next_due?l`<span><strong>${n("next_due",e)||"Next due"}:</strong> ${te(t.next_due,e)}</span>`:_}
|
${t.next_due?l`<span><strong>${n("next_due",e)||"Next due"}:</strong> ${B(t.next_due,e)}</span>`:_}
|
||||||
${t.last_performed?l`<span><strong>${n("last_performed",e)||"Last"}:</strong> ${te(t.last_performed,e)}</span>`:_}
|
${t.last_performed?l`<span><strong>${n("last_performed",e)||"Last"}:</strong> ${B(t.last_performed,e)}</span>`:_}
|
||||||
${t.schedule?.kind&&!["manual","one_time"].includes(t.schedule.kind)||t.interval_days!=null?l`<span><strong>${n("interval",e)||"Interval"}:</strong> ${Fi(t,e)}</span>`:_}
|
${t.schedule?.kind&&!["manual","one_time"].includes(t.schedule.kind)||t.interval_days!=null?l`<span><strong>${n("interval",e)||"Interval"}:</strong> ${Fi(t,e)}</span>`:_}
|
||||||
${Ye(t)?l`<span><strong>${n("phase_current",e)}:</strong> ${Ye(t)}</span>`:_}
|
${Qe(t)?l`<span><strong>${n("phase_current",e)}:</strong> ${Qe(t)}</span>`:_}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -4149,7 +4182,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
`}
|
`}
|
||||||
`:l`<div class="loading">${n("loading",e)||"Loading\u2026"}</div>`}
|
`:l`<div class="loading">${n("loading",e)||"Loading\u2026"}</div>`}
|
||||||
</div>
|
</div>
|
||||||
`}};L.styles=[nt,E`
|
`}};L.styles=[at,E`
|
||||||
:host { display: contents; }
|
:host { display: contents; }
|
||||||
.backdrop {
|
.backdrop {
|
||||||
position: fixed; inset: 0; z-index: 100;
|
position: fixed; inset: 0; z-index: 100;
|
||||||
@@ -4338,7 +4371,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
.weibull-section, .seasonal-card-compact { max-width: 100%; }
|
.weibull-section, .seasonal-card-compact { max-width: 100%; }
|
||||||
.weibull-chart svg { max-width: 100%; height: auto; }
|
.weibull-chart svg { max-width: 100%; height: auto; }
|
||||||
.details-toggle { gap: 12px; flex-wrap: wrap; }
|
.details-toggle { gap: 12px; flex-wrap: wrap; }
|
||||||
`],d([y({attribute:!1})],L.prototype,"hass",2),d([u()],L.prototype,"_open",2),d([u()],L.prototype,"_entryId",2),d([u()],L.prototype,"_taskId",2),d([u()],L.prototype,"_task",2),d([u()],L.prototype,"_objectName",2),d([u()],L.prototype,"_busy",2),d([u()],L.prototype,"_error",2),d([u()],L.prototype,"_showSkip",2),d([u()],L.prototype,"_showReset",2),d([u()],L.prototype,"_showDetails",2),d([u()],L.prototype,"_showAdaptive",2),d([u()],L.prototype,"_skipReason",2),d([u()],L.prototype,"_resetDate",2),d([u()],L.prototype,"_features",2),d([u()],L.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",L)});function Nr(s){return!!s&&/^https?:\/\//i.test(s)}var jr=w(()=>{"use strict"});function Hr(s){return s?customElements.get("ha-markdown")?l`<ha-markdown class="notes-md" .content=${s} breaks></ha-markdown>`:l`${s}`:_}var Or=w(()=>{"use strict";I()});var Z,Dr=w(()=>{"use strict";I();jr();Or();V();q();fe();Z=class extends A{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return M(this.hass)}async openFor(e){this._entryId=e,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=e}catch(e){this._error=O(e,this._lang)}}_onEditObject(){!this._entryId||!this._data||Promise.resolve().then(()=>(J(),se)).then(({openEditObjectDialog:e})=>{e(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&Promise.resolve().then(()=>(J(),se)).then(({openCreateTaskDialog:e})=>{e(this._entryId),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let e=n("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(e)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=O(t,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let e=!!this._data.object.archived;if(!e){let t=n("confirm_archive_object",this._lang)||"Archive this object and its tasks?";if(!window.confirm(t))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:e?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=O(t,this._lang)}finally{this._busy=!1}}_onTaskClick(e){this._entryId&&Promise.resolve().then(()=>(J(),se)).then(({openTaskQuickActions:t})=>{t(this._entryId,e)})}render(){if(!this._open)return _;let e=this._lang,t=this._data,i=t?.object,a=t?.tasks||[],o=this.hass?.user?.is_admin??!0;return l`
|
`],d([y({attribute:!1})],L.prototype,"hass",2),d([u()],L.prototype,"_open",2),d([u()],L.prototype,"_entryId",2),d([u()],L.prototype,"_taskId",2),d([u()],L.prototype,"_task",2),d([u()],L.prototype,"_objectName",2),d([u()],L.prototype,"_busy",2),d([u()],L.prototype,"_error",2),d([u()],L.prototype,"_showSkip",2),d([u()],L.prototype,"_showReset",2),d([u()],L.prototype,"_showDetails",2),d([u()],L.prototype,"_showAdaptive",2),d([u()],L.prototype,"_skipReason",2),d([u()],L.prototype,"_resetDate",2),d([u()],L.prototype,"_features",2),d([u()],L.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",L)});function Or(s){return!!s&&/^https?:\/\//i.test(s)}var Dr=w(()=>{"use strict"});function Mr(s){return s?customElements.get("ha-markdown")?l`<ha-markdown class="notes-md" .content=${s} breaks></ha-markdown>`:l`${s}`:_}var zr=w(()=>{"use strict";C()});var X,Ur=w(()=>{"use strict";C();Dr();zr();W();R();fe();X=class extends A{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return z(this.hass)}async openFor(e){this._entryId=e,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=e}catch(e){this._error=O(e,this._lang)}}_onEditObject(){!this._entryId||!this._data||Promise.resolve().then(()=>(Z(),se)).then(({openEditObjectDialog:e})=>{e(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openCreateTaskDialog:e})=>{e(this._entryId),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let e=n("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(e)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=O(t,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let e=!!this._data.object.archived;if(!e){let t=n("confirm_archive_object",this._lang)||"Archive this object and its tasks?";if(!window.confirm(t))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:e?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=O(t,this._lang)}finally{this._busy=!1}}_onTaskClick(e){this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openTaskQuickActions:t})=>{t(this._entryId,e)})}render(){if(!this._open)return _;let e=this._lang,t=this._data,i=t?.object,a=t?.tasks||[],o=this.hass?.user?.is_admin??!0;return l`
|
||||||
<div class="backdrop" @click=${this.close}></div>
|
<div class="backdrop" @click=${this.close}></div>
|
||||||
<div class="dialog" role="dialog" aria-modal="true">
|
<div class="dialog" role="dialog" aria-modal="true">
|
||||||
${t&&i?l`
|
${t&&i?l`
|
||||||
@@ -4358,7 +4391,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
<div class="task-list">
|
<div class="task-list">
|
||||||
${a.map(p=>l`
|
${a.map(p=>l`
|
||||||
<div class="task-row" @click=${()=>this._onTaskClick(p.id)}>
|
<div class="task-row" @click=${()=>this._onTaskClick(p.id)}>
|
||||||
<span class="status-dot" style="background: ${ze[p.status]||"#ccc"}"></span>
|
<span class="status-dot" style="background: ${Ue[p.status]||"#ccc"}"></span>
|
||||||
<span class="task-name">${p.name}</span>
|
<span class="task-name">${p.name}</span>
|
||||||
<span class="task-status">${n(p.status||"ok",e)}</span>
|
<span class="task-status">${n(p.status||"ok",e)}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -4370,7 +4403,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
${i.notes?l`
|
${i.notes?l`
|
||||||
<div class="notes-section">
|
<div class="notes-section">
|
||||||
<strong>${n("object_notes_label",e)}</strong>
|
<strong>${n("object_notes_label",e)}</strong>
|
||||||
<div class="notes-body">${Hr(i.notes)}</div>
|
<div class="notes-body">${Mr(i.notes)}</div>
|
||||||
</div>
|
</div>
|
||||||
`:_}
|
`:_}
|
||||||
|
|
||||||
@@ -4401,11 +4434,11 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
${i.map(([a,o])=>l`
|
${i.map(([a,o])=>l`
|
||||||
<div class="meta-item">
|
<div class="meta-item">
|
||||||
<span class="meta-label">${a}</span>
|
<span class="meta-label">${a}</span>
|
||||||
<span class="meta-value">${Nr(o)?l`<a href="${o}" target="_blank" rel="noopener noreferrer">${o}</a>`:o}</span>
|
<span class="meta-value">${Or(o)?l`<a href="${o}" target="_blank" rel="noopener noreferrer">${o}</a>`:o}</span>
|
||||||
</div>
|
</div>
|
||||||
`)}
|
`)}
|
||||||
</div>
|
</div>
|
||||||
`}};Z.styles=E`
|
`}};X.styles=E`
|
||||||
:host { display: contents; }
|
:host { display: contents; }
|
||||||
.backdrop {
|
.backdrop {
|
||||||
position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.5);
|
position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.5);
|
||||||
@@ -4465,7 +4498,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
.btn ha-icon { --mdc-icon-size: 16px; }
|
.btn ha-icon { --mdc-icon-size: 16px; }
|
||||||
.loading { padding: 24px; text-align: center; color: var(--secondary-text-color); }
|
.loading { padding: 24px; text-align: center; color: var(--secondary-text-color); }
|
||||||
.error { padding: 8px; border-radius: 6px; background: rgba(211,47,47,0.1); color: var(--error-color); font-size: 13px; }
|
.error { padding: 8px; border-radius: 6px; background: rgba(211,47,47,0.1); color: var(--error-color); font-size: 13px; }
|
||||||
`,d([y({attribute:!1})],Z.prototype,"hass",2),d([u()],Z.prototype,"_open",2),d([u()],Z.prototype,"_entryId",2),d([u()],Z.prototype,"_data",2),d([u()],Z.prototype,"_busy",2),d([u()],Z.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",Z)});function Mr(){let s=window;return s.__msSettingsCache??={promise:null}}function pt(s){let r=Mr();if(r.promise)return r.promise;let e=s.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(t=>({features:t.features??Ut.features,defaultWarningDays:t.general?.default_warning_days??7,rowActionStyle:t.general?.row_action_style??Ut.rowActionStyle})).catch(()=>(r.promise===e&&(r.promise=null),Ut));return r.promise=e,e}function zr(){Mr().promise=null}var Ut,Fr=w(()=>{"use strict";Ut={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7,rowActionStyle:"buttons_compact"}});var se={};Yr(se,{__resetSettingsCacheForTests:()=>nn,getRowActionStyle:()=>sn,openCompleteDialog:()=>cn,openCreateObjectDialog:()=>an,openCreateTaskDialog:()=>ln,openEditObjectDialog:()=>on,openEditTaskDialog:()=>dn,openHistoryEditDialog:()=>Bt,openObjectQuickActions:()=>hn,openQrDialog:()=>pn,openTaskQuickActions:()=>Vt});function ht(){return document.querySelector("home-assistant")?.hass}function rn(){return document.querySelector("home-assistant")?.shadowRoot??document.body}function ne(s){let r=rn(),e=r.querySelector(s)??document.body.querySelector(s);return e?e.parentNode!==r&&r.appendChild(e):(e=document.createElement(s),r.appendChild(e)),e}function ae(s){let r=ht();if(!r)return!1;s.hass=r;let e=M(r);return Be(e)||Ve(e).then(()=>{s.requestUpdate?.()}),Ct(r.locale,r.config?.country),!0}function sn(s){return pt(s).then(r=>r.rowActionStyle)}function nn(){zr()}function an(){let s=ne(Ur);return ae(s)?(s.openCreate(),!0):!1}function on(s,r){let e=ne(Ur);return ae(e)?(e.openEdit(s,r),!0):!1}function ln(s="",r){let e=ne(Br);if(!ae(e))return!1;let t=ht();return t?((async()=>{let i=await pt(t),a=e;a.checklistsEnabled=i.features.checklists,a.scheduleTimeEnabled=i.features.schedule_time,a.completionActionsEnabled=i.features.completion_actions,a.defaultWarningDays=i.defaultWarningDays,a.openCreate(s,r)})(),!0):!1}function dn(s,r){let e=ne(Br);if(!ae(e))return!1;let t=ht();return t?((async()=>{try{let[i,a]=await Promise.all([t.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:s}),pt(t)]),o=(i.tasks||[]).find(c=>c.id===r);if(!o){console.warn(`openEditTaskDialog: task ${r} not found in entry ${s}`);return}let p=e;p.checklistsEnabled=a.features.checklists,p.scheduleTimeEnabled=a.features.schedule_time,p.completionActionsEnabled=a.features.completion_actions,p.defaultWarningDays=a.defaultWarningDays,await p.openEdit(s,o)}catch(i){console.warn("openEditTaskDialog: failed to load task/features",i)}})(),!0):!1}function Bt(s){let r=ne(Js);return ae(r)?(r.openEdit(s),!0):!1}function cn(s){let r=ne(Zs);return ae(r)?($r(r,s,ht()?.language||"en"),!0):!1}function pn(s){let r=ne(Xs);return ae(r)?(r.openForTask(s.entry_id,s.task_id,s.object_name,s.task_name),!0):!1}function Vt(s,r){let e=ne(en);return ae(e)?(e.openFor(s,r),!0):!1}function hn(s){let r=ne(tn);return ae(r)?(r.openFor(s),!0):!1}var Ur,Br,Js,Zs,Xs,en,tn,J=w(()=>{"use strict";Xi();hr();gr();yr();xr();qr();Dr();q();zt();Fr();Ur="maintenance-object-dialog",Br="maintenance-task-dialog",Js="maintenance-history-edit-dialog",Zs="maintenance-complete-dialog",Xs="maintenance-qr-dialog",en="maintenance-task-quick-actions-dialog",tn="maintenance-object-quick-actions-dialog"});I();V();At();I();var Si=E`
|
`,d([y({attribute:!1})],X.prototype,"hass",2),d([u()],X.prototype,"_open",2),d([u()],X.prototype,"_entryId",2),d([u()],X.prototype,"_data",2),d([u()],X.prototype,"_busy",2),d([u()],X.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",X)});function Fr(){let s=window;return s.__msSettingsCache??={promise:null}}function ht(s){let r=Fr();if(r.promise)return r.promise;let e=s.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(t=>({features:t.features??Bt.features,defaultWarningDays:t.general?.default_warning_days??7,rowActionStyle:t.general?.row_action_style??Bt.rowActionStyle})).catch(()=>(r.promise===e&&(r.promise=null),Bt));return r.promise=e,e}function Br(){Fr().promise=null}var Bt,Vr=w(()=>{"use strict";Bt={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7,rowActionStyle:"buttons_compact"}});var se={};Jr(se,{__resetSettingsCacheForTests:()=>dn,getRowActionStyle:()=>ln,openCompleteDialog:()=>_n,openCreateObjectDialog:()=>cn,openCreateTaskDialog:()=>hn,openEditObjectDialog:()=>pn,openEditTaskDialog:()=>un,openHistoryEditDialog:()=>Vt,openObjectQuickActions:()=>mn,openQrDialog:()=>gn,openTaskQuickActions:()=>Wt});function ut(){return document.querySelector("home-assistant")?.hass}function on(){return document.querySelector("home-assistant")?.shadowRoot??document.body}function ne(s){let r=on(),e=r.querySelector(s)??document.body.querySelector(s);return e?e.parentNode!==r&&r.appendChild(e):(e=document.createElement(s),r.appendChild(e)),e}function ae(s){let r=ut();if(!r)return!1;s.hass=r;let e=z(r);return We(e)||Ke(e).then(()=>{s.requestUpdate?.()}),Ct(r.locale,r.config?.country),!0}function ln(s){return ht(s).then(r=>r.rowActionStyle)}function dn(){Br()}function cn(){let s=ne(Wr);return ae(s)?(s.openCreate(),!0):!1}function pn(s,r){let e=ne(Wr);return ae(e)?(e.openEdit(s,r),!0):!1}function hn(s="",r){let e=ne(Kr);if(!ae(e))return!1;let t=ut();return t?((async()=>{let i=await ht(t),a=e;a.checklistsEnabled=i.features.checklists,a.scheduleTimeEnabled=i.features.schedule_time,a.completionActionsEnabled=i.features.completion_actions,a.defaultWarningDays=i.defaultWarningDays,a.openCreate(s,r)})(),!0):!1}function un(s,r){let e=ne(Kr);if(!ae(e))return!1;let t=ut();return t?((async()=>{try{let[i,a]=await Promise.all([t.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:s}),ht(t)]),o=(i.tasks||[]).find(c=>c.id===r);if(!o){console.warn(`openEditTaskDialog: task ${r} not found in entry ${s}`);return}let p=e;p.checklistsEnabled=a.features.checklists,p.scheduleTimeEnabled=a.features.schedule_time,p.completionActionsEnabled=a.features.completion_actions,p.defaultWarningDays=a.defaultWarningDays,await p.openEdit(s,o)}catch(i){console.warn("openEditTaskDialog: failed to load task/features",i)}})(),!0):!1}function Vt(s){let r=ne(tn);return ae(r)?(r.openEdit(s),!0):!1}function _n(s){let r=ne(rn);return ae(r)?(Sr(r,s,ut()?.language||"en"),!0):!1}function gn(s){let r=ne(sn);return ae(r)?(r.openForTask(s.entry_id,s.task_id,s.object_name,s.task_name),!0):!1}function Wt(s,r){let e=ne(nn);return ae(e)?(e.openFor(s,r),!0):!1}function mn(s){let r=ne(an);return ae(r)?(r.openFor(s),!0):!1}var Wr,Kr,tn,rn,sn,nn,an,Z=w(()=>{"use strict";ir();gr();vr();wr();kr();Hr();Ur();R();Ut();Vr();Wr="maintenance-object-dialog",Kr="maintenance-task-dialog",tn="maintenance-history-edit-dialog",rn="maintenance-complete-dialog",sn="maintenance-qr-dialog",nn="maintenance-task-quick-actions-dialog",an="maintenance-object-quick-actions-dialog"});C();W();Tt();C();var Ai=E`
|
||||||
.cal-controls {
|
.cal-controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
@@ -4662,35 +4695,35 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
.cal-pill-day { font-size: 17px; }
|
.cal-pill-day { font-size: 17px; }
|
||||||
.cal-user-filter { margin-left: 0; width: 100%; }
|
.cal-user-filter { margin-left: 0; width: 100%; }
|
||||||
}
|
}
|
||||||
`;q();function Vi(s){let r=window;r.customCards=r.customCards||[],r.customCards.some(e=>e.type===s.type)||r.customCards.push(s)}at();Ee();J();var B=class extends A{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-calendar-card"};this._objects=[];this._stats=null;this._windowDays=30;this._pastDays=0;this._userFilter="";this._objectFilter="";this._configuredObjects=[];this._unsub=null;this._dataLoaded=!1;this._lastConnection=null}static getConfigElement(){return document.createElement("maintenance-supporter-calendar-card-editor")}static getStubConfig(){return{type:"custom:maintenance-supporter-calendar-card",window_days:30,show_window_chips:!0,show_user_filter:!0}}setConfig(e){if(this._config={...e},e.past_days&&[30,90].includes(e.past_days)?this._pastDays=e.past_days:e.window_days&&[7,14,30,365].includes(e.window_days)&&(this._windowDays=e.window_days,this._pastDays=0),typeof e.user_filter=="string"&&(this._userFilter=e.user_filter),typeof e.object_filter=="string")this._objectFilter=e.object_filter,this._configuredObjects=[];else if(Array.isArray(e.object_filter)){let t=e.object_filter.filter(i=>typeof i=="string"&&i!=="");this._objectFilter=t.length===1?t[0]:"",this._configuredObjects=t.length>1?t:[]}}getCardSize(){return 6}get _lang(){return M(this.hass)}disconnectedCallback(){if(super.disconnectedCallback(),this._unsub){try{this._unsub()}catch{}this._unsub=null}this._dataLoaded=!1,this._lastConnection=null}updated(e){if(super.updated(e),qi(this,e),e.has("hass")&&this.hass){if(!this._dataLoaded)this._dataLoaded=!0,this._lastConnection=this.hass.connection,this._loadData(),this._subscribe();else if(this.hass.connection!==this._lastConnection){if(this._lastConnection=this.hass.connection,this._unsub){try{this._unsub()}catch{}this._unsub=null}this._subscribe(),this._loadData()}}}async _loadData(){try{let[e,t]=await Promise.all([this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects"}),this.hass.connection.sendMessagePromise({type:"maintenance_supporter/statistics"})]);this._objects=e.objects,this._stats=t}catch{}}async _subscribe(){try{let e=await this.hass.connection.subscribeMessage(t=>{let i=t;this._objects=i.objects},{type:"maintenance_supporter/subscribe"});if(!this.isConnected){e();return}this._unsub=e}catch{}}_onEventClick(e){if(e.history_timestamp){this._openHistoryEntry(e);return}Vt(e.entry_id,e.task_id)||this.dispatchEvent(new CustomEvent("ll-custom",{detail:{type:"maintenance-supporter:open-task",entry_id:e.entry_id,task_id:e.task_id},bubbles:!0,composed:!0}))}async _openHistoryEntry(e){try{let i=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:e.entry_id})).tasks?.find(p=>p.id===e.task_id),a=i?.history?.find(p=>p.timestamp===e.history_timestamp);if(!a||Bt({entry_id:e.entry_id,task_id:e.task_id,original_timestamp:e.history_timestamp,type:a.type||"completed",timestamp:a.timestamp||e.history_timestamp,notes:a.notes??null,cost:a.cost??null,duration:a.duration??null,completed_by:a.completed_by??null,used_parts:a.used_parts??null,photo_doc_ids:We(a),reading_value:a.reading_value??null,reading_values:ie(a),readings:i?.readings??[],task_type:i?.type??null,reading_unit:i?.reading_unit??null}))return}catch{}this.dispatchEvent(new CustomEvent("ll-custom",{detail:{type:"maintenance-supporter:edit-history",entry_id:e.entry_id,task_id:e.task_id,original_timestamp:e.history_timestamp},bubbles:!0,composed:!0}))}render(){if(!this.hass)return _;let e=this._lang,t=this._config.show_window_chips!==!1,i=this._config.show_user_filter!==!1,a=this._config.title,o=null;this._userFilter&&(o=this._userFilter==="current_user"?this.hass?.user?.id??null:this._userFilter);let p=b=>{let Y=b.toLowerCase();return this._objects.find(R=>R.entry_id===b||R.object.name.toLowerCase()===Y)?.entry_id??null},c=new Set(this._configuredObjects.map(p).filter(b=>b!==null)),h=c.size?this._objects.filter(b=>c.has(b.entry_id)):this._objects,m=this._config.show_object_filter!==!1&&h.length>1,f=this._objectFilter?p(this._objectFilter):null,x=f&&h.some(b=>b.entry_id===f)?h.filter(b=>b.entry_id===f):h,v=new Date;v.setHours(0,0,0,0);let k=this._pastDays>0,T=k?Ei(x,v,this._pastDays,o):ki(x,v,this._windowDays,o),D=ge(v),F=this._windowDays===365||k,j=F?T.filter(b=>b.events.length>0):T,K=b=>{let Y=`cal-status-${b.status}`,ve=b.projected?"cal-event-projected":"",R=b.status==="overdue"&&b.days_until_due!=null?` (${Di(b.days_until_due,e)})`:"",H=b.projected&&b.interval_days?l`<span class="cal-event-recur">${b.interval_unit&&b.interval_unit!=="days"?`${b.interval_days} ${n("unit_"+b.interval_unit,e)}`:n("cal_every_n_days",e).replace("{n}",String(b.interval_days))}</span>`:_,ce=b.schedule_type==="sensor_based",Ie=ce?l`<ha-icon class="cal-event-icon cal-source-sensor"
|
`;R();function Wi(s){let r=window;r.customCards=r.customCards||[],r.customCards.some(e=>e.type===s.type)||r.customCards.push(s)}ot();Ee();Z();var V=class extends A{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-calendar-card"};this._objects=[];this._stats=null;this._windowDays=30;this._pastDays=0;this._userFilter="";this._objectFilter="";this._configuredObjects=[];this._unsub=null;this._dataLoaded=!1;this._lastConnection=null}static getConfigElement(){return document.createElement("maintenance-supporter-calendar-card-editor")}static getStubConfig(){return{type:"custom:maintenance-supporter-calendar-card",window_days:30,show_window_chips:!0,show_user_filter:!0}}setConfig(e){if(this._config={...e},e.past_days&&[30,90].includes(e.past_days)?this._pastDays=e.past_days:e.window_days&&[7,14,30,365].includes(e.window_days)&&(this._windowDays=e.window_days,this._pastDays=0),typeof e.user_filter=="string"&&(this._userFilter=e.user_filter),typeof e.object_filter=="string")this._objectFilter=e.object_filter,this._configuredObjects=[];else if(Array.isArray(e.object_filter)){let t=e.object_filter.filter(i=>typeof i=="string"&&i!=="");this._objectFilter=t.length===1?t[0]:"",this._configuredObjects=t.length>1?t:[]}}getCardSize(){return 6}get _lang(){return z(this.hass)}disconnectedCallback(){if(super.disconnectedCallback(),this._unsub){try{this._unsub()}catch{}this._unsub=null}this._dataLoaded=!1,this._lastConnection=null}updated(e){if(super.updated(e),qi(this,e),e.has("hass")&&this.hass){if(!this._dataLoaded)this._dataLoaded=!0,this._lastConnection=this.hass.connection,this._loadData(),this._subscribe();else if(this.hass.connection!==this._lastConnection){if(this._lastConnection=this.hass.connection,this._unsub){try{this._unsub()}catch{}this._unsub=null}this._subscribe(),this._loadData()}}}async _loadData(){try{let[e,t]=await Promise.all([this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects"}),this.hass.connection.sendMessagePromise({type:"maintenance_supporter/statistics"})]);this._objects=e.objects,this._stats=t}catch{}}async _subscribe(){try{let e=await this.hass.connection.subscribeMessage(t=>{let i=t;this._objects=i.objects},{type:"maintenance_supporter/subscribe"});if(!this.isConnected){e();return}this._unsub=e}catch{}}_onEventClick(e){if(e.history_timestamp){this._openHistoryEntry(e);return}Wt(e.entry_id,e.task_id)||this.dispatchEvent(new CustomEvent("ll-custom",{detail:{type:"maintenance-supporter:open-task",entry_id:e.entry_id,task_id:e.task_id},bubbles:!0,composed:!0}))}async _openHistoryEntry(e){try{let i=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:e.entry_id})).tasks?.find(p=>p.id===e.task_id),a=i?.history?.find(p=>p.timestamp===e.history_timestamp);if(!a||Vt({entry_id:e.entry_id,task_id:e.task_id,original_timestamp:e.history_timestamp,type:a.type||"completed",timestamp:a.timestamp||e.history_timestamp,notes:a.notes??null,cost:a.cost??null,duration:a.duration??null,completed_by:a.completed_by??null,used_parts:a.used_parts??null,photo_doc_ids:Ye(a),reading_value:a.reading_value??null,reading_values:ie(a),readings:i?.readings??[],task_type:i?.type??null,reading_unit:i?.reading_unit??null}))return}catch{}this.dispatchEvent(new CustomEvent("ll-custom",{detail:{type:"maintenance-supporter:edit-history",entry_id:e.entry_id,task_id:e.task_id,original_timestamp:e.history_timestamp},bubbles:!0,composed:!0}))}render(){if(!this.hass)return _;let e=this._lang,t=this._config.show_window_chips!==!1,i=this._config.show_user_filter!==!1,a=this._config.title,o=null;this._userFilter&&(o=this._userFilter==="current_user"?this.hass?.user?.id??null:this._userFilter);let p=b=>{let G=b.toLowerCase();return this._objects.find(N=>N.entry_id===b||N.object.name.toLowerCase()===G)?.entry_id??null},c=new Set(this._configuredObjects.map(p).filter(b=>b!==null)),h=c.size?this._objects.filter(b=>c.has(b.entry_id)):this._objects,m=this._config.show_object_filter!==!1&&h.length>1,f=this._objectFilter?p(this._objectFilter):null,x=f&&h.some(b=>b.entry_id===f)?h.filter(b=>b.entry_id===f):h,v=new Date;v.setHours(0,0,0,0);let k=this._pastDays>0,T=k?Si(x,v,this._pastDays,o):Ei(x,v,this._windowDays,o),M=ge(v),F=this._windowDays===365||k,j=F?T.filter(b=>b.events.length>0):T,Y=b=>{let G=`cal-status-${b.status}`,ve=b.projected?"cal-event-projected":"",N=b.status==="overdue"&&b.days_until_due!=null?` (${Mi(b.days_until_due,e)})`:"",H=b.projected&&b.interval_days?l`<span class="cal-event-recur">${b.interval_unit&&b.interval_unit!=="days"?`${b.interval_days} ${n("unit_"+b.interval_unit,e)}`:n("cal_every_n_days",e).replace("{n}",String(b.interval_days))}</span>`:_,ce=b.schedule_type==="sensor_based",Pe=ce?l`<ha-icon class="cal-event-icon cal-source-sensor"
|
||||||
title="${n("cal_source_sensor",e)}" icon="mdi:trending-up"></ha-icon>`:l`<ha-icon class="cal-event-icon cal-source-time"
|
title="${n("cal_source_sensor",e)}" icon="mdi:trending-up"></ha-icon>`:l`<ha-icon class="cal-event-icon cal-source-time"
|
||||||
title="${b.adaptive_enabled?n("cal_source_time_adaptive",e):n("cal_source_time",e)}"
|
title="${b.adaptive_enabled?n("cal_source_time_adaptive",e):n("cal_source_time",e)}"
|
||||||
icon="${b.adaptive_enabled?"mdi:clock-time-four-outline":"mdi:clock-outline"}"></ha-icon>`,Pe=ce&&b.prediction_confidence&&b.status!=="triggered"&&!b.projected?l`<span class="cal-event-prediction cal-conf-${b.prediction_confidence}">
|
icon="${b.adaptive_enabled?"mdi:clock-time-four-outline":"mdi:clock-outline"}"></ha-icon>`,Le=ce&&b.prediction_confidence&&b.status!=="triggered"&&!b.projected?l`<span class="cal-event-prediction cal-conf-${b.prediction_confidence}">
|
||||||
${n("cal_predicted",e)} · ${n(`cal_confidence_${b.prediction_confidence}`,e)}
|
${n("cal_predicted",e)} · ${n(`cal_confidence_${b.prediction_confidence}`,e)}
|
||||||
</span>`:_,Vr=this._stats?.budget?.currency_symbol||Li,Wr=b.history_type?n(b.history_type,e):n(b.status,e);return l`
|
</span>`:_,Yr=this._stats?.budget?.currency_symbol||Ri,Gr=b.history_type?n(b.history_type,e):n(b.status,e);return l`
|
||||||
<div class="cal-event ${ve}"
|
<div class="cal-event ${ve}"
|
||||||
@click=${()=>this._onEventClick(b)}>
|
@click=${()=>this._onEventClick(b)}>
|
||||||
${Ie}
|
${Pe}
|
||||||
<span class="cal-status-pill ${Y}">${Wr}</span>
|
<span class="cal-status-pill ${G}">${Gr}</span>
|
||||||
<div class="cal-event-body">
|
<div class="cal-event-body">
|
||||||
<div class="cal-event-title">${b.object_name} · ${b.task_name}${R}</div>
|
<div class="cal-event-title">${b.object_name} · ${b.task_name}${N}</div>
|
||||||
${Pe}
|
${Le}
|
||||||
${H}
|
${H}
|
||||||
</div>
|
</div>
|
||||||
${b.avg_cost!=null&&b.avg_cost>0?l`<span class="cal-event-cost">${st(b.avg_cost,Vr,e,0)}</span>`:_}
|
${b.avg_cost!=null&&b.avg_cost>0?l`<span class="cal-event-cost">${nt(b.avg_cost,Yr,e,0)}</span>`:_}
|
||||||
</div>
|
</div>
|
||||||
`},oe=b=>{let[Y,ve,R]=b.date.split("-").map(Number),H=new Date(Y,ve-1,R),ce=b.date===D,Ie=Mi(H,e,"short"),Pe=zi(H,e,"long");return l`
|
`},oe=b=>{let[G,ve,N]=b.date.split("-").map(Number),H=new Date(G,ve-1,N),ce=b.date===M,Pe=zi(H,e,"short"),Le=Ui(H,e,"long");return l`
|
||||||
<div class="cal-day-row">
|
<div class="cal-day-row">
|
||||||
<div class="cal-day-pill ${ce?"cal-today":""}">
|
<div class="cal-day-pill ${ce?"cal-today":""}">
|
||||||
<span class="cal-pill-weekday">${Ie}</span>
|
<span class="cal-pill-weekday">${Pe}</span>
|
||||||
<span class="cal-pill-day">${H.getDate()}</span>
|
<span class="cal-pill-day">${H.getDate()}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cal-day-content">
|
<div class="cal-day-content">
|
||||||
<div class="cal-day-header">
|
<div class="cal-day-header">
|
||||||
<span class="cal-day-month">${Pe}</span>
|
<span class="cal-day-month">${Le}</span>
|
||||||
${ce?l`<span class="cal-day-today-badge">${n("today",e)}</span>`:_}
|
${ce?l`<span class="cal-day-today-badge">${n("today",e)}</span>`:_}
|
||||||
</div>
|
</div>
|
||||||
${b.events.length===0?l`<div class="cal-empty">${n("cal_no_events",e)}</div>`:b.events.map(K)}
|
${b.events.length===0?l`<div class="cal-empty">${n("cal_no_events",e)}</div>`:b.events.map(Y)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`};return l`
|
`};return l`
|
||||||
@@ -4729,7 +4762,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
.value=${f??""}
|
.value=${f??""}
|
||||||
@change=${b=>{this._objectFilter=b.target.value}}>
|
@change=${b=>{this._objectFilter=b.target.value}}>
|
||||||
<option value="">${n("all_objects",e)}</option>
|
<option value="">${n("all_objects",e)}</option>
|
||||||
${[...h].sort((b,Y)=>b.object.name.localeCompare(Y.object.name)).map(b=>l`<option value=${b.entry_id} ?selected=${b.entry_id===f}>${b.object.name}</option>`)}
|
${[...h].sort((b,G)=>b.object.name.localeCompare(G.object.name)).map(b=>l`<option value=${b.entry_id} ?selected=${b.entry_id===f}>${b.object.name}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
`:_}
|
`:_}
|
||||||
</div>
|
</div>
|
||||||
@@ -4738,10 +4771,10 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
${j.length===0&&F?l`<div class="cal-empty">${n("cal_no_events",e)}</div>`:j.map(oe)}
|
${j.length===0&&F?l`<div class="cal-empty">${n("cal_no_events",e)}</div>`:j.map(oe)}
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
`}};B.styles=[nt,Si,E`
|
`}};V.styles=[at,Ai,E`
|
||||||
:host { display: block; }
|
:host { display: block; }
|
||||||
ha-card { padding: 0; overflow: hidden; }
|
ha-card { padding: 0; overflow: hidden; }
|
||||||
`],d([y({attribute:!1})],B.prototype,"hass",2),d([u()],B.prototype,"_config",2),d([u()],B.prototype,"_objects",2),d([u()],B.prototype,"_stats",2),d([u()],B.prototype,"_windowDays",2),d([u()],B.prototype,"_pastDays",2),d([u()],B.prototype,"_userFilter",2),d([u()],B.prototype,"_objectFilter",2),d([u()],B.prototype,"_unsub",2);var un=[{value:7,key:"cal_editor_window_week"},{value:14,key:"cal_editor_window_fortnight"},{value:30,key:"cal_editor_window_month"},{value:365,key:"cal_editor_window_year"}],Ce=class extends A{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-calendar-card"}}get _lang(){return M(this.hass)}setConfig(e){this._config={...e}}updated(){let e=this._lang;e&&!Be(e)&&Ve(e).then(()=>this.requestUpdate())}_valueChanged(e,t){let i={...this._config,[e]:t};e==="show_window_chips"&&t===!0&&delete i.show_window_chips,e==="show_user_filter"&&t===!0&&delete i.show_user_filter,e==="show_object_filter"&&t===!0&&delete i.show_object_filter,e==="title"&&(!t||typeof t=="string"&&t.trim()==="")&&delete i.title,e==="user_filter"&&t===""&&delete i.user_filter,this._config=i,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:i},bubbles:!0,composed:!0}))}render(){let e=this._lang,t=this._config.window_days??30,i=this._config.show_window_chips!==!1,a=this._config.show_user_filter!==!1,o=this._config.user_filter??"",p=this._config.title??"";return l`
|
`],d([y({attribute:!1})],V.prototype,"hass",2),d([u()],V.prototype,"_config",2),d([u()],V.prototype,"_objects",2),d([u()],V.prototype,"_stats",2),d([u()],V.prototype,"_windowDays",2),d([u()],V.prototype,"_pastDays",2),d([u()],V.prototype,"_userFilter",2),d([u()],V.prototype,"_objectFilter",2),d([u()],V.prototype,"_unsub",2);var fn=[{value:7,key:"cal_editor_window_week"},{value:14,key:"cal_editor_window_fortnight"},{value:30,key:"cal_editor_window_month"},{value:365,key:"cal_editor_window_year"}],Ce=class extends A{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-calendar-card"}}get _lang(){return z(this.hass)}setConfig(e){this._config={...e}}updated(){let e=this._lang;e&&!We(e)&&Ke(e).then(()=>this.requestUpdate())}_valueChanged(e,t){let i={...this._config,[e]:t};e==="show_window_chips"&&t===!0&&delete i.show_window_chips,e==="show_user_filter"&&t===!0&&delete i.show_user_filter,e==="show_object_filter"&&t===!0&&delete i.show_object_filter,e==="title"&&(!t||typeof t=="string"&&t.trim()==="")&&delete i.title,e==="user_filter"&&t===""&&delete i.user_filter,this._config=i,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:i},bubbles:!0,composed:!0}))}render(){let e=this._lang,t=this._config.window_days??30,i=this._config.show_window_chips!==!1,a=this._config.show_user_filter!==!1,o=this._config.user_filter??"",p=this._config.title??"";return l`
|
||||||
<div class="editor">
|
<div class="editor">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label for="title">${n("card_title",e)}</label>
|
<label for="title">${n("card_title",e)}</label>
|
||||||
@@ -4758,7 +4791,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
id="window"
|
id="window"
|
||||||
@change=${c=>this._valueChanged("window_days",Number(c.target.value))}
|
@change=${c=>this._valueChanged("window_days",Number(c.target.value))}
|
||||||
>
|
>
|
||||||
${un.map(c=>l`<option value="${c.value}" ?selected=${c.value===t}>${n(c.key,e)}</option>`)}
|
${fn.map(c=>l`<option value="${c.value}" ?selected=${c.value===t}>${n(c.key,e)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="row toggle">
|
<div class="row toggle">
|
||||||
@@ -4827,7 +4860,7 @@ ${c?`<div class="sub">${c}</div>`:""}
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--secondary-text-color, #666);
|
color: var(--secondary-text-color, #666);
|
||||||
}
|
}
|
||||||
`,d([y({attribute:!1})],Ce.prototype,"hass",2),d([u()],Ce.prototype,"_config",2);customElements.get("maintenance-supporter-calendar-card")||customElements.define("maintenance-supporter-calendar-card",B);customElements.get("maintenance-supporter-calendar-card-editor")||customElements.define("maintenance-supporter-calendar-card-editor",Ce);Vi({type:"maintenance-supporter-calendar-card",name:"Maintenance Supporter \u2014 Calendar",description:"Rolling calendar of maintenance tasks with 7/14/30/365 day windows, source icons, and prediction-confidence pills.",preview:!0});export{B as MaintenanceCalendarCard};
|
`,d([y({attribute:!1})],Ce.prototype,"hass",2),d([u()],Ce.prototype,"_config",2);customElements.get("maintenance-supporter-calendar-card")||customElements.define("maintenance-supporter-calendar-card",V);customElements.get("maintenance-supporter-calendar-card-editor")||customElements.define("maintenance-supporter-calendar-card-editor",Ce);Wi({type:"maintenance-supporter-calendar-card",name:"Maintenance Supporter \u2014 Calendar",description:"Rolling calendar of maintenance tasks with 7/14/30/365 day windows, source icons, and prediction-confidence pills.",preview:!0});export{V as MaintenanceCalendarCard};
|
||||||
/*! Bundled license information:
|
/*! Bundled license information:
|
||||||
|
|
||||||
@lit/reactive-element/css-tag.js:
|
@lit/reactive-element/css-tag.js:
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
var ri=Object.defineProperty;var Ys=Object.getOwnPropertyDescriptor;var w=(r,s,e)=>()=>{if(e)throw e[0];try{return r&&(s=r(r=0)),s}catch(t){throw e=[t],t}};var Gs=(r,s)=>{for(var e in s)ri(r,e,{get:s[e],enumerable:!0})};var c=(r,s,e,t)=>{for(var i=t>1?void 0:t?Ys(s,e):s,a=r.length-1,l;a>=0;a--)(l=r[a])&&(i=(t?l(s,e,i):l(i))||i);return t&&i&&ri(s,e,i),i};var We,Ke,ut,ni,Te,ai,A,oi,_t,gt=w(()=>{We=globalThis,Ke=We.ShadowRoot&&(We.ShadyCSS===void 0||We.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ut=Symbol(),ni=new WeakMap,Te=class{constructor(s,e,t){if(this._$cssResult$=!0,t!==ut)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=s,this.t=e}get styleSheet(){let s=this.o,e=this.t;if(Ke&&s===void 0){let t=e!==void 0&&e.length===1;t&&(s=ni.get(e)),s===void 0&&((this.o=s=new CSSStyleSheet).replaceSync(this.cssText),t&&ni.set(e,s))}return s}toString(){return this.cssText}},ai=r=>new Te(typeof r=="string"?r:r+"",void 0,ut),A=(r,...s)=>{let e=r.length===1?r[0]:s.reduce((t,i,a)=>t+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[a+1],r[0]);return new Te(e,r,ut)},oi=(r,s)=>{if(Ke)r.adoptedStyleSheets=s.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of s){let t=document.createElement("style"),i=We.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,r.appendChild(t)}},_t=Ke?r=>r:r=>r instanceof CSSStyleSheet?(s=>{let e="";for(let t of s.cssRules)e+=t.cssText;return ai(e)})(r):r});var Qs,Js,Zs,Xs,er,tr,Ye,li,ir,sr,Ce,Ie,Ge,ci,ee,Pe=w(()=>{gt();gt();({is:Qs,defineProperty:Js,getOwnPropertyDescriptor:Zs,getOwnPropertyNames:Xs,getOwnPropertySymbols:er,getPrototypeOf:tr}=Object),Ye=globalThis,li=Ye.trustedTypes,ir=li?li.emptyScript:"",sr=Ye.reactiveElementPolyfillSupport,Ce=(r,s)=>r,Ie={toAttribute(r,s){switch(s){case Boolean:r=r?ir:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,s){let e=r;switch(s){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},Ge=(r,s)=>!Qs(r,s),ci={attribute:!0,type:String,converter:Ie,reflect:!1,useDefault:!1,hasChanged:Ge};Symbol.metadata??=Symbol("metadata"),Ye.litPropertyMetadata??=new WeakMap;ee=class extends HTMLElement{static addInitializer(s){this._$Ei(),(this.l??=[]).push(s)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(s,e=ci){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(s)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(s,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(s,t,e);i!==void 0&&Js(this.prototype,s,i)}}static getPropertyDescriptor(s,e,t){let{get:i,set:a}=Zs(this.prototype,s)??{get(){return this[e]},set(l){this[e]=l}};return{get:i,set(l){let d=i?.call(this);a?.call(this,l),this.requestUpdate(s,d,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(s){return this.elementProperties.get(s)??ci}static _$Ei(){if(this.hasOwnProperty(Ce("elementProperties")))return;let s=tr(this);s.finalize(),s.l!==void 0&&(this.l=[...s.l]),this.elementProperties=new Map(s.elementProperties)}static finalize(){if(this.hasOwnProperty(Ce("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ce("properties"))){let e=this.properties,t=[...Xs(e),...er(e)];for(let i of t)this.createProperty(i,e[i])}let s=this[Symbol.metadata];if(s!==null){let e=litPropertyMetadata.get(s);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){let e=[];if(Array.isArray(s)){let t=new Set(s.flat(1/0).reverse());for(let i of t)e.unshift(_t(i))}else s!==void 0&&e.push(_t(s));return e}static _$Eu(s,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof s=="string"?s.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(s=>this.enableUpdating=s),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(s=>s(this))}addController(s){(this._$EO??=new Set).add(s),this.renderRoot!==void 0&&this.isConnected&&s.hostConnected?.()}removeController(s){this._$EO?.delete(s)}_$E_(){let s=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(s.set(t,this[t]),delete this[t]);s.size>0&&(this._$Ep=s)}createRenderRoot(){let s=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return oi(s,this.constructor.elementStyles),s}connectedCallback(){this.renderRoot??=tLine truncated
|
var ni=Object.defineProperty;var Js=Object.getOwnPropertyDescriptor;var w=(r,s,e)=>()=>{if(e)throw e[0];try{return r&&(s=r(r=0)),s}catch(t){throw e=[t],t}};var Zs=(r,s)=>{for(var e in s)ni(r,e,{get:s[e],enumerable:!0})};var d=(r,s,e,t)=>{for(var i=t>1?void 0:t?Js(s,e):s,a=r.length-1,l;a>=0;a--)(l=r[a])&&(i=(t?l(s,e,i):l(i))||i);return t&&i&&ni(s,e,i),i};var Ye,Ge,_t,ai,Ce,oi,T,li,gt,mt=w(()=>{Ye=globalThis,Ge=Ye.ShadowRoot&&(Ye.ShadyCSS===void 0||Ye.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_t=Symbol(),ai=new WeakMap,Ce=class{constructor(s,e,t){if(this._$cssResult$=!0,t!==_t)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=s,this.t=e}get styleSheet(){let s=this.o,e=this.t;if(Ge&&s===void 0){let t=e!==void 0&&e.length===1;t&&(s=ai.get(e)),s===void 0&&((this.o=s=new CSSStyleSheet).replaceSync(this.cssText),t&&ai.set(e,s))}return s}toString(){return this.cssText}},oi=r=>new Ce(typeof r=="string"?r:r+"",void 0,_t),T=(r,...s)=>{let e=r.length===1?r[0]:s.reduce((t,i,a)=>t+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[a+1],r[0]);return new Ce(e,r,_t)},li=(r,s)=>{if(Ge)r.adoptedStyleSheets=s.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of s){let t=document.createElement("style"),i=Ye.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,r.appendChild(t)}},gt=Ge?r=>r:r=>r instanceof CSSStyleSheet?(s=>{let e="";for(let t of s.cssRules)e+=t.cssText;return oi(e)})(r):r});var Xs,er,tr,ir,sr,rr,Qe,di,nr,ar,Ie,Pe,Je,ci,ee,Le=w(()=>{mt();mt();({is:Xs,defineProperty:er,getOwnPropertyDescriptor:tr,getOwnPropertyNames:ir,getOwnPropertySymbols:sr,getPrototypeOf:rr}=Object),Qe=globalThis,di=Qe.trustedTypes,nr=di?di.emptyScript:"",ar=Qe.reactiveElementPolyfillSupport,Ie=(r,s)=>r,Pe={toAttribute(r,s){switch(s){case Boolean:r=r?nr:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,s){let e=r;switch(s){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},Je=(r,s)=>!Xs(r,s),ci={attribute:!0,type:String,converter:Pe,reflect:!1,useDefault:!1,hasChanged:Je};Symbol.metadata??=Symbol("metadata"),Qe.litPropertyMetadata??=new WeakMap;ee=class extends HTMLElement{static addInitializer(s){this._$Ei(),(this.l??=[]).push(s)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(s,e=ci){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(s)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(s,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(s,t,e);i!==void 0&&er(this.prototype,s,i)}}static getPropertyDescriptor(s,e,t){let{get:i,set:a}=tr(this.prototype,s)??{get(){return this[e]},set(l){this[e]=l}};return{get:i,set(l){let c=i?.call(this);a?.call(this,l),this.requestUpdate(s,c,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(s){return this.elementProperties.get(s)??ci}static _$Ei(){if(this.hasOwnProperty(Ie("elementProperties")))return;let s=rr(this);s.finalize(),s.l!==void 0&&(this.l=[...s.l]),this.elementProperties=new Map(s.elementProperties)}static finalize(){if(this.hasOwnProperty(Ie("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ie("properties"))){let e=this.properties,t=[...ir(e),...sr(e)];for(let i of t)this.createProperty(i,e[i])}let s=this[Symbol.metadata];if(s!==null){let e=litPropertyMetadata.get(s);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){let e=[];if(Array.isArray(s)){let t=new Set(s.flat(1/0).reverse());for(let i of t)e.unshift(gt(i))}else s!==void 0&&e.push(gt(s));return e}static _$Eu(s,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof s=="string"?s.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(s=>this.enableUpdating=s),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(s=>s(this))}addController(s){(this._$EO??=new Set).add(s),this.renderRoot!==void 0&&this.isConnected&&s.hostConnected?.()}removeController(s){this._$EO?.delete(s)}_$E_(){let s=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(s.set(t,this[t]),delete this[t]);s.size>0&&(this._$Ep=s)}createRenderRoot(){let s=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return li(s,this.constructor.elementStyles),s}connectedCallback(){this.renderRoot??=tLine truncated
|
||||||
\f\r]`,Le=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,hi=/-->/g,ui=/>/g,de=RegExp(`>|${mt}(?:([^\\s"'>=/]+)(${mt}*=${mt}*(?:[^
|
\f\r]`,Re=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ui=/-->/g,_i=/>/g,ce=RegExp(`>|${ft}(?:([^\\s"'>=/]+)(${ft}*=${ft}*(?:[^
|
||||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),_i=/'/g,gi=/"/g,bi=/^(?:script|style|textarea|title)$/i,kt=r=>(s,...e)=>({_$litType$:r,strings:s,values:e}),o=kt(1),ye=kt(2),vn=kt(3),ue=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),mi=new WeakMap,pe=he.createTreeWalker(he,129);ar=(r,s)=>{let e=r.length-1,t=[],i,a=s===2?"<svg>":s===3?"<math>":"",l=Le;for(let d=0;d<e;d++){let p=r[d],_,f,x=-1,v=0;for(;v<p.length&&(l.lastIndex=v,f=l.exec(p),f!==null);)v=l.lastIndex,l===Le?f[1]==="!--"?l=hi:f[1]!==void 0?l=ui:f[2]!==void 0?(bi.test(f[2])&&(i=RegExp("</"+f[2],"g")),l=de):f[3]!==void 0&&(l=de):l===de?f[0]===">"?(l=i??Le,x=-1):f[1]===void 0?x=-2:(x=l.lastIndex-f[2].length,_=f[1],l=f[3]===void 0?de:f[3]==='"'?gi:_i):l===gi||l===_i?l=de:l===hi||l===ui?l=Le:(l=de,i=void 0);let y=l===de&&r[d+1].startsWith("/>")?" ":"";a+=l===Le?p+rr:x>=0?(t.push(_),p.slice(0,x)+fi+p.slice(x)+ae+y):p+ae+(x===-2?d:y)}return[yi(r,a+(r[e]||"<?>")+(s===2?"</svg>":s===3?"</math>":"")),t]},je=class r{constructor({strings:s,_$litType$:e},t){let i;this.parts=[];let a=0,l=0,d=s.length-1,p=this.parts,[_,f]=ar(s,e);if(this.el=r.createElement(_,t),pe.currentNode=this.el.content,e===2||e===3){let x=this.el.content.firstChild;x.replaceWith(...x.childNodes)}for(;(i=pe.nextNode())!==null&&p.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(let x of i.getAttributeNames())if(x.endsWith(fi)){let v=f[l++],y=i.getAttribute(x).split(ae),m=/([.?@])?(.*)/.exec(v);p.push({type:1,index:a,name:m[2],strings:y,ctor:m[1]==="."?vt:m[1]==="?"?bt:m[1]==="@"?yt:be}),i.removeAttribute(x)}else x.startsWith(ae)&&(p.push({type:6,index:a}),i.removeAttribute(x));if(bi.test(i.tagName)){let x=i.textContent.split(ae),v=x.length-1;if(v>0){i.textContent=Qe?Qe.emptyScript:"";for(let y=0;y<v;y++)i.append(x[y],Re()),pe.nextNode(),p.push({type:2,index:++a});i.append(x[v],Re())}}}else if(i.nodeType===8)if(i.data===vi)p.push({type:2,index:a});else{let x=-1;for(;(x=i.data.indexOf(ae,x+1))!==-1;)p.push({type:7,index:a}),x+=ae.length-1}a++}}static createElement(s,e){let t=he.createElement("template");return t.innerHTML=s,t}};ft=class{constructor(s,e){this._$AV=[],this._$AN=void 0,this._$AD=s,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(s){let{el:{content:e},parts:t}=this._$AD,i=(s?.creationScope??he).importNode(e,!0);pe.currentNode=i;let a=pe.nextNode(),l=0,d=0,p=t[0];for(;p!==void 0;){if(l===p.index){let _;p.type===2?_=new qe(a,a.nextSibling,this,s):p.type===1?_=new p.ctor(a,p.name,p.strings,this,s):p.type===6&&(_=new xt(a,this,s)),this._$AV.push(_),p=t[++d]}l!==p?.index&&(a=pe.nextNode(),l++)}return pe.currentNode=he,i}p(s){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(s,t,e),e+=t.strings.length-2):t._$AI(s[e])),e++}},qe=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(s,e,t,i){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=s,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let s=this._$AA.parentNode,e=this._$AM;return e!==void 0&&s?.nodeType===11&&(s=e.parentNode),s}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(s,e=this){s=ve(this,s,e),Ne(s)?s===h||s==null||s===""?(this._$AH!==h&&this._$AR(),this._$AH=h):s!==this._$AH&&s!==ue&&this._(s):s._$litType$!==void 0?this.$(s):s.nodeType!==void 0?this.T(s):nr(s)?this.k(s):this._(s)}O(s){return this._$AA.parentNode.insertBefore(s,this._$AB)}T(s){this._$AH!==s&&(this._$AR(),this._$AH=this.O(s))}_(s){this._$AH!==h&&Ne(this._$AH)?this._$AA.nextSibling.data=s:this.T(he.createTextNode(s)),this._$AH=s}$(s){let{values:e,_$litType$:t}=s,i=typeof t=="number"?this._$AC(s):(t.el===void 0&&(t.el=je.createElement(yi(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let a=new ft(i,this),l=a.u(this.options);a.p(e),this.T(l),this._$AH=a}}_$AC(s){let e=mi.get(s.strings);return e===void 0&&mi.set(s.strings,e=new je(s)),e}k(s){$t(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let a of s)i===e.length?e.push(t=new r(this.O(Re()),this.O(Re()),this,this.options)):t=e[i],t._$AI(a),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(s=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);s!==this._$AB;){let t=di(s).nextSibling;di(s).remove(),s=t}}setConnected(s){this._$AM===void 0&&(this._$Cv=s,this._$AP?.(s))}},be=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(s,e,t,i,a){this.type=1,this._$AH=h,this._$AN=void 0,this.element=s,this.name=e,this._$AM=i,this.options=a,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=h}_$AI(s,e=this,t,i){let a=this.strings,l=!1;if(a===void 0)s=ve(this,s,e,0),l=!Ne(s)||s!==this._$AH&&s!==ue,l&&(this._$AH=s);else{let d=s,p,_;for(s=a[0],p=0;p<a.length-1;p++)_=ve(this,d[t+p],e,p),_===ue&&(_=this._$AH[p]),l||=!Ne(_)||_!==this._$AH[p],_===h?s=h:s!==h&&(s+=(_??"")+a[p+1]),this._$AH[p]=_}l&&!i&&this.j(s)}j(s){s===h?this.element.removeAttribute(this.naLine truncated
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),gi=/'/g,mi=/"/g,yi=/^(?:script|style|textarea|title)$/i,Et=r=>(s,...e)=>({_$litType$:r,strings:s,values:e}),o=Et(1),ye=Et(2),wn=Et(3),ue=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),fi=new WeakMap,pe=he.createTreeWalker(he,129);dr=(r,s)=>{let e=r.length-1,t=[],i,a=s===2?"<svg>":s===3?"<math>":"",l=Re;for(let c=0;c<e;c++){let p=r[c],_,f,x=-1,v=0;for(;v<p.length&&(l.lastIndex=v,f=l.exec(p),f!==null);)v=l.lastIndex,l===Re?f[1]==="!--"?l=ui:f[1]!==void 0?l=_i:f[2]!==void 0?(yi.test(f[2])&&(i=RegExp("</"+f[2],"g")),l=ce):f[3]!==void 0&&(l=ce):l===ce?f[0]===">"?(l=i??Re,x=-1):f[1]===void 0?x=-2:(x=l.lastIndex-f[2].length,_=f[1],l=f[3]===void 0?ce:f[3]==='"'?mi:gi):l===mi||l===gi?l=ce:l===ui||l===_i?l=Re:(l=ce,i=void 0);let y=l===ce&&r[c+1].startsWith("/>")?" ":"";a+=l===Re?p+or:x>=0?(t.push(_),p.slice(0,x)+vi+p.slice(x)+ae+y):p+ae+(x===-2?c:y)}return[xi(r,a+(r[e]||"<?>")+(s===2?"</svg>":s===3?"</math>":"")),t]},qe=class r{constructor({strings:s,_$litType$:e},t){let i;this.parts=[];let a=0,l=0,c=s.length-1,p=this.parts,[_,f]=dr(s,e);if(this.el=r.createElement(_,t),pe.currentNode=this.el.content,e===2||e===3){let x=this.el.content.firstChild;x.replaceWith(...x.childNodes)}for(;(i=pe.nextNode())!==null&&p.length<c;){if(i.nodeType===1){if(i.hasAttributes())for(let x of i.getAttributeNames())if(x.endsWith(vi)){let v=f[l++],y=i.getAttribute(x).split(ae),m=/([.?@])?(.*)/.exec(v);p.push({type:1,index:a,name:m[2],strings:y,ctor:m[1]==="."?bt:m[1]==="?"?yt:m[1]==="@"?xt:be}),i.removeAttribute(x)}else x.startsWith(ae)&&(p.push({type:6,index:a}),i.removeAttribute(x));if(yi.test(i.tagName)){let x=i.textContent.split(ae),v=x.length-1;if(v>0){i.textContent=Ze?Ze.emptyScript:"";for(let y=0;y<v;y++)i.append(x[y],je()),pe.nextNode(),p.push({type:2,index:++a});i.append(x[v],je())}}}else if(i.nodeType===8)if(i.data===bi)p.push({type:2,index:a});else{let x=-1;for(;(x=i.data.indexOf(ae,x+1))!==-1;)p.push({type:7,index:a}),x+=ae.length-1}a++}}static createElement(s,e){let t=he.createElement("template");return t.innerHTML=s,t}};vt=class{constructor(s,e){this._$AV=[],this._$AN=void 0,this._$AD=s,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(s){let{el:{content:e},parts:t}=this._$AD,i=(s?.creationScope??he).importNode(e,!0);pe.currentNode=i;let a=pe.nextNode(),l=0,c=0,p=t[0];for(;p!==void 0;){if(l===p.index){let _;p.type===2?_=new He(a,a.nextSibling,this,s):p.type===1?_=new p.ctor(a,p.name,p.strings,this,s):p.type===6&&(_=new wt(a,this,s)),this._$AV.push(_),p=t[++c]}l!==p?.index&&(a=pe.nextNode(),l++)}return pe.currentNode=he,i}p(s){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(s,t,e),e+=t.strings.length-2):t._$AI(s[e])),e++}},He=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(s,e,t,i){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=s,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let s=this._$AA.parentNode,e=this._$AM;return e!==void 0&&s?.nodeType===11&&(s=e.parentNode),s}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(s,e=this){s=ve(this,s,e),Ne(s)?s===h||s==null||s===""?(this._$AH!==h&&this._$AR(),this._$AH=h):s!==this._$AH&&s!==ue&&this._(s):s._$litType$!==void 0?this.$(s):s.nodeType!==void 0?this.T(s):lr(s)?this.k(s):this._(s)}O(s){return this._$AA.parentNode.insertBefore(s,this._$AB)}T(s){this._$AH!==s&&(this._$AR(),this._$AH=this.O(s))}_(s){this._$AH!==h&&Ne(this._$AH)?this._$AA.nextSibling.data=s:this.T(he.createTextNode(s)),this._$AH=s}$(s){let{values:e,_$litType$:t}=s,i=typeof t=="number"?this._$AC(s):(t.el===void 0&&(t.el=qe.createElement(xi(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let a=new vt(i,this),l=a.u(this.options);a.p(e),this.T(l),this._$AH=a}}_$AC(s){let e=fi.get(s.strings);return e===void 0&&fi.set(s.strings,e=new qe(s)),e}k(s){kt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let a of s)i===e.length?e.push(t=new r(this.O(je()),this.O(je()),this,this.options)):t=e[i],t._$AI(a),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(s=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);s!==this._$AB;){let t=pi(s).nextSibling;pi(s).remove(),s=t}}setConnected(s){this._$AM===void 0&&(this._$Cv=s,this._$AP?.(s))}},be=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(s,e,t,i,a){this.type=1,this._$AH=h,this._$AN=void 0,this.element=s,this.name=e,this._$AM=i,this.options=a,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=h}_$AI(s,e=this,t,i){let a=this.strings,l=!1;if(a===void 0)s=ve(this,s,e,0),l=!Ne(s)||s!==this._$AH&&s!==ue,l&&(this._$AH=s);else{let c=s,p,_;for(s=a[0],p=0;p<a.length-1;p++)_=ve(this,c[t+p],e,p),_===ue&&(_=this._$AH[p]),l||=!Ne(_)||_!==this._$AH[p],_===h?s=h:s!==h&&(s+=(_??"")+a[p+1]),this._$AH[p]=_}l&&!i&&this.j(s)}j(s){s===h?this.element.removeAttribute(this.naLine truncated
|
||||||
Replace seal
|
Replace seal
|
||||||
Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_toggle:"Due at a specific time",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",notes_markdown_hint:"Markdown is supported \u2014 **bold**, lists, [links](\u2026)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",completed_at_optional:"Completed at (optional, empty = now)",completed_at_pick:"Set date & time",completed_at_future_error:"The completion date cannot be in the future.",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",confirm_delete_object:"Delete this object and all its tasks?",confirm_delete_task:"Delete this task?",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",all_priorities:"All priorities",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",all_parts:"All parts",tasks_lower:"tasks",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all:"All entities must trigger",entities:"entities",attribute_optional:"Attribute (optional, blank = state)",use_entity_state:"Use entity state (no attribute)",trigger_above:"Trigger above",trigger_below:"Trigger below",trigger_equals:"Trigger when equal to (=)",trigger_not_equals:"Trigger when different from (\u2260)",for_at_least_minutes:"For at least (minutes)",safety_interval_days:"Safety interval (days, optional)",safety_interval:"Safety interval (optional)",trigger_combinator:"Combine trigger and interval",trigger_combinator_any:"Trigger or interval (whichever first)",trigger_combinator_all:"Trigger and interval (both required)",delta_mode:"Delta mode",from_state_optional:"From state (optional)",to_state_optional:"To state (optional)",documentation_url_optional:"Documentation URL (optional)",object_notes_optional:"Notes (optional)",nfc_tag_id_optional:"NFC Tag ID (optional)",nfc_tags_empty_help:"No NFC tags registered in Home Assistant yet.",nfc_tags_open_settings:"Open Tags settings",nfc_tags_refresh:"Refresh",environmental_entity_optional:"Environmental sensor (optional)",environmental_entity_helper:"e.g. sensor.outdoor_temperature \u2014 adjusts the interval based on environmental conditions",adaptive_prediction_enabled:"Enable sensor-driven predictions",adaptive_seasonal_enabled:"Enable seasonal awareness",adaptive_max_interval:"Maximum interval (days)",adaptive_min_interval:"Minimum interval (days)",adaptive_ewa_alpha:"Learning rate (alpha)",adaptive_enabled:"Enable adaptive scheduling",adaptive_section_title:"Adaptive Scheduling",environmental_attribute_optional:"Environmental attribute (optional)",nfc_tag_id:"NFC Tag ID",nfc_linked:"NFC tag linked",nfc_link_hint:"Click to link NFC tag",responsible_user:"Responsible User",shared_with:"Shared with (rotation)",shared_with_help:"Pick multiple people to share this task; the responsible person rotates on each completion.",rotation_strategy:"Rotation",rotation_none:"No rotation",rotation_round_robin:"Round-robin",rotation_least_com
Line truncated
|
Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_toggle:"Due at a specific time",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",notes_markdown_hint:"Markdown is supported \u2014 **bold**, lists, [links](\u2026)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",completed_at_optional:"Completed at (optional, empty = now)",completed_at_pick:"Set date & time",completed_at_future_error:"The completion date cannot be in the future.",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",confirm_delete_object:"Delete this object and all its tasks?",confirm_delete_task:"Delete this task?",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",all_priorities:"All priorities",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",all_parts:"All parts",tasks_lower:"tasks",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all:"All entities must trigger",entities:"entities",attribute_optional:"Attribute (optional, blank = state)",use_entity_state:"Use entity state (no attribute)",trigger_above:"Trigger above",trigger_below:"Trigger below",trigger_equals:"Trigger when equal to (=)",trigger_not_equals:"Trigger when different from (\u2260)",for_at_least_minutes:"For at least (minutes)",safety_interval_days:"Safety interval (days, optional)",safety_interval:"Safety interval (optional)",trigger_combinator:"Combine trigger and interval",trigger_combinator_any:"Trigger or interval (whichever first)",trigger_combinator_all:"Trigger and interval (both required)",delta_mode:"Delta mode",from_state_optional:"From state (optional)",to_state_optional:"To state (optional)",documentation_url_optional:"Documentation URL (optional)",object_notes_optional:"Notes (optional)",nfc_tag_id_optional:"NFC Tag ID (optional)",nfc_tags_empty_help:"No NFC tags registered in Home Assistant yet.",nfc_tags_open_settings:"Open Tags settings",nfc_tags_refresh:"Refresh",environmental_entity_optional:"Environmental sensor (optional)",environmental_entity_helper:"e.g. sensor.outdoor_temperature \u2014 adjusts the interval based on environmental conditions",adaptive_prediction_enabled:"Enable sensor-driven predictions",adaptive_seasonal_enabled:"Enable seasonal awareness",adaptive_max_interval:"Maximum interval (days)",adaptive_min_interval:"Minimum interval (days)",adaptive_ewa_alpha:"Learning rate (alpha)",adaptive_enabled:"Enable adaptive scheduling",adaptive_section_title:"Adaptive Scheduling",environmental_attribute_optional:"Environmental attribute (optional)",nfc_tag_id:"NFC Tag ID",nfc_linked:"NFC tag linked",nfc_link_hint:"Click to link NFC tag",responsible_user:"Responsible User",shared_with:"Shared with (rotation)",shared_with_help:"Pick multiple people to share this task; the responsible person rotates on each completion.",rotation_strategy:"Rotation",rotation_none:"No rotation",rotation_round_robin:"Round-robin",rotation_least_com
Line truncated
|
||||||
.field { display: flex; flex-direction: column; gap: 4px; }
|
.field { display: flex; flex-direction: column; gap: 4px; }
|
||||||
.field-label { font-size: 12px; color: var(--secondary-text-color); }
|
.field-label { font-size: 12px; color: var(--secondary-text-color); }
|
||||||
.field-input {
|
.field-input {
|
||||||
@@ -14,7 +14,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
font-family: inherit; width: 100%; box-sizing: border-box;
|
font-family: inherit; width: 100%; box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.field-input:focus { outline: none; border-color: var(--primary-color); }
|
.field-input:focus { outline: none; border-color: var(--primary-color); }
|
||||||
`,$r=A`
|
`,Sr=T`
|
||||||
.person-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; vertical-align: middle; }
|
.person-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; vertical-align: middle; }
|
||||||
.person-avatar {
|
.person-avatar {
|
||||||
width: 22px; height: 22px; border-radius: 50%; flex: none;
|
width: 22px; height: 22px; border-radius: 50%; flex: none;
|
||||||
@@ -24,16 +24,16 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
}
|
}
|
||||||
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
||||||
`,kr=A`
|
`,Tr=T`
|
||||||
.ref-chip {
|
.ref-chip {
|
||||||
display: inline-block; font-size: 11.5px; font-weight: 500; line-height: 1; padding: 3px 6px;
|
display: inline-block; font-size: 11.5px; font-weight: 500; line-height: 1; padding: 3px 6px;
|
||||||
border-radius: 6px; border: 1px solid var(--divider-color); color: var(--secondary-text-color);
|
border-radius: 6px; border: 1px solid var(--divider-color); color: var(--secondary-text-color);
|
||||||
font-variant-numeric: tabular-nums; letter-spacing: .02em; vertical-align: middle; white-space: nowrap;
|
font-variant-numeric: tabular-nums; letter-spacing: .02em; vertical-align: middle; white-space: nowrap;
|
||||||
user-select: all;
|
user-select: all;
|
||||||
}
|
}
|
||||||
`,tt=A`
|
`,it=T`
|
||||||
${$r}
|
${Sr}
|
||||||
${kr}
|
${Tr}
|
||||||
:host {
|
:host {
|
||||||
--maint-ok-color: var(--success-color, #4caf50);
|
--maint-ok-color: var(--success-color, #4caf50);
|
||||||
--maint-due-soon-color: var(--warning-color, #ff9800);
|
--maint-due-soon-color: var(--warning-color, #ff9800);
|
||||||
@@ -1237,25 +1237,34 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.stat-item .stat-label { font-size: 11px; white-space: normal; text-align: center; line-height: 1.2; hyphens: auto; overflow-wrap: anywhere; }
|
.stat-item .stat-label { font-size: 11px; white-space: normal; text-align: center; line-height: 1.2; hyphens: auto; overflow-wrap: anywhere; }
|
||||||
.stat-value { font-size: 20px; }
|
.stat-value { font-size: 20px; }
|
||||||
}
|
}
|
||||||
`});function Yi(r,s,e){let t=new Blob([r],{type:e}),i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=s,a.target="_blank",a.rel="noopener",a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(i),6e4)}var Lt=w(()=>{"use strict"});async function Er(r,s,e=300){return(await r.connection.sendMessagePromise({type:"auth/sign_path",path:s,expires:e})).path}async function Rt(r,s,e=300){return Er(r,`/api/maintenance_supporter/document/${s}`,e)}async function Gi(r,s,e=""){let t=window.open("about:blank","_blank");try{let i=await Rt(r,s);t&&(t.location.href=new URL(i+e,window.location.origin).href)}catch(i){throw t&&t.close(),i}}var Nt=w(()=>{"use strict";Lt()});function it(r){return!!r&&/^https?:\/\//i.test(r)}var jt=w(()=>{"use strict"});function Sr(r){let s=(r||"").split(/\s+/).filter(Boolean);return s.length===0?"?":s.length===1?s[0][0].toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()}function Ar(r){let s=0;for(let e of r)s=s*31+e.charCodeAt(0)>>>0;return Qi[s%Qi.length]}function rt(r){return r?{id:r.id,name:r.name,initials:r.initials||Sr(r.name),color:r.color||Ar(r.id)}:null}function qt(r){return r?o`<span class="person-avatar" style="--person-color: ${r.color}" title=${r.name}>${r.initials}</span>`:h}var Qi,Ht=w(()=>{"use strict";P();Qi=["#c62828","#ad1457","#6a1b9a","#4527a0","#283593","#1565c0","#00838f","#2e7d32","#558b2f","#ef6c00","#6d4c41","#546e7a"]});var $e,Ot=w(()=>{"use strict";Ht();$e=class{constructor(s){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=s}updateHass(s){this.hass=s}async getUsers(s=!1){let e=Date.now();if(!s&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(s,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:s,task_id:e,user_id:t})}async getTasksByUser(s){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:s})).tasks}getUserName(s){return!s||!this.usersCache?null:this.usersCache.find(t=>t.id===s)?.name||null}getPerson(s){return rt(this.getUser(s))}getUser(s){return!s||!this.usersCache?null:this.usersCache.find(e=>e.id===s)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(s){return s?s===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}}});function Tr(r,s){if(s<=0)return 0;let e=typeof r=="number"&&Number.isFinite(r)?Math.trunc(r):0;return e<0?0:e%s}function Cr(r){return!!(r?.phases&&r.phase_sequence&&r.phase_sequence.length>0)}function Dt(r){if(!r||!Cr(r))return null;let s=r.phase_sequence,e=Tr(r.phase_cursor,s.length),t=s[e],i=r.phases?.[t];return i?{id:t,name:i.name,index:e,count:s.length,notes:i.notes,checklist:i.checklist!==void 0?i.checklist:r.checklist??[],consumesParts:i.consumes_parts!==void 0?i.consumes_parts:r.consumes_parts??[],requiredFields:i.required_completion_fields!==void 0?i.required_completion_fields:r.required_completion_fields??[]}:null}function oe(r){let s=Dt(r);return s?`${s.index+1}/${s.count} \xB7 ${s.name}`:""}var nt=w(()=>{"use strict"});function Ji(){let r=new Uint8Array(4);return(globalThis.crypto??{getRandomValues:s=>s.map(()=>Math.floor(Math.random()*256))}).getRandomValues(r),Array.from(r,s=>s.toString(16).padStart(2,"0")).join("")}function me(r){let s=r?.reading_values;if(!Array.isArray(s))return[];let e=[],t=new Set;for(let i of s){if(!i||typeof i!="object")continue;let a=i;typeof a.id!="string"||!a.id||t.has(a.id)||typeof a.value!="number"||!Number.isFinite(a.value)||(t.add(a.id),e.push({id:a.id,name:typeof a.name=="string"?a.name:a.id,unit:typeof a.unit=="string"?a.unit:null,value:a.value}))}return e}function Zi(r){return r.filter(s=>s.type==="completed"&&(s.reading_value!=null||me(s).length>0)).sort((s,e)=>s.timestamp.localeCompare(e.timestamp))}function Xi(r){return Zi(r??[]).map(s=>({timestamp:s.timestamp,values:me(s)})).filter(s=>s.values.length>0)}function es(r,s,e){let t;for(let i of r){if(e!==void 0){let l=new Date(i.timestamp).getTime();if(!isNaN(l)&&l>=e)break}let a=i.values.find(l=>l.id===s);a&&(t=a)}return t}function ts(r,s,e){let t=me(s).find(a=>a.id===e);if(!t)return null;let i=null;for(let a of Zi(r)){if(a.timestamp>=s.timestamp)break;let l=me(a).find(d=>d.id===e);l&&(i=l.value)}return i==null?null:t.value-i}function is(r){let s=new Set,e=new Set;for(let t of r){let i=(t.name||"").trim().toLowerCase();i&&(s.has(i)?e.add(t.id):s.add(i))}return e}function ss(r){let s=[],e=new Set,t=new Set;for(let i of r){let a=(i.name||"").trim();if(!(!a||e.has(i.id)||t.has(a.toLowerCase()))&&(e.add(i.id),t.add(a.toLowerCase()),s.push({id:i.id,Line truncated
|
`});function Gi(r,s,e){let t=new Blob([r],{type:e}),i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=s,a.target="_blank",a.rel="noopener",a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(i),6e4)}var Rt=w(()=>{"use strict"});async function Ar(r,s,e=300){return(await r.connection.sendMessagePromise({type:"auth/sign_path",path:s,expires:e})).path}async function jt(r,s,e=300){return Ar(r,`/api/maintenance_supporter/document/${s}`,e)}async function Qi(r,s,e=""){let t=window.open("about:blank","_blank");try{let i=await jt(r,s);t&&(t.location.href=new URL(i+e,window.location.origin).href)}catch(i){throw t&&t.close(),i}}var Nt=w(()=>{"use strict";Rt()});function st(r){return!!r&&/^https?:\/\//i.test(r)}var qt=w(()=>{"use strict"});function Cr(r){let s=(r||"").split(/\s+/).filter(Boolean);return s.length===0?"?":s.length===1?s[0][0].toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()}function Ir(r){let s=0;for(let e of r)s=s*31+e.charCodeAt(0)>>>0;return Ji[s%Ji.length]}function nt(r){return r?{id:r.id,name:r.name,initials:r.initials||Cr(r.name),color:r.color||Ir(r.id)}:null}function Ht(r){return r?o`<span class="person-avatar" style="--person-color: ${r.color}" title=${r.name}>${r.initials}</span>`:h}var Ji,Ot=w(()=>{"use strict";P();Ji=["#c62828","#ad1457","#6a1b9a","#4527a0","#283593","#1565c0","#00838f","#2e7d32","#558b2f","#ef6c00","#6d4c41","#546e7a"]});var $e,Dt=w(()=>{"use strict";Ot();$e=class{constructor(s){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=s}updateHass(s){this.hass=s}async getUsers(s=!1){let e=Date.now();if(!s&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(s,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:s,task_id:e,user_id:t})}async getTasksByUser(s){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:s})).tasks}getUserName(s){return!s||!this.usersCache?null:this.usersCache.find(t=>t.id===s)?.name||null}getPerson(s){return nt(this.getUser(s))}getUser(s){return!s||!this.usersCache?null:this.usersCache.find(e=>e.id===s)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(s){return s?s===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}}});function Pr(r,s){if(s<=0)return 0;let e=typeof r=="number"&&Number.isFinite(r)?Math.trunc(r):0;return e<0?0:e%s}function Lr(r){return!!(r?.phases&&r.phase_sequence&&r.phase_sequence.length>0)}function Mt(r){if(!r||!Lr(r))return null;let s=r.phase_sequence,e=Pr(r.phase_cursor,s.length),t=s[e],i=r.phases?.[t];return i?{id:t,name:i.name,index:e,count:s.length,notes:i.notes,checklist:i.checklist!==void 0?i.checklist:r.checklist??[],consumesParts:i.consumes_parts!==void 0?i.consumes_parts:r.consumes_parts??[],requiredFields:i.required_completion_fields!==void 0?i.required_completion_fields:r.required_completion_fields??[]}:null}function oe(r){let s=Mt(r);return s?`${s.index+1}/${s.count} \xB7 ${s.name}`:""}var at=w(()=>{"use strict"});function Zi(){let r=new Uint8Array(4);return(globalThis.crypto??{getRandomValues:s=>s.map(()=>Math.floor(Math.random()*256))}).getRandomValues(r),Array.from(r,s=>s.toString(16).padStart(2,"0")).join("")}function me(r){let s=r?.reading_values;if(!Array.isArray(s))return[];let e=[],t=new Set;for(let i of s){if(!i||typeof i!="object")continue;let a=i;typeof a.id!="string"||!a.id||t.has(a.id)||typeof a.value!="number"||!Number.isFinite(a.value)||(t.add(a.id),e.push({id:a.id,name:typeof a.name=="string"?a.name:a.id,unit:typeof a.unit=="string"?a.unit:null,value:a.value}))}return e}function Xi(r){return r.filter(s=>s.type==="completed"&&(s.reading_value!=null||me(s).length>0)).sort((s,e)=>s.timestamp.localeCompare(e.timestamp))}function es(r){return Xi(r??[]).map(s=>({timestamp:s.timestamp,values:me(s)})).filter(s=>s.values.length>0)}function ts(r,s,e){let t;for(let i of r){if(e!==void 0){let l=new Date(i.timestamp).getTime();if(!isNaN(l)&&l>=e)break}let a=i.values.find(l=>l.id===s);a&&(t=a)}return t}function is(r,s,e){let t=me(s).find(a=>a.id===e);if(!t)return null;let i=null;for(let a of Xi(r)){if(a.timestamp>=s.timestamp)break;let l=me(a).find(c=>c.id===e);l&&(i=l.value)}return i==null?null:t.value-i}function ss(r){let s=new Set,e=new Set;for(let t of r){let i=(t.name||"").trim().toLowerCase();i&&(s.has(i)?e.add(t.id):s.add(i))}return e}function rs(r){let s=[],e=new Set,t=new Set;for(let i of r){let a=(i.name||"").trim();if(!(!a||e.has(i.id)||t.has(a.toLowerCase()))&&(e.add(i.id),t.add(a.toLowerCase()),s.push({id:i.id,Line truncated
|
||||||
<div class="field">
|
<div class="field">
|
||||||
${this.label?o`<span class="label">${this.label}${this.required?o`<span class="req">*</span>`:h}</span>`:h}
|
${this.label?o`<span class="label">${this.label}${this.required?o`<span class="req">*</span>`:h}</span>`:h}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<ha-selector
|
${this._typing?o`<input class="typed" type="text" inputmode="numeric" autocomplete="off"
|
||||||
.hass=${this.hass}
|
.value=${this._typed}
|
||||||
.selector=${this._selector()}
|
placeholder=${F("1978-03-15",this.lang)}
|
||||||
.value=${Nr(this.kind,this.value)}
|
aria-invalid=${this._typedInvalid?"true":"false"}
|
||||||
.required=${this.required}
|
@input=${e=>{this._typed=e.target.value,this._typedInvalid=!1}}
|
||||||
.disabled=${this.disabled}
|
@keydown=${this._onTypedKey}
|
||||||
@value-changed=${this._onSelectorChange}
|
@blur=${this._commitTyped} />`:o`<ha-selector
|
||||||
></ha-selector>
|
.hass=${this.hass}
|
||||||
${this.clearable&&this.value&&!this.disabled?o`<button type="button" class="clear" title=${n("clear",this.lang)} aria-label=${n("clear",this.lang)} @click=${this._clear}>
|
.selector=${this._selector()}
|
||||||
|
.value=${Or(this.kind,this.value)}
|
||||||
|
.required=${this.required}
|
||||||
|
.disabled=${this.disabled}
|
||||||
|
@value-changed=${this._onSelectorChange}
|
||||||
|
></ha-selector>`}
|
||||||
|
${this.kind==="date"&&!this.disabled&&!this._typing?o`<button type="button" class="type-toggle" title=${n("date_type_toggle",this.lang)} aria-label=${n("date_type_toggle",this.lang)} @click=${this._startTyping}>
|
||||||
|
<ha-icon icon="mdi:keyboard-outline"></ha-icon>
|
||||||
|
</button>`:h}
|
||||||
|
${this.clearable&&this.value&&!this.disabled&&!this._typing?o`<button type="button" class="clear" title=${n("clear",this.lang)} aria-label=${n("clear",this.lang)} @click=${this._clear}>
|
||||||
<ha-icon icon="mdi:close"></ha-icon>
|
<ha-icon icon="mdi:close"></ha-icon>
|
||||||
</button>`:h}
|
</button>`:h}
|
||||||
</div>
|
</div>
|
||||||
${this.helper?o`<span class="helper">${this.helper}</span>`:h}
|
${this._typedInvalid?o`<span class="helper invalid">${n("date_type_invalid",this.lang)}</span>`:this.helper?o`<span class="helper">${this.helper}</span>`:h}
|
||||||
</div>
|
</div>
|
||||||
`}};U.styles=A`
|
`}};D.styles=T`
|
||||||
:host { display: block; }
|
:host { display: block; }
|
||||||
.field {
|
.field {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -1277,7 +1286,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
.clear {
|
.clear, .type-toggle {
|
||||||
flex: none;
|
flex: none;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -1292,14 +1301,29 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
--mdc-icon-size: 20px;
|
--mdc-icon-size: 20px;
|
||||||
}
|
}
|
||||||
.clear:hover { background: rgba(var(--rgb-primary-text-color, 0, 0, 0), 0.08); }
|
.clear:hover, .type-toggle:hover { background: rgba(var(--rgb-primary-text-color, 0, 0, 0), 0.08); }
|
||||||
.clear:focus-visible { outline: 2px solid var(--primary-color); }
|
.clear:focus-visible, .type-toggle:focus-visible { outline: 2px solid var(--primary-color); }
|
||||||
.helper {
|
.helper {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
`,c([b({attribute:!1})],U.prototype,"hass",2),c([b()],U.prototype,"kind",2),c([b()],U.prototype,"label",2),c([b()],U.prototype,"value",2),c([b()],U.prototype,"helper",2),c([b({type:Boolean})],U.prototype,"clearable",2),c([b({type:Boolean})],U.prototype,"disabled",2),c([b({type:Boolean})],U.prototype,"required",2),c([b()],U.prototype,"lang",2);customElements.get("ms-date-field")||customElements.define("ms-date-field",U)});var k,Vt=w(()=>{"use strict";P();M();Fe();j();le();at();ls();zt();Bt();Ee();k=class extends T{constructor(){super(...arguments);this.entryId="";this.taskId="";this.taskName="";this.lang="en";this.checklist=[];this.adaptiveEnabled=!1;this.taskType="";this.readingUnit="";this.readings=[];this.readingHistory=[];this.restockDefault=null;this.restockUnitCost=null;this.currencySymbol="";this.parts=[];this.consumesParts=[];this.consumesInfo=[];this.requiredFields=[];this.phaseLabel="";this.requireTagScan=!1;this.viaTagScan=!1;this._open=!1;this._notes="";this._cost="";this._duration="";this._loading=!1;this._error="";this._checklistState={};this._feedback="needed";this._photos=[];this._uploadedIds=[];this._photoUploading=!1;this._readingValue="";this._readingValues={};this._restockQty="";this._completedAt="";this._usedParts={};this.checklistPrefill={};this._singlePick=os()}open(e={}){this._open||(this._open=!0,this.viaTagScan=!!e.viaTagScan,this._notes="",this._cost="",this._duration="",this._error="",this._checklistState=Object.fromEntries(this.checklist.map((t,i)=>[String(i),!!this.checklistPrefill[t]]).filter(([,t])=>t)),this._feedback="needed",this._photos.forEach(t=>URL.revokeObjectURL(t.preview)),this._photos=[],this._uploadedIds=[],this._photoUploading=!1,this._readingValue="",this._readingValues={},this._restockQty=this.restockDefault!==null?String(this.restockDefault):"",this._completedAt="",this._usedParts=Object.fromEntries(this.consumesParts.map(t=>[G(t),{...t}])))}_toggleCheck(e){let t=String(e);this._checklistState={...this._checklistState,[t]:!this._checklistState[t]}}_setFeedback(e){this._feedback=e}async _onPhotoInput(e){let t=e.target,i=Array.from(t.files??[]);if(t.value="",i.length===0)return;let a=10-this._photos.length,l=i.slice(0,Math.max(a,0));this._photoUploading=!0,this._error="";try{for(let d of l){let p=await lt(this.hass,this.entryId,d);this._uploadedIds=[...this._uploadedIds,p],this._photos=[...this._photos,{id:p,preview:URL.createObjectURL(d)}]}i.length>l.length&&(this._error=n("photos_limit",this.lang).replace("{max}",String(10)))}catch(d){let p=d instanceof Error&&d.message==="doc_too_large"?"doc_too_large":"doc_upload_failed";this._error=n(p,this.lang)}finally{this._photoUploading=!1}}_removePhoto(e){let t=this._photos.find(i=>i.id===e);t&&URL.revokeObjectURL(t.preview),this._photos=this._photos.filter(i=>i.id!==e),this._uploadedIds.includes(e)&&(this._uploadedIds=this._uploadedIds.filter(i=>i!==e),ke(this.hass,[e]))}async _complete(){this._loading=!0,this._error="";try{let e={type:"maintenance_supporter/task/complete",entry_id:this.entryId,task_id:this.taskId};if(this._notes&&(e.notes=this._notes),this._cost){let t=parseFloat(this._cost);!isNaN(t)&&t>=0&&(e.cost=t)}if(this._duration){let t=parseInt(this._duration,10);!isNaN(t)&&t>=0&&(e.duration=t)}if(this.checklist.length>0&&(e.checklist_state=this._checklistState),this.adaptiveEnabled&&(e.feedback=this._feedback),this._photos.length>0&&(e.photo_doc_ids=this._photos.map(t=>t.id)),this.viaTagScan&&(e.via_tag_scan=!0),this._completedAt){if(new Date(this._completedAt).getTime()>Date.now()){this._error=n("completed_at_future_error",this.lang),this._loading=!1;return}e.completed_at=this._completedAt.length===16?`${this._completedAt}:00`:this._completedAt}if(this.readings.length>0){let t={};for(let i of this.readings){let a=(this._readingValues[i.id]??"").trim();if(a==="")continue;let l=parseFloat(a.replace(",","."));isNaN(l)||(t[i.id]=l)}Object.keys(t).length>0&&(e.reading_values=t)}else if(this._readingValue!==""){let t=parseFloat(this._readingValue);isNaN(t)||(e.reading_value=t)}if(this.restockDefault!==null&&this._restockQty!==""){let t=parseFloat(this._restockQty);!isNaN(t)&&t>=1&&(e.restock_quantity=t)}this.parts.length>0&&(e.used_parts=Object.values(this._usedParts).filter(t=>Number.isFinite(t.quantity)&&t.quantity>0).map(t=>t.entry_id?{part_id:t.part_id,quantity:t.quantity,entry_id:t.entry_id}:{part_id:t.part_id,quantity:t.quantity})),await this.hass.connection.sendMessagePromise(e),this._uploadedIds=[],this._open=!1,this.dispatchEvent(new CustomEvent("task-completed"))}catch(e){this._error=C(e,this.lang,n("save_error",this.lang))}finally{this._loading=!1}}_renderReadingField(e,t){let i=this._completedAt?new Date(this._completedAt).getTime():NaN,a=es(this.readingHistory,e.id,isNaN(i)?void 0:i),l=e.unit||this.readingUnit,d=(this._readingValues[e.id]??"").trim(),p=d===""?NaN:parseFloat(d.replace(",",".")),_=a!==void 0&&!isNaN(p)&&p<a.value,f=a!==void 0?N(a.value,t,{maximumFractionDigits:3}):"";return o`
|
.helper.invalid { color: var(--error-color, #f44336); font-style: normal; }
|
||||||
|
input.typed {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
height: 40px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 12px;
|
||||||
|
border: 1px solid var(--divider-color, #ccc);
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--card-background-color, #fff);
|
||||||
|
color: var(--primary-text-color);
|
||||||
|
font: inherit;
|
||||||
|
}
|
||||||
|
input.typed[aria-invalid="true"] { border-color: var(--error-color, #f44336); }
|
||||||
|
input.typed:focus { outline: 2px solid var(--primary-color); outline-offset: -1px; }
|
||||||
|
`,d([b({attribute:!1})],D.prototype,"hass",2),d([b()],D.prototype,"kind",2),d([b()],D.prototype,"label",2),d([b()],D.prototype,"value",2),d([b()],D.prototype,"helper",2),d([b({type:Boolean})],D.prototype,"clearable",2),d([b({type:Boolean})],D.prototype,"disabled",2),d([b({type:Boolean})],D.prototype,"required",2),d([b()],D.prototype,"lang",2),d([u()],D.prototype,"_typing",2),d([u()],D.prototype,"_typed",2),d([u()],D.prototype,"_typedInvalid",2);customElements.get("ms-date-field")||customElements.define("ms-date-field",D)});var k,Wt=w(()=>{"use strict";P();z();Be();L();le();ot();ds();Ft();Vt();Se();k=class extends A{constructor(){super(...arguments);this.entryId="";this.taskId="";this.taskName="";this.lang="en";this.checklist=[];this.adaptiveEnabled=!1;this.taskType="";this.readingUnit="";this.readings=[];this.readingHistory=[];this.restockDefault=null;this.restockUnitCost=null;this.currencySymbol="";this.parts=[];this.consumesParts=[];this.consumesInfo=[];this.requiredFields=[];this.phaseLabel="";this.requireTagScan=!1;this.viaTagScan=!1;this._open=!1;this._notes="";this._cost="";this._duration="";this._loading=!1;this._error="";this._checklistState={};this._feedback="needed";this._photos=[];this._uploadedIds=[];this._photoUploading=!1;this._readingValue="";this._readingValues={};this._restockQty="";this._completedAt="";this._usedParts={};this.checklistPrefill={};this._singlePick=ls()}open(e={}){this._open||(this._open=!0,this.viaTagScan=!!e.viaTagScan,this._notes="",this._cost="",this._duration="",this._error="",this._checklistState=Object.fromEntries(this.checklist.map((t,i)=>[String(i),!!this.checklistPrefill[t]]).filter(([,t])=>t)),this._feedback="needed",this._photos.forEach(t=>URL.revokeObjectURL(t.preview)),this._photos=[],this._uploadedIds=[],this._photoUploading=!1,this._readingValue="",this._readingValues={},this._restockQty=this.restockDefault!==null?String(this.restockDefault):"",this._completedAt="",this._usedParts=Object.fromEntries(this.consumesParts.map(t=>[G(t),{...t}])))}_toggleCheck(e){let t=String(e);this._checklistState={...this._checklistState,[t]:!this._checklistState[t]}}_setFeedback(e){this._feedback=e}async _onPhotoInput(e){let t=e.target,i=Array.from(t.files??[]);if(t.value="",i.length===0)return;let a=10-this._photos.length,l=i.slice(0,Math.max(a,0));this._photoUploading=!0,this._error="";try{for(let c of l){let p=await dt(this.hass,this.entryId,c);this._uploadedIds=[...this._uploadedIds,p],this._photos=[...this._photos,{id:p,preview:URL.createObjectURL(c)}]}i.length>l.length&&(this._error=n("photos_limit",this.lang).replace("{max}",String(10)))}catch(c){let p=c instanceof Error&&c.message==="doc_too_large"?"doc_too_large":"doc_upload_failed";this._error=n(p,this.lang)}finally{this._photoUploading=!1}}_removePhoto(e){let t=this._photos.find(i=>i.id===e);t&&URL.revokeObjectURL(t.preview),this._photos=this._photos.filter(i=>i.id!==e),this._uploadedIds.includes(e)&&(this._uploadedIds=this._uploadedIds.filter(i=>i!==e),ke(this.hass,[e]))}async _complete(){this._loading=!0,this._error="";try{let e={type:"maintenance_supporter/task/complete",entry_id:this.entryId,task_id:this.taskId};if(this._notes&&(e.notes=this._notes),this._cost){let t=parseFloat(this._cost);!isNaN(t)&&t>=0&&(e.cost=t)}if(this._duration){let t=parseInt(this._duration,10);!isNaN(t)&&t>=0&&(e.duration=t)}if(this.checklist.length>0&&(e.checklist_state=this._checklistState),this.adaptiveEnabled&&(e.feedback=this._feedback),this._photos.length>0&&(e.photo_doc_ids=this._photos.map(t=>t.id)),this.viaTagScan&&(e.via_tag_scan=!0),this._completedAt){if(new Date(this._completedAt).getTime()>Date.now()){this._error=n("completed_at_future_error",this.lang),this._loading=!1;return}e.completed_at=this._completedAt.length===16?`${this._completedAt}:00`:this._completedAt}if(this.readings.length>0){let t={};for(let i of this.readings){let a=(this._readingValues[i.id]??"").trim();if(a==="")continue;let l=parseFloat(a.replace(",","."));isNaN(l)||(t[i.id]=l)}Object.keys(t).length>0&&(e.reading_values=t)}else if(this._readingValue!==""){let t=parseFloat(this._readingValue);isNaN(t)||(e.reading_value=t)}if(this.restockDefault!==null&&this._restockQty!==""){let t=parseFloat(this._restockQty);!isNaN(t)&&t>=1&&(e.restock_quantity=t)}this.parts.length>0&&(e.used_parts=Object.values(this._usedParts).filter(t=>Number.isFinite(t.quantity)&&t.quantity>0).map(t=>t.entry_id?{part_id:t.part_id,quantity:t.quantity,entry_id:t.entry_id}:{part_id:t.part_id,quantity:t.quantity})),await this.hass.connection.sendMessagePromise(e),this._uploadedIds=[],this._open=!1,this.dispatchEvent(new CustomEvent("task-completed"))}catch(e){this._error=C(e,this.lang,n("save_error",this.lang))}finally{this._loading=!1}}_renderReadingField(e,t){let i=this._completedAt?new Date(this._completedAt).getTime():NaN,a=ts(this.readingHistory,e.id,isNaN(i)?void 0:i),l=e.unit||this.readingUnit,c=(this._readingValues[e.id]??"").trim(),p=c===""?NaN:parseFloat(c.replace(",",".")),_=
Line truncated
|
||||||
<label class="field reading-field">
|
<label class="field reading-field">
|
||||||
<span class="field-label">${e.name}${l?` (${l})`:""}</span>
|
<span class="field-label">${e.name}${l?` (${l})`:""}</span>
|
||||||
<input type="text" inputmode="decimal" class="field-input"
|
<input type="text" inputmode="decimal" class="field-input"
|
||||||
@@ -1307,7 +1331,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._readingValues[e.id]??""}
|
.value=${this._readingValues[e.id]??""}
|
||||||
@input=${x=>{this._readingValues={...this._readingValues,[e.id]:x.target.value}}} />
|
@input=${x=>{this._readingValues={...this._readingValues,[e.id]:x.target.value}}} />
|
||||||
${_?o`<span class="reading-warn">${n("reading_below_last",t).replace("{value}",f)}</span>`:h}
|
${_?o`<span class="reading-warn">${n("reading_below_last",t).replace("{value}",f)}</span>`:h}
|
||||||
</label>`}get _missingRequired(){let e={notes:this._notes.trim()!=="",cost:this._cost.trim()!=="",duration:this._duration.trim()!=="",photo:this._photos.length>0,user:!!this.hass?.user};return this.requiredFields.filter(t=>!e[t])}_req(e){return this.requiredFields.includes(e)?o`<span class="req-mark" aria-hidden="true">*</span>`:h}_partsCostSuggestion(){if(this.restockDefault!==null){let i=parseFloat(this._restockQty);return this.restockUnitCost==null||!Number.isFinite(i)||i<=0?null:Math.round(this.restockUnitCost*i*100)/100}if(!this.parts.length)return null;let e=0,t=!1;for(let i of Object.values(this._usedParts)){let a=this.parts.find(l=>G({part_id:l.id,entry_id:l.entry_id})===G(i));a?.cost!=null&&(e+=a.cost*(i.quantity||1),t=!0)}return t?Math.round(e*100)/100:null}_renderCostSuggestion(e){if(this._cost.trim()!=="")return h;let t=this._partsCostSuggestion();if(t==null||t<=0)return h;let i=Mi(t,this.currencySymbol,e);return o`<button
|
</label>`}get _missingRequired(){let e={notes:this._notes.trim()!=="",cost:this._cost.trim()!=="",duration:this._duration.trim()!=="",photo:this._photos.length>0,user:!!this.hass?.user};return this.requiredFields.filter(t=>!e[t])}_req(e){return this.requiredFields.includes(e)?o`<span class="req-mark" aria-hidden="true">*</span>`:h}_partsCostSuggestion(){if(this.restockDefault!==null){let i=parseFloat(this._restockQty);return this.restockUnitCost==null||!Number.isFinite(i)||i<=0?null:Math.round(this.restockUnitCost*i*100)/100}if(!this.parts.length)return null;let e=0,t=!1;for(let i of Object.values(this._usedParts)){let a=this.parts.find(l=>G({part_id:l.id,entry_id:l.entry_id})===G(i));a?.cost!=null&&(e+=a.cost*(i.quantity||1),t=!0)}return t?Math.round(e*100)/100:null}_renderCostSuggestion(e){if(this._cost.trim()!=="")return h;let t=this._partsCostSuggestion();if(t==null||t<=0)return h;let i=zi(t,this.currencySymbol,e);return o`<button
|
||||||
type="button"
|
type="button"
|
||||||
class="cost-suggestion"
|
class="cost-suggestion"
|
||||||
@click=${()=>this._cost=String(Math.round(t*100)/100)}
|
@click=${()=>this._cost=String(Math.round(t*100)/100)}
|
||||||
@@ -1341,17 +1365,17 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
</label>`:h}
|
</label>`:h}
|
||||||
${this.parts.length?o`<div class="used-parts">
|
${this.parts.length?o`<div class="used-parts">
|
||||||
<span class="field-label">${n("complete_parts_used",e)}</span>
|
<span class="field-label">${n("complete_parts_used",e)}</span>
|
||||||
${this.parts.map(t=>{let i=G({part_id:t.id,entry_id:t.entry_id}),a=this._usedParts[i],l=a!==void 0,d=t.entry_id?{part_id:t.id,quantity:1,entry_id:t.entry_id}:{part_id:t.id,quantity:1};return o`<div class="used-part-row">
|
${this.parts.map(t=>{let i=G({part_id:t.id,entry_id:t.entry_id}),a=this._usedParts[i],l=a!==void 0,c=t.entry_id?{part_id:t.id,quantity:1,entry_id:t.entry_id}:{part_id:t.id,quantity:1};return o`<div class="used-part-row">
|
||||||
<label class="used-part-check">
|
<label class="used-part-check">
|
||||||
<input type="checkbox" .checked=${l}
|
<input type="checkbox" .checked=${l}
|
||||||
@change=${p=>{let _={...this._usedParts};p.target.checked?_[i]=_[i]||d:delete _[i],this._usedParts=_}} />
|
@change=${p=>{let _={...this._usedParts};p.target.checked?_[i]=_[i]||c:delete _[i],this._usedParts=_}} />
|
||||||
<span
|
<span
|
||||||
>${t.name}${t.owner_name?o`<span class="used-part-owner"> (${t.owner_name})</span>`:h}${t.stock!==null&&t.stock!==void 0?` (${t.stock}${t.unit?" "+t.unit:""})`:""}</span
|
>${t.name}${t.owner_name?o`<span class="used-part-owner"> (${t.owner_name})</span>`:h}${t.stock!==null&&t.stock!==void 0?` (${t.stock}${t.unit?" "+t.unit:""})`:""}</span
|
||||||
>
|
>
|
||||||
</label>
|
</label>
|
||||||
${l?o`<input class="used-part-qty" type="number" min="0.01" max="999" step="0.01"
|
${l?o`<input class="used-part-qty" type="number" min="0.01" max="999" step="0.01"
|
||||||
.value=${String(a.quantity)}
|
.value=${String(a.quantity)}
|
||||||
@input=${p=>{let _=parseFloat(p.target.value);this._usedParts={...this._usedParts,[i]:{...d,quantity:Number.isFinite(_)&&_>=.01?_:1}}}} />`:h}
|
@input=${p=>{let _=parseFloat(p.target.value);this._usedParts={...this._usedParts,[i]:{...c,quantity:Number.isFinite(_)&&_>=.01?_:1}}}} />`:h}
|
||||||
</div>`})}
|
</div>`})}
|
||||||
</div>`:this.consumesInfo.length?o`<div class="consumes-hint">
|
</div>`:this.consumesInfo.length?o`<div class="consumes-hint">
|
||||||
${this.consumesInfo.map(t=>o`<div>${t}</div>`)}
|
${this.consumesInfo.map(t=>o`<div>${t}</div>`)}
|
||||||
@@ -1456,13 +1480,13 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<ha-button
|
<ha-button
|
||||||
@click=${this._complete}
|
@click=${this._complete}
|
||||||
.disabled=${this._loading||this._missingRequired.length>0}
|
.disabled=${this._loading||this._missingRequired.length>0}
|
||||||
title=${this._missingRequired.length?this._missingRequired.map(t=>n("err_required",e).replace("{field}",n(Ve[t]??t,e))).join(" \xB7 "):""}
|
title=${this._missingRequired.length?this._missingRequired.map(t=>n("err_required",e).replace("{field}",n(Ke[t]??t,e))).join(" \xB7 "):""}
|
||||||
>
|
>
|
||||||
${this._loading?n("completing",e):n("complete",e)}
|
${this._loading?n("completing",e):n("complete",e)}
|
||||||
</ha-button>
|
</ha-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
`}};k.styles=[Ki,A`
|
`}};k.styles=[Yi,T`
|
||||||
.req-mark {
|
.req-mark {
|
||||||
color: var(--error-color, #f44336);
|
color: var(--error-color, #f44336);
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
@@ -1690,7 +1714,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
color: var(--text-primary-color, #fff);
|
color: var(--text-primary-color, #fff);
|
||||||
border-color: var(--primary-color);
|
border-color: var(--primary-color);
|
||||||
}
|
}
|
||||||
`],c([b({attribute:!1})],k.prototype,"hass",2),c([b()],k.prototype,"entryId",2),c([b()],k.prototype,"taskId",2),c([b()],k.prototype,"taskName",2),c([b()],k.prototype,"lang",2),c([b({type:Array})],k.prototype,"checklist",2),c([b({type:Boolean})],k.prototype,"adaptiveEnabled",2),c([b()],k.prototype,"taskType",2),c([b()],k.prototype,"readingUnit",2),c([b({attribute:!1})],k.prototype,"readings",2),c([b({attribute:!1})],k.prototype,"readingHistory",2),c([b({attribute:!1})],k.prototype,"restockDefault",2),c([b({attribute:!1})],k.prototype,"restockUnitCost",2),c([b()],k.prototype,"currencySymbol",2),c([b({attribute:!1})],k.prototype,"parts",2),c([b({attribute:!1})],k.prototype,"consumesParts",2),c([b({type:Array})],k.prototype,"consumesInfo",2),c([b({type:Array})],k.prototype,"requiredFields",2),c([b()],k.prototype,"phaseLabel",2),c([b({type:Boolean})],k.prototype,"requireTagScan",2),c([b({type:Boolean})],k.prototype,"viaTagScan",2),c([u()],k.prototype,"_open",2),c([u()],k.prototype,"_notes",2),c([u()],k.prototype,"_cost",2),c([u()],k.prototype,"_duration",2),c([u()],k.prototype,"_loading",2),c([u()],k.prototype,"_error",2),c([u()],k.prototype,"_checklistState",2),c([u()],k.prototype,"_feedback",2),c([u()],k.prototype,"_photos",2),c([u()],k.prototype,"_photoUploading",2),c([u()],k.prototype,"_readingValue",2),c([u()],k.prototype,"_readingValues",2),c([u()],k.prototype,"_restockQty",2),c([u()],k.prototype,"_completedAt",2),c([u()],k.prototype,"_usedParts",2),c([b({attribute:!1})],k.prototype,"checklistPrefill",2);customElements.get("maintenance-complete-dialog")||customElements.define("maintenance-complete-dialog",k)});function E(r){return r.toFixed(1)}var ct=w(()=>{"use strict";j()});var O,Yt=w(()=>{"use strict";P();M();O=class extends T{constructor(){super(...arguments);this.label="";this.value="";this.placeholder="";this.type="text";this.required=!1;this.disabled=!1;this.multiline=!1;this.rows=3}_onInput(e){let t=e.target.value;this.value=t,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:t}}))}render(){return o`
|
`],d([b({attribute:!1})],k.prototype,"hass",2),d([b()],k.prototype,"entryId",2),d([b()],k.prototype,"taskId",2),d([b()],k.prototype,"taskName",2),d([b()],k.prototype,"lang",2),d([b({type:Array})],k.prototype,"checklist",2),d([b({type:Boolean})],k.prototype,"adaptiveEnabled",2),d([b()],k.prototype,"taskType",2),d([b()],k.prototype,"readingUnit",2),d([b({attribute:!1})],k.prototype,"readings",2),d([b({attribute:!1})],k.prototype,"readingHistory",2),d([b({attribute:!1})],k.prototype,"restockDefault",2),d([b({attribute:!1})],k.prototype,"restockUnitCost",2),d([b()],k.prototype,"currencySymbol",2),d([b({attribute:!1})],k.prototype,"parts",2),d([b({attribute:!1})],k.prototype,"consumesParts",2),d([b({type:Array})],k.prototype,"consumesInfo",2),d([b({type:Array})],k.prototype,"requiredFields",2),d([b()],k.prototype,"phaseLabel",2),d([b({type:Boolean})],k.prototype,"requireTagScan",2),d([b({type:Boolean})],k.prototype,"viaTagScan",2),d([u()],k.prototype,"_open",2),d([u()],k.prototype,"_notes",2),d([u()],k.prototype,"_cost",2),d([u()],k.prototype,"_duration",2),d([u()],k.prototype,"_loading",2),d([u()],k.prototype,"_error",2),d([u()],k.prototype,"_checklistState",2),d([u()],k.prototype,"_feedback",2),d([u()],k.prototype,"_photos",2),d([u()],k.prototype,"_photoUploading",2),d([u()],k.prototype,"_readingValue",2),d([u()],k.prototype,"_readingValues",2),d([u()],k.prototype,"_restockQty",2),d([u()],k.prototype,"_completedAt",2),d([u()],k.prototype,"_usedParts",2),d([b({attribute:!1})],k.prototype,"checklistPrefill",2);customElements.get("maintenance-complete-dialog")||customElements.define("maintenance-complete-dialog",k)});function E(r){return r.toFixed(1)}var ct=w(()=>{"use strict";L()});var O,Gt=w(()=>{"use strict";P();z();O=class extends A{constructor(){super(...arguments);this.label="";this.value="";this.placeholder="";this.type="text";this.required=!1;this.disabled=!1;this.multiline=!1;this.rows=3}_onInput(e){let t=e.target.value;this.value=t,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:t}}))}render(){return o`
|
||||||
<label class="field">
|
<label class="field">
|
||||||
${this.label?o`<span class="label">${this.label}${this.required?o`<span class="req">*</span>`:h}</span>`:h}
|
${this.label?o`<span class="label">${this.label}${this.required?o`<span class="req">*</span>`:h}</span>`:h}
|
||||||
${this.multiline?o`
|
${this.multiline?o`
|
||||||
@@ -1718,7 +1742,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
/>`}
|
/>`}
|
||||||
${this.helper?o`<span class="helper">${this.helper}</span>`:h}
|
${this.helper?o`<span class="helper">${this.helper}</span>`:h}
|
||||||
</label>
|
</label>
|
||||||
`}};O.styles=A`
|
`}};O.styles=T`
|
||||||
:host { display: block; }
|
:host { display: block; }
|
||||||
.field {
|
.field {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -1767,7 +1791,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
`,c([b()],O.prototype,"label",2),c([b()],O.prototype,"value",2),c([b()],O.prototype,"placeholder",2),c([b()],O.prototype,"type",2),c([b({type:Boolean})],O.prototype,"required",2),c([b({type:Boolean})],O.prototype,"disabled",2),c([b()],O.prototype,"step",2),c([b()],O.prototype,"min",2),c([b()],O.prototype,"max",2),c([b()],O.prototype,"pattern",2),c([b()],O.prototype,"helper",2),c([b({type:Boolean})],O.prototype,"multiline",2),c([b({type:Number})],O.prototype,"rows",2);customElements.get("ms-textfield")||customElements.define("ms-textfield",O)});var L,ps=w(()=>{"use strict";P();M();j();le();Yt();Ee();L=class extends T{constructor(){super(...arguments);this.objects=[];this._open=!1;this._loading=!1;this._error="";this._name="";this._manufacturer="";this._model="";this._serialNumber="";this._areaId="";this._installationDate="";this._warrantyExpiry="";this._documentationUrl="";this._notes="";this._haDeviceId="";this._parentEntryId="";this._entryId=null}get _lang(){return H(this.hass)}openCreate(){this._entryId=null,this._name="",this._manufacturer="",this._model="",this._serialNumber="",this._areaId="",this._installationDate="",this._warrantyExpiry="",this._documentationUrl="",this._notes="",this._haDeviceId="",this._parentEntryId="",this._error="",this._open=!0}openEdit(e,t){this._entryId=e,this._name=t.name||"",this._manufacturer=t.manufacturer||"",this._model=t.model||"",this._serialNumber=t.serial_number||"",this._areaId=t.area_id||"",this._installationDate=t.installation_date||"",this._warrantyExpiry=t.warranty_expiry||"",this._documentationUrl=t.documentation_url||"",this._notes=t.notes||"",this._haDeviceId=t.ha_device_id||"",this._parentEntryId=t.parent_entry_id||"",this._error="",this._open=!0}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{this._entryId?await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/update",entry_id:this._entryId,name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}):await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/create",name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}),this._open=!1,this.dispatchEvent(new CustomEvent("object-saved"))}catch(e){this._error=C(e,this._lang,n("save_error",this._lang))}finally{this._loading=!1}}}_parentChoices(){return(this.objects||[]).filter(e=>e.entry_id!==this._entryId)}_close(){this._open=!1}render(){if(!this._open)return o``;let e=this._lang,t=this._entryId?n("edit_object",e):n("new_object",e);return o`
|
`,d([b()],O.prototype,"label",2),d([b()],O.prototype,"value",2),d([b()],O.prototype,"placeholder",2),d([b()],O.prototype,"type",2),d([b({type:Boolean})],O.prototype,"required",2),d([b({type:Boolean})],O.prototype,"disabled",2),d([b()],O.prototype,"step",2),d([b()],O.prototype,"min",2),d([b()],O.prototype,"max",2),d([b()],O.prototype,"pattern",2),d([b()],O.prototype,"helper",2),d([b({type:Boolean})],O.prototype,"multiline",2),d([b({type:Number})],O.prototype,"rows",2);customElements.get("ms-textfield")||customElements.define("ms-textfield",O)});var R,_s=w(()=>{"use strict";P();z();L();le();Gt();Se();R=class extends A{constructor(){super(...arguments);this.objects=[];this._open=!1;this._loading=!1;this._error="";this._name="";this._manufacturer="";this._model="";this._serialNumber="";this._areaId="";this._installationDate="";this._warrantyExpiry="";this._documentationUrl="";this._notes="";this._haDeviceId="";this._parentEntryId="";this._entryId=null}get _lang(){return H(this.hass)}openCreate(){this._entryId=null,this._name="",this._manufacturer="",this._model="",this._serialNumber="",this._areaId="",this._installationDate="",this._warrantyExpiry="",this._documentationUrl="",this._notes="",this._haDeviceId="",this._parentEntryId="",this._error="",this._open=!0}openEdit(e,t){this._entryId=e,this._name=t.name||"",this._manufacturer=t.manufacturer||"",this._model=t.model||"",this._serialNumber=t.serial_number||"",this._areaId=t.area_id||"",this._installationDate=t.installation_date||"",this._warrantyExpiry=t.warranty_expiry||"",this._documentationUrl=t.documentation_url||"",this._notes=t.notes||"",this._haDeviceId=t.ha_device_id||"",this._parentEntryId=t.parent_entry_id||"",this._error="",this._open=!0}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{this._entryId?await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/update",entry_id:this._entryId,name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}):await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/create",name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}),this._open=!1,this.dispatchEvent(new CustomEvent("object-saved"))}catch(e){this._error=C(e,this._lang,n("save_error",this._lang))}finally{this._loading=!1}}}_parentChoices(){return(this.objects||[]).filter(e=>e.entry_id!==this._entryId)}_close(){this._open=!1}render(){if(!this._open)return o``;let e=this._lang,t=this._entryId?n("edit_object",e):n("new_object",e);return o`
|
||||||
<ha-dialog open @closed=${this._close}>
|
<ha-dialog open @closed=${this._close}>
|
||||||
<div class="dialog-title">${t}</div>
|
<div class="dialog-title">${t}</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -1868,7 +1892,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
</ha-button>
|
</ha-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
`}};L.styles=A`
|
`}};R.styles=T`
|
||||||
.dialog-title {
|
.dialog-title {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -1918,16 +1942,16 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
color: var(--error-color, #f44336);
|
color: var(--error-color, #f44336);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
`,c([b({attribute:!1})],L.prototype,"hass",2),c([b({attribute:!1})],L.prototype,"objects",2),c([u()],L.prototype,"_open",2),c([u()],L.prototype,"_loading",2),c([u()],L.prototype,"_error",2),c([u()],L.prototype,"_name",2),c([u()],L.prototype,"_manufacturer",2),c([u()],L.prototype,"_model",2),c([u()],L.prototype,"_serialNumber",2),c([u()],L.prototype,"_areaId",2),c([u()],L.prototype,"_installationDate",2),c([u()],L.prototype,"_warrantyExpiry",2),c([u()],L.prototype,"_documentationUrl",2),c([u()],L.prototype,"_notes",2),c([u()],L.prototype,"_haDeviceId",2),c([u()],L.prototype,"_parentEntryId",2),c([u()],L.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",L)});var Gt,hs,us,_s=w(()=>{"use strict";Gt=["sensor","binary_sensor","number","input_number","input_boolean","switch","climate","vacuum","cover","fan","light","water_heater","humidifier","media_player","weather","air_quality","valve","lawn_mower","lock"],hs=["sensor"],us=["temperature","humidity","pressure"]});function zr(){return{entityIds:"",type:"threshold",attribute:"",above:"",below:"",equals:"",notEquals:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}function Ur(r){return{entityIds:(r.entity_ids||(r.entity_id?[r.entity_id]:[])).join(", "),type:r.type||"threshold",attribute:r.attribute||"",above:r.trigger_above?.toString()??"",below:r.trigger_below?.toString()??"",equals:r.trigger_equals?.toString()??"",notEquals:r.trigger_not_equals?.toString()??"",forMinutes:r.trigger_for_minutes?.toString()??"0",targetValue:r.trigger_target_value?.toString()??"",deltaMode:r.trigger_delta_mode||!1,fromState:r.trigger_from_state||"",toState:r.trigger_to_state||"",targetChanges:r.trigger_target_changes?.toString()??"",runtimeHours:r.trigger_runtime_hours?.toString()??"",onStates:(r.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(r).filter(([e])=>!Fr.has(e)&&!e.startsWith("_")))}}function Br(r){let s=r.entityIds.split(",").map(t=>t.trim()).filter(Boolean);if(s.length===0)return null;let e={...r.carry||{},entity_id:s[0],entity_ids:s,type:r.type};if(r.attribute&&(e.attribute=r.attribute),r.type==="threshold"){let t=parseFloat(r.above);isNaN(t)||(e.trigger_above=t);let i=parseFloat(r.below);isNaN(i)||(e.trigger_below=i);let a=parseFloat(r.equals);isNaN(a)||(e.trigger_equals=a);let l=parseFloat(r.notEquals);isNaN(l)||(e.trigger_not_equals=l);let d=parseInt(r.forMinutes,10);isNaN(d)||(e.trigger_for_minutes=d)}else if(r.type==="counter"){let t=parseFloat(r.targetValue);isNaN(t)||(e.trigger_target_value=t),e.trigger_delta_mode=r.deltaMode}else if(r.type==="state_change"){r.fromState&&(e.trigger_from_state=r.fromState),r.toState&&(e.trigger_to_state=r.toState);let t=parseInt(r.targetChanges,10);isNaN(t)||(e.trigger_target_changes=t)}else if(r.type==="runtime"){let t=parseFloat(r.runtimeHours);isNaN(t)||(e.trigger_runtime_hours=t);let i=(r.onStates||"").split(",").map(a=>a.trim()).filter(Boolean);i.length>0&&(e.trigger_on_states=i)}return e}function Vr(r){return Array.from({length:7},(s,e)=>De(e,r,"short"))}function Wr(r){return Array.from({length:12},(s,e)=>Bi(e,r,"short"))}var Hr,Or,Dr,dt,gs,ms,Mr,ie,Fr,g,Qt,fs=w(()=>{"use strict";P();M();j();Ot();at();Fe();_s();le();zt();Yt();Ee();Hr=["cleaning","inspection","replacement","calibration","service","reading","custom"],Or=["low","normal","high"],Dr=["time_based","weekdays","nth_weekday","day_of_month","sensor_based","one_time","manual"],dt=["weekdays","nth_weekday","day_of_month"],gs=["time_based","one_time",...dt],ms=["threshold","counter","state_change","runtime"],Mr=[...ms,"compound"],ie={alpha:"0.3",min:"7",max:"365"};Fr=new Set(["entity_id","entity_ids","type","attribute","trigger_above","trigger_below","trigger_equals","trigger_not_equals","trigger_for_minutes","trigger_target_value","trigger_delta_mode","trigger_from_state","trigger_to_state","trigger_target_changes","trigger_runtime_hours","trigger_on_states"]);g=class g extends T{constructor(){super(...arguments);this.checklistsEnabled=!1;this.scheduleTimeEnabled=!1;this.completionActionsEnabled=!1;this.defaultWarningDays=7;this.parts=[];this._foreignOwners=[];this._open=!1;this._entityPickerFallback=!1;this._pickerProbeStrikes=0;this._loading=!1;this._error="";this._entryId="";this._taskId=null;this._objectChoices=[];this._name="";this._type="custom";this._scheduleType="time_based";this._intervalDays="30";this._intervalUnit="days";this._dueDate="";this._warningDays="7";this._earliestCompletionDays="";this._intervalAnchor="completion";this._weekdays=[];this._nth="1";this._nthWeekday="5";this._domDay="1";this._domLastDay=!1;this._domBusiness=!1;this._calOffset="0";this._seasonMonths=[];this._endsMode="never";this._endsCount="";this._endsUntil="";this._schedulePreview=[];this._schedulePreviewEnded=!1;this._previewSeq=0;this._notes="";this._documentationUrl="";this._customIcon="";this._priority="nor
Line truncated
|
`,d([b({attribute:!1})],R.prototype,"hass",2),d([b({attribute:!1})],R.prototype,"objects",2),d([u()],R.prototype,"_open",2),d([u()],R.prototype,"_loading",2),d([u()],R.prototype,"_error",2),d([u()],R.prototype,"_name",2),d([u()],R.prototype,"_manufacturer",2),d([u()],R.prototype,"_model",2),d([u()],R.prototype,"_serialNumber",2),d([u()],R.prototype,"_areaId",2),d([u()],R.prototype,"_installationDate",2),d([u()],R.prototype,"_warrantyExpiry",2),d([u()],R.prototype,"_documentationUrl",2),d([u()],R.prototype,"_notes",2),d([u()],R.prototype,"_haDeviceId",2),d([u()],R.prototype,"_parentEntryId",2),d([u()],R.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",R)});var Qt,gs,ms,fs=w(()=>{"use strict";Qt=["sensor","binary_sensor","number","input_number","input_boolean","switch","climate","vacuum","cover","fan","light","water_heater","humidifier","media_player","weather","air_quality","valve","lawn_mower","lock"],gs=["sensor"],ms=["temperature","humidity","pressure"]});function Vr(){return{entityIds:"",type:"threshold",attribute:"",above:"",below:"",equals:"",notEquals:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}function Kr(r){return{entityIds:(r.entity_ids||(r.entity_id?[r.entity_id]:[])).join(", "),type:r.type||"threshold",attribute:r.attribute||"",above:r.trigger_above?.toString()??"",below:r.trigger_below?.toString()??"",equals:r.trigger_equals?.toString()??"",notEquals:r.trigger_not_equals?.toString()??"",forMinutes:r.trigger_for_minutes?.toString()??"0",targetValue:r.trigger_target_value?.toString()??"",deltaMode:r.trigger_delta_mode||!1,fromState:r.trigger_from_state||"",toState:r.trigger_to_state||"",targetChanges:r.trigger_target_changes?.toString()??"",runtimeHours:r.trigger_runtime_hours?.toString()??"",onStates:(r.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(r).filter(([e])=>!Wr.has(e)&&!e.startsWith("_")))}}function Yr(r){let s=r.entityIds.split(",").map(t=>t.trim()).filter(Boolean);if(s.length===0)return null;let e={...r.carry||{},entity_id:s[0],entity_ids:s,type:r.type};if(r.attribute&&(e.attribute=r.attribute),r.type==="threshold"){let t=parseFloat(r.above);isNaN(t)||(e.trigger_above=t);let i=parseFloat(r.below);isNaN(i)||(e.trigger_below=i);let a=parseFloat(r.equals);isNaN(a)||(e.trigger_equals=a);let l=parseFloat(r.notEquals);isNaN(l)||(e.trigger_not_equals=l);let c=parseInt(r.forMinutes,10);isNaN(c)||(e.trigger_for_minutes=c)}else if(r.type==="counter"){let t=parseFloat(r.targetValue);isNaN(t)||(e.trigger_target_value=t),e.trigger_delta_mode=r.deltaMode}else if(r.type==="state_change"){r.fromState&&(e.trigger_from_state=r.fromState),r.toState&&(e.trigger_to_state=r.toState);let t=parseInt(r.targetChanges,10);isNaN(t)||(e.trigger_target_changes=t)}else if(r.type==="runtime"){let t=parseFloat(r.runtimeHours);isNaN(t)||(e.trigger_runtime_hours=t);let i=(r.onStates||"").split(",").map(a=>a.trim()).filter(Boolean);i.length>0&&(e.trigger_on_states=i)}return e}function Gr(r){return Array.from({length:7},(s,e)=>ze(e,r,"short"))}function Qr(r){return Array.from({length:12},(s,e)=>Vi(e,r,"short"))}var zr,Fr,Ur,pt,vs,bs,Br,ie,Wr,g,Jt,ys=w(()=>{"use strict";P();z();L();Dt();ot();Be();fs();le();Ft();Gt();Se();zr=["cleaning","inspection","replacement","calibration","service","reading","custom"],Fr=["low","normal","high"],Ur=["time_based","weekdays","nth_weekday","day_of_month","sensor_based","one_time","manual"],pt=["weekdays","nth_weekday","day_of_month"],vs=["time_based","one_time",...pt],bs=["threshold","counter","state_change","runtime"],Br=[...bs,"compound"],ie={alpha:"0.3",min:"7",max:"365"};Wr=new Set(["entity_id","entity_ids","type","attribute","trigger_above","trigger_below","trigger_equals","trigger_not_equals","trigger_for_minutes","trigger_target_value","trigger_delta_mode","trigger_from_state","trigger_to_state","trigger_target_changes","trigger_runtime_hours","trigger_on_states"]);g=class g extends A{constructor(){super(...arguments);this.checklistsEnabled=!1;this.scheduleTimeEnabled=!1;this.completionActionsEnabled=!1;this.defaultWarningDays=7;this.parts=[];this._foreignOwners=[];this._open=!1;this._entityPickerFallback=!1;this._pickerProbeStrikes=0;this._loading=!1;this._error="";this._entryId="";this._taskId=null;this._objectChoices=[];this._name="";this._type="custom";this._scheduleType="time_based";this._intervalDays="30";this._intervalUnit="days";this._dueDate="";this._warningDays="7";this._earliestCompletionDays="";this._intervalAnchor="completion";this._weekdays=[];this._nth="1";this._nthWeekday="5";this._domDay="1";this._domLastDay=!1;this._domBusiness=!1;this._calOffset="0";this._seasonMonths=[];this._endsMode="never";this._endsCount="";this._endsUntil="";this._schedulePreview=[];this._schedulePreviewEnded=!1;this._previewSeq=0;this._notes="";this._documentationUrl="";this._customIcon="";this._priority="nor
Line truncated
|
||||||
`),this._phaseDefs=Object.entries(t.phases||{}).map(([_,f])=>{let{name:x,checklist:v,consumes_parts:y,required_completion_fields:m,...$}=f,D=f.consumes_parts||[],I=D.findIndex(R=>!R.entry_id),S=I>=0?D[I]:void 0;return{id:_,name:f.name||_,checklistText:(f.checklist||[]).join(`
|
`),this._phaseDefs=Object.entries(t.phases||{}).map(([_,f])=>{let{name:x,checklist:v,consumes_parts:y,required_completion_fields:m,...$}=f,M=f.consumes_parts||[],I=M.findIndex(j=>!j.entry_id),S=I>=0?M[I]:void 0;return{id:_,name:f.name||_,checklistText:(f.checklist||[]).join(`
|
||||||
`),partId:S?.part_id||"",partQty:S?.quantity!=null?String(S.quantity):"",reqOverride:f.required_completion_fields!==void 0,reqFields:[...f.required_completion_fields||[]],extraParts:D.filter((R,fe)=>fe!==I).map(R=>({...R})),carry:$}}),this._phaseSeq=[...t.phase_sequence||[]],this._requiredCompletion=[...t.required_completion_fields||[]],this._scheduleTime=t.schedule_time||"",this._scheduleTimeOn=!!t.schedule_time;let l=t.on_complete_action;if(l&&l.service){this._actionService=l.service;let _=l.target?.entity_id;this._actionTargetEntity=Array.isArray(_)?_[0]||"":_||"",this._actionData=l.data&&typeof l.data=="object"?{...l.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let d=t.quick_complete_defaults;this._qcNotes=d?.notes||"",this._qcCost=d?.cost!=null?String(d.cost):"",this._qcDuration=d?.duration!=null?String(d.duration):"",this._qcFeedback=d?.feedback||"";let p=t.adaptive_config||{};if(this._environmentalEntity=p.environmental_entity||"",this._environmentalAttribute=p.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,this._adaptiveEnabled=!!p.enabled,this._adaptiveAlpha=p.ewa_alpha?.toString()??ie.alpha,this._adaptiveMin=p.min_interval_days?.toString()??ie.min,this._adaptiveMax=p.max_interval_days?.toString()??ie.max,this._adaptiveSeasonal=p.seasonal_enabled!==!1,this._adaptivePrediction=p.sensor_prediction_enabled!==!1,this._adaptiveInitial=this._adaptiveSnapshot(),t.trigger_config){let _=t.trigger_config;this._triggerEntityId=_.entity_id||_.entity_ids&&_.entity_ids[0]||"",this._triggerEntityIds=_.entity_ids||(_.entity_id?[_.entity_id]:[]),this._triggerEntityLogic=_.entity_logic||"any",this._triggerAttribute=_.attribute||"",this._triggerType=_.type||"threshold",this._triggerAbove=_.trigger_above?.toString()||"",this._triggerBelow=_.trigger_below?.toString()||"",this._triggerEquals=_.trigger_equals?.toString()||"",this._triggerNotEquals=_.trigger_not_equals?.toString()||"",this._triggerForMinutes=_.trigger_for_minutes?.toString()||"0",this._triggerCombinator=_.trigger_combinator==="all"?"all":"any",this._triggerTargetValue=_.trigger_target_value?.toString()||"",this._triggerDeltaMode=_.trigger_delta_mode||!1,this._triggerBaselineValue=_.trigger_baseline_value?.toString()||"",this._liveBaselineValue=t.trigger_baseline_value??null,this._autoCompleteOnRecovery=_.auto_complete_on_recovery||!1,this._triggerFromState=_.trigger_from_state||"",this._triggerToState=_.trigger_to_state||"",this._triggerTargetChanges=_.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=_.trigger_runtime_hours?.toString()||"",this._triggerRuntimeMaxSession=_.trigger_runtime_max_session_seconds?.toString()||"",this._triggerOnStates=(_.trigger_on_states||[]).join(", "),_.type==="compound"?(this._compoundLogic=_.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(_.conditions||[]).map(Ur)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._requireTagScan=!1,this._allowSkip=!0,this._readingUnit="",this._readings=[],this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._phaseDefs=[],this._phaseSeq=[],this._requiredCompletion=[],this._scheduleTime="",this._scheduleTimeOn=!1,this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._adaptiveEnabled=!1,this._adaptiveAlpha=ie.alpha,this._adaptiveMin=ie.min,this._adaptiveMax=ie.max,this._adaptiveSeasonal=!0,this._adaptivePrediction=!0,this._adaptiveInitial=this._adaptiveSnapshot(),this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute="",this._suggestedAttributes
Line truncated
|
`),partId:S?.part_id||"",partQty:S?.quantity!=null?String(S.quantity):"",reqOverride:f.required_completion_fields!==void 0,reqFields:[...f.required_completion_fields||[]],extraParts:M.filter((j,fe)=>fe!==I).map(j=>({...j})),carry:$}}),this._phaseSeq=[...t.phase_sequence||[]],this._requiredCompletion=[...t.required_completion_fields||[]],this._scheduleTime=t.schedule_time||"",this._scheduleTimeOn=!!t.schedule_time;let l=t.on_complete_action;if(l&&l.service){this._actionService=l.service;let _=l.target?.entity_id;this._actionTargetEntity=Array.isArray(_)?_[0]||"":_||"",this._actionData=l.data&&typeof l.data=="object"?{...l.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let c=t.quick_complete_defaults;this._qcNotes=c?.notes||"",this._qcCost=c?.cost!=null?String(c.cost):"",this._qcDuration=c?.duration!=null?String(c.duration):"",this._qcFeedback=c?.feedback||"";let p=t.adaptive_config||{};if(this._environmentalEntity=p.environmental_entity||"",this._environmentalAttribute=p.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,this._adaptiveEnabled=!!p.enabled,this._adaptiveAlpha=p.ewa_alpha?.toString()??ie.alpha,this._adaptiveMin=p.min_interval_days?.toString()??ie.min,this._adaptiveMax=p.max_interval_days?.toString()??ie.max,this._adaptiveSeasonal=p.seasonal_enabled!==!1,this._adaptivePrediction=p.sensor_prediction_enabled!==!1,this._adaptiveInitial=this._adaptiveSnapshot(),t.trigger_config){let _=t.trigger_config;this._triggerEntityId=_.entity_id||_.entity_ids&&_.entity_ids[0]||"",this._triggerEntityIds=_.entity_ids||(_.entity_id?[_.entity_id]:[]),this._triggerEntityLogic=_.entity_logic||"any",this._triggerAttribute=_.attribute||"",this._triggerType=_.type||"threshold",this._triggerAbove=_.trigger_above?.toString()||"",this._triggerBelow=_.trigger_below?.toString()||"",this._triggerEquals=_.trigger_equals?.toString()||"",this._triggerNotEquals=_.trigger_not_equals?.toString()||"",this._triggerForMinutes=_.trigger_for_minutes?.toString()||"0",this._triggerCombinator=_.trigger_combinator==="all"?"all":"any",this._triggerTargetValue=_.trigger_target_value?.toString()||"",this._triggerDeltaMode=_.trigger_delta_mode||!1,this._triggerBaselineValue=_.trigger_baseline_value?.toString()||"",this._liveBaselineValue=t.trigger_baseline_value??null,this._autoCompleteOnRecovery=_.auto_complete_on_recovery||!1,this._triggerFromState=_.trigger_from_state||"",this._triggerToState=_.trigger_to_state||"",this._triggerTargetChanges=_.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=_.trigger_runtime_hours?.toString()||"",this._triggerRuntimeMaxSession=_.trigger_runtime_max_session_seconds?.toString()||"",this._triggerOnStates=(_.trigger_on_states||[]).join(", "),_.type==="compound"?(this._compoundLogic=_.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(_.conditions||[]).map(Kr)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._requireTagScan=!1,this._allowSkip=!0,this._readingUnit="",this._readings=[],this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._phaseDefs=[],this._phaseSeq=[],this._requiredCompletion=[],this._scheduleTime="",this._scheduleTimeOn=!1,this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._adaptiveEnabled=!1,this._adaptiveAlpha=ie.alpha,this._adaptiveMin=ie.min,this._adaptiveMax=ie.max,this._adaptiveSeasonal=!0,this._adaptivePrediction=!0,this._adaptiveInitial=this._adaptiveSnapshot(),this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute="",this._suggestedAttributes
Line truncated
|
||||||
<details class="ca-section">
|
<details class="ca-section">
|
||||||
<summary>${n("on_complete_action_title",e)}</summary>
|
<summary>${n("on_complete_action_title",e)}</summary>
|
||||||
<p class="field-help">${n("on_complete_action_desc",e)}</p>
|
<p class="field-help">${n("on_complete_action_desc",e)}</p>
|
||||||
<ha-service-picker
|
<ha-service-picker
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.value=${this._actionService}
|
.value=${this._actionService}
|
||||||
@value-changed=${i=>{this._actionService=i.detail.value||"";let a=this._serviceSchema();if(a){let l=new Set(a.map(d=>d.name));this._actionData=Object.fromEntries(Object.entries(this._actionData).filter(([d])=>l.has(d)))}}}
|
@value-changed=${i=>{this._actionService=i.detail.value||"";let a=this._serviceSchema();if(a){let l=new Set(a.map(c=>c.name));this._actionData=Object.fromEntries(Object.entries(this._actionData).filter(([c])=>l.has(c)))}}}
|
||||||
></ha-service-picker>
|
></ha-service-picker>
|
||||||
<ha-form
|
<ha-form
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@@ -2002,7 +2026,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
.checked=${a!==void 0}
|
.checked=${a!==void 0}
|
||||||
@change=${d=>{let p={...this._consumesParts};d.target.checked?p[i]=p[i]||l:delete p[i],this._consumesParts=p}}
|
@change=${c=>{let p={...this._consumesParts};c.target.checked?p[i]=p[i]||l:delete p[i],this._consumesParts=p}}
|
||||||
/>
|
/>
|
||||||
<span>${e.name}${e.unit?` (${e.unit})`:""}</span>
|
<span>${e.name}${e.unit?` (${e.unit})`:""}</span>
|
||||||
</label>
|
</label>
|
||||||
@@ -2013,10 +2037,10 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
max="999"
|
max="999"
|
||||||
step="0.01"
|
step="0.01"
|
||||||
.value=${String(a.quantity)}
|
.value=${String(a.quantity)}
|
||||||
@input=${d=>{let p=parseFloat(d.target.value);this._consumesParts={...this._consumesParts,[i]:{...l,quantity:Number.isFinite(p)&&p>=.01?p:1}}}}
|
@input=${c=>{let p=parseFloat(c.target.value);this._consumesParts={...this._consumesParts,[i]:{...l,quantity:Number.isFinite(p)&&p>=.01?p:1}}}}
|
||||||
/>`:h}
|
/>`:h}
|
||||||
</div>
|
</div>
|
||||||
`}_toggleRequired(e,t){let i=new Set(this._requiredCompletion);t?i.add(e):i.delete(e),this._requiredCompletion=[...i]}_patchReading(e,t){this._readings=this._readings.map(i=>i.id===e?{...i,...t}:i)}_renderReadingsEditor(e){let t=is(this._readings);return o`
|
`}_toggleRequired(e,t){let i=new Set(this._requiredCompletion);t?i.add(e):i.delete(e),this._requiredCompletion=[...i]}_patchReading(e,t){this._readings=this._readings.map(i=>i.id===e?{...i,...t}:i)}_renderReadingsEditor(e){let t=ss(this._readings);return o`
|
||||||
<div class="readings-editor">
|
<div class="readings-editor">
|
||||||
<div class="field-label">${n("readings_section",e)}</div>
|
<div class="field-label">${n("readings_section",e)}</div>
|
||||||
<div class="field-help">${n("readings_hint",e)}</div>
|
<div class="field-help">${n("readings_hint",e)}</div>
|
||||||
@@ -2042,7 +2066,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
`)}
|
`)}
|
||||||
${this._readings.length<20?o`
|
${this._readings.length<20?o`
|
||||||
<ha-button appearance="plain" class="reading-add"
|
<ha-button appearance="plain" class="reading-add"
|
||||||
@click=${()=>this._readings=[...this._readings,{id:Ji(),name:"",unit:this._readings.length?this._readings[this._readings.length-1].unit:this._readingUnit}]}>
|
@click=${()=>this._readings=[...this._readings,{id:Zi(),name:"",unit:this._readings.length?this._readings[this._readings.length-1].unit:this._readingUnit}]}>
|
||||||
<ha-icon icon="mdi:plus"></ha-icon> ${n("reading_add",e)}
|
<ha-icon icon="mdi:plus"></ha-icon> ${n("reading_add",e)}
|
||||||
</ha-button>`:h}
|
</ha-button>`:h}
|
||||||
</div>
|
</div>
|
||||||
@@ -2094,14 +2118,14 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
</label>
|
</label>
|
||||||
${i.reqOverride?o`
|
${i.reqOverride?o`
|
||||||
<div class="required-completion phase-req-fields">
|
<div class="required-completion phase-req-fields">
|
||||||
${Mt.map(a=>o`
|
${zt.map(a=>o`
|
||||||
<label class="req-option">
|
<label class="req-option">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
.checked=${i.reqFields.includes(a)}
|
.checked=${i.reqFields.includes(a)}
|
||||||
@change=${l=>{let d=l.target.checked,p=new Set(i.reqFields);d?p.add(a):p.delete(a),this._patchPhaseDef(i.id,{reqFields:[...p]})}}
|
@change=${l=>{let c=l.target.checked,p=new Set(i.reqFields);c?p.add(a):p.delete(a),this._patchPhaseDef(i.id,{reqFields:[...p]})}}
|
||||||
/>
|
/>
|
||||||
<span>${n(Ve[a],e)}</span>
|
<span>${n(Ke[a],e)}</span>
|
||||||
</label>
|
</label>
|
||||||
`)}
|
`)}
|
||||||
</div>
|
</div>
|
||||||
@@ -2117,7 +2141,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
${this._phaseSeq.map((i,a)=>o`
|
${this._phaseSeq.map((i,a)=>o`
|
||||||
<span class="phase-chip">
|
<span class="phase-chip">
|
||||||
${a+1}. ${t(i)}
|
${a+1}. ${t(i)}
|
||||||
<button class="phase-chip-x" @click=${()=>{this._phaseSeq=this._phaseSeq.filter((l,d)=>d!==a)}}>✕</button>
|
<button class="phase-chip-x" @click=${()=>{this._phaseSeq=this._phaseSeq.filter((l,c)=>c!==a)}}>✕</button>
|
||||||
</span>
|
</span>
|
||||||
`)}
|
`)}
|
||||||
<select
|
<select
|
||||||
@@ -2130,9 +2154,9 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
`:h}
|
`:h}
|
||||||
`}async _save(){if(!this._loading&&this._name.trim()){if(this._adaptiveSnapshot()!==this._adaptiveInitial){let e=parseInt(this._adaptiveMin,10),t=parseInt(this._adaptiveMax,10);if(!isNaN(e)&&!isNaN(t)&&e>t){this._error=`${n("adaptive_min_interval",this._lang)} > ${n("adaptive_max_interval",this._lang)}`;return}}if(this._triggerType==="threshold"&&this._thresholdLimitsOverlap()){this._error=n("trigger_hint_overlap",this._lang);return}this._loading=!0,this._error="";try{let e={type:this._taskId?"maintenance_supporter/task/update":"maintenance_supporter/task/create",entry_id:this._entryId,name:this._name,task_type:this._type,schedule_type:this._scheduleType,warning_days:Number.isNaN(parseInt(this._warningDays,10))?this.defaultWarningDays:Math.max(0,parseInt(this._warningDays,10))},t=this._earliestCompletionDays.trim();e.earliest_completion_days=t===""?null:Math.max(0,parseInt(t,10)||0),this._taskId&&(e.task_id=this._taskId),this._scheduleType==="one_time"?(e.due_date=this._dueDate||null,e.interval_days=null):dt.includes(this._scheduleType)?(e.schedule={...this._buildSchedule(),...this._recurrenceExtras()},e.interval_days=null,this._taskId&&(e.due_date=null)):(this._taskId&&(e.due_date=null),this._scheduleType!=="manual"&&this._intervalDays?(e.interval_days=parseInt(this._intervalDays,10),e.interval_unit=this._intervalUnit,e.interval_anchor=this._intervalAnchor,this._scheduleType==="time_based"&&(e.schedule={kind:"interval",...this._recurrenceExtras()})):this._taskId&&(e.interval_days=null,e.interval_anchor="completion")),e.notes=this._notes||null,e.documentation_url=this._documentationUrl||null,e.custom_icon=this._customIcon||null,e.priority=this._priority,e.labels=this._labels.split(",").map(d=>d.trim()).filter(Boolean),e.enabled=this._enabled,e.last_performed=this._lastPerformed||null,e.nfc_tag_id=this._nfcTagId||null,e.require_tag_scan=this._requireTagScan,e.allow_skip=this._allowSkip,e.reading_unit=this._readingUnit.trim()||null,e.readings=ss(this._readings);{let d={};for(let _ of this._phaseDefs){if(!_.name.trim())continue;let f={..._.carry,name:_.name.trim()},x=_.checklistText.split(`
|
`}async _save(){if(!this._loading&&this._name.trim()){if(this._adaptiveSnapshot()!==this._adaptiveInitial){let e=parseInt(this._adaptiveMin,10),t=parseInt(this._adaptiveMax,10);if(!isNaN(e)&&!isNaN(t)&&e>t){this._error=`${n("adaptive_min_interval",this._lang)} > ${n("adaptive_max_interval",this._lang)}`;return}}if(this._triggerType==="threshold"&&this._thresholdLimitsOverlap()){this._error=n("trigger_hint_overlap",this._lang);return}this._loading=!0,this._error="";try{let e={type:this._taskId?"maintenance_supporter/task/update":"maintenance_supporter/task/create",entry_id:this._entryId,name:this._name,task_type:this._type,schedule_type:this._scheduleType,warning_days:Number.isNaN(parseInt(this._warningDays,10))?this.defaultWarningDays:Math.max(0,parseInt(this._warningDays,10))},t=this._earliestCompletionDays.trim();e.earliest_completion_days=t===""?null:Math.max(0,parseInt(t,10)||0),this._taskId&&(e.task_id=this._taskId),this._scheduleType==="one_time"?(e.due_date=this._dueDate||null,e.interval_days=null):pt.includes(this._scheduleType)?(e.schedule={...this._buildSchedule(),...this._recurrenceExtras()},e.interval_days=null,this._taskId&&(e.due_date=null)):(this._taskId&&(e.due_date=null),this._scheduleType!=="manual"&&this._intervalDays?(e.interval_days=parseInt(this._intervalDays,10),e.interval_unit=this._intervalUnit,e.interval_anchor=this._intervalAnchor,this._scheduleType==="time_based"&&(e.schedule={kind:"interval",...this._recurrenceExtras()})):this._taskId&&(e.interval_days=null,e.interval_anchor="completion")),e.notes=this._notes||null,e.documentation_url=this._documentationUrl||null,e.custom_icon=this._customIcon||null,e.priority=this._priority,e.labels=this._labels.split(",").map(c=>c.trim()).filter(Boolean),e.enabled=this._enabled,e.last_performed=this._lastPerformed||null,e.nfc_tag_id=this._nfcTagId||null,e.require_tag_scan=this._requireTagScan,e.allow_skip=this._allowSkip,e.notify_enabled=this._notifyEnabled,e.reading_unit=this._readingUnit.trim()||null,e.readings=rs(this._readings);{let c={};for(let _ of this._phaseDefs){if(!_.name.trim())continue;let f={..._.carry,name:_.name.trim()},x=_.checklistText.split(`
|
||||||
`).map(y=>y.trim()).filter(Boolean);x.length&&(f.checklist=x);let v=[];if(_.partId){let y=parseFloat(_.partQty);v.push({part_id:_.partId,quantity:Number.isFinite(y)&&y>0?y:1})}for(let y of _.extraParts)v.push(y.entry_id?{part_id:y.part_id,quantity:y.quantity,entry_id:y.entry_id}:{part_id:y.part_id,quantity:y.quantity});v.length&&(f.consumes_parts=v),_.reqOverride&&(f.required_completion_fields=[..._.reqFields]),d[_.id]=f}let p=this._phaseSeq.filter(_=>_ in d);e.phases=Object.keys(d).length&&p.length?d:null,e.phase_sequence=e.phases?p:null}if((this.parts.length||this._foreignOwners.length)&&(e.consumes_parts=Object.values(this._consumesParts).map(d=>d.entry_id?{part_id:d.part_id,quantity:d.quantity,entry_id:d.entry_id}:{part_id:d.part_id,quantity:d.quantity})),e.responsible_user_id=this._responsibleUserId,e.assignee_pool=this._assigneePool,e.required_completion_fields=this._requiredCompletion,e.rotation_strategy=this._assigneePool.length>=2&&this._rotationStrategy?this._rotationStrategy:null,this._scheduleType==="sensor_based"&&this._triggerType==="compound"){let d=this._compoundConditions.map(Br).filter(p=>p!==null);if(d.length>0){let p={type:"compound",compound_logic:this._compoundLogic,conditions:d};this._autoCompleteOnRecovery&&(p.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(p.trigger_combinator="all"),e.trigger_config=p}else this._taskId&&(e.trigger_config=null)}else if(this._scheduleType==="sensor_based"&&this._triggerEntityId){let d=this._triggerEntityIds.length>0?this._triggerEntityIds:[this._triggerEntityId],p={entity_id:d[0],entity_ids:d,type:this._triggerType};if(this._triggerAttribute&&(p.attribute=this._triggerAttribute),this._autoCompleteOnRecovery&&(p.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(p.trigger_combinator="all"),d.length>1&&(p.entity_logic=this._triggerEntityLogic),this._triggerType==="threshold"){if(this._triggerAbove){let _=parseFloat(this._triggerAbove);isNaN(_)||(p.trigger_above=_)}if(this._triggerBelow){let _=parseFloat(this._triggerBelow);isNaN(_)||(p.trigger_below=_)}if(this._triggerEquals){let _=parseFloat(this._triggerEquals);isNaN(_)||(p.trigger_equals=_)}if(this._triggerNotEquals){let _=parseFloat(this._triggerNotEquals);isNaN(_)||(p.trigger_not_equals=_)}if(this._triggerForMinutes){let _=parseInt(this._triggerForMinutes,10);isNaN(_)||(p.trigger_for_minutes=_)}}else if(this._triggerType==="counter"){if(this._triggerTargetValue){let _=parseFloat(this._triggerTargetValue);isNaN(_)||(p.trigger_target_value=_)}if(p.trigger_delta_mode=this._triggerDeltaMode,this._triggerDeltaMode&&this._triggerBaselineValue){let _=parseFloat(this._triggerBaselineValue);!isNaN(_)&&_>=0&&(p.trigger_baseline_value=_)}}else if(this._triggerType==="state_change"){if(this._triggerFromState&&(p.trigger_from_state=this._triggerFromState),this._triggerToState&&(p.trigger_to_state=this._triggerToState),this._triggerTargetChanges){let _=parseInt(this._triggerTargetChanges,10);isNaN(_)||(p.trigger_target_changes=_)}if(this._triggerForMinutes){let _=parseInt(this._triggerForMinutes,10);isNaN(_)||(p.trigger_for_minutes=_)}}else if(this._triggerType==="runtime"){if(this._triggerRuntimeHours){let f=parseFloat(this._triggerRuntimeHours);isNaN(f)||(p.trigger_runtime_hours=f)}if(this._triggerRuntimeMaxSession){let f=parseInt(this._triggerRuntimeMaxSession,10);!isNaN(f)&&f>0&&(p.trigger_runtime_max_session_seconds=f)}let _=this._triggerOnStates.split(",").map(f=>f.trim()).filter(Boolean);_.length>0&&(p.trigger_on_states=_)}e.trigger_config=p}else this._taskId&&(e.trigger_config=null);if(this.scheduleTimeEnabled&&gs.includes(this._scheduleType)){let d=this._scheduleTimeOn?this._scheduleTime.trim():"";e.schedule_time=/^([01]\d|2[0-3]):[0-5]\d$/.test(d)?d:null}if(this.checklistsEnabled){let d=this._checklistText.split(`
|
`).map(y=>y.trim()).filter(Boolean);x.length&&(f.checklist=x);let v=[];if(_.partId){let y=parseFloat(_.partQty);v.push({part_id:_.partId,quantity:Number.isFinite(y)&&y>0?y:1})}for(let y of _.extraParts)v.push(y.entry_id?{part_id:y.part_id,quantity:y.quantity,entry_id:y.entry_id}:{part_id:y.part_id,quantity:y.quantity});v.length&&(f.consumes_parts=v),_.reqOverride&&(f.required_completion_fields=[..._.reqFields]),c[_.id]=f}let p=this._phaseSeq.filter(_=>_ in c);e.phases=Object.keys(c).length&&p.length?c:null,e.phase_sequence=e.phases?p:null}if((this.parts.length||this._foreignOwners.length)&&(e.consumes_parts=Object.values(this._consumesParts).map(c=>c.entry_id?{part_id:c.part_id,quantity:c.quantity,entry_id:c.entry_id}:{part_id:c.part_id,quantity:c.quantity})),e.responsible_user_id=this._responsibleUserId,e.assignee_pool=this._assigneePool,e.required_completion_fields=this._requiredCompletion,e.rotation_strategy=this._assigneePool.length>=2&&this._rotationStrategy?this._rotationStrategy:null,this._scheduleType==="sensor_based"&&this._triggerType==="compound"){let c=this._compoundConditions.map(Yr).filter(p=>p!==null);if(c.length>0){let p={type:"compound",compound_logic:this._compoundLogic,conditions:c};this._autoCompleteOnRecovery&&(p.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(p.trigger_combinator="all"),e.trigger_config=p}else this._taskId&&(e.trigger_config=null)}else if(this._scheduleType==="sensor_based"&&this._triggerEntityId){let c=this._triggerEntityIds.length>0?this._triggerEntityIds:[this._triggerEntityId],p={entity_id:c[0],entity_ids:c,type:this._triggerType};if(this._triggerAttribute&&(p.attribute=this._triggerAttribute),this._autoCompleteOnRecovery&&(p.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(p.trigger_combinator="all"),c.length>1&&(p.entity_logic=this._triggerEntityLogic),this._triggerType==="threshold"){if(this._triggerAbove){let _=parseFloat(this._triggerAbove);isNaN(_)||(p.trigger_above=_)}if(this._triggerBelow){let _=parseFloat(this._triggerBelow);isNaN(_)||(p.trigger_below=_)}if(this._triggerEquals){let _=parseFloat(this._triggerEquals);isNaN(_)||(p.trigger_equals=_)}if(this._triggerNotEquals){let _=parseFloat(this._triggerNotEquals);isNaN(_)||(p.trigger_not_equals=_)}if(this._triggerForMinutes){let _=parseInt(this._triggerForMinutes,10);isNaN(_)||(p.trigger_for_minutes=_)}}else if(this._triggerType==="counter"){if(this._triggerTargetValue){let _=parseFloat(this._triggerTargetValue);isNaN(_)||(p.trigger_target_value=_)}if(p.trigger_delta_mode=this._triggerDeltaMode,this._triggerDeltaMode&&this._triggerBaselineValue){let _=parseFloat(this._triggerBaselineValue);!isNaN(_)&&_>=0&&(p.trigger_baseline_value=_)}}else if(this._triggerType==="state_change"){if(this._triggerFromState&&(p.trigger_from_state=this._triggerFromState),this._triggerToState&&(p.trigger_to_state=this._triggerToState),this._triggerTargetChanges){let _=parseInt(this._triggerTargetChanges,10);isNaN(_)||(p.trigger_target_changes=_)}if(this._triggerForMinutes){let _=parseInt(this._triggerForMinutes,10);isNaN(_)||(p.trigger_for_minutes=_)}}else if(this._triggerType==="runtime"){if(this._triggerRuntimeHours){let f=parseFloat(this._triggerRuntimeHours);isNaN(f)||(p.trigger_runtime_hours=f)}if(this._triggerRuntimeMaxSession){let f=parseInt(this._triggerRuntimeMaxSession,10);!isNaN(f)&&f>0&&(p.trigger_runtime_max_session_seconds=f)}let _=this._triggerOnStates.split(",").map(f=>f.trim()).filter(Boolean);_.length>0&&(p.trigger_on_states=_)}e.trigger_config=p}else this._taskId&&(e.trigger_config=null);if(this.scheduleTimeEnabled&&vs.includes(this._scheduleType)){let c=this._scheduleTimeOn?this._scheduleTime.trim():"";e.schedule_time=/^([01]\d|2[0-3]):[0-5]\d$/.test(c)?c:null}if(this.checklistsEnabled){let c=this._checklistText.split(`
|
||||||
`).map(p=>p.trim()).filter(Boolean).slice(0,100);e.checklist=d.length?d:null}if(this.completionActionsEnabled){let d=this._actionService.trim();if(d&&/^[a-z][a-z0-9_]*\.[a-z0-9_]+$/.test(d)){let x={service:d},v=this._actionTargetEntity.trim();v&&(x.target={entity_id:v});let y=this._buildActionData();Object.keys(y).length>0&&(x.data=y),e.on_complete_action=x}else e.on_complete_action=null;let p={};this._qcNotes.trim()&&(p.notes=this._qcNotes.trim());let _=parseFloat(this._qcCost);!isNaN(_)&&_>=0&&(p.cost=_);let f=parseInt(this._qcDuration,10);!isNaN(f)&&f>=0&&(p.duration=f),this._qcFeedback&&(p.feedback=this._qcFeedback),e.quick_complete_defaults=Object.keys(p).length?p:null}let i=await this.hass.connection.sendMessagePromise(e),a=this._taskId||i?.task_id,l=this._environmentalEntity!==this._environmentalInitial||this._environmentalAttribute!==this._environmentalAttributeInitial;if(a&&this._scheduleType==="sensor_based"&&l)try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_environmental_entity",entry_id:this._entryId,task_id:a,environmental_entity:this._environmentalEntity||null,environmental_attribute:this._environmentalAttribute||null}),this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute}catch{}if(a&&this._adaptiveSnapshot()!==this._adaptiveInitial){let d=parseFloat(this._adaptiveAlpha),p=parseInt(this._adaptiveMin,10),_=parseInt(this._adaptiveMax,10);try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_adaptive",entry_id:this._entryId,task_id:a,enabled:this._adaptiveEnabled,...d>=.1&&d<=.9?{ewa_alpha:d}:{},...!isNaN(p)&&p>=1?{min_interval_days:p}:{},...!isNaN(_)&&_>=1?{max_interval_days:_}:{},seasonal_enabled:this._adaptiveSeasonal,sensor_prediction_enabled:this._adaptivePrediction}),this._adaptiveInitial=this._adaptiveSnapshot()}catch{}}this._open=!1,this.dispatchEvent(new CustomEvent("task-saved"))}catch(e){this._error=C(e,this._lang,n("save_error",this._lang))}finally{this._loading=!1}}}_close(){this._open=!1,this._pickerProbeTimer!==void 0&&(clearTimeout(this._pickerProbeTimer),this._pickerProbeTimer=void 0),this._pickerProbeStrikes=0}_renderTriggerFields(){if(this._scheduleType!=="sensor_based")return h;let e=this._lang,t=this._triggerType==="compound";return o`
|
`).map(p=>p.trim()).filter(Boolean).slice(0,100);e.checklist=c.length?c:null}if(this.completionActionsEnabled){let c=this._actionService.trim();if(c&&/^[a-z][a-z0-9_]*\.[a-z0-9_]+$/.test(c)){let x={service:c},v=this._actionTargetEntity.trim();v&&(x.target={entity_id:v});let y=this._buildActionData();Object.keys(y).length>0&&(x.data=y),e.on_complete_action=x}else e.on_complete_action=null;let p={};this._qcNotes.trim()&&(p.notes=this._qcNotes.trim());let _=parseFloat(this._qcCost);!isNaN(_)&&_>=0&&(p.cost=_);let f=parseInt(this._qcDuration,10);!isNaN(f)&&f>=0&&(p.duration=f),this._qcFeedback&&(p.feedback=this._qcFeedback),e.quick_complete_defaults=Object.keys(p).length?p:null}let i=await this.hass.connection.sendMessagePromise(e),a=this._taskId||i?.task_id,l=this._environmentalEntity!==this._environmentalInitial||this._environmentalAttribute!==this._environmentalAttributeInitial;if(a&&this._scheduleType==="sensor_based"&&l)try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_environmental_entity",entry_id:this._entryId,task_id:a,environmental_entity:this._environmentalEntity||null,environmental_attribute:this._environmentalAttribute||null}),this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute}catch{}if(a&&this._adaptiveSnapshot()!==this._adaptiveInitial){let c=parseFloat(this._adaptiveAlpha),p=parseInt(this._adaptiveMin,10),_=parseInt(this._adaptiveMax,10);try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_adaptive",entry_id:this._entryId,task_id:a,enabled:this._adaptiveEnabled,...c>=.1&&c<=.9?{ewa_alpha:c}:{},...!isNaN(p)&&p>=1?{min_interval_days:p}:{},...!isNaN(_)&&_>=1?{max_interval_days:_}:{},seasonal_enabled:this._adaptiveSeasonal,sensor_prediction_enabled:this._adaptivePrediction}),this._adaptiveInitial=this._adaptiveSnapshot()}catch{}}this._open=!1,this.dispatchEvent(new CustomEvent("task-saved"))}catch(e){this._error=C(e,this._lang,n("save_error",this._lang))}finally{this._loading=!1}}}_close(){this._open=!1,this._pickerProbeTimer!==void 0&&(clearTimeout(this._pickerProbeTimer),this._pickerProbeTimer=void 0),this._pickerProbeStrikes=0}_renderTriggerFields(){if(this._scheduleType!=="sensor_based")return h;let e=this._lang,t=this._triggerType==="compound";return o`
|
||||||
<h3>${n("trigger_configuration",e)}</h3>
|
<h3>${n("trigger_configuration",e)}</h3>
|
||||||
<div class="select-row">
|
<div class="select-row">
|
||||||
<label>${n("trigger_type",e)}</label>
|
<label>${n("trigger_type",e)}</label>
|
||||||
@@ -2140,7 +2164,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._triggerType}
|
.value=${this._triggerType}
|
||||||
@change=${i=>this._triggerType=i.target.value}
|
@change=${i=>this._triggerType=i.target.value}
|
||||||
>
|
>
|
||||||
${Mr.map(i=>o`<option value=${i} ?selected=${i===this._triggerType}>${n(i,e)}</option>`)}
|
${Br.map(i=>o`<option value=${i} ?selected=${i===this._triggerType}>${n(i,e)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
${t?this._renderCompoundEditor():o`
|
${t?this._renderCompoundEditor():o`
|
||||||
@@ -2148,13 +2172,13 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<ms-textfield
|
<ms-textfield
|
||||||
label="${n("entity_id",e)} (${n("comma_separated",e)})"
|
label="${n("entity_id",e)} (${n("comma_separated",e)})"
|
||||||
.value=${this._triggerEntityIds.length>0?this._triggerEntityIds.join(", "):this._triggerEntityId}
|
.value=${this._triggerEntityIds.length>0?this._triggerEntityIds.join(", "):this._triggerEntityId}
|
||||||
@input=${i=>{let l=i.target.value.split(",").map(d=>d.trim()).filter(Boolean);this._triggerEntityId=l[0]||"",this._triggerEntityIds=l,l[0]&&this._fetchEntityAttributes(l[0])}}
|
@input=${i=>{let l=i.target.value.split(",").map(c=>c.trim()).filter(Boolean);this._triggerEntityId=l[0]||"",this._triggerEntityIds=l,l[0]&&this._fetchEntityAttributes(l[0])}}
|
||||||
></ms-textfield>
|
></ms-textfield>
|
||||||
`:o`
|
`:o`
|
||||||
<ha-form
|
<ha-form
|
||||||
class="entity-picker-form"
|
class="entity-picker-form"
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.schema=${[{name:"trigger_entities",selector:{entity:{multiple:!0,domain:Gt}}}]}
|
.schema=${[{name:"trigger_entities",selector:{entity:{multiple:!0,domain:Qt}}}]}
|
||||||
.data=${{trigger_entities:this._triggerEntityIds.length>0?this._triggerEntityIds:this._triggerEntityId?[this._triggerEntityId]:[]}}
|
.data=${{trigger_entities:this._triggerEntityIds.length>0?this._triggerEntityIds:this._triggerEntityId?[this._triggerEntityId]:[]}}
|
||||||
.computeLabel=${()=>n("entity_id",e)}
|
.computeLabel=${()=>n("entity_id",e)}
|
||||||
@value-changed=${i=>{let a=(i.detail.value.trigger_entities||[]).filter(Boolean);this._triggerEntityId=a[0]||"",this._triggerEntityIds=a,a[0]?this._fetchEntityAttributes(a[0]):this._fetchEntityAttributes("")}}
|
@value-changed=${i=>{let a=(i.detail.value.trigger_entities||[]).filter(Boolean);this._triggerEntityId=a[0]||"",this._triggerEntityIds=a,a[0]?this._fetchEntityAttributes(a[0]):this._fetchEntityAttributes("")}}
|
||||||
@@ -2202,7 +2226,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
`:h}
|
`:h}
|
||||||
`}_patchCondition(e,t){this._compoundConditions=this._compoundConditions.map((i,a)=>a===e?{...i,...t}:i)}_addCondition(){this._compoundConditions=[...this._compoundConditions,zr()]}_removeCondition(e){this._compoundConditions=this._compoundConditions.filter((t,i)=>i!==e)}_renderCompoundEditor(){let e=this._lang;return o`
|
`}_patchCondition(e,t){this._compoundConditions=this._compoundConditions.map((i,a)=>a===e?{...i,...t}:i)}_addCondition(){this._compoundConditions=[...this._compoundConditions,Vr()]}_removeCondition(e){this._compoundConditions=this._compoundConditions.filter((t,i)=>i!==e)}_renderCompoundEditor(){let e=this._lang;return o`
|
||||||
<div class="select-row">
|
<div class="select-row">
|
||||||
<label>${n("compound_logic",e)}</label>
|
<label>${n("compound_logic",e)}</label>
|
||||||
<select
|
<select
|
||||||
@@ -2239,10 +2263,10 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<ha-form
|
<ha-form
|
||||||
class="entity-picker-form"
|
class="entity-picker-form"
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.schema=${[{name:"condition_entities",selector:{entity:{multiple:!0,domain:Gt}}}]}
|
.schema=${[{name:"condition_entities",selector:{entity:{multiple:!0,domain:Qt}}}]}
|
||||||
.data=${{condition_entities:e.entityIds.split(",").map(l=>l.trim()).filter(Boolean)}}
|
.data=${{condition_entities:e.entityIds.split(",").map(l=>l.trim()).filter(Boolean)}}
|
||||||
.computeLabel=${()=>n("entity_id",i)}
|
.computeLabel=${()=>n("entity_id",i)}
|
||||||
@value-changed=${l=>{let d=(l.detail.value.condition_entities||[]).filter(Boolean);this._patchCondition(t,{entityIds:d.join(", ")})}}
|
@value-changed=${l=>{let c=(l.detail.value.condition_entities||[]).filter(Boolean);this._patchCondition(t,{entityIds:c.join(", ")})}}
|
||||||
></ha-form>`}
|
></ha-form>`}
|
||||||
${this._renderConditionAttribute(e,t)}
|
${this._renderConditionAttribute(e,t)}
|
||||||
<div class="select-row">
|
<div class="select-row">
|
||||||
@@ -2251,7 +2275,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${e.type}
|
.value=${e.type}
|
||||||
@change=${l=>this._patchCondition(t,{type:l.target.value})}
|
@change=${l=>this._patchCondition(t,{type:l.target.value})}
|
||||||
>
|
>
|
||||||
${ms.map(l=>o`<option value=${l} ?selected=${l===e.type}>${n(l,i)}</option>`)}
|
${bs.map(l=>o`<option value=${l} ?selected=${l===e.type}>${n(l,i)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
${this._renderConditionTypeFields(e,t)}
|
${this._renderConditionTypeFields(e,t)}
|
||||||
@@ -2395,12 +2419,12 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
>
|
>
|
||||||
${["days","weeks","months","years"].map(t=>o`<option value=${t} ?selected=${t===this._intervalUnit}>${n("unit_"+t,e)}</option>`)}
|
${["days","weeks","months","years"].map(t=>o`<option value=${t} ?selected=${t===this._intervalUnit}>${n("unit_"+t,e)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>`}_toggleWeekday(e){this._weekdays=this._weekdays.includes(e)?this._weekdays.filter(t=>t!==e):[...this._weekdays,e]}_previewScheduleDict(){if(this._scheduleType==="one_time")return this._dueDate?{kind:"one_time",due_date:this._dueDate}:null;if(dt.includes(this._scheduleType))return{...this._buildSchedule(),...this._recurrenceExtras()};let e=parseInt(this._intervalDays,10);return this._scheduleType==="manual"||!e||e<=0?null:{kind:"interval",every:e,unit:this._intervalUnit,anchor:this._intervalAnchor,...this._recurrenceExtras()}}updated(e){super.updated?.(e),this._scheduleEntityPickerProbe();for(let t of e.keys())if(g._PREVIEW_RELEVANT.has(String(t))){this._schedulePreviewRefresh();return}}_scheduleEntityPickerProbe(){this._entityPickerFallback||this._pickerProbeTimer!==void 0||!this._open||this._scheduleType!=="sensor_based"||(this._pickerProbeTimer=setTimeout(()=>this._probeEntityPickers(),1500))}_probeEntityPickers(){if(this._pickerProbeTimer=void 0,this._entityPickerFallback||!this._open)return;let e=this.shadowRoot?.querySelector("ha-form.entity-picker-form"),t=(this.shadowRoot?.querySelector(".content")?.offsetHeight??0)>0;if(!e||!t){this._pickerProbeStrikes=0;return}let i=(p,_,f=0)=>{if(!(!p||f>10)){(p.tagName?.toLowerCase()??"")==="ha-entity-picker"&&_.push(p);for(let x of[p.shadowRoot,p])if(x)for(let v of Array.from(x.children??[]))i(v,_,f+1)}},a=[...this.shadowRoot?.querySelectorAll("ha-form.entity-picker-form")??[]],l=[];for(let p of a)i(p,l);let d=l.length===0||l.some(p=>p.offsetHeight===0);if(e.offsetHeight===0||d){if(this._pickerProbeStrikes+=1,this._pickerProbeStrikes>=2){this._entityPickerFallback=!0;return}this._pickerProbeTimer=setTimeout(()=>this._probeEntityPickers(),700)}else this._pickerProbeStrikes=0}_schedulePreviewRefresh(){this._previewTimer&&clearTimeout(this._previewTimer),this._previewTimer=setTimeout(()=>{this._fetchSchedulePreview()},300)}async _fetchSchedulePreview(){let e=this._open?this._previewScheduleDict():null;if(!e){this._schedulePreview=[],this._schedulePreviewEnded=!1;return}let t=++this._previewSeq;try{let i=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/schedule/preview",schedule:e,...this._lastPerformed?{last_performed:this._lastPerformed}:{}});if(t!==this._previewSeq)return;this._schedulePreview=i.occurrences||[],this._schedulePreviewEnded=!!i.series_ended}catch{}}_renderSchedulePreview(){if(this._schedulePreview.length===0)return h;let e=this._lang,t=this.scheduleTimeEnabled&&this._scheduleTimeOn&&this._scheduleTime?` ${this._scheduleTime}`:"",i=this._schedulePreview.map((l,d)=>{let p=new Date(`${l}T12:00:00`).getDay();return`${De(p===0?6:p-1,e,"short")} ${K(l,e)}${d===0?t:""}`}).join(" \xB7 "),a=this._scheduleType==="time_based"&&this._intervalAnchor==="completion"?o`<div class="field-help">${n("schedule_preview_ontime",e)}</div>`:h;return o`
|
</div>`}_toggleWeekday(e){this._weekdays=this._weekdays.includes(e)?this._weekdays.filter(t=>t!==e):[...this._weekdays,e]}_previewScheduleDict(){if(this._scheduleType==="one_time")return this._dueDate?{kind:"one_time",due_date:this._dueDate}:null;if(pt.includes(this._scheduleType))return{...this._buildSchedule(),...this._recurrenceExtras()};let e=parseInt(this._intervalDays,10);return this._scheduleType==="manual"||!e||e<=0?null:{kind:"interval",every:e,unit:this._intervalUnit,anchor:this._intervalAnchor,...this._recurrenceExtras()}}updated(e){super.updated?.(e),this._scheduleEntityPickerProbe();for(let t of e.keys())if(g._PREVIEW_RELEVANT.has(String(t))){this._schedulePreviewRefresh();return}}_scheduleEntityPickerProbe(){this._entityPickerFallback||this._pickerProbeTimer!==void 0||!this._open||this._scheduleType!=="sensor_based"||(this._pickerProbeTimer=setTimeout(()=>this._probeEntityPickers(),1500))}_probeEntityPickers(){if(this._pickerProbeTimer=void 0,this._entityPickerFallback||!this._open)return;let e=this.shadowRoot?.querySelector("ha-form.entity-picker-form"),t=(this.shadowRoot?.querySelector(".content")?.offsetHeight??0)>0;if(!e||!t){this._pickerProbeStrikes=0;return}let i=(p,_,f=0)=>{if(!(!p||f>10)){(p.tagName?.toLowerCase()??"")==="ha-entity-picker"&&_.push(p);for(let x of[p.shadowRoot,p])if(x)for(let v of Array.from(x.children??[]))i(v,_,f+1)}},a=[...this.shadowRoot?.querySelectorAll("ha-form.entity-picker-form")??[]],l=[];for(let p of a)i(p,l);let c=l.length===0||l.some(p=>p.offsetHeight===0);if(e.offsetHeight===0||c){if(this._pickerProbeStrikes+=1,this._pickerProbeStrikes>=2){this._entityPickerFallback=!0;return}this._pickerProbeTimer=setTimeout(()=>this._probeEntityPickers(),700)}else this._pickerProbeStrikes=0}_schedulePreviewRefresh(){this._previewTimer&&clearTimeout(this._previewTimer),this._previewTimer=setTimeout(()=>{this._fetchSchedulePreview()},300)}async _fetchSchedulePreview(){let e=this._open?this._previewScheduleDict():null;if(!e){this._schedulePreview=[],this._schedulePreviewEnded=!1;return}let t=++this._previewSeq;try{let i=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/schedule/preview",schedule:e,...this._lastPerformed?{last_performed:this._lastPerformed}:{}});if(t!==this._previewSeq)return;this._schedulePreview=i.occurrences||[],this._schedulePreviewEnded=!!i.series_ended}catch{}}_renderSchedulePreview(){if(this._schedulePreview.length===0)return h;let e=this._lang,t=this.scheduleTimeEnabled&&this._scheduleTimeOn&&this._scheduleTime?` ${this._scheduleTime}`:"",i=this._schedulePreview.map((l,c)=>{let p=new Date(`${l}T12:00:00`).getDay();return`${ze(p===0?6:p-1,e,"short")} ${F(l,e)}${c===0?t:""}`}).join(" \xB7 "),a=this._scheduleType==="time_based"&&this._intervalAnchor==="completion"?o`<div class="field-help">${n("schedule_preview_ontime",e)}</div>`:h;return o`
|
||||||
<div class="trigger-live-hint schedule-preview">
|
<div class="trigger-live-hint schedule-preview">
|
||||||
${n("schedule_preview_title",e)}: ${i}${this._schedulePreviewEnded?o` <span class="field-help">${n("schedule_preview_ends",e)}</span>`:h}
|
${n("schedule_preview_title",e)}: ${i}${this._schedulePreviewEnded?o` <span class="field-help">${n("schedule_preview_ends",e)}</span>`:h}
|
||||||
${a}
|
${a}
|
||||||
</div>
|
</div>
|
||||||
`}_buildSchedule(){let e=i=>{let a=parseInt(this._calOffset,10)||0;return a&&(i.offset=Math.max(-15,Math.min(a,15))),i};if(this._scheduleType==="weekdays")return e({kind:"weekdays",weekdays:[...this._weekdays].sort((i,a)=>i-a)});if(this._scheduleType==="nth_weekday")return e({kind:"nth_weekday",nth:parseInt(this._nth,10),weekday:parseInt(this._nthWeekday,10)});let t={kind:"day_of_month",day:this._domLastDay?-1:parseInt(this._domDay,10)||1};return this._domBusiness&&(t.business=!0),e(t)}_recurrenceExtras(){let e={};if(this._seasonMonths.length&&(e.season_months=[...this._seasonMonths].sort((t,i)=>t-i)),this._endsMode==="count"){let t=parseInt(this._endsCount,10);t>=1&&(e.ends={count:t})}else this._endsMode==="until"&&this._endsUntil&&(e.ends={until:this._endsUntil});return e}_toggleSeasonMonth(e){this._seasonMonths=this._seasonMonths.includes(e)?this._seasonMonths.filter(t=>t!==e):[...this._seasonMonths,e]}_renderRecurrenceExtras(){let e=this._lang;if(!(this._scheduleType==="time_based"||dt.includes(this._scheduleType)))return h;let i=Wr(e);return o`
|
`}_buildSchedule(){let e=i=>{let a=parseInt(this._calOffset,10)||0;return a&&(i.offset=Math.max(-15,Math.min(a,15))),i};if(this._scheduleType==="weekdays")return e({kind:"weekdays",weekdays:[...this._weekdays].sort((i,a)=>i-a)});if(this._scheduleType==="nth_weekday")return e({kind:"nth_weekday",nth:parseInt(this._nth,10),weekday:parseInt(this._nthWeekday,10)});let t={kind:"day_of_month",day:this._domLastDay?-1:parseInt(this._domDay,10)||1};return this._domBusiness&&(t.business=!0),e(t)}_recurrenceExtras(){let e={};if(this._seasonMonths.length&&(e.season_months=[...this._seasonMonths].sort((t,i)=>t-i)),this._endsMode==="count"){let t=parseInt(this._endsCount,10);t>=1&&(e.ends={count:t})}else this._endsMode==="until"&&this._endsUntil&&(e.ends={until:this._endsUntil});return e}_toggleSeasonMonth(e){this._seasonMonths=this._seasonMonths.includes(e)?this._seasonMonths.filter(t=>t!==e):[...this._seasonMonths,e]}_renderRecurrenceExtras(){let e=this._lang;if(!(this._scheduleType==="time_based"||pt.includes(this._scheduleType)))return h;let i=Qr(e);return o`
|
||||||
<label class="field-label">${n("season_window_label",e)}</label>
|
<label class="field-label">${n("season_window_label",e)}</label>
|
||||||
<div class="field-help">${n("season_window_hint",e)}</div>
|
<div class="field-help">${n("season_window_hint",e)}</div>
|
||||||
<div class="weekday-chips season-chips">
|
<div class="weekday-chips season-chips">
|
||||||
@@ -2437,7 +2461,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._endsUntil}
|
.value=${this._endsUntil}
|
||||||
@value-changed=${a=>this._endsUntil=a.detail.value}
|
@value-changed=${a=>this._endsUntil=a.detail.value}
|
||||||
></ms-date-field>`:h}
|
></ms-date-field>`:h}
|
||||||
`}_renderCalendarFields(){let e=this._lang,t=Vr(e);if(this._scheduleType==="weekdays")return o`
|
`}_renderCalendarFields(){let e=this._lang,t=Gr(e);if(this._scheduleType==="weekdays")return o`
|
||||||
<label class="field-label">${n("recurrence_on_days",e)}</label>
|
<label class="field-label">${n("recurrence_on_days",e)}</label>
|
||||||
<div class="weekday-chips">
|
<div class="weekday-chips">
|
||||||
${t.map((i,a)=>o`
|
${t.map((i,a)=>o`
|
||||||
@@ -2489,7 +2513,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
max="15"
|
max="15"
|
||||||
.value=${this._calOffset}
|
.value=${this._calOffset}
|
||||||
@input=${t=>this._calOffset=t.target.value}
|
@input=${t=>this._calOffset=t.target.value}
|
||||||
></ms-textfield>`}_thresholdLimitsOverlap(){let e=parseFloat(this._triggerAbove),t=parseFloat(this._triggerBelow);return!isNaN(e)&&!isNaN(t)&&t>e}_renderTriggerLiveHint(){if(this._triggerType==="compound")return h;let e=this._triggerType==="threshold"&&this._thresholdLimitsOverlap()?o`<div class="trigger-live-hint warn">${n("trigger_hint_overlap",this._lang)}</div>`:h,t=this._triggerEntityId||this._triggerEntityIds[0];if(!t||!this.hass?.states)return e;let i=this.hass.states[t];if(!i)return e;let a=this._lang,l=i.attributes?.unit_of_measurement,d=typeof l=="string"&&l?` ${l}`:"",p=this._triggerAttribute?i.attributes?.[this._triggerAttribute]:i.state,_=typeof p=="number"?p:parseFloat(String(p)),f=p!=="unknown"&&p!=="unavailable"&&p!=null&&!isNaN(_),x=y=>N(y,a,{maximumFractionDigits:1}),v=[];if(this._triggerType==="threshold"){let y=parseFloat(this._triggerAbove),m=parseFloat(this._triggerBelow);if(isNaN(y)&&isNaN(m))return h;f&&v.push(n("trigger_hint_now",a).replace("{value}",x(_)+d)),isNaN(y)||v.push(n("trigger_hint_above",a).replace("{target}",x(y)+d)),isNaN(m)||v.push(n("trigger_hint_below",a).replace("{target}",x(m)+d))}else if(this._triggerType==="counter"){let y=parseFloat(this._triggerTargetValue);if(isNaN(y))return h;this._triggerDeltaMode?this._taskId?v.push(n("trigger_hint_counter_delta_edit",a).replace("{target}",x(y)+d)):f?v.push(n("trigger_hint_counter_delta",a).replace("{value}",x(_)+d).replace("{due}",x(_+y)+d).replace("{target}",x(y)+d)):v.push(n("trigger_hint_counter_delta_edit",a).replace("{target}",x(y)+d)):(f&&v.push(n("trigger_hint_now",a).replace("{value}",x(_)+d)),v.push(n("trigger_hint_counter_abs",a).replace("{target}",x(y)+d)))}else if(this._triggerType==="runtime"){let y=parseFloat(this._triggerRuntimeHours);if(isNaN(y))return h;v.push(n("trigger_hint_runtime",a).replace("{hours}",x(y))),v.push(n("trigger_hint_state_now",a).replace("{value}",String(i.state)))}else if(this._triggerType==="state_change"){let y=parseInt(this._triggerTargetChanges,10)||1,m=this._triggerToState.trim();v.push((m?n("trigger_hint_state_change_to",a).replace("{state}",m):n("trigger_hint_state_change",a)).replace("{count}",String(y))),v.push(n("trigger_hint_state_now",a).replace("{value}",String(i.state)))}return v.length?o`<div class="trigger-live-hint">${v.join(" ")}</div>${e}`:e}_renderTriggerTypeFields(){let e=this._lang;return this._triggerType==="threshold"?o`
|
></ms-textfield>`}_thresholdLimitsOverlap(){let e=parseFloat(this._triggerAbove),t=parseFloat(this._triggerBelow);return!isNaN(e)&&!isNaN(t)&&t>e}_renderTriggerLiveHint(){if(this._triggerType==="compound")return h;let e=this._triggerType==="threshold"&&this._thresholdLimitsOverlap()?o`<div class="trigger-live-hint warn">${n("trigger_hint_overlap",this._lang)}</div>`:h,t=this._triggerEntityId||this._triggerEntityIds[0];if(!t||!this.hass?.states)return e;let i=this.hass.states[t];if(!i)return e;let a=this._lang,l=i.attributes?.unit_of_measurement,c=typeof l=="string"&&l?` ${l}`:"",p=this._triggerAttribute?i.attributes?.[this._triggerAttribute]:i.state,_=typeof p=="number"?p:parseFloat(String(p)),f=p!=="unknown"&&p!=="unavailable"&&p!=null&&!isNaN(_),x=y=>N(y,a,{maximumFractionDigits:1}),v=[];if(this._triggerType==="threshold"){let y=parseFloat(this._triggerAbove),m=parseFloat(this._triggerBelow);if(isNaN(y)&&isNaN(m))return h;f&&v.push(n("trigger_hint_now",a).replace("{value}",x(_)+c)),isNaN(y)||v.push(n("trigger_hint_above",a).replace("{target}",x(y)+c)),isNaN(m)||v.push(n("trigger_hint_below",a).replace("{target}",x(m)+c))}else if(this._triggerType==="counter"){let y=parseFloat(this._triggerTargetValue);if(isNaN(y))return h;this._triggerDeltaMode?this._taskId?v.push(n("trigger_hint_counter_delta_edit",a).replace("{target}",x(y)+c)):f?v.push(n("trigger_hint_counter_delta",a).replace("{value}",x(_)+c).replace("{due}",x(_+y)+c).replace("{target}",x(y)+c)):v.push(n("trigger_hint_counter_delta_edit",a).replace("{target}",x(y)+c)):(f&&v.push(n("trigger_hint_now",a).replace("{value}",x(_)+c)),v.push(n("trigger_hint_counter_abs",a).replace("{target}",x(y)+c)))}else if(this._triggerType==="runtime"){let y=parseFloat(this._triggerRuntimeHours);if(isNaN(y))return h;v.push(n("trigger_hint_runtime",a).replace("{hours}",x(y))),v.push(n("trigger_hint_state_now",a).replace("{value}",String(i.state)))}else if(this._triggerType==="state_change"){let y=parseInt(this._triggerTargetChanges,10)||1,m=this._triggerToState.trim();v.push((m?n("trigger_hint_state_change_to",a).replace("{state}",m):n("trigger_hint_state_change",a)).replace("{count}",String(y))),v.push(n("trigger_hint_state_now",a).replace("{value}",String(i.state)))}return v.length?o`<div class="trigger-live-hint">${v.join(" ")}</div>${e}`:e}_renderTriggerTypeFields(){let e=this._lang;return this._triggerType==="threshold"?o`
|
||||||
<ms-textfield
|
<ms-textfield
|
||||||
label="${n("trigger_above",e)}"
|
label="${n("trigger_above",e)}"
|
||||||
type="number"
|
type="number"
|
||||||
@@ -2622,7 +2646,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._type}
|
.value=${this._type}
|
||||||
@change=${i=>this._type=i.target.value}
|
@change=${i=>this._type=i.target.value}
|
||||||
>
|
>
|
||||||
${Hr.map(i=>o`<option value=${i} ?selected=${i===this._type}>${n(i,e)}</option>`)}
|
${zr.map(i=>o`<option value=${i} ?selected=${i===this._type}>${n(i,e)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
${this._type==="reading"?o`
|
${this._type==="reading"?o`
|
||||||
@@ -2657,7 +2681,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._priority}
|
.value=${this._priority}
|
||||||
@change=${i=>this._priority=i.target.value}
|
@change=${i=>this._priority=i.target.value}
|
||||||
>
|
>
|
||||||
${Or.map(i=>o`<option value=${i} ?selected=${i===this._priority}>${n("priority_"+i,e)}</option>`)}
|
${Fr.map(i=>o`<option value=${i} ?selected=${i===this._priority}>${n("priority_"+i,e)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
@@ -2676,7 +2700,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.value=${this._scheduleType}
|
.value=${this._scheduleType}
|
||||||
@change=${i=>this._scheduleType=i.target.value}
|
@change=${i=>this._scheduleType=i.target.value}
|
||||||
>
|
>
|
||||||
${Dr.map(i=>o`<option value=${i} ?selected=${i===this._scheduleType}>${n(i,e)}</option>`)}
|
${Ur.map(i=>o`<option value=${i} ?selected=${i===this._scheduleType}>${n(i,e)}</option>`)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
${this._scheduleType==="time_based"?o`
|
${this._scheduleType==="time_based"?o`
|
||||||
@@ -2709,7 +2733,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
@value-changed=${i=>this._dueDate=i.detail.value}
|
@value-changed=${i=>this._dueDate=i.detail.value}
|
||||||
></ms-date-field>
|
></ms-date-field>
|
||||||
`:h}
|
`:h}
|
||||||
${this.scheduleTimeEnabled&&gs.includes(this._scheduleType)?o`
|
${this.scheduleTimeEnabled&&vs.includes(this._scheduleType)?o`
|
||||||
<label class="checkbox-row schedule-time-toggle">
|
<label class="checkbox-row schedule-time-toggle">
|
||||||
<input type="checkbox" .checked=${this._scheduleTimeOn}
|
<input type="checkbox" .checked=${this._scheduleTimeOn}
|
||||||
@change=${i=>this._scheduleTimeOn=i.target.checked} />
|
@change=${i=>this._scheduleTimeOn=i.target.checked} />
|
||||||
@@ -2758,14 +2782,14 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
${this._renderPhasesEditor(e)}
|
${this._renderPhasesEditor(e)}
|
||||||
<h3>${n("require_on_completion",e)}</h3>
|
<h3>${n("require_on_completion",e)}</h3>
|
||||||
<div class="required-completion">
|
<div class="required-completion">
|
||||||
${Mt.map(i=>o`
|
${zt.map(i=>o`
|
||||||
<label class="req-option">
|
<label class="req-option">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
.checked=${this._requiredCompletion.includes(i)}
|
.checked=${this._requiredCompletion.includes(i)}
|
||||||
@change=${a=>this._toggleRequired(i,a.target.checked)}
|
@change=${a=>this._toggleRequired(i,a.target.checked)}
|
||||||
/>
|
/>
|
||||||
<span>${n(Ve[i],e)}</span>
|
<span>${n(Ke[i],e)}</span>
|
||||||
</label>
|
</label>
|
||||||
`)}
|
`)}
|
||||||
</div>
|
</div>
|
||||||
@@ -2827,7 +2851,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<ha-form
|
<ha-form
|
||||||
class="entity-picker-form"
|
class="entity-picker-form"
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.schema=${[{name:"environmental_entity",selector:{entity:{domain:hs,device_class:us}}}]}
|
.schema=${[{name:"environmental_entity",selector:{entity:{domain:gs,device_class:ms}}}]}
|
||||||
.data=${{environmental_entity:this._environmentalEntity}}
|
.data=${{environmental_entity:this._environmentalEntity}}
|
||||||
.computeLabel=${()=>n("environmental_entity_optional",e)}
|
.computeLabel=${()=>n("environmental_entity_optional",e)}
|
||||||
.computeHelper=${()=>n("environmental_entity_helper",e)}
|
.computeHelper=${()=>n("environmental_entity_helper",e)}
|
||||||
@@ -2901,6 +2925,15 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<span>${n("disallow_skip",e)}</span>
|
<span>${n("disallow_skip",e)}</span>
|
||||||
</label>
|
</label>
|
||||||
${this._allowSkip?h:o`<div class="field-help">${n("disallow_skip_help",e)}</div>`}
|
${this._allowSkip?h:o`<div class="field-help">${n("disallow_skip_help",e)}</div>`}
|
||||||
|
<label class="req-option">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
.checked=${!this._notifyEnabled}
|
||||||
|
@change=${i=>this._notifyEnabled=!i.target.checked}
|
||||||
|
/>
|
||||||
|
<span>${n("no_notifications",e)}</span>
|
||||||
|
</label>
|
||||||
|
${this._notifyEnabled?h:o`<div class="field-help">${n("no_notifications_help",e)}</div>`}
|
||||||
<label class="toggle-row">
|
<label class="toggle-row">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -2921,7 +2954,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
</ha-button>
|
</ha-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
`}};g._PREVIEW_RELEVANT=new Set(["_open","_scheduleType","_intervalDays","_intervalUnit","_intervalAnchor","_dueDate","_weekdays","_nth","_nthWeekday","_domDay","_domLastDay","_domBusiness","_calOffset","_seasonMonths","_endsMode","_endsCount","_endsUntil","_lastPerformed"]),g.styles=A`
|
`}};g._PREVIEW_RELEVANT=new Set(["_open","_scheduleType","_intervalDays","_intervalUnit","_intervalAnchor","_dueDate","_weekdays","_nth","_nthWeekday","_domDay","_domLastDay","_domBusiness","_calOffset","_seasonMonths","_endsMode","_endsCount","_endsUntil","_lastPerformed"]),g.styles=T`
|
||||||
.dialog-title {
|
.dialog-title {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -3317,11 +3350,11 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
`,c([b({attribute:!1})],g.prototype,"hass",2),c([b({type:Boolean,attribute:"checklists-enabled"})],g.prototype,"checklistsEnabled",2),c([b({type:Boolean,attribute:"schedule-time-enabled"})],g.prototype,"scheduleTimeEnabled",2),c([b({type:Boolean,attribute:"completion-actions-enabled"})],g.prototype,"completionActionsEnabled",2),c([b({type:Number,attribute:"default-warning-days"})],g.prototype,"defaultWarningDays",2),c([u()],g.prototype,"parts",2),c([u()],g.prototype,"_foreignOwners",2),c([u()],g.prototype,"_open",2),c([u()],g.prototype,"_entityPickerFallback",2),c([u()],g.prototype,"_loading",2),c([u()],g.prototype,"_error",2),c([u()],g.prototype,"_entryId",2),c([u()],g.prototype,"_taskId",2),c([u()],g.prototype,"_objectChoices",2),c([u()],g.prototype,"_name",2),c([u()],g.prototype,"_type",2),c([u()],g.prototype,"_scheduleType",2),c([u()],g.prototype,"_intervalDays",2),c([u()],g.prototype,"_intervalUnit",2),c([u()],g.prototype,"_dueDate",2),c([u()],g.prototype,"_warningDays",2),c([u()],g.prototype,"_earliestCompletionDays",2),c([u()],g.prototype,"_intervalAnchor",2),c([u()],g.prototype,"_weekdays",2),c([u()],g.prototype,"_nth",2),c([u()],g.prototype,"_nthWeekday",2),c([u()],g.prototype,"_domDay",2),c([u()],g.prototype,"_domLastDay",2),c([u()],g.prototype,"_domBusiness",2),c([u()],g.prototype,"_calOffset",2),c([u()],g.prototype,"_seasonMonths",2),c([u()],g.prototype,"_endsMode",2),c([u()],g.prototype,"_endsCount",2),c([u()],g.prototype,"_endsUntil",2),c([u()],g.prototype,"_schedulePreview",2),c([u()],g.prototype,"_schedulePreviewEnded",2),c([u()],g.prototype,"_notes",2),c([u()],g.prototype,"_documentationUrl",2),c([u()],g.prototype,"_customIcon",2),c([u()],g.prototype,"_priority",2),c([u()],g.prototype,"_labels",2),c([u()],g.prototype,"_enabled",2),c([u()],g.prototype,"_triggerEntityId",2),c([u()],g.prototype,"_triggerEntityIds",2),c([u()],g.prototype,"_triggerEntityLogic",2),c([u()],g.prototype,"_triggerAttribute",2),c([u()],g.prototype,"_triggerType",2),c([u()],g.prototype,"_triggerAbove",2),c([u()],g.prototype,"_triggerBelow",2),c([u()],g.prototype,"_triggerEquals",2),c([u()],g.prototype,"_triggerNotEquals",2),c([u()],g.prototype,"_triggerForMinutes",2),c([u()],g.prototype,"_triggerCombinator",2),c([u()],g.prototype,"_triggerTargetValue",2),c([u()],g.prototype,"_triggerDeltaMode",2),c([u()],g.prototype,"_triggerBaselineValue",2),c([u()],g.prototype,"_liveBaselineValue",2),c([u()],g.prototype,"_autoCompleteOnRecovery",2),c([u()],g.prototype,"_triggerFromState",2),c([u()],g.prototype,"_triggerToState",2),c([u()],g.prototype,"_triggerTargetChanges",2),c([u()],g.prototype,"_triggerRuntimeHours",2),c([u()],g.prototype,"_triggerRuntimeMaxSession",2),c([u()],g.prototype,"_triggerOnStates",2),c([u()],g.prototype,"_compoundLogic",2),c([u()],g.prototype,"_compoundConditions",2),c([u()],g.prototype,"_suggestedAttributes",2),c([u()],g.prototype,"_availableAttributes",2),c([u()],g.prototype,"_entityDomain",2),c([u()],g.prototype,"_lastPerformed",2),c([u()],g.prototype,"_nfcTagId",2),c([u()],g.prototype,"_requireTagScan",2),c([u()],g.prototype,"_allowSkip",2),c([u()],g.prototype,"_readingUnit",2),c([u()],g.prototype,"_readings",2),c([u()],g.prototype,"_consumesParts",2),c([u()],g.prototype,"_partsLoadFailed",2),c([u()],g.prototype,"_availableTags",2),c([u()],g.prototype,"_responsibleUserId",2),c([u()],g.prototype,"_assigneePool",2),c([u()],g.prototype,"_rotationStrategy",2),c([u()],g.prototype,"_availableUsers",2),c([u()],g.prototype,"_checklistText",2),c([u()],g.prototype,"_phaseDefs",2),c([u()],g.prototype,"_phaseSeq",2),c([u()],g.prototype,"_requiredCompletion",2),c([u()],g.prototype,"_scheduleTime",2),c([u()],g.prototype,"_scheduleTimeOn",2),c([u()],g.prototype,"_actionService",2),c([u()],g.prototype,"_actionTargetEntity",2),c([u()],g.prototype,"_actionData",2),c([u()],g.prototype,"_actionDataJsonFallback",2),c([u()],g.prototype,"_actionTesting",2),c([u()],g.prototype,"_actionTestResult",2),c([u()],g.prototype,"_actionTestError",2),c([u()],g.prototype,"_qcNotes",2),c([u()],g.prototype,"_qcCost",2),c([u()],g.prototype,"_qcDuration",2),c([u()],g.prototype,"_qcFeedback",2),c([u()],g.prototype,"_environmentalEntity",2),c([u()],g.prototype,"_environmentalAttribute",2),c([u()],g.prototype,"_adaptiveEnabled",2),c([u()],g.prototype,"_adaptiveAlpha",2),c([u()],g.prototype,"_adaptiveMin",2),c([u()],g.prototype,"_adaptiveMax",2),c([u()],g.prototype,"_adaptiveSeasonal",2),c([u()],g.prototype,"_adaptivePrediction",2),c([u()],g.prototype,"_conditionAttrOptions",2);Qt=g;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",Qt)});var ce,Jt=w(()=>{"use strict";P();M();Nt();ce=class extends T{constructor(){super(...arguments);this.docId="";this._url="";this._failed=!1;this._signedFor=""}updated(){this.hass&&this.docId&&this._signedFor!==this.docId&&(this._signedFor=this.docId,this._url="",this._failed=!1,this._sign())}async _sign(){try{this._url=await Rt(this.hass,this.docId)}catch{this._f
Line truncated
|
`,d([b({attribute:!1})],g.prototype,"hass",2),d([b({type:Boolean,attribute:"checklists-enabled"})],g.prototype,"checklistsEnabled",2),d([b({type:Boolean,attribute:"schedule-time-enabled"})],g.prototype,"scheduleTimeEnabled",2),d([b({type:Boolean,attribute:"completion-actions-enabled"})],g.prototype,"completionActionsEnabled",2),d([b({type:Number,attribute:"default-warning-days"})],g.prototype,"defaultWarningDays",2),d([u()],g.prototype,"parts",2),d([u()],g.prototype,"_foreignOwners",2),d([u()],g.prototype,"_open",2),d([u()],g.prototype,"_entityPickerFallback",2),d([u()],g.prototype,"_loading",2),d([u()],g.prototype,"_error",2),d([u()],g.prototype,"_entryId",2),d([u()],g.prototype,"_taskId",2),d([u()],g.prototype,"_objectChoices",2),d([u()],g.prototype,"_name",2),d([u()],g.prototype,"_type",2),d([u()],g.prototype,"_scheduleType",2),d([u()],g.prototype,"_intervalDays",2),d([u()],g.prototype,"_intervalUnit",2),d([u()],g.prototype,"_dueDate",2),d([u()],g.prototype,"_warningDays",2),d([u()],g.prototype,"_earliestCompletionDays",2),d([u()],g.prototype,"_intervalAnchor",2),d([u()],g.prototype,"_weekdays",2),d([u()],g.prototype,"_nth",2),d([u()],g.prototype,"_nthWeekday",2),d([u()],g.prototype,"_domDay",2),d([u()],g.prototype,"_domLastDay",2),d([u()],g.prototype,"_domBusiness",2),d([u()],g.prototype,"_calOffset",2),d([u()],g.prototype,"_seasonMonths",2),d([u()],g.prototype,"_endsMode",2),d([u()],g.prototype,"_endsCount",2),d([u()],g.prototype,"_endsUntil",2),d([u()],g.prototype,"_schedulePreview",2),d([u()],g.prototype,"_schedulePreviewEnded",2),d([u()],g.prototype,"_notes",2),d([u()],g.prototype,"_documentationUrl",2),d([u()],g.prototype,"_customIcon",2),d([u()],g.prototype,"_priority",2),d([u()],g.prototype,"_labels",2),d([u()],g.prototype,"_enabled",2),d([u()],g.prototype,"_triggerEntityId",2),d([u()],g.prototype,"_triggerEntityIds",2),d([u()],g.prototype,"_triggerEntityLogic",2),d([u()],g.prototype,"_triggerAttribute",2),d([u()],g.prototype,"_triggerType",2),d([u()],g.prototype,"_triggerAbove",2),d([u()],g.prototype,"_triggerBelow",2),d([u()],g.prototype,"_triggerEquals",2),d([u()],g.prototype,"_triggerNotEquals",2),d([u()],g.prototype,"_triggerForMinutes",2),d([u()],g.prototype,"_triggerCombinator",2),d([u()],g.prototype,"_triggerTargetValue",2),d([u()],g.prototype,"_triggerDeltaMode",2),d([u()],g.prototype,"_triggerBaselineValue",2),d([u()],g.prototype,"_liveBaselineValue",2),d([u()],g.prototype,"_autoCompleteOnRecovery",2),d([u()],g.prototype,"_triggerFromState",2),d([u()],g.prototype,"_triggerToState",2),d([u()],g.prototype,"_triggerTargetChanges",2),d([u()],g.prototype,"_triggerRuntimeHours",2),d([u()],g.prototype,"_triggerRuntimeMaxSession",2),d([u()],g.prototype,"_triggerOnStates",2),d([u()],g.prototype,"_compoundLogic",2),d([u()],g.prototype,"_compoundConditions",2),d([u()],g.prototype,"_suggestedAttributes",2),d([u()],g.prototype,"_availableAttributes",2),d([u()],g.prototype,"_entityDomain",2),d([u()],g.prototype,"_lastPerformed",2),d([u()],g.prototype,"_nfcTagId",2),d([u()],g.prototype,"_requireTagScan",2),d([u()],g.prototype,"_allowSkip",2),d([u()],g.prototype,"_notifyEnabled",2),d([u()],g.prototype,"_readingUnit",2),d([u()],g.prototype,"_readings",2),d([u()],g.prototype,"_consumesParts",2),d([u()],g.prototype,"_partsLoadFailed",2),d([u()],g.prototype,"_availableTags",2),d([u()],g.prototype,"_responsibleUserId",2),d([u()],g.prototype,"_assigneePool",2),d([u()],g.prototype,"_rotationStrategy",2),d([u()],g.prototype,"_availableUsers",2),d([u()],g.prototype,"_checklistText",2),d([u()],g.prototype,"_phaseDefs",2),d([u()],g.prototype,"_phaseSeq",2),d([u()],g.prototype,"_requiredCompletion",2),d([u()],g.prototype,"_scheduleTime",2),d([u()],g.prototype,"_scheduleTimeOn",2),d([u()],g.prototype,"_actionService",2),d([u()],g.prototype,"_actionTargetEntity",2),d([u()],g.prototype,"_actionData",2),d([u()],g.prototype,"_actionDataJsonFallback",2),d([u()],g.prototype,"_actionTesting",2),d([u()],g.prototype,"_actionTestResult",2),d([u()],g.prototype,"_actionTestError",2),d([u()],g.prototype,"_qcNotes",2),d([u()],g.prototype,"_qcCost",2),d([u()],g.prototype,"_qcDuration",2),d([u()],g.prototype,"_qcFeedback",2),d([u()],g.prototype,"_environmentalEntity",2),d([u()],g.prototype,"_environmentalAttribute",2),d([u()],g.prototype,"_adaptiveEnabled",2),d([u()],g.prototype,"_adaptiveAlpha",2),d([u()],g.prototype,"_adaptiveMin",2),d([u()],g.prototype,"_adaptiveMax",2),d([u()],g.prototype,"_adaptiveSeasonal",2),d([u()],g.prototype,"_adaptivePrediction",2),d([u()],g.prototype,"_conditionAttrOptions",2);Jt=g;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",Jt)});var de,Zt=w(()=>{"use strict";P();z();Nt();de=class extends A{constructor(){super(...arguments);this.docId="";this._url="";this._failed=!1;this._signedFor=""}updated(){this.hass&&this.docId&&this._signedFor!==this.docId&&(this._signedFor=this.docId,this._url="",this._failed=!1,this._sign())}async _sign(){try{this._url=awai
Line truncated
|
||||||
<a href=${this._url} target="_blank" rel="noopener" class="wrap">
|
<a href=${this._url} target="_blank" rel="noopener" class="wrap">
|
||||||
<img src=${this._url} alt="" loading="lazy"
|
<img src=${this._url} alt="" loading="lazy"
|
||||||
@error=${()=>this._failed=!0} />
|
@error=${()=>this._failed=!0} />
|
||||||
</a>`:o`<div class="ph"></div>`}};ce.styles=A`
|
</a>`:o`<div class="ph"></div>`}};de.styles=T`
|
||||||
.wrap { display: inline-block; margin-top: 4px; }
|
.wrap { display: inline-block; margin-top: 4px; }
|
||||||
/* #161: uniform 96px tiles — several photos sit in a strip, so a
|
/* #161: uniform 96px tiles — several photos sit in a strip, so a
|
||||||
tiny or portrait shot must not collapse its slot. */
|
tiny or portrait shot must not collapse its slot. */
|
||||||
@@ -3341,7 +3374,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
`,c([b({attribute:!1})],ce.prototype,"hass",2),c([b()],ce.prototype,"docId",2),c([u()],ce.prototype,"_url",2),c([u()],ce.prototype,"_failed",2);customElements.get("maintenance-history-photo")||customElements.define("maintenance-history-photo",ce)});var z,vs=w(()=>{"use strict";P();M();j();le();Bt();Ee();Jt();z=class extends T{constructor(){super(...arguments);this._open=!1;this._saving=!1;this._error="";this._draft=null;this._originalSnapshot=null;this._partOptions=null;this._partQty={};this._partQtyOriginal="";this._photos=[];this._photosOriginal="";this._readingRows=[];this._readingText={};this._readingsOriginal="";this._uploadedIds=[];this._photoUploading=!1}get _lang(){return H(this.hass)}openEdit(e){this._draft={...e},this._originalSnapshot={...e},this._error="",this._open=!0,this._partOptions=null,this._partQty={},this._partQtyOriginal="",this._photos=[...e.photo_doc_ids??[]],this._photosOriginal=JSON.stringify(this._photos),this._uploadedIds=[],this._photoUploading=!1,this._seedReadings(e),this._loadPartOptions()}_seedReadings(e){let t=[],i=new Set;for(let l of e.readings??[])i.has(l.id)||(i.add(l.id),t.push({id:l.id,name:l.name,unit:l.unit??null}));for(let l of e.reading_values??[])i.has(l.id)||(i.add(l.id),t.push({id:l.id,name:l.name,unit:l.unit??null}));this._readingRows=t;let a={};for(let l of e.reading_values??[])a[l.id]=String(l.value);this._readingText=a,this._readingsOriginal=JSON.stringify(this._readingNumbers())}_readingNumbers(){let e={};for(let t of this._readingRows){let i=(this._readingText[t.id]??"").trim();if(i==="")continue;let a=parseFloat(i.replace(",","."));isNaN(a)||(e[t.id]=a)}return e}async _onPhotoInput(e){let t=e.target,i=Array.from(t.files??[]);t.value="";let a=this._draft;if(i.length===0||!a)return;let l=10-this._photos.length,d=i.slice(0,Math.max(l,0));this._photoUploading=!0,this._error="";try{for(let p of d){let _=await lt(this.hass,a.entry_id,p);this._uploadedIds=[...this._uploadedIds,_],this._photos=[...this._photos,_]}i.length>d.length&&(this._error=n("photos_limit",this._lang).replace("{max}",String(10)))}catch(p){let _=p instanceof Error&&p.message==="doc_too_large"?"doc_too_large":"doc_upload_failed";this._error=n(_,this._lang)}finally{this._photoUploading=!1}}_removePhoto(e){this._photos=this._photos.filter(t=>t!==e),this._uploadedIds.includes(e)&&(this._uploadedIds=this._uploadedIds.filter(t=>t!==e),ke(this.hass,[e]))}async _loadPartOptions(){let e=this._draft;if(e)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/parts/overview"}),i=[];for(let l of t.parts||[]){let d=l.entry_id===e.entry_id,p=l.consumers.some(_=>_.entry_id===e.entry_id&&_.task_id===e.task_id);!d&&!p||i.push({part_id:l.part_id,name:l.name,entry_id:l.entry_id,foreign:!d,object_name:l.object_name})}for(let l of e.used_parts||[]){let d=l.entry_id||e.entry_id;i.some(p=>p.part_id===l.part_id&&p.entry_id===d)||i.push({part_id:l.part_id,name:l.name||l.part_id,entry_id:d,foreign:d!==e.entry_id,object_name:null})}let a={};for(let l of e.used_parts||[])a[`${l.entry_id||e.entry_id}:${l.part_id}`]=l.quantity??1;this._partOptions=i,this._partQty=a,this._partQtyOriginal=this._partSelectionKey()}catch{this._partOptions=[]}}_partSelectionKey(){return JSON.stringify(Object.entries(this._partQty).filter(([,e])=>e>0).sort(([e],[t])=>e.localeCompare(t)))}close(){if(this._open=!1,this._error="",this._draft=null,this._originalSnapshot=null,this._uploadedIds.length>0){let e=this._uploadedIds;this._uploadedIds=[],ke(this.hass,e)}}_set(e,t){this._draft&&(this._draft={...this._draft,[e]:t})}async _save(){if(!(!this._draft||!this._originalSnapshot)){this._saving=!0,this._error="";try{let e={type:"maintenance_supporter/task/history/update",entry_id:this._draft.entry_id,task_id:this._draft.task_id,original_timestamp:this._originalSnapshot.original_timestamp};if(this._draft.timestamp!==this._originalSnapshot.timestamp&&(e.timestamp=this._draft.timestamp),this._draft.notes!==this._originalSnapshot.notes&&(e.notes=this._draft.notes),this._draft.cost!==this._originalSnapshot.cost&&(e.cost=this._draft.cost),this._draft.duration!==this._originalSnapshot.duration&&(e.duration=this._draft.duration),this._draft.completed_by!==this._originalSnapshot.completed_by&&(e.completed_by=this._draft.completed_by),this._partOptions!==null&&this._partSelectionKey()!==this._partQtyOriginal&&(e.used_parts=(this._partOptions||[]).filter(i=>(this._partQty[`${i.entry_id}:${i.part_id}`]||0)>0).map(i=>({part_id:i.part_id,quantity:this._partQty[`${i.entry_id}:${i.part_id}`],...i.foreign?{entry_id:i.entry_id}:{}}))),this._draft.reading_value!==this._originalSnapshot.reading_value&&(e.reading_value=this._draft.reading_value??null),this._readingRows.length>0&&JSON.stringify(this._readingNumbers())!==this._readingsOriginal){let i=this._readingNumbers(),a={};for(let l of this._readingRows)a[l.id]=i[l.id]??null;e.reading_values=a}if(JSON.stringify(this._photos)!==this._photosOriginal&&(e.photo_doc_ids=[...this._photos]),O
Line truncated
|
`,d([b({attribute:!1})],de.prototype,"hass",2),d([b()],de.prototype,"docId",2),d([u()],de.prototype,"_url",2),d([u()],de.prototype,"_failed",2);customElements.get("maintenance-history-photo")||customElements.define("maintenance-history-photo",de)});var U,xs=w(()=>{"use strict";P();z();L();le();Vt();Se();Zt();U=class extends A{constructor(){super(...arguments);this._open=!1;this._saving=!1;this._error="";this._draft=null;this._originalSnapshot=null;this._partOptions=null;this._partQty={};this._partQtyOriginal="";this._photos=[];this._photosOriginal="";this._readingRows=[];this._readingText={};this._readingsOriginal="";this._uploadedIds=[];this._photoUploading=!1}get _lang(){return H(this.hass)}openEdit(e){this._draft={...e},this._originalSnapshot={...e},this._error="",this._open=!0,this._partOptions=null,this._partQty={},this._partQtyOriginal="",this._photos=[...e.photo_doc_ids??[]],this._photosOriginal=JSON.stringify(this._photos),this._uploadedIds=[],this._photoUploading=!1,this._seedReadings(e),this._loadPartOptions()}_seedReadings(e){let t=[],i=new Set;for(let l of e.readings??[])i.has(l.id)||(i.add(l.id),t.push({id:l.id,name:l.name,unit:l.unit??null}));for(let l of e.reading_values??[])i.has(l.id)||(i.add(l.id),t.push({id:l.id,name:l.name,unit:l.unit??null}));this._readingRows=t;let a={};for(let l of e.reading_values??[])a[l.id]=String(l.value);this._readingText=a,this._readingsOriginal=JSON.stringify(this._readingNumbers())}_readingNumbers(){let e={};for(let t of this._readingRows){let i=(this._readingText[t.id]??"").trim();if(i==="")continue;let a=parseFloat(i.replace(",","."));isNaN(a)||(e[t.id]=a)}return e}async _onPhotoInput(e){let t=e.target,i=Array.from(t.files??[]);t.value="";let a=this._draft;if(i.length===0||!a)return;let l=10-this._photos.length,c=i.slice(0,Math.max(l,0));this._photoUploading=!0,this._error="";try{for(let p of c){let _=await dt(this.hass,a.entry_id,p);this._uploadedIds=[...this._uploadedIds,_],this._photos=[...this._photos,_]}i.length>c.length&&(this._error=n("photos_limit",this._lang).replace("{max}",String(10)))}catch(p){let _=p instanceof Error&&p.message==="doc_too_large"?"doc_too_large":"doc_upload_failed";this._error=n(_,this._lang)}finally{this._photoUploading=!1}}_removePhoto(e){this._photos=this._photos.filter(t=>t!==e),this._uploadedIds.includes(e)&&(this._uploadedIds=this._uploadedIds.filter(t=>t!==e),ke(this.hass,[e]))}async _loadPartOptions(){let e=this._draft;if(e)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/parts/overview"}),i=[];for(let l of t.parts||[]){let c=l.entry_id===e.entry_id,p=l.consumers.some(_=>_.entry_id===e.entry_id&&_.task_id===e.task_id);!c&&!p||i.push({part_id:l.part_id,name:l.name,entry_id:l.entry_id,foreign:!c,object_name:l.object_name})}for(let l of e.used_parts||[]){let c=l.entry_id||e.entry_id;i.some(p=>p.part_id===l.part_id&&p.entry_id===c)||i.push({part_id:l.part_id,name:l.name||l.part_id,entry_id:c,foreign:c!==e.entry_id,object_name:null})}let a={};for(let l of e.used_parts||[])a[`${l.entry_id||e.entry_id}:${l.part_id}`]=l.quantity??1;this._partOptions=i,this._partQty=a,this._partQtyOriginal=this._partSelectionKey()}catch{this._partOptions=[]}}_partSelectionKey(){return JSON.stringify(Object.entries(this._partQty).filter(([,e])=>e>0).sort(([e],[t])=>e.localeCompare(t)))}close(){if(this._open=!1,this._error="",this._draft=null,this._originalSnapshot=null,this._uploadedIds.length>0){let e=this._uploadedIds;this._uploadedIds=[],ke(this.hass,e)}}_set(e,t){this._draft&&(this._draft={...this._draft,[e]:t})}async _save(){if(!(!this._draft||!this._originalSnapshot)){this._saving=!0,this._error="";try{let e={type:"maintenance_supporter/task/history/update",entry_id:this._draft.entry_id,task_id:this._draft.task_id,original_timestamp:this._originalSnapshot.original_timestamp};if(this._draft.timestamp!==this._originalSnapshot.timestamp&&(e.timestamp=this._draft.timestamp),this._draft.notes!==this._originalSnapshot.notes&&(e.notes=this._draft.notes),this._draft.cost!==this._originalSnapshot.cost&&(e.cost=this._draft.cost),this._draft.duration!==this._originalSnapshot.duration&&(e.duration=this._draft.duration),this._draft.completed_by!==this._originalSnapshot.completed_by&&(e.completed_by=this._draft.completed_by),this._partOptions!==null&&this._partSelectionKey()!==this._partQtyOriginal&&(e.used_parts=(this._partOptions||[]).filter(i=>(this._partQty[`${i.entry_id}:${i.part_id}`]||0)>0).map(i=>({part_id:i.part_id,quantity:this._partQty[`${i.entry_id}:${i.part_id}`],...i.foreign?{entry_id:i.entry_id}:{}}))),this._draft.reading_value!==this._originalSnapshot.reading_value&&(e.reading_value=this._draft.reading_value??null),this._readingRows.length>0&&JSON.stringify(this._readingNumbers())!==this._readingsOriginal){let i=this._readingNumbers(),a={};for(let l of this._readingRows)a[l.id]=i[l.id]??null;e.reading_values=a}if(JSON.stringify(this._photos)!==this._photosOriginal&&(e.photo_doc_ids=[...this._photos]),O
Line truncated
|
||||||
<div class="backdrop" @click=${this.close}></div>
|
<div class="backdrop" @click=${this.close}></div>
|
||||||
<div class="dialog" role="dialog" aria-modal="true">
|
<div class="dialog" role="dialog" aria-modal="true">
|
||||||
<h2>${n("history_edit_title",e)||"Edit history entry"}</h2>
|
<h2>${n("history_edit_title",e)||"Edit history entry"}</h2>
|
||||||
@@ -3386,12 +3419,12 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
${this._partOptions.map(i=>{let a=`${i.entry_id}:${i.part_id}`,l=this._partQty[a]||0;return o`
|
${this._partOptions.map(i=>{let a=`${i.entry_id}:${i.part_id}`,l=this._partQty[a]||0;return o`
|
||||||
<label class="part-row-edit">
|
<label class="part-row-edit">
|
||||||
<input type="checkbox" .checked=${l>0}
|
<input type="checkbox" .checked=${l>0}
|
||||||
@change=${d=>{let p=d.target.checked;this._partQty={...this._partQty,[a]:p?1:0}}} />
|
@change=${c=>{let p=c.target.checked;this._partQty={...this._partQty,[a]:p?1:0}}} />
|
||||||
<span class="part-label">${i.name}${i.foreign&&i.object_name?` (${i.object_name})`:""}</span>
|
<span class="part-label">${i.name}${i.foreign&&i.object_name?` (${i.object_name})`:""}</span>
|
||||||
${l>0?o`
|
${l>0?o`
|
||||||
<input class="part-qty" type="number" min="0.01" max="999" step="0.01"
|
<input class="part-qty" type="number" min="0.01" max="999" step="0.01"
|
||||||
.value=${String(l)}
|
.value=${String(l)}
|
||||||
@input=${d=>{let p=parseFloat(d.target.value);!isNaN(p)&&p>0&&(this._partQty={...this._partQty,[a]:p})}} />
|
@input=${c=>{let p=parseFloat(c.target.value);!isNaN(p)&&p>0&&(this._partQty={...this._partQty,[a]:p})}} />
|
||||||
`:h}
|
`:h}
|
||||||
</label>
|
</label>
|
||||||
`})}
|
`})}
|
||||||
@@ -3445,7 +3478,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
<input type="number" step="any"
|
<input type="number" step="any"
|
||||||
.value=${e.reading_value!=null?String(e.reading_value):""}
|
.value=${e.reading_value!=null?String(e.reading_value):""}
|
||||||
@input=${i=>{let a=i.target.value,l=a===""?NaN:Number(a);this._set("reading_value",isNaN(l)?null:l)}} />
|
@input=${i=>{let a=i.target.value,l=a===""?NaN:Number(a);this._set("reading_value",isNaN(l)?null:l)}} />
|
||||||
</label>`}};z.styles=A`
|
</label>`}};U.styles=T`
|
||||||
:host { display: contents; }
|
:host { display: contents; }
|
||||||
.backdrop {
|
.backdrop {
|
||||||
position: fixed; inset: 0;
|
position: fixed; inset: 0;
|
||||||
@@ -3557,9 +3590,9 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.photo-add:hover { border-color: var(--primary-color); }
|
.photo-add:hover { border-color: var(--primary-color); }
|
||||||
.photo-add input[type="file"] { display: none; }
|
.photo-add input[type="file"] { display: none; }
|
||||||
.photos-hint { font-size: 12px; color: var(--secondary-text-color); }
|
.photos-hint { font-size: 12px; color: var(--secondary-text-color); }
|
||||||
`,c([b({attribute:!1})],z.prototype,"hass",2),c([u()],z.prototype,"_open",2),c([u()],z.prototype,"_saving",2),c([u()],z.prototype,"_error",2),c([u()],z.prototype,"_draft",2),c([u()],z.prototype,"_partOptions",2),c([u()],z.prototype,"_partQty",2),c([u()],z.prototype,"_photos",2),c([u()],z.prototype,"_readingRows",2),c([u()],z.prototype,"_readingText",2),c([u()],z.prototype,"_photoUploading",2);customElements.get("maintenance-history-edit-dialog")||customElements.define("maintenance-history-edit-dialog",z)});function Ae(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function bs(r){return!r.startsWith("data:image/svg+xml,")&&!r.startsWith("data:image/png;base64,")?"":Ae(r)}function Kr(r){return r.replace(/[/\\:*?"<>|#%]+/g,"").replace(/\s+/g,"-").toLowerCase().substring(0,100)}var V,ys=w(()=>{"use strict";P();M();j();Lt();V=class extends T{constructor(){super(...arguments);this.lang="en";this._open=!1;this._loading=!1;this._error="";this._viewResult=null;this._completeResult=null;this._urlMode="companion";this._entryId="";this._taskId=null;this._objectName="";this._taskName="";this._generateSeq=0}openForObject(e,t){this._entryId=e,this._taskId=null,this._objectName=t,this._taskName="",this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}openForTask(e,t,i,a){this._entryId=e,this._taskId=t,this._objectName=i,this._taskName=a,this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}async _generate(){let e=++this._generateSeq;this._loading=!0,this._error="",this._viewResult=null,this._completeResult=null;try{let t={type:"maintenance_supporter/qr/generate",entry_id:this._entryId,url_mode:this._urlMode};this._taskId&&(t.task_id=this._taskId);let i=[this.hass.connection.sendMessagePromise({...t,action:"view"})];this._taskId&&i.push(this.hass.connection.sendMessagePromise({...t,action:"complete"}));let a=await Promise.all(i);if(e!==this._generateSeq)return;this._viewResult=a[0],a.length>1&&(this._completeResult=a[1])}catch(t){if(e!==this._generateSeq)return;let i=t?.code,a=t?.message;this._error=i==="no_url"||typeof a=="string"&&a.includes("No Home Assistant URL")?n("qr_error_no_url",this.lang):n("qr_error",this.lang)}finally{e===this._generateSeq&&(this._loading=!1)}}_setUrlMode(e){this._urlMode!==e&&(this._urlMode=e,this._generate())}_print(){if(!this._viewResult)return;let e=this._viewResult,t=e.label.task_name?`${e.label.object_name} \u2014 ${e.label.task_name}`:e.label.object_name,i=[e.label.manufacturer,e.label.model].filter(Boolean).join(" "),a=window.open("","_blank","width=600,height=500");if(!a)return;let l=this.lang||"en",d=Ae(t),p=Ae(i),_=!!this._completeResult,f=Ae(n("qr_action_view",l)),x=Ae(n("qr_action_complete",l));a.document.write(`<!DOCTYPE html><html><head><meta charset="utf-8">
|
`,d([b({attribute:!1})],U.prototype,"hass",2),d([u()],U.prototype,"_open",2),d([u()],U.prototype,"_saving",2),d([u()],U.prototype,"_error",2),d([u()],U.prototype,"_draft",2),d([u()],U.prototype,"_partOptions",2),d([u()],U.prototype,"_partQty",2),d([u()],U.prototype,"_photos",2),d([u()],U.prototype,"_readingRows",2),d([u()],U.prototype,"_readingText",2),d([u()],U.prototype,"_photoUploading",2);customElements.get("maintenance-history-edit-dialog")||customElements.define("maintenance-history-edit-dialog",U)});function Ae(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function ws(r){return!r.startsWith("data:image/svg+xml,")&&!r.startsWith("data:image/png;base64,")?"":Ae(r)}function Jr(r){return r.replace(/[/\\:*?"<>|#%]+/g,"").replace(/\s+/g,"-").toLowerCase().substring(0,100)}var W,$s=w(()=>{"use strict";P();z();L();Rt();W=class extends A{constructor(){super(...arguments);this.lang="en";this._open=!1;this._loading=!1;this._error="";this._viewResult=null;this._completeResult=null;this._urlMode="companion";this._entryId="";this._taskId=null;this._objectName="";this._taskName="";this._generateSeq=0}openForObject(e,t){this._entryId=e,this._taskId=null,this._objectName=t,this._taskName="",this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}openForTask(e,t,i,a){this._entryId=e,this._taskId=t,this._objectName=i,this._taskName=a,this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}async _generate(){let e=++this._generateSeq;this._loading=!0,this._error="",this._viewResult=null,this._completeResult=null;try{let t={type:"maintenance_supporter/qr/generate",entry_id:this._entryId,url_mode:this._urlMode};this._taskId&&(t.task_id=this._taskId);let i=[this.hass.connection.sendMessagePromise({...t,action:"view"})];this._taskId&&i.push(this.hass.connection.sendMessagePromise({...t,action:"complete"}));let a=await Promise.all(i);if(e!==this._generateSeq)return;this._viewResult=a[0],a.length>1&&(this._completeResult=a[1])}catch(t){if(e!==this._generateSeq)return;let i=t?.code,a=t?.message;this._error=i==="no_url"||typeof a=="string"&&a.includes("No Home Assistant URL")?n("qr_error_no_url",this.lang):n("qr_error",this.lang)}finally{e===this._generateSeq&&(this._loading=!1)}}_setUrlMode(e){this._urlMode!==e&&(this._urlMode=e,this._generate())}_print(){if(!this._viewResult)return;let e=this._viewResult,t=e.label.task_name?`${e.label.object_name} \u2014 ${e.label.task_name}`:e.label.object_name,i=[e.label.manufacturer,e.label.model].filter(Boolean).join(" "),a=window.open("","_blank","width=600,height=500");if(!a)return;let l=this.lang||"en",c=Ae(t),p=Ae(i),_=!!this._completeResult,f=Ae(n("qr_action_view",l)),x=Ae(n("qr_action_complete",l));a.document.write(`<!DOCTYPE html><html><head><meta charset="utf-8">
|
||||||
<meta name="color-scheme" content="light">
|
<meta name="color-scheme" content="light">
|
||||||
<title>${d}</title>
|
<title>${c}</title>
|
||||||
<style>
|
<style>
|
||||||
/* Printable sheet \u2014 must not inherit the phone's dark theme. The QR images
|
/* Printable sheet \u2014 must not inherit the phone's dark theme. The QR images
|
||||||
carry their own white quiet zone and stay scannable either way, but the
|
carry their own white quiet zone and stay scannable either way, but the
|
||||||
@@ -3575,21 +3608,21 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.qr-label{font-size:13px;font-weight:500;color:#333}
|
.qr-label{font-size:13px;font-weight:500;color:#333}
|
||||||
.url{font-size:10px;color:#999;word-break:break-all;margin-top:8px;max-width:480px}
|
.url{font-size:10px;color:#999;word-break:break-all;margin-top:8px;max-width:480px}
|
||||||
</style></head><body>
|
</style></head><body>
|
||||||
<h2>${d}</h2>
|
<h2>${c}</h2>
|
||||||
${p?`<div class="sub">${p}</div>`:""}
|
${p?`<div class="sub">${p}</div>`:""}
|
||||||
<div class="qr-row">
|
<div class="qr-row">
|
||||||
<div class="qr-col">
|
<div class="qr-col">
|
||||||
<img src="${bs(this._viewResult.svg_data_uri)}" alt="QR Info" />
|
<img src="${ws(this._viewResult.svg_data_uri)}" alt="QR Info" />
|
||||||
<div class="qr-label">${f}</div>
|
<div class="qr-label">${f}</div>
|
||||||
</div>
|
</div>
|
||||||
${_?`<div class="qr-col">
|
${_?`<div class="qr-col">
|
||||||
<img src="${bs(this._completeResult.svg_data_uri)}" alt="QR Complete" />
|
<img src="${ws(this._completeResult.svg_data_uri)}" alt="QR Complete" />
|
||||||
<div class="qr-label">${x}</div>
|
<div class="qr-label">${x}</div>
|
||||||
</div>`:""}
|
</div>`:""}
|
||||||
</div>
|
</div>
|
||||||
<div class="url">${Ae(this._viewResult.url)}</div>
|
<div class="url">${Ae(this._viewResult.url)}</div>
|
||||||
<script>setTimeout(()=>window.print(),300)<\/script>
|
<script>setTimeout(()=>window.print(),300)<\/script>
|
||||||
</body></html>`),a.document.close()}_downloadSvg(e,t){let i=decodeURIComponent(e.svg_data_uri.replace("data:image/svg+xml,","")),a=this._taskName?`${this._objectName}-${this._taskName}`:this._objectName;Yi(i,`qr-${Kr(a)}-${t}.svg`,"image/svg+xml")}_close(){this._open=!1,this._viewResult=null,this._completeResult=null,this._error="",this._loading=!1}render(){if(!this._open)return o``;let e=this.lang||this.hass?.language||"en",t=this._taskName?`${n("qr_code",e)}: ${this._objectName} \u2014 ${this._taskName}`:`${n("qr_code",e)}: ${this._objectName}`,i=!!this._viewResult;return o`
|
</body></html>`),a.document.close()}_downloadSvg(e,t){let i=decodeURIComponent(e.svg_data_uri.replace("data:image/svg+xml,","")),a=this._taskName?`${this._objectName}-${this._taskName}`:this._objectName;Gi(i,`qr-${Jr(a)}-${t}.svg`,"image/svg+xml")}_close(){this._open=!1,this._viewResult=null,this._completeResult=null,this._error="",this._loading=!1}render(){if(!this._open)return o``;let e=this.lang||this.hass?.language||"en",t=this._taskName?`${n("qr_code",e)}: ${this._objectName} \u2014 ${this._taskName}`:`${n("qr_code",e)}: ${this._objectName}`,i=!!this._viewResult;return o`
|
||||||
<ha-dialog open @closed=${this._close}>
|
<ha-dialog open @closed=${this._close}>
|
||||||
<div class="dialog-title">${t}</div>
|
<div class="dialog-title">${t}</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -3650,7 +3683,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
</ha-button>
|
</ha-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
`}};V.styles=A`
|
`}};W.styles=T`
|
||||||
.dialog-title {
|
.dialog-title {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -3768,30 +3801,30 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
color: var(--text-primary-color, #fff);
|
color: var(--text-primary-color, #fff);
|
||||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
`,c([b({attribute:!1})],V.prototype,"hass",2),c([b()],V.prototype,"lang",2),c([u()],V.prototype,"_open",2),c([u()],V.prototype,"_loading",2),c([u()],V.prototype,"_error",2),c([u()],V.prototype,"_viewResult",2),c([u()],V.prototype,"_completeResult",2),c([u()],V.prototype,"_urlMode",2);customElements.get("maintenance-qr-dialog")||customElements.define("maintenance-qr-dialog",V)});var xs=w(()=>{"use strict"});function ws(r){let s=r.getFullYear(),e=String(r.getMonth()+1).padStart(2,"0"),t=String(r.getDate()).padStart(2,"0");return`${s}-${e}-${t}`}var $s=w(()=>{"use strict";xs()});function ks(r,s){let e=r.interval_analysis,t=e?.weibull_beta,i=e?.weibull_eta;if(t==null||i==null||i<=0)return h;let a=r.interval_days??0,l=r.suggested_interval??a;return o`
|
`,d([b({attribute:!1})],W.prototype,"hass",2),d([b()],W.prototype,"lang",2),d([u()],W.prototype,"_open",2),d([u()],W.prototype,"_loading",2),d([u()],W.prototype,"_error",2),d([u()],W.prototype,"_viewResult",2),d([u()],W.prototype,"_completeResult",2),d([u()],W.prototype,"_urlMode",2);customElements.get("maintenance-qr-dialog")||customElements.define("maintenance-qr-dialog",W)});var ks=w(()=>{"use strict"});function Es(r){let s=r.getFullYear(),e=String(r.getMonth()+1).padStart(2,"0"),t=String(r.getDate()).padStart(2,"0");return`${s}-${e}-${t}`}var Ss=w(()=>{"use strict";ks()});function Ts(r,s){let e=r.interval_analysis,t=e?.weibull_beta,i=e?.weibull_eta;if(t==null||i==null||i<=0)return h;let a=r.interval_days??0,l=r.suggested_interval??a;return o`
|
||||||
<div class="weibull-section">
|
<div class="weibull-section">
|
||||||
<div class="weibull-title">
|
<div class="weibull-title">
|
||||||
<ha-svg-icon aria-hidden="true" path="M3,14L3.5,14.07L8.07,9.5C7.89,8.85 8.06,8.11 8.59,7.59C9.37,6.8 10.63,6.8 11.41,7.59C11.94,8.11 12.11,8.85 11.93,9.5L14.5,12.07L15,12C15.18,12 15.35,12 15.5,12.07L19.07,8.5C19,8.35 19,8.18 19,8A2,2 0 0,1 21,6A2,2 0 0,1 23,8A2,2 0 0,1 21,10C20.82,10 20.65,10 20.5,9.93L16.93,13.5C17,13.65 17,13.82 17,14A2,2 0 0,1 15,16A2,2 0 0,1 13,14L13.07,13.5L10.5,10.93C10.18,11 9.82,11 9.5,10.93L4.93,15.5L5,16A2,2 0 0,1 3,18A2,2 0 0,1 1,16A2,2 0 0,1 3,14Z"></ha-svg-icon>
|
<ha-svg-icon aria-hidden="true" path="M3,14L3.5,14.07L8.07,9.5C7.89,8.85 8.06,8.11 8.59,7.59C9.37,6.8 10.63,6.8 11.41,7.59C11.94,8.11 12.11,8.85 11.93,9.5L14.5,12.07L15,12C15.18,12 15.35,12 15.5,12.07L19.07,8.5C19,8.35 19,8.18 19,8A2,2 0 0,1 21,6A2,2 0 0,1 23,8A2,2 0 0,1 21,10C20.82,10 20.65,10 20.5,9.93L16.93,13.5C17,13.65 17,13.82 17,14A2,2 0 0,1 15,16A2,2 0 0,1 13,14L13.07,13.5L10.5,10.93C10.18,11 9.82,11 9.5,10.93L4.93,15.5L5,16A2,2 0 0,1 3,18A2,2 0 0,1 1,16A2,2 0 0,1 3,14Z"></ha-svg-icon>
|
||||||
${n("weibull_reliability_curve",s)}
|
${n("weibull_reliability_curve",s)}
|
||||||
${Yr(t,s)}
|
${Zr(t,s)}
|
||||||
</div>
|
</div>
|
||||||
${Gr(t,i,a,l,s)}
|
${Xr(t,i,a,l,s)}
|
||||||
${Qr(e,s)}
|
${en(e,s)}
|
||||||
${e?.confidence_interval_low!=null?Jr(e,r,s):h}
|
${e?.confidence_interval_low!=null?tn(e,r,s):h}
|
||||||
</div>
|
</div>
|
||||||
`}function Yr(r,s){let e,t,i;return r<.8?(e="early_failures",t="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z",i="beta_early_failures"):r<=1.2?(e="random_failures",t="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,17H11V15H13V17M13,13H11V7H13V13Z",i="beta_random_failures"):r<=3.5?(e="wear_out",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,6A6,6 0 0,1 18,12H12V6Z",i="beta_wear_out"):(e="highly_predictable",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z",i="beta_highly_predictable"),o`
|
`}function Zr(r,s){let e,t,i;return r<.8?(e="early_failures",t="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z",i="beta_early_failures"):r<=1.2?(e="random_failures",t="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,17H11V15H13V17M13,13H11V7H13V13Z",i="beta_random_failures"):r<=3.5?(e="wear_out",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,6A6,6 0 0,1 18,12H12V6Z",i="beta_wear_out"):(e="highly_predictable",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z",i="beta_highly_predictable"),o`
|
||||||
<span class="beta-badge ${e}">
|
<span class="beta-badge ${e}">
|
||||||
<ha-svg-icon path="${t}"></ha-svg-icon>
|
<ha-svg-icon path="${t}"></ha-svg-icon>
|
||||||
${n(i,s)} (\u03B2=${N(r,s,2)})
|
${n(i,s)} (\u03B2=${N(r,s,2)})
|
||||||
</span>
|
</span>
|
||||||
`}function Gr(r,s,e,t,i){let y=Math.max(e,t,s,1)*1.3,m=50,$=[];for(let W=0;W<=m;W++){let Y=W/m*y,Vs=1-Math.exp(-Math.pow(Y/s,r)),Ws=32+Y/y*260,Ks=136-Vs*128;$.push([Ws,Ks])}let D=$.map(([W,Y])=>`${E(W)},${E(Y)}`).join(" "),I="M32,136 "+$.map(([W,Y])=>`L${E(W)},${E(Y)}`).join(" ")+` L${E($[m][0])},136 Z`,S=32+e/y*260,R=1-Math.exp(-Math.pow(e/s,r)),fe=136-R*128,Us=N((1-R)*100,i,0),si=32+t/y*260,Bs=[0,.25,.5,.75,1];return o`
|
`}function Xr(r,s,e,t,i){let y=Math.max(e,t,s,1)*1.3,m=50,$=[];for(let K=0;K<=m;K++){let Y=K/m*y,Ys=1-Math.exp(-Math.pow(Y/s,r)),Gs=32+Y/y*260,Qs=136-Ys*128;$.push([Gs,Qs])}let M=$.map(([K,Y])=>`${E(K)},${E(Y)}`).join(" "),I="M32,136 "+$.map(([K,Y])=>`L${E(K)},${E(Y)}`).join(" ")+` L${E($[m][0])},136 Z`,S=32+e/y*260,j=1-Math.exp(-Math.pow(e/s,r)),fe=136-j*128,Ws=N((1-j)*100,i,0),ri=32+t/y*260,Ks=[0,.25,.5,.75,1];return o`
|
||||||
<div class="weibull-chart">
|
<div class="weibull-chart">
|
||||||
<svg viewBox="0 0 ${300} ${160}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${n("chart_weibull",i)}">
|
<svg viewBox="0 0 ${300} ${160}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${n("chart_weibull",i)}">
|
||||||
${Bs.map(W=>{let Y=136-W*128;return ye`
|
${Ks.map(K=>{let Y=136-K*128;return ye`
|
||||||
<line x1="${32}" y1="${E(Y)}" x2="${292}" y2="${E(Y)}"
|
<line x1="${32}" y1="${E(Y)}" x2="${292}" y2="${E(Y)}"
|
||||||
stroke="var(--divider-color)" stroke-width="0.5" stroke-dasharray="${W===.5?"4,3":h}" />
|
stroke="var(--divider-color)" stroke-width="0.5" stroke-dasharray="${K===.5?"4,3":h}" />
|
||||||
<text x="${28}" y="${E(Y+3)}" fill="var(--secondary-text-color)"
|
<text x="${28}" y="${E(Y+3)}" fill="var(--secondary-text-color)"
|
||||||
font-size="8" text-anchor="end">${N(W*100,i,0)}%</text>
|
font-size="8" text-anchor="end">${N(K*100,i,0)}%</text>
|
||||||
`})}
|
`})}
|
||||||
|
|
||||||
<text x="${32}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">0</text>
|
<text x="${32}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">0</text>
|
||||||
@@ -3799,7 +3832,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<text x="${292}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">${Math.round(y)}</text>
|
<text x="${292}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">${Math.round(y)}</text>
|
||||||
|
|
||||||
<path d="${I}" fill="var(--primary-color, #03a9f4)" opacity="0.08" />
|
<path d="${I}" fill="var(--primary-color, #03a9f4)" opacity="0.08" />
|
||||||
<polyline points="${D}" fill="none"
|
<polyline points="${M}" fill="none"
|
||||||
stroke="var(--primary-color, #03a9f4)" stroke-width="2" />
|
stroke="var(--primary-color, #03a9f4)" stroke-width="2" />
|
||||||
|
|
||||||
${e>0?ye`
|
${e>0?ye`
|
||||||
@@ -3808,11 +3841,11 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<circle cx="${E(S)}" cy="${E(fe)}" r="3"
|
<circle cx="${E(S)}" cy="${E(fe)}" r="3"
|
||||||
fill="var(--primary-color, #03a9f4)" />
|
fill="var(--primary-color, #03a9f4)" />
|
||||||
<text x="${E(S+4)}" y="${E(fe-6)}" fill="var(--primary-color, #03a9f4)"
|
<text x="${E(S+4)}" y="${E(fe-6)}" fill="var(--primary-color, #03a9f4)"
|
||||||
font-size="9" font-weight="600">R=${Us}%</text>
|
font-size="9" font-weight="600">R=${Ws}%</text>
|
||||||
`:h}
|
`:h}
|
||||||
|
|
||||||
${t>0&&t!==e?ye`
|
${t>0&&t!==e?ye`
|
||||||
<line x1="${E(si)}" y1="${8}" x2="${E(si)}" y2="${E(136)}"
|
<line x1="${E(ri)}" y1="${8}" x2="${E(ri)}" y2="${E(136)}"
|
||||||
stroke="var(--success-color, #4caf50)" stroke-width="1.5" stroke-dasharray="4,3" />
|
stroke="var(--success-color, #4caf50)" stroke-width="1.5" stroke-dasharray="4,3" />
|
||||||
`:h}
|
`:h}
|
||||||
|
|
||||||
@@ -3827,7 +3860,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
${e>0?o`<span class="legend-item"><span class="legend-swatch" style="background:var(--primary-color, #03a9f4); opacity:0.5"></span> ${n("current_interval_marker",i)}</span>`:h}
|
${e>0?o`<span class="legend-item"><span class="legend-swatch" style="background:var(--primary-color, #03a9f4); opacity:0.5"></span> ${n("current_interval_marker",i)}</span>`:h}
|
||||||
${t>0&&t!==e?o`<span class="legend-item"><span class="legend-swatch" style="background:var(--success-color, #4caf50)"></span> ${n("recommended_marker",i)}</span>`:h}
|
${t>0&&t!==e?o`<span class="legend-item"><span class="legend-swatch" style="background:var(--success-color, #4caf50)"></span> ${n("recommended_marker",i)}</span>`:h}
|
||||||
</div>
|
</div>
|
||||||
`}function Qr(r,s){return o`
|
`}function en(r,s){return o`
|
||||||
<div class="weibull-info-row">
|
<div class="weibull-info-row">
|
||||||
<div class="weibull-info-item">
|
<div class="weibull-info-item">
|
||||||
<span>${n("characteristic_life",s)}</span>
|
<span>${n("characteristic_life",s)}</span>
|
||||||
@@ -3840,7 +3873,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
</div>
|
</div>
|
||||||
`:h}
|
`:h}
|
||||||
</div>
|
</div>
|
||||||
`}function Jr(r,s,e){let t=r.confidence_interval_low,i=r.confidence_interval_high,a=s.suggested_interval??s.interval_days??0,l=s.interval_days??0,d=Math.max(0,t-5),_=i+5-d,f=(t-d)/_*100,x=(i-t)/_*100,v=(a-d)/_*100,y=l>0?(l-d)/_*100:-1;return o`
|
`}function tn(r,s,e){let t=r.confidence_interval_low,i=r.confidence_interval_high,a=s.suggested_interval??s.interval_days??0,l=s.interval_days??0,c=Math.max(0,t-5),_=i+5-c,f=(t-c)/_*100,x=(i-t)/_*100,v=(a-c)/_*100,y=l>0?(l-c)/_*100:-1;return o`
|
||||||
<div class="confidence-range">
|
<div class="confidence-range">
|
||||||
<div class="confidence-range-title">
|
<div class="confidence-range-title">
|
||||||
${n("confidence_interval",e)}: ${a} ${n("days",e)} (${t}\u2013${i})
|
${n("confidence_interval",e)}: ${a} ${n("days",e)} (${t}\u2013${i})
|
||||||
@@ -3855,7 +3888,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<span class="confidence-text high">${n("confidence_aggressive",e)} (${i}${n("days",e).charAt(0)})</span>
|
<span class="confidence-text high">${n("confidence_aggressive",e)} (${i}${n("days",e).charAt(0)})</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}var Es=w(()=>{"use strict";P();j();ct()});function Ss(r,s,e){let t=r.degradation_trend!=null&&r.degradation_trend!=="insufficient_data",i=r.days_until_threshold!=null,a=r.environmental_factor!=null&&r.environmental_factor!==1;if(!t&&!i&&!a)return h;let l=r.degradation_trend==="rising"?"M16,6L18.29,8.29L13.41,13.17L9.41,9.17L2,16.59L3.41,18L9.41,12L13.41,16L19.71,9.71L22,12V6H16Z":r.degradation_trend==="falling"?"M16,18L18.29,15.71L13.41,10.83L9.41,14.83L2,7.41L3.41,6L9.41,12L13.41,8L19.71,14.29L22,12V18H16Z":"M22,12L18,8V11H3V13H18V16L22,12Z";return o`
|
`}var As=w(()=>{"use strict";P();L();ct()});function Cs(r,s,e){let t=r.degradation_trend!=null&&r.degradation_trend!=="insufficient_data",i=r.days_until_threshold!=null,a=r.environmental_factor!=null&&r.environmental_factor!==1;if(!t&&!i&&!a)return h;let l=r.degradation_trend==="rising"?"M16,6L18.29,8.29L13.41,13.17L9.41,9.17L2,16.59L3.41,18L9.41,12L13.41,16L19.71,9.71L22,12V6H16Z":r.degradation_trend==="falling"?"M16,18L18.29,15.71L13.41,10.83L9.41,14.83L2,7.41L3.41,6L9.41,12L13.41,8L19.71,14.29L22,12V18H16Z":"M22,12L18,8V11H3V13H18V16L22,12Z";return o`
|
||||||
<div class="prediction-section">
|
<div class="prediction-section">
|
||||||
${r.sensor_prediction_urgency?o`
|
${r.sensor_prediction_urgency?o`
|
||||||
<div class="prediction-urgency-banner">
|
<div class="prediction-urgency-banner">
|
||||||
@@ -3881,7 +3914,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<ha-svg-icon path="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z"></ha-svg-icon>
|
<ha-svg-icon path="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z"></ha-svg-icon>
|
||||||
<span class="prediction-label">${n("days_until_threshold",s)}</span>
|
<span class="prediction-label">${n("days_until_threshold",s)}</span>
|
||||||
<span class="prediction-value prediction-days${r.days_until_threshold===0?" exceeded":r.sensor_prediction_urgency?" urgent":""}">${r.days_until_threshold===0?n("threshold_exceeded",s):"~"+Math.round(r.days_until_threshold)+" "+n("days",s)}</span>
|
<span class="prediction-value prediction-days${r.days_until_threshold===0?" exceeded":r.sensor_prediction_urgency?" urgent":""}">${r.days_until_threshold===0?n("threshold_exceeded",s):"~"+Math.round(r.days_until_threshold)+" "+n("days",s)}</span>
|
||||||
${r.threshold_prediction_date?o`<span class="prediction-date">${K(r.threshold_prediction_date,s)}</span>`:h}
|
${r.threshold_prediction_date?o`<span class="prediction-date">${F(r.threshold_prediction_date,s)}</span>`:h}
|
||||||
${r.threshold_prediction_confidence?o`<span class="confidence-dot ${r.threshold_prediction_confidence}"></span>`:h}
|
${r.threshold_prediction_confidence?o`<span class="confidence-dot ${r.threshold_prediction_confidence}"></span>`:h}
|
||||||
${(r.prediction_cycles??0)>0?o`<span class="prediction-cycles">${n("prediction_cycles",s)}: ${r.prediction_cycles}</span>`:h}
|
${(r.prediction_cycles??0)>0?o`<span class="prediction-cycles">${n("prediction_cycles",s)}: ${r.prediction_cycles}</span>`:h}
|
||||||
</div>
|
</div>
|
||||||
@@ -3891,12 +3924,12 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<ha-svg-icon path="M15,13V5A3,3 0 0,0 12,2A3,3 0 0,0 9,5V13A5,5 0 0,0 7,17A5,5 0 0,0 12,22A5,5 0 0,0 17,17A5,5 0 0,0 15,13M12,4A1,1 0 0,1 13,5V8H11V5A1,1 0 0,1 12,4Z"></ha-svg-icon>
|
<ha-svg-icon path="M15,13V5A3,3 0 0,0 12,2A3,3 0 0,0 9,5V13A5,5 0 0,0 7,17A5,5 0 0,0 12,22A5,5 0 0,0 17,17A5,5 0 0,0 15,13M12,4A1,1 0 0,1 13,5V8H11V5A1,1 0 0,1 12,4Z"></ha-svg-icon>
|
||||||
<span class="prediction-label">${n("environmental_adjustment",s)}</span>
|
<span class="prediction-label">${n("environmental_adjustment",s)}</span>
|
||||||
<span class="prediction-value">${N(r.environmental_factor,s,2)}x</span>
|
<span class="prediction-value">${N(r.environmental_factor,s,2)}x</span>
|
||||||
${r.environmental_entity?o`<span class="prediction-entity entity-link" @click=${d=>Wi(d,r.environmental_entity)}>${r.environmental_entity}</span>`:h}
|
${r.environmental_entity?o`<span class="prediction-entity entity-link" @click=${c=>Ki(c,r.environmental_entity)}>${r.environmental_entity}</span>`:h}
|
||||||
</div>
|
</div>
|
||||||
`:h}
|
`:h}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}var As=w(()=>{"use strict";P();j()});function Ts(r,s,e,t){let i=Math.max(r||1,s);return o`
|
`}var Is=w(()=>{"use strict";P();L()});function Ps(r,s,e,t){let i=Math.max(r||1,s);return o`
|
||||||
<div class="interval-comparison">
|
<div class="interval-comparison">
|
||||||
<div class="interval-bar">
|
<div class="interval-bar">
|
||||||
<div class="interval-label">
|
<div class="interval-label">
|
||||||
@@ -3914,14 +3947,14 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
style="width: ${Math.min(s/i*100,100)}%"></div>
|
style="width: ${Math.min(s/i*100,100)}%"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}var Cs=w(()=>{"use strict";P();j()});function Ps(r,s,e){if(!e.seasonal||!r.seasonal_factor||r.seasonal_factor===1)return h;let t=Is.map(d=>n(d,s)),i=new Date().getMonth(),a=r.seasonal_factors||r.interval_analysis?.seasonal_factors||null,l=a&&a.length===12?a:t.map((d,p)=>{let _=r.seasonal_factor||1,f=Math.sin((p-6)*Math.PI/6)*.3;return Math.max(.7,Math.min(1.3,_+f))});return o`
|
`}var Ls=w(()=>{"use strict";P();L()});function js(r,s,e){if(!e.seasonal||!r.seasonal_factor||r.seasonal_factor===1)return h;let t=Rs.map(c=>n(c,s)),i=new Date().getMonth(),a=r.seasonal_factors||r.interval_analysis?.seasonal_factors||null,l=a&&a.length===12?a:t.map((c,p)=>{let _=r.seasonal_factor||1,f=Math.sin((p-6)*Math.PI/6)*.3;return Math.max(.7,Math.min(1.3,_+f))});return o`
|
||||||
<div class="seasonal-card-compact">
|
<div class="seasonal-card-compact">
|
||||||
<h4>${n("seasonal_awareness",s)}</h4>
|
<h4>${n("seasonal_awareness",s)}</h4>
|
||||||
<div class="seasonal-mini-chart">
|
<div class="seasonal-mini-chart">
|
||||||
${l.map((d,p)=>{let _=d*40,f=d<.9?"low":d>1.1?"high":"normal";return o`
|
${l.map((c,p)=>{let _=c*40,f=c<.9?"low":c>1.1?"high":"normal";return o`
|
||||||
<div class="seasonal-bar ${f} ${p===i?"current":""}"
|
<div class="seasonal-bar ${f} ${p===i?"current":""}"
|
||||||
style="height: ${_}px"
|
style="height: ${_}px"
|
||||||
title="${t[p]}: ${N(d,s,2)}x">
|
title="${t[p]}: ${N(c,s,2)}x">
|
||||||
</div>
|
</div>
|
||||||
`})}
|
`})}
|
||||||
</div>
|
</div>
|
||||||
@@ -3931,7 +3964,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<span class="legend-item"><span class="dot high"></span> ${n("longer",s)||"L\xE4nger"}</span>
|
<span class="legend-item"><span class="dot high"></span> ${n("longer",s)||"L\xE4nger"}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}function Ls(r,s){return Zr(r,s)}function Zr(r,s){let e=r.seasonal_factors??r.interval_analysis?.seasonal_factors;if(!e||e.length!==12)return h;let t=r.interval_analysis?.seasonal_reason,i=new Date().getMonth(),a=300,l=100,d=8,_=l-d-4,f=Math.max(...e,1.5),x=a/12,v=x*.65,y=d+_-1/f*_;return o`
|
`}function Ns(r,s){return sn(r,s)}function sn(r,s){let e=r.seasonal_factors??r.interval_analysis?.seasonal_factors;if(!e||e.length!==12)return h;let t=r.interval_analysis?.seasonal_reason,i=new Date().getMonth(),a=300,l=100,c=8,_=l-c-4,f=Math.max(...e,1.5),x=a/12,v=x*.65,y=c+_-1/f*_;return o`
|
||||||
<div class="seasonal-chart">
|
<div class="seasonal-chart">
|
||||||
<div class="seasonal-chart-title">
|
<div class="seasonal-chart-title">
|
||||||
<ha-svg-icon aria-hidden="true" path="M17.75 4.09L15.22 6.03L16.13 9.09L13.5 7.28L10.87 9.09L11.78 6.03L9.25 4.09L12.44 4L13.5 1L14.56 4L17.75 4.09M21.25 11L19.61 12.25L20.2 14.23L18.5 13.06L16.8 14.23L17.39 12.25L15.75 11L17.81 10.95L18.5 9L19.19 10.95L21.25 11M18.97 15.95C19.8 15.87 20.69 17.05 20.16 17.8C19.84 18.25 19.5 18.67 19.08 19.07C15.17 23 8.84 23 4.94 19.07C1.03 15.17 1.03 8.83 4.94 4.93C5.34 4.53 5.76 4.17 6.21 3.85C6.96 3.32 8.14 4.21 8.06 5.04C7.79 7.9 8.75 10.87 10.95 13.06C13.14 15.26 16.1 16.22 18.97 15.95Z"></ha-svg-icon>
|
<ha-svg-icon aria-hidden="true" path="M17.75 4.09L15.22 6.03L16.13 9.09L13.5 7.28L10.87 9.09L11.78 6.03L9.25 4.09L12.44 4L13.5 1L14.56 4L17.75 4.09M21.25 11L19.61 12.25L20.2 14.23L18.5 13.06L16.8 14.23L17.39 12.25L15.75 11L17.81 10.95L18.5 9L19.19 10.95L21.25 11M18.97 15.95C19.8 15.87 20.69 17.05 20.16 17.8C19.84 18.25 19.5 18.67 19.08 19.07C15.17 23 8.84 23 4.94 19.07C1.03 15.17 1.03 8.83 4.94 4.93C5.34 4.53 5.76 4.17 6.21 3.85C6.96 3.32 8.14 4.21 8.06 5.04C7.79 7.9 8.75 10.87 10.95 13.06C13.14 15.26 16.1 16.22 18.97 15.95Z"></ha-svg-icon>
|
||||||
@@ -3941,20 +3974,20 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<svg viewBox="0 0 ${a} ${l}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${n("chart_seasonal",s)}">
|
<svg viewBox="0 0 ${a} ${l}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${n("chart_seasonal",s)}">
|
||||||
<line x1="0" y1="${E(y)}" x2="${a}" y2="${E(y)}"
|
<line x1="0" y1="${E(y)}" x2="${a}" y2="${E(y)}"
|
||||||
stroke="var(--divider-color)" stroke-width="1" stroke-dasharray="4,3" />
|
stroke="var(--divider-color)" stroke-width="1" stroke-dasharray="4,3" />
|
||||||
${e.map((m,$)=>{let D=m/f*_,I=$*x+(x-v)/2,S=d+_-D,R=$===i,fe=m<1?"var(--success-color, #4caf50)":m>1?"var(--warning-color, #ff9800)":"var(--secondary-text-color)";return ye`
|
${e.map((m,$)=>{let M=m/f*_,I=$*x+(x-v)/2,S=c+_-M,j=$===i,fe=m<1?"var(--success-color, #4caf50)":m>1?"var(--warning-color, #ff9800)":"var(--secondary-text-color)";return ye`
|
||||||
<rect x="${E(I)}" y="${E(S)}"
|
<rect x="${E(I)}" y="${E(S)}"
|
||||||
width="${E(v)}" height="${E(D)}"
|
width="${E(v)}" height="${E(M)}"
|
||||||
fill="${fe}" opacity="${R?1:.5}" rx="2" />
|
fill="${fe}" opacity="${j?1:.5}" rx="2" />
|
||||||
`})}
|
`})}
|
||||||
</svg>
|
</svg>
|
||||||
<div class="seasonal-labels">
|
<div class="seasonal-labels">
|
||||||
${Is.map((m,$)=>o`<span class="seasonal-label ${$===i?"active-month":""}">${n(m,s)}</span>`)}
|
${Rs.map((m,$)=>o`<span class="seasonal-label ${$===i?"active-month":""}">${n(m,s)}</span>`)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}var Is,Rs=w(()=>{"use strict";P();j();ct();Is=["month_jan","month_feb","month_mar","month_apr","month_may","month_jun","month_jul","month_aug","month_sep","month_oct","month_nov","month_dec"]});var q,Ns=w(()=>{"use strict";P();M();j();le();$s();ot();nt();Ut();Fe();Jt();Es();As();Cs();Ee();Rs();q=class extends T{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1;this._currencySymbol=""}get _lang(){return H(this.hass)}async openFor(e,t){this._entryId=e,this._taskId=t,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=ws(new Date),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});e?.features&&(this._features={...this._features,...e.features}),this._currencySymbol=e?.budget?.currency_symbol||"",this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=e.object?.name||"";let t=(e.tasks||[]).find(i=>i.id===this._taskId);this._task=t??null}catch(e){this._error=C(e,this._lang)}}async _runWs(e){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(e),this._busy=!1,!0}catch(t){return this._error=C(t,this._lang),this._busy=!1,!1}}_notifyChanged(e){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:e},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(Z(),se)).then(async({openCompleteDialog:e})=>{let t=this._task,i=[];try{i=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0})).objects||[]}catch{}e(Ue({entryId:this._entryId,taskId:this._taskId,taskName:t.name,task:t,objects:i,lang:this._lang,checklist:t.checklist||[],adaptiveEnabled:!!t.adaptive_config?.enabled,currencySymbol:this._currencySymbol}))&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||Promise.resolve().then(()=>(Z(),se)).then(({openEditTaskDialog:e})=>{e(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(Z(),se)).then(({openQrDialog:e})=>{e({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let e=n("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(e))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let e=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",e),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=n("suggestion_applied",this._lang)||"Applied",this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){if(!(!this._entryId||!this._taskId)){thi
Line truncated
|
`}var Rs,qs=w(()=>{"use strict";P();L();ct();Rs=["month_jan","month_feb","month_mar","month_apr","month_may","month_jun","month_jul","month_aug","month_sep","month_oct","month_nov","month_dec"]});var q,Hs=w(()=>{"use strict";P();z();L();le();Ss();lt();at();Bt();Be();Zt();As();Is();Ls();Se();qs();q=class extends A{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1;this._currencySymbol=""}get _lang(){return H(this.hass)}async openFor(e,t){this._entryId=e,this._taskId=t,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=Es(new Date),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});e?.features&&(this._features={...this._features,...e.features}),this._currencySymbol=e?.budget?.currency_symbol||"",this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=e.object?.name||"";let t=(e.tasks||[]).find(i=>i.id===this._taskId);this._task=t??null}catch(e){this._error=C(e,this._lang)}}async _runWs(e){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(e),this._busy=!1,!0}catch(t){return this._error=C(t,this._lang),this._busy=!1,!1}}_notifyChanged(e){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:e},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(Z(),se)).then(async({openCompleteDialog:e})=>{let t=this._task,i=[];try{i=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0})).objects||[]}catch{}e(Ve({entryId:this._entryId,taskId:this._taskId,taskName:t.name,task:t,objects:i,lang:this._lang,checklist:t.checklist||[],adaptiveEnabled:!!t.adaptive_config?.enabled,currencySymbol:this._currencySymbol}))&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||Promise.resolve().then(()=>(Z(),se)).then(({openEditTaskDialog:e})=>{e(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(Z(),se)).then(({openQrDialog:e})=>{e({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let e=n("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(e))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let e=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",e),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=n("suggestion_applied",this._lang)||"Applied",this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){if(!(!this._entryId||!this._taskId)){thi
Line truncated
|
||||||
<div class="recommendation-card">
|
<div class="recommendation-card">
|
||||||
<h4>${n("suggested_interval",t)}</h4>
|
<h4>${n("suggested_interval",t)}</h4>
|
||||||
${Ts(e.interval_days,e.suggested_interval,e.interval_confidence||"medium",t)}
|
${Ps(e.interval_days,e.suggested_interval,e.interval_confidence||"medium",t)}
|
||||||
<div class="recommendation-actions">
|
<div class="recommendation-actions">
|
||||||
<button class="btn primary"
|
<button class="btn primary"
|
||||||
@click=${this._applySuggestion} ?disabled=${this._busy}>
|
@click=${this._applySuggestion} ?disabled=${this._busy}>
|
||||||
@@ -3968,25 +4001,25 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}_renderAdaptive(e){let t=this._lang,i=this._features.adaptive&&e.suggested_interval&&e.suggested_interval!==e.interval_days,a=e.degradation_trend!=null&&e.degradation_trend!=="insufficient_data"||e.days_until_threshold!=null||e.environmental_factor!=null&&e.environmental_factor!==1,l=this._features.adaptive&&e.interval_analysis?.weibull_beta!=null&&e.interval_analysis?.weibull_eta!=null,d=this._features.seasonal&&e.seasonal_factor&&e.seasonal_factor!==1;return!i&&!a&&!l&&!d?o`<div class="adaptive-empty">
|
`}_renderAdaptive(e){let t=this._lang,i=this._features.adaptive&&e.suggested_interval&&e.suggested_interval!==e.interval_days,a=e.degradation_trend!=null&&e.degradation_trend!=="insufficient_data"||e.days_until_threshold!=null||e.environmental_factor!=null&&e.environmental_factor!==1,l=this._features.adaptive&&e.interval_analysis?.weibull_beta!=null&&e.interval_analysis?.weibull_eta!=null,c=this._features.seasonal&&e.seasonal_factor&&e.seasonal_factor!==1;return!i&&!a&&!l&&!c?o`<div class="adaptive-empty">
|
||||||
${n("adaptive_no_data",t)||"Not enough completion history yet for adaptive analysis."}
|
${n("adaptive_no_data",t)||"Not enough completion history yet for adaptive analysis."}
|
||||||
</div>`:o`
|
</div>`:o`
|
||||||
<div class="adaptive-stack">
|
<div class="adaptive-stack">
|
||||||
${this._toast?o`<div class="toast">${this._toast}</div>`:h}
|
${this._toast?o`<div class="toast">${this._toast}</div>`:h}
|
||||||
${i?this._renderRecommendation(e):h}
|
${i?this._renderRecommendation(e):h}
|
||||||
${a?Ss(e,t,this._features):h}
|
${a?Cs(e,t,this._features):h}
|
||||||
${l?ks(e,t):h}
|
${l?Ts(e,t):h}
|
||||||
${d?o`
|
${c?o`
|
||||||
${Ps(e,t,this._features)}
|
${js(e,t,this._features)}
|
||||||
${e.seasonal_factors?.length===12||e.interval_analysis?.seasonal_factors?.length===12?Ls(e,t):h}
|
${e.seasonal_factors?.length===12||e.interval_analysis?.seasonal_factors?.length===12?Ns(e,t):h}
|
||||||
`:h}
|
`:h}
|
||||||
</div>
|
</div>
|
||||||
`}_renderHistoryReadings(e,t,i){let a=me(e),l=d=>N(d,i,{maximumFractionDigits:3});if(a.length>0)return o`<div class="history-readings">
|
`}_renderHistoryReadings(e,t,i){let a=me(e),l=c=>N(c,i,{maximumFractionDigits:3});if(a.length>0)return o`<div class="history-readings">
|
||||||
${a.map(d=>{let p=ts(t,e,d.id);return o`<span class="history-reading"><span class="history-reading-name">${d.name}</span>
|
${a.map(c=>{let p=is(t,e,c.id);return o`<span class="history-reading"><span class="history-reading-name">${c.name}</span>
|
||||||
<span class="history-reading-value">${l(d.value)}${d.unit?` ${d.unit}`:""}${p==null?"":` (${p>=0?"+":""}${l(p)})`}</span></span>`})}
|
<span class="history-reading-value">${l(c.value)}${c.unit?` ${c.unit}`:""}${p==null?"":` (${p>=0?"+":""}${l(p)})`}</span></span>`})}
|
||||||
</div>`;if(e.reading_value!=null){let d=this._task?.reading_unit?` ${this._task.reading_unit}`:"";return o`<div class="history-readings"><span class="history-reading">
|
</div>`;if(e.reading_value!=null){let c=this._task?.reading_unit?` ${this._task.reading_unit}`:"";return o`<div class="history-readings"><span class="history-reading">
|
||||||
<span class="history-reading-name">${n("reading_label",i)}</span>
|
<span class="history-reading-name">${n("reading_label",i)}</span>
|
||||||
<span class="history-reading-value">${l(e.reading_value)}${d}</span></span></div>`}return h}_renderDetails(e){let t=this._lang,i=e.history||[],a=i.filter(p=>p.type==="completed"),l=a.reduce((p,_)=>p+(typeof _.cost=="number"?_.cost:0),0),d=(()=>{let p=a.map(_=>typeof _.duration=="number"?_.duration:null).filter(_=>_!=null);return p.length?Math.round(p.reduce((_,f)=>_+f,0)/p.length):null})();return o`
|
<span class="history-reading-value">${l(e.reading_value)}${c}</span></span></div>`}return h}_renderDetails(e){let t=this._lang,i=e.history||[],a=i.filter(p=>p.type==="completed"),l=a.reduce((p,_)=>p+(typeof _.cost=="number"?_.cost:0),0),c=(()=>{let p=a.map(_=>typeof _.duration=="number"?_.duration:null).filter(_=>_!=null);return p.length?Math.round(p.reduce((_,f)=>_+f,0)/p.length):null})();return o`
|
||||||
<div class="details">
|
<div class="details">
|
||||||
<div class="stats-grid">
|
<div class="stats-grid">
|
||||||
<div class="stat">
|
<div class="stat">
|
||||||
@@ -3999,7 +4032,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
</div>
|
</div>
|
||||||
<div class="stat">
|
<div class="stat">
|
||||||
<span class="stat-label">${n("avg_duration",t)||"Avg duration"}</span>
|
<span class="stat-label">${n("avg_duration",t)||"Avg duration"}</span>
|
||||||
<span class="stat-value">${d!=null?`${d}m`:"\u2014"}</span>
|
<span class="stat-value">${c!=null?`${c}m`:"\u2014"}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="history-header">
|
<div class="history-header">
|
||||||
@@ -4012,7 +4045,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<div class="history-entry">
|
<div class="history-entry">
|
||||||
<div class="history-line">
|
<div class="history-line">
|
||||||
<span class="history-type type-${p.type}">${n(p.type,t)}</span>
|
<span class="history-type type-${p.type}">${n(p.type,t)}</span>
|
||||||
<span class="history-date">${Ui(p.timestamp,t)}</span>
|
<span class="history-date">${Bi(p.timestamp,t)}</span>
|
||||||
${_?o`<button class="history-edit"
|
${_?o`<button class="history-edit"
|
||||||
title="${n("history_edit_button",t)||"Edit"}"
|
title="${n("history_edit_button",t)||"Edit"}"
|
||||||
@click=${()=>this._onEditHistoryEntry(p)}>
|
@click=${()=>this._onEditHistoryEntry(p)}>
|
||||||
@@ -4021,7 +4054,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
</div>
|
</div>
|
||||||
${p.notes?o`<div class="history-notes">${p.notes}</div>`:h}
|
${p.notes?o`<div class="history-notes">${p.notes}</div>`:h}
|
||||||
${this._renderHistoryReadings(p,i,t)}
|
${this._renderHistoryReadings(p,i,t)}
|
||||||
${(()=>{let f=Ft(p);return f.length?o`<div class="history-photos">
|
${(()=>{let f=Ut(p);return f.length?o`<div class="history-photos">
|
||||||
${f.map(x=>o`<maintenance-history-photo .hass=${this.hass} .docId=${x}></maintenance-history-photo>`)}
|
${f.map(x=>o`<maintenance-history-photo .hass=${this.hass} .docId=${x}></maintenance-history-photo>`)}
|
||||||
</div>`:h})()}
|
</div>`:h})()}
|
||||||
${p.cost!=null||p.duration!=null?o`<div class="history-meta">
|
${p.cost!=null||p.duration!=null?o`<div class="history-meta">
|
||||||
@@ -4047,9 +4080,9 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<button class="link-inline" @click=${()=>{this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openObjectQuickActions:a})=>{a(this._entryId),this.close()})}}>${this._objectName}</button>
|
<button class="link-inline" @click=${()=>{this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openObjectQuickActions:a})=>{a(this._entryId),this.close()})}}>${this._objectName}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="quick-info">
|
<div class="quick-info">
|
||||||
${t.next_due?o`<span><strong>${n("next_due",e)||"Next due"}:</strong> ${K(t.next_due,e)}</span>`:h}
|
${t.next_due?o`<span><strong>${n("next_due",e)||"Next due"}:</strong> ${F(t.next_due,e)}</span>`:h}
|
||||||
${t.last_performed?o`<span><strong>${n("last_performed",e)||"Last"}:</strong> ${K(t.last_performed,e)}</span>`:h}
|
${t.last_performed?o`<span><strong>${n("last_performed",e)||"Last"}:</strong> ${F(t.last_performed,e)}</span>`:h}
|
||||||
${t.schedule?.kind&&!["manual","one_time"].includes(t.schedule.kind)||t.interval_days!=null?o`<span><strong>${n("interval",e)||"Interval"}:</strong> ${Vi(t,e)}</span>`:h}
|
${t.schedule?.kind&&!["manual","one_time"].includes(t.schedule.kind)||t.interval_days!=null?o`<span><strong>${n("interval",e)||"Interval"}:</strong> ${Wi(t,e)}</span>`:h}
|
||||||
${oe(t)?o`<span><strong>${n("phase_current",e)}:</strong> ${oe(t)}</span>`:h}
|
${oe(t)?o`<span><strong>${n("phase_current",e)}:</strong> ${oe(t)}</span>`:h}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -4149,7 +4182,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
`}
|
`}
|
||||||
`:o`<div class="loading">${n("loading",e)||"Loading\u2026"}</div>`}
|
`:o`<div class="loading">${n("loading",e)||"Loading\u2026"}</div>`}
|
||||||
</div>
|
</div>
|
||||||
`}};q.styles=[tt,A`
|
`}};q.styles=[it,T`
|
||||||
:host { display: contents; }
|
:host { display: contents; }
|
||||||
.backdrop {
|
.backdrop {
|
||||||
position: fixed; inset: 0; z-index: 100;
|
position: fixed; inset: 0; z-index: 100;
|
||||||
@@ -4338,7 +4371,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
.weibull-section, .seasonal-card-compact { max-width: 100%; }
|
.weibull-section, .seasonal-card-compact { max-width: 100%; }
|
||||||
.weibull-chart svg { max-width: 100%; height: auto; }
|
.weibull-chart svg { max-width: 100%; height: auto; }
|
||||||
.details-toggle { gap: 12px; flex-wrap: wrap; }
|
.details-toggle { gap: 12px; flex-wrap: wrap; }
|
||||||
`],c([b({attribute:!1})],q.prototype,"hass",2),c([u()],q.prototype,"_open",2),c([u()],q.prototype,"_entryId",2),c([u()],q.prototype,"_taskId",2),c([u()],q.prototype,"_task",2),c([u()],q.prototype,"_objectName",2),c([u()],q.prototype,"_busy",2),c([u()],q.prototype,"_error",2),c([u()],q.prototype,"_showSkip",2),c([u()],q.prototype,"_showReset",2),c([u()],q.prototype,"_showDetails",2),c([u()],q.prototype,"_showAdaptive",2),c([u()],q.prototype,"_skipReason",2),c([u()],q.prototype,"_resetDate",2),c([u()],q.prototype,"_features",2),c([u()],q.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",q)});function js(r){return r?customElements.get("ha-markdown")?o`<ha-markdown class="notes-md" .content=${r} breaks></ha-markdown>`:o`${r}`:h}var qs=w(()=>{"use strict";P()});var X,Hs=w(()=>{"use strict";P();jt();qs();M();j();le();X=class extends T{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return H(this.hass)}async openFor(e){this._entryId=e,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=e}catch(e){this._error=C(e,this._lang)}}_onEditObject(){!this._entryId||!this._data||Promise.resolve().then(()=>(Z(),se)).then(({openEditObjectDialog:e})=>{e(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openCreateTaskDialog:e})=>{e(this._entryId),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let e=n("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(e)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=C(t,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let e=!!this._data.object.archived;if(!e){let t=n("confirm_archive_object",this._lang)||"Archive this object and its tasks?";if(!window.confirm(t))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:e?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=C(t,this._lang)}finally{this._busy=!1}}_onTaskClick(e){this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openTaskQuickActions:t})=>{t(this._entryId,e)})}render(){if(!this._open)return h;let e=this._lang,t=this._data,i=t?.object,a=t?.tasks||[],l=this.hass?.user?.is_admin??!0;return o`
|
`],d([b({attribute:!1})],q.prototype,"hass",2),d([u()],q.prototype,"_open",2),d([u()],q.prototype,"_entryId",2),d([u()],q.prototype,"_taskId",2),d([u()],q.prototype,"_task",2),d([u()],q.prototype,"_objectName",2),d([u()],q.prototype,"_busy",2),d([u()],q.prototype,"_error",2),d([u()],q.prototype,"_showSkip",2),d([u()],q.prototype,"_showReset",2),d([u()],q.prototype,"_showDetails",2),d([u()],q.prototype,"_showAdaptive",2),d([u()],q.prototype,"_skipReason",2),d([u()],q.prototype,"_resetDate",2),d([u()],q.prototype,"_features",2),d([u()],q.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",q)});function Os(r){return r?customElements.get("ha-markdown")?o`<ha-markdown class="notes-md" .content=${r} breaks></ha-markdown>`:o`${r}`:h}var Ds=w(()=>{"use strict";P()});var X,Ms=w(()=>{"use strict";P();qt();Ds();z();L();le();X=class extends A{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return H(this.hass)}async openFor(e){this._entryId=e,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=e}catch(e){this._error=C(e,this._lang)}}_onEditObject(){!this._entryId||!this._data||Promise.resolve().then(()=>(Z(),se)).then(({openEditObjectDialog:e})=>{e(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openCreateTaskDialog:e})=>{e(this._entryId),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let e=n("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(e)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=C(t,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let e=!!this._data.object.archived;if(!e){let t=n("confirm_archive_object",this._lang)||"Archive this object and its tasks?";if(!window.confirm(t))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:e?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=C(t,this._lang)}finally{this._busy=!1}}_onTaskClick(e){this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openTaskQuickActions:t})=>{t(this._entryId,e)})}render(){if(!this._open)return h;let e=this._lang,t=this._data,i=t?.object,a=t?.tasks||[],l=this.hass?.user?.is_admin??!0;return o`
|
||||||
<div class="backdrop" @click=${this.close}></div>
|
<div class="backdrop" @click=${this.close}></div>
|
||||||
<div class="dialog" role="dialog" aria-modal="true">
|
<div class="dialog" role="dialog" aria-modal="true">
|
||||||
${t&&i?o`
|
${t&&i?o`
|
||||||
@@ -4356,11 +4389,11 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
</div>
|
</div>
|
||||||
${a.length===0?o`<div class="empty">${n("no_tasks",e)||"No tasks yet."}</div>`:o`
|
${a.length===0?o`<div class="empty">${n("no_tasks",e)||"No tasks yet."}</div>`:o`
|
||||||
<div class="task-list">
|
<div class="task-list">
|
||||||
${a.map(d=>o`
|
${a.map(c=>o`
|
||||||
<div class="task-row" @click=${()=>this._onTaskClick(d.id)}>
|
<div class="task-row" @click=${()=>this._onTaskClick(c.id)}>
|
||||||
<span class="status-dot" style="background: ${_e[d.status]||"#ccc"}"></span>
|
<span class="status-dot" style="background: ${_e[c.status]||"#ccc"}"></span>
|
||||||
<span class="task-name">${d.name}</span>
|
<span class="task-name">${c.name}</span>
|
||||||
<span class="task-status">${n(d.status||"ok",e)}</span>
|
<span class="task-status">${n(c.status||"ok",e)}</span>
|
||||||
</div>
|
</div>
|
||||||
`)}
|
`)}
|
||||||
</div>
|
</div>
|
||||||
@@ -4370,7 +4403,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
${i.notes?o`
|
${i.notes?o`
|
||||||
<div class="notes-section">
|
<div class="notes-section">
|
||||||
<strong>${n("object_notes_label",e)}</strong>
|
<strong>${n("object_notes_label",e)}</strong>
|
||||||
<div class="notes-body">${js(i.notes)}</div>
|
<div class="notes-body">${Os(i.notes)}</div>
|
||||||
</div>
|
</div>
|
||||||
`:h}
|
`:h}
|
||||||
|
|
||||||
@@ -4401,11 +4434,11 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
${i.map(([a,l])=>o`
|
${i.map(([a,l])=>o`
|
||||||
<div class="meta-item">
|
<div class="meta-item">
|
||||||
<span class="meta-label">${a}</span>
|
<span class="meta-label">${a}</span>
|
||||||
<span class="meta-value">${it(l)?o`<a href="${l}" target="_blank" rel="noopener noreferrer">${l}</a>`:l}</span>
|
<span class="meta-value">${st(l)?o`<a href="${l}" target="_blank" rel="noopener noreferrer">${l}</a>`:l}</span>
|
||||||
</div>
|
</div>
|
||||||
`)}
|
`)}
|
||||||
</div>
|
</div>
|
||||||
`}};X.styles=A`
|
`}};X.styles=T`
|
||||||
:host { display: contents; }
|
:host { display: contents; }
|
||||||
.backdrop {
|
.backdrop {
|
||||||
position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.5);
|
position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.5);
|
||||||
@@ -4465,7 +4498,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
.btn ha-icon { --mdc-icon-size: 16px; }
|
.btn ha-icon { --mdc-icon-size: 16px; }
|
||||||
.loading { padding: 24px; text-align: center; color: var(--secondary-text-color); }
|
.loading { padding: 24px; text-align: center; color: var(--secondary-text-color); }
|
||||||
.error { padding: 8px; border-radius: 6px; background: rgba(211,47,47,0.1); color: var(--error-color); font-size: 13px; }
|
.error { padding: 8px; border-radius: 6px; background: rgba(211,47,47,0.1); color: var(--error-color); font-size: 13px; }
|
||||||
`,c([b({attribute:!1})],X.prototype,"hass",2),c([u()],X.prototype,"_open",2),c([u()],X.prototype,"_entryId",2),c([u()],X.prototype,"_data",2),c([u()],X.prototype,"_busy",2),c([u()],X.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",X)});function Os(){let r=window;return r.__msSettingsCache??={promise:null}}function pt(r){let s=Os();if(s.promise)return s.promise;let e=r.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(t=>({features:t.features??Zt.features,defaultWarningDays:t.general?.default_warning_days??7,rowActionStyle:t.general?.row_action_style??Zt.rowActionStyle})).catch(()=>(s.promise===e&&(s.promise=null),Zt));return s.promise=e,e}function Ds(){Os().promise=null}var Zt,Ms=w(()=>{"use strict";Zt={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7,rowActionStyle:"buttons_compact"}});var se={};Gs(se,{__resetSettingsCacheForTests:()=>an,getRowActionStyle:()=>Xt,openCompleteDialog:()=>dn,openCreateObjectDialog:()=>ei,openCreateTaskDialog:()=>ti,openEditObjectDialog:()=>on,openEditTaskDialog:()=>ln,openHistoryEditDialog:()=>cn,openObjectQuickActions:()=>hn,openQrDialog:()=>pn,openTaskQuickActions:()=>ii});function ht(){return document.querySelector("home-assistant")?.hass}function nn(){return document.querySelector("home-assistant")?.shadowRoot??document.body}function re(r){let s=nn(),e=s.querySelector(r)??document.body.querySelector(r);return e?e.parentNode!==s&&s.appendChild(e):(e=document.createElement(r),s.appendChild(e)),e}function ne(r){let s=ht();if(!s)return!1;r.hass=s;let e=H(s);return Ct(e)||ze(e).then(()=>{r.requestUpdate?.()}),It(s.locale,s.config?.country),!0}function Xt(r){return pt(r).then(s=>s.rowActionStyle)}function an(){Ds()}function ei(){let r=re(zs);return ne(r)?(r.openCreate(),!0):!1}function on(r,s){let e=re(zs);return ne(e)?(e.openEdit(r,s),!0):!1}function ti(r="",s){let e=re(Fs);if(!ne(e))return!1;let t=ht();return t?((async()=>{let i=await pt(t),a=e;a.checklistsEnabled=i.features.checklists,a.scheduleTimeEnabled=i.features.schedule_time,a.completionActionsEnabled=i.features.completion_actions,a.defaultWarningDays=i.defaultWarningDays,a.openCreate(r,s)})(),!0):!1}function ln(r,s){let e=re(Fs);if(!ne(e))return!1;let t=ht();return t?((async()=>{try{let[i,a]=await Promise.all([t.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:r}),pt(t)]),l=(i.tasks||[]).find(p=>p.id===s);if(!l){console.warn(`openEditTaskDialog: task ${s} not found in entry ${r}`);return}let d=e;d.checklistsEnabled=a.features.checklists,d.scheduleTimeEnabled=a.features.schedule_time,d.completionActionsEnabled=a.features.completion_actions,d.defaultWarningDays=a.defaultWarningDays,await d.openEdit(r,l)}catch(i){console.warn("openEditTaskDialog: failed to load task/features",i)}})(),!0):!1}function cn(r){let s=re(Xr);return ne(s)?(s.openEdit(r),!0):!1}function dn(r){let s=re(en);return ne(s)?(Be(s,r,ht()?.language||"en"),!0):!1}function pn(r){let s=re(tn);return ne(s)?(s.openForTask(r.entry_id,r.task_id,r.object_name,r.task_name),!0):!1}function ii(r,s){let e=re(sn);return ne(e)?(e.openFor(r,s),!0):!1}function hn(r){let s=re(rn);return ne(s)?(s.openFor(r),!0):!1}var zs,Fs,Xr,en,tn,sn,rn,Z=w(()=>{"use strict";ps();fs();Vt();vs();ys();Ns();Hs();j();ot();Ms();zs="maintenance-object-dialog",Fs="maintenance-task-dialog",Xr="maintenance-history-edit-dialog",en="maintenance-complete-dialog",tn="maintenance-qr-dialog",sn="maintenance-task-quick-actions-dialog",rn="maintenance-object-quick-actions-dialog"});P();var cr=["assignee_pool","required_completion_fields","checklist","labels","history","readings"],dr=["checklist_progress"],pr=["tasks","parts"],hr=["manual_docs","battery_fleet_excluded"];function St(r,s,e=[]){for(let t of s)r[t]===void 0&&(r[t]=[]);for(let t of e)r[t]===void 0&&(r[t]={})}function ur(r){let s=r;St(s,pr),s.object&&typeof s.object=="object"&&St(s.object,hr);for(let e of s.tasks)St(e,cr,dr);return r}function He(r){for(let s of r)ur(s);return r}function _r(r,s){if(s.objects)return s.objects;let e=s.delta||[],t=s.removed||[];if(!e.length&&!t.length)return null;let i=new Map(r.map(a=>[a.entry_id,a]));for(let a of e)i.set(a.entry_id,a);for(let a of t)i.delete(a);return[...i.values()]}function ki(r,s){return s.objects&&He(s.objects),s.delta&&He(s.delta),_r(r,s)}M();j();Nt();jt();function st(r){let s=window;s.customCards=s.customCards||[],s.customCards.some(e=>e.type===r.type)||s.customCards.push(r)}Ot();Ht();nt();ot();P();M();j();var Ir=["overdue","triggered","due_soon","ok"],Q=class extends T{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._objects=[];this._loadingObjects=!0;this._loadError=!1;this._views=[];this._objectsLoaded=!1;this._onEntitiesChanged=e=>{this._valueChanged("entity_ids",e.detail.value
Line truncated
|
`,d([b({attribute:!1})],X.prototype,"hass",2),d([u()],X.prototype,"_open",2),d([u()],X.prototype,"_entryId",2),d([u()],X.prototype,"_data",2),d([u()],X.prototype,"_busy",2),d([u()],X.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",X)});function zs(){let r=window;return r.__msSettingsCache??={promise:null}}function ht(r){let s=zs();if(s.promise)return s.promise;let e=r.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(t=>({features:t.features??Xt.features,defaultWarningDays:t.general?.default_warning_days??7,rowActionStyle:t.general?.row_action_style??Xt.rowActionStyle})).catch(()=>(s.promise===e&&(s.promise=null),Xt));return s.promise=e,e}function Fs(){zs().promise=null}var Xt,Us=w(()=>{"use strict";Xt={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7,rowActionStyle:"buttons_compact"}});var se={};Zs(se,{__resetSettingsCacheForTests:()=>cn,getRowActionStyle:()=>ei,openCompleteDialog:()=>_n,openCreateObjectDialog:()=>ti,openCreateTaskDialog:()=>ii,openEditObjectDialog:()=>pn,openEditTaskDialog:()=>hn,openHistoryEditDialog:()=>un,openObjectQuickActions:()=>mn,openQrDialog:()=>gn,openTaskQuickActions:()=>si});function ut(){return document.querySelector("home-assistant")?.hass}function dn(){return document.querySelector("home-assistant")?.shadowRoot??document.body}function re(r){let s=dn(),e=s.querySelector(r)??document.body.querySelector(r);return e?e.parentNode!==s&&s.appendChild(e):(e=document.createElement(r),s.appendChild(e)),e}function ne(r){let s=ut();if(!s)return!1;r.hass=s;let e=H(s);return It(e)||Ue(e).then(()=>{r.requestUpdate?.()}),Pt(s.locale,s.config?.country),!0}function ei(r){return ht(r).then(s=>s.rowActionStyle)}function cn(){Fs()}function ti(){let r=re(Bs);return ne(r)?(r.openCreate(),!0):!1}function pn(r,s){let e=re(Bs);return ne(e)?(e.openEdit(r,s),!0):!1}function ii(r="",s){let e=re(Vs);if(!ne(e))return!1;let t=ut();return t?((async()=>{let i=await ht(t),a=e;a.checklistsEnabled=i.features.checklists,a.scheduleTimeEnabled=i.features.schedule_time,a.completionActionsEnabled=i.features.completion_actions,a.defaultWarningDays=i.defaultWarningDays,a.openCreate(r,s)})(),!0):!1}function hn(r,s){let e=re(Vs);if(!ne(e))return!1;let t=ut();return t?((async()=>{try{let[i,a]=await Promise.all([t.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:r}),ht(t)]),l=(i.tasks||[]).find(p=>p.id===s);if(!l){console.warn(`openEditTaskDialog: task ${s} not found in entry ${r}`);return}let c=e;c.checklistsEnabled=a.features.checklists,c.scheduleTimeEnabled=a.features.schedule_time,c.completionActionsEnabled=a.features.completion_actions,c.defaultWarningDays=a.defaultWarningDays,await c.openEdit(r,l)}catch(i){console.warn("openEditTaskDialog: failed to load task/features",i)}})(),!0):!1}function un(r){let s=re(rn);return ne(s)?(s.openEdit(r),!0):!1}function _n(r){let s=re(nn);return ne(s)?(We(s,r,ut()?.language||"en"),!0):!1}function gn(r){let s=re(an);return ne(s)?(s.openForTask(r.entry_id,r.task_id,r.object_name,r.task_name),!0):!1}function si(r,s){let e=re(on);return ne(e)?(e.openFor(r,s),!0):!1}function mn(r){let s=re(ln);return ne(s)?(s.openFor(r),!0):!1}var Bs,Vs,rn,nn,an,on,ln,Z=w(()=>{"use strict";_s();ys();Wt();xs();$s();Hs();Ms();L();lt();Us();Bs="maintenance-object-dialog",Vs="maintenance-task-dialog",rn="maintenance-history-edit-dialog",nn="maintenance-complete-dialog",an="maintenance-qr-dialog",on="maintenance-task-quick-actions-dialog",ln="maintenance-object-quick-actions-dialog"});P();var hr=["assignee_pool","required_completion_fields","checklist","labels","history","readings"],ur=["checklist_progress"],_r=["tasks","parts"],gr=["manual_docs","battery_fleet_excluded"];function Tt(r,s,e=[]){for(let t of s)r[t]===void 0&&(r[t]=[]);for(let t of e)r[t]===void 0&&(r[t]={})}function mr(r){let s=r;Tt(s,_r),s.object&&typeof s.object=="object"&&Tt(s.object,gr);for(let e of s.tasks)Tt(e,hr,ur);return r}function Oe(r){for(let s of r)mr(s);return r}function fr(r,s){if(s.objects)return s.objects;let e=s.delta||[],t=s.removed||[];if(!e.length&&!t.length)return null;let i=new Map(r.map(a=>[a.entry_id,a]));for(let a of e)i.set(a.entry_id,a);for(let a of t)i.delete(a);return[...i.values()]}function Ei(r,s){return s.objects&&Oe(s.objects),s.delta&&Oe(s.delta),fr(r,s)}z();L();Nt();qt();function rt(r){let s=window;s.customCards=s.customCards||[],s.customCards.some(e=>e.type===r.type)||s.customCards.push(r)}Dt();Ot();at();lt();P();z();L();var Rr=["overdue","triggered","due_soon","ok"],Q=class extends A{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._objects=[];this._loadingObjects=!0;this._loadError=!1;this._views=[];this._objectsLoaded=!1;this._onEntitiesChanged=e=>{this._valueChanged("entity_ids",e.detail.value
Line truncated
|
||||||
<div class="editor">
|
<div class="editor">
|
||||||
<ha-textfield
|
<ha-textfield
|
||||||
label="${n("card_title",e)}"
|
label="${n("card_title",e)}"
|
||||||
@@ -4477,7 +4510,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="field-label">${n("card_filter_status",e)}</div>
|
<div class="field-label">${n("card_filter_status",e)}</div>
|
||||||
<div class="chip-row">
|
<div class="chip-row">
|
||||||
${Ir.map(m=>o`
|
${Rr.map(m=>o`
|
||||||
<label class="chip ${t.has(m)?"active":""}">
|
<label class="chip ${t.has(m)?"active":""}">
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
.checked=${t.has(m)}
|
.checked=${t.has(m)}
|
||||||
@@ -4645,7 +4678,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
></ha-textfield>
|
></ha-textfield>
|
||||||
${h}
|
${h}
|
||||||
</div>
|
</div>
|
||||||
`}};Q.styles=A`
|
`}};Q.styles=T`
|
||||||
.editor {
|
.editor {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -4724,23 +4757,23 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
max-width: 320px;
|
max-width: 320px;
|
||||||
}
|
}
|
||||||
`,c([b({attribute:!1})],Q.prototype,"hass",2),c([u()],Q.prototype,"_config",2),c([u()],Q.prototype,"_objects",2),c([u()],Q.prototype,"_loadingObjects",2),c([u()],Q.prototype,"_loadError",2),c([u()],Q.prototype,"_views",2);customElements.get("maintenance-supporter-card-editor")||customElements.define("maintenance-supporter-card-editor",Q);Vt();P();M();P();M();j();var Wt={printOptions:"msp-print-options",overviewTab:"msp-overview-tab",collapsedSections:"msp-collapsed-sections",chartRange:"msp-chart-range",chartHideOutliers:"msp-chart-hide-outliers",taskSort:"maintenance_supporter_sort",objectSort:"maintenance_supporter_object_sort",groupBy:"maintenance_supporter_groupby",objectView:"maintenance_supporter_object_view",objectsCache:"msp-objects-cache",gettingStartedDismissed:"msp-gs-dismissed",batteryRosterSort:"ms_bf_roster_sort"};function cs(r){try{return localStorage.getItem(r)}catch{return null}}function ds(r,s){try{localStorage.setItem(r,s)}catch{}}le();ct();var F=class F extends T{constructor(){super(...arguments);this.flat=!1;this._ov=null;this._loading=!1;this._marking=!1;this._error="";this._history=null;this._rosterSort=F._storedSort();this._typeFilter=null;this._recorded=[];this._historyRequested=!1;this._localeReady=!1;this._markAll=async()=>{await this._mark(void 0)};this._repair=async()=>{if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/setup",language:this._lang}),await this._load()}catch(e){this._error=C(e,this._lang)}finally{this._marking=!1}}};this._loadHistory=async e=>{if(!(!e.target.open||this._historyRequested)){this._historyRequested=!0;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/overview_history"});this._history=t.series}catch{this._history=null}}}}get _lang(){return H(this.hass)}connectedCallback(){super.connectedCallback(),this.hass&&this._load()}updated(e){et(this,e),e.has("hass")&&this.hass&&!this._localeReady&&(this._localeReady=!0,ze(this._lang).then(()=>this.requestUpdate()),this._ov===null&&!this._loading&&this._load())}async _load(){this._loading=!0,this._error="";try{this._ov=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/overview"})}catch(e){this._error=C(e,this._lang)}finally{this._loading=!1}}async _mark(e){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/mark_replaced",...e?{entity_ids:e}:{}}),await this._load()}catch(t){this._error=C(t,this._lang)}finally{this._marking=!1}}}async _setExcluded(e,t){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/set_excluded",entity_id:e,excluded:t}),await this._load()}catch(i){this._error=C(i,this._lang)}finally{this._marking=!1}}}async _addBattery(e){let t=e.detail?.value;if(!(!t||this._marking)){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/set_included",entity_id:t,included:!0}),await this._load()}catch(i){this._error=C(i,this._lang)}finally{this._marking=!1}}}async _setTrackSelf(e){await this._setFleetOption("set_track_self_charging",e.target.checked)}async _setDueWithoutSensor(e){await this._setFleetOption("set_due_without_sensor",e.target.checked)}async _setFleetOption(e,t){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:`maintenance_supporter/battery_fleet/${e}`,enabled:t}),await this._load()}catch(i){this._error=C(i,this._lang)}finally{this._marking=!1}}}_sparkline(e){let t=this._history?.[e.entity_id];if(!t||t.points.length<2)return h;let i=110,a=24,l=2,d=t.points[0][0],p=t.points[t.points.length-1][0],_=Date.now()/1e3,f=e.status!=="low"&&e.predicted_source==="trend"&&e.days_until!=null?_+e.days_until*86400:null,x=Math.max(p,f??p),v=I=>x===d?l:l+(I-d)/(x-d)*(i-2*l),y=I=>l+(1-Math.min(100,Math.max(0,I))/100)*(a-2*l),m=t.points.map(([I,S])=>`${E(v(I))},${E(y(S))}`).join(" "),$=t.points[t.points.length-1][1],D=E(y(t.threshold));return o`<svg
|
`,d([b({attribute:!1})],Q.prototype,"hass",2),d([u()],Q.prototype,"_config",2),d([u()],Q.prototype,"_objects",2),d([u()],Q.prototype,"_loadingObjects",2),d([u()],Q.prototype,"_loadError",2),d([u()],Q.prototype,"_views",2);customElements.get("maintenance-supporter-card-editor")||customElements.define("maintenance-supporter-card-editor",Q);Wt();P();z();P();z();L();var Kt={printOptions:"msp-print-options",overviewTab:"msp-overview-tab",collapsedSections:"msp-collapsed-sections",chartRange:"msp-chart-range",chartHideOutliers:"msp-chart-hide-outliers",taskSort:"maintenance_supporter_sort",objectSort:"maintenance_supporter_object_sort",groupBy:"maintenance_supporter_groupby",objectView:"maintenance_supporter_object_view",objectsCache:"msp-objects-cache",gettingStartedDismissed:"msp-gs-dismissed",batteryRosterSort:"ms_bf_roster_sort"};function hs(r){try{return localStorage.getItem(r)}catch{return null}}function us(r,s){try{localStorage.setItem(r,s)}catch{}}le();ct();var B=class B extends A{constructor(){super(...arguments);this.flat=!1;this._ov=null;this._loading=!1;this._marking=!1;this._error="";this._history=null;this._rosterSort=B._storedSort();this._typeFilter=null;this._recorded=[];this._historyRequested=!1;this._localeReady=!1;this._markAll=async()=>{await this._mark(void 0)};this._repair=async()=>{if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/setup",language:this._lang}),await this._load()}catch(e){this._error=C(e,this._lang)}finally{this._marking=!1}}};this._loadHistory=async e=>{if(!(!e.target.open||this._historyRequested)){this._historyRequested=!0;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/overview_history"});this._history=t.series}catch{this._history=null}}}}get _lang(){return H(this.hass)}connectedCallback(){super.connectedCallback(),this.hass&&this._load()}updated(e){tt(this,e),e.has("hass")&&this.hass&&!this._localeReady&&(this._localeReady=!0,Ue(this._lang).then(()=>this.requestUpdate()),this._ov===null&&!this._loading&&this._load())}async _load(){this._loading=!0,this._error="";try{this._ov=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/overview"})}catch(e){this._error=C(e,this._lang)}finally{this._loading=!1}}async _mark(e){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/mark_replaced",...e?{entity_ids:e}:{}}),await this._load()}catch(t){this._error=C(t,this._lang)}finally{this._marking=!1}}}async _setExcluded(e,t){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/set_excluded",entity_id:e,excluded:t}),await this._load()}catch(i){this._error=C(i,this._lang)}finally{this._marking=!1}}}async _addBattery(e){let t=e.detail?.value;if(!(!t||this._marking)){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/set_included",entity_id:t,included:!0}),await this._load()}catch(i){this._error=C(i,this._lang)}finally{this._marking=!1}}}async _setTrackSelf(e){await this._setFleetOption("set_track_self_charging",e.target.checked)}async _setDueWithoutSensor(e){await this._setFleetOption("set_due_without_sensor",e.target.checked)}async _setFleetOption(e,t){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:`maintenance_supporter/battery_fleet/${e}`,enabled:t}),await this._load()}catch(i){this._error=C(i,this._lang)}finally{this._marking=!1}}}_sparkline(e){let t=this._history?.[e.entity_id];if(!t||t.points.length<2)return h;let i=110,a=24,l=2,c=t.points[0][0],p=t.points[t.points.length-1][0],_=Date.now()/1e3,f=e.status!=="low"&&e.predicted_source==="trend"&&e.days_until!=null?_+e.days_until*86400:null,x=Math.max(p,f??p),v=I=>x===c?l:l+(I-c)/(x-c)*(i-2*l),y=I=>l+(1-Math.min(100,Math.max(0,I))/100)*(a-2*l),m=t.points.map(([I,S])=>`${E(v(I))},${E(y(S))}`).join(" "),$=t.points[t.points.length-1][1],M=E(y(t.threshold));return o`<svg
|
||||||
class="bf-spark"
|
class="bf-spark"
|
||||||
viewBox="0 0 ${i} ${a}"
|
viewBox="0 0 ${i} ${a}"
|
||||||
role="img"
|
role="img"
|
||||||
aria-label=${n("battery_fleet_sparkline_hint",this._lang)}
|
aria-label=${n("battery_fleet_sparkline_hint",this._lang)}
|
||||||
>
|
>
|
||||||
<title>${n("battery_fleet_sparkline_hint",this._lang)}</title>
|
<title>${n("battery_fleet_sparkline_hint",this._lang)}</title>
|
||||||
<line class="bf-spark-th" x1="0" y1=${D} x2=${i} y2=${D}></line>
|
<line class="bf-spark-th" x1="0" y1=${M} x2=${i} y2=${M}></line>
|
||||||
<polyline class="bf-spark-line" points=${m}></polyline>
|
<polyline class="bf-spark-line" points=${m}></polyline>
|
||||||
${f!==null?o`<line
|
${f!==null?o`<line
|
||||||
class="bf-spark-proj"
|
class="bf-spark-proj"
|
||||||
x1=${E(v(p))}
|
x1=${E(v(p))}
|
||||||
y1=${E(y($))}
|
y1=${E(y($))}
|
||||||
x2=${E(v(f))}
|
x2=${E(v(f))}
|
||||||
y2=${D}
|
y2=${M}
|
||||||
></line>`:h}
|
></line>`:h}
|
||||||
</svg>`}static _storedSort(){return cs(Wt.batteryRosterSort)==="name"?"name":"urgency"}_setSort(e){this._rosterSort=e,ds(Wt.batteryRosterSort,e)}_sortedRoster(e){let t=this._typeFilter===null?e:e.filter(a=>a.battery_type===this._typeFilter);if(this._rosterSort==="name")return t;let i=a=>a.status==="low"?-1e3+(a.level??101)/101:a.days_until??1/0;return[...t].sort((a,l)=>i(a)-i(l)||a.device_name.localeCompare(l.device_name))}_predictedDate(e){return this._fmtDate(Date.now()+e*864e5)}_fmtDate(e){let t=new Date(e),i=a=>String(a).padStart(2,"0");return K(`${t.getFullYear()}-${i(t.getMonth()+1)}-${i(t.getDate())}`,this._lang)}_shoppingLine(e){return Object.entries(e).map(([t,i])=>o`<button
|
</svg>`}static _storedSort(){return hs(Kt.batteryRosterSort)==="name"?"name":"urgency"}_setSort(e){this._rosterSort=e,us(Kt.batteryRosterSort,e)}_sortedRoster(e){let t=this._typeFilter===null?e:e.filter(a=>a.battery_type===this._typeFilter);if(this._rosterSort==="name")return t;let i=a=>a.status==="low"?-1e3+(a.level??101)/101:a.days_until??1/0;return[...t].sort((a,l)=>i(a)-i(l)||a.device_name.localeCompare(l.device_name))}_predictedDate(e){return this._fmtDate(Date.now()+e*864e5)}_fmtDate(e){let t=new Date(e),i=a=>String(a).padStart(2,"0");return F(`${t.getFullYear()}-${i(t.getMonth()+1)}-${i(t.getDate())}`,this._lang)}_shoppingLine(e){return Object.entries(e).map(([t,i])=>o`<button
|
||||||
class="bf-type-chip ${this._typeFilter===t?"bf-type-chip-active":""}"
|
class="bf-type-chip ${this._typeFilter===t?"bf-type-chip-active":""}"
|
||||||
title=${n("battery_fleet_filter_type",this._lang)}
|
title=${n("battery_fleet_filter_type",this._lang)}
|
||||||
@click=${()=>this._toggleTypeFilter(t)}
|
@click=${()=>this._toggleTypeFilter(t)}
|
||||||
@@ -4932,7 +4965,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
`:h}
|
`:h}
|
||||||
<div class="bf-total">${n("battery_fleet_total",e).replace("{n}",String(t.total))}</div>
|
<div class="bf-total">${n("battery_fleet_total",e).replace("{n}",String(t.total))}</div>
|
||||||
</div>
|
</div>
|
||||||
`}};F.styles=A`
|
`}};B.styles=T`
|
||||||
.bf-card {
|
.bf-card {
|
||||||
background: var(--card-background-color, #fff);
|
background: var(--card-background-color, #fff);
|
||||||
border: 1px solid var(--divider-color);
|
border: 1px solid var(--divider-color);
|
||||||
@@ -5342,20 +5375,20 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
accent-color: var(--primary-color);
|
accent-color: var(--primary-color);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
`,c([b({attribute:!1})],F.prototype,"hass",2),c([b({type:Boolean})],F.prototype,"flat",2),c([u()],F.prototype,"_ov",2),c([u()],F.prototype,"_loading",2),c([u()],F.prototype,"_marking",2),c([u()],F.prototype,"_error",2),c([u()],F.prototype,"_history",2),c([u()],F.prototype,"_rosterSort",2),c([u()],F.prototype,"_typeFilter",2),c([u()],F.prototype,"_recorded",2);var Kt=F;customElements.get("maintenance-battery-fleet-section")||customElements.define("maintenance-battery-fleet-section",Kt);var Se=class extends T{constructor(){super(...arguments);this._config={type:"custom:maintenance-battery-fleet-card"}}static getStubConfig(){return{type:"custom:maintenance-battery-fleet-card"}}setConfig(e){this._config=e}getCardSize(){return 6}render(){return this.hass?o`
|
`,d([b({attribute:!1})],B.prototype,"hass",2),d([b({type:Boolean})],B.prototype,"flat",2),d([u()],B.prototype,"_ov",2),d([u()],B.prototype,"_loading",2),d([u()],B.prototype,"_marking",2),d([u()],B.prototype,"_error",2),d([u()],B.prototype,"_history",2),d([u()],B.prototype,"_rosterSort",2),d([u()],B.prototype,"_typeFilter",2),d([u()],B.prototype,"_recorded",2);var Yt=B;customElements.get("maintenance-battery-fleet-section")||customElements.define("maintenance-battery-fleet-section",Yt);var Te=class extends A{constructor(){super(...arguments);this._config={type:"custom:maintenance-battery-fleet-card"}}static getStubConfig(){return{type:"custom:maintenance-battery-fleet-card"}}setConfig(e){this._config=e}getCardSize(){return 6}render(){return this.hass?o`
|
||||||
<ha-card .header=${this._config.title||void 0}>
|
<ha-card .header=${this._config.title||void 0}>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<maintenance-battery-fleet-section flat .hass=${this.hass}></maintenance-battery-fleet-section>
|
<maintenance-battery-fleet-section flat .hass=${this.hass}></maintenance-battery-fleet-section>
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
`:h}};Se.styles=A`
|
`:h}};Te.styles=T`
|
||||||
ha-card {
|
ha-card {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
padding: 12px 16px 14px;
|
padding: 12px 16px 14px;
|
||||||
}
|
}
|
||||||
`,c([b({attribute:!1})],Se.prototype,"hass",2),c([u()],Se.prototype,"_config",2);customElements.get("maintenance-battery-fleet-card")||customElements.define("maintenance-battery-fleet-card",Se);st({type:"maintenance-battery-fleet-card",name:"Battery Fleet",description:"All tracked batteries: what is low now, what runs out soon, and what to buy.",preview:!1});Z();var B=class extends T{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._globalRowStyle="buttons_compact";this._objects=[];this._stats=null;this._unsub=null;this._viewFilters=null;this._userNames={};this._userPersons={};this._userService=null;this._userNamesLoaded=!1;this._taskDocs={};this._docsLoadedFor=new Set;this._dataLoaded=!1;this._lastConnection=null;this._onCompleted=async()=>{await this._loadData()}}get _lang(){return H(this.hass)}static getConfigElement(){return document.createElement("maintenance-supporter-card-editor")}static getStubConfig(){return{type:"custom:maintenance-supporter-card",show_header:!0,show_actions:!0,filter_status:["overdue","triggered","due_soon"],max_items:10}}setConfig(e){let t=e.view_id!==this._config.view_id;this._config=e,t&&this._dataLoaded&&this.hass&&this._loadViewFilters()}getCardSize(){return 3}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._unsub&&(this._unsub(),this._unsub=null),this._dataLoaded=!1,this._lastConnection=null}updated(e){if(super.updated(e),et(this,e),this.hass&&!this._userNamesLoaded&&this._config.show_assignee!==!1&&this._objects.some(t=>t.tasks.some(i=>i.responsible_user_id))&&this._loadUserNames(),this.hass&&this._config.show_documents!==!1)for(let t of this._objects)this._docsLoadedFor.has(t.entry_id)||t.tasks.some(i=>(i.document_count??0)>0)&&this._loadDocuments(t.entry_id);if(e.has("hass")&&this.hass){if(!this._dataLoaded)this._dataLoaded=!0,this._lastConnection=this.hass.connection,this._loadData(),this._subscribe();else if(this.hass.connection!==this._lastConnection){if(this._lastConnection=this.hass.connection,this._unsub){try{this._unsub()}catch{}this._unsub=null}this._subscribe(),this._loadData()}}}async _loadData(){Xt(this.hass).then(e=>{this._globalRowStyle=e}).catch(()=>{});try{let[e,t]=await Promise.all([this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0}),this.hass.connection.sendMessagePromise({type:"maintenance_supporter/statistics"})]);this._objects=He(e.objects),this._stats=t}catch{}await this._loadViewFilters()}_assigneeName(e){if(this._config.show_assignee===!1)return"";let t=e.responsible_user_id;return t&&this._userNames[t]||""}async _loadUserNames(){this._userNamesLoaded=!0,this._userService?this._userService.updateHass(this.hass):this._userService=new $e(this.hass);try{let e=await this._userService.getUsers();this._userPersons=Object.fromEntries(e.map(t=>[t.id,rt(t)])),this._userNames=Object.fromEntries(e.map(t=>[t.id,t.name]))}catch{}}async _loadDocuments(e){this._docsLoadedFor.add(e);try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/documents/list",entry_id:e}),i={};for(let a of t.documents||[])for(let l of a.task_ids||[])(i[l]||=[]).push({id:a.id,title:a.title,kind:a.kind,url:a.url});this._taskDocs={...this._taskDocs,[e]:i}}catch{}}_docsFor(e,t){if(this._config.show_documents===!1)return[];let a=[...this._taskDocs[e]?.[t.id]||[]];return t.documentation_url&&a.push({id:`url:${t.id}`,title:n("documentation_label",this._lang),kind:"weblink",url:t.documentation_url}),a}async _openDoc(e){if(e.kind==="weblink"&&e.url){it(e.url)&&window.open(e.url,"_blank","noopener");return}try{await Gi(this.hass,e.id)}catch{}}async _loadViewFilters(){if(!this._config.view_id){this._viewFilters=null;return}try{let t=((await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/views/list"})).views||[]).find(i=>i.id===this._config.view_id);this._viewFilters=t?t.filters:null}catch{this._viewFilters=null}}async _subscribe(){try{let e=await this.hass.connection.subscribeMessage(t=>{let i=ki(this._objects,t);i!==null&&(this._objects=i)},{type:"maintenance_supporter/subscribe",deltas:!0,compact:!0});if(!this.isConnected){e();return}this._unsub=e}catch{}}get _flatTasks(){let e=[],{filter_status:t,filter_objects:i,entity_ids:a,filter_due_min_days:l,filter_due_max_days:d,filter_labels:p,filter_priority:_,filter_areas:f,max_items:x}=this._config,v=a?.length?new Set(a):null,y=l!==void 0||d!==void 0,m=this._viewFilters,$=m?.user_id==="current_user"?this.hass.user?.id??null:m?.user_id??null;for(let I of this._objects)if(!(i?.length&&!i.includes(I.object.name))){if(f?.length){let S=I.object.area_id;if(!S||!f.includes(S))continue}for(let S of I.tasks)if(!S.is_done&&!(S.archived||I.object.archived)&&!(t?.length&&!t.includes(S.status))&&!(p?.length&&!(S.labels||[]).some(R=>p.includes(R)))&&!(_?.length&&!_.includes(S.priority||"normal"))&&!(v&&!(S.sensor_entity_id&&v.has(S.sensor_entity_id)||S.binary_sensor_entity_
Line truncated
|
`,d([b({attribute:!1})],Te.prototype,"hass",2),d([u()],Te.prototype,"_config",2);customElements.get("maintenance-battery-fleet-card")||customElements.define("maintenance-battery-fleet-card",Te);rt({type:"maintenance-battery-fleet-card",name:"Battery Fleet",description:"All tracked batteries: what is low now, what runs out soon, and what to buy.",preview:!1});Z();var V=class extends A{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._globalRowStyle="buttons_compact";this._objects=[];this._stats=null;this._unsub=null;this._viewFilters=null;this._userNames={};this._userPersons={};this._userService=null;this._userNamesLoaded=!1;this._taskDocs={};this._docsLoadedFor=new Set;this._dataLoaded=!1;this._lastConnection=null;this._onCompleted=async()=>{await this._loadData()}}get _lang(){return H(this.hass)}static getConfigElement(){return document.createElement("maintenance-supporter-card-editor")}static getStubConfig(){return{type:"custom:maintenance-supporter-card",show_header:!0,show_actions:!0,filter_status:["overdue","triggered","due_soon"],max_items:10}}setConfig(e){let t=e.view_id!==this._config.view_id;this._config=e,t&&this._dataLoaded&&this.hass&&this._loadViewFilters()}getCardSize(){return 3}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._unsub&&(this._unsub(),this._unsub=null),this._dataLoaded=!1,this._lastConnection=null}updated(e){if(super.updated(e),tt(this,e),this.hass&&!this._userNamesLoaded&&this._config.show_assignee!==!1&&this._objects.some(t=>t.tasks.some(i=>i.responsible_user_id))&&this._loadUserNames(),this.hass&&this._config.show_documents!==!1)for(let t of this._objects)this._docsLoadedFor.has(t.entry_id)||t.tasks.some(i=>(i.document_count??0)>0)&&this._loadDocuments(t.entry_id);if(e.has("hass")&&this.hass){if(!this._dataLoaded)this._dataLoaded=!0,this._lastConnection=this.hass.connection,this._loadData(),this._subscribe();else if(this.hass.connection!==this._lastConnection){if(this._lastConnection=this.hass.connection,this._unsub){try{this._unsub()}catch{}this._unsub=null}this._subscribe(),this._loadData()}}}async _loadData(){ei(this.hass).then(e=>{this._globalRowStyle=e}).catch(()=>{});try{let[e,t]=await Promise.all([this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0}),this.hass.connection.sendMessagePromise({type:"maintenance_supporter/statistics"})]);this._objects=Oe(e.objects),this._stats=t}catch{}await this._loadViewFilters()}_assigneeName(e){if(this._config.show_assignee===!1)return"";let t=e.responsible_user_id;return t&&this._userNames[t]||""}async _loadUserNames(){this._userNamesLoaded=!0,this._userService?this._userService.updateHass(this.hass):this._userService=new $e(this.hass);try{let e=await this._userService.getUsers();this._userPersons=Object.fromEntries(e.map(t=>[t.id,nt(t)])),this._userNames=Object.fromEntries(e.map(t=>[t.id,t.name]))}catch{}}async _loadDocuments(e){this._docsLoadedFor.add(e);try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/documents/list",entry_id:e}),i={};for(let a of t.documents||[])for(let l of a.task_ids||[])(i[l]||=[]).push({id:a.id,title:a.title,kind:a.kind,url:a.url});this._taskDocs={...this._taskDocs,[e]:i}}catch{}}_docsFor(e,t){if(this._config.show_documents===!1)return[];let a=[...this._taskDocs[e]?.[t.id]||[]];return t.documentation_url&&a.push({id:`url:${t.id}`,title:n("documentation_label",this._lang),kind:"weblink",url:t.documentation_url}),a}async _openDoc(e){if(e.kind==="weblink"&&e.url){st(e.url)&&window.open(e.url,"_blank","noopener");return}try{await Qi(this.hass,e.id)}catch{}}async _loadViewFilters(){if(!this._config.view_id){this._viewFilters=null;return}try{let t=((await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/views/list"})).views||[]).find(i=>i.id===this._config.view_id);this._viewFilters=t?t.filters:null}catch{this._viewFilters=null}}async _subscribe(){try{let e=await this.hass.connection.subscribeMessage(t=>{let i=Ei(this._objects,t);i!==null&&(this._objects=i)},{type:"maintenance_supporter/subscribe",deltas:!0,compact:!0});if(!this.isConnected){e();return}this._unsub=e}catch{}}get _flatTasks(){let e=[],{filter_status:t,filter_objects:i,entity_ids:a,filter_due_min_days:l,filter_due_max_days:c,filter_labels:p,filter_priority:_,filter_areas:f,max_items:x}=this._config,v=a?.length?new Set(a):null,y=l!==void 0||c!==void 0,m=this._viewFilters,$=m?.user_id==="current_user"?this.hass.user?.id??null:m?.user_id??null;for(let I of this._objects)if(!(i?.length&&!i.includes(I.object.name))){if(f?.length){let S=I.object.area_id;if(!S||!f.includes(S))continue}for(let S of I.tasks)if(!S.is_done&&!(S.archived||I.object.archived)&&!(t?.length&&!t.includes(S.status))&&!(p?.length&&!(S.labels||[]).some(j=>p.includes(j)))&&!(_?.length&&!_.includes(S.priority||"normal"))&&!(v&&!(S.sensor_entity_id&&v.has(S.sensor_entity_id)||S.binary_sensor_entity_
Line truncated
|
||||||
<ha-card>
|
<ha-card>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h1>${t}</h1>
|
<h1>${t}</h1>
|
||||||
@@ -5371,14 +5404,14 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<mwc-icon-button
|
<mwc-icon-button
|
||||||
class="hdr-add"
|
class="hdr-add"
|
||||||
title="${n("new_object",e)}"
|
title="${n("new_object",e)}"
|
||||||
@click=${()=>ei()}
|
@click=${()=>ti()}
|
||||||
>
|
>
|
||||||
<ha-icon icon="mdi:plus-box"></ha-icon>
|
<ha-icon icon="mdi:plus-box"></ha-icon>
|
||||||
</mwc-icon-button>
|
</mwc-icon-button>
|
||||||
<mwc-icon-button
|
<mwc-icon-button
|
||||||
class="hdr-add"
|
class="hdr-add"
|
||||||
title="${n("add_task",e)}"
|
title="${n("add_task",e)}"
|
||||||
@click=${()=>ti("",this._objects)}
|
@click=${()=>ii("",this._objects)}
|
||||||
>
|
>
|
||||||
<ha-icon icon="mdi:playlist-plus"></ha-icon>
|
<ha-icon icon="mdi:playlist-plus"></ha-icon>
|
||||||
</mwc-icon-button>
|
</mwc-icon-button>
|
||||||
@@ -5393,7 +5426,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<div>${n("card_no_tasks_title",e)}</div>
|
<div>${n("card_no_tasks_title",e)}</div>
|
||||||
<a class="empty-link" href="/maintenance-supporter">${n("card_no_tasks_cta",e)}</a>
|
<a class="empty-link" href="/maintenance-supporter">${n("card_no_tasks_cta",e)}</a>
|
||||||
</div>`:o`
|
</div>`:o`
|
||||||
<div class="task-list ${d?"compact":""}">
|
<div class="task-list ${c?"compact":""}">
|
||||||
${p.map(({entry_id:f,object_name:x,task:v})=>o`
|
${p.map(({entry_id:f,object_name:x,task:v})=>o`
|
||||||
<div class="task-item clickable"
|
<div class="task-item clickable"
|
||||||
@click=${()=>this._openTaskDetail(f,v.id)}
|
@click=${()=>this._openTaskDetail(f,v.id)}
|
||||||
@@ -5408,11 +5441,11 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
title="${n("postponed",e)||"Postponed"}"
|
title="${n("postponed",e)||"Postponed"}"
|
||||||
></ha-icon>`:h}
|
></ha-icon>`:h}
|
||||||
</div>
|
</div>
|
||||||
${d?this._assigneeName(v)?o`<div class="task-meta compact-assignee" title="${this._assigneeName(v)}">
|
${c?this._assigneeName(v)?o`<div class="task-meta compact-assignee" title="${this._assigneeName(v)}">
|
||||||
${qt(this._userPersons[v.responsible_user_id])}${this._assigneeName(v)}
|
${Ht(this._userPersons[v.responsible_user_id])}${this._assigneeName(v)}
|
||||||
</div>`:h:o`<div class="task-meta">
|
</div>`:h:o`<div class="task-meta">
|
||||||
${x} · ${n(v.type,e)}${oe(v)?o` · ${oe(v)}`:h}${this._assigneeName(v)?o` · <span class="assignee"
|
${x} · ${n(v.type,e)}${oe(v)?o` · ${oe(v)}`:h}${this._assigneeName(v)?o` · <span class="assignee"
|
||||||
>${qt(this._userPersons[v.responsible_user_id])}${this._assigneeName(v)}</span
|
>${Ht(this._userPersons[v.responsible_user_id])}${this._assigneeName(v)}</span
|
||||||
>`:h}
|
>`:h}
|
||||||
</div>`}
|
</div>`}
|
||||||
</div>
|
</div>
|
||||||
@@ -5430,7 +5463,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
`)}
|
`)}
|
||||||
</div>`:h}
|
</div>`:h}
|
||||||
<div class="task-due">
|
<div class="task-due">
|
||||||
${v.days_until_due!==null&&v.days_until_due!==void 0?v.days_until_due<0?o`<span class="overdue-text">${Pt(v.days_until_due,e)}</span>`:Pt(v.days_until_due,e):v.trigger_active?"\u26A1":"\u2014"}
|
${v.days_until_due!==null&&v.days_until_due!==void 0?v.days_until_due<0?o`<span class="overdue-text">${Lt(v.days_until_due,e)}</span>`:Lt(v.days_until_due,e):v.trigger_active?"\u26A1":"\u2014"}
|
||||||
</div>
|
</div>
|
||||||
${l&&a?o`
|
${l&&a?o`
|
||||||
<ha-button
|
<ha-button
|
||||||
@@ -5439,7 +5472,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
variant="success"
|
variant="success"
|
||||||
class="complete-btn-text"
|
class="complete-btn-text"
|
||||||
title="${n("complete",e)}"
|
title="${n("complete",e)}"
|
||||||
@click=${y=>{y.stopPropagation();let m=this.shadowRoot.querySelector("maintenance-complete-dialog");Be(m,Ue({entryId:f,taskId:v.id,taskName:v.name,task:v,objects:this._objects,lang:e,checklist:v.checklist||[],adaptiveEnabled:!!v.adaptive_config?.enabled,currencySymbol:this._stats?.budget?.currency_symbol||""}),e)}}
|
@click=${y=>{y.stopPropagation();let m=this.shadowRoot.querySelector("maintenance-complete-dialog");We(m,Ve({entryId:f,taskId:v.id,taskName:v.name,task:v,objects:this._objects,lang:e,checklist:v.checklist||[],adaptiveEnabled:!!v.adaptive_config?.enabled,currencySymbol:this._stats?.budget?.currency_symbol||""}),e)}}
|
||||||
>
|
>
|
||||||
<ha-icon slot="start" icon="mdi:check"></ha-icon>${n("complete",e)}
|
<ha-icon slot="start" icon="mdi:check"></ha-icon>${n("complete",e)}
|
||||||
</ha-button>
|
</ha-button>
|
||||||
@@ -5447,7 +5480,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
<mwc-icon-button
|
<mwc-icon-button
|
||||||
class="complete-btn"
|
class="complete-btn"
|
||||||
title="${n("complete",e)}"
|
title="${n("complete",e)}"
|
||||||
@click=${y=>{y.stopPropagation();let m=this.shadowRoot.querySelector("maintenance-complete-dialog");Be(m,Ue({entryId:f,taskId:v.id,taskName:v.name,task:v,objects:this._objects,lang:e,checklist:v.checklist||[],adaptiveEnabled:!!v.adaptive_config?.enabled,currencySymbol:this._stats?.budget?.currency_symbol||""}),e)}}
|
@click=${y=>{y.stopPropagation();let m=this.shadowRoot.querySelector("maintenance-complete-dialog");We(m,Ve({entryId:f,taskId:v.id,taskName:v.name,task:v,objects:this._objects,lang:e,checklist:v.checklist||[],adaptiveEnabled:!!v.adaptive_config?.enabled,currencySymbol:this._stats?.budget?.currency_symbol||""}),e)}}
|
||||||
>
|
>
|
||||||
<ha-icon icon="mdi:check"></ha-icon>
|
<ha-icon icon="mdi:check"></ha-icon>
|
||||||
</mwc-icon-button>
|
</mwc-icon-button>
|
||||||
@@ -5461,7 +5494,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@task-completed=${this._onCompleted}
|
@task-completed=${this._onCompleted}
|
||||||
></maintenance-complete-dialog>
|
></maintenance-complete-dialog>
|
||||||
`}};B.styles=[tt,A`
|
`}};V.styles=[it,T`
|
||||||
ha-card { overflow: hidden; }
|
ha-card { overflow: hidden; }
|
||||||
|
|
||||||
.card-header {
|
.card-header {
|
||||||
@@ -5598,7 +5631,7 @@ ${p?`<div class="sub">${p}</div>`:""}
|
|||||||
/* DESIGN PROTOTYPE (#145): action_style: buttons — HA-native labelled button. */
|
/* DESIGN PROTOTYPE (#145): action_style: buttons — HA-native labelled button. */
|
||||||
.complete-btn-text { --ha-button-font-size: 13px; flex: none; white-space: nowrap; }
|
.complete-btn-text { --ha-button-font-size: 13px; flex: none; white-space: nowrap; }
|
||||||
.complete-btn-text ha-icon { --mdc-icon-size: 18px; }
|
.complete-btn-text ha-icon { --mdc-icon-size: 18px; }
|
||||||
`],c([b({attribute:!1})],B.prototype,"hass",2),c([u()],B.prototype,"_config",2),c([u()],B.prototype,"_globalRowStyle",2),c([u()],B.prototype,"_objects",2),c([u()],B.prototype,"_stats",2),c([u()],B.prototype,"_unsub",2),c([u()],B.prototype,"_viewFilters",2),c([u()],B.prototype,"_userNames",2),c([u()],B.prototype,"_taskDocs",2);customElements.get("maintenance-supporter-card")||customElements.define("maintenance-supporter-card",B);st({type:"maintenance-supporter-card",name:"Maintenance Supporter",description:"Overview of your maintenance tasks with quick actions.",preview:!0});export{B as MaintenanceSupporterCard};
|
`],d([b({attribute:!1})],V.prototype,"hass",2),d([u()],V.prototype,"_config",2),d([u()],V.prototype,"_globalRowStyle",2),d([u()],V.prototype,"_objects",2),d([u()],V.prototype,"_stats",2),d([u()],V.prototype,"_unsub",2),d([u()],V.prototype,"_viewFilters",2),d([u()],V.prototype,"_userNames",2),d([u()],V.prototype,"_taskDocs",2);customElements.get("maintenance-supporter-card")||customElements.define("maintenance-supporter-card",V);rt({type:"maintenance-supporter-card",name:"Maintenance Supporter",description:"Overview of your maintenance tasks with quick actions.",preview:!0});export{V as MaintenanceSupporterCard};
|
||||||
/*! Bundled license information:
|
/*! Bundled license information:
|
||||||
|
|
||||||
@lit/reactive-element/css-tag.js:
|
@lit/reactive-element/css-tag.js:
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -1,2 +1,2 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
var v="2.80.0";var f="maintenance-supporter",A=`ll-strategy-dashboard-${f}`,L="hui-maintenance-supporter-strategy-editor",D=["maintenance-supporter-section","maintenance-supporter-vacation","maintenance-supporter-budget","maintenance-supporter-groups"],I=`/maintenance_supporter_strategy/maintenance-dashboard-strategy.js?v=${v}`,w=null;function h(){return w||(w=import(I)),w}async function M(){let e=await h();if(!e.MaintenanceDashboardStrategy)throw new Error("[maintenance-supporter] strategy bundle loaded but did not export MaintenanceDashboardStrategy");return e.MaintenanceDashboardStrategy}async function B(e){let i=(await h()).SECTION_STRATEGIES?.[e];if(!i)throw new Error(`[maintenance-supporter] strategy bundle loaded but has no section strategy "${e}"`);return i}function O(e){return class extends HTMLElement{static async generate(i,l){return(await B(e)).generate(i,l)}}}var y=class extends HTMLElement{static getCreateSuggestions(s){return{title:"Maintenance Supporter",icon:"mdi:wrench-clock"}}static async getConfigElement(){return await h(),document.createElement(L)}static async generate(s,i){return(await M()).generate(s,i)}};function P(){try{customElements.define(A,y)}catch{}for(let e of D)try{customElements.define(`ll-strategy-section-${e}`,O(e))}catch{}}P();var g=window;g.customStrategies=g.customStrategies||[];var U=[{type:f,strategyType:"dashboard",name:"Maintenance Supporter",description:"Auto-generated dashboard. Group views by area, status, floor, or due date \u2014 picked from the strategy editor or YAML.",documentationURL:"https://github.com/iluebbe/maintenance_supporter#dashboard-strategy"},{type:"maintenance-supporter-section",strategyType:"section",name:"Maintenance Supporter \u2014 Section",description:"Embed maintenance tasks (filterable by area, status, due date) as a section in any dashboard view.",documentationURL:"https://github.com/iluebbe/maintenance_supporter#section-strategy"},{type:"maintenance-supporter-vacation",strategyType:"section",name:"Maintenance Supporter \u2014 Vacation Status",description:"Compact vacation-mode status banner. Tap to open settings in the panel."},{type:"maintenance-supporter-budget",strategyType:"section",name:"Maintenance Supporter \u2014 Budget Status",description:"Monthly + yearly maintenance budget overview. Tap for details."},{type:"maintenance-supporter-groups",strategyType:"section",name:"Maintenance Supporter \u2014 Groups",description:"List of configured task groups with member counts."}];for(let e of U)g.customStrategies.some(s=>s.type===e.type&&s.strategyType===e.strategyType)||g.customStrategies.push(e);(()=>{let e=window;if(e.__msStrategyHealActive)return;e.__msStrategyHealActive=!0;let s=/^\/(auth|config|developer-tools|profile|hassio|history|logbook|map|media-browser|energy|todo|calendar)\b/,i=/Timeout waiting for strategy element ll-strategy-(dashboard-)?maintenance-supporter/i,l=`custom:${f}`;function S(r){let t=[document.documentElement],a=0;for(;t.length&&a<9e3;){let o=t.pop();if(a++,!o)continue;let n=o;if(n.nodeType===1&&n.tagName&&n.tagName.toLowerCase()===r)return n;n.shadowRoot&&t.push(n.shadowRoot);let u=o.children;if(u)for(let p of Array.from(u))t.push(p)}return null}function R(r){let t=r?.views;if(!Array.isArray(t)||!t.length)return null;let a=window.location.pathname.split("/").filter(Boolean).pop()||"",o=t.find(u=>u?.path===a);if(o)return o;let n=Number(a);return Number.isInteger(n)&&t[n]?t[n]:t[0]}function k(){try{let t=S("ha-panel-lovelace")?.lovelace;if(!t)return!1;let a=o=>o?.type;for(let o of[t.config,t.rawConfig]){if(!o)continue;if(a(o.strategy)===l)return!0;let n=R(o);if(n&&a(n.strategy)===l)return!0}return!1}catch{return!1}}function T(){let r=!1,t=0,a=!1,o=!1,n=[document.documentElement],u=0;for(;n.length&&u<9e3;){let p=n.pop();if(u++,!p)continue;let d=p;if(d.nodeType===1&&d.tagName){let c=d.tagName.toLowerCase();(c==="hui-view"||c==="hui-sections-view")&&(r=!0),(c==="ha-card"||c==="hui-card")&&t++,c==="hui-empty-state-card"&&(o=!0),c==="hui-error-card"&&i.test(d.textContent||"")&&(a=!0)}d.shadowRoot&&n.push(d.shadowRoot);let _=p.children;if(_)for(let c of Array.from(_))n.push(c)}return a?!0:o?!1:r&&t<3&&k()}let N="/maintenance_supporter_strategy_shim.js",E=0,b=0;function C(){let r=Date.now();r-b<5e3||E>=3||(b=r,E+=1,import(`${N}?heal=${r}`).catch(()=>{}).finally(()=>{let t=window.location.pathname+window.location.search;history.pushState(null,"","/lovelace"),window.dispatchEvent(new CustomEvent("location-changed")),window.setTimeout(()=>{history.pushState(null,"",t),window.dispatchEvent(new CustomEvent("location-changed"))},200)}))}function m(){if(s.test(window.location.pathname))return;let r=0,t=Date.now(),a=window.setInterval(()=>{r++;try{if(Date.now()-t<6e3)return;if(s.test(window.location.pathname)){window.clearInterval(a);return}T()?C():window.clearInterval(a),r>=30&&window.clearInterval(a)}catch{window.clearInterval(a)}},500)}try{document.readyState==="loading"?window.addEventListener("DOMContentLoaded",m):m(),wLine truncated
|
var v="2.82.0";var f="maintenance-supporter",A=`ll-strategy-dashboard-${f}`,L="hui-maintenance-supporter-strategy-editor",D=["maintenance-supporter-section","maintenance-supporter-vacation","maintenance-supporter-budget","maintenance-supporter-groups"],I=`/maintenance_supporter_strategy/maintenance-dashboard-strategy.js?v=${v}`,w=null;function h(){return w||(w=import(I)),w}async function M(){let e=await h();if(!e.MaintenanceDashboardStrategy)throw new Error("[maintenance-supporter] strategy bundle loaded but did not export MaintenanceDashboardStrategy");return e.MaintenanceDashboardStrategy}async function B(e){let i=(await h()).SECTION_STRATEGIES?.[e];if(!i)throw new Error(`[maintenance-supporter] strategy bundle loaded but has no section strategy "${e}"`);return i}function O(e){return class extends HTMLElement{static async generate(i,l){return(await B(e)).generate(i,l)}}}var y=class extends HTMLElement{static getCreateSuggestions(s){return{title:"Maintenance Supporter",icon:"mdi:wrench-clock"}}static async getConfigElement(){return await h(),document.createElement(L)}static async generate(s,i){return(await M()).generate(s,i)}};function P(){try{customElements.define(A,y)}catch{}for(let e of D)try{customElements.define(`ll-strategy-section-${e}`,O(e))}catch{}}P();var g=window;g.customStrategies=g.customStrategies||[];var U=[{type:f,strategyType:"dashboard",name:"Maintenance Supporter",description:"Auto-generated dashboard. Group views by area, status, floor, or due date \u2014 picked from the strategy editor or YAML.",documentationURL:"https://github.com/iluebbe/maintenance_supporter#dashboard-strategy"},{type:"maintenance-supporter-section",strategyType:"section",name:"Maintenance Supporter \u2014 Section",description:"Embed maintenance tasks (filterable by area, status, due date) as a section in any dashboard view.",documentationURL:"https://github.com/iluebbe/maintenance_supporter#section-strategy"},{type:"maintenance-supporter-vacation",strategyType:"section",name:"Maintenance Supporter \u2014 Vacation Status",description:"Compact vacation-mode status banner. Tap to open settings in the panel."},{type:"maintenance-supporter-budget",strategyType:"section",name:"Maintenance Supporter \u2014 Budget Status",description:"Monthly + yearly maintenance budget overview. Tap for details."},{type:"maintenance-supporter-groups",strategyType:"section",name:"Maintenance Supporter \u2014 Groups",description:"List of configured task groups with member counts."}];for(let e of U)g.customStrategies.some(s=>s.type===e.type&&s.strategyType===e.strategyType)||g.customStrategies.push(e);(()=>{let e=window;if(e.__msStrategyHealActive)return;e.__msStrategyHealActive=!0;let s=/^\/(auth|config|developer-tools|profile|hassio|history|logbook|map|media-browser|energy|todo|calendar)\b/,i=/Timeout waiting for strategy element ll-strategy-(dashboard-)?maintenance-supporter/i,l=`custom:${f}`;function S(r){let t=[document.documentElement],a=0;for(;t.length&&a<9e3;){let o=t.pop();if(a++,!o)continue;let n=o;if(n.nodeType===1&&n.tagName&&n.tagName.toLowerCase()===r)return n;n.shadowRoot&&t.push(n.shadowRoot);let u=o.children;if(u)for(let p of Array.from(u))t.push(p)}return null}function R(r){let t=r?.views;if(!Array.isArray(t)||!t.length)return null;let a=window.location.pathname.split("/").filter(Boolean).pop()||"",o=t.find(u=>u?.path===a);if(o)return o;let n=Number(a);return Number.isInteger(n)&&t[n]?t[n]:t[0]}function k(){try{let t=S("ha-panel-lovelace")?.lovelace;if(!t)return!1;let a=o=>o?.type;for(let o of[t.config,t.rawConfig]){if(!o)continue;if(a(o.strategy)===l)return!0;let n=R(o);if(n&&a(n.strategy)===l)return!0}return!1}catch{return!1}}function T(){let r=!1,t=0,a=!1,o=!1,n=[document.documentElement],u=0;for(;n.length&&u<9e3;){let p=n.pop();if(u++,!p)continue;let d=p;if(d.nodeType===1&&d.tagName){let c=d.tagName.toLowerCase();(c==="hui-view"||c==="hui-sections-view")&&(r=!0),(c==="ha-card"||c==="hui-card")&&t++,c==="hui-empty-state-card"&&(o=!0),c==="hui-error-card"&&i.test(d.textContent||"")&&(a=!0)}d.shadowRoot&&n.push(d.shadowRoot);let _=p.children;if(_)for(let c of Array.from(_))n.push(c)}return a?!0:o?!1:r&&t<3&&k()}let N="/maintenance_supporter_strategy_shim.js",E=0,b=0;function C(){let r=Date.now();r-b<5e3||E>=3||(b=r,E+=1,import(`${N}?heal=${r}`).catch(()=>{}).finally(()=>{let t=window.location.pathname+window.location.search;history.pushState(null,"","/lovelace"),window.dispatchEvent(new CustomEvent("location-changed")),window.setTimeout(()=>{history.pushState(null,"",t),window.dispatchEvent(new CustomEvent("location-changed"))},200)}))}function m(){if(s.test(window.location.pathname))return;let r=0,t=Date.now(),a=window.setInterval(()=>{r++;try{if(Date.now()-t<6e3)return;if(s.test(window.location.pathname)){window.clearInterval(a);return}T()?C():window.clearInterval(a),r>=30&&window.clearInterval(a)}catch{window.clearInterval(a)}},500)}try{document.readyState==="loading"?window.addEventListener("DOMContentLoaded",m):m(),wLine truncated
|
||||||
-250
@@ -1,250 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.71.0 */
|
|
||||||
import{a as f}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-JSPW4Q6Q.js";import{a as p}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-GJI3RTUI.js";import{a as o,b as _,c as i,f as l,h,l as g,m as n,q as t,s as u,u as v}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-PBRIQQ2X.js";var r=class extends h{constructor(){super(...arguments);this._open=!1;this._loading=!1;this._adopting=!1;this._error="";this._sensors=[];this._selected=new Set;this._users=[];this._responsible="";this._forMinutes="0";this._localeReady=!1;this._userService=null;this._toggle=s=>{let a=new Set(this._selected);a.has(s)?a.delete(s):a.add(s),this._selected=a};this._toggleAll=()=>{this._selected.size===this._sensors.length?this._selected=new Set:this._selected=new Set(this._sensors.map(s=>s.entity_id))};this._adopt=async()=>{if(!(this._selected.size===0||this._adopting)){this._adopting=!0,this._error="";try{let s=this._sensors.filter(e=>this._selected.has(e.entity_id)).map(e=>({entity_id:e.entity_id,name:e.name,entry_id:e.suggested_entry_id??void 0,object_name:e.suggested_object_name,device_id:e.device_id??void 0,part_id:e.suggested_part_id??void 0,responsible_user_id:this._responsible||void 0,for_minutes:parseInt(this._forMinutes,10)>0?parseInt(this._forMinutes,10):void 0})),a=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/problem_sensors/adopt",selections:s});this.dispatchEvent(new CustomEvent("problem-sensors-adopted",{bubbles:!0,composed:!0,detail:a})),this._open=!1}catch(s){this._error=p(s,this._lang)}finally{this._adopting=!1}}}}get _lang(){return u(this.hass)}updated(s){s.has("hass")&&this.hass&&!this._localeReady&&(this._localeReady=!0,v(this._lang).then(()=>this.requestUpdate()))}async open(){this._open=!0,this._loading=!0,this._error="",this._sensors=[],this._selected=new Set,this._responsible="",this._forMinutes="0";try{this._userService?this._userService.updateHass(this.hass):this._userService=new f(this.hass);let[s,a]=await Promise.all([this.hass.connection.sendMessagePromise({type:"maintenance_supporter/problem_sensors/discover"}),this._userService.getUsers().catch(()=>[])]);this._sensors=s.sensors||[],this._selected=new Set(this._sensors.map(e=>e.entity_id)),this._users=a}catch(s){this._error=p(s,this._lang)}finally{this._loading=!1}}_close(){this._open=!1}render(){if(!this._open)return i``;let s=this._lang,a=this._sensors.length>0&&this._selected.size===this._sensors.length;return i`
|
|
||||||
<div class="overlay" @click=${this._close}>
|
|
||||||
<div class="card" @click=${e=>e.stopPropagation()}>
|
|
||||||
<div class="title">${t("adopt_problem_title",s)}</div>
|
|
||||||
<div class="hint">${t("adopt_problem_hint",s)}</div>
|
|
||||||
${this._error?i`<div class="error">${this._error}</div>`:l}
|
|
||||||
|
|
||||||
${this._loading?i`<div class="loading">…</div>`:this._sensors.length===0?i`<div class="empty">${t("adopt_problem_none",s)}</div>`:i`
|
|
||||||
<label class="select-all">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
.checked=${a}
|
|
||||||
@change=${this._toggleAll}
|
|
||||||
/>
|
|
||||||
<span>${t("selected",s)}: ${this._selected.size} / ${this._sensors.length}</span>
|
|
||||||
</label>
|
|
||||||
<div class="list">
|
|
||||||
${this._sensors.map(e=>{let m=this._selected.has(e.entity_id),d=e.state==="on",c=[e.device_name,e.area_name].filter(Boolean).join(" \xB7 ");return i`
|
|
||||||
<label class="row">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
.checked=${m}
|
|
||||||
@change=${()=>this._toggle(e.entity_id)}
|
|
||||||
/>
|
|
||||||
<div class="row-main">
|
|
||||||
<div class="row-top">
|
|
||||||
<span class="row-name">${e.name}</span>
|
|
||||||
<span class="chip ${d?"chip-active":"chip-ok"}">
|
|
||||||
${d?t("adopt_problem_active",s):t("adopt_problem_ok",s)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
${c?i`<div class="row-sub">${c}</div>`:l}
|
|
||||||
<div class="row-target">
|
|
||||||
→ ${e.suggested_object_name}${e.suggested_entry_id?l:i` <span class="new-tag">${t("adopt_problem_new_object",s)}</span>`}
|
|
||||||
</div>
|
|
||||||
${e.suggested_part_name?i`<div class="row-part">
|
|
||||||
<ha-icon icon="mdi:package-variant-closed"></ha-icon>
|
|
||||||
${t("adopt_problem_part",s).replace("{name}",e.suggested_part_name)}
|
|
||||||
</div>`:l}
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
`})}
|
|
||||||
</div>
|
|
||||||
`}
|
|
||||||
|
|
||||||
${!this._loading&&this._sensors.length>0?i`
|
|
||||||
<label class="responsible">
|
|
||||||
<span>${t("for_at_least_minutes",s)}</span>
|
|
||||||
<input
|
|
||||||
class="for-input"
|
|
||||||
type="number"
|
|
||||||
min="0"
|
|
||||||
max="1440"
|
|
||||||
.value=${this._forMinutes}
|
|
||||||
@input=${e=>this._forMinutes=e.target.value}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
<div class="for-hint">${t("adopt_for_minutes_hint",s)}</div>
|
|
||||||
`:l}
|
|
||||||
|
|
||||||
${!this._loading&&this._sensors.length>0&&this._users.length>0?i`
|
|
||||||
<label class="responsible">
|
|
||||||
<span>${t("adopt_problem_responsible",s)}</span>
|
|
||||||
<select
|
|
||||||
.value=${this._responsible}
|
|
||||||
@change=${e=>{this._responsible=e.target.value}}
|
|
||||||
>
|
|
||||||
<option value="" ?selected=${!this._responsible}>${t("no_user_assigned",s)}</option>
|
|
||||||
${this._users.map(e=>i`<option value=${e.id} ?selected=${e.id===this._responsible}>${e.name}</option>`)}
|
|
||||||
</select>
|
|
||||||
</label>
|
|
||||||
`:l}
|
|
||||||
|
|
||||||
<div class="actions">
|
|
||||||
<ha-button appearance="plain" @click=${this._close}>
|
|
||||||
${t("cancel",s)}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button
|
|
||||||
@click=${this._adopt}
|
|
||||||
.disabled=${this._selected.size===0||this._adopting}
|
|
||||||
>
|
|
||||||
${t("adopt_problem_adopt",s)}
|
|
||||||
</ha-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}};r.styles=_`
|
|
||||||
.overlay {
|
|
||||||
position: fixed;
|
|
||||||
inset: 0;
|
|
||||||
background: rgba(0, 0, 0, 0.5);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: 1000;
|
|
||||||
}
|
|
||||||
.card {
|
|
||||||
background: var(--card-background-color, #fff);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
padding: 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 12px;
|
|
||||||
min-width: min(360px, calc(100vw - 24px));
|
|
||||||
max-width: 560px;
|
|
||||||
width: 90vw;
|
|
||||||
max-height: 80vh;
|
|
||||||
overflow: hidden;
|
|
||||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
.title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
.hint {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.error {
|
|
||||||
color: var(--error-color, #f44336);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.loading,
|
|
||||||
.empty {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 12px 0;
|
|
||||||
}
|
|
||||||
.select-all {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.select-all input {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 6px;
|
|
||||||
overflow-y: auto;
|
|
||||||
max-height: 50vh;
|
|
||||||
}
|
|
||||||
.row {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
gap: 10px;
|
|
||||||
padding: 8px;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
border-radius: 6px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.row input {
|
|
||||||
margin-top: 2px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.row-main {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 2px;
|
|
||||||
min-width: 0;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
.row-top {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
.row-name {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.row-sub {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
.row-target {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
.row-part {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-size: 12px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
}
|
|
||||||
.row-part ha-icon {
|
|
||||||
--mdc-icon-size: 14px;
|
|
||||||
}
|
|
||||||
.new-tag {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
.chip {
|
|
||||||
font-size: 11px;
|
|
||||||
padding: 1px 8px;
|
|
||||||
border-radius: 10px;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.chip-active {
|
|
||||||
background: var(--error-color, #f44336);
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.chip-ok {
|
|
||||||
background: var(--divider-color);
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.responsible {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.for-input {
|
|
||||||
width: 70px;
|
|
||||||
background: var(--card-background-color);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 4px 6px;
|
|
||||||
}
|
|
||||||
.for-hint {
|
|
||||||
font-size: 11px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
margin: -4px 0 2px;
|
|
||||||
}
|
|
||||||
.responsible select {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 140px;
|
|
||||||
padding: 4px 6px;
|
|
||||||
border-radius: 4px;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
background: var(--card-background-color, #fff);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 8px;
|
|
||||||
padding-top: 8px;
|
|
||||||
}
|
|
||||||
`,o([g({attribute:!1})],r.prototype,"hass",2),o([n()],r.prototype,"_open",2),o([n()],r.prototype,"_loading",2),o([n()],r.prototype,"_adopting",2),o([n()],r.prototype,"_error",2),o([n()],r.prototype,"_sensors",2),o([n()],r.prototype,"_selected",2),o([n()],r.prototype,"_users",2),o([n()],r.prototype,"_responsible",2),o([n()],r.prototype,"_forMinutes",2);customElements.get("maintenance-adopt-problem-sensors-dialog")||customElements.define("maintenance-adopt-problem-sensors-dialog",r);export{r as MaintenanceAdoptProblemSensorsDialog};
|
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
import{e as f}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-PRQXFMNO.js";import{a as p}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-3IZWSKBJ.js";import{a as o,b as _,c as i,f as l,h,l as g,m as n,q as t,s as u,u as v}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-NAI3MD3R.js";var r=class extends h{constructor(){super(...arguments);this._open=!1;this._loading=!1;this._adopting=!1;this._error="";this._sensors=[];this._selected=new Set;this._users=[];this._responsible="";this._forMinutes="0";this._localeReady=!1;this._userService=null;this._toggle=s=>{let a=new Set(this._selected);a.has(s)?a.delete(s):a.add(s),this._selected=a};this._toggleAll=()=>{this._selected.size===this._sensors.length?this._selected=new Set:this._selected=new Set(this._sensors.map(s=>s.entity_id))};this._adopt=async()=>{if(!(this._selected.size===0||this._adopting)){this._adopting=!0,this._error="";try{let s=this._sensors.filter(e=>this._selected.has(e.entity_id)).map(e=>({entity_id:e.entity_id,name:e.name,entry_id:e.suggested_entry_id??void 0,object_name:e.suggested_object_name,device_id:e.device_id??void 0,part_id:e.suggested_part_id??void 0,responsible_user_id:this._responsible||void 0,for_minutes:parseInt(this._forMinutes,10)>0?parseInt(this._forMinutes,10):void 0})),a=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/problem_sensors/adopt",selections:s});this.dispatchEvent(new CustomEvent("problem-sensors-adopted",{bubbles:!0,composed:!0,detail:a})),this._open=!1}catch(s){this._error=p(s,this._lang)}finally{this._adopting=!1}}}}get _lang(){return u(this.hass)}updated(s){s.has("hass")&&this.hass&&!this._localeReady&&(this._localeReady=!0,v(this._lang).then(()=>this.requestUpdate()))}async open(){this._open=!0,this._loading=!0,this._error="",this._sensors=[],this._selected=new Set,this._responsible="",this._forMinutes="0";try{this._userService?this._userService.updateHass(this.hass):this._userService=new f(this.hass);let[s,a]=await Promise.all([this.hass.connection.sendMessagePromise({type:"maintenance_supporter/problem_sensors/discover"}),this._userService.getUsers().catch(()=>[])]);this._sensors=s.sensors||[],this._selected=new Set(this._sensors.map(e=>e.entity_id)),this._users=a}catch(s){this._error=p(s,this._lang)}finally{this._loading=!1}}_close(){this._open=!1}render(){if(!this._open)return i``;let s=this._lang,a=this._sensors.length>0&&this._selected.size===this._sensors.length;return i`
|
import{e as f}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-B4ELBSAY.js";import{a as p}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-XCPYIT7M.js";import{a as o,b as _,c as i,f as l,h,l as g,m as n,q as t,s as u,u as v}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-4OPY4VQ5.js";var r=class extends h{constructor(){super(...arguments);this._open=!1;this._loading=!1;this._adopting=!1;this._error="";this._sensors=[];this._selected=new Set;this._users=[];this._responsible="";this._forMinutes="0";this._localeReady=!1;this._userService=null;this._toggle=s=>{let a=new Set(this._selected);a.has(s)?a.delete(s):a.add(s),this._selected=a};this._toggleAll=()=>{this._selected.size===this._sensors.length?this._selected=new Set:this._selected=new Set(this._sensors.map(s=>s.entity_id))};this._adopt=async()=>{if(!(this._selected.size===0||this._adopting)){this._adopting=!0,this._error="";try{let s=this._sensors.filter(e=>this._selected.has(e.entity_id)).map(e=>({entity_id:e.entity_id,name:e.name,entry_id:e.suggested_entry_id??void 0,object_name:e.suggested_object_name,device_id:e.device_id??void 0,part_id:e.suggested_part_id??void 0,responsible_user_id:this._responsible||void 0,for_minutes:parseInt(this._forMinutes,10)>0?parseInt(this._forMinutes,10):void 0})),a=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/problem_sensors/adopt",selections:s});this.dispatchEvent(new CustomEvent("problem-sensors-adopted",{bubbles:!0,composed:!0,detail:a})),this._open=!1}catch(s){this._error=p(s,this._lang)}finally{this._adopting=!1}}}}get _lang(){return u(this.hass)}updated(s){s.has("hass")&&this.hass&&!this._localeReady&&(this._localeReady=!0,v(this._lang).then(()=>this.requestUpdate()))}async open(){this._open=!0,this._loading=!0,this._error="",this._sensors=[],this._selected=new Set,this._responsible="",this._forMinutes="0";try{this._userService?this._userService.updateHass(this.hass):this._userService=new f(this.hass);let[s,a]=await Promise.all([this.hass.connection.sendMessagePromise({type:"maintenance_supporter/problem_sensors/discover"}),this._userService.getUsers().catch(()=>[])]);this._sensors=s.sensors||[],this._selected=new Set(this._sensors.map(e=>e.entity_id)),this._users=a}catch(s){this._error=p(s,this._lang)}finally{this._loading=!1}}_close(){this._open=!1}render(){if(!this._open)return i``;let s=this._lang,a=this._sensors.length>0&&this._selected.size===this._sensors.length;return i`
|
||||||
<div class="overlay" @click=${this._close}>
|
<div class="overlay" @click=${this._close}>
|
||||||
<div class="card" @click=${e=>e.stopPropagation()}>
|
<div class="card" @click=${e=>e.stopPropagation()}>
|
||||||
<div class="title">${t("adopt_problem_title",s)}</div>
|
<div class="title">${t("adopt_problem_title",s)}</div>
|
||||||
-250
@@ -1,250 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.74.0 */
|
|
||||||
import{a as f}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-S2VAROHZ.js";import{a as p}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-NYOACMQR.js";import{a as o,b as _,c as i,f as l,h,l as g,m as n,q as t,s as u,u as v}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-Y2JXJRDF.js";var r=class extends h{constructor(){super(...arguments);this._open=!1;this._loading=!1;this._adopting=!1;this._error="";this._sensors=[];this._selected=new Set;this._users=[];this._responsible="";this._forMinutes="0";this._localeReady=!1;this._userService=null;this._toggle=s=>{let a=new Set(this._selected);a.has(s)?a.delete(s):a.add(s),this._selected=a};this._toggleAll=()=>{this._selected.size===this._sensors.length?this._selected=new Set:this._selected=new Set(this._sensors.map(s=>s.entity_id))};this._adopt=async()=>{if(!(this._selected.size===0||this._adopting)){this._adopting=!0,this._error="";try{let s=this._sensors.filter(e=>this._selected.has(e.entity_id)).map(e=>({entity_id:e.entity_id,name:e.name,entry_id:e.suggested_entry_id??void 0,object_name:e.suggested_object_name,device_id:e.device_id??void 0,part_id:e.suggested_part_id??void 0,responsible_user_id:this._responsible||void 0,for_minutes:parseInt(this._forMinutes,10)>0?parseInt(this._forMinutes,10):void 0})),a=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/problem_sensors/adopt",selections:s});this.dispatchEvent(new CustomEvent("problem-sensors-adopted",{bubbles:!0,composed:!0,detail:a})),this._open=!1}catch(s){this._error=p(s,this._lang)}finally{this._adopting=!1}}}}get _lang(){return u(this.hass)}updated(s){s.has("hass")&&this.hass&&!this._localeReady&&(this._localeReady=!0,v(this._lang).then(()=>this.requestUpdate()))}async open(){this._open=!0,this._loading=!0,this._error="",this._sensors=[],this._selected=new Set,this._responsible="",this._forMinutes="0";try{this._userService?this._userService.updateHass(this.hass):this._userService=new f(this.hass);let[s,a]=await Promise.all([this.hass.connection.sendMessagePromise({type:"maintenance_supporter/problem_sensors/discover"}),this._userService.getUsers().catch(()=>[])]);this._sensors=s.sensors||[],this._selected=new Set(this._sensors.map(e=>e.entity_id)),this._users=a}catch(s){this._error=p(s,this._lang)}finally{this._loading=!1}}_close(){this._open=!1}render(){if(!this._open)return i``;let s=this._lang,a=this._sensors.length>0&&this._selected.size===this._sensors.length;return i`
|
|
||||||
<div class="overlay" @click=${this._close}>
|
|
||||||
<div class="card" @click=${e=>e.stopPropagation()}>
|
|
||||||
<div class="title">${t("adopt_problem_title",s)}</div>
|
|
||||||
<div class="hint">${t("adopt_problem_hint",s)}</div>
|
|
||||||
${this._error?i`<div class="error">${this._error}</div>`:l}
|
|
||||||
|
|
||||||
${this._loading?i`<div class="loading">…</div>`:this._sensors.length===0?i`<div class="empty">${t("adopt_problem_none",s)}</div>`:i`
|
|
||||||
<label class="select-all">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
.checked=${a}
|
|
||||||
@change=${this._toggleAll}
|
|
||||||
/>
|
|
||||||
<span>${t("selected",s)}: ${this._selected.size} / ${this._sensors.length}</span>
|
|
||||||
</label>
|
|
||||||
<div class="list">
|
|
||||||
${this._sensors.map(e=>{let m=this._selected.has(e.entity_id),d=e.state==="on",c=[e.device_name,e.area_name].filter(Boolean).join(" \xB7 ");return i`
|
|
||||||
<label class="row">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
.checked=${m}
|
|
||||||
@change=${()=>this._toggle(e.entity_id)}
|
|
||||||
/>
|
|
||||||
<div class="row-main">
|
|
||||||
<div class="row-top">
|
|
||||||
<span class="row-name">${e.name}</span>
|
|
||||||
<span class="chip ${d?"chip-active":"chip-ok"}">
|
|
||||||
${d?t("adopt_problem_active",s):t("adopt_problem_ok",s)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
${c?i`<div class="row-sub">${c}</div>`:l}
|
|
||||||
<div class="row-target">
|
|
||||||
→ ${e.suggested_object_name}${e.suggested_entry_id?l:i` <span class="new-tag">${t("adopt_problem_new_object",s)}</span>`}
|
|
||||||
</div>
|
|
||||||
${e.suggested_part_name?i`<div class="row-part">
|
|
||||||
<ha-icon icon="mdi:package-variant-closed"></ha-icon>
|
|
||||||
${t("adopt_problem_part",s).replace("{name}",e.suggested_part_name)}
|
|
||||||
</div>`:l}
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
`})}
|
|
||||||
</div>
|
|
||||||
`}
|
|
||||||
|
|
||||||
${!this._loading&&this._sensors.length>0?i`
|
|
||||||
<label class="responsible">
|
|
||||||
<span>${t("for_at_least_minutes",s)}</span>
|
|
||||||
<input
|
|
||||||
class="for-input"
|
|
||||||
type="number"
|
|
||||||
min="0"
|
|
||||||
max="1440"
|
|
||||||
.value=${this._forMinutes}
|
|
||||||
@input=${e=>this._forMinutes=e.target.value}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
<div class="for-hint">${t("adopt_for_minutes_hint",s)}</div>
|
|
||||||
`:l}
|
|
||||||
|
|
||||||
${!this._loading&&this._sensors.length>0&&this._users.length>0?i`
|
|
||||||
<label class="responsible">
|
|
||||||
<span>${t("adopt_problem_responsible",s)}</span>
|
|
||||||
<select
|
|
||||||
.value=${this._responsible}
|
|
||||||
@change=${e=>{this._responsible=e.target.value}}
|
|
||||||
>
|
|
||||||
<option value="" ?selected=${!this._responsible}>${t("no_user_assigned",s)}</option>
|
|
||||||
${this._users.map(e=>i`<option value=${e.id} ?selected=${e.id===this._responsible}>${e.name}</option>`)}
|
|
||||||
</select>
|
|
||||||
</label>
|
|
||||||
`:l}
|
|
||||||
|
|
||||||
<div class="actions">
|
|
||||||
<ha-button appearance="plain" @click=${this._close}>
|
|
||||||
${t("cancel",s)}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button
|
|
||||||
@click=${this._adopt}
|
|
||||||
.disabled=${this._selected.size===0||this._adopting}
|
|
||||||
>
|
|
||||||
${t("adopt_problem_adopt",s)}
|
|
||||||
</ha-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}};r.styles=_`
|
|
||||||
.overlay {
|
|
||||||
position: fixed;
|
|
||||||
inset: 0;
|
|
||||||
background: rgba(0, 0, 0, 0.5);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: 1000;
|
|
||||||
}
|
|
||||||
.card {
|
|
||||||
background: var(--card-background-color, #fff);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
padding: 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 12px;
|
|
||||||
min-width: min(360px, calc(100vw - 24px));
|
|
||||||
max-width: 560px;
|
|
||||||
width: 90vw;
|
|
||||||
max-height: 80vh;
|
|
||||||
overflow: hidden;
|
|
||||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
.title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
.hint {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.error {
|
|
||||||
color: var(--error-color, #f44336);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.loading,
|
|
||||||
.empty {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 12px 0;
|
|
||||||
}
|
|
||||||
.select-all {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.select-all input {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 6px;
|
|
||||||
overflow-y: auto;
|
|
||||||
max-height: 50vh;
|
|
||||||
}
|
|
||||||
.row {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
gap: 10px;
|
|
||||||
padding: 8px;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
border-radius: 6px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.row input {
|
|
||||||
margin-top: 2px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.row-main {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 2px;
|
|
||||||
min-width: 0;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
.row-top {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
.row-name {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.row-sub {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
.row-target {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
.row-part {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-size: 12px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
}
|
|
||||||
.row-part ha-icon {
|
|
||||||
--mdc-icon-size: 14px;
|
|
||||||
}
|
|
||||||
.new-tag {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
.chip {
|
|
||||||
font-size: 11px;
|
|
||||||
padding: 1px 8px;
|
|
||||||
border-radius: 10px;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.chip-active {
|
|
||||||
background: var(--error-color, #f44336);
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.chip-ok {
|
|
||||||
background: var(--divider-color);
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.responsible {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.for-input {
|
|
||||||
width: 70px;
|
|
||||||
background: var(--card-background-color);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 4px 6px;
|
|
||||||
}
|
|
||||||
.for-hint {
|
|
||||||
font-size: 11px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
margin: -4px 0 2px;
|
|
||||||
}
|
|
||||||
.responsible select {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 140px;
|
|
||||||
padding: 4px 6px;
|
|
||||||
border-radius: 4px;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
background: var(--card-background-color, #fff);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 8px;
|
|
||||||
padding-top: 8px;
|
|
||||||
}
|
|
||||||
`,o([g({attribute:!1})],r.prototype,"hass",2),o([n()],r.prototype,"_open",2),o([n()],r.prototype,"_loading",2),o([n()],r.prototype,"_adopting",2),o([n()],r.prototype,"_error",2),o([n()],r.prototype,"_sensors",2),o([n()],r.prototype,"_selected",2),o([n()],r.prototype,"_users",2),o([n()],r.prototype,"_responsible",2),o([n()],r.prototype,"_forMinutes",2);customElements.get("maintenance-adopt-problem-sensors-dialog")||customElements.define("maintenance-adopt-problem-sensors-dialog",r);export{r as MaintenanceAdoptProblemSensorsDialog};
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
|
||||||
import{a as r,b as d,c as a,f as l,h as p,l as s,q as c}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-NAI3MD3R.js";function h(o,e){if(e)switch(o){case"date":return e.split("T")[0];case"time":return e.length===5?`${e}:00`:e;case"datetime":{let[i,n="00:00:00"]=e.split("T");return`${i} ${n.length===5?`${n}:00`:n}`}}}function u(o,e){if(typeof e!="string"||!e)return"";switch(o){case"date":return e.slice(0,10);case"time":return e.slice(0,5);case"datetime":{let[i,n="00:00:00"]=e.split(" ");return`${i}T${n.length===5?`${n}:00`:n}`}}}var t=class extends p{constructor(){super(...arguments);this.kind="date";this.label="";this.value="";this.clearable=!1;this.disabled=!1;this.required=!1;this.lang="en"}_selector(){switch(this.kind){case"date":return{date:{}};case"time":return{time:{no_second:!0}};case"datetime":return{datetime:{}}}}_onSelectorChange(i){i.stopPropagation(),this._emit(u(this.kind,i.detail?.value))}_clear(){this._emit("")}_emit(i){i!==this.value&&(this.value=i,this.dispatchEvent(new CustomEvent("value-changed",{bubbles:!0,composed:!0,detail:{value:i}})))}render(){return a`
|
|
||||||
<div class="field">
|
|
||||||
${this.label?a`<span class="label">${this.label}${this.required?a`<span class="req">*</span>`:l}</span>`:l}
|
|
||||||
<div class="row">
|
|
||||||
<ha-selector
|
|
||||||
.hass=${this.hass}
|
|
||||||
.selector=${this._selector()}
|
|
||||||
.value=${h(this.kind,this.value)}
|
|
||||||
.required=${this.required}
|
|
||||||
.disabled=${this.disabled}
|
|
||||||
@value-changed=${this._onSelectorChange}
|
|
||||||
></ha-selector>
|
|
||||||
${this.clearable&&this.value&&!this.disabled?a`<button type="button" class="clear" title=${c("clear",this.lang)} aria-label=${c("clear",this.lang)} @click=${this._clear}>
|
|
||||||
<ha-icon icon="mdi:close"></ha-icon>
|
|
||||||
</button>`:l}
|
|
||||||
</div>
|
|
||||||
${this.helper?a`<span class="helper">${this.helper}</span>`:l}
|
|
||||||
</div>
|
|
||||||
`}};t.styles=d`
|
|
||||||
:host { display: block; }
|
|
||||||
.field {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 4px;
|
|
||||||
}
|
|
||||||
.label {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--secondary-text-color, #888);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
.req { color: var(--error-color, #f44336); margin-left: 2px; }
|
|
||||||
.row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
}
|
|
||||||
ha-selector {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
.clear {
|
|
||||||
flex: none;
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 36px;
|
|
||||||
height: 36px;
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: transparent;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
cursor: pointer;
|
|
||||||
--mdc-icon-size: 20px;
|
|
||||||
}
|
|
||||||
.clear:hover { background: rgba(var(--rgb-primary-text-color, 0, 0, 0), 0.08); }
|
|
||||||
.clear:focus-visible { outline: 2px solid var(--primary-color); }
|
|
||||||
.helper {
|
|
||||||
font-size: 11px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
`,r([s({attribute:!1})],t.prototype,"hass",2),r([s()],t.prototype,"kind",2),r([s()],t.prototype,"label",2),r([s()],t.prototype,"value",2),r([s()],t.prototype,"helper",2),r([s({type:Boolean})],t.prototype,"clearable",2),r([s({type:Boolean})],t.prototype,"disabled",2),r([s({type:Boolean})],t.prototype,"required",2),r([s()],t.prototype,"lang",2);customElements.get("ms-date-field")||customElements.define("ms-date-field",t);
|
|
||||||
+6
-6
@@ -1,9 +1,9 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
var Re=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var dt=(o,e,t,r)=>{for(var a=r>1?void 0:r?De(e,t):e,n=o.length-1,i;n>=0;n--)(i=o[n])&&(a=(r?i(e,t,a):i(a))||a);return r&&a&&Re(e,t,a),a};var q=globalThis,I=q.ShadowRoot&&(q.ShadyCSS===void 0||q.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,J=Symbol(),ce=new WeakMap,N=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==J)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(I&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=ce.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&ce.set(t,e))}return e}toString(){return this.cssText}},de=o=>new N(typeof o=="string"?o:o+"",void 0,J),C=(o,...e)=>{let t=o.length===1?o[0]:e.reduce((r,a,n)=>r+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+o[n+1],o[0]);return new N(t,o,J)},pe=(o,e)=>{if(I)o.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),a=q.litNonce;a!==void 0&&r.setAttribute("nonce",a),r.textContent=t.cssText,o.appendChild(r)}},Z=I?o=>o:o=>o instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return de(t)})(o):o;var{is:Oe,defineProperty:Le,getOwnPropertyDescriptor:ze,getOwnPropertyNames:Me,getOwnPropertySymbols:Ue,getPrototypeOf:qe}=Object,F=globalThis,_e=F.trustedTypes,Ie=_e?_e.emptyScript:"",Fe=F.reactiveElementPolyfillSupport,j=(o,e)=>o,P={toAttribute(o,e){switch(e){case Boolean:o=o?Ie:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,e){let t=o;switch(e){case Boolean:t=o!==null;break;case Number:t=o===null?null:Number(o);break;case Object:case Array:try{t=JSON.parse(o)}catch{t=null}}return t}},H=(o,e)=>!Oe(o,e),he={attribute:!0,type:String,converter:P,reflect:!1,useDefault:!1,hasChanged:H};Symbol.metadata??=Symbol("metadata"),F.litPropertyMetadata??=new WeakMap;var g=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=he){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){let r=Symbol(),a=this.getPropertyDescriptor(e,r,t);a!==void 0&&Le(this.prototype,e,a)}}static getPropertyDescriptor(e,t,r){let{get:a,set:n}=ze(this.prototype,e)??{get(){return this[t]},set(i){this[t]=i}};return{get:a,set(i){let l=a?.call(this);n?.call(this,i),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??he}static _$Ei(){if(this.hasOwnProperty(j("elementProperties")))return;let e=qe(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(j("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(j("properties"))){let t=this.properties,r=[...Me(t),...Ue(t)];for(let a of r)this.createProperty(a,t[a])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,a]of t)this.elementProperties.set(r,a)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let a=this._$Eu(t,r);a!==void 0&&this._$Eh.set(a,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let a of r)t.unshift(Z(a))}else e!==void 0&&t.push(Z(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return pe(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,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),a=Line truncated
|
var Re=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var dt=(o,e,t,r)=>{for(var a=r>1?void 0:r?De(e,t):e,n=o.length-1,i;n>=0;n--)(i=o[n])&&(a=(r?i(e,t,a):i(a))||a);return r&&a&&Re(e,t,a),a};var q=globalThis,I=q.ShadowRoot&&(q.ShadyCSS===void 0||q.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,J=Symbol(),de=new WeakMap,N=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==J)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(I&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=de.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&de.set(t,e))}return e}toString(){return this.cssText}},pe=o=>new N(typeof o=="string"?o:o+"",void 0,J),C=(o,...e)=>{let t=o.length===1?o[0]:e.reduce((r,a,n)=>r+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+o[n+1],o[0]);return new N(t,o,J)},_e=(o,e)=>{if(I)o.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),a=q.litNonce;a!==void 0&&r.setAttribute("nonce",a),r.textContent=t.cssText,o.appendChild(r)}},Z=I?o=>o:o=>o instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return pe(t)})(o):o;var{is:Oe,defineProperty:Le,getOwnPropertyDescriptor:ze,getOwnPropertyNames:Me,getOwnPropertySymbols:Ue,getPrototypeOf:qe}=Object,F=globalThis,he=F.trustedTypes,Ie=he?he.emptyScript:"",Fe=F.reactiveElementPolyfillSupport,j=(o,e)=>o,P={toAttribute(o,e){switch(e){case Boolean:o=o?Ie:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,e){let t=o;switch(e){case Boolean:t=o!==null;break;case Number:t=o===null?null:Number(o);break;case Object:case Array:try{t=JSON.parse(o)}catch{t=null}}return t}},H=(o,e)=>!Oe(o,e),ue={attribute:!0,type:String,converter:P,reflect:!1,useDefault:!1,hasChanged:H};Symbol.metadata??=Symbol("metadata"),F.litPropertyMetadata??=new WeakMap;var g=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=ue){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){let r=Symbol(),a=this.getPropertyDescriptor(e,r,t);a!==void 0&&Le(this.prototype,e,a)}}static getPropertyDescriptor(e,t,r){let{get:a,set:n}=ze(this.prototype,e)??{get(){return this[t]},set(i){this[t]=i}};return{get:a,set(i){let l=a?.call(this);n?.call(this,i),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ue}static _$Ei(){if(this.hasOwnProperty(j("elementProperties")))return;let e=qe(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(j("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(j("properties"))){let t=this.properties,r=[...Me(t),...Ue(t)];for(let a of r)this.createProperty(a,t[a])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,a]of t)this.elementProperties.set(r,a)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let a=this._$Eu(t,r);a!==void 0&&this._$Eh.set(a,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let a of r)t.unshift(Z(a))}else e!==void 0&&t.push(Z(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _e(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,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),a=Line truncated
|
||||||
\f\r]`,R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,me=/-->/g,fe=/>/g,b=RegExp(`>|${X}(?:([^\\s"'>=/]+)(${X}*=${X}*(?:[^
|
\f\r]`,R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,fe=/-->/g,ye=/>/g,b=RegExp(`>|${X}(?:([^\\s"'>=/]+)(${X}*=${X}*(?:[^
|
||||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),ye=/'/g,be=/"/g,xe=/^(?:script|style|textarea|title)$/i,ae=o=>(e,...t)=>({_$litType$:o,strings:e,values:t}),mt=ae(1),ft=ae(2),yt=ae(3),x=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),ve=new WeakMap,v=w.createTreeWalker(w,129);function ke(o,e){if(!re(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return ge!==void 0?ge.createHTML(e):e}var Se=(o,e)=>{let t=o.length-1,r=[],a,n=e===2?"<svg>":e===3?"<math>":"",i=R;for(let l=0;l<t;l++){let s=o[l],d,_,c=-1,u=0;for(;u<s.length&&(i.lastIndex=u,_=i.exec(s),_!==null);)u=i.lastIndex,i===R?_[1]==="!--"?i=me:_[1]!==void 0?i=fe:_[2]!==void 0?(xe.test(_[2])&&(a=RegExp("</"+_[2],"g")),i=b):_[3]!==void 0&&(i=b):i===b?_[0]===">"?(i=a??R,c=-1):_[1]===void 0?c=-2:(c=i.lastIndex-_[2].length,d=_[1],i=_[3]===void 0?b:_[3]==='"'?be:ye):i===be||i===ye?i=b:i===me||i===fe?i=R:(i=b,a=void 0);let y=i===b&&o[l+1].startsWith("/>")?" ":"";n+=i===R?s+He:c>=0?(r.push(d),s.slice(0,c)+te+s.slice(c)+m+y):s+m+(c===-2?l:y)}return[ke(o,n+(o[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},L=class o{constructor({strings:e,_$litType$:t},r){let a;this.parts=[];let n=0,i=0,l=e.length-1,s=this.parts,[d,_]=Se(e,t);if(this.el=o.createElement(d,r),v.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(a=v.nextNode())!==null&&s.length<l;){if(a.nodeType===1){if(a.hasAttributes())for(let c of a.getAttributeNames())if(c.endsWith(te)){let u=_[i++],y=a.getAttribute(c).split(m),U=/([.?@])?(.*)/.exec(u);s.push({type:1,index:n,name:U[2],strings:y,ctor:U[1]==="."?V:U[1]==="?"?G:U[1]==="@"?K:S}),a.removeAttribute(c)}else c.startsWith(m)&&(s.push({type:6,index:n}),a.removeAttribute(c));if(xe.test(a.tagName)){let c=a.textContent.split(m),u=c.length-1;if(u>0){a.textContent=B?B.emptyScript:"";for(let y=0;y<u;y++)a.append(c[y],D()),v.nextNode(),s.push({type:2,index:++n});a.append(c[u],D())}}}else if(a.nodeType===8)if(a.data===oe)s.push({type:2,index:n});else{let c=-1;for(;(c=a.data.indexOf(m,c+1))!==-1;)s.push({type:7,index:n}),c+=m.length-1}n++}}static createElement(e,t){let r=w.createElement("template");return r.innerHTML=e,r}};function k(o,e,t=o,r){if(e===x)return e;let a=r!==void 0?t._$Co?.[r]:t._$Cl,n=O(e)?void 0:e._$litDirective$;return a?.constructor!==n&&(a?._$AO?.(!1),n===void 0?a=void 0:(a=new n(o),a._$AT(o,t,r)),r!==void 0?(t._$Co??=[])[r]=a:t._$Cl=a),a!==void 0&&(e=k(o,a._$AS(o,e.values),a,r)),e}var W=class{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){let{el:{content:t},parts:r}=this._$AD,a=(e?.creationScope??w).importNode(t,!0);v.currentNode=a;let n=v.nextNode(),i=0,l=0,s=r[0];for(;s!==void 0;){if(i===s.index){let d;s.type===2?d=new E(n,n.nextSibling,this,e):s.type===1?d=new s.ctor(n,s.name,s.strings,this,e):s.type===6&&(d=new Q(n,this,e)),this._$AV.push(d),s=r[++l]}i!==s?.index&&(n=v.nextNode(),i++)}return v.currentNode=w,a}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},E=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,a){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=a,this._$Cv=a?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=k(this,e,t),O(e)?e===p||e==null||e===""?(this._$AH!==p&&this._$AR(),this._$AH=p):e!==this._$AH&&e!==x&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):we(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!==p&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T(w.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,a=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=L.createElement(ke(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===a)this._$AH.p(t);else{let n=new W(a,this),i=n.u(this.options);n.p(t),this.T(i),this._$AH=n}}_$AC(e){let t=ve.get(e.strings);return t===void 0&&ve.set(e.strings,t=new L(e)),t}k(e){re(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,a=0;for(let n of e)a===t.length?t.push(r=new o(this.O(D()),this.O(D()),this,this.options)):r=t[a],r._$AI(n),a++;a<t.length&&(this._$AR(r&&r._$AB.nextSibling,a),t.length=a)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=ue(e).nextSibling;ue(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},S=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,a,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=e,this.name=t,this._$AM=a,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):thisLine truncated
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),be=/'/g,ve=/"/g,ke=/^(?:script|style|textarea|title)$/i,ae=o=>(e,...t)=>({_$litType$:o,strings:e,values:t}),mt=ae(1),ft=ae(2),yt=ae(3),x=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),we=new WeakMap,v=w.createTreeWalker(w,129);function Se(o,e){if(!re(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return me!==void 0?me.createHTML(e):e}var Ae=(o,e)=>{let t=o.length-1,r=[],a,n=e===2?"<svg>":e===3?"<math>":"",i=R;for(let l=0;l<t;l++){let s=o[l],d,_,c=-1,u=0;for(;u<s.length&&(i.lastIndex=u,_=i.exec(s),_!==null);)u=i.lastIndex,i===R?_[1]==="!--"?i=fe:_[1]!==void 0?i=ye:_[2]!==void 0?(ke.test(_[2])&&(a=RegExp("</"+_[2],"g")),i=b):_[3]!==void 0&&(i=b):i===b?_[0]===">"?(i=a??R,c=-1):_[1]===void 0?c=-2:(c=i.lastIndex-_[2].length,d=_[1],i=_[3]===void 0?b:_[3]==='"'?ve:be):i===ve||i===be?i=b:i===fe||i===ye?i=R:(i=b,a=void 0);let y=i===b&&o[l+1].startsWith("/>")?" ":"";n+=i===R?s+He:c>=0?(r.push(d),s.slice(0,c)+te+s.slice(c)+m+y):s+m+(c===-2?l:y)}return[Se(o,n+(o[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},L=class o{constructor({strings:e,_$litType$:t},r){let a;this.parts=[];let n=0,i=0,l=e.length-1,s=this.parts,[d,_]=Ae(e,t);if(this.el=o.createElement(d,r),v.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(a=v.nextNode())!==null&&s.length<l;){if(a.nodeType===1){if(a.hasAttributes())for(let c of a.getAttributeNames())if(c.endsWith(te)){let u=_[i++],y=a.getAttribute(c).split(m),U=/([.?@])?(.*)/.exec(u);s.push({type:1,index:n,name:U[2],strings:y,ctor:U[1]==="."?V:U[1]==="?"?G:U[1]==="@"?K:S}),a.removeAttribute(c)}else c.startsWith(m)&&(s.push({type:6,index:n}),a.removeAttribute(c));if(ke.test(a.tagName)){let c=a.textContent.split(m),u=c.length-1;if(u>0){a.textContent=B?B.emptyScript:"";for(let y=0;y<u;y++)a.append(c[y],D()),v.nextNode(),s.push({type:2,index:++n});a.append(c[u],D())}}}else if(a.nodeType===8)if(a.data===oe)s.push({type:2,index:n});else{let c=-1;for(;(c=a.data.indexOf(m,c+1))!==-1;)s.push({type:7,index:n}),c+=m.length-1}n++}}static createElement(e,t){let r=w.createElement("template");return r.innerHTML=e,r}};function k(o,e,t=o,r){if(e===x)return e;let a=r!==void 0?t._$Co?.[r]:t._$Cl,n=O(e)?void 0:e._$litDirective$;return a?.constructor!==n&&(a?._$AO?.(!1),n===void 0?a=void 0:(a=new n(o),a._$AT(o,t,r)),r!==void 0?(t._$Co??=[])[r]=a:t._$Cl=a),a!==void 0&&(e=k(o,a._$AS(o,e.values),a,r)),e}var W=class{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){let{el:{content:t},parts:r}=this._$AD,a=(e?.creationScope??w).importNode(t,!0);v.currentNode=a;let n=v.nextNode(),i=0,l=0,s=r[0];for(;s!==void 0;){if(i===s.index){let d;s.type===2?d=new T(n,n.nextSibling,this,e):s.type===1?d=new s.ctor(n,s.name,s.strings,this,e):s.type===6&&(d=new Q(n,this,e)),this._$AV.push(d),s=r[++l]}i!==s?.index&&(n=v.nextNode(),i++)}return v.currentNode=w,a}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},T=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,a){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=a,this._$Cv=a?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=k(this,e,t),O(e)?e===p||e==null||e===""?(this._$AH!==p&&this._$AR(),this._$AH=p):e!==this._$AH&&e!==x&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):xe(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!==p&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T(w.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,a=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=L.createElement(Se(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===a)this._$AH.p(t);else{let n=new W(a,this),i=n.u(this.options);n.p(t),this.T(i),this._$AH=n}}_$AC(e){let t=we.get(e.strings);return t===void 0&&we.set(e.strings,t=new L(e)),t}k(e){re(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,a=0;for(let n of e)a===t.length?t.push(r=new o(this.O(D()),this.O(D()),this,this.options)):r=t[a],r._$AI(n),a++;a<t.length&&(this._$AR(r&&r._$AB.nextSibling,a),t.length=a)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=ge(e).nextSibling;ge(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},S=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,a,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=e,this.name=t,this._$AM=a,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):thisLine truncated
|
||||||
Replace seal
|
Replace seal
|
||||||
Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_toggle:"Due at a specific time",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",notes_markdown_hint:"Markdown is supported \u2014 **bold**, lists, [links](\u2026)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",completed_at_optional:"Completed at (optional, empty = now)",completed_at_pick:"Set date & time",completed_at_future_error:"The completion date cannot be in the future.",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",confirm_delete_object:"Delete this object and all its tasks?",confirm_delete_task:"Delete this task?",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",all_priorities:"All priorities",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",all_parts:"All parts",tasks_lower:"tasks",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all:"All entities must trigger",entities:"entities",attribute_optional:"Attribute (optional, blank = state)",use_entity_state:"Use entity state (no attribute)",trigger_above:"Trigger above",trigger_below:"Trigger below",trigger_equals:"Trigger when equal to (=)",trigger_not_equals:"Trigger when different from (\u2260)",for_at_least_minutes:"For at least (minutes)",safety_interval_days:"Safety interval (days, optional)",safety_interval:"Safety interval (optional)",trigger_combinator:"Combine trigger and interval",trigger_combinator_any:"Trigger or interval (whichever first)",trigger_combinator_all:"Trigger and interval (both required)",delta_mode:"Delta mode",from_state_optional:"From state (optional)",to_state_optional:"To state (optional)",documentation_url_optional:"Documentation URL (optional)",object_notes_optional:"Notes (optional)",nfc_tag_id_optional:"NFC Tag ID (optional)",nfc_tags_empty_help:"No NFC tags registered in Home Assistant yet.",nfc_tags_open_settings:"Open Tags settings",nfc_tags_refresh:"Refresh",environmental_entity_optional:"Environmental sensor (optional)",environmental_entity_helper:"e.g. sensor.outdoor_temperature \u2014 adjusts the interval based on environmental conditions",adaptive_prediction_enabled:"Enable sensor-driven predictions",adaptive_seasonal_enabled:"Enable seasonal awareness",adaptive_max_interval:"Maximum interval (days)",adaptive_min_interval:"Minimum interval (days)",adaptive_ewa_alpha:"Learning rate (alpha)",adaptive_enabled:"Enable adaptive scheduling",adaptive_section_title:"Adaptive Scheduling",environmental_attribute_optional:"Environmental attribute (optional)",nfc_tag_id:"NFC Tag ID",nfc_linked:"NFC tag linked",nfc_link_hint:"Click to link NFC tag",responsible_user:"Responsible User",shared_with:"Shared with (rotation)",shared_with_help:"Pick multiple people to share this task; the responsible person rotates on each completion.",rotation_strategy:"Rotation",rotation_none:"No rotation",rotation_round_robin:"Round-robin",rotation_least_com
Line truncated
|
Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_toggle:"Due at a specific time",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",notes_markdown_hint:"Markdown is supported \u2014 **bold**, lists, [links](\u2026)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",completed_at_optional:"Completed at (optional, empty = now)",completed_at_pick:"Set date & time",completed_at_future_error:"The completion date cannot be in the future.",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",confirm_delete_object:"Delete this object and all its tasks?",confirm_delete_task:"Delete this task?",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",all_priorities:"All priorities",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",all_parts:"All parts",tasks_lower:"tasks",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all:"All entities must trigger",entities:"entities",attribute_optional:"Attribute (optional, blank = state)",use_entity_state:"Use entity state (no attribute)",trigger_above:"Trigger above",trigger_below:"Trigger below",trigger_equals:"Trigger when equal to (=)",trigger_not_equals:"Trigger when different from (\u2260)",for_at_least_minutes:"For at least (minutes)",safety_interval_days:"Safety interval (days, optional)",safety_interval:"Safety interval (optional)",trigger_combinator:"Combine trigger and interval",trigger_combinator_any:"Trigger or interval (whichever first)",trigger_combinator_all:"Trigger and interval (both required)",delta_mode:"Delta mode",from_state_optional:"From state (optional)",to_state_optional:"To state (optional)",documentation_url_optional:"Documentation URL (optional)",object_notes_optional:"Notes (optional)",nfc_tag_id_optional:"NFC Tag ID (optional)",nfc_tags_empty_help:"No NFC tags registered in Home Assistant yet.",nfc_tags_open_settings:"Open Tags settings",nfc_tags_refresh:"Refresh",environmental_entity_optional:"Environmental sensor (optional)",environmental_entity_helper:"e.g. sensor.outdoor_temperature \u2014 adjusts the interval based on environmental conditions",adaptive_prediction_enabled:"Enable sensor-driven predictions",adaptive_seasonal_enabled:"Enable seasonal awareness",adaptive_max_interval:"Maximum interval (days)",adaptive_min_interval:"Minimum interval (days)",adaptive_ewa_alpha:"Learning rate (alpha)",adaptive_enabled:"Enable adaptive scheduling",adaptive_section_title:"Adaptive Scheduling",environmental_attribute_optional:"Environmental attribute (optional)",nfc_tag_id:"NFC Tag ID",nfc_linked:"NFC tag linked",nfc_link_hint:"Click to link NFC tag",responsible_user:"Responsible User",shared_with:"Shared with (rotation)",shared_with_help:"Pick multiple people to share this task; the responsible person rotates on each completion.",rotation_strategy:"Rotation",rotation_none:"No rotation",rotation_round_robin:"Round-robin",rotation_least_com
Line truncated
|
||||||
.field { display: flex; flex-direction: column; gap: 4px; }
|
.field { display: flex; flex-direction: column; gap: 4px; }
|
||||||
.field-label { font-size: 12px; color: var(--secondary-text-color); }
|
.field-label { font-size: 12px; color: var(--secondary-text-color); }
|
||||||
.field-input {
|
.field-input {
|
||||||
@@ -1237,7 +1237,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
|||||||
.stat-item .stat-label { font-size: 11px; white-space: normal; text-align: center; line-height: 1.2; hyphens: auto; overflow-wrap: anywhere; }
|
.stat-item .stat-label { font-size: 11px; white-space: normal; text-align: center; line-height: 1.2; hyphens: auto; overflow-wrap: anywhere; }
|
||||||
.stat-value { font-size: 20px; }
|
.stat-value { font-size: 20px; }
|
||||||
}
|
}
|
||||||
`;export{dt as a,C as b,mt as c,ft as d,x as e,p as f,bt as g,T as h,ie as i,Pt as j,Dt as k,$e as l,Ut as m,Ke as n,Qe as o,go as p,h as q,mo as r,fo as s,et as t,tt as u,rt as v,nt as w,yo as x,it as y,Ee as z,bo as A,vo as B,Te as C,se as D,st as E,wo as F,xo as G,ko as H,So as I,Ao as J,$o as K,lt as L,Co as M};
|
`;export{dt as a,C as b,mt as c,ft as d,x as e,p as f,bt as g,E as h,ie as i,Pt as j,Dt as k,Ce as l,Ut as m,Ke as n,Qe as o,go as p,h as q,mo as r,fo as s,et as t,tt as u,rt as v,nt as w,yo as x,it as y,Ee as z,bo as A,vo as B,se as C,le as D,st as E,wo as F,xo as G,ko as H,So as I,Ao as J,$o as K,lt as L,Co as M};
|
||||||
/*! Bundled license information:
|
/*! Bundled license information:
|
||||||
|
|
||||||
@lit/reactive-element/css-tag.js:
|
@lit/reactive-element/css-tag.js:
|
||||||
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*! maintenance_supporter frontend 2.74.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
import{a as u}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-NYOACMQR.js";import{a as r,b as _,c as l,f as o,h,l as d,m as s,q as i,s as p}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-Y2JXJRDF.js";var a=class extends h{constructor(){super(...arguments);this.objects=[];this._open=!1;this._loading=!1;this._error="";this._name="";this._manufacturer="";this._model="";this._serialNumber="";this._areaId="";this._installationDate="";this._warrantyExpiry="";this._documentationUrl="";this._notes="";this._haDeviceId="";this._parentEntryId="";this._entryId=null}get _lang(){return p(this.hass)}openCreate(){this._entryId=null,this._name="",this._manufacturer="",this._model="",this._serialNumber="",this._areaId="",this._installationDate="",this._warrantyExpiry="",this._documentationUrl="",this._notes="",this._haDeviceId="",this._parentEntryId="",this._error="",this._open=!0}openEdit(e,n){this._entryId=e,this._name=n.name||"",this._manufacturer=n.manufacturer||"",this._model=n.model||"",this._serialNumber=n.serial_number||"",this._areaId=n.area_id||"",this._installationDate=n.installation_date||"",this._warrantyExpiry=n.warranty_expiry||"",this._documentationUrl=n.documentation_url||"",this._notes=n.notes||"",this._haDeviceId=n.ha_device_id||"",this._parentEntryId=n.parent_entry_id||"",this._error="",this._open=!0}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{this._entryId?await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/update",entry_id:this._entryId,name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}):await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/create",name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}),this._open=!1,this.dispatchEvent(new CustomEvent("object-saved"))}catch(e){this._error=u(e,this._lang,i("save_error",this._lang))}finally{this._loading=!1}}}_parentChoices(){return(this.objects||[]).filter(e=>e.entry_id!==this._entryId)}_close(){this._open=!1}render(){if(!this._open)return l``;let e=this._lang,n=this._entryId?i("edit_object",e):i("new_object",e);return l`
|
import{a as u}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-XCPYIT7M.js";import{a as r,b as _,c as l,f as o,h,l as d,m as s,q as i,s as p}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-4OPY4VQ5.js";var a=class extends h{constructor(){super(...arguments);this.objects=[];this._open=!1;this._loading=!1;this._error="";this._name="";this._manufacturer="";this._model="";this._serialNumber="";this._areaId="";this._installationDate="";this._warrantyExpiry="";this._documentationUrl="";this._notes="";this._haDeviceId="";this._parentEntryId="";this._entryId=null}get _lang(){return p(this.hass)}openCreate(){this._entryId=null,this._name="",this._manufacturer="",this._model="",this._serialNumber="",this._areaId="",this._installationDate="",this._warrantyExpiry="",this._documentationUrl="",this._notes="",this._haDeviceId="",this._parentEntryId="",this._error="",this._open=!0}openEdit(e,n){this._entryId=e,this._name=n.name||"",this._manufacturer=n.manufacturer||"",this._model=n.model||"",this._serialNumber=n.serial_number||"",this._areaId=n.area_id||"",this._installationDate=n.installation_date||"",this._warrantyExpiry=n.warranty_expiry||"",this._documentationUrl=n.documentation_url||"",this._notes=n.notes||"",this._haDeviceId=n.ha_device_id||"",this._parentEntryId=n.parent_entry_id||"",this._error="",this._open=!0}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{this._entryId?await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/update",entry_id:this._entryId,name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}):await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/create",name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}),this._open=!1,this.dispatchEvent(new CustomEvent("object-saved"))}catch(e){this._error=u(e,this._lang,i("save_error",this._lang))}finally{this._loading=!1}}}_parentChoices(){return(this.objects||[]).filter(e=>e.entry_id!==this._entryId)}_close(){this._open=!1}render(){if(!this._open)return l``;let e=this._lang,n=this._entryId?i("edit_object",e):i("new_object",e);return l`
|
||||||
<ha-dialog open @closed=${this._close}>
|
<ha-dialog open @closed=${this._close}>
|
||||||
<div class="dialog-title">${n}</div>
|
<div class="dialog-title">${n}</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.71.0 */
|
|
||||||
import{a as r,b as l,c as i,f as o,h as n,l as t}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-PBRIQQ2X.js";var e=class extends n{constructor(){super(...arguments);this.label="";this.value="";this.placeholder="";this.type="text";this.required=!1;this.disabled=!1;this.multiline=!1;this.rows=3}_onInput(s){let a=s.target.value;this.value=a,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:a}}))}render(){return i`
|
|
||||||
<label class="field">
|
|
||||||
${this.label?i`<span class="label">${this.label}${this.required?i`<span class="req">*</span>`:o}</span>`:o}
|
|
||||||
${this.multiline?i`
|
|
||||||
<textarea
|
|
||||||
.value=${this.value??""}
|
|
||||||
rows=${this.rows}
|
|
||||||
?required=${this.required}
|
|
||||||
?disabled=${this.disabled}
|
|
||||||
placeholder=${this.placeholder}
|
|
||||||
@input=${this._onInput}
|
|
||||||
@change=${this._onInput}
|
|
||||||
></textarea>`:i`
|
|
||||||
<input
|
|
||||||
.value=${this.value??""}
|
|
||||||
.type=${this.type}
|
|
||||||
?required=${this.required}
|
|
||||||
?disabled=${this.disabled}
|
|
||||||
placeholder=${this.placeholder}
|
|
||||||
step=${this.step??o}
|
|
||||||
min=${this.min??o}
|
|
||||||
max=${this.max??o}
|
|
||||||
pattern=${this.pattern??o}
|
|
||||||
@input=${this._onInput}
|
|
||||||
@change=${this._onInput}
|
|
||||||
/>`}
|
|
||||||
${this.helper?i`<span class="helper">${this.helper}</span>`:o}
|
|
||||||
</label>
|
|
||||||
`}};e.styles=l`
|
|
||||||
:host { display: block; }
|
|
||||||
.field {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 4px;
|
|
||||||
}
|
|
||||||
.label {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--secondary-text-color, #888);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
.req { color: var(--error-color, #f44336); margin-left: 2px; }
|
|
||||||
input {
|
|
||||||
padding: 8px 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color, rgba(255,255,255,0.12));
|
|
||||||
border-radius: 6px;
|
|
||||||
font-family: inherit;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
input:focus {
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
input:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
||||||
textarea {
|
|
||||||
padding: 8px 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color, rgba(255,255,255,0.12));
|
|
||||||
border-radius: 6px;
|
|
||||||
font-family: inherit;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
outline: none;
|
|
||||||
resize: vertical;
|
|
||||||
}
|
|
||||||
textarea:focus { border-color: var(--primary-color); }
|
|
||||||
textarea:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
||||||
.helper {
|
|
||||||
font-size: 11px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
`,r([t()],e.prototype,"label",2),r([t()],e.prototype,"value",2),r([t()],e.prototype,"placeholder",2),r([t()],e.prototype,"type",2),r([t({type:Boolean})],e.prototype,"required",2),r([t({type:Boolean})],e.prototype,"disabled",2),r([t()],e.prototype,"step",2),r([t()],e.prototype,"min",2),r([t()],e.prototype,"max",2),r([t()],e.prototype,"pattern",2),r([t()],e.prototype,"helper",2),r([t({type:Boolean})],e.prototype,"multiline",2),r([t({type:Number})],e.prototype,"rows",2);customElements.get("ms-textfield")||customElements.define("ms-textfield",e);
|
|
||||||
+2
-2
@@ -1,2 +1,2 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
import{c as r,f as i}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-NAI3MD3R.js";var a=["#c62828","#ad1457","#6a1b9a","#4527a0","#283593","#1565c0","#00838f","#2e7d32","#558b2f","#ef6c00","#6d4c41","#546e7a"];function u(e){let s=(e||"").split(/\s+/).filter(Boolean);return s.length===0?"?":s.length===1?s[0][0].toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()}function c(e){let s=0;for(let n of e)s=s*31+n.charCodeAt(0)>>>0;return a[s%a.length]}function o(e){return e?{id:e.id,name:e.name,initials:e.initials||u(e.name),color:e.color||c(e.id)}:null}function h(e){return e?r`<span class="person-avatar" style="--person-color: ${e.color}" title=${e.name}>${e.initials}</span>`:i}function m(e,s=""){return e?r`<span class="person-chip ${s}" title=${e.name}>${h(e)}<span class="person-name">${e.name}</span></span>`:i}var l=class{constructor(s){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=s}updateHass(s){this.hass=s}async getUsers(s=!1){let n=Date.now();if(!s&&this.usersCache&&n-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=n,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(s,n,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:s,task_id:n,user_id:t})}async getTasksByUser(s){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:s})).tasks}getUserName(s){return!s||!this.usersCache?null:this.usersCache.find(t=>t.id===s)?.name||null}getPerson(s){return o(this.getUser(s))}getUser(s){return!s||!this.usersCache?null:this.usersCache.find(n=>n.id===s)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(s){return s?s===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}};export{a,o as b,h as c,m as d,l as e};
|
import{c as r,f as i}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-4OPY4VQ5.js";var a=["#c62828","#ad1457","#6a1b9a","#4527a0","#283593","#1565c0","#00838f","#2e7d32","#558b2f","#ef6c00","#6d4c41","#546e7a"];function u(e){let s=(e||"").split(/\s+/).filter(Boolean);return s.length===0?"?":s.length===1?s[0][0].toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()}function c(e){let s=0;for(let n of e)s=s*31+n.charCodeAt(0)>>>0;return a[s%a.length]}function o(e){return e?{id:e.id,name:e.name,initials:e.initials||u(e.name),color:e.color||c(e.id)}:null}function h(e){return e?r`<span class="person-avatar" style="--person-color: ${e.color}" title=${e.name}>${e.initials}</span>`:i}function m(e,s=""){return e?r`<span class="person-chip ${s}" title=${e.name}>${h(e)}<span class="person-name">${e.name}</span></span>`:i}var l=class{constructor(s){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=s}updateHass(s){this.hass=s}async getUsers(s=!1){let n=Date.now();if(!s&&this.usersCache&&n-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=n,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(s,n,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:s,task_id:n,user_id:t})}async getTasksByUser(s){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:s})).tasks}getUserName(s){return!s||!this.usersCache?null:this.usersCache.find(t=>t.id===s)?.name||null}getPerson(s){return o(this.getUser(s))}getUser(s){return!s||!this.usersCache?null:this.usersCache.find(n=>n.id===s)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(s){return s?s===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}};export{a,o as b,h as c,m as d,l as e};
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.74.0 */
|
|
||||||
import{b as i}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-EOLJHFO4.js";async function l(e,n,t=300){return(await e.connection.sendMessagePromise({type:"auth/sign_path",path:n,expires:t})).path}async function r(e,n,t=300){return l(e,`/api/maintenance_supporter/document/${n}`,t)}async function y(e,n,t=""){let a=window.open("about:blank","_blank");try{let o=await r(e,n);a&&(a.location.href=new URL(o+t,window.location.origin).href)}catch(o){throw a&&a.close(),o}}async function p(e,n,t){i(await r(e,n,30),t)}function d(e){let n=URL.createObjectURL(new Blob([e],{type:"text/html"}));window.open(n,"_blank"),setTimeout(()=>URL.revokeObjectURL(n),6e4)}var c=[{key:"name",labelKey:"name",required:!0},{key:"manufacturer",labelKey:"manufacturer"},{key:"model",labelKey:"model"},{key:"serial_number",labelKey:"serial_number_label"},{key:"installation_date",labelKey:"installed"},{key:"warranty_expiry",labelKey:"warranty"},{key:"area_id",labelKey:"area"},{key:"documentation_url",labelKey:"documentation_url_label"},{key:"notes",labelKey:"object_notes_label"},{key:"task_count",labelKey:"tasks"},{key:"actions",labelKey:"actions"}],u=c.map(e=>e.key),s=["name","manufacturer","model","serial_number","installation_date","warranty_expiry","area_id","task_count","actions"];function g(e){if(!Array.isArray(e))return[...s];let n=new Set,t=[];for(let a of e)typeof a=="string"&&u.includes(a)&&!n.has(a)&&(n.add(a),t.push(a));return t.length?(t.includes("name")||t.unshift("name"),t):[...s]}export{l as a,r as b,y as c,p as d,d as e,c as f,s as g,g as h};
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.74.0 */
|
|
||||||
function c(o,t,e){let l=new Blob([o],{type:e}),d=URL.createObjectURL(l),n=document.createElement("a");n.href=d,n.download=t,n.target="_blank",n.rel="noopener",n.style.display="none",document.body.appendChild(n),n.dispatchEvent(new MouseEvent("click")),document.body.removeChild(n),setTimeout(()=>URL.revokeObjectURL(d),6e4)}function r(o,t){let e=document.createElement("a");e.href=o,e.download=t,e.target="_blank",e.rel="noopener",e.style.display="none",document.body.appendChild(e),e.dispatchEvent(new MouseEvent("click")),document.body.removeChild(e)}export{c as a,r as b};
|
|
||||||
@@ -1,341 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.74.0 */
|
|
||||||
import{a as _,e as y}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-YP2KCO26.js";import{a as k}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-NYOACMQR.js";import{K as m,a as s,b,c as o,f as d,h as v,l as n,m as l,q as r,x as g}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-Y2JXJRDF.js";var i=class extends v{constructor(){super(...arguments);this.entryId="";this.taskId="";this.taskName="";this.lang="en";this.checklist=[];this.adaptiveEnabled=!1;this.taskType="";this.readingUnit="";this.restockDefault=null;this.restockUnitCost=null;this.currencySymbol="";this.parts=[];this.consumesParts=[];this.consumesInfo=[];this.requiredFields=[];this.phaseLabel="";this.requireTagScan=!1;this.viaTagScan=!1;this._open=!1;this._notes="";this._cost="";this._duration="";this._loading=!1;this._error="";this._checklistState={};this._feedback="needed";this._photoDocId="";this._photoPreview="";this._photoUploading=!1;this._readingValue="";this._restockQty="";this._completedAt="";this._usedParts={};this.checklistPrefill={}}open(e={}){this._open||(this._open=!0,this.viaTagScan=!!e.viaTagScan,this._notes="",this._cost="",this._duration="",this._error="",this._checklistState=Object.fromEntries(this.checklist.map((t,a)=>[String(a),!!this.checklistPrefill[t]]).filter(([,t])=>t)),this._feedback="needed",this._photoDocId="",this._photoPreview="",this._photoUploading=!1,this._readingValue="",this._restockQty=this.restockDefault!==null?String(this.restockDefault):"",this._completedAt="",this._usedParts=Object.fromEntries(this.consumesParts.map(t=>[_(t),{...t}])))}_toggleCheck(e){let t=String(e);this._checklistState={...this._checklistState,[t]:!this._checklistState[t]}}_setFeedback(e){this._feedback=e}async _onPhotoInput(e){let t=e.target,a=t.files?.[0];if(t.value="",!!a){this._photoUploading=!0,this._error="";try{let c=new FormData;c.append("entry_id",this.entryId),c.append("tags","photo"),c.append("file",a,a.name);let p=await fetch("/api/maintenance_supporter/document/upload",{method:"POST",headers:{Authorization:`Bearer ${this.hass.auth?.data?.access_token??""}`},body:c});if(!p.ok){this._error=p.status===413?r("doc_too_large",this.lang):r("doc_upload_failed",this.lang);return}let u=await p.json();u.id&&(this._photoDocId=u.id,this._photoPreview=URL.createObjectURL(a))}catch{this._error=r("doc_upload_failed",this.lang)}finally{this._photoUploading=!1}}}_removePhoto(){this._photoPreview&&URL.revokeObjectURL(this._photoPreview),this._photoDocId="",this._photoPreview=""}async _complete(){this._loading=!0,this._error="";try{let e={type:"maintenance_supporter/task/complete",entry_id:this.entryId,task_id:this.taskId};if(this._notes&&(e.notes=this._notes),this._cost){let t=parseFloat(this._cost);!isNaN(t)&&t>=0&&(e.cost=t)}if(this._duration){let t=parseInt(this._duration,10);!isNaN(t)&&t>=0&&(e.duration=t)}if(this.checklist.length>0&&(e.checklist_state=this._checklistState),this.adaptiveEnabled&&(e.feedback=this._feedback),this._photoDocId&&(e.photo_doc_id=this._photoDocId),this.viaTagScan&&(e.via_tag_scan=!0),this._completedAt){if(new Date(this._completedAt).getTime()>Date.now()){this._error=r("completed_at_future_error",this.lang),this._loading=!1;return}e.completed_at=this._completedAt.length===16?`${this._completedAt}:00`:this._completedAt}if(this._readingValue!==""){let t=parseFloat(this._readingValue);isNaN(t)||(e.reading_value=t)}if(this.restockDefault!==null&&this._restockQty!==""){let t=parseFloat(this._restockQty);!isNaN(t)&&t>=1&&(e.restock_quantity=t)}this.parts.length>0&&(e.used_parts=Object.values(this._usedParts).filter(t=>Number.isFinite(t.quantity)&&t.quantity>0).map(t=>t.entry_id?{part_id:t.part_id,quantity:t.quantity,entry_id:t.entry_id}:{part_id:t.part_id,quantity:t.quantity})),await this.hass.connection.sendMessagePromise(e),this._open=!1,this.dispatchEvent(new CustomEvent("task-completed"))}catch(e){this._error=k(e,this.lang,r("save_error",this.lang))}finally{this._loading=!1}}get _missingRequired(){let e={notes:this._notes.trim()!=="",cost:this._cost.trim()!=="",duration:this._duration.trim()!=="",photo:this._photoDocId!=="",user:!!this.hass?.user};return this.requiredFields.filter(t=>!e[t])}_req(e){return this.requiredFields.includes(e)?o`<span class="req-mark" aria-hidden="true">*</span>`:d}_partsCostSuggestion(){if(this.restockDefault!==null){let a=parseFloat(this._restockQty);return this.restockUnitCost==null||!Number.isFinite(a)||a<=0?null:Math.round(this.restockUnitCost*a*100)/100}if(!this.parts.length)return null;let e=0,t=!1;for(let a of Object.values(this._usedParts)){let c=this.parts.find(p=>_({part_id:p.id,entry_id:p.entry_id})===_(a));c?.cost!=null&&(e+=c.cost*(a.quantity||1),t=!0)}return t?Math.round(e*100)/100:null}_renderCostSuggestion(e){if(this._cost.trim()!=="")return d;let t=this._partsCostSuggestion();if(t==null||t<=0)return d;let a=g(t,this.currencySymbol,e);return o`<button
|
|
||||||
type="button"
|
|
||||||
class="cost-suggestion"
|
|
||||||
@click=${()=>this._cost=String(Math.round(t*100)/100)}
|
|
||||||
>${r("cost_from_parts",e).replace("{amount}",a)}</button>`}_close(){this._open=!1}_pickCompletedAt(){let e=new Date,t=a=>String(a).padStart(2,"0");this._completedAt=`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:00`}render(){if(!this._open)return o``;let e=this.lang||this.hass?.language||"en";return o`
|
|
||||||
<ha-dialog open @closed=${this._close}>
|
|
||||||
<div class="dialog-title">${r("complete_title",e)}${this.taskName}</div>
|
|
||||||
${this.phaseLabel?o`<div class="phase-line">${r("phase_current",e)}: ${this.phaseLabel}</div>`:d}
|
|
||||||
${this.requireTagScan&&!this.viaTagScan?o`<div class="scan-required-note">${r("require_tag_scan_hint",e)}</div>`:d}
|
|
||||||
<div class="content">
|
|
||||||
${this._error?o`<div class="error">${this._error}</div>`:d}
|
|
||||||
${this.checklist.length>0?o`
|
|
||||||
<div class="checklist-section">
|
|
||||||
<label class="checklist-label">${r("checklist",e)}</label>
|
|
||||||
${this.checklist.map((t,a)=>o`
|
|
||||||
<label class="checklist-item" @click=${()=>this._toggleCheck(a)}>
|
|
||||||
<input type="checkbox" .checked=${!!this._checklistState[String(a)]} />
|
|
||||||
<span>${t}</span>
|
|
||||||
</label>
|
|
||||||
`)}
|
|
||||||
</div>
|
|
||||||
`:d}
|
|
||||||
${this.taskType==="reading"?o`
|
|
||||||
<label class="field">
|
|
||||||
<span class="field-label">${r("reading_value_label",e)}${this.readingUnit?` (${this.readingUnit})`:""}</span>
|
|
||||||
<input type="number" step="any" class="field-input"
|
|
||||||
.value=${this._readingValue}
|
|
||||||
@input=${t=>this._readingValue=t.target.value} />
|
|
||||||
</label>`:d}
|
|
||||||
${this.parts.length?o`<div class="used-parts">
|
|
||||||
<span class="field-label">${r("complete_parts_used",e)}</span>
|
|
||||||
${this.parts.map(t=>{let a=_({part_id:t.id,entry_id:t.entry_id}),c=this._usedParts[a],p=c!==void 0,u=t.entry_id?{part_id:t.id,quantity:1,entry_id:t.entry_id}:{part_id:t.id,quantity:1};return o`<div class="used-part-row">
|
|
||||||
<label class="used-part-check">
|
|
||||||
<input type="checkbox" .checked=${p}
|
|
||||||
@change=${f=>{let h={...this._usedParts};f.target.checked?h[a]=h[a]||u:delete h[a],this._usedParts=h}} />
|
|
||||||
<span
|
|
||||||
>${t.name}${t.owner_name?o`<span class="used-part-owner"> (${t.owner_name})</span>`:d}${t.stock!==null&&t.stock!==void 0?` (${t.stock}${t.unit?" "+t.unit:""})`:""}</span
|
|
||||||
>
|
|
||||||
</label>
|
|
||||||
${p?o`<input class="used-part-qty" type="number" min="0.01" max="999" step="0.01"
|
|
||||||
.value=${String(c.quantity)}
|
|
||||||
@input=${f=>{let h=parseFloat(f.target.value);this._usedParts={...this._usedParts,[a]:{...u,quantity:Number.isFinite(h)&&h>=.01?h:1}}}} />`:d}
|
|
||||||
</div>`})}
|
|
||||||
</div>`:this.consumesInfo.length?o`<div class="consumes-hint">
|
|
||||||
${this.consumesInfo.map(t=>o`<div>${t}</div>`)}
|
|
||||||
</div>`:d}
|
|
||||||
${this.restockDefault!==null?o`
|
|
||||||
<label class="field">
|
|
||||||
<span class="field-label">${r("restock_quantity_label",e)}</span>
|
|
||||||
<input type="number" step="0.01" min="0.01" class="field-input"
|
|
||||||
.value=${this._restockQty}
|
|
||||||
@input=${t=>this._restockQty=t.target.value} />
|
|
||||||
</label>`:d}
|
|
||||||
<!-- Native <input>s rather than <ha-textfield>: when this dialog
|
|
||||||
is opened from a Lovelace card via dialog-mount, ha-textfield
|
|
||||||
isn't yet registered (HA loads it lazily when its own panels
|
|
||||||
need it) so the elements render with zero height and the user
|
|
||||||
only sees the title + Cancel/Complete buttons — the original
|
|
||||||
bug report. Native inputs always render. -->
|
|
||||||
<label class="field">
|
|
||||||
<span class="field-label">${r("notes_optional",e)}${this._req("notes")}</span>
|
|
||||||
<input type="text" class="field-input"
|
|
||||||
.value=${this._notes}
|
|
||||||
@input=${t=>this._notes=t.target.value} />
|
|
||||||
</label>
|
|
||||||
<label class="field">
|
|
||||||
<span class="field-label">${r("cost_optional",e)}${this._req("cost")}</span>
|
|
||||||
<input type="number" step="0.01" min="0" class="field-input"
|
|
||||||
.value=${this._cost}
|
|
||||||
@input=${t=>this._cost=t.target.value} />
|
|
||||||
${this._renderCostSuggestion(e)}
|
|
||||||
</label>
|
|
||||||
<label class="field">
|
|
||||||
<span class="field-label">${r("duration_minutes",e)}${this._req("duration")}</span>
|
|
||||||
<input type="number" step="0.01" min="0" class="field-input"
|
|
||||||
.value=${this._duration}
|
|
||||||
@input=${t=>this._duration=t.target.value} />
|
|
||||||
</label>
|
|
||||||
<div class="field">
|
|
||||||
<span class="field-label">${r("completed_at_optional",e)}</span>
|
|
||||||
${this._completedAt?o`<ms-date-field
|
|
||||||
kind="datetime"
|
|
||||||
clearable
|
|
||||||
.hass=${this.hass}
|
|
||||||
.lang=${e}
|
|
||||||
.value=${this._completedAt}
|
|
||||||
@value-changed=${t=>this._completedAt=t.detail.value}
|
|
||||||
></ms-date-field>`:o`<button type="button" class="backdate-pick" @click=${this._pickCompletedAt}>
|
|
||||||
<ha-icon icon="mdi:calendar-clock"></ha-icon>${r("completed_at_pick",e)}
|
|
||||||
</button>`}
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<span class="field-label">${r("completion_photo_optional",e)}${this._req("photo")}</span>
|
|
||||||
${this._photoPreview?o`
|
|
||||||
<div class="photo-preview">
|
|
||||||
<img src=${this._photoPreview} alt="" />
|
|
||||||
<button type="button" class="photo-remove" @click=${this._removePhoto}
|
|
||||||
title="${r("remove",e)}">✕</button>
|
|
||||||
</div>`:o`
|
|
||||||
<label class="photo-pick">
|
|
||||||
<ha-icon icon="mdi:camera"></ha-icon>
|
|
||||||
<span>${this._photoUploading?r("uploading",e):r("add_photo",e)}</span>
|
|
||||||
<input type="file" accept="image/*" capture="environment"
|
|
||||||
?disabled=${this._photoUploading}
|
|
||||||
@change=${this._onPhotoInput} />
|
|
||||||
</label>`}
|
|
||||||
</div>
|
|
||||||
${this.adaptiveEnabled?o`
|
|
||||||
<div class="feedback-section">
|
|
||||||
<label class="feedback-label">${r("was_maintenance_needed",e)}</label>
|
|
||||||
<div class="feedback-buttons">
|
|
||||||
<button
|
|
||||||
class="feedback-btn ${this._feedback==="needed"?"selected":""}"
|
|
||||||
@click=${()=>this._setFeedback("needed")}
|
|
||||||
>${r("feedback_needed",e)}</button>
|
|
||||||
<button
|
|
||||||
class="feedback-btn ${this._feedback==="not_needed"?"selected":""}"
|
|
||||||
@click=${()=>this._setFeedback("not_needed")}
|
|
||||||
>${r("feedback_not_needed",e)}</button>
|
|
||||||
<button
|
|
||||||
class="feedback-btn ${this._feedback==="not_sure"?"selected":""}"
|
|
||||||
@click=${()=>this._setFeedback("not_sure")}
|
|
||||||
>${r("feedback_not_sure",e)}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`:d}
|
|
||||||
</div>
|
|
||||||
<div class="dialog-actions">
|
|
||||||
<ha-button appearance="plain" @click=${this._close}>
|
|
||||||
${r("cancel",e)}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button
|
|
||||||
@click=${this._complete}
|
|
||||||
.disabled=${this._loading||this._missingRequired.length>0}
|
|
||||||
title=${this._missingRequired.length?this._missingRequired.map(t=>r("err_required",e).replace("{field}",r(y[t]??t,e))).join(" \xB7 "):""}
|
|
||||||
>
|
|
||||||
${this._loading?r("completing",e):r("complete",e)}
|
|
||||||
</ha-button>
|
|
||||||
</div>
|
|
||||||
</ha-dialog>
|
|
||||||
`}};i.styles=[m,b`
|
|
||||||
.req-mark {
|
|
||||||
color: var(--error-color, #f44336);
|
|
||||||
margin-left: 2px;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
/* #104: one-click cost suggestion from parts — quiet link-style chip. */
|
|
||||||
.cost-suggestion {
|
|
||||||
align-self: flex-start;
|
|
||||||
margin-top: 4px;
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
background: none;
|
|
||||||
color: var(--primary-color);
|
|
||||||
font-size: 12.5px;
|
|
||||||
cursor: pointer;
|
|
||||||
text-decoration: underline dotted;
|
|
||||||
text-underline-offset: 2px;
|
|
||||||
}
|
|
||||||
.dialog-title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
}
|
|
||||||
.scan-required-note {
|
|
||||||
margin: -4px 0 12px;
|
|
||||||
padding: 8px 10px;
|
|
||||||
border-radius: 6px;
|
|
||||||
background: rgba(255, 152, 0, 0.12);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.phase-line {
|
|
||||||
margin-top: -8px;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 16px;
|
|
||||||
min-width: 300px;
|
|
||||||
}
|
|
||||||
.dialog-actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 8px;
|
|
||||||
padding-top: 16px;
|
|
||||||
}
|
|
||||||
.consumes-hint {
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
border-left: 3px solid var(--primary-color);
|
|
||||||
padding: 4px 8px;
|
|
||||||
margin: 4px 0 8px;
|
|
||||||
}
|
|
||||||
/* #99: editable per-completion parts selection */
|
|
||||||
.used-parts { margin: 4px 0 8px; display: flex; flex-direction: column; gap: 4px; }
|
|
||||||
.used-part-row { display: flex; align-items: center; gap: 8px; }
|
|
||||||
.used-part-check {
|
|
||||||
display: flex; align-items: center; gap: 6px; flex: 1;
|
|
||||||
font-size: 13px; cursor: pointer;
|
|
||||||
}
|
|
||||||
.used-part-check input { cursor: pointer; }
|
|
||||||
/* #111: whose stock this row draws on. Muted but never omitted — an
|
|
||||||
unlabelled foreign pool is indistinguishable from an own part. */
|
|
||||||
.used-part-owner { color: var(--secondary-text-color); }
|
|
||||||
.used-part-qty {
|
|
||||||
width: 76px; padding: 4px 6px; border-radius: 4px; font: inherit; font-size: 13px;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
background: var(--card-background-color);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
}
|
|
||||||
.error {
|
|
||||||
color: var(--error-color, #f44336);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
/* .field/.field-label/.field-input come from nativeFieldStyles */
|
|
||||||
.photo-pick {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 8px 12px;
|
|
||||||
border: 1px dashed var(--divider-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
width: fit-content;
|
|
||||||
}
|
|
||||||
.photo-pick:hover { border-color: var(--primary-color); }
|
|
||||||
/* #163: the backdate moment starts EMPTY (= now); the button seeds the
|
|
||||||
HA date+time picker with the current minute instead of the picker's
|
|
||||||
own 00:00 default, so a backdated completion never lands at midnight
|
|
||||||
by accident. */
|
|
||||||
.backdate-pick {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 8px 12px;
|
|
||||||
border: 1px dashed var(--divider-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
background: transparent;
|
|
||||||
cursor: pointer;
|
|
||||||
font: inherit;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
width: fit-content;
|
|
||||||
--mdc-icon-size: 18px;
|
|
||||||
}
|
|
||||||
.backdate-pick:hover { border-color: var(--primary-color); }
|
|
||||||
.photo-pick input[type="file"] { display: none; }
|
|
||||||
.photo-preview {
|
|
||||||
position: relative;
|
|
||||||
width: fit-content;
|
|
||||||
}
|
|
||||||
.photo-preview img {
|
|
||||||
max-width: 160px;
|
|
||||||
max-height: 160px;
|
|
||||||
border-radius: 8px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.photo-remove {
|
|
||||||
position: absolute;
|
|
||||||
top: -8px;
|
|
||||||
right: -8px;
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: none;
|
|
||||||
background: var(--error-color, #db4437);
|
|
||||||
color: #fff;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
.checklist-section {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 8px 0;
|
|
||||||
border-bottom: 1px solid var(--divider-color);
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
.checklist-label {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.checklist-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 4px 0;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.checklist-item input[type="checkbox"] {
|
|
||||||
width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.feedback-section {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 8px 0;
|
|
||||||
border-top: 1px solid var(--divider-color);
|
|
||||||
}
|
|
||||||
.feedback-label {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.feedback-buttons {
|
|
||||||
display: flex;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
.feedback-btn {
|
|
||||||
flex: 1;
|
|
||||||
padding: 8px 12px;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
background: var(--card-background-color, #fff);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
font-size: 13px;
|
|
||||||
cursor: pointer;
|
|
||||||
text-align: center;
|
|
||||||
transition: all 0.2s;
|
|
||||||
}
|
|
||||||
.feedback-btn:hover {
|
|
||||||
background: var(--secondary-background-color, #f5f5f5);
|
|
||||||
}
|
|
||||||
.feedback-btn.selected {
|
|
||||||
background: var(--primary-color);
|
|
||||||
color: var(--text-primary-color, #fff);
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
`],s([n({attribute:!1})],i.prototype,"hass",2),s([n()],i.prototype,"entryId",2),s([n()],i.prototype,"taskId",2),s([n()],i.prototype,"taskName",2),s([n()],i.prototype,"lang",2),s([n({type:Array})],i.prototype,"checklist",2),s([n({type:Boolean})],i.prototype,"adaptiveEnabled",2),s([n()],i.prototype,"taskType",2),s([n()],i.prototype,"readingUnit",2),s([n({attribute:!1})],i.prototype,"restockDefault",2),s([n({attribute:!1})],i.prototype,"restockUnitCost",2),s([n()],i.prototype,"currencySymbol",2),s([n({attribute:!1})],i.prototype,"parts",2),s([n({attribute:!1})],i.prototype,"consumesParts",2),s([n({type:Array})],i.prototype,"consumesInfo",2),s([n({type:Array})],i.prototype,"requiredFields",2),s([n()],i.prototype,"phaseLabel",2),s([n({type:Boolean})],i.prototype,"requireTagScan",2),s([n({type:Boolean})],i.prototype,"viaTagScan",2),s([l()],i.prototype,"_open",2),s([l()],i.prototype,"_notes",2),s([l()],i.prototype,"_cost",2),s([l()],i.prototype,"_duration",2),s([l()],i.prototype,"_loading",2),s([l()],i.prototype,"_error",2),s([l()],i.prototype,"_checklistState",2),s([l()],i.prototype,"_feedback",2),s([l()],i.prototype,"_photoDocId",2),s([l()],i.prototype,"_photoPreview",2),s([l()],i.prototype,"_photoUploading",2),s([l()],i.prototype,"_readingValue",2),s([l()],i.prototype,"_restockQty",2),s([l()],i.prototype,"_completedAt",2),s([l()],i.prototype,"_usedParts",2),s([n({attribute:!1})],i.prototype,"checklistPrefill",2);customElements.get("maintenance-complete-dialog")||customElements.define("maintenance-complete-dialog",i);export{i as a};
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.71.0 */
|
|
||||||
import{q as a}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-PBRIQQ2X.js";var s={entry_id:"object",name:"name",task_type:"maintenance_type",schedule_type:"schedule_type",interval_days:"interval_days",interval_anchor:"interval_anchor",warning_days:"warning_days",last_performed:"last_performed_optional",notes:"notes_optional",documentation_url:"documentation_url_optional",custom_icon:"custom_icon_optional",nfc_tag_id:"nfc_tag_id_optional",responsible_user_id:"responsible_user",entity_slug:"entity_slug",entity_id:"entity_id",area_id:"area_id_optional",manufacturer:"manufacturer_optional",model:"model_optional",serial_number:"serial_number_optional",installation_date:"installation_date_optional",warranty_expiry:"warranty_expiry_optional",checklist:"checklist_steps_optional",reason:"reason",feedback:"feedback",cost:"cost",duration:"duration",description:"description_optional",group_name:"name",group_description:"description_optional",environmental_entity:"environmental_entity_optional",environmental_attribute:"environmental_attribute_optional",trigger_above:"trigger_above",trigger_below:"trigger_below",trigger_equals:"trigger_equals",trigger_not_equals:"trigger_not_equals",trigger_for_minutes:"trigger_for_minutes"};function c(e,o){let r=s[e];if(!r)return e;let t=a(r,o);return t&&t!==r?t:e}function d(e){let r=e.match(/data\['([^']+)'\]/)?.[1],t;return(t=e.match(/length of value must be at most (\d+)/))?{field:r,rule:"too_long",param:t[1]}:(t=e.match(/length of value must be at least (\d+)/))?{field:r,rule:"too_short",param:t[1]}:(t=e.match(/value must be at most (\S+)/))?{field:r,rule:"value_too_high",param:t[1]}:(t=e.match(/value must be at least (\S+)/))?{field:r,rule:"value_too_low",param:t[1]}:/required key not provided/.test(e)?{field:r,rule:"required"}:(t=e.match(/expected (\w+)/))?{field:r,rule:"wrong_type",param:t[1]}:/value must be one of/.test(e)?{field:r,rule:"invalid_choice"}:/not a valid value/.test(e)?{field:r,rule:"invalid_value"}:{field:r,rule:"unknown"}}function g(e,o,r){if(r=r??a("action_error",o),typeof e=="string")return e;if(typeof e!="object"||e===null)return r;let t=e,_=t.message||t.error?.message||"";if(!_)return r;let i=d(_),l=i.field?c(i.field,o):"",n=u=>a(u,o).replace("{field}",l).replace("{n}",i.param??"");switch(i.rule){case"too_long":return n("err_too_long");case"too_short":return n("err_too_short");case"value_too_high":return n("err_value_too_high");case"value_too_low":return n("err_value_too_low");case"required":return n("err_required");case"wrong_type":return n("err_wrong_type").replace("{type}",i.param??"");case"invalid_choice":return n("err_invalid_choice");case"invalid_value":return n("err_invalid_value");default:return _||r}}export{g as a};
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,315 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.71.0 */
|
|
||||||
import{a as _,e as k}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-WQQNFFGB.js";import{a as m}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-GJI3RTUI.js";import{C as g,a as s,b,c as o,f as d,h as v,l as n,m as l,q as r}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-PBRIQQ2X.js";var i=class extends v{constructor(){super(...arguments);this.entryId="";this.taskId="";this.taskName="";this.lang="en";this.checklist=[];this.adaptiveEnabled=!1;this.taskType="";this.readingUnit="";this.restockDefault=null;this.restockUnitCost=null;this.currencySymbol="";this.parts=[];this.consumesParts=[];this.consumesInfo=[];this.requiredFields=[];this.phaseLabel="";this.requireTagScan=!1;this.viaTagScan=!1;this._open=!1;this._notes="";this._cost="";this._duration="";this._loading=!1;this._error="";this._checklistState={};this._feedback="needed";this._photoDocId="";this._photoPreview="";this._photoUploading=!1;this._readingValue="";this._restockQty="";this._completedAt="";this._usedParts={};this.checklistPrefill={}}open(e={}){this._open||(this._open=!0,this.viaTagScan=!!e.viaTagScan,this._notes="",this._cost="",this._duration="",this._error="",this._checklistState=Object.fromEntries(this.checklist.map((t,a)=>[String(a),!!this.checklistPrefill[t]]).filter(([,t])=>t)),this._feedback="needed",this._photoDocId="",this._photoPreview="",this._photoUploading=!1,this._readingValue="",this._restockQty=this.restockDefault!==null?String(this.restockDefault):"",this._completedAt="",this._usedParts=Object.fromEntries(this.consumesParts.map(t=>[_(t),{...t}])))}_toggleCheck(e){let t=String(e);this._checklistState={...this._checklistState,[t]:!this._checklistState[t]}}_setFeedback(e){this._feedback=e}async _onPhotoInput(e){let t=e.target,a=t.files?.[0];if(t.value="",!!a){this._photoUploading=!0,this._error="";try{let c=new FormData;c.append("entry_id",this.entryId),c.append("tags","photo"),c.append("file",a,a.name);let p=await fetch("/api/maintenance_supporter/document/upload",{method:"POST",headers:{Authorization:`Bearer ${this.hass.auth?.data?.access_token??""}`},body:c});if(!p.ok){this._error=p.status===413?r("doc_too_large",this.lang):r("doc_upload_failed",this.lang);return}let u=await p.json();u.id&&(this._photoDocId=u.id,this._photoPreview=URL.createObjectURL(a))}catch{this._error=r("doc_upload_failed",this.lang)}finally{this._photoUploading=!1}}}_removePhoto(){this._photoPreview&&URL.revokeObjectURL(this._photoPreview),this._photoDocId="",this._photoPreview=""}async _complete(){this._loading=!0,this._error="";try{let e={type:"maintenance_supporter/task/complete",entry_id:this.entryId,task_id:this.taskId};if(this._notes&&(e.notes=this._notes),this._cost){let t=parseFloat(this._cost);!isNaN(t)&&t>=0&&(e.cost=t)}if(this._duration){let t=parseInt(this._duration,10);!isNaN(t)&&t>=0&&(e.duration=t)}if(this.checklist.length>0&&(e.checklist_state=this._checklistState),this.adaptiveEnabled&&(e.feedback=this._feedback),this._photoDocId&&(e.photo_doc_id=this._photoDocId),this.viaTagScan&&(e.via_tag_scan=!0),this._completedAt){if(new Date(this._completedAt).getTime()>Date.now()){this._error=r("completed_at_future_error",this.lang),this._loading=!1;return}e.completed_at=this._completedAt.length===16?`${this._completedAt}:00`:this._completedAt}if(this._readingValue!==""){let t=parseFloat(this._readingValue);isNaN(t)||(e.reading_value=t)}if(this.restockDefault!==null&&this._restockQty!==""){let t=parseFloat(this._restockQty);!isNaN(t)&&t>=1&&(e.restock_quantity=t)}this.parts.length>0&&(e.used_parts=Object.values(this._usedParts).filter(t=>Number.isFinite(t.quantity)&&t.quantity>0).map(t=>t.entry_id?{part_id:t.part_id,quantity:t.quantity,entry_id:t.entry_id}:{part_id:t.part_id,quantity:t.quantity})),await this.hass.connection.sendMessagePromise(e),this._open=!1,this.dispatchEvent(new CustomEvent("task-completed"))}catch(e){this._error=m(e,this.lang,r("save_error",this.lang))}finally{this._loading=!1}}get _missingRequired(){let e={notes:this._notes.trim()!=="",cost:this._cost.trim()!=="",duration:this._duration.trim()!=="",photo:this._photoDocId!=="",user:!!this.hass?.user};return this.requiredFields.filter(t=>!e[t])}_req(e){return this.requiredFields.includes(e)?o`<span class="req-mark" aria-hidden="true">*</span>`:d}_partsCostSuggestion(){if(this.restockDefault!==null){let a=parseFloat(this._restockQty);return this.restockUnitCost==null||!Number.isFinite(a)||a<=0?null:Math.round(this.restockUnitCost*a*100)/100}if(!this.parts.length)return null;let e=0,t=!1;for(let a of Object.values(this._usedParts)){let c=this.parts.find(p=>_({part_id:p.id,entry_id:p.entry_id})===_(a));c?.cost!=null&&(e+=c.cost*(a.quantity||1),t=!0)}return t?Math.round(e*100)/100:null}_renderCostSuggestion(e){if(this._cost.trim()!=="")return d;let t=this._partsCostSuggestion();if(t==null||t<=0)return d;let a=`${t.toFixed(2)}${this.currencySymbol?` ${this.currencySymbol}`:""}`;return o`<button
|
|
||||||
type="button"
|
|
||||||
class="cost-suggestion"
|
|
||||||
@click=${()=>this._cost=t.toFixed(2)}
|
|
||||||
>${r("cost_from_parts",e).replace("{amount}",a)}</button>`}_close(){this._open=!1}render(){if(!this._open)return o``;let e=this.lang||this.hass?.language||"en";return o`
|
|
||||||
<ha-dialog open @closed=${this._close}>
|
|
||||||
<div class="dialog-title">${r("complete_title",e)}${this.taskName}</div>
|
|
||||||
${this.phaseLabel?o`<div class="phase-line">${r("phase_current",e)}: ${this.phaseLabel}</div>`:d}
|
|
||||||
${this.requireTagScan&&!this.viaTagScan?o`<div class="scan-required-note">${r("require_tag_scan_hint",e)}</div>`:d}
|
|
||||||
<div class="content">
|
|
||||||
${this._error?o`<div class="error">${this._error}</div>`:d}
|
|
||||||
${this.checklist.length>0?o`
|
|
||||||
<div class="checklist-section">
|
|
||||||
<label class="checklist-label">${r("checklist",e)}</label>
|
|
||||||
${this.checklist.map((t,a)=>o`
|
|
||||||
<label class="checklist-item" @click=${()=>this._toggleCheck(a)}>
|
|
||||||
<input type="checkbox" .checked=${!!this._checklistState[String(a)]} />
|
|
||||||
<span>${t}</span>
|
|
||||||
</label>
|
|
||||||
`)}
|
|
||||||
</div>
|
|
||||||
`:d}
|
|
||||||
${this.taskType==="reading"?o`
|
|
||||||
<label class="field">
|
|
||||||
<span class="field-label">${r("reading_value_label",e)}${this.readingUnit?` (${this.readingUnit})`:""}</span>
|
|
||||||
<input type="number" step="any" class="field-input"
|
|
||||||
.value=${this._readingValue}
|
|
||||||
@input=${t=>this._readingValue=t.target.value} />
|
|
||||||
</label>`:d}
|
|
||||||
${this.parts.length?o`<div class="used-parts">
|
|
||||||
<span class="field-label">${r("complete_parts_used",e)}</span>
|
|
||||||
${this.parts.map(t=>{let a=_({part_id:t.id,entry_id:t.entry_id}),c=this._usedParts[a],p=c!==void 0,u=t.entry_id?{part_id:t.id,quantity:1,entry_id:t.entry_id}:{part_id:t.id,quantity:1};return o`<div class="used-part-row">
|
|
||||||
<label class="used-part-check">
|
|
||||||
<input type="checkbox" .checked=${p}
|
|
||||||
@change=${f=>{let h={...this._usedParts};f.target.checked?h[a]=h[a]||u:delete h[a],this._usedParts=h}} />
|
|
||||||
<span
|
|
||||||
>${t.name}${t.owner_name?o`<span class="used-part-owner"> (${t.owner_name})</span>`:d}${t.stock!==null&&t.stock!==void 0?` (${t.stock}${t.unit?" "+t.unit:""})`:""}</span
|
|
||||||
>
|
|
||||||
</label>
|
|
||||||
${p?o`<input class="used-part-qty" type="number" min="0.01" max="999" step="0.01"
|
|
||||||
.value=${String(c.quantity)}
|
|
||||||
@input=${f=>{let h=parseFloat(f.target.value);this._usedParts={...this._usedParts,[a]:{...u,quantity:Number.isFinite(h)&&h>=.01?h:1}}}} />`:d}
|
|
||||||
</div>`})}
|
|
||||||
</div>`:this.consumesInfo.length?o`<div class="consumes-hint">
|
|
||||||
${this.consumesInfo.map(t=>o`<div>${t}</div>`)}
|
|
||||||
</div>`:d}
|
|
||||||
${this.restockDefault!==null?o`
|
|
||||||
<label class="field">
|
|
||||||
<span class="field-label">${r("restock_quantity_label",e)}</span>
|
|
||||||
<input type="number" step="0.01" min="0.01" class="field-input"
|
|
||||||
.value=${this._restockQty}
|
|
||||||
@input=${t=>this._restockQty=t.target.value} />
|
|
||||||
</label>`:d}
|
|
||||||
<!-- Native <input>s rather than <ha-textfield>: when this dialog
|
|
||||||
is opened from a Lovelace card via dialog-mount, ha-textfield
|
|
||||||
isn't yet registered (HA loads it lazily when its own panels
|
|
||||||
need it) so the elements render with zero height and the user
|
|
||||||
only sees the title + Cancel/Complete buttons — the original
|
|
||||||
bug report. Native inputs always render. -->
|
|
||||||
<label class="field">
|
|
||||||
<span class="field-label">${r("notes_optional",e)}${this._req("notes")}</span>
|
|
||||||
<input type="text" class="field-input"
|
|
||||||
.value=${this._notes}
|
|
||||||
@input=${t=>this._notes=t.target.value} />
|
|
||||||
</label>
|
|
||||||
<label class="field">
|
|
||||||
<span class="field-label">${r("cost_optional",e)}${this._req("cost")}</span>
|
|
||||||
<input type="number" step="0.01" min="0" class="field-input"
|
|
||||||
.value=${this._cost}
|
|
||||||
@input=${t=>this._cost=t.target.value} />
|
|
||||||
${this._renderCostSuggestion(e)}
|
|
||||||
</label>
|
|
||||||
<label class="field">
|
|
||||||
<span class="field-label">${r("duration_minutes",e)}${this._req("duration")}</span>
|
|
||||||
<input type="number" step="0.01" min="0" class="field-input"
|
|
||||||
.value=${this._duration}
|
|
||||||
@input=${t=>this._duration=t.target.value} />
|
|
||||||
</label>
|
|
||||||
<label class="field">
|
|
||||||
<span class="field-label">${r("completed_at_optional",e)}</span>
|
|
||||||
<input type="datetime-local" class="field-input"
|
|
||||||
max=${new Date(Date.now()-new Date().getTimezoneOffset()*6e4).toISOString().slice(0,16)}
|
|
||||||
.value=${this._completedAt}
|
|
||||||
@change=${t=>this._completedAt=t.target.value} />
|
|
||||||
</label>
|
|
||||||
<div class="field">
|
|
||||||
<span class="field-label">${r("completion_photo_optional",e)}${this._req("photo")}</span>
|
|
||||||
${this._photoPreview?o`
|
|
||||||
<div class="photo-preview">
|
|
||||||
<img src=${this._photoPreview} alt="" />
|
|
||||||
<button type="button" class="photo-remove" @click=${this._removePhoto}
|
|
||||||
title="${r("remove",e)}">✕</button>
|
|
||||||
</div>`:o`
|
|
||||||
<label class="photo-pick">
|
|
||||||
<ha-icon icon="mdi:camera"></ha-icon>
|
|
||||||
<span>${this._photoUploading?r("uploading",e):r("add_photo",e)}</span>
|
|
||||||
<input type="file" accept="image/*" capture="environment"
|
|
||||||
?disabled=${this._photoUploading}
|
|
||||||
@change=${this._onPhotoInput} />
|
|
||||||
</label>`}
|
|
||||||
</div>
|
|
||||||
${this.adaptiveEnabled?o`
|
|
||||||
<div class="feedback-section">
|
|
||||||
<label class="feedback-label">${r("was_maintenance_needed",e)}</label>
|
|
||||||
<div class="feedback-buttons">
|
|
||||||
<button
|
|
||||||
class="feedback-btn ${this._feedback==="needed"?"selected":""}"
|
|
||||||
@click=${()=>this._setFeedback("needed")}
|
|
||||||
>${r("feedback_needed",e)}</button>
|
|
||||||
<button
|
|
||||||
class="feedback-btn ${this._feedback==="not_needed"?"selected":""}"
|
|
||||||
@click=${()=>this._setFeedback("not_needed")}
|
|
||||||
>${r("feedback_not_needed",e)}</button>
|
|
||||||
<button
|
|
||||||
class="feedback-btn ${this._feedback==="not_sure"?"selected":""}"
|
|
||||||
@click=${()=>this._setFeedback("not_sure")}
|
|
||||||
>${r("feedback_not_sure",e)}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`:d}
|
|
||||||
</div>
|
|
||||||
<div class="dialog-actions">
|
|
||||||
<ha-button appearance="plain" @click=${this._close}>
|
|
||||||
${r("cancel",e)}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button
|
|
||||||
@click=${this._complete}
|
|
||||||
.disabled=${this._loading||this._missingRequired.length>0}
|
|
||||||
title=${this._missingRequired.length?this._missingRequired.map(t=>r("err_required",e).replace("{field}",r(k[t]??t,e))).join(" \xB7 "):""}
|
|
||||||
>
|
|
||||||
${this._loading?r("completing",e):r("complete",e)}
|
|
||||||
</ha-button>
|
|
||||||
</div>
|
|
||||||
</ha-dialog>
|
|
||||||
`}};i.styles=[g,b`
|
|
||||||
.req-mark {
|
|
||||||
color: var(--error-color, #f44336);
|
|
||||||
margin-left: 2px;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
/* #104: one-click cost suggestion from parts — quiet link-style chip. */
|
|
||||||
.cost-suggestion {
|
|
||||||
align-self: flex-start;
|
|
||||||
margin-top: 4px;
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
background: none;
|
|
||||||
color: var(--primary-color);
|
|
||||||
font-size: 12.5px;
|
|
||||||
cursor: pointer;
|
|
||||||
text-decoration: underline dotted;
|
|
||||||
text-underline-offset: 2px;
|
|
||||||
}
|
|
||||||
.dialog-title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
}
|
|
||||||
.scan-required-note {
|
|
||||||
margin: -4px 0 12px;
|
|
||||||
padding: 8px 10px;
|
|
||||||
border-radius: 6px;
|
|
||||||
background: rgba(255, 152, 0, 0.12);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.phase-line {
|
|
||||||
margin-top: -8px;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 16px;
|
|
||||||
min-width: 300px;
|
|
||||||
}
|
|
||||||
.dialog-actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 8px;
|
|
||||||
padding-top: 16px;
|
|
||||||
}
|
|
||||||
.consumes-hint {
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
border-left: 3px solid var(--primary-color);
|
|
||||||
padding: 4px 8px;
|
|
||||||
margin: 4px 0 8px;
|
|
||||||
}
|
|
||||||
/* #99: editable per-completion parts selection */
|
|
||||||
.used-parts { margin: 4px 0 8px; display: flex; flex-direction: column; gap: 4px; }
|
|
||||||
.used-part-row { display: flex; align-items: center; gap: 8px; }
|
|
||||||
.used-part-check {
|
|
||||||
display: flex; align-items: center; gap: 6px; flex: 1;
|
|
||||||
font-size: 13px; cursor: pointer;
|
|
||||||
}
|
|
||||||
.used-part-check input { cursor: pointer; }
|
|
||||||
/* #111: whose stock this row draws on. Muted but never omitted — an
|
|
||||||
unlabelled foreign pool is indistinguishable from an own part. */
|
|
||||||
.used-part-owner { color: var(--secondary-text-color); }
|
|
||||||
.used-part-qty {
|
|
||||||
width: 76px; padding: 4px 6px; border-radius: 4px; font: inherit; font-size: 13px;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
background: var(--card-background-color);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
}
|
|
||||||
.error {
|
|
||||||
color: var(--error-color, #f44336);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
/* .field/.field-label/.field-input come from nativeFieldStyles */
|
|
||||||
.photo-pick {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 8px 12px;
|
|
||||||
border: 1px dashed var(--divider-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
width: fit-content;
|
|
||||||
}
|
|
||||||
.photo-pick:hover { border-color: var(--primary-color); }
|
|
||||||
.photo-pick input[type="file"] { display: none; }
|
|
||||||
.photo-preview {
|
|
||||||
position: relative;
|
|
||||||
width: fit-content;
|
|
||||||
}
|
|
||||||
.photo-preview img {
|
|
||||||
max-width: 160px;
|
|
||||||
max-height: 160px;
|
|
||||||
border-radius: 8px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.photo-remove {
|
|
||||||
position: absolute;
|
|
||||||
top: -8px;
|
|
||||||
right: -8px;
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: none;
|
|
||||||
background: var(--error-color, #db4437);
|
|
||||||
color: #fff;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
.checklist-section {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 8px 0;
|
|
||||||
border-bottom: 1px solid var(--divider-color);
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
.checklist-label {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.checklist-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 4px 0;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.checklist-item input[type="checkbox"] {
|
|
||||||
width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.feedback-section {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 8px 0;
|
|
||||||
border-top: 1px solid var(--divider-color);
|
|
||||||
}
|
|
||||||
.feedback-label {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.feedback-buttons {
|
|
||||||
display: flex;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
.feedback-btn {
|
|
||||||
flex: 1;
|
|
||||||
padding: 8px 12px;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
background: var(--card-background-color, #fff);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
font-size: 13px;
|
|
||||||
cursor: pointer;
|
|
||||||
text-align: center;
|
|
||||||
transition: all 0.2s;
|
|
||||||
}
|
|
||||||
.feedback-btn:hover {
|
|
||||||
background: var(--secondary-background-color, #f5f5f5);
|
|
||||||
}
|
|
||||||
.feedback-btn.selected {
|
|
||||||
background: var(--primary-color);
|
|
||||||
color: var(--text-primary-color, #fff);
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
`],s([n({attribute:!1})],i.prototype,"hass",2),s([n()],i.prototype,"entryId",2),s([n()],i.prototype,"taskId",2),s([n()],i.prototype,"taskName",2),s([n()],i.prototype,"lang",2),s([n({type:Array})],i.prototype,"checklist",2),s([n({type:Boolean})],i.prototype,"adaptiveEnabled",2),s([n()],i.prototype,"taskType",2),s([n()],i.prototype,"readingUnit",2),s([n({attribute:!1})],i.prototype,"restockDefault",2),s([n({attribute:!1})],i.prototype,"restockUnitCost",2),s([n()],i.prototype,"currencySymbol",2),s([n({attribute:!1})],i.prototype,"parts",2),s([n({attribute:!1})],i.prototype,"consumesParts",2),s([n({type:Array})],i.prototype,"consumesInfo",2),s([n({type:Array})],i.prototype,"requiredFields",2),s([n()],i.prototype,"phaseLabel",2),s([n({type:Boolean})],i.prototype,"requireTagScan",2),s([n({type:Boolean})],i.prototype,"viaTagScan",2),s([l()],i.prototype,"_open",2),s([l()],i.prototype,"_notes",2),s([l()],i.prototype,"_cost",2),s([l()],i.prototype,"_duration",2),s([l()],i.prototype,"_loading",2),s([l()],i.prototype,"_error",2),s([l()],i.prototype,"_checklistState",2),s([l()],i.prototype,"_feedback",2),s([l()],i.prototype,"_photoDocId",2),s([l()],i.prototype,"_photoPreview",2),s([l()],i.prototype,"_photoUploading",2),s([l()],i.prototype,"_readingValue",2),s([l()],i.prototype,"_restockQty",2),s([l()],i.prototype,"_completedAt",2),s([l()],i.prototype,"_usedParts",2),s([n({attribute:!1})],i.prototype,"checklistPrefill",2);customElements.get("maintenance-complete-dialog")||customElements.define("maintenance-complete-dialog",i);export{i as a};
|
|
||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
var l=[{key:"name",labelKey:"name",required:!0},{key:"ref_no",labelKey:"ref_number"},{key:"manufacturer",labelKey:"manufacturer"},{key:"model",labelKey:"model"},{key:"serial_number",labelKey:"serial_number_label"},{key:"installation_date",labelKey:"installed"},{key:"warranty_expiry",labelKey:"warranty"},{key:"area_id",labelKey:"area"},{key:"documentation_url",labelKey:"documentation_url_label"},{key:"notes",labelKey:"object_notes_label"},{key:"task_count",labelKey:"tasks"},{key:"actions",labelKey:"actions"}],i=l.map(a=>a.key),r=["name","manufacturer","model","serial_number","installation_date","warranty_expiry","area_id","task_count","actions"];function o(a){if(!Array.isArray(a))return[...r];let t=new Set,e=[];for(let n of a)typeof n=="string"&&i.includes(n)&&!t.has(n)&&(t.add(n),e.push(n));return e.length?(e.includes("name")||e.unshift("name"),e):[...r]}export{l as a,r as b,o as c};
|
var l=[{key:"name",labelKey:"name",required:!0},{key:"ref_no",labelKey:"ref_number"},{key:"manufacturer",labelKey:"manufacturer"},{key:"model",labelKey:"model"},{key:"serial_number",labelKey:"serial_number_label"},{key:"installation_date",labelKey:"installed"},{key:"warranty_expiry",labelKey:"warranty"},{key:"area_id",labelKey:"area"},{key:"documentation_url",labelKey:"documentation_url_label"},{key:"notes",labelKey:"object_notes_label"},{key:"task_count",labelKey:"tasks"},{key:"actions",labelKey:"actions"}],i=l.map(a=>a.key),r=["name","manufacturer","model","serial_number","installation_date","warranty_expiry","area_id","task_count","actions"];function o(a){if(!Array.isArray(a))return[...r];let t=new Set,e=[];for(let n of a)typeof n=="string"&&i.includes(n)&&!t.has(n)&&(t.add(n),e.push(n));return e.length?(e.includes("name")||e.unshift("name"),e):[...r]}export{l as a,r as b,o as c};
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
|
import{a,b as y,c as s,f as l,h as g,l as o,m as f,q as d,z as m}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-4OPY4VQ5.js";function $(n){let t=m("2001-02-03",n).match(/\d+/g)||[],e=v=>t.findIndex(_=>Number(_)===v),h=e(2001),c=e(2),u=e(3);return h===0?"YMD":c>=0&&u>=0&&c<u?"MDY":"DMY"}function p(n,i,t){if(n<1e3||n>9999||i<1||i>12||t<1||t>31)return null;let e=new Date(n,i-1,t);return e.getFullYear()!==n||e.getMonth()!==i-1||e.getDate()!==t?null:`${n}-${String(i).padStart(2,"0")}-${String(t).padStart(2,"0")}`}function b(n,i){let t=n.trim(),e;if(e=t.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/))return p(+e[1],+e[2],+e[3]);if(e=t.match(/^(\d{4})$/))return p(+e[1],1,1);if(e=t.match(/^(\d{1,2})[./](\d{4})$/))return p(+e[2],+e[1],1);if(e=t.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/))return p(+e[3],+e[2],+e[1]);if(e=t.match(/^(\d{1,2})[/-](\d{1,2})[/-](\d{4})$/)){let h=+e[1],c=+e[2],u=+e[3];return $(i)==="MDY"?p(u,h,c):p(u,c,h)}return null}function x(n,i){if(i)switch(n){case"date":return i.split("T")[0];case"time":return i.length===5?`${i}:00`:i;case"datetime":{let[t,e="00:00:00"]=i.split("T");return`${t} ${e.length===5?`${e}:00`:e}`}}}function k(n,i){if(typeof i!="string"||!i)return"";switch(n){case"date":return i.slice(0,10);case"time":return i.slice(0,5);case"datetime":{let[t,e="00:00:00"]=i.split(" ");return`${t}T${e.length===5?`${e}:00`:e}`}}}var r=class extends g{constructor(){super(...arguments);this.kind="date";this.label="";this.value="";this.clearable=!1;this.disabled=!1;this.required=!1;this.lang="en";this._typing=!1;this._typed="";this._typedInvalid=!1}_startTyping(){this._typed=this.value,this._typedInvalid=!1,this._typing=!0,this.updateComplete.then(()=>this.shadowRoot?.querySelector("input.typed")?.focus())}_commitTyped(){if(!this._typed.trim()){this._typing=!1;return}let t=b(this._typed,this.lang);if(!t){this._typedInvalid=!0;return}this._typing=!1,this._typedInvalid=!1,this._emit(t)}_onTypedKey(t){t.key==="Enter"?(t.preventDefault(),this._commitTyped()):t.key==="Escape"&&(t.preventDefault(),this._typing=!1,this._typedInvalid=!1)}_selector(){switch(this.kind){case"date":return{date:{}};case"time":return{time:{no_second:!0}};case"datetime":return{datetime:{}}}}_onSelectorChange(t){t.stopPropagation(),this._emit(k(this.kind,t.detail?.value))}_clear(){this._emit("")}_emit(t){t!==this.value&&(this.value=t,this.dispatchEvent(new CustomEvent("value-changed",{bubbles:!0,composed:!0,detail:{value:t}})))}render(){return s`
|
||||||
|
<div class="field">
|
||||||
|
${this.label?s`<span class="label">${this.label}${this.required?s`<span class="req">*</span>`:l}</span>`:l}
|
||||||
|
<div class="row">
|
||||||
|
${this._typing?s`<input class="typed" type="text" inputmode="numeric" autocomplete="off"
|
||||||
|
.value=${this._typed}
|
||||||
|
placeholder=${m("1978-03-15",this.lang)}
|
||||||
|
aria-invalid=${this._typedInvalid?"true":"false"}
|
||||||
|
@input=${t=>{this._typed=t.target.value,this._typedInvalid=!1}}
|
||||||
|
@keydown=${this._onTypedKey}
|
||||||
|
@blur=${this._commitTyped} />`:s`<ha-selector
|
||||||
|
.hass=${this.hass}
|
||||||
|
.selector=${this._selector()}
|
||||||
|
.value=${x(this.kind,this.value)}
|
||||||
|
.required=${this.required}
|
||||||
|
.disabled=${this.disabled}
|
||||||
|
@value-changed=${this._onSelectorChange}
|
||||||
|
></ha-selector>`}
|
||||||
|
${this.kind==="date"&&!this.disabled&&!this._typing?s`<button type="button" class="type-toggle" title=${d("date_type_toggle",this.lang)} aria-label=${d("date_type_toggle",this.lang)} @click=${this._startTyping}>
|
||||||
|
<ha-icon icon="mdi:keyboard-outline"></ha-icon>
|
||||||
|
</button>`:l}
|
||||||
|
${this.clearable&&this.value&&!this.disabled&&!this._typing?s`<button type="button" class="clear" title=${d("clear",this.lang)} aria-label=${d("clear",this.lang)} @click=${this._clear}>
|
||||||
|
<ha-icon icon="mdi:close"></ha-icon>
|
||||||
|
</button>`:l}
|
||||||
|
</div>
|
||||||
|
${this._typedInvalid?s`<span class="helper invalid">${d("date_type_invalid",this.lang)}</span>`:this.helper?s`<span class="helper">${this.helper}</span>`:l}
|
||||||
|
</div>
|
||||||
|
`}};r.styles=y`
|
||||||
|
:host { display: block; }
|
||||||
|
.field {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
.label {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--secondary-text-color, #888);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.req { color: var(--error-color, #f44336); margin-left: 2px; }
|
||||||
|
.row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
ha-selector {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.clear, .type-toggle {
|
||||||
|
flex: none;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
padding: 0;
|
||||||
|
border: none;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
cursor: pointer;
|
||||||
|
--mdc-icon-size: 20px;
|
||||||
|
}
|
||||||
|
.clear:hover, .type-toggle:hover { background: rgba(var(--rgb-primary-text-color, 0, 0, 0), 0.08); }
|
||||||
|
.clear:focus-visible, .type-toggle:focus-visible { outline: 2px solid var(--primary-color); }
|
||||||
|
.helper {
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
.helper.invalid { color: var(--error-color, #f44336); font-style: normal; }
|
||||||
|
input.typed {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
height: 40px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 12px;
|
||||||
|
border: 1px solid var(--divider-color, #ccc);
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--card-background-color, #fff);
|
||||||
|
color: var(--primary-text-color);
|
||||||
|
font: inherit;
|
||||||
|
}
|
||||||
|
input.typed[aria-invalid="true"] { border-color: var(--error-color, #f44336); }
|
||||||
|
input.typed:focus { outline: 2px solid var(--primary-color); outline-offset: -1px; }
|
||||||
|
`,a([o({attribute:!1})],r.prototype,"hass",2),a([o()],r.prototype,"kind",2),a([o()],r.prototype,"label",2),a([o()],r.prototype,"value",2),a([o()],r.prototype,"helper",2),a([o({type:Boolean})],r.prototype,"clearable",2),a([o({type:Boolean})],r.prototype,"disabled",2),a([o({type:Boolean})],r.prototype,"required",2),a([o()],r.prototype,"lang",2),a([f()],r.prototype,"_typing",2),a([f()],r.prototype,"_typed",2),a([f()],r.prototype,"_typedInvalid",2);customElements.get("ms-date-field")||customElements.define("ms-date-field",r);
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.71.0 */
|
|
||||||
var r=class{constructor(s){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=s}updateHass(s){this.hass=s}async getUsers(s=!1){let e=Date.now();if(!s&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(s,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:s,task_id:e,user_id:t})}async getTasksByUser(s){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:s})).tasks}getUserName(s){return!s||!this.usersCache?null:this.usersCache.find(t=>t.id===s)?.name||null}getUser(s){return!s||!this.usersCache?null:this.usersCache.find(e=>e.id===s)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(s){return s?s===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}};export{r as a};
|
|
||||||
@@ -1,153 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
|
||||||
import{a as u}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-3IZWSKBJ.js";import{a as r,b as _,c as l,f as o,h,l as d,m as s,q as i,s as p}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-NAI3MD3R.js";var a=class extends h{constructor(){super(...arguments);this.objects=[];this._open=!1;this._loading=!1;this._error="";this._name="";this._manufacturer="";this._model="";this._serialNumber="";this._areaId="";this._installationDate="";this._warrantyExpiry="";this._documentationUrl="";this._notes="";this._haDeviceId="";this._parentEntryId="";this._entryId=null}get _lang(){return p(this.hass)}openCreate(){this._entryId=null,this._name="",this._manufacturer="",this._model="",this._serialNumber="",this._areaId="",this._installationDate="",this._warrantyExpiry="",this._documentationUrl="",this._notes="",this._haDeviceId="",this._parentEntryId="",this._error="",this._open=!0}openEdit(e,n){this._entryId=e,this._name=n.name||"",this._manufacturer=n.manufacturer||"",this._model=n.model||"",this._serialNumber=n.serial_number||"",this._areaId=n.area_id||"",this._installationDate=n.installation_date||"",this._warrantyExpiry=n.warranty_expiry||"",this._documentationUrl=n.documentation_url||"",this._notes=n.notes||"",this._haDeviceId=n.ha_device_id||"",this._parentEntryId=n.parent_entry_id||"",this._error="",this._open=!0}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{this._entryId?await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/update",entry_id:this._entryId,name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}):await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/create",name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}),this._open=!1,this.dispatchEvent(new CustomEvent("object-saved"))}catch(e){this._error=u(e,this._lang,i("save_error",this._lang))}finally{this._loading=!1}}}_parentChoices(){return(this.objects||[]).filter(e=>e.entry_id!==this._entryId)}_close(){this._open=!1}render(){if(!this._open)return l``;let e=this._lang,n=this._entryId?i("edit_object",e):i("new_object",e);return l`
|
|
||||||
<ha-dialog open @closed=${this._close}>
|
|
||||||
<div class="dialog-title">${n}</div>
|
|
||||||
<div class="content">
|
|
||||||
${this._error?l`<div class="error">${this._error}</div>`:o}
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("name",e)}"
|
|
||||||
required
|
|
||||||
.value=${this._name}
|
|
||||||
@input=${t=>this._name=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("manufacturer_optional",e)}"
|
|
||||||
.value=${this._manufacturer}
|
|
||||||
@input=${t=>this._manufacturer=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("model_optional",e)}"
|
|
||||||
.value=${this._model}
|
|
||||||
@input=${t=>this._model=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("serial_number_optional",e)}"
|
|
||||||
.value=${this._serialNumber}
|
|
||||||
@input=${t=>this._serialNumber=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("documentation_url_optional",e)}"
|
|
||||||
type="url"
|
|
||||||
.value=${this._documentationUrl}
|
|
||||||
@input=${t=>this._documentationUrl=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ha-area-picker
|
|
||||||
.hass=${this.hass}
|
|
||||||
label="${i("area_id_optional",e)}"
|
|
||||||
.value=${this._areaId}
|
|
||||||
@value-changed=${t=>this._areaId=t.detail.value||""}
|
|
||||||
></ha-area-picker>
|
|
||||||
<ms-date-field
|
|
||||||
kind="date"
|
|
||||||
clearable
|
|
||||||
.hass=${this.hass}
|
|
||||||
.lang=${e}
|
|
||||||
label="${i("installation_date_optional",e)}"
|
|
||||||
.value=${this._installationDate}
|
|
||||||
@value-changed=${t=>this._installationDate=t.detail.value}
|
|
||||||
></ms-date-field>
|
|
||||||
<ms-date-field
|
|
||||||
kind="date"
|
|
||||||
clearable
|
|
||||||
.hass=${this.hass}
|
|
||||||
.lang=${e}
|
|
||||||
label="${i("warranty_expiry_optional",e)}"
|
|
||||||
.value=${this._warrantyExpiry}
|
|
||||||
@value-changed=${t=>this._warrantyExpiry=t.detail.value}
|
|
||||||
></ms-date-field>
|
|
||||||
<ha-form
|
|
||||||
.hass=${this.hass}
|
|
||||||
.data=${{device:this._haDeviceId||void 0}}
|
|
||||||
.schema=${[{name:"device",selector:{device:{}}}]}
|
|
||||||
.computeLabel=${()=>i("link_device_optional",e)}
|
|
||||||
@value-changed=${t=>this._haDeviceId=t.detail.value?.device||""}
|
|
||||||
></ha-form>
|
|
||||||
${this._parentChoices().length?l`<label class="textarea-field">
|
|
||||||
<span class="textarea-label">${i("parent_object_optional",e)}</span>
|
|
||||||
<select
|
|
||||||
class="parent-select"
|
|
||||||
.value=${this._parentEntryId}
|
|
||||||
@change=${t=>this._parentEntryId=t.target.value}
|
|
||||||
>
|
|
||||||
<option value="" ?selected=${!this._parentEntryId}>
|
|
||||||
${i("parent_none",e)}
|
|
||||||
</option>
|
|
||||||
${this._parentChoices().map(t=>l`<option
|
|
||||||
value=${t.entry_id}
|
|
||||||
?selected=${this._parentEntryId===t.entry_id}
|
|
||||||
>${t.object.name}</option>`)}
|
|
||||||
</select>
|
|
||||||
</label>`:o}
|
|
||||||
<label class="textarea-field">
|
|
||||||
<span class="textarea-label">${i("object_notes_optional",e)}</span>
|
|
||||||
<textarea
|
|
||||||
rows="3"
|
|
||||||
.value=${this._notes}
|
|
||||||
@input=${t=>this._notes=t.target.value}
|
|
||||||
></textarea>
|
|
||||||
<span class="md-hint">${i("notes_markdown_hint",e)}</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="dialog-actions">
|
|
||||||
<ha-button appearance="plain" @click=${this._close}>
|
|
||||||
${i("cancel",this._lang)}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button
|
|
||||||
@click=${this._save}
|
|
||||||
.disabled=${this._loading||!this._name.trim()}
|
|
||||||
>
|
|
||||||
${this._loading?i("saving",this._lang):i("save",this._lang)}
|
|
||||||
</ha-button>
|
|
||||||
</div>
|
|
||||||
</ha-dialog>
|
|
||||||
`}};a.styles=_`
|
|
||||||
.dialog-title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 16px;
|
|
||||||
min-width: 300px;
|
|
||||||
}
|
|
||||||
.dialog-actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 8px;
|
|
||||||
padding-top: 16px;
|
|
||||||
}
|
|
||||||
ms-textfield {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.textarea-field {
|
|
||||||
display: flex; flex-direction: column; gap: 4px;
|
|
||||||
}
|
|
||||||
.textarea-label {
|
|
||||||
font-size: 12px; color: var(--secondary-text-color, #888); font-weight: 500;
|
|
||||||
}
|
|
||||||
.textarea-field textarea {
|
|
||||||
padding: 8px 10px; font-size: 14px; font-family: inherit;
|
|
||||||
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color); border-radius: 6px;
|
|
||||||
resize: vertical;
|
|
||||||
}
|
|
||||||
.textarea-field textarea:focus {
|
|
||||||
outline: none; border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
.md-hint {
|
|
||||||
font-size: 11px; color: var(--secondary-text-color); font-style: italic;
|
|
||||||
}
|
|
||||||
.parent-select {
|
|
||||||
padding: 8px 10px; font-size: 14px; font-family: inherit;
|
|
||||||
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color); border-radius: 6px;
|
|
||||||
}
|
|
||||||
.error {
|
|
||||||
color: var(--error-color, #f44336);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
`,r([d({attribute:!1})],a.prototype,"hass",2),r([d({attribute:!1})],a.prototype,"objects",2),r([s()],a.prototype,"_open",2),r([s()],a.prototype,"_loading",2),r([s()],a.prototype,"_error",2),r([s()],a.prototype,"_name",2),r([s()],a.prototype,"_manufacturer",2),r([s()],a.prototype,"_model",2),r([s()],a.prototype,"_serialNumber",2),r([s()],a.prototype,"_areaId",2),r([s()],a.prototype,"_installationDate",2),r([s()],a.prototype,"_warrantyExpiry",2),r([s()],a.prototype,"_documentationUrl",2),r([s()],a.prototype,"_notes",2),r([s()],a.prototype,"_haDeviceId",2),r([s()],a.prototype,"_parentEntryId",2),r([s()],a.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",a);export{a};
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.71.0 */
|
|
||||||
import{b as i}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-BQCLT4RW.js";async function l(e,n,t=300){return(await e.connection.sendMessagePromise({type:"auth/sign_path",path:n,expires:t})).path}async function r(e,n,t=300){return l(e,`/api/maintenance_supporter/document/${n}`,t)}async function y(e,n,t=""){let a=window.open("about:blank","_blank");try{let o=await r(e,n);a&&(a.location.href=new URL(o+t,window.location.origin).href)}catch(o){throw a&&a.close(),o}}async function p(e,n,t){i(await r(e,n,30),t)}function d(e){let n=URL.createObjectURL(new Blob([e],{type:"text/html"}));window.open(n,"_blank"),setTimeout(()=>URL.revokeObjectURL(n),6e4)}var c=[{key:"name",labelKey:"name",required:!0},{key:"manufacturer",labelKey:"manufacturer"},{key:"model",labelKey:"model"},{key:"serial_number",labelKey:"serial_number_label"},{key:"installation_date",labelKey:"installed"},{key:"warranty_expiry",labelKey:"warranty"},{key:"area_id",labelKey:"area"},{key:"documentation_url",labelKey:"documentation_url_label"},{key:"notes",labelKey:"object_notes_label"},{key:"task_count",labelKey:"tasks"},{key:"actions",labelKey:"actions"}],u=c.map(e=>e.key),s=["name","manufacturer","model","serial_number","installation_date","warranty_expiry","area_id","task_count","actions"];function g(e){if(!Array.isArray(e))return[...s];let n=new Set,t=[];for(let a of e)typeof a=="string"&&u.includes(a)&&!n.has(a)&&(n.add(a),t.push(a));return t.length?(t.includes("name")||t.unshift("name"),t):[...s]}export{l as a,r as b,y as c,p as d,d as e,c as f,s as g,g as h};
|
|
||||||
@@ -1,213 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.71.0 */
|
|
||||||
import{a as x}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-BQCLT4RW.js";import{a,b as v,c as n,f as p,h as b,l as h,m as c,q as t}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-PBRIQQ2X.js";function d(l){return l.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function f(l){return!l.startsWith("data:image/svg+xml,")&&!l.startsWith("data:image/png;base64,")?"":d(l)}function q(l){return l.replace(/[/\\:*?"<>|#%]+/g,"").replace(/\s+/g,"-").toLowerCase().substring(0,100)}var o=class extends b{constructor(){super(...arguments);this.lang="en";this._open=!1;this._loading=!1;this._error="";this._viewResult=null;this._completeResult=null;this._urlMode="companion";this._entryId="";this._taskId=null;this._objectName="";this._taskName="";this._generateSeq=0}openForObject(e,i){this._entryId=e,this._taskId=null,this._objectName=i,this._taskName="",this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}openForTask(e,i,r,s){this._entryId=e,this._taskId=i,this._objectName=r,this._taskName=s,this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}async _generate(){let e=++this._generateSeq;this._loading=!0,this._error="",this._viewResult=null,this._completeResult=null;try{let i={type:"maintenance_supporter/qr/generate",entry_id:this._entryId,url_mode:this._urlMode};this._taskId&&(i.task_id=this._taskId);let r=[this.hass.connection.sendMessagePromise({...i,action:"view"})];this._taskId&&r.push(this.hass.connection.sendMessagePromise({...i,action:"complete"}));let s=await Promise.all(r);if(e!==this._generateSeq)return;this._viewResult=s[0],s.length>1&&(this._completeResult=s[1])}catch(i){if(e!==this._generateSeq)return;let r=i?.code,s=i?.message;this._error=r==="no_url"||typeof s=="string"&&s.includes("No Home Assistant URL")?t("qr_error_no_url",this.lang):t("qr_error",this.lang)}finally{e===this._generateSeq&&(this._loading=!1)}}_setUrlMode(e){this._urlMode!==e&&(this._urlMode=e,this._generate())}_print(){if(!this._viewResult)return;let e=this._viewResult,i=e.label.task_name?`${e.label.object_name} \u2014 ${e.label.task_name}`:e.label.object_name,r=[e.label.manufacturer,e.label.model].filter(Boolean).join(" "),s=window.open("","_blank","width=600,height=500");if(!s)return;let g=this.lang||"en",u=d(i),m=d(r),_=!!this._completeResult,w=d(t("qr_action_view",g)),$=d(t("qr_action_complete",g));s.document.write(`<!DOCTYPE html><html><head><meta charset="utf-8">
|
|
||||||
<meta name="color-scheme" content="light">
|
|
||||||
<title>${u}</title>
|
|
||||||
<style>
|
|
||||||
/* Printable sheet \u2014 must not inherit the phone's dark theme. The QR images
|
|
||||||
carry their own white quiet zone and stay scannable either way, but the
|
|
||||||
labels below are explicit dark greys and would vanish on a WebView's dark
|
|
||||||
canvas. Same reasoning as helpers/report.ts. */
|
|
||||||
:root{color-scheme:light}
|
|
||||||
body{font-family:sans-serif;text-align:center;padding:20px;background:#fff;color:#1a1a1a}
|
|
||||||
h2{margin:0 0 4px}
|
|
||||||
.sub{color:#666;font-size:14px;margin-bottom:16px}
|
|
||||||
.qr-row{display:flex;justify-content:center;gap:24px;margin:12px 0}
|
|
||||||
.qr-col{display:flex;flex-direction:column;align-items:center;gap:6px}
|
|
||||||
.qr-col img{width:${_?"200px":"280px"}}
|
|
||||||
.qr-label{font-size:13px;font-weight:500;color:#333}
|
|
||||||
.url{font-size:10px;color:#999;word-break:break-all;margin-top:8px;max-width:480px}
|
|
||||||
</style></head><body>
|
|
||||||
<h2>${u}</h2>
|
|
||||||
${m?`<div class="sub">${m}</div>`:""}
|
|
||||||
<div class="qr-row">
|
|
||||||
<div class="qr-col">
|
|
||||||
<img src="${f(this._viewResult.svg_data_uri)}" alt="QR Info" />
|
|
||||||
<div class="qr-label">${w}</div>
|
|
||||||
</div>
|
|
||||||
${_?`<div class="qr-col">
|
|
||||||
<img src="${f(this._completeResult.svg_data_uri)}" alt="QR Complete" />
|
|
||||||
<div class="qr-label">${$}</div>
|
|
||||||
</div>`:""}
|
|
||||||
</div>
|
|
||||||
<div class="url">${d(this._viewResult.url)}</div>
|
|
||||||
<script>setTimeout(()=>window.print(),300)<\/script>
|
|
||||||
</body></html>`),s.document.close()}_downloadSvg(e,i){let r=decodeURIComponent(e.svg_data_uri.replace("data:image/svg+xml,","")),s=this._taskName?`${this._objectName}-${this._taskName}`:this._objectName;x(r,`qr-${q(s)}-${i}.svg`,"image/svg+xml")}_close(){this._open=!1,this._viewResult=null,this._completeResult=null,this._error="",this._loading=!1}render(){if(!this._open)return n``;let e=this.lang||this.hass?.language||"en",i=this._taskName?`${t("qr_code",e)}: ${this._objectName} \u2014 ${this._taskName}`:`${t("qr_code",e)}: ${this._objectName}`,r=!!this._viewResult;return n`
|
|
||||||
<ha-dialog open @closed=${this._close}>
|
|
||||||
<div class="dialog-title">${i}</div>
|
|
||||||
<div class="content">
|
|
||||||
${this._loading?n`<div class="loading">${t("qr_generating",e)}</div>`:this._error?n`<div class="error">${this._error}</div>`:r?n`
|
|
||||||
<div class="qr-pair">
|
|
||||||
<div class="qr-item">
|
|
||||||
<img
|
|
||||||
class="qr-image ${this._completeResult?"small":""}"
|
|
||||||
src="${this._viewResult.svg_data_uri}"
|
|
||||||
alt="QR Info"
|
|
||||||
/>
|
|
||||||
<div class="qr-item-label">${t("qr_action_view",e)}</div>
|
|
||||||
<button class="dl-btn"
|
|
||||||
@click=${()=>this._downloadSvg(this._viewResult,"info")}>
|
|
||||||
<ha-icon icon="mdi:download"></ha-icon>
|
|
||||||
${t("qr_download",e)}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
${this._completeResult?n`
|
|
||||||
<div class="qr-item">
|
|
||||||
<img
|
|
||||||
class="qr-image small"
|
|
||||||
src="${this._completeResult.svg_data_uri}"
|
|
||||||
alt="QR Complete"
|
|
||||||
/>
|
|
||||||
<div class="qr-item-label">${t("qr_action_complete",e)}</div>
|
|
||||||
<button class="dl-btn"
|
|
||||||
@click=${()=>this._downloadSvg(this._completeResult,"complete")}>
|
|
||||||
<ha-icon icon="mdi:download"></ha-icon>
|
|
||||||
${t("qr_download",e)}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
`:p}
|
|
||||||
</div>
|
|
||||||
<div class="url-display">${this._viewResult.url}</div>
|
|
||||||
`:p}
|
|
||||||
<div class="action-row">
|
|
||||||
<label>${t("qr_url_mode",e)}</label>
|
|
||||||
<div class="action-toggle">
|
|
||||||
<button class="toggle-btn ${this._urlMode==="companion"?"active":""}"
|
|
||||||
@click=${()=>this._setUrlMode("companion")}>${t("qr_mode_companion",e)}</button>
|
|
||||||
<button class="toggle-btn ${this._urlMode==="local"?"active":""}"
|
|
||||||
@click=${()=>this._setUrlMode("local")}>${t("qr_mode_local",e)}</button>
|
|
||||||
<button class="toggle-btn ${this._urlMode==="server"?"active":""}"
|
|
||||||
@click=${()=>this._setUrlMode("server")}>${t("qr_mode_server",e)}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="dialog-actions">
|
|
||||||
<ha-button appearance="plain" @click=${this._close}>
|
|
||||||
${t("cancel",e)}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button
|
|
||||||
@click=${this._print}
|
|
||||||
.disabled=${!r}
|
|
||||||
>
|
|
||||||
${t("qr_print",e)}
|
|
||||||
</ha-button>
|
|
||||||
</div>
|
|
||||||
</ha-dialog>
|
|
||||||
`}};o.styles=v`
|
|
||||||
.dialog-title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
gap: 16px;
|
|
||||||
min-width: 300px;
|
|
||||||
}
|
|
||||||
.dialog-actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 8px;
|
|
||||||
padding-top: 16px;
|
|
||||||
}
|
|
||||||
.qr-pair {
|
|
||||||
display: flex;
|
|
||||||
gap: 20px;
|
|
||||||
justify-content: center;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.qr-item {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
.qr-image {
|
|
||||||
width: 240px;
|
|
||||||
height: 240px;
|
|
||||||
image-rendering: pixelated;
|
|
||||||
}
|
|
||||||
.qr-image.small {
|
|
||||||
width: 180px;
|
|
||||||
height: 180px;
|
|
||||||
}
|
|
||||||
.qr-item-label {
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.dl-btn {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
background: none;
|
|
||||||
border: 1px solid var(--divider-color, #e0e0e0);
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
padding: 6px 14px;
|
|
||||||
border-radius: 18px;
|
|
||||||
transition: background 0.2s, border-color 0.2s;
|
|
||||||
}
|
|
||||||
.dl-btn:hover {
|
|
||||||
background: var(--secondary-background-color, #f5f5f5);
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
.dl-btn ha-icon {
|
|
||||||
--mdc-icon-size: 18px;
|
|
||||||
}
|
|
||||||
.url-display {
|
|
||||||
font-size: 11px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
word-break: break-all;
|
|
||||||
text-align: center;
|
|
||||||
max-width: 400px;
|
|
||||||
}
|
|
||||||
.loading {
|
|
||||||
padding: 40px 0;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.error {
|
|
||||||
padding: 20px 0;
|
|
||||||
color: var(--error-color, #f44336);
|
|
||||||
}
|
|
||||||
.action-row {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 6px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.action-row label {
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.action-toggle {
|
|
||||||
display: flex;
|
|
||||||
gap: 4px;
|
|
||||||
background: var(--divider-color, #e0e0e0);
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 3px;
|
|
||||||
}
|
|
||||||
.toggle-btn {
|
|
||||||
flex: 1;
|
|
||||||
padding: 8px 12px;
|
|
||||||
border: none;
|
|
||||||
background: transparent;
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
cursor: pointer;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 13px;
|
|
||||||
transition: all 0.2s;
|
|
||||||
line-height: 1.3;
|
|
||||||
}
|
|
||||||
.toggle-btn:hover {
|
|
||||||
background: rgba(0, 0, 0, 0.05);
|
|
||||||
}
|
|
||||||
.toggle-btn.active {
|
|
||||||
background: var(--primary-color);
|
|
||||||
color: var(--text-primary-color, #fff);
|
|
||||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
|
||||||
}
|
|
||||||
`,a([h({attribute:!1})],o.prototype,"hass",2),a([h()],o.prototype,"lang",2),a([c()],o.prototype,"_open",2),a([c()],o.prototype,"_loading",2),a([c()],o.prototype,"_error",2),a([c()],o.prototype,"_viewResult",2),a([c()],o.prototype,"_completeResult",2),a([c()],o.prototype,"_urlMode",2);customElements.get("maintenance-qr-dialog")||customElements.define("maintenance-qr-dialog",o);export{o as a};
|
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*! maintenance_supporter frontend 2.74.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
import{a as x}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-EOLJHFO4.js";import{a,b as v,c as n,f as p,h as b,l as h,m as c,q as t}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-Y2JXJRDF.js";function d(l){return l.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function f(l){return!l.startsWith("data:image/svg+xml,")&&!l.startsWith("data:image/png;base64,")?"":d(l)}function q(l){return l.replace(/[/\\:*?"<>|#%]+/g,"").replace(/\s+/g,"-").toLowerCase().substring(0,100)}var o=class extends b{constructor(){super(...arguments);this.lang="en";this._open=!1;this._loading=!1;this._error="";this._viewResult=null;this._completeResult=null;this._urlMode="companion";this._entryId="";this._taskId=null;this._objectName="";this._taskName="";this._generateSeq=0}openForObject(e,i){this._entryId=e,this._taskId=null,this._objectName=i,this._taskName="",this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}openForTask(e,i,r,s){this._entryId=e,this._taskId=i,this._objectName=r,this._taskName=s,this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}async _generate(){let e=++this._generateSeq;this._loading=!0,this._error="",this._viewResult=null,this._completeResult=null;try{let i={type:"maintenance_supporter/qr/generate",entry_id:this._entryId,url_mode:this._urlMode};this._taskId&&(i.task_id=this._taskId);let r=[this.hass.connection.sendMessagePromise({...i,action:"view"})];this._taskId&&r.push(this.hass.connection.sendMessagePromise({...i,action:"complete"}));let s=await Promise.all(r);if(e!==this._generateSeq)return;this._viewResult=s[0],s.length>1&&(this._completeResult=s[1])}catch(i){if(e!==this._generateSeq)return;let r=i?.code,s=i?.message;this._error=r==="no_url"||typeof s=="string"&&s.includes("No Home Assistant URL")?t("qr_error_no_url",this.lang):t("qr_error",this.lang)}finally{e===this._generateSeq&&(this._loading=!1)}}_setUrlMode(e){this._urlMode!==e&&(this._urlMode=e,this._generate())}_print(){if(!this._viewResult)return;let e=this._viewResult,i=e.label.task_name?`${e.label.object_name} \u2014 ${e.label.task_name}`:e.label.object_name,r=[e.label.manufacturer,e.label.model].filter(Boolean).join(" "),s=window.open("","_blank","width=600,height=500");if(!s)return;let g=this.lang||"en",u=d(i),m=d(r),_=!!this._completeResult,w=d(t("qr_action_view",g)),$=d(t("qr_action_complete",g));s.document.write(`<!DOCTYPE html><html><head><meta charset="utf-8">
|
import{a as x}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-ZSJQYRHU.js";import{a,b as v,c as n,f as p,h as b,l as h,m as c,q as t}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-4OPY4VQ5.js";function d(l){return l.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function f(l){return!l.startsWith("data:image/svg+xml,")&&!l.startsWith("data:image/png;base64,")?"":d(l)}function q(l){return l.replace(/[/\\:*?"<>|#%]+/g,"").replace(/\s+/g,"-").toLowerCase().substring(0,100)}var o=class extends b{constructor(){super(...arguments);this.lang="en";this._open=!1;this._loading=!1;this._error="";this._viewResult=null;this._completeResult=null;this._urlMode="companion";this._entryId="";this._taskId=null;this._objectName="";this._taskName="";this._generateSeq=0}openForObject(e,i){this._entryId=e,this._taskId=null,this._objectName=i,this._taskName="",this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}openForTask(e,i,r,s){this._entryId=e,this._taskId=i,this._objectName=r,this._taskName=s,this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}async _generate(){let e=++this._generateSeq;this._loading=!0,this._error="",this._viewResult=null,this._completeResult=null;try{let i={type:"maintenance_supporter/qr/generate",entry_id:this._entryId,url_mode:this._urlMode};this._taskId&&(i.task_id=this._taskId);let r=[this.hass.connection.sendMessagePromise({...i,action:"view"})];this._taskId&&r.push(this.hass.connection.sendMessagePromise({...i,action:"complete"}));let s=await Promise.all(r);if(e!==this._generateSeq)return;this._viewResult=s[0],s.length>1&&(this._completeResult=s[1])}catch(i){if(e!==this._generateSeq)return;let r=i?.code,s=i?.message;this._error=r==="no_url"||typeof s=="string"&&s.includes("No Home Assistant URL")?t("qr_error_no_url",this.lang):t("qr_error",this.lang)}finally{e===this._generateSeq&&(this._loading=!1)}}_setUrlMode(e){this._urlMode!==e&&(this._urlMode=e,this._generate())}_print(){if(!this._viewResult)return;let e=this._viewResult,i=e.label.task_name?`${e.label.object_name} \u2014 ${e.label.task_name}`:e.label.object_name,r=[e.label.manufacturer,e.label.model].filter(Boolean).join(" "),s=window.open("","_blank","width=600,height=500");if(!s)return;let g=this.lang||"en",u=d(i),m=d(r),_=!!this._completeResult,w=d(t("qr_action_view",g)),$=d(t("qr_action_complete",g));s.document.write(`<!DOCTYPE html><html><head><meta charset="utf-8">
|
||||||
<meta name="color-scheme" content="light">
|
<meta name="color-scheme" content="light">
|
||||||
<title>${u}</title>
|
<title>${u}</title>
|
||||||
<style>
|
<style>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.74.0 */
|
|
||||||
import{q as a}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-Y2JXJRDF.js";var s={entry_id:"object",name:"name",task_type:"maintenance_type",schedule_type:"schedule_type",interval_days:"interval_days",interval_anchor:"interval_anchor",warning_days:"warning_days",last_performed:"last_performed_optional",notes:"notes_optional",documentation_url:"documentation_url_optional",custom_icon:"custom_icon_optional",nfc_tag_id:"nfc_tag_id_optional",responsible_user_id:"responsible_user",entity_slug:"entity_slug",entity_id:"entity_id",area_id:"area_id_optional",manufacturer:"manufacturer_optional",model:"model_optional",serial_number:"serial_number_optional",installation_date:"installation_date_optional",warranty_expiry:"warranty_expiry_optional",checklist:"checklist_steps_optional",reason:"reason",feedback:"feedback",cost:"cost",duration:"duration",description:"description_optional",group_name:"name",group_description:"description_optional",environmental_entity:"environmental_entity_optional",environmental_attribute:"environmental_attribute_optional",trigger_above:"trigger_above",trigger_below:"trigger_below",trigger_equals:"trigger_equals",trigger_not_equals:"trigger_not_equals",trigger_for_minutes:"trigger_for_minutes"};function c(e,o){let r=s[e];if(!r)return e;let t=a(r,o);return t&&t!==r?t:e}function d(e){let r=e.match(/data\['([^']+)'\]/)?.[1],t;return(t=e.match(/length of value must be at most (\d+)/))?{field:r,rule:"too_long",param:t[1]}:(t=e.match(/length of value must be at least (\d+)/))?{field:r,rule:"too_short",param:t[1]}:(t=e.match(/value must be at most (\S+)/))?{field:r,rule:"value_too_high",param:t[1]}:(t=e.match(/value must be at least (\S+)/))?{field:r,rule:"value_too_low",param:t[1]}:/required key not provided/.test(e)?{field:r,rule:"required"}:(t=e.match(/expected (\w+)/))?{field:r,rule:"wrong_type",param:t[1]}:/value must be one of/.test(e)?{field:r,rule:"invalid_choice"}:/not a valid value/.test(e)?{field:r,rule:"invalid_value"}:{field:r,rule:"unknown"}}function g(e,o,r){if(r=r??a("action_error",o),typeof e=="string")return e;if(typeof e!="object"||e===null)return r;let t=e,_=t.message||t.error?.message||"";if(!_)return r;let i=d(_),l=i.field?c(i.field,o):"",n=u=>a(u,o).replace("{field}",l).replace("{n}",i.param??"");switch(i.rule){case"too_long":return n("err_too_long");case"too_short":return n("err_too_short");case"value_too_high":return n("err_value_too_high");case"value_too_low":return n("err_value_too_low");case"required":return n("err_required");case"wrong_type":return n("err_wrong_type").replace("{type}",i.param??"");case"invalid_choice":return n("err_invalid_choice");case"invalid_value":return n("err_invalid_value");default:return _||r}}export{g as a};
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
|
||||||
function c(o,t,e){let l=new Blob([o],{type:e}),d=URL.createObjectURL(l),n=document.createElement("a");n.href=d,n.download=t,n.target="_blank",n.rel="noopener",n.style.display="none",document.body.appendChild(n),n.dispatchEvent(new MouseEvent("click")),document.body.removeChild(n),setTimeout(()=>URL.revokeObjectURL(d),6e4)}function r(o,t){let e=document.createElement("a");e.href=o,e.download=t,e.target="_blank",e.rel="noopener",e.style.display="none",document.body.appendChild(e),e.dispatchEvent(new MouseEvent("click")),document.body.removeChild(e)}export{c as a,r as b};
|
|
||||||
@@ -1,817 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.71.0 */
|
|
||||||
import{b as at,c as it}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-WQQNFFGB.js";import{a as A}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-GJI3RTUI.js";import{A as et,B as nt,D as st,a as m,b as E,c as r,d as S,f as c,h as H,l as j,m as y,n as V,q as i,s as I,t as Q,u as J,v as O,w as X,y as tt}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-PBRIQQ2X.js";var $=class extends H{constructor(){super(...arguments);this._open=!1;this._saving=!1;this._error="";this._draft=null;this._originalSnapshot=null;this._partOptions=null;this._partQty={};this._partQtyOriginal=""}get _lang(){return I(this.hass)}openEdit(t){this._draft={...t},this._originalSnapshot={...t},this._error="",this._open=!0,this._partOptions=null,this._partQty={},this._partQtyOriginal="",this._loadPartOptions()}async _loadPartOptions(){let t=this._draft;if(t)try{let n=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/parts/overview"}),a=[];for(let l of n.parts||[]){let d=l.entry_id===t.entry_id,p=l.consumers.some(u=>u.entry_id===t.entry_id&&u.task_id===t.task_id);!d&&!p||a.push({part_id:l.part_id,name:l.name,entry_id:l.entry_id,foreign:!d,object_name:l.object_name})}for(let l of t.used_parts||[]){let d=l.entry_id||t.entry_id;a.some(p=>p.part_id===l.part_id&&p.entry_id===d)||a.push({part_id:l.part_id,name:l.name||l.part_id,entry_id:d,foreign:d!==t.entry_id,object_name:null})}let o={};for(let l of t.used_parts||[])o[`${l.entry_id||t.entry_id}:${l.part_id}`]=l.quantity??1;this._partOptions=a,this._partQty=o,this._partQtyOriginal=this._partSelectionKey()}catch{this._partOptions=[]}}_partSelectionKey(){return JSON.stringify(Object.entries(this._partQty).filter(([,t])=>t>0).sort(([t],[n])=>t.localeCompare(n)))}close(){this._open=!1,this._error="",this._draft=null,this._originalSnapshot=null}_set(t,n){this._draft&&(this._draft={...this._draft,[t]:n})}async _save(){if(!(!this._draft||!this._originalSnapshot)){this._saving=!0,this._error="";try{let t={type:"maintenance_supporter/task/history/update",entry_id:this._draft.entry_id,task_id:this._draft.task_id,original_timestamp:this._originalSnapshot.original_timestamp};if(this._draft.timestamp!==this._originalSnapshot.timestamp&&(t.timestamp=this._draft.timestamp),this._draft.notes!==this._originalSnapshot.notes&&(t.notes=this._draft.notes),this._draft.cost!==this._originalSnapshot.cost&&(t.cost=this._draft.cost),this._draft.duration!==this._originalSnapshot.duration&&(t.duration=this._draft.duration),this._draft.completed_by!==this._originalSnapshot.completed_by&&(t.completed_by=this._draft.completed_by),this._partOptions!==null&&this._partSelectionKey()!==this._partQtyOriginal&&(t.used_parts=(this._partOptions||[]).filter(a=>(this._partQty[`${a.entry_id}:${a.part_id}`]||0)>0).map(a=>({part_id:a.part_id,quantity:this._partQty[`${a.entry_id}:${a.part_id}`],...a.foreign?{entry_id:a.entry_id}:{}}))),Object.keys(t).filter(a=>!["type","entry_id","task_id","original_timestamp"].includes(a)).length===0){this.close();return}await this.hass.connection.sendMessagePromise(t),this.dispatchEvent(new CustomEvent("history-entry-saved",{detail:{entry_id:this._draft.entry_id,task_id:this._draft.task_id,new_timestamp:this._draft.timestamp},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=A(t,this._lang)}finally{this._saving=!1}}}render(){if(!this._open||!this._draft)return c;let t=this._lang,n=this._draft;return r`
|
|
||||||
<div class="backdrop" @click=${this.close}></div>
|
|
||||||
<div class="dialog" role="dialog" aria-modal="true">
|
|
||||||
<h2>${i("history_edit_title",t)||"Edit history entry"}</h2>
|
|
||||||
<div class="entry-type">
|
|
||||||
<ha-icon icon="mdi:tag-outline"></ha-icon>
|
|
||||||
<span>${i(n.type,t)||n.type}</span>
|
|
||||||
</div>
|
|
||||||
<label>
|
|
||||||
<span>${i("history_edit_timestamp",t)||"Timestamp"}</span>
|
|
||||||
<input type="datetime-local"
|
|
||||||
.value=${n.timestamp.length>=16?n.timestamp.slice(0,16):n.timestamp}
|
|
||||||
@change=${a=>{let o=a.target.value;this._set("timestamp",o.length===16?`${o}:00`:o)}} />
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<span>${i("notes_label",t)}</span>
|
|
||||||
<textarea
|
|
||||||
rows="3"
|
|
||||||
@input=${a=>{let o=a.target.value;this._set("notes",o||null)}}
|
|
||||||
.value=${n.notes??""}></textarea>
|
|
||||||
</label>
|
|
||||||
<div class="row">
|
|
||||||
<label>
|
|
||||||
<span>${i("cost",t)||"Cost"}</span>
|
|
||||||
<input type="number" min="0" step="0.01"
|
|
||||||
.value=${n.cost!=null?String(n.cost):""}
|
|
||||||
@input=${a=>{let o=a.target.value;this._set("cost",o?Number(o):null)}} />
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<span>${i("duration",t)||"Duration (min)"}</span>
|
|
||||||
<input type="number" min="0"
|
|
||||||
.value=${n.duration!=null?String(n.duration):""}
|
|
||||||
@input=${a=>{let o=a.target.value;this._set("duration",o?Number(o):null)}} />
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
${this._partOptions&&this._partOptions.length>0?r`
|
|
||||||
<div class="parts-block">
|
|
||||||
<span class="parts-title">${i("complete_parts_used",t)}</span>
|
|
||||||
${this._partOptions.map(a=>{let o=`${a.entry_id}:${a.part_id}`,l=this._partQty[o]||0;return r`
|
|
||||||
<label class="part-row-edit">
|
|
||||||
<input type="checkbox" .checked=${l>0}
|
|
||||||
@change=${d=>{let p=d.target.checked;this._partQty={...this._partQty,[o]:p?1:0}}} />
|
|
||||||
<span class="part-label">${a.name}${a.foreign&&a.object_name?` (${a.object_name})`:""}</span>
|
|
||||||
${l>0?r`
|
|
||||||
<input class="part-qty" type="number" min="0.01" max="999" step="0.01"
|
|
||||||
.value=${String(l)}
|
|
||||||
@input=${d=>{let p=parseFloat(d.target.value);!isNaN(p)&&p>0&&(this._partQty={...this._partQty,[o]:p})}} />
|
|
||||||
`:c}
|
|
||||||
</label>
|
|
||||||
`})}
|
|
||||||
</div>
|
|
||||||
`:c}
|
|
||||||
${this._error?r`<div class="error">${this._error}</div>`:c}
|
|
||||||
<div class="actions">
|
|
||||||
<button class="cancel" @click=${this.close} ?disabled=${this._saving}>
|
|
||||||
${i("cancel",t)||"Cancel"}
|
|
||||||
</button>
|
|
||||||
<button class="save" @click=${this._save} ?disabled=${this._saving}>
|
|
||||||
${this._saving?i("saving",t)||"Saving\u2026":i("save",t)||"Save"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}};$.styles=E`
|
|
||||||
:host { display: contents; }
|
|
||||||
.backdrop {
|
|
||||||
position: fixed; inset: 0;
|
|
||||||
background: rgba(0,0,0,0.5);
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
.dialog {
|
|
||||||
position: fixed; left: 50%; top: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
width: 95vw; max-width: 480px;
|
|
||||||
background: var(--card-background-color, var(--ha-card-background, #1c1c1c));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 10px 30px rgba(0,0,0,0.4);
|
|
||||||
padding: 20px;
|
|
||||||
display: flex; flex-direction: column; gap: 12px;
|
|
||||||
z-index: 101;
|
|
||||||
max-height: 90vh; overflow: auto;
|
|
||||||
}
|
|
||||||
h2 { margin: 0; font-size: 18px; }
|
|
||||||
.entry-type {
|
|
||||||
display: flex; align-items: center; gap: 6px;
|
|
||||||
color: var(--secondary-text-color); font-size: 13px;
|
|
||||||
}
|
|
||||||
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
|
|
||||||
label span { color: var(--secondary-text-color); }
|
|
||||||
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
|
|
||||||
input, textarea {
|
|
||||||
padding: 8px; font-size: 14px;
|
|
||||||
background: var(--secondary-background-color, #2c2c2c);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color, #444);
|
|
||||||
border-radius: 6px;
|
|
||||||
width: 100%; box-sizing: border-box;
|
|
||||||
font-family: inherit;
|
|
||||||
}
|
|
||||||
.actions {
|
|
||||||
display: flex; gap: 8px; justify-content: flex-end;
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
padding: 8px 16px; font-size: 14px;
|
|
||||||
border-radius: 6px; cursor: pointer;
|
|
||||||
border: none; font-weight: 500;
|
|
||||||
}
|
|
||||||
button.cancel {
|
|
||||||
background: transparent;
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
}
|
|
||||||
button.save {
|
|
||||||
background: var(--primary-color);
|
|
||||||
color: var(--text-primary-color, white);
|
|
||||||
}
|
|
||||||
button[disabled] { opacity: 0.5; cursor: wait; }
|
|
||||||
.error {
|
|
||||||
color: var(--error-color, #d32f2f);
|
|
||||||
font-size: 13px; padding: 8px;
|
|
||||||
background: rgba(211,47,47,0.1);
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
/* #130: parts on the entry */
|
|
||||||
.parts-block {
|
|
||||||
display: flex; flex-direction: column; gap: 6px;
|
|
||||||
border: 1px solid var(--divider-color, #444);
|
|
||||||
border-radius: 6px; padding: 8px;
|
|
||||||
}
|
|
||||||
.parts-title { color: var(--secondary-text-color); font-size: 13px; }
|
|
||||||
.part-row-edit {
|
|
||||||
display: flex; flex-direction: row; align-items: center; gap: 8px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.part-row-edit input[type="checkbox"] { width: auto; }
|
|
||||||
.part-label { flex: 1; color: var(--primary-text-color); }
|
|
||||||
.part-qty { width: 76px; }
|
|
||||||
`,m([j({attribute:!1})],$.prototype,"hass",2),m([y()],$.prototype,"_open",2),m([y()],$.prototype,"_saving",2),m([y()],$.prototype,"_error",2),m([y()],$.prototype,"_draft",2),m([y()],$.prototype,"_partOptions",2),m([y()],$.prototype,"_partQty",2);customElements.get("maintenance-history-edit-dialog")||customElements.define("maintenance-history-edit-dialog",$);var At={days:1,weeks:7,months:30.4368,years:365.25};function U(e,s){return!e||e<=0?0:e*(At[s||"days"]??1)}function Yt(e,s,t){let n=U(e,t);if(n<=0||s==null)return{pct:0,overflow:!1};let a=(n-s)/n*100;return{pct:Math.max(0,Math.min(100,a)),overflow:a>100}}var rt=5;function R(e){let s=e.getFullYear(),t=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${s}-${t}-${n}`}function Lt(e,s){let t=[];for(let n=0;n<s;n++){let a=new Date(e);a.setDate(a.getDate()+n),a.setHours(0,0,0,0),t.push(R(a))}return t}function W(e,s){let[t,n,a]=e.split("-").map(Number),o=new Date(t,n-1,a);return o.setDate(o.getDate()+s),R(o)}function Mt(e){if(!e||e.length===0)return null;let s=e.map(t=>t.cost).filter(t=>typeof t=="number");return s.length===0?null:s.reduce((t,n)=>t+n,0)/s.length}function Dt(e){let{windowStart:s,windowEnd:t,task:n,entryId:a,objectName:o}=e,l=[],d=(_,g)=>({date:_,entry_id:a,task_id:n.id,task_name:n.name,object_name:o,status:g&&(n.status==="overdue"||n.status==="triggered")?"ok":n.status,days_until_due:g?null:n.days_until_due??null,projected:g,schedule_type:n.schedule_type,interval_days:n.interval_days??null,interval_unit:n.interval_unit??null,responsible_user_id:n.responsible_user_id??null,avg_cost:Mt(n.history),adaptive_enabled:!!n.adaptive_config?.enabled,prediction_confidence:n.threshold_prediction_confidence??null}),p=Math.max(1,Math.round(U(n.interval_days,n.interval_unit)));if(n.status==="overdue"||n.status==="triggered"){if(l.push(d(s,!1)),n.schedule_type==="time_based"&&n.interval_days&&n.interval_days>0){let _=W(s,p),g=1;for(;_<=t&&g<rt;)l.push(d(_,!0)),g++,_=W(_,p)}return l}let u=n.next_due;if(typeof u!="string"||!u)return l;let h=u.slice(0,10);if(h>=s&&h<=t)l.push(d(h,!1));else if(h>t)return l;if(n.schedule_type==="time_based"&&n.interval_days&&n.interval_days>0){let _=W(h,p),g=l.length;for(;_<=t&&g<rt;)_>=s&&(l.push(d(_,!0)),g++),_=W(_,p)}return l}var ot={overdue:0,triggered:1,due_soon:2,ok:3};function Xt(e,s,t,n=null){let a=Lt(s,t),o=a[0],l=a[a.length-1],d=[];for(let u of e){let h=u.object?.name||"",_=u.entry_id,g=u.tasks||[];for(let f of g){if(n&&f.responsible_user_id!==n||f.enabled===!1)continue;let x=Dt({windowStart:o,windowEnd:l,task:f,entryId:_,objectName:h});d.push(...x)}}let p=new Map;for(let u of a)p.set(u,[]);for(let u of d){let h=p.get(u.date);h&&h.push(u)}for(let[,u]of p)u.sort((h,_)=>{let g=ot[h.status]??99,f=ot[_.status]??99;if(g!==f)return g-f;if(h.projected!==_.projected)return h.projected?1:-1;let x=h.object_name.localeCompare(_.object_name);return x!==0?x:h.task_name.localeCompare(_.task_name)});return a.map(u=>({date:u,events:p.get(u)??[]}))}var Tt={completed:"ok",reset:"ok",skipped:"due_soon",missed:"overdue",triggered:"triggered",trigger_replaced:"triggered",trigger_removed:"ok"};function Pt(e,s){let t=[];for(let n=s-1;n>=0;n--){let a=new Date(e);a.setDate(a.getDate()-n),a.setHours(0,0,0,0),t.push(R(a))}return t}function te(e,s,t,n=null){let a=Pt(s,t),o=a[0],l=a[a.length-1],d=new Map;for(let u of a)d.set(u,[]);for(let u of e){let h=u.object?.name||"",_=u.entry_id,g=u.tasks||[];for(let f of g){if(n&&f.responsible_user_id!==n)continue;let x=f.history||[];for(let v of x){if(typeof v?.timestamp!="string")continue;let M=v.timestamp.slice(0,10);if(M<o||M>l)continue;let C=d.get(M);if(!C)continue;let D=v.type??"completed";C.push({date:M,entry_id:_,task_id:f.id,task_name:f.name,object_name:h,status:Tt[D]??"ok",days_until_due:null,projected:!1,schedule_type:f.schedule_type,interval_days:f.interval_days??null,responsible_user_id:f.responsible_user_id??null,avg_cost:typeof v.cost=="number"?v.cost:null,adaptive_enabled:!!f.adaptive_config?.enabled,prediction_confidence:null,history_timestamp:v.timestamp,history_type:D,history_cost:typeof v.cost=="number"?v.cost:null,history_notes:typeof v.notes=="string"?v.notes:null,history_duration:typeof v.duration=="number"?v.duration:null})}}}let p={completed:0,reset:1,skipped:2,triggered:3,trigger_replaced:4};for(let[,u]of d)u.sort((h,_)=>{let g=p[h.history_type??""]??99,f=p[_.history_type??""]??99;if(g!==f)return g-f;let x=h.object_name.localeCompare(_.object_name);return x!==0?x:h.task_name.localeCompare(_.task_name)});return a.map(u=>({date:u,events:d.get(u)??[]}))}function It(e,s){if(s<=0)return 0;let t=typeof e=="number"&&Number.isFinite(e)?Math.trunc(e):0;return t<0?0:t%s}function Ct(e){return!!(e?.phases&&e.phase_sequence&&e.phase_sequence.length>0)}function K(e){if(!e||!Ct(e))return null;let s=e.phase_sequence,t=It(e.phase_cursor,s.length),n=s[t],a=e.phases?.[n];return a?{id:n,name:a.name,index:t,count:s.length,notes:a.notes,checklist:a.checklist!==void 0?a.che
Line truncated
|
|
||||||
<div class="weibull-section">
|
|
||||||
<div class="weibull-title">
|
|
||||||
<ha-svg-icon aria-hidden="true" path="M3,14L3.5,14.07L8.07,9.5C7.89,8.85 8.06,8.11 8.59,7.59C9.37,6.8 10.63,6.8 11.41,7.59C11.94,8.11 12.11,8.85 11.93,9.5L14.5,12.07L15,12C15.18,12 15.35,12 15.5,12.07L19.07,8.5C19,8.35 19,8.18 19,8A2,2 0 0,1 21,6A2,2 0 0,1 23,8A2,2 0 0,1 21,10C20.82,10 20.65,10 20.5,9.93L16.93,13.5C17,13.65 17,13.82 17,14A2,2 0 0,1 15,16A2,2 0 0,1 13,14L13.07,13.5L10.5,10.93C10.18,11 9.82,11 9.5,10.93L4.93,15.5L5,16A2,2 0 0,1 3,18A2,2 0 0,1 1,16A2,2 0 0,1 3,14Z"></ha-svg-icon>
|
|
||||||
${i("weibull_reliability_curve",s)}
|
|
||||||
${Et(n,s)}
|
|
||||||
</div>
|
|
||||||
${St(n,a,o,l,s)}
|
|
||||||
${Ht(t,s)}
|
|
||||||
${t?.confidence_interval_low!=null?jt(t,e,s):c}
|
|
||||||
</div>
|
|
||||||
`}function Et(e,s){let t,n,a;return e<.8?(t="early_failures",n="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z",a="beta_early_failures"):e<=1.2?(t="random_failures",n="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,17H11V15H13V17M13,13H11V7H13V13Z",a="beta_random_failures"):e<=3.5?(t="wear_out",n="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,6A6,6 0 0,1 18,12H12V6Z",a="beta_wear_out"):(t="highly_predictable",n="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z",a="beta_highly_predictable"),r`
|
|
||||||
<span class="beta-badge ${t}">
|
|
||||||
<ha-svg-icon path="${n}"></ha-svg-icon>
|
|
||||||
${i(a,s)} (\u03B2=${e.toFixed(2)})
|
|
||||||
</span>
|
|
||||||
`}function St(e,s,t,n,a){let f=Math.max(t,n,s,1)*1.3,x=50,v=[];for(let k=0;k<=x;k++){let w=k/x*f,kt=1-Math.exp(-Math.pow(w/s,e)),$t=32+w/f*260,wt=136-kt*128;v.push([$t,wt])}let M=v.map(([k,w])=>`${k.toFixed(1)},${w.toFixed(1)}`).join(" "),C="M32,136 "+v.map(([k,w])=>`L${k.toFixed(1)},${w.toFixed(1)}`).join(" ")+` L${v[x][0].toFixed(1)},136 Z`,D=32+t/f*260,q=1-Math.exp(-Math.pow(t/s,e)),N=136-q*128,bt=((1-q)*100).toFixed(0),Y=32+n/f*260,xt=[0,.25,.5,.75,1];return r`
|
|
||||||
<div class="weibull-chart">
|
|
||||||
<svg viewBox="0 0 ${300} ${160}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${i("chart_weibull",a)}">
|
|
||||||
${xt.map(k=>{let w=136-k*128;return S`
|
|
||||||
<line x1="${32}" y1="${w.toFixed(1)}" x2="${292}" y2="${w.toFixed(1)}"
|
|
||||||
stroke="var(--divider-color)" stroke-width="0.5" stroke-dasharray="${k===.5?"4,3":c}" />
|
|
||||||
<text x="${28}" y="${(w+3).toFixed(1)}" fill="var(--secondary-text-color)"
|
|
||||||
font-size="8" text-anchor="end">${(k*100).toFixed(0)}%</text>
|
|
||||||
`})}
|
|
||||||
|
|
||||||
<text x="${32}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">0</text>
|
|
||||||
<text x="${324/2}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">${Math.round(f/2)}</text>
|
|
||||||
<text x="${292}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">${Math.round(f)}</text>
|
|
||||||
|
|
||||||
<path d="${C}" fill="var(--primary-color, #03a9f4)" opacity="0.08" />
|
|
||||||
<polyline points="${M}" fill="none"
|
|
||||||
stroke="var(--primary-color, #03a9f4)" stroke-width="2" />
|
|
||||||
|
|
||||||
${t>0?S`
|
|
||||||
<line x1="${D.toFixed(1)}" y1="${8}" x2="${D.toFixed(1)}" y2="${136 .toFixed(1)}"
|
|
||||||
stroke="var(--primary-color, #03a9f4)" stroke-width="1.5" stroke-dasharray="4,3" />
|
|
||||||
<circle cx="${D.toFixed(1)}" cy="${N.toFixed(1)}" r="3"
|
|
||||||
fill="var(--primary-color, #03a9f4)" />
|
|
||||||
<text x="${(D+4).toFixed(1)}" y="${(N-6).toFixed(1)}" fill="var(--primary-color, #03a9f4)"
|
|
||||||
font-size="9" font-weight="600">R=${bt}%</text>
|
|
||||||
`:c}
|
|
||||||
|
|
||||||
${n>0&&n!==t?S`
|
|
||||||
<line x1="${Y.toFixed(1)}" y1="${8}" x2="${Y.toFixed(1)}" y2="${136 .toFixed(1)}"
|
|
||||||
stroke="var(--success-color, #4caf50)" stroke-width="1.5" stroke-dasharray="4,3" />
|
|
||||||
`:c}
|
|
||||||
|
|
||||||
<line x1="${32}" y1="${8}" x2="${32}" y2="${136}"
|
|
||||||
stroke="var(--secondary-text-color)" stroke-width="1" />
|
|
||||||
<line x1="${32}" y1="${136}" x2="${292}" y2="${136}"
|
|
||||||
stroke="var(--secondary-text-color)" stroke-width="1" />
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
<div class="chart-legend">
|
|
||||||
<span class="legend-item"><span class="legend-swatch" style="background:var(--primary-color, #03a9f4)"></span> ${i("weibull_failure_probability",a)}</span>
|
|
||||||
${t>0?r`<span class="legend-item"><span class="legend-swatch" style="background:var(--primary-color, #03a9f4); opacity:0.5"></span> ${i("current_interval_marker",a)}</span>`:c}
|
|
||||||
${n>0&&n!==t?r`<span class="legend-item"><span class="legend-swatch" style="background:var(--success-color, #4caf50)"></span> ${i("recommended_marker",a)}</span>`:c}
|
|
||||||
</div>
|
|
||||||
`}function Ht(e,s){return r`
|
|
||||||
<div class="weibull-info-row">
|
|
||||||
<div class="weibull-info-item">
|
|
||||||
<span>${i("characteristic_life",s)}</span>
|
|
||||||
<span class="weibull-info-value">${Math.round(e.weibull_eta)} ${i("days",s)}</span>
|
|
||||||
</div>
|
|
||||||
${e.weibull_r_squared!=null?r`
|
|
||||||
<div class="weibull-info-item">
|
|
||||||
<span>${i("weibull_r_squared",s)}</span>
|
|
||||||
<span class="weibull-info-value">${e.weibull_r_squared.toFixed(3)}</span>
|
|
||||||
</div>
|
|
||||||
`:c}
|
|
||||||
</div>
|
|
||||||
`}function jt(e,s,t){let n=e.confidence_interval_low,a=e.confidence_interval_high,o=s.suggested_interval??s.interval_days??0,l=s.interval_days??0,d=Math.max(0,n-5),u=a+5-d,h=(n-d)/u*100,_=(a-n)/u*100,g=(o-d)/u*100,f=l>0?(l-d)/u*100:-1;return r`
|
|
||||||
<div class="confidence-range">
|
|
||||||
<div class="confidence-range-title">
|
|
||||||
${i("confidence_interval",t)}: ${o} ${i("days",t)} (${n}\u2013${a})
|
|
||||||
</div>
|
|
||||||
<div class="confidence-bar">
|
|
||||||
<div class="confidence-fill" style="left:${h.toFixed(1)}%;width:${_.toFixed(1)}%"></div>
|
|
||||||
${f>=0?r`<div class="confidence-marker current" style="left:${f.toFixed(1)}%"></div>`:c}
|
|
||||||
<div class="confidence-marker recommended" style="left:${g.toFixed(1)}%"></div>
|
|
||||||
</div>
|
|
||||||
<div class="confidence-labels">
|
|
||||||
<span class="confidence-text low">${i("confidence_conservative",t)} (${n}${i("days",t).charAt(0)})</span>
|
|
||||||
<span class="confidence-text high">${i("confidence_aggressive",t)} (${a}${i("days",t).charAt(0)})</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}function pt(e,s,t){let n=e.degradation_trend!=null&&e.degradation_trend!=="insufficient_data",a=e.days_until_threshold!=null,o=e.environmental_factor!=null&&e.environmental_factor!==1;if(!n&&!a&&!o)return c;let l=e.degradation_trend==="rising"?"M16,6L18.29,8.29L13.41,13.17L9.41,9.17L2,16.59L3.41,18L9.41,12L13.41,16L19.71,9.71L22,12V6H16Z":e.degradation_trend==="falling"?"M16,18L18.29,15.71L13.41,10.83L9.41,14.83L2,7.41L3.41,6L9.41,12L13.41,8L19.71,14.29L22,12V18H16Z":"M22,12L18,8V11H3V13H18V16L22,12Z";return r`
|
|
||||||
<div class="prediction-section">
|
|
||||||
${e.sensor_prediction_urgency?r`
|
|
||||||
<div class="prediction-urgency-banner">
|
|
||||||
<ha-svg-icon path="M1,21H23L12,2L1,21M12,18A1,1 0 0,1 11,17A1,1 0 0,1 12,16A1,1 0 0,1 13,17A1,1 0 0,1 12,18M13,15H11V10H13V15Z"></ha-svg-icon>
|
|
||||||
${i("sensor_prediction_urgency",s).replace("{days}",String(Math.round(e.days_until_threshold||0)))}
|
|
||||||
</div>
|
|
||||||
`:c}
|
|
||||||
<div class="prediction-title">
|
|
||||||
<ha-svg-icon path="M2,2V4H7V2H2M22,2V4H13V2H22M7,7V9H2V7H7M22,7V9H13V7H22M7,12V14H2V12H7M22,12V14H13V12H22M7,17V19H2V17H7M22,17V19H13V17H22M9,2V19L12,22L15,19V2H9M11,4H13V17.17L12,18.17L11,17.17V4Z"></ha-svg-icon>
|
|
||||||
${i("sensor_prediction",s)}
|
|
||||||
</div>
|
|
||||||
<div class="prediction-grid">
|
|
||||||
${n?r`
|
|
||||||
<div class="prediction-item">
|
|
||||||
<ha-svg-icon path="${l}"></ha-svg-icon>
|
|
||||||
<span class="prediction-label">${i("degradation_trend",s)}</span>
|
|
||||||
<span class="prediction-value ${e.degradation_trend}">${i("trend_"+e.degradation_trend,s)}</span>
|
|
||||||
${e.degradation_rate!=null?r`<span class="prediction-rate">${e.degradation_rate>0?"+":""}${Math.abs(e.degradation_rate)>=10?Math.round(e.degradation_rate).toLocaleString():e.degradation_rate.toFixed(1)} ${e.trigger_entity_info?.unit_of_measurement||""}/${i("day_short",s)}</span>`:c}
|
|
||||||
</div>
|
|
||||||
`:c}
|
|
||||||
${a?r`
|
|
||||||
<div class="prediction-item">
|
|
||||||
<ha-svg-icon path="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z"></ha-svg-icon>
|
|
||||||
<span class="prediction-label">${i("days_until_threshold",s)}</span>
|
|
||||||
<span class="prediction-value prediction-days${e.days_until_threshold===0?" exceeded":e.sensor_prediction_urgency?" urgent":""}">${e.days_until_threshold===0?i("threshold_exceeded",s):"~"+Math.round(e.days_until_threshold)+" "+i("days",s)}</span>
|
|
||||||
${e.threshold_prediction_date?r`<span class="prediction-date">${O(e.threshold_prediction_date,s)}</span>`:c}
|
|
||||||
${e.threshold_prediction_confidence?r`<span class="confidence-dot ${e.threshold_prediction_confidence}"></span>`:c}
|
|
||||||
${(e.prediction_cycles??0)>0?r`<span class="prediction-cycles">${i("prediction_cycles",s)}: ${e.prediction_cycles}</span>`:c}
|
|
||||||
</div>
|
|
||||||
`:c}
|
|
||||||
${o&&t.environmental?r`
|
|
||||||
<div class="prediction-item">
|
|
||||||
<ha-svg-icon path="M15,13V5A3,3 0 0,0 12,2A3,3 0 0,0 9,5V13A5,5 0 0,0 7,17A5,5 0 0,0 12,22A5,5 0 0,0 17,17A5,5 0 0,0 15,13M12,4A1,1 0 0,1 13,5V8H11V5A1,1 0 0,1 12,4Z"></ha-svg-icon>
|
|
||||||
<span class="prediction-label">${i("environmental_adjustment",s)}</span>
|
|
||||||
<span class="prediction-value">${e.environmental_factor.toFixed(2)}x</span>
|
|
||||||
${e.environmental_entity?r`<span class="prediction-entity entity-link" @click=${d=>nt(d,e.environmental_entity)}>${e.environmental_entity}</span>`:c}
|
|
||||||
</div>
|
|
||||||
`:c}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}function ut(e,s,t,n){let a=Math.max(e||1,s);return r`
|
|
||||||
<div class="interval-comparison">
|
|
||||||
<div class="interval-bar">
|
|
||||||
<div class="interval-label">
|
|
||||||
${i("current",n)}: ${e??"\u2014"} ${e!=null?i("days",n):""}
|
|
||||||
</div>
|
|
||||||
<div class="interval-visual current"
|
|
||||||
style="width: ${e!=null?Math.min(e/a*100,100):0}%"></div>
|
|
||||||
</div>
|
|
||||||
<div class="interval-bar">
|
|
||||||
<div class="interval-label">
|
|
||||||
${i("recommended",n)}: ${s} ${i("days",n)}
|
|
||||||
<span class="confidence-badge ${t}">${i(`confidence_${t}`,n)}</span>
|
|
||||||
</div>
|
|
||||||
<div class="interval-visual suggested"
|
|
||||||
style="width: ${Math.min(s/a*100,100)}%"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}var ht=["month_jan","month_feb","month_mar","month_apr","month_may","month_jun","month_jul","month_aug","month_sep","month_oct","month_nov","month_dec"];function _t(e,s,t){if(!t.seasonal||!e.seasonal_factor||e.seasonal_factor===1)return c;let n=ht.map(d=>i(d,s)),a=new Date().getMonth(),o=e.seasonal_factors||e.interval_analysis?.seasonal_factors||null,l=o&&o.length===12?o:n.map((d,p)=>{let u=e.seasonal_factor||1,h=Math.sin((p-6)*Math.PI/6)*.3;return Math.max(.7,Math.min(1.3,u+h))});return r`
|
|
||||||
<div class="seasonal-card-compact">
|
|
||||||
<h4>${i("seasonal_awareness",s)}</h4>
|
|
||||||
<div class="seasonal-mini-chart">
|
|
||||||
${l.map((d,p)=>{let u=d*40,h=d<.9?"low":d>1.1?"high":"normal";return r`
|
|
||||||
<div class="seasonal-bar ${h} ${p===a?"current":""}"
|
|
||||||
style="height: ${u}px"
|
|
||||||
title="${n[p]}: ${d.toFixed(2)}x">
|
|
||||||
</div>
|
|
||||||
`})}
|
|
||||||
</div>
|
|
||||||
<div class="seasonal-legend">
|
|
||||||
<span class="legend-item"><span class="dot low"></span> ${i("shorter",s)||"K\xFCrzer"}</span>
|
|
||||||
<span class="legend-item"><span class="dot normal"></span> ${i("normal",s)||"Normal"}</span>
|
|
||||||
<span class="legend-item"><span class="dot high"></span> ${i("longer",s)||"L\xE4nger"}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}function mt(e,s){return Ot(e,s)}function Ot(e,s){let t=e.seasonal_factors??e.interval_analysis?.seasonal_factors;if(!t||t.length!==12)return c;let n=e.interval_analysis?.seasonal_reason,a=new Date().getMonth(),o=300,l=100,d=8,u=l-d-4,h=Math.max(...t,1.5),_=o/12,g=_*.65,f=d+u-1/h*u;return r`
|
|
||||||
<div class="seasonal-chart">
|
|
||||||
<div class="seasonal-chart-title">
|
|
||||||
<ha-svg-icon aria-hidden="true" path="M17.75 4.09L15.22 6.03L16.13 9.09L13.5 7.28L10.87 9.09L11.78 6.03L9.25 4.09L12.44 4L13.5 1L14.56 4L17.75 4.09M21.25 11L19.61 12.25L20.2 14.23L18.5 13.06L16.8 14.23L17.39 12.25L15.75 11L17.81 10.95L18.5 9L19.19 10.95L21.25 11M18.97 15.95C19.8 15.87 20.69 17.05 20.16 17.8C19.84 18.25 19.5 18.67 19.08 19.07C15.17 23 8.84 23 4.94 19.07C1.03 15.17 1.03 8.83 4.94 4.93C5.34 4.53 5.76 4.17 6.21 3.85C6.96 3.32 8.14 4.21 8.06 5.04C7.79 7.9 8.75 10.87 10.95 13.06C13.14 15.26 16.1 16.22 18.97 15.95Z"></ha-svg-icon>
|
|
||||||
${i("seasonal_chart_title",s)}
|
|
||||||
${n?r`<span class="source-tag">${n==="learned"?i("seasonal_learned",s):i("seasonal_manual",s)}</span>`:c}
|
|
||||||
</div>
|
|
||||||
<svg viewBox="0 0 ${o} ${l}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${i("chart_seasonal",s)}">
|
|
||||||
<line x1="0" y1="${f.toFixed(1)}" x2="${o}" y2="${f.toFixed(1)}"
|
|
||||||
stroke="var(--divider-color)" stroke-width="1" stroke-dasharray="4,3" />
|
|
||||||
${t.map((x,v)=>{let M=x/h*u,C=v*_+(_-g)/2,D=d+u-M,q=v===a,N=x<1?"var(--success-color, #4caf50)":x>1?"var(--warning-color, #ff9800)":"var(--secondary-text-color)";return S`
|
|
||||||
<rect x="${C.toFixed(1)}" y="${D.toFixed(1)}"
|
|
||||||
width="${g.toFixed(1)}" height="${M.toFixed(1)}"
|
|
||||||
fill="${N}" opacity="${q?1:.5}" rx="2" />
|
|
||||||
`})}
|
|
||||||
</svg>
|
|
||||||
<div class="seasonal-labels">
|
|
||||||
${ht.map((x,v)=>r`<span class="seasonal-label ${v===a?"active-month":""}">${i(x,s)}</span>`)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}var b=class extends H{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1;this._currencySymbol=""}get _lang(){return I(this.hass)}async openFor(t,n){this._entryId=t,this._taskId=n,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=R(new Date),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});t?.features&&(this._features={...this._features,...t.features}),this._currencySymbol=t?.budget?.currency_symbol||"",this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=t.object?.name||"";let n=(t.tasks||[]).find(a=>a.id===this._taskId);this._task=n??null}catch(t){this._error=A(t,this._lang)}}async _runWs(t){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(t),this._busy=!1,!0}catch(n){return this._error=A(n,this._lang),this._busy=!1,!1}}_notifyChanged(t){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:t},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-GY4RKNUA.js").then(async({openCompleteDialog:t})=>{let n=this._task,a=[];try{a=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0})).objects||[]}catch{}t(lt({entryId:this._entryId,taskId:this._taskId,taskName:n.name,task:n,objects:a,lang:this._lang,checklist:n.checklist||[],adaptiveEnabled:!!n.adaptive_config?.enabled,currencySymbol:this._currencySymbol}))&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-GY4RKNUA.js").then(({openEditTaskDialog:t})=>{t(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-GY4RKNUA.js").then(({openQrDialog:t})=>{t({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let t=i("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(t))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let t=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",t),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=i("suggestion_applied",this._lang)||"Applied",this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){if(!(!this._entryId||!this._taskId)){this._busy=!0,this._error="";try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/analyze_interval",entry_id:this._entryId,
Line truncated
|
|
||||||
<div class="recommendation-card">
|
|
||||||
<h4>${i("suggested_interval",n)}</h4>
|
|
||||||
${ut(t.interval_days,t.suggested_interval,t.interval_confidence||"medium",n)}
|
|
||||||
<div class="recommendation-actions">
|
|
||||||
<button class="btn primary"
|
|
||||||
@click=${this._applySuggestion} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="mdi:check"></ha-icon>
|
|
||||||
${i("apply_suggestion",n)}
|
|
||||||
</button>
|
|
||||||
<button class="btn"
|
|
||||||
@click=${this._reanalyzeInterval} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="mdi:refresh"></ha-icon>
|
|
||||||
${i("reanalyze",n)}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}_renderAdaptive(t){let n=this._lang,a=this._features.adaptive&&t.suggested_interval&&t.suggested_interval!==t.interval_days,o=t.degradation_trend!=null&&t.degradation_trend!=="insufficient_data"||t.days_until_threshold!=null||t.environmental_factor!=null&&t.environmental_factor!==1,l=this._features.adaptive&&t.interval_analysis?.weibull_beta!=null&&t.interval_analysis?.weibull_eta!=null,d=this._features.seasonal&&t.seasonal_factor&&t.seasonal_factor!==1;return!a&&!o&&!l&&!d?r`<div class="adaptive-empty">
|
|
||||||
${i("adaptive_no_data",n)||"Not enough completion history yet for adaptive analysis."}
|
|
||||||
</div>`:r`
|
|
||||||
<div class="adaptive-stack">
|
|
||||||
${this._toast?r`<div class="toast">${this._toast}</div>`:c}
|
|
||||||
${a?this._renderRecommendation(t):c}
|
|
||||||
${o?pt(t,n,this._features):c}
|
|
||||||
${l?dt(t,n):c}
|
|
||||||
${d?r`
|
|
||||||
${_t(t,n,this._features)}
|
|
||||||
${t.seasonal_factors?.length===12||t.interval_analysis?.seasonal_factors?.length===12?mt(t,n):c}
|
|
||||||
`:c}
|
|
||||||
</div>
|
|
||||||
`}_renderDetails(t){let n=this._lang,a=t.history||[],o=a.filter(p=>p.type==="completed"),l=o.reduce((p,u)=>p+(typeof u.cost=="number"?u.cost:0),0),d=(()=>{let p=o.map(u=>typeof u.duration=="number"?u.duration:null).filter(u=>u!=null);return p.length?Math.round(p.reduce((u,h)=>u+h,0)/p.length):null})();return r`
|
|
||||||
<div class="details">
|
|
||||||
<div class="stats-grid">
|
|
||||||
<div class="stat">
|
|
||||||
<span class="stat-label">${i("times_performed",n)||"Performed"}</span>
|
|
||||||
<span class="stat-value">${o.length}</span>
|
|
||||||
</div>
|
|
||||||
<div class="stat">
|
|
||||||
<span class="stat-label">${i("total_cost",n)||"Total cost"}</span>
|
|
||||||
<span class="stat-value">${l.toFixed(2)}</span>
|
|
||||||
</div>
|
|
||||||
<div class="stat">
|
|
||||||
<span class="stat-label">${i("avg_duration",n)||"Avg duration"}</span>
|
|
||||||
<span class="stat-value">${d!=null?`${d}m`:"\u2014"}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="history-header">
|
|
||||||
<strong>${i("history",n)||"History"}</strong>
|
|
||||||
<span class="history-count">${a.length}</span>
|
|
||||||
</div>
|
|
||||||
${a.length===0?r`<div class="history-empty">${i("history_empty",n)||"No history yet."}</div>`:r`
|
|
||||||
<div class="history-list">
|
|
||||||
${[...a].reverse().slice(0,20).map(p=>{let u=["completed","reset","skipped"].includes(p.type);return r`
|
|
||||||
<div class="history-entry">
|
|
||||||
<div class="history-line">
|
|
||||||
<span class="history-type type-${p.type}">${i(p.type,n)}</span>
|
|
||||||
<span class="history-date">${X(p.timestamp,n)}</span>
|
|
||||||
${u?r`<button class="history-edit"
|
|
||||||
title="${i("history_edit_button",n)||"Edit"}"
|
|
||||||
@click=${()=>this._onEditHistoryEntry(p)}>
|
|
||||||
<ha-icon icon="mdi:pencil"></ha-icon>
|
|
||||||
</button>`:c}
|
|
||||||
</div>
|
|
||||||
${p.notes?r`<div class="history-notes">${p.notes}</div>`:c}
|
|
||||||
${p.cost!=null||p.duration!=null?r`<div class="history-meta">
|
|
||||||
${p.cost!=null?r`<span>💰 ${p.cost.toFixed(2)}</span>`:c}
|
|
||||||
${p.duration!=null?r`<span>⏱️ ${p.duration}m</span>`:c}
|
|
||||||
</div>`:c}
|
|
||||||
</div>
|
|
||||||
`})}
|
|
||||||
${a.length>20?r`<div class="history-more">… +${a.length-20} ${i("older_entries",n)||"older"}</div>`:c}
|
|
||||||
</div>
|
|
||||||
`}
|
|
||||||
</div>
|
|
||||||
`}render(){if(!this._open)return c;let t=this._lang,n=this._task,a=this.hass?.user?.is_admin??!0;return r`
|
|
||||||
<div class="backdrop" @click=${this.close}></div>
|
|
||||||
<div class="dialog" role="dialog" aria-modal="true">
|
|
||||||
${n?r`
|
|
||||||
<div class="header">
|
|
||||||
<div class="title">
|
|
||||||
<span class="status-dot" style="background: ${V[n.status]||"#ccc"}"></span>
|
|
||||||
<span class="task-name">${n.name}</span>
|
|
||||||
</div>
|
|
||||||
<div class="object">
|
|
||||||
<button class="link-inline" @click=${()=>{this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-GY4RKNUA.js").then(({openObjectQuickActions:o})=>{o(this._entryId),this.close()})}}>${this._objectName}</button>
|
|
||||||
</div>
|
|
||||||
<div class="quick-info">
|
|
||||||
${n.next_due?r`<span><strong>${i("next_due",t)||"Next due"}:</strong> ${O(n.next_due,t)}</span>`:c}
|
|
||||||
${n.last_performed?r`<span><strong>${i("last_performed",t)||"Last"}:</strong> ${O(n.last_performed,t)}</span>`:c}
|
|
||||||
${n.schedule?.kind&&!["manual","one_time"].includes(n.schedule.kind)||n.interval_days!=null?r`<span><strong>${i("interval",t)||"Interval"}:</strong> ${et(n,t)}</span>`:c}
|
|
||||||
${F(n)?r`<span><strong>${i("phase_current",t)}:</strong> ${F(n)}</span>`:c}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
${this._error?r`<div class="error">${this._error}</div>`:c}
|
|
||||||
|
|
||||||
${this._showSkip?r`
|
|
||||||
<div class="inline-form">
|
|
||||||
<label>${i("skip_reason",t)||"Skip reason (optional)"}</label>
|
|
||||||
<input type="text" .value=${this._skipReason}
|
|
||||||
@input=${o=>{this._skipReason=o.target.value}} />
|
|
||||||
<div class="inline-actions">
|
|
||||||
<button class="btn cancel" @click=${()=>{this._showSkip=!1}} ?disabled=${this._busy}>
|
|
||||||
${i("cancel",t)||"Cancel"}
|
|
||||||
</button>
|
|
||||||
<button class="btn primary" @click=${this._onSkipConfirm} ?disabled=${this._busy}>
|
|
||||||
${i("skip",t)||"Skip"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`:this._showReset?r`
|
|
||||||
<div class="inline-form">
|
|
||||||
<label>${i("reset_to_date",t)||"Reset last_performed to"}</label>
|
|
||||||
<input type="date" .value=${this._resetDate}
|
|
||||||
@input=${o=>{this._resetDate=o.target.value}} />
|
|
||||||
<div class="inline-actions">
|
|
||||||
<button class="btn cancel" @click=${()=>{this._showReset=!1}} ?disabled=${this._busy}>
|
|
||||||
${i("cancel",t)||"Cancel"}
|
|
||||||
</button>
|
|
||||||
<button class="btn primary" @click=${this._onResetConfirm} ?disabled=${this._busy}>
|
|
||||||
${i("reset",t)||"Reset"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`:r`
|
|
||||||
<div class="actions primary-row">
|
|
||||||
<ha-button appearance="accent" variant="success" @click=${this._onComplete} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:check"></ha-icon>
|
|
||||||
${i("complete",t)||"Complete"}
|
|
||||||
</ha-button>
|
|
||||||
${n.allow_skip!==!1?r`
|
|
||||||
<ha-button appearance="outlined" variant="neutral" @click=${()=>{this._showSkip=!0}} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:skip-next"></ha-icon>
|
|
||||||
${i("skip",t)||"Skip"}
|
|
||||||
</ha-button>
|
|
||||||
`:c}
|
|
||||||
<ha-button appearance="outlined" variant="neutral" @click=${()=>{this._showReset=!0}} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:restart"></ha-icon>
|
|
||||||
${i("reset",t)||"Reset"}
|
|
||||||
</ha-button>
|
|
||||||
</div>
|
|
||||||
${a?r`
|
|
||||||
<div class="actions secondary-row">
|
|
||||||
<ha-button size="small" appearance="outlined" variant="neutral" @click=${this._onEdit} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:pencil"></ha-icon>
|
|
||||||
${i("edit",t)||"Edit"}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button size="small" appearance="outlined" variant="neutral" @click=${this._onQr} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:qrcode"></ha-icon>
|
|
||||||
${i("qr_code",t)||"QR"}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button size="small" appearance="outlined" variant="neutral"
|
|
||||||
@click=${n.archived?this._onUnarchive:this._onArchive}
|
|
||||||
.disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="${n.archived?"mdi:archive-arrow-up-outline":"mdi:archive-outline"}"></ha-icon>
|
|
||||||
${n.archived?i("unarchive",t)||"Unarchive":i("archive",t)||"Archive"}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button size="small" appearance="outlined" variant="danger" class="danger" @click=${this._onDelete} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:delete"></ha-icon>
|
|
||||||
${i("delete",t)||"Delete"}
|
|
||||||
</ha-button>
|
|
||||||
</div>
|
|
||||||
`:c}
|
|
||||||
<div class="details-toggle">
|
|
||||||
<button class="link" @click=${()=>{this._showDetails=!this._showDetails}}>
|
|
||||||
<ha-icon icon="${this._showDetails?"mdi:chevron-up":"mdi:chevron-down"}"></ha-icon>
|
|
||||||
${this._showDetails?i("hide_details",t)||"Hide details":i("show_details",t)||"Show history + stats"}
|
|
||||||
</button>
|
|
||||||
${this._features.adaptive||this._features.seasonal||this._features.environmental?r`<button class="link" @click=${()=>{this._showAdaptive=!this._showAdaptive}}>
|
|
||||||
<ha-icon icon="${this._showAdaptive?"mdi:chart-line":"mdi:chart-line-variant"}"></ha-icon>
|
|
||||||
${this._showAdaptive?i("hide_stats",t)||"Hide stats":i("show_stats",t)||"Show stats + graphs"}
|
|
||||||
</button>`:c}
|
|
||||||
</div>
|
|
||||||
${this._showDetails?this._renderDetails(n):c}
|
|
||||||
${this._showAdaptive?this._renderAdaptive(n):c}
|
|
||||||
<div class="footer">
|
|
||||||
<button class="link" @click=${this._onOpenInPanel}>
|
|
||||||
<ha-icon icon="mdi:open-in-new"></ha-icon>
|
|
||||||
${i("open_in_panel",t)||"Open in Maintenance panel"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
`}
|
|
||||||
`:r`<div class="loading">${i("loading",t)||"Loading\u2026"}</div>`}
|
|
||||||
</div>
|
|
||||||
`}};b.styles=[st,E`
|
|
||||||
:host { display: contents; }
|
|
||||||
.backdrop {
|
|
||||||
position: fixed; inset: 0; z-index: 100;
|
|
||||||
background: rgba(0,0,0,0.5);
|
|
||||||
}
|
|
||||||
.dialog {
|
|
||||||
position: fixed; left: 50%; top: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
width: 95vw; max-width: 460px;
|
|
||||||
max-height: 92vh; overflow: auto;
|
|
||||||
background: var(--card-background-color, var(--ha-card-background, #1c1c1c));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 10px 30px rgba(0,0,0,0.4);
|
|
||||||
padding: 20px;
|
|
||||||
display: flex; flex-direction: column; gap: 14px;
|
|
||||||
z-index: 101;
|
|
||||||
}
|
|
||||||
.header { display: flex; flex-direction: column; gap: 6px; }
|
|
||||||
.title { display: flex; align-items: center; gap: 10px; }
|
|
||||||
.status-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
|
|
||||||
.task-name { font-size: 18px; font-weight: 600; }
|
|
||||||
.object { font-size: 13px; color: var(--secondary-text-color); }
|
|
||||||
.link-inline {
|
|
||||||
background: transparent; border: none; padding: 0; cursor: pointer;
|
|
||||||
color: var(--primary-color); font-size: inherit; font-family: inherit;
|
|
||||||
}
|
|
||||||
.link-inline:hover { text-decoration: underline; }
|
|
||||||
.quick-info {
|
|
||||||
display: flex; flex-wrap: wrap; gap: 12px;
|
|
||||||
font-size: 12px; color: var(--secondary-text-color);
|
|
||||||
padding-top: 4px; border-top: 1px solid var(--divider-color);
|
|
||||||
}
|
|
||||||
.quick-info strong { color: var(--primary-text-color); font-weight: 500; }
|
|
||||||
.actions { display: flex; gap: 8px; }
|
|
||||||
.actions.primary-row { gap: 6px; }
|
|
||||||
.actions.primary-row .btn { flex: 1; }
|
|
||||||
.actions.primary-row ha-button { flex: 1; }
|
|
||||||
/* Edit + QR are admin-tools — left-align as a group; Delete is destructive
|
|
||||||
so it gets pushed to the far right with margin-left:auto for visual
|
|
||||||
separation. Earlier this row was flex-end which left a strange empty
|
|
||||||
gap on the left (user feedback). */
|
|
||||||
.actions.secondary-row {
|
|
||||||
padding-top: 8px; border-top: 1px solid var(--divider-color);
|
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
|
||||||
.actions.secondary-row .btn.danger,
|
|
||||||
.actions.secondary-row ha-button.danger {
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
.actions.secondary-row ha-button { --ha-button-font-size: 13px; }
|
|
||||||
.btn {
|
|
||||||
padding: 8px 12px; font-size: 14px;
|
|
||||||
border-radius: 6px; cursor: pointer;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
background: var(--secondary-background-color, transparent);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
font-weight: 500;
|
|
||||||
display: inline-flex; align-items: center; gap: 6px;
|
|
||||||
transition: background 0.12s;
|
|
||||||
}
|
|
||||||
.btn:hover { background: var(--state-icon-color, rgba(255,255,255,0.06)); }
|
|
||||||
.btn[disabled] { opacity: 0.5; cursor: wait; }
|
|
||||||
.btn.primary {
|
|
||||||
background: var(--primary-color);
|
|
||||||
color: var(--text-primary-color, white);
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
.btn.cancel { background: transparent; }
|
|
||||||
.btn.ghost { padding: 6px 10px; font-size: 13px; }
|
|
||||||
.btn.danger { color: var(--error-color); }
|
|
||||||
.btn ha-icon { --mdc-icon-size: 18px; }
|
|
||||||
.inline-form { display: flex; flex-direction: column; gap: 8px; }
|
|
||||||
.inline-form label { font-size: 13px; color: var(--secondary-text-color); }
|
|
||||||
.inline-form input {
|
|
||||||
padding: 8px; font-size: 14px;
|
|
||||||
background: var(--secondary-background-color, #2c2c2c);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color, #444);
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
.inline-actions { display: flex; gap: 8px; justify-content: flex-end; }
|
|
||||||
.footer { display: flex; justify-content: center; padding-top: 4px; }
|
|
||||||
.link {
|
|
||||||
background: transparent; border: none; cursor: pointer;
|
|
||||||
color: var(--primary-color); font-size: 13px;
|
|
||||||
display: inline-flex; align-items: center; gap: 4px;
|
|
||||||
}
|
|
||||||
.link:hover { text-decoration: underline; }
|
|
||||||
.link ha-icon { --mdc-icon-size: 14px; }
|
|
||||||
.loading { padding: 24px; text-align: center; color: var(--secondary-text-color); }
|
|
||||||
.error {
|
|
||||||
padding: 8px; border-radius: 6px;
|
|
||||||
background: rgba(211,47,47,0.1);
|
|
||||||
color: var(--error-color, #d32f2f); font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Details (expandable Show details section) */
|
|
||||||
.details-toggle { display: flex; justify-content: center; margin-top: 4px; }
|
|
||||||
.details {
|
|
||||||
display: flex; flex-direction: column; gap: 12px;
|
|
||||||
border-top: 1px solid var(--divider-color);
|
|
||||||
padding-top: 12px;
|
|
||||||
}
|
|
||||||
.stats-grid {
|
|
||||||
display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
|
|
||||||
}
|
|
||||||
.stat {
|
|
||||||
display: flex; flex-direction: column; gap: 2px;
|
|
||||||
background: var(--secondary-background-color, rgba(255,255,255,0.04));
|
|
||||||
padding: 8px; border-radius: 6px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.stat-label { font-size: 11px; color: var(--secondary-text-color); text-transform: uppercase; letter-spacing: 0.5px; }
|
|
||||||
.stat-value { font-size: 16px; font-weight: 600; }
|
|
||||||
.history-header {
|
|
||||||
display: flex; align-items: baseline; gap: 8px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.history-count {
|
|
||||||
font-size: 12px; color: var(--secondary-text-color);
|
|
||||||
background: var(--secondary-background-color); padding: 2px 8px; border-radius: 999px;
|
|
||||||
}
|
|
||||||
.history-empty { color: var(--secondary-text-color); font-style: italic; font-size: 13px; }
|
|
||||||
.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow: auto; }
|
|
||||||
.history-entry {
|
|
||||||
padding: 6px 8px; border-radius: 6px;
|
|
||||||
background: var(--secondary-background-color, rgba(255,255,255,0.03));
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.history-line {
|
|
||||||
display: flex; align-items: center; gap: 8px;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.history-type {
|
|
||||||
font-weight: 600; font-size: 11px;
|
|
||||||
padding: 2px 6px; border-radius: 4px;
|
|
||||||
text-transform: uppercase; letter-spacing: 0.5px;
|
|
||||||
}
|
|
||||||
.type-completed { background: rgba(46,125,50,0.2); color: #66bb6a; }
|
|
||||||
.type-skipped { background: rgba(158,158,158,0.2); color: var(--secondary-text-color); }
|
|
||||||
.type-reset { background: rgba(33,150,243,0.2); color: #64b5f6; }
|
|
||||||
.type-triggered { background: rgba(255,87,34,0.2); color: #ff8a65; }
|
|
||||||
.history-date { font-size: 11px; color: var(--secondary-text-color); flex: 1; text-align: right; }
|
|
||||||
.history-edit {
|
|
||||||
background: transparent; border: none; cursor: pointer;
|
|
||||||
padding: 4px; border-radius: 4px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.history-edit:hover { background: var(--state-icon-color, rgba(255,255,255,0.06)); color: var(--primary-color); }
|
|
||||||
.history-edit ha-icon { --mdc-icon-size: 14px; }
|
|
||||||
.history-notes { margin-top: 4px; color: var(--primary-text-color); }
|
|
||||||
.history-meta { display: flex; gap: 12px; margin-top: 4px; color: var(--secondary-text-color); font-size: 11px; }
|
|
||||||
.history-more { padding: 8px; text-align: center; font-size: 12px; color: var(--secondary-text-color); font-style: italic; }
|
|
||||||
|
|
||||||
/* Adaptive section — wraps the panel renderers (which assume sharedStyles
|
|
||||||
are present) and adds dialog-specific layout. */
|
|
||||||
.adaptive-stack {
|
|
||||||
display: flex; flex-direction: column; gap: 12px;
|
|
||||||
border-top: 1px solid var(--divider-color);
|
|
||||||
padding-top: 12px;
|
|
||||||
}
|
|
||||||
.adaptive-empty {
|
|
||||||
padding: 16px; text-align: center;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-style: italic; font-size: 13px;
|
|
||||||
border-top: 1px solid var(--divider-color);
|
|
||||||
}
|
|
||||||
.toast {
|
|
||||||
padding: 8px 12px; border-radius: 6px;
|
|
||||||
background: rgba(76, 175, 80, 0.15);
|
|
||||||
color: #4caf50; font-size: 13px; font-weight: 500;
|
|
||||||
}
|
|
||||||
/* The panel's recommendation-card uses ha-button. We use plain <button>
|
|
||||||
in this dialog's button styles. Re-style the action row to match. */
|
|
||||||
.recommendation-actions {
|
|
||||||
display: flex; gap: 8px; margin-top: 8px;
|
|
||||||
}
|
|
||||||
/* Constrain SVG charts so they fit the dialog width even on mobile. */
|
|
||||||
.weibull-section, .seasonal-card-compact { max-width: 100%; }
|
|
||||||
.weibull-chart svg { max-width: 100%; height: auto; }
|
|
||||||
.details-toggle { gap: 12px; flex-wrap: wrap; }
|
|
||||||
`],m([j({attribute:!1})],b.prototype,"hass",2),m([y()],b.prototype,"_open",2),m([y()],b.prototype,"_entryId",2),m([y()],b.prototype,"_taskId",2),m([y()],b.prototype,"_task",2),m([y()],b.prototype,"_objectName",2),m([y()],b.prototype,"_busy",2),m([y()],b.prototype,"_error",2),m([y()],b.prototype,"_showSkip",2),m([y()],b.prototype,"_showReset",2),m([y()],b.prototype,"_showDetails",2),m([y()],b.prototype,"_showAdaptive",2),m([y()],b.prototype,"_skipReason",2),m([y()],b.prototype,"_resetDate",2),m([y()],b.prototype,"_features",2),m([y()],b.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",b);function ft(e){return!!e&&/^https?:\/\//i.test(e)}function yt(e){return e?customElements.get("ha-markdown")?r`<ha-markdown class="notes-md" .content=${e} breaks></ha-markdown>`:r`${e}`:c}var L=class extends H{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return I(this.hass)}async openFor(t){this._entryId=t,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=t}catch(t){this._error=A(t,this._lang)}}_onEditObject(){!this._entryId||!this._data||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-GY4RKNUA.js").then(({openEditObjectDialog:t})=>{t(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-GY4RKNUA.js").then(({openCreateTaskDialog:t})=>{t(this._entryId),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let t=i("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(t)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(n){this._error=A(n,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let t=!!this._data.object.archived;if(!t){let n=i("confirm_archive_object",this._lang)||"Archive this object and its tasks?";if(!window.confirm(n))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:t?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(n){this._error=A(n,this._lang)}finally{this._busy=!1}}_onTaskClick(t){this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-GY4RKNUA.js").then(({openTaskQuickActions:n})=>{n(this._entryId,t)})}render(){if(!this._open)return c;let t=this._lang,n=this._data,a=n?.object,o=n?.tasks||[],l=this.hass?.user?.is_admin??!0;return r`
|
|
||||||
<div class="backdrop" @click=${this.close}></div>
|
|
||||||
<div class="dialog" role="dialog" aria-modal="true">
|
|
||||||
${n&&a?r`
|
|
||||||
<div class="header">
|
|
||||||
<div class="title">${a.name}</div>
|
|
||||||
${this._renderMetaRow(a)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
${this._error?r`<div class="error">${this._error}</div>`:c}
|
|
||||||
|
|
||||||
<div class="tasks-section">
|
|
||||||
<div class="section-header">
|
|
||||||
<strong>${i("tasks",t)||"Tasks"}</strong>
|
|
||||||
<span class="count">${o.length}</span>
|
|
||||||
</div>
|
|
||||||
${o.length===0?r`<div class="empty">${i("no_tasks",t)||"No tasks yet."}</div>`:r`
|
|
||||||
<div class="task-list">
|
|
||||||
${o.map(d=>r`
|
|
||||||
<div class="task-row" @click=${()=>this._onTaskClick(d.id)}>
|
|
||||||
<span class="status-dot" style="background: ${V[d.status]||"#ccc"}"></span>
|
|
||||||
<span class="task-name">${d.name}</span>
|
|
||||||
<span class="task-status">${i(d.status||"ok",t)}</span>
|
|
||||||
</div>
|
|
||||||
`)}
|
|
||||||
</div>
|
|
||||||
`}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
${a.notes?r`
|
|
||||||
<div class="notes-section">
|
|
||||||
<strong>${i("object_notes_label",t)}</strong>
|
|
||||||
<div class="notes-body">${yt(a.notes)}</div>
|
|
||||||
</div>
|
|
||||||
`:c}
|
|
||||||
|
|
||||||
${l?r`
|
|
||||||
<div class="actions">
|
|
||||||
<button class="btn primary" @click=${this._onAddTask} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="mdi:plus"></ha-icon>
|
|
||||||
${i("add_task",t)||"Add task"}
|
|
||||||
</button>
|
|
||||||
<button class="btn" @click=${this._onEditObject} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="mdi:pencil"></ha-icon>
|
|
||||||
${i("edit",t)||"Edit"}
|
|
||||||
</button>
|
|
||||||
<button class="btn" @click=${this._onArchiveObject} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="${a.archived?"mdi:archive-arrow-up-outline":"mdi:archive-outline"}"></ha-icon>
|
|
||||||
${a.archived?i("unarchive_object",t)||"Unarchive object":i("archive_object",t)||"Archive object"}
|
|
||||||
</button>
|
|
||||||
<button class="btn danger" @click=${this._onDelete} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="mdi:delete"></ha-icon>
|
|
||||||
${i("delete",t)||"Delete"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
`:c}
|
|
||||||
`:r`<div class="loading">${i("loading",t)||"Loading\u2026"}</div>`}
|
|
||||||
</div>
|
|
||||||
`}_renderMetaRow(t){let n=this._lang,a=[];return t.area_id&&a.push([i("area",n),t.area_id]),t.manufacturer&&a.push([i("manufacturer",n),t.manufacturer]),t.model&&a.push([i("model",n),t.model]),t.serial_number&&a.push([i("serial_number_label",n),t.serial_number]),t.installation_date&&a.push([i("installed",n),t.installation_date]),t.warranty_expiry&&a.push([i("warranty",n),t.warranty_expiry]),t.documentation_url&&a.push([i("documentation_url_label",n),t.documentation_url]),a.length===0?c:r`
|
|
||||||
<div class="meta">
|
|
||||||
${a.map(([o,l])=>r`
|
|
||||||
<div class="meta-item">
|
|
||||||
<span class="meta-label">${o}</span>
|
|
||||||
<span class="meta-value">${ft(l)?r`<a href="${l}" target="_blank" rel="noopener noreferrer">${l}</a>`:l}</span>
|
|
||||||
</div>
|
|
||||||
`)}
|
|
||||||
</div>
|
|
||||||
`}};L.styles=E`
|
|
||||||
:host { display: contents; }
|
|
||||||
.backdrop {
|
|
||||||
position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.5);
|
|
||||||
}
|
|
||||||
.dialog {
|
|
||||||
position: fixed; left: 50%; top: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
width: 95vw; max-width: 480px;
|
|
||||||
max-height: 92vh; overflow: auto;
|
|
||||||
background: var(--card-background-color, var(--ha-card-background, #1c1c1c));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 10px 30px rgba(0,0,0,0.4);
|
|
||||||
padding: 20px; z-index: 101;
|
|
||||||
display: flex; flex-direction: column; gap: 14px;
|
|
||||||
}
|
|
||||||
.header { display: flex; flex-direction: column; gap: 6px; }
|
|
||||||
.title { font-size: 20px; font-weight: 600; }
|
|
||||||
.meta { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; border-top: 1px solid var(--divider-color); }
|
|
||||||
.meta-item { display: flex; gap: 8px; font-size: 12px; }
|
|
||||||
.meta-label { color: var(--secondary-text-color); min-width: 100px; }
|
|
||||||
.meta-value { color: var(--primary-text-color); flex: 1; word-break: break-word; }
|
|
||||||
.meta-value a { color: var(--primary-color); }
|
|
||||||
.tasks-section, .notes-section { display: flex; flex-direction: column; gap: 6px; }
|
|
||||||
.section-header { display: flex; align-items: baseline; gap: 8px; }
|
|
||||||
.count {
|
|
||||||
font-size: 11px; color: var(--secondary-text-color);
|
|
||||||
background: var(--secondary-background-color); padding: 2px 8px; border-radius: 999px;
|
|
||||||
}
|
|
||||||
.empty { color: var(--secondary-text-color); font-style: italic; font-size: 13px; padding: 8px 0; }
|
|
||||||
.task-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow: auto; }
|
|
||||||
.task-row {
|
|
||||||
display: flex; align-items: center; gap: 10px;
|
|
||||||
padding: 8px; border-radius: 6px; cursor: pointer;
|
|
||||||
background: var(--secondary-background-color, rgba(255,255,255,0.03));
|
|
||||||
transition: background 0.12s;
|
|
||||||
}
|
|
||||||
.task-row:hover { background: var(--state-icon-color, rgba(255,255,255,0.06)); }
|
|
||||||
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
|
|
||||||
.task-name { flex: 1; font-size: 14px; }
|
|
||||||
.task-status { font-size: 11px; color: var(--secondary-text-color); text-transform: uppercase; }
|
|
||||||
.notes-body { white-space: pre-wrap; font-size: 13px; padding: 8px; background: var(--secondary-background-color); border-radius: 6px; }
|
|
||||||
.notes-body ha-markdown { white-space: normal; }
|
|
||||||
.actions { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--divider-color); }
|
|
||||||
.actions .btn { flex: 1; }
|
|
||||||
.btn {
|
|
||||||
padding: 8px; font-size: 13px; border-radius: 6px; cursor: pointer;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
background: var(--secondary-background-color, transparent);
|
|
||||||
color: var(--primary-text-color); font-weight: 500;
|
|
||||||
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
|
||||||
}
|
|
||||||
.btn:hover { background: var(--state-icon-color, rgba(255,255,255,0.06)); }
|
|
||||||
.btn[disabled] { opacity: 0.5; cursor: wait; }
|
|
||||||
.btn.primary { background: var(--primary-color); color: var(--text-primary-color, white); border-color: var(--primary-color); }
|
|
||||||
.btn.danger { color: var(--error-color); }
|
|
||||||
.btn ha-icon { --mdc-icon-size: 16px; }
|
|
||||||
.loading { padding: 24px; text-align: center; color: var(--secondary-text-color); }
|
|
||||||
.error { padding: 8px; border-radius: 6px; background: rgba(211,47,47,0.1); color: var(--error-color); font-size: 13px; }
|
|
||||||
`,m([j({attribute:!1})],L.prototype,"hass",2),m([y()],L.prototype,"_open",2),m([y()],L.prototype,"_entryId",2),m([y()],L.prototype,"_data",2),m([y()],L.prototype,"_busy",2),m([y()],L.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",L);var gt="maintenance-object-dialog",vt="maintenance-task-dialog",Rt="maintenance-history-edit-dialog",Ft="maintenance-complete-dialog",zt="maintenance-qr-dialog",qt="maintenance-task-quick-actions-dialog",Nt="maintenance-object-quick-actions-dialog";function B(){return document.querySelector("home-assistant")?.hass}function Vt(){return document.querySelector("home-assistant")?.shadowRoot??document.body}function T(e){let s=Vt(),t=s.querySelector(e)??document.body.querySelector(e);return t?t.parentNode!==s&&s.appendChild(t):(t=document.createElement(e),s.appendChild(t)),t}function P(e){let s=B();if(!s)return!1;e.hass=s;let t=I(s);return Q(t)||J(t).then(()=>{e.requestUpdate?.()}),!0}var G={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7,rowActionStyle:"buttons_compact"};function Qe(e){return Z(e).then(s=>s.rowActionStyle)}function Je(){z=null}var z=null;function Z(e){return z||(z=e.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(s=>({features:s.features??G.features,defaultWarningDays:s.general?.default_warning_days??7,rowActionStyle:s.general?.row_action_style??G.rowActionStyle})).catch(()=>G),z)}function Xe(){let e=T(gt);return P(e)?(e.openCreate(),!0):!1}function tn(e,s){let t=T(gt);return P(t)?(t.openEdit(e,s),!0):!1}function en(e="",s){let t=T(vt);if(!P(t))return!1;let n=B();return n?((async()=>{let a=await Z(n),o=t;o.checklistsEnabled=a.features.checklists,o.scheduleTimeEnabled=a.features.schedule_time,o.completionActionsEnabled=a.features.completion_actions,o.defaultWarningDays=a.defaultWarningDays,o.openCreate(e,s)})(),!0):!1}function nn(e,s){let t=T(vt);if(!P(t))return!1;let n=B();return n?((async()=>{try{let[a,o]=await Promise.all([n.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:e}),Z(n)]),l=(a.tasks||[]).find(p=>p.id===s);if(!l){console.warn(`openEditTaskDialog: task ${s} not found in entry ${e}`);return}let d=t;d.checklistsEnabled=o.features.checklists,d.scheduleTimeEnabled=o.features.schedule_time,d.completionActionsEnabled=o.features.completion_actions,d.defaultWarningDays=o.defaultWarningDays,await d.openEdit(e,l)}catch(a){console.warn("openEditTaskDialog: failed to load task/features",a)}})(),!0):!1}function sn(e){let s=T(Rt);return P(s)?(s.openEdit(e),!0):!1}function an(e){let s=T(Ft);return P(s)?(ct(s,e,B()?.language||"en"),!0):!1}function rn(e){let s=T(zt);return P(s)?(s.openForTask(e.entry_id,e.task_id,e.object_name,e.task_name),!0):!1}function on(e,s){let t=T(qt);return P(t)?(t.openFor(e,s),!0):!1}function ln(e){let s=T(Nt);return P(s)?(s.openFor(e),!0):!1}export{ft as a,Yt as b,yt as c,It as d,Ct as e,K as f,lt as g,ct as h,R as i,Xt as j,te as k,dt as l,pt as m,ut as n,_t as o,mt as p,Qe as q,Je as r,Xe as s,tn as t,en as u,nn as v,sn as w,an as x,rn as y,on as z,ln as A};
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.74.0 */
|
|
||||||
import{a as r,b as l,c as i,f as o,h as n,l as t}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-Y2JXJRDF.js";var e=class extends n{constructor(){super(...arguments);this.label="";this.value="";this.placeholder="";this.type="text";this.required=!1;this.disabled=!1;this.multiline=!1;this.rows=3}_onInput(s){let a=s.target.value;this.value=a,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:a}}))}render(){return i`
|
|
||||||
<label class="field">
|
|
||||||
${this.label?i`<span class="label">${this.label}${this.required?i`<span class="req">*</span>`:o}</span>`:o}
|
|
||||||
${this.multiline?i`
|
|
||||||
<textarea
|
|
||||||
.value=${this.value??""}
|
|
||||||
rows=${this.rows}
|
|
||||||
?required=${this.required}
|
|
||||||
?disabled=${this.disabled}
|
|
||||||
placeholder=${this.placeholder}
|
|
||||||
@input=${this._onInput}
|
|
||||||
@change=${this._onInput}
|
|
||||||
></textarea>`:i`
|
|
||||||
<input
|
|
||||||
.value=${this.value??""}
|
|
||||||
.type=${this.type}
|
|
||||||
?required=${this.required}
|
|
||||||
?disabled=${this.disabled}
|
|
||||||
placeholder=${this.placeholder}
|
|
||||||
step=${this.step??o}
|
|
||||||
min=${this.min??o}
|
|
||||||
max=${this.max??o}
|
|
||||||
pattern=${this.pattern??o}
|
|
||||||
@input=${this._onInput}
|
|
||||||
@change=${this._onInput}
|
|
||||||
/>`}
|
|
||||||
${this.helper?i`<span class="helper">${this.helper}</span>`:o}
|
|
||||||
</label>
|
|
||||||
`}};e.styles=l`
|
|
||||||
:host { display: block; }
|
|
||||||
.field {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 4px;
|
|
||||||
}
|
|
||||||
.label {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--secondary-text-color, #888);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
.req { color: var(--error-color, #f44336); margin-left: 2px; }
|
|
||||||
input {
|
|
||||||
padding: 8px 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color, rgba(255,255,255,0.12));
|
|
||||||
border-radius: 6px;
|
|
||||||
font-family: inherit;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
input:focus {
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
input:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
||||||
textarea {
|
|
||||||
padding: 8px 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color, rgba(255,255,255,0.12));
|
|
||||||
border-radius: 6px;
|
|
||||||
font-family: inherit;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
outline: none;
|
|
||||||
resize: vertical;
|
|
||||||
}
|
|
||||||
textarea:focus { border-color: var(--primary-color); }
|
|
||||||
textarea:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
||||||
.helper {
|
|
||||||
font-size: 11px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
`,r([t()],e.prototype,"label",2),r([t()],e.prototype,"value",2),r([t()],e.prototype,"placeholder",2),r([t()],e.prototype,"type",2),r([t({type:Boolean})],e.prototype,"required",2),r([t({type:Boolean})],e.prototype,"disabled",2),r([t()],e.prototype,"step",2),r([t()],e.prototype,"min",2),r([t()],e.prototype,"max",2),r([t()],e.prototype,"pattern",2),r([t()],e.prototype,"helper",2),r([t({type:Boolean})],e.prototype,"multiline",2),r([t({type:Number})],e.prototype,"rows",2);customElements.get("ms-textfield")||customElements.define("ms-textfield",e);
|
|
||||||
+15
-6
@@ -1,7 +1,7 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
import{a as C,d as U,i as D,j,k as q,l as A}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-XMX3E3HG.js";import{e as z}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-PRQXFMNO.js";import{a as B}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-3IZWSKBJ.js";import{D as k,E as M,a as n,b as N,c as o,f as p,h as H,l as x,m as l,q as s,s as R,w as F,z as O}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-NAI3MD3R.js";var P=["sensor","binary_sensor","number","input_number","input_boolean","switch","climate","vacuum","cover","fan","light","water_heater","humidifier","media_player","weather","air_quality","valve","lawn_mower","lock"],V=["sensor"],W=["temperature","humidity","pressure"];var X=["cleaning","inspection","replacement","calibration","service","reading","custom"],Z=["low","normal","high"],ee=["time_based","weekdays","nth_weekday","day_of_month","sensor_based","one_time","manual"],w=["weekdays","nth_weekday","day_of_month"],K=["time_based","one_time",...w],Y=["threshold","counter","state_change","runtime"],te=[...Y,"compound"],b={alpha:"0.3",min:"7",max:"365"};function ie(){return{entityIds:"",type:"threshold",attribute:"",above:"",below:"",equals:"",notEquals:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}var se=new Set(["entity_id","entity_ids","type","attribute","trigger_above","trigger_below","trigger_equals","trigger_not_equals","trigger_for_minutes","trigger_target_value","trigger_delta_mode","trigger_from_state","trigger_to_state","trigger_target_changes","trigger_runtime_hours","trigger_on_states"]);function re(u){return{entityIds:(u.entity_ids||(u.entity_id?[u.entity_id]:[])).join(", "),type:u.type||"threshold",attribute:u.attribute||"",above:u.trigger_above?.toString()??"",below:u.trigger_below?.toString()??"",equals:u.trigger_equals?.toString()??"",notEquals:u.trigger_not_equals?.toString()??"",forMinutes:u.trigger_for_minutes?.toString()??"0",targetValue:u.trigger_target_value?.toString()??"",deltaMode:u.trigger_delta_mode||!1,fromState:u.trigger_from_state||"",toState:u.trigger_to_state||"",targetChanges:u.trigger_target_changes?.toString()??"",runtimeHours:u.trigger_runtime_hours?.toString()??"",onStates:(u.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(u).filter(([e])=>!se.has(e)&&!e.startsWith("_")))}}function ae(u){let y=u.entityIds.split(",").map(i=>i.trim()).filter(Boolean);if(y.length===0)return null;let e={...u.carry||{},entity_id:y[0],entity_ids:y,type:u.type};if(u.attribute&&(e.attribute=u.attribute),u.type==="threshold"){let i=parseFloat(u.above);isNaN(i)||(e.trigger_above=i);let t=parseFloat(u.below);isNaN(t)||(e.trigger_below=t);let r=parseFloat(u.equals);isNaN(r)||(e.trigger_equals=r);let _=parseFloat(u.notEquals);isNaN(_)||(e.trigger_not_equals=_);let c=parseInt(u.forMinutes,10);isNaN(c)||(e.trigger_for_minutes=c)}else if(u.type==="counter"){let i=parseFloat(u.targetValue);isNaN(i)||(e.trigger_target_value=i),e.trigger_delta_mode=u.deltaMode}else if(u.type==="state_change"){u.fromState&&(e.trigger_from_state=u.fromState),u.toState&&(e.trigger_to_state=u.toState);let i=parseInt(u.targetChanges,10);isNaN(i)||(e.trigger_target_changes=i)}else if(u.type==="runtime"){let i=parseFloat(u.runtimeHours);isNaN(i)||(e.trigger_runtime_hours=i);let t=(u.onStates||"").split(",").map(r=>r.trim()).filter(Boolean);t.length>0&&(e.trigger_on_states=t)}return e}function ne(u){return Array.from({length:7},(y,e)=>k(e,u,"short"))}function oe(u){return Array.from({length:12},(y,e)=>M(e,u,"short"))}var a=class a extends H{constructor(){super(...arguments);this.checklistsEnabled=!1;this.scheduleTimeEnabled=!1;this.completionActionsEnabled=!1;this.defaultWarningDays=7;this.parts=[];this._foreignOwners=[];this._open=!1;this._entityPickerFallback=!1;this._pickerProbeStrikes=0;this._loading=!1;this._error="";this._entryId="";this._taskId=null;this._objectChoices=[];this._name="";this._type="custom";this._scheduleType="time_based";this._intervalDays="30";this._intervalUnit="days";this._dueDate="";this._warningDays="7";this._earliestCompletionDays="";this._intervalAnchor="completion";this._weekdays=[];this._nth="1";this._nthWeekday="5";this._domDay="1";this._domLastDay=!1;this._domBusiness=!1;this._calOffset="0";this._seasonMonths=[];this._endsMode="never";this._endsCount="";this._endsUntil="";this._schedulePreview=[];this._schedulePreviewEnded=!1;this._previewSeq=0;this._notes="";this._documentationUrl="";this._customIcon="";this._priority="normal";this._labels="";this._enabled=!0;this._triggerEntityId="";this._triggerEntityIds=[];this._triggerEntityLogic="any";this._triggerAttribute="";this._triggerType="threshold";this._triggerAbove="";this._triggerBelow="";this._triggerEquals="";this._triggerNotEquals="";this._triggerForMinutes="0";this._triggerCombinator="any";this._triggerTargetValue="";this._triggerDeltaMode=!1;this._triggerBaselineValue="";this._liveBaselineValLine truncated
|
import{a as C,d as U,i as D,j,k as q,l as A}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-Z4FQHWRJ.js";import{e as z}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-B4ELBSAY.js";import{a as B}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-XCPYIT7M.js";import{D as k,E as M,a as n,b as N,c as o,f as p,h as H,l as E,m as l,q as s,s as R,w as F,z as O}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-4OPY4VQ5.js";var P=["sensor","binary_sensor","number","input_number","input_boolean","switch","climate","vacuum","cover","fan","light","water_heater","humidifier","media_player","weather","air_quality","valve","lawn_mower","lock"],V=["sensor"],W=["temperature","humidity","pressure"];var X=["cleaning","inspection","replacement","calibration","service","reading","custom"],Z=["low","normal","high"],ee=["time_based","weekdays","nth_weekday","day_of_month","sensor_based","one_time","manual"],w=["weekdays","nth_weekday","day_of_month"],K=["time_based","one_time",...w],Y=["threshold","counter","state_change","runtime"],te=[...Y,"compound"],b={alpha:"0.3",min:"7",max:"365"};function ie(){return{entityIds:"",type:"threshold",attribute:"",above:"",below:"",equals:"",notEquals:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}var se=new Set(["entity_id","entity_ids","type","attribute","trigger_above","trigger_below","trigger_equals","trigger_not_equals","trigger_for_minutes","trigger_target_value","trigger_delta_mode","trigger_from_state","trigger_to_state","trigger_target_changes","trigger_runtime_hours","trigger_on_states"]);function re(u){return{entityIds:(u.entity_ids||(u.entity_id?[u.entity_id]:[])).join(", "),type:u.type||"threshold",attribute:u.attribute||"",above:u.trigger_above?.toString()??"",below:u.trigger_below?.toString()??"",equals:u.trigger_equals?.toString()??"",notEquals:u.trigger_not_equals?.toString()??"",forMinutes:u.trigger_for_minutes?.toString()??"0",targetValue:u.trigger_target_value?.toString()??"",deltaMode:u.trigger_delta_mode||!1,fromState:u.trigger_from_state||"",toState:u.trigger_to_state||"",targetChanges:u.trigger_target_changes?.toString()??"",runtimeHours:u.trigger_runtime_hours?.toString()??"",onStates:(u.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(u).filter(([e])=>!se.has(e)&&!e.startsWith("_")))}}function ae(u){let y=u.entityIds.split(",").map(i=>i.trim()).filter(Boolean);if(y.length===0)return null;let e={...u.carry||{},entity_id:y[0],entity_ids:y,type:u.type};if(u.attribute&&(e.attribute=u.attribute),u.type==="threshold"){let i=parseFloat(u.above);isNaN(i)||(e.trigger_above=i);let t=parseFloat(u.below);isNaN(t)||(e.trigger_below=t);let r=parseFloat(u.equals);isNaN(r)||(e.trigger_equals=r);let _=parseFloat(u.notEquals);isNaN(_)||(e.trigger_not_equals=_);let c=parseInt(u.forMinutes,10);isNaN(c)||(e.trigger_for_minutes=c)}else if(u.type==="counter"){let i=parseFloat(u.targetValue);isNaN(i)||(e.trigger_target_value=i),e.trigger_delta_mode=u.deltaMode}else if(u.type==="state_change"){u.fromState&&(e.trigger_from_state=u.fromState),u.toState&&(e.trigger_to_state=u.toState);let i=parseInt(u.targetChanges,10);isNaN(i)||(e.trigger_target_changes=i)}else if(u.type==="runtime"){let i=parseFloat(u.runtimeHours);isNaN(i)||(e.trigger_runtime_hours=i);let t=(u.onStates||"").split(",").map(r=>r.trim()).filter(Boolean);t.length>0&&(e.trigger_on_states=t)}return e}function ne(u){return Array.from({length:7},(y,e)=>k(e,u,"short"))}function oe(u){return Array.from({length:12},(y,e)=>M(e,u,"short"))}var a=class a extends H{constructor(){super(...arguments);this.checklistsEnabled=!1;this.scheduleTimeEnabled=!1;this.completionActionsEnabled=!1;this.defaultWarningDays=7;this.parts=[];this._foreignOwners=[];this._open=!1;this._entityPickerFallback=!1;this._pickerProbeStrikes=0;this._loading=!1;this._error="";this._entryId="";this._taskId=null;this._objectChoices=[];this._name="";this._type="custom";this._scheduleType="time_based";this._intervalDays="30";this._intervalUnit="days";this._dueDate="";this._warningDays="7";this._earliestCompletionDays="";this._intervalAnchor="completion";this._weekdays=[];this._nth="1";this._nthWeekday="5";this._domDay="1";this._domLastDay=!1;this._domBusiness=!1;this._calOffset="0";this._seasonMonths=[];this._endsMode="never";this._endsCount="";this._endsUntil="";this._schedulePreview=[];this._schedulePreviewEnded=!1;this._previewSeq=0;this._notes="";this._documentationUrl="";this._customIcon="";this._priority="normal";this._labels="";this._enabled=!0;this._triggerEntityId="";this._triggerEntityIds=[];this._triggerEntityLogic="any";this._triggerAttribute="";this._triggerType="threshold";this._triggerAbove="";this._triggerBelow="";this._triggerEquals="";this._triggerNotEquals="";this._triggerForMinutes="0";this._triggerCombinator="any";this._triggerTargetValue="";this._triggerDeltaMode=!1;this._triggerBaselineValue="";this._liveBaselineValLine truncated
|
||||||
`),this._phaseDefs=Object.entries(i.phases||{}).map(([d,m])=>{let{name:f,checklist:v,consumes_parts:g,required_completion_fields:$,...G}=m,S=m.consumes_parts||[],I=S.findIndex(E=>!E.entry_id),T=I>=0?S[I]:void 0;return{id:d,name:m.name||d,checklistText:(m.checklist||[]).join(`
|
`),this._phaseDefs=Object.entries(i.phases||{}).map(([d,m])=>{let{name:f,checklist:v,consumes_parts:g,required_completion_fields:$,...G}=m,S=m.consumes_parts||[],I=S.findIndex(x=>!x.entry_id),T=I>=0?S[I]:void 0;return{id:d,name:m.name||d,checklistText:(m.checklist||[]).join(`
|
||||||
`),partId:T?.part_id||"",partQty:T?.quantity!=null?String(T.quantity):"",reqOverride:m.required_completion_fields!==void 0,reqFields:[...m.required_completion_fields||[]],extraParts:S.filter((E,J)=>J!==I).map(E=>({...E})),carry:G}}),this._phaseSeq=[...i.phase_sequence||[]],this._requiredCompletion=[...i.required_completion_fields||[]],this._scheduleTime=i.schedule_time||"",this._scheduleTimeOn=!!i.schedule_time;let _=i.on_complete_action;if(_&&_.service){this._actionService=_.service;let d=_.target?.entity_id;this._actionTargetEntity=Array.isArray(d)?d[0]||"":d||"",this._actionData=_.data&&typeof _.data=="object"?{..._.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let c=i.quick_complete_defaults;this._qcNotes=c?.notes||"",this._qcCost=c?.cost!=null?String(c.cost):"",this._qcDuration=c?.duration!=null?String(c.duration):"",this._qcFeedback=c?.feedback||"";let h=i.adaptive_config||{};if(this._environmentalEntity=h.environmental_entity||"",this._environmentalAttribute=h.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,this._adaptiveEnabled=!!h.enabled,this._adaptiveAlpha=h.ewa_alpha?.toString()??b.alpha,this._adaptiveMin=h.min_interval_days?.toString()??b.min,this._adaptiveMax=h.max_interval_days?.toString()??b.max,this._adaptiveSeasonal=h.seasonal_enabled!==!1,this._adaptivePrediction=h.sensor_prediction_enabled!==!1,this._adaptiveInitial=this._adaptiveSnapshot(),i.trigger_config){let d=i.trigger_config;this._triggerEntityId=d.entity_id||d.entity_ids&&d.entity_ids[0]||"",this._triggerEntityIds=d.entity_ids||(d.entity_id?[d.entity_id]:[]),this._triggerEntityLogic=d.entity_logic||"any",this._triggerAttribute=d.attribute||"",this._triggerType=d.type||"threshold",this._triggerAbove=d.trigger_above?.toString()||"",this._triggerBelow=d.trigger_below?.toString()||"",this._triggerEquals=d.trigger_equals?.toString()||"",this._triggerNotEquals=d.trigger_not_equals?.toString()||"",this._triggerForMinutes=d.trigger_for_minutes?.toString()||"0",this._triggerCombinator=d.trigger_combinator==="all"?"all":"any",this._triggerTargetValue=d.trigger_target_value?.toString()||"",this._triggerDeltaMode=d.trigger_delta_mode||!1,this._triggerBaselineValue=d.trigger_baseline_value?.toString()||"",this._liveBaselineValue=i.trigger_baseline_value??null,this._autoCompleteOnRecovery=d.auto_complete_on_recovery||!1,this._triggerFromState=d.trigger_from_state||"",this._triggerToState=d.trigger_to_state||"",this._triggerTargetChanges=d.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=d.trigger_runtime_hours?.toString()||"",this._triggerRuntimeMaxSession=d.trigger_runtime_max_session_seconds?.toString()||"",this._triggerOnStates=(d.trigger_on_states||[]).join(", "),d.type==="compound"?(this._compoundLogic=d.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(d.conditions||[]).map(re)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._requireTagScan=!1,this._allowSkip=!0,this._readingUnit="",this._readings=[],this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._phaseDefs=[],this._phaseSeq=[],this._requiredCompletion=[],this._scheduleTime="",this._scheduleTimeOn=!1,this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._adaptiveEnabled=!1,this._adaptiveAlpha=b.alpha,this._adaptiveMin=b.min,this._adaptiveMax=b.max,this._adaptiveSeasonal=!0,this._adaptivePrediction=!0,this._adaptiveInitial=this._adaptiveSnapshot(),this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute="",this._suggestedAttributes=[],this
Line truncated
|
`),partId:T?.part_id||"",partQty:T?.quantity!=null?String(T.quantity):"",reqOverride:m.required_completion_fields!==void 0,reqFields:[...m.required_completion_fields||[]],extraParts:S.filter((x,J)=>J!==I).map(x=>({...x})),carry:G}}),this._phaseSeq=[...i.phase_sequence||[]],this._requiredCompletion=[...i.required_completion_fields||[]],this._scheduleTime=i.schedule_time||"",this._scheduleTimeOn=!!i.schedule_time;let _=i.on_complete_action;if(_&&_.service){this._actionService=_.service;let d=_.target?.entity_id;this._actionTargetEntity=Array.isArray(d)?d[0]||"":d||"",this._actionData=_.data&&typeof _.data=="object"?{..._.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let c=i.quick_complete_defaults;this._qcNotes=c?.notes||"",this._qcCost=c?.cost!=null?String(c.cost):"",this._qcDuration=c?.duration!=null?String(c.duration):"",this._qcFeedback=c?.feedback||"";let h=i.adaptive_config||{};if(this._environmentalEntity=h.environmental_entity||"",this._environmentalAttribute=h.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,this._adaptiveEnabled=!!h.enabled,this._adaptiveAlpha=h.ewa_alpha?.toString()??b.alpha,this._adaptiveMin=h.min_interval_days?.toString()??b.min,this._adaptiveMax=h.max_interval_days?.toString()??b.max,this._adaptiveSeasonal=h.seasonal_enabled!==!1,this._adaptivePrediction=h.sensor_prediction_enabled!==!1,this._adaptiveInitial=this._adaptiveSnapshot(),i.trigger_config){let d=i.trigger_config;this._triggerEntityId=d.entity_id||d.entity_ids&&d.entity_ids[0]||"",this._triggerEntityIds=d.entity_ids||(d.entity_id?[d.entity_id]:[]),this._triggerEntityLogic=d.entity_logic||"any",this._triggerAttribute=d.attribute||"",this._triggerType=d.type||"threshold",this._triggerAbove=d.trigger_above?.toString()||"",this._triggerBelow=d.trigger_below?.toString()||"",this._triggerEquals=d.trigger_equals?.toString()||"",this._triggerNotEquals=d.trigger_not_equals?.toString()||"",this._triggerForMinutes=d.trigger_for_minutes?.toString()||"0",this._triggerCombinator=d.trigger_combinator==="all"?"all":"any",this._triggerTargetValue=d.trigger_target_value?.toString()||"",this._triggerDeltaMode=d.trigger_delta_mode||!1,this._triggerBaselineValue=d.trigger_baseline_value?.toString()||"",this._liveBaselineValue=i.trigger_baseline_value??null,this._autoCompleteOnRecovery=d.auto_complete_on_recovery||!1,this._triggerFromState=d.trigger_from_state||"",this._triggerToState=d.trigger_to_state||"",this._triggerTargetChanges=d.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=d.trigger_runtime_hours?.toString()||"",this._triggerRuntimeMaxSession=d.trigger_runtime_max_session_seconds?.toString()||"",this._triggerOnStates=(d.trigger_on_states||[]).join(", "),d.type==="compound"?(this._compoundLogic=d.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(d.conditions||[]).map(re)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._requireTagScan=!1,this._allowSkip=!0,this._readingUnit="",this._readings=[],this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._phaseDefs=[],this._phaseSeq=[],this._requiredCompletion=[],this._scheduleTime="",this._scheduleTimeOn=!1,this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._adaptiveEnabled=!1,this._adaptiveAlpha=b.alpha,this._adaptiveMin=b.min,this._adaptiveMax=b.max,this._adaptiveSeasonal=!0,this._adaptivePrediction=!0,this._adaptiveInitial=this._adaptiveSnapshot(),this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute="",this._suggestedAttributes=[],this
Line truncated
|
||||||
<details class="ca-section">
|
<details class="ca-section">
|
||||||
<summary>${s("on_complete_action_title",e)}</summary>
|
<summary>${s("on_complete_action_title",e)}</summary>
|
||||||
<p class="field-help">${s("on_complete_action_desc",e)}</p>
|
<p class="field-help">${s("on_complete_action_desc",e)}</p>
|
||||||
@@ -211,7 +211,7 @@ import{a as C,d as U,i as D,j,k as q,l as A}from"/maintenance_supporter_panelfil
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
`:p}
|
`:p}
|
||||||
`}async _save(){if(!this._loading&&this._name.trim()){if(this._adaptiveSnapshot()!==this._adaptiveInitial){let e=parseInt(this._adaptiveMin,10),i=parseInt(this._adaptiveMax,10);if(!isNaN(e)&&!isNaN(i)&&e>i){this._error=`${s("adaptive_min_interval",this._lang)} > ${s("adaptive_max_interval",this._lang)}`;return}}if(this._triggerType==="threshold"&&this._thresholdLimitsOverlap()){this._error=s("trigger_hint_overlap",this._lang);return}this._loading=!0,this._error="";try{let e={type:this._taskId?"maintenance_supporter/task/update":"maintenance_supporter/task/create",entry_id:this._entryId,name:this._name,task_type:this._type,schedule_type:this._scheduleType,warning_days:Number.isNaN(parseInt(this._warningDays,10))?this.defaultWarningDays:Math.max(0,parseInt(this._warningDays,10))},i=this._earliestCompletionDays.trim();e.earliest_completion_days=i===""?null:Math.max(0,parseInt(i,10)||0),this._taskId&&(e.task_id=this._taskId),this._scheduleType==="one_time"?(e.due_date=this._dueDate||null,e.interval_days=null):w.includes(this._scheduleType)?(e.schedule={...this._buildSchedule(),...this._recurrenceExtras()},e.interval_days=null,this._taskId&&(e.due_date=null)):(this._taskId&&(e.due_date=null),this._scheduleType!=="manual"&&this._intervalDays?(e.interval_days=parseInt(this._intervalDays,10),e.interval_unit=this._intervalUnit,e.interval_anchor=this._intervalAnchor,this._scheduleType==="time_based"&&(e.schedule={kind:"interval",...this._recurrenceExtras()})):this._taskId&&(e.interval_days=null,e.interval_anchor="completion")),e.notes=this._notes||null,e.documentation_url=this._documentationUrl||null,e.custom_icon=this._customIcon||null,e.priority=this._priority,e.labels=this._labels.split(",").map(c=>c.trim()).filter(Boolean),e.enabled=this._enabled,e.last_performed=this._lastPerformed||null,e.nfc_tag_id=this._nfcTagId||null,e.require_tag_scan=this._requireTagScan,e.allow_skip=this._allowSkip,e.reading_unit=this._readingUnit.trim()||null,e.readings=j(this._readings);{let c={};for(let d of this._phaseDefs){if(!d.name.trim())continue;let m={...d.carry,name:d.name.trim()},f=d.checklistText.split(`
|
`}async _save(){if(!this._loading&&this._name.trim()){if(this._adaptiveSnapshot()!==this._adaptiveInitial){let e=parseInt(this._adaptiveMin,10),i=parseInt(this._adaptiveMax,10);if(!isNaN(e)&&!isNaN(i)&&e>i){this._error=`${s("adaptive_min_interval",this._lang)} > ${s("adaptive_max_interval",this._lang)}`;return}}if(this._triggerType==="threshold"&&this._thresholdLimitsOverlap()){this._error=s("trigger_hint_overlap",this._lang);return}this._loading=!0,this._error="";try{let e={type:this._taskId?"maintenance_supporter/task/update":"maintenance_supporter/task/create",entry_id:this._entryId,name:this._name,task_type:this._type,schedule_type:this._scheduleType,warning_days:Number.isNaN(parseInt(this._warningDays,10))?this.defaultWarningDays:Math.max(0,parseInt(this._warningDays,10))},i=this._earliestCompletionDays.trim();e.earliest_completion_days=i===""?null:Math.max(0,parseInt(i,10)||0),this._taskId&&(e.task_id=this._taskId),this._scheduleType==="one_time"?(e.due_date=this._dueDate||null,e.interval_days=null):w.includes(this._scheduleType)?(e.schedule={...this._buildSchedule(),...this._recurrenceExtras()},e.interval_days=null,this._taskId&&(e.due_date=null)):(this._taskId&&(e.due_date=null),this._scheduleType!=="manual"&&this._intervalDays?(e.interval_days=parseInt(this._intervalDays,10),e.interval_unit=this._intervalUnit,e.interval_anchor=this._intervalAnchor,this._scheduleType==="time_based"&&(e.schedule={kind:"interval",...this._recurrenceExtras()})):this._taskId&&(e.interval_days=null,e.interval_anchor="completion")),e.notes=this._notes||null,e.documentation_url=this._documentationUrl||null,e.custom_icon=this._customIcon||null,e.priority=this._priority,e.labels=this._labels.split(",").map(c=>c.trim()).filter(Boolean),e.enabled=this._enabled,e.last_performed=this._lastPerformed||null,e.nfc_tag_id=this._nfcTagId||null,e.require_tag_scan=this._requireTagScan,e.allow_skip=this._allowSkip,e.notify_enabled=this._notifyEnabled,e.reading_unit=this._readingUnit.trim()||null,e.readings=j(this._readings);{let c={};for(let d of this._phaseDefs){if(!d.name.trim())continue;let m={...d.carry,name:d.name.trim()},f=d.checklistText.split(`
|
||||||
`).map(g=>g.trim()).filter(Boolean);f.length&&(m.checklist=f);let v=[];if(d.partId){let g=parseFloat(d.partQty);v.push({part_id:d.partId,quantity:Number.isFinite(g)&&g>0?g:1})}for(let g of d.extraParts)v.push(g.entry_id?{part_id:g.part_id,quantity:g.quantity,entry_id:g.entry_id}:{part_id:g.part_id,quantity:g.quantity});v.length&&(m.consumes_parts=v),d.reqOverride&&(m.required_completion_fields=[...d.reqFields]),c[d.id]=m}let h=this._phaseSeq.filter(d=>d in c);e.phases=Object.keys(c).length&&h.length?c:null,e.phase_sequence=e.phases?h:null}if((this.parts.length||this._foreignOwners.length)&&(e.consumes_parts=Object.values(this._consumesParts).map(c=>c.entry_id?{part_id:c.part_id,quantity:c.quantity,entry_id:c.entry_id}:{part_id:c.part_id,quantity:c.quantity})),e.responsible_user_id=this._responsibleUserId,e.assignee_pool=this._assigneePool,e.required_completion_fields=this._requiredCompletion,e.rotation_strategy=this._assigneePool.length>=2&&this._rotationStrategy?this._rotationStrategy:null,this._scheduleType==="sensor_based"&&this._triggerType==="compound"){let c=this._compoundConditions.map(ae).filter(h=>h!==null);if(c.length>0){let h={type:"compound",compound_logic:this._compoundLogic,conditions:c};this._autoCompleteOnRecovery&&(h.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(h.trigger_combinator="all"),e.trigger_config=h}else this._taskId&&(e.trigger_config=null)}else if(this._scheduleType==="sensor_based"&&this._triggerEntityId){let c=this._triggerEntityIds.length>0?this._triggerEntityIds:[this._triggerEntityId],h={entity_id:c[0],entity_ids:c,type:this._triggerType};if(this._triggerAttribute&&(h.attribute=this._triggerAttribute),this._autoCompleteOnRecovery&&(h.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(h.trigger_combinator="all"),c.length>1&&(h.entity_logic=this._triggerEntityLogic),this._triggerType==="threshold"){if(this._triggerAbove){let d=parseFloat(this._triggerAbove);isNaN(d)||(h.trigger_above=d)}if(this._triggerBelow){let d=parseFloat(this._triggerBelow);isNaN(d)||(h.trigger_below=d)}if(this._triggerEquals){let d=parseFloat(this._triggerEquals);isNaN(d)||(h.trigger_equals=d)}if(this._triggerNotEquals){let d=parseFloat(this._triggerNotEquals);isNaN(d)||(h.trigger_not_equals=d)}if(this._triggerForMinutes){let d=parseInt(this._triggerForMinutes,10);isNaN(d)||(h.trigger_for_minutes=d)}}else if(this._triggerType==="counter"){if(this._triggerTargetValue){let d=parseFloat(this._triggerTargetValue);isNaN(d)||(h.trigger_target_value=d)}if(h.trigger_delta_mode=this._triggerDeltaMode,this._triggerDeltaMode&&this._triggerBaselineValue){let d=parseFloat(this._triggerBaselineValue);!isNaN(d)&&d>=0&&(h.trigger_baseline_value=d)}}else if(this._triggerType==="state_change"){if(this._triggerFromState&&(h.trigger_from_state=this._triggerFromState),this._triggerToState&&(h.trigger_to_state=this._triggerToState),this._triggerTargetChanges){let d=parseInt(this._triggerTargetChanges,10);isNaN(d)||(h.trigger_target_changes=d)}if(this._triggerForMinutes){let d=parseInt(this._triggerForMinutes,10);isNaN(d)||(h.trigger_for_minutes=d)}}else if(this._triggerType==="runtime"){if(this._triggerRuntimeHours){let m=parseFloat(this._triggerRuntimeHours);isNaN(m)||(h.trigger_runtime_hours=m)}if(this._triggerRuntimeMaxSession){let m=parseInt(this._triggerRuntimeMaxSession,10);!isNaN(m)&&m>0&&(h.trigger_runtime_max_session_seconds=m)}let d=this._triggerOnStates.split(",").map(m=>m.trim()).filter(Boolean);d.length>0&&(h.trigger_on_states=d)}e.trigger_config=h}else this._taskId&&(e.trigger_config=null);if(this.scheduleTimeEnabled&&K.includes(this._scheduleType)){let c=this._scheduleTimeOn?this._scheduleTime.trim():"";e.schedule_time=/^([01]\d|2[0-3]):[0-5]\d$/.test(c)?c:null}if(this.checklistsEnabled){let c=this._checklistText.split(`
|
`).map(g=>g.trim()).filter(Boolean);f.length&&(m.checklist=f);let v=[];if(d.partId){let g=parseFloat(d.partQty);v.push({part_id:d.partId,quantity:Number.isFinite(g)&&g>0?g:1})}for(let g of d.extraParts)v.push(g.entry_id?{part_id:g.part_id,quantity:g.quantity,entry_id:g.entry_id}:{part_id:g.part_id,quantity:g.quantity});v.length&&(m.consumes_parts=v),d.reqOverride&&(m.required_completion_fields=[...d.reqFields]),c[d.id]=m}let h=this._phaseSeq.filter(d=>d in c);e.phases=Object.keys(c).length&&h.length?c:null,e.phase_sequence=e.phases?h:null}if((this.parts.length||this._foreignOwners.length)&&(e.consumes_parts=Object.values(this._consumesParts).map(c=>c.entry_id?{part_id:c.part_id,quantity:c.quantity,entry_id:c.entry_id}:{part_id:c.part_id,quantity:c.quantity})),e.responsible_user_id=this._responsibleUserId,e.assignee_pool=this._assigneePool,e.required_completion_fields=this._requiredCompletion,e.rotation_strategy=this._assigneePool.length>=2&&this._rotationStrategy?this._rotationStrategy:null,this._scheduleType==="sensor_based"&&this._triggerType==="compound"){let c=this._compoundConditions.map(ae).filter(h=>h!==null);if(c.length>0){let h={type:"compound",compound_logic:this._compoundLogic,conditions:c};this._autoCompleteOnRecovery&&(h.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(h.trigger_combinator="all"),e.trigger_config=h}else this._taskId&&(e.trigger_config=null)}else if(this._scheduleType==="sensor_based"&&this._triggerEntityId){let c=this._triggerEntityIds.length>0?this._triggerEntityIds:[this._triggerEntityId],h={entity_id:c[0],entity_ids:c,type:this._triggerType};if(this._triggerAttribute&&(h.attribute=this._triggerAttribute),this._autoCompleteOnRecovery&&(h.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(h.trigger_combinator="all"),c.length>1&&(h.entity_logic=this._triggerEntityLogic),this._triggerType==="threshold"){if(this._triggerAbove){let d=parseFloat(this._triggerAbove);isNaN(d)||(h.trigger_above=d)}if(this._triggerBelow){let d=parseFloat(this._triggerBelow);isNaN(d)||(h.trigger_below=d)}if(this._triggerEquals){let d=parseFloat(this._triggerEquals);isNaN(d)||(h.trigger_equals=d)}if(this._triggerNotEquals){let d=parseFloat(this._triggerNotEquals);isNaN(d)||(h.trigger_not_equals=d)}if(this._triggerForMinutes){let d=parseInt(this._triggerForMinutes,10);isNaN(d)||(h.trigger_for_minutes=d)}}else if(this._triggerType==="counter"){if(this._triggerTargetValue){let d=parseFloat(this._triggerTargetValue);isNaN(d)||(h.trigger_target_value=d)}if(h.trigger_delta_mode=this._triggerDeltaMode,this._triggerDeltaMode&&this._triggerBaselineValue){let d=parseFloat(this._triggerBaselineValue);!isNaN(d)&&d>=0&&(h.trigger_baseline_value=d)}}else if(this._triggerType==="state_change"){if(this._triggerFromState&&(h.trigger_from_state=this._triggerFromState),this._triggerToState&&(h.trigger_to_state=this._triggerToState),this._triggerTargetChanges){let d=parseInt(this._triggerTargetChanges,10);isNaN(d)||(h.trigger_target_changes=d)}if(this._triggerForMinutes){let d=parseInt(this._triggerForMinutes,10);isNaN(d)||(h.trigger_for_minutes=d)}}else if(this._triggerType==="runtime"){if(this._triggerRuntimeHours){let m=parseFloat(this._triggerRuntimeHours);isNaN(m)||(h.trigger_runtime_hours=m)}if(this._triggerRuntimeMaxSession){let m=parseInt(this._triggerRuntimeMaxSession,10);!isNaN(m)&&m>0&&(h.trigger_runtime_max_session_seconds=m)}let d=this._triggerOnStates.split(",").map(m=>m.trim()).filter(Boolean);d.length>0&&(h.trigger_on_states=d)}e.trigger_config=h}else this._taskId&&(e.trigger_config=null);if(this.scheduleTimeEnabled&&K.includes(this._scheduleType)){let c=this._scheduleTimeOn?this._scheduleTime.trim():"";e.schedule_time=/^([01]\d|2[0-3]):[0-5]\d$/.test(c)?c:null}if(this.checklistsEnabled){let c=this._checklistText.split(`
|
||||||
`).map(h=>h.trim()).filter(Boolean).slice(0,100);e.checklist=c.length?c:null}if(this.completionActionsEnabled){let c=this._actionService.trim();if(c&&/^[a-z][a-z0-9_]*\.[a-z0-9_]+$/.test(c)){let f={service:c},v=this._actionTargetEntity.trim();v&&(f.target={entity_id:v});let g=this._buildActionData();Object.keys(g).length>0&&(f.data=g),e.on_complete_action=f}else e.on_complete_action=null;let h={};this._qcNotes.trim()&&(h.notes=this._qcNotes.trim());let d=parseFloat(this._qcCost);!isNaN(d)&&d>=0&&(h.cost=d);let m=parseInt(this._qcDuration,10);!isNaN(m)&&m>=0&&(h.duration=m),this._qcFeedback&&(h.feedback=this._qcFeedback),e.quick_complete_defaults=Object.keys(h).length?h:null}let t=await this.hass.connection.sendMessagePromise(e),r=this._taskId||t?.task_id,_=this._environmentalEntity!==this._environmentalInitial||this._environmentalAttribute!==this._environmentalAttributeInitial;if(r&&this._scheduleType==="sensor_based"&&_)try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_environmental_entity",entry_id:this._entryId,task_id:r,environmental_entity:this._environmentalEntity||null,environmental_attribute:this._environmentalAttribute||null}),this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute}catch{}if(r&&this._adaptiveSnapshot()!==this._adaptiveInitial){let c=parseFloat(this._adaptiveAlpha),h=parseInt(this._adaptiveMin,10),d=parseInt(this._adaptiveMax,10);try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_adaptive",entry_id:this._entryId,task_id:r,enabled:this._adaptiveEnabled,...c>=.1&&c<=.9?{ewa_alpha:c}:{},...!isNaN(h)&&h>=1?{min_interval_days:h}:{},...!isNaN(d)&&d>=1?{max_interval_days:d}:{},seasonal_enabled:this._adaptiveSeasonal,sensor_prediction_enabled:this._adaptivePrediction}),this._adaptiveInitial=this._adaptiveSnapshot()}catch{}}this._open=!1,this.dispatchEvent(new CustomEvent("task-saved"))}catch(e){this._error=B(e,this._lang,s("save_error",this._lang))}finally{this._loading=!1}}}_close(){this._open=!1,this._pickerProbeTimer!==void 0&&(clearTimeout(this._pickerProbeTimer),this._pickerProbeTimer=void 0),this._pickerProbeStrikes=0}_renderTriggerFields(){if(this._scheduleType!=="sensor_based")return p;let e=this._lang,i=this._triggerType==="compound";return o`
|
`).map(h=>h.trim()).filter(Boolean).slice(0,100);e.checklist=c.length?c:null}if(this.completionActionsEnabled){let c=this._actionService.trim();if(c&&/^[a-z][a-z0-9_]*\.[a-z0-9_]+$/.test(c)){let f={service:c},v=this._actionTargetEntity.trim();v&&(f.target={entity_id:v});let g=this._buildActionData();Object.keys(g).length>0&&(f.data=g),e.on_complete_action=f}else e.on_complete_action=null;let h={};this._qcNotes.trim()&&(h.notes=this._qcNotes.trim());let d=parseFloat(this._qcCost);!isNaN(d)&&d>=0&&(h.cost=d);let m=parseInt(this._qcDuration,10);!isNaN(m)&&m>=0&&(h.duration=m),this._qcFeedback&&(h.feedback=this._qcFeedback),e.quick_complete_defaults=Object.keys(h).length?h:null}let t=await this.hass.connection.sendMessagePromise(e),r=this._taskId||t?.task_id,_=this._environmentalEntity!==this._environmentalInitial||this._environmentalAttribute!==this._environmentalAttributeInitial;if(r&&this._scheduleType==="sensor_based"&&_)try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_environmental_entity",entry_id:this._entryId,task_id:r,environmental_entity:this._environmentalEntity||null,environmental_attribute:this._environmentalAttribute||null}),this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute}catch{}if(r&&this._adaptiveSnapshot()!==this._adaptiveInitial){let c=parseFloat(this._adaptiveAlpha),h=parseInt(this._adaptiveMin,10),d=parseInt(this._adaptiveMax,10);try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_adaptive",entry_id:this._entryId,task_id:r,enabled:this._adaptiveEnabled,...c>=.1&&c<=.9?{ewa_alpha:c}:{},...!isNaN(h)&&h>=1?{min_interval_days:h}:{},...!isNaN(d)&&d>=1?{max_interval_days:d}:{},seasonal_enabled:this._adaptiveSeasonal,sensor_prediction_enabled:this._adaptivePrediction}),this._adaptiveInitial=this._adaptiveSnapshot()}catch{}}this._open=!1,this.dispatchEvent(new CustomEvent("task-saved"))}catch(e){this._error=B(e,this._lang,s("save_error",this._lang))}finally{this._loading=!1}}}_close(){this._open=!1,this._pickerProbeTimer!==void 0&&(clearTimeout(this._pickerProbeTimer),this._pickerProbeTimer=void 0),this._pickerProbeStrikes=0}_renderTriggerFields(){if(this._scheduleType!=="sensor_based")return p;let e=this._lang,i=this._triggerType==="compound";return o`
|
||||||
<h3>${s("trigger_configuration",e)}</h3>
|
<h3>${s("trigger_configuration",e)}</h3>
|
||||||
@@ -982,6 +982,15 @@ import{a as C,d as U,i as D,j,k as q,l as A}from"/maintenance_supporter_panelfil
|
|||||||
<span>${s("disallow_skip",e)}</span>
|
<span>${s("disallow_skip",e)}</span>
|
||||||
</label>
|
</label>
|
||||||
${this._allowSkip?p:o`<div class="field-help">${s("disallow_skip_help",e)}</div>`}
|
${this._allowSkip?p:o`<div class="field-help">${s("disallow_skip_help",e)}</div>`}
|
||||||
|
<label class="req-option">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
.checked=${!this._notifyEnabled}
|
||||||
|
@change=${t=>this._notifyEnabled=!t.target.checked}
|
||||||
|
/>
|
||||||
|
<span>${s("no_notifications",e)}</span>
|
||||||
|
</label>
|
||||||
|
${this._notifyEnabled?p:o`<div class="field-help">${s("no_notifications_help",e)}</div>`}
|
||||||
<label class="toggle-row">
|
<label class="toggle-row">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -1398,4 +1407,4 @@ import{a as C,d as U,i as D,j,k as q,l as A}from"/maintenance_supporter_panelfil
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
`,n([x({attribute:!1})],a.prototype,"hass",2),n([x({type:Boolean,attribute:"checklists-enabled"})],a.prototype,"checklistsEnabled",2),n([x({type:Boolean,attribute:"schedule-time-enabled"})],a.prototype,"scheduleTimeEnabled",2),n([x({type:Boolean,attribute:"completion-actions-enabled"})],a.prototype,"completionActionsEnabled",2),n([x({type:Number,attribute:"default-warning-days"})],a.prototype,"defaultWarningDays",2),n([l()],a.prototype,"parts",2),n([l()],a.prototype,"_foreignOwners",2),n([l()],a.prototype,"_open",2),n([l()],a.prototype,"_entityPickerFallback",2),n([l()],a.prototype,"_loading",2),n([l()],a.prototype,"_error",2),n([l()],a.prototype,"_entryId",2),n([l()],a.prototype,"_taskId",2),n([l()],a.prototype,"_objectChoices",2),n([l()],a.prototype,"_name",2),n([l()],a.prototype,"_type",2),n([l()],a.prototype,"_scheduleType",2),n([l()],a.prototype,"_intervalDays",2),n([l()],a.prototype,"_intervalUnit",2),n([l()],a.prototype,"_dueDate",2),n([l()],a.prototype,"_warningDays",2),n([l()],a.prototype,"_earliestCompletionDays",2),n([l()],a.prototype,"_intervalAnchor",2),n([l()],a.prototype,"_weekdays",2),n([l()],a.prototype,"_nth",2),n([l()],a.prototype,"_nthWeekday",2),n([l()],a.prototype,"_domDay",2),n([l()],a.prototype,"_domLastDay",2),n([l()],a.prototype,"_domBusiness",2),n([l()],a.prototype,"_calOffset",2),n([l()],a.prototype,"_seasonMonths",2),n([l()],a.prototype,"_endsMode",2),n([l()],a.prototype,"_endsCount",2),n([l()],a.prototype,"_endsUntil",2),n([l()],a.prototype,"_schedulePreview",2),n([l()],a.prototype,"_schedulePreviewEnded",2),n([l()],a.prototype,"_notes",2),n([l()],a.prototype,"_documentationUrl",2),n([l()],a.prototype,"_customIcon",2),n([l()],a.prototype,"_priority",2),n([l()],a.prototype,"_labels",2),n([l()],a.prototype,"_enabled",2),n([l()],a.prototype,"_triggerEntityId",2),n([l()],a.prototype,"_triggerEntityIds",2),n([l()],a.prototype,"_triggerEntityLogic",2),n([l()],a.prototype,"_triggerAttribute",2),n([l()],a.prototype,"_triggerType",2),n([l()],a.prototype,"_triggerAbove",2),n([l()],a.prototype,"_triggerBelow",2),n([l()],a.prototype,"_triggerEquals",2),n([l()],a.prototype,"_triggerNotEquals",2),n([l()],a.prototype,"_triggerForMinutes",2),n([l()],a.prototype,"_triggerCombinator",2),n([l()],a.prototype,"_triggerTargetValue",2),n([l()],a.prototype,"_triggerDeltaMode",2),n([l()],a.prototype,"_triggerBaselineValue",2),n([l()],a.prototype,"_liveBaselineValue",2),n([l()],a.prototype,"_autoCompleteOnRecovery",2),n([l()],a.prototype,"_triggerFromState",2),n([l()],a.prototype,"_triggerToState",2),n([l()],a.prototype,"_triggerTargetChanges",2),n([l()],a.prototype,"_triggerRuntimeHours",2),n([l()],a.prototype,"_triggerRuntimeMaxSession",2),n([l()],a.prototype,"_triggerOnStates",2),n([l()],a.prototype,"_compoundLogic",2),n([l()],a.prototype,"_compoundConditions",2),n([l()],a.prototype,"_suggestedAttributes",2),n([l()],a.prototype,"_availableAttributes",2),n([l()],a.prototype,"_entityDomain",2),n([l()],a.prototype,"_lastPerformed",2),n([l()],a.prototype,"_nfcTagId",2),n([l()],a.prototype,"_requireTagScan",2),n([l()],a.prototype,"_allowSkip",2),n([l()],a.prototype,"_readingUnit",2),n([l()],a.prototype,"_readings",2),n([l()],a.prototype,"_consumesParts",2),n([l()],a.prototype,"_partsLoadFailed",2),n([l()],a.prototype,"_availableTags",2),n([l()],a.prototype,"_responsibleUserId",2),n([l()],a.prototype,"_assigneePool",2),n([l()],a.prototype,"_rotationStrategy",2),n([l()],a.prototype,"_availableUsers",2),n([l()],a.prototype,"_checklistText",2),n([l()],a.prototype,"_phaseDefs",2),n([l()],a.prototype,"_phaseSeq",2),n([l()],a.prototype,"_requiredCompletion",2),n([l()],a.prototype,"_scheduleTime",2),n([l()],a.prototype,"_scheduleTimeOn",2),n([l()],a.prototype,"_actionService",2),n([l()],a.prototype,"_actionTargetEntity",2),n([l()],a.prototype,"_actionData",2),n([l()],a.prototype,"_actionDataJsonFallback",2),n([l()],a.prototype,"_actionTesting",2),n([l()],a.prototype,"_actionTestResult",2),n([l()],a.prototype,"_actionTestError",2),n([l()],a.prototype,"_qcNotes",2),n([l()],a.prototype,"_qcCost",2),n([l()],a.prototype,"_qcDuration",2),n([l()],a.prototype,"_qcFeedback",2),n([l()],a.prototype,"_environmentalEntity",2),n([l()],a.prototype,"_environmentalAttribute",2),n([l()],a.prototype,"_adaptiveEnabled",2),n([l()],a.prototype,"_adaptiveAlpha",2),n([l()],a.prototype,"_adaptiveMin",2),n([l()],a.prototype,"_adaptiveMax",2),n([l()],a.prototype,"_adaptiveSeasonal",2),n([l()],a.prototype,"_adaptivePrediction",2),n([l()],a.prototype,"_conditionAttrOptions",2);var L=a;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",L);export{L as a};
|
`,n([E({attribute:!1})],a.prototype,"hass",2),n([E({type:Boolean,attribute:"checklists-enabled"})],a.prototype,"checklistsEnabled",2),n([E({type:Boolean,attribute:"schedule-time-enabled"})],a.prototype,"scheduleTimeEnabled",2),n([E({type:Boolean,attribute:"completion-actions-enabled"})],a.prototype,"completionActionsEnabled",2),n([E({type:Number,attribute:"default-warning-days"})],a.prototype,"defaultWarningDays",2),n([l()],a.prototype,"parts",2),n([l()],a.prototype,"_foreignOwners",2),n([l()],a.prototype,"_open",2),n([l()],a.prototype,"_entityPickerFallback",2),n([l()],a.prototype,"_loading",2),n([l()],a.prototype,"_error",2),n([l()],a.prototype,"_entryId",2),n([l()],a.prototype,"_taskId",2),n([l()],a.prototype,"_objectChoices",2),n([l()],a.prototype,"_name",2),n([l()],a.prototype,"_type",2),n([l()],a.prototype,"_scheduleType",2),n([l()],a.prototype,"_intervalDays",2),n([l()],a.prototype,"_intervalUnit",2),n([l()],a.prototype,"_dueDate",2),n([l()],a.prototype,"_warningDays",2),n([l()],a.prototype,"_earliestCompletionDays",2),n([l()],a.prototype,"_intervalAnchor",2),n([l()],a.prototype,"_weekdays",2),n([l()],a.prototype,"_nth",2),n([l()],a.prototype,"_nthWeekday",2),n([l()],a.prototype,"_domDay",2),n([l()],a.prototype,"_domLastDay",2),n([l()],a.prototype,"_domBusiness",2),n([l()],a.prototype,"_calOffset",2),n([l()],a.prototype,"_seasonMonths",2),n([l()],a.prototype,"_endsMode",2),n([l()],a.prototype,"_endsCount",2),n([l()],a.prototype,"_endsUntil",2),n([l()],a.prototype,"_schedulePreview",2),n([l()],a.prototype,"_schedulePreviewEnded",2),n([l()],a.prototype,"_notes",2),n([l()],a.prototype,"_documentationUrl",2),n([l()],a.prototype,"_customIcon",2),n([l()],a.prototype,"_priority",2),n([l()],a.prototype,"_labels",2),n([l()],a.prototype,"_enabled",2),n([l()],a.prototype,"_triggerEntityId",2),n([l()],a.prototype,"_triggerEntityIds",2),n([l()],a.prototype,"_triggerEntityLogic",2),n([l()],a.prototype,"_triggerAttribute",2),n([l()],a.prototype,"_triggerType",2),n([l()],a.prototype,"_triggerAbove",2),n([l()],a.prototype,"_triggerBelow",2),n([l()],a.prototype,"_triggerEquals",2),n([l()],a.prototype,"_triggerNotEquals",2),n([l()],a.prototype,"_triggerForMinutes",2),n([l()],a.prototype,"_triggerCombinator",2),n([l()],a.prototype,"_triggerTargetValue",2),n([l()],a.prototype,"_triggerDeltaMode",2),n([l()],a.prototype,"_triggerBaselineValue",2),n([l()],a.prototype,"_liveBaselineValue",2),n([l()],a.prototype,"_autoCompleteOnRecovery",2),n([l()],a.prototype,"_triggerFromState",2),n([l()],a.prototype,"_triggerToState",2),n([l()],a.prototype,"_triggerTargetChanges",2),n([l()],a.prototype,"_triggerRuntimeHours",2),n([l()],a.prototype,"_triggerRuntimeMaxSession",2),n([l()],a.prototype,"_triggerOnStates",2),n([l()],a.prototype,"_compoundLogic",2),n([l()],a.prototype,"_compoundConditions",2),n([l()],a.prototype,"_suggestedAttributes",2),n([l()],a.prototype,"_availableAttributes",2),n([l()],a.prototype,"_entityDomain",2),n([l()],a.prototype,"_lastPerformed",2),n([l()],a.prototype,"_nfcTagId",2),n([l()],a.prototype,"_requireTagScan",2),n([l()],a.prototype,"_allowSkip",2),n([l()],a.prototype,"_notifyEnabled",2),n([l()],a.prototype,"_readingUnit",2),n([l()],a.prototype,"_readings",2),n([l()],a.prototype,"_consumesParts",2),n([l()],a.prototype,"_partsLoadFailed",2),n([l()],a.prototype,"_availableTags",2),n([l()],a.prototype,"_responsibleUserId",2),n([l()],a.prototype,"_assigneePool",2),n([l()],a.prototype,"_rotationStrategy",2),n([l()],a.prototype,"_availableUsers",2),n([l()],a.prototype,"_checklistText",2),n([l()],a.prototype,"_phaseDefs",2),n([l()],a.prototype,"_phaseSeq",2),n([l()],a.prototype,"_requiredCompletion",2),n([l()],a.prototype,"_scheduleTime",2),n([l()],a.prototype,"_scheduleTimeOn",2),n([l()],a.prototype,"_actionService",2),n([l()],a.prototype,"_actionTargetEntity",2),n([l()],a.prototype,"_actionData",2),n([l()],a.prototype,"_actionDataJsonFallback",2),n([l()],a.prototype,"_actionTesting",2),n([l()],a.prototype,"_actionTestResult",2),n([l()],a.prototype,"_actionTestError",2),n([l()],a.prototype,"_qcNotes",2),n([l()],a.prototype,"_qcCost",2),n([l()],a.prototype,"_qcDuration",2),n([l()],a.prototype,"_qcFeedback",2),n([l()],a.prototype,"_environmentalEntity",2),n([l()],a.prototype,"_environmentalAttribute",2),n([l()],a.prototype,"_adaptiveEnabled",2),n([l()],a.prototype,"_adaptiveAlpha",2),n([l()],a.prototype,"_adaptiveMin",2),n([l()],a.prototype,"_adaptiveMax",2),n([l()],a.prototype,"_adaptiveSeasonal",2),n([l()],a.prototype,"_adaptivePrediction",2),n([l()],a.prototype,"_conditionAttrOptions",2);var L=a;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",L);export{L as a};
|
||||||
File diff suppressed because it is too large.
Load diff
+5
-5
@@ -1,5 +1,5 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
import{b as ut,f as B,g as yt}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-YQMBLRSW.js";import{a as Q,b as gt,c as X}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-VRRFDTZU.js";import{b as ht,c as _t,e as J,f as mt,h as ft}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-XMX3E3HG.js";import{a as T}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-3IZWSKBJ.js";import{A as ot,C as lt,H as Z,I as dt,J as ct,M as pt,a as h,b as C,c as l,d as z,f as u,h as H,l as P,m,n as U,q as a,s as j,t as it,u as st,v as at,w as x,y as rt,z as N}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-NAI3MD3R.js";var R=class extends H{constructor(){super(...arguments);this.docId="";this._url="";this._failed=!1;this._signedFor=""}updated(){this.hass&&this.docId&&this._signedFor!==this.docId&&(this._signedFor=this.docId,this._url="",this._failed=!1,this._sign())}async _sign(){try{this._url=await ut(this.hass,this.docId)}catch{this._failed=!0}}render(){return this._failed||!this.docId?u:this._url?l`
|
import{b as ut,f as B,g as yt}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-WTWETRW4.js";import{a as Q,b as gt,c as X}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-VNJMQWX4.js";import{b as ht,c as _t,e as J,f as mt,h as ft}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-Z4FQHWRJ.js";import{a as T}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-XCPYIT7M.js";import{A as ot,C as lt,H as Z,I as dt,J as ct,M as pt,a as h,b as C,c as l,d as z,f as u,h as H,l as P,m,n as U,q as a,s as j,t as it,u as st,v as at,w as x,y as rt,z as N}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-4OPY4VQ5.js";var R=class extends H{constructor(){super(...arguments);this.docId="";this._url="";this._failed=!1;this._signedFor=""}updated(){this.hass&&this.docId&&this._signedFor!==this.docId&&(this._signedFor=this.docId,this._url="",this._failed=!1,this._sign())}async _sign(){try{this._url=await ut(this.hass,this.docId)}catch{this._failed=!0}}render(){return this._failed||!this.docId?u:this._url?l`
|
||||||
<a href=${this._url} target="_blank" rel="noopener" class="wrap">
|
<a href=${this._url} target="_blank" rel="noopener" class="wrap">
|
||||||
<img src=${this._url} alt="" loading="lazy"
|
<img src=${this._url} alt="" loading="lazy"
|
||||||
@error=${()=>this._failed=!0} />
|
@error=${()=>this._failed=!0} />
|
||||||
@@ -422,7 +422,7 @@ import{b as ut,f as B,g as yt}from"/maintenance_supporter_panelfiles/panel-chunk
|
|||||||
${It.map((k,b)=>l`<span class="seasonal-label ${b===s?"active-month":""}">${a(k,i)}</span>`)}
|
${It.map((k,b)=>l`<span class="seasonal-label ${b===s?"active-month":""}">${a(k,i)}</span>`)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`}var $=class extends H{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1;this._currencySymbol=""}get _lang(){return j(this.hass)}async openFor(t,n){this._entryId=t,this._taskId=n,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=q(new Date),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});t?.features&&(this._features={...this._features,...t.features}),this._currencySymbol=t?.budget?.currency_symbol||"",this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=t.object?.name||"";let n=(t.tasks||[]).find(s=>s.id===this._taskId);this._task=n??null}catch(t){this._error=T(t,this._lang)}}async _runWs(t){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(t),this._busy=!1,!0}catch(n){return this._error=T(n,this._lang),this._busy=!1,!1}}_notifyChanged(t){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:t},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-ZZSGDAOS.js").then(async({openCompleteDialog:t})=>{let n=this._task,s=[];try{s=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0})).objects||[]}catch{}t(xt({entryId:this._entryId,taskId:this._taskId,taskName:n.name,task:n,objects:s,lang:this._lang,checklist:n.checklist||[],adaptiveEnabled:!!n.adaptive_config?.enabled,currencySymbol:this._currencySymbol}))&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-ZZSGDAOS.js").then(({openEditTaskDialog:t})=>{t(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-ZZSGDAOS.js").then(({openQrDialog:t})=>{t({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let t=a("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(t))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let t=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",t),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=a("suggestion_applied",this._lang)||"Applied",this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){if(!(!this._entryId||!this._taskId)){this._busy=!0,this._error="";try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/analyze_interval",entry_id:this._entryId,
Line truncated
|
`}var $=class extends H{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1;this._currencySymbol=""}get _lang(){return j(this.hass)}async openFor(t,n){this._entryId=t,this._taskId=n,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=q(new Date),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});t?.features&&(this._features={...this._features,...t.features}),this._currencySymbol=t?.budget?.currency_symbol||"",this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=t.object?.name||"";let n=(t.tasks||[]).find(s=>s.id===this._taskId);this._task=n??null}catch(t){this._error=T(t,this._lang)}}async _runWs(t){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(t),this._busy=!1,!0}catch(n){return this._error=T(n,this._lang),this._busy=!1,!1}}_notifyChanged(t){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:t},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-63ZHQOD5.js").then(async({openCompleteDialog:t})=>{let n=this._task,s=[];try{s=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0})).objects||[]}catch{}t(xt({entryId:this._entryId,taskId:this._taskId,taskName:n.name,task:n,objects:s,lang:this._lang,checklist:n.checklist||[],adaptiveEnabled:!!n.adaptive_config?.enabled,currencySymbol:this._currencySymbol}))&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-63ZHQOD5.js").then(({openEditTaskDialog:t})=>{t(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-63ZHQOD5.js").then(({openQrDialog:t})=>{t({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let t=a("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(t))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let t=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",t),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=a("suggestion_applied",this._lang)||"Applied",this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){if(!(!this._entryId||!this._taskId)){this._busy=!0,this._error="";try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/analyze_interval",entry_id:this._entryId,
Line truncated
|
||||||
<div class="recommendation-card">
|
<div class="recommendation-card">
|
||||||
<h4>${a("suggested_interval",n)}</h4>
|
<h4>${a("suggested_interval",n)}</h4>
|
||||||
${At(t.interval_days,t.suggested_interval,t.interval_confidence||"medium",n)}
|
${At(t.interval_days,t.suggested_interval,t.interval_confidence||"medium",n)}
|
||||||
@@ -515,7 +515,7 @@ import{b as ut,f as B,g as yt}from"/maintenance_supporter_panelfiles/panel-chunk
|
|||||||
<span class="task-name">${n.name}</span>
|
<span class="task-name">${n.name}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="object">
|
<div class="object">
|
||||||
<button class="link-inline" @click=${()=>{this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-ZZSGDAOS.js").then(({openObjectQuickActions:r})=>{r(this._entryId),this.close()})}}>${this._objectName}</button>
|
<button class="link-inline" @click=${()=>{this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-63ZHQOD5.js").then(({openObjectQuickActions:r})=>{r(this._entryId),this.close()})}}>${this._objectName}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="quick-info">
|
<div class="quick-info">
|
||||||
${n.next_due?l`<span><strong>${a("next_due",t)||"Next due"}:</strong> ${N(n.next_due,t)}</span>`:u}
|
${n.next_due?l`<span><strong>${a("next_due",t)||"Next due"}:</strong> ${N(n.next_due,t)}</span>`:u}
|
||||||
@@ -809,7 +809,7 @@ import{b as ut,f as B,g as yt}from"/maintenance_supporter_panelfiles/panel-chunk
|
|||||||
.weibull-section, .seasonal-card-compact { max-width: 100%; }
|
.weibull-section, .seasonal-card-compact { max-width: 100%; }
|
||||||
.weibull-chart svg { max-width: 100%; height: auto; }
|
.weibull-chart svg { max-width: 100%; height: auto; }
|
||||||
.details-toggle { gap: 12px; flex-wrap: wrap; }
|
.details-toggle { gap: 12px; flex-wrap: wrap; }
|
||||||
`],h([P({attribute:!1})],$.prototype,"hass",2),h([m()],$.prototype,"_open",2),h([m()],$.prototype,"_entryId",2),h([m()],$.prototype,"_taskId",2),h([m()],$.prototype,"_task",2),h([m()],$.prototype,"_objectName",2),h([m()],$.prototype,"_busy",2),h([m()],$.prototype,"_error",2),h([m()],$.prototype,"_showSkip",2),h([m()],$.prototype,"_showReset",2),h([m()],$.prototype,"_showDetails",2),h([m()],$.prototype,"_showAdaptive",2),h([m()],$.prototype,"_skipReason",2),h([m()],$.prototype,"_resetDate",2),h([m()],$.prototype,"_features",2),h([m()],$.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",$);function Dt(e){return!!e&&/^https?:\/\//i.test(e)}function Mt(e){return e?customElements.get("ha-markdown")?l`<ha-markdown class="notes-md" .content=${e} breaks></ha-markdown>`:l`${e}`:u}var L=class extends H{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return j(this.hass)}async openFor(t){this._entryId=t,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=t}catch(t){this._error=T(t,this._lang)}}_onEditObject(){!this._entryId||!this._data||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-ZZSGDAOS.js").then(({openEditObjectDialog:t})=>{t(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-ZZSGDAOS.js").then(({openCreateTaskDialog:t})=>{t(this._entryId),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let t=a("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(t)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(n){this._error=T(n,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let t=!!this._data.object.archived;if(!t){let n=a("confirm_archive_object",this._lang)||"Archive this object and its tasks?";if(!window.confirm(n))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:t?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(n){this._error=T(n,this._lang)}finally{this._busy=!1}}_onTaskClick(t){this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-ZZSGDAOS.js").then(({openTaskQuickActions:n})=>{n(this._entryId,t)})}render(){if(!this._open)return u;let t=this._lang,n=this._data,s=n?.object,r=n?.tasks||[],o=this.hass?.user?.is_admin??!0;return l`
|
`],h([P({attribute:!1})],$.prototype,"hass",2),h([m()],$.prototype,"_open",2),h([m()],$.prototype,"_entryId",2),h([m()],$.prototype,"_taskId",2),h([m()],$.prototype,"_task",2),h([m()],$.prototype,"_objectName",2),h([m()],$.prototype,"_busy",2),h([m()],$.prototype,"_error",2),h([m()],$.prototype,"_showSkip",2),h([m()],$.prototype,"_showReset",2),h([m()],$.prototype,"_showDetails",2),h([m()],$.prototype,"_showAdaptive",2),h([m()],$.prototype,"_skipReason",2),h([m()],$.prototype,"_resetDate",2),h([m()],$.prototype,"_features",2),h([m()],$.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",$);function Dt(e){return!!e&&/^https?:\/\//i.test(e)}function Mt(e){return e?customElements.get("ha-markdown")?l`<ha-markdown class="notes-md" .content=${e} breaks></ha-markdown>`:l`${e}`:u}var L=class extends H{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return j(this.hass)}async openFor(t){this._entryId=t,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=t}catch(t){this._error=T(t,this._lang)}}_onEditObject(){!this._entryId||!this._data||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-63ZHQOD5.js").then(({openEditObjectDialog:t})=>{t(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-63ZHQOD5.js").then(({openCreateTaskDialog:t})=>{t(this._entryId),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let t=a("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(t)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(n){this._error=T(n,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let t=!!this._data.object.archived;if(!t){let n=a("confirm_archive_object",this._lang)||"Archive this object and its tasks?";if(!window.confirm(n))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:t?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(n){this._error=T(n,this._lang)}finally{this._busy=!1}}_onTaskClick(t){this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-63ZHQOD5.js").then(({openTaskQuickActions:n})=>{n(this._entryId,t)})}render(){if(!this._open)return u;let t=this._lang,n=this._data,s=n?.object,r=n?.tasks||[],o=this.hass?.user?.is_admin??!0;return l`
|
||||||
<div class="backdrop" @click=${this.close}></div>
|
<div class="backdrop" @click=${this.close}></div>
|
||||||
<div class="dialog" role="dialog" aria-modal="true">
|
<div class="dialog" role="dialog" aria-modal="true">
|
||||||
${n&&s?l`
|
${n&&s?l`
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.74.0 */
|
|
||||||
var r=class{constructor(s){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=s}updateHass(s){this.hass=s}async getUsers(s=!1){let e=Date.now();if(!s&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(s,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:s,task_id:e,user_id:t})}async getTasksByUser(s){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:s})).tasks}getUserName(s){return!s||!this.usersCache?null:this.usersCache.find(t=>t.id===s)?.name||null}getUser(s){return!s||!this.usersCache?null:this.usersCache.find(e=>e.id===s)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(s){return s?s===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}};export{r as a};
|
|
||||||
@@ -1,825 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.74.0 */
|
|
||||||
import{b as ct,c as dt}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-YP2KCO26.js";import{a as L}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-NYOACMQR.js";import{A as at,C as it,H as G,I as rt,J as ot,L as lt,a as m,b as H,c as o,d as j,f as u,h as O,l as R,m as g,n as B,q as i,s as E,t as tt,u as et,v as nt,w as x,y as st,z}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-Y2JXJRDF.js";var A=class extends O{constructor(){super(...arguments);this._open=!1;this._saving=!1;this._error="";this._draft=null;this._originalSnapshot=null;this._partOptions=null;this._partQty={};this._partQtyOriginal=""}get _lang(){return E(this.hass)}openEdit(t){this._draft={...t},this._originalSnapshot={...t},this._error="",this._open=!0,this._partOptions=null,this._partQty={},this._partQtyOriginal="",this._loadPartOptions()}async _loadPartOptions(){let t=this._draft;if(t)try{let n=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/parts/overview"}),a=[];for(let l of n.parts||[]){let d=l.entry_id===t.entry_id,p=l.consumers.some(c=>c.entry_id===t.entry_id&&c.task_id===t.task_id);!d&&!p||a.push({part_id:l.part_id,name:l.name,entry_id:l.entry_id,foreign:!d,object_name:l.object_name})}for(let l of t.used_parts||[]){let d=l.entry_id||t.entry_id;a.some(p=>p.part_id===l.part_id&&p.entry_id===d)||a.push({part_id:l.part_id,name:l.name||l.part_id,entry_id:d,foreign:d!==t.entry_id,object_name:null})}let r={};for(let l of t.used_parts||[])r[`${l.entry_id||t.entry_id}:${l.part_id}`]=l.quantity??1;this._partOptions=a,this._partQty=r,this._partQtyOriginal=this._partSelectionKey()}catch{this._partOptions=[]}}_partSelectionKey(){return JSON.stringify(Object.entries(this._partQty).filter(([,t])=>t>0).sort(([t],[n])=>t.localeCompare(n)))}close(){this._open=!1,this._error="",this._draft=null,this._originalSnapshot=null}_set(t,n){this._draft&&(this._draft={...this._draft,[t]:n})}async _save(){if(!(!this._draft||!this._originalSnapshot)){this._saving=!0,this._error="";try{let t={type:"maintenance_supporter/task/history/update",entry_id:this._draft.entry_id,task_id:this._draft.task_id,original_timestamp:this._originalSnapshot.original_timestamp};if(this._draft.timestamp!==this._originalSnapshot.timestamp&&(t.timestamp=this._draft.timestamp),this._draft.notes!==this._originalSnapshot.notes&&(t.notes=this._draft.notes),this._draft.cost!==this._originalSnapshot.cost&&(t.cost=this._draft.cost),this._draft.duration!==this._originalSnapshot.duration&&(t.duration=this._draft.duration),this._draft.completed_by!==this._originalSnapshot.completed_by&&(t.completed_by=this._draft.completed_by),this._partOptions!==null&&this._partSelectionKey()!==this._partQtyOriginal&&(t.used_parts=(this._partOptions||[]).filter(a=>(this._partQty[`${a.entry_id}:${a.part_id}`]||0)>0).map(a=>({part_id:a.part_id,quantity:this._partQty[`${a.entry_id}:${a.part_id}`],...a.foreign?{entry_id:a.entry_id}:{}}))),Object.keys(t).filter(a=>!["type","entry_id","task_id","original_timestamp"].includes(a)).length===0){this.close();return}await this.hass.connection.sendMessagePromise(t),this.dispatchEvent(new CustomEvent("history-entry-saved",{detail:{entry_id:this._draft.entry_id,task_id:this._draft.task_id,new_timestamp:this._draft.timestamp},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=L(t,this._lang)}finally{this._saving=!1}}}render(){if(!this._open||!this._draft)return u;let t=this._lang,n=this._draft;return o`
|
|
||||||
<div class="backdrop" @click=${this.close}></div>
|
|
||||||
<div class="dialog" role="dialog" aria-modal="true">
|
|
||||||
<h2>${i("history_edit_title",t)||"Edit history entry"}</h2>
|
|
||||||
<div class="entry-type">
|
|
||||||
<ha-icon icon="mdi:tag-outline"></ha-icon>
|
|
||||||
<span>${i(n.type,t)||n.type}</span>
|
|
||||||
</div>
|
|
||||||
<ms-date-field
|
|
||||||
kind="datetime"
|
|
||||||
required
|
|
||||||
.hass=${this.hass}
|
|
||||||
.lang=${t}
|
|
||||||
.label=${i("history_edit_timestamp",t)||"Timestamp"}
|
|
||||||
.value=${n.timestamp.slice(0,19)}
|
|
||||||
@value-changed=${a=>{let r=a.detail.value;r&&this._set("timestamp",r)}}
|
|
||||||
></ms-date-field>
|
|
||||||
<label>
|
|
||||||
<span>${i("notes_label",t)}</span>
|
|
||||||
<textarea
|
|
||||||
rows="3"
|
|
||||||
@input=${a=>{let r=a.target.value;this._set("notes",r||null)}}
|
|
||||||
.value=${n.notes??""}></textarea>
|
|
||||||
</label>
|
|
||||||
<div class="row">
|
|
||||||
<label>
|
|
||||||
<span>${i("cost",t)||"Cost"}</span>
|
|
||||||
<input type="number" min="0" step="0.01"
|
|
||||||
.value=${n.cost!=null?String(n.cost):""}
|
|
||||||
@input=${a=>{let r=a.target.value;this._set("cost",r?Number(r):null)}} />
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<span>${i("duration",t)||"Duration (min)"}</span>
|
|
||||||
<input type="number" min="0"
|
|
||||||
.value=${n.duration!=null?String(n.duration):""}
|
|
||||||
@input=${a=>{let r=a.target.value;this._set("duration",r?Number(r):null)}} />
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
${this._partOptions&&this._partOptions.length>0?o`
|
|
||||||
<div class="parts-block">
|
|
||||||
<span class="parts-title">${i("complete_parts_used",t)}</span>
|
|
||||||
${this._partOptions.map(a=>{let r=`${a.entry_id}:${a.part_id}`,l=this._partQty[r]||0;return o`
|
|
||||||
<label class="part-row-edit">
|
|
||||||
<input type="checkbox" .checked=${l>0}
|
|
||||||
@change=${d=>{let p=d.target.checked;this._partQty={...this._partQty,[r]:p?1:0}}} />
|
|
||||||
<span class="part-label">${a.name}${a.foreign&&a.object_name?` (${a.object_name})`:""}</span>
|
|
||||||
${l>0?o`
|
|
||||||
<input class="part-qty" type="number" min="0.01" max="999" step="0.01"
|
|
||||||
.value=${String(l)}
|
|
||||||
@input=${d=>{let p=parseFloat(d.target.value);!isNaN(p)&&p>0&&(this._partQty={...this._partQty,[r]:p})}} />
|
|
||||||
`:u}
|
|
||||||
</label>
|
|
||||||
`})}
|
|
||||||
</div>
|
|
||||||
`:u}
|
|
||||||
${this._error?o`<div class="error">${this._error}</div>`:u}
|
|
||||||
<div class="actions">
|
|
||||||
<button class="cancel" @click=${this.close} ?disabled=${this._saving}>
|
|
||||||
${i("cancel",t)||"Cancel"}
|
|
||||||
</button>
|
|
||||||
<button class="save" @click=${this._save} ?disabled=${this._saving}>
|
|
||||||
${this._saving?i("saving",t)||"Saving\u2026":i("save",t)||"Save"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}};A.styles=H`
|
|
||||||
:host { display: contents; }
|
|
||||||
.backdrop {
|
|
||||||
position: fixed; inset: 0;
|
|
||||||
background: rgba(0,0,0,0.5);
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
.dialog {
|
|
||||||
position: fixed; left: 50%; top: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
width: 95vw; max-width: 480px;
|
|
||||||
background: var(--card-background-color, var(--ha-card-background, #1c1c1c));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 10px 30px rgba(0,0,0,0.4);
|
|
||||||
padding: 20px;
|
|
||||||
display: flex; flex-direction: column; gap: 12px;
|
|
||||||
z-index: 101;
|
|
||||||
max-height: 90vh; overflow: auto;
|
|
||||||
}
|
|
||||||
h2 { margin: 0; font-size: 18px; }
|
|
||||||
.entry-type {
|
|
||||||
display: flex; align-items: center; gap: 6px;
|
|
||||||
color: var(--secondary-text-color); font-size: 13px;
|
|
||||||
}
|
|
||||||
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
|
|
||||||
label span { color: var(--secondary-text-color); }
|
|
||||||
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
|
|
||||||
input, textarea {
|
|
||||||
padding: 8px; font-size: 14px;
|
|
||||||
background: var(--secondary-background-color, #2c2c2c);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color, #444);
|
|
||||||
border-radius: 6px;
|
|
||||||
width: 100%; box-sizing: border-box;
|
|
||||||
font-family: inherit;
|
|
||||||
}
|
|
||||||
.actions {
|
|
||||||
display: flex; gap: 8px; justify-content: flex-end;
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
padding: 8px 16px; font-size: 14px;
|
|
||||||
border-radius: 6px; cursor: pointer;
|
|
||||||
border: none; font-weight: 500;
|
|
||||||
}
|
|
||||||
button.cancel {
|
|
||||||
background: transparent;
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
}
|
|
||||||
button.save {
|
|
||||||
background: var(--primary-color);
|
|
||||||
color: var(--text-primary-color, white);
|
|
||||||
}
|
|
||||||
button[disabled] { opacity: 0.5; cursor: wait; }
|
|
||||||
.error {
|
|
||||||
color: var(--error-color, #d32f2f);
|
|
||||||
font-size: 13px; padding: 8px;
|
|
||||||
background: rgba(211,47,47,0.1);
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
/* #130: parts on the entry */
|
|
||||||
.parts-block {
|
|
||||||
display: flex; flex-direction: column; gap: 6px;
|
|
||||||
border: 1px solid var(--divider-color, #444);
|
|
||||||
border-radius: 6px; padding: 8px;
|
|
||||||
}
|
|
||||||
.parts-title { color: var(--secondary-text-color); font-size: 13px; }
|
|
||||||
.part-row-edit {
|
|
||||||
display: flex; flex-direction: row; align-items: center; gap: 8px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.part-row-edit input[type="checkbox"] { width: auto; }
|
|
||||||
.part-label { flex: 1; color: var(--primary-text-color); }
|
|
||||||
.part-qty { width: 76px; }
|
|
||||||
`,m([R({attribute:!1})],A.prototype,"hass",2),m([g()],A.prototype,"_open",2),m([g()],A.prototype,"_saving",2),m([g()],A.prototype,"_error",2),m([g()],A.prototype,"_draft",2),m([g()],A.prototype,"_partOptions",2),m([g()],A.prototype,"_partQty",2);customElements.get("maintenance-history-edit-dialog")||customElements.define("maintenance-history-edit-dialog",A);var Pt={days:1,weeks:7,months:30.4368,years:365.25};function Y(e,s){return!e||e<=0?0:e*(Pt[s||"days"]??1)}function ne(e,s,t){let n=Y(e,t);if(n<=0||s==null)return{pct:0,overflow:!1};let a=(n-s)/n*100;return{pct:Math.max(0,Math.min(100,a)),overflow:a>100}}var pt=5;function q(e){let s=e.getFullYear(),t=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${s}-${t}-${n}`}function Ct(e,s){let t=[];for(let n=0;n<s;n++){let a=new Date(e);a.setDate(a.getDate()+n),a.setHours(0,0,0,0),t.push(q(a))}return t}function U(e,s){let[t,n,a]=e.split("-").map(Number),r=new Date(t,n-1,a);return r.setDate(r.getDate()+s),q(r)}function It(e){if(!e||e.length===0)return null;let s=e.map(t=>t.cost).filter(t=>typeof t=="number");return s.length===0?null:s.reduce((t,n)=>t+n,0)/s.length}function Et(e){let{windowStart:s,windowEnd:t,task:n,entryId:a,objectName:r}=e,l=[],d=(_,v)=>({date:_,entry_id:a,task_id:n.id,task_name:n.name,object_name:r,status:v&&(n.status==="overdue"||n.status==="triggered")?"ok":n.status,days_until_due:v?null:n.days_until_due??null,projected:v,schedule_type:n.schedule_type,interval_days:n.interval_days??null,interval_unit:n.interval_unit??null,responsible_user_id:n.responsible_user_id??null,avg_cost:It(n.history),adaptive_enabled:!!n.adaptive_config?.enabled,prediction_confidence:n.threshold_prediction_confidence??null}),p=Math.max(1,Math.round(Y(n.interval_days,n.interval_unit)));if(n.status==="overdue"||n.status==="triggered"){if(l.push(d(s,!1)),n.schedule_type==="time_based"&&n.interval_days&&n.interval_days>0){let _=U(s,p),v=1;for(;_<=t&&v<pt;)l.push(d(_,!0)),v++,_=U(_,p)}return l}let c=n.next_due;if(typeof c!="string"||!c)return l;let h=c.slice(0,10);if(h>=s&&h<=t)l.push(d(h,!1));else if(h>t)return l;if(n.schedule_type==="time_based"&&n.interval_days&&n.interval_days>0){let _=U(h,p),v=l.length;for(;_<=t&&v<pt;)_>=s&&(l.push(d(_,!0)),v++),_=U(_,p)}return l}var ut={overdue:0,triggered:1,due_soon:2,ok:3};function ie(e,s,t,n=null){let a=Ct(s,t),r=a[0],l=a[a.length-1],d=[];for(let c of e){let h=c.object?.name||"",_=c.entry_id,v=c.tasks||[];for(let f of v){if(n&&f.responsible_user_id!==n||f.enabled===!1)continue;let $=Et({windowStart:r,windowEnd:l,task:f,entryId:_,objectName:h});d.push(...$)}}let p=new Map;for(let c of a)p.set(c,[]);for(let c of d){let h=p.get(c.date);h&&h.push(c)}for(let[,c]of p)c.sort((h,_)=>{let v=ut[h.status]??99,f=ut[_.status]??99;if(v!==f)return v-f;if(h.projected!==_.projected)return h.projected?1:-1;let $=h.object_name.localeCompare(_.object_name);return $!==0?$:h.task_name.localeCompare(_.task_name)});return a.map(c=>({date:c,events:p.get(c)??[]}))}var St={completed:"ok",reset:"ok",skipped:"due_soon",missed:"overdue",triggered:"triggered",trigger_replaced:"triggered",trigger_removed:"ok"};function Ht(e,s){let t=[];for(let n=s-1;n>=0;n--){let a=new Date(e);a.setDate(a.getDate()-n),a.setHours(0,0,0,0),t.push(q(a))}return t}function re(e,s,t,n=null){let a=Ht(s,t),r=a[0],l=a[a.length-1],d=new Map;for(let c of a)d.set(c,[]);for(let c of e){let h=c.object?.name||"",_=c.entry_id,v=c.tasks||[];for(let f of v){if(n&&f.responsible_user_id!==n)continue;let $=f.history||[];for(let b of $){if(typeof b?.timestamp!="string")continue;let T=b.timestamp.slice(0,10);if(T<r||T>l)continue;let S=d.get(T);if(!S)continue;let P=b.type??"completed";S.push({date:T,entry_id:_,task_id:f.id,task_name:f.name,object_name:h,status:St[P]??"ok",days_until_due:null,projected:!1,schedule_type:f.schedule_type,interval_days:f.interval_days??null,responsible_user_id:f.responsible_user_id??null,avg_cost:typeof b.cost=="number"?b.cost:null,adaptive_enabled:!!f.adaptive_config?.enabled,prediction_confidence:null,history_timestamp:b.timestamp,history_type:P,history_cost:typeof b.cost=="number"?b.cost:null,history_notes:typeof b.notes=="string"?b.notes:null,history_duration:typeof b.duration=="number"?b.duration:null})}}}let p={completed:0,reset:1,skipped:2,triggered:3,trigger_replaced:4};for(let[,c]of d)c.sort((h,_)=>{let v=p[h.history_type??""]??99,f=p[_.history_type??""]??99;if(v!==f)return v-f;let $=h.object_name.localeCompare(_.object_name);return $!==0?$:h.task_name.localeCompare(_.task_name)});return a.map(c=>({date:c,events:d.get(c)??[]}))}function jt(e,s){if(s<=0)return 0;let t=typeof e=="number"&&Number.isFinite(e)?Math.trunc(e):0;return t<0?0:t%s}function Ot(e){return!!(e?.phases&&e.phase_sequence&&e.phase_sequence.length>0)}function Z(e){if(!e||!Ot(e))return null;let s=e.phase_sequence,t=jt(e.phase_cursor,s.length),n=s[t],a=e.phases?.[n];return a?{id:n,name:a.name,index:t,count:s.length,notes:a.notes,checklist:a.checklist!==void 0?a.che
Line truncated
|
|
||||||
<div class="weibull-section">
|
|
||||||
<div class="weibull-title">
|
|
||||||
<ha-svg-icon aria-hidden="true" path="M3,14L3.5,14.07L8.07,9.5C7.89,8.85 8.06,8.11 8.59,7.59C9.37,6.8 10.63,6.8 11.41,7.59C11.94,8.11 12.11,8.85 11.93,9.5L14.5,12.07L15,12C15.18,12 15.35,12 15.5,12.07L19.07,8.5C19,8.35 19,8.18 19,8A2,2 0 0,1 21,6A2,2 0 0,1 23,8A2,2 0 0,1 21,10C20.82,10 20.65,10 20.5,9.93L16.93,13.5C17,13.65 17,13.82 17,14A2,2 0 0,1 15,16A2,2 0 0,1 13,14L13.07,13.5L10.5,10.93C10.18,11 9.82,11 9.5,10.93L4.93,15.5L5,16A2,2 0 0,1 3,18A2,2 0 0,1 1,16A2,2 0 0,1 3,14Z"></ha-svg-icon>
|
|
||||||
${i("weibull_reliability_curve",s)}
|
|
||||||
${Rt(n,s)}
|
|
||||||
</div>
|
|
||||||
${zt(n,a,r,l,s)}
|
|
||||||
${qt(t,s)}
|
|
||||||
${t?.confidence_interval_low!=null?Nt(t,e,s):u}
|
|
||||||
</div>
|
|
||||||
`}function Rt(e,s){let t,n,a;return e<.8?(t="early_failures",n="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z",a="beta_early_failures"):e<=1.2?(t="random_failures",n="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,17H11V15H13V17M13,13H11V7H13V13Z",a="beta_random_failures"):e<=3.5?(t="wear_out",n="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,6A6,6 0 0,1 18,12H12V6Z",a="beta_wear_out"):(t="highly_predictable",n="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z",a="beta_highly_predictable"),o`
|
|
||||||
<span class="beta-badge ${t}">
|
|
||||||
<ha-svg-icon path="${n}"></ha-svg-icon>
|
|
||||||
${i(a,s)} (\u03B2=${x(e,s,2)})
|
|
||||||
</span>
|
|
||||||
`}function zt(e,s,t,n,a){let f=Math.max(t,n,s,1)*1.3,$=50,b=[];for(let w=0;w<=$;w++){let D=w/$*f,Lt=1-Math.exp(-Math.pow(D/s,e)),Mt=32+D/f*260,Tt=136-Lt*128;b.push([Mt,Tt])}let T=b.map(([w,D])=>`${y(w)},${y(D)}`).join(" "),S="M32,136 "+b.map(([w,D])=>`L${y(w)},${y(D)}`).join(" ")+` L${y(b[$][0])},136 Z`,P=32+t/f*260,W=1-Math.exp(-Math.pow(t/s,e)),F=136-W*128,At=x((1-W)*100,a,0),X=32+n/f*260,Dt=[0,.25,.5,.75,1];return o`
|
|
||||||
<div class="weibull-chart">
|
|
||||||
<svg viewBox="0 0 ${300} ${160}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${i("chart_weibull",a)}">
|
|
||||||
${Dt.map(w=>{let D=136-w*128;return j`
|
|
||||||
<line x1="${32}" y1="${y(D)}" x2="${292}" y2="${y(D)}"
|
|
||||||
stroke="var(--divider-color)" stroke-width="0.5" stroke-dasharray="${w===.5?"4,3":u}" />
|
|
||||||
<text x="${28}" y="${y(D+3)}" fill="var(--secondary-text-color)"
|
|
||||||
font-size="8" text-anchor="end">${x(w*100,a,0)}%</text>
|
|
||||||
`})}
|
|
||||||
|
|
||||||
<text x="${32}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">0</text>
|
|
||||||
<text x="${324/2}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">${Math.round(f/2)}</text>
|
|
||||||
<text x="${292}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">${Math.round(f)}</text>
|
|
||||||
|
|
||||||
<path d="${S}" fill="var(--primary-color, #03a9f4)" opacity="0.08" />
|
|
||||||
<polyline points="${T}" fill="none"
|
|
||||||
stroke="var(--primary-color, #03a9f4)" stroke-width="2" />
|
|
||||||
|
|
||||||
${t>0?j`
|
|
||||||
<line x1="${y(P)}" y1="${8}" x2="${y(P)}" y2="${y(136)}"
|
|
||||||
stroke="var(--primary-color, #03a9f4)" stroke-width="1.5" stroke-dasharray="4,3" />
|
|
||||||
<circle cx="${y(P)}" cy="${y(F)}" r="3"
|
|
||||||
fill="var(--primary-color, #03a9f4)" />
|
|
||||||
<text x="${y(P+4)}" y="${y(F-6)}" fill="var(--primary-color, #03a9f4)"
|
|
||||||
font-size="9" font-weight="600">R=${At}%</text>
|
|
||||||
`:u}
|
|
||||||
|
|
||||||
${n>0&&n!==t?j`
|
|
||||||
<line x1="${y(X)}" y1="${8}" x2="${y(X)}" y2="${y(136)}"
|
|
||||||
stroke="var(--success-color, #4caf50)" stroke-width="1.5" stroke-dasharray="4,3" />
|
|
||||||
`:u}
|
|
||||||
|
|
||||||
<line x1="${32}" y1="${8}" x2="${32}" y2="${136}"
|
|
||||||
stroke="var(--secondary-text-color)" stroke-width="1" />
|
|
||||||
<line x1="${32}" y1="${136}" x2="${292}" y2="${136}"
|
|
||||||
stroke="var(--secondary-text-color)" stroke-width="1" />
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
<div class="chart-legend">
|
|
||||||
<span class="legend-item"><span class="legend-swatch" style="background:var(--primary-color, #03a9f4)"></span> ${i("weibull_failure_probability",a)}</span>
|
|
||||||
${t>0?o`<span class="legend-item"><span class="legend-swatch" style="background:var(--primary-color, #03a9f4); opacity:0.5"></span> ${i("current_interval_marker",a)}</span>`:u}
|
|
||||||
${n>0&&n!==t?o`<span class="legend-item"><span class="legend-swatch" style="background:var(--success-color, #4caf50)"></span> ${i("recommended_marker",a)}</span>`:u}
|
|
||||||
</div>
|
|
||||||
`}function qt(e,s){return o`
|
|
||||||
<div class="weibull-info-row">
|
|
||||||
<div class="weibull-info-item">
|
|
||||||
<span>${i("characteristic_life",s)}</span>
|
|
||||||
<span class="weibull-info-value">${Math.round(e.weibull_eta)} ${i("days",s)}</span>
|
|
||||||
</div>
|
|
||||||
${e.weibull_r_squared!=null?o`
|
|
||||||
<div class="weibull-info-item">
|
|
||||||
<span>${i("weibull_r_squared",s)}</span>
|
|
||||||
<span class="weibull-info-value">${x(e.weibull_r_squared,s,3)}</span>
|
|
||||||
</div>
|
|
||||||
`:u}
|
|
||||||
</div>
|
|
||||||
`}function Nt(e,s,t){let n=e.confidence_interval_low,a=e.confidence_interval_high,r=s.suggested_interval??s.interval_days??0,l=s.interval_days??0,d=Math.max(0,n-5),c=a+5-d,h=(n-d)/c*100,_=(a-n)/c*100,v=(r-d)/c*100,f=l>0?(l-d)/c*100:-1;return o`
|
|
||||||
<div class="confidence-range">
|
|
||||||
<div class="confidence-range-title">
|
|
||||||
${i("confidence_interval",t)}: ${r} ${i("days",t)} (${n}\u2013${a})
|
|
||||||
</div>
|
|
||||||
<div class="confidence-bar">
|
|
||||||
<div class="confidence-fill" style="left:${y(h)}%;width:${y(_)}%"></div>
|
|
||||||
${f>=0?o`<div class="confidence-marker current" style="left:${y(f)}%"></div>`:u}
|
|
||||||
<div class="confidence-marker recommended" style="left:${y(v)}%"></div>
|
|
||||||
</div>
|
|
||||||
<div class="confidence-labels">
|
|
||||||
<span class="confidence-text low">${i("confidence_conservative",t)} (${n}${i("days",t).charAt(0)})</span>
|
|
||||||
<span class="confidence-text high">${i("confidence_aggressive",t)} (${a}${i("days",t).charAt(0)})</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}function ft(e,s,t){let n=e.degradation_trend!=null&&e.degradation_trend!=="insufficient_data",a=e.days_until_threshold!=null,r=e.environmental_factor!=null&&e.environmental_factor!==1;if(!n&&!a&&!r)return u;let l=e.degradation_trend==="rising"?"M16,6L18.29,8.29L13.41,13.17L9.41,9.17L2,16.59L3.41,18L9.41,12L13.41,16L19.71,9.71L22,12V6H16Z":e.degradation_trend==="falling"?"M16,18L18.29,15.71L13.41,10.83L9.41,14.83L2,7.41L3.41,6L9.41,12L13.41,8L19.71,14.29L22,12V18H16Z":"M22,12L18,8V11H3V13H18V16L22,12Z";return o`
|
|
||||||
<div class="prediction-section">
|
|
||||||
${e.sensor_prediction_urgency?o`
|
|
||||||
<div class="prediction-urgency-banner">
|
|
||||||
<ha-svg-icon path="M1,21H23L12,2L1,21M12,18A1,1 0 0,1 11,17A1,1 0 0,1 12,16A1,1 0 0,1 13,17A1,1 0 0,1 12,18M13,15H11V10H13V15Z"></ha-svg-icon>
|
|
||||||
${i("sensor_prediction_urgency",s).replace("{days}",String(Math.round(e.days_until_threshold||0)))}
|
|
||||||
</div>
|
|
||||||
`:u}
|
|
||||||
<div class="prediction-title">
|
|
||||||
<ha-svg-icon path="M2,2V4H7V2H2M22,2V4H13V2H22M7,7V9H2V7H7M22,7V9H13V7H22M7,12V14H2V12H7M22,12V14H13V12H22M7,17V19H2V17H7M22,17V19H13V17H22M9,2V19L12,22L15,19V2H9M11,4H13V17.17L12,18.17L11,17.17V4Z"></ha-svg-icon>
|
|
||||||
${i("sensor_prediction",s)}
|
|
||||||
</div>
|
|
||||||
<div class="prediction-grid">
|
|
||||||
${n?o`
|
|
||||||
<div class="prediction-item">
|
|
||||||
<ha-svg-icon path="${l}"></ha-svg-icon>
|
|
||||||
<span class="prediction-label">${i("degradation_trend",s)}</span>
|
|
||||||
<span class="prediction-value ${e.degradation_trend}">${i("trend_"+e.degradation_trend,s)}</span>
|
|
||||||
${e.degradation_rate!=null?o`<span class="prediction-rate">${e.degradation_rate>0?"+":""}${x(e.degradation_rate,s,Math.abs(e.degradation_rate)>=10?0:1)} ${e.trigger_entity_info?.unit_of_measurement||""}/${i("day_short",s)}</span>`:u}
|
|
||||||
</div>
|
|
||||||
`:u}
|
|
||||||
${a?o`
|
|
||||||
<div class="prediction-item">
|
|
||||||
<ha-svg-icon path="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z"></ha-svg-icon>
|
|
||||||
<span class="prediction-label">${i("days_until_threshold",s)}</span>
|
|
||||||
<span class="prediction-value prediction-days${e.days_until_threshold===0?" exceeded":e.sensor_prediction_urgency?" urgent":""}">${e.days_until_threshold===0?i("threshold_exceeded",s):"~"+Math.round(e.days_until_threshold)+" "+i("days",s)}</span>
|
|
||||||
${e.threshold_prediction_date?o`<span class="prediction-date">${z(e.threshold_prediction_date,s)}</span>`:u}
|
|
||||||
${e.threshold_prediction_confidence?o`<span class="confidence-dot ${e.threshold_prediction_confidence}"></span>`:u}
|
|
||||||
${(e.prediction_cycles??0)>0?o`<span class="prediction-cycles">${i("prediction_cycles",s)}: ${e.prediction_cycles}</span>`:u}
|
|
||||||
</div>
|
|
||||||
`:u}
|
|
||||||
${r&&t.environmental?o`
|
|
||||||
<div class="prediction-item">
|
|
||||||
<ha-svg-icon path="M15,13V5A3,3 0 0,0 12,2A3,3 0 0,0 9,5V13A5,5 0 0,0 7,17A5,5 0 0,0 12,22A5,5 0 0,0 17,17A5,5 0 0,0 15,13M12,4A1,1 0 0,1 13,5V8H11V5A1,1 0 0,1 12,4Z"></ha-svg-icon>
|
|
||||||
<span class="prediction-label">${i("environmental_adjustment",s)}</span>
|
|
||||||
<span class="prediction-value">${x(e.environmental_factor,s,2)}x</span>
|
|
||||||
${e.environmental_entity?o`<span class="prediction-entity entity-link" @click=${d=>ot(d,e.environmental_entity)}>${e.environmental_entity}</span>`:u}
|
|
||||||
</div>
|
|
||||||
`:u}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}function yt(e,s,t,n){let a=Math.max(e||1,s);return o`
|
|
||||||
<div class="interval-comparison">
|
|
||||||
<div class="interval-bar">
|
|
||||||
<div class="interval-label">
|
|
||||||
${i("current",n)}: ${e??"\u2014"} ${e!=null?i("days",n):""}
|
|
||||||
</div>
|
|
||||||
<div class="interval-visual current"
|
|
||||||
style="width: ${e!=null?Math.min(e/a*100,100):0}%"></div>
|
|
||||||
</div>
|
|
||||||
<div class="interval-bar">
|
|
||||||
<div class="interval-label">
|
|
||||||
${i("recommended",n)}: ${s} ${i("days",n)}
|
|
||||||
<span class="confidence-badge ${t}">${i(`confidence_${t}`,n)}</span>
|
|
||||||
</div>
|
|
||||||
<div class="interval-visual suggested"
|
|
||||||
style="width: ${Math.min(s/a*100,100)}%"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}var gt=["month_jan","month_feb","month_mar","month_apr","month_may","month_jun","month_jul","month_aug","month_sep","month_oct","month_nov","month_dec"];function vt(e,s,t){if(!t.seasonal||!e.seasonal_factor||e.seasonal_factor===1)return u;let n=gt.map(d=>i(d,s)),a=new Date().getMonth(),r=e.seasonal_factors||e.interval_analysis?.seasonal_factors||null,l=r&&r.length===12?r:n.map((d,p)=>{let c=e.seasonal_factor||1,h=Math.sin((p-6)*Math.PI/6)*.3;return Math.max(.7,Math.min(1.3,c+h))});return o`
|
|
||||||
<div class="seasonal-card-compact">
|
|
||||||
<h4>${i("seasonal_awareness",s)}</h4>
|
|
||||||
<div class="seasonal-mini-chart">
|
|
||||||
${l.map((d,p)=>{let c=d*40,h=d<.9?"low":d>1.1?"high":"normal";return o`
|
|
||||||
<div class="seasonal-bar ${h} ${p===a?"current":""}"
|
|
||||||
style="height: ${c}px"
|
|
||||||
title="${n[p]}: ${x(d,s,2)}x">
|
|
||||||
</div>
|
|
||||||
`})}
|
|
||||||
</div>
|
|
||||||
<div class="seasonal-legend">
|
|
||||||
<span class="legend-item"><span class="dot low"></span> ${i("shorter",s)||"K\xFCrzer"}</span>
|
|
||||||
<span class="legend-item"><span class="dot normal"></span> ${i("normal",s)||"Normal"}</span>
|
|
||||||
<span class="legend-item"><span class="dot high"></span> ${i("longer",s)||"L\xE4nger"}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}function bt(e,s){return Vt(e,s)}function Vt(e,s){let t=e.seasonal_factors??e.interval_analysis?.seasonal_factors;if(!t||t.length!==12)return u;let n=e.interval_analysis?.seasonal_reason,a=new Date().getMonth(),r=300,l=100,d=8,c=l-d-4,h=Math.max(...t,1.5),_=r/12,v=_*.65,f=d+c-1/h*c;return o`
|
|
||||||
<div class="seasonal-chart">
|
|
||||||
<div class="seasonal-chart-title">
|
|
||||||
<ha-svg-icon aria-hidden="true" path="M17.75 4.09L15.22 6.03L16.13 9.09L13.5 7.28L10.87 9.09L11.78 6.03L9.25 4.09L12.44 4L13.5 1L14.56 4L17.75 4.09M21.25 11L19.61 12.25L20.2 14.23L18.5 13.06L16.8 14.23L17.39 12.25L15.75 11L17.81 10.95L18.5 9L19.19 10.95L21.25 11M18.97 15.95C19.8 15.87 20.69 17.05 20.16 17.8C19.84 18.25 19.5 18.67 19.08 19.07C15.17 23 8.84 23 4.94 19.07C1.03 15.17 1.03 8.83 4.94 4.93C5.34 4.53 5.76 4.17 6.21 3.85C6.96 3.32 8.14 4.21 8.06 5.04C7.79 7.9 8.75 10.87 10.95 13.06C13.14 15.26 16.1 16.22 18.97 15.95Z"></ha-svg-icon>
|
|
||||||
${i("seasonal_chart_title",s)}
|
|
||||||
${n?o`<span class="source-tag">${n==="learned"?i("seasonal_learned",s):i("seasonal_manual",s)}</span>`:u}
|
|
||||||
</div>
|
|
||||||
<svg viewBox="0 0 ${r} ${l}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${i("chart_seasonal",s)}">
|
|
||||||
<line x1="0" y1="${y(f)}" x2="${r}" y2="${y(f)}"
|
|
||||||
stroke="var(--divider-color)" stroke-width="1" stroke-dasharray="4,3" />
|
|
||||||
${t.map(($,b)=>{let T=$/h*c,S=b*_+(_-v)/2,P=d+c-T,W=b===a,F=$<1?"var(--success-color, #4caf50)":$>1?"var(--warning-color, #ff9800)":"var(--secondary-text-color)";return j`
|
|
||||||
<rect x="${y(S)}" y="${y(P)}"
|
|
||||||
width="${y(v)}" height="${y(T)}"
|
|
||||||
fill="${F}" opacity="${W?1:.5}" rx="2" />
|
|
||||||
`})}
|
|
||||||
</svg>
|
|
||||||
<div class="seasonal-labels">
|
|
||||||
${gt.map(($,b)=>o`<span class="seasonal-label ${b===a?"active-month":""}">${i($,s)}</span>`)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}var k=class extends O{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1;this._currencySymbol=""}get _lang(){return E(this.hass)}async openFor(t,n){this._entryId=t,this._taskId=n,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=q(new Date),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});t?.features&&(this._features={...this._features,...t.features}),this._currencySymbol=t?.budget?.currency_symbol||"",this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=t.object?.name||"";let n=(t.tasks||[]).find(a=>a.id===this._taskId);this._task=n??null}catch(t){this._error=L(t,this._lang)}}async _runWs(t){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(t),this._busy=!1,!0}catch(n){return this._error=L(n,this._lang),this._busy=!1,!1}}_notifyChanged(t){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:t},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-P3P7TFC2.js").then(async({openCompleteDialog:t})=>{let n=this._task,a=[];try{a=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0})).objects||[]}catch{}t(ht({entryId:this._entryId,taskId:this._taskId,taskName:n.name,task:n,objects:a,lang:this._lang,checklist:n.checklist||[],adaptiveEnabled:!!n.adaptive_config?.enabled,currencySymbol:this._currencySymbol}))&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-P3P7TFC2.js").then(({openEditTaskDialog:t})=>{t(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-P3P7TFC2.js").then(({openQrDialog:t})=>{t({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let t=i("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(t))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let t=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",t),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=i("suggestion_applied",this._lang)||"Applied",this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){if(!(!this._entryId||!this._taskId)){this._busy=!0,this._error="";try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/analyze_interval",entry_id:this._entryId,
Line truncated
|
|
||||||
<div class="recommendation-card">
|
|
||||||
<h4>${i("suggested_interval",n)}</h4>
|
|
||||||
${yt(t.interval_days,t.suggested_interval,t.interval_confidence||"medium",n)}
|
|
||||||
<div class="recommendation-actions">
|
|
||||||
<button class="btn primary"
|
|
||||||
@click=${this._applySuggestion} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="mdi:check"></ha-icon>
|
|
||||||
${i("apply_suggestion",n)}
|
|
||||||
</button>
|
|
||||||
<button class="btn"
|
|
||||||
@click=${this._reanalyzeInterval} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="mdi:refresh"></ha-icon>
|
|
||||||
${i("reanalyze",n)}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`}_renderAdaptive(t){let n=this._lang,a=this._features.adaptive&&t.suggested_interval&&t.suggested_interval!==t.interval_days,r=t.degradation_trend!=null&&t.degradation_trend!=="insufficient_data"||t.days_until_threshold!=null||t.environmental_factor!=null&&t.environmental_factor!==1,l=this._features.adaptive&&t.interval_analysis?.weibull_beta!=null&&t.interval_analysis?.weibull_eta!=null,d=this._features.seasonal&&t.seasonal_factor&&t.seasonal_factor!==1;return!a&&!r&&!l&&!d?o`<div class="adaptive-empty">
|
|
||||||
${i("adaptive_no_data",n)||"Not enough completion history yet for adaptive analysis."}
|
|
||||||
</div>`:o`
|
|
||||||
<div class="adaptive-stack">
|
|
||||||
${this._toast?o`<div class="toast">${this._toast}</div>`:u}
|
|
||||||
${a?this._renderRecommendation(t):u}
|
|
||||||
${r?ft(t,n,this._features):u}
|
|
||||||
${l?mt(t,n):u}
|
|
||||||
${d?o`
|
|
||||||
${vt(t,n,this._features)}
|
|
||||||
${t.seasonal_factors?.length===12||t.interval_analysis?.seasonal_factors?.length===12?bt(t,n):u}
|
|
||||||
`:u}
|
|
||||||
</div>
|
|
||||||
`}_renderDetails(t){let n=this._lang,a=t.history||[],r=a.filter(p=>p.type==="completed"),l=r.reduce((p,c)=>p+(typeof c.cost=="number"?c.cost:0),0),d=(()=>{let p=r.map(c=>typeof c.duration=="number"?c.duration:null).filter(c=>c!=null);return p.length?Math.round(p.reduce((c,h)=>c+h,0)/p.length):null})();return o`
|
|
||||||
<div class="details">
|
|
||||||
<div class="stats-grid">
|
|
||||||
<div class="stat">
|
|
||||||
<span class="stat-label">${i("times_performed",n)||"Performed"}</span>
|
|
||||||
<span class="stat-value">${r.length}</span>
|
|
||||||
</div>
|
|
||||||
<div class="stat">
|
|
||||||
<span class="stat-label">${i("total_cost",n)||"Total cost"}</span>
|
|
||||||
<span class="stat-value">${x(l,n,2)}</span>
|
|
||||||
</div>
|
|
||||||
<div class="stat">
|
|
||||||
<span class="stat-label">${i("avg_duration",n)||"Avg duration"}</span>
|
|
||||||
<span class="stat-value">${d!=null?`${d}m`:"\u2014"}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="history-header">
|
|
||||||
<strong>${i("history",n)||"History"}</strong>
|
|
||||||
<span class="history-count">${a.length}</span>
|
|
||||||
</div>
|
|
||||||
${a.length===0?o`<div class="history-empty">${i("history_empty",n)||"No history yet."}</div>`:o`
|
|
||||||
<div class="history-list">
|
|
||||||
${[...a].reverse().slice(0,20).map(p=>{let c=["completed","reset","skipped"].includes(p.type);return o`
|
|
||||||
<div class="history-entry">
|
|
||||||
<div class="history-line">
|
|
||||||
<span class="history-type type-${p.type}">${i(p.type,n)}</span>
|
|
||||||
<span class="history-date">${at(p.timestamp,n)}</span>
|
|
||||||
${c?o`<button class="history-edit"
|
|
||||||
title="${i("history_edit_button",n)||"Edit"}"
|
|
||||||
@click=${()=>this._onEditHistoryEntry(p)}>
|
|
||||||
<ha-icon icon="mdi:pencil"></ha-icon>
|
|
||||||
</button>`:u}
|
|
||||||
</div>
|
|
||||||
${p.notes?o`<div class="history-notes">${p.notes}</div>`:u}
|
|
||||||
${p.cost!=null||p.duration!=null?o`<div class="history-meta">
|
|
||||||
${p.cost!=null?o`<span>💰 ${x(p.cost,n,2)}</span>`:u}
|
|
||||||
${p.duration!=null?o`<span>⏱️ ${p.duration}m</span>`:u}
|
|
||||||
</div>`:u}
|
|
||||||
</div>
|
|
||||||
`})}
|
|
||||||
${a.length>20?o`<div class="history-more">… +${a.length-20} ${i("older_entries",n)||"older"}</div>`:u}
|
|
||||||
</div>
|
|
||||||
`}
|
|
||||||
</div>
|
|
||||||
`}render(){if(!this._open)return u;let t=this._lang,n=this._task,a=this.hass?.user?.is_admin??!0;return o`
|
|
||||||
<div class="backdrop" @click=${this.close}></div>
|
|
||||||
<div class="dialog" role="dialog" aria-modal="true">
|
|
||||||
${n?o`
|
|
||||||
<div class="header">
|
|
||||||
<div class="title">
|
|
||||||
<span class="status-dot" style="background: ${B[n.status]||"#ccc"}"></span>
|
|
||||||
<span class="task-name">${n.name}</span>
|
|
||||||
</div>
|
|
||||||
<div class="object">
|
|
||||||
<button class="link-inline" @click=${()=>{this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-P3P7TFC2.js").then(({openObjectQuickActions:r})=>{r(this._entryId),this.close()})}}>${this._objectName}</button>
|
|
||||||
</div>
|
|
||||||
<div class="quick-info">
|
|
||||||
${n.next_due?o`<span><strong>${i("next_due",t)||"Next due"}:</strong> ${z(n.next_due,t)}</span>`:u}
|
|
||||||
${n.last_performed?o`<span><strong>${i("last_performed",t)||"Last"}:</strong> ${z(n.last_performed,t)}</span>`:u}
|
|
||||||
${n.schedule?.kind&&!["manual","one_time"].includes(n.schedule.kind)||n.interval_days!=null?o`<span><strong>${i("interval",t)||"Interval"}:</strong> ${rt(n,t)}</span>`:u}
|
|
||||||
${N(n)?o`<span><strong>${i("phase_current",t)}:</strong> ${N(n)}</span>`:u}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
${this._error?o`<div class="error">${this._error}</div>`:u}
|
|
||||||
|
|
||||||
${this._showSkip?o`
|
|
||||||
<div class="inline-form">
|
|
||||||
<label>${i("skip_reason",t)||"Skip reason (optional)"}</label>
|
|
||||||
<input type="text" .value=${this._skipReason}
|
|
||||||
@input=${r=>{this._skipReason=r.target.value}} />
|
|
||||||
<div class="inline-actions">
|
|
||||||
<button class="btn cancel" @click=${()=>{this._showSkip=!1}} ?disabled=${this._busy}>
|
|
||||||
${i("cancel",t)||"Cancel"}
|
|
||||||
</button>
|
|
||||||
<button class="btn primary" @click=${this._onSkipConfirm} ?disabled=${this._busy}>
|
|
||||||
${i("skip",t)||"Skip"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`:this._showReset?o`
|
|
||||||
<div class="inline-form">
|
|
||||||
<label>${i("reset_to_date",t)||"Reset last_performed to"}</label>
|
|
||||||
<ms-date-field
|
|
||||||
kind="date"
|
|
||||||
.hass=${this.hass}
|
|
||||||
.lang=${t}
|
|
||||||
.value=${this._resetDate}
|
|
||||||
@value-changed=${r=>{this._resetDate=r.detail.value}}
|
|
||||||
></ms-date-field>
|
|
||||||
<div class="inline-actions">
|
|
||||||
<button class="btn cancel" @click=${()=>{this._showReset=!1}} ?disabled=${this._busy}>
|
|
||||||
${i("cancel",t)||"Cancel"}
|
|
||||||
</button>
|
|
||||||
<button class="btn primary" @click=${this._onResetConfirm} ?disabled=${this._busy}>
|
|
||||||
${i("reset",t)||"Reset"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`:o`
|
|
||||||
<div class="actions primary-row">
|
|
||||||
<ha-button appearance="accent" variant="success" @click=${this._onComplete} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:check"></ha-icon>
|
|
||||||
${i("complete",t)||"Complete"}
|
|
||||||
</ha-button>
|
|
||||||
${n.allow_skip!==!1?o`
|
|
||||||
<ha-button appearance="outlined" variant="warning" @click=${()=>{this._showSkip=!0}} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:skip-next"></ha-icon>
|
|
||||||
${i("skip",t)||"Skip"}
|
|
||||||
</ha-button>
|
|
||||||
`:u}
|
|
||||||
<ha-button appearance="outlined" variant="neutral" @click=${()=>{this._showReset=!0}} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:restart"></ha-icon>
|
|
||||||
${i("reset",t)||"Reset"}
|
|
||||||
</ha-button>
|
|
||||||
</div>
|
|
||||||
${a?o`
|
|
||||||
<div class="actions secondary-row">
|
|
||||||
<ha-button size="small" appearance="outlined" variant="neutral" @click=${this._onEdit} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:pencil"></ha-icon>
|
|
||||||
${i("edit",t)||"Edit"}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button size="small" appearance="outlined" variant="neutral" @click=${this._onQr} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:qrcode"></ha-icon>
|
|
||||||
${i("qr_code",t)||"QR"}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button size="small" appearance="outlined" variant="neutral"
|
|
||||||
@click=${n.archived?this._onUnarchive:this._onArchive}
|
|
||||||
.disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="${n.archived?"mdi:archive-arrow-up-outline":"mdi:archive-outline"}"></ha-icon>
|
|
||||||
${n.archived?i("unarchive",t)||"Unarchive":i("archive",t)||"Archive"}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button size="small" appearance="outlined" variant="danger" class="danger" @click=${this._onDelete} .disabled=${this._busy}>
|
|
||||||
<ha-icon slot="start" icon="mdi:delete"></ha-icon>
|
|
||||||
${i("delete",t)||"Delete"}
|
|
||||||
</ha-button>
|
|
||||||
</div>
|
|
||||||
`:u}
|
|
||||||
<div class="details-toggle">
|
|
||||||
<button class="link" @click=${()=>{this._showDetails=!this._showDetails}}>
|
|
||||||
<ha-icon icon="${this._showDetails?"mdi:chevron-up":"mdi:chevron-down"}"></ha-icon>
|
|
||||||
${this._showDetails?i("hide_details",t)||"Hide details":i("show_details",t)||"Show history + stats"}
|
|
||||||
</button>
|
|
||||||
${this._features.adaptive||this._features.seasonal||this._features.environmental?o`<button class="link" @click=${()=>{this._showAdaptive=!this._showAdaptive}}>
|
|
||||||
<ha-icon icon="${this._showAdaptive?"mdi:chart-line":"mdi:chart-line-variant"}"></ha-icon>
|
|
||||||
${this._showAdaptive?i("hide_stats",t)||"Hide stats":i("show_stats",t)||"Show stats + graphs"}
|
|
||||||
</button>`:u}
|
|
||||||
</div>
|
|
||||||
${this._showDetails?this._renderDetails(n):u}
|
|
||||||
${this._showAdaptive?this._renderAdaptive(n):u}
|
|
||||||
<div class="footer">
|
|
||||||
<button class="link" @click=${this._onOpenInPanel}>
|
|
||||||
<ha-icon icon="mdi:open-in-new"></ha-icon>
|
|
||||||
${i("open_in_panel",t)||"Open in Maintenance panel"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
`}
|
|
||||||
`:o`<div class="loading">${i("loading",t)||"Loading\u2026"}</div>`}
|
|
||||||
</div>
|
|
||||||
`}};k.styles=[lt,H`
|
|
||||||
:host { display: contents; }
|
|
||||||
.backdrop {
|
|
||||||
position: fixed; inset: 0; z-index: 100;
|
|
||||||
background: rgba(0,0,0,0.5);
|
|
||||||
}
|
|
||||||
.dialog {
|
|
||||||
position: fixed; left: 50%; top: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
width: 95vw; max-width: 460px;
|
|
||||||
max-height: 92vh; overflow: auto;
|
|
||||||
background: var(--card-background-color, var(--ha-card-background, #1c1c1c));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 10px 30px rgba(0,0,0,0.4);
|
|
||||||
padding: 20px;
|
|
||||||
display: flex; flex-direction: column; gap: 14px;
|
|
||||||
z-index: 101;
|
|
||||||
}
|
|
||||||
.header { display: flex; flex-direction: column; gap: 6px; }
|
|
||||||
.title { display: flex; align-items: center; gap: 10px; }
|
|
||||||
.status-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
|
|
||||||
.task-name { font-size: 18px; font-weight: 600; }
|
|
||||||
.object { font-size: 13px; color: var(--secondary-text-color); }
|
|
||||||
.link-inline {
|
|
||||||
background: transparent; border: none; padding: 0; cursor: pointer;
|
|
||||||
color: var(--primary-color); font-size: inherit; font-family: inherit;
|
|
||||||
}
|
|
||||||
.link-inline:hover { text-decoration: underline; }
|
|
||||||
.quick-info {
|
|
||||||
display: flex; flex-wrap: wrap; gap: 12px;
|
|
||||||
font-size: 12px; color: var(--secondary-text-color);
|
|
||||||
padding-top: 4px; border-top: 1px solid var(--divider-color);
|
|
||||||
}
|
|
||||||
.quick-info strong { color: var(--primary-text-color); font-weight: 500; }
|
|
||||||
.actions { display: flex; gap: 8px; }
|
|
||||||
.actions.primary-row { gap: 6px; }
|
|
||||||
.actions.primary-row .btn { flex: 1; }
|
|
||||||
.actions.primary-row ha-button { flex: 1; }
|
|
||||||
/* Edit + QR are admin-tools — left-align as a group; Delete is destructive
|
|
||||||
so it gets pushed to the far right with margin-left:auto for visual
|
|
||||||
separation. Earlier this row was flex-end which left a strange empty
|
|
||||||
gap on the left (user feedback). */
|
|
||||||
.actions.secondary-row {
|
|
||||||
padding-top: 8px; border-top: 1px solid var(--divider-color);
|
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
|
||||||
.actions.secondary-row .btn.danger,
|
|
||||||
.actions.secondary-row ha-button.danger {
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
.actions.secondary-row ha-button { --ha-button-font-size: 13px; }
|
|
||||||
.btn {
|
|
||||||
padding: 8px 12px; font-size: 14px;
|
|
||||||
border-radius: 6px; cursor: pointer;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
background: var(--secondary-background-color, transparent);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
font-weight: 500;
|
|
||||||
display: inline-flex; align-items: center; gap: 6px;
|
|
||||||
transition: background 0.12s;
|
|
||||||
}
|
|
||||||
.btn:hover { background: var(--state-icon-color, rgba(255,255,255,0.06)); }
|
|
||||||
.btn[disabled] { opacity: 0.5; cursor: wait; }
|
|
||||||
.btn.primary {
|
|
||||||
background: var(--primary-color);
|
|
||||||
color: var(--text-primary-color, white);
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
.btn.cancel { background: transparent; }
|
|
||||||
.btn.ghost { padding: 6px 10px; font-size: 13px; }
|
|
||||||
.btn.danger { color: var(--error-color); }
|
|
||||||
.btn ha-icon { --mdc-icon-size: 18px; }
|
|
||||||
.inline-form { display: flex; flex-direction: column; gap: 8px; }
|
|
||||||
.inline-form label { font-size: 13px; color: var(--secondary-text-color); }
|
|
||||||
.inline-form input {
|
|
||||||
padding: 8px; font-size: 14px;
|
|
||||||
background: var(--secondary-background-color, #2c2c2c);
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color, #444);
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
.inline-actions { display: flex; gap: 8px; justify-content: flex-end; }
|
|
||||||
.footer { display: flex; justify-content: center; padding-top: 4px; }
|
|
||||||
.link {
|
|
||||||
background: transparent; border: none; cursor: pointer;
|
|
||||||
color: var(--primary-color); font-size: 13px;
|
|
||||||
display: inline-flex; align-items: center; gap: 4px;
|
|
||||||
}
|
|
||||||
.link:hover { text-decoration: underline; }
|
|
||||||
.link ha-icon { --mdc-icon-size: 14px; }
|
|
||||||
.loading { padding: 24px; text-align: center; color: var(--secondary-text-color); }
|
|
||||||
.error {
|
|
||||||
padding: 8px; border-radius: 6px;
|
|
||||||
background: rgba(211,47,47,0.1);
|
|
||||||
color: var(--error-color, #d32f2f); font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Details (expandable Show details section) */
|
|
||||||
.details-toggle { display: flex; justify-content: center; margin-top: 4px; }
|
|
||||||
.details {
|
|
||||||
display: flex; flex-direction: column; gap: 12px;
|
|
||||||
border-top: 1px solid var(--divider-color);
|
|
||||||
padding-top: 12px;
|
|
||||||
}
|
|
||||||
.stats-grid {
|
|
||||||
display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
|
|
||||||
}
|
|
||||||
.stat {
|
|
||||||
display: flex; flex-direction: column; gap: 2px;
|
|
||||||
background: var(--secondary-background-color, rgba(255,255,255,0.04));
|
|
||||||
padding: 8px; border-radius: 6px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.stat-label { font-size: 11px; color: var(--secondary-text-color); text-transform: uppercase; letter-spacing: 0.5px; }
|
|
||||||
.stat-value { font-size: 16px; font-weight: 600; }
|
|
||||||
.history-header {
|
|
||||||
display: flex; align-items: baseline; gap: 8px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.history-count {
|
|
||||||
font-size: 12px; color: var(--secondary-text-color);
|
|
||||||
background: var(--secondary-background-color); padding: 2px 8px; border-radius: 999px;
|
|
||||||
}
|
|
||||||
.history-empty { color: var(--secondary-text-color); font-style: italic; font-size: 13px; }
|
|
||||||
.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow: auto; }
|
|
||||||
.history-entry {
|
|
||||||
padding: 6px 8px; border-radius: 6px;
|
|
||||||
background: var(--secondary-background-color, rgba(255,255,255,0.03));
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.history-line {
|
|
||||||
display: flex; align-items: center; gap: 8px;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.history-type {
|
|
||||||
font-weight: 600; font-size: 11px;
|
|
||||||
padding: 2px 6px; border-radius: 4px;
|
|
||||||
text-transform: uppercase; letter-spacing: 0.5px;
|
|
||||||
}
|
|
||||||
.type-completed { background: rgba(46,125,50,0.2); color: #66bb6a; }
|
|
||||||
.type-skipped { background: rgba(158,158,158,0.2); color: var(--secondary-text-color); }
|
|
||||||
.type-reset { background: rgba(33,150,243,0.2); color: #64b5f6; }
|
|
||||||
.type-triggered { background: rgba(255,87,34,0.2); color: #ff8a65; }
|
|
||||||
.history-date { font-size: 11px; color: var(--secondary-text-color); flex: 1; text-align: right; }
|
|
||||||
.history-edit {
|
|
||||||
background: transparent; border: none; cursor: pointer;
|
|
||||||
padding: 4px; border-radius: 4px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.history-edit:hover { background: var(--state-icon-color, rgba(255,255,255,0.06)); color: var(--primary-color); }
|
|
||||||
.history-edit ha-icon { --mdc-icon-size: 14px; }
|
|
||||||
.history-notes { margin-top: 4px; color: var(--primary-text-color); }
|
|
||||||
.history-meta { display: flex; gap: 12px; margin-top: 4px; color: var(--secondary-text-color); font-size: 11px; }
|
|
||||||
.history-more { padding: 8px; text-align: center; font-size: 12px; color: var(--secondary-text-color); font-style: italic; }
|
|
||||||
|
|
||||||
/* Adaptive section — wraps the panel renderers (which assume sharedStyles
|
|
||||||
are present) and adds dialog-specific layout. */
|
|
||||||
.adaptive-stack {
|
|
||||||
display: flex; flex-direction: column; gap: 12px;
|
|
||||||
border-top: 1px solid var(--divider-color);
|
|
||||||
padding-top: 12px;
|
|
||||||
}
|
|
||||||
.adaptive-empty {
|
|
||||||
padding: 16px; text-align: center;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-style: italic; font-size: 13px;
|
|
||||||
border-top: 1px solid var(--divider-color);
|
|
||||||
}
|
|
||||||
.toast {
|
|
||||||
padding: 8px 12px; border-radius: 6px;
|
|
||||||
background: rgba(76, 175, 80, 0.15);
|
|
||||||
color: #4caf50; font-size: 13px; font-weight: 500;
|
|
||||||
}
|
|
||||||
/* The panel's recommendation-card uses ha-button. We use plain <button>
|
|
||||||
in this dialog's button styles. Re-style the action row to match. */
|
|
||||||
.recommendation-actions {
|
|
||||||
display: flex; gap: 8px; margin-top: 8px;
|
|
||||||
}
|
|
||||||
/* Constrain SVG charts so they fit the dialog width even on mobile. */
|
|
||||||
.weibull-section, .seasonal-card-compact { max-width: 100%; }
|
|
||||||
.weibull-chart svg { max-width: 100%; height: auto; }
|
|
||||||
.details-toggle { gap: 12px; flex-wrap: wrap; }
|
|
||||||
`],m([R({attribute:!1})],k.prototype,"hass",2),m([g()],k.prototype,"_open",2),m([g()],k.prototype,"_entryId",2),m([g()],k.prototype,"_taskId",2),m([g()],k.prototype,"_task",2),m([g()],k.prototype,"_objectName",2),m([g()],k.prototype,"_busy",2),m([g()],k.prototype,"_error",2),m([g()],k.prototype,"_showSkip",2),m([g()],k.prototype,"_showReset",2),m([g()],k.prototype,"_showDetails",2),m([g()],k.prototype,"_showAdaptive",2),m([g()],k.prototype,"_skipReason",2),m([g()],k.prototype,"_resetDate",2),m([g()],k.prototype,"_features",2),m([g()],k.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",k);function xt(e){return!!e&&/^https?:\/\//i.test(e)}function kt(e){return e?customElements.get("ha-markdown")?o`<ha-markdown class="notes-md" .content=${e} breaks></ha-markdown>`:o`${e}`:u}var M=class extends O{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return E(this.hass)}async openFor(t){this._entryId=t,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=t}catch(t){this._error=L(t,this._lang)}}_onEditObject(){!this._entryId||!this._data||import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-P3P7TFC2.js").then(({openEditObjectDialog:t})=>{t(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-P3P7TFC2.js").then(({openCreateTaskDialog:t})=>{t(this._entryId),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let t=i("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(t)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(n){this._error=L(n,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let t=!!this._data.object.archived;if(!t){let n=i("confirm_archive_object",this._lang)||"Archive this object and its tasks?";if(!window.confirm(n))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:t?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(n){this._error=L(n,this._lang)}finally{this._busy=!1}}_onTaskClick(t){this._entryId&&import("/maintenance_supporter_panelfiles/panel-chunks/dialog-mount-P3P7TFC2.js").then(({openTaskQuickActions:n})=>{n(this._entryId,t)})}render(){if(!this._open)return u;let t=this._lang,n=this._data,a=n?.object,r=n?.tasks||[],l=this.hass?.user?.is_admin??!0;return o`
|
|
||||||
<div class="backdrop" @click=${this.close}></div>
|
|
||||||
<div class="dialog" role="dialog" aria-modal="true">
|
|
||||||
${n&&a?o`
|
|
||||||
<div class="header">
|
|
||||||
<div class="title">${a.name}</div>
|
|
||||||
${this._renderMetaRow(a)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
${this._error?o`<div class="error">${this._error}</div>`:u}
|
|
||||||
|
|
||||||
<div class="tasks-section">
|
|
||||||
<div class="section-header">
|
|
||||||
<strong>${i("tasks",t)||"Tasks"}</strong>
|
|
||||||
<span class="count">${r.length}</span>
|
|
||||||
</div>
|
|
||||||
${r.length===0?o`<div class="empty">${i("no_tasks",t)||"No tasks yet."}</div>`:o`
|
|
||||||
<div class="task-list">
|
|
||||||
${r.map(d=>o`
|
|
||||||
<div class="task-row" @click=${()=>this._onTaskClick(d.id)}>
|
|
||||||
<span class="status-dot" style="background: ${B[d.status]||"#ccc"}"></span>
|
|
||||||
<span class="task-name">${d.name}</span>
|
|
||||||
<span class="task-status">${i(d.status||"ok",t)}</span>
|
|
||||||
</div>
|
|
||||||
`)}
|
|
||||||
</div>
|
|
||||||
`}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
${a.notes?o`
|
|
||||||
<div class="notes-section">
|
|
||||||
<strong>${i("object_notes_label",t)}</strong>
|
|
||||||
<div class="notes-body">${kt(a.notes)}</div>
|
|
||||||
</div>
|
|
||||||
`:u}
|
|
||||||
|
|
||||||
${l?o`
|
|
||||||
<div class="actions">
|
|
||||||
<button class="btn primary" @click=${this._onAddTask} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="mdi:plus"></ha-icon>
|
|
||||||
${i("add_task",t)||"Add task"}
|
|
||||||
</button>
|
|
||||||
<button class="btn" @click=${this._onEditObject} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="mdi:pencil"></ha-icon>
|
|
||||||
${i("edit",t)||"Edit"}
|
|
||||||
</button>
|
|
||||||
<button class="btn" @click=${this._onArchiveObject} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="${a.archived?"mdi:archive-arrow-up-outline":"mdi:archive-outline"}"></ha-icon>
|
|
||||||
${a.archived?i("unarchive_object",t)||"Unarchive object":i("archive_object",t)||"Archive object"}
|
|
||||||
</button>
|
|
||||||
<button class="btn danger" @click=${this._onDelete} ?disabled=${this._busy}>
|
|
||||||
<ha-icon icon="mdi:delete"></ha-icon>
|
|
||||||
${i("delete",t)||"Delete"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
`:u}
|
|
||||||
`:o`<div class="loading">${i("loading",t)||"Loading\u2026"}</div>`}
|
|
||||||
</div>
|
|
||||||
`}_renderMetaRow(t){let n=this._lang,a=[];return t.area_id&&a.push([i("area",n),t.area_id]),t.manufacturer&&a.push([i("manufacturer",n),t.manufacturer]),t.model&&a.push([i("model",n),t.model]),t.serial_number&&a.push([i("serial_number_label",n),t.serial_number]),t.installation_date&&a.push([i("installed",n),t.installation_date]),t.warranty_expiry&&a.push([i("warranty",n),t.warranty_expiry]),t.documentation_url&&a.push([i("documentation_url_label",n),t.documentation_url]),a.length===0?u:o`
|
|
||||||
<div class="meta">
|
|
||||||
${a.map(([r,l])=>o`
|
|
||||||
<div class="meta-item">
|
|
||||||
<span class="meta-label">${r}</span>
|
|
||||||
<span class="meta-value">${xt(l)?o`<a href="${l}" target="_blank" rel="noopener noreferrer">${l}</a>`:l}</span>
|
|
||||||
</div>
|
|
||||||
`)}
|
|
||||||
</div>
|
|
||||||
`}};M.styles=H`
|
|
||||||
:host { display: contents; }
|
|
||||||
.backdrop {
|
|
||||||
position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.5);
|
|
||||||
}
|
|
||||||
.dialog {
|
|
||||||
position: fixed; left: 50%; top: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
width: 95vw; max-width: 480px;
|
|
||||||
max-height: 92vh; overflow: auto;
|
|
||||||
background: var(--card-background-color, var(--ha-card-background, #1c1c1c));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 10px 30px rgba(0,0,0,0.4);
|
|
||||||
padding: 20px; z-index: 101;
|
|
||||||
display: flex; flex-direction: column; gap: 14px;
|
|
||||||
}
|
|
||||||
.header { display: flex; flex-direction: column; gap: 6px; }
|
|
||||||
.title { font-size: 20px; font-weight: 600; }
|
|
||||||
.meta { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; border-top: 1px solid var(--divider-color); }
|
|
||||||
.meta-item { display: flex; gap: 8px; font-size: 12px; }
|
|
||||||
.meta-label { color: var(--secondary-text-color); min-width: 100px; }
|
|
||||||
.meta-value { color: var(--primary-text-color); flex: 1; word-break: break-word; }
|
|
||||||
.meta-value a { color: var(--primary-color); }
|
|
||||||
.tasks-section, .notes-section { display: flex; flex-direction: column; gap: 6px; }
|
|
||||||
.section-header { display: flex; align-items: baseline; gap: 8px; }
|
|
||||||
.count {
|
|
||||||
font-size: 11px; color: var(--secondary-text-color);
|
|
||||||
background: var(--secondary-background-color); padding: 2px 8px; border-radius: 999px;
|
|
||||||
}
|
|
||||||
.empty { color: var(--secondary-text-color); font-style: italic; font-size: 13px; padding: 8px 0; }
|
|
||||||
.task-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow: auto; }
|
|
||||||
.task-row {
|
|
||||||
display: flex; align-items: center; gap: 10px;
|
|
||||||
padding: 8px; border-radius: 6px; cursor: pointer;
|
|
||||||
background: var(--secondary-background-color, rgba(255,255,255,0.03));
|
|
||||||
transition: background 0.12s;
|
|
||||||
}
|
|
||||||
.task-row:hover { background: var(--state-icon-color, rgba(255,255,255,0.06)); }
|
|
||||||
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
|
|
||||||
.task-name { flex: 1; font-size: 14px; }
|
|
||||||
.task-status { font-size: 11px; color: var(--secondary-text-color); text-transform: uppercase; }
|
|
||||||
.notes-body { white-space: pre-wrap; font-size: 13px; padding: 8px; background: var(--secondary-background-color); border-radius: 6px; }
|
|
||||||
.notes-body ha-markdown { white-space: normal; }
|
|
||||||
.actions { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--divider-color); }
|
|
||||||
.actions .btn { flex: 1; }
|
|
||||||
.btn {
|
|
||||||
padding: 8px; font-size: 13px; border-radius: 6px; cursor: pointer;
|
|
||||||
border: 1px solid var(--divider-color);
|
|
||||||
background: var(--secondary-background-color, transparent);
|
|
||||||
color: var(--primary-text-color); font-weight: 500;
|
|
||||||
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
|
||||||
}
|
|
||||||
.btn:hover { background: var(--state-icon-color, rgba(255,255,255,0.06)); }
|
|
||||||
.btn[disabled] { opacity: 0.5; cursor: wait; }
|
|
||||||
.btn.primary { background: var(--primary-color); color: var(--text-primary-color, white); border-color: var(--primary-color); }
|
|
||||||
.btn.danger { color: var(--error-color); }
|
|
||||||
.btn ha-icon { --mdc-icon-size: 16px; }
|
|
||||||
.loading { padding: 24px; text-align: center; color: var(--secondary-text-color); }
|
|
||||||
.error { padding: 8px; border-radius: 6px; background: rgba(211,47,47,0.1); color: var(--error-color); font-size: 13px; }
|
|
||||||
`,m([R({attribute:!1})],M.prototype,"hass",2),m([g()],M.prototype,"_open",2),m([g()],M.prototype,"_entryId",2),m([g()],M.prototype,"_data",2),m([g()],M.prototype,"_busy",2),m([g()],M.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",M);var $t="maintenance-object-dialog",wt="maintenance-task-dialog",Wt="maintenance-history-edit-dialog",Ft="maintenance-complete-dialog",Bt="maintenance-qr-dialog",Ut="maintenance-task-quick-actions-dialog",Kt="maintenance-object-quick-actions-dialog";function K(){return document.querySelector("home-assistant")?.hass}function Gt(){return document.querySelector("home-assistant")?.shadowRoot??document.body}function C(e){let s=Gt(),t=s.querySelector(e)??document.body.querySelector(e);return t?t.parentNode!==s&&s.appendChild(t):(t=document.createElement(e),s.appendChild(t)),t}function I(e){let s=K();if(!s)return!1;e.hass=s;let t=E(s);return tt(t)||et(t).then(()=>{e.requestUpdate?.()}),nt(s.locale,s.config?.country),!0}var Q={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7,rowActionStyle:"buttons_compact"};function fn(e){return J(e).then(s=>s.rowActionStyle)}function yn(){V=null}var V=null;function J(e){return V||(V=e.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(s=>({features:s.features??Q.features,defaultWarningDays:s.general?.default_warning_days??7,rowActionStyle:s.general?.row_action_style??Q.rowActionStyle})).catch(()=>Q),V)}function gn(){let e=C($t);return I(e)?(e.openCreate(),!0):!1}function vn(e,s){let t=C($t);return I(t)?(t.openEdit(e,s),!0):!1}function bn(e="",s){let t=C(wt);if(!I(t))return!1;let n=K();return n?((async()=>{let a=await J(n),r=t;r.checklistsEnabled=a.features.checklists,r.scheduleTimeEnabled=a.features.schedule_time,r.completionActionsEnabled=a.features.completion_actions,r.defaultWarningDays=a.defaultWarningDays,r.openCreate(e,s)})(),!0):!1}function xn(e,s){let t=C(wt);if(!I(t))return!1;let n=K();return n?((async()=>{try{let[a,r]=await Promise.all([n.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:e}),J(n)]),l=(a.tasks||[]).find(p=>p.id===s);if(!l){console.warn(`openEditTaskDialog: task ${s} not found in entry ${e}`);return}let d=t;d.checklistsEnabled=r.features.checklists,d.scheduleTimeEnabled=r.features.schedule_time,d.completionActionsEnabled=r.features.completion_actions,d.defaultWarningDays=r.defaultWarningDays,await d.openEdit(e,l)}catch(a){console.warn("openEditTaskDialog: failed to load task/features",a)}})(),!0):!1}function kn(e){let s=C(Wt);return I(s)?(s.openEdit(e),!0):!1}function $n(e){let s=C(Ft);return I(s)?(_t(s,e,K()?.language||"en"),!0):!1}function wn(e){let s=C(Bt);return I(s)?(s.openForTask(e.entry_id,e.task_id,e.object_name,e.task_name),!0):!1}function An(e,s){let t=C(Ut);return I(t)?(t.openFor(e,s),!0):!1}function Dn(e){let s=C(Kt);return I(s)?(s.openFor(e),!0):!1}export{xt as a,ne as b,kt as c,jt as d,Ot as e,Z as f,ht as g,_t as h,y as i,he as j,_e as k,me as l,fe as m,ye as n,ge as o,ve as p,q,ie as r,re as s,mt as t,ft as u,yt as v,vt as w,bt as x,fn as y,yn as z,gn as A,vn as B,bn as C,xn as D,kn as E,$n as F,wn as G,An as H,Dn as I};
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.71.0 */
|
|
||||||
import{a as u}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-GJI3RTUI.js";import{a as r,b as _,c as l,f as o,h as p,l as d,m as s,q as i,s as h}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-PBRIQQ2X.js";var a=class extends p{constructor(){super(...arguments);this.objects=[];this._open=!1;this._loading=!1;this._error="";this._name="";this._manufacturer="";this._model="";this._serialNumber="";this._areaId="";this._installationDate="";this._warrantyExpiry="";this._documentationUrl="";this._notes="";this._haDeviceId="";this._parentEntryId="";this._entryId=null}get _lang(){return h(this.hass)}openCreate(){this._entryId=null,this._name="",this._manufacturer="",this._model="",this._serialNumber="",this._areaId="",this._installationDate="",this._warrantyExpiry="",this._documentationUrl="",this._notes="",this._haDeviceId="",this._parentEntryId="",this._error="",this._open=!0}openEdit(e,n){this._entryId=e,this._name=n.name||"",this._manufacturer=n.manufacturer||"",this._model=n.model||"",this._serialNumber=n.serial_number||"",this._areaId=n.area_id||"",this._installationDate=n.installation_date||"",this._warrantyExpiry=n.warranty_expiry||"",this._documentationUrl=n.documentation_url||"",this._notes=n.notes||"",this._haDeviceId=n.ha_device_id||"",this._parentEntryId=n.parent_entry_id||"",this._error="",this._open=!0}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{this._entryId?await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/update",entry_id:this._entryId,name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}):await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/create",name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}),this._open=!1,this.dispatchEvent(new CustomEvent("object-saved"))}catch(e){this._error=u(e,this._lang,i("save_error",this._lang))}finally{this._loading=!1}}}_parentChoices(){return(this.objects||[]).filter(e=>e.entry_id!==this._entryId)}_close(){this._open=!1}render(){if(!this._open)return l``;let e=this._lang,n=this._entryId?i("edit_object",e):i("new_object",e);return l`
|
|
||||||
<ha-dialog open @closed=${this._close}>
|
|
||||||
<div class="dialog-title">${n}</div>
|
|
||||||
<div class="content">
|
|
||||||
${this._error?l`<div class="error">${this._error}</div>`:o}
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("name",e)}"
|
|
||||||
required
|
|
||||||
.value=${this._name}
|
|
||||||
@input=${t=>this._name=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("manufacturer_optional",e)}"
|
|
||||||
.value=${this._manufacturer}
|
|
||||||
@input=${t=>this._manufacturer=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("model_optional",e)}"
|
|
||||||
.value=${this._model}
|
|
||||||
@input=${t=>this._model=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("serial_number_optional",e)}"
|
|
||||||
.value=${this._serialNumber}
|
|
||||||
@input=${t=>this._serialNumber=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("documentation_url_optional",e)}"
|
|
||||||
type="url"
|
|
||||||
.value=${this._documentationUrl}
|
|
||||||
@input=${t=>this._documentationUrl=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ha-area-picker
|
|
||||||
.hass=${this.hass}
|
|
||||||
label="${i("area_id_optional",e)}"
|
|
||||||
.value=${this._areaId}
|
|
||||||
@value-changed=${t=>this._areaId=t.detail.value||""}
|
|
||||||
></ha-area-picker>
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("installation_date_optional",e)}"
|
|
||||||
type="date"
|
|
||||||
.value=${this._installationDate}
|
|
||||||
@input=${t=>this._installationDate=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ms-textfield
|
|
||||||
label="${i("warranty_expiry_optional",e)}"
|
|
||||||
type="date"
|
|
||||||
.value=${this._warrantyExpiry}
|
|
||||||
@input=${t=>this._warrantyExpiry=t.target.value}
|
|
||||||
></ms-textfield>
|
|
||||||
<ha-form
|
|
||||||
.hass=${this.hass}
|
|
||||||
.data=${{device:this._haDeviceId||void 0}}
|
|
||||||
.schema=${[{name:"device",selector:{device:{}}}]}
|
|
||||||
.computeLabel=${()=>i("link_device_optional",e)}
|
|
||||||
@value-changed=${t=>this._haDeviceId=t.detail.value?.device||""}
|
|
||||||
></ha-form>
|
|
||||||
${this._parentChoices().length?l`<label class="textarea-field">
|
|
||||||
<span class="textarea-label">${i("parent_object_optional",e)}</span>
|
|
||||||
<select
|
|
||||||
class="parent-select"
|
|
||||||
.value=${this._parentEntryId}
|
|
||||||
@change=${t=>this._parentEntryId=t.target.value}
|
|
||||||
>
|
|
||||||
<option value="" ?selected=${!this._parentEntryId}>
|
|
||||||
${i("parent_none",e)}
|
|
||||||
</option>
|
|
||||||
${this._parentChoices().map(t=>l`<option
|
|
||||||
value=${t.entry_id}
|
|
||||||
?selected=${this._parentEntryId===t.entry_id}
|
|
||||||
>${t.object.name}</option>`)}
|
|
||||||
</select>
|
|
||||||
</label>`:o}
|
|
||||||
<label class="textarea-field">
|
|
||||||
<span class="textarea-label">${i("object_notes_optional",e)}</span>
|
|
||||||
<textarea
|
|
||||||
rows="3"
|
|
||||||
.value=${this._notes}
|
|
||||||
@input=${t=>this._notes=t.target.value}
|
|
||||||
></textarea>
|
|
||||||
<span class="md-hint">${i("notes_markdown_hint",e)}</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="dialog-actions">
|
|
||||||
<ha-button appearance="plain" @click=${this._close}>
|
|
||||||
${i("cancel",this._lang)}
|
|
||||||
</ha-button>
|
|
||||||
<ha-button
|
|
||||||
@click=${this._save}
|
|
||||||
.disabled=${this._loading||!this._name.trim()}
|
|
||||||
>
|
|
||||||
${this._loading?i("saving",this._lang):i("save",this._lang)}
|
|
||||||
</ha-button>
|
|
||||||
</div>
|
|
||||||
</ha-dialog>
|
|
||||||
`}};a.styles=_`
|
|
||||||
.dialog-title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 16px;
|
|
||||||
min-width: 300px;
|
|
||||||
}
|
|
||||||
.dialog-actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 8px;
|
|
||||||
padding-top: 16px;
|
|
||||||
}
|
|
||||||
ms-textfield {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.textarea-field {
|
|
||||||
display: flex; flex-direction: column; gap: 4px;
|
|
||||||
}
|
|
||||||
.textarea-label {
|
|
||||||
font-size: 12px; color: var(--secondary-text-color, #888); font-weight: 500;
|
|
||||||
}
|
|
||||||
.textarea-field textarea {
|
|
||||||
padding: 8px 10px; font-size: 14px; font-family: inherit;
|
|
||||||
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color); border-radius: 6px;
|
|
||||||
resize: vertical;
|
|
||||||
}
|
|
||||||
.textarea-field textarea:focus {
|
|
||||||
outline: none; border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
.md-hint {
|
|
||||||
font-size: 11px; color: var(--secondary-text-color); font-style: italic;
|
|
||||||
}
|
|
||||||
.parent-select {
|
|
||||||
padding: 8px 10px; font-size: 14px; font-family: inherit;
|
|
||||||
background: var(--secondary-background-color, rgba(0,0,0,0.06));
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
border: 1px solid var(--divider-color); border-radius: 6px;
|
|
||||||
}
|
|
||||||
.error {
|
|
||||||
color: var(--error-color, #f44336);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
`,r([d({attribute:!1})],a.prototype,"hass",2),r([d({attribute:!1})],a.prototype,"objects",2),r([s()],a.prototype,"_open",2),r([s()],a.prototype,"_loading",2),r([s()],a.prototype,"_error",2),r([s()],a.prototype,"_name",2),r([s()],a.prototype,"_manufacturer",2),r([s()],a.prototype,"_model",2),r([s()],a.prototype,"_serialNumber",2),r([s()],a.prototype,"_areaId",2),r([s()],a.prototype,"_installationDate",2),r([s()],a.prototype,"_warrantyExpiry",2),r([s()],a.prototype,"_documentationUrl",2),r([s()],a.prototype,"_notes",2),r([s()],a.prototype,"_haDeviceId",2),r([s()],a.prototype,"_parentEntryId",2),r([s()],a.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",a);export{a};
|
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*! maintenance_supporter frontend 2.80.0 */
|
/*! maintenance_supporter frontend 2.82.0 */
|
||||||
import{a as r,b as l,c as i,f as o,h as n,l as t}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-NAI3MD3R.js";var e=class extends n{constructor(){super(...arguments);this.label="";this.value="";this.placeholder="";this.type="text";this.required=!1;this.disabled=!1;this.multiline=!1;this.rows=3}_onInput(s){let a=s.target.value;this.value=a,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:a}}))}render(){return i`
|
import{a as r,b as l,c as i,f as o,h as n,l as t}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-4OPY4VQ5.js";var e=class extends n{constructor(){super(...arguments);this.label="";this.value="";this.placeholder="";this.type="text";this.required=!1;this.disabled=!1;this.multiline=!1;this.rows=3}_onInput(s){let a=s.target.value;this.value=a,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:a}}))}render(){return i`
|
||||||
<label class="field">
|
<label class="field">
|
||||||
${this.label?i`<span class="label">${this.label}${this.required?i`<span class="req">*</span>`:o}</span>`:o}
|
${this.label?i`<span class="label">${this.label}${this.required?i`<span class="req">*</span>`:o}</span>`:o}
|
||||||
${this.multiline?i`
|
${this.multiline?i`
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
/*! maintenance_supporter frontend 2.74.0 */
|
|
||||||
import{a as r,b as d,c as a,f as l,h as p,l as s,q as c}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-Y2JXJRDF.js";function h(o,e){if(e)switch(o){case"date":return e.split("T")[0];case"time":return e.length===5?`${e}:00`:e;case"datetime":{let[i,n="00:00:00"]=e.split("T");return`${i} ${n.length===5?`${n}:00`:n}`}}}function u(o,e){if(typeof e!="string"||!e)return"";switch(o){case"date":return e.slice(0,10);case"time":return e.slice(0,5);case"datetime":{let[i,n="00:00:00"]=e.split(" ");return`${i}T${n.length===5?`${n}:00`:n}`}}}var t=class extends p{constructor(){super(...arguments);this.kind="date";this.label="";this.value="";this.clearable=!1;this.disabled=!1;this.required=!1;this.lang="en"}_selector(){switch(this.kind){case"date":return{date:{}};case"time":return{time:{no_second:!0}};case"datetime":return{datetime:{}}}}_onSelectorChange(i){i.stopPropagation(),this._emit(u(this.kind,i.detail?.value))}_clear(){this._emit("")}_emit(i){i!==this.value&&(this.value=i,this.dispatchEvent(new CustomEvent("value-changed",{bubbles:!0,composed:!0,detail:{value:i}})))}render(){return a`
|
|
||||||
<div class="field">
|
|
||||||
${this.label?a`<span class="label">${this.label}${this.required?a`<span class="req">*</span>`:l}</span>`:l}
|
|
||||||
<div class="row">
|
|
||||||
<ha-selector
|
|
||||||
.hass=${this.hass}
|
|
||||||
.selector=${this._selector()}
|
|
||||||
.value=${h(this.kind,this.value)}
|
|
||||||
.required=${this.required}
|
|
||||||
.disabled=${this.disabled}
|
|
||||||
@value-changed=${this._onSelectorChange}
|
|
||||||
></ha-selector>
|
|
||||||
${this.clearable&&this.value&&!this.disabled?a`<button type="button" class="clear" title=${c("clear",this.lang)} aria-label=${c("clear",this.lang)} @click=${this._clear}>
|
|
||||||
<ha-icon icon="mdi:close"></ha-icon>
|
|
||||||
</button>`:l}
|
|
||||||
</div>
|
|
||||||
${this.helper?a`<span class="helper">${this.helper}</span>`:l}
|
|
||||||
</div>
|
|
||||||
`}};t.styles=d`
|
|
||||||
:host { display: block; }
|
|
||||||
.field {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 4px;
|
|
||||||
}
|
|
||||||
.label {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--secondary-text-color, #888);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
.req { color: var(--error-color, #f44336); margin-left: 2px; }
|
|
||||||
.row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
}
|
|
||||||
ha-selector {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
.clear {
|
|
||||||
flex: none;
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 36px;
|
|
||||||
height: 36px;
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: transparent;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
cursor: pointer;
|
|
||||||
--mdc-icon-size: 20px;
|
|
||||||
}
|
|
||||||
.clear:hover { background: rgba(var(--rgb-primary-text-color, 0, 0, 0), 0.08); }
|
|
||||||
.clear:focus-visible { outline: 2px solid var(--primary-color); }
|
|
||||||
.helper {
|
|
||||||
font-size: 11px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
`,r([s({attribute:!1})],t.prototype,"hass",2),r([s()],t.prototype,"kind",2),r([s()],t.prototype,"label",2),r([s()],t.prototype,"value",2),r([s()],t.prototype,"helper",2),r([s({type:Boolean})],t.prototype,"clearable",2),r([s({type:Boolean})],t.prototype,"disabled",2),r([s({type:Boolean})],t.prototype,"required",2),r([s()],t.prototype,"lang",2);customElements.get("ms-date-field")||customElements.define("ms-date-field",t);
|
|
||||||
Loaded 100 of 201 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user