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