import{dasV,iasl,xasA,oasD,casS,easo,wasp,basr,fasL,Kasj,lask,Gas_,_asJ}from"./index-ab3b0b84.js";import{_asW}from"./BasicModal.vue_vue_type_style_index_0_lang-6b846ddc.js";import{_asX}from"./BasicMainCard-235c6a8e.js";import{_asG,uasK}from"./useBaseTable-af0ac405.js";import{_asq}from"./button.vue_vue_type_style_index_0_lang-2b2ee941.js";import{easz,fasH,hasQ}from"./competition-7e179a1a.js";import{tasY,aasZ}from"./useDataTime-45198684.js";import{IasC}from"./Icon-b552f0cb.js";import{_asee}from"./TextPreview.vue_vue_type_script_setup_true_lang-6e277daa.js";import{_aste}from"./index-9bb4e5d4.js";import"./index-cbd716ee.js";import"./isSymbol-5cc45ff5.js";import"./_plugin-vue_export-helper-6c5748cb.js";import"./vnode-602d90c4.js";import"./index-34ee3839.js";import"./DialogWrap-421034e2.js";import"./shallowequal-39bf2166.js";import"./omit-837670e8.js";import"./pickAttrs-1e1939a5.js";import"./index-086ff91e.js";import"./styleChecker-558deef9.js";import"./FormItemContext-548f4b58.js";import"./Grid-0eb1a61b.js";import"./index-b305a6df.js";import"./index-b2118e3c.js";import"./index-d5e11315.js";import"./useState-7883cedd.js";import"./useRefs-3f675f69.js";import"./_flatRest-289ae805.js";import"./isMobile-e2e89480.js";import"./index-fd8a1334.js";import"./Col-48c01651.js";import"./isPlainObject-d617fbb5.js";import"./updateLocale-958574f8.js";import"./useMemo-1af73168.js";import"./lodash-a8d94941.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-d33f0812.js";import"./index-adf5fd7f.js";import"./SearchOutlined-a36e5cce.js";import"./index-b5f9a27e.js";import"./Badge-fca8f233.js";import"./isNumeric-3f69e2aa.js";import"./index-18e93846.js";import"./index-0e84975e.js";import"./index-323711b8.js";import"./css-aae66f86.js";import"./toArray-78940ccb.js";import"./index-257982d0.js";import"./textUtils-c37780ad.js";constoe=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:u=>u.record.index+1},{title:"نام مسابقه",dataIndex:"match_title",key:"match_title"},{title:"شرح مسابقه",dataIndex:"match_description",key:"match_description",slot:"match_description"},{title:"نام کاربر",dataIndex:"user_name",key:"user_name"},{title:"شماره همراه",dataIndex:"user_mobile",key:"user_mobile"},{title:"امتیاز کسب شده",dataIndex:"score",key:"score",align:"center",customRender:u=>u.record.score||0},{title:"زمان",dataIndex:"created_at",key:"created_at",customRender:u=>Y(u.record.created_at)}],ae={class:"flex justify-between items-center mb-4"},le=r("h2",null,"امتیازات و برندگان مسابقات",-1),ie={class:"flex gap-2"},re={class:"space-y-4"},ne=r("div",{class:"mb-1 text-sm text-gray-600"},"انتخاب مسابقه",-1),se={class:"space-y-4"},ce=r("div",{class:"mb-1 text-sm text-gray-600"},"انتخاب مسابقه",-1),rt=V({__name:"index",setup(u){constw=te,B=l(null),[E,de]=K(),f=l(!1),g=l(!1),n=l(void0),s=l(void0),d=l([]),h=l(!1),b=l(!1),$=l(!1),T=l({columns:oe,api:z,defaultPageLimit:20});asyncfunctiony(){try{h.value=!0;constt=awaitH();d.value=(t||[]).map(e=>({label:e.title||`مسابقه ${e.id}`,value:e.id}))}catch(t){console.error("Error loading matchs:",t),_.error("خطا در بارگذاری لیست مسابقات")}finally{h.value=!1}}functionR(){n.value=void0,f.value=!0,d.value.length===0&&y()}functionI(){f.value=!1,n.value=void0}functionF(){s.value=void0,g.value=!0,d.value.length===0&&y()}functionM(){g.value=!1,s.value=void0}functionN(){if(!s.value){_.warning("لطفاً مسابقه را انتخاب کنید");return}constt=d.value.find(v=>v.value===s.value),e=encodeURIComponent((t==null?void0:t.label)||`مسابقه_${s.value}`),i=`/lottery?matchId=${s.value}&title=${e}`;window.open(i,"_blank","width=1200,height=800"),M()}asyncfunctionP(){if(!n.value){_.warning("لطفاً مسابقه را انتخاب کنید");return}try{b.value=!0;constt=awaitQ(n.value);if(t.length===0){_.warning("برای این مسابقه برندهای یافت نشد");return}c