import{dasO,gasl,vasS,oasV,casj,baso,wasp,aasr,easL,JasA,jask,Das_,_asJ}from"./index-35c19078.js";import{_asW}from"./BasicModal.vue_vue_type_style_index_0_lang-20cc468f.js";import{_asX}from"./BasicMainCard-aaaa8dc3.js";import{_asq,uasz}from"./useBaseTable-1184a002.js";import{_asG}from"./button.vue_vue_type_style_index_0_lang-cbfd9667.js";import{easH,fasK,hasQ}from"./competition-bc3bce97.js";import{tasY,aasZ}from"./useDataTime-35d3ce8c.js";import{IasC}from"./Icon-0c226cc8.js";import{_asee}from"./TextPreview.vue_vue_type_script_setup_true_lang-8b46377d.js";import{aaste}from"./index-0cfe3fb2.js";import"./index-c135e3cd.js";import"./isSymbol-76912a30.js";import"./_plugin-vue_export-helper-b8aa26f1.js";import"./vnode-bd016db8.js";import"./index-d1bea9c9.js";import"./DialogWrap-7ea92471.js";import"./shallowequal-336924ae.js";import"./omit-fea2187f.js";import"./pickAttrs-2a6a34d0.js";import"./index-317dfb98.js";import"./styleChecker-5378d544.js";import"./FormItemContext-c59740e7.js";import"./Grid-5df717b4.js";import"./index-0b82077f.js";import"./index-e39a0c4e.js";import"./index-81c6c557.js";import"./useState-0b0c0b26.js";import"./useRefs-d20fccdf.js";import"./_flatRest-ce9c6e5e.js";import"./isMobile-e2e89480.js";import"./index-5e048154.js";import"./Col-93e193e7.js";import"./isPlainObject-9fc066ac.js";import"./updateLocale-674603f1.js";import"./useMemo-141475be.js";import"./lodash-e3d7e6b8.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-aa5cbf20.js";import"./index-e2b66426.js";import"./SearchOutlined-fd97bf7f.js";import"./index-9c958bd1.js";import"./Badge-5aec0f5b.js";import"./isNumeric-3f69e2aa.js";import"./index-597067d3.js";import"./index-3e7c49ac.js";import"./index-53a07be2.js";import"./css-aae66f86.js";import"./toArray-f7bbf4fe.js";import"./index-70f42a71.js";import"./textUtils-c37780ad.js";constoe=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:m=>m.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:m=>m.record.score||0},{title:"زمان",dataIndex:"created_at",key:"created_at",customRender:m=>Y(m.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=O({__name:"index",setup(m){constw=te,B=l(null),[E,de]=z(),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:H,defaultPageLimit:20});asyncfunctiony(){try{h.value=!0;constt=awaitK();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