"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[8742],{665826:(e,t,s)=>{s.r(t),s.d(t,{default:()=>y});var a=s(296540),o=s(469733),n=s(198494),r=s(638310),l=s(592510),c=s(187483),i=s(927099),u=s(459449),O=s(775699),E=s(415246),C=s(71479),A=s(617147);const _=(0,C.A)(A.A)`
  width: 450px;
`,p=({setOpenOtherLaunchOptionModal:e,setDisplayUnsupportedInterfaceModal:t,onRequestClose:s})=>{const n=(0,o.useDispatch)(),r=(0,a.useCallback)(()=>{t(!1)},[t]),l=(0,a.useCallback)(()=>{n((0,O.i4)({[E.Lv.ENABLE_NEW_UI]:!0})).then(r)},[n,r]),c=(0,a.useCallback)(()=>{e(!0)},[e]),C=(0,a.useMemo)(()=>[{type:"button",variant:"tertiary",text:a.createElement(u.sA,{id:"COMMON_SWITCH_TO_NEW_INTERFACE"}),onClick:l},{type:"button",variant:"primary",text:a.createElement(u.sA,{id:"COMMON_SEE_OTHER_LAUNCH_OPTIONS"}),onClick:c}],[l,c]);return a.createElement(_,{isOpen:!0,actions:C,size:"auto",onRequestClose:s,title:a.createElement(i.A,{size:"body",weight:"bold",color:"primary"},a.createElement(u.sA,{id:"COMMON_LEGACY_INTERFACE_NOT_SUPPORTED_TITLE"}))},a.createElement(i.A,{size:"body",color:"secondary"},a.createElement(u.sA,{id:"COMMON_LEGACY_INTERFACE_NOT_SUPPORTED_DESCRIPTION",values:{b:u.b}})))};var d=s(349107),m=s(765562),N=s(768643),T=s(602021),h=s(778851),M=s(627440),S=s(784998),I=s(727270);const b=({setOpenOtherLaunchOptionModal:e,onRequestClose:t})=>{const{formatMessage:s}=(0,u.tz)(),n=(0,o.useSelector)(T.LF),r=(0,o.useSelector)(c.W1),l=(0,o.useSelector)(c.TP),O=(0,o.useSelector)(c.YL),E=(0,o.useSelector)(S.F_),C=(0,o.useSelector)(S.K2),A=(0,o.useSelector)(S.aH),p=(0,a.useCallback)(()=>{e(!1)},[e]),b=(0,a.useMemo)(()=>[{type:"button",variant:"tertiary",text:a.createElement(u.sA,{id:"COMMON_ACTION_CANCEL"}),onClick:p}],[p]);return a.createElement(_,{isOpen:!0,actions:b,size:"auto",onRequestClose:t,title:a.createElement(i.A,{size:"body",weight:"bold",color:"primary"},a.createElement(u.sA,{id:"COMMON_OTHER_LAUNCH_OPTIONS_TITLE"}))},a.createElement(i.A,{size:"body",color:"secondary",whiteSpacePreWrap:!0},a.createElement(u.sA,{id:"COMMON_OTHER_LAUNCH_OPTIONS_DESCRIPTION",values:{networkUnifi:a.createElement(d.A,{href:`${m.A.networkUnifiUi}/${A}.0/unifi/site/${n||N.I}/${M.VO.DASHBOARD}/?d=${(0,h.ns)(r,O,l)}`,customText:new URL(m.A.networkUnifiUi).hostname}),haveIps:Boolean(E.length),ips:E.reduce((e,t,o)=>0===o?[a.createElement(d.A,{href:`${I.DU}${t}:${C}`,customText:t})]:[...e,o<E.length-1?", ":` ${s({id:"COMMON_OR"}).toLowerCase()} `,a.createElement(d.A,{href:`${I.DU}${t}:${C}`,customText:t})],[])}})))},y=(0,a.memo)(()=>{const e=(0,o.useDispatch)(),t=(0,o.useSelector)(c.W1),s=(0,o.useSelector)(n.Ou),[i,u]=(0,a.useState)(t&&!s),[O,E]=(0,a.useState)(!1),C=O?b:p,A=(0,a.useCallback)(()=>{u(!1)},[]);return(0,a.useEffect)(()=>{i&&e((0,r.E)(void 0,{crudCacheStrategy:{type:l.e.CACHE}}))},[i,e]),i?a.createElement(C,{setOpenOtherLaunchOptionModal:E,setDisplayUnsupportedInterfaceModal:u,onRequestClose:A}):null})}}]);