import{dasV,iasl,xasA,oasD,casS,easo,wasp,basr,fasL,Kasj,lask,Gas_,_asJ}from"./index-e064ffac.js";import{_asW}from"./BasicModal.vue_vue_type_style_index_0_lang-73f8a39e.js";import{_asX}from"./BasicMainCard-5c80ef19.js";import{_asG,uasK}from"./useBaseTable-fed341a8.js";import{_asq}from"./button.vue_vue_type_style_index_0_lang-76fea031.js";import{easz,fasH,hasQ}from"./competition-db7efbe2.js";import{tasY,aasZ}from"./useDataTime-ba62eb36.js";import{IasC}from"./Icon-66010218.js";import{_asee}from"./TextPreview.vue_vue_type_script_setup_true_lang-f36f6b08.js";import{_aste}from"./index-020f9f38.js";import"./index-5791312b.js";import"./isSymbol-dc94e500.js";import"./_plugin-vue_export-helper-c2b02d20.js";import"./vnode-43e0532a.js";import"./index-418d2c16.js";import"./DialogWrap-934116e0.js";import"./shallowequal-9a59fe48.js";import"./omit-98a5c881.js";import"./pickAttrs-20fc50b7.js";import"./index-c6cc46d7.js";import"./styleChecker-a89d8927.js";import"./FormItemContext-ea5e629b.js";import"./Grid-28c7683b.js";import"./index-69ceab84.js";import"./index-01bd72a1.js";import"./index-2f676c29.js";import"./useState-1df7da74.js";import"./useRefs-320b3f3d.js";import"./_flatRest-0e75a214.js";import"./isMobile-e2e89480.js";import"./index-7dcbad31.js";import"./Col-e0b57a55.js";import"./isPlainObject-118a5a84.js";import"./updateLocale-53d85368.js";import"./useMemo-118b7fdd.js";import"./lodash-77052907.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-094732f6.js";import"./index-3d02255e.js";import"./SearchOutlined-bce29925.js";import"./index-a1f6487e.js";import"./Badge-31351815.js";import"./isNumeric-3f69e2aa.js";import"./index-6b63d7e6.js";import"./index-1320e6a3.js";import"./index-cf4a2322.js";import"./css-aae66f86.js";import"./toArray-03404447.js";import"./index-4cde3ed4.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