"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[90049],{323572:(e,t,E)=>{E.d(t,{TG:()=>A,Ve:()=>T,Yl:()=>u,x_:()=>d,zK:()=>S,us:()=>m,jk:()=>r,p5:()=>o,RZ:()=>c,rA:()=>l,gM:()=>O,NA:()=>I,_F:()=>N});var s=E(691189),a=E(736318),i=E(294201),n=E(87485);const _="/api/s/{site}/cmd/sitemgr",c=(e={},t={})=>(0,s.t9)("autoIpsec","/v2/api/vpn/auto/sites",e,{idField:"id",...t}),T=e=>(0,s.Xj)(i.A.ADD_SITE_VPN,_,e),I=e=>(0,s.Xj)(i.A.REBUILD_SITE_VPN,_,e),A=e=>(0,s.Xj)(i.A.ADD_SITE,_,{desc:e}),l=e=>(0,s.Xj)(i.A.IMPORT_SITE,a.g1,{site_desc:e.newSiteName,backup_id:e.importedSiteId}),o=()=>(0,s.Xj)(i.A.EXPORT_SITE,a.g1),d=e=>(0,s.Xj)(i.A.DELETE_SITE,_,{site:e}),S=(e,t={})=>(0,s.Xj)(i.A.DELETE_SITE_VPN,_,{site:e.remote_site_id,name:e.name},t),r=(e,t={})=>(0,s.Xj)(i.A.ENABLE_SITE_VPN,_,{site:e.site,name:e.name},t),m=(e,t={})=>(0,s.Xj)(i.A.DISABLE_SITE_VPN,_,{site:e.site,name:e.name},t),N=e=>(0,s.Xj)(i.A.UPDATE_SITE,_,{desc:e}),u=(e,t={})=>(0,s.Xj)(i.A.DELETE_DEVICE,_,{macs:[].concat(e)},{...(0,n.rk)("COMMON_COMMAND_DELETE_DEVICE_TOAST_ERROR",{count:[].concat(e).length}),...t}),O=(e,t,E={})=>(0,s.Xj)(i.A.MOVE_DEVICE,_,{mac:e,site:t},E)},790049:(e,t,E)=>{E.r(t),E.d(t,{default:()=>o});var s=E(469733),a=E(296540),i=E(927099),n=E(742920),_=E(675359),c=E(126457),T=E(699784),I=E(323572),A=E(602021),l=E(705426);const o=()=>{const e=(0,s.useDispatch)(),[t,E]=(0,a.useState)(!1),{_id:o,name:d,desc:S}=(0,s.useSelector)(A.Gd),r=(0,s.useSelector)(A.VO),m=(0,a.useCallback)(()=>e((0,c.AS)()),[e]),N=(0,a.useCallback)(()=>{E(!0),e((0,I.x_)(o)).then(()=>{m(),window.location.href=`${window.location.href.substring(0,window.location.href.indexOf(d))}${r.name}/dashboard`}).catch(()=>{e((0,_.ox)({type:n.C.danger,message:"SETTINGS_SITE_CONFIGURATION_DELETE_SITE_ERROR",values:{siteName:S}}))})},[o,S,m,e,d,r.name]),u=(0,a.useMemo)(()=>[{type:"button",text:a.createElement(T.sA,{id:"COMMON_ACTION_CANCEL"}),onClick:m,disabled:t},{type:"button",text:a.createElement(T.sA,{id:"COMMON_ACTION_CONFIRM"}),onClick:N,disabled:t,variant:"primary"}],[m,t,N]);return a.createElement(l.A,{title:a.createElement(T.sA,{id:"SETTINGS_SITE_CONFIGURATION_DELETE_SITE"}),onRequestClose:m,size:"small",actions:u},a.createElement(i.A,{size:"body"},a.createElement(T.sA,{id:"SETTINGS_SITE_CONFIGURATION_DELETE_SITE_MESSAGE",values:{siteName:a.createElement("b",null,S)}})))}}}]);