fix: alignment guides follow the live gesture again (#521)

#451 moved every editor gesture onto the live painter, and the guides stayed
behind in the settled scene. While a gesture runs, the settled scene is not
re-rendered at all, so the guides did not follow the marker in the device
editor, the shape in the backdrop editor, or the cursor while a contour is
drawn in the plan editor. Measured with real pointer events on the demo stand
against `origin/dev`, after waiting for the editor chrome to settle: three
gestures, each exactly on another object's axis, 0 settled render cycles,
`.alignline` 0 and no `.alignguides` group in all three.

The report called it two breaks. It is one — the layer — plus one thing that
would have broken the repair: `_alignPoint` read `_pos`, which during a live
gesture answers from the snapshot of the last settled render. Over one drag:
live 254.17 → 220.83 while `_pos` stayed at 254.17, eight grid steps behind,
so a restored layer would have drawn the guide at the marker's old place.

The live template now paints the guides in all three modes (the device editor
had no template at all — `paintDevice` only moves the marker element), and
`_alignPoint` takes the live position. The settled copy of
`.hp-editor-only-layer` is made transparent for the duration of any editor
gesture, not only in plan mode: two guides, one of them stale, is what the
user would otherwise see when an unrelated settled render lands mid-gesture.
`_renderAlignGuides` on the card becomes soft — a gesture that starts while
the editor runtime is still loading must cost nothing, and an exception inside
a `requestAnimationFrame` paint would take the whole gesture with it.

The witness is rewritten around the defect that hid this for two stable
releases: the old smoke assigned `_deviceDrag`/`_decorDraft` wholesale, and an
assignment with `oldValue == null` does not route to the live path — it
verified a state a real gesture never reaches. Every scenario now drives real
`PointerEvent`s, waits for silence first (the `_hdrH` settling window right
after entering a mode hands out settled frames that make even the broken code
draw a guide), and asserts zero settled cycles during the movements plus
exactly one `.alignguides` group. #400's exclusion is checked without touching
the drag state: the dragged marker must simply be absent from the candidates.
On `origin/dev` the smoke fails on nine of its facts; a witness that stays
green before the fix was the actual bug here.

Mutants: `live-editor-devices-drops-align-guides`,
`live-editor-decor-drops-align-guides`, `live-editor-plan-drops-align-guides`,
`align-point-reads-frozen-snapshot` — one per AC, all guarded by the smoke.
`test/smoke-harness-contract.test.mjs` pins that the smoke cannot go back to
fabricating gesture state.

Issue: #521
User-Visible: yes
This commit is contained in:
Claude
2026-09-10 22:20:18 +03:00
parent fa7ac02c0f
commit 53585b451b
51 changed files with 699 additions and 407 deletions
@@ -1,89 +1,89 @@
{
"schema": 1,
"fingerprint": "2e6f7d70c797ae4e865b10859c77cc3380a432272a975b8f35b51234ae3cfe62",
"fingerprint": "f05c68a63b313b206793c56f6e16b8ca3dc833f2a702373251b1119db27d7f4c",
"entry": "houseplan-card.js",
"panelEntry": "houseplan-panel.js",
"initialViewFiles": [
"houseplan-assets/houseplan-card-BMuv6THL.js",
"houseplan-assets/houseplan-card-OSEmUAD-.js",
"houseplan-card.js"
],
"initialViewGzipBytes": 299812,
"initialViewGzipBytes": 299824,
"initialPanelFiles": [
"houseplan-assets/houseplan-card-BMuv6THL.js",
"houseplan-assets/houseplan-card-OSEmUAD-.js",
"houseplan-card.js",
"houseplan-panel.js"
],
"initialPanelGzipBytes": 302118,
"initialPanelGzipBytes": 302130,
"initialPanelOnlyFiles": [
"houseplan-panel.js"
],
"initialPanelOnlyGzipBytes": 2306,
"lazyFiles": [
"houseplan-assets/backdrop-pick-DJt73xkJ.js",
"houseplan-assets/de-CnIkrYVa.js",
"houseplan-assets/editor-CzEoJoet.js",
"houseplan-assets/fr-D1gV1f-s.js",
"houseplan-assets/furniture-plan-art.generated-XOCt_Wns.js",
"houseplan-assets/guard-8MebpCtO.js",
"houseplan-assets/houseplan-editor-runtime-BR7ukTUP.js",
"houseplan-assets/houseplan-onboarding-runtime-DKBSTd7u.js",
"houseplan-assets/hp-zigbee-topology-overlay-BRoahbu2.js",
"houseplan-assets/iso-scene-render-hhlqgOTn.js",
"houseplan-assets/live-interaction-runtime-DCcaRZ3p.js",
"houseplan-assets/pdf-export-BqxOXzDP.js",
"houseplan-assets/summary-panel-runtime-loaded-QU6oGUjk.js",
"houseplan-assets/zigbee-topology-86ml1Wbm.js",
"houseplan-assets/zigbee-topology-runtime-BcEe0VIS.js"
"houseplan-assets/backdrop-pick-BoPUTKeK.js",
"houseplan-assets/de-CNSeAOQ3.js",
"houseplan-assets/editor-JMqOmbEv.js",
"houseplan-assets/fr-D5KjY73X.js",
"houseplan-assets/furniture-plan-art.generated-C0hnPM_V.js",
"houseplan-assets/guard-QUChKUQo.js",
"houseplan-assets/houseplan-editor-runtime-B2NknGD4.js",
"houseplan-assets/houseplan-onboarding-runtime-BYMGNkWk.js",
"houseplan-assets/hp-zigbee-topology-overlay-DKWFo-d2.js",
"houseplan-assets/iso-scene-render-BRopB7rI.js",
"houseplan-assets/live-interaction-runtime-BsK654mu.js",
"houseplan-assets/pdf-export-rkZBR1-U.js",
"houseplan-assets/summary-panel-runtime-loaded-DC9vpAeK.js",
"houseplan-assets/zigbee-topology-0qWvfDBi.js",
"houseplan-assets/zigbee-topology-runtime-U6UsskhO.js"
],
"lazyGzipBytes": 418124,
"lazyGzipBytes": 418169,
"lazyEditorFiles": [
"houseplan-assets/backdrop-pick-DJt73xkJ.js",
"houseplan-assets/editor-CzEoJoet.js",
"houseplan-assets/furniture-plan-art.generated-XOCt_Wns.js",
"houseplan-assets/guard-8MebpCtO.js",
"houseplan-assets/houseplan-editor-runtime-BR7ukTUP.js",
"houseplan-assets/zigbee-topology-86ml1Wbm.js"
"houseplan-assets/backdrop-pick-BoPUTKeK.js",
"houseplan-assets/editor-JMqOmbEv.js",
"houseplan-assets/furniture-plan-art.generated-C0hnPM_V.js",
"houseplan-assets/guard-QUChKUQo.js",
"houseplan-assets/houseplan-editor-runtime-B2NknGD4.js",
"houseplan-assets/zigbee-topology-0qWvfDBi.js"
],
"lazyEditorGzipBytes": 205681,
"lazyEditorGzipBytes": 205717,
"lazyOnboardingFiles": [
"houseplan-assets/backdrop-pick-DJt73xkJ.js",
"houseplan-assets/houseplan-onboarding-runtime-DKBSTd7u.js"
"houseplan-assets/backdrop-pick-BoPUTKeK.js",
"houseplan-assets/houseplan-onboarding-runtime-BYMGNkWk.js"
],
"lazyOnboardingGzipBytes": 14183,
"lazyOnboardingGzipBytes": 14185,
"lazyLocaleFiles": [
"houseplan-assets/de-CnIkrYVa.js",
"houseplan-assets/fr-D1gV1f-s.js"
"houseplan-assets/de-CNSeAOQ3.js",
"houseplan-assets/fr-D5KjY73X.js"
],
"lazyLocaleGzipBytes": 54855,
"lazyLocaleGzipBytes": 54856,
"lazyIsometricFiles": [
"houseplan-assets/guard-8MebpCtO.js",
"houseplan-assets/iso-scene-render-hhlqgOTn.js"
"houseplan-assets/guard-QUChKUQo.js",
"houseplan-assets/iso-scene-render-BRopB7rI.js"
],
"lazyIsometricGzipBytes": 13456,
"lazyIsometricGzipBytes": 13459,
"lazyFurnitureArtFiles": [
"houseplan-assets/furniture-plan-art.generated-XOCt_Wns.js"
"houseplan-assets/furniture-plan-art.generated-C0hnPM_V.js"
],
"lazyFurnitureArtGzipBytes": 10251,
"lazyPdfFiles": [
"houseplan-assets/furniture-plan-art.generated-XOCt_Wns.js",
"houseplan-assets/pdf-export-BqxOXzDP.js"
"houseplan-assets/furniture-plan-art.generated-C0hnPM_V.js",
"houseplan-assets/pdf-export-rkZBR1-U.js"
],
"lazyPdfGzipBytes": 120367,
"lazyPdfGzipBytes": 120366,
"files": [
{
"path": "houseplan-assets/backdrop-pick-DJt73xkJ.js",
"sha256": "e5a0f92c77993da16eba0468de5f3f4c539e7910507c9b2abdfbba295d62ae97",
"path": "houseplan-assets/backdrop-pick-BoPUTKeK.js",
"sha256": "546b78e424df30d2d94aae84396f80df6d6d3e185236b287d0e519b3c35ee279",
"rawBytes": 21134,
"gzipBytes": 7145,
"gzipBytes": 7147,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BMuv6THL.js"
"houseplan-assets/houseplan-card-OSEmUAD-.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/de-CnIkrYVa.js",
"sha256": "a3a7ba67f00c4e9bf041d6b45263a90324c7568e81f8b49bbbf3a47dbb31ae3a",
"path": "houseplan-assets/de-CNSeAOQ3.js",
"sha256": "55370ced8262a943f10114060769ce388dffbd66fa9b825fac2cae31765290dd",
"rawBytes": 91441,
"gzipBytes": 27711,
"isEntry": false,
@@ -91,28 +91,28 @@
"dynamicImports": []
},
{
"path": "houseplan-assets/editor-CzEoJoet.js",
"sha256": "ce96845e0bf4b3edc77ff7f3e60ef624c6ce7b28dd3bdef91689248938e68a82",
"path": "houseplan-assets/editor-JMqOmbEv.js",
"sha256": "f6664270134eca4219837cc305f45bcf43adc5ef6120dd2935094b23ff72f3ce",
"rawBytes": 3832,
"gzipBytes": 1585,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BMuv6THL.js"
"houseplan-assets/houseplan-card-OSEmUAD-.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/fr-D1gV1f-s.js",
"sha256": "bbb0b285746c475a1bb29ec6f3c66d913d0af9e6e9cdfe42ce73177bef7f8c25",
"path": "houseplan-assets/fr-D5KjY73X.js",
"sha256": "3086f971d042ceeb81196a81941710b89f391bf0d4efc18ba62cbe3a748b4382",
"rawBytes": 93719,
"gzipBytes": 27144,
"gzipBytes": 27145,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/furniture-plan-art.generated-XOCt_Wns.js",
"sha256": "b95da605686e12dbfa3273052fa16cb09d9938e2333882841a94dd90e999d651",
"path": "houseplan-assets/furniture-plan-art.generated-C0hnPM_V.js",
"sha256": "d909a5bfd9f24f47aeaa4de568c32f529ff0ce2ef921bff3f381e187fdfb15fe",
"rawBytes": 33655,
"gzipBytes": 10251,
"isEntry": false,
@@ -120,188 +120,188 @@
"dynamicImports": []
},
{
"path": "houseplan-assets/guard-8MebpCtO.js",
"sha256": "b269052d60c81b167dc53848c25ce8a5fe1333869313cc045e2b87b273523a77",
"path": "houseplan-assets/guard-QUChKUQo.js",
"sha256": "e3af66ee99c246d262703370b4d278af04169408d1c889a7613b14214f03a461",
"rawBytes": 518,
"gzipBytes": 369,
"gzipBytes": 370,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BMuv6THL.js"
"houseplan-assets/houseplan-card-OSEmUAD-.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-card-BMuv6THL.js",
"sha256": "7f512c2354bb41fc5a390333483dd6e4fa154ec4d92736982431e5bf44a0a096",
"rawBytes": 1078601,
"gzipBytes": 299008,
"path": "houseplan-assets/houseplan-card-OSEmUAD-.js",
"sha256": "1ccc9e8edd37ed6f8182e5beb470183caa304c3435c2964c5ac163aec0ec4380",
"rawBytes": 1078600,
"gzipBytes": 299020,
"isEntry": false,
"imports": [],
"dynamicImports": [
"houseplan-assets/de-CnIkrYVa.js",
"houseplan-assets/editor-CzEoJoet.js",
"houseplan-assets/fr-D1gV1f-s.js",
"houseplan-assets/furniture-plan-art.generated-XOCt_Wns.js",
"houseplan-assets/houseplan-editor-runtime-BR7ukTUP.js",
"houseplan-assets/houseplan-onboarding-runtime-DKBSTd7u.js",
"houseplan-assets/hp-zigbee-topology-overlay-BRoahbu2.js",
"houseplan-assets/iso-scene-render-hhlqgOTn.js",
"houseplan-assets/live-interaction-runtime-DCcaRZ3p.js",
"houseplan-assets/pdf-export-BqxOXzDP.js",
"houseplan-assets/summary-panel-runtime-loaded-QU6oGUjk.js"
"houseplan-assets/de-CNSeAOQ3.js",
"houseplan-assets/editor-JMqOmbEv.js",
"houseplan-assets/fr-D5KjY73X.js",
"houseplan-assets/furniture-plan-art.generated-C0hnPM_V.js",
"houseplan-assets/houseplan-editor-runtime-B2NknGD4.js",
"houseplan-assets/houseplan-onboarding-runtime-BYMGNkWk.js",
"houseplan-assets/hp-zigbee-topology-overlay-DKWFo-d2.js",
"houseplan-assets/iso-scene-render-BRopB7rI.js",
"houseplan-assets/live-interaction-runtime-BsK654mu.js",
"houseplan-assets/pdf-export-rkZBR1-U.js",
"houseplan-assets/summary-panel-runtime-loaded-DC9vpAeK.js"
]
},
{
"path": "houseplan-assets/houseplan-editor-runtime-BR7ukTUP.js",
"sha256": "50bb70879e251179dbb7203a562324da9248fc63eb4f65a917bce6202542ea18",
"rawBytes": 672160,
"gzipBytes": 178900,
"path": "houseplan-assets/houseplan-editor-runtime-B2NknGD4.js",
"sha256": "91c53852ec8908de37d348bbad3ec6fb9edbba2eeba593aadecdf6c9c00dc988",
"rawBytes": 672339,
"gzipBytes": 178936,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-DJt73xkJ.js",
"houseplan-assets/furniture-plan-art.generated-XOCt_Wns.js",
"houseplan-assets/guard-8MebpCtO.js",
"houseplan-assets/houseplan-card-BMuv6THL.js",
"houseplan-assets/zigbee-topology-86ml1Wbm.js"
"houseplan-assets/backdrop-pick-BoPUTKeK.js",
"houseplan-assets/furniture-plan-art.generated-C0hnPM_V.js",
"houseplan-assets/guard-QUChKUQo.js",
"houseplan-assets/houseplan-card-OSEmUAD-.js",
"houseplan-assets/zigbee-topology-0qWvfDBi.js"
],
"dynamicImports": [
"houseplan-assets/zigbee-topology-runtime-BcEe0VIS.js"
"houseplan-assets/zigbee-topology-runtime-U6UsskhO.js"
]
},
{
"path": "houseplan-assets/houseplan-onboarding-runtime-DKBSTd7u.js",
"sha256": "6f45e5b18ac7ab279e2548b7c9e70da223c8bd0564c688e35a223a529a6762b4",
"path": "houseplan-assets/houseplan-onboarding-runtime-BYMGNkWk.js",
"sha256": "e875ebfafe42e6689c9901fe9a04dcad63bca17419e17ee05d7985768918a3df",
"rawBytes": 28287,
"gzipBytes": 7038,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-DJt73xkJ.js",
"houseplan-assets/houseplan-card-BMuv6THL.js"
"houseplan-assets/backdrop-pick-BoPUTKeK.js",
"houseplan-assets/houseplan-card-OSEmUAD-.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/hp-zigbee-topology-overlay-BRoahbu2.js",
"sha256": "b6d24c41180b61cf78235838b9a4d9cf64f7a0e94c0965837659da632c989349",
"path": "houseplan-assets/hp-zigbee-topology-overlay-DKWFo-d2.js",
"sha256": "5cfcd13e4956a286f87fc20550e489838def2aa44e1e3acd721db89606ac431d",
"rawBytes": 11034,
"gzipBytes": 3728,
"gzipBytes": 3731,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BMuv6THL.js",
"houseplan-assets/zigbee-topology-86ml1Wbm.js",
"houseplan-assets/zigbee-topology-runtime-BcEe0VIS.js"
"houseplan-assets/houseplan-card-OSEmUAD-.js",
"houseplan-assets/zigbee-topology-0qWvfDBi.js",
"houseplan-assets/zigbee-topology-runtime-U6UsskhO.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/iso-scene-render-hhlqgOTn.js",
"sha256": "3648b50e2c7db67a871a602e061cfb27c0c57d49e48fb165796b2040302b4722",
"path": "houseplan-assets/iso-scene-render-BRopB7rI.js",
"sha256": "95776ccdde60e6f6d494353a271c0aa524cef5e2b5cbf20db683a8af65af838e",
"rawBytes": 38562,
"gzipBytes": 13087,
"gzipBytes": 13089,
"isEntry": false,
"imports": [
"houseplan-assets/guard-8MebpCtO.js",
"houseplan-assets/houseplan-card-BMuv6THL.js"
"houseplan-assets/guard-QUChKUQo.js",
"houseplan-assets/houseplan-card-OSEmUAD-.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/live-interaction-runtime-DCcaRZ3p.js",
"sha256": "74f360b102709340269d1425e162b1b3b48733ded14b3e9c96392d112e4a19fa",
"path": "houseplan-assets/live-interaction-runtime-BsK654mu.js",
"sha256": "b35513357e4889c356cfdbde562d772c8be19241e089c2b6aa9a6383f0c7cd6b",
"rawBytes": 5196,
"gzipBytes": 2128,
"gzipBytes": 2129,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BMuv6THL.js"
"houseplan-assets/houseplan-card-OSEmUAD-.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/pdf-export-BqxOXzDP.js",
"sha256": "011bc6e1ee4182634c9f00a0063dc55a7ad38eb497381d0a2cea92153542ef76",
"path": "houseplan-assets/pdf-export-rkZBR1-U.js",
"sha256": "0f9dff9653b8229267732d4dbf4454c3c76ddfd36dcfed72fc492d2b9fce990d",
"rawBytes": 237254,
"gzipBytes": 110116,
"gzipBytes": 110115,
"isEntry": false,
"imports": [
"houseplan-assets/furniture-plan-art.generated-XOCt_Wns.js",
"houseplan-assets/houseplan-card-BMuv6THL.js"
"houseplan-assets/furniture-plan-art.generated-C0hnPM_V.js",
"houseplan-assets/houseplan-card-OSEmUAD-.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/summary-panel-editor-CvUVaV6M.js",
"sha256": "372ebeaa2b6b6b1a36fed8d46a66d970361f431df794ba8d4f735bd3b7c6de3c",
"path": "houseplan-assets/summary-panel-editor-BZKruQjX.js",
"sha256": "88ca8b2fcbfb478d408ca0a6fea739b1f4b2684f2b67ee52e4fd151f5e059b5b",
"rawBytes": 14824,
"gzipBytes": 3402,
"gzipBytes": 3401,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BMuv6THL.js",
"houseplan-assets/summary-panel-runtime-loaded-QU6oGUjk.js"
"houseplan-assets/houseplan-card-OSEmUAD-.js",
"houseplan-assets/summary-panel-runtime-loaded-DC9vpAeK.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/summary-panel-metrics-DD7ukKTj.js",
"sha256": "a8cff52183abd5db8a15052d82d02e70755dbaf4d60d2d8b3d5afd71c1f7d75d",
"path": "houseplan-assets/summary-panel-metrics-bO6kFSfP.js",
"sha256": "d1dc85f8b659200c8af996d3a3295e10f04c3847546b5ba9228c050a56e0ca07",
"rawBytes": 2610,
"gzipBytes": 1307,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BMuv6THL.js"
"houseplan-assets/houseplan-card-OSEmUAD-.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/summary-panel-runtime-loaded-QU6oGUjk.js",
"sha256": "032a1172e860092afe2b6f17df776166d1cebcec8c4795fd4e8004b95609066a",
"path": "houseplan-assets/summary-panel-runtime-loaded-DC9vpAeK.js",
"sha256": "9f371e11b1aca4ac84ad13807adf285960e2846e6ba8c7f44a123244a16a5fa5",
"rawBytes": 72272,
"gzipBytes": 19728,
"gzipBytes": 19730,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BMuv6THL.js"
"houseplan-assets/houseplan-card-OSEmUAD-.js"
],
"dynamicImports": [
"houseplan-assets/summary-panel-editor-CvUVaV6M.js",
"houseplan-assets/summary-panel-metrics-DD7ukKTj.js"
"houseplan-assets/summary-panel-editor-BZKruQjX.js",
"houseplan-assets/summary-panel-metrics-bO6kFSfP.js"
]
},
{
"path": "houseplan-assets/zigbee-topology-86ml1Wbm.js",
"sha256": "199b7bb041db57b49913da278212ac85c4fe9f55c25f1ed50252ab3182f6217a",
"path": "houseplan-assets/zigbee-topology-0qWvfDBi.js",
"sha256": "f00c98e759c738c8b7a5ffcc8ddbbed43d2466582c68c4b8cd97b23d17a3c2a4",
"rawBytes": 18961,
"gzipBytes": 7431,
"gzipBytes": 7428,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BMuv6THL.js"
"houseplan-assets/houseplan-card-OSEmUAD-.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/zigbee-topology-runtime-BcEe0VIS.js",
"sha256": "6e650560e552e1092dd2fb4c99cf578fcfe03da4cd1b1f94e8eff498b8b19792",
"path": "houseplan-assets/zigbee-topology-runtime-U6UsskhO.js",
"sha256": "ed32368c787d22a2b6fc09ca349aca6071ee0fc6ee57df1f8de714f70ecfd2a6",
"rawBytes": 3941,
"gzipBytes": 1763,
"gzipBytes": 1764,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BMuv6THL.js",
"houseplan-assets/zigbee-topology-86ml1Wbm.js"
"houseplan-assets/houseplan-card-OSEmUAD-.js",
"houseplan-assets/zigbee-topology-0qWvfDBi.js"
],
"dynamicImports": []
},
{
"path": "houseplan-card.js",
"sha256": "52772eada719ce09fa86787e017c6f0ffa28645d391365694d81f53fbac909eb",
"sha256": "fcbac6b49c4fbe740d1ecf67df08a2bb1b85507e59ac81431656ae86087863b4",
"rawBytes": 1205,
"gzipBytes": 804,
"isEntry": true,
"imports": [
"houseplan-assets/houseplan-card-BMuv6THL.js"
"houseplan-assets/houseplan-card-OSEmUAD-.js"
],
"dynamicImports": []
},
{
"path": "houseplan-panel.js",
"sha256": "e97a154275ce08e79a0bd8622911985749e0b1ad46e8ee7af5955a1cf2458e32",
"sha256": "196159d9c2af6321cbe68dae7e11c761a753285855f308dee19f6531df976035",
"rawBytes": 6124,
"gzipBytes": 2306,
"isEntry": true,
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2e6f7d70c797ae4e865b10859c77cc3380a432272a975b8f35b51234ae3cfe62";import{m as e,l as o,t,e3 as s,A as a,e4 as i,e5 as l,e6 as n,dU as r,b as c}from"./houseplan-card-BMuv6THL.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},f=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f05c68a63b313b206793c56f6e16b8ca3dc833f2a702373251b1119db27d7f4c";import{m as e,l as o,t,e3 as s,A as a,e4 as i,e5 as l,e6 as n,dU as r,b as c}from"./houseplan-card-OSEmUAD-.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},f=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
.hass=${this.hass}
.data=${this._formData}
.schema=${e}
@@ -1 +0,0 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2e6f7d70c797ae4e865b10859c77cc3380a432272a975b8f35b51234ae3cfe62";import{dS as r,dT as t,dU as e}from"./houseplan-card-BMuv6THL.js";const s={},a=r(class extends t{constructor(){super(...arguments),this.ot=s}render(r,t){return t()}update(r,[t,s]){if(Array.isArray(t)){if(Array.isArray(this.ot)&&this.ot.length===t.length&&t.every((r,t)=>r===this.ot[t]))return e}else if(this.ot===t)return e;return this.ot=Array.isArray(t)?Array.from(t):t,this.render(t,s)}});export{a as i};
@@ -0,0 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f05c68a63b313b206793c56f6e16b8ca3dc833f2a702373251b1119db27d7f4c";import{dS as r,dT as t,dU as s}from"./houseplan-card-OSEmUAD-.js";const e={},a=r(class extends t{constructor(){super(...arguments),this.ot=e}render(r,t){return t()}update(r,[t,e]){if(Array.isArray(t)){if(Array.isArray(this.ot)&&this.ot.length===t.length&&t.every((r,t)=>r===this.ot[t]))return s}else if(this.ot===t)return s;return this.ot=Array.isArray(t)?Array.from(t):t,this.render(t,e)}});export{a as i};
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2e6f7d70c797ae4e865b10859c77cc3380a432272a975b8f35b51234ae3cfe62";import{l as t,b0 as s,A as e,t as a,b as o,cj as l,ck as i,cl as h,cm as c,aZ as n,cn as r,cs as p,co as d,cp as _,cq as u,cr as g,ct as m,cu as b,dp as $,dq as v,dr as f,aY as y,a_ as w,ds as D}from"./houseplan-card-BMuv6THL.js";import{c as k,e as S,r as C,a as M}from"./backdrop-pick-DJt73xkJ.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="2e6f7d70c797ae4e865b10859c77cc3380a432272a975b8f35b51234ae3cfe62";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?o`<hp-help data-help-key=${l}
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f05c68a63b313b206793c56f6e16b8ca3dc833f2a702373251b1119db27d7f4c";import{l as t,b0 as s,A as e,t as a,b as o,cj as l,ck as i,cl as h,cm as c,aZ as n,cn as r,cs as p,co as d,cp as _,cq as u,cr as g,ct as m,cu as b,dp as $,dq as v,dr as f,aY as y,a_ as w,ds as D}from"./houseplan-card-OSEmUAD-.js";import{c as k,e as S,r as C,a as M}from"./backdrop-pick-BoPUTKeK.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="f05c68a63b313b206793c56f6e16b8ca3dc833f2a702373251b1119db27d7f4c";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?o`<hp-help data-help-key=${l}
.text=${a(h,l)} .ariaLabel=${a(h,i)}></hp-help>`:e}_openSpaceDialog(t,s){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===t){const e=this.host._serverCfg.spaces.find(t=>t.id===s);if(!e)return;const a=l(e),o=e.settings?.custom_fill&&"object"==typeof e.settings.custom_fill?i(e.settings.custom_fill):null,p="none"===a.fill?{...o||h,a:0}:o;return void(this.host._spaceDialog={mode:t,spaceId:s,title:e.title,planUrl:e.plan_url||null,planFile:null,source:e.plan_url?"file":"draw",showBorders:a.showBorders,showNames:a.showNames,zeroWallStyle:r(e),displayTouched:!0,hideDecor:a.hideDecor,hideOpenings:a.hideOpenings,roomColor:a.color,roomOpacity:a.opacity,fillMode:"none"===a.fill?"custom":a.fill,customFill:p,glowEnabled:a.glow,bgColor:a.bgColor,bgMode:"static"===e.settings?.bg_mode||"daynight"===e.settings?.bg_mode?e.settings.bg_mode:null,northDeg:n({},e.settings),sunRays:"boolean"==typeof e.settings?.sun_rays?e.settings.sun_rays:null,tempMin:a.tempMin,tempMax:a.tempMax,showLqi:a.showLqi??this.host._config?.show_signal??!0,cardFontScale:a.cardFontScale,labelTemp:a.labelTemp,labelHum:a.labelHum,labelLqi:a.labelLqi,labelLight:a.labelLight,cellCm:Number(e.cell_cm)>0?Number(e.cell_cm):5,cellCmInput:c(Number(e.cell_cm)>0?Number(e.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const e=p(this.host._imperial);this.host._spaceDialog={mode:t,title:"",planUrl:null,planFile:null,...m(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:g,roomOpacity:u,fillMode:"custom",customFill:{...h,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:_,tempMax:d,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:e,cellCmInput:c(e,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;s.value="";const a=await k(e);if("reject"===a.kind)return void this.host._showToast(this.host._t("toast.plan_formats"));if("guard"===a.kind)return void(this.host._backdropGuard=a.state);const o=await S(e,a.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:o})}_renderBackdropGuard(){return C(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??e}_useServerPlan(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,planUrl:t,planFile:null,pickSaved:!1,savedAspect:void 0},this.host._aspectJob=this._readPlanAspect(t))}async _readPlanAspect(t){for(let s=0;s<40;s++){const s=this.host._display(t);if(s){const e=await new Promise(t=>{const e=new Image;e.onload=()=>t(e.naturalWidth&&e.naturalHeight?e.naturalWidth/e.naturalHeight:0),e.onerror=()=>t(0),e.src=s}),a=this.host._spaceDialog;return a&&a.planUrl===t&&Number.isFinite(e)&&e>0?(this.host._spaceDialog={...a,savedAspect:e},e):0}if(await new Promise(t=>setTimeout(t,150)),this.host._spaceDialog?.planUrl!==t)return 0}return 0}async _deleteServerPlan(t){const s=this.host._spaceDialog,e=s?.saved?.find(s=>s.name===t);if(!s||!e||e.used_by.length||e.url===s.planUrl)return;const a=await this.host._confirmDanger({key:"delete-plan",kind:"destructive",title:this.host._t("confirm.delete_plan_title"),message:this.host._t("confirm.delete_plan_body"),objectName:t,confirmLabel:this.host._t("btn.delete"),cancelLabel:this.host._t("btn.cancel")}),o=this.host._spaceDialog,l=o?.saved?.find(s=>s.name===t);if(a&&o&&l&&l.url===e.url&&l.modified===e.modified&&!l.used_by.length&&l.url!==o.planUrl)try{await this.host.hass.callWS({type:"houseplan/plans/delete",name:t});const s=this.host._spaceDialog;s?.saved&&(this.host._spaceDialog={...s,saved:s.saved.filter(s=>s.name!==t)})}catch(t){this.host._showToast(this.host._t("toast.plan_delete_failed",{err:this.host._errText(t)}))}}_renderServerPlans(t){if(t.savedBusy)return o`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return o`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return o`<div class="savedplans">
${s.map(s=>{return o`
<div class="savedplan ${s.url===t.planUrl?"cur":""}">
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2e6f7d70c797ae4e865b10859c77cc3380a432272a975b8f35b51234ae3cfe62";import{b as a,A as e}from"./houseplan-card-BMuv6THL.js";import{s,n as t,a as l,m as r,b as o,c as i,d as u}from"./summary-panel-runtime-loaded-QU6oGUjk.js";const m=m=>{const{host:c,dialog:d,problems:n,t:b}=m,y=n.find(a=>"error"===a.kind),$=d.localShow!==d.baseLocalShow||!d.localOnly&&!s(t(d.draft),d.base),p=$&&!d.busy&&!y,v=a=>n.find(e=>e.path===a),h=a=>a?b(`summary.problem.${a.code}`):"",k=()=>m.close(),g=a`<label class="summary-switch" for="summary-local-show">
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f05c68a63b313b206793c56f6e16b8ca3dc833f2a702373251b1119db27d7f4c";import{b as a,A as e}from"./houseplan-card-OSEmUAD-.js";import{s,n as t,a as l,m as r,b as o,c as i,d as u}from"./summary-panel-runtime-loaded-DC9vpAeK.js";const m=m=>{const{host:c,dialog:d,problems:n,t:b}=m,y=n.find(a=>"error"===a.kind),$=d.localShow!==d.baseLocalShow||!d.localOnly&&!s(t(d.draft),d.base),p=$&&!d.busy&&!y,v=a=>n.find(e=>e.path===a),h=a=>a?b(`summary.problem.${a.code}`):"",k=()=>m.close(),g=a`<label class="summary-switch" for="summary-local-show">
<span class="summary-switch-caption"><strong>${b("summary.show_local")}</strong>
<small id="summary-local-show-hint">${b("summary.show_local_hint")}</small></span>
<input id="summary-local-show" data-summary-local-show type="checkbox"
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2e6f7d70c797ae4e865b10859c77cc3380a432272a975b8f35b51234ae3cfe62";import{e9 as e,L as t,a2 as n,J as i,an as o,N as r,bo as s,bn as a,a1 as c,a0 as l,ax as u,ea as d,eb as f,bq as m,ec as g}from"./houseplan-card-BMuv6THL.js";function v(e){if(!e.registry.authoritative)return null;const t=new Set,n=u(e.markers);for(const i of Object.values(e.registry.devices||{}))i?.id&&"service"!==i.entry_type&&!n.devices.has(i.id)&&i.area_id&&e.areaToSpace[i.area_id]&&t.add(i.id);for(const i of e.markers||[]){if(i.removed||"virtual"===i.binding)continue;const o=String(i.binding||"").indexOf(":");if(o<1)continue;const r=i.binding.slice(0,o),s=i.binding.slice(o+1),a="device"===r?e.registry.devices?.[s]:null,c="entity"===r?e.registry.entities?.[s]:null,l="device"===r?s:c?.device_id,u="device"===r?a?.area_id:c?.area_id||l&&e.registry.devices?.[l]?.area_id,d="string"==typeof i.room_id&&i.room_id.length>0&&null===i.area?"":i.area||u||"",f=d&&e.areaToSpace[d]||i.space||e.firstSpaceId;l&&e.registry.devices?.[l]&&e.spaceIds.has(f)&&(!n.devices.has(l)||"entity"===r&&n.liveEntities.has(s))&&t.add(l)}return t}function y(e,t){return e?.length?t?.length?g(e,t):e:t}function _(e,t){const n=c(e.rooms,t.walls,t.openCuts,[],i,t.cellCm,o,r);return{roomGeom:"ok"===n.status||"degraded-extra"===n.status?n.roomGeom:void 0,multiWallNodes:l(e.rooms,t.walls,t.openCuts,i,t.cellCm,o,r)}}function*h(c,l,u=_){try{let d=0;for(const f of l){const l=c.spaces.find(e=>String(e?.id)===f.id);if(!l)continue;const m=e(l,f),g=u(f,m);let v=null;for(const e of f.rooms){if(!e.id)continue;const a=t(e);if(!a)continue;const c=n(f.rooms,e.id,m.walls,m.openCuts,i,m.cellCm,o,r,g.roomGeom,g.multiWallNodes)||a;v=y(v,s(c,m.physicalBodies)),yield}const _=m.cellCm/o;d+=a(v)*_*_/1e4}return d}catch{return null}}function p(e,t,n=_){const i=h(e,t,n);let o=i.next();for(;!o.done;)o=i.next();return o.value}function b(e,t,n,i){if("system"!==e.type)return null;if("device_count"===e.key)return null===t.deviceCount?null:String(t.deviceCount);if("total_area"===e.key)return null===t.areaM2?null:m(t.areaM2,"mi"===n?.config?.unit_system?.length);try{return new Intl.DateTimeFormat(i||void 0,{dateStyle:"short",timeStyle:"short",timeZone:n?.config?.time_zone||void 0}).format(t.now)}catch{return t.now.toLocaleString()}}function S(e,t){const n=e?.states?.[t];if(!n)return null;const i=d(e,t);return i?f(i,String(n.attributes?.unit_of_measurement||"")):null}export{h as cleanFloorAreaSteps,v as representedHaDeviceIds,_ as spaceWallGeometry,S as summaryEntityValue,b as summarySystemValue,p as totalCleanFloorAreaM2};
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f05c68a63b313b206793c56f6e16b8ca3dc833f2a702373251b1119db27d7f4c";import{e9 as e,L as t,a2 as n,J as i,an as o,N as r,bo as s,bn as a,a1 as c,a0 as l,ax as u,ea as d,eb as f,bq as m,ec as g}from"./houseplan-card-OSEmUAD-.js";function v(e){if(!e.registry.authoritative)return null;const t=new Set,n=u(e.markers);for(const i of Object.values(e.registry.devices||{}))i?.id&&"service"!==i.entry_type&&!n.devices.has(i.id)&&i.area_id&&e.areaToSpace[i.area_id]&&t.add(i.id);for(const i of e.markers||[]){if(i.removed||"virtual"===i.binding)continue;const o=String(i.binding||"").indexOf(":");if(o<1)continue;const r=i.binding.slice(0,o),s=i.binding.slice(o+1),a="device"===r?e.registry.devices?.[s]:null,c="entity"===r?e.registry.entities?.[s]:null,l="device"===r?s:c?.device_id,u="device"===r?a?.area_id:c?.area_id||l&&e.registry.devices?.[l]?.area_id,d="string"==typeof i.room_id&&i.room_id.length>0&&null===i.area?"":i.area||u||"",f=d&&e.areaToSpace[d]||i.space||e.firstSpaceId;l&&e.registry.devices?.[l]&&e.spaceIds.has(f)&&(!n.devices.has(l)||"entity"===r&&n.liveEntities.has(s))&&t.add(l)}return t}function y(e,t){return e?.length?t?.length?g(e,t):e:t}function _(e,t){const n=c(e.rooms,t.walls,t.openCuts,[],i,t.cellCm,o,r);return{roomGeom:"ok"===n.status||"degraded-extra"===n.status?n.roomGeom:void 0,multiWallNodes:l(e.rooms,t.walls,t.openCuts,i,t.cellCm,o,r)}}function*b(c,l,u=_){try{let d=0;for(const f of l){const l=c.spaces.find(e=>String(e?.id)===f.id);if(!l)continue;const m=e(l,f),g=u(f,m);let v=null;for(const e of f.rooms){if(!e.id)continue;const a=t(e);if(!a)continue;const c=n(f.rooms,e.id,m.walls,m.openCuts,i,m.cellCm,o,r,g.roomGeom,g.multiWallNodes)||a;v=y(v,s(c,m.physicalBodies)),yield}const _=m.cellCm/o;d+=a(v)*_*_/1e4}return d}catch{return null}}function h(e,t,n=_){const i=b(e,t,n);let o=i.next();for(;!o.done;)o=i.next();return o.value}function p(e,t,n,i){if("system"!==e.type)return null;if("device_count"===e.key)return null===t.deviceCount?null:String(t.deviceCount);if("total_area"===e.key)return null===t.areaM2?null:m(t.areaM2,"mi"===n?.config?.unit_system?.length);try{return new Intl.DateTimeFormat(i||void 0,{dateStyle:"short",timeStyle:"short",timeZone:n?.config?.time_zone||void 0}).format(t.now)}catch{return t.now.toLocaleString()}}function S(e,t){const n=e?.states?.[t];if(!n)return null;const i=d(e,t);return i?f(i,String(n.attributes?.unit_of_measurement||"")):null}export{b as cleanFloorAreaSteps,v as representedHaDeviceIds,_ as spaceWallGeometry,S as summaryEntityValue,p as summarySystemValue,h as totalCleanFloorAreaM2};
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2e6f7d70c797ae4e865b10859c77cc3380a432272a975b8f35b51234ae3cfe62";import{n as t,b as n}from"./zigbee-topology-86ml1Wbm.js";import{B as e}from"./houseplan-card-BMuv6THL.js";const o=new WeakMap;function i(t){const n=function(t){const n=t?.connection||t;return!n||"object"!=typeof n&&"function"!=typeof n?null:n}(t);if(!n)return null;let e=o.get(n);return e||(e={revision:0,topologies:[],states:{},listeners:new Set,inflight:new Map},o.set(n,e)),e}function r(t,n,e){t.states={...t.states,[n]:e},function(t){t.revision++;for(const n of t.listeners)n()}(t)}function s(t){const n=t?.code;if("permission"===n||"unsupported"===n||"timeout"===n||"invalid_topic"===n||"invalid_payload"===n)return n;const e=String(t?.message||"").toLowerCase();return e.includes("unauthor")||e.includes("permission")?"permission":e.includes("unknown_command")||e.includes("not found")?"unsupported":"provider"}function a(t){return Object.assign(new Error(t),{code:t})}function c(t,n,e){const o=t.inflight.get(n);if(o)return o;r(t,n,{phase:"loading"});const i=e().then(n=>{if(!n.nodes.length&&n.warnings.some(t=>"invalid_payload"===t.code))throw a("invalid_payload");!function(t,n){t.topologies=[...t.topologies.filter(t=>!(t.provider===n.provider&&t.instanceId===n.instanceId)),n],r(t,"zha"===n.provider?"zha":`z2m:${n.instanceId}`,{phase:"ready",obtainedAt:n.obtainedAt,partial:n.warnings.length>0})}(t,n)}).catch(e=>{r(t,n,{phase:"error",error:s(e)})}).finally(()=>t.inflight.delete(n));return t.inflight.set(n,i),i}function l(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function u(t,n){const e=i(t);return e?(e.listeners.add(n),()=>e.listeners.delete(n)):()=>{}}function p(t){if(!0!==t?.user?.is_admin)throw a("permission")}function f(n){const e=i(n);return e?c(e,"zha",async()=>{if(p(n),"function"!=typeof n?.callWS)throw a("unsupported");return t(await n.callWS({type:"zha/devices"}))}):Promise.resolve()}function d(t){return null!==t&&"object"==typeof t?t:null}function h(t){const n=d(t),e=n?.payload??t;if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return null}}async function g(t,n){let e;try{return await Promise.race([t,new Promise((t,o)=>{e=globalThis.setTimeout(()=>o(a("timeout")),Math.max(1,n))})])}finally{void 0!==e&&globalThis.clearTimeout(e)}}function m(t,o,r=15e4){const s=i(t);if(!s)return Promise.resolve();const l=e(o);return c(s,`z2m:${l||String(o)}`,async()=>{if(p(t),!l)throw a("invalid_topic");const e=t.connection,o=e?.subscribeMessage;if("function"!=typeof o||"function"!=typeof t?.callService)throw a("unsupported");const i=function(){const t=globalThis.crypto;return"function"==typeof t?.randomUUID?`houseplan-${t.randomUUID()}`:`houseplan-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}(),s=Date.now()+Math.max(1,r);let c=!1,u=null,f=null,m=null;const y=new Promise(t=>{u=t}),w=new Promise((t,n)=>{f=t,m=n}),b=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&u?.()},{type:"mqtt/subscribe",topic:`${l}/bridge/info`});"function"==typeof r&&b.push(r);const p=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);null!==n?n&&function(t){const n=d(t),e=n?.transaction??d(n?.data)?.transaction;return"string"==typeof e||"number"==typeof e?String(e):null}(n)===i&&f?.(n):c&&m?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof p&&b.push(p),await g(y,Math.min(4e3,Math.max(1,s-Date.now()))),c=!0,await t.callService("mqtt","publish",{topic:`${l}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const v=await g(w,s-Date.now()),_=d(v)?.status;if(_&&"ok"!==_)throw a("provider");return n(v,l)}finally{for(const t of b)try{t()}catch{}}})}export{f as readZhaTopology,m as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot};
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f05c68a63b313b206793c56f6e16b8ca3dc833f2a702373251b1119db27d7f4c";import{n as t,b as n}from"./zigbee-topology-0qWvfDBi.js";import{B as e}from"./houseplan-card-OSEmUAD-.js";const o=new WeakMap;function i(t){const n=function(t){const n=t?.connection||t;return!n||"object"!=typeof n&&"function"!=typeof n?null:n}(t);if(!n)return null;let e=o.get(n);return e||(e={revision:0,topologies:[],states:{},listeners:new Set,inflight:new Map},o.set(n,e)),e}function r(t,n,e){t.states={...t.states,[n]:e},function(t){t.revision++;for(const n of t.listeners)n()}(t)}function s(t){const n=t?.code;if("permission"===n||"unsupported"===n||"timeout"===n||"invalid_topic"===n||"invalid_payload"===n)return n;const e=String(t?.message||"").toLowerCase();return e.includes("unauthor")||e.includes("permission")?"permission":e.includes("unknown_command")||e.includes("not found")?"unsupported":"provider"}function a(t){return Object.assign(new Error(t),{code:t})}function c(t,n,e){const o=t.inflight.get(n);if(o)return o;r(t,n,{phase:"loading"});const i=e().then(n=>{if(!n.nodes.length&&n.warnings.some(t=>"invalid_payload"===t.code))throw a("invalid_payload");!function(t,n){t.topologies=[...t.topologies.filter(t=>!(t.provider===n.provider&&t.instanceId===n.instanceId)),n],r(t,"zha"===n.provider?"zha":`z2m:${n.instanceId}`,{phase:"ready",obtainedAt:n.obtainedAt,partial:n.warnings.length>0})}(t,n)}).catch(e=>{r(t,n,{phase:"error",error:s(e)})}).finally(()=>t.inflight.delete(n));return t.inflight.set(n,i),i}function l(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function u(t,n){const e=i(t);return e?(e.listeners.add(n),()=>e.listeners.delete(n)):()=>{}}function p(t){if(!0!==t?.user?.is_admin)throw a("permission")}function f(n){const e=i(n);return e?c(e,"zha",async()=>{if(p(n),"function"!=typeof n?.callWS)throw a("unsupported");return t(await n.callWS({type:"zha/devices"}))}):Promise.resolve()}function d(t){return null!==t&&"object"==typeof t?t:null}function h(t){const n=d(t),e=n?.payload??t;if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return null}}async function g(t,n){let e;try{return await Promise.race([t,new Promise((t,o)=>{e=globalThis.setTimeout(()=>o(a("timeout")),Math.max(1,n))})])}finally{void 0!==e&&globalThis.clearTimeout(e)}}function m(t,o,r=15e4){const s=i(t);if(!s)return Promise.resolve();const l=e(o);return c(s,`z2m:${l||String(o)}`,async()=>{if(p(t),!l)throw a("invalid_topic");const e=t.connection,o=e?.subscribeMessage;if("function"!=typeof o||"function"!=typeof t?.callService)throw a("unsupported");const i=function(){const t=globalThis.crypto;return"function"==typeof t?.randomUUID?`houseplan-${t.randomUUID()}`:`houseplan-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}(),s=Date.now()+Math.max(1,r);let c=!1,u=null,f=null,m=null;const y=new Promise(t=>{u=t}),w=new Promise((t,n)=>{f=t,m=n}),b=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&u?.()},{type:"mqtt/subscribe",topic:`${l}/bridge/info`});"function"==typeof r&&b.push(r);const p=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);null!==n?n&&function(t){const n=d(t),e=n?.transaction??d(n?.data)?.transaction;return"string"==typeof e||"number"==typeof e?String(e):null}(n)===i&&f?.(n):c&&m?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof p&&b.push(p),await g(y,Math.min(4e3,Math.max(1,s-Date.now()))),c=!0,await t.callService("mqtt","publish",{topic:`${l}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const v=await g(w,s-Date.now()),_=d(v)?.status;if(_&&"ok"!==_)throw a("provider");return n(v,l)}finally{for(const t of b)try{t()}catch{}}})}export{f as readZhaTopology,m as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot};
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2e6f7d70c797ae4e865b10859c77cc3380a432272a975b8f35b51234ae3cfe62";try{await import("./houseplan-assets/houseplan-card-BMuv6THL.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale houseplan-card.js: the implementation chunk is unavailable",e)}
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f05c68a63b313b206793c56f6e16b8ca3dc833f2a702373251b1119db27d7f4c";try{await import("./houseplan-assets/houseplan-card-OSEmUAD-.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale houseplan-card.js: the implementation chunk is unavailable",e)}
File diff suppressed because one or more lines are too long