PageSourceSearch

https://trocafigurinhas.app/assets/RankingIndicationsView-VbpxI4NM.js

js trocafigurinhas.app collected 2026-10-06 04:46:27 UTC 31,717 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PremiumModal-Bkrz1MfJ.js","assets/index-CIhbGVJX.js","assets/index-Bjgpq81W.css","assets/PremiumUpsell-DNHlr4mL.js"])))=>i.map(i=>d[i]);
2import{h as Ue,v as Ve,K as Ke,a,bw as He,bx as We,by as Ze,bz as Je,bA as q,bB as Ye,bC as Xe,bD as es,bE as P,bF as ss,bG as me,bH as as,bI as rs,x as ts,A as ns,bJ as is,bK as ue,j as e,Y as pe,q as x,bL as os,bM as A,bN as ls,bO as ds,bP as cs,Z as xs,S as ms,_ as be}from"./index-CIhbGVJX.js";const ps=a.lazy(()=>be(()=>import("./PremiumModal-Bkrz1MfJ.js"),__vite__mapDeps([0,1,2]))),gs=a.lazy(()=>be(()=>import("./PremiumUpsell-DNHlr4mL.js"),__vite__mapDeps([3,1,2]))),ge="ranking_info_seen",v=100;function N(l,d){const t=String(l??"").trim(),m=Number(t.match(/\d+/)?.[0]??0),p=A(m>0?m:d);return m>0&&t.toLowerCase().includes("figurinha")&&!t.toLowerCase().includes("pacote")?`${m} figurinhas`:`${p} figurinhas`}function Q({className:l}){return e.jsx("span",{className:x("inline-flex items-center rounded bg-amber-100 px-1.5 py-0.5 text-[9px] leading-none font-black text-amber-700",l),children:"Premium PRO"})}function he({label:l}){return e.jsxs("div",{className:"rounded-xl border bg-white p-6 text-center shadow-sm",children:[e.jsx("div",{className:"mx-auto mb-3 h-7 w-7 animate-spin rounded-full border-4 border-green-600 border-t-transparent"}),e.jsx("p",{className:"text-sm font-bold text-gray-600",children:l})]})}function T({entries:l,myEntry:d,currentUserId:t,rewardedPositions:m=3}){const p=a.useMemo(()=>[...l].filter(o=>o.score>0).sort(ue).slice(0,v).map((o,D)=>({...o,position:D+1})),[l]),y=a.useMemo(()=>{if(!d||!t)return null;const i=p.find(o=>o.participant_id===t);return i?i.position:d.position},[p,d,t]);return e.jsxs("div",{children:[d&&d.score>0&&e.jsxs("div",{className:"mb-3 overflow-hidden rounded-xl border-2 border-green-400 bg-green-50 shadow-sm",children:[e.jsxs("div",{className:"grid grid-cols-[1fr_72px] gap-2 bg-green-100 px-3 py-1.5 text-[10px] font-bold tracking-wide text-green-700 uppercase",children:[e.jsx("span",{children:"Sua posição"}),e.jsx("span",{className:"text-center",children:"Pontuação"})]}),e.jsxs("div",{className:"grid grid-cols-[1fr_72px] items-center gap-2 px-3 py-3",children:[e.jsx("div",{className:"min-w-0",children:e.jsxs("p",{className:"flex flex-wrap items-center gap-1 text-sm font-black text-green-800",children:[e.jsxs("span",{className:"shrink-0 text-green-700",children:[y??`${v}+`,"º"]}),e.jsx("span",{className:"min-w-0 truncate",children:d.participant_nickname||"Você"}),d.is_premium&&e.jsx(Q,{}),e.jsx("span",{className:"font-normal text-green-600",children:"(você)"})]})}),e.jsx("span",{className:"text-center text-sm font-black text-green-700",children:d.score})]})]}),e.jsxs("div",{className:"overflow-hidden rounded-xl border bg-white shadow-sm",children:[e.jsxs("div",{className:"grid grid-cols-[1fr_72px] gap-2 border-b bg-gray-100 px-3 py-2 text-[10px] font-bold tracking-wide text-gray-500 uppercase",children:[e.jsx("span",{children:"Participante"}),e.jsx("span",{className:"text-center text-green-600",children:"Pontuação"})]}),p.length===0?e.jsx("div",{className:"p-6 text-center text-sm text-gray-400",children:"Nenhum participante com pontuação neste período."}):e.jsx("div",{className:"max-h-100 overflow-y-auto",children:p.map(i=>{const o=t===i.participant_id;return e.jsxs("div",{className:x("grid grid-cols-[1fr_72px] items-center gap-2 border-b px-3 py-2.5",o?"bg-green-50/60":"bg-white hover:bg-gray-50"),children:[e.jsx("div",{className:"min-w-0",children:e.jsxs("p",{className:x("flex flex-wrap items-center gap-1 text-xs font-bold",o?"text-green-800":"text-gray-800"),children:[e.jsx("span",{className:"shrink-0 text-gray-500",children:i.position&&i.position<=m?i.position===1?"🥇":i.position===2?"🥈":"🥉":`${i.position??"-"}º`}),e.jsx("span",{className:"min-w-0 truncate",children:i.participant_nickname||"Usuário"}),i.is_premium&&e.jsx(Q,{}),o&&e.jsx("span",{className:"ml-1 font-normal text-green-600",children:"(você)"})]})}),e.jsx("span",{className:"text-center text-xs font-black text-green-700",children:i.score})]},i.id)})})]}),l.length>=v&&e.jsxs("p",{className:"mt-1.5 text-center text-[10px] text-gray-400",children:["Exibindo at
2é os ",v," primeiros do ranking. Pontos já incluem as regras vigentes."]})]})}function us({onNavigate:l,onOpenAppImport:d}){const{user:t,profile:m,refreshProfile:p}=Ue(),{showToast:y}=Ve(),{getSlot:i}=Ke(),[o,D]=a.useState(null),[$,U]=a.useState(!1),[fe,je]=a.useState(!1),[Ne,V]=a.useState(!1),[K,H]=a.useState({referrerCoins:50,referredCoins:50}),[k,ve]=a.useState(()=>typeof window<"u"?!localStorage.getItem(ge):!0),W=i("ranking_footer"),ye=i("rankings_partner"),ke=i("rankings_partner_bottom"),[g,w]=a.useState("ambassador"),[we,I]=a.useState(!0),[_e,L]=a.useState(!1),[Se,_]=a.useState(!1),[Z,J]=a.useState(!1),[c,Re]=a.useState(null),[Ce,Ee]=a.useState(null),[Pe,Y]=a.useState(null),[M,X]=a.useState(null),[Ae,ee]=a.useState([]),[F,se]=a.useState(null),[ae,re]=a.useState([]),[te,ne]=a.useState(null),[ie,De]=a.useState(null),[z,Ie]=a.useState([]),[Le,oe]=a.useState(null),[Me,le]=a.useState(null),[Fe,ze]=a.useState(null),[de,Ge]=a.useState([]),[f,Be]=a.useState(""),[ce,S]=a.useState(null),[R,Oe]=a.useState(!1),[qe,xe]=a.useState(!1),[G,Te]=a.useState([]),C=a.useCallback(async()=>{if(t?.uid){I(!0),L(!0),_(!0),S(null);try{const[s,r,h]=await Promise.all([He(),We(t.uid),Ze()]);if(Re(s),w(n=>{const b=s.daily_ranking_enabled!==!1,j=s.ambassador_ranking_enabled!==!1,O=s.general_ranking_enabled!==!1;return n==="ambassador"&&!j?O?"general":b?"daily":"ambassador":n==="general"&&!O?j?"ambassador":b?"daily":"general":n==="daily"&&!b?j?"ambassador":O?"general":"daily":n}),s.daily_ranking_enabled!==!1){const n=await Je(void 0,v);X(n.period),ee(n.entries),q(t.uid,n.period.id).then(oe).catch(b=>console.error("[RankingIndicationsView] myDailyEntry:",b))}else X(null),ee([]),oe(null);const E="lrtt.11",$e=[...h.filter(n=>(n.ambassador_code??"").toLowerCase()===E),...h.filter(n=>(n.ambassador_code??"").toLowerCase()!==E)];Ge($e),I(!1);const u=r.membership?.ambassador_code||r.profileAmbassadorCode;Ee(u),(async()=>{try{const n=await Ye(void 0,v);De(n.period),Ie(n.entries),ze(await q(t.uid,n.period.id))}catch(n){console.error("[RankingIndicationsView] general ranking:",n)}finally{L(!1)}})(),u?(async()=>{try{const[n,b]=await Promise.all([Xe(u),es(u)]),j=u===P?await ss(u):null;re(n.entries),se(n.period),le(await q(t.uid,n.period.id)),Y(j?.name||(u===P?me:b?.name||b?.card_name?.trim()||null)),ne(j?.subtitle||(u===P?as:null))}catch(n){console.error("[RankingIndicationsView] ambassador ranking:",n)}finally{_(!1)}})():(re([]),se(null),le(null),Y(null),ne(null),_(!1))}catch(s){console.error("[RankingIndicationsView] loadRankingData:",s),S("Não foi possível carregar o ranking agora."),L(!1),_(!1),I(!1)}}},[t?.uid]);a.useEffect(()=>{C(),p()},[C,p]),a.useEffect(()=>{!R||G.length>0||(xe(!0),rs().then(Te).catch(s=>console.error("[RankingIndicationsView] history:",s)).finally(()=>xe(!1)))},[R,G.length]),a.useEffect(()=>{t?.uid&&(ts(t.uid).then(D),ns().then(H).catch(()=>H({referrerCoins:50,referredCoins:50})))},[t?.uid]),a.useCallback(()=>{if(!o){y("Código de convite não disponível");return}U(!0)},[o,y]);const Qe=a.useCallback(async()=>{if(!(!t?.uid||!f)){J(!0),S(null);try{await is(t.uid,f,"voluntary"),await C()}catch(s){console.error("[RankingIndicationsView] handleJoinRanking:",s),S(s instanceof Error?s.message:"Não foi possível entrar no ranking.")}finally{J(!1)}}},[C,f,t?.uid]),B=a.useMemo(()=>[...z].sort(ue).slice(0,3),[z]);return we?e.jsx("div",{className:"flex h-64 items-center justify-center",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-green-600 border-t-transparent"})}):t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"pb-4",children:[e.jsxs("div",{className:"bg-linear-to-r from-green-600 to-emerald-600 px-4 py-3 text-white",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-white/80",children:"Premiações"}),e.jsx("h3",{className:"text-xl font-black",children:"Ranking de Premiações"})]}),e.jsx("div",{className:"px-4 pt-3",children:e.jsxs("button",{onClick:()=>V(!0),className:"flex w-full items-center gap-3 rounded-xl border-2 border-amber-300/70 bg-gradient-to-r from-yellow-400 via-orange-400 to-amber-500 px-4 py-3 text-left text-white shadow-xl hover:scale-[1.02] active:scale-[0.98] transition-transform",children:[e.jsxs("div",{className:"flex shrink-0 flex-col items-center justify-center rounded-lg bg-white/30 px-2 py-1 shadow-inner",children:[e.jsx("span",{className:"text-[8px] font-black uppercase tracking-wider text-amber-100",children:"PREMIUM"}),e.jsx("span",{className:"text-base font-black leading-none text-white",children:"PRO"})]}),e.jsx("div",{className:"flex-1",children:e.jsx("p",{className:"font-black",children:"Bônus: dobre sua pontuação"})}),e.jsx("span",{className:"text-xl",children:"›"})]})}),e.jsxs("div",{className:"px-4 pt-4",children:[e.jsx(pe,{slotId:"rankings_affiliate",fallbackSlot:ye,className:"mb-4",position:"indications"}),e.jsxs("button",{onClick:d,className:"mb-4 flex w-full items-center gap-3 rounded-xl border border-indigo-200 bg-indigo-50 px-4 py-3 text-left shadow-sm transition hover:border-indigo-300 hover:bg-indigo-100 active:scale-95",children:[e.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-indigo-600 text-white",children:e.jsx("i",{className:"fa-solid fa-file-import text-sm"})}),e.jsx("span",{className:"flex-1",children:e.jsx("span",{className:"block text-sm font-black text-indigo-950",children:"Ganhe 4 pontos + Premium PRO"})}),e.jsx("i",{className:"fa-solid fa-chevron-right text-xs text-indigo-500"})]}),e.jsxs("button",{onClick:()=>l?.("rewards"),className:"mb-4 flex w-full items-center gap-3 rounded-xl bg-gradient-to-r from-blue-500 to-blue-700 p-4 text-white shadow-lg transition hover:shadow-xl active:scale-[0.98]",children:[e.jsx("span",{className:"shrink-0",children:e.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"22",cy:"22",r:"20",fill:"rgba(255,255,255,0.18)",stroke:"rgba(255,255,255,0.25)",strokeWidth:"1"}),e.jsx("path",{d:"M10 23 Q10 35 22 36 Q34 35 34 23 Z",fill:"#FDE68A"}),e.jsx("path",{d:"M12 23 Q12 33 22 34 Q32 33 32 23 Z",fill:"#FEF3C7",fillOpacity:"0.35"}),e.jsx("rect",{x:"8",y:"19",width:"28",height:"6",rx:"3",fill:"#FBBF24"}),e.jsx("rect",{x:"8",y:"19",width:"28",height:"3",rx:"1.5",fill:"#FDE68A"}),e.jsx("path",{d:"M10 21 Q5 21 5 25.5 Q5 30 10 30",stroke:"#F59E0B",strokeWidth:"2.5",strokeLinecap:"round",fill:"none"}),e.jsx("path",{d:"M34 21 Q39 21 39 25.5 Q39 30 34 30",stroke:"#F59E0B",strokeWidth:"2.5",strokeLinecap:"round",fill:"none"}),e.jsx("path",{d:"M22 9 L23.1 12.2 L26.5 12.4 L24 14.5 L24.9 17.8 L22 16 L19.1 17.8 L20 14.5 L17.5 12.4 L20.9 12.2 Z",fill:"#FDE68A"}),e.jsx("circle",{cx:"14",cy:"14",r:"1.5",fill:"#FDE68A"}),e.jsx("circle",{cx:"30",cy:"15",r:"1.5",fill:"#FDE68A"}),e.jsx("ellipse",{cx:"16",cy:"29",rx:"2",ry:"4",fill:"rgba(255,255,255,0.18)",transform:"rotate(-15 16 29)"})]})}),e.jsx("div",{className:"text-left",children:e.jsx("p",{className:"font-black",children:"Pote da Comunidade! Ganhe figurinhas!"})}),e.jsx("span",{className:"ml-auto text-2xl",children:"›"})]}),e.jsxs("div",{className:"mb-4 overflow-hidden rounded-xl border bg-white shadow-sm",children:[e.jsxs("button",{onClick:()=>{ve(!k),k&&localStorage.setItem(ge,"1")},className:"flex w-full items-center justify-between p-4 text-left",children:[e.jsx("h4",{className:"text-sm font-black text-gray-800",children:g==="daily"?"⚡ Como funciona o Ranking Diário":g==="ambassador"?"🏅 Como funciona o Ranking do Embaixador":"🏆 Como funciona o Ranking Geral"}),e.jsx("i",{className:x("fa-solid fa-chevron-down text-gray-400 transition-transform",k&&"rotate-180")}
2)]}),k&&e.jsx("div",{className:"border-t px-4 pb-4",children:g==="daily"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mt-3 rounded-xl border border-amber-300 bg-amber-50 p-3",children:[e.jsx("p",{className:"text-center text-xs font-black text-amber-800",children:"⚡ Compete todos os dias pelo prêmio do dia!"}),e.jsx("p",{className:"mt-1 text-center text-xs text-amber-700",children:"Indique amigos, acumule pontos e lidere o ranking até às 23:59."})]}),e.jsx("div",{className:"mt-3 rounded-xl border border-purple-300 bg-gradient-to-br from-purple-50 to-pink-50 p-3",children:e.jsxs("p",{className:"text-xs text-purple-800",children:[e.jsx("span",{className:"mr-1",children:"👑"}),e.jsx("strong",{className:"font-black text-purple-900",children:"Importação concluída"})," conta como"," ",e.jsx("strong",{className:"font-black text-pink-700",children:"4 pts nos rankings"})," e libera Premium Pro para os dois usuários."]})}),e.jsxs("div",{className:"mt-4 space-y-2 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"font-bold text-green-600",children:"1."}),e.jsxs("p",{children:[e.jsx("strong",{children:"Indique amigos"})," usando seu código de convite"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"font-bold text-green-600",children:"2."}),e.jsxs("p",{children:[e.jsx("strong",{children:"O amigo precisa:"})," engajar com o app no período para a indicação gerar pontuação"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"font-bold text-green-600",children:"3."}),e.jsxs("p",{children:["Ranking ",e.jsx("strong",{children:"fecha às 23:59"})," — novo período começa à meia-noite"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"font-bold text-green-600",children:"4."}),e.jsxs("p",{children:[e.jsx("strong",{children:"🚀 Quer mais indicações?"})," Mande seu link em grupos de WhatsApp, poste nas redes sociais e indique para amigos! Quanto mais divulgar, mais chances de vencer!"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"font-bold text-green-600",children:"5."}),e.jsxs("p",{children:[e.jsx("strong",{children:"Quer ainda mais indicações?"})," Quando for trocar com alguém que usa outro app, convide para importar o álbum para nosso app e ganhe 4 pts no ranking. Facilita a troca e ainda concorre a prêmios."]})]})]}),e.jsxs("div",{className:"mt-4 rounded-xl border-2 border-amber-400 bg-amber-50 p-4 text-center",children:[e.jsx("p",{className:"text-xs font-bold tracking-wide text-amber-700 uppercase",children:"🏆 Prêmio Diário — 1° lugar"}),e.jsx("p",{className:"text-lg font-black text-amber-800",children:"10 pacotes = 70 figurinhas"}),e.jsx("p",{className:"mt-1 text-[11px] text-amber-600",children:"Apenas o 1° lugar é premiado por dia. É obrigatório ter pontuação no período."})]}),e.jsx("p",{className:"mt-2 text-[11px] text-gray-500",children:"Critério de desempate: premium ativo, mais vídeos assistidos para o pote da comunidade e, por fim, quem alcançou a marca primeiro."})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-3 rounded-xl border border-blue-200 bg-blue-50 p-3 text-center",children:e.jsxs("p",{className:"text-xs font-bold text-blue-700",children:["📅 Ranking ",c?.period_type==="weekly"?"Semanal":"Mensal"," · Fecha dia"," ",c?.closing_day??25]})}),e.jsx("div",{className:"mt-3 rounded-xl border border-purple-300 bg-gradient-to-br from-purple-50 to-pink-50 p-3",children:e.jsxs("p",{className:"text-xs text-purple-800",children:[e.jsx("span",{className:"mr-1",children:"👑"}),e.jsx("strong",{className:"font-black text-purple-900",children:"Importação concluída"})," conta como"," ",e.jsx("strong",{className:"font-black text-pink-700",children:"4 pts nos rankings"})," e libera Premium Pro para os dois usuários."]})}),e.jsxs("div",{className:"mt-4 space-y-2 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600",children:"1."}),e.jsxs("p",{children:[e.jsx("strong",{children:"Indique amigos"})," para usar o app usando seu código de convite"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600",children:"2."}),e.jsx("p",{children:e.jsx("strong",{children:"O amigo indicado precisa ser um usuário ativo no app"})})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600",children:"3."}),e.jsxs("p",{children:[e.jsx("strong",{children:"Suba no ranking"})," e conquiste benefícios exclusivos!"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600",children:"4."}),e.jsxs("p",{children:[e.jsx("strong",{children:"🚀 Quer mais indicações?"})," Mande seu link em grupos de WhatsApp, poste nas redes sociais e indique para amigos! Quanto mais divulgar, mais chances de vencer!"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600",children:"5."}),e.jsxs("p",{children:[e.jsx("strong",{children:"Quer ainda mais indicações?"})," Quando for trocar com alguém que usa outro app, convide para 
2importar o álbum para nosso app e ganhe 4 pts no ranking. Facilita a troca e ainda concorre a prêmios."]})]})]}),g==="ambassador"?e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"mb-2 text-xs font-black text-gray-700 uppercase",children:"🏅 Prêmio do Ranking Embaixador (1° lugar)"}),e.jsx("div",{className:"overflow-hidden rounded-xl border",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b bg-gray-100 text-[10px] font-bold text-gray-500 uppercase",children:[e.jsx("th",{className:"px-3 py-2 text-left",children:"Usuários ativos"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Figurinhas (1º lugar)"})]})}),e.jsx("tbody",{children:os.filter(s=>s.prizes>0).map(s=>e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsx("td",{className:"px-3 py-1.5 text-gray-600",children:s.max===1/0?`${s.min}+`:`${s.min}–${s.max}`}),e.jsxs("td",{className:"px-3 py-1.5 font-black text-green-700",children:[A(s.prizes)," figurinhas"]})]},s.key))})]})}),e.jsx("p",{className:"mt-2 text-[11px] text-gray-500",children:"Critério de desempate: premium ativo, mais vídeos assistidos para o pote da comunidade e, por fim, quem alcançou a marca primeiro."})]}):e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"mb-2 text-center text-xs font-bold text-purple-700",children:"🏆 Prêmios — Ranking Geral"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center text-xs",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-purple-600",children:"🥇 1º"}),e.jsx("p",{className:"font-black text-purple-700",children:N(c?.prize_general_1st,40)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-purple-600",children:"🥈 2º"}),e.jsx("p",{className:"font-black text-purple-700",children:N(c?.prize_general_2nd,30)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-purple-600",children:"🥉 3º"}),e.jsx("p",{className:"font-black text-purple-700",children:N(c?.prize_general_3rd,20)})]})]})]})]})})]}),ce&&e.jsx("div",{className:"mb-4 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm font-bold text-red-600",children:ce}),e.jsxs("div",{className:"mb-3 flex overflow-hidden rounded-xl border bg-white shadow-sm",children:[c?.daily_ranking_enabled===!0&&e.jsx("button",{onClick:()=>w("daily"),className:x("flex-1 py-3 text-xs font-bold transition",g==="daily"?"bg-green-600 text-white":"text-gray-500 hover:bg-gray-50"),children:"⚡ Diário"}),c?.ambassador_ranking_enabled!==!1&&e.jsx("button",{onClick:()=>w("ambassador"),className:x("flex-1 py-3 text-xs font-bold transition",g==="ambassador"?"bg-green-600 text-white":"text-gray-500 hover:bg-gray-50"),children:"🏅 Embaixador"}),c?.general_ranking_enabled!==!1&&e.jsx("button",{onClick:()=>w("general"),className:x("flex-1 py-3 text-xs font-bold transition",g==="general"?"bg-green-600 text-white":"text-gray-500 hover:bg-gray-50"),children:"🏆 Geral"})]}),g==="daily"?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-xl border bg-white p-4 shadow-sm",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold tracking-wide text-green-600 uppercase",children:"Primeira aba"}),e.jsx("h2",{className:"text-xl font-black text-gray-800",children:"Ranking Diário de Indicações"}),e.jsxs("p",{className:"mt-1 text-sm text-gray-500",children:["Fecha às 23:59 de Brasília",M?` · período ${new Date(`${M.period_start}T12:00:00`).toLocaleDateString("pt-BR")} a ${new Date(`${M.period_end}T12:00:00`).toLocaleDateString("pt-BR")}`:""]})]}),e.jsxs("div",{className:"rounded-xl border border-amber-300 bg-amber-50 px-4 py-2 text-center",children:[e.jsx("p",{className:"text-[10px] font-bold tracking-wide text-amber-700 uppercase",children:"Prêmio do dia"}),e.jsx("p",{className:"text-sm font-black text-amber-800",children:"10 pacotes = 70 figurinhas"})]})]})}),e.jsx(T,{entries:Ae,myEntry:Le,currentUserId:t?.uid,rewardedPositions:1})]}):g==="ambassador"?Se?e.jsx(he,{label:"Carregando ranking do embaixador..."}):Ce&&F?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-xl border bg-white p-4 shadow-sm",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs font-bold tracking-wide text-green-600 uppercase",children:F.ambassador_code===P?"Ranking agrupado":"Ranking do embaixador"}),e.jsx("h2",{className:"mt-1 text-xl font-black text-gray-800",children:Pe||me}),te&&e.jsx("p",{className:"mt-1 text-[11px] text-gray-400",children:te}),e.jsxs("p",{className:"mt-1 text-sm text-gray-500",children:["Fecha em ",new Date(`${F.period_end}T12:00:00`).toLocaleDateString("pt-BR")]})]}),(()=>{const s=ls(ae),r=ds(s),h=cs(s),E=h?Math.min(100,(s-r.min)/Math.max(1,h.min-r.min)*100):100;return e.jsxs("div",{className:"min-w-52 rounded-xl border-2 border-yellow-400 bg-yellow-50 px-4 py-2 text-center",children:[e.jsxs("p",{className:"text-xs font-bold text-yellow-700",children:[r.emoji," ",r.name]}),e.jsx("p",{className:"text-sm font-black text-yellow-600",children:r.prizes>0?`1° ganha ${A(r.prizes)} figurinhas`:"Premiação destrava com 1 ponto"}),e.jsxs("p",{className:"text-[10px] text-yellow-600/70",children:[s," participante(s) pontuando"]}),h&&r.prizes>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-2 h-1.5 rounded-full bg-yellow-200",children:e.jsx("div",{className:"h-1.5 rounded-full bg-gradient-to-r from-yellow-400 to-orange-400",style:{width:`${E}%`}})}),e.jsxs("p",{className:"mt-1 text-[10px] text-yellow-700",children:["Faltam ",Math.max(0,h.min-s)," para ",A(h.prizes)," ","figurinhas"]})]})]})})()]})}),e.jsx(T,{entries:ae,myEntry:Me,currentUserId:t?.uid,rewardedPositions:1})]}):e.jsxs("div",{className:"rounded-xl border bg-white p-6 shadow-sm",children:[e.jsx("div",{className:"mb-4 text-center text-4xl",children:"📣"}),e.jsx("h2",{className:"text-center text-xl font-black text-gray-800",children:"Entrar no ranking dos embaixadores"}),e.jsx("p",{className:"mt-2 text-center text-sm text-gray-500",children:"Escolha o ranking de embaixadores para concorrer à premiação vigente do período."}),de.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-4 grid gap-3",children:de.map(s=>e.jsxs("button",{onClick:()=>Be(s.ambassador_code||""),className:x("flex items-center gap-3 rounded-xl border-2 p-4 text-left transition",f===s.ambassador_code?"border-green-500 bg-green-50":"border-gray-200 bg-white hover:border-gray-300"),children:[e.jsx("div",{className:"h-12 w-12 shrink-0 overflow-hidden rounded-full",children:s.photo_url?e.jsx("img",{src:s.photo_url,alt:s.name,className:"h-full w-full object-cover"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-linear-to-br from-green-500 to-emerald-600 text-xl text-white",children:"📣"})}),e.jsx("div",{children:e.jsx("p",{className:"font-black text-gray-800",children:s.card_name||s.name})}),f===s.ambassador_code&&e.jsx("span",{className:"ml-auto text-green-600",children:"✓"})]},s.ambassador_code))}),e.jsx("button",{disabled:!f||Z,onClick:()=>void Qe(),className:"mt-4 w-full rounded-xl bg-linear-to-r from-green-600 to-emerald-600 py-3 text-sm font-black text-white disabled:opacity-60",children:Z?"Entrando...":"Entrar no ranking"})]}):e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Nenhum embaixador disponível no momento."}),e.jsxs("button",{onClick:()=>l?.("ambassadors"),className:"mt-3 inline-flex items-center gap-2 rounded-xl border border-green-200 bg-green-50 px-4 py-2 text-sm font-bold text-green-700 transition hover:bg-green-100",children:[e.jsx("i",{className:"fa-solid fa-users text-xs"}),"Ver embaixadores"]})]})]}):_e?e.jsx(he,{label:"Carregando ranking geral..."}):e.jsxs("div",{className:"space-y-4",children:[B.length>0&&e.jsx("div",{className:"grid grid-cols-3 gap-2",children:B.map((s,r)=>e.jsxs("div",{className:x("rounded-xl border p-4 text-center shadow-sm",r===0?"border-yellow-400 bg-yellow-50":r===1?"border-gray-300 bg-gray-50":"border-orange-300 bg-orange-50"),children:[e.jsx("div",{className:"text-3xl",children:r===0?"🥇":r===1?"🥈":"🥉"}),e.jsx("p",{className:"mt-2 font-black text-gray-800",children:s.participant_nickname||"Usuário"}),s.is_premium&&e.jsx(Q,{className:"mt-1 justify-center"}),e.jsxs("p",{className:"text-sm text-gray-500",children:[s.score," pts"]}),e.jsx("p",{className:"mt-1 text-xs font-bold text-green-600",children:r===0?N(c?.prize_general_1st,40):r===1?N(c?.prize_general_2nd,30):N(c?.prize_general_3rd,20)})]},s.id))}),B.length===0&&e.jsx("div",{className:"rounded-xl border border-dashed bg-white p-4 text-center text-sm text-gray-500 shadow-sm",children:"Ainda não há indicadores no ranking geral."}),e.jsxs("div",{className:"rounded-xl border bg-white p-4 shadow-sm",children:[e.jsx("div",{className:"mb-3 flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h2",{className:"font-black text-gray-800",children:"Classificação Geral"}),e.jsxs("p",{className:"text-sm text-gray-500",children:["Fecha em"," ",ie?new Date(`${ie.period_end}T12:00:00`).toLocaleDateString("pt-BR"):"-"]})]})}),e.jsx(T,{entries:z,myEntry:Fe,currentUserId:t?.uid})]})]}),e.jsx(pe,{slotId:"rankings_affiliate_bottom",fallbackSlot:ke,className:"mt-5",position:"indications"}),(()=>{const s=G.filter(r=>r.ranking_type==="daily_referral").slice(0,15);return e.jsxs("div",{className:"mt-5 overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",children:[e.jsxs("button",{onClick:()=>Oe(r=>!r),className:"flex w-full items-center justify-between px-4 py-3 text-left",children:[e.jsx("span",{className:"text-xs font-black tracking-wide text-gray-600 uppercase",children:"🏆 Vencedores anteriores"}),e.jsx("i",{className:x("fa-solid fa-chevron-down text-xs text-gray-400 transition-transform",R&&"rotate-180")}
2)]}),R&&e.jsx("div",{className:"border-t",children:qe?e.jsxs("div",{className:"flex items-center justify-center gap-2 py-4 text-xs text-gray-400",children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-green-500 border-t-transparent"}),"Carregando histórico…"]}):s.length===0?e.jsx("p",{className:"py-4 text-center text-xs text-gray-400",children:"Nenhum período encerrado ainda."}):e.jsx("div",{className:"divide-y",children:s.map(r=>e.jsx("div",{className:"px-4 py-3",children:r.prize_delivered?e.jsxs("div",{className:"space-y-1",children:[(r.validated_winner_1st_name??r.winner_1st_name)&&e.jsxs("p",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{children:"🥇"}),e.jsx("span",{className:"font-bold text-gray-800 truncate",children:r.validated_winner_1st_name??r.winner_1st_name}),r.prize_1st&&e.jsx("span",{className:"ml-auto shrink-0 text-[10px] font-semibold text-green-700",children:r.prize_1st.replace(" + "," = ").replace(" de figurinhas","")})]}),e.jsxs("p",{className:"flex items-center gap-1 text-[10px] font-semibold text-green-600",children:[e.jsx("i",{className:"fa-solid fa-circle-check"}),"Premiação já entregue!"]})]}):e.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-amber-600",children:[e.jsx("i",{className:"fa-solid fa-hourglass-half"}),"Apuração das indicações em andamento, vencedor em breve"]})},r.id))})})]})})(),e.jsxs("div",{className:"mt-5 rounded-xl border border-gray-200 bg-gray-50 p-3",children:[e.jsx("p",{className:"mb-1 text-[10px] font-bold uppercase tracking-wide text-gray-500",children:"⚠️ Regras e Elegibilidade"}),e.jsxs("p",{className:"text-[11px] leading-relaxed text-gray-500",children:["Para concorrer a benefícios e experiências exclusivas do programa, é obrigatório ter ao menos 1 (um) ponto no período vigente. Participantes sem pontuação não são elegíveis a qualquer benefício, mesmo que constem no ranking. Resultados suspeitos de irregularidades ou fraude serão automaticamente anulados após análise interna, sem direito a recurso. Rankings de Embaixadores com menos de 100 participantes ou baixa pontuação total poderão ser agrupados com outros grupos para otimização da campanha. As recompensas consistem em itens colecionáveis e/ou benefícios exclusivos do programa, conforme disponibilidade de estoque e critérios vigentes. Regras completas disponíveis em"," ",e.jsx("strong",{className:"font-semibold",children:"Configurações → Regras das Premiações"}),"."]})]}),e.jsx("p",{className:"mt-2 text-center text-[10px] leading-relaxed text-gray-400",children:"⚠️ Este app é independente e não é afiliado, patrocinado ou endossado por marcas, editoras, federações ou entidades esportivas de terceiros. A Apple Inc. não é patrocinadora nem organizadora de quaisquer concursos ou resgates oferecidos no app."})]})]}),W?.enabled&&e.jsx("div",{className:"border-t border-gray-200 bg-white",children:e.jsx(xs,{slot:W,maxHeight:100,className:"w-full"})}),$&&o&&e.jsx(ms,{open:$,onClose:()=>U(!1),variant:"rank",title:"Ganhe figurinhas no ranking",description:"Cada amigo que entrar pelo seu link conta nos rankings de premiação.",ctx:{code:o,nickname:m?.username||m?.displayName||t?.displayName||void 0,referrerCoins:K.referrerCoins,referredCoins:K.referredCoins},onToast:y}),fe&&e.jsx(a.Suspense,{fallback:null,children:e.jsx(ps,{onClose:()=>je(!1)})}),Ne&&e.jsx(a.Suspense,{fallback:null,children:e.jsx(gs,{feature:"Bônus: dobre sua pontuação",description:"Tenha o Premium Pro ativo no momento em que a indicação pontua e ganhe 2 pontos por indicação. Pontuação dobrada!",benefits:["🚫 Remove anúncios do app","🏆 Benefícios nos rankings de premiações","⭐ Aparece no topo na lista de usuários disponíveis para troca","🔍 Filtros avançados de troca"],icon:"",onDismiss:()=>V(!1)})})]}):e.jsx("div",{className:"p-4",children:e.jsxs("div",{className:"rounded-xl border bg-white p-6 text-center shadow-sm",children:[e.jsx("div",{className:"mb-2 text-4xl",children:"🏆"}),e.jsx("h1",{className:"text-xl font-black text-gray-800",children:"Ranking e Prêmios"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Faça login para acompanhar o ranking geral e o ranking dos embaixadores."})]})})}export{us 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.