import{r as w,_ as E,o as Y,x as r,L as p,y as a,z as e,Y as W,K as T,aq as O,P as l,O as M,C as P,c as S,q as N,R as j,Q as z,ac as F,aV as G,aT as Q,u as J,aU as X}from"./vue-vendor-Bsazo-x0.js";import{_ as V,b as L,s as $,a as Z}from"./index-B2CfBDav.js";import{T as ee}from"./ThemeToggle-Ov1cO6jp.js";import{C as te}from"./ConfirmModal-BdGKP07t.js";import"./element-plus-C5sO7D8l.js";import"./vendor-C8JtMHuO.js";const se={key:0,class:"fixed inset-0 z-50 h-full w-full overflow-y-auto bg-gray-600 bg-opacity-50"},oe={class:"relative top-20 mx-auto w-[768px] max-w-4xl rounded-md border bg-white p-5 shadow-lg"},le={class:"mt-3"},re={class:"mb-4 flex items-center justify-between"},ae=["disabled"],de=["disabled"],ie={key:0,class:"rounded-md border border-red-200 bg-red-50 p-3"},ne={class:"flex"},ue={class:"ml-3"},ce={class:"text-sm text-red-700"},me={class:"flex justify-end space-x-3 pt-4"},xe=["disabled"],ge=["disabled"],ve={key:0,class:"flex items-center"},ye={key:1},pe={key:0,class:"mt-6 rounded-md border border-green-200 bg-green-50 p-4"},fe={class:"flex items-start"},he={class:"ml-3 flex-1"},ke={class:"mt-3"},we={class:"rounded-md border border-green-300 bg-white p-3"},be={class:"flex items-center justify-between"},_e={class:"break-all font-mono text-sm text-gray-900"},$e={__name:"CreateApiKeyModal",props:{show:{type:Boolean,default:!1}},emits:["close","created"],setup(x,{emit:b}){const f=x,h=b,g=L(),c=w(!1),y=w(""),v=w(null),s=E({name:"",description:""}),o=()=>{s.name="",s.description="",y.value="",v.value=null},A=async()=>{var i,t;if(!s.name.trim()){y.value="API key name is required";return}c.value=!0,y.value="";try{const d={name:s.name.trim(),description:s.description.trim()||void 0},k=await g.createApiKey(d);k.success?(v.value=k.apiKey,$("API key created successfully!","success")):y.value=k.message||"Failed to create API key"}catch(d){console.error("Create API key error:",d),y.value=((t=(i=d.response)==null?void 0:i.data)==null?void 0:t.message)||d.message||"Failed to create API key"}finally{c.value=!1}},C=async i=>{try{await navigator.clipboard.writeText(i),$("API key copied to clipboard!","success")}catch(t){console.error("Failed to copy:",t),$("Failed to copy to clipboard","error")}},_=()=>{o(),h("created"),h("close")};return Y(()=>f.show,i=>{i&&o()}),(i,t)=>x.show?(a(),r("div",se,[e("div",oe,[e("div",le,[e("div",re,[t[6]||(t[6]=e("h3",{class:"text-lg font-medium text-gray-900"},"Create New API Key",-1)),e("button",{class:"text-gray-400 hover:text-gray-600",onClick:t[0]||(t[0]=d=>i.$emit("close"))},t[5]||(t[5]=[e("svg",{class:"h-6 w-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M6 18L18 6M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)]))]),e("form",{class:"space-y-4",onSubmit:W(A,["prevent"])},[e("div",null,[t[7]||(t[7]=e("label",{class:"block text-sm font-medium text-gray-700",for:"name"}," Name * ",-1)),T(e("input",{id:"name","onUpdate:modelValue":t[1]||(t[1]=d=>s.name=d),class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",disabled:c.value,placeholder:"Enter API key name",required:"",type:"text"},null,8,ae),[[O,s.name]])]),e("div",null,[t[8]||(t[8]=e("label",{class:"block text-sm font-medium text-gray-700",for:"description"}," Description ",-1)),T(e("textarea",{id:"description","onUpdate:modelValue":t[2]||(t[2]=d=>s.description=d),class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",disabled:c.value,placeholder:"Optional description",rows:"3"},null,8,de),[[O,s.description]])]),y.value?(a(),r("div",ie,[e("div",ne,[t[9]||(t[9]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-5 w-5 text-red-400",fill:"currentColor",viewBox:"0 0 20 20"},[e("path",{"clip-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","fill-rule":"evenodd"})])],-1)),e("div",ue,[e("p",ce,l(y.value),1)])])])):p("",!0),e("div",me,[e("button",{class:"rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:opacity-50",disabled:c.value,type:"button",onClick:t[3]||(t[3]=d=>i.$emit("close"))}," Cancel ",8,xe),e("button",{class:"rounded-md border border-transparent bg-blue-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",disabled:c.value||!s.name.trim(),type:"submit"},[c.value?(a(),r("span",ve,t[10]||(t[10]=[e("svg",{class:"-ml-1 mr-2 h-4 w-4 animate-spin text-white",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"})],-1),M(" Creating... ",-1)]))):(a(),r("span",ye,"Create API Key"))],8,ge)])],32),v.value?(a(),r("div",pe,[e("div",fe,[t[14]||(t[14]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-5 w-5 text-green-400",fill:"currentColor",viewBox:"0 0 20 20"},[e("path",{"clip-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","fill-rule":"evenodd"})])],-1)),e("div",he,[t[13]||(t[13]=e("h4",{class:"text-sm font-medium text-green-800"},"API Key Created Successfully!",-1)),e("div",ke,[t[12]||(t[12]=e("p",{class:"mb-2 text-sm text-green-700"},[e("strong",null,"Important:"),M(" Copy your API key now. You won't be able to see it again! ")],-1)),e("div",we,[e("div",be,[e("code",_e,l(v.value.key),1),e("button",{class:"ml-3 inline-flex flex-shrink-0 items-center rounded border border-transparent bg-green-100 px-2 py-1 text-xs font-medium text-green-700 hover:bg-green-200 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2",onClick:t[4]||(t[4]=d=>C(v.value.key))},t[11]||(t[11]=[e("svg",{class:"mr-1 h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1),M(" Copy ",-1)]))])])]),e("div",{class:"mt-4 flex justify-end"},[e("button",{class:"rounded-md border border-transparent bg-green-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2",onClick:_}," Done ")])])])])):p("",!0)])])])):p("",!0)}},Ae=V($e,[["__scopeId","data-v-cc42dc9a"]]),Ce={key:0,class:"fixed inset-0 z-50 h-full w-full overflow-y-auto bg-gray-600 bg-opacity-50"},Me={class:"relative top-20 mx-auto w-[768px] max-w-4xl rounded-md border bg-white p-5 shadow-lg"},De={class:"mt-3"},Ie={class:"mb-4 flex items-center justify-between"},Pe={key:0,class:"space-y-4"},je={class:"mt-1 text-sm text-gray-900"},Ue={key:0},Ke={class:"mt-1 text-sm text-gray-900"},Ve={class:"mt-1 flex items-center space-x-2"},Be={class:"flex-1"},Le={key:0,class:"rounded-md border border-gray-300 bg-gray-50 p-3"},Se={class:"break-all font-mono text-sm text-gray-900"},Te={key:1,class:"rounded-md border border-gray-300 bg-gray-50 p-3"},ze={class:"font-mono text-sm text-gray-900"},Fe={class:"flex flex-col space-y-1"},Ne={key:0,class:"mr-1 h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},qe={key:1,class:"mr-1 h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},He={key:0,class:"mt-1 text-xs text-gray-500"},Re={class:"mt-1"},Oe={key:1,class:"border-t border-gray-200 pt-4"},Ee={class:"grid grid-cols-2 gap-4 text-sm"},Ye={class:"ml-2 font-medium"},We={class:"ml-2 font-medium"},Ge={class:"ml-2 font-medium"},Qe={class:"ml-2 font-medium"},Je={class:"space-y-2 border-t border-gray-200 pt-4 text-sm"},Xe={class:"flex justify-between"},Ze={class:"text-gray-900"},et={key:0,class:"flex justify-between"},tt={class:"text-gray-900"},st={key:1,class:"flex justify-between"},ot={class:"flex justify-end pt-4"},lt={__name:"ViewApiKeyModal",props:{show:{type:Boolean,default:!1},apiKey:{type:Object,default:null}},emits:["close"],setup(x,{emit:b}){const f=b,h=w(!1),g=v=>v>=1e6?(v/1e6).toFixed(1)+"M":v>=1e3?(v/1e3).toFixed(1)+"K":v.toString(),c=v=>v?new Date(v).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):null,y=async v=>{try{await navigator.clipboard.writeText(v),$("Copied to clipboard!","success")}catch(s){console.error("Failed to copy:",s),$("Failed to copy to clipboard","error")}};return(v,s)=>x.show?(a(),r("div",Ce,[e("div",Me,[e("div",De,[e("div",Ie,[s[5]||(s[5]=e("h3",{class:"text-lg font-medium text-gray-900"},"API Key Details",-1)),e("button",{class:"text-gray-400 hover:text-gray-600",onClick:s[0]||(s[0]=o=>f("close"))},s[4]||(s[4]=[e("svg",{class:"h-6 w-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M6 18L18 6M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)]))]),x.apiKey?(a(),r("div",Pe,[e("div",null,[s[6]||(s[6]=e("label",{class:"block text-sm font-medium text-gray-700"},"Name",-1)),e("p",je,l(x.apiKey.name),1)]),x.apiKey.description?(a(),r("div",Ue,[s[7]||(s[7]=e("label",{class:"block text-sm font-medium text-gray-700"},"Description",-1)),e("p",Ke,l(x.apiKey.description),1)])):p("",!0),e("div",null,[s[11]||(s[11]=e("label",{class:"block text-sm font-medium text-gray-700"},"API Key",-1)),e("div",Ve,[e("div",Be,[h.value?(a(),r("div",Le,[e("code",Se,l(x.apiKey.key||"Not available"),1)])):(a(),r("div",Te,[e("code",ze,l(x.apiKey.keyPreview||"cr_****"),1)]))]),e("div",Fe,[x.apiKey.key?(a(),r("button",{key:0,class:"inline-flex items-center rounded border border-gray-300 bg-white px-2 py-1 text-xs font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",onClick:s[1]||(s[1]=o=>h.value=!h.value)},[h.value?(a(),r("svg",Ne,s[8]||(s[8]=[e("path",{d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.878L12 12m-1.122-2.122L12 12m-1.122-2.122l-4.243-4.242m6.879 6.878L15 15","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},null,-1)]))):(a(),r("svg",qe,s[9]||(s[9]=[e("path",{d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},null,-1),e("path",{d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},null,-1)]))),M(" "+l(h.value?"Hide":"Show"),1)])):p("",!0),h.value&&x.apiKey.key?(a(),r("button",{key:1,class:"inline-flex items-center rounded border border-gray-300 bg-white px-2 py-1 text-xs font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",onClick:s[2]||(s[2]=o=>y(x.apiKey.key))},s[10]||(s[10]=[e("svg",{class:"mr-1 h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1),M(" Copy ",-1)]))):p("",!0)])]),x.apiKey.key?p("",!0):(a(),r("p",He," Full API key is only shown when first created or regenerated "))]),e("div",null,[s[12]||(s[12]=e("label",{class:"block text-sm font-medium text-gray-700"},"Status",-1)),e("div",Re,[e("span",{class:P(["inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",x.apiKey.isActive?"bg-green-100 text-green-800":"bg-red-100 text-red-800"])},l(x.apiKey.isActive?"Active":"Disabled"),3)])]),x.apiKey.usage?(a(),r("div",Oe,[s[17]||(s[17]=e("label",{class:"mb-2 block text-sm font-medium text-gray-700"},"Usage Statistics",-1)),e("div",Ee,[e("div",null,[s[13]||(s[13]=e("span",{class:"text-gray-500"},"Requests:",-1)),e("span",Ye,l(g(x.apiKey.usage.requests||0)),1)]),e("div",null,[s[14]||(s[14]=e("span",{class:"text-gray-500"},"Input Tokens:",-1)),e("span",We,l(g(x.apiKey.usage.inputTokens||0)),1)]),e("div",null,[s[15]||(s[15]=e("span",{class:"text-gray-500"},"Output Tokens:",-1)),e("span",Ge,l(g(x.apiKey.usage.outputTokens||0)),1)]),e("div",null,[s[16]||(s[16]=e("span",{class:"text-gray-500"},"Total Cost:",-1)),e("span",Qe,"$"+l((x.apiKey.usage.totalCost||0).toFixed(4)),1)])])])):p("",!0),e("div",Je,[e("div",Xe,[s[18]||(s[18]=e("span",{class:"text-gray-500"},"Created:",-1)),e("span",Ze,l(c(x.apiKey.createdAt)),1)]),x.apiKey.lastUsedAt?(a(),r("div",et,[s[19]||(s[19]=e("span",{class:"text-gray-500"},"Last Used:",-1)),e("span",tt,l(c(x.apiKey.lastUsedAt)),1)])):p("",!0),x.apiKey.expiresAt?(a(),r("div",st,[s[20]||(s[20]=e("span",{class:"text-gray-500"},"Expires:",-1)),e("span",{class:P(["font-medium",new Date(x.apiKey.expiresAt)f("close"))}," Close ")])])):p("",!0)])])])):p("",!0)}},rt=V(lt,[["__scopeId","data-v-3bc05568"]]),at={class:"space-y-6"},dt={class:"sm:flex sm:items-center"},it={class:"mt-4 sm:ml-16 sm:mt-0 sm:flex-none"},nt=["disabled"],ut={key:0,class:"rounded-md border border-yellow-200 bg-yellow-50 p-4"},ct={class:"flex"},mt={class:"ml-3"},xt={class:"text-sm text-yellow-700"},gt={key:1,class:"py-12 text-center"},vt={key:2,class:"overflow-hidden bg-white shadow sm:rounded-md"},yt={class:"divide-y divide-gray-200",role:"list"},pt={class:"flex items-center justify-between"},ft={class:"flex items-center"},ht={class:"flex-shrink-0"},kt={class:"ml-4"},wt={class:"flex items-center"},bt={class:"text-sm font-medium text-gray-900"},_t={key:0,class:"ml-2 inline-flex items-center rounded-full bg-gray-100 px-2.5 py-0.5 text-xs font-medium text-gray-800"},$t={key:1,class:"ml-2 inline-flex items-center rounded-full bg-red-100 px-2.5 py-0.5 text-xs font-medium text-red-800"},At={class:"mt-1"},Ct={class:"text-sm text-gray-500"},Mt={class:"mt-1 flex items-center space-x-4 text-xs text-gray-400"},Dt={key:0},It={key:1},Pt={key:2},jt={key:3},Ut={class:"flex items-center space-x-2"},Kt={class:"text-right text-xs text-gray-500"},Vt={key:0},Bt={class:"flex items-center space-x-1"},Lt=["onClick"],St=["onClick"],Tt={key:3,class:"py-12 text-center"},zt={class:"mt-6"},Ft={__name:"UserApiKeysManager",setup(x){const b=L(),f=w(!0),h=w([]),g=S(()=>{var m;return((m=b.config)==null?void 0:m.maxApiKeysPerUser)||5}),c=w(!1),y=w(!1),v=w(!1),s=w(null),o=S(()=>[...h.value].sort((m,n)=>{const I=new Date(m.createdAt);return new Date(n.createdAt)-I})),A=S(()=>h.value.filter(m=>!(m.isDeleted==="true"||m.deletedAt)).length),C=m=>m>=1e6?(m/1e6).toFixed(1)+"M":m>=1e3?(m/1e3).toFixed(1)+"K":m.toString(),_=m=>m?new Date(m).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):null,i=async()=>{f.value=!0;try{h.value=await b.getUserApiKeys(!0)}catch(m){console.error("Failed to load API keys:",m),$("Failed to load API keys","error")}finally{f.value=!1}},t=m=>{s.value=m,y.value=!0},d=m=>{s.value=m,v.value=!0},k=async()=>{try{(await b.deleteApiKey(s.value.id)).success&&($("API key deleted successfully","success"),await i())}catch(m){console.error("Failed to delete API key:",m),$("Failed to delete API key","error")}finally{v.value=!1,s.value=null}},D=async()=>{c.value=!1,await i()};return N(()=>{i()}),(m,n)=>{var I;return a(),r("div",at,[e("div",dt,[n[6]||(n[6]=e("div",{class:"sm:flex-auto"},[e("h1",{class:"text-2xl font-semibold text-gray-900"},"My API Keys"),e("p",{class:"mt-2 text-sm text-gray-700"}," Manage your API keys to access Claude Relay services ")],-1)),e("div",it,[e("button",{class:"inline-flex items-center justify-center rounded-md border border-transparent bg-blue-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto",disabled:A.value>=g.value,onClick:n[0]||(n[0]=u=>c.value=!0)},n[5]||(n[5]=[e("svg",{class:"-ml-1 mr-2 h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M12 6v6m0 0v6m0-6h6m-6 0H6","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1),M(" Create API Key ",-1)]),8,nt)])]),A.value>=g.value?(a(),r("div",ut,[e("div",ct,[n[7]||(n[7]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-5 w-5 text-yellow-400",fill:"currentColor",viewBox:"0 0 20 20"},[e("path",{"clip-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","fill-rule":"evenodd"})])],-1)),e("div",mt,[e("p",xt," You have reached the maximum number of API keys ("+l(g.value)+"). Please delete an existing key to create a new one. ",1)])])])):p("",!0),f.value?(a(),r("div",gt,n[8]||(n[8]=[e("svg",{class:"mx-auto h-8 w-8 animate-spin text-blue-600",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"})],-1),e("p",{class:"mt-2 text-sm text-gray-500"},"Loading API keys...",-1)]))):o.value.length>0?(a(),r("div",vt,[e("ul",yt,[(a(!0),r(z,null,F(o.value,u=>{var U,K;return a(),r("li",{key:u.id,class:"px-6 py-4"},[e("div",pt,[e("div",ft,[e("div",ht,[e("div",{class:P(["h-2 w-2 rounded-full",u.isDeleted==="true"||u.deletedAt?"bg-gray-400":u.isActive?"bg-green-400":"bg-red-400"])},null,2)]),e("div",kt,[e("div",wt,[e("p",bt,l(u.name),1),u.isDeleted==="true"||u.deletedAt?(a(),r("span",_t," Deleted ")):u.isActive?p("",!0):(a(),r("span",$t," Deleted "))]),e("div",At,[e("p",Ct,l(u.description||"No description"),1),e("div",Mt,[e("span",null,"Created: "+l(_(u.createdAt)),1),u.isDeleted==="true"||u.deletedAt?(a(),r("span",Dt,"Deleted: "+l(_(u.deletedAt)),1)):u.lastUsedAt?(a(),r("span",It,"Last used: "+l(_(u.lastUsedAt)),1)):(a(),r("span",Pt,"Never used")),u.expiresAt&&!(u.isDeleted==="true"||u.deletedAt)?(a(),r("span",jt,"Expires: "+l(_(u.expiresAt)),1)):p("",!0)])])])]),e("div",Ut,[e("div",Kt,[e("div",null,l(C(((U=u.usage)==null?void 0:U.requests)||0))+" requests",1),(K=u.usage)!=null&&K.totalCost?(a(),r("div",Vt,"$"+l(u.usage.totalCost.toFixed(4)),1)):p("",!0)]),e("div",Bt,[e("button",{class:"inline-flex items-center rounded border border-transparent p-1 text-gray-400 hover:text-gray-600",title:"View API Key",onClick:B=>t(u)},n[9]||(n[9]=[e("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}),e("path",{d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)]),8,Lt),!(u.isDeleted==="true"||u.deletedAt)&&u.isActive?(a(),r("button",{key:0,class:"inline-flex items-center rounded border border-transparent p-1 text-red-400 hover:text-red-600",title:"Delete API Key",onClick:B=>d(u)},n[10]||(n[10]=[e("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)]),8,St)):p("",!0)])])])])}),128))])])):(a(),r("div",Tt,[n[12]||(n[12]=e("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M15 7a2 2 0 012 2m0 0a2 2 0 012 2m-2-2h-6m6 0v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9a2 2 0 012-2h6z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)),n[13]||(n[13]=e("h3",{class:"mt-2 text-sm font-medium text-gray-900"},"No API keys",-1)),n[14]||(n[14]=e("p",{class:"mt-1 text-sm text-gray-500"},"Get started by creating your first API key.",-1)),e("div",zt,[e("button",{class:"inline-flex items-center rounded-md border border-transparent bg-blue-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",onClick:n[1]||(n[1]=u=>c.value=!0)},n[11]||(n[11]=[e("svg",{class:"-ml-1 mr-2 h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M12 6v6m0 0v6m0-6h6m-6 0H6","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1),M(" Create API Key ",-1)]))])])),j(Ae,{show:c.value,onClose:n[2]||(n[2]=u=>c.value=!1),onCreated:D},null,8,["show"]),j(rt,{"api-key":s.value,show:y.value,onClose:n[3]||(n[3]=u=>y.value=!1)},null,8,["api-key","show"]),j(te,{"confirm-class":"bg-red-600 hover:bg-red-700","confirm-text":"Delete",message:`Are you sure you want to delete '${(I=s.value)==null?void 0:I.name}'? This action cannot be undone.`,show:v.value,title:"Delete API Key",onCancel:n[4]||(n[4]=u=>v.value=!1),onConfirm:k},null,8,["message","show"])])}}},Nt=V(Ft,[["__scopeId","data-v-bfad7dc8"]]),qt={class:"space-y-6"},Ht={class:"sm:flex sm:items-center"},Rt={class:"mt-4 sm:ml-16 sm:mt-0 sm:flex-none"},Ot={key:0,class:"py-12 text-center"},Et={key:1,class:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4"},Yt={class:"overflow-hidden rounded-lg bg-white shadow"},Wt={class:"p-5"},Gt={class:"flex items-center"},Qt={class:"ml-5 w-0 flex-1"},Jt={class:"text-lg font-medium text-gray-900"},Xt={class:"overflow-hidden rounded-lg bg-white shadow"},Zt={class:"p-5"},es={class:"flex items-center"},ts={class:"ml-5 w-0 flex-1"},ss={class:"text-lg font-medium text-gray-900"},os={class:"overflow-hidden rounded-lg bg-white shadow"},ls={class:"p-5"},rs={class:"flex items-center"},as={class:"ml-5 w-0 flex-1"},ds={class:"text-lg font-medium text-gray-900"},is={class:"overflow-hidden rounded-lg bg-white shadow"},ns={class:"p-5"},us={class:"flex items-center"},cs={class:"ml-5 w-0 flex-1"},ms={class:"text-lg font-medium text-gray-900"},xs={key:2,class:"rounded-lg bg-white shadow"},gs={key:3,class:"rounded-lg bg-white shadow"},vs={class:"px-4 py-5 sm:p-6"},ys={class:"space-y-3"},ps={class:"flex items-center"},fs={class:"ml-3"},hs={class:"text-sm font-medium text-gray-900"},ks={class:"text-right"},ws={class:"text-sm text-gray-900"},bs={class:"text-xs text-gray-500"},_s={key:4,class:"rounded-lg bg-white shadow"},$s={class:"px-4 py-5 sm:p-6"},As={class:"overflow-hidden"},Cs={class:"min-w-full divide-y divide-gray-200"},Ms={class:"divide-y divide-gray-200 bg-white"},Ds={class:"whitespace-nowrap px-6 py-4"},Is={class:"text-sm font-medium text-gray-900"},Ps={class:"text-sm text-gray-500"},js={class:"whitespace-nowrap px-6 py-4 text-sm text-gray-900"},Us={class:"whitespace-nowrap px-6 py-4 text-sm text-gray-900"},Ks={class:"whitespace-nowrap px-6 py-4 text-sm text-gray-900"},Vs={class:"whitespace-nowrap px-6 py-4 text-sm text-gray-900"},Bs={class:"whitespace-nowrap px-6 py-4"},Ls={key:5,class:"py-12 text-center"},Ss={__name:"UserUsageStats",setup(x){const b=L(),f=w(!0),h=w("week"),g=w(null),c=w([]),y=s=>s>=1e6?(s/1e6).toFixed(1)+"M":s>=1e3?(s/1e3).toFixed(1)+"K":s.toString(),v=async()=>{f.value=!0;try{const[s,o]=await Promise.all([b.getUserUsageStats({period:h.value}),b.getUserApiKeys(!0)]);g.value=s,c.value=o}catch(s){console.error("Failed to load usage stats:",s),$("Failed to load usage statistics","error")}finally{f.value=!1}};return N(()=>{v()}),(s,o)=>{var A,C,_,i,t;return a(),r("div",qt,[e("div",Ht,[o[2]||(o[2]=e("div",{class:"sm:flex-auto"},[e("h1",{class:"text-2xl font-semibold text-gray-900"},"Usage Statistics"),e("p",{class:"mt-2 text-sm text-gray-700"},"View your API usage statistics and costs")],-1)),e("div",Rt,[T(e("select",{"onUpdate:modelValue":o[0]||(o[0]=d=>h.value=d),class:"block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",onChange:v},o[1]||(o[1]=[e("option",{value:"day"},"Last 24 Hours",-1),e("option",{value:"week"},"Last 7 Days",-1),e("option",{value:"month"},"Last 30 Days",-1),e("option",{value:"quarter"},"Last 90 Days",-1)]),544),[[G,h.value]])])]),f.value?(a(),r("div",Ot,o[3]||(o[3]=[e("svg",{class:"mx-auto h-8 w-8 animate-spin text-blue-600",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"})],-1),e("p",{class:"mt-2 text-sm text-gray-500"},"Loading usage statistics...",-1)]))):(a(),r("div",Et,[e("div",Yt,[e("div",Wt,[e("div",Gt,[o[5]||(o[5]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-6 w-6 text-blue-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M13 10V3L4 14h7v7l9-11h-7z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})])],-1)),e("div",Qt,[e("dl",null,[o[4]||(o[4]=e("dt",{class:"truncate text-sm font-medium text-gray-500"},"Total Requests",-1)),e("dd",Jt,l(y(((A=g.value)==null?void 0:A.totalRequests)||0)),1)])])])])]),e("div",Xt,[e("div",Zt,[e("div",es,[o[7]||(o[7]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-6 w-6 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})])],-1)),e("div",ts,[e("dl",null,[o[6]||(o[6]=e("dt",{class:"truncate text-sm font-medium text-gray-500"},"Input Tokens",-1)),e("dd",ss,l(y(((C=g.value)==null?void 0:C.totalInputTokens)||0)),1)])])])])]),e("div",os,[e("div",ls,[e("div",rs,[o[9]||(o[9]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-6 w-6 text-purple-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})])],-1)),e("div",as,[e("dl",null,[o[8]||(o[8]=e("dt",{class:"truncate text-sm font-medium text-gray-500"},"Output Tokens",-1)),e("dd",ds,l(y(((_=g.value)==null?void 0:_.totalOutputTokens)||0)),1)])])])])]),e("div",is,[e("div",ns,[e("div",us,[o[11]||(o[11]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-6 w-6 text-yellow-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})])],-1)),e("div",cs,[e("dl",null,[o[10]||(o[10]=e("dt",{class:"truncate text-sm font-medium text-gray-500"},"Total Cost",-1)),e("dd",ms," $"+l((((i=g.value)==null?void 0:i.totalCost)||0).toFixed(4)),1)])])])])])])),!f.value&&g.value?(a(),r("div",xs,o[12]||(o[12]=[Q('

Daily Usage Trend

Usage Chart

Daily usage trends would be displayed here

(Chart integration can be added with Chart.js, D3.js, or similar library)

',1)]))):p("",!0),!f.value&&g.value&&((t=g.value.modelStats)==null?void 0:t.length)>0?(a(),r("div",gs,[e("div",vs,[o[14]||(o[14]=e("h3",{class:"mb-4 text-lg font-medium leading-6 text-gray-900"},"Usage by Model",-1)),e("div",ys,[(a(!0),r(z,null,F(g.value.modelStats,d=>(a(),r("div",{key:d.name,class:"flex items-center justify-between"},[e("div",ps,[o[13]||(o[13]=e("div",{class:"flex-shrink-0"},[e("div",{class:"h-2 w-2 rounded-full bg-blue-500"})],-1)),e("div",fs,[e("p",hs,l(d.name),1)])]),e("div",ks,[e("p",ws,l(y(d.requests))+" requests",1),e("p",bs,"$"+l(d.cost.toFixed(4)),1)])]))),128))])])])):p("",!0),!f.value&&c.value.length>0?(a(),r("div",_s,[e("div",$s,[o[16]||(o[16]=e("h3",{class:"mb-4 text-lg font-medium leading-6 text-gray-900"},"Usage by API Key",-1)),e("div",As,[e("table",Cs,[o[15]||(o[15]=e("thead",{class:"bg-gray-50"},[e("tr",null,[e("th",{class:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",scope:"col"}," API Key "),e("th",{class:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",scope:"col"}," Requests "),e("th",{class:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",scope:"col"}," Input Tokens "),e("th",{class:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",scope:"col"}," Output Tokens "),e("th",{class:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",scope:"col"}," Cost "),e("th",{class:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",scope:"col"}," Status ")])],-1)),e("tbody",Ms,[(a(!0),r(z,null,F(c.value,d=>{var k,D,m,n;return a(),r("tr",{key:d.id},[e("td",Ds,[e("div",Is,l(d.name),1),e("div",Ps,l(d.keyPreview),1)]),e("td",js,l(y(((k=d.usage)==null?void 0:k.requests)||0)),1),e("td",Us,l(y(((D=d.usage)==null?void 0:D.inputTokens)||0)),1),e("td",Ks,l(y(((m=d.usage)==null?void 0:m.outputTokens)||0)),1),e("td",Vs," $"+l((((n=d.usage)==null?void 0:n.totalCost)||0).toFixed(4)),1),e("td",Bs,[e("span",{class:P(["inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",d.isDeleted==="true"||d.deletedAt?"bg-gray-100 text-gray-800":d.isActive?"bg-green-100 text-green-800":"bg-red-100 text-red-800"])},l(d.isDeleted==="true"||d.deletedAt?"Deleted":d.isActive?"Active":"Disabled"),3)])])}),128))])])])])])):p("",!0),!f.value&&(!g.value||g.value.totalRequests===0)?(a(),r("div",Ls,o[17]||(o[17]=[e("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1),e("h3",{class:"mt-2 text-sm font-medium text-gray-900"},"No usage data",-1),e("p",{class:"mt-1 text-sm text-gray-500"}," You haven't made any API requests yet. Create an API key and start using the service to see usage statistics. ",-1)]))):p("",!0)])}}},Ts=V(Ss,[["__scopeId","data-v-9d260191"]]),zs={class:"min-h-screen bg-gray-50 dark:bg-gray-900"},Fs={class:"bg-white shadow dark:bg-gray-800"},Ns={class:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8"},qs={class:"flex h-16 justify-between"},Hs={class:"flex items-center"},Rs={class:"ml-10"},Os={class:"flex items-baseline space-x-4"},Es={class:"flex items-center space-x-4"},Ys={class:"text-sm text-gray-700 dark:text-gray-300"},Ws={class:"font-medium"},Gs={class:"mx-auto max-w-7xl px-4 py-6 sm:px-6 lg:px-8"},Qs={key:0,class:"space-y-6"},Js={class:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-5"},Xs={class:"overflow-hidden rounded-lg bg-white shadow dark:bg-gray-800"},Zs={class:"p-5"},eo={class:"flex items-center"},to={class:"ml-5 w-0 flex-1"},so={class:"text-lg font-medium text-gray-900 dark:text-white"},oo={class:"overflow-hidden rounded-lg bg-white shadow dark:bg-gray-800"},lo={class:"p-5"},ro={class:"flex items-center"},ao={class:"ml-5 w-0 flex-1"},io={class:"text-lg font-medium text-gray-900 dark:text-white"},no={class:"overflow-hidden rounded-lg bg-white shadow dark:bg-gray-800"},uo={class:"p-5"},co={class:"flex items-center"},mo={class:"ml-5 w-0 flex-1"},xo={class:"text-lg font-medium text-gray-900 dark:text-white"},go={class:"overflow-hidden rounded-lg bg-white shadow dark:bg-gray-800"},vo={class:"p-5"},yo={class:"flex items-center"},po={class:"ml-5 w-0 flex-1"},fo={class:"text-lg font-medium text-gray-900 dark:text-white"},ho={class:"overflow-hidden rounded-lg bg-white shadow dark:bg-gray-800"},ko={class:"p-5"},wo={class:"flex items-center"},bo={class:"ml-5 w-0 flex-1"},_o={class:"text-lg font-medium text-gray-900 dark:text-white"},$o={class:"rounded-lg bg-white shadow dark:bg-gray-800"},Ao={class:"px-4 py-5 sm:p-6"},Co={class:"mt-5 border-t border-gray-200 dark:border-gray-700"},Mo={class:"divide-y divide-gray-200 dark:divide-gray-700"},Do={class:"py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5"},Io={class:"mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0"},Po={class:"py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5"},jo={class:"mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0"},Uo={class:"py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5"},Ko={class:"mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0"},Vo={class:"py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5"},Bo={class:"mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0"},Lo={class:"inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 text-xs font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200"},So={class:"py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5"},To={class:"mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0"},zo={class:"py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5"},Fo={class:"mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0"},No={key:1},qo={key:2},Ho={__name:"UserDashboardView",setup(x){const b=X(),f=L(),h=Z(),g=w("overview"),c=w(null),y=w({active:0,deleted:0}),v=i=>i>=1e6?(i/1e6).toFixed(1)+"M":i>=1e3?(i/1e3).toFixed(1)+"K":i.toString(),s=i=>i?new Date(i).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):null,o=i=>{g.value=i,i==="overview"&&_()},A=async()=>{try{await f.logout(),$("Logged out successfully","success"),b.push("/user-login")}catch(i){console.error("Logout error:",i),$("Logout failed","error")}},C=async()=>{try{c.value=await f.getUserProfile()}catch(i){console.error("Failed to load user profile:",i),$("Failed to load user profile","error")}},_=async()=>{try{const i=await f.getUserApiKeys(!0);console.log("All API Keys received:",i);const t=i.filter(k=>!(k.isDeleted==="true"||k.deletedAt)&&k.isActive),d=i.filter(k=>k.isDeleted==="true"||k.deletedAt);console.log("Active keys:",t),console.log("Deleted keys:",d),console.log("Active count:",t.length),console.log("Deleted count:",d.length),y.value={active:t.length,deleted:d.length}}catch(i){console.error("Failed to load API keys stats:",i),y.value={active:0,deleted:0}}};return N(()=>{h.initTheme(),C(),_()}),(i,t)=>{var d,k,D,m,n,I,u,U,K,B,q,H;return a(),r("div",zs,[e("nav",Fs,[e("div",Ns,[e("div",qs,[e("div",Hs,[t[3]||(t[3]=e("div",{class:"flex flex-shrink-0 items-center"},[e("svg",{class:"h-8 w-8 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})]),e("span",{class:"ml-2 text-xl font-bold text-gray-900 dark:text-white"},"Claude Relay")],-1)),e("div",Rs,[e("div",Os,[e("button",{class:P(["rounded-md px-3 py-2 text-sm font-medium",g.value==="overview"?"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300":"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"]),onClick:t[0]||(t[0]=R=>o("overview"))}," Overview ",2),e("button",{class:P(["rounded-md px-3 py-2 text-sm font-medium",g.value==="api-keys"?"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300":"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"]),onClick:t[1]||(t[1]=R=>o("api-keys"))}," API Keys ",2),e("button",{class:P(["rounded-md px-3 py-2 text-sm font-medium",g.value==="usage"?"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300":"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"]),onClick:t[2]||(t[2]=R=>o("usage"))}," Usage Stats ",2)])])]),e("div",Es,[e("div",Ys,[t[4]||(t[4]=M(" Welcome, ",-1)),e("span",Ws,l(J(f).userName),1)]),j(ee,{mode:"icon"}),e("button",{class:"rounded-md px-3 py-2 text-sm font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",onClick:A}," Logout ")])])])]),e("main",Gs,[g.value==="overview"?(a(),r("div",Qs,[t[22]||(t[22]=e("div",null,[e("h1",{class:"text-2xl font-semibold text-gray-900 dark:text-white"},"Dashboard Overview"),e("p",{class:"mt-2 text-sm text-gray-600 dark:text-gray-400"}," Welcome to your Claude Relay dashboard ")],-1)),e("div",Js,[e("div",Xs,[e("div",Zs,[e("div",eo,[t[6]||(t[6]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-6 w-6 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M15 7a2 2 0 012 2m0 0a2 2 0 012 2m-2-2h-6m6 0v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9a2 2 0 012-2h6z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})])],-1)),e("div",to,[e("dl",null,[t[5]||(t[5]=e("dt",{class:"truncate text-sm font-medium text-gray-500 dark:text-gray-400"}," Active API Keys ",-1)),e("dd",so,l(y.value.active),1)])])])])]),e("div",oo,[e("div",lo,[e("div",ro,[t[8]||(t[8]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-6 w-6 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})])],-1)),e("div",ao,[e("dl",null,[t[7]||(t[7]=e("dt",{class:"truncate text-sm font-medium text-gray-500 dark:text-gray-400"}," Deleted API Keys ",-1)),e("dd",io,l(y.value.deleted),1)])])])])]),e("div",no,[e("div",uo,[e("div",co,[t[10]||(t[10]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-6 w-6 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M13 10V3L4 14h7v7l9-11h-7z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})])],-1)),e("div",mo,[e("dl",null,[t[9]||(t[9]=e("dt",{class:"truncate text-sm font-medium text-gray-500 dark:text-gray-400"}," Total Requests ",-1)),e("dd",xo,l(v(((k=(d=c.value)==null?void 0:d.totalUsage)==null?void 0:k.requests)||0)),1)])])])])]),e("div",go,[e("div",vo,[e("div",yo,[t[12]||(t[12]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-6 w-6 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})])],-1)),e("div",po,[e("dl",null,[t[11]||(t[11]=e("dt",{class:"truncate text-sm font-medium text-gray-500 dark:text-gray-400"}," Input Tokens ",-1)),e("dd",fo,l(v(((m=(D=c.value)==null?void 0:D.totalUsage)==null?void 0:m.inputTokens)||0)),1)])])])])]),e("div",ho,[e("div",ko,[e("div",wo,[t[14]||(t[14]=e("div",{class:"flex-shrink-0"},[e("svg",{class:"h-6 w-6 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})])],-1)),e("div",bo,[e("dl",null,[t[13]||(t[13]=e("dt",{class:"truncate text-sm font-medium text-gray-500 dark:text-gray-400"}," Total Cost ",-1)),e("dd",_o," $"+l((((I=(n=c.value)==null?void 0:n.totalUsage)==null?void 0:I.totalCost)||0).toFixed(4)),1)])])])])])]),e("div",$o,[e("div",Ao,[t[21]||(t[21]=e("h3",{class:"text-lg font-medium leading-6 text-gray-900 dark:text-white"}," Account Information ",-1)),e("div",Co,[e("dl",Mo,[e("div",Do,[t[15]||(t[15]=e("dt",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"Username",-1)),e("dd",Io,l((u=c.value)==null?void 0:u.username),1)]),e("div",Po,[t[16]||(t[16]=e("dt",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"Display Name",-1)),e("dd",jo,l(((U=c.value)==null?void 0:U.displayName)||"N/A"),1)]),e("div",Uo,[t[17]||(t[17]=e("dt",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"Email",-1)),e("dd",Ko,l(((K=c.value)==null?void 0:K.email)||"N/A"),1)]),e("div",Vo,[t[18]||(t[18]=e("dt",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"Role",-1)),e("dd",Bo,[e("span",Lo,l(((B=c.value)==null?void 0:B.role)||"user"),1)])]),e("div",So,[t[19]||(t[19]=e("dt",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"Member Since",-1)),e("dd",To,l(s((q=c.value)==null?void 0:q.createdAt)),1)]),e("div",zo,[t[20]||(t[20]=e("dt",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"Last Login",-1)),e("dd",Fo,l(s((H=c.value)==null?void 0:H.lastLoginAt)||"N/A"),1)])])])])])])):g.value==="api-keys"?(a(),r("div",No,[j(Nt)])):g.value==="usage"?(a(),r("div",qo,[j(Ts)])):p("",!0)])])}}},Qo=V(Ho,[["__scopeId","data-v-ad1d87d9"]]);export{Qo as default};