"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[63671],{481472(e,t,n){n.d(t,{o:()=>h,z:()=>m});var i=n(29472),r=n(159469),o=n(352210),s=n(774366),d=n(290454);const a="teleportToken",l=`${d.w}/teleport/token`,c=(e,{apiMsg:t})=>({icon:r.C.danger,message:o.API_STRING_TRANSLATION[t]}),m=()=>(0,i.Kd)(a,l,"teleport",{},{method:s.A.POST,fetchConfig:{getAllPostData:!0},failureToast:c}),h=e=>(0,i.LK)(a,e,`${l}/${e}`,{},{failureToast:c})},535322(e,t,n){n.d(t,{A:()=>x,I:()=>i});var i,r=n(274934),o=n(814557),s=n(158885),d=n(247816),a=n(565527),l=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(i||(i={}));const h=(0,d.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===a.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${a.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${a.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${l.Ln}`:l.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||l.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}})=>o.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,A=(0,d.A)(s.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===a.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${a.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${a.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||o.Ay[t===a.S.DARK?`desktop-color-neutral-01-${a.S.DARK}`:`desktop-color-neutral-00-${a.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${l.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${l.Ln} ${l.Ln};
      }
    }
  }
`,x=({type:e,marginBottom:t,margin:n,padding:o,flex:s,width:d,nested:a,...l})=>"items"in l?(0,r.jsx)(A,{marginBottom:t,margin:n,padding:o,flex:s,nested:a,...l}):(0,r.jsx)(h,{nested:a,width:d,marginBottom:t,margin:n,padding:o,flex:s,isButtonList:e===i.BUTTON_LIST,...l,children:l.children})},89469(e,t,n){n.d(t,{A:()=>d});var i=n(274934),r=n(602086),o=n(309130),s=n(100978);const d=(0,r.forwardRef)((e,t)=>(0,i.jsx)(s.A,{ref:t,flexDirection:"column",gap:o.kc,width:"100%",...e}))},756782(e,t,n){n.d(t,{A:()=>p});var i=n(274934),r=n(814557),o=n(602086),s=n(938984),d=n(247816),a=n(309130),l=n(590979),c=n(147045),m=n(291508),h=n(304151),A=n(100978),x=n(535322),u=n(89469);const g=(0,d.A)(x.A,(0,m.A)("isOutlined"))`
  border: ${({theme:{themeName:e},isOutlined:t})=>`1px solid ${t?r.Ay[`desktop-color-ublue-06-${e}`]:"transparent"}`};
`,p=({children:e,title:t,tooltip:n,tooltipProps:r,[c.L]:d,titleAction:m,isOutlined:x})=>{const p=(e=>o.Children.toArray(e).length>0)(e);return(0,i.jsx)(g,{marginBottom:"none",...l.A.addDataTestId(d??""),isOutlined:x,children:(0,i.jsxs)(A.A,{flexDirection:"column",...p&&{gap:a.Ln},width:"100%",children:[t?(0,i.jsxs)(A.A,{alignItems:"center",gap:a.YC,justifyContent:"space-between",width:"100%",children:[(0,i.jsxs)(A.A,{gap:a.YC,alignItems:"center",children:[(0,i.jsx)(s.A,{variant:"heading-medium",children:t}),n?(0,i.jsx)(h.A,{description:n,portal:!0,...r}):null]}),m?(0,i.jsx)(A.A,{children:m}):null]}):null,p?(0,i.jsx)(u.A,{children:e}):null]})})}},279279(e,t,n){n.d(t,{A:()=>a});var i=n(977872),r=n(602086),o=n(820633),s=n(897166),d=n(570801);const a=()=>{const e=(0,i.d4)(o.zi),t=(0,i.d4)(d.BQ),n=(0,i.d4)(s.hq),a=(0,r.useMemo)(()=>new Intl.DateTimeFormat(e,{hourCycle:t,month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZone:n}),[e,t,n]);return(0,r.useCallback)(e=>a.format(e),[a])}},663671(e,t,n){n.r(t),n.d(t,{default:()=>O});var i=n(274934),r=n(977872),o=n(602086),s=n(814557),d=n(734318),a=n(247816),l=n(938984),c=n(954702),m=n(309130),h=n(100978),A=n(470070),x=n(993366),u=n(469456),g=n(481472),p=n(223597),j=n(239627),T=n(756782),$=n(254590),f=n(279279),N=n(590979),_=n(735552),k=n(146215);const I=(0,a.A)(h.A)`
  flex-direction: column;
  padding: ${m.kc};
  background: ${({theme:{themeName:e}})=>s.Ay[`desktop-color-neutral-01-${e}`]};
  border-radius: ${s.Ay["desktop-radius-global"]};
  gap: ${m.kc};
