"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[8241],{54408:function(e,o,n){n(23792),n(26099),n(31415),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(47764),n(62953);var a=n(148),s=n(27802),i=n(56245),t=n(46602),r=new Set,d=function(e){window.addEventListener("haptic",function(o){return e.hass.auth.external.fireMessage({type:"haptic",payload:{hapticType:o.detail}})}),e.hass.auth.external.addCommandHandler(function(o){return l(e,o)})},c=function(e){return r.add(e),function(){r.delete(e)}},l=function(e,o){var n=e.hass.auth.external;if("restart"===o.command)e.hass.connection.reconnect(!0);else if("navigate"===o.command)(0,i.oo)(o.payload.path,o.payload.options);else if("notifications/show"===o.command)(0,a.r)(e,"hass-show-notifications");else if("sidebar/toggle"===o.command){var d;if(null!==(d=s.G.history.state)&&void 0!==d&&d.open)return n.fireMessage({id:o.id,type:"result",success:!1,error:{code:"not_allowed",message:"dialog open"}}),!0;(0,a.r)(e,"hass-toggle-menu")}else if("sidebar/show"===o.command){var c;if(null!==(c=s.G.history.state)&&void 0!==c&&c.open)return n.fireMessage({id:o.id,type:"result",success:!1,error:{code:"not_allowed",message:"dialog open"}}),!0;(0,a.r)(e,"hass-toggle-menu",{open:!0})}else if("automation/editor/show"===o.command){var l;(0,t.mX)(null===(l=o.payload)||void 0===l?void 0:l.config)}else if("improv/discovered_device"===o.command)(0,a.r)(window,"improv-discovered-device",o.payload);else if("improv/device_setup_done"===o.command)(0,a.r)(window,"improv-device-setup-done");else if("matter/commission/finish"===o.command)(0,a.r)(window,"matter-commission-finish",o.payload);else if("bar_code/scan_result"===o.command)r.forEach(function(e){return e(o)});else if("bar_code/aborted"===o.command)r.forEach(function(e){return e(o)});else{if("kiosk_mode/set"!==o.command)return!1;(0,a.r)(window,"hass-kiosk-mode",{enable:o.payload.enable})}return n.fireMessage({id:o.id,type:"result",success:!0,result:null}),!0};n.d(o,{attachExternalToApp:function(){return d},v:function(){return c}})}}]);
//# sourceMappingURL=8241.74bff5300c78c728.js.map