diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index bfc4cf98..726d8e07 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -37,6 +37,7 @@ jobs: - large-house - isometric - plan-snap + - interaction - blend - overlay - space-default @@ -190,6 +191,10 @@ jobs: npm run benchmark:large-house-plan-snap -- --target-root=../baseline --samples=7 --warmups=1 --output=../artifacts/performance/plan-snap-baseline.json npm run benchmark:large-house-plan-snap -- --target-root=. --samples=7 --warmups=1 --output=../artifacts/performance/plan-snap-candidate.json ;; + interaction) + npm run benchmark:large-house-interaction -- --target-root=../baseline --samples=7 --warmups=1 --output=../artifacts/performance/interaction-baseline.json + npm run benchmark:large-house-interaction -- --target-root=. --samples=7 --warmups=1 --output=../artifacts/performance/interaction-candidate.json + ;; blend) npm run benchmark:glow -- --profile=large-light-blend-v1 --target-root=../baseline --samples=7 --warmups=1 --output=../artifacts/performance/blend-baseline.json npm run benchmark:glow -- --profile=large-light-blend-v1 --target-root=. --samples=7 --warmups=1 --output=../artifacts/performance/blend-candidate.json @@ -235,6 +240,9 @@ jobs: plan-snap) npm run benchmark:compare -- --budgets=demo/performance/budgets-large-house-plan-snap.json --baseline=../artifacts/performance/plan-snap-baseline.json --candidate=../artifacts/performance/plan-snap-candidate.json --output=../artifacts/performance/plan-snap-comparison.json ;; + interaction) + npm run benchmark:compare -- --budgets=demo/performance/budgets-large-house-interaction.json --baseline=../artifacts/performance/interaction-baseline.json --candidate=../artifacts/performance/interaction-candidate.json --output=../artifacts/performance/interaction-comparison.json + ;; blend) npm run benchmark:compare -- --budgets=demo/performance/budgets-large-light-blend.json --baseline=../artifacts/performance/blend-baseline.json --candidate=../artifacts/performance/blend-candidate.json --output=../artifacts/performance/blend-comparison.json ;; diff --git a/custom_components/houseplan/frontend/houseplan-assets.json b/custom_components/houseplan/frontend/houseplan-assets.json index 99bc1ffe..b344cb35 100644 --- a/custom_components/houseplan/frontend/houseplan-assets.json +++ b/custom_components/houseplan/frontend/houseplan-assets.json @@ -1,169 +1,182 @@ { "schema": 1, - "fingerprint": "7b4d74c1518e5fb1a797d7bcbc7e8b7a5eef380513e51e6901c3c9f537123e91", + "fingerprint": "71049c6ab3188a66c7112a997ed0f56cdd5e60d90668049e62f53c7c7e022ae7", "entry": "houseplan-card.js", "initialViewFiles": [ - "houseplan-assets/houseplan-card-DcH_msOh.js", + "houseplan-assets/houseplan-card-Csq_DR2Y.js", "houseplan-card.js" ], - "initialViewGzipBytes": 295744, + "initialViewGzipBytes": 296722, "lazyFiles": [ - "houseplan-assets/backdrop-pick-CXzP7hUG.js", - "houseplan-assets/de-CcfVGZcf.js", - "houseplan-assets/editor-CrMXGx3s.js", - "houseplan-assets/fr-OCiOh_q7.js", - "houseplan-assets/houseplan-editor-runtime-CaF5LJAh.js", - "houseplan-assets/houseplan-onboarding-runtime-BiIOObYb.js", - "houseplan-assets/hp-zigbee-topology-overlay-B7l7_FNi.js", - "houseplan-assets/zigbee-topology-runtime-BFjOXm55.js", - "houseplan-assets/zigbee-topology-x104QxRs.js" + "houseplan-assets/backdrop-pick-CEZBr4qx.js", + "houseplan-assets/de-DR62x0IQ.js", + "houseplan-assets/editor-BVOuJXsz.js", + "houseplan-assets/fr-D4YIJQhT.js", + "houseplan-assets/houseplan-editor-runtime-C5_zNXOu.js", + "houseplan-assets/houseplan-onboarding-runtime-C0Zl7v7b.js", + "houseplan-assets/hp-zigbee-topology-overlay-CnCZWJj6.js", + "houseplan-assets/live-interaction-runtime-C2JvTP_O.js", + "houseplan-assets/zigbee-topology-D9L1ESh4.js", + "houseplan-assets/zigbee-topology-runtime-DUxfg4Z9.js" ], - "lazyGzipBytes": 234162, + "lazyGzipBytes": 240676, "lazyEditorFiles": [ - "houseplan-assets/backdrop-pick-CXzP7hUG.js", - "houseplan-assets/editor-CrMXGx3s.js", - "houseplan-assets/houseplan-editor-runtime-CaF5LJAh.js", - "houseplan-assets/zigbee-topology-x104QxRs.js" + "houseplan-assets/backdrop-pick-CEZBr4qx.js", + "houseplan-assets/editor-BVOuJXsz.js", + "houseplan-assets/houseplan-editor-runtime-C5_zNXOu.js", + "houseplan-assets/zigbee-topology-D9L1ESh4.js" ], - "lazyEditorGzipBytes": 173958, + "lazyEditorGzipBytes": 178334, "lazyOnboardingFiles": [ - "houseplan-assets/backdrop-pick-CXzP7hUG.js", - "houseplan-assets/houseplan-onboarding-runtime-BiIOObYb.js" + "houseplan-assets/backdrop-pick-CEZBr4qx.js", + "houseplan-assets/houseplan-onboarding-runtime-C0Zl7v7b.js" ], - "lazyOnboardingGzipBytes": 14235, + "lazyOnboardingGzipBytes": 14241, "lazyLocaleFiles": [ - "houseplan-assets/de-CcfVGZcf.js", - "houseplan-assets/fr-OCiOh_q7.js" + "houseplan-assets/de-DR62x0IQ.js", + "houseplan-assets/fr-D4YIJQhT.js" ], - "lazyLocaleGzipBytes": 49109, + "lazyLocaleGzipBytes": 49115, "files": [ { - "path": "houseplan-assets/backdrop-pick-CXzP7hUG.js", - "sha256": "ede625d42274e8806716776cb0e4de9707fa6713bd990f13c564fc9348fe08c5", - "rawBytes": 21418, + "path": "houseplan-assets/backdrop-pick-CEZBr4qx.js", + "sha256": "709ac3421f7630a539c5c1c27248b39f76e6d9d2b54b75057abb0b4af70bc844", + "rawBytes": 21417, "gzipBytes": 7282, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-DcH_msOh.js" + "houseplan-assets/houseplan-card-Csq_DR2Y.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/de-CcfVGZcf.js", - "sha256": "ceca4bfbade91448d50b8ce35e0e894fcf58023f692d6ecc11968add4a501661", + "path": "houseplan-assets/de-DR62x0IQ.js", + "sha256": "0377277d00b6e025e587aa7404a3cecea12c56d873fa9741680a4ab246914d09", "rawBytes": 82182, - "gzipBytes": 24824, + "gzipBytes": 24827, "isEntry": false, "imports": [], "dynamicImports": [] }, { - "path": "houseplan-assets/editor-CrMXGx3s.js", - "sha256": "70f2f6ee3de165adf92a553886464362fdfcad7dc99e294340e945d82369ece9", - "rawBytes": 3826, - "gzipBytes": 1579, + "path": "houseplan-assets/editor-BVOuJXsz.js", + "sha256": "efde2f9d2f8bc1f5fb961bb3c57feb8a291018f2871c4c068ab60bae58106446", + "rawBytes": 3831, + "gzipBytes": 1583, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-DcH_msOh.js" + "houseplan-assets/houseplan-card-Csq_DR2Y.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/fr-OCiOh_q7.js", - "sha256": "35feec4d0e40f8d157537b89c32e7cf066fdb984c020c2112303b6863bfa2bfd", + "path": "houseplan-assets/fr-D4YIJQhT.js", + "sha256": "e5c0ff025e2826a8a43b53e6af22c7314a5b72effd2b41d7cfd38a128f998925", "rawBytes": 84312, - "gzipBytes": 24285, + "gzipBytes": 24288, "isEntry": false, "imports": [], "dynamicImports": [] }, { - "path": "houseplan-assets/houseplan-card-DcH_msOh.js", - "sha256": "3ad91eaf921e0d682e4b9c14af09d754d1511b432624cc5e7064d71b00aabe0e", - "rawBytes": 1050357, - "gzipBytes": 294949, + "path": "houseplan-assets/houseplan-card-Csq_DR2Y.js", + "sha256": "2751d48b52d10030532b2de87f0f0c7f38c283223bae57c8728b2717b115c353", + "rawBytes": 1053904, + "gzipBytes": 295925, "isEntry": false, "imports": [], "dynamicImports": [ - "houseplan-assets/de-CcfVGZcf.js", - "houseplan-assets/editor-CrMXGx3s.js", - "houseplan-assets/fr-OCiOh_q7.js", - "houseplan-assets/houseplan-editor-runtime-CaF5LJAh.js", - "houseplan-assets/houseplan-onboarding-runtime-BiIOObYb.js", - "houseplan-assets/hp-zigbee-topology-overlay-B7l7_FNi.js" + "houseplan-assets/de-DR62x0IQ.js", + "houseplan-assets/editor-BVOuJXsz.js", + "houseplan-assets/fr-D4YIJQhT.js", + "houseplan-assets/houseplan-editor-runtime-C5_zNXOu.js", + "houseplan-assets/houseplan-onboarding-runtime-C0Zl7v7b.js", + "houseplan-assets/hp-zigbee-topology-overlay-CnCZWJj6.js", + "houseplan-assets/live-interaction-runtime-C2JvTP_O.js" ] }, { - "path": "houseplan-assets/houseplan-editor-runtime-CaF5LJAh.js", - "sha256": "9045a38e1be7f4a93f6934c82380b94e2e9df95532bcfd2085d25c5225a00a04", - "rawBytes": 608951, - "gzipBytes": 160252, + "path": "houseplan-assets/houseplan-editor-runtime-C5_zNXOu.js", + "sha256": "db3ca36d567fb682fb633555bdfa963db0d2f5e9682c1532bdf6ef81c17591fc", + "rawBytes": 622491, + "gzipBytes": 164622, "isEntry": false, "imports": [ - "houseplan-assets/backdrop-pick-CXzP7hUG.js", - "houseplan-assets/houseplan-card-DcH_msOh.js", - "houseplan-assets/zigbee-topology-x104QxRs.js" + "houseplan-assets/backdrop-pick-CEZBr4qx.js", + "houseplan-assets/houseplan-card-Csq_DR2Y.js", + "houseplan-assets/zigbee-topology-D9L1ESh4.js" ], "dynamicImports": [ - "houseplan-assets/zigbee-topology-runtime-BFjOXm55.js" + "houseplan-assets/zigbee-topology-runtime-DUxfg4Z9.js" ] }, { - "path": "houseplan-assets/houseplan-onboarding-runtime-BiIOObYb.js", - "sha256": "1619296b625e2dd17d93ab4bc01e928dec730ddf5b8a56e12a7bc276addf10e6", + "path": "houseplan-assets/houseplan-onboarding-runtime-C0Zl7v7b.js", + "sha256": "bb156e1a1244328a728875141ddf47d2ebe0d1e12e763eb1336e2f72837bcfaf", "rawBytes": 28088, - "gzipBytes": 6953, + "gzipBytes": 6959, "isEntry": false, "imports": [ - "houseplan-assets/backdrop-pick-CXzP7hUG.js", - "houseplan-assets/houseplan-card-DcH_msOh.js" + "houseplan-assets/backdrop-pick-CEZBr4qx.js", + "houseplan-assets/houseplan-card-Csq_DR2Y.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/hp-zigbee-topology-overlay-B7l7_FNi.js", - "sha256": "4e87b71be6179c03adb570887921e1a86ba8965483be24135f3bce2d27a5ed82", - "rawBytes": 6007, - "gzipBytes": 2380, + "path": "houseplan-assets/hp-zigbee-topology-overlay-CnCZWJj6.js", + "sha256": "aac582f8d2e0586aeed749ff9581f1fb7d11bb15493cc939bd37b61f903c05aa", + "rawBytes": 6006, + "gzipBytes": 2376, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-DcH_msOh.js", - "houseplan-assets/zigbee-topology-runtime-BFjOXm55.js", - "houseplan-assets/zigbee-topology-x104QxRs.js" + "houseplan-assets/houseplan-card-Csq_DR2Y.js", + "houseplan-assets/zigbee-topology-D9L1ESh4.js", + "houseplan-assets/zigbee-topology-runtime-DUxfg4Z9.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/zigbee-topology-runtime-BFjOXm55.js", - "sha256": "dfd3a3dfc807b9035019ea89187327f20975ad11ff0635f1c9df4ad542d3a6f6", - "rawBytes": 3941, - "gzipBytes": 1762, + "path": "houseplan-assets/live-interaction-runtime-C2JvTP_O.js", + "sha256": "91e8a03ebb3fb35b89c974e2bcf3ee1eff8523f9d9cb1ac93a061c3f751706d1", + "rawBytes": 5196, + "gzipBytes": 2128, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-DcH_msOh.js", - "houseplan-assets/zigbee-topology-x104QxRs.js" + "houseplan-assets/houseplan-card-Csq_DR2Y.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/zigbee-topology-x104QxRs.js", - "sha256": "d52ca29eeb5a62e0a00362844d00c66258fef6c375e090b7173515eb78ccf856", + "path": "houseplan-assets/zigbee-topology-D9L1ESh4.js", + "sha256": "817e5b42008db12cdf922275098eb06a536408dbd01f464859dccee434c2451b", "rawBytes": 12382, - "gzipBytes": 4845, + "gzipBytes": 4847, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-DcH_msOh.js" + "houseplan-assets/houseplan-card-Csq_DR2Y.js" + ], + "dynamicImports": [] + }, + { + "path": "houseplan-assets/zigbee-topology-runtime-DUxfg4Z9.js", + "sha256": "8197d48ba2f6eb615024f0cabca6ff12c10a3442fa19ebcd536bd5d3d5586c34", + "rawBytes": 3941, + "gzipBytes": 1764, + "isEntry": false, + "imports": [ + "houseplan-assets/houseplan-card-Csq_DR2Y.js", + "houseplan-assets/zigbee-topology-D9L1ESh4.js" ], "dynamicImports": [] }, { "path": "houseplan-card.js", - "sha256": "e50d3f3c6e84d612ead3f39c6f39d987697dbea608e85d839a41848268cb73a4", + "sha256": "dbba45693954cf08e2165d88bdcb9e5c295d3782fe5fae9943e079e22135e22c", "rawBytes": 1183, - "gzipBytes": 795, + "gzipBytes": 797, "isEntry": true, "imports": [ - "houseplan-assets/houseplan-card-DcH_msOh.js" + "houseplan-assets/houseplan-card-Csq_DR2Y.js" ], "dynamicImports": [] } diff --git a/custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-CXzP7hUG.js b/custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-CEZBr4qx.js similarity index 59% rename from custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-CXzP7hUG.js rename to custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-CEZBr4qx.js index ca0aea1a..3e82be4e 100644 --- a/custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-CXzP7hUG.js +++ b/custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-CEZBr4qx.js @@ -1,4 +1,4 @@ -globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7b4d74c1518e5fb1a797d7bcbc7e8b7a5eef380513e51e6901c3c9f537123e91";import{dn as e,c as t,A as i,j as o,k as n,dp as r}from"./houseplan-card-DcH_msOh.js";function s(e){const t=e.visualViewport;return t&&Number.isFinite(t.width)&&Number.isFinite(t.height)?{left:Number(t.offsetLeft)||0,top:Number(t.offsetTop)||0,width:Math.max(0,Number(t.width)||0),height:Math.max(0,Number(t.height)||0)}:{left:0,top:0,width:e.innerWidth,height:e.innerHeight}}function a(e,t,i,o=7,n=8){const r=i.left+n,s=i.top+n,a=Math.max(r,i.left+i.width-n),l=Math.max(s,i.top+i.height-n),h=Math.max(0,a-r),c=Math.max(0,l-s),d=Math.min(Math.max(0,t.width),h),u=Math.min(Math.max(0,t.height),c);let p=e.left;p+d>a&&(p=e.right-d),p=Math.min(Math.max(r,p),Math.max(r,a-d));const g=e.bottom+o,_=e.top-o-u;let m="bottom",f=g;return g+u>l&&_>=s?(m="top",f=Math.min(Math.max(s,_),Math.max(s,l-u))):f=Math.min(Math.max(s,g),Math.max(s,l-u)),{left:Math.round(p),top:Math.round(f),side:m,maxWidth:Math.round(h),maxHeight:Math.round(c)}}class l{constructor(e,t,i){this.owner=e,this.name=t,this.keydown=i,this.host=null,this.root=null}window(){return this.owner.ownerDocument.defaultView}dialog(){return this.owner.closest("hp-dialog")}usesPopover(e=!1){const t=this.window();return!e&&!!t&&function(e){const t=e.HTMLElement?.prototype;return"function"==typeof t?.showPopover&&"function"==typeof t?.hidePopover}(t)}get hasFallback(){return!!this.host}containsPath(e){return e.includes(this.owner)||!!this.host&&e.includes(this.host)}ownsActiveElement(){let e=this.owner.ownerDocument.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return!(!e||e!==this.owner&&!this.owner.shadowRoot?.contains(e)&&!this.root?.contains(e))}renderFallback(i,o){const n=this.ensureFallback();return n?(e(t`${i}`,n),n):null}surface(e,t){return t?this.owner.shadowRoot?.querySelector(e)||null:this.root?.querySelector(e)||null}destroy(){this.root&&e(i,this.root),this.host?.remove(),this.host=null,this.root=null}ensureFallback(){if(this.root?.isConnected)return this.root;const e=this.dialog()?.overlayPortal()||this.owner.ownerDocument.body;if(!e)return null;const t=this.owner.ownerDocument.createElement("div");return t.dataset.hpOverlay=this.name,t.style.display="contents",this.keydown&&t.addEventListener("keydown",this.keydown,!0),e.append(t),this.host=t,this.root=t.attachShadow({mode:"open"}),this.root}}let h=0;class c extends n{constructor(){super(...arguments),this.text="",this.ariaLabel="",this.pointerHover=!1,this._open=!1,this._openTimer=0,this._closeTimer=0,this._positionRaf=0,this._forceFallback=!1,this._hoverOwned=!1,this._overlayDispose=null,this._scrollDialog=null,this._descriptionId="hp-help-description-"+ ++h,this._surfacePointerEnter=()=>{const e=this._window();this._closeTimer&&e?.clearTimeout(this._closeTimer),this._closeTimer=0},this._surfacePointerLeave=()=>{this._scheduleClose()},this._outsidePointerDown=e=>{if(!this._open)return;const t=e.composedPath();this._floating.containsPath(t)||this._closeHelp(!1,"outside")},this._dialogScroll=e=>{const t=this._floating.containsPath(e.composedPath()),i=e.target,o=this._dialog(),n=i instanceof Node&&(i===o||i instanceof Element&&i.contains(this));var r;this._open&&(r=n,!t&&r)&&this._closeHelp(!1,"scroll")},this._keyDown=e=>{if(!this._open||e.defaultPrevented)return;if("Escape"===e.key)return e.preventDefault(),e.stopImmediatePropagation(),void this._closeHelp(this._floating.ownsActiveElement(),"escape");const t=this.renderRoot.querySelector(".trigger");if(!t||!e.composedPath().includes(t))return;const i=this._surface();if(!i||i.scrollHeight<=i.clientHeight)return;const o=Math.max(40,.8*i.clientHeight),n={ArrowDown:40,ArrowUp:-40,PageDown:o,PageUp:-o};if("Home"===e.key)i.scrollTop=0;else if("End"===e.key)i.scrollTop=i.scrollHeight;else{if(!(e.key in n))return;i.scrollBy({top:n[e.key],behavior:"auto"})}e.preventDefault(),e.stopImmediatePropagation()},this._floating=new l(this,"help",this._keyDown),this._queuePosition=()=>{if(!this._open||this._positionRaf)return;const e=this._window();e&&(this._positionRaf=e.requestAnimationFrame(()=>{this._positionRaf=0,this._position()||this._closeHelp()}))}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._keyDown,!0)}willUpdate(){this.toggleAttribute("data-has-content",this._hasContent())}disconnectedCallback(){const e=this.ownerDocument.defaultView;this._unsubscribeOpenListeners(),this.removeEventListener("keydown",this._keyDown,!0),this._clearTimers(),this._positionRaf&&e?.cancelAnimationFrame(this._positionRaf),this._positionRaf=0,this._closeHelp(!1,"disconnect"),super.disconnectedCallback()}updated(e){if(e.has("pointerHover")&&!this.pointerHover){const e=this._window();this._openTimer&&e?.clearTimeout(this._openTimer),this._openTimer=0,this._hoverOwned&&this._closeHelp(!1,"outside")}this._hasContent()||!this._open?this._open&&e.has("text")&&(this._usesPopover()||this._renderFallback(),this._queuePosition()):this._closeHelp()}_window(){return this._floating.window()}_dialog(){return this._floating.dialog()}_usesPopover(){return this._floating.usesPopover(this._forceFallback)}_hasContent(){return e=this.text,t=this.ariaLabel,"string"==typeof e&&e.trim().length>0&&"string"==typeof t&&t.trim().length>0;var e,t}_clearTimers(){const e=this._window();this._openTimer&&e?.clearTimeout(this._openTimer),this._closeTimer&&e?.clearTimeout(this._closeTimer),this._openTimer=0,this._closeTimer=0}_scheduleOpen(){const e=this._window();this.pointerHover&&e&&!this._open&&!this._openTimer&&(this._closeTimer&&e.clearTimeout(this._closeTimer),this._closeTimer=0,this._openTimer=e.setTimeout(()=>{this._openTimer=0,this.isConnected&&(this._hoverOwned=!0,this._openHelp())},300))}_scheduleClose(){const e=this._window(),t=this.renderRoot.querySelector(".trigger");e&&!t?.matches(":focus-visible")&&(this._openTimer&&e.clearTimeout(this._openTimer),this._closeTimer&&e.clearTimeout(this._closeTimer),this._openTimer=0,this._closeTimer=e.setTimeout(()=>{this._closeTimer=0,this.isConnected&&this._closeHelp()},150))}_triggerPointerEnter(e){this.pointerHover&&"mouse"===e.pointerType&&this._scheduleOpen()}_triggerPointerLeave(e){"mouse"===e.pointerType&&this._scheduleClose()}_triggerFocus(){queueMicrotask(()=>{const e=this.renderRoot.querySelector(".trigger");e?.matches(":focus-visible")&&(this._hoverOwned=!1,this._openHelp())})}_triggerBlur(){this._scheduleClose()}_triggerClick(){this._open?this._closeHelp():(this._hoverOwned=!1,this._openHelp())}_subscribeOpenListeners(){this.ownerDocument.addEventListener("pointerdown",this._outsidePointerDown,!0),this.ownerDocument.addEventListener("keydown",this._keyDown,!0);const e=this._window();e?.addEventListener("resize",this._queuePosition),e?.addEventListener("orientationchange",this._queuePosition),e?.visualViewport?.addEventListener("resize",this._queuePosition),e?.visualViewport?.addEventListener("scroll",this._queuePosition),this._scrollDialog=this._dialog(),this._scrollDialog?.addEventListener("scroll",this._dialogScroll,!0)}_unsubscribeOpenListeners(){this.ownerDocument.removeEventListener("pointerdown",this._outsidePointerDown,!0),this.ownerDocument.removeEventListener("keydown",this._keyDown,!0);const e=this._window();e?.removeEventListener("resize",this._queuePosition),e?.removeEventListener("orientationchange",this._queuePosition),e?.visualViewport?.removeEventListener("resize",this._queuePosition),e?.visualViewport?.removeEventListener("scroll",this._queuePosition),this._scrollDialog?.removeEventListener("scroll",this._dialogScroll,!0),this._scrollDialog=null}async _openHelp(){!this._open&&this._hasContent()&&(this._clearTimers(),this._forceFallback=!1,this._open=!0,this._subscribeOpenListeners(),await this.updateComplete,this._open&&(this._usesPopover()||this._renderFallback(),this._position()?this._overlayDispose=this._dialog()?.registerOverlay({owner:this,group:"transient",close:e=>this._closeHelp("escape"===e&&this._floating.ownsActiveElement(),e)})||null:this._closeHelp()))}_closeHelp(e=!1,t="exclusive"){if(!this._open&&!this._floating.hasFallback)return;this._clearTimers();const i=this._overlayDispose;this._overlayDispose=null,i?.();const o=this.renderRoot.querySelector(".tooltip");if(o?.hidePopover)try{o.matches(":popover-open")&&o.hidePopover()}catch{}this._open=!1,this._hoverOwned=!1,this._unsubscribeOpenListeners(),this._floating.destroy(),e&&this.updateComplete.then(()=>this.renderRoot.querySelector(".trigger")?.focus())}_tooltipTemplate(e){return t`