"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[29680],{104154(e,t,n){n.d(t,{A:()=>o});var r=n(296540),i=n(469733),l=n(691294),a=n(239417);const o=({client:{id:e,type:t,status:n,blocked:o},props:c,children:d})=>{const s=(0,r.useMemo)(()=>t===l.sK.VPN?l.N7.VPN:t===l.sK.TELEPORT?l.N7.TELEPORT:o?l.N7.BLOCKED:n===l.S2.OFFLINE?l.N7.OFFLINE:l.N7.ACTIVE,[t,o,n]);return d((0,i.useSelector)((0,r.useMemo)(()=>(0,a.kV)(e,c,s),[e,c,s])))}},424095(e,t,n){n.d(t,{A:()=>a});var r=n(296540),i=n(90757),l=n(573531);const a=({startTimestamp:e,uptimeParams:t})=>{const n=(0,r.useRef)(null),a=(0,r.useRef)(null),o=(0,r.useCallback)(t=>{n.current&&(n.current.innerText=e?(0,i.Ay)(Math.floor(Date.now()/1e3)-e,t).join(" "):l.L,a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{o(t)},1e3))},[e]);return(0,r.useEffect)(()=>(e&&o(t),()=>{a.current&&clearTimeout(a.current)}),[e,t,o]),r.createElement("span",{ref:n})}},689965(e,t,n){n.d(t,{A:()=>E,I:()=>r});var r,i=n(296540),l=n(822336),a=n(963724),o=n(71479),c=n(825032),d=n(566723),s=n(294303),m=n(311785);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));const u=(0,o.A)(s.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||l.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}})=>l.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,A=(0,o.A)(a.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||l.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||l.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;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,E=({type:e,marginBottom:t,margin:n,padding:l,flex:a,width:o,nested:c,...d})=>"items"in d?i.createElement(A,{marginBottom:t,margin:n,padding:l,flex:a,nested:c,...d}):i.createElement(u,{nested:c,width:o,marginBottom:t,margin:n,padding:l,flex:a,isButtonList:e===r.BUTTON_LIST,...d},d.children)},643757(e,t,n){n.d(t,{A:()=>c});var r=n(296540),i=n(705145),l=n(180524);var a=n(566723),o=n(294303);const c=(0,r.memo)(({title:e,icon:t,maxWidth:n,disabled:c=!1})=>{const d=(0,r.useRef)(null),s=(e=>{const[t,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{e.current&&n(e.current.clientWidth<e.current.scrollWidth)},[e]),t})(d);return r.createElement(l.A,{description:s?e:void 0},r.createElement(o.A,{gap:a.YC,alignItems:"center",maxWidth:n},t,r.createElement(i.A,{isTruncated:!0,size:"medium",weight:"bold",color:c?"text-3":"text-1",ref:d},e)))})},360113(e,t,n){n.d(t,{A:()=>d});var r=n(296540),i=n(71479),l=n(566723),a=n(294303),o=n(311785);const c=(0,i.A)(a.A,(0,o.A)("valueMaxWidth","keyMinWidth","compact"))`
  &:not(:last-child) {
    ${({compact:e})=>e?"":`margin-bottom: ${l.kc};`}
  }
  & > {
    &:nth-child(1) {
      min-width: ${({keyMinWidth:e})=>e}px;
    }
    &:nth-child(2) {
      max-width: ${({valueMaxWidth:e})=>e}px;
    }
  }
