import{T as b}from"./Input-b786da58.js";import{T}from"./Button-d4d49350.js";import{T as B}from"./InputError-8d3cfe49.js";import{T as C}from"./DialogModal-d32a0a51.js";import{T as S}from"./ActionMessage-e7228db2.js";import{T as L}from"./ActionSection-4deeb4ab.js";import{T as M}from"./SecondaryButton-7ef0b567.js";import{_ as x,r as a,o as i,d as O,e as t,h as r,t as o,a as e,c as l,F as V,i as F,b as I,g as d,q as N,n as $}from"./app-32ed258c.js";import"./Modal-291f355a.js";import"./SectionTitle-8b846035.js";const z={props:["sessions"],components:{TecInput:b,TecButton:T,TecInputError:B,TecDialogModal:C,TecActionMessage:S,TecActionSection:L,TecSecondaryButton:M},data(){return{confirmingLogout:!1,form:this.$inertia.form({password:""})}},methods:{confirmLogout(){this.confirmingLogout=!0,setTimeout(()=>this.$refs.password.focus(),250)},logoutOtherBrowserSessions(){this.form.delete(route("other-browser-sessions.destroy"),{preserveScroll:!0,onSuccess:()=>this.closeModal(),onError:()=>this.$refs.password.focus(),onFinish:()=>this.form.reset()})},closeModal(){this.confirmingLogout=!1,this.form.reset()}}},D={class:"text-gray-600"},E={key:0,class:"mt-5 space-y-6"},K={key:0,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24",stroke:"currentColor",class:"w-8 h-8 text-gray-500"},j=e("path",{d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1),A=[j],H={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:"w-8 h-8 text-gray-500"},P=e("path",{d:"M0 0h24v24H0z",stroke:"none"},null,-1),q=e("rect",{x:"7",y:"4",width:"10",height:"16",rx:"1"},null,-1),U=e("path",{d:"M11 5h2M12 17v.01"},null,-1),G=[P,q,U],J={class:"ml-3"},Q={class:"text-gray-600"},R={class:"text-xs text-gray-500"},W={key:0,class:"text-green-500 font-semibold"},X={key:1},Y={class:"flex items-center mt-5"},Z={class:"mt-4"};function oo(s,m,h,eo,c,u){const _=a("tec-button"),p=a("tec-action-message"),f=a("tec-input"),g=a("tec-input-error"),w=a("tec-secondary-button"),y=a("tec-dialog-modal"),v=a("tec-action-section");return i(),O(v,null,{title:t(()=>[r(o(s.$t("Browser Sessions")),1)]),description:t(()=>[r(o(s.$t("Manage and log out your active sessions on other browsers and devices.")),1)]),content:t(()=>[e("div",D,o(s.$t("If necessary, you may log out of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password.")),1),h.sessions.length>0?(i(),l("div",E,[(i(!0),l(V,null,F(h.sessions,(n,k)=>(i(),l("div",{class:"flex items-center",key:k},[e("div",null,[n.agent.is_desktop?(i(),l("svg",K,A)):(i(),l("svg",H,G))]),e("div",J,[e("div",Q,o(n.agent.platform)+" - "+o(n.agent.browser),1),e("div",null,[e("div",R,[r(o(n.ip_address)+", ",1),n.is_current_device?(i(),l("span",W,o(s.$t("This device")),1)):(i(),l("span",X,o(s.$t("Last active"))+" "+o(n.last_active),1))])])])]))),128))])):I("",!0),e("div",Y,[d(_,{onClick:u.confirmLogout},{default:t(()=>[r(o(s.$t("Log Out Other Browser Sessions")),1)]),_:1},8,["onClick"]),d(p,{on:c.form.recentlySuccessful,class:"ml-3"},{default:t(()=>[r(o(s.$t("Done.")),1)]),_:1},8,["on"])]),d(y,{show:c.confirmingLogout,onClose:u.closeModal},{title:t(()=>[r(o(s.$t("Log Out Other Browser Sessions")),1)]),content:t(()=>[r(o(s.$t("Please enter your password to confirm you would like to log out of your other browser sessions across all of your devices."))+" ",1),e("div",Z,[d(f,{ref:"password",type:"password",placeholder:"Password",modelValue:c.form.password,"onUpdate:modelValue":m[0]||(m[0]=n=>c.form.password=n),class:"mt-1 block w-3/4",onKeyup:N(u.logoutOtherBrowserSessions,["enter"])},null,8,["modelValue","onKeyup"]),d(g,{message:c.form.errors.password,class:"mt-2"},null,8,["message"])])]),footer:t(()=>[d(w,{onClick:u.closeModal},{default:t(()=>[r(o(s.$t("Cancel")),1)]),_:1},8,["onClick"]),d(_,{class:$(["ml-2",{"opacity-25":c.form.processing}]),disabled:c.form.processing,onClick:u.logoutOtherBrowserSessions},{default:t(()=>[r(o(s.$t("Log Out Other Browser Sessions")),1)]),_:1},8,["disabled","onClick","class"])]),_:1},8,["show","onClose"])]),_:1})}const ho=x(z,[["render",oo]]);export{ho as default};
