import{Q as A}from"./QPage-DjgmKzZ_.js";import{u as D}from"./use-meta-Drr87NGw.js";import{u as S}from"./use-quasar-CxlsMA-r.js";import{u as I,Q as U}from"./QItemLabel-BRceraJL.js";import{a as w,r as o,o as V,w as P,a2 as K,a3 as q,a6 as n,a7 as r,a8 as x,ad as p,a5 as d,as as L,a9 as B,av as M,aK as R,ag as z,aq as E,e as F,ab as G}from"./index-D6xcdmSy.js";import{a as H,b as W}from"./rtl-BJcSdsPV.js";import{Q as j,a as J,b as O}from"./QTable-mJIsuc0j.js";import{e as X,g as Y}from"./axios-B_9szzRp.js";import{u as Z}from"./language-BmNUDO97.js";import{u as ee}from"./vue-i18n.runtime-BS3IaizX.js";const ae={class:"q-pa-md"},te={__name:"PyPi",setup(C){const{t}=ee(),s=S(),c=I(),y=Z(),b=w(()=>[{name:"category",required:!0,label:t("pypi.category"),align:"left",field:"category"},{name:"downloads",align:"center",label:t("pypi.downloads"),field:"downloads"},{name:"percent",align:"center",label:t("pypi.percent"),field:"percent"},{name:"date",align:"center",label:t("pypi.date"),field:"date"}]),f=w(()=>c.token),m=o([]),Q=o([]),g=o(""),k=o(0),i=o({sortBy:"updated_time",descending:!1,page:1,rowsPerPage:30,rowsNumber:30}),_=w(()=>f.value!==""?Math.ceil(k.value/i.value.rowsPerPage):0),$=o(s.screen.height*.73+"px"),T=o(s.screen.width*.825+"px"),h=o(s.dark.isActive?"#121212":"#ffffff");function u(l){let e={};l?e=l:e.pagination=i.value,c.tokenDataGet!==""&&(Y({url:"core/pypi/",params:{search:g.value,page:e.pagination.page,max_page:e.pagination.rowsPerPage}}).then(a=>{m.value=a.results,k.value=a.count,Q.value=a.users}).catch(a=>{s.notify({type:"error",message:a}),s.loading.hide()}),i.value=e.pagination)}V(()=>{N(),u()}),P(()=>s.dark.isActive,l=>{h.value=l?"#121212":"#ffffff"});function N(){X.on("needLogin",l=>{l&&(m.value=[],Q.value=[],g.value="",k.value=0)})}return P(()=>y.langData,l=>{l&&u()}),(l,e)=>(q(),K("div",ae,[n(O,{class:E(d(s).dark.isActive?"my-sticky-header-column-table-dark":"my-sticky-header-column-table"),flat:"",bordered:"",rows:m.value,columns:b.value,"row-key":"index",pagination:i.value,"onUpdate:pagination":e[6]||(e[6]=a=>i.value=a),separator:"cell","no-data-label":d(t)("nodata"),"rows-per-page-label":d(t)("per_page"),"rows-per-page-options":[10,30,50,200,1e3],"table-style":{height:$.value,width:T.value},"card-style":{backgroundColor:h.value},onRequest:u},{top:r(a=>[e[7]||(e[7]=x(" Bomiot PyPi Stats ")),n(H,{flat:""},{default:r(()=>[n(B,{label:d(t)("refresh"),icon:"refresh",onClick:e[0]||(e[0]=v=>u())},{default:r(()=>[n(U,{class:"bg-indigo",offset:[10,10],"content-style":"font-size: 12px"},{default:r(()=>[x(p(d(t)("refreshdata")),1)]),_:1})]),_:1},8,["label"])]),_:1}),n(W),n(M,{dense:"",debounce:"300",color:"primary",modelValue:g.value,"onUpdate:modelValue":e[1]||(e[1]=v=>g.value=v),onInput:e[2]||(e[2]=v=>u()),onKeyup:e[3]||(e[3]=R(v=>u(),["enter"]))},{append:r(()=>[n(z,{name:"search"})]),_:1},8,["modelValue"]),n(B,{flat:"",round:"",dense:"",icon:a.inFullscreen?"fullscreen_exit":"fullscreen",onClick:a.toggleFullscreen},null,8,["icon","onClick"])]),"body-cell":r(a=>[n(J,{props:a},{default:r(()=>[L("div",null,p(a.value),1)]),_:2},1032,["props"])]),pagination:r(()=>[x(p(d(t)("total"))+p(_.value)+" "+p(d(t)("page"))+" ",1),n(j,{modelValue:i.value.page,"onUpdate:modelValue":[e[4]||(e[4]=a=>i.value.page=a),e[5]||(e[5]=a=>u())],max:_.value,input:"","input-class":"text-orange-10"},null,8,["modelValue","max"])]),_:1},8,["class","rows","columns","pagination","no-data-label","rows-per-page-label","table-style","card-style"])]))}},fe={__name:"PyPiReader",setup(C){const t=S(),s=o(!1),c=o(""),y=o(""),b=o("");return D(()=>({title:c.value,meta:{description:{name:"description",content:y.value},keywords:{name:"keywords",content:b.value}}})),V(()=>{}),F(()=>{}),P(()=>t.dark.isActive,f=>{s.value=f}),(f,m)=>(q(),G(A,{class:"flex flex-top"},{default:r(()=>[n(te)]),_:1}))}};export{fe as default};
