"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[80836],{177445(e,t,i){i.d(t,{A:()=>o});var n=i(602086),r=i(977872),s=i(223597),d=i(34118);const o=({client:{id:e,type:t,status:i,blocked:o},props:l,children:a})=>{const c=(0,n.useMemo)(()=>t===s.sK.VPN?s.N7.VPN:t===s.sK.TELEPORT?s.N7.TELEPORT:o?s.N7.BLOCKED:i===s.S2.OFFLINE?s.N7.OFFLINE:s.N7.ACTIVE,[t,o,i]),h=(0,r.d4)((0,n.useMemo)(()=>(0,d.kV)(e,l,c),[e,l,c]));return a((0,n.useMemo)(()=>h,[h]))}},347500(e,t,i){i.d(t,{A:()=>o});var n=i(274934),r=i(602086),s=i(898809),d=i(254590);const o=({startTimestamp:e,uptimeParams:t})=>{const i=(0,r.useRef)(null),o=(0,r.useRef)(null),l=(0,r.useCallback)(t=>{i.current&&(i.current.innerText=e?(0,s.Ay)(Math.floor(Date.now()/1e3)-e,t).join(" "):d.L,o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{l(t)},1e3))},[e]);return(0,r.useEffect)(()=>(e&&l(t),()=>{o.current&&clearTimeout(o.current)}),[e,t,l]),(0,n.jsx)("span",{ref:i})}},535322(e,t,i){i.d(t,{A:()=>u,I:()=>n});var n,r=i(274934),s=i(814557),d=i(158885),o=i(247816),l=i(565527),a=i(309130),c=i(100978),h=i(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(n||(n={}));const m=(0,o.A)(c.A,(0,h.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:i}})=>e||s.Ay[i===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${a.Ln}`:a.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||a.Ln};
  ${({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}})=>s.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,x=(0,o.A)(d.A,(0,h.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:i}})=>e||s.Ay[i===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.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||s.Ay[t===l.S.DARK?`desktop-color-neutral-01-${l.S.DARK}`:`desktop-color-neutral-00-${l.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${a.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${a.Ln} ${a.Ln};
      }
    }
  }
`,u=({type:e,marginBottom:t,margin:i,padding:s,flex:d,width:o,nested:l,...a})=>"items"in a?(0,r.jsx)(x,{marginBottom:t,margin:i,padding:s,flex:d,nested:l,...a}):(0,r.jsx)(m,{nested:l,width:o,marginBottom:t,margin:i,padding:s,flex:d,isButtonList:e===n.BUTTON_LIST,...a,children:a.children})},449954(e,t,i){i.d(t,{A:()=>a});var n=i(274934),r=i(602086),s=i(95032),d=i(669439);var o=i(309130),l=i(100978);const a=(0,r.memo)(({title:e,icon:t,maxWidth:i,disabled:a=!1})=>{const c=(0,r.useRef)(null),h=(e=>{const[t,i]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{e.current&&i(e.current.clientWidth<e.current.scrollWidth)},[e]),t})(c);return(0,n.jsx)(d.A,{description:h?e:void 0,children:(0,n.jsxs)(l.A,{gap:o.YC,alignItems:"center",maxWidth:i,children:[t,(0,n.jsx)(s.A,{isTruncated:!0,size:"medium",weight:"bold",color:a?"text-3":"text-1",ref:c,children:e})]})})})},910100(e,t,i){i.d(t,{p:()=>o});var n=i(814557),r=i(247816),s=i(100978),d=i(291508);const o=(0,r.A)(s.A,(0,d.A)("disabled"))`
  height: 48px;
  border-bottom: ${({theme:{themeName:e}})=>n.Ay[`desktop-border-divider-${e}`]};
  ${({disabled:e=!1})=>e&&"\n      opacity: 0.4;\n      pointer-events: none;\n  "}
`},664092(e,t,i){i.d(t,{A:()=>a});var n=i(274934),r=i(247816),s=i(309130),d=i(100978),o=i(291508);const l=(0,r.A)(d.A,(0,o.A)("valueMaxWidth","keyMinWidth","compact"))`
  &:not(:last-child) {
    ${({compact:e})=>e?"":`margin-bottom: ${s.kc};`}
  }
  & > {
    &:nth-child(1) {
      min-width: ${({keyMinWidth:e})=>e}px;
    }
    &:nth-child(2) {
      max-width: ${({valueMaxWidth:e})=>e}px;
    }
  }
`,a=({children:e,valueMaxWidth:t=215,keyMinWidth:i=0,flexProps:r={},compact:d=!1})=>(0,n.jsx)(l,{width:"100%",justifyContent:"space-between",gap:s.kc,height:d?void 0:24,valueMaxWidth:t,keyMinWidth:i,compact:d,...r,children:e})},480836(e,t,i){i.r(t),i.d(t,{default:()=>k});var n,r=i(274934),s=i(878151),d=i(938984),o=i(309130),l=i(347500),a=i(100978),c=i(996121),h=i(470070),m=i(177445),x=i(223597),u=i(664092),A=i(977872),p=i(602086),g=i(599110),b=i(239627),j=i(378767),f=i(535322),O=i(910100);!function(e){e.REVOKE="revoke",e.UNAUTHORIZE="unauthorize"}(n||(n={}));const T=(0,p.memo)(({id:e,status:t})=>{const i=(0,A.wA)(),[{[n.REVOKE]:s,[n.UNAUTHORIZE]:o},l]=(0,p.useReducer)((e,t)=>({...e,[t.type]:t.disabled}),{[n.REVOKE]:!1,[n.UNAUTHORIZE]:!1}),a=(0,p.useCallback)(()=>{l({type:n.REVOKE,disabled:!0}),i((0,b.$L)(e,t===x.S2.ONLINE)).finally(()=>l({type:n.REVOKE,disabled:!1}))},[i,e,t]),c=(0,p.useCallback)(()=>{l({type:n.UNAUTHORIZE,disabled:!0}),i((0,b.j1)(e)).finally(()=>l({type:n.UNAUTHORIZE,disabled:!1}))},[i,e]);return(0,r.jsx)(f.A,{type:f.I.BUTTON_LIST,children:(0,r.jsxs)(j.A,{children:[(0,r.jsx)(O.p,{disabled:s,children:(0,r.jsx)(g.A,{type:"button",disabled:s,color:"danger",variant:"inline",size:"medium",onClick:a,children:(0,r.jsx)(d.A,{size:"medium",color:"inherit",children:(0,r.jsx)(h.sA,{id:"COMMON_ACTION_REVOKE_ACCESS"})})})}),t===x.S2.ONLINE?(0,r.jsx)(O.p,{disabled:o,children:(0,r.jsx)(g.A,{type:"button",disabled:o,variant:"inline",size:"medium",onClick:c,children:(0,r.jsx)(d.A,{size:"medium",color:"inherit",children:(0,r.jsx)(h.sA,{id:"COMMON_ACTION_UNAUTHORIZE"})})})}):null]})})});var N=i(449954);const k=({activeItem:e})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.A,{marginBottom:o.Ln,children:(0,r.jsxs)(a.A,{flexDirection:"row",alignItems:"stretch",justifyContent:"flex-start",gap:o.kc,children:[(0,r.jsx)(a.A,{width:50,minWidth:50,height:50,children:(0,r.jsx)(c.A,{type:"teleport"})}),(0,r.jsxs)(a.A,{width:"100%",justifyContent:"center",flexDirection:"column",alignItems:"stretch",overflow:"hidden",flex:"1",children:[(0,r.jsx)(N.A,{title:e.display_name}),(0,r.jsx)(d.A,{color:"text-3",children:(0,r.jsx)(h.sA,{id:"COMMON_TELEPORT"})})]})]})}),(0,r.jsxs)(f.A,{children:[e.ip?(0,r.jsxs)(u.A,{children:[(0,r.jsx)(d.A,{color:"text-2",children:(0,r.jsx)(h.sA,{id:"COMMON_IP_ADDRESS"})}),(0,r.jsx)(d.A,{color:"text-3",children:e.ip})]}):null,e.status===x.S2.ONLINE&&e.assoc_time?(0,r.jsxs)(u.A,{children:[(0,r.jsx)(d.A,{color:"text-2",children:(0,r.jsx)(h.sA,{id:"COMMON_UPTIME"})}),(0,r.jsx)(d.A,{color:"text-3",children:(0,r.jsx)(l.A,{startTimestamp:e.assoc_time})})]}):null,(0,r.jsx)(m.A,{client:e,props:["tx_packets","tx_bytes"],children:({tx_packets:e=0,tx_bytes:t=0})=>e&&t?(0,r.jsxs)(u.A,{children:[(0,r.jsx)(d.A,{color:"text-2",children:(0,r.jsx)(h.sA,{id:"COMMON_ACTIVITY_DOWN_PKTS_BYTES"})}),(0,r.jsxs)(d.A,{color:"text-3",children:[e?.toLocaleString()," / ",(0,r.jsx)(s.A,{type:"bytes",size:"body",input:t,color:"tertiary"})]})]}):null}),(0,r.jsx)(m.A,{client:e,props:["rx_packets","rx_bytes"],children:({rx_packets:e=0,rx_bytes:t=0})=>e&&t?(0,r.jsxs)(u.A,{children:[(0,r.jsx)(d.A,{color:"text-2",children:(0,r.jsx)(h.sA,{id:"COMMON_ACTIVITY_UP_PKTS_BYTES"})}),(0,r.jsxs)(d.A,{color:"text-3",children:[e?.toLocaleString()," / ",(0,r.jsx)(s.A,{type:"bytes",size:"body",input:t,color:"tertiary"})]})]}):null})]}),(0,r.jsx)(T,{id:e.id,status:e.status})]})},378767(e,t,i){i.d(t,{A:()=>d});var n=i(274934),r=i(977872),s=i(897166);const d=({children:e=null})=>(0,r.d4)(s.EL)?null:(0,n.jsx)(n.Fragment,{children:e})}}]);