`,b=(0,a.A)(h.A)`
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
`,O=()=>{const e=(0,r.wA)(),[t,n]=(0,o.useState)({}),s=(0,r.d4)(x.J),a=(0,f.A)(),O=(0,o.useMemo)(()=>s.filter(({expiration_timestamp:e})=>!e||1e3*e>=Date.now()).reverse(),[s]),L=(0,o.useCallback)(({token_id:i,client:r})=>{t[i]||(n({...t,[i]:!0}),e(r?(0,j.$L)(r.id,r.status===p.S2.ONLINE):(0,g.o)(i)).then(()=>e((0,u.t)())).catch(()=>{n({...t,[i]:!1})}))},[t,e]);return(0,o.useEffect)(()=>{e((0,_.NM)(u.j))},[e]),(0,i.jsx)(T.A,{title:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(A.sA,{id:"SETTINGS_TP_INV_HIST"})," (",O.length,")"]}),children:(0,i.jsx)(h.A,{width:"100%",flexDirection:"column",gap:10,...N.A.addDataTestId(N.A.TestId.TELEPORT_TOKEN_TABLE),children:O.map(e=>(0,i.jsxs)(I,{children:[(0,i.jsxs)(b,{children:[(0,i.jsx)(l.A,{color:"text-2",children:(0,i.jsx)(A.sA,{id:"COMMON_CREATED"})}),(0,i.jsx)(l.A,{color:"text-3",children:e.creation_timestamp?a(1e3*e.creation_timestamp):$.L})]}),(0,i.jsxs)(b,{children:[(0,i.jsx)(l.A,{color:"text-2",children:(0,i.jsx)(A.sA,{id:"SETTINGS_TP_LINK"})}),(0,i.jsx)(l.A,{color:"text-3",children:e.invitation_url?`...${e.invitation_url.slice(-8)}`:(0,i.jsx)(A.sA,{id:"COMMON_FALLBACK"})})]}),(0,i.jsxs)(b,{children:[(0,i.jsx)(l.A,{color:"text-2",children:(0,i.jsx)(A.sA,{id:"COMMON_STATUS"})}),(0,i.jsx)(l.A,{color:"text-3",style:{textTransform:"capitalize"},children:e.invitation_status})]}),e.client?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(b,{children:[(0,i.jsx)(l.A,{color:"text-2",children:(0,i.jsx)(A.sA,{id:"COMMON_CLIENT"})}),(0,i.jsxs)(h.A,{alignItems:"center",gap:m.YC,children:[(0,i.jsx)(d.A,{size:"original",isActive:!0}),(0,i.jsx)(l.A,{color:"text-3",children:e.client.display_name})]})]}),(0,i.jsxs)(b,{children:[(0,i.jsx)(l.A,{color:"text-2",children:(0,i.jsx)(A.sA,{id:"COMMON_LAST_CONNECTED"})}),(0,i.jsx)(l.A,{color:"text-3",children:e.client.last_seen?a(1e3*e.client.last_seen):$.L})]})]}):null,(0,i.jsx)(h.A,{width:"100%",justifyContent:"flex-start",children:(0,i.jsx)(k.A,{title:(0,i.jsx)(A.sA,{id:"SETTINGS_REVOKE_INVITE_QUESTION"}),message:(0,i.jsx)(A.sA,{id:"SETTINGS_REVOKE_INVITE_CONFIRMATION"}),onConfirm:()=>L(e),trigger:(0,i.jsx)(c.A,{variant:"destructive",fontSize:"medium",isDisabled:t[e.token_id],children:(0,i.jsx)(A.sA,{id:"COMMON_ACTION_REMOVE"})})})})]},e.token_id))})})}}}]);