import{u as x,b as _,j as s,l as p,r as f,x as u,ai as g,C as h}from"./main-BiT4j4N5.js";import{p as d,L as j,D as w,B as v}from"./LastActive-Ceb4QxH0.js";import{R as b,L as N,H as y,N as B,C as F,M as S,I as m,A as I,E as L}from"./EndBrowserSessionButton-Di6zgty2.js";const E=""+new URL("chrome_64x64-TTj2uZYF.png",import.meta.url).href,R=""+new URL("firefox_64x64-sbBPu9C9.png",import.meta.url).href,T=""+new URL("safari_64x64-DJVjfeAY.png",import.meta.url).href,C=p(`
  fragment BrowserSession_session on BrowserSession {
    id
    createdAt
    finishedAt
    ...EndBrowserSessionButton_session
    userAgent {
      deviceType
      name
      os
      model
    }
    lastActiveAt
  }
`),U=r=>{const t=r?.toLowerCase();if(t?.includes("chrome")||t?.includes("chromium"))return E;if(t?.includes("firefox"))return R;if(t?.includes("safari"))return T},G=({session:r,isCurrent:t})=>{const e=_(C,r),{t:n}=x(),a=e.userAgent?.deviceType??"UNKNOWN";let o=null,i=null;e.userAgent?.model?(o=e.userAgent.model,e.userAgent?.name&&(e.userAgent?.os?i=n("frontend.session.name_for_platform",{name:e.userAgent.name,platform:e.userAgent.os}):i=e.userAgent.name)):(o=e.userAgent?.name??n("frontend.session.unknown_browser"),i=e.userAgent?.os??null);const A=d(e.createdAt),c=e.lastActiveAt?d(e.lastActiveAt):void 0;return s.jsxs(b,{children:[s.jsxs(N,{to:"/sessions/$id",params:{id:e.id},disabled:!!e.finishedAt,children:[s.jsxs(y,{type:a,children:[s.jsx(B,{name:o}),i&&s.jsx(F,{name:i,logoUri:U(e.userAgent?.name??void 0)})]}),s.jsxs(S,{children:[c&&!t&&s.jsx(m,{label:n("frontend.session.last_active_label"),children:s.jsx(j,{lastActive:c})}),s.jsx(m,{label:n("frontend.session.signed_in_label"),children:s.jsx(w,{datetime:A})}),t&&s.jsx(v,{kind:"green",className:"self-center",children:n("frontend.session.current")})]})]}),!e.finishedAt&&s.jsx(I,{children:s.jsx(L,{session:e,size:"sm"})})]})},k="_empty-state_1lwui_8",D={emptyState:k},J=f.forwardRef(function({children:t,...e},n){const a=u(D.emptyState,e.className);return s.jsx("div",{ref:n,...e,className:a,children:t})}),M="_filter_nv8wu_8",H="_enabled-filter_nv8wu_18",O="_close-icon_nv8wu_22",Y="_disabled-filter_nv8wu_43",l={filter:M,enabledFilter:H,closeIcon:O,disabledFilter:Y},K=g(f.forwardRef(function({children:t,enabled:e,...n},a){const o=u(l.filter,e?l.enabledFilter:l.disabledFilter,n.className);return s.jsxs("a",{...n,ref:a,className:o,children:[t,e&&s.jsx(h,{className:l.closeIcon})]})}));export{G as B,J as E,K as F,U as b};
//# sourceMappingURL=Filter-Dk-lkHif.js.map
