"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[31680,89965],{104154:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(469733),a=n(296540),i=n(691294),l=n(239417);const o=({client:{id:e,type:t,status:n,blocked:o},props:c,children:d})=>{const s=(0,a.useMemo)(()=>t===i.sK.VPN?i.N7.VPN:t===i.sK.TELEPORT?i.N7.TELEPORT:o?i.N7.BLOCKED:n===i.S2.OFFLINE?i.N7.OFFLINE:i.N7.ACTIVE,[t,o,n]);return d((0,r.useSelector)((0,a.useMemo)(()=>(0,l.kV)(e,c,s),[e,c,s])))}},331680:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var r,a=n(296540),i=n(777916),l=n(217439),o=n(566723),c=n(424095),d=n(294303),s=n(395812),m=n(699784),u=n(104154),p=n(691294),E=n(360113),h=n(469733),A=n(927099),g=n(758649),x=n(984652),b=n(842630),f=n(689965);!function(e){e.REVOKE="revoke",e.UNAUTHORIZE="unauthorize"}(r||(r={}));const k=(0,a.memo)(({id:e,status:t})=>{const n=(0,h.useDispatch)(),[i,l]=(0,a.useReducer)((e,t)=>({...e,[t.type]:t.disabled}),{[r.REVOKE]:!1,[r.UNAUTHORIZE]:!1}),o=(0,a.useCallback)(()=>{l({type:r.REVOKE,disabled:!0}),n((0,x.$L)(e,t===p.S2.ONLINE)).finally(()=>l({type:r.REVOKE,disabled:!1}))},[n,e,t]),c=(0,a.useCallback)(()=>{l({type:r.UNAUTHORIZE,disabled:!0}),n((0,x.j1)(e)).finally(()=>l({type:r.UNAUTHORIZE,disabled:!1}))},[n,e]);return a.createElement(f.A,{type:f.I.BUTTON_LIST},a.createElement(b.A,null,a.createElement(d.A,null,a.createElement(g.A,{type:"button",disabled:i[r.REVOKE],color:"danger",variant:"inline",size:"medium",onClick:o},a.createElement(A.A,{size:"body",color:"inherit"},a.createElement(m.sA,{id:"COMMON_ACTION_REVOKE_ACCESS"})))),t===p.S2.ONLINE?a.createElement(d.A,null,a.createElement(g.A,{type:"button",disabled:i[r.UNAUTHORIZE],variant:"inline",size:"medium",onClick:c},a.createElement(A.A,{size:"body",color:"inherit"},a.createElement(m.sA,{id:"COMMON_ACTION_UNAUTHORIZE"})))):null))});var O=n(643757);const y=({activeItem:e})=>a.createElement(a.Fragment,null,a.createElement(f.A,{marginBottom:o.Ln},a.createElement(d.A,{flexDirection:"row",alignItems:"stretch",justifyContent:"flex-start",gap:o.kc},a.createElement(d.A,{width:50,minWidth:50,height:50},a.createElement(s.A,{type:"teleport"})),a.createElement(d.A,{width:"100%",justifyContent:"center",flexDirection:"column",alignItems:"stretch",overflow:"hidden",flex:"1"},a.createElement(O.A,{title:e.display_name}),a.createElement(l.A,{color:"text-3"},a.createElement(m.sA,{id:"COMMON_TELEPORT"}))))),a.createElement(f.A,null,e.ip?a.createElement(E.A,null,a.createElement(l.A,{color:"text-2"},a.createElement(m.sA,{id:"COMMON_IP_ADDRESS"})),a.createElement(l.A,{color:"text-3"},e.ip)):null,e.status===p.S2.ONLINE&&e.assoc_time?a.createElement(E.A,null,a.createElement(l.A,{color:"text-2"},a.createElement(m.sA,{id:"COMMON_UPTIME"})),a.createElement(l.A,{color:"text-3"},a.createElement(c.A,{startTimestamp:e.assoc_time}))):null,a.createElement(u.A,{client:e,props:["tx_packets","tx_bytes"]},({tx_packets:e=0,tx_bytes:t=0})=>e&&t?a.createElement(E.A,null,a.createElement(l.A,{color:"text-2"},a.createElement(m.sA,{id:"COMMON_ACTIVITY_DOWN_PKTS_BYTES"})),a.createElement(l.A,{color:"text-3"},e?.toLocaleString()," / ",a.createElement(i.A,{type:"bytes",size:"body",input:t,color:"tertiary"}))):null),a.createElement(u.A,{client:e,props:["rx_packets","rx_bytes"]},({rx_packets:e=0,rx_bytes:t=0})=>e&&t?a.createElement(E.A,null,a.createElement(l.A,{color:"text-2"},a.createElement(m.sA,{id:"COMMON_ACTIVITY_UP_PKTS_BYTES"})),a.createElement(l.A,{color:"text-3"},e?.toLocaleString()," / ",a.createElement(i.A,{type:"bytes",size:"body",input:t,color:"tertiary"}))):null)),a.createElement(k,{id:e.id,status:e.status}))},360113:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(296540),a=n(71479),i=n(566723),l=n(294303);const o=(0,a.A)(l.A,{shouldForwardProp:e=>!["valueMaxWidth","keyMinWidth","compact"].includes(e)})`
  &:not(:last-child) {
    ${({compact:e})=>e?"":`margin-bottom: ${i.kc};`}
  }
  & > {
    &:nth-child(1) {
      min-width: ${({keyMinWidth:e})=>e}px;
    }
    &:nth-child(2) {
      max-width: ${({valueMaxWidth:e})=>e}px;
    }
  }
