"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[38385,49810],{338385(e,t,n){n.r(t),n.d(t,{default:()=>o});var i=n(296540),a=n(469733),s=n(6510),l=n(126457),r=n(649810);const o=({onConfirm:e,device:t,...n})=>{const o=(0,a.useDispatch)();return i.createElement(r.default,{onConfirm:()=>{e(),o((0,l.AS)())},title:t.disabled?"DEVICE_ACTIONS_ENABLE_CONFIRM_TITLE":"DEVICE_ACTIONS_DISABLE_CONFIRM_TITLE",titleValues:{deviceName:(0,s.Q)(t)},message:t.disabled?"DEVICE_ACTIONS_ENABLE_CONFIRM_MESSAGE":"DEVICE_ACTIONS_DISABLE_CONFIRM_MESSAGE",messageValues:{deviceName:(0,s.Q)(t)},...n})}},649810(e,t,n){n.r(t),n.d(t,{default:()=>m});var i=n(296540),a=n(217439),s=n(71479),l=n(469733),r=n(372737),o=n(126457),E=n(916537),c=n(705426);const u=(0,s.A)("div")`
  line-height: 1.5;
  word-break: break-word;
`,d=(0,s.A)(a.A)`
  color: ${({theme:{motifPalette:{text01:e}}})=>e} !important;
  padding-right: ${({theme:{spacing:e}})=>e["spacing-xl"]};
`,m=({message:e,title:t,onConfirm:n,children:s=null,messageValues:m={},size:C="small",titleValues:A={},onCancel:N=null,confirmButtonProps:_={},confirmButtonText:I,...f})=>{const k=(0,l.useDispatch)(),p=(0,i.useCallback)(()=>{N?N():k((0,o.AS)())},[N,k]);return(0,i.useEffect)(()=>{function e(e){e.stopPropagation(),e.key===r.U.ENTER?n():e.key===r.U.ESCAPE&&p()}return window.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0)}},[p,n]),i.createElement(c.A,{actions:[{text:i.createElement(E.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",onClick:p},{text:i.createElement(E.sA,{id:I??"COMMON_ACTION_CONFIRM"}),type:"button",variant:"primary",onClick:()=>n(),..._}],size:C,title:i.createElement(d,{size:"large",isTruncated:!0},i.createElement(E.sA,{id:t,values:A})),...f},i.createElement(u,null,i.createElement(a.A,{size:"medium"},i.createElement(E.sA,{id:e,values:m}))),s)}}}]);