`,d=({children:e,valueMaxWidth:t=215,keyMinWidth:n=0,flexProps:i={},compact:a=!1})=>r.createElement(c,{width:"100%",justifyContent:"space-between",gap:l.kc,height:a?void 0:24,valueMaxWidth:t,keyMinWidth:n,compact:a,...i},e)},331680(e,t,n){n.r(t),n.d(t,{default:()=>O});var r,i=n(296540),l=n(777916),a=n(217439),o=n(566723),c=n(424095),d=n(294303),s=n(395812),m=n(916537),u=n(104154),A=n(691294),E=n(360113),h=n(469733),p=n(758649),g=n(984652),f=n(842630),x=n(689965);!function(e){e.REVOKE="revoke",e.UNAUTHORIZE="unauthorize"}(r||(r={}));const b=(0,i.memo)(({id:e,status:t})=>{const n=(0,h.useDispatch)(),[l,o]=(0,i.useReducer)((e,t)=>({...e,[t.type]:t.disabled}),{[r.REVOKE]:!1,[r.UNAUTHORIZE]:!1}),c=(0,i.useCallback)(()=>{o({type:r.REVOKE,disabled:!0}),n((0,g.$L)(e,t===A.S2.ONLINE)).finally(()=>o({type:r.REVOKE,disabled:!1}))},[n,e,t]),s=(0,i.useCallback)(()=>{o({type:r.UNAUTHORIZE,disabled:!0}),n((0,g.j1)(e)).finally(()=>o({type:r.UNAUTHORIZE,disabled:!1}))},[n,e]);return i.createElement(x.A,{type:x.I.BUTTON_LIST},i.createElement(f.A,null,i.createElement(d.A,null,i.createElement(p.A,{type:"button",disabled:l[r.REVOKE],color:"danger",variant:"inline",size:"medium",onClick:c},i.createElement(a.A,{size:"medium",color:"inherit"},i.createElement(m.sA,{id:"COMMON_ACTION_REVOKE_ACCESS"})))),t===A.S2.ONLINE?i.createElement(d.A,null,i.createElement(p.A,{type:"button",disabled:l[r.UNAUTHORIZE],variant:"inline",size:"medium",onClick:s},i.createElement(a.A,{size:"medium",color:"inherit"},i.createElement(m.sA,{id:"COMMON_ACTION_UNAUTHORIZE"})))):null))});var k=n(643757);const O=({activeItem:e})=>i.createElement(i.Fragment,null,i.createElement(x.A,{marginBottom:o.Ln},i.createElement(d.A,{flexDirection:"row",alignItems:"stretch",justifyContent:"flex-start",gap:o.kc},i.createElement(d.A,{width:50,minWidth:50,height:50},i.createElement(s.A,{type:"teleport"})),i.createElement(d.A,{width:"100%",justifyContent:"center",flexDirection:"column",alignItems:"stretch",overflow:"hidden",flex:"1"},i.createElement(k.A,{title:e.display_name}),i.createElement(a.A,{color:"text-3"},i.createElement(m.sA,{id:"COMMON_TELEPORT"}))))),i.createElement(x.A,null,e.ip?i.createElement(E.A,null,i.createElement(a.A,{color:"text-2"},i.createElement(m.sA,{id:"COMMON_IP_ADDRESS"})),i.createElement(a.A,{color:"text-3"},e.ip)):null,e.status===A.S2.ONLINE&&e.assoc_time?i.createElement(E.A,null,i.createElement(a.A,{color:"text-2"},i.createElement(m.sA,{id:"COMMON_UPTIME"})),i.createElement(a.A,{color:"text-3"},i.createElement(c.A,{startTimestamp:e.assoc_time}))):null,i.createElement(u.A,{client:e,props:["tx_packets","tx_bytes"]},({tx_packets:e=0,tx_bytes:t=0})=>e&&t?i.createElement(E.A,null,i.createElement(a.A,{color:"text-2"},i.createElement(m.sA,{id:"COMMON_ACTIVITY_DOWN_PKTS_BYTES"})),i.createElement(a.A,{color:"text-3"},e?.toLocaleString()," / ",i.createElement(l.A,{type:"bytes",size:"body",input:t,color:"tertiary"}))):null),i.createElement(u.A,{client:e,props:["rx_packets","rx_bytes"]},({rx_packets:e=0,rx_bytes:t=0})=>e&&t?i.createElement(E.A,null,i.createElement(a.A,{color:"text-2"},i.createElement(m.sA,{id:"COMMON_ACTIVITY_UP_PKTS_BYTES"})),i.createElement(a.A,{color:"text-3"},e?.toLocaleString()," / ",i.createElement(l.A,{type:"bytes",size:"body",input:t,color:"tertiary"}))):null)),i.createElement(b,{id:e.id,status:e.status}))},842630(e,t,n){n.d(t,{A:()=>a});var r=n(296540),i=n(469733),l=n(602021);const a=({children:e=null})=>(0,i.useSelector)(l.EL)?null:r.createElement(r.Fragment,null,e)},383149(e,t,n){n.d(t,{A:()=>i});var r=n(885205);const i=function(e,t){return!(null==e||!e.length)&&(0,r.A)(e,t,0)>-1}},887809(e,t,n){n.d(t,{A:()=>r});const r=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},458043(e,t,n){n.d(t,{A:()=>d});var r=n(8300),i=n(383149),l=n(887809),a=n(45572),o=n(552789),c=n(764099);const d=function(e,t,n,d){var s=-1,m=i.A,u=!0,A=e.length,E=[],h=t.length;if(!A)return E;n&&(t=(0,a.A)(t,(0,o.A)(n))),d?(m=l.A,u=!1):t.length>=200&&(m=c.A,u=!1,t=new r.A(t));e:for(;++s<A;){var p=e[s],g=null==n?p:n(p);if(p=d||0!==p?p:0,u&&g==g){for(var f=h;f--;)if(t[f]===g)continue e;E.push(p)}else m(t,g,d)||E.push(p)}return E}},144757(e,t,n){n.d(t,{A:()=>o});var r=n(458043),i=n(187671),l=n(224326),a=n(153533);const o=(0,l.A)(function(e,t){return(0,a.A)(e)?(0,r.A)(e,(0,i.A)(t,1,a.A,!0)):[]})}}]);