import{u as C,Q as q}from"./use-meta-CC3atq9B.js";import{z as x,G as U,H as j}from"./QItemLabel-CSFHvavz.js";import{a as f,r as o,l as Q,w as v,Z as m,_ as g,a1 as l,a2 as i,a4 as y,ac as A,a8 as _,a3 as N,aj as S,a0 as b,o as $,a6 as F}from"./index-D2hPaYPv.js";import{Q as I,a as M,b as R}from"./QTable-CAVi90dQ.js";import{get as T}from"./axios-B0Jsh4iT.js";import{u as z}from"./vue-i18n.runtime-DOx4kxGK.js";const H={class:"q-pa-md"},D={key:0},E={key:1},G={__name:"UserList",setup(V){const{t}=z(),n=x(),p=f(()=>[{name:"username",required:!0,label:t("username"),align:"left",field:e=>e.name,format:e=>`${e}`,sortable:!0},{name:"email",align:"center",label:t("email"),field:"email",sortable:!0},{name:"fat",label:"Fat (g)",field:"fat",sortable:!0},{name:"date_joined",label:t("date_joined"),field:"date_joined",sortable:!0},{name:"last_login",label:t("last_login"),field:"last_login",sortable:!0},{name:"updated_time",label:t("updated_time"),field:"updated_time",sortable:!0},{name:"action",label:t("action"),align:"right"}]),c=f(()=>[]),s=o({sortBy:"username",descending:!1,page:1,rowsPerPage:1,rowsNumber:1}),u=f(()=>Math.ceil(c.value.length/s.value.rowsPerPage)),h=o(n.screen.height*.73+"px"),P=o(n.screen.width*.825+"px"),k=o(n.dark.isActive?"#121212":"#ffffff");function w(e){T("core/user/").then(r=>{c.value=r.results}).catch(r=>(console.error(r),Promise.reject(r))),console.log(e),s.value=e.pagination}function B(e){console.log(e)}return Q(()=>{w({pagination:s.value})}),v(()=>n.dark.isActive,e=>{k.value=e?"#121212":"#ffffff"}),v(()=>s.value,e=>{console.log(e)}),(e,r)=>(m(),g("div",H,[l(R,{class:S(b(n).dark.isActive?"my-sticky-header-last-column-table-dark":"my-sticky-header-last-column-table"),flat:"",bordered:"",rows:c.value,columns:p.value,"row-key":"name",pagination:s.value,separator:"cell","no-data-label":b(t)("nodata"),"rows-per-page-label":b(t)("per_page"),"rows-per-page-options":[1,10,30,50,200,0],"table-style":{height:h.value,width:P.value},"card-style":{backgroundColor:k.value},onRequest:w},{top:i(a=>[l(y,{color:"primary",label:"Add row"}),l(U),l(j,{borderless:"",dense:"",debounce:"300",color:"primary",modelValue:u.value,"onUpdate:modelValue":r[0]||(r[0]=d=>u.value=d)},{append:i(()=>[l(A,{name:"search"})]),_:1},8,["modelValue"]),l(y,{flat:"",round:"",dense:"",icon:a.inFullscreen?"fullscreen_exit":"fullscreen",onClick:a.toggleFullscreen},null,8,["icon","onClick"])]),"body-cell":i(a=>[l(I,{props:a},{default:i(()=>[a.col.name==="action"?(m(),g("div",D,_(a),1)):(m(),g("div",E,_(a.value),1))]),_:2},1032,["props"])]),pagination:i(a=>[N(_(a)+" ",1),l(M,{modelValue:a.pagination.page,"onUpdate:modelValue":[d=>a.pagination.page=d,d=>B(a)],max:a.pagesNumber,input:"","input-class":"text-orange-10"},null,8,["modelValue","onUpdate:modelValue","max"])]),_:1},8,["class","rows","columns","pagination","no-data-label","rows-per-page-label","table-style","card-style"])]))}},X={__name:"UserReader",setup(V){const t=x(),n=o(!1),p=o(""),c=o(""),s=o("");return C(()=>({title:p.value,meta:{description:{name:"description",content:c.value},keywords:{name:"keywords",content:s.value}}})),Q(()=>{}),$(()=>{}),v(()=>t.dark.isActive,u=>{n.value=u}),(u,h)=>(m(),F(q,{class:"flex flex-top"},{default:i(()=>[l(G)]),_:1}))}};export{X as default};
