import{n as e}from"./chunk-DrgAwqJ9.js";import{a as t,i as n}from"./graphql-BME5mLgf.js";import{n as r,t as i}from"./jsx-runtime-C3uB2UIS.js";import{n as a}from"./link-DiTuM_g9.js";import{d as o,t as s}from"./useTranslation-DVVidJl_.js";import{r as c}from"./Tooltip-Lf-InH2_.js";import{i as l,n as u,r as d,t as f}from"./LastActive-c7Jpp_WC.js";import{c as p,d as m,f as h,i as g,l as _,o as v,s as y,t as b,u as x}from"./EndBrowserSessionButton-CfUO0PtZ.js";var S=``+new URL(`chrome_64x64-TTj2uZYF.png`,import.meta.url).href,C=``+new URL(`firefox_64x64-sbBPu9C9.png`,import.meta.url).href,w=``+new URL(`safari_64x64-DJVjfeAY.png`,import.meta.url).href,T=i(),E=n(`
  fragment BrowserSession_session on BrowserSession {
    id
    createdAt
    finishedAt
    ...EndBrowserSessionButton_session
    userAgent {
      deviceType
      name
      os
      model
    }
    lastActiveAt
  }
`),D=e=>{let t=e?.toLowerCase();if(t?.includes(`chrome`)||t?.includes(`chromium`))return S;if(t?.includes(`firefox`))return C;if(t?.includes(`safari`))return w},O=({session:e,isCurrent:n})=>{let r=t(E,e),{t:i}=s(),a=r.userAgent?.deviceType??`UNKNOWN`,o=null,c=null;r.userAgent?.model?(o=r.userAgent.model,r.userAgent?.name&&(c=r.userAgent?.os?i(`frontend.session.name_for_platform`,{name:r.userAgent.name,platform:r.userAgent.os}):r.userAgent.name)):(o=r.userAgent?.name??i(`frontend.session.unknown_browser`),c=r.userAgent?.os??null);let S=d(r.createdAt),C=r.lastActiveAt?d(r.lastActiveAt):void 0;return(0,T.jsxs)(h,{children:[(0,T.jsxs)(_,{to:`/sessions/$id`,params:{id:r.id},disabled:!!r.finishedAt,children:[(0,T.jsxs)(y,{type:a,children:[(0,T.jsx)(m,{name:o}),c&&(0,T.jsx)(v,{name:c,logoUri:D(r.userAgent?.name??void 0)})]}),(0,T.jsxs)(x,{children:[C&&!n&&(0,T.jsx)(p,{label:i(`frontend.session.last_active_label`),children:(0,T.jsx)(f,{lastActive:C})}),(0,T.jsx)(p,{label:i(`frontend.session.signed_in_label`),children:(0,T.jsx)(u,{datetime:S})}),n&&(0,T.jsx)(l,{kind:`green`,className:`self-center`,children:i(`frontend.session.current`)})]})]}),!r.finishedAt&&(0,T.jsx)(g,{children:(0,T.jsx)(b,{session:r,size:`sm`})})]})},k={emptyState:`_empty-state_1lwui_8`},A=e(o(),1),j=e(r(),1),M=(0,j.forwardRef)(function({children:e,...t},n){let r=(0,A.default)(k.emptyState,t.className);return(0,T.jsx)(`div`,{ref:n,...t,className:r,children:e})}),N={filter:`_filter_nv8wu_8`,enabledFilter:`_enabled-filter_nv8wu_18`,closeIcon:`_close-icon_nv8wu_22`,disabledFilter:`_disabled-filter_nv8wu_43`},P=a((0,j.forwardRef)(function({children:e,enabled:t,...n},r){let i=(0,A.default)(N.filter,t?N.enabledFilter:N.disabledFilter,n.className);return(0,T.jsxs)(`a`,{...n,ref:r,className:i,children:[e,t&&(0,T.jsx)(c,{className:N.closeIcon})]})}));export{D as i,M as n,O as r,P as t};
//# sourceMappingURL=Filter-CpEITKHx.js.map