"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[39833],{30144:function(o,a,i){i.a(o,async function(o,t){try{i.r(a);var e,n,l,s,c=i(36854),h=i(98117),r=i(28430),u=i(57567),d=i(25979),g=i(12463),p=i(16472),_=(i(28706),i(26099),i(3362),i(15697)),k=i(57527),f=i(51209),m=i(148),b=(i(90507),i(13288)),y=i(76730),v=i(78343),A=i(98747),w=i(73651),z=i(23962),C=o([A,w,z]);[A,w,z]=C.then?(await C)():C;var H=function(o){function a(){var o;(0,u.A)(this,a);for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return(o=(0,p.A)(this,a,[].concat(t)))._open=!1,o}return(0,g.A)(a,o),(0,d.A)(a,[{key:"showDialog",value:function(o){this._params=o,this._open=!0}},{key:"closeDialog",value:function(){this._open=!1}},{key:"_dialogClosed",value:function(){this._open=!1,this._params=void 0,(0,m.r)(this,"dialog-closed",{dialog:this.localName})}},{key:"render",value:function(){if(!this._params)return k.s6;var o=this._params,a=o.webhook,i=o.cloudhook,t="automation"===a.domain?(0,v.o)(this.hass,"/docs/automation/trigger/#webhook-trigger"):(0,v.o)(this.hass,"/integrations/".concat(a.domain,"/"));return(0,k.qy)(e||(e=(0,r.A)([" <ha-dialog .open="," header-title="," @closed=","> <div> <p> "," </p> <ha-input-copy readonly=readonly .value="," .label=",'></ha-input-copy> </div> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" href=',' target="_blank" rel="noreferrer" appearance="plain"> ',' <ha-svg-icon slot="end" .path=','></ha-svg-icon> </ha-button> <ha-button slot="primaryAction" @click=',"> "," </ha-button> </ha-dialog-footer> </ha-dialog> "])),this._open,this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.webhook_for",{name:a.name}),this._dialogClosed,i.managed?(0,k.qy)(n||(n=(0,r.A)([" "," "])),this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.managed_by_integration")):(0,k.qy)(l||(l=(0,r.A)([" ",' <button class="link" @click=',"> ","</button>. "])),this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.info_disable_webhook"),this._disableWebhook,this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.link_disable_webhook")),i.cloudhook_url,this.hass.localize("ui.panel.config.common.copy_link"),t,this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.view_documentation"),"M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",this.closeDialog,this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.close"))}},{key:"_disableWebhook",value:(i=(0,h.A)((0,c.A)().m(function o(){return(0,c.A)().w(function(o){for(;;)switch(o.n){case 0:return o.n=1,(0,b.dk)(this,{title:this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.confirm_disable_title"),text:this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.confirm_disable_text",{name:this._params.webhook.name}),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.disable"),destructive:!0});case 1:o.v&&(this._params.disableHook(),this.closeDialog());case 2:return o.a(2)}},o,this)})),function(){return i.apply(this,arguments)})}],[{key:"styles",get:function(){return[y.RF,y.nA,(0,k.AH)(s||(s=(0,r.A)(["button.link{color:var(--primary-color);text-decoration:none}p{margin-top:0;margin-bottom:16px}"])))]}}]);var i}(k.WF);(0,_.Cg)([(0,f.wk)()],H.prototype,"_params",void 0),(0,_.Cg)([(0,f.wk)()],H.prototype,"_open",void 0),H=(0,_.Cg)([(0,f.EM)("dialog-manage-cloudhook")],H),i.d(a,{DialogManageCloudhook:function(){return H}}),t()}catch(V){t(V)}})}}]);
//# sourceMappingURL=39833.2b529b434f3c7406.js.map