1import{d as $,k as g,a as o,o as n,b as a,u as i,g as S,w as l,e,j as M,P as N,L as T,n as f,F as m,r as h,t as r,p as v,Q as y,f as c}from"./app-D6Z0QfqM.js";import{_ as I}from"./AppLayout.vue_vue_type_script_setup_true_lang-DZH8kkxg.js";import{_ as L,a as A,b as B,c as P,d as U,e as V,f as H,g as j}from"./AlertDialogTitle.vue_vue_type_script_setup_true_lang-CELDHhxN.js";import"./Primitive-BocIYmOS.js";import"./useForwardExpose-CJ58Ne1s.js";import"./useForwardPropsEmits-IQJC-XB-.js";import"./TooltipTrigger.vue_vue_type_script_setup_true_lang-BeeXy6SD.js";import"./SwitchLang.vue_vue_type_script_setup_true_lang-CpzNRh6X.js";import"./AppLogoIcon.vue_vue_type_script_setup_true_lang-_OmQKkcg.js";import"./useDirection-1rjEeOj7.js";import"./RovingFocusGroup-BVPIo6LO.js";import"./useArrowNavigation-B5rxJs06.js";const F={class:"py-12"},Q={class:"max-w-full mx-auto sm:px-6 lg:px-8"},z={class:"mb-6 bg-white p-6 shadow-sm sm:rounded-lg flex flex-col md:flex-row md:items-center space-y-4 md:space-y-0 md:space-x-4"},E={class:"flex-1 max-w-md relative"},K={class:"flex items-center space-x-2"},J={class:"bg-white overflow-hidden shadow-xl sm:rounded-lg p-6"},O={class:"overflow-x-auto"},W={class:"min-w-full divide-y divide-gray-200"},q={class:"bg-white divide-y divide-gray-200"},G={class:"px-4 py-4 whitespace-nowrap text-sm text-gray-500"},R={class:"px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},X={key:0,class:"px-2 py-1 bg-blue-100 text-blue-800 rounded-md text-xs font-bold"},Y={key:1},Z={class:"px-4 py-4 whitespace-nowrap text-sm text-gray-500"},ee={key:0},te={class:"font-medium text-gray-900"},se={class:"text-xs"},oe={key:1,class:"text-red-400 italic"},ne={class:"px-4 py-4 whitespace-nowrap text-sm"},re={key:0},ae={key:0,class:"mt-1 text-xs text-orange-600 font-semibold"},ie={key:1,class:"mt-1 text-xs text-blue-600 font-semibold"},le={key:1,class:"text-gray-400 text-xs"},de={class:"px-4 py-4 whitespace-nowrap text-sm text-gray-500"},ue={class:"px-4 py-4 whitespace-nowrap text-sm text-gray-500"},ce={class:"px-4 py-4 whitespace-nowrap text-right text-sm font-medium"},pe=["onClick"],xe={key:0,class:"mt-6 flex justify-center"},me={class:"flex items-center space-x-1"},_e=["onClick","innerHTML"],ge=["innerHTML"],Ie=$({__name:"Index",props:{tokens:{},filters:{},extension_token_name:{}},setup(w){const u=g(w.filters.search||""),_=()=>{y.get(route("admin.tokens.index"),{search:u.value||void 0},{preserveState:!0,preserveScroll:!0})},k=()=>{u.value="",_()},p=g(!1),x=g(null),C=d=>{x.value=d,p.value=!0},D=()=>{x.value&&y.delete(route("admin.tokens.destroy",x.value),{onSuccess:()=>{p.value=!1,x.value=null}})};return(d,s)=>(n(),o(m,null,[a(i(S),{title:"API Management"}),a(I,{title:"API Management"},{header:l(()=>s[2]||(s[2]=[e("h2",{class:"font-semibold text-xl text-gray-800 leading-tight cursor-default"}," API Connection Management ",-1)])),default:l(()=>[e("div",F,[e("div",Q,[e("div",z,[e("div",E,[s[3]||(s[3]=e("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[e("svg",{class:"h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})])],-1)),M(e("input",{"onUpdate:modelValue":s[0]||(s[0]=t=>u.value=t),type:"text",placeholder:"Find by user email...",class:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md leading-5 bg-white placeholder-gray-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm",onKeyup:N(_,["enter"])},null,544),[[T,u.value]])]),e("div",K,[e("button",{onClick:_,class:"inline-flex items-center px-4 py-2 bg-blue-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-blue-700 active:bg-blue-900 focus:outline-none focus:border-blue-900 focus:ring ring-blue-300 disabled:opacity-25 transition ease-in-out duration-150 cursor-pointer"}," Search "),u.value?(n(),o("button",{key:0,onClick:k,class:"px-3 py-2 text-sm text-gray-500 hover:text-gray-700 cursor-pointer"}," Clear ")):f("",!0)])]),e("div",J,[e("div",O,[e("table",W,[s[4]||(s[4]=e("thead",null,[e("tr",null,[e("th",{class:"px-4 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"ID"),e("th",{class:"px-4 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Name"),e("th",{class:"px-4 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"User"),e("th",{class:"px-4 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Subscription"),e("th",{class:"px-4 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"}
1,"Last Used"),e("th",{class:"px-4 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Created"),e("th",{class:"px-6 py-3 bg-gray-50 text-right text-xs font-medium text-gray-500 uppercase tracking-wider"},"Actions")])],-1)),e("tbody",q,[(n(!0),o(m,null,h(d.tokens.data,t=>(n(),o("tr",{key:t.id},[e("td",G,r(t.id),1),e("td",R,[t.name===d.extension_token_name?(n(),o("span",X,r(t.name),1)):(n(),o("span",Y,r(t.name),1))]),e("td",Z,[t.tokenable?(n(),o("div",ee,[e("div",te,r(t.tokenable.name),1),e("div",se,r(t.tokenable.email),1)])):(n(),o("span",oe,"Deleted User"))]),e("td",ne,[t.subscription_info?(n(),o("div",re,[e("span",{class:v(["px-2 py-0.5 rounded text-xs font-medium",[t.subscription_info.valid?"bg-green-100 text-green-800":"bg-red-100 text-red-800"]])},r(t.subscription_info.status),3),t.subscription_info.on_grace_period?(n(),o("div",ae," Ending: "+r(t.subscription_info.ends_at),1)):t.subscription_info.valid&&t.subscription_info.next_billing_date?(n(),o("div",ie," Next Billing: "+r(t.subscription_info.next_billing_date),1)):f("",!0)])):(n(),o("span",le,"No Subscription"))]),e("td",de,r(t.last_used_at_formatted),1),e("td",ue,r(t.created_at_formatted),1),e("td",ce,[e("button",{onClick:b=>C(t.id),class:"text-red-600 hover:text-red-900 cursor-pointer"},"Delete",8,pe)])]))),128))])])]),d.tokens.last_page>1?(n(),o("div",xe,[e("nav",me,[(n(!0),o(m,null,h(d.tokens.links,(t,b)=>(n(),o(m,{key:b},[t.url?(n(),o("button",{key:0,onClick:ye=>i(y).get(t.url),class:v(["px-3 py-1 text-sm rounded-md border cursor-pointer",[t.active?"bg-blue-600 text-white border-blue-600 font-bold":"hover:bg-gray-50 text-gray-500 border-gray-300"]]),innerHTML:t.label},null,10,_e)):(n(),o("span",{key:1,class:"px-3 py-1 text-sm text-gray-400 border border-gray-200 rounded-md cursor-not-allowed",innerHTML:t.label},null,8,ge))],64))),128))])])):f("",!0)])])])]),_:1}),a(i(j),{open:p.value,"onUpdate:open":s[1]||(s[1]=t=>p.value=t)},{default:l(()=>[a(i(L),null,{default:l(()=>[a(i(A),null,{default:l(()=>[a(i(B),null,{default:l(()=>s[5]||(s[5]=[c("Are you sure?")])),_:1,__:[5]}),a(i(P),null,{default:l(()=>[s[6]||(s[6]=c(" This will revoke this API connection immediately. ")),s[7]||(s[7]=e("br",null,null,-1)),s[8]||(s[8]=e("br",null,null,-1)),s[9]||(s[9]=e("strong",null,"Warning:",-1)),c(" If this is an '"+r(d.extension_token_name)+"' connection, it will also be cleared from the user's secondary JSON storage to prevent confusion. ",1)]),_:1,__:[6,7,8,9]})]),_:1}),a(i(U),null,{default:l(()=>[a(i(V),{class:"cursor-pointer"},{default:l(()=>s[10]||(s[10]=[c("Cancel")])),_:1,__:[10]}),a(i(H),{onClick:D,class:"bg-red-600 hover:bg-red-700 cursor-pointer"},{default:l(()=>s[11]||(s[11]=[c("Delete Connection")])),_:1,__:[11]})]),_:1})]),_:1})]),_:1},8,["open"])],64))}});export{Ie as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.