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