@texturehq/edges 2.5.0 → 2.5.1

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.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { BreadcrumbProps, BreadcrumbsProps, DateValue, CalendarProps as CalendarProps$1, ValidationResult, DisclosureGroupProps, DisclosurePanelProps, ButtonProps, DisclosureProps, DateRangePickerProps as DateRangePickerProps$1, FormProps, TooltipTriggerComponentProps, TooltipProps as TooltipProps$1, ListBoxProps as ListBoxProps$1, ListBoxItemProps, ModalOverlayProps, Key, PopoverProps as PopoverProps$1, ProgressBarProps as ProgressBarProps$1, RangeCalendarProps as RangeCalendarProps$1, TabProps as TabProps$1, TabListProps as TabListProps$1, TabPanelProps, TabsProps as TabsProps$2 } from 'react-aria-components';
2
2
  export { BreadcrumbProps, BreadcrumbsProps, DialogTrigger } from 'react-aria-components';
3
- import { B as BadgeProps, aa as FieldValue, ab as BooleanFormat, ac as FormattedValue, ad as FieldFormat, ae as CurrentFormat, af as DateFormat, ag as DistanceFormat, ah as EnergyUnit, ai as EnergyFormat, aj as CurrencyFormat, ak as NumberFormat, al as PhoneFormat, am as PowerFormat, an as FormatterFunction, ao as ResistanceFormat, ap as TemperatureFormat, aq as TemperatureUnitString, ar as TemperatureUnit, as as TextFormat, at as VoltageFormat, e as BaseDataPoint, O as YFormatType, F as TooltipData, au as DeviceState, av as GridState, aw as ComponentFormatter, ax as LayerSpec, ay as CustomPinsSpec, az as GeoJsonLayerSpec, aA as RasterLayerSpec, aB as VectorLayerSpec, aC as ClusteredVectorLayerSpec } from './colors-Jvcd1uiH.cjs';
4
- export { A as ABSENT_GRID_FIELDS, a as ActionItem, aD as ActionMenu, b as ActionMenuProps, aE as AppShell, c as AppShellProps, aF as Avatar, d as AvatarProps, aG as Badge, aH as BaseFormat, aI as ChartContext, C as ChartMargin, aJ as CodeEditor, f as CodeEditorProps, g as CodeLanguage, h as CodeTheme, aK as ColorSpec, aL as ComponentFormatOptions, aM as CurrentUnit, aN as CustomFormat, aO as DEFAULT_MAP_TYPE, aP as DateFormatStyle, aQ as DistanceUnit, aR as ENTITY_CATEGORY_CONFIG, E as ENTITY_CONFIG, i as EntityArchetype, aS as EntityCategory, aT as EntityCategoryConfig, j as EntityConfig, k as EntityStateRule, l as EntityType, G as GRID_ELEMENT_TYPE_BY_ENTITY, aU as GRID_STATE_COLORS, m as GRID_STAT_LIST, n as GridElementSourceType, o as GridStatField, p as GridStatFieldFormat, aV as GridStateColor, H as HEADLINE_METRIC_BOUNDS, q as Heading, r as HeadlineMetric, aW as InteractiveMap, aX as InteractiveMapHandle, I as InteractiveMapProps, aY as LayerFeature, aZ as LayerStyle, L as Loader, s as Logo, a_ as MAP_TYPES, M as MapPoint, a$ as MapType, b0 as Meter, t as MeterProps, b1 as MetricFormat, u as MetricSource, b2 as PercentageFormat, b3 as PowerUnit, b4 as RenderType, b5 as ResistanceUnit, S as SegmentOption, b6 as SegmentedControl, v as SegmentedControlProps, w as SerializableFieldFormat, x as SideNav, y as SideNavItem, z as SideNavProps, b7 as StackNav, b8 as StackNavGroup, b9 as StackNavItem, ba as StackNavLinkComponentProps, bb as StackNavProps, bc as StackNavTheme, bd as StaticMap, D as StaticMapProps, T as TextLink, be as TextTransform, bf as TextTruncatePosition, J as TooltipSeries, K as TopNav, N as TopNavProps, bg as VoltageUnit, Y as YFormatSettings, bh as ZoomStops, bi as activeDeviceStates, P as archetypeFor, bj as baselineFromPoint, Q as clearColorCache, R as createCategoryColorMap, U as createXScale, V as createYScale, W as defaultMargin, bk as deviceStateLabels, bl as deviceStateMetricFormats, X as entityHasDetailPage, Z as entityHasStatList, _ as entityShowsNow, bm as formatComponentValue, $ as getContrastingTextColor, a0 as getDefaultChartColor, a1 as getDefaultColors, bn as getDeviceStateDisplayLabel, bn as getDeviceStateLabel, bo as getEntityCategory, a2 as getEntityConfig, a3 as getEntityIcon, a4 as getEntityLabel, a5 as getEntityStatList, bp as getGridStateLabel, a6 as getResolvedColor, a7 as getThemeCategoricalColors, a8 as getYFormatSettings, bq as gridStateLabels, br as isActiveDeviceState, br as isActiveState, a9 as isLightColor, bs as mapValuesToCategoricalColors, bt as useChartContext, bu as useComponentFormatter } from './colors-Jvcd1uiH.cjs';
3
+ import { B as BadgeProps, aa as FieldValue, ab as BooleanFormat, ac as FormattedValue, ad as FieldFormat, ae as CurrentFormat, af as DateFormat, ag as DistanceFormat, ah as EnergyUnit, ai as EnergyFormat, aj as CurrencyFormat, ak as NumberFormat, al as PhoneFormat, am as PowerFormat, an as FormatterFunction, ao as ResistanceFormat, ap as TemperatureFormat, aq as TemperatureUnitString, ar as TemperatureUnit, as as TextFormat, at as VoltageFormat, e as BaseDataPoint, O as YFormatType, F as TooltipData, au as DeviceState, av as GridState, aw as ComponentFormatter, ax as LayerSpec, ay as CustomPinsSpec, az as GeoJsonLayerSpec, aA as RasterLayerSpec, aB as VectorLayerSpec, aC as ClusteredVectorLayerSpec } from './colors-fisZABpX.cjs';
4
+ export { A as ABSENT_GRID_FIELDS, a as ActionItem, aD as ActionMenu, b as ActionMenuProps, aE as AppShell, c as AppShellProps, aF as Avatar, d as AvatarProps, aG as Badge, aH as BaseFormat, aI as ChartContext, C as ChartMargin, aJ as CodeEditor, f as CodeEditorProps, g as CodeLanguage, h as CodeTheme, aK as ColorSpec, aL as ComponentFormatOptions, aM as CurrentUnit, aN as CustomFormat, aO as DEFAULT_MAP_TYPE, aP as DateFormatStyle, aQ as DistanceUnit, aR as ENTITY_CATEGORY_CONFIG, E as ENTITY_CONFIG, i as EntityArchetype, aS as EntityCategory, aT as EntityCategoryConfig, j as EntityConfig, k as EntityStateRule, l as EntityType, G as GRID_ELEMENT_TYPE_BY_ENTITY, aU as GRID_STATE_COLORS, m as GRID_STAT_LIST, n as GridElementSourceType, o as GridStatField, p as GridStatFieldFormat, aV as GridStateColor, H as HEADLINE_METRIC_BOUNDS, q as Heading, r as HeadlineMetric, aW as InteractiveMap, aX as InteractiveMapHandle, I as InteractiveMapProps, aY as LayerFeature, aZ as LayerStyle, L as Loader, s as Logo, a_ as MAP_TYPES, M as MapPoint, a$ as MapType, b0 as Meter, t as MeterProps, b1 as MetricFormat, u as MetricSource, b2 as PercentageFormat, b3 as PowerUnit, b4 as RenderType, b5 as ResistanceUnit, S as SegmentOption, b6 as SegmentedControl, v as SegmentedControlProps, w as SerializableFieldFormat, x as SideNav, y as SideNavItem, z as SideNavProps, b7 as StackNav, b8 as StackNavGroup, b9 as StackNavItem, ba as StackNavLinkComponentProps, bb as StackNavProps, bc as StackNavTheme, bd as StaticMap, D as StaticMapProps, T as TextLink, be as TextTransform, bf as TextTruncatePosition, J as TooltipSeries, K as TopNav, N as TopNavProps, bg as VoltageUnit, Y as YFormatSettings, bh as ZoomStops, bi as activeDeviceStates, P as archetypeFor, bj as baselineFromPoint, Q as clearColorCache, R as createCategoryColorMap, U as createXScale, V as createYScale, W as defaultMargin, bk as deviceStateLabels, bl as deviceStateMetricFormats, X as entityHasDetailPage, Z as entityHasStatList, _ as entityShowsNow, bm as formatComponentValue, $ as getContrastingTextColor, a0 as getDefaultChartColor, a1 as getDefaultColors, bn as getDeviceStateDisplayLabel, bn as getDeviceStateLabel, bo as getEntityCategory, a2 as getEntityConfig, a3 as getEntityIcon, a4 as getEntityLabel, a5 as getEntityStatList, bp as getGridStateLabel, a6 as getResolvedColor, a7 as getThemeCategoricalColors, a8 as getYFormatSettings, bq as gridStateLabels, br as isActiveDeviceState, br as isActiveState, a9 as isLightColor, bs as mapValuesToCategoricalColors, bt as useChartContext, bu as useComponentFormatter } from './colors-fisZABpX.cjs';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import * as React$1 from 'react';
7
7
  import React__default, { ReactNode, RefObject, HTMLAttributes, ComponentProps, ComponentType, CSSProperties, Component, ErrorInfo } from 'react';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { BreadcrumbProps, BreadcrumbsProps, DateValue, CalendarProps as CalendarProps$1, ValidationResult, DisclosureGroupProps, DisclosurePanelProps, ButtonProps, DisclosureProps, DateRangePickerProps as DateRangePickerProps$1, FormProps, TooltipTriggerComponentProps, TooltipProps as TooltipProps$1, ListBoxProps as ListBoxProps$1, ListBoxItemProps, ModalOverlayProps, Key, PopoverProps as PopoverProps$1, ProgressBarProps as ProgressBarProps$1, RangeCalendarProps as RangeCalendarProps$1, TabProps as TabProps$1, TabListProps as TabListProps$1, TabPanelProps, TabsProps as TabsProps$2 } from 'react-aria-components';
2
2
  export { BreadcrumbProps, BreadcrumbsProps, DialogTrigger } from 'react-aria-components';
3
- import { B as BadgeProps, aa as FieldValue, ab as BooleanFormat, ac as FormattedValue, ad as FieldFormat, ae as CurrentFormat, af as DateFormat, ag as DistanceFormat, ah as EnergyUnit, ai as EnergyFormat, aj as CurrencyFormat, ak as NumberFormat, al as PhoneFormat, am as PowerFormat, an as FormatterFunction, ao as ResistanceFormat, ap as TemperatureFormat, aq as TemperatureUnitString, ar as TemperatureUnit, as as TextFormat, at as VoltageFormat, e as BaseDataPoint, O as YFormatType, F as TooltipData, au as DeviceState, av as GridState, aw as ComponentFormatter, ax as LayerSpec, ay as CustomPinsSpec, az as GeoJsonLayerSpec, aA as RasterLayerSpec, aB as VectorLayerSpec, aC as ClusteredVectorLayerSpec } from './colors-CwPI5R2L.js';
4
- export { A as ABSENT_GRID_FIELDS, a as ActionItem, aD as ActionMenu, b as ActionMenuProps, aE as AppShell, c as AppShellProps, aF as Avatar, d as AvatarProps, aG as Badge, aH as BaseFormat, aI as ChartContext, C as ChartMargin, aJ as CodeEditor, f as CodeEditorProps, g as CodeLanguage, h as CodeTheme, aK as ColorSpec, aL as ComponentFormatOptions, aM as CurrentUnit, aN as CustomFormat, aO as DEFAULT_MAP_TYPE, aP as DateFormatStyle, aQ as DistanceUnit, aR as ENTITY_CATEGORY_CONFIG, E as ENTITY_CONFIG, i as EntityArchetype, aS as EntityCategory, aT as EntityCategoryConfig, j as EntityConfig, k as EntityStateRule, l as EntityType, G as GRID_ELEMENT_TYPE_BY_ENTITY, aU as GRID_STATE_COLORS, m as GRID_STAT_LIST, n as GridElementSourceType, o as GridStatField, p as GridStatFieldFormat, aV as GridStateColor, H as HEADLINE_METRIC_BOUNDS, q as Heading, r as HeadlineMetric, aW as InteractiveMap, aX as InteractiveMapHandle, I as InteractiveMapProps, aY as LayerFeature, aZ as LayerStyle, L as Loader, s as Logo, a_ as MAP_TYPES, M as MapPoint, a$ as MapType, b0 as Meter, t as MeterProps, b1 as MetricFormat, u as MetricSource, b2 as PercentageFormat, b3 as PowerUnit, b4 as RenderType, b5 as ResistanceUnit, S as SegmentOption, b6 as SegmentedControl, v as SegmentedControlProps, w as SerializableFieldFormat, x as SideNav, y as SideNavItem, z as SideNavProps, b7 as StackNav, b8 as StackNavGroup, b9 as StackNavItem, ba as StackNavLinkComponentProps, bb as StackNavProps, bc as StackNavTheme, bd as StaticMap, D as StaticMapProps, T as TextLink, be as TextTransform, bf as TextTruncatePosition, J as TooltipSeries, K as TopNav, N as TopNavProps, bg as VoltageUnit, Y as YFormatSettings, bh as ZoomStops, bi as activeDeviceStates, P as archetypeFor, bj as baselineFromPoint, Q as clearColorCache, R as createCategoryColorMap, U as createXScale, V as createYScale, W as defaultMargin, bk as deviceStateLabels, bl as deviceStateMetricFormats, X as entityHasDetailPage, Z as entityHasStatList, _ as entityShowsNow, bm as formatComponentValue, $ as getContrastingTextColor, a0 as getDefaultChartColor, a1 as getDefaultColors, bn as getDeviceStateDisplayLabel, bn as getDeviceStateLabel, bo as getEntityCategory, a2 as getEntityConfig, a3 as getEntityIcon, a4 as getEntityLabel, a5 as getEntityStatList, bp as getGridStateLabel, a6 as getResolvedColor, a7 as getThemeCategoricalColors, a8 as getYFormatSettings, bq as gridStateLabels, br as isActiveDeviceState, br as isActiveState, a9 as isLightColor, bs as mapValuesToCategoricalColors, bt as useChartContext, bu as useComponentFormatter } from './colors-CwPI5R2L.js';
3
+ import { B as BadgeProps, aa as FieldValue, ab as BooleanFormat, ac as FormattedValue, ad as FieldFormat, ae as CurrentFormat, af as DateFormat, ag as DistanceFormat, ah as EnergyUnit, ai as EnergyFormat, aj as CurrencyFormat, ak as NumberFormat, al as PhoneFormat, am as PowerFormat, an as FormatterFunction, ao as ResistanceFormat, ap as TemperatureFormat, aq as TemperatureUnitString, ar as TemperatureUnit, as as TextFormat, at as VoltageFormat, e as BaseDataPoint, O as YFormatType, F as TooltipData, au as DeviceState, av as GridState, aw as ComponentFormatter, ax as LayerSpec, ay as CustomPinsSpec, az as GeoJsonLayerSpec, aA as RasterLayerSpec, aB as VectorLayerSpec, aC as ClusteredVectorLayerSpec } from './colors-BbO4TbGH.js';
4
+ export { A as ABSENT_GRID_FIELDS, a as ActionItem, aD as ActionMenu, b as ActionMenuProps, aE as AppShell, c as AppShellProps, aF as Avatar, d as AvatarProps, aG as Badge, aH as BaseFormat, aI as ChartContext, C as ChartMargin, aJ as CodeEditor, f as CodeEditorProps, g as CodeLanguage, h as CodeTheme, aK as ColorSpec, aL as ComponentFormatOptions, aM as CurrentUnit, aN as CustomFormat, aO as DEFAULT_MAP_TYPE, aP as DateFormatStyle, aQ as DistanceUnit, aR as ENTITY_CATEGORY_CONFIG, E as ENTITY_CONFIG, i as EntityArchetype, aS as EntityCategory, aT as EntityCategoryConfig, j as EntityConfig, k as EntityStateRule, l as EntityType, G as GRID_ELEMENT_TYPE_BY_ENTITY, aU as GRID_STATE_COLORS, m as GRID_STAT_LIST, n as GridElementSourceType, o as GridStatField, p as GridStatFieldFormat, aV as GridStateColor, H as HEADLINE_METRIC_BOUNDS, q as Heading, r as HeadlineMetric, aW as InteractiveMap, aX as InteractiveMapHandle, I as InteractiveMapProps, aY as LayerFeature, aZ as LayerStyle, L as Loader, s as Logo, a_ as MAP_TYPES, M as MapPoint, a$ as MapType, b0 as Meter, t as MeterProps, b1 as MetricFormat, u as MetricSource, b2 as PercentageFormat, b3 as PowerUnit, b4 as RenderType, b5 as ResistanceUnit, S as SegmentOption, b6 as SegmentedControl, v as SegmentedControlProps, w as SerializableFieldFormat, x as SideNav, y as SideNavItem, z as SideNavProps, b7 as StackNav, b8 as StackNavGroup, b9 as StackNavItem, ba as StackNavLinkComponentProps, bb as StackNavProps, bc as StackNavTheme, bd as StaticMap, D as StaticMapProps, T as TextLink, be as TextTransform, bf as TextTruncatePosition, J as TooltipSeries, K as TopNav, N as TopNavProps, bg as VoltageUnit, Y as YFormatSettings, bh as ZoomStops, bi as activeDeviceStates, P as archetypeFor, bj as baselineFromPoint, Q as clearColorCache, R as createCategoryColorMap, U as createXScale, V as createYScale, W as defaultMargin, bk as deviceStateLabels, bl as deviceStateMetricFormats, X as entityHasDetailPage, Z as entityHasStatList, _ as entityShowsNow, bm as formatComponentValue, $ as getContrastingTextColor, a0 as getDefaultChartColor, a1 as getDefaultColors, bn as getDeviceStateDisplayLabel, bn as getDeviceStateLabel, bo as getEntityCategory, a2 as getEntityConfig, a3 as getEntityIcon, a4 as getEntityLabel, a5 as getEntityStatList, bp as getGridStateLabel, a6 as getResolvedColor, a7 as getThemeCategoricalColors, a8 as getYFormatSettings, bq as gridStateLabels, br as isActiveDeviceState, br as isActiveState, a9 as isLightColor, bs as mapValuesToCategoricalColors, bt as useChartContext, bu as useComponentFormatter } from './colors-BbO4TbGH.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import * as React$1 from 'react';
7
7
  import React__default, { ReactNode, RefObject, HTMLAttributes, ComponentProps, ComponentType, CSSProperties, Component, ErrorInfo } from 'react';