`,c=({children:e,valueMaxWidth:t=215,keyMinWidth:n=0,flexProps:a={},compact:l=!1})=>r.createElement(o,{width:"100%",justifyContent:"space-between",gap:i.kc,height:l?void 0:24,valueMaxWidth:t,keyMinWidth:n,compact:l,...a},e)},424095:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(296540),a=n(90757),i=n(573531);const l=({startTimestamp:e,uptimeParams:t})=>{const n=(0,r.useRef)(null),l=(0,r.useRef)(null),o=(0,r.useCallback)(t=>{n.current&&(n.current.innerText=e?(0,a.Ay)(Math.floor(Date.now()/1e3)-e,t).join(" "):i.L,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{o(t)},1e3))},[e]);return(0,r.useEffect)(()=>(e&&o(t),()=>{l.current&&clearTimeout(l.current)}),[e,t,o]),r.createElement("span",{ref:n})}},643757:(e,t,n)=>{n.d(t,{A:()=>E});var r=n(296540),a=n(271856),i=n(705145),l=n(71479);const o=e=>{const[t,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{e.current&&n(e.current.clientWidth<e.current.scrollWidth)},[e]),t};var c=n(311785),d=n(566723),s=n(294303),m=n(955161);const u=e=>t=>r.createElement(a.A,{description:e,noWrap:!0,portal:!0},t),p=(0,l.A)(i.A,(0,c.A)("maxWidth"))`
  max-width: ${({maxWidth:e})=>e}px;
`,E=(0,r.memo)(({title:e,icon:t,maxWidth:n,disabled:a=!1})=>{const i=(0,r.useRef)(null),l=o(i);return r.createElement(m.A,{condition:l,wrapper:u(e)},r.createElement(s.A,{gap:d.YC,alignItems:"center"},t,r.createElement(p,{isTruncated:!0,size:"medium",weight:"bold",color:a?"text-3":"text-1",maxWidth:n,ref:i},e)))})},689965:(e,t,n)=>{n.d(t,{A:()=>p,I:()=>r});var r,a=n(296540),i=n(822336),l=n(427853),o=n(71479),c=n(825032),d=n(566723),s=n(294303);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));const m=(0,o.A)(s.A,{shouldForwardProp:e=>!["marginBottom","isButtonList","margin","flex","width","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>i.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,o.A)(l.A,{shouldForwardProp:e=>!["marginBottom","margin","flex","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||i.Ay[t===c.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0 ${d.Ln} ${d.Ln};
      > div {
        padding: 0;
      }
    }
  }
`,p=({type:e,marginBottom:t,margin:n,padding:i,flex:l,width:o,nested:c,...d})=>"items"in d?a.createElement(u,{marginBottom:t,margin:n,padding:i,flex:l,nested:c,...d}):a.createElement(m,{nested:c,width:o,marginBottom:t,margin:n,padding:i,flex:l,isButtonList:e===r.BUTTON_LIST,...d},d.children)},842630:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(469733),a=n(296540),i=n(602021);const l=({children:e=null})=>(0,r.useSelector)(i.EL)?null:a.createElement(a.Fragment,null,e)}}]);