myio-js-library 0.1.574 → 0.1.576

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -233,6 +233,7 @@ __export(src_exports, {
233
233
  MENU_SHOPPING_CSS_PREFIX: () => MENU_SHOPPING_CSS_PREFIX,
234
234
  METRO_TILE_COLORS: () => METRO_TILE_COLORS,
235
235
  MONEY_DASH: () => DASH,
236
+ MONEY_HOURLY_MAX_DAYS: () => MONEY_HOURLY_MAX_DAYS,
236
237
  MONEY_REQUIRES_DEVICE_GRANULARITY: () => MONEY_REQUIRES_DEVICE_GRANULARITY,
237
238
  MONEY_VARIANCE_HEADER: () => MONEY_VARIANCE_HEADER,
238
239
  MOTOR_SORT_OPTIONS: () => MOTOR_SORT_OPTIONS,
@@ -314,6 +315,7 @@ __export(src_exports, {
314
315
  SolenoidControlView: () => SolenoidControlView,
315
316
  SwitchControlController: () => SwitchControlController,
316
317
  SwitchControlView: () => SwitchControlView,
318
+ TARIFF_DEFAULT_TIMEZONE: () => TARIFF_DEFAULT_TIMEZONE,
317
319
  TELEMETRY_CONTEXT_CONFIG: () => CONTEXT_CONFIG,
318
320
  TELEMETRY_DEFAULT_FILTER_TABS: () => DEFAULT_FILTER_TABS,
319
321
  TELEMETRY_DOMAIN_CONFIG: () => DOMAIN_CONFIG6,
@@ -518,6 +520,7 @@ __export(src_exports, {
518
520
  createSwitchControl: () => createSwitchControl,
519
521
  createTariffApiAdapter: () => createTariffApiAdapter,
520
522
  createTariffApiClient: () => createTariffApiClient,
523
+ createTariffValuator: () => createTariffValuator,
521
524
  createTbEnvelopeStore: () => createTbEnvelopeStore,
522
525
  createTelemetryGridComponent: () => createTelemetryGridComponent,
523
526
  createTelemetryGridShoppingComponent: () => createTelemetryGridShoppingComponent,
@@ -558,7 +561,7 @@ __export(src_exports, {
558
561
  doSchedulesOverlap: () => doSchedulesOverlap,
559
562
  downloadAnnotationsTextFile: () => downloadTextFile,
560
563
  encodeDeviceProductCode: () => encodeDeviceProductCode,
561
- escapeAnnotationHtml: () => escapeHtml20,
564
+ escapeAnnotationHtml: () => escapeHtml22,
562
565
  evaluateDeviceStatus: () => evaluateDeviceStatus,
563
566
  expandBandHours: () => expandBandHours,
564
567
  expandBandToHourBucketsByYear: () => expandBandToHourBucketsByYear,
@@ -809,6 +812,7 @@ __export(src_exports, {
809
812
  openGatewayModal: () => openGatewayModal,
810
813
  openGenericModal: () => openGenericModal,
811
814
  openGoalsPanel: () => openGoalsPanel,
815
+ openGoalsTariffsHub: () => openGoalsTariffsHub,
812
816
  openHelpModal: () => openHelpModal,
813
817
  openIntegrationsModal: () => openIntegrationsModal,
814
818
  openManualDeviceModal: () => openManualDeviceModal,
@@ -907,7 +911,7 @@ __export(src_exports, {
907
911
  schedCreateNumberInput: () => createNumberInput,
908
912
  schedCreateSelect: () => createSelect,
909
913
  schedCreateTimeInput: () => createTimeInput,
910
- schedEscapeHtml: () => escapeHtml19,
914
+ schedEscapeHtml: () => escapeHtml21,
911
915
  schedShowConfirmModal: () => showConfirmModal,
912
916
  schedShowNotificationModal: () => showNotificationModal,
913
917
  selectBreakdownItems: () => selectBreakdownItems,
@@ -958,7 +962,7 @@ module.exports = __toCommonJS(src_exports);
958
962
  // package.json
959
963
  var package_default = {
960
964
  name: "myio-js-library",
961
- version: "0.1.574",
965
+ version: "0.1.576",
962
966
  description: "A clean, standalone JS SDK for MYIO projects",
963
967
  license: "MIT",
964
968
  repository: "github:gh-myio/myio-js-library",
@@ -41425,10 +41429,10 @@ var WaterTankModalView = class {
41425
41429
  */
41426
41430
  render() {
41427
41431
  const { params } = this.config;
41428
- const STYLE_ID23 = "myio-water-tank-modal-styles";
41429
- if (!document.getElementById(STYLE_ID23)) {
41432
+ const STYLE_ID24 = "myio-water-tank-modal-styles";
41433
+ if (!document.getElementById(STYLE_ID24)) {
41430
41434
  const style = document.createElement("style");
41431
- style.id = STYLE_ID23;
41435
+ style.id = STYLE_ID24;
41432
41436
  style.textContent = `
41433
41437
  @media (max-width: 640px) {
41434
41438
  .myio-water-tank-modal { width: 100vw !important; max-width: 100vw !important; max-height: 100vh !important; border-radius: 0 !important; }
@@ -63317,6 +63321,285 @@ var WellEquipmentTab = class {
63317
63321
  }
63318
63322
  };
63319
63323
 
63324
+ // src/components/premium-modals/settings/retrolavagem/RetrolavagemTab.ts
63325
+ var RETROLAVAGEM_PROFILE = "HIDROMETRO_ENTRADA_RETROLAVAGEM";
63326
+ var RETROLAVAGEM_BINDINGS_KEY = "retrolavagemBindings";
63327
+ var MAX_RETROLAVAGEM_DEVICES_PER_SIDE = 10;
63328
+ var MAX_CUSTOMER_DEVICE_PAGES2 = 100;
63329
+ var SIDE_TEXT = {
63330
+ inputs: { title: "Entrada", add: "+ Adicionar entrada", hint: "Hidr\xF4metros que medem a \xE1gua que entra na retrolavagem." },
63331
+ outputs: { title: "Sa\xEDda", add: "+ Adicionar sa\xEDda", hint: "Hidr\xF4metros que medem a \xE1gua que sai da retrolavagem." }
63332
+ };
63333
+ function isRetrolavagemCandidateProfile(profile) {
63334
+ const p = String(profile || "").trim().toUpperCase();
63335
+ return p.startsWith("HIDROMETRO") && p !== RETROLAVAGEM_PROFILE && !p.endsWith("_MANUAL");
63336
+ }
63337
+ function escapeHtml7(value) {
63338
+ return value.replace(/[&<>"']/g, (char) => ({
63339
+ "&": "&amp;",
63340
+ "<": "&lt;",
63341
+ ">": "&gt;",
63342
+ '"': "&quot;",
63343
+ "'": "&#39;"
63344
+ })[char]);
63345
+ }
63346
+ function normalizeRetrolavagemBindings(value) {
63347
+ let parsed = value;
63348
+ if (typeof value === "string") {
63349
+ try {
63350
+ parsed = JSON.parse(value);
63351
+ } catch {
63352
+ parsed = null;
63353
+ }
63354
+ }
63355
+ const raw = parsed && typeof parsed === "object" ? parsed : {};
63356
+ const seen = /* @__PURE__ */ new Set();
63357
+ const side = (items) => (Array.isArray(items) ? items : []).filter((item) => !!item && typeof item === "object" && typeof item.tbId === "string" && !!item.tbId).filter((item) => seen.has(item.tbId) ? false : (seen.add(item.tbId), true)).slice(0, MAX_RETROLAVAGEM_DEVICES_PER_SIDE).map((item) => ({
63358
+ tbId: item.tbId,
63359
+ label: String(item.label || item.tbId),
63360
+ ...item.gcdrId ? { gcdrId: String(item.gcdrId) } : {}
63361
+ }));
63362
+ const inputs = side(raw.inputs);
63363
+ const outputs = side(raw.outputs);
63364
+ return { version: 1, inputs, outputs };
63365
+ }
63366
+ var RetrolavagemTab = class {
63367
+ config;
63368
+ catalog = [];
63369
+ bindings = { version: 1, inputs: [], outputs: [] };
63370
+ /** Linhas na tela (tbId '' = linha vazia ainda sem device escolhido) */
63371
+ rows = { inputs: [], outputs: [] };
63372
+ loaded = false;
63373
+ catalogWarnings = 0;
63374
+ constructor(config2) {
63375
+ this.config = config2;
63376
+ }
63377
+ async init() {
63378
+ this.config.container.innerHTML = '<p class="rlt-state">Carregando v\xEDnculos e hidr\xF4metros\u2026</p>';
63379
+ try {
63380
+ const [attributes, catalog] = await Promise.all([
63381
+ this.fetchAttributes(this.config.deviceId, RETROLAVAGEM_BINDINGS_KEY),
63382
+ this.fetchCatalog()
63383
+ ]);
63384
+ this.bindings = normalizeRetrolavagemBindings(attributes.get(RETROLAVAGEM_BINDINGS_KEY));
63385
+ this.catalog = catalog;
63386
+ this.rows = { inputs: this.bindings.inputs.map((d) => d.tbId), outputs: this.bindings.outputs.map((d) => d.tbId) };
63387
+ this.loaded = true;
63388
+ this.render();
63389
+ if (this.catalogWarnings > 0) {
63390
+ this.showMessage(`${this.catalogWarnings} hidr\xF4metro(s) n\xE3o puderam ser verificados e foram omitidos da lista.`, true);
63391
+ }
63392
+ } catch (error) {
63393
+ this.config.container.innerHTML = `<p class="rlt-state rlt-error" role="alert">N\xE3o foi poss\xEDvel carregar os v\xEDnculos ou a lista de hidr\xF4metros: ${escapeHtml7(
63394
+ this.errorMessage(error)
63395
+ )}</p>`;
63396
+ }
63397
+ }
63398
+ destroy() {
63399
+ }
63400
+ headers() {
63401
+ return { "X-Authorization": `Bearer ${this.config.jwtToken}`, "Content-Type": "application/json" };
63402
+ }
63403
+ async fetchAttributes(deviceId, keys) {
63404
+ const url = `${this.config.tbBaseUrl}/api/plugins/telemetry/DEVICE/${encodeURIComponent(deviceId)}/values/attributes/SERVER_SCOPE?keys=${encodeURIComponent(keys)}`;
63405
+ const response = await fetch(url, { headers: this.headers() });
63406
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
63407
+ const raw = await response.json();
63408
+ if (!Array.isArray(raw)) throw new Error("Resposta de atributos inv\xE1lida");
63409
+ return new Map(raw.map(({ key, value }) => [key, value]));
63410
+ }
63411
+ async fetchCatalog() {
63412
+ if (!this.config.customerId) throw new Error("customerId indispon\xEDvel");
63413
+ const devices = [];
63414
+ let page = 0;
63415
+ let hasNext = true;
63416
+ while (hasNext) {
63417
+ if (page >= MAX_CUSTOMER_DEVICE_PAGES2) throw new Error(`Lista excede o limite de ${MAX_CUSTOMER_DEVICE_PAGES2} p\xE1ginas`);
63418
+ const query = new URLSearchParams({ pageSize: "1000", page: String(page) });
63419
+ const response = await fetch(
63420
+ `${this.config.tbBaseUrl}/api/customer/${encodeURIComponent(this.config.customerId)}/devices?${query}`,
63421
+ { headers: this.headers() }
63422
+ );
63423
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
63424
+ const result = await response.json();
63425
+ if (!Array.isArray(result.data)) throw new Error("Resposta de dispositivos inv\xE1lida");
63426
+ if (result.hasNext === true && result.data.length === 0) throw new Error("Pagina\xE7\xE3o da lista n\xE3o avan\xE7ou");
63427
+ devices.push(...result.data);
63428
+ hasNext = result.hasNext === true;
63429
+ page += 1;
63430
+ }
63431
+ const queue = devices.map((device) => ({ device, tbId: typeof device.id === "string" ? device.id : device.id?.id })).filter((item) => !!item.tbId && item.tbId !== this.config.deviceId);
63432
+ const matching = [];
63433
+ const worker = async () => {
63434
+ while (queue.length) {
63435
+ const item = queue.shift();
63436
+ if (!item) return;
63437
+ try {
63438
+ const attributes = await this.fetchAttributes(item.tbId, "deviceProfile,gcdrDeviceId");
63439
+ const profile = String(attributes.get("deviceProfile") || "").toUpperCase();
63440
+ if (!isRetrolavagemCandidateProfile(profile)) continue;
63441
+ matching.push({
63442
+ tbId: item.tbId,
63443
+ label: String(item.device.label || item.device.name || item.tbId),
63444
+ profile,
63445
+ ...attributes.get("gcdrDeviceId") != null ? { gcdrId: String(attributes.get("gcdrDeviceId")) } : {}
63446
+ });
63447
+ } catch (error) {
63448
+ this.catalogWarnings += 1;
63449
+ console.warn(`[RetrolavagemTab] Falha ao ler atributos do hidr\xF4metro ${item.tbId}:`, error);
63450
+ }
63451
+ }
63452
+ };
63453
+ await Promise.all(Array.from({ length: Math.min(8, Math.max(1, queue.length)) }, () => worker()));
63454
+ return matching.sort((a, b) => a.label.localeCompare(b.label));
63455
+ }
63456
+ /** Vínculo salvo que não está mais no catálogo (device apagado, perfil mudou, sem acesso). */
63457
+ storedRef(tbId) {
63458
+ return [...this.bindings.inputs, ...this.bindings.outputs].find((d) => d.tbId === tbId);
63459
+ }
63460
+ sideHtml(side) {
63461
+ const text2 = SIDE_TEXT[side];
63462
+ const rows = this.rows[side];
63463
+ const full = rows.length >= MAX_RETROLAVAGEM_DEVICES_PER_SIDE;
63464
+ const options = (current) => {
63465
+ const missing = current && !this.catalog.some((o) => o.tbId === current) ? `<option value="${escapeHtml7(current)}" selected data-unavailable="true">V\xEDnculo atual indispon\xEDvel \u2014 ${escapeHtml7(
63466
+ this.storedRef(current)?.label || current
63467
+ )}</option>` : "";
63468
+ return `<option value="">Selecione\u2026</option>${missing}${this.catalog.map(
63469
+ (o) => `<option value="${escapeHtml7(o.tbId)}"${o.tbId === current ? " selected" : ""}>${escapeHtml7(o.label)} \xB7 ${escapeHtml7(o.profile)}</option>`
63470
+ ).join("")}`;
63471
+ };
63472
+ return `
63473
+ <fieldset class="rlt-side" data-side="${side}">
63474
+ <legend>${text2.title} <span class="rlt-count">${rows.length}/${MAX_RETROLAVAGEM_DEVICES_PER_SIDE}</span></legend>
63475
+ <p class="rlt-hint">${text2.hint}</p>
63476
+ ${rows.length ? rows.map(
63477
+ (tbId, i) => `<div class="rlt-row">
63478
+ <select data-side="${side}" data-index="${i}" aria-label="${text2.title} ${i + 1}">${options(tbId)}</select>
63479
+ <button type="button" class="rlt-remove" data-remove="${side}" data-index="${i}" aria-label="Remover ${text2.title} ${i + 1}">\u2715</button>
63480
+ </div>`
63481
+ ).join("") : `<p class="rlt-empty">Nenhum hidr\xF4metro de ${text2.title.toLowerCase()}.</p>`}
63482
+ <button type="button" class="rlt-add" data-add="${side}" ${full ? "disabled" : ""}>${text2.add}</button>
63483
+ </fieldset>`;
63484
+ }
63485
+ render() {
63486
+ const noConfig = !this.rows.inputs.length && !this.rows.outputs.length;
63487
+ this.config.container.innerHTML = `
63488
+ <section class="rlt-tab">
63489
+ <p>Escolha os hidr\xF4metros de entrada e de sa\xEDda. A retrolavagem passa a ser <strong>total de entrada \u2212 total de sa\xEDda</strong>
63490
+ no per\xEDodo. O mesmo hidr\xF4metro pode ser usado em outras retrolavagens.</p>
63491
+ ${noConfig ? '<p class="rlt-note">Sem v\xEDnculos, o painel usa a conta autom\xE1tica: entrada do shopping \u2212 consumo de lojas e \xE1rea comum.</p>' : ""}
63492
+ <div class="rlt-grid">${this.sideHtml("inputs")}${this.sideHtml("outputs")}</div>
63493
+ <p id="rlt-message" class="rlt-message" role="status" aria-live="polite"></p>
63494
+ <button type="button" id="rlt-save" ${this.loaded ? "" : "disabled"}>Salvar v\xEDnculos</button>
63495
+ </section>
63496
+ <style>
63497
+ .rlt-tab{padding:24px;color:#374151}.rlt-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px;margin-top:12px}
63498
+ .rlt-side{border:1px solid #e5e7eb;border-radius:8px;padding:12px 14px;margin:0}.rlt-side legend{font-weight:700;padding:0 6px}
63499
+ .rlt-count{font-weight:500;color:#6b7280;font-size:12px}.rlt-hint,.rlt-empty,.rlt-note{margin:0 0 10px;font-size:13px;color:#6b7280}
63500
+ .rlt-note{background:#f1ecfa;color:#3e1a7d;border-radius:6px;padding:8px 10px}
63501
+ .rlt-row{display:flex;gap:8px;margin-bottom:8px}.rlt-row select{flex:1;min-width:0;min-height:36px;padding:6px 8px;border:1px solid #d1d5db;border-radius:6px;background:#fff}
63502
+ .rlt-remove{border:1px solid #d1d5db;background:#fff;border-radius:6px;padding:0 10px;cursor:pointer;color:#6b7280}
63503
+ .rlt-add{border:1px dashed #9ca3af;background:#fff;border-radius:6px;padding:7px 12px;cursor:pointer;color:#374151;font-weight:600}
63504
+ .rlt-add:disabled{opacity:.5;cursor:not-allowed}
63505
+ #rlt-save{margin-top:18px;padding:9px 16px;border:0;border-radius:6px;background:#2563eb;color:#fff;font-weight:600;cursor:pointer}
63506
+ #rlt-save:disabled{opacity:.6;cursor:wait}.rlt-message{min-height:20px;margin:12px 0 0}.rlt-message.rlt-error,.rlt-error{color:#b91c1c}
63507
+ .rlt-message.rlt-success{color:#15803d}.rlt-state{text-align:center;padding:30px;color:#6b7280}
63508
+ </style>`;
63509
+ const c = this.config.container;
63510
+ c.querySelectorAll("select[data-side]").forEach((select) => {
63511
+ select.addEventListener("change", () => {
63512
+ this.rows[select.dataset.side][Number(select.dataset.index)] = select.value;
63513
+ this.showMessage("");
63514
+ });
63515
+ });
63516
+ c.querySelectorAll("[data-add]").forEach((btn) => {
63517
+ btn.addEventListener("click", () => {
63518
+ const side = btn.dataset.add;
63519
+ if (this.rows[side].length >= MAX_RETROLAVAGEM_DEVICES_PER_SIDE) return;
63520
+ this.rows[side].push("");
63521
+ this.render();
63522
+ });
63523
+ });
63524
+ c.querySelectorAll("[data-remove]").forEach((btn) => {
63525
+ btn.addEventListener("click", () => {
63526
+ this.rows[btn.dataset.remove].splice(Number(btn.dataset.index), 1);
63527
+ this.render();
63528
+ });
63529
+ });
63530
+ c.querySelector("#rlt-save")?.addEventListener("click", () => {
63531
+ void this.save();
63532
+ });
63533
+ }
63534
+ /** Linhas da tela → vínculos, ou a mensagem do primeiro problema encontrado. */
63535
+ buildBindings() {
63536
+ const known = (tbId) => this.catalog.find((o) => o.tbId === tbId);
63537
+ const seen = /* @__PURE__ */ new Map();
63538
+ const out = { version: 1, inputs: [], outputs: [] };
63539
+ for (const side of ["inputs", "outputs"]) {
63540
+ const ids = this.rows[side].filter(Boolean);
63541
+ if (ids.length > MAX_RETROLAVAGEM_DEVICES_PER_SIDE) {
63542
+ return `No m\xE1ximo ${MAX_RETROLAVAGEM_DEVICES_PER_SIDE} hidr\xF4metros de ${SIDE_TEXT[side].title.toLowerCase()}.`;
63543
+ }
63544
+ for (const tbId of ids) {
63545
+ const option = known(tbId);
63546
+ const stored = this.storedRef(tbId);
63547
+ const name = option?.label || stored?.label || tbId;
63548
+ if (seen.has(tbId)) {
63549
+ return seen.get(tbId) === side ? `${name} aparece duas vezes em ${SIDE_TEXT[side].title}.` : `${name} n\xE3o pode estar na entrada e na sa\xEDda ao mesmo tempo.`;
63550
+ }
63551
+ if (!option && !stored) return `${name} n\xE3o \xE9 um hidr\xF4metro v\xE1lido deste cliente.`;
63552
+ seen.set(tbId, side);
63553
+ const gcdrId = option?.gcdrId || stored?.gcdrId;
63554
+ out[side].push({ tbId, label: name, ...gcdrId ? { gcdrId } : {} });
63555
+ }
63556
+ }
63557
+ return out;
63558
+ }
63559
+ async save() {
63560
+ const button = this.config.container.querySelector("#rlt-save");
63561
+ if (!this.loaded || !button) return;
63562
+ const bindings = this.buildBindings();
63563
+ if (typeof bindings === "string") {
63564
+ this.showMessage(bindings, true);
63565
+ return;
63566
+ }
63567
+ if (bindings.inputs.length && !bindings.outputs.length) {
63568
+ this.showMessage("Aten\xE7\xE3o: sem hidr\xF4metro de sa\xEDda, a retrolavagem fica igual ao total de entrada.");
63569
+ }
63570
+ button.disabled = true;
63571
+ button.textContent = "Salvando\u2026";
63572
+ try {
63573
+ const response = await fetch(
63574
+ `${this.config.tbBaseUrl}/api/plugins/telemetry/DEVICE/${encodeURIComponent(this.config.deviceId)}/attributes/SERVER_SCOPE`,
63575
+ { method: "POST", headers: this.headers(), body: JSON.stringify({ [RETROLAVAGEM_BINDINGS_KEY]: bindings }) }
63576
+ );
63577
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
63578
+ this.bindings = bindings;
63579
+ this.rows = { inputs: bindings.inputs.map((d) => d.tbId), outputs: bindings.outputs.map((d) => d.tbId) };
63580
+ this.render();
63581
+ this.showMessage("V\xEDnculos salvos. O painel recalcula a retrolavagem na pr\xF3xima atualiza\xE7\xE3o dos dados.", false, true);
63582
+ } catch (error) {
63583
+ this.showMessage(`Falha ao salvar os v\xEDnculos: ${this.errorMessage(error)}`, true);
63584
+ const b = this.config.container.querySelector("#rlt-save");
63585
+ if (b) {
63586
+ b.disabled = false;
63587
+ b.textContent = "Salvar v\xEDnculos";
63588
+ }
63589
+ }
63590
+ }
63591
+ showMessage(message, isError = false, isSuccess = false) {
63592
+ const element = this.config.container.querySelector("#rlt-message");
63593
+ if (!element) return;
63594
+ element.textContent = message;
63595
+ element.classList.toggle("rlt-error", isError);
63596
+ element.classList.toggle("rlt-success", isSuccess);
63597
+ }
63598
+ errorMessage(error) {
63599
+ return error instanceof Error ? error.message : String(error);
63600
+ }
63601
+ };
63602
+
63320
63603
  // src/services/freshdesk/FreshdeskClient.ts
63321
63604
  var FreshdeskClient_exports = {};
63322
63605
  __export(FreshdeskClient_exports, {
@@ -64233,10 +64516,10 @@ ${this._formatFileSize(f.size)} \xB7 ${f.type || "arquivo"}`;
64233
64516
  // Styles
64234
64517
  // ==========================================================================
64235
64518
  injectStyles() {
64236
- const STYLE_ID23 = "myio-tickets-tab-styles";
64237
- if (document.getElementById(STYLE_ID23)) return;
64519
+ const STYLE_ID24 = "myio-tickets-tab-styles";
64520
+ if (document.getElementById(STYLE_ID24)) return;
64238
64521
  const style = document.createElement("style");
64239
- style.id = STYLE_ID23;
64522
+ style.id = STYLE_ID24;
64240
64523
  style.textContent = `
64241
64524
  /* ===== TicketsTab layout ===== */
64242
64525
  .ct-tab {
@@ -65067,6 +65350,7 @@ var SettingsModalView = class _SettingsModalView {
65067
65350
  exclusionGroupsTab = null;
65068
65351
  deviceProfileTab = null;
65069
65352
  wellEquipmentTab = null;
65353
+ retrolavagemTab = null;
65070
65354
  currentTab = "general";
65071
65355
  currentUser = null;
65072
65356
  permissions = null;
@@ -65118,6 +65402,10 @@ var SettingsModalView = class _SettingsModalView {
65118
65402
  isWellEquipmentDevice() {
65119
65403
  return ["CISTERNA", "CISTERNA_ENTRADA"].includes(String(this.config.deviceProfile || "").toUpperCase());
65120
65404
  }
65405
+ /** Retrolavagem virtual: escolhe os hidrômetros de entrada e de saída (aba só para SuperAdmin). */
65406
+ isRetrolavagemDevice() {
65407
+ return String(this.config.deviceProfile || "").toUpperCase() === RETROLAVAGEM_PROFILE;
65408
+ }
65121
65409
  render(initialData) {
65122
65410
  this.originalActiveElement = document.activeElement;
65123
65411
  document.body.appendChild(this.container);
@@ -65155,6 +65443,9 @@ var SettingsModalView = class _SettingsModalView {
65155
65443
  if (this.isWellEquipmentDevice() && this.isSuperAdmin()) {
65156
65444
  this.initWellEquipmentTab();
65157
65445
  }
65446
+ if (this.isRetrolavagemDevice() && this.isSuperAdmin()) {
65447
+ this.initRetrolavagemTab();
65448
+ }
65158
65449
  if (this.config.isGateway && this.isSuperAdmin()) {
65159
65450
  this.bindIncidentsTabEvents();
65160
65451
  this.initIncidentsDateRange();
@@ -65432,6 +65723,29 @@ var SettingsModalView = class _SettingsModalView {
65432
65723
  container.innerHTML = '<p class="wet-state wet-error" role="alert">Erro ao carregar configura\xE7\xF5es de equipamentos do po\xE7o.</p>';
65433
65724
  }
65434
65725
  }
65726
+ async initRetrolavagemTab() {
65727
+ const container = this.modal.querySelector("#retrolavagem-tab-content");
65728
+ if (!container || !this.isRetrolavagemDevice() || !this.isSuperAdmin()) return;
65729
+ const customerId = this.config.customerId || window.MyIOUtils?.customerTB_ID;
65730
+ const { deviceId, jwtToken, tbBaseUrl } = this.config;
65731
+ if (!deviceId || !jwtToken || !customerId) {
65732
+ container.innerHTML = '<p class="rlt-state rlt-error" role="alert">Configura\xE7\xE3o da retrolavagem indispon\xEDvel: deviceId, autentica\xE7\xE3o ou customerId n\xE3o informado.</p>';
65733
+ return;
65734
+ }
65735
+ try {
65736
+ this.retrolavagemTab = new RetrolavagemTab({
65737
+ container,
65738
+ deviceId,
65739
+ customerId,
65740
+ jwtToken,
65741
+ tbBaseUrl: tbBaseUrl ?? window.location.origin
65742
+ });
65743
+ await this.retrolavagemTab.init();
65744
+ } catch (error) {
65745
+ console.error("[SettingsModalView] Failed to initialize RetrolavagemTab:", error);
65746
+ container.innerHTML = '<p class="rlt-state rlt-error" role="alert">Erro ao carregar os equipamentos da retrolavagem.</p>';
65747
+ }
65748
+ }
65435
65749
  // RFC-0104 / RFC-0180 / RFC-0198: Switch between tabs
65436
65750
  switchTab(tab) {
65437
65751
  this.currentTab = tab;
@@ -65446,6 +65760,7 @@ var SettingsModalView = class _SettingsModalView {
65446
65760
  const exclusionGroupsContent = this.modal.querySelector("#exclusion-groups-tab-content");
65447
65761
  const deviceProfileContent = this.modal.querySelector("#device-profile-tab-content");
65448
65762
  const wellEquipmentContent = this.modal.querySelector("#well-equipment-tab-content");
65763
+ const retrolavagemContent = this.modal.querySelector("#retrolavagem-tab-content");
65449
65764
  const incidentsContent = this.modal.querySelector("#incidents-tab-content");
65450
65765
  if (generalContent) generalContent.style.display = tab === "general" ? "block" : "none";
65451
65766
  if (annotationsContent) annotationsContent.style.display = tab === "annotations" ? "block" : "none";
@@ -65453,6 +65768,7 @@ var SettingsModalView = class _SettingsModalView {
65453
65768
  if (chamadosContent) chamadosContent.style.display = tab === "chamados" ? "block" : "none";
65454
65769
  if (deviceProfileContent) deviceProfileContent.style.display = tab === "device-profile" ? "block" : "none";
65455
65770
  if (wellEquipmentContent) wellEquipmentContent.style.display = tab === "well-equipment" ? "block" : "none";
65771
+ if (retrolavagemContent) retrolavagemContent.style.display = tab === "retrolavagem" ? "block" : "none";
65456
65772
  if (exclusionGroupsContent) exclusionGroupsContent.style.display = tab === "exclusion-groups" ? "block" : "none";
65457
65773
  if (incidentsContent) incidentsContent.style.display = tab === "incidents" ? "block" : "none";
65458
65774
  const saveBtn = this.modal.querySelector(".btn-save");
@@ -65487,6 +65803,10 @@ var SettingsModalView = class _SettingsModalView {
65487
65803
  this.wellEquipmentTab.destroy();
65488
65804
  this.wellEquipmentTab = null;
65489
65805
  }
65806
+ if (this.retrolavagemTab) {
65807
+ this.retrolavagemTab.destroy();
65808
+ this.retrolavagemTab = null;
65809
+ }
65490
65810
  if (this.incidentsDateRangeController) {
65491
65811
  this.incidentsDateRangeController.destroy();
65492
65812
  this.incidentsDateRangeController = null;
@@ -65673,6 +65993,14 @@ var SettingsModalView = class _SettingsModalView {
65673
65993
  </svg>
65674
65994
  Equipamentos do Po\xE7o
65675
65995
  </button>` : ""}
65996
+ ${this.isRetrolavagemDevice() && this.isSuperAdmin() ? `<button type="button" class="modal-tab" data-tab="retrolavagem">
65997
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
65998
+ <path d="M3 12h7M14 12h7"></path>
65999
+ <path d="M7 8l-4 4 4 4"></path>
66000
+ <path d="M17 8l4 4-4 4"></path>
66001
+ </svg>
66002
+ Equipamentos da Retrolavagem
66003
+ </button>` : ""}
65676
66004
  <!-- RFC-0232: Incidentes (interpola\xE7\xE3o) \u2014 central + admin MyIO only -->
65677
66005
  ${this.config.isGateway && this.isSuperAdmin() ? `<button type="button" class="modal-tab" data-tab="incidents">
65678
66006
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
@@ -65730,6 +66058,9 @@ var SettingsModalView = class _SettingsModalView {
65730
66058
  ${this.isWellEquipmentDevice() && this.isSuperAdmin() ? `<div id="well-equipment-tab-content" class="tab-content" style="display:none;">
65731
66059
  <p class="wet-state">Carregando v\xEDnculos e equipamentos\u2026</p>
65732
66060
  </div>` : ""}
66061
+ ${this.isRetrolavagemDevice() && this.isSuperAdmin() ? `<div id="retrolavagem-tab-content" class="tab-content" style="display:none;">
66062
+ <p class="rlt-state">Carregando v\xEDnculos e hidr\xF4metros\u2026</p>
66063
+ </div>` : ""}
65733
66064
  <!-- RFC-0232: Incidentes (interpola\xE7\xE3o) Tab Content \u2014 central + admin MyIO only.
65734
66065
  Rendered synchronously (data comes pre-fetched via config.interpolatedSlots,
65735
66066
  same as getGatewayInfoHTML() \u2014 no async loading state needed here). -->
@@ -76655,10 +76986,10 @@ function render(container, modalId, state6) {
76655
76986
  <div class="alarm-list">
76656
76987
  ${state6.alarms.map((a) => `
76657
76988
  <div class="alarm-row">
76658
- <div class="alarm-title">${escapeHtml7(a.title || a.id)}</div>
76659
- <div class="alarm-meta">${escapeHtml7(a.customerName || "")}</div>
76660
- <div class="alarm-meta">${escapeHtml7(a.severity)}</div>
76661
- <div class="alarm-meta">${escapeHtml7(a.state)}</div>
76989
+ <div class="alarm-title">${escapeHtml8(a.title || a.id)}</div>
76990
+ <div class="alarm-meta">${escapeHtml8(a.customerName || "")}</div>
76991
+ <div class="alarm-meta">${escapeHtml8(a.severity)}</div>
76992
+ <div class="alarm-meta">${escapeHtml8(a.state)}</div>
76662
76993
  <div class="alarm-meta">${formatDate2(a.lastOccurrence, state6.locale, true)}</div>
76663
76994
  </div>
76664
76995
  `).join("")}
@@ -76845,7 +77176,7 @@ function buildBars(data, order, colors2) {
76845
77176
  const pct = Math.round(value / maxVal * 100);
76846
77177
  return `
76847
77178
  <div class="bar-row">
76848
- <span class="bar-label">${escapeHtml7(String(key))}</span>
77179
+ <span class="bar-label">${escapeHtml8(String(key))}</span>
76849
77180
  <div class="bar-track"><div class="bar-fill" style="width:${pct}%"></div></div>
76850
77181
  <span class="bar-value">${value}</span>
76851
77182
  </div>
@@ -76875,7 +77206,7 @@ function toTime(value) {
76875
77206
  const parsed = new Date(value).getTime();
76876
77207
  return Number.isNaN(parsed) ? 0 : parsed;
76877
77208
  }
76878
- function escapeHtml7(text2) {
77209
+ function escapeHtml8(text2) {
76879
77210
  const div = document.createElement("div");
76880
77211
  div.textContent = text2 || "";
76881
77212
  return div.innerHTML;
@@ -77062,8 +77393,8 @@ function render2(container, modalId, state6) {
77062
77393
  </div>
77063
77394
  ${state6.devices.map((d) => `
77064
77395
  <div class="device-table-row">
77065
- <div class="col-name">${escapeHtml8(d.name)}</div>
77066
- <div class="col-customer">${escapeHtml8(d.customerName)}</div>
77396
+ <div class="col-name">${escapeHtml9(d.name)}</div>
77397
+ <div class="col-customer">${escapeHtml9(d.customerName)}</div>
77067
77398
  <div class="col-status">
77068
77399
  <span class="status-badge" style="background: ${STATUS_COLORS3[d.status] || "#6b7280"}20; color: ${STATUS_COLORS3[d.status] || "#6b7280"};">
77069
77400
  ${STATUS_LABELS5[d.status] || d.status}
@@ -77310,7 +77641,7 @@ function buildHorizontalBarChart(devices, metric, unit, colors2, getColor, inver
77310
77641
  const displayValue = metric === "availability" ? value.toFixed(1) : value.toFixed(metric === "mttr" ? 1 : 0);
77311
77642
  return `
77312
77643
  <div class="bar-row">
77313
- <span class="bar-label" title="${escapeHtml8(d.name)}">${escapeHtml8(d.name)}</span>
77644
+ <span class="bar-label" title="${escapeHtml9(d.name)}">${escapeHtml9(d.name)}</span>
77314
77645
  <div class="bar-track">
77315
77646
  <div class="bar-fill" style="width:${pct}%; background:${color};"></div>
77316
77647
  </div>
@@ -77341,7 +77672,7 @@ function formatDate3(value, locale) {
77341
77672
  if (isNaN(d.getTime())) return "-";
77342
77673
  return d.toLocaleDateString(locale, { day: "2-digit", month: "2-digit", year: "numeric" });
77343
77674
  }
77344
- function escapeHtml8(text2) {
77675
+ function escapeHtml9(text2) {
77345
77676
  const div = document.createElement("div");
77346
77677
  div.textContent = text2 || "";
77347
77678
  return div.innerHTML;
@@ -81693,11 +82024,11 @@ function injectDialogStyles() {
81693
82024
  // src/components/premium-modals/dialog/openDialog.ts
81694
82025
  var BASE_Z_INDEX = 10500;
81695
82026
  var openCount = 0;
81696
- function escapeHtml9(value) {
82027
+ function escapeHtml10(value) {
81697
82028
  return String(value).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
81698
82029
  }
81699
82030
  function escapeMessage(value) {
81700
- return escapeHtml9(value).replace(/\n/g, "<br>");
82031
+ return escapeHtml10(value).replace(/\n/g, "<br>");
81701
82032
  }
81702
82033
  function cssWidth(width) {
81703
82034
  if (width == null) return "420px";
@@ -81722,7 +82053,7 @@ function openDialog(params) {
81722
82053
  overlay.style.zIndex = String(BASE_Z_INDEX + openCount);
81723
82054
  const buttonsHtml = params.buttons.map((btn, i) => {
81724
82055
  const variant = btn.variant ?? "secondary";
81725
- return `<button type="button" class="myio-dialog__btn myio-dialog__btn--${variant}" data-index="${i}">${escapeHtml9(btn.label)}</button>`;
82056
+ return `<button type="button" class="myio-dialog__btn myio-dialog__btn--${variant}" data-index="${i}">${escapeHtml10(btn.label)}</button>`;
81726
82057
  }).join("");
81727
82058
  overlay.innerHTML = `
81728
82059
  <div class="myio-dialog${params.modifier ? ` ${params.modifier}` : ""}"
@@ -81732,7 +82063,7 @@ function openDialog(params) {
81732
82063
  <div class="myio-dialog__accent"></div>
81733
82064
  <div class="myio-dialog__header">
81734
82065
  ${params.icon ? `<span class="myio-dialog__icon" aria-hidden="true">${params.icon}</span>` : ""}
81735
- <h3 class="myio-dialog__title" id="${idBase}-title">${escapeHtml9(params.title)}</h3>
82066
+ <h3 class="myio-dialog__title" id="${idBase}-title">${escapeHtml10(params.title)}</h3>
81736
82067
  ${dismissible ? `<button type="button" class="myio-dialog__close" aria-label="Fechar">\u2715</button>` : ""}
81737
82068
  </div>
81738
82069
  <p class="myio-dialog__message" id="${idBase}-message">${escapeMessage(params.message)}</p>
@@ -81828,7 +82159,7 @@ var STYLE_ID9 = "myio-genmodal-styles";
81828
82159
  var FONT_LINK_ID2 = "myio-dialog-font-nunito";
81829
82160
  var BASE_Z_INDEX2 = 10600;
81830
82161
  var openCount2 = 0;
81831
- function escapeHtml10(value) {
82162
+ function escapeHtml11(value) {
81832
82163
  return String(value).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
81833
82164
  }
81834
82165
  function cssSize(v, fallback) {
@@ -81981,17 +82312,17 @@ function openGenericModal(params) {
81981
82312
  overlay.style.zIndex = String(BASE_Z_INDEX2 + openCount2);
81982
82313
  const buttonsHtml = buttons.map((btn, i) => {
81983
82314
  const variant = btn.variant ?? "secondary";
81984
- return `<button type="button" class="myio-genmodal__btn myio-genmodal__btn--${variant}" data-index="${i}">${escapeHtml10(btn.label)}</button>`;
82315
+ return `<button type="button" class="myio-genmodal__btn myio-genmodal__btn--${variant}" data-index="${i}">${escapeHtml11(btn.label)}</button>`;
81985
82316
  }).join("");
81986
82317
  overlay.innerHTML = `
81987
- <div class="myio-genmodal${params.className ? ` ${escapeHtml10(params.className)}` : ""}"
82318
+ <div class="myio-genmodal${params.className ? ` ${escapeHtml11(params.className)}` : ""}"
81988
82319
  role="dialog" aria-modal="true"
81989
82320
  aria-labelledby="${idBase}-title"
81990
82321
  style="width:${cssSize(params.width, "560px")}">
81991
82322
  <div class="myio-genmodal__accent"></div>
81992
82323
  <div class="myio-genmodal__header">
81993
82324
  ${params.icon ? `<span class="myio-genmodal__icon" aria-hidden="true">${params.icon}</span>` : ""}
81994
- <h3 class="myio-genmodal__title" id="${idBase}-title">${escapeHtml10(params.title)}</h3>
82325
+ <h3 class="myio-genmodal__title" id="${idBase}-title">${escapeHtml11(params.title)}</h3>
81995
82326
  ${dismissible ? `<button type="button" class="myio-genmodal__close" aria-label="Fechar">\u2715</button>` : ""}
81996
82327
  </div>
81997
82328
  <div class="myio-genmodal__body" id="${idBase}-body" style="max-height:${cssSize(params.bodyMaxHeight, "70vh")}"></div>
@@ -84870,6 +85201,15 @@ function buildYearOptions() {
84870
85201
  function esc5(s) {
84871
85202
  return String(s == null ? "" : s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
84872
85203
  }
85204
+ function resolveThemeVars(theme) {
85205
+ if (!theme || typeof theme !== "object") return null;
85206
+ try {
85207
+ const vars = typeof theme.cssVars === "function" ? theme.cssVars() : theme;
85208
+ return vars && typeof vars === "object" ? vars : null;
85209
+ } catch (_) {
85210
+ return null;
85211
+ }
85212
+ }
84873
85213
  function openGoalsPanel(params) {
84874
85214
  if (typeof window === "undefined" || typeof document === "undefined") {
84875
85215
  throw new Error("GoalsPanel requires a browser environment");
@@ -84883,6 +85223,8 @@ function openGoalsPanel(params) {
84883
85223
  const container = p.container || document.body;
84884
85224
  const locale = p.locale === "en-US" ? "en-US" : "pt-BR";
84885
85225
  const styles = p.styles || {};
85226
+ const tenantId = p.tenantId ? String(p.tenantId) : null;
85227
+ const themeVars = resolveThemeVars(p.theme);
84886
85228
  if (!customerId) throw new Error("customerId is required");
84887
85229
  if (!apiKey) throw new Error("apiKey (X-API-Key gcdr_cust_*) is required");
84888
85230
  if (!rawBaseUrl) throw new Error("baseUrl (GCDR host) is required");
@@ -84890,7 +85232,8 @@ function openGoalsPanel(params) {
84890
85232
  const theme = {
84891
85233
  accent: styles.accent || styles.primaryColor || "#059669",
84892
85234
  accentSoft: styles.accentSoft || "rgba(5,150,105,0.10)",
84893
- primary: styles.primaryColor || styles.accent || "#059669",
85235
+ // Header: styles explícito > paleta do dashboard (--myio-brand-700) > esmeralda.
85236
+ primary: styles.primaryColor || styles.accent || (themeVars && typeof themeVars["--myio-brand-700"] === "string" ? themeVars["--myio-brand-700"] : null) || "#059669",
84894
85237
  violet: styles.violet || "#6c5ce7",
84895
85238
  danger: styles.errorColor || "#dc2626",
84896
85239
  amber: styles.warningColor || "#d97706",
@@ -84898,7 +85241,7 @@ function openGoalsPanel(params) {
84898
85241
  fontFamily: styles.fontFamily || "'Nunito', system-ui, sans-serif",
84899
85242
  zIndex: styles.zIndex || 1e6
84900
85243
  };
84901
- const MODAL_ID7 = "goals-gcdr-modal";
85244
+ const MODAL_ID8 = "goals-gcdr-modal";
84902
85245
  const ROOT_ID2 = "myio-goals-gcdr-root";
84903
85246
  const state6 = {
84904
85247
  domain: DOMAINS2.includes(p.domain) ? p.domain : "ENERGY",
@@ -84960,11 +85303,14 @@ function openGoalsPanel(params) {
84960
85303
  try {
84961
85304
  res = await fetch(url, {
84962
85305
  method,
84963
- headers: {
84964
- "X-API-Key": apiKey,
84965
- "Content-Type": "application/json",
84966
- Accept: "application/json"
84967
- },
85306
+ headers: Object.assign(
85307
+ {
85308
+ "X-API-Key": apiKey,
85309
+ "Content-Type": "application/json",
85310
+ Accept: "application/json"
85311
+ },
85312
+ tenantId ? { "X-Tenant-ID": tenantId } : {}
85313
+ ),
84968
85314
  body: o.body !== void 0 ? JSON.stringify(o.body) : void 0
84969
85315
  });
84970
85316
  } catch (e) {
@@ -85417,6 +85763,11 @@ function openGoalsPanel(params) {
85417
85763
  rootEl.className = "myio-goals-overlay";
85418
85764
  rootEl.setAttribute("role", "dialog");
85419
85765
  rootEl.setAttribute("aria-modal", "true");
85766
+ if (themeVars) {
85767
+ Object.entries(themeVars).forEach(([k, v]) => {
85768
+ if (k.startsWith("--") && typeof v === "string") rootEl.style.setProperty(k, v);
85769
+ });
85770
+ }
85420
85771
  container.appendChild(rootEl);
85421
85772
  injectStyles26();
85422
85773
  rootEl.addEventListener("click", onClick);
@@ -85564,7 +85915,7 @@ function openGoalsPanel(params) {
85564
85915
  const headerHTML = ModalHeader.generateInlineHTML({
85565
85916
  icon: "\u{1F3AF}",
85566
85917
  title: i18n2.modalTitle,
85567
- modalId: MODAL_ID7,
85918
+ modalId: MODAL_ID8,
85568
85919
  theme: "dark",
85569
85920
  isMaximized: false,
85570
85921
  showThemeToggle: false,
@@ -85588,7 +85939,7 @@ function openGoalsPanel(params) {
85588
85939
  </div>
85589
85940
  ${state6.importOpen ? renderImportModal() : ""}
85590
85941
  `;
85591
- ModalHeader.setupHandlers({ modalId: MODAL_ID7, onClose: () => closeModal2() });
85942
+ ModalHeader.setupHandlers({ modalId: MODAL_ID8, onClose: () => closeModal2() });
85592
85943
  attachCoverageTooltip();
85593
85944
  }
85594
85945
  function renderToolbar() {
@@ -93026,13 +93377,13 @@ var COLUMN_SUMMARY_CSS = `
93026
93377
  var _cssInjected2 = false;
93027
93378
  function injectCSS10() {
93028
93379
  if (_cssInjected2 || typeof document === "undefined") return;
93029
- const STYLE_ID23 = "myio-column-summary-tooltip-css";
93030
- if (document.getElementById(STYLE_ID23)) {
93380
+ const STYLE_ID24 = "myio-column-summary-tooltip-css";
93381
+ if (document.getElementById(STYLE_ID24)) {
93031
93382
  _cssInjected2 = true;
93032
93383
  return;
93033
93384
  }
93034
93385
  const style = document.createElement("style");
93035
- style.id = STYLE_ID23;
93386
+ style.id = STYLE_ID24;
93036
93387
  style.textContent = COLUMN_SUMMARY_CSS;
93037
93388
  document.head.appendChild(style);
93038
93389
  _cssInjected2 = true;
@@ -104835,6 +105186,15 @@ var HUB_OPTIONS = [
104835
105186
  desc: "Unidades e casas decimais",
104836
105187
  superAdminOnly: false
104837
105188
  },
105189
+ {
105190
+ // RFC-0241 — MyIO (@myio.com.br) ou admin do usuário; gate via `permissions`.
105191
+ action: "goals-tariffs",
105192
+ icon: "\u{1F3AF}",
105193
+ title: "Metas e Tarifas",
105194
+ desc: "Metas de consumo e tarifas (R$/kWh, R$/m\xB3)",
105195
+ superAdminOnly: false,
105196
+ requiresPermission: true
105197
+ },
104838
105198
  {
104839
105199
  action: "integration",
104840
105200
  icon: "\u{1F517}",
@@ -105003,7 +105363,7 @@ var HUB_CSS = `
105003
105363
  color: var(--myio-brand-700, #7B2FF7);
105004
105364
  }
105005
105365
  `;
105006
- function escapeHtml11(value) {
105366
+ function escapeHtml12(value) {
105007
105367
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
105008
105368
  }
105009
105369
  function resolveTopDocument() {
@@ -105021,7 +105381,7 @@ function resolveHubThemeVars(explicit) {
105021
105381
  return vars && typeof vars === "object" ? vars : null;
105022
105382
  }
105023
105383
  function openSettingsHubModal(options) {
105024
- const { customerName = "", isSuperAdmin: isSuperAdmin2 = false, handlers } = options;
105384
+ const { customerName = "", isSuperAdmin: isSuperAdmin2 = false, handlers, permissions = {} } = options;
105025
105385
  const doc = options.targetDocument || resolveTopDocument();
105026
105386
  if (!doc.getElementById(STYLE_ID12)) {
105027
105387
  const style = doc.createElement("style");
@@ -105031,7 +105391,7 @@ function openSettingsHubModal(options) {
105031
105391
  }
105032
105392
  doc.getElementById(MODAL_ID2)?.remove();
105033
105393
  const visibleOptions = HUB_OPTIONS.filter(
105034
- (opt) => typeof handlers[opt.action] === "function" && (!opt.superAdminOnly || isSuperAdmin2)
105394
+ (opt) => typeof handlers[opt.action] === "function" && (!opt.superAdminOnly || isSuperAdmin2) && (!opt.requiresPermission || permissions[opt.action] === true)
105035
105395
  );
105036
105396
  const cardsHtml = visibleOptions.map(
105037
105397
  (opt) => `
@@ -105050,7 +105410,7 @@ function openSettingsHubModal(options) {
105050
105410
  <div class="myio-conf-picker__overlay"></div>
105051
105411
  <div class="myio-conf-picker__content">
105052
105412
  <div class="myio-conf-picker__header">
105053
- <h3>\u2699\uFE0F Configura\xE7\xF5es${customerName ? ` \u2014 ${escapeHtml11(customerName)}` : ""}</h3>
105413
+ <h3>\u2699\uFE0F Configura\xE7\xF5es${customerName ? ` \u2014 ${escapeHtml12(customerName)}` : ""}</h3>
105054
105414
  <button class="myio-conf-picker__close" aria-label="Fechar">&times;</button>
105055
105415
  </div>
105056
105416
  <div class="myio-conf-picker__body">${cardsHtml}
@@ -105086,6 +105446,201 @@ function openSettingsHubModal(options) {
105086
105446
  return { close: closeModal2 };
105087
105447
  }
105088
105448
 
105449
+ // src/components/goals-tariffs-hub/openGoalsTariffsHub.ts
105450
+ var ROUTE_DELAY_MS2 = 200;
105451
+ var MODAL_ID3 = "myio-goals-tariffs-hub";
105452
+ var STYLE_ID13 = "myio-goals-tariffs-hub-styles";
105453
+ var AREAS = [
105454
+ {
105455
+ area: "manage",
105456
+ icon: "\u{1F6E0}\uFE0F",
105457
+ title: "Gest\xE3o de Metas",
105458
+ desc: (entity) => `Criar, atualizar e importar metas por ${entity} (planilha, hist\xF3rico de vers\xF5es, margem).`
105459
+ },
105460
+ {
105461
+ area: "compare",
105462
+ icon: "\u{1F4CA}",
105463
+ title: "Metas \xD7 Consumo",
105464
+ desc: () => "Comparar o consumo real com as metas, num \xFAnico painel."
105465
+ },
105466
+ {
105467
+ area: "tariffs",
105468
+ icon: "\u{1F4B2}",
105469
+ title: "Tarifas",
105470
+ desc: () => "Tarifas de energia e \xE1gua (R$/kWh, R$/m\xB3) por categoria e per\xEDodo."
105471
+ }
105472
+ ];
105473
+ var HUB_CSS2 = `
105474
+ .myio-gt-hub {
105475
+ position: fixed; inset: 0; z-index: 999999;
105476
+ display: flex; align-items: center; justify-content: center;
105477
+ opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
105478
+ font-family: 'Nunito', system-ui, sans-serif;
105479
+ }
105480
+ .myio-gt-hub.show { opacity: 1; pointer-events: auto; }
105481
+ .myio-gt-hub__overlay {
105482
+ position: absolute; inset: 0;
105483
+ background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px);
105484
+ }
105485
+ .myio-gt-hub__content {
105486
+ position: relative; z-index: 2; background: #FFFFFF; border-radius: 12px;
105487
+ box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
105488
+ width: min(720px, calc(100% - 32px)); max-height: 90vh; overflow: hidden;
105489
+ display: flex; flex-direction: column;
105490
+ transform: translateY(10px) scale(0.98); transition: transform 0.2s ease;
105491
+ }
105492
+ .myio-gt-hub.show .myio-gt-hub__content { transform: translateY(0) scale(1); }
105493
+ .myio-gt-hub__header {
105494
+ display: flex; align-items: center; justify-content: space-between;
105495
+ padding: 12px 16px; background: var(--myio-brand-700, #3e1a7d);
105496
+ color: var(--myio-accent-text, #FFFFFF);
105497
+ }
105498
+ .myio-gt-hub__header h3 { margin: 0; font-size: 15px; font-weight: 700; }
105499
+ .myio-gt-hub__close {
105500
+ background: transparent; border: none; color: inherit; font-size: 22px; line-height: 1;
105501
+ cursor: pointer; padding: 2px 6px; border-radius: 4px;
105502
+ }
105503
+ .myio-gt-hub__close:hover { background: rgba(255, 255, 255, 0.15); }
105504
+ .myio-gt-hub__body {
105505
+ display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
105506
+ gap: 12px; padding: 18px; overflow-y: auto;
105507
+ }
105508
+ .myio-gt-hub__card {
105509
+ display: flex; flex-direction: column; gap: 8px; padding: 20px 18px;
105510
+ border: 1px solid #E2E8F0; border-radius: 12px; background: #FFFFFF;
105511
+ cursor: pointer; text-align: left; font-family: inherit;
105512
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
105513
+ }
105514
+ .myio-gt-hub__card:hover, .myio-gt-hub__card:focus-visible {
105515
+ border-color: var(--myio-brand-700, #3e1a7d);
105516
+ box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08); outline: none;
105517
+ }
105518
+ .myio-gt-hub__icon { font-size: 26px; }
105519
+ .myio-gt-hub__title { font-size: 14px; font-weight: 700; color: #1E293B; }
105520
+ .myio-gt-hub__desc { font-size: 12px; font-weight: 600; color: #64748B; line-height: 1.35; }
105521
+ `;
105522
+ function escapeHtml13(value) {
105523
+ return String(value).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
105524
+ }
105525
+ function resolveTopDocument2() {
105526
+ try {
105527
+ return (window.top || window).document;
105528
+ } catch {
105529
+ return document;
105530
+ }
105531
+ }
105532
+ function resolveThemeVars2(explicit) {
105533
+ const theme = explicit || (typeof window !== "undefined" ? window.MyIOUtils?.theme : void 0);
105534
+ if (!theme) return null;
105535
+ try {
105536
+ const vars = typeof theme.cssVars === "function" ? theme.cssVars() : theme;
105537
+ return vars && typeof vars === "object" ? vars : null;
105538
+ } catch {
105539
+ return null;
105540
+ }
105541
+ }
105542
+ function openGoalsTariffsHub(options) {
105543
+ const handlers = options.handlers || {};
105544
+ const doc = options.targetDocument || resolveTopDocument2();
105545
+ const title = options.title || "\u{1F3AF} Metas e Tarifas";
105546
+ const entity = options.entityLabel || "shopping";
105547
+ const reportError = options.onError || ((err, area) => {
105548
+ console.error(`[GoalsTariffsHub] handler '${area}' falhou:`, err);
105549
+ });
105550
+ if (!doc.getElementById(STYLE_ID13)) {
105551
+ const style = doc.createElement("style");
105552
+ style.id = STYLE_ID13;
105553
+ style.textContent = HUB_CSS2;
105554
+ doc.head.appendChild(style);
105555
+ }
105556
+ doc.getElementById(MODAL_ID3)?.remove();
105557
+ const visible = AREAS.filter((a) => typeof handlers[a.area] === "function");
105558
+ const cardsHtml = visible.map((a) => {
105559
+ const desc = options.descriptions?.[a.area] ?? a.desc(entity);
105560
+ return `
105561
+ <button type="button" class="myio-gt-hub__card" data-area="${a.area}">
105562
+ <span class="myio-gt-hub__icon">${a.icon}</span>
105563
+ <span class="myio-gt-hub__title">${a.title}</span>
105564
+ <span class="myio-gt-hub__desc">${escapeHtml13(desc)}</span>
105565
+ </button>`;
105566
+ }).join("");
105567
+ const modal = doc.createElement("div");
105568
+ modal.id = MODAL_ID3;
105569
+ modal.className = "myio-gt-hub";
105570
+ modal.innerHTML = `
105571
+ <div class="myio-gt-hub__overlay"></div>
105572
+ <div class="myio-gt-hub__content" role="dialog" aria-modal="true" aria-label="${escapeHtml13(title)}">
105573
+ <div class="myio-gt-hub__header">
105574
+ <h3>${escapeHtml13(title)}</h3>
105575
+ <button type="button" class="myio-gt-hub__close" aria-label="Fechar">&times;</button>
105576
+ </div>
105577
+ <div class="myio-gt-hub__body">${cardsHtml}
105578
+ </div>
105579
+ </div>
105580
+ `;
105581
+ doc.body.appendChild(modal);
105582
+ const themeVars = resolveThemeVars2(options.theme);
105583
+ if (themeVars) {
105584
+ Object.entries(themeVars).forEach(([k, v]) => {
105585
+ if (k.startsWith("--") && typeof v === "string") modal.style.setProperty(k, v);
105586
+ });
105587
+ }
105588
+ let footer = null;
105589
+ if (options.footer) {
105590
+ try {
105591
+ footer = createModalFooter({
105592
+ customerName: options.footer.customerName || "",
105593
+ libVersion: options.footer.libVersion ? { current: options.footer.libVersion } : false,
105594
+ libVersionMode: "static",
105595
+ themeMode: "light"
105596
+ });
105597
+ modal.querySelector(".myio-gt-hub__content")?.appendChild(footer.element);
105598
+ } catch {
105599
+ footer = null;
105600
+ }
105601
+ }
105602
+ const raf = typeof requestAnimationFrame === "function" ? requestAnimationFrame : (cb) => setTimeout(cb, 0);
105603
+ raf(() => modal.classList.add("show"));
105604
+ let closed = false;
105605
+ const escHandler = (e) => {
105606
+ if (e.key === "Escape") close();
105607
+ };
105608
+ function close() {
105609
+ if (closed) return;
105610
+ closed = true;
105611
+ doc.removeEventListener("keydown", escHandler);
105612
+ modal.classList.remove("show");
105613
+ setTimeout(() => {
105614
+ footer?.destroy?.();
105615
+ modal.remove();
105616
+ }, 200);
105617
+ try {
105618
+ options.onClose?.();
105619
+ } catch {
105620
+ }
105621
+ }
105622
+ modal.querySelector(".myio-gt-hub__overlay")?.addEventListener("click", close);
105623
+ modal.querySelector(".myio-gt-hub__close")?.addEventListener("click", close);
105624
+ doc.addEventListener("keydown", escHandler);
105625
+ modal.querySelectorAll(".myio-gt-hub__card").forEach((btn) => {
105626
+ btn.addEventListener("click", () => {
105627
+ const area = btn.dataset.area;
105628
+ close();
105629
+ setTimeout(() => {
105630
+ try {
105631
+ const out = handlers[area]?.();
105632
+ if (out && typeof out.then === "function") {
105633
+ out.catch((err) => reportError(err, area));
105634
+ }
105635
+ } catch (err) {
105636
+ reportError(err, area);
105637
+ }
105638
+ }, ROUTE_DELAY_MS2);
105639
+ });
105640
+ });
105641
+ return { close };
105642
+ }
105643
+
105089
105644
  // src/components/pricing-panel/helpers.ts
105090
105645
  var DOMAIN_LABEL = {
105091
105646
  energy: "Energia",
@@ -106244,18 +106799,18 @@ function createTariffApiAdapter(client, opts) {
106244
106799
  }
106245
106800
 
106246
106801
  // src/components/pricing-panel/openPricingPanel.ts
106247
- var MODAL_ID3 = "myio-pricing-panel";
106248
- function escapeHtml12(value) {
106802
+ var MODAL_ID4 = "myio-pricing-panel";
106803
+ function escapeHtml14(value) {
106249
106804
  return String(value).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
106250
106805
  }
106251
- function resolveTopDocument2() {
106806
+ function resolveTopDocument3() {
106252
106807
  try {
106253
106808
  return (window.top || window).document;
106254
106809
  } catch {
106255
106810
  return document;
106256
106811
  }
106257
106812
  }
106258
- function resolveThemeVars(explicit) {
106813
+ function resolveThemeVars3(explicit) {
106259
106814
  const theme = explicit || (typeof window !== "undefined" ? window.MyIOUtils?.theme : void 0);
106260
106815
  if (!theme) return null;
106261
106816
  const vars = typeof theme.cssVars === "function" ? theme.cssVars() : theme;
@@ -106300,7 +106855,7 @@ function fmtTimestamp(iso) {
106300
106855
  return d.toLocaleString("pt-BR");
106301
106856
  }
106302
106857
  function openPricingPanel(params) {
106303
- const doc = params.targetDocument || resolveTopDocument2();
106858
+ const doc = params.targetDocument || resolveTopDocument3();
106304
106859
  const author = params.currentUserEmail || "";
106305
106860
  const storePrefix = params.storageKeyPrefix || "myio";
106306
106861
  const keyEntries = entriesKey(storePrefix);
@@ -106320,9 +106875,10 @@ function openPricingPanel(params) {
106320
106875
  }
106321
106876
  };
106322
106877
  injectPricingPanelStyles(doc);
106323
- doc.getElementById(MODAL_ID3)?.remove();
106324
- const allowed = isPricingAllowed(params.currentUserEmail, isSuperAdmin());
106878
+ doc.getElementById(MODAL_ID4)?.remove();
106879
+ const allowed = typeof params.allowed === "boolean" ? params.allowed : isPricingAllowed(params.currentUserEmail, isSuperAdmin());
106325
106880
  const customers = params.customers || [];
106881
+ const lockCustomer = params.lockCustomer === true && customers.length > 0;
106326
106882
  const tariffApi = params.tariffApi;
106327
106883
  let adapter = null;
106328
106884
  if (allowed && tariffApi) {
@@ -106338,10 +106894,10 @@ function openPricingPanel(params) {
106338
106894
  let entries = allowed ? adapter ? (params.initialEntries || []).map((e) => ({ ...e })) : mergeEntries(loadJson(doc, keyEntries, []), params.initialEntries || [], author) : [];
106339
106895
  let auditLog = allowed && !adapter ? loadJson(doc, keyAudit, []) : [];
106340
106896
  const modal = doc.createElement("div");
106341
- modal.id = MODAL_ID3;
106897
+ modal.id = MODAL_ID4;
106342
106898
  modal.className = "myio-pricing";
106343
106899
  function applyTheme() {
106344
- const themeVars = resolveThemeVars(params.theme);
106900
+ const themeVars = resolveThemeVars3(params.theme);
106345
106901
  if (!themeVars) return;
106346
106902
  Object.entries(themeVars).forEach(([k, v]) => {
106347
106903
  if (k.startsWith("--") && typeof v === "string") modal.style.setProperty(k, v);
@@ -106400,7 +106956,7 @@ function openPricingPanel(params) {
106400
106956
  }
106401
106957
  const initDomain = params.domain || "energy";
106402
106958
  const initCategory = params.category || "lojas";
106403
- const customerOptions = customers.map((c) => `<option value="${escapeHtml12(resolveCustomerId(c))}">${escapeHtml12(c.title)}</option>`).join("");
106959
+ const customerOptions = customers.map((c) => `<option value="${escapeHtml14(resolveCustomerId(c))}">${escapeHtml14(c.title)}</option>`).join("");
106404
106960
  modal.innerHTML = `
106405
106961
  <div class="myio-pricing__overlay"></div>
106406
106962
  <div class="myio-pricing__content">
@@ -106417,7 +106973,7 @@ function openPricingPanel(params) {
106417
106973
  <!-- TAB: Definir pre\xE7os -->
106418
106974
  <div class="myio-pricing__panel" data-panel="define">
106419
106975
  <div class="myio-pricing__form">
106420
- <div class="myio-pricing__field myio-pricing__field--full">
106976
+ <div class="myio-pricing__field myio-pricing__field--full" data-testid="pricing-customer-field"${lockCustomer ? ' style="display:none;"' : ""}>
106421
106977
  <label class="myio-pricing__label" for="myio-pricing-customer">Customer (shopping)</label>
106422
106978
  <select class="myio-pricing__select" id="myio-pricing-customer" data-testid="pricing-customer">
106423
106979
  ${customerOptions}
@@ -106615,9 +107171,9 @@ function openPricingPanel(params) {
106615
107171
  const pushAudit = (rec) => {
106616
107172
  if (rec) auditLog = [rec, ...auditLog];
106617
107173
  };
106618
- const badge = (domain, category) => `<span class="myio-pricing__badge${domain === "water" ? " myio-pricing__badge--water" : ""}">${escapeHtml12(
107174
+ const badge = (domain, category) => `<span class="myio-pricing__badge${domain === "water" ? " myio-pricing__badge--water" : ""}">${escapeHtml14(
106619
107175
  DOMAIN_LABEL[domain]
106620
- )} \xB7 ${escapeHtml12(CATEGORY_LABEL[category])}</span>`;
107176
+ )} \xB7 ${escapeHtml14(CATEGORY_LABEL[category])}</span>`;
106621
107177
  const renderList2 = () => {
106622
107178
  const customerId = customerSel.value;
106623
107179
  const rows = entries.filter((e) => e.customerId === customerId).sort((a, b) => {
@@ -106630,15 +107186,15 @@ function openPricingPanel(params) {
106630
107186
  const boundsKey = b ? `${b.start}__${b.end}` : "";
106631
107187
  return `
106632
107188
  <li class="myio-pricing__item">
106633
- <span class="myio-pricing__item-period">${badge(e.domain, e.category)} ${escapeHtml12(
107189
+ <span class="myio-pricing__item-period">${badge(e.domain, e.category)} ${escapeHtml14(
106634
107190
  formatPeriodLabel(e)
106635
107191
  )}</span>
106636
- <span class="myio-pricing__item-price">${escapeHtml12(formatBRL2(e.pricePerKwh))} ${escapeHtml12(
107192
+ <span class="myio-pricing__item-price">${escapeHtml14(formatBRL2(e.pricePerKwh))} ${escapeHtml14(
106637
107193
  unitLabel(e.domain)
106638
107194
  )}</span>
106639
- <button class="myio-pricing__remove" data-remove="${escapeHtml12(e.domain)}|${escapeHtml12(
107195
+ <button class="myio-pricing__remove" data-remove="${escapeHtml14(e.domain)}|${escapeHtml14(
106640
107196
  e.category
106641
- )}|${escapeHtml12(boundsKey)}" aria-label="Remover" type="button">\u2715</button>
107197
+ )}|${escapeHtml14(boundsKey)}" aria-label="Remover" type="button">\u2715</button>
106642
107198
  </li>`;
106643
107199
  }).join("");
106644
107200
  emptyEl.style.display = rows.length ? "none" : "";
@@ -106737,8 +107293,8 @@ function openPricingPanel(params) {
106737
107293
  kpiEl.innerHTML = cards.map(
106738
107294
  (c) => `
106739
107295
  <div class="myio-pricing__kpi">
106740
- <div class="myio-pricing__kpi-value">${escapeHtml12(c.value)}</div>
106741
- <div class="myio-pricing__kpi-label">${escapeHtml12(c.label)}</div>
107296
+ <div class="myio-pricing__kpi-value">${escapeHtml14(c.value)}</div>
107297
+ <div class="myio-pricing__kpi-label">${escapeHtml14(c.label)}</div>
106742
107298
  </div>`
106743
107299
  ).join("");
106744
107300
  renderReport();
@@ -106757,11 +107313,11 @@ function openPricingPanel(params) {
106757
107313
  reportBody.innerHTML = rows.length ? rows.map(
106758
107314
  (e) => `
106759
107315
  <tr>
106760
- <td>${escapeHtml12(customerTitle(e.customerId))}</td>
106761
- <td>${escapeHtml12(DOMAIN_LABEL[e.domain])}</td>
106762
- <td>${escapeHtml12(CATEGORY_LABEL[e.category])}</td>
106763
- <td>${escapeHtml12(formatPeriodLabel(e))}</td>
106764
- <td>${escapeHtml12(formatBRL2(e.pricePerKwh))} ${escapeHtml12(unitLabel(e.domain))}</td>
107316
+ <td>${escapeHtml14(customerTitle(e.customerId))}</td>
107317
+ <td>${escapeHtml14(DOMAIN_LABEL[e.domain])}</td>
107318
+ <td>${escapeHtml14(CATEGORY_LABEL[e.category])}</td>
107319
+ <td>${escapeHtml14(formatPeriodLabel(e))}</td>
107320
+ <td>${escapeHtml14(formatBRL2(e.pricePerKwh))} ${escapeHtml14(unitLabel(e.domain))}</td>
106765
107321
  </tr>`
106766
107322
  ).join("") : `<tr><td colspan="5" style="text-align:center;color:var(--myio-text-muted,#6b7280);padding:24px;">Nenhum pre\xE7o para o filtro selecionado.</td></tr>`;
106767
107323
  }
@@ -106771,15 +107327,15 @@ function openPricingPanel(params) {
106771
107327
  return `
106772
107328
  <li class="myio-pricing__history-item">
106773
107329
  <div class="myio-pricing__history-head">
106774
- <span class="myio-pricing__action myio-pricing__action--${escapeHtml12(rec.action)}">${escapeHtml12(
107330
+ <span class="myio-pricing__action myio-pricing__action--${escapeHtml14(rec.action)}">${escapeHtml14(
106775
107331
  rec.action
106776
107332
  )}</span>
106777
107333
  ${badge(rec.domain, rec.category)}
106778
- <span>${escapeHtml12(rec.periodLabel)}${escapeHtml12(priceInfo)}</span>
107334
+ <span>${escapeHtml14(rec.periodLabel)}${escapeHtml14(priceInfo)}</span>
106779
107335
  </div>
106780
- <div class="myio-pricing__history-meta">${escapeHtml12(customerTitle(rec.customerId))} \xB7 ${escapeHtml12(
107336
+ <div class="myio-pricing__history-meta">${escapeHtml14(customerTitle(rec.customerId))} \xB7 ${escapeHtml14(
106781
107337
  rec.by || "\u2014"
106782
- )} \xB7 ${escapeHtml12(fmtTimestamp(rec.at))}</div>
107338
+ )} \xB7 ${escapeHtml14(fmtTimestamp(rec.at))}</div>
106783
107339
  </li>`;
106784
107340
  }).join("");
106785
107341
  historyEmpty.style.display = auditLog.length ? "none" : "";
@@ -107841,6 +108397,207 @@ function renderGatedMoney(params, renderers) {
107841
108397
  return renderers.renderCoverage(routing.coverageOverlay);
107842
108398
  }
107843
108399
 
108400
+ // src/components/financial-goals/tariffValuation.ts
108401
+ var MONEY_HOURLY_MAX_DAYS = 31;
108402
+ var TARIFF_DEFAULT_TIMEZONE = "America/Sao_Paulo";
108403
+ var HOUR_MS2 = 36e5;
108404
+ var QTY_SCALE = 6;
108405
+ var PRICE_SCALE = 6;
108406
+ var AMOUNT_SCALE = QTY_SCALE + PRICE_SCALE;
108407
+ var DECIMAL_RE = /^([+-]?)(\d+)(?:\.(\d+))?$/;
108408
+ function parseScaled(s, scale) {
108409
+ const m = DECIMAL_RE.exec(String(s).trim());
108410
+ if (!m) return null;
108411
+ const frac = (m[3] || "").slice(0, scale).padEnd(scale, "0");
108412
+ const v = BigInt(m[2] + frac);
108413
+ return m[1] === "-" ? -v : v;
108414
+ }
108415
+ function formatScaled(v, scale) {
108416
+ const neg = v < 0n;
108417
+ const abs = neg ? -v : v;
108418
+ const digits = abs.toString().padStart(scale + 1, "0");
108419
+ const int = digits.slice(0, digits.length - scale);
108420
+ let frac = digits.slice(digits.length - scale).replace(/0+$/, "");
108421
+ if (frac.length < 2) frac = frac.padEnd(2, "0");
108422
+ const isZero = abs === 0n;
108423
+ return `${neg && !isZero ? "-" : ""}${int}.${frac}`;
108424
+ }
108425
+ function qtyToScaled(qty) {
108426
+ if (typeof qty !== "number" || !Number.isFinite(qty) || Math.abs(qty) >= 1e15) return null;
108427
+ return parseScaled(qty.toFixed(QTY_SCALE), QTY_SCALE);
108428
+ }
108429
+ function isPriceString(p) {
108430
+ return typeof p === "string" && DECIMAL_RE.test(p.trim());
108431
+ }
108432
+ function makeLocalPartsFn(timezone) {
108433
+ let fmt2 = null;
108434
+ try {
108435
+ fmt2 = new Intl.DateTimeFormat("en-US", {
108436
+ timeZone: timezone,
108437
+ year: "numeric",
108438
+ month: "2-digit",
108439
+ day: "2-digit",
108440
+ hour: "2-digit",
108441
+ hourCycle: "h23"
108442
+ });
108443
+ } catch {
108444
+ fmt2 = null;
108445
+ }
108446
+ return (ts) => {
108447
+ if (fmt2) {
108448
+ const out = {};
108449
+ for (const p of fmt2.formatToParts(new Date(ts))) {
108450
+ if (p.type === "year" || p.type === "month" || p.type === "day" || p.type === "hour") {
108451
+ out[p.type] = Number(p.value);
108452
+ }
108453
+ }
108454
+ return { year: out.year, month: out.month, day: out.day, hour: out.hour % 24 };
108455
+ }
108456
+ const d = new Date(ts - 3 * HOUR_MS2);
108457
+ return { year: d.getUTCFullYear(), month: d.getUTCMonth() + 1, day: d.getUTCDate(), hour: d.getUTCHours() };
108458
+ };
108459
+ }
108460
+ var pad24 = (n) => String(n).padStart(2, "0");
108461
+ function nodePrice(node) {
108462
+ return node && isPriceString(node.price) ? node.price.trim() : null;
108463
+ }
108464
+ function hourPrice(dayNode, hour) {
108465
+ const hourly = dayNode?.hourly;
108466
+ if (!hourly) return null;
108467
+ return nodePrice(hourly[String(hour)]) ?? nodePrice(hourly[pad24(hour)]);
108468
+ }
108469
+ function resolveTreePrice(tree, p) {
108470
+ const mm = pad24(p.month);
108471
+ const dd = pad24(p.day);
108472
+ const mmdd = `${mm}-${dd}`;
108473
+ const monthNode = tree.monthly?.[mm];
108474
+ const dayNodes = [tree.daily?.[mmdd], monthNode?.daily?.[dd], monthNode?.daily?.[mmdd]];
108475
+ for (const dn of dayNodes) {
108476
+ const hp = hourPrice(dn, p.hour);
108477
+ if (hp) return hp;
108478
+ }
108479
+ for (const dn of dayNodes) {
108480
+ const dp = nodePrice(dn);
108481
+ if (dp) return dp;
108482
+ }
108483
+ return nodePrice(monthNode) ?? nodePrice(tree.annual);
108484
+ }
108485
+ function createTariffValuator(options) {
108486
+ const trees = options?.trees || {};
108487
+ const localParts = makeLocalPartsFn(options?.timezone || TARIFF_DEFAULT_TIMEZONE);
108488
+ const byYear = {};
108489
+ Object.keys(trees).forEach((cat) => {
108490
+ const map = /* @__PURE__ */ new Map();
108491
+ for (const res of trees[cat] || []) {
108492
+ if (res && typeof res.year === "number" && res.tree) map.set(res.year, res.tree);
108493
+ }
108494
+ byYear[cat] = map;
108495
+ });
108496
+ function hasAnyTariff(category) {
108497
+ const map = byYear[category];
108498
+ return !!map && map.size > 0;
108499
+ }
108500
+ function priceAt(category, ts) {
108501
+ const map = byYear[category];
108502
+ if (!map || !Number.isFinite(ts)) return null;
108503
+ const p = localParts(ts);
108504
+ const tree = map.get(p.year);
108505
+ return tree ? resolveTreePrice(tree, p) : null;
108506
+ }
108507
+ function pricesInside(category, startTs, endTs) {
108508
+ const out = [];
108509
+ const end = Math.max(endTs, startTs + 1);
108510
+ for (let t = startTs; t < end; t += HOUR_MS2) out.push(priceAt(category, t));
108511
+ return out;
108512
+ }
108513
+ function valuate(series, opts) {
108514
+ const needsHourlyReason = opts?.intradayLimited ? "intraday-tariff-long-period" : "needs-hourly";
108515
+ const category = series?.category ?? null;
108516
+ if (!category) return { state: "uncategorized", reason: "no-category" };
108517
+ if (!hasAnyTariff(category)) return { state: "none", reason: "no-tariff", coveredRatio: 0 };
108518
+ const buckets = Array.isArray(series.buckets) ? series.buckets : [];
108519
+ if (buckets.length === 0) return { state: "none", reason: "no-data", coveredRatio: 0 };
108520
+ let acc = 0n;
108521
+ let covered = 0;
108522
+ let firstReason;
108523
+ const distinct = /* @__PURE__ */ new Set();
108524
+ for (const b of buckets) {
108525
+ const qty = qtyToScaled(b?.qty);
108526
+ if (qty == null || !Number.isFinite(b.startTs) || !Number.isFinite(b.endTs)) {
108527
+ firstReason = firstReason || "invalid-qty";
108528
+ continue;
108529
+ }
108530
+ const prices = pricesInside(category, b.startTs, b.endTs);
108531
+ if (prices.some((p) => p == null)) {
108532
+ firstReason = firstReason || "no-tariff";
108533
+ continue;
108534
+ }
108535
+ const unique = new Set(prices);
108536
+ if (unique.size > 1) {
108537
+ firstReason = firstReason || needsHourlyReason;
108538
+ continue;
108539
+ }
108540
+ const price = prices[0];
108541
+ const scaledPrice = parseScaled(price, PRICE_SCALE);
108542
+ if (scaledPrice == null) {
108543
+ firstReason = firstReason || "no-tariff";
108544
+ continue;
108545
+ }
108546
+ distinct.add(formatScaled(scaledPrice, PRICE_SCALE));
108547
+ acc += qty * scaledPrice;
108548
+ covered += 1;
108549
+ }
108550
+ const ratio = covered / buckets.length;
108551
+ const priceVaries = distinct.size > 1;
108552
+ if (covered === buckets.length) {
108553
+ return { state: "complete", amount: formatScaled(acc, AMOUNT_SCALE), coveredRatio: 1, priceVaries };
108554
+ }
108555
+ if (covered === 0) return { state: "none", reason: firstReason || "no-tariff", coveredRatio: 0 };
108556
+ return { state: "partial", reason: firstReason, coveredRatio: ratio, priceVaries };
108557
+ }
108558
+ function sum2(list) {
108559
+ const items = Array.isArray(list) ? list : [];
108560
+ const total = items.length;
108561
+ if (total === 0) return { state: "none", covered: 0, total: 0 };
108562
+ let acc = 0n;
108563
+ let covered = 0;
108564
+ for (const m of items) {
108565
+ if (m?.state !== "complete" || m.amount == null) continue;
108566
+ const v = parseScaled(m.amount, AMOUNT_SCALE);
108567
+ if (v == null) continue;
108568
+ acc += v;
108569
+ covered += 1;
108570
+ }
108571
+ if (covered === total) return { state: "complete", amount: formatScaled(acc, AMOUNT_SCALE), covered, total };
108572
+ return { state: covered > 0 ? "partial" : "none", covered, total };
108573
+ }
108574
+ function chooseGranularity(categories, startTs, endTs) {
108575
+ const cats = Array.from(new Set((categories || []).filter(Boolean)));
108576
+ let intraday = false;
108577
+ outer: for (const cat of cats) {
108578
+ let dayKey = "";
108579
+ let dayPrice;
108580
+ for (let t = startTs; t < endTs; t += HOUR_MS2) {
108581
+ const p = localParts(t);
108582
+ const key = `${p.year}-${p.month}-${p.day}`;
108583
+ const price = priceAt(cat, t);
108584
+ if (key !== dayKey) {
108585
+ dayKey = key;
108586
+ dayPrice = price;
108587
+ } else if (price !== dayPrice) {
108588
+ intraday = true;
108589
+ break outer;
108590
+ }
108591
+ }
108592
+ }
108593
+ if (!intraday) return { granularity: "1d", intradayLimited: false };
108594
+ const days = (endTs - startTs) / (24 * HOUR_MS2);
108595
+ if (days <= MONEY_HOURLY_MAX_DAYS) return { granularity: "1h", intradayLimited: false };
108596
+ return { granularity: "1d", intradayLimited: true };
108597
+ }
108598
+ return { priceAt, valuate, sum: sum2, chooseGranularity };
108599
+ }
108600
+
107844
108601
  // src/components/premium-modals/measurement-setup/types.ts
107845
108602
  var WATER_UNITS = [
107846
108603
  { value: "m3", label: "Metros C\xFAbicos (m\xB3)" },
@@ -115115,11 +115872,11 @@ function refreshIncidentBadges(opts) {
115115
115872
  }
115116
115873
 
115117
115874
  // src/components/premium-modals/standard-modal/openStandardModal.ts
115118
- var STYLE_ID13 = "myio-stdmodal-styles";
115875
+ var STYLE_ID14 = "myio-stdmodal-styles";
115119
115876
  var FONT_LINK_ID3 = "myio-dialog-font-nunito";
115120
115877
  var BASE_Z_INDEX3 = 10700;
115121
115878
  var openCount3 = 0;
115122
- function escapeHtml13(v) {
115879
+ function escapeHtml15(v) {
115123
115880
  return String(v).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
115124
115881
  }
115125
115882
  function injectStyles13() {
@@ -115130,9 +115887,9 @@ function injectStyles13() {
115130
115887
  link.href = "https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap";
115131
115888
  document.head.appendChild(link);
115132
115889
  }
115133
- if (document.getElementById(STYLE_ID13)) return;
115890
+ if (document.getElementById(STYLE_ID14)) return;
115134
115891
  const style = document.createElement("style");
115135
- style.id = STYLE_ID13;
115892
+ style.id = STYLE_ID14;
115136
115893
  style.textContent = `
115137
115894
  .myio-stdmodal-overlay {
115138
115895
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
@@ -115173,10 +115930,10 @@ function openStandardModal(params) {
115173
115930
  overlay.className = "myio-stdmodal-overlay";
115174
115931
  overlay.style.zIndex = String(BASE_Z_INDEX3 + openCount3);
115175
115932
  overlay.innerHTML = `
115176
- <div class="myio-stdmodal" role="dialog" aria-modal="true" aria-label="${escapeHtml13(params.title)}" style="width:${width}">
115933
+ <div class="myio-stdmodal" role="dialog" aria-modal="true" aria-label="${escapeHtml15(params.title)}" style="width:${width}">
115177
115934
  ${ModalHeader.generateHTML({
115178
115935
  icon: params.icon,
115179
- title: escapeHtml13(params.title),
115936
+ title: escapeHtml15(params.title),
115180
115937
  modalId,
115181
115938
  showThemeToggle: false,
115182
115939
  showMaximize: false,
@@ -115185,7 +115942,7 @@ function openStandardModal(params) {
115185
115942
  })}
115186
115943
  <div class="myio-stdmodal__body"></div>
115187
115944
  ${buttons.length ? `<div class="myio-stdmodal__footer">${buttons.map(
115188
- (b, i) => `<button type="button" class="myio-stdmodal__btn myio-stdmodal__btn--${b.variant ?? "secondary"}" data-index="${i}" data-value="${escapeHtml13(b.value)}">${escapeHtml13(b.label)}</button>`
115945
+ (b, i) => `<button type="button" class="myio-stdmodal__btn myio-stdmodal__btn--${b.variant ?? "secondary"}" data-index="${i}" data-value="${escapeHtml15(b.value)}">${escapeHtml15(b.label)}</button>`
115189
115946
  ).join("")}</div>` : ""}
115190
115947
  </div>`;
115191
115948
  const root = overlay.querySelector(".myio-stdmodal");
@@ -115266,7 +116023,7 @@ var VALUE_COLUMN = {
115266
116023
  };
115267
116024
  var MAX_IMPORT_ROWS = 5e3;
115268
116025
  var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
115269
- var pad24 = (n) => String(n).padStart(2, "0");
116026
+ var pad25 = (n) => String(n).padStart(2, "0");
115270
116027
  function isImportableKey(d) {
115271
116028
  const slave = Number(d?.slaveId);
115272
116029
  return !!d?.centralId && UUID_RE.test(String(d.centralId)) && Number.isInteger(slave) && slave >= 1;
@@ -115284,14 +116041,14 @@ function daysBetween(start, end) {
115284
116041
  const cur = new Date(Date.UTC(y1, m1 - 1, d1));
115285
116042
  const last = Date.UTC(y2, m2 - 1, d2);
115286
116043
  while (cur.getTime() <= last && out.length < 400) {
115287
- out.push(`${cur.getUTCFullYear()}-${pad24(cur.getUTCMonth() + 1)}-${pad24(cur.getUTCDate())}`);
116044
+ out.push(`${cur.getUTCFullYear()}-${pad25(cur.getUTCMonth() + 1)}-${pad25(cur.getUTCDate())}`);
115288
116045
  cur.setUTCDate(cur.getUTCDate() + 1);
115289
116046
  }
115290
116047
  return out;
115291
116048
  }
115292
116049
  function nowSaoPaulo(now) {
115293
116050
  const d = new Date(now - 3 * 3600 * 1e3);
115294
- return { date: `${d.getUTCFullYear()}-${pad24(d.getUTCMonth() + 1)}-${pad24(d.getUTCDate())}`, hour: d.getUTCHours() };
116051
+ return { date: `${d.getUTCFullYear()}-${pad25(d.getUTCMonth() + 1)}-${pad25(d.getUTCDate())}`, hour: d.getUTCHours() };
115295
116052
  }
115296
116053
  function buildTemplateCsv(domain, devices, start, end, now = Date.now()) {
115297
116054
  const valueCol = VALUE_COLUMN[domain];
@@ -115306,7 +116063,7 @@ function buildTemplateCsv(domain, devices, start, end, now = Date.now()) {
115306
116063
  if (date > today.date) break;
115307
116064
  for (let h3 = 0; h3 < 24; h3++) {
115308
116065
  if (date === today.date && h3 >= today.hour) break;
115309
- const cols = [String(dev.centralId), String(Number(dev.slaveId)), esc10(dev.label || ""), date, `${pad24(h3)}:00`, ""];
116066
+ const cols = [String(dev.centralId), String(Number(dev.slaveId)), esc10(dev.label || ""), date, `${pad25(h3)}:00`, ""];
115310
116067
  if (domain === "energy") cols.push("");
115311
116068
  lines.push(cols.join(";"));
115312
116069
  }
@@ -115351,26 +116108,26 @@ function parseCsv(text2) {
115351
116108
  function normalizeDate(v) {
115352
116109
  if (typeof v === "number" && Number.isFinite(v) && v > 2e4 && v < 8e4) {
115353
116110
  const d = new Date(Date.UTC(1899, 11, 30) + Math.floor(v) * 864e5);
115354
- return `${d.getUTCFullYear()}-${pad24(d.getUTCMonth() + 1)}-${pad24(d.getUTCDate())}`;
116111
+ return `${d.getUTCFullYear()}-${pad25(d.getUTCMonth() + 1)}-${pad25(d.getUTCDate())}`;
115355
116112
  }
115356
116113
  const s = String(v ?? "").trim();
115357
116114
  let m = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(s);
115358
- if (m) return `${m[1]}-${pad24(+m[2])}-${pad24(+m[3])}`;
116115
+ if (m) return `${m[1]}-${pad25(+m[2])}-${pad25(+m[3])}`;
115359
116116
  m = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(s);
115360
- if (m) return `${m[3]}-${pad24(+m[2])}-${pad24(+m[1])}`;
116117
+ if (m) return `${m[3]}-${pad25(+m[2])}-${pad25(+m[1])}`;
115361
116118
  return null;
115362
116119
  }
115363
116120
  function normalizeHour(v) {
115364
116121
  if (typeof v === "number" && Number.isFinite(v) && v >= 0 && v < 1) {
115365
116122
  const mins = Math.round(v * 24 * 60);
115366
- return mins % 60 === 0 ? `${pad24(mins / 60)}:00` : null;
116123
+ return mins % 60 === 0 ? `${pad25(mins / 60)}:00` : null;
115367
116124
  }
115368
116125
  const s = String(v ?? "").trim();
115369
116126
  const m = /^(\d{1,2})(?::(\d{2})(?::(\d{2}))?)?$/.exec(s);
115370
116127
  if (!m) return null;
115371
116128
  const h3 = Number(m[1]);
115372
116129
  if (h3 > 23 || Number(m[2] || 0) !== 0 || Number(m[3] || 0) !== 0) return null;
115373
- return `${pad24(h3)}:00`;
116130
+ return `${pad25(h3)}:00`;
115374
116131
  }
115375
116132
  function parseDecimal(v) {
115376
116133
  if (typeof v === "number") return Number.isFinite(v) ? v : NaN;
@@ -115479,7 +116236,7 @@ var TOTAL_COLUMN = {
115479
116236
  var ACCUMULATED_SOURCE_PREFIX = "acumulado";
115480
116237
  var MAX_PERIOD_DAYS = 366;
115481
116238
  var MILLI = 1e3;
115482
- var pad25 = (n) => String(n).padStart(2, "0");
116239
+ var pad26 = (n) => String(n).padStart(2, "0");
115483
116240
  function closedHoursInPeriod(start, end, now = Date.now()) {
115484
116241
  const today = nowSaoPaulo(now);
115485
116242
  const out = [];
@@ -115552,7 +116309,7 @@ function accumulatedRows(domain, entries, profile = DEFAULT_DISTRIBUTION_PROFILE
115552
116309
  gateway_id: e.gateway_id,
115553
116310
  slave_id: e.slave_id,
115554
116311
  date: slots[i].date,
115555
- hour: `${pad25(slots[i].hour)}:00`,
116312
+ hour: `${pad26(slots[i].hour)}:00`,
115556
116313
  [valueCol]: value
115557
116314
  });
115558
116315
  });
@@ -115759,15 +116516,15 @@ function fmtSaoPaulo(iso) {
115759
116516
  const p = (n) => String(n).padStart(2, "0");
115760
116517
  return `${p(d.getUTCDate())}/${p(d.getUTCMonth() + 1)}/${d.getUTCFullYear()} ${p(d.getUTCHours())}:00`;
115761
116518
  }
115762
- var STYLE_ID14 = "myio-tlmimport-styles";
116519
+ var STYLE_ID15 = "myio-tlmimport-styles";
115763
116520
  function esc9(v) {
115764
116521
  return String(v ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
115765
116522
  }
115766
116523
  var fmtNum = (n, d = 0) => Number.isFinite(Number(n)) ? Number(n).toLocaleString("pt-BR", { minimumFractionDigits: d, maximumFractionDigits: d }) : "\u2014";
115767
116524
  function injectStyles14() {
115768
- if (document.getElementById(STYLE_ID14)) return;
116525
+ if (document.getElementById(STYLE_ID15)) return;
115769
116526
  const style = document.createElement("style");
115770
- style.id = STYLE_ID14;
116527
+ style.id = STYLE_ID15;
115771
116528
  style.textContent = `
115772
116529
  .tlmi { --tlmi-ac: #3e1a7d; --tlmi-ac-soft: #f1ecfa; --tlmi-ok: #16a34a; --tlmi-warn: #d97706; --tlmi-err: #dc2626;
115773
116530
  display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: #1e293b; }
@@ -116518,14 +117275,14 @@ var DOMAIN_TEXT2 = {
116518
117275
  energy: { title: "Novo medidor de energia manual", icon: "\u26A1", noun: "Medidor de energia" },
116519
117276
  water: { title: "Novo hidr\xF4metro manual", icon: "\u{1F4A7}", noun: "Hidr\xF4metro" }
116520
117277
  };
116521
- var STYLE_ID15 = "myio-manualdev-styles";
116522
- function escapeHtml14(v) {
117278
+ var STYLE_ID16 = "myio-manualdev-styles";
117279
+ function escapeHtml16(v) {
116523
117280
  return String(v ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
116524
117281
  }
116525
117282
  function injectStyles15() {
116526
- if (document.getElementById(STYLE_ID15)) return;
117283
+ if (document.getElementById(STYLE_ID16)) return;
116527
117284
  const style = document.createElement("style");
116528
- style.id = STYLE_ID15;
117285
+ style.id = STYLE_ID16;
116529
117286
  style.textContent = `
116530
117287
  .myio-manualdev { display: flex; flex-direction: column; gap: 16px; }
116531
117288
  .myio-manualdev__hint { margin: 0; font-size: 13px; color: #6b7280; line-height: 1.5; }
@@ -116580,18 +117337,18 @@ function formHtml(domain, values, error, detail) {
116580
117337
  return `
116581
117338
  <form class="myio-manualdev" novalidate>
116582
117339
  <p class="myio-manualdev__hint">Cadastre um ponto de leitura manual. Ele aparece nesta lista e n\xE3o entra nos totais nem nos relat\xF3rios.</p>
116583
- <span class="myio-manualdev__type">${t.icon} ${escapeHtml14(t.noun)} manual</span>
117340
+ <span class="myio-manualdev__type">${t.icon} ${escapeHtml16(t.noun)} manual</span>
116584
117341
  <label class="myio-manualdev__field">
116585
117342
  <span class="myio-manualdev__label">Etiqueta</span>
116586
117343
  <input class="myio-manualdev__input" name="label" maxlength="80" autocomplete="off"
116587
- placeholder="Ex.: Burger King" value="${escapeHtml14(values.label)}" />
117344
+ placeholder="Ex.: Burger King" value="${escapeHtml16(values.label)}" />
116588
117345
  </label>
116589
117346
  <label class="myio-manualdev__field">
116590
117347
  <span class="myio-manualdev__label">Identificador</span>
116591
117348
  <input class="myio-manualdev__input" name="identifier" maxlength="40" autocomplete="off"
116592
- placeholder="Ex.: STB01010" value="${escapeHtml14(values.identifier)}" />
117349
+ placeholder="Ex.: STB01010" value="${escapeHtml16(values.identifier)}" />
116593
117350
  </label>
116594
- ${error ? `<p class="myio-manualdev__error" role="alert">${escapeHtml14(error)}${detail ? `<small class="myio-manualdev__detail">${escapeHtml14(detail)}</small>` : ""}</p>` : ""}
117351
+ ${error ? `<p class="myio-manualdev__error" role="alert">${escapeHtml16(error)}${detail ? `<small class="myio-manualdev__detail">${escapeHtml16(detail)}</small>` : ""}</p>` : ""}
116595
117352
  <button type="submit" hidden></button>
116596
117353
  </form>`;
116597
117354
  }
@@ -116599,13 +117356,13 @@ function successHtml(domain, r, tech) {
116599
117356
  return `
116600
117357
  <div class="myio-manualdev__ok">
116601
117358
  <div class="myio-manualdev__ok-icon">\u2705</div>
116602
- <p class="myio-manualdev__ok-title">${escapeHtml14(DOMAIN_TEXT2[domain].noun)} criado</p>
116603
- <p class="myio-manualdev__ok-text"><strong>${escapeHtml14(r.label)}</strong> \xB7 ${escapeHtml14(r.identifier)}</p>
117359
+ <p class="myio-manualdev__ok-title">${escapeHtml16(DOMAIN_TEXT2[domain].noun)} criado</p>
117360
+ <p class="myio-manualdev__ok-text"><strong>${escapeHtml16(r.label)}</strong> \xB7 ${escapeHtml16(r.identifier)}</p>
116604
117361
  ${tech ? `<div class="myio-manualdev__tech">
116605
- device <code>${escapeHtml14(r.name)}</code><br/>
116606
- profile <code>${escapeHtml14(r.deviceProfile)}</code><br/>
116607
- asset <code>${escapeHtml14(r.assetName)}</code><br/>
116608
- id <code>${escapeHtml14(r.deviceId)}</code>
117362
+ device <code>${escapeHtml16(r.name)}</code><br/>
117363
+ profile <code>${escapeHtml16(r.deviceProfile)}</code><br/>
117364
+ asset <code>${escapeHtml16(r.assetName)}</code><br/>
117365
+ id <code>${escapeHtml16(r.deviceId)}</code>
116609
117366
  </div>` : ""}
116610
117367
  </div>`;
116611
117368
  }
@@ -116620,20 +117377,20 @@ var STEP_ICON = {
116620
117377
  };
116621
117378
  function stepsHtml(steps) {
116622
117379
  return `<ol class="myio-manualdev__steps">${steps.map(
116623
- (s) => `<li class="myio-manualdev__step" data-status="${escapeHtml14(s.status)}">
117380
+ (s) => `<li class="myio-manualdev__step" data-status="${escapeHtml16(s.status)}">
116624
117381
  <span aria-hidden="true">${STEP_ICON[s.status] || "\u25CB"}</span>
116625
- <span class="myio-manualdev__step-sys">${escapeHtml14(s.system)}</span>
116626
- <span>${escapeHtml14(s.title)}${s.message ? `<small class="myio-manualdev__step-msg">${escapeHtml14(s.message)}</small>` : ""}</span>
117382
+ <span class="myio-manualdev__step-sys">${escapeHtml16(s.system)}</span>
117383
+ <span>${escapeHtml16(s.title)}${s.message ? `<small class="myio-manualdev__step-msg">${escapeHtml16(s.message)}</small>` : ""}</span>
116627
117384
  </li>`
116628
117385
  ).join("")}</ol>`;
116629
117386
  }
116630
117387
  function notesHtml(plan) {
116631
- const block = (plan.blockers || []).map((b) => `<p class="myio-manualdev__note myio-manualdev__note--block" role="alert">\u26D4 ${escapeHtml14(b)}</p>`);
116632
- const warn = (plan.warnings || []).map((w) => `<p class="myio-manualdev__note myio-manualdev__note--warn">\u26A0\uFE0F ${escapeHtml14(w)}</p>`);
117388
+ const block = (plan.blockers || []).map((b) => `<p class="myio-manualdev__note myio-manualdev__note--block" role="alert">\u26D4 ${escapeHtml16(b)}</p>`);
117389
+ const warn = (plan.warnings || []).map((w) => `<p class="myio-manualdev__note myio-manualdev__note--warn">\u26A0\uFE0F ${escapeHtml16(w)}</p>`);
116633
117390
  return [...block, ...warn].join("");
116634
117391
  }
116635
117392
  function rowsHtml(rows) {
116636
- return `<table class="myio-manualdev__summary"><tbody>${rows.map((r) => `<tr><th>${escapeHtml14(r.label)}</th><td>${escapeHtml14(r.value)}</td></tr>`).join("")}</tbody></table>`;
117393
+ return `<table class="myio-manualdev__summary"><tbody>${rows.map((r) => `<tr><th>${escapeHtml16(r.label)}</th><td>${escapeHtml16(r.value)}</td></tr>`).join("")}</tbody></table>`;
116637
117394
  }
116638
117395
  function moreHtml(inner, open = false) {
116639
117396
  return `<details class="myio-manualdev__more"${open ? " open" : ""}>
@@ -116653,7 +117410,7 @@ function planHtml(plan) {
116653
117410
  function progressHtml(steps, message, ok, open = false) {
116654
117411
  return `
116655
117412
  <div class="myio-manualdev">
116656
- ${ok === void 0 ? '<p class="myio-manualdev__hint">Criando o dispositivo\u2026 n\xE3o feche esta janela.</p>' : `<p class="myio-manualdev__note ${ok ? "myio-manualdev__note--warn" : "myio-manualdev__note--block"}" role="status">${escapeHtml14(
117413
+ ${ok === void 0 ? '<p class="myio-manualdev__hint">Criando o dispositivo\u2026 n\xE3o feche esta janela.</p>' : `<p class="myio-manualdev__note ${ok ? "myio-manualdev__note--warn" : "myio-manualdev__note--block"}" role="status">${escapeHtml16(
116657
117414
  message || (ok ? "Conclu\xEDdo com avisos." : "N\xE3o foi poss\xEDvel concluir.")
116658
117415
  )}</p>`}
116659
117416
  ${moreHtml(stepsHtml(steps), open)}
@@ -118927,9 +119684,9 @@ function openMyioGcdrLoginModal(options) {
118927
119684
  }
118928
119685
 
118929
119686
  // src/components/img-gallery/ScrollableTabs.ts
118930
- var STYLE_ID16 = "myio-tabs-styles";
119687
+ var STYLE_ID17 = "myio-tabs-styles";
118931
119688
  var FONT_LINK_ID4 = "myio-dialog-font-nunito";
118932
- function escapeHtml15(value) {
119689
+ function escapeHtml17(value) {
118933
119690
  return String(value).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
118934
119691
  }
118935
119692
  function injectStyles16() {
@@ -118940,9 +119697,9 @@ function injectStyles16() {
118940
119697
  link.href = "https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap";
118941
119698
  document.head.appendChild(link);
118942
119699
  }
118943
- if (document.getElementById(STYLE_ID16)) return;
119700
+ if (document.getElementById(STYLE_ID17)) return;
118944
119701
  const style = document.createElement("style");
118945
- style.id = STYLE_ID16;
119702
+ style.id = STYLE_ID17;
118946
119703
  style.textContent = `
118947
119704
  .myio-tabs {
118948
119705
  display: flex;
@@ -119065,7 +119822,7 @@ function createScrollableTabs(options) {
119065
119822
  btn.setAttribute("role", "tab");
119066
119823
  btn.dataset.key = t.key;
119067
119824
  if (t.disabled) btn.disabled = true;
119068
- btn.innerHTML = `${t.icon ? `<span aria-hidden="true">${t.icon}</span>` : ""}<span>${escapeHtml15(t.label)}</span>`;
119825
+ btn.innerHTML = `${t.icon ? `<span aria-hidden="true">${t.icon}</span>` : ""}<span>${escapeHtml17(t.label)}</span>`;
119069
119826
  styleTab(btn, t.key === active);
119070
119827
  btn.addEventListener("click", () => {
119071
119828
  if (t.disabled || t.key === active) return;
@@ -119150,9 +119907,9 @@ function createScrollableTabs(options) {
119150
119907
  }
119151
119908
 
119152
119909
  // src/components/img-gallery/ImgGallery.ts
119153
- var STYLE_ID17 = "myio-gallery-styles";
119910
+ var STYLE_ID18 = "myio-gallery-styles";
119154
119911
  var FONT_LINK_ID5 = "myio-dialog-font-nunito";
119155
- function escapeHtml16(value) {
119912
+ function escapeHtml18(value) {
119156
119913
  return String(value == null ? "" : value).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
119157
119914
  }
119158
119915
  var PRM = () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
@@ -119164,9 +119921,9 @@ function injectStyles17() {
119164
119921
  link.href = "https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap";
119165
119922
  document.head.appendChild(link);
119166
119923
  }
119167
- if (document.getElementById(STYLE_ID17)) return;
119924
+ if (document.getElementById(STYLE_ID18)) return;
119168
119925
  const style = document.createElement("style");
119169
- style.id = STYLE_ID17;
119926
+ style.id = STYLE_ID18;
119170
119927
  style.textContent = `
119171
119928
  .myio-gallery {
119172
119929
  font-family: 'Nunito', system-ui, sans-serif;
@@ -119376,10 +120133,10 @@ function createImgGallery(options) {
119376
120133
  root.appendChild(grid);
119377
120134
  function detailsHtml(img) {
119378
120135
  const lines = [];
119379
- if (img.filename) lines.push(`<span title="${escapeHtml16(img.filename)}">${escapeHtml16(img.filename)}</span>`);
119380
- if (typeof img.sizeBytes === "number") lines.push(`<span>${escapeHtml16(formatSize(img.sizeBytes))}</span>`);
120136
+ if (img.filename) lines.push(`<span title="${escapeHtml18(img.filename)}">${escapeHtml18(img.filename)}</span>`);
120137
+ if (typeof img.sizeBytes === "number") lines.push(`<span>${escapeHtml18(formatSize(img.sizeBytes))}</span>`);
119381
120138
  const dims = typeof img.width === "number" && typeof img.height === "number" ? `${img.width} \xD7 ${img.height}px` : "";
119382
- lines.push(`<span data-dims>${escapeHtml16(dims)}</span>`);
120139
+ lines.push(`<span data-dims>${escapeHtml18(dims)}</span>`);
119383
120140
  return lines.join("");
119384
120141
  }
119385
120142
  function renderDescription(body, img, index) {
@@ -133885,7 +134642,7 @@ function createCustomerCardV1(params) {
133885
134642
  }
133886
134643
 
133887
134644
  // src/components/cards/customer-goals/v1.0.0/styles.ts
133888
- var STYLE_ID18 = "myio-customer-goals-card-css";
134645
+ var STYLE_ID19 = "myio-customer-goals-card-css";
133889
134646
  var CSS4 = `
133890
134647
  .myio-cgc{
133891
134648
  --cgc-surface:#ffffff;
@@ -133986,9 +134743,9 @@ var CSS4 = `
133986
134743
  `;
133987
134744
  function injectCustomerGoalsCardStyles() {
133988
134745
  if (typeof document === "undefined") return;
133989
- if (document.getElementById(STYLE_ID18)) return;
134746
+ if (document.getElementById(STYLE_ID19)) return;
133990
134747
  const tag = document.createElement("style");
133991
- tag.id = STYLE_ID18;
134748
+ tag.id = STYLE_ID19;
133992
134749
  tag.textContent = CSS4;
133993
134750
  document.head.appendChild(tag);
133994
134751
  }
@@ -136838,7 +137595,7 @@ var WATER_FIXTURES = {
136838
137595
  var DEFAULT_FIXTURES = ENERGY_FIXTURES;
136839
137596
 
136840
137597
  // src/components/metas-guide/openMetasGuide.ts
136841
- var STYLE_ID19 = "myio-metas-guide-styles";
137598
+ var STYLE_ID20 = "myio-metas-guide-styles";
136842
137599
  var ROOT_ID = "myio-metas-guide-root";
136843
137600
  var FALLBACK_THEME = {
136844
137601
  accent: "#6c5ce7",
@@ -136846,7 +137603,7 @@ var FALLBACK_THEME = {
136846
137603
  accentText: "#ffffff",
136847
137604
  mode: "light"
136848
137605
  };
136849
- function escapeHtml17(value) {
137606
+ function escapeHtml19(value) {
136850
137607
  return String(value ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
136851
137608
  }
136852
137609
  var nfInt = new Intl.NumberFormat("pt-BR", { maximumFractionDigits: 0 });
@@ -136874,7 +137631,7 @@ function legendHtml() {
136874
137631
  [SERIES_COLORS.orcado, "Or\xE7ado"]
136875
137632
  ];
136876
137633
  return `<div class="myio-mg-legend">${items.map(
136877
- ([c, l]) => `<span class="myio-mg-legend__item"><span class="myio-mg-legend__dot" style="background:${c}" aria-hidden="true"></span>${escapeHtml17(
137634
+ ([c, l]) => `<span class="myio-mg-legend__item"><span class="myio-mg-legend__dot" style="background:${c}" aria-hidden="true"></span>${escapeHtml19(
136878
137635
  l
136879
137636
  )}</span>`
136880
137637
  ).join("")}</div>`;
@@ -136914,7 +137671,7 @@ function miniChartSvg(s) {
136914
137671
  const pts = data.map((v, i) => `${(i * bandW + bandW / 2).toFixed(1)},${y(v).toFixed(1)}`).join(" ");
136915
137672
  return `<polyline points="${pts}" fill="none" stroke="${color}" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></polyline>`;
136916
137673
  };
136917
- return `<svg class="myio-mg-chart" viewBox="0 0 ${W} ${H}" role="img" aria-label="Gr\xE1fico ilustrativo de ${escapeHtml17(
137674
+ return `<svg class="myio-mg-chart" viewBox="0 0 ${W} ${H}" role="img" aria-label="Gr\xE1fico ilustrativo de ${escapeHtml19(
136918
137675
  s.name
136919
137676
  )}" preserveAspectRatio="none">
136920
137677
  ${bars}
@@ -136931,8 +137688,8 @@ function kpiRowHtml(s, unit) {
136931
137688
  ];
136932
137689
  return `<div class="myio-mg-kpis">${kpis.map(
136933
137690
  ([label, val, color]) => `<div class="myio-mg-kpi">
136934
- <span class="myio-mg-kpi__label" style="color:${color}">${escapeHtml17(label)}</span>
136935
- <span class="myio-mg-kpi__value">${fmtInt(val)} <small>${escapeHtml17(unit)}</small></span>
137691
+ <span class="myio-mg-kpi__label" style="color:${color}">${escapeHtml19(label)}</span>
137692
+ <span class="myio-mg-kpi__value">${fmtInt(val)} <small>${escapeHtml19(unit)}</small></span>
136936
137693
  </div>`
136937
137694
  ).join("")}</div>`;
136938
137695
  }
@@ -136940,7 +137697,7 @@ function chipsHtml(s) {
136940
137697
  const c = computeChips(s);
136941
137698
  const chip = (label, ratio) => {
136942
137699
  const cls = ratio > 0 ? "is-up" : ratio < 0 ? "is-down" : "is-flat";
136943
- return `<span class="myio-mg-chip ${cls}">${escapeHtml17(label)} <strong>${escapeHtml17(
137700
+ return `<span class="myio-mg-chip ${cls}">${escapeHtml19(label)} <strong>${escapeHtml19(
136944
137701
  fmtPct4(ratio)
136945
137702
  )}</strong></span>`;
136946
137703
  };
@@ -136955,7 +137712,7 @@ function miniCardHtml(s, unit, opts) {
136955
137712
  const showKpis = opts?.kpis !== false;
136956
137713
  const showChips = opts?.chips !== false;
136957
137714
  return `<div class="myio-mg-card">
136958
- <h5 class="myio-mg-card__title">${escapeHtml17(s.name)}</h5>
137715
+ <h5 class="myio-mg-card__title">${escapeHtml19(s.name)}</h5>
136959
137716
  ${showChart ? legendHtml() + miniChartSvg(s) : ""}
136960
137717
  ${showKpis ? kpiRowHtml(s, unit) : ""}
136961
137718
  ${showChips ? chipsHtml(s) : ""}
@@ -136965,7 +137722,7 @@ function miniSidebarHtml(shoppings, unit, prevY, curY) {
136965
137722
  const total = deriveTotal({ shoppings });
136966
137723
  const row = (name, a, r, o, m, isTotal) => `
136967
137724
  <div class="myio-mg-side__row${isTotal ? " is-total" : ""}">
136968
- <span class="myio-mg-side__name">${escapeHtml17(name)}</span>
137725
+ <span class="myio-mg-side__name">${escapeHtml19(name)}</span>
136969
137726
  <span class="myio-mg-side__vals">
136970
137727
  <b style="color:${SERIES_COLORS.aMinus1}">${fmtInt(a)}</b>
136971
137728
  <b style="color:${SERIES_COLORS.realizado}">${fmtInt(r)}</b>
@@ -136976,7 +137733,7 @@ function miniSidebarHtml(shoppings, unit, prevY, curY) {
136976
137733
  return `<div class="myio-mg-side">
136977
137734
  <div class="myio-mg-side__head">
136978
137735
  <span>Resumo por shopping</span>
136979
- <span class="myio-mg-side__unit">${escapeHtml17(unit)}</span>
137736
+ <span class="myio-mg-side__unit">${escapeHtml19(unit)}</span>
136980
137737
  </div>
136981
137738
  <div class="myio-mg-side__cols">
136982
137739
  <span>Shopping</span>
@@ -137003,10 +137760,10 @@ function miniToolbarHtml(prevY, curY, highlight) {
137003
137760
  </div>`;
137004
137761
  }
137005
137762
  function bannerHtml(text2) {
137006
- return `<p class="myio-mg-banner">${escapeHtml17(text2)}</p>`;
137763
+ return `<p class="myio-mg-banner">${escapeHtml19(text2)}</p>`;
137007
137764
  }
137008
137765
  function paras(sentences) {
137009
- return `<div class="myio-mg-copy">${sentences.map((s) => `<p>${escapeHtml17(s)}</p>`).join("")}</div>`;
137766
+ return `<div class="myio-mg-copy">${sentences.map((s) => `<p>${escapeHtml19(s)}</p>`).join("")}</div>`;
137010
137767
  }
137011
137768
  function buildSections(ctx) {
137012
137769
  const { energy, water, curY, prevY } = ctx;
@@ -137031,8 +137788,8 @@ function buildSections(ctx) {
137031
137788
  "A r\xE9gua da meta muda por dom\xEDnio: em Energia a refer\xEAncia \xE9 a ENTRADA; em \xC1gua, os hidr\xF4metros.",
137032
137789
  "Os n\xFAmeros e a unidade de cada card acompanham o dom\xEDnio selecionado."
137033
137790
  ]) + miniToolbarHtml(prevY, curY, "domain") + `<div class="myio-mg-two">
137034
- <div><div class="myio-mg-two__tag">\u26A1 Energia \xB7 ${escapeHtml17(energy.unit)}</div>${miniCardHtml(e0, energy.unit, { chips: false })}</div>
137035
- <div><div class="myio-mg-two__tag">\u{1F4A7} \xC1gua \xB7 ${escapeHtml17(water.unit)}</div>${miniCardHtml(w0, water.unit, { chips: false })}</div>
137791
+ <div><div class="myio-mg-two__tag">\u26A1 Energia \xB7 ${escapeHtml19(energy.unit)}</div>${miniCardHtml(e0, energy.unit, { chips: false })}</div>
137792
+ <div><div class="myio-mg-two__tag">\u{1F4A7} \xC1gua \xB7 ${escapeHtml19(water.unit)}</div>${miniCardHtml(w0, water.unit, { chips: false })}</div>
137036
137793
  </div>`
137037
137794
  },
137038
137795
  {
@@ -137103,7 +137860,7 @@ function buildSections(ctx) {
137103
137860
  ]) + `<div class="myio-mg-order">
137104
137861
  <span class="myio-mg-order__btn">Data de Inaugura\xE7\xE3o \u2191 \xB7 \u2699\uFE0F</span>
137105
137862
  <span class="myio-mg-order__btn">\u25BD Filtros</span>
137106
- </div><ul class="myio-mg-order__list">${energy.shoppings.slice().sort((a, b) => a.inaugurationDate.localeCompare(b.inaugurationDate)).map((s) => `<li><b>${escapeHtml17(s.name)}</b> <span>inaugurado em ${escapeHtml17(s.inaugurationDate)}</span></li>`).join("")}</ul>`
137863
+ </div><ul class="myio-mg-order__list">${energy.shoppings.slice().sort((a, b) => a.inaugurationDate.localeCompare(b.inaugurationDate)).map((s) => `<li><b>${escapeHtml19(s.name)}</b> <span>inaugurado em ${escapeHtml19(s.inaugurationDate)}</span></li>`).join("")}</ul>`
137107
137864
  },
137108
137865
  {
137109
137866
  id: "engine",
@@ -137132,9 +137889,9 @@ function buildSections(ctx) {
137132
137889
  ];
137133
137890
  }
137134
137891
  function injectStyles19() {
137135
- if (document.getElementById(STYLE_ID19)) return;
137892
+ if (document.getElementById(STYLE_ID20)) return;
137136
137893
  const style = document.createElement("style");
137137
- style.id = STYLE_ID19;
137894
+ style.id = STYLE_ID20;
137138
137895
  style.textContent = `
137139
137896
  #${ROOT_ID}{position:fixed;inset:0;z-index:100001;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(15,23,42,.6);backdrop-filter:blur(4px);font-family:'Nunito',system-ui,sans-serif;}
137140
137897
  #${ROOT_ID} *{box-sizing:border-box;}
@@ -137242,9 +137999,9 @@ function openMetasGuide(options = {}) {
137242
137999
  root.innerHTML = `
137243
138000
  <div class="myio-mg-modal${theme.mode === "dark" ? " is-dark" : ""}" role="dialog" aria-modal="true"
137244
138001
  aria-labelledby="myio-mg-title"
137245
- style="--mg-accent:${escapeHtml17(theme.accent)};--mg-accent-dark:${escapeHtml17(
138002
+ style="--mg-accent:${escapeHtml19(theme.accent)};--mg-accent-dark:${escapeHtml19(
137246
138003
  theme.accentDark
137247
- )};--mg-accent-text:${escapeHtml17(theme.accentText)};">
138004
+ )};--mg-accent-text:${escapeHtml19(theme.accentText)};">
137248
138005
  <div class="myio-mg-header">
137249
138006
  <div class="myio-mg-header__l">
137250
138007
  <span class="myio-mg-header__logo" aria-hidden="true">\u{1F393}</span>
@@ -155340,8 +156097,8 @@ function renderDowntimeList(downtimeList) {
155340
156097
  <div class="downtime-item">
155341
156098
  <span class="rank">${index + 1}</span>
155342
156099
  <div class="item-info">
155343
- <span class="item-name">${escapeHtml18(item.name)}</span>
155344
- <span class="item-location">${escapeHtml18(item.location)}</span>
156100
+ <span class="item-name">${escapeHtml20(item.name)}</span>
156101
+ <span class="item-location">${escapeHtml20(item.location)}</span>
155345
156102
  </div>
155346
156103
  <div class="item-metrics">
155347
156104
  <span class="downtime-hours">${item.downtime}h</span>
@@ -155354,7 +156111,7 @@ function renderDowntimeList(downtimeList) {
155354
156111
  `
155355
156112
  ).join("");
155356
156113
  }
155357
- function escapeHtml18(text2) {
156114
+ function escapeHtml20(text2) {
155358
156115
  const div = document.createElement("div");
155359
156116
  div.textContent = text2;
155360
156117
  return div.innerHTML;
@@ -159937,7 +160694,7 @@ function removeSchedulingSharedStyles() {
159937
160694
  }
159938
160695
 
159939
160696
  // src/components/scheduling-shared/view-helpers.ts
159940
- function escapeHtml19(str) {
160697
+ function escapeHtml21(str) {
159941
160698
  const div = document.createElement("div");
159942
160699
  div.textContent = str;
159943
160700
  return div.innerHTML;
@@ -160098,7 +160855,7 @@ function showConfirmModal(container, title, message) {
160098
160855
  overlay.innerHTML = `
160099
160856
  <div class="${SCHED_CSS_PREFIX}__modal-backdrop"></div>
160100
160857
  <div class="${SCHED_CSS_PREFIX}__modal-content">
160101
- <h3>${escapeHtml19(title)}</h3>
160858
+ <h3>${escapeHtml21(title)}</h3>
160102
160859
  <p>${message}</p>
160103
160860
  <div class="${SCHED_CSS_PREFIX}__modal-actions">
160104
160861
  <button class="${SCHED_CSS_PREFIX}__modal-btn-cancel">Cancelar</button>
@@ -160132,8 +160889,8 @@ function showNotificationModal(container, type, message, autoCloseMs = 6e3) {
160132
160889
  overlay.innerHTML = `
160133
160890
  <div class="${SCHED_CSS_PREFIX}__modal-backdrop"></div>
160134
160891
  <div class="${SCHED_CSS_PREFIX}__modal-content">
160135
- <h3>${escapeHtml19(title)}</h3>
160136
- <p>${escapeHtml19(message)}</p>
160892
+ <h3>${escapeHtml21(title)}</h3>
160893
+ <p>${escapeHtml21(message)}</p>
160137
160894
  <div class="${SCHED_CSS_PREFIX}__modal-actions">
160138
160895
  <button class="${SCHED_CSS_PREFIX}__modal-btn-close">Fechar</button>
160139
160896
  </div>
@@ -166340,7 +167097,7 @@ function injectAmbienteModalStyles() {
166340
167097
  }
166341
167098
 
166342
167099
  // src/components/ambiente-detail-modal/AmbienteDetailModal.ts
166343
- var MODAL_ID4 = "ambiente-detail";
167100
+ var MODAL_ID5 = "ambiente-detail";
166344
167101
  function formatTemperature3(value) {
166345
167102
  if (value === null || value === void 0 || isNaN(value)) return "-";
166346
167103
  return value.toLocaleString("pt-BR", {
@@ -166581,7 +167338,7 @@ function renderModalHTML(data, source, config2) {
166581
167338
  const headerHTML = ModalHeader.generateHTML({
166582
167339
  icon: "\u{1F3E2}",
166583
167340
  title: data.label,
166584
- modalId: MODAL_ID4,
167341
+ modalId: MODAL_ID5,
166585
167342
  theme: config2.themeMode || "dark",
166586
167343
  isMaximized: false,
166587
167344
  showThemeToggle: false,
@@ -166630,7 +167387,7 @@ function createAmbienteDetailModal(data, source, config2 = {}) {
166630
167387
  }
166631
167388
  });
166632
167389
  ModalHeader.setupHandlers({
166633
- modalId: MODAL_ID4,
167390
+ modalId: MODAL_ID5,
166634
167391
  onClose: close
166635
167392
  });
166636
167393
  footerCloseBtn?.addEventListener("click", close);
@@ -169932,9 +170689,9 @@ var GCDRSyncController = class {
169932
170689
  var TEAL = "#0a6d5e";
169933
170690
  var TEAL_DARK = "#084f44";
169934
170691
  var TEAL_LIGHT = "#0d8570";
169935
- var MODAL_ID5 = "myio-gcdr-sync-modal";
170692
+ var MODAL_ID6 = "myio-gcdr-sync-modal";
169936
170693
  var STYLES2 = `
169937
- #${MODAL_ID5} {
170694
+ #${MODAL_ID6} {
169938
170695
  position: fixed;
169939
170696
  inset: 0;
169940
170697
  background: rgba(0, 0, 0, 0.60);
@@ -169946,7 +170703,7 @@ var STYLES2 = `
169946
170703
  justify-content: center;
169947
170704
  font-family: 'Nunito', system-ui, sans-serif;
169948
170705
  }
169949
- #${MODAL_ID5} .gcdr-card {
170706
+ #${MODAL_ID6} .gcdr-card {
169950
170707
  background: #fff;
169951
170708
  color: #1a1a1a;
169952
170709
  border-radius: 16px;
@@ -169957,7 +170714,7 @@ var STYLES2 = `
169957
170714
  flex-direction: column;
169958
170715
  overflow: hidden;
169959
170716
  }
169960
- #${MODAL_ID5} .gcdr-header {
170717
+ #${MODAL_ID6} .gcdr-header {
169961
170718
  background: ${TEAL};
169962
170719
  color: #fff;
169963
170720
  padding: 20px 24px 16px;
@@ -169966,25 +170723,25 @@ var STYLES2 = `
169966
170723
  gap: 12px;
169967
170724
  flex-shrink: 0;
169968
170725
  }
169969
- #${MODAL_ID5} .gcdr-header-icon {
170726
+ #${MODAL_ID6} .gcdr-header-icon {
169970
170727
  font-size: 24px;
169971
170728
  flex-shrink: 0;
169972
170729
  }
169973
- #${MODAL_ID5} .gcdr-header-text {
170730
+ #${MODAL_ID6} .gcdr-header-text {
169974
170731
  flex: 1;
169975
170732
  }
169976
- #${MODAL_ID5} .gcdr-header-title {
170733
+ #${MODAL_ID6} .gcdr-header-title {
169977
170734
  font-size: 18px;
169978
170735
  font-weight: 700;
169979
170736
  line-height: 1.2;
169980
170737
  margin: 0;
169981
170738
  }
169982
- #${MODAL_ID5} .gcdr-header-sub {
170739
+ #${MODAL_ID6} .gcdr-header-sub {
169983
170740
  font-size: 13px;
169984
170741
  opacity: 0.80;
169985
170742
  margin: 4px 0 0;
169986
170743
  }
169987
- #${MODAL_ID5} .gcdr-close-btn {
170744
+ #${MODAL_ID6} .gcdr-close-btn {
169988
170745
  background: none;
169989
170746
  border: none;
169990
170747
  color: #fff;
@@ -169997,13 +170754,13 @@ var STYLES2 = `
169997
170754
  transition: opacity 0.15s;
169998
170755
  flex-shrink: 0;
169999
170756
  }
170000
- #${MODAL_ID5} .gcdr-close-btn:hover { opacity: 1; }
170001
- #${MODAL_ID5} .gcdr-body {
170757
+ #${MODAL_ID6} .gcdr-close-btn:hover { opacity: 1; }
170758
+ #${MODAL_ID6} .gcdr-body {
170002
170759
  padding: 24px;
170003
170760
  overflow-y: auto;
170004
170761
  flex: 1;
170005
170762
  }
170006
- #${MODAL_ID5} .gcdr-footer {
170763
+ #${MODAL_ID6} .gcdr-footer {
170007
170764
  padding: 16px 24px;
170008
170765
  border-top: 1px solid #e8ecef;
170009
170766
  display: flex;
@@ -170011,7 +170768,7 @@ var STYLES2 = `
170011
170768
  justify-content: flex-end;
170012
170769
  flex-shrink: 0;
170013
170770
  }
170014
- #${MODAL_ID5} .gcdr-btn {
170771
+ #${MODAL_ID6} .gcdr-btn {
170015
170772
  padding: 10px 20px;
170016
170773
  border-radius: 8px;
170017
170774
  font-size: 14px;
@@ -170023,53 +170780,53 @@ var STYLES2 = `
170023
170780
  align-items: center;
170024
170781
  gap: 6px;
170025
170782
  }
170026
- #${MODAL_ID5} .gcdr-btn:active { transform: scale(0.97); }
170027
- #${MODAL_ID5} .gcdr-btn-primary {
170783
+ #${MODAL_ID6} .gcdr-btn:active { transform: scale(0.97); }
170784
+ #${MODAL_ID6} .gcdr-btn-primary {
170028
170785
  background: ${TEAL};
170029
170786
  color: #fff;
170030
170787
  }
170031
- #${MODAL_ID5} .gcdr-btn-primary:hover { background: ${TEAL_LIGHT}; }
170032
- #${MODAL_ID5} .gcdr-btn-secondary {
170788
+ #${MODAL_ID6} .gcdr-btn-primary:hover { background: ${TEAL_LIGHT}; }
170789
+ #${MODAL_ID6} .gcdr-btn-secondary {
170033
170790
  background: #f0f4f3;
170034
170791
  color: ${TEAL_DARK};
170035
170792
  border: 1px solid #d0dbd9;
170036
170793
  }
170037
- #${MODAL_ID5} .gcdr-btn-secondary:hover { background: #e0ecea; }
170038
- #${MODAL_ID5} .gcdr-btn-danger {
170794
+ #${MODAL_ID6} .gcdr-btn-secondary:hover { background: #e0ecea; }
170795
+ #${MODAL_ID6} .gcdr-btn-danger {
170039
170796
  background: #d32f2f;
170040
170797
  color: #fff;
170041
170798
  }
170042
- #${MODAL_ID5} .gcdr-btn-danger:hover { background: #b71c1c; }
170043
- #${MODAL_ID5} .gcdr-counts {
170799
+ #${MODAL_ID6} .gcdr-btn-danger:hover { background: #b71c1c; }
170800
+ #${MODAL_ID6} .gcdr-counts {
170044
170801
  display: grid;
170045
170802
  grid-template-columns: repeat(3, 1fr);
170046
170803
  gap: 12px;
170047
170804
  margin-bottom: 20px;
170048
170805
  }
170049
- #${MODAL_ID5} .gcdr-count-card {
170806
+ #${MODAL_ID6} .gcdr-count-card {
170050
170807
  background: #f8faf9;
170051
170808
  border: 1px solid #e0eceb;
170052
170809
  border-radius: 10px;
170053
170810
  padding: 14px 12px;
170054
170811
  text-align: center;
170055
170812
  }
170056
- #${MODAL_ID5} .gcdr-count-num {
170813
+ #${MODAL_ID6} .gcdr-count-num {
170057
170814
  font-size: 28px;
170058
170815
  font-weight: 700;
170059
170816
  line-height: 1;
170060
170817
  margin-bottom: 4px;
170061
170818
  }
170062
- #${MODAL_ID5} .gcdr-count-label {
170819
+ #${MODAL_ID6} .gcdr-count-label {
170063
170820
  font-size: 12px;
170064
170821
  color: #666;
170065
170822
  text-transform: uppercase;
170066
170823
  letter-spacing: 0.04em;
170067
170824
  }
170068
- #${MODAL_ID5} .gcdr-count-create { color: ${TEAL}; }
170069
- #${MODAL_ID5} .gcdr-count-update { color: #e67e00; }
170070
- #${MODAL_ID5} .gcdr-count-skip { color: #888; }
170071
- #${MODAL_ID5} .gcdr-count-recreate { color: #9c27b0; }
170072
- #${MODAL_ID5} .gcdr-info-box {
170825
+ #${MODAL_ID6} .gcdr-count-create { color: ${TEAL}; }
170826
+ #${MODAL_ID6} .gcdr-count-update { color: #e67e00; }
170827
+ #${MODAL_ID6} .gcdr-count-skip { color: #888; }
170828
+ #${MODAL_ID6} .gcdr-count-recreate { color: #9c27b0; }
170829
+ #${MODAL_ID6} .gcdr-info-box {
170073
170830
  background: #f0f9f7;
170074
170831
  border: 1px solid #c3e6e2;
170075
170832
  border-radius: 8px;
@@ -170078,7 +170835,7 @@ var STYLES2 = `
170078
170835
  color: #1a4a45;
170079
170836
  line-height: 1.5;
170080
170837
  }
170081
- #${MODAL_ID5} .gcdr-error-box {
170838
+ #${MODAL_ID6} .gcdr-error-box {
170082
170839
  background: #fff0f0;
170083
170840
  border: 1px solid #ffb3b3;
170084
170841
  border-radius: 8px;
@@ -170090,7 +170847,7 @@ var STYLES2 = `
170090
170847
  gap: 10px;
170091
170848
  align-items: flex-start;
170092
170849
  }
170093
- #${MODAL_ID5} .gcdr-section-title {
170850
+ #${MODAL_ID6} .gcdr-section-title {
170094
170851
  font-size: 14px;
170095
170852
  font-weight: 600;
170096
170853
  color: #333;
@@ -170099,7 +170856,7 @@ var STYLES2 = `
170099
170856
  align-items: center;
170100
170857
  gap: 6px;
170101
170858
  }
170102
- #${MODAL_ID5} .gcdr-action-list {
170859
+ #${MODAL_ID6} .gcdr-action-list {
170103
170860
  list-style: none;
170104
170861
  margin: 0 0 12px;
170105
170862
  padding: 0;
@@ -170108,7 +170865,7 @@ var STYLES2 = `
170108
170865
  border: 1px solid #e8ecef;
170109
170866
  border-radius: 8px;
170110
170867
  }
170111
- #${MODAL_ID5} .gcdr-action-item {
170868
+ #${MODAL_ID6} .gcdr-action-item {
170112
170869
  padding: 8px 12px;
170113
170870
  display: flex;
170114
170871
  align-items: center;
@@ -170116,8 +170873,8 @@ var STYLES2 = `
170116
170873
  font-size: 13px;
170117
170874
  border-bottom: 1px solid #f0f4f3;
170118
170875
  }
170119
- #${MODAL_ID5} .gcdr-action-item:last-child { border-bottom: none; }
170120
- #${MODAL_ID5} .gcdr-badge {
170876
+ #${MODAL_ID6} .gcdr-action-item:last-child { border-bottom: none; }
170877
+ #${MODAL_ID6} .gcdr-badge {
170121
170878
  padding: 2px 7px;
170122
170879
  border-radius: 4px;
170123
170880
  font-size: 10px;
@@ -170126,10 +170883,10 @@ var STYLES2 = `
170126
170883
  letter-spacing: 0.05em;
170127
170884
  flex-shrink: 0;
170128
170885
  }
170129
- #${MODAL_ID5} .gcdr-badge-create { background: #e6f4f1; color: ${TEAL_DARK}; }
170130
- #${MODAL_ID5} .gcdr-badge-update { background: #fff3e0; color: #e67e00; }
170131
- #${MODAL_ID5} .gcdr-badge-recreate { background: #f3e5f5; color: #7b1fa2; }
170132
- #${MODAL_ID5} .gcdr-progress-overlay {
170886
+ #${MODAL_ID6} .gcdr-badge-create { background: #e6f4f1; color: ${TEAL_DARK}; }
170887
+ #${MODAL_ID6} .gcdr-badge-update { background: #fff3e0; color: #e67e00; }
170888
+ #${MODAL_ID6} .gcdr-badge-recreate { background: #f3e5f5; color: #7b1fa2; }
170889
+ #${MODAL_ID6} .gcdr-progress-overlay {
170133
170890
  position: absolute;
170134
170891
  inset: 0;
170135
170892
  background: rgba(255,255,255,0.92);
@@ -170143,17 +170900,17 @@ var STYLES2 = `
170143
170900
  text-align: center;
170144
170901
  z-index: 10;
170145
170902
  }
170146
- #${MODAL_ID5} .gcdr-progress-title {
170903
+ #${MODAL_ID6} .gcdr-progress-title {
170147
170904
  font-size: 16px;
170148
170905
  font-weight: 600;
170149
170906
  color: ${TEAL_DARK};
170150
170907
  }
170151
- #${MODAL_ID5} .gcdr-progress-entity {
170908
+ #${MODAL_ID6} .gcdr-progress-entity {
170152
170909
  font-size: 13px;
170153
170910
  color: #555;
170154
170911
  min-height: 20px;
170155
170912
  }
170156
- #${MODAL_ID5} .gcdr-progress-bar-wrap {
170913
+ #${MODAL_ID6} .gcdr-progress-bar-wrap {
170157
170914
  width: 100%;
170158
170915
  max-width: 360px;
170159
170916
  background: #e0ece9;
@@ -170161,46 +170918,46 @@ var STYLES2 = `
170161
170918
  height: 8px;
170162
170919
  overflow: hidden;
170163
170920
  }
170164
- #${MODAL_ID5} .gcdr-progress-bar {
170921
+ #${MODAL_ID6} .gcdr-progress-bar {
170165
170922
  height: 100%;
170166
170923
  background: ${TEAL};
170167
170924
  border-radius: 99px;
170168
170925
  transition: width 0.3s ease;
170169
170926
  width: 0%;
170170
170927
  }
170171
- #${MODAL_ID5} .gcdr-progress-counter {
170928
+ #${MODAL_ID6} .gcdr-progress-counter {
170172
170929
  font-size: 12px;
170173
170930
  color: #888;
170174
170931
  }
170175
- #${MODAL_ID5} .gcdr-result-counts {
170932
+ #${MODAL_ID6} .gcdr-result-counts {
170176
170933
  display: grid;
170177
170934
  grid-template-columns: repeat(3, 1fr);
170178
170935
  gap: 12px;
170179
170936
  margin-bottom: 20px;
170180
170937
  }
170181
- #${MODAL_ID5} .gcdr-result-card {
170938
+ #${MODAL_ID6} .gcdr-result-card {
170182
170939
  background: #f8faf9;
170183
170940
  border: 1px solid #e0eceb;
170184
170941
  border-radius: 10px;
170185
170942
  padding: 14px 12px;
170186
170943
  text-align: center;
170187
170944
  }
170188
- #${MODAL_ID5} .gcdr-result-num {
170945
+ #${MODAL_ID6} .gcdr-result-num {
170189
170946
  font-size: 28px;
170190
170947
  font-weight: 700;
170191
170948
  line-height: 1;
170192
170949
  margin-bottom: 4px;
170193
170950
  }
170194
- #${MODAL_ID5} .gcdr-result-label {
170951
+ #${MODAL_ID6} .gcdr-result-label {
170195
170952
  font-size: 12px;
170196
170953
  color: #666;
170197
170954
  text-transform: uppercase;
170198
170955
  letter-spacing: 0.04em;
170199
170956
  }
170200
- #${MODAL_ID5} .gcdr-result-ok { color: ${TEAL}; }
170201
- #${MODAL_ID5} .gcdr-result-fail { color: #d32f2f; }
170202
- #${MODAL_ID5} .gcdr-result-skip { color: #888; }
170203
- #${MODAL_ID5} .gcdr-fail-list {
170957
+ #${MODAL_ID6} .gcdr-result-ok { color: ${TEAL}; }
170958
+ #${MODAL_ID6} .gcdr-result-fail { color: #d32f2f; }
170959
+ #${MODAL_ID6} .gcdr-result-skip { color: #888; }
170960
+ #${MODAL_ID6} .gcdr-fail-list {
170204
170961
  background: #fff5f5;
170205
170962
  border: 1px solid #ffcdd2;
170206
170963
  border-radius: 8px;
@@ -170208,23 +170965,23 @@ var STYLES2 = `
170208
170965
  max-height: 160px;
170209
170966
  overflow-y: auto;
170210
170967
  }
170211
- #${MODAL_ID5} .gcdr-fail-item {
170968
+ #${MODAL_ID6} .gcdr-fail-item {
170212
170969
  font-size: 12px;
170213
170970
  color: #b71c1c;
170214
170971
  padding: 4px 0;
170215
170972
  border-bottom: 1px solid #ffebee;
170216
170973
  }
170217
- #${MODAL_ID5} .gcdr-fail-item:last-child { border-bottom: none; }
170974
+ #${MODAL_ID6} .gcdr-fail-item:last-child { border-bottom: none; }
170218
170975
  `;
170219
170976
  function injectStyles23() {
170220
- if (document.getElementById(`${MODAL_ID5}-styles`)) return;
170977
+ if (document.getElementById(`${MODAL_ID6}-styles`)) return;
170221
170978
  const style = document.createElement("style");
170222
- style.id = `${MODAL_ID5}-styles`;
170979
+ style.id = `${MODAL_ID6}-styles`;
170223
170980
  style.textContent = STYLES2;
170224
170981
  document.head.appendChild(style);
170225
170982
  }
170226
170983
  function removeExistingModal() {
170227
- const existing = document.getElementById(MODAL_ID5);
170984
+ const existing = document.getElementById(MODAL_ID6);
170228
170985
  existing?.remove();
170229
170986
  }
170230
170987
  function badgeHtml(type) {
@@ -170336,7 +171093,7 @@ async function openGCDRSyncModal(params) {
170336
171093
  return;
170337
171094
  }
170338
171095
  const overlay = document.createElement("div");
170339
- overlay.id = MODAL_ID5;
171096
+ overlay.id = MODAL_ID6;
170340
171097
  const card = document.createElement("div");
170341
171098
  card.className = "gcdr-card";
170342
171099
  card.style.position = "relative";
@@ -170566,13 +171323,13 @@ async function openGCDRSyncModal(params) {
170566
171323
  }
170567
171324
 
170568
171325
  // src/components/premium-modals/alarm-bundle-map/openAlarmBundleMapModal.ts
170569
- var MODAL_ID6 = "myio-alarm-bundle-map-modal";
171326
+ var MODAL_ID7 = "myio-alarm-bundle-map-modal";
170570
171327
  var GCDR_INTEGRATION_API_KEY = "gcdr_cust_tb_integration_key_2026";
170571
171328
  var TEAL2 = "#0a6d5e";
170572
171329
  var TEAL_DARK2 = "#084f44";
170573
171330
  var TEAL_LIGHT2 = "#0d8570";
170574
171331
  var STYLES3 = `
170575
- #${MODAL_ID6} {
171332
+ #${MODAL_ID7} {
170576
171333
  position: fixed;
170577
171334
  inset: 0;
170578
171335
  background: rgba(0, 0, 0, 0.60);
@@ -170584,7 +171341,7 @@ var STYLES3 = `
170584
171341
  justify-content: center;
170585
171342
  font-family: 'Nunito', system-ui, sans-serif;
170586
171343
  }
170587
- #${MODAL_ID6} .abm-card {
171344
+ #${MODAL_ID7} .abm-card {
170588
171345
  background: #fff;
170589
171346
  color: #1a1a1a;
170590
171347
  border-radius: 16px;
@@ -170595,12 +171352,12 @@ var STYLES3 = `
170595
171352
  flex-direction: column;
170596
171353
  overflow: hidden;
170597
171354
  }
170598
- #${MODAL_ID6} .abm-card.is-maximized {
171355
+ #${MODAL_ID7} .abm-card.is-maximized {
170599
171356
  width: 100vw !important; max-width: 100vw !important;
170600
171357
  height: 100vh !important; max-height: 100vh !important; border-radius: 0;
170601
171358
  }
170602
- #${MODAL_ID6} .myio-premium-chrome-header .abm-view-toggle { margin-left: 0; margin-right: 6px; }
170603
- #${MODAL_ID6} .abm-header {
171359
+ #${MODAL_ID7} .myio-premium-chrome-header .abm-view-toggle { margin-left: 0; margin-right: 6px; }
171360
+ #${MODAL_ID7} .abm-header {
170604
171361
  background: ${TEAL2};
170605
171362
  color: #fff;
170606
171363
  padding: 18px 24px 14px;
@@ -170609,123 +171366,123 @@ var STYLES3 = `
170609
171366
  gap: 12px;
170610
171367
  flex-shrink: 0;
170611
171368
  }
170612
- #${MODAL_ID6} .abm-header-icon { font-size: 22px; flex-shrink: 0; }
170613
- #${MODAL_ID6} .abm-header-text { flex: 1; }
170614
- #${MODAL_ID6} .abm-header-title {
171369
+ #${MODAL_ID7} .abm-header-icon { font-size: 22px; flex-shrink: 0; }
171370
+ #${MODAL_ID7} .abm-header-text { flex: 1; }
171371
+ #${MODAL_ID7} .abm-header-title {
170615
171372
  font-size: 17px; font-weight: 700; line-height: 1.2; margin: 0;
170616
171373
  }
170617
- #${MODAL_ID6} .abm-header-sub {
171374
+ #${MODAL_ID7} .abm-header-sub {
170618
171375
  font-size: 12px; opacity: 0.80; margin: 3px 0 0;
170619
171376
  }
170620
- #${MODAL_ID6} .abm-close-btn {
171377
+ #${MODAL_ID7} .abm-close-btn {
170621
171378
  background: none; border: none; color: #fff;
170622
171379
  font-size: 20px; cursor: pointer; padding: 4px 8px;
170623
171380
  border-radius: 6px; line-height: 1; opacity: 0.80; transition: opacity 0.15s; flex-shrink: 0;
170624
171381
  }
170625
- #${MODAL_ID6} .abm-close-btn:hover { opacity: 1; }
170626
- #${MODAL_ID6} .abm-body {
171382
+ #${MODAL_ID7} .abm-close-btn:hover { opacity: 1; }
171383
+ #${MODAL_ID7} .abm-body {
170627
171384
  padding: 20px 24px; overflow-y: auto; flex: 1;
170628
171385
  }
170629
- #${MODAL_ID6} .abm-footer {
171386
+ #${MODAL_ID7} .abm-footer {
170630
171387
  padding: 14px 24px; border-top: 1px solid #e8ecef;
170631
171388
  display: flex; gap: 12px; justify-content: flex-end; flex-shrink: 0;
170632
171389
  }
170633
- #${MODAL_ID6} .abm-btn {
171390
+ #${MODAL_ID7} .abm-btn {
170634
171391
  padding: 9px 18px; border-radius: 8px; font-size: 14px;
170635
171392
  font-weight: 600; cursor: pointer; border: none;
170636
171393
  transition: background 0.15s;
170637
171394
  display: inline-flex; align-items: center; gap: 6px;
170638
171395
  }
170639
- #${MODAL_ID6} .abm-btn-secondary {
171396
+ #${MODAL_ID7} .abm-btn-secondary {
170640
171397
  background: #f0f4f3; color: ${TEAL_DARK2}; border: 1px solid #d0dbd9;
170641
171398
  }
170642
- #${MODAL_ID6} .abm-btn-secondary:hover { background: #e0ecea; }
170643
- #${MODAL_ID6} .abm-error-box {
171399
+ #${MODAL_ID7} .abm-btn-secondary:hover { background: #e0ecea; }
171400
+ #${MODAL_ID7} .abm-error-box {
170644
171401
  background: #fff0f0; border: 1px solid #ffb3b3; border-radius: 8px;
170645
171402
  padding: 14px 16px; font-size: 14px; color: #b71c1c;
170646
171403
  line-height: 1.5; display: flex; gap: 10px; align-items: flex-start;
170647
171404
  }
170648
- #${MODAL_ID6} .abm-empty-box {
171405
+ #${MODAL_ID7} .abm-empty-box {
170649
171406
  background: #f0f9f7; border: 1px solid #c3e6e2; border-radius: 8px;
170650
171407
  padding: 16px; font-size: 14px; color: #1a4a45; line-height: 1.5;
170651
171408
  text-align: center;
170652
171409
  }
170653
- #${MODAL_ID6} .abm-loading {
171410
+ #${MODAL_ID7} .abm-loading {
170654
171411
  text-align: center; padding: 32px; color: #555; font-size: 14px;
170655
171412
  }
170656
- #${MODAL_ID6} .abm-summary-bar {
171413
+ #${MODAL_ID7} .abm-summary-bar {
170657
171414
  display: flex; gap: 20px; margin-bottom: 18px;
170658
171415
  padding: 12px 16px; background: #f8faf9;
170659
171416
  border: 1px solid #e0eceb; border-radius: 10px;
170660
171417
  }
170661
- #${MODAL_ID6} .abm-summary-item { text-align: center; flex: 1; }
170662
- #${MODAL_ID6} .abm-summary-num {
171418
+ #${MODAL_ID7} .abm-summary-item { text-align: center; flex: 1; }
171419
+ #${MODAL_ID7} .abm-summary-num {
170663
171420
  font-size: 22px; font-weight: 700; color: ${TEAL2}; line-height: 1;
170664
171421
  }
170665
- #${MODAL_ID6} .abm-summary-label {
171422
+ #${MODAL_ID7} .abm-summary-label {
170666
171423
  font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.04em;
170667
171424
  margin-top: 2px;
170668
171425
  }
170669
- #${MODAL_ID6} .abm-asset-group { margin-bottom: 16px; }
170670
- #${MODAL_ID6} .abm-asset-label {
171426
+ #${MODAL_ID7} .abm-asset-group { margin-bottom: 16px; }
171427
+ #${MODAL_ID7} .abm-asset-label {
170671
171428
  font-size: 11px; font-weight: 700; color: #888;
170672
171429
  text-transform: uppercase; letter-spacing: 0.07em;
170673
171430
  margin-bottom: 6px; padding-left: 2px;
170674
171431
  }
170675
- #${MODAL_ID6} .abm-device-card {
171432
+ #${MODAL_ID7} .abm-device-card {
170676
171433
  border: 1px solid #e0eceb; border-radius: 10px;
170677
171434
  margin-bottom: 8px; overflow: hidden;
170678
171435
  }
170679
- #${MODAL_ID6} .abm-device-header {
171436
+ #${MODAL_ID7} .abm-device-header {
170680
171437
  display: flex; align-items: center; gap: 10px;
170681
171438
  padding: 10px 14px; background: #f8faf9;
170682
171439
  border-bottom: 1px solid #e0eceb;
170683
171440
  }
170684
- #${MODAL_ID6} .abm-device-name {
171441
+ #${MODAL_ID7} .abm-device-name {
170685
171442
  flex: 1; font-size: 14px; font-weight: 600; color: #1a1a1a;
170686
171443
  }
170687
- #${MODAL_ID6} .abm-device-type {
171444
+ #${MODAL_ID7} .abm-device-type {
170688
171445
  font-size: 11px; font-weight: 600; padding: 2px 8px;
170689
171446
  border-radius: 4px; background: #e6f4f1; color: ${TEAL_DARK2};
170690
171447
  text-transform: uppercase; letter-spacing: 0.04em;
170691
171448
  }
170692
- #${MODAL_ID6} .abm-rule-list { padding: 0; list-style: none; margin: 0; }
170693
- #${MODAL_ID6} .abm-rule-item {
171449
+ #${MODAL_ID7} .abm-rule-list { padding: 0; list-style: none; margin: 0; }
171450
+ #${MODAL_ID7} .abm-rule-item {
170694
171451
  padding: 10px 14px; border-bottom: 1px solid #f0f4f3;
170695
171452
  font-size: 13px;
170696
171453
  }
170697
- #${MODAL_ID6} .abm-rule-item:last-child { border-bottom: none; }
170698
- #${MODAL_ID6} .abm-rule-name {
171454
+ #${MODAL_ID7} .abm-rule-item:last-child { border-bottom: none; }
171455
+ #${MODAL_ID7} .abm-rule-name {
170699
171456
  font-weight: 600; color: #333; margin-bottom: 4px;
170700
171457
  display: flex; align-items: center; gap: 6px;
170701
171458
  }
170702
- #${MODAL_ID6} .abm-rule-detail {
171459
+ #${MODAL_ID7} .abm-rule-detail {
170703
171460
  color: #555; line-height: 1.6;
170704
171461
  display: flex; flex-wrap: wrap; gap: 4px 12px;
170705
171462
  }
170706
- #${MODAL_ID6} .abm-rule-chip {
171463
+ #${MODAL_ID7} .abm-rule-chip {
170707
171464
  display: inline-flex; align-items: center; gap: 3px;
170708
171465
  font-size: 12px; background: #f0f4f3; border-radius: 4px;
170709
171466
  padding: 1px 7px; color: #444;
170710
171467
  }
170711
- #${MODAL_ID6} .abm-day-chip {
171468
+ #${MODAL_ID7} .abm-day-chip {
170712
171469
  font-size: 10px; font-weight: 700; padding: 1px 5px;
170713
171470
  border-radius: 3px; background: ${TEAL2}; color: #fff;
170714
171471
  }
170715
- #${MODAL_ID6} .abm-day-chip.off {
171472
+ #${MODAL_ID7} .abm-day-chip.off {
170716
171473
  background: #e8ecef; color: #aaa;
170717
171474
  }
170718
- #${MODAL_ID6} .abm-rule-name {
171475
+ #${MODAL_ID7} .abm-rule-name {
170719
171476
  justify-content: space-between;
170720
171477
  }
170721
- #${MODAL_ID6} .abm-edit-rule-btn {
171478
+ #${MODAL_ID7} .abm-edit-rule-btn {
170722
171479
  background: none; border: none; cursor: pointer;
170723
171480
  font-size: 13px; padding: 2px 5px; border-radius: 4px;
170724
171481
  color: #888; line-height: 1; transition: background 0.12s, color 0.12s;
170725
171482
  flex-shrink: 0;
170726
171483
  }
170727
- #${MODAL_ID6} .abm-edit-rule-btn:hover { background: #e6f4f1; color: ${TEAL2}; }
170728
- #${MODAL_ID6} .abm-edit-form {
171484
+ #${MODAL_ID7} .abm-edit-rule-btn:hover { background: #e6f4f1; color: ${TEAL2}; }
171485
+ #${MODAL_ID7} .abm-edit-form {
170729
171486
  margin-top: 8px; padding: 10px 12px;
170730
171487
  background: #f4fbf9; border: 1px solid #c3e6e2; border-radius: 8px;
170731
171488
  display: flex; flex-direction: column; gap: 10px;
@@ -170733,136 +171490,136 @@ var STYLES3 = `
170733
171490
  ele s\xF3 ocupava a largura do conte\xFAdo. For\xE7a ocupar a linha inteira. */
170734
171491
  flex: 1 1 100%; width: 100%; box-sizing: border-box;
170735
171492
  }
170736
- #${MODAL_ID6} .abm-ef-row {
171493
+ #${MODAL_ID7} .abm-ef-row {
170737
171494
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
170738
171495
  }
170739
- #${MODAL_ID6} .abm-ef-label {
171496
+ #${MODAL_ID7} .abm-ef-label {
170740
171497
  font-size: 11px; font-weight: 600; color: #555; min-width: 60px; flex-shrink: 0;
170741
171498
  }
170742
- #${MODAL_ID6} .abm-ef-input {
171499
+ #${MODAL_ID7} .abm-ef-input {
170743
171500
  border: 1px solid #b0d8d2; border-radius: 5px; padding: 4px 8px;
170744
171501
  font-size: 13px; color: #1a1a1a; background: #fff;
170745
171502
  outline: none; transition: border-color 0.15s;
170746
171503
  }
170747
- #${MODAL_ID6} .abm-ef-input:focus { border-color: ${TEAL2}; }
170748
- #${MODAL_ID6} .abm-ef-input--value { width: 80px; }
170749
- #${MODAL_ID6} .abm-ef-input--time { width: 88px; }
170750
- #${MODAL_ID6} .abm-ef-days { display: flex; gap: 4px; flex-wrap: wrap; }
170751
- #${MODAL_ID6} .abm-ef-day-btn {
171504
+ #${MODAL_ID7} .abm-ef-input:focus { border-color: ${TEAL2}; }
171505
+ #${MODAL_ID7} .abm-ef-input--value { width: 80px; }
171506
+ #${MODAL_ID7} .abm-ef-input--time { width: 88px; }
171507
+ #${MODAL_ID7} .abm-ef-days { display: flex; gap: 4px; flex-wrap: wrap; }
171508
+ #${MODAL_ID7} .abm-ef-day-btn {
170752
171509
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px;
170753
171510
  cursor: pointer; border: 1px solid #b0d8d2; background: #e8ecef; color: #aaa;
170754
171511
  transition: background 0.12s, color 0.12s;
170755
171512
  }
170756
- #${MODAL_ID6} .abm-ef-day-btn.on { background: ${TEAL2}; color: #fff; border-color: ${TEAL2}; }
170757
- #${MODAL_ID6} .abm-ef-actions { display: flex; gap: 8px; justify-content: flex-end; }
170758
- #${MODAL_ID6} .abm-ef-save-btn {
171513
+ #${MODAL_ID7} .abm-ef-day-btn.on { background: ${TEAL2}; color: #fff; border-color: ${TEAL2}; }
171514
+ #${MODAL_ID7} .abm-ef-actions { display: flex; gap: 8px; justify-content: flex-end; }
171515
+ #${MODAL_ID7} .abm-ef-save-btn {
170759
171516
  padding: 5px 14px; border-radius: 6px; font-size: 12px; font-weight: 700;
170760
171517
  cursor: pointer; border: none; background: ${TEAL2}; color: #fff;
170761
171518
  transition: background 0.15s;
170762
171519
  }
170763
- #${MODAL_ID6} .abm-ef-save-btn:hover { background: ${TEAL_LIGHT2}; }
170764
- #${MODAL_ID6} .abm-ef-save-btn:disabled { opacity: 0.55; cursor: not-allowed; }
170765
- #${MODAL_ID6} .abm-ef-cancel-btn {
171520
+ #${MODAL_ID7} .abm-ef-save-btn:hover { background: ${TEAL_LIGHT2}; }
171521
+ #${MODAL_ID7} .abm-ef-save-btn:disabled { opacity: 0.55; cursor: not-allowed; }
171522
+ #${MODAL_ID7} .abm-ef-cancel-btn {
170766
171523
  padding: 5px 14px; border-radius: 6px; font-size: 12px; font-weight: 600;
170767
171524
  cursor: pointer; background: #e8ecef; color: #555; border: 1px solid #ccc;
170768
171525
  transition: background 0.15s;
170769
171526
  }
170770
- #${MODAL_ID6} .abm-ef-cancel-btn:hover { background: #d8dfe0; }
170771
- #${MODAL_ID6} .abm-ef-error {
171527
+ #${MODAL_ID7} .abm-ef-cancel-btn:hover { background: #d8dfe0; }
171528
+ #${MODAL_ID7} .abm-ef-error {
170772
171529
  font-size: 11px; color: #c0392b; font-weight: 600;
170773
171530
  }
170774
- #${MODAL_ID6} .abm-view-toggle {
171531
+ #${MODAL_ID7} .abm-view-toggle {
170775
171532
  display: flex; gap: 0; border: 1px solid rgba(255,255,255,0.3); border-radius: 6px; overflow: hidden;
170776
171533
  margin-left: auto; flex-shrink: 0;
170777
171534
  }
170778
- #${MODAL_ID6} .abm-view-btn {
171535
+ #${MODAL_ID7} .abm-view-btn {
170779
171536
  background: none; border: none; color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 600;
170780
171537
  padding: 5px 12px; cursor: pointer; transition: background 0.15s, color 0.15s; white-space: nowrap;
170781
171538
  }
170782
- #${MODAL_ID6} .abm-view-btn.active { background: rgba(255,255,255,0.25); color: #fff; }
170783
- #${MODAL_ID6} .abm-view-btn:hover:not(.active) { background: rgba(255,255,255,0.1); color: #fff; }
170784
- #${MODAL_ID6} .abm-restore-btn {
171539
+ #${MODAL_ID7} .abm-view-btn.active { background: rgba(255,255,255,0.25); color: #fff; }
171540
+ #${MODAL_ID7} .abm-view-btn:hover:not(.active) { background: rgba(255,255,255,0.1); color: #fff; }
171541
+ #${MODAL_ID7} .abm-restore-btn {
170785
171542
  background: none; border: none; cursor: pointer; font-size: 13px;
170786
171543
  padding: 2px 4px; border-radius: 4px; color: #e67e22; line-height: 1;
170787
171544
  flex-shrink: 0; transition: background 0.12s;
170788
171545
  title: "Restaurar valor padr\xE3o";
170789
171546
  }
170790
- #${MODAL_ID6} .abm-restore-btn:hover { background: #fef0e4; }
170791
- #${MODAL_ID6} .abm-override-badge {
171547
+ #${MODAL_ID7} .abm-restore-btn:hover { background: #fef0e4; }
171548
+ #${MODAL_ID7} .abm-override-badge {
170792
171549
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px;
170793
171550
  background: #e67e22; color: #fff; letter-spacing: 0.03em;
170794
171551
  }
170795
- #${MODAL_ID6} .abm-rule-group {
171552
+ #${MODAL_ID7} .abm-rule-group {
170796
171553
  border: 1px solid #e0eceb; border-radius: 10px; margin-bottom: 16px; overflow: hidden;
170797
171554
  }
170798
- #${MODAL_ID6} .abm-rule-group-header {
171555
+ #${MODAL_ID7} .abm-rule-group-header {
170799
171556
  display: flex; align-items: center; gap: 10px;
170800
171557
  padding: 10px 14px; background: #f0f9f7; border-bottom: 1px solid #e0eceb;
170801
171558
  }
170802
- #${MODAL_ID6} .abm-rule-group-name { flex: 1; font-size: 14px; font-weight: 600; color: #1a1a1a; }
170803
- #${MODAL_ID6} .abm-rule-group-devices { padding: 0; list-style: none; margin: 0; }
170804
- #${MODAL_ID6} .abm-rule-group-device {
171559
+ #${MODAL_ID7} .abm-rule-group-name { flex: 1; font-size: 14px; font-weight: 600; color: #1a1a1a; }
171560
+ #${MODAL_ID7} .abm-rule-group-devices { padding: 0; list-style: none; margin: 0; }
171561
+ #${MODAL_ID7} .abm-rule-group-device {
170805
171562
  padding: 8px 14px; border-bottom: 1px solid #f0f4f3;
170806
171563
  font-size: 13px; color: #555; display: flex; align-items: center; gap: 8px;
170807
171564
  }
170808
- #${MODAL_ID6} .abm-rule-group-device:last-child { border-bottom: none; }
170809
- #${MODAL_ID6} .abm-rule-description {
171565
+ #${MODAL_ID7} .abm-rule-group-device:last-child { border-bottom: none; }
171566
+ #${MODAL_ID7} .abm-rule-description {
170810
171567
  font-size: 12px; color: #777; font-style: italic;
170811
171568
  margin: 2px 0 6px; line-height: 1.4;
170812
171569
  }
170813
- #${MODAL_ID6} .abm-ef-input--desc {
171570
+ #${MODAL_ID7} .abm-ef-input--desc {
170814
171571
  flex: 1; min-width: 0; resize: vertical;
170815
171572
  font-family: inherit; line-height: 1.4;
170816
171573
  }
170817
171574
  /* Override value chip in por-regra device row */
170818
- #${MODAL_ID6} .abm-override-value {
171575
+ #${MODAL_ID7} .abm-override-value {
170819
171576
  font-size: 12px; font-weight: 600; color: #e67e22;
170820
171577
  background: #fef3e8; border-radius: 4px; padding: 1px 6px;
170821
171578
  }
170822
171579
  /* Collapse/expand */
170823
- #${MODAL_ID6} .abm-device-card.collapsed .abm-rule-list { display: none; }
170824
- #${MODAL_ID6} .abm-rule-group.collapsed .abm-rule-group-devices,
170825
- #${MODAL_ID6} .abm-rule-group.collapsed .abm-rule-detail-wrap { display: none; }
170826
- #${MODAL_ID6} .abm-chevron {
171580
+ #${MODAL_ID7} .abm-device-card.collapsed .abm-rule-list { display: none; }
171581
+ #${MODAL_ID7} .abm-rule-group.collapsed .abm-rule-group-devices,
171582
+ #${MODAL_ID7} .abm-rule-group.collapsed .abm-rule-detail-wrap { display: none; }
171583
+ #${MODAL_ID7} .abm-chevron {
170827
171584
  font-size: 11px; color: #94a3b8; transition: transform 0.18s; flex-shrink: 0; user-select: none;
170828
171585
  }
170829
- #${MODAL_ID6} .abm-device-card.collapsed .abm-chevron,
170830
- #${MODAL_ID6} .abm-rule-group.collapsed .abm-chevron { transform: rotate(-90deg); }
170831
- #${MODAL_ID6} .abm-device-header { cursor: pointer; }
170832
- #${MODAL_ID6} .abm-device-header:hover { background: #f0f9f7; }
170833
- #${MODAL_ID6} .abm-rule-group-header { cursor: pointer; }
170834
- #${MODAL_ID6} .abm-rule-group-header:hover { background: #e6f4f1; }
171586
+ #${MODAL_ID7} .abm-device-card.collapsed .abm-chevron,
171587
+ #${MODAL_ID7} .abm-rule-group.collapsed .abm-chevron { transform: rotate(-90deg); }
171588
+ #${MODAL_ID7} .abm-device-header { cursor: pointer; }
171589
+ #${MODAL_ID7} .abm-device-header:hover { background: #f0f9f7; }
171590
+ #${MODAL_ID7} .abm-rule-group-header { cursor: pointer; }
171591
+ #${MODAL_ID7} .abm-rule-group-header:hover { background: #e6f4f1; }
170835
171592
  /* Alarm badge */
170836
- #${MODAL_ID6} .abm-alarm-badge {
171593
+ #${MODAL_ID7} .abm-alarm-badge {
170837
171594
  display: inline-flex; align-items: center; gap: 3px;
170838
171595
  background: #fee2e2; color: #b91c1c; border-radius: 10px;
170839
171596
  font-size: 10px; font-weight: 700; padding: 1px 7px; flex-shrink: 0;
170840
171597
  }
170841
- #${MODAL_ID6} .abm-alarm-badge.zero { background: #f0f9f7; color: #6b7280; }
171598
+ #${MODAL_ID7} .abm-alarm-badge.zero { background: #f0f9f7; color: #6b7280; }
170842
171599
  /* Filter bar */
170843
- #${MODAL_ID6} .abm-filter-bar {
171600
+ #${MODAL_ID7} .abm-filter-bar {
170844
171601
  display: flex; gap: 8px; align-items: center; margin-bottom: 14px;
170845
171602
  padding: 10px 12px; background: #f8faf9; border: 1px solid #e0eceb; border-radius: 8px;
170846
171603
  }
170847
- #${MODAL_ID6} .abm-filter-input {
171604
+ #${MODAL_ID7} .abm-filter-input {
170848
171605
  flex: 1; border: 1px solid #d1d5db; border-radius: 6px; padding: 6px 10px;
170849
171606
  font-size: 12px; outline: none; transition: border-color 0.15s;
170850
171607
  }
170851
- #${MODAL_ID6} .abm-filter-input:focus { border-color: ${TEAL2}; }
170852
- #${MODAL_ID6} .abm-filter-select {
171608
+ #${MODAL_ID7} .abm-filter-input:focus { border-color: ${TEAL2}; }
171609
+ #${MODAL_ID7} .abm-filter-select {
170853
171610
  border: 1px solid #d1d5db; border-radius: 6px; padding: 5px 8px;
170854
171611
  font-size: 12px; outline: none; min-width: 140px; max-width: 220px;
170855
171612
  background: #fff; cursor: pointer;
170856
171613
  }
170857
- #${MODAL_ID6} .abm-filter-count {
171614
+ #${MODAL_ID7} .abm-filter-count {
170858
171615
  font-size: 11px; color: #64748b; white-space: nowrap; flex-shrink: 0;
170859
171616
  }
170860
- #${MODAL_ID6} .abm-filter-clear {
171617
+ #${MODAL_ID7} .abm-filter-clear {
170861
171618
  background: none; border: 1px solid #e0eceb; border-radius: 6px; cursor: pointer;
170862
171619
  font-size: 11px; color: #64748b; padding: 4px 8px; white-space: nowrap; flex-shrink: 0;
170863
171620
  transition: background 0.12s;
170864
171621
  }
170865
- #${MODAL_ID6} .abm-filter-clear:hover { background: #f0f4f3; color: #1e293b; }
171622
+ #${MODAL_ID7} .abm-filter-clear:hover { background: #f0f4f3; color: #1e293b; }
170866
171623
  /* Confirmation modal \u2014 value edit overwrite warning */
170867
171624
  .abm-confirm-overlay {
170868
171625
  position: fixed; inset: 0;
@@ -170899,14 +171656,14 @@ var STYLES3 = `
170899
171656
  .abm-confirm-btn--confirm:hover { background: #cf6d17; }
170900
171657
  `;
170901
171658
  function injectStyles24() {
170902
- if (document.getElementById(`${MODAL_ID6}-styles`)) return;
171659
+ if (document.getElementById(`${MODAL_ID7}-styles`)) return;
170903
171660
  const style = document.createElement("style");
170904
- style.id = `${MODAL_ID6}-styles`;
171661
+ style.id = `${MODAL_ID7}-styles`;
170905
171662
  style.textContent = STYLES3;
170906
171663
  document.head.appendChild(style);
170907
171664
  }
170908
171665
  function removeExistingModal2() {
170909
- document.getElementById(MODAL_ID6)?.remove();
171666
+ document.getElementById(MODAL_ID7)?.remove();
170910
171667
  }
170911
171668
  function escHtml5(str) {
170912
171669
  return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
@@ -171593,7 +172350,7 @@ async function openAlarmBundleMapModal(params) {
171593
172350
  }
171594
172351
  const baseUrl = params.gcdrApiBaseUrl;
171595
172352
  const overlay = document.createElement("div");
171596
- overlay.id = MODAL_ID6;
172353
+ overlay.id = MODAL_ID7;
171597
172354
  const card = document.createElement("div");
171598
172355
  card.className = "abm-card";
171599
172356
  overlay.appendChild(card);
@@ -172747,11 +173504,11 @@ function _esc(s) {
172747
173504
  const str = s == null ? "" : String(s);
172748
173505
  return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
172749
173506
  }
172750
- var STYLE_ID20 = "ntw-styles";
173507
+ var STYLE_ID21 = "ntw-styles";
172751
173508
  function _injectStyles2() {
172752
- if (document.getElementById(STYLE_ID20)) return;
173509
+ if (document.getElementById(STYLE_ID21)) return;
172753
173510
  const s = document.createElement("style");
172754
- s.id = STYLE_ID20;
173511
+ s.id = STYLE_ID21;
172755
173512
  s.textContent = NTW_CSS;
172756
173513
  document.head.appendChild(s);
172757
173514
  }
@@ -175452,7 +176209,7 @@ var IMPORTANCE_COLORS4 = {
175452
176209
  // red
175453
176210
  };
175454
176211
  var ITEM_TEXT_MAX = 120;
175455
- function escapeHtml20(input) {
176212
+ function escapeHtml22(input) {
175456
176213
  if (input == null) return "";
175457
176214
  return String(input).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
175458
176215
  }
@@ -175490,24 +176247,24 @@ function renderAnnotationItemCard(device, annotation, searchTerm) {
175490
176247
  const domainIcon = DOMAIN_ICONS3[device.domain] ?? DOMAIN_ICONS3.unknown;
175491
176248
  const typeIcon = TYPE_ICONS[annotation.type] ?? "\xB7";
175492
176249
  const importance = Math.max(1, Math.min(5, annotation.importance || 1));
175493
- const textEscaped = escapeHtml20(truncate2(annotation.text || "", ITEM_TEXT_MAX));
175494
- const deviceLabelEscaped = escapeHtml20(device.label || device.name || device.deviceId);
175495
- const author = escapeHtml20(annotation.createdBy?.name || "sem autor");
175496
- const when = escapeHtml20(formatRelative(annotation.createdAt));
176250
+ const textEscaped = escapeHtml22(truncate2(annotation.text || "", ITEM_TEXT_MAX));
176251
+ const deviceLabelEscaped = escapeHtml22(device.label || device.name || device.deviceId);
176252
+ const author = escapeHtml22(annotation.createdBy?.name || "sem autor");
176253
+ const when = escapeHtml22(formatRelative(annotation.createdAt));
175497
176254
  const overdueTag = isOverdue(annotation) ? '<span class="myio-annotations-overdue">Vencida</span>' : "";
175498
176255
  const text2 = searchTerm ? highlightMatches(textEscaped, searchTerm) : textEscaped;
175499
176256
  const deviceLabel = searchTerm ? highlightMatches(deviceLabelEscaped, searchTerm) : deviceLabelEscaped;
175500
- const identifierEscaped = device.identifier ? escapeHtml20(device.identifier) : "";
176257
+ const identifierEscaped = device.identifier ? escapeHtml22(device.identifier) : "";
175501
176258
  const identifierHighlighted = searchTerm && identifierEscaped ? highlightMatches(identifierEscaped, searchTerm) : identifierEscaped;
175502
176259
  const identifierTag = device.identifier ? `<span class="myio-annotations-item-device">${identifierHighlighted}</span>` : "";
175503
176260
  return `
175504
176261
  <button
175505
176262
  class="myio-annotations-item"
175506
176263
  type="button"
175507
- data-device-id="${escapeHtml20(device.deviceId)}"
175508
- data-annotation-id="${escapeHtml20(annotation.id)}"
176264
+ data-device-id="${escapeHtml22(device.deviceId)}"
176265
+ data-annotation-id="${escapeHtml22(annotation.id)}"
175509
176266
  tabindex="0"
175510
- aria-label="${escapeHtml20(annotation.text)} \u2014 ${deviceLabel}"
176267
+ aria-label="${escapeHtml22(annotation.text)} \u2014 ${deviceLabel}"
175511
176268
  >
175512
176269
  <span class="myio-annotations-item-icon" aria-hidden="true">${typeIcon}</span>
175513
176270
  <div class="myio-annotations-item-body">
@@ -176484,8 +177241,8 @@ var HeaderAnnotationsPanel = class _HeaderAnnotationsPanel {
176484
177241
  // group header
176485
177242
  render: () => `
176486
177243
  <header class="myio-annotations-group-header ${groupClass}">
176487
- ${g.icon ? `<span class="myio-annotations-group-icon" aria-hidden="true">${escapeHtml20(g.icon)}</span>` : ""}
176488
- <span class="myio-annotations-group-label">${escapeHtml20(g.label)}</span>
177244
+ ${g.icon ? `<span class="myio-annotations-group-icon" aria-hidden="true">${escapeHtml22(g.icon)}</span>` : ""}
177245
+ <span class="myio-annotations-group-label">${escapeHtml22(g.label)}</span>
176489
177246
  <span class="myio-annotations-group-count">${g.totalAnnotations}</span>
176490
177247
  </header>`
176491
177248
  });
@@ -176610,9 +177367,9 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
176610
177367
  }
176611
177368
  _renderToolbar(filteredCount, totalCount) {
176612
177369
  const sortOptions = SORT_OPTIONS.map(
176613
- (o) => `<option value="${o.key}" ${o.key === this.sortBy ? "selected" : ""}>${escapeHtml20(o.label)}</option>`
177370
+ (o) => `<option value="${o.key}" ${o.key === this.sortBy ? "selected" : ""}>${escapeHtml22(o.label)}</option>`
176614
177371
  ).join("");
176615
- const term = escapeHtml20(this.filter.searchTerm || "");
177372
+ const term = escapeHtml22(this.filter.searchTerm || "");
176616
177373
  const filtersActiveCount = this._activeFilterCount();
176617
177374
  const filterIndicator = filtersActiveCount > 0 ? `<span class="myio-annotations-group-count">${filtersActiveCount}</span>` : "";
176618
177375
  const showingHtml = filteredCount === totalCount ? `${totalCount} anota\xE7\xF5es` : `${filteredCount} de ${totalCount} anota\xE7\xF5es`;
@@ -176653,13 +177410,13 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
176653
177410
  const typesHtml = FILTER_TYPE_OPTIONS.map(
176654
177411
  (t) => `<label class="myio-annotations-filter-chip ${this.filter.types.has(t.id) ? "is-on" : ""}">
176655
177412
  <input type="checkbox" data-filter="type" value="${t.id}" ${this.filter.types.has(t.id) ? "checked" : ""} />
176656
- <span>${t.icon} ${escapeHtml20(t.label)}</span>
177413
+ <span>${t.icon} ${escapeHtml22(t.label)}</span>
176657
177414
  </label>`
176658
177415
  ).join("");
176659
177416
  const statusHtml = FILTER_STATUS_OPTIONS.map(
176660
177417
  (s) => `<label class="myio-annotations-filter-chip ${this.filter.statuses.has(s.id) ? "is-on" : ""}">
176661
177418
  <input type="checkbox" data-filter="status" value="${s.id}" ${this.filter.statuses.has(s.id) ? "checked" : ""} />
176662
- <span>${escapeHtml20(s.label)}</span>
177419
+ <span>${escapeHtml22(s.label)}</span>
176663
177420
  </label>`
176664
177421
  ).join("");
176665
177422
  const impHtml = [1, 2, 3, 4, 5].map(
@@ -176736,12 +177493,12 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
176736
177493
  return `
176737
177494
  <section class="${groupClass}">
176738
177495
  <header class="myio-annotations-group-header" role="button" tabindex="0"
176739
- data-group-toggle="${escapeHtml20(group.key)}"
177496
+ data-group-toggle="${escapeHtml22(group.key)}"
176740
177497
  aria-expanded="${!isCollapsed}"
176741
177498
  title="${isCollapsed ? "Expandir grupo" : "Recolher grupo"}">
176742
177499
  <span class="myio-annotations-group-chevron" aria-hidden="true">${isCollapsed ? "\u25B6" : "\u25BC"}</span>
176743
- ${group.icon ? `<span class="myio-annotations-group-icon" aria-hidden="true">${escapeHtml20(group.icon)}</span>` : ""}
176744
- <span class="myio-annotations-group-label">${escapeHtml20(group.label)}</span>
177500
+ ${group.icon ? `<span class="myio-annotations-group-icon" aria-hidden="true">${escapeHtml22(group.icon)}</span>` : ""}
177501
+ <span class="myio-annotations-group-label">${escapeHtml22(group.label)}</span>
176745
177502
  <span class="myio-annotations-group-count">${group.totalAnnotations}</span>
176746
177503
  </header>
176747
177504
  ${itemsHtml}
@@ -177283,7 +178040,7 @@ function prefixForProductType(productType) {
177283
178040
  if (entry) return entry.prefix;
177284
178041
  return `T${productType}`;
177285
178042
  }
177286
- function pad26(n) {
178043
+ function pad27(n) {
177287
178044
  return String(n).padStart(2, "0");
177288
178045
  }
177289
178046
  function pad4(n) {
@@ -177291,9 +178048,9 @@ function pad4(n) {
177291
178048
  }
177292
178049
  function deviceProductCodeToName(value) {
177293
178050
  const prefix = prefixForProductType(value.productType);
177294
- const yy = pad26(value.year % 100);
177295
- const mm = pad26(value.month);
177296
- const dd = pad26(value.day);
178051
+ const yy = pad27(value.year % 100);
178052
+ const mm = pad27(value.month);
178053
+ const dd = pad27(value.day);
177297
178054
  const unit = value.seq3 * 254 + value.seq;
177298
178055
  return `${prefix} ${yy}${mm}${dd}-${pad4(unit)}`;
177299
178056
  }
@@ -177402,7 +178159,7 @@ function validateDeviceProductCode(code) {
177402
178159
  }
177403
178160
 
177404
178161
  // src/components/cards/central-status/v1.0.0/styles.ts
177405
- var STYLE_ID21 = "myio-central-status-card-styles";
178162
+ var STYLE_ID22 = "myio-central-status-card-styles";
177406
178163
  var CSS5 = `
177407
178164
  .myio-cscard{
177408
178165
  --cscard-surface:#ffffff;
@@ -177705,9 +178462,9 @@ var CSS5 = `
177705
178462
  `;
177706
178463
  function injectCentralStatusCardStyles() {
177707
178464
  if (typeof document === "undefined") return;
177708
- if (document.getElementById(STYLE_ID21)) return;
178465
+ if (document.getElementById(STYLE_ID22)) return;
177709
178466
  const tag = document.createElement("style");
177710
- tag.id = STYLE_ID21;
178467
+ tag.id = STYLE_ID22;
177711
178468
  tag.textContent = CSS5;
177712
178469
  document.head.appendChild(tag);
177713
178470
  }
@@ -177767,7 +178524,7 @@ function deriveCentralConnectivity(ev, opts) {
177767
178524
  }
177768
178525
 
177769
178526
  // src/components/cards/central-status/v1.0.0/TimelineModal.ts
177770
- var STYLE_ID22 = "myio-cscard-timeline-styles";
178527
+ var STYLE_ID23 = "myio-cscard-timeline-styles";
177771
178528
  var DEFAULT_PERIODS = [1, 7, 30, 90];
177772
178529
  function escAttr5(s) {
177773
178530
  return String(s ?? "").replace(
@@ -177776,9 +178533,9 @@ function escAttr5(s) {
177776
178533
  );
177777
178534
  }
177778
178535
  function injectTimelineModalStyles() {
177779
- if (typeof document === "undefined" || document.getElementById(STYLE_ID22)) return;
178536
+ if (typeof document === "undefined" || document.getElementById(STYLE_ID23)) return;
177780
178537
  const tag = document.createElement("style");
177781
- tag.id = STYLE_ID22;
178538
+ tag.id = STYLE_ID23;
177782
178539
  tag.textContent = `
177783
178540
  .myio-tlmodal{
177784
178541
  --tl-online:#3b82f6;
@@ -179074,6 +179831,7 @@ var version = package_default.version || "0.0.0";
179074
179831
  MENU_SHOPPING_CSS_PREFIX,
179075
179832
  METRO_TILE_COLORS,
179076
179833
  MONEY_DASH,
179834
+ MONEY_HOURLY_MAX_DAYS,
179077
179835
  MONEY_REQUIRES_DEVICE_GRANULARITY,
179078
179836
  MONEY_VARIANCE_HEADER,
179079
179837
  MOTOR_SORT_OPTIONS,
@@ -179155,6 +179913,7 @@ var version = package_default.version || "0.0.0";
179155
179913
  SolenoidControlView,
179156
179914
  SwitchControlController,
179157
179915
  SwitchControlView,
179916
+ TARIFF_DEFAULT_TIMEZONE,
179158
179917
  TELEMETRY_CONTEXT_CONFIG,
179159
179918
  TELEMETRY_DEFAULT_FILTER_TABS,
179160
179919
  TELEMETRY_DOMAIN_CONFIG,
@@ -179359,6 +180118,7 @@ var version = package_default.version || "0.0.0";
179359
180118
  createSwitchControl,
179360
180119
  createTariffApiAdapter,
179361
180120
  createTariffApiClient,
180121
+ createTariffValuator,
179362
180122
  createTbEnvelopeStore,
179363
180123
  createTelemetryGridComponent,
179364
180124
  createTelemetryGridShoppingComponent,
@@ -179650,6 +180410,7 @@ var version = package_default.version || "0.0.0";
179650
180410
  openGatewayModal,
179651
180411
  openGenericModal,
179652
180412
  openGoalsPanel,
180413
+ openGoalsTariffsHub,
179653
180414
  openHelpModal,
179654
180415
  openIntegrationsModal,
179655
180416
  openManualDeviceModal,