package/dist/index.js CHANGED
@@ -44,5 +44,5 @@ import {TooltipTrigger,Tooltip,OverlayArrow,composeRenderProps,DialogTrigger,Men
44
44
  `;return}else W.tagName;}for(let W=0;W<M.childNodes.length;W++)E(M.childNodes[W]);};return E(j),Q},[]),R=useCallback((j,Q)=>{let E=document.createTreeWalker(j,NodeFilter.SHOW_TEXT,{acceptNode:F=>{let O=F.parentElement;return O&&O.closest("[data-chip-id]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),M=E.nextNode(),W=Math.max(0,Q);for(;M;){let F=M.nodeValue||"";if(F.length>=W){let O=document.createRange();O.setStart(M,W),O.collapse(true);let K=window.getSelection();K?.removeAllRanges(),K?.addRange(O);return}W-=F.length,M=E.nextNode();}let I=window.getSelection(),C=document.createRange();C.selectNodeContents(j),C.collapse(false),I?.removeAllRanges(),I?.addRange(C);},[]);useEffect(()=>{N.current&&!m&&N.current.textContent!==""&&(N.current.textContent="");},[m]),useLayoutEffect(()=>{if(N.current){if(m===""){if(T)try{N.current.focus({preventScroll:!0}),R(N.current,0);}catch{}return}if(D.current!=null)try{R(N.current,D.current);}finally{D.current=null;}}},[m,R,T]);let H=useCallback((j,Q)=>{if(p?.(j),j===""){x?.();return}if(h&&b&&Q!==void 0){let E=j.slice(0,Q),M=typeof h=="string"?new RegExp(`\\${h}([^\\s]*)$`):h,W=E.match(M);if(W){let I=W[1]||"",C=Q-W[0].length;b({query:I,position:Q,startIndex:C});}else x?.();}},[p,h,b,x]),G=useCallback(j=>{if(!f||!p)return;let Q=g.filter(M=>M.id!==j);f(Q);let E=m.replace(new RegExp(`\\{\\{${j}\\}\\}`,"g"),"");p(E);},[g,f,m,p]),Y=useCallback(j=>y?y(j,()=>G(j.id)):jsx(eo,{variant:v,size:A,onRemove:c?void 0:()=>G(j.id),isDisabled:c,className:"py-0.5 px-1.5 gap-1 text-xs leading-none rounded-md",children:j.label},j.id),[y,v,A,G,c]),U=()=>{let j=Vt({isInvalid:s,isDisabled:c,isFocused:T,transparent:i,size:o}),Q=`min-h-[100px] py-2 px-3 ${c?"resize-none":l?"resize-y":"resize-none"}`,E=twMerge("focus:outline-none overflow-auto","[&_[data-chip-id]::selection]:bg-action-primary/20","[&:empty]:before:content-[attr(data-placeholder)] [&:empty]:before:text-text-disabled [&:empty]:before:pointer-events-none");return twMerge(j,Q,E,u)},q=()=>m?m.split(/(\{\{[^}]+\}\})/g).map((Q,E)=>{let M=Q.match(/\{\{([^}]+)\}\}/);if(M){let W=M[1],I=g.find(C=>C.id===W);if(I)return jsx("span",{className:"inline-block align-baseline cursor-pointer",contentEditable:false,suppressContentEditableWarning:true,"data-chip-id":W,style:{userSelect:"none",verticalAlign:"baseline",lineHeight:"1"},onClick:C=>{C.preventDefault();let F=window.getSelection(),O=document.createRange();O.selectNode(C.currentTarget),F?.removeAllRanges(),F?.addRange(O);},children:Y(I)},`chip-${W}-${E}`)}return Q.includes(`
45
45
  `)?Q.split(`
46
46
  `).map((W,I)=>jsxs(Oe__default.Fragment,{children:[W,I<Q.split(`
47
- `).length-1&&jsx("br",{})]},`line-${E}-${I}`)):Q}):null;return jsx("div",{className:"group flex flex-col",children:jsxs("div",{className:"flex flex-col",children:[e&&jsx(ze,{size:o,tooltip:n,isRequired:a,children:e}),jsx(ht,{children:jsx("div",{ref:N,contentEditable:!c,suppressContentEditableWarning:true,onInput:j=>{if(c)return;let Q=j.target,E=Q.querySelector("[data-chip-id]")!==null,M;if(E?(M=L(Q),M=M.replace(/(\{\{[^}]+\}\})\s{2,}/g,"$1 ").replace(/\s{2,}(\{\{[^}]+\}\})/g," $1")):M=Q.textContent||"",M===""){try{let C=document.createRange();C.selectNodeContents(Q),C.collapse(!0);let F=window.getSelection();F?.removeAllRanges(),F?.addRange(C),D.current=0;}catch{}H("",0);return}if(M===m)return;let W=window.getSelection(),I=0;if(W&&W.rangeCount>0)try{let C=W.getRangeAt(0);if(E){let F=0,O=!1,K=te=>{if(O)return !0;if(te===C.startContainer)return F+=C.startOffset,O=!0,!0;if(te.nodeType===Node.TEXT_NODE){if(!te.parentElement?.closest("[data-chip-id]")){if(te.contains(C.startContainer))return F+=C.startOffset,O=!0,!0;F+=(te.textContent||"").length;}}else if(te.nodeType===Node.ELEMENT_NODE){let de=te;if(de.hasAttribute("data-chip-id")){if(de.contains(C.startContainer)||de===C.startContainer){let ae=de.getAttribute("data-chip-id");return F+=`{{${ae}}}`.length,O=!0,!0}let _=de.getAttribute("data-chip-id");return F+=`{{${_}}}`.length,!1}else if(de.tagName==="BR")return de===C.startContainer?(O=!0,!0):(F+=1,!1)}for(let de=0;de<te.childNodes.length;de++)if(K(te.childNodes[de]))return !0;return !1};K(Q),I=F;}else {let F=document.createRange();F.setStart(Q,0),F.setEnd(C.startContainer,C.startOffset),I=F.toString().length;}}catch{I=M.length;}D.current=I,H(M,I);},onKeyDown:j=>{if(c)return;let Q=window.getSelection();if(!(!Q||Q.rangeCount===0))try{let E=Q.getRangeAt(0),M=E.commonAncestorContainer;if(j.key==="ArrowLeft"||j.key==="ArrowRight"){let W=M.nodeType===Node.TEXT_NODE?M.parentElement?.closest("[data-chip-id]"):M.closest("[data-chip-id]");if(W){j.preventDefault();try{let I=document.createRange(),C=window.getSelection();j.key==="ArrowLeft"?I.setStartBefore(W):I.setStartAfter(W),I.collapse(!0),C?.removeAllRanges(),C?.addRange(I);}catch{}}}if(j.key==="Backspace"){let W=null;if(W=(M.nodeType===Node.TEXT_NODE?M.parentElement?.closest("[data-chip-id]"):M.closest("[data-chip-id]"))||null,!W)if(M.nodeType===Node.TEXT_NODE){let I=M;if(E.startOffset===0&&I.parentElement){let C=I.previousSibling;if(C&&C.nodeType===Node.ELEMENT_NODE){let F=C.closest("[data-chip-id]");F&&(W=F);}}}else {let I=M;if(E.startOffset>0){let C=I.childNodes[E.startOffset-1];if(C&&C.nodeType===Node.ELEMENT_NODE){let F=C.closest("[data-chip-id]");F&&(W=F);}}}if(W){j.preventDefault(),j.stopPropagation();let I=W.getAttribute("data-chip-id");if(!I)return;let C=`{{${I}}}`,F=m.indexOf(C);if(F!==-1){let O=m.slice(0,F)+m.slice(F+C.length),K=g.filter(te=>te.id!==I);D.current=F;try{window.getSelection()?.removeAllRanges();}catch{}f?.(K),p?.(O);}}}}catch{}},onFocus:j=>{c||(w.onFocus&&w.onFocus(j),k(j));},onBlur:j=>{c||(w.onBlur&&w.onBlur(j),P(j));},className:U(),style:{whiteSpace:"pre-wrap",wordBreak:"break-word",...w.style},"data-placeholder":w.placeholder,children:q()},m===""?"empty":"content")}),t&&jsx(Te,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsx(be,{size:o,className:"mt-1",children:r}),typeof r=="function"&&d&&jsx(be,{size:o,className:"mt-1",children:r(d)})]})})}function qD({isPlaceholder:e,isDisabled:t,size:r="md"}){return twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[r],e?"text-text-disabled italic":"text-text-primary",t?"text-text-disabled cursor-not-allowed":"cursor-text",!t&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function Hy({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,reserveErrorSpace:c=true,validationResult:l,className:u,descriptionPlacement:d="below",...m}){return jsxs(TimeField,{...m,isDisabled:i,isRequired:a,isInvalid:s,className:ke(u,"flex flex-col gap-1"),children:[e&&jsx(ze,{size:o,tooltip:n,description:d==="tooltip"||d==="inline"?t:void 0,descriptionPlacement:d,isRequired:a,children:e}),jsx(ht,{children:jsx(DateInput,{className:twMerge(Vo({isInvalid:s,isDisabled:i}),"px-3 py-2 flex items-center gap-0.5 w-full"),children:p=>jsx(DateSegment,{segment:p,className:qD({isPlaceholder:p.isPlaceholder,isDisabled:!p.isEditable||i,size:o})})})}),c?jsx("div",{className:"mt-1 min-h-[20px]",children:typeof r=="string"?jsx(be,{size:o,children:r}):typeof r=="function"&&l?jsx(be,{size:o,children:r(l)}):t&&d==="below"?jsx(Te,{size:o,children:t}):null}):jsx(Fragment,{children:typeof r=="string"?jsx(be,{size:o,className:"mt-1",children:r}):typeof r=="function"&&l?jsx(be,{size:o,className:"mt-1",children:r(l)}):t&&d==="below"?jsx(Te,{size:o,className:"mt-1",children:t}):null})]})}function Wy({children:e,className:t=""}){return jsx("div",{className:`flex flex-col ${t}`.trim(),role:"list",children:e})}function Gy({children:e,variant:t="default",icon:r,label:o,isLast:n=false,className:a=""}){let s={default:{dot:"bg-border-default border-border-default",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},active:{dot:"bg-text-primary border-text-primary",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary font-medium"},muted:{dot:"bg-border-muted border-border-muted",line:"bg-border-muted",label:"text-text-secondary",content:"text-text-secondary"},success:{dot:"bg-feedback-success-border border-feedback-success-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},error:{dot:"bg-feedback-error-border border-feedback-error-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},warning:{dot:"bg-feedback-warning-border border-feedback-warning-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},info:{dot:"bg-feedback-info-border border-feedback-info-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"}}[t];return jsxs("div",{className:`flex gap-3 ${a}`.trim(),role:"listitem",children:[jsxs("div",{className:"flex flex-col items-center",style:{width:"20px"},children:[jsx("div",{className:`flex items-center justify-center rounded-full border-2 ${s.dot}`,style:{width:"20px",height:"20px",flexShrink:0},children:r&&jsx(B,{name:r,size:12,className:"text-background-body"})}),!n&&jsx("div",{className:`w-0.5 flex-1 ${s.line}`,style:{minHeight:"24px"}})]}),jsxs("div",{className:"flex-1 pb-6",children:[o&&jsx("div",{className:`text-xs mb-1 ${s.label}`,children:o}),jsx("div",{className:`text-sm ${s.content}`,children:e})]})]})}function eE(e){return "primary"}var tE="flex font-medium justify-center items-center gap-2 text-center transition whitespace-nowrap box-border",Uy={primary:{selected:"bg-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-action-primary border-2 border-border-muted hover:bg-text-primary/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"}},rE="opacity-[--control-hover-opacity] cursor-not-allowed pointer-events-none grayscale",oE="opacity-100 cursor-pointer",nE={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},aE={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function iE(e){let{variant:t="primary",size:r="md",isDisabled:o,isSelected:n,borderRadius:a,borderRight:i,borderLeft:s}=e,c=eE(),l=`${tE} ${n?Uy[c].selected:Uy[c].unselected}`;return l+=` ${Ge[r].text} ${Ge[r].height} ${Ge[r].padding} ${Ge[r].gap}`,l+=` ${o?rE:oE}`,a==="left"&&(l+=" rounded-l-sm"),a==="right"&&(l+=" rounded-r-sm"),i&&(l+=" border-r"),s&&(l+=" border-l"),l+=` ${Je()}`,(l+=" focus-visible:outline-action-primary"),twMerge(l)}function Yy(e){let{className:t,children:r,onPress:o,icon:n,iconPosition:a="left",iconWeight:i,isLoading:s=false,loadingText:c,loadingIndicator:l,size:u="md",badgeNumber:d,badgeVariant:m="primary",badgePosition:p="top-right",...g}=e,f=n?jsx(B,{name:n,size:u,weight:i}):null,h=()=>{let x=jsxs(Fragment,{children:[a==="left"&&f,r,a==="right"&&f]});return s?jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l||jsx(B,{name:"CircleNotch",size:u,className:"animate-spin","aria-hidden":"true"})}),jsx("div",{className:"invisible","aria-hidden":"true",children:x}),c&&jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:c})]}):x},b=jsx(ToggleButton,{onPress:o,...g,className:twMerge(iE(e),t),"aria-busy":s,children:h()});return d&&d>0?jsxs("div",{className:"relative",children:[b,jsx("span",{className:`absolute ${nE[p]} flex h-5 w-5 items-center justify-center rounded-full ${aE[m]} text-xs`,"aria-label":`${d} items`,children:d})]}):b}var lE={open:{className:"text-feedback-success-border",token:"--color-feedback-success-border",label:"Open"},closed:{className:"text-feedback-error-border",token:"--color-feedback-error-border",label:"Closed"}},cE={platform:{label:"Platform",description:"Core product objects that structure the Texture workspace.",icon:"Stack",order:0},grid:{label:"Grid Elements",description:"Physical utility-grid infrastructure imported from a customer's GIS export.",icon:"TreeStructure",order:1},device:{label:"Devices",description:"Behind-the-meter connected energy devices.",icon:"Lightning",order:2}},dE=["energized","customerName","gs_max_continuous_current"],it={TRANSFORMER:[{key:"primaryRatedVoltage",label:"Primary Voltage",format:{type:"voltage",unit:"V",decimals:0}},{key:"ratedOutputVoltage",label:"Output Voltage",format:{type:"voltage",unit:"V",decimals:0}},{key:"tranKvaA",label:"Rating Phase A",format:{type:"power",unit:"kVA",decimals:1}},{key:"tranKvaB",label:"Rating Phase B",format:{type:"power",unit:"kVA",decimals:1}},{key:"tranKvaC",label:"Rating Phase C",format:{type:"power",unit:"kVA",decimals:1}}],CONSUMER:[{key:"meterNumber",label:"Meter Number",format:{type:"text"}}],SOURCE:[{key:"busVoltage",label:"Bus Voltage",format:{type:"voltage",unit:"V",decimals:0}},{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}},{key:"substationNumber",label:"Substation Number",format:{type:"text"}}],SWITCH:[{key:"switchId",label:"Switch ID",format:{type:"text"}},{key:"ratedCurrent",label:"Rated Current",format:{type:"number",unit:"A",decimals:0}},{key:"normalState",label:"Normal State",format:{type:"text"}}],CAPACITOR:[{key:"unitSizeKvar",label:"Capacity",format:{type:"power",unit:"kVar",decimals:1}},{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}}],OVERCURRENT_DEVICE:[{key:"ratedCurrent",label:"Rated Current",format:{type:"number",unit:"A",decimals:0}},{key:"deviceType",label:"Device Type",format:{type:"text"}}],REGULATOR:[{key:"outputVoltagePhA",label:"Output Voltage Phase A",format:{type:"voltage",unit:"V",decimals:0}},{key:"outputVoltagePhB",label:"Output Voltage Phase B",format:{type:"voltage",unit:"V",decimals:0}},{key:"outputVoltagePhC",label:"Output Voltage Phase C",format:{type:"voltage",unit:"V",decimals:0}},{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kVA",decimals:1}}],OVERHEAD_LINE:[{key:"impedanceLength",label:"Length",format:{type:"distance",unit:"ft",decimals:0}},{key:"conductorDescPhA",label:"Conductor Phase A",format:{type:"text"}},{key:"conductorDescPhB",label:"Conductor Phase B",format:{type:"text"}},{key:"conductorDescPhC",label:"Conductor Phase C",format:{type:"text"}}],UNDERGROUND_LINE:[{key:"impedanceLength",label:"Length",format:{type:"distance",unit:"ft",decimals:0}},{key:"conductorDescPhA",label:"Conductor Phase A",format:{type:"text"}},{key:"conductorDescPhB",label:"Conductor Phase B",format:{type:"text"}},{key:"conductorDescPhC",label:"Conductor Phase C",format:{type:"text"}}],NODE:[{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}}],GENERATOR:[{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kW",decimals:1}},{key:"outputVoltage",label:"Output Voltage",format:{type:"voltage",unit:"V",decimals:0}}],MOTOR:[{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kW",decimals:1}},{key:"voltage",label:"Voltage",format:{type:"voltage",unit:"V",decimals:0}}]},oa={app:{icon:"AppWindow",category:"platform",archetype:"platform",detailPage:false,label:{singular:"App",plural:"Apps"},description:"Workspace tools and third-party integrations"},site:{icon:"MapPin",category:"platform",archetype:"platform",detailPage:true,label:{singular:"Site",plural:"Sites"},description:"Physical location housing energy systems"},device:{icon:"ShareNetwork",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Device",plural:"Devices"},description:"Connected, controllable energy device"},customer:{icon:"Users",category:"platform",archetype:"platform",detailPage:true,label:{singular:"Customer",plural:"Customers"},description:"End customer or owner of one or more sites"},contact:{icon:"Users",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Contact",plural:"Contacts"},description:"Person associated with a customer or site"},program:{icon:"ClipboardText",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Program",plural:"Programs"},description:"Demand-response or virtual power plant program"},workflow:{icon:"FlowArrow",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Workflow",plural:"Workflows"},description:"Automated rule that runs in response to events"},collection:{icon:"Stack",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Collection",plural:"Collections"},description:"Named group of related entities or records"},board:{icon:"SquaresFour",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Board",plural:"Boards"},description:"Dashboard for monitoring metrics and devices"},report:{icon:"ChartLine",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Report",plural:"Reports"},description:"Saved analytics view or generated report"},event:{icon:"ClockCounterClockwise",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Event",plural:"Events"},description:"Recorded system event or logged activity"},alert:{icon:"Warning",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Alert",plural:"Alerts"},description:"Notification raised when attention is needed"},monitor:{icon:"Pulse",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Monitor",plural:"Monitors"},description:"Rule that watches a metric against a threshold"},command:{icon:"Play",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Command",plural:"Commands"},description:"Control action issued to a connected device"},source:{icon:"TextureSource",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.SOURCE},label:{singular:"Source",plural:"Sources"},description:"Upstream feed where the network originates"},substation:{icon:"TextureSource",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.SOURCE},label:{singular:"Substation",plural:"Substations"},description:"Facility that steps down transmission voltage"},capacitor:{icon:"TextureCapacitor",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.CAPACITOR},label:{singular:"Capacitor",plural:"Capacitors"},description:"Capacitor bank for power-factor and voltage support"},switch:{icon:"TextureSwitchClosed",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.SWITCH},label:{singular:"Switch",plural:"Switches"},description:"Sectionalizing or disconnect switch on the line",states:{open:{icon:"TextureSwitch",color:"open"},closed:{icon:"TextureSwitchClosed",color:"closed"}}},sectionalizer:{icon:"TextureSectionalizerClosed",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.SWITCH},label:{singular:"Sectionalizer",plural:"Sectionalizers"},description:"Counts upstream recloser trips and opens to isolate a faulted section",states:{open:{icon:"TextureSectionalizerOpen",color:"open"},closed:{icon:"TextureSectionalizerClosed",color:"closed"}}},relay:{icon:"Cpu",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.NODE},label:{singular:"Relay",plural:"Relays"},description:"Microprocessor relay that senses faults and trips devices"},transformer:{icon:"TextureTransformer",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.TRANSFORMER},label:{singular:"Transformer",plural:"Transformers"},description:"Transformer that steps voltage up or down"},meter:{icon:"Gauge",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.CONSUMER},label:{singular:"Meter",plural:"Meters"},description:"Revenue meter at the point of consumption",fusedMetricId:"power",fields:{headlineMetrics:[{id:"power",label:"device.meter.fields.power",source:{kind:"state",path:"state.phaseARealPower"},format:{type:"power",unit:"kW",decimals:2},icon:"Pulse"},{id:"consumption",label:"device.meter.fields.consumption",source:{kind:"state",path:"state.latestKwhUsage"},format:{type:"energy",sourceUnit:"kWh",decimals:2},icon:"Lightning"},{id:"voltage",label:"device.meter.fields.voltage",source:{kind:"state",path:"state.phaseAVoltage"},format:{type:"voltage",decimals:1},icon:"Lightning"},{id:"current",label:"device.meter.fields.current",source:{kind:"state",path:"state.phaseACurrent"},format:{type:"current",decimals:2},icon:"Lightning"}]}},consumer:{icon:"Gauge",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.CONSUMER},label:{singular:"Consumer",plural:"Consumers"},description:"Service point or customer premise on the grid"},singlePhaseOverheadLine:{icon:"TextureSinglePhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.OVERHEAD_LINE},label:{singular:"Single-Phase Overhead Line",plural:"Single-Phase Overhead Lines"},description:"Overhead line carrying one phase conductor"},twoPhaseOverheadLine:{icon:"TextureTwoPhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.OVERHEAD_LINE},label:{singular:"Two-Phase Overhead Line",plural:"Two-Phase Overhead Lines"},description:"Overhead line carrying two phase conductors"},threePhaseOverheadLine:{icon:"TextureThreePhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.OVERHEAD_LINE},label:{singular:"Three-Phase Overhead Line",plural:"Three-Phase Overhead Lines"},description:"Overhead line carrying three phase conductors"},singlePhaseUndergroundLine:{icon:"TextureSinglePhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.UNDERGROUND_LINE},label:{singular:"Single-Phase Underground Line",plural:"Single-Phase Underground Lines"},description:"Buried line carrying one phase conductor"},twoPhaseUndergroundLine:{icon:"TextureTwoPhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.UNDERGROUND_LINE},label:{singular:"Two-Phase Underground Line",plural:"Two-Phase Underground Lines"},description:"Buried line carrying two phase conductors"},threePhaseUndergroundLine:{icon:"TextureThreePhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.UNDERGROUND_LINE},label:{singular:"Three-Phase Underground Line",plural:"Three-Phase Underground Lines"},description:"Buried line carrying three phase conductors"},motorSwitch:{icon:"Diamond",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.MOTOR},label:{singular:"Motor Switch",plural:"Motor Switches"},description:"Motor-operated switch or motor load element"},recloser:{icon:"TextureRecloser",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.OVERCURRENT_DEVICE},label:{singular:"Recloser",plural:"Reclosers"},description:"Auto-reclosing device that clears transient faults",states:{open:{color:"open"},closed:{color:"closed"}}},fuse:{icon:"TextureFuse",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.OVERCURRENT_DEVICE},label:{singular:"Fuse",plural:"Fuses"},description:"Fusible element providing overcurrent protection"},breaker:{icon:"TextureBreaker",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.OVERCURRENT_DEVICE},label:{singular:"Breaker",plural:"Breakers"},description:"Circuit breaker that interrupts fault current",states:{open:{color:"open"},closed:{color:"closed"}}},generator:{icon:"Wind",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.GENERATOR},label:{singular:"Generator",plural:"Generators"},description:"Distributed generation unit feeding the grid"},regulator:{icon:"TextureRegulator",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.REGULATOR},label:{singular:"Regulator",plural:"Regulators"},description:"Voltage regulator that holds line voltage in range"},supportStructure:{icon:"TextureSupportStructure",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.NODE},label:{singular:"Support Structure",plural:"Support Structures"},description:"Structure carrying overhead line equipment"},battery:{icon:"BatteryHigh",category:"device",archetype:"device",detailPage:true,label:{singular:"Battery",plural:"Batteries"},description:"Behind-the-meter battery or storage system",fusedMetricId:"soc",fields:{headlineMetrics:[{id:"power",label:"device.battery.fields.power",source:{kind:"state",path:"state.gridPower"},format:{type:"power",decimals:1},icon:"Lightning"},{id:"soc",label:"device.battery.fields.soc",source:{kind:"state",path:"state.chargePercentage"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"backupReserve",label:"device.battery.fields.backupReserve",source:{kind:"state",path:"state.backupReserve"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"loadPower",label:"device.battery.fields.loadPower",source:{kind:"state",path:"state.loadPower"},format:{type:"power",decimals:1},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.battery.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"},secondaryState:{label:"device.battery.fields.gridState",fieldPath:"state.gridStatus",mapping:{importing:"importing",exporting:"exporting",idle:"importing",unknown:"importing"},fallback:"importing"}}},evCharger:{icon:"ChargingStation",category:"device",archetype:"device",detailPage:true,label:{singular:"EV Charger",plural:"EV Chargers"},description:"Electric-vehicle charging station or port",fusedMetricId:"power",fields:{headlineMetrics:[{id:"power",label:"device.evCharger.fields.power",source:{kind:"state",path:"state.chargerWattage"},format:{type:"power",decimals:1},icon:"Lightning"},{id:"isPluggedIn",label:"device.evCharger.fields.isPluggedIn",source:{kind:"state",path:"state.isPluggedIn"},format:{type:"boolean",trueText:"Yes",falseText:"No"},icon:"Plug"},{id:"voltage",label:"device.evCharger.fields.voltage",source:{kind:"state",path:"state.chargerVoltage"},format:{type:"voltage",decimals:1},icon:"Lightning"},{id:"current",label:"device.evCharger.fields.current",source:{kind:"state",path:"state.chargerCurrent"},format:{type:"current",decimals:1},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.evCharger.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"}}},inverter:{icon:"Sun",category:"device",archetype:"device",detailPage:true,label:{singular:"Solar / Inverter",plural:"Solar / Inverters"},description:"Solar PV inverter and its connected array",fusedMetricId:"power",fields:{headlineMetrics:[{id:"power",label:"device.inverter.fields.power",source:{kind:"state",path:"state.power"},format:{type:"power",decimals:0},icon:"Lightning"},{id:"gridPower",label:"device.inverter.fields.gridPower",source:{kind:"state",path:"state.gridPower"},format:{type:"power",decimals:0},icon:"GridFour"},{id:"generatedEnergy",label:"device.inverter.fields.generatedEnergy",source:{kind:"state",path:"state.generatedEnergy"},format:{type:"energy",decimals:1},icon:"Lightning"},{id:"lifetimeEnergyGenerated",label:"device.inverter.fields.lifetimeEnergyGenerated",source:{kind:"state",path:"state.lifetimeEnergyGenerated"},format:{type:"energy",decimals:0},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.inverter.fields.gridStatus",fieldPath:"state.gridStatus",mapping:{exporting:"exporting",importing:"importing",idle:"idle"},fallback:"unknown"}}},thermostat:{icon:"Thermometer",category:"device",archetype:"device",detailPage:true,label:{singular:"Thermostat",plural:"Thermostats"},description:"Smart thermostat or connected HVAC control",fusedMetricId:"ambientTemperature",fields:{headlineMetrics:[{id:"ambientTemperature",label:"device.thermostat.fields.ambientTemperature",source:{kind:"state",path:"state.ambientTemperature"},format:{type:"temperature",decimals:0},icon:"Thermometer"},{id:"heatTarget",label:"device.thermostat.fields.heatTarget",source:{kind:"state",path:"state.heatTarget"},format:{type:"temperature",decimals:0},icon:"Flame"},{id:"coolTarget",label:"device.thermostat.fields.coolTarget",source:{kind:"state",path:"state.coolTarget"},format:{type:"temperature",decimals:0},icon:"Snowflake"},{id:"fanMode",label:"device.thermostat.fields.fanMode",source:{kind:"state",path:"state.fanMode"},format:{type:"text"}}]},stateRules:{primaryState:{label:"device.thermostat.fields.operatingMode",fieldPath:"state.operatingMode",mapping:{heat:"heat",cool:"cool",auto:"auto",off:"off",eco:"eco",unknown:"unknown"},fallback:"unknown"}}},vehicle:{icon:"Car",category:"device",archetype:"device",detailPage:true,label:{singular:"EV",plural:"EVs"},description:"Electric vehicle managed as a flexible load",fusedMetricId:"chargePercentage",fields:{headlineMetrics:[{id:"chargePercentage",label:"device.vehicle.fields.chargePercentage",source:{kind:"state",path:"state.chargePercentage"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"range",label:"device.vehicle.fields.range",source:{kind:"state",path:"state.range"},format:{type:"distance",unit:"mi",decimals:0},icon:"GasPump"},{id:"chargeLimit",label:"device.vehicle.fields.chargeLimit",source:{kind:"state",path:"state.chargeLimit"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"isPluggedIn",label:"device.vehicle.fields.isPluggedIn",source:{kind:"state",path:"state.isPluggedIn"},format:{type:"boolean",trueText:"Yes",falseText:"No"},icon:"Plug"}]},stateRules:{primaryState:{label:"device.vehicle.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"}}},waterHeater:{icon:"Drop",category:"device",archetype:"device",detailPage:true,label:{singular:"Water Heater",plural:"Water Heaters"},description:"Connected or smart electric water heater"}},uE={source:"SOURCE",substation:"SOURCE",capacitor:"CAPACITOR",switch:"SWITCH",sectionalizer:"SWITCH",relay:"NODE",transformer:"TRANSFORMER",meter:"CONSUMER",consumer:"CONSUMER",singlePhaseOverheadLine:"OVERHEAD_LINE",twoPhaseOverheadLine:"OVERHEAD_LINE",threePhaseOverheadLine:"OVERHEAD_LINE",singlePhaseUndergroundLine:"UNDERGROUND_LINE",twoPhaseUndergroundLine:"UNDERGROUND_LINE",threePhaseUndergroundLine:"UNDERGROUND_LINE",motorSwitch:"MOTOR",recloser:"OVERCURRENT_DEVICE",fuse:"OVERCURRENT_DEVICE",breaker:"OVERCURRENT_DEVICE",generator:"GENERATOR",regulator:"REGULATOR",supportStructure:"NODE"};function gc(e){return oa[e]}function pE(e){return oa[e].icon}function mE(e,t=false){return t?oa[e].label.plural:oa[e].label.singular}function fE(e){return oa[e].category}var gE={min:2,max:4};function bE(e){let t=oa[e];if(!t)throw new Error(`archetypeFor: unknown entity type "${String(e)}"`);return t.archetype}function xE(e){return gc(e).detailPage}function hE(e){return (gc(e).fields?.headlineMetrics.length??0)>0}function Jy(e){return gc(e).properties?.statList??[]}function yE(e){return Jy(e).length>0}function vE({formId:e="dialog-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:i="secondary",children:s,title:c,...l}){return jsx(Nr,{title:c,primaryAction:{label:r,onPress:()=>{let d=document.getElementById(e);d&&d.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:i}:void 0,...l,children:jsx(Fa,{id:e,onSubmit:t,children:s})})}function CE({formId:e="drawer-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:i="secondary",children:s,...c}){return jsx(Ei,{primaryAction:{label:r,onPress:()=>{let u=document.getElementById(e);u&&u.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:i}:void 0,...c,children:jsx(Fa,{id:e,onSubmit:t,className:"mt-2",children:s})})}function wE({align:e="end",className:t,...r}){return jsx("div",{...r,className:twMerge("flex gap-2",e==="start"?"justify-start":e==="between"?"justify-between":"justify-end",t)})}var TE={sm:"gap-2",md:"gap-4",lg:"gap-6"};function PE(e){if(!e)return "";let t=e.base?`grid-cols-${e.base}`:"",r=e.md?`md:grid-cols-${e.md}`:"",o=e.lg?`lg:grid-cols-${e.lg}`:"";return [t,r,o].filter(Boolean).join(" ")}function RE({cols:e={base:1},gap:t="lg",className:r,...o}){return jsx("div",{...o,className:twMerge("grid",PE(e),TE[t],r)})}function EE({title:e,description:t,showDivider:r,className:o,children:n,...a}){return jsxs("section",{...a,className:twMerge("flex flex-col",o),children:[(e||t)&&jsxs("div",{className:"flex flex-col gap-1 mb-6",children:[typeof e=="string"?jsx(Qt,{tag:"h3",size:"sm",children:e}):e,t?jsx(Te,{size:"lg",children:t}):null]}),jsx("div",{className:"flex flex-col gap-6",children:n}),r&&jsx("hr",{className:"mt-2 border-border-muted"})]})}function LE(){return jsx("hr",{className:"border-border-muted"})}function AE({steps:e,currentStepId:t,onStepClick:r,className:o}){let n=e.findIndex(a=>a.id===t);return jsx("nav",{"aria-label":"Progress",className:twMerge("w-full",o),children:jsx("div",{className:"relative mb-12",children:jsx("ol",{className:"relative flex items-start justify-between",children:e.map((a,i)=>{let s=a.id===t,c=i<n,l=r&&(c||s);return jsxs("li",{className:"relative flex flex-col items-center",style:{flex:`1 1 ${100/e.length}%`},children:[jsx("button",{type:"button",disabled:!l,onClick:()=>l&&r?.(a.id),className:twMerge("relative z-10 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors bg-background-body",c&&"border-action-primary bg-action-primary text-text-inverse hover:bg-action-primary/90",s&&"border-action-primary bg-background-body text-action-primary",!c&&!s&&"border-border-default bg-background-body text-text-secondary",l&&"cursor-pointer",!l&&"cursor-default"),"aria-current":s?"step":void 0,children:c?jsx(B,{name:"Check",size:20,weight:"bold"}):jsx("span",{className:"text-sm font-semibold",children:i+1})}),i<e.length-1&&jsx("div",{className:"absolute top-5 h-0.5 transition-colors",style:{left:"50%",width:"100%",marginLeft:"20px",backgroundColor:i<n?"var(--color-action-primary)":"var(--color-border-default)"}}),jsxs("div",{className:"mt-3 flex flex-col items-center text-center w-32",children:[jsx("span",{className:twMerge("text-sm font-medium",s&&"text-text-default",c&&"text-text-primary",!s&&!c&&"text-text-secondary"),children:a.title}),a.description&&jsx("span",{className:"mt-1 text-xs text-text-secondary",children:a.description})]})]},a.id)})})})})}function FE({formId:e,show:t,isSubmitting:r,onCancel:o,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:i}){return t?jsx("div",{className:twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",i),children:jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsx("div",{className:"text-sm text-text-secondary",children:"You have unsaved changes"}),jsxs("div",{className:"flex gap-2",children:[jsx(Z,{variant:"secondary",onPress:o,children:a}),jsx(Z,{type:"submit",form:e,isDisabled:!!r,children:r?"Saving...":n})]})]})}):null}function BE({when:e,message:t="You have unsaved changes. Leave anyway?"}){return Oe.useEffect(()=>{if(!e)return;let r=o=>(o.preventDefault(),o.returnValue=t,t);return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[e,t]),null}function VE({steps:e,initialStepId:t,canNavigate:r}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[o,n]=Oe.useState(t||e[0].id),a=e.findIndex(d=>d.id===o),i=a>0,s=a<e.length-1,c=async d=>d===o?true:r&&!await r(o,d)?false:(n(d),true);return {steps:e,currentStepId:o,setCurrentStepId:c,next:async()=>!s||a===-1?false:c(e[a+1].id),prev:async()=>!i||a===-1?false:c(e[a-1].id),hasNext:s,hasPrev:i,stepIndex:a}}function $i(e,t){return t.split(".").reduce((r,o)=>r?.[o],e)}function OE(e,t){let r=$i(e,t.field),o=t.value;switch(t.operator){case "eq":return r===o;case "neq":return r!==o;case "in":return Array.isArray(o)?Array.isArray(r)?r.some(n=>o.includes(n)):o.includes(r):false;case "nin":return Array.isArray(o)?Array.isArray(r)?!r.some(n=>o.includes(n)):!o.includes(r):false;case "gt":return r instanceof Date&&typeof o=="string"?r>new Date(o):r>o;case "gte":return r instanceof Date&&typeof o=="string"?r>=new Date(o):r>=o;case "lt":return r instanceof Date&&typeof o=="string"?r<new Date(o):r<o;case "lte":return r instanceof Date&&typeof o=="string"?r<=new Date(o):r<=o;case "contains":return typeof r!="string"?false:r.toLowerCase().includes(String(o).toLowerCase());case "startsWith":return typeof r!="string"?false:r.toLowerCase().startsWith(String(o).toLowerCase());case "endsWith":return typeof r!="string"?false:r.toLowerCase().endsWith(String(o).toLowerCase());default:return false}}function ev(e,t){if(t.conditions.length===0)return true;let r=t.conditions.map(o=>"conditions"in o?ev(e,o):OE(e,o));return t.logic==="AND"?r.every(Boolean):r.some(Boolean)}function HE(e,t){return !t||t.conditions.length===0?e:e.filter(r=>ev(r,t))}function WE(e,t,r){if(e==null&&t==null)return 0;if(e==null)return r==="asc"?1:-1;if(t==null)return r==="asc"?-1:1;if(e instanceof Date&&t instanceof Date){let o=e.getTime()-t.getTime();return r==="asc"?o:-o}if(typeof e=="string"&&typeof t=="string"){let o=e.toLowerCase().localeCompare(t.toLowerCase());return r==="asc"?o:-o}return e<t?r==="asc"?-1:1:e>t?r==="asc"?1:-1:0}function GE(e,t){return t?[...e].sort((r,o)=>{let n=$i(r,t.field),a=$i(o,t.field);return WE(n,a,t.direction)}):e}function UE(e,t){if(!t||!t.query.trim())return e;let{query:r,fields:o,fuzzy:n=true,threshold:a=.3}=t;if(n)return new zE(e,{keys:o,threshold:a,ignoreLocation:true,includeScore:true}).search(r).map(l=>l.item);let i=r.toLowerCase();return e.filter(s=>o.some(c=>{let l=$i(s,c);return l==null?false:String(l).toLowerCase().includes(i)}))}function KE(e,t){let r={};for(let o of t){if(r[o.field]={},o.values)for(let n of o.values)r[o.field][String(n.value)]=0;for(let n of e){let a=$i(n,o.field);if(a!=null)if(Array.isArray(a))for(let i of a){let s=String(i);r[o.field][s]=(r[o.field][s]||0)+1;}else {let i=String(a);r[o.field][i]=(r[o.field][i]||0)+1;}}}return r}function Ep({data:e,filters:t,sort:r,search:o,facetConfigs:n=[]}){let a=UE(e,o||null);a=HE(a,t||null);let i=KE(a,n);return a=GE(a,r||null),{data:a,facetCounts:i,resultCount:a.length}}function xc({data:e,filters:t,sort:r,search:o,facetConfigs:n=[]}){return useMemo(()=>Ep({data:e,filters:t,sort:r,search:o,facetConfigs:n}),[e,t,r,o,n])}function hc({filters:e,sort:t,search:r,onStateChange:o,searchDebounce:n=300}){let a=Bo(r,n),i=useRef(true);useEffect(()=>{if(i.current){i.current=false;return}o({filters:e,sort:t,search:a});},[e,t,a,o]);}function tv(e){return e.mode==="client"?xc({data:e.data,filters:e.filters,sort:e.sort,search:e.search,facetConfigs:e.facetConfigs}):(hc({filters:e.filters,sort:e.sort,search:e.search,onStateChange:e.onStateChange,searchDebounce:e.searchDebounce}),{data:e.data,facetCounts:e.facetCounts||{},resultCount:e.resultCount??e.data.length})}var rv=Op(iu());function qE(e,t,r=true){let o=e;if(r){let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return `${o}-${n}.${t}`}return `${o}.${t}`}function QE(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function ov(e,t){let r=QE(t,e);return e.exportValue?e.exportValue(r,t)??"":r==null?"":r instanceof Date?r.toISOString():typeof r=="object"?JSON.stringify(r):r}function Lp(e){return e.filter(t=>t.exportable!==false)}function nv(e){let t=e.map(n=>n.exportLabel||n.label),r=new Set,o=[];for(let n of t)r.has(n)?o.includes(n)||o.push(n):r.add(n);if(o.length>0)throw new Error(`Duplicate export headers found: ${o.join(", ")}. Use exportLabel to provide unique headers.`)}async function Ap(e){let{columns:t,data:r,metadata:o={}}=e;try{let n=Lp(t);if(n.length===0)throw new Error("No exportable columns found");nv(n);let a=r.map(l=>{let u={};for(let d of n){let m=d.exportLabel||d.label;u[m]=ov(d,l);}return u}),i=nk.unparse(a,{header:!0,skipEmptyLines:!0}),s=new Blob([i],{type:"text/csv;charset=utf-8;"}),c=qE(o.filename||"table-data","csv",o.timestamp!==!1);(0,rv.saveAs)(s,c);}catch(n){throw new Error(`CSV export failed: ${n instanceof Error?n.message:"Unknown error"}`)}}function ZE(e){let{columns:t,data:r}=e,o=Lp(t);return nv(o),r.map(n=>{let a={};for(let i of o){let s=i.exportLabel||i.label;a[s]=ov(i,n);}return a})}function _E(e){return Lp(e).map(t=>t.exportLabel||t.label)}function av({columns:e,data:t,metadata:r}){let n=e.filter(i=>i.exportable!==false).length>0&&t.length>0;return {exportCSV:useCallback(async()=>{try{await Ap({columns:e,data:t,metadata:r});}catch(i){throw console.error("Table export failed:",i),i}},[e,t,r]),canExport:n}}function doe(e){switch(e){case "charging":case "on":return "success";case "discharging":return "warning";case "heat":case "cool":return "info";case "off":case "idle":case "eco":case "auto":return "neutral";default:return "neutral"}}export{dE as ABSENT_GRID_FIELDS,Ub as ActionCell,fa as ActionMenu,vd as ActivityFeed,hs as ActivityFeedGroup,ys as ActivityItem,cf as Alert,bf as AppShell,Yo as AreaSeries,wl as AutoMobileRenderer,Rs as Autocomplete,bo as Avatar,sn as BREAKPOINTS,nt as Badge,Yb as BadgeCell,Ds as Banner,Ws as BarSeries,Jb as BooleanCell,Qp as BrandProvider,Ls as BreadcrumbItem,Es as Breadcrumbs,Z as Button,ia as CUSTOM_ICON_REGISTRY,ha as Calendar,Ue as Card,pd as CardContent,md as CardFooter,dd as CardHeader,ud as CardMedia,Nl as CardMobileRenderer,Yf as CarouselAutoplayTrigger,Wf as CarouselControl,Gd as CarouselIndicator,Kf as CarouselIndicatorGroup,Hf as CarouselItem,Of as CarouselItemGroup,Uf as CarouselNextTrigger,Gf as CarouselPrevTrigger,Jf as CarouselProgressText,zf as CarouselRoot,wg as CategoryBarChart,Rr as ChartAxis,Ta as ChartBottomBar,Gg as ChartContainer,Pr as ChartContext,Xs as ChartEventMarkers,js as ChartEventSpans,Jo as ChartTooltip,Cn as Checkbox,Ud as CheckboxGroup,eo as Chip,$f as ChipInputField,ai as ClearButton,rg as CodeEditor,ya as Collapse,Uo as CollapseContent,Go as CollapseHeader,Wo as CollapseItem,lN as ColorField,sm as ColorModeProvider,Fx as CommandPalette,lg as Confirm,cg as ConnectionStatusBadge,dg as ContactCard,jb as ContactMetaCell,Vs as ContactMetaDisplay,mg as ContainerQueryProvider,zo as CopyToClipboard,qb as CustomCell,_l as DEFAULT_MAP_TYPE,Ab as DataControls,wx as DataTable,Qb as DateCell,Bb as DateField,sl as DateRangePicker,Te as Description,kx as DeviceHealthBadge,_b as DeviceMetaCell,ml as DeviceMetaDisplay,zn as DeviceStateBadge,tx as DeviceStateCell,bl as DeviceStateWithMetric,Px as DeviceTypeIcon,Nr as Dialog,vE as DialogForm,Ht as DialogHeader,Ei as Drawer,CE as DrawerForm,cE as ENTITY_CATEGORY_CONFIG,oa as ENTITY_CONFIG,$s as EmptyState,Mx as EnrollmentStatusBadge,Vr as ErrorBoundary,be as FieldError,yf as FieldGroup,Ex as FileUpload,Ib as FilterChips,Hb as FilterDialog,Ax as FirmwareVersionBadge,Fa as Form,wE as FormActions,LE as FormDivider,RE as FormGrid,EE as FormSection,AE as FormStepper,oe as FormatRegistry,ox as FormattedCell,Jg as FunnelSeries,uE as GRID_ELEMENT_TYPE_BY_ENTITY,lE as GRID_STATE_COLORS,it as GRID_STAT_LIST,zx as GlobalSearch,ju as Grid,gl as GridStateBadge,gE as HEADLINE_METRIC_BOUNDS,Qt as Heading,ph as HierarchyExplorer,Bu as HorizontalBarCell,pR as HoverCard,B as Icon,wr as InfiniteScrollIndicator,ks as Input,ht as InputWrapper,Ui as InteractiveMap,gh as Kpi,op as KpiGroup,ze as Label,Tn as LineSeries,Ch as List,wR as ListBox,_t as ListBoxItem,wh as ListItem,Nh as ListPane,fo as Loader,ba as Logo,_h as MAP_TYPES,oy as Meter,Vu as MiniBarCell,cr as ModalBackdrop,oc as Notice,nc as NoticeContainer,ay as NoticeProvider,lx as NumberCell,Ti as NumberField,Df as PageBanner,Qn as PageLayout,zu as PercentBarCell,my as PlaceSearch,st as Popover,gy as ProgressBar,by as Prose,Cy as Radio,xy as RadioCard,hy as RadioCardGroup,vy as RadioGroup,Ma as RangeCalendar,Si as ResultsCount,Ny as RichTextEditor,Zo as SKELETON_SIZES,Jc as SOURCE_UNIT_TO_WH,FE as SaveBar,In as SearchControl,Ox as SearchEmptyState,Wx as SearchLoadingState,Ux as SearchResultGroup,Kx as SearchResultItem,Yx as SearchResultsList,Xx as SearchTrigger,Ka as Section,sc as SectionNav,tl as SegmentedControl,go as Select,dx as SelectCell,Cs as SideNav,ky as SiteCard,Py as SiteContactCard,px as SiteMetaCell,yl as SiteMetaDisplay,J as Skeleton,Ry as Slider,wi as SortControl,Ou as SparklineCell,fc as SplitPane,Ss as StackNav,Ll as StatList,Ua as StaticMap,ll as Switch,pc as Tab,uc as TabList,dy as TabPanel,dc as Tabs,Iy as TextArea,zy as TextAreaWithChips,bx as TextCell,Er as TextField,Ze as TextLink,Zs as TiledTimeSeriesChart,Rb as TiledTimeSeriesExplorer,rl as TimeControls,Hy as TimeField,Wy as Timeline,Gy as TimelineItem,Yy as ToggleButton,Zt as Tooltip,ni as TopNav,lt as Tray,BE as UnsavedChangesPrompt,K1 as activeDeviceStates,Qo as addFilterCondition,Ep as applyDataOperations,bE as archetypeFor,db as assembleSeries,RC as autoScaleCurrent,bm as autoScaleDistance,vm as autoScaleEnergy,BC as autoScalePower,VC as autoScaleResistance,KC as autoScaleVoltage,zN as baselineFromPoint,Bm as camelCaseToWords,Im as capitalize,zC as celsiusToFahrenheit,jA as celsiusToKelvin,MA as centimetersToInches,os as clearColorCache,dC as createCategoryColorMap,Ni as createEmptyFilter,s1 as createFilter,l1 as createFilters,C5 as createFormat,rt as createTextureIcon,Xg as createTiledCameraSyncGroup,tu as createXScale,ui as createYScale,nd as csvUnitFor,Om as csvValueFor,Ie as defaultMargin,Y1 as deviceStateLabels,_G as deviceStateMetricFormats,ub as emptyStore,xE as entityHasDetailPage,yE as entityHasStatList,hE as entityShowsNow,GC as enumToSentenceCase,lu as exportChart,Ap as exportTableAsCSV,OC as fahrenheitToCelsius,qA as fahrenheitToKelvin,vA as feetToMeters,wA as feetToMiles,c1 as filterToChips,lm as formatBoolean,_L as formatCapacity,jr as formatComponentValue,mm as formatCurrency,Vc as formatCurrent,fm as formatDate,xm as formatDistance,ul as formatEmptyValue,Xc as formatEnergy,Br as formatFieldValue,jc as formatInternationalPhone,pm as formatNumber,dm as formatPercent,Cm as formatPhone,ca as formatPhoneNumber,_c as formatPower,$L as formatPowerRating,ed as formatResistance,Mm as formatTemperature,zm as formatText,ss as formatUSPhone,od as formatVoltage,Wb as getBadgeClasses,Gb as getBooleanBadgeVariant,Eu as getCellAlignmentClasses,Me as getCellContainerClasses,Lr as getCellTextClasses,uC as getContrastingTextColor,fA as getDateParts,Qa as getDefaultChartColor,_p as getDefaultColors,Iu as getDeviceStateDisplayLabel,Iu as getDeviceStateLabel,fE as getEntityCategory,gc as getEntityConfig,pE as getEntityIcon,mE as getEntityLabel,Jy as getEntityStatList,ho as getEventColor,ck as getExportFormatName,_E as getExportHeaders,dS as getFieldGroupStyles,Bn as getFilterFields,ex as getGridStateLabel,hf as getInputBackgroundStyles,Vt as getInputBaseStyles,Vo as getInputStateStyles,Lu as getLinkClasses,pl as getNumericColorClasses,Tt as getResolvedColor,nr as getSkeletonSize,doe as getStateTone,ln as getThemeCategoricalColors,Or as getYFormatSettings,X1 as gridStateLabels,RA as inchesToCentimeters,Au as isActiveDeviceState,Au as isActiveState,pp as isCustomPinsLayer,lk as isExportSupported,il as isFilterEmpty,up as isGeoJsonLayer,$p as isLightColor,me as isNil,mp as isRasterLayer,dp as isVectorLayer,HC as kelvinToCelsius,QA as kelvinToFahrenheit,SA as kilometersToMiles,cp as layer,Rc as mapValuesToCategoricalColors,yA as metersToFeet,NA as metersToMiles,PA as metersToYards,gm as milesToFeet,CA as milesToKilometers,kA as milesToMeters,Eo as parseBoolean,Yc as pickEnergyUnit,ZE as prepareTableDataForExport,ty as registerPhosphorIcon,Fn as removeFilterCondition,Se as resolveValue,Vm as snakeCaseToWords,Nm as temperatureStringToSymbol,_s as tierForViewport,pT as tileIndexAt,rr as tileKey,pb as tileReducer,Xo as tilesForViewport,cA as toA,yC as toActiveInactive,as as toAmps,Do as toBoolean,Tm as toCelsius,AC as toCentimeters,CC as toCheckmark,kC as toCompactNumber,um as toCurrency,LC as toCustomDateFormat,MC as toDateString,xC as toEnabledDisabled,km as toFahrenheit,Hc as toFeet,wC as toFloat,NC as toFormattedNumber,DC as toFullDateTime,WA as toGW,ym as toGWh,Zc as toGigawatts,EC as toISOString,FC as toInches,SC as toInteger,dA as toKA,n5 as toKV,OA as toKW,Pm as toKelvin,Bc as toKiloamps,Sm as toKilohms,Oc as toKilometers,rd as toKilovolts,qc as toKilowatts,Em as toLowerCase,lA as toMA,r5 as toMV,HA as toMW,hm as toMWh,Qc as toMegawatts,wm as toMegohms,zc as toMeters,Wc as toMiles,Fc as toMilliamps,IC as toMillimeters,$c as toMilliohms,td as toMillivolts,hA as toNauticalMiles,cs as toOhms,hC as toOnOff,cm as toPercentage,is as toRelativeTime,TC as toScientificNotation,UC as toSecret,Lm as toSentenceCase,Rm as toTemperature,Am as toTitleCase,vC as toTrueFalse,Dm as toUpperCase,o5 as toV,ps as toVolts,zA as toW,ls as toWatts,Uc as toWh,Gc as toYards,Kc as tokWh,us as truncateEnd,da as truncateMiddle,ds as truncateStart,ft as typeRole,qr as typographyRole,Fm as ucFirst,Xt as useBreakpoint,kn as useChartContext,xc as useClientDataControls,Bt as useColorMode,oA as useComponentFormatter,ug as useContainerBreakpoint,tv as useDataControls,Bo as useDebounce,xa as useElementSize,Io as useInfiniteScroll,Tr as useInputFocus,Gl as useLocalStorage,Jt as useMediaQuery,sy as useNotice,hc as useServerDataControls,av as useTableExport,yb as useTileWindow,yu as useTiledTimeSeries,VE as useWizard,ao as wrapWithLink,TA as yardsToMeters};//# sourceMappingURL=index.js.map
47
+ `).length-1&&jsx("br",{})]},`line-${E}-${I}`)):Q}):null;return jsx("div",{className:"group flex flex-col",children:jsxs("div",{className:"flex flex-col",children:[e&&jsx(ze,{size:o,tooltip:n,isRequired:a,children:e}),jsx(ht,{children:jsx("div",{ref:N,contentEditable:!c,suppressContentEditableWarning:true,onInput:j=>{if(c)return;let Q=j.target,E=Q.querySelector("[data-chip-id]")!==null,M;if(E?(M=L(Q),M=M.replace(/(\{\{[^}]+\}\})\s{2,}/g,"$1 ").replace(/\s{2,}(\{\{[^}]+\}\})/g," $1")):M=Q.textContent||"",M===""){try{let C=document.createRange();C.selectNodeContents(Q),C.collapse(!0);let F=window.getSelection();F?.removeAllRanges(),F?.addRange(C),D.current=0;}catch{}H("",0);return}if(M===m)return;let W=window.getSelection(),I=0;if(W&&W.rangeCount>0)try{let C=W.getRangeAt(0);if(E){let F=0,O=!1,K=te=>{if(O)return !0;if(te===C.startContainer)return F+=C.startOffset,O=!0,!0;if(te.nodeType===Node.TEXT_NODE){if(!te.parentElement?.closest("[data-chip-id]")){if(te.contains(C.startContainer))return F+=C.startOffset,O=!0,!0;F+=(te.textContent||"").length;}}else if(te.nodeType===Node.ELEMENT_NODE){let de=te;if(de.hasAttribute("data-chip-id")){if(de.contains(C.startContainer)||de===C.startContainer){let ae=de.getAttribute("data-chip-id");return F+=`{{${ae}}}`.length,O=!0,!0}let _=de.getAttribute("data-chip-id");return F+=`{{${_}}}`.length,!1}else if(de.tagName==="BR")return de===C.startContainer?(O=!0,!0):(F+=1,!1)}for(let de=0;de<te.childNodes.length;de++)if(K(te.childNodes[de]))return !0;return !1};K(Q),I=F;}else {let F=document.createRange();F.setStart(Q,0),F.setEnd(C.startContainer,C.startOffset),I=F.toString().length;}}catch{I=M.length;}D.current=I,H(M,I);},onKeyDown:j=>{if(c)return;let Q=window.getSelection();if(!(!Q||Q.rangeCount===0))try{let E=Q.getRangeAt(0),M=E.commonAncestorContainer;if(j.key==="ArrowLeft"||j.key==="ArrowRight"){let W=M.nodeType===Node.TEXT_NODE?M.parentElement?.closest("[data-chip-id]"):M.closest("[data-chip-id]");if(W){j.preventDefault();try{let I=document.createRange(),C=window.getSelection();j.key==="ArrowLeft"?I.setStartBefore(W):I.setStartAfter(W),I.collapse(!0),C?.removeAllRanges(),C?.addRange(I);}catch{}}}if(j.key==="Backspace"){let W=null;if(W=(M.nodeType===Node.TEXT_NODE?M.parentElement?.closest("[data-chip-id]"):M.closest("[data-chip-id]"))||null,!W)if(M.nodeType===Node.TEXT_NODE){let I=M;if(E.startOffset===0&&I.parentElement){let C=I.previousSibling;if(C&&C.nodeType===Node.ELEMENT_NODE){let F=C.closest("[data-chip-id]");F&&(W=F);}}}else {let I=M;if(E.startOffset>0){let C=I.childNodes[E.startOffset-1];if(C&&C.nodeType===Node.ELEMENT_NODE){let F=C.closest("[data-chip-id]");F&&(W=F);}}}if(W){j.preventDefault(),j.stopPropagation();let I=W.getAttribute("data-chip-id");if(!I)return;let C=`{{${I}}}`,F=m.indexOf(C);if(F!==-1){let O=m.slice(0,F)+m.slice(F+C.length),K=g.filter(te=>te.id!==I);D.current=F;try{window.getSelection()?.removeAllRanges();}catch{}f?.(K),p?.(O);}}}}catch{}},onFocus:j=>{c||(w.onFocus&&w.onFocus(j),k(j));},onBlur:j=>{c||(w.onBlur&&w.onBlur(j),P(j));},className:U(),style:{whiteSpace:"pre-wrap",wordBreak:"break-word",...w.style},"data-placeholder":w.placeholder,children:q()},m===""?"empty":"content")}),t&&jsx(Te,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsx(be,{size:o,className:"mt-1",children:r}),typeof r=="function"&&d&&jsx(be,{size:o,className:"mt-1",children:r(d)})]})})}function qD({isPlaceholder:e,isDisabled:t,size:r="md"}){return twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[r],e?"text-text-disabled italic":"text-text-primary",t?"text-text-disabled cursor-not-allowed":"cursor-text",!t&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function Hy({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,reserveErrorSpace:c=true,validationResult:l,className:u,descriptionPlacement:d="below",...m}){return jsxs(TimeField,{...m,isDisabled:i,isRequired:a,isInvalid:s,className:ke(u,"flex flex-col gap-1"),children:[e&&jsx(ze,{size:o,tooltip:n,description:d==="tooltip"||d==="inline"?t:void 0,descriptionPlacement:d,isRequired:a,children:e}),jsx(ht,{children:jsx(DateInput,{className:twMerge(Vo({isInvalid:s,isDisabled:i}),"px-3 py-2 flex items-center gap-0.5 w-full"),children:p=>jsx(DateSegment,{segment:p,className:qD({isPlaceholder:p.isPlaceholder,isDisabled:!p.isEditable||i,size:o})})})}),c?jsx("div",{className:"mt-1 min-h-[20px]",children:typeof r=="string"?jsx(be,{size:o,children:r}):typeof r=="function"&&l?jsx(be,{size:o,children:r(l)}):t&&d==="below"?jsx(Te,{size:o,children:t}):null}):jsx(Fragment,{children:typeof r=="string"?jsx(be,{size:o,className:"mt-1",children:r}):typeof r=="function"&&l?jsx(be,{size:o,className:"mt-1",children:r(l)}):t&&d==="below"?jsx(Te,{size:o,className:"mt-1",children:t}):null})]})}function Wy({children:e,className:t=""}){return jsx("div",{className:`flex flex-col ${t}`.trim(),role:"list",children:e})}function Gy({children:e,variant:t="default",icon:r,label:o,isLast:n=false,className:a=""}){let s={default:{dot:"bg-border-default border-border-default",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},active:{dot:"bg-text-primary border-text-primary",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary font-medium"},muted:{dot:"bg-border-muted border-border-muted",line:"bg-border-muted",label:"text-text-secondary",content:"text-text-secondary"},success:{dot:"bg-feedback-success-border border-feedback-success-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},error:{dot:"bg-feedback-error-border border-feedback-error-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},warning:{dot:"bg-feedback-warning-border border-feedback-warning-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},info:{dot:"bg-feedback-info-border border-feedback-info-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"}}[t];return jsxs("div",{className:`flex gap-3 ${a}`.trim(),role:"listitem",children:[jsxs("div",{className:"flex flex-col items-center",style:{width:"20px"},children:[jsx("div",{className:`flex items-center justify-center rounded-full border-2 ${s.dot}`,style:{width:"20px",height:"20px",flexShrink:0},children:r&&jsx(B,{name:r,size:12,className:"text-background-body"})}),!n&&jsx("div",{className:`w-0.5 flex-1 ${s.line}`,style:{minHeight:"24px"}})]}),jsxs("div",{className:"flex-1 pb-6",children:[o&&jsx("div",{className:`text-xs mb-1 ${s.label}`,children:o}),jsx("div",{className:`text-sm ${s.content}`,children:e})]})]})}function eE(e){return "primary"}var tE="flex font-medium justify-center items-center gap-2 text-center transition whitespace-nowrap box-border",Uy={primary:{selected:"bg-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-action-primary border-2 border-border-muted hover:bg-text-primary/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"}},rE="opacity-[--control-hover-opacity] cursor-not-allowed pointer-events-none grayscale",oE="opacity-100 cursor-pointer",nE={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},aE={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function iE(e){let{variant:t="primary",size:r="md",isDisabled:o,isSelected:n,borderRadius:a,borderRight:i,borderLeft:s}=e,c=eE(),l=`${tE} ${n?Uy[c].selected:Uy[c].unselected}`;return l+=` ${Ge[r].text} ${Ge[r].height} ${Ge[r].padding} ${Ge[r].gap}`,l+=` ${o?rE:oE}`,a==="left"&&(l+=" rounded-l-sm"),a==="right"&&(l+=" rounded-r-sm"),i&&(l+=" border-r"),s&&(l+=" border-l"),l+=` ${Je()}`,(l+=" focus-visible:outline-action-primary"),twMerge(l)}function Yy(e){let{className:t,children:r,onPress:o,icon:n,iconPosition:a="left",iconWeight:i,isLoading:s=false,loadingText:c,loadingIndicator:l,size:u="md",badgeNumber:d,badgeVariant:m="primary",badgePosition:p="top-right",...g}=e,f=n?jsx(B,{name:n,size:u,weight:i}):null,h=()=>{let x=jsxs(Fragment,{children:[a==="left"&&f,r,a==="right"&&f]});return s?jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l||jsx(B,{name:"CircleNotch",size:u,className:"animate-spin","aria-hidden":"true"})}),jsx("div",{className:"invisible","aria-hidden":"true",children:x}),c&&jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:c})]}):x},b=jsx(ToggleButton,{onPress:o,...g,className:twMerge(iE(e),t),"aria-busy":s,children:h()});return d&&d>0?jsxs("div",{className:"relative",children:[b,jsx("span",{className:`absolute ${nE[p]} flex h-5 w-5 items-center justify-center rounded-full ${aE[m]} text-xs`,"aria-label":`${d} items`,children:d})]}):b}var lE={open:{className:"text-feedback-success-border",token:"--color-feedback-success-border",label:"Open"},closed:{className:"text-feedback-error-border",token:"--color-feedback-error-border",label:"Closed"}},cE={platform:{label:"Platform",description:"Core product objects that structure the Texture workspace.",icon:"Stack",order:0},grid:{label:"Grid Elements",description:"Physical utility-grid infrastructure imported from a customer's GIS export.",icon:"TreeStructure",order:1},device:{label:"Devices",description:"Behind-the-meter connected energy devices.",icon:"Lightning",order:2}},dE=["energized","customerName","gs_max_continuous_current"],it={TRANSFORMER:[{key:"capacityKva",label:"kVA Rating",format:{type:"power",unit:"kVA",decimals:0}},{key:"primaryRatedVoltage",label:"Primary Voltage",format:{type:"voltage",unit:"V",decimals:0}}],CONSUMER:[{key:"meterNumber",label:"Meter Number",format:{type:"text"}}],SOURCE:[{key:"busVoltage",label:"Bus Voltage",format:{type:"voltage",unit:"V",decimals:0}},{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}},{key:"substationNumber",label:"Substation Number",format:{type:"text"}}],SWITCH:[{key:"switchId",label:"Switch ID",format:{type:"text"}},{key:"ratedCurrent",label:"Rated Current",format:{type:"number",unit:"A",decimals:0}},{key:"normalState",label:"Normal State",format:{type:"text"}}],CAPACITOR:[{key:"unitSizeKvar",label:"Capacity",format:{type:"power",unit:"kVar",decimals:1}},{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}}],OVERCURRENT_DEVICE:[{key:"ratedCurrent",label:"Rated Current",format:{type:"number",unit:"A",decimals:0}},{key:"deviceType",label:"Device Type",format:{type:"text"}}],REGULATOR:[{key:"outputVoltagePhA",label:"Output Voltage Phase A",format:{type:"voltage",unit:"V",decimals:0}},{key:"outputVoltagePhB",label:"Output Voltage Phase B",format:{type:"voltage",unit:"V",decimals:0}},{key:"outputVoltagePhC",label:"Output Voltage Phase C",format:{type:"voltage",unit:"V",decimals:0}},{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kVA",decimals:1}}],OVERHEAD_LINE:[{key:"impedanceLength",label:"Length",format:{type:"distance",unit:"ft",decimals:0}},{key:"conductorDescPhA",label:"Conductor Phase A",format:{type:"text"}},{key:"conductorDescPhB",label:"Conductor Phase B",format:{type:"text"}},{key:"conductorDescPhC",label:"Conductor Phase C",format:{type:"text"}}],UNDERGROUND_LINE:[{key:"impedanceLength",label:"Length",format:{type:"distance",unit:"ft",decimals:0}},{key:"conductorDescPhA",label:"Conductor Phase A",format:{type:"text"}},{key:"conductorDescPhB",label:"Conductor Phase B",format:{type:"text"}},{key:"conductorDescPhC",label:"Conductor Phase C",format:{type:"text"}}],NODE:[{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}}],GENERATOR:[{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kW",decimals:1}},{key:"outputVoltage",label:"Output Voltage",format:{type:"voltage",unit:"V",decimals:0}}],MOTOR:[{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kW",decimals:1}},{key:"voltage",label:"Voltage",format:{type:"voltage",unit:"V",decimals:0}}]},oa={app:{icon:"AppWindow",category:"platform",archetype:"platform",detailPage:false,label:{singular:"App",plural:"Apps"},description:"Workspace tools and third-party integrations"},site:{icon:"MapPin",category:"platform",archetype:"platform",detailPage:true,label:{singular:"Site",plural:"Sites"},description:"Physical location housing energy systems"},device:{icon:"ShareNetwork",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Device",plural:"Devices"},description:"Connected, controllable energy device"},customer:{icon:"Users",category:"platform",archetype:"platform",detailPage:true,label:{singular:"Customer",plural:"Customers"},description:"End customer or owner of one or more sites"},contact:{icon:"Users",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Contact",plural:"Contacts"},description:"Person associated with a customer or site"},program:{icon:"ClipboardText",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Program",plural:"Programs"},description:"Demand-response or virtual power plant program"},workflow:{icon:"FlowArrow",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Workflow",plural:"Workflows"},description:"Automated rule that runs in response to events"},collection:{icon:"Stack",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Collection",plural:"Collections"},description:"Named group of related entities or records"},board:{icon:"SquaresFour",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Board",plural:"Boards"},description:"Dashboard for monitoring metrics and devices"},report:{icon:"ChartLine",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Report",plural:"Reports"},description:"Saved analytics view or generated report"},event:{icon:"ClockCounterClockwise",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Event",plural:"Events"},description:"Recorded system event or logged activity"},alert:{icon:"Warning",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Alert",plural:"Alerts"},description:"Notification raised when attention is needed"},monitor:{icon:"Pulse",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Monitor",plural:"Monitors"},description:"Rule that watches a metric against a threshold"},command:{icon:"Play",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Command",plural:"Commands"},description:"Control action issued to a connected device"},source:{icon:"TextureSource",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.SOURCE},label:{singular:"Source",plural:"Sources"},description:"Upstream feed where the network originates"},substation:{icon:"TextureSource",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.SOURCE},label:{singular:"Substation",plural:"Substations"},description:"Facility that steps down transmission voltage"},capacitor:{icon:"TextureCapacitor",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.CAPACITOR},label:{singular:"Capacitor",plural:"Capacitors"},description:"Capacitor bank for power-factor and voltage support"},switch:{icon:"TextureSwitchClosed",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.SWITCH},label:{singular:"Switch",plural:"Switches"},description:"Sectionalizing or disconnect switch on the line",states:{open:{icon:"TextureSwitch",color:"open"},closed:{icon:"TextureSwitchClosed",color:"closed"}}},sectionalizer:{icon:"TextureSectionalizerClosed",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.SWITCH},label:{singular:"Sectionalizer",plural:"Sectionalizers"},description:"Counts upstream recloser trips and opens to isolate a faulted section",states:{open:{icon:"TextureSectionalizerOpen",color:"open"},closed:{icon:"TextureSectionalizerClosed",color:"closed"}}},relay:{icon:"Cpu",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.NODE},label:{singular:"Relay",plural:"Relays"},description:"Microprocessor relay that senses faults and trips devices"},transformer:{icon:"TextureTransformer",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.TRANSFORMER},label:{singular:"Transformer",plural:"Transformers"},description:"Transformer that steps voltage up or down"},meter:{icon:"Gauge",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.CONSUMER},label:{singular:"Meter",plural:"Meters"},description:"Revenue meter at the point of consumption",fusedMetricId:"power",fields:{headlineMetrics:[{id:"power",label:"device.meter.fields.power",source:{kind:"state",path:"state.phaseARealPower"},format:{type:"power",unit:"kW",decimals:2},icon:"Pulse"},{id:"consumption",label:"device.meter.fields.consumption",source:{kind:"state",path:"state.latestKwhUsage"},format:{type:"energy",sourceUnit:"kWh",decimals:2},icon:"Lightning"},{id:"voltage",label:"device.meter.fields.voltage",source:{kind:"state",path:"state.phaseAVoltage"},format:{type:"voltage",decimals:1},icon:"Lightning"},{id:"current",label:"device.meter.fields.current",source:{kind:"state",path:"state.phaseACurrent"},format:{type:"current",decimals:2},icon:"Lightning"}]}},consumer:{icon:"Gauge",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.CONSUMER},label:{singular:"Consumer",plural:"Consumers"},description:"Service point or customer premise on the grid"},singlePhaseOverheadLine:{icon:"TextureSinglePhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.OVERHEAD_LINE},label:{singular:"Single-Phase Overhead Line",plural:"Single-Phase Overhead Lines"},description:"Overhead line carrying one phase conductor"},twoPhaseOverheadLine:{icon:"TextureTwoPhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.OVERHEAD_LINE},label:{singular:"Two-Phase Overhead Line",plural:"Two-Phase Overhead Lines"},description:"Overhead line carrying two phase conductors"},threePhaseOverheadLine:{icon:"TextureThreePhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.OVERHEAD_LINE},label:{singular:"Three-Phase Overhead Line",plural:"Three-Phase Overhead Lines"},description:"Overhead line carrying three phase conductors"},singlePhaseUndergroundLine:{icon:"TextureSinglePhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.UNDERGROUND_LINE},label:{singular:"Single-Phase Underground Line",plural:"Single-Phase Underground Lines"},description:"Buried line carrying one phase conductor"},twoPhaseUndergroundLine:{icon:"TextureTwoPhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.UNDERGROUND_LINE},label:{singular:"Two-Phase Underground Line",plural:"Two-Phase Underground Lines"},description:"Buried line carrying two phase conductors"},threePhaseUndergroundLine:{icon:"TextureThreePhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.UNDERGROUND_LINE},label:{singular:"Three-Phase Underground Line",plural:"Three-Phase Underground Lines"},description:"Buried line carrying three phase conductors"},motorSwitch:{icon:"Diamond",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.MOTOR},label:{singular:"Motor Switch",plural:"Motor Switches"},description:"Motor-operated switch or motor load element"},recloser:{icon:"TextureRecloser",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.OVERCURRENT_DEVICE},label:{singular:"Recloser",plural:"Reclosers"},description:"Auto-reclosing device that clears transient faults",states:{open:{color:"open"},closed:{color:"closed"}}},fuse:{icon:"TextureFuse",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.OVERCURRENT_DEVICE},label:{singular:"Fuse",plural:"Fuses"},description:"Fusible element providing overcurrent protection"},breaker:{icon:"TextureBreaker",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.OVERCURRENT_DEVICE},label:{singular:"Breaker",plural:"Breakers"},description:"Circuit breaker that interrupts fault current",states:{open:{color:"open"},closed:{color:"closed"}}},generator:{icon:"Wind",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.GENERATOR},label:{singular:"Generator",plural:"Generators"},description:"Distributed generation unit feeding the grid"},regulator:{icon:"TextureRegulator",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:it.REGULATOR},label:{singular:"Regulator",plural:"Regulators"},description:"Voltage regulator that holds line voltage in range"},supportStructure:{icon:"TextureSupportStructure",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:it.NODE},label:{singular:"Support Structure",plural:"Support Structures"},description:"Structure carrying overhead line equipment"},battery:{icon:"BatteryHigh",category:"device",archetype:"device",detailPage:true,label:{singular:"Battery",plural:"Batteries"},description:"Behind-the-meter battery or storage system",fusedMetricId:"soc",fields:{headlineMetrics:[{id:"power",label:"device.battery.fields.power",source:{kind:"state",path:"state.gridPower"},format:{type:"power",decimals:1},icon:"Lightning"},{id:"soc",label:"device.battery.fields.soc",source:{kind:"state",path:"state.chargePercentage"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"backupReserve",label:"device.battery.fields.backupReserve",source:{kind:"state",path:"state.backupReserve"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"loadPower",label:"device.battery.fields.loadPower",source:{kind:"state",path:"state.loadPower"},format:{type:"power",decimals:1},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.battery.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"},secondaryState:{label:"device.battery.fields.gridState",fieldPath:"state.gridStatus",mapping:{importing:"importing",exporting:"exporting",idle:"importing",unknown:"importing"},fallback:"importing"}}},evCharger:{icon:"ChargingStation",category:"device",archetype:"device",detailPage:true,label:{singular:"EV Charger",plural:"EV Chargers"},description:"Electric-vehicle charging station or port",fusedMetricId:"power",fields:{headlineMetrics:[{id:"power",label:"device.evCharger.fields.power",source:{kind:"state",path:"state.chargerWattage"},format:{type:"power",decimals:1},icon:"Lightning"},{id:"isPluggedIn",label:"device.evCharger.fields.isPluggedIn",source:{kind:"state",path:"state.isPluggedIn"},format:{type:"boolean",trueText:"Yes",falseText:"No"},icon:"Plug"},{id:"voltage",label:"device.evCharger.fields.voltage",source:{kind:"state",path:"state.chargerVoltage"},format:{type:"voltage",decimals:1},icon:"Lightning"},{id:"current",label:"device.evCharger.fields.current",source:{kind:"state",path:"state.chargerCurrent"},format:{type:"current",decimals:1},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.evCharger.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"}}},inverter:{icon:"Sun",category:"device",archetype:"device",detailPage:true,label:{singular:"Solar / Inverter",plural:"Solar / Inverters"},description:"Solar PV inverter and its connected array",fusedMetricId:"power",fields:{headlineMetrics:[{id:"power",label:"device.inverter.fields.power",source:{kind:"state",path:"state.power"},format:{type:"power",decimals:0},icon:"Lightning"},{id:"gridPower",label:"device.inverter.fields.gridPower",source:{kind:"state",path:"state.gridPower"},format:{type:"power",decimals:0},icon:"GridFour"},{id:"generatedEnergy",label:"device.inverter.fields.generatedEnergy",source:{kind:"state",path:"state.generatedEnergy"},format:{type:"energy",decimals:1},icon:"Lightning"},{id:"lifetimeEnergyGenerated",label:"device.inverter.fields.lifetimeEnergyGenerated",source:{kind:"state",path:"state.lifetimeEnergyGenerated"},format:{type:"energy",decimals:0},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.inverter.fields.gridStatus",fieldPath:"state.gridStatus",mapping:{exporting:"exporting",importing:"importing",idle:"idle"},fallback:"unknown"}}},thermostat:{icon:"Thermometer",category:"device",archetype:"device",detailPage:true,label:{singular:"Thermostat",plural:"Thermostats"},description:"Smart thermostat or connected HVAC control",fusedMetricId:"ambientTemperature",fields:{headlineMetrics:[{id:"ambientTemperature",label:"device.thermostat.fields.ambientTemperature",source:{kind:"state",path:"state.ambientTemperature"},format:{type:"temperature",decimals:0},icon:"Thermometer"},{id:"heatTarget",label:"device.thermostat.fields.heatTarget",source:{kind:"state",path:"state.heatTarget"},format:{type:"temperature",decimals:0},icon:"Flame"},{id:"coolTarget",label:"device.thermostat.fields.coolTarget",source:{kind:"state",path:"state.coolTarget"},format:{type:"temperature",decimals:0},icon:"Snowflake"},{id:"fanMode",label:"device.thermostat.fields.fanMode",source:{kind:"state",path:"state.fanMode"},format:{type:"text"}}]},stateRules:{primaryState:{label:"device.thermostat.fields.operatingMode",fieldPath:"state.operatingMode",mapping:{heat:"heat",cool:"cool",auto:"auto",off:"off",eco:"eco",unknown:"unknown"},fallback:"unknown"}}},vehicle:{icon:"Car",category:"device",archetype:"device",detailPage:true,label:{singular:"EV",plural:"EVs"},description:"Electric vehicle managed as a flexible load",fusedMetricId:"chargePercentage",fields:{headlineMetrics:[{id:"chargePercentage",label:"device.vehicle.fields.chargePercentage",source:{kind:"state",path:"state.chargePercentage"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"range",label:"device.vehicle.fields.range",source:{kind:"state",path:"state.range"},format:{type:"distance",unit:"mi",decimals:0},icon:"GasPump"},{id:"chargeLimit",label:"device.vehicle.fields.chargeLimit",source:{kind:"state",path:"state.chargeLimit"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"isPluggedIn",label:"device.vehicle.fields.isPluggedIn",source:{kind:"state",path:"state.isPluggedIn"},format:{type:"boolean",trueText:"Yes",falseText:"No"},icon:"Plug"}]},stateRules:{primaryState:{label:"device.vehicle.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"}}},waterHeater:{icon:"Drop",category:"device",archetype:"device",detailPage:true,label:{singular:"Water Heater",plural:"Water Heaters"},description:"Connected or smart electric water heater"}},uE={source:"SOURCE",substation:"SOURCE",capacitor:"CAPACITOR",switch:"SWITCH",sectionalizer:"SWITCH",relay:"NODE",transformer:"TRANSFORMER",meter:"CONSUMER",consumer:"CONSUMER",singlePhaseOverheadLine:"OVERHEAD_LINE",twoPhaseOverheadLine:"OVERHEAD_LINE",threePhaseOverheadLine:"OVERHEAD_LINE",singlePhaseUndergroundLine:"UNDERGROUND_LINE",twoPhaseUndergroundLine:"UNDERGROUND_LINE",threePhaseUndergroundLine:"UNDERGROUND_LINE",motorSwitch:"MOTOR",recloser:"OVERCURRENT_DEVICE",fuse:"OVERCURRENT_DEVICE",breaker:"OVERCURRENT_DEVICE",generator:"GENERATOR",regulator:"REGULATOR",supportStructure:"NODE"};function gc(e){return oa[e]}function pE(e){return oa[e].icon}function mE(e,t=false){return t?oa[e].label.plural:oa[e].label.singular}function fE(e){return oa[e].category}var gE={min:2,max:4};function bE(e){let t=oa[e];if(!t)throw new Error(`archetypeFor: unknown entity type "${String(e)}"`);return t.archetype}function xE(e){return gc(e).detailPage}function hE(e){return (gc(e).fields?.headlineMetrics.length??0)>0}function Jy(e){return gc(e).properties?.statList??[]}function yE(e){return Jy(e).length>0}function vE({formId:e="dialog-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:i="secondary",children:s,title:c,...l}){return jsx(Nr,{title:c,primaryAction:{label:r,onPress:()=>{let d=document.getElementById(e);d&&d.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:i}:void 0,...l,children:jsx(Fa,{id:e,onSubmit:t,children:s})})}function CE({formId:e="drawer-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:i="secondary",children:s,...c}){return jsx(Ei,{primaryAction:{label:r,onPress:()=>{let u=document.getElementById(e);u&&u.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:i}:void 0,...c,children:jsx(Fa,{id:e,onSubmit:t,className:"mt-2",children:s})})}function wE({align:e="end",className:t,...r}){return jsx("div",{...r,className:twMerge("flex gap-2",e==="start"?"justify-start":e==="between"?"justify-between":"justify-end",t)})}var TE={sm:"gap-2",md:"gap-4",lg:"gap-6"};function PE(e){if(!e)return "";let t=e.base?`grid-cols-${e.base}`:"",r=e.md?`md:grid-cols-${e.md}`:"",o=e.lg?`lg:grid-cols-${e.lg}`:"";return [t,r,o].filter(Boolean).join(" ")}function RE({cols:e={base:1},gap:t="lg",className:r,...o}){return jsx("div",{...o,className:twMerge("grid",PE(e),TE[t],r)})}function EE({title:e,description:t,showDivider:r,className:o,children:n,...a}){return jsxs("section",{...a,className:twMerge("flex flex-col",o),children:[(e||t)&&jsxs("div",{className:"flex flex-col gap-1 mb-6",children:[typeof e=="string"?jsx(Qt,{tag:"h3",size:"sm",children:e}):e,t?jsx(Te,{size:"lg",children:t}):null]}),jsx("div",{className:"flex flex-col gap-6",children:n}),r&&jsx("hr",{className:"mt-2 border-border-muted"})]})}function LE(){return jsx("hr",{className:"border-border-muted"})}function AE({steps:e,currentStepId:t,onStepClick:r,className:o}){let n=e.findIndex(a=>a.id===t);return jsx("nav",{"aria-label":"Progress",className:twMerge("w-full",o),children:jsx("div",{className:"relative mb-12",children:jsx("ol",{className:"relative flex items-start justify-between",children:e.map((a,i)=>{let s=a.id===t,c=i<n,l=r&&(c||s);return jsxs("li",{className:"relative flex flex-col items-center",style:{flex:`1 1 ${100/e.length}%`},children:[jsx("button",{type:"button",disabled:!l,onClick:()=>l&&r?.(a.id),className:twMerge("relative z-10 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors bg-background-body",c&&"border-action-primary bg-action-primary text-text-inverse hover:bg-action-primary/90",s&&"border-action-primary bg-background-body text-action-primary",!c&&!s&&"border-border-default bg-background-body text-text-secondary",l&&"cursor-pointer",!l&&"cursor-default"),"aria-current":s?"step":void 0,children:c?jsx(B,{name:"Check",size:20,weight:"bold"}):jsx("span",{className:"text-sm font-semibold",children:i+1})}),i<e.length-1&&jsx("div",{className:"absolute top-5 h-0.5 transition-colors",style:{left:"50%",width:"100%",marginLeft:"20px",backgroundColor:i<n?"var(--color-action-primary)":"var(--color-border-default)"}}),jsxs("div",{className:"mt-3 flex flex-col items-center text-center w-32",children:[jsx("span",{className:twMerge("text-sm font-medium",s&&"text-text-default",c&&"text-text-primary",!s&&!c&&"text-text-secondary"),children:a.title}),a.description&&jsx("span",{className:"mt-1 text-xs text-text-secondary",children:a.description})]})]},a.id)})})})})}function FE({formId:e,show:t,isSubmitting:r,onCancel:o,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:i}){return t?jsx("div",{className:twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",i),children:jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsx("div",{className:"text-sm text-text-secondary",children:"You have unsaved changes"}),jsxs("div",{className:"flex gap-2",children:[jsx(Z,{variant:"secondary",onPress:o,children:a}),jsx(Z,{type:"submit",form:e,isDisabled:!!r,children:r?"Saving...":n})]})]})}):null}function BE({when:e,message:t="You have unsaved changes. Leave anyway?"}){return Oe.useEffect(()=>{if(!e)return;let r=o=>(o.preventDefault(),o.returnValue=t,t);return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[e,t]),null}function VE({steps:e,initialStepId:t,canNavigate:r}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[o,n]=Oe.useState(t||e[0].id),a=e.findIndex(d=>d.id===o),i=a>0,s=a<e.length-1,c=async d=>d===o?true:r&&!await r(o,d)?false:(n(d),true);return {steps:e,currentStepId:o,setCurrentStepId:c,next:async()=>!s||a===-1?false:c(e[a+1].id),prev:async()=>!i||a===-1?false:c(e[a-1].id),hasNext:s,hasPrev:i,stepIndex:a}}function $i(e,t){return t.split(".").reduce((r,o)=>r?.[o],e)}function OE(e,t){let r=$i(e,t.field),o=t.value;switch(t.operator){case "eq":return r===o;case "neq":return r!==o;case "in":return Array.isArray(o)?Array.isArray(r)?r.some(n=>o.includes(n)):o.includes(r):false;case "nin":return Array.isArray(o)?Array.isArray(r)?!r.some(n=>o.includes(n)):!o.includes(r):false;case "gt":return r instanceof Date&&typeof o=="string"?r>new Date(o):r>o;case "gte":return r instanceof Date&&typeof o=="string"?r>=new Date(o):r>=o;case "lt":return r instanceof Date&&typeof o=="string"?r<new Date(o):r<o;case "lte":return r instanceof Date&&typeof o=="string"?r<=new Date(o):r<=o;case "contains":return typeof r!="string"?false:r.toLowerCase().includes(String(o).toLowerCase());case "startsWith":return typeof r!="string"?false:r.toLowerCase().startsWith(String(o).toLowerCase());case "endsWith":return typeof r!="string"?false:r.toLowerCase().endsWith(String(o).toLowerCase());default:return false}}function ev(e,t){if(t.conditions.length===0)return true;let r=t.conditions.map(o=>"conditions"in o?ev(e,o):OE(e,o));return t.logic==="AND"?r.every(Boolean):r.some(Boolean)}function HE(e,t){return !t||t.conditions.length===0?e:e.filter(r=>ev(r,t))}function WE(e,t,r){if(e==null&&t==null)return 0;if(e==null)return r==="asc"?1:-1;if(t==null)return r==="asc"?-1:1;if(e instanceof Date&&t instanceof Date){let o=e.getTime()-t.getTime();return r==="asc"?o:-o}if(typeof e=="string"&&typeof t=="string"){let o=e.toLowerCase().localeCompare(t.toLowerCase());return r==="asc"?o:-o}return e<t?r==="asc"?-1:1:e>t?r==="asc"?1:-1:0}function GE(e,t){return t?[...e].sort((r,o)=>{let n=$i(r,t.field),a=$i(o,t.field);return WE(n,a,t.direction)}):e}function UE(e,t){if(!t||!t.query.trim())return e;let{query:r,fields:o,fuzzy:n=true,threshold:a=.3}=t;if(n)return new zE(e,{keys:o,threshold:a,ignoreLocation:true,includeScore:true}).search(r).map(l=>l.item);let i=r.toLowerCase();return e.filter(s=>o.some(c=>{let l=$i(s,c);return l==null?false:String(l).toLowerCase().includes(i)}))}function KE(e,t){let r={};for(let o of t){if(r[o.field]={},o.values)for(let n of o.values)r[o.field][String(n.value)]=0;for(let n of e){let a=$i(n,o.field);if(a!=null)if(Array.isArray(a))for(let i of a){let s=String(i);r[o.field][s]=(r[o.field][s]||0)+1;}else {let i=String(a);r[o.field][i]=(r[o.field][i]||0)+1;}}}return r}function Ep({data:e,filters:t,sort:r,search:o,facetConfigs:n=[]}){let a=UE(e,o||null);a=HE(a,t||null);let i=KE(a,n);return a=GE(a,r||null),{data:a,facetCounts:i,resultCount:a.length}}function xc({data:e,filters:t,sort:r,search:o,facetConfigs:n=[]}){return useMemo(()=>Ep({data:e,filters:t,sort:r,search:o,facetConfigs:n}),[e,t,r,o,n])}function hc({filters:e,sort:t,search:r,onStateChange:o,searchDebounce:n=300}){let a=Bo(r,n),i=useRef(true);useEffect(()=>{if(i.current){i.current=false;return}o({filters:e,sort:t,search:a});},[e,t,a,o]);}function tv(e){return e.mode==="client"?xc({data:e.data,filters:e.filters,sort:e.sort,search:e.search,facetConfigs:e.facetConfigs}):(hc({filters:e.filters,sort:e.sort,search:e.search,onStateChange:e.onStateChange,searchDebounce:e.searchDebounce}),{data:e.data,facetCounts:e.facetCounts||{},resultCount:e.resultCount??e.data.length})}var rv=Op(iu());function qE(e,t,r=true){let o=e;if(r){let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return `${o}-${n}.${t}`}return `${o}.${t}`}function QE(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function ov(e,t){let r=QE(t,e);return e.exportValue?e.exportValue(r,t)??"":r==null?"":r instanceof Date?r.toISOString():typeof r=="object"?JSON.stringify(r):r}function Lp(e){return e.filter(t=>t.exportable!==false)}function nv(e){let t=e.map(n=>n.exportLabel||n.label),r=new Set,o=[];for(let n of t)r.has(n)?o.includes(n)||o.push(n):r.add(n);if(o.length>0)throw new Error(`Duplicate export headers found: ${o.join(", ")}. Use exportLabel to provide unique headers.`)}async function Ap(e){let{columns:t,data:r,metadata:o={}}=e;try{let n=Lp(t);if(n.length===0)throw new Error("No exportable columns found");nv(n);let a=r.map(l=>{let u={};for(let d of n){let m=d.exportLabel||d.label;u[m]=ov(d,l);}return u}),i=nk.unparse(a,{header:!0,skipEmptyLines:!0}),s=new Blob([i],{type:"text/csv;charset=utf-8;"}),c=qE(o.filename||"table-data","csv",o.timestamp!==!1);(0,rv.saveAs)(s,c);}catch(n){throw new Error(`CSV export failed: ${n instanceof Error?n.message:"Unknown error"}`)}}function ZE(e){let{columns:t,data:r}=e,o=Lp(t);return nv(o),r.map(n=>{let a={};for(let i of o){let s=i.exportLabel||i.label;a[s]=ov(i,n);}return a})}function _E(e){return Lp(e).map(t=>t.exportLabel||t.label)}function av({columns:e,data:t,metadata:r}){let n=e.filter(i=>i.exportable!==false).length>0&&t.length>0;return {exportCSV:useCallback(async()=>{try{await Ap({columns:e,data:t,metadata:r});}catch(i){throw console.error("Table export failed:",i),i}},[e,t,r]),canExport:n}}function doe(e){switch(e){case "charging":case "on":return "success";case "discharging":return "warning";case "heat":case "cool":return "info";case "off":case "idle":case "eco":case "auto":return "neutral";default:return "neutral"}}export{dE as ABSENT_GRID_FIELDS,Ub as ActionCell,fa as ActionMenu,vd as ActivityFeed,hs as ActivityFeedGroup,ys as ActivityItem,cf as Alert,bf as AppShell,Yo as AreaSeries,wl as AutoMobileRenderer,Rs as Autocomplete,bo as Avatar,sn as BREAKPOINTS,nt as Badge,Yb as BadgeCell,Ds as Banner,Ws as BarSeries,Jb as BooleanCell,Qp as BrandProvider,Ls as BreadcrumbItem,Es as Breadcrumbs,Z as Button,ia as CUSTOM_ICON_REGISTRY,ha as Calendar,Ue as Card,pd as CardContent,md as CardFooter,dd as CardHeader,ud as CardMedia,Nl as CardMobileRenderer,Yf as CarouselAutoplayTrigger,Wf as CarouselControl,Gd as CarouselIndicator,Kf as CarouselIndicatorGroup,Hf as CarouselItem,Of as CarouselItemGroup,Uf as CarouselNextTrigger,Gf as CarouselPrevTrigger,Jf as CarouselProgressText,zf as CarouselRoot,wg as CategoryBarChart,Rr as ChartAxis,Ta as ChartBottomBar,Gg as ChartContainer,Pr as ChartContext,Xs as ChartEventMarkers,js as ChartEventSpans,Jo as ChartTooltip,Cn as Checkbox,Ud as CheckboxGroup,eo as Chip,$f as ChipInputField,ai as ClearButton,rg as CodeEditor,ya as Collapse,Uo as CollapseContent,Go as CollapseHeader,Wo as CollapseItem,lN as ColorField,sm as ColorModeProvider,Fx as CommandPalette,lg as Confirm,cg as ConnectionStatusBadge,dg as ContactCard,jb as ContactMetaCell,Vs as ContactMetaDisplay,mg as ContainerQueryProvider,zo as CopyToClipboard,qb as CustomCell,_l as DEFAULT_MAP_TYPE,Ab as DataControls,wx as DataTable,Qb as DateCell,Bb as DateField,sl as DateRangePicker,Te as Description,kx as DeviceHealthBadge,_b as DeviceMetaCell,ml as DeviceMetaDisplay,zn as DeviceStateBadge,tx as DeviceStateCell,bl as DeviceStateWithMetric,Px as DeviceTypeIcon,Nr as Dialog,vE as DialogForm,Ht as DialogHeader,Ei as Drawer,CE as DrawerForm,cE as ENTITY_CATEGORY_CONFIG,oa as ENTITY_CONFIG,$s as EmptyState,Mx as EnrollmentStatusBadge,Vr as ErrorBoundary,be as FieldError,yf as FieldGroup,Ex as FileUpload,Ib as FilterChips,Hb as FilterDialog,Ax as FirmwareVersionBadge,Fa as Form,wE as FormActions,LE as FormDivider,RE as FormGrid,EE as FormSection,AE as FormStepper,oe as FormatRegistry,ox as FormattedCell,Jg as FunnelSeries,uE as GRID_ELEMENT_TYPE_BY_ENTITY,lE as GRID_STATE_COLORS,it as GRID_STAT_LIST,zx as GlobalSearch,ju as Grid,gl as GridStateBadge,gE as HEADLINE_METRIC_BOUNDS,Qt as Heading,ph as HierarchyExplorer,Bu as HorizontalBarCell,pR as HoverCard,B as Icon,wr as InfiniteScrollIndicator,ks as Input,ht as InputWrapper,Ui as InteractiveMap,gh as Kpi,op as KpiGroup,ze as Label,Tn as LineSeries,Ch as List,wR as ListBox,_t as ListBoxItem,wh as ListItem,Nh as ListPane,fo as Loader,ba as Logo,_h as MAP_TYPES,oy as Meter,Vu as MiniBarCell,cr as ModalBackdrop,oc as Notice,nc as NoticeContainer,ay as NoticeProvider,lx as NumberCell,Ti as NumberField,Df as PageBanner,Qn as PageLayout,zu as PercentBarCell,my as PlaceSearch,st as Popover,gy as ProgressBar,by as Prose,Cy as Radio,xy as RadioCard,hy as RadioCardGroup,vy as RadioGroup,Ma as RangeCalendar,Si as ResultsCount,Ny as RichTextEditor,Zo as SKELETON_SIZES,Jc as SOURCE_UNIT_TO_WH,FE as SaveBar,In as SearchControl,Ox as SearchEmptyState,Wx as SearchLoadingState,Ux as SearchResultGroup,Kx as SearchResultItem,Yx as SearchResultsList,Xx as SearchTrigger,Ka as Section,sc as SectionNav,tl as SegmentedControl,go as Select,dx as SelectCell,Cs as SideNav,ky as SiteCard,Py as SiteContactCard,px as SiteMetaCell,yl as SiteMetaDisplay,J as Skeleton,Ry as Slider,wi as SortControl,Ou as SparklineCell,fc as SplitPane,Ss as StackNav,Ll as StatList,Ua as StaticMap,ll as Switch,pc as Tab,uc as TabList,dy as TabPanel,dc as Tabs,Iy as TextArea,zy as TextAreaWithChips,bx as TextCell,Er as TextField,Ze as TextLink,Zs as TiledTimeSeriesChart,Rb as TiledTimeSeriesExplorer,rl as TimeControls,Hy as TimeField,Wy as Timeline,Gy as TimelineItem,Yy as ToggleButton,Zt as Tooltip,ni as TopNav,lt as Tray,BE as UnsavedChangesPrompt,K1 as activeDeviceStates,Qo as addFilterCondition,Ep as applyDataOperations,bE as archetypeFor,db as assembleSeries,RC as autoScaleCurrent,bm as autoScaleDistance,vm as autoScaleEnergy,BC as autoScalePower,VC as autoScaleResistance,KC as autoScaleVoltage,zN as baselineFromPoint,Bm as camelCaseToWords,Im as capitalize,zC as celsiusToFahrenheit,jA as celsiusToKelvin,MA as centimetersToInches,os as clearColorCache,dC as createCategoryColorMap,Ni as createEmptyFilter,s1 as createFilter,l1 as createFilters,C5 as createFormat,rt as createTextureIcon,Xg as createTiledCameraSyncGroup,tu as createXScale,ui as createYScale,nd as csvUnitFor,Om as csvValueFor,Ie as defaultMargin,Y1 as deviceStateLabels,_G as deviceStateMetricFormats,ub as emptyStore,xE as entityHasDetailPage,yE as entityHasStatList,hE as entityShowsNow,GC as enumToSentenceCase,lu as exportChart,Ap as exportTableAsCSV,OC as fahrenheitToCelsius,qA as fahrenheitToKelvin,vA as feetToMeters,wA as feetToMiles,c1 as filterToChips,lm as formatBoolean,_L as formatCapacity,jr as formatComponentValue,mm as formatCurrency,Vc as formatCurrent,fm as formatDate,xm as formatDistance,ul as formatEmptyValue,Xc as formatEnergy,Br as formatFieldValue,jc as formatInternationalPhone,pm as formatNumber,dm as formatPercent,Cm as formatPhone,ca as formatPhoneNumber,_c as formatPower,$L as formatPowerRating,ed as formatResistance,Mm as formatTemperature,zm as formatText,ss as formatUSPhone,od as formatVoltage,Wb as getBadgeClasses,Gb as getBooleanBadgeVariant,Eu as getCellAlignmentClasses,Me as getCellContainerClasses,Lr as getCellTextClasses,uC as getContrastingTextColor,fA as getDateParts,Qa as getDefaultChartColor,_p as getDefaultColors,Iu as getDeviceStateDisplayLabel,Iu as getDeviceStateLabel,fE as getEntityCategory,gc as getEntityConfig,pE as getEntityIcon,mE as getEntityLabel,Jy as getEntityStatList,ho as getEventColor,ck as getExportFormatName,_E as getExportHeaders,dS as getFieldGroupStyles,Bn as getFilterFields,ex as getGridStateLabel,hf as getInputBackgroundStyles,Vt as getInputBaseStyles,Vo as getInputStateStyles,Lu as getLinkClasses,pl as getNumericColorClasses,Tt as getResolvedColor,nr as getSkeletonSize,doe as getStateTone,ln as getThemeCategoricalColors,Or as getYFormatSettings,X1 as gridStateLabels,RA as inchesToCentimeters,Au as isActiveDeviceState,Au as isActiveState,pp as isCustomPinsLayer,lk as isExportSupported,il as isFilterEmpty,up as isGeoJsonLayer,$p as isLightColor,me as isNil,mp as isRasterLayer,dp as isVectorLayer,HC as kelvinToCelsius,QA as kelvinToFahrenheit,SA as kilometersToMiles,cp as layer,Rc as mapValuesToCategoricalColors,yA as metersToFeet,NA as metersToMiles,PA as metersToYards,gm as milesToFeet,CA as milesToKilometers,kA as milesToMeters,Eo as parseBoolean,Yc as pickEnergyUnit,ZE as prepareTableDataForExport,ty as registerPhosphorIcon,Fn as removeFilterCondition,Se as resolveValue,Vm as snakeCaseToWords,Nm as temperatureStringToSymbol,_s as tierForViewport,pT as tileIndexAt,rr as tileKey,pb as tileReducer,Xo as tilesForViewport,cA as toA,yC as toActiveInactive,as as toAmps,Do as toBoolean,Tm as toCelsius,AC as toCentimeters,CC as toCheckmark,kC as toCompactNumber,um as toCurrency,LC as toCustomDateFormat,MC as toDateString,xC as toEnabledDisabled,km as toFahrenheit,Hc as toFeet,wC as toFloat,NC as toFormattedNumber,DC as toFullDateTime,WA as toGW,ym as toGWh,Zc as toGigawatts,EC as toISOString,FC as toInches,SC as toInteger,dA as toKA,n5 as toKV,OA as toKW,Pm as toKelvin,Bc as toKiloamps,Sm as toKilohms,Oc as toKilometers,rd as toKilovolts,qc as toKilowatts,Em as toLowerCase,lA as toMA,r5 as toMV,HA as toMW,hm as toMWh,Qc as toMegawatts,wm as toMegohms,zc as toMeters,Wc as toMiles,Fc as toMilliamps,IC as toMillimeters,$c as toMilliohms,td as toMillivolts,hA as toNauticalMiles,cs as toOhms,hC as toOnOff,cm as toPercentage,is as toRelativeTime,TC as toScientificNotation,UC as toSecret,Lm as toSentenceCase,Rm as toTemperature,Am as toTitleCase,vC as toTrueFalse,Dm as toUpperCase,o5 as toV,ps as toVolts,zA as toW,ls as toWatts,Uc as toWh,Gc as toYards,Kc as tokWh,us as truncateEnd,da as truncateMiddle,ds as truncateStart,ft as typeRole,qr as typographyRole,Fm as ucFirst,Xt as useBreakpoint,kn as useChartContext,xc as useClientDataControls,Bt as useColorMode,oA as useComponentFormatter,ug as useContainerBreakpoint,tv as useDataControls,Bo as useDebounce,xa as useElementSize,Io as useInfiniteScroll,Tr as useInputFocus,Gl as useLocalStorage,Jt as useMediaQuery,sy as useNotice,hc as useServerDataControls,av as useTableExport,yb as useTileWindow,yu as useTiledTimeSeries,VE as useWizard,ao as wrapWithLink,TA as yardsToMeters};//# sourceMappingURL=index.js.map
48
48
  //# sourceMappingURL=index.js.map