1import"./base-pe7GV1XZ.js";import{E as R}from"./el-pagination-CFEjM4Hs.js";import"./el-scrollbar-jCUVLUnO.js";import"./el-select-DWefANXt.js";/* empty css */import"./el-input-CnmL_t4N.js";import{E as D,a as F}from"./el-table-column-CHhKiIHF.js";import"./el-checkbox-STTymSq4.js";import"./el-tooltip-l0sNRNKZ.js";import{E as G}from"./el-popover-B40E4AT-.js";import{E as I}from"./el-button-DJtZds9M.js";import{E as L}from"./el-switch-DgVKjOrr.js";import{r as l,v as M,o as W,c as q,d as e,b as u,w as r,F as H,g as J,t as b,j as y,_ as K}from"./index-yrPBkgLG.js";import{a as O}from"./badges-BMLjtT7k.js";import{b as v}from"./BadgeService-Q5VA-qJo.js";import{t as Q}from"./TemplateService-Cw7f5OJc.js";import"./event-BB_Ol6Sd.js";import"./index-pfuQmdwN.js";import"./index-M7Y52XAl.js";import"./index-DWme1wXO.js";import"./index-cAzKqqYT.js";import"./aria--JZTNrRr.js";import"./constants-Dnj8X3EN.js";import"./use-form-common-props-C11eZE7M.js";import"./castArray-BFnFmXfp.js";import"./index-DNvpQlGu.js";import"./scroll-CJo2Uqhl.js";import"./toNumber-BXlDze-m.js";import"./index-CCntWDod.js";import"./vnode-B3H-aSbi.js";import"./_baseClone-uLppoVnS.js";import"./omit-DPP0qQjJ.js";import"./debounce-LRtN-bop.js";import"./raf-D65up9Ge.js";import"./index-r5W6hzzQ.js";import"./validator-BUysMGcF.js";const X={class:"flex gap-2 justify-between"},Y={class:"flex justify-end mt-4"},je={__name:"badge-table",emits:["update"],setup(Z,{expose:C,emit:x}){const f=l([]),{locale:E}=M(),c=l(0),s=l(10),g=l(0),m=l(1),h=l([]),k=x,z=async()=>{try{const t=await Q.GetAll({take:"-1"});h.value=t.data.content}catch(t){console.error(t)}},p=async()=>{try{const t=await v.GetAllBadges({skip:c.value,take:s.value});f.value=t.data.content,g.value=t.data.total}catch(t){console.error(t)}};function B(t){s.value=t,m.value=1,c.value=0,p()}function S(t){m.value=t,c.value=(t-1)*s.value,p()}const A=async t=>{try{await v.Delete(t),p()}catch(i){console.error(i)}},N=async(t,i)=>{try{await v.ChangeBadgeActive({id:i,isActive:t}),f.value.find(o=>o.id===i).isActive=t}catch(o){console.error(o)}},T=t=>c.value+t+1;return W(()=>{p(),z()}),C({upload:p}),(t,i)=>{const o=F,_=K,w=I,V=L,P=G,U=D,$=R;return J(),q(H,null,[e(U,{data:f.value,class:"w-full"},{default:r(()=>[e(o,{type:"index",label:"â",width:"60",index:T}),e(o,{prop:"name.uz",label:"Name uzb","min-width":"120"}),e(o,{prop:"name.ru",label:"Name rus","min-width":"120"}),e(o,{prop:"name.cyrl",label:"Name kiril","min-width":"120"}),e(o,{prop:"name.eng",label:"Name eng","min-width":"120"}),e(o,{prop:"ratingBoost",label:"Rating Boost","min-width":"120"}),e(o,{prop:"achievementLevel",label:"Achievement Level","min-width":"120"}),e(o,{label:"Notification","min-width":"180"},{default:r(({row:a})=>{var n,d;return[u("span",null,b((d=(n=h.value.find(j=>j.id===a.notificationSourceId))==null?void 0:n.title)==null?void 0:d[y(E)]),1)]}),_:1}),e(o,{label:"Type","min-width":"120"},{default:r(({row:a})=>{var n;return[u("span",null,b((n=y(O).find(d=>d.value===a.type))==null?void 0:n.name),1)]}),_:1}),e(o,{prop:"description.uz",label:"Tavsif uzb","min-width":"180"}),e(o,{prop:"description.ru",label:"Tavsif rus","min-width":"180"}),e(o,{prop:"description.cyrl",label:"Tavsif kiril","min-width":"180"}),e(o,{prop:"description.eng",label:"Tavsif eng","min-width":"180"}),e(o,{width:"200",fixed:"right"},{default:r(a=>[u("div",X,[e(w,{type:"primary",circle:"",class:"w-5 h-5",onClick:n=>k("update",a.row.id)},{default:r(()=>[e(_,{name:"penWhite",isSvg:""})]),_:1},8,["onClick"]),e(V,{modelValue:a.row.isActive,"onUpdate:modelValue":n=>a.row.isActive=n,class:"ml-2",style:{"--el-switch-on-color":"#13ce66","--el-switch-off-color":"#ff4949"},onChange:n=>N(a.row.isActive,a.row.id)},null,8,["modelValue","onUpdate:modelValue","onChange"]),e(P,{class:"box-item",title:"Are you sure?",placement:"top-end",onConfirm:n=>A(a.row.id)},{reference:r(()=>[e(w,{type:"danger",circle:"",plain:""},{default:r(()=>[e(_,{name:"trash",isSvg:""})]),_:1})]),_:1},8,["onConfirm"])])]),_:1})]),_:1},8,["data"]),u("div",Y,[e($,{"current-page":m.value,"onUpdate:currentPage":i[0]||(i[0]=a=>m.value=a),"page-size":s.value,"onUpdate:pageSize":i[1]||(i[1]=a=>s.value=a),"page-sizes":[10,20,50,100],total:g.value,layout:"total, sizes, prev, pager, next",onSizeChange:B,onCurrentChange:S},null,8,["current-page","page-size","total"])])],64)}}};export{je 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.