1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6534],{86534:function(e,t,l){l.r(t),l.d(t,{default:function(){return f}});var s=l(57437),a=l(65243),i=l(16991),n=l(85946),r=l(76437),o=l(2265),d=l(9391),c=l(45155),x=l(24797),h=l(97927),m=l(34446);let u={hidden:{opacity:0,scale:.95,y:-10,transformOrigin:"top right"},visible:{opacity:1,scale:1,y:0,transition:{duration:.2,ease:[.4,0,.2,1],staggerChildren:.05,delayChildren:.1}},exit:{opacity:0,scale:.95,y:-10,transition:{duration:.15,ease:[.4,0,1,1]}}},p={hidden:{opacity:0,x:-10,transition:{duration:.1}},visible:{opacity:1,x:0,transition:{duration:.2,ease:[.4,0,.2,1]}}},v={hidden:{opacity:0},visible:{opacity:1,transition:{duration:.2,ease:"easeOut"}},exit:{opacity:0,transition:{duration:.15,ease:"easeIn"}}};var g=e=>{let{code:t,success:l}=e,[a,i]=(0,o.useState)(!1),n=async(e,s)=>{e.stopPropagation();let a=window.location.origin,n="link"===s?"".concat(a,"/login?referralCode=").concat(t):t;await navigator.clipboard.writeText(n),l("".concat("link"===s?"Link":"Refferal Code"," copied")),i(!1)};return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"rounded-lg lg:p-4 p-2 text-white",children:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"flex justify-between items-center",children:(0,s.jsx)(h.E.button,{type:"button",title:"Copy options",onClick:e=>{e.stopPropagation(),i(!a)},className:"p-1 bg-transparent",whileHover:{scale:1.05},whileTap:{scale:.95},children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16",className:"w-5 h-5 text-purple hover:text-purple",children:(0,s.jsx)("g",{opacity:"0.5",children:(0,s.jsx)("path",{d:"M6 12C5.63333 12 5.31944 11.8695 5.05833 11.6083C4.79722 11.3472 4.66667 11.0333 4.66667 10.6667V2.66668C4.66667 2.30001 4.79722 1.98612 5.05833 1.72501C5.31944 1.4639 5.63333 1.33334 6 1.33334H12C12.3667 1.33334 12.6806 1.4639 12.9417 1.72501C13.2028 1.98612 13.3333 2.30001 13.3333 2.66668V10.6667C13.3333 11.0333 13.2028 11.3472 12.9417 11.6083C12.6806 11.8695 12.3667 12 12 12H6ZM6 10.6667H12V2.66668H6V10.6667ZM3.33333 14.6667C2.96667 14.6667 2.65278 14.5361 2.39167 14.275C2.13056 14.0139 2 13.7 2 13.3333V4.00001H3.33333V13.3333H10.6667V14.6667H3.33333Z",className:"fill-current"})})})})})})}),(0,s.jsx)(m.M,{children:a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.E.div,{variants:v,initial:"hidden",animate:"visible",exit:"exit",className:"fixed inset-0 bg-black/20 dark:bg-black/40 backdrop-blur-sm z-40",onClick:e=>{e.preventDefault(),e.stopPropagation(),i(!1)}}),(0,s.jsx)(h.E.div,{variants:u,initial:"hidden",animate:"visible",exit:"exit",className:"absolute right-0 mt-2 bg-white dark:bg-[#1A1B1E] rounded-lg shadow-lg overflow-hidden z-50 min-w-[180px]",style:{transform:"translateX(calc(-100% + 24px))",top:"100%"},children:(0,s.jsxs)("div",{className:"py-1",children:[(0,s.jsxs)(h.E.button,{variants:p,type:"button",title:"Copy code only",onClick:e=>n(e,"code"),className:"w-full px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 flex items-center gap-2 transition-colors",whileHover:{x:4},whileTap:{scale:.98},children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),(0,s.jsx)("span",{children:"Copy Code Only"})]}),(0,s.jsxs)(h.E.button,{variants:p,type:"button",title:"Open link in new tab",onClick:e=>n(e,"link"),className:"w-full px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 flex items-center gap-2 transition-colors",whileHover:{x:4},whileTap:{scale:.98},children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),(0,s.jsx)("span",{children:"Copy as Link"})]})]})})]})})]})},b=l(87766),j=l(96044);let w=e=>{let{onLoadMore:t}=e,{ref:l,inView:a}=(0,j.YD)({threshold:1,triggerOnce:!1});return(0,o.useEffect)(()=>{a&&t()},[a]),(0,s.jsx)("div",{ref:l,className:"h-1 w-full"})};function f(){var e;let{user:t,refetchUser:l}=(0,d.a)(),{ready:h}=(0,r.rB)(),{alert:m,success:u}=(0,a.kC)(),[p,v]=(0,o.useState)(!1),[j,f]=(0,o.useState)(null),[y,N]=(0,o.useState)(!1),[k,C]=(0,o.useState)([]),[M,S]=(0,o.useState)(1),[B,E]=(0,o.useState)([]),[L,H]=(0,o.useState)(1),{getReferral:R,getCurrentReferralTvl:V,claimReferralReward:F,getDeeperReferrals:A}=(0,n.n)(),[O,T]=(0,o.useState)(0),_=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M,t=await R(e,20);C(e=>Array.from(new Set([...e,...t])))},D=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L,l=await A(e,t,20);E(e=>(0,x.uw)([...e,...l],"id"))},I=async()=>{await l(),C([]),E([]),S(1),H(1),await _(1),await D(null==t?void 0:t.id,1),T(await V())},P=async e=>{if(!p){v(!0),f(e);try{await F(e)&&N(!0)}catch(e){m("Claim failed")}finally{v(!1),f(null)}}},Z=()=>{l(),N(!1)};return(0,o.useEffect)(()=>{h&&(null==t?void 0:t.id)&&(l(),_(),D(t.id),V().then(T))},[h,null==t?void 0:t.id]),(0,s.jsx)(b.Z,{isPullable:!0,onRefresh:I,children:(0,s.jsxs)(i.W,{children:[(0,s.jsxs)("div",{className:"col-start-1 col-end-13 sm:col-start-2 sm:col-end-12 grid grid-cols-12",children:[(0,s.jsx)("div",{className:"col-start-1 col-span-12 lg:col-start-4 lg:col-span-6 mb-2",children:(0,s.jsx)("h1",{className:"text-white text-3xl font-bold text-center mb-6",children:"AFFILIATE PROGRAM"})}),(0,s.jsx)("div",{className:"col-start-1 col-span-12 lg:col-start-4 lg:col-span-6 gap-2 px-8 py-8 bg-lightpurple roun
1ded-[16px]",children:(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{className:"w-full mb-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("div",{className:"text-white font-semibold text-lg ",children:"Your Referrer Bonus"}),(0,s.jsx)(c.default,{tvl:(null==t?void 0:t.rank)||0,label:"Current Star:",rank:!0})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center p-2 py-2 gap-2 w-100 lg:h-16 md:h-16 h-16 dark:bg-white/10 bg-black/10 rounded-[10px]",children:[(0,s.jsx)("div",{className:"flex items-center gap-0 p-2",children:(0,s.jsxs)("span",{className:"text-white lg:text-lg text-base pl-1",children:[(null==t?void 0:t.totalBonus)?null==t?void 0:t.totalBonus.toLocaleString():0," DCAI"]})}),(0,s.jsx)("div",{className:"px-2 py-2",children:(0,s.jsx)(a.KM,{disabled:p||!(null==t?void 0:t.totalBonus),onClick:()=>{!p&&(null==t?void 0:t.totalBonus)&&P(0)},className:"bg-purple lg:w-50 md:w-30 w-30 lg:text-md md:text-md text-sm text-black rounded-[70px] font-bold lg:px-3 px-2 py-2",children:"Claim"})})]})]}),(0,s.jsxs)("div",{className:"w-full mb-2",children:[(0,s.jsx)("div",{className:"block text-white mb-3",children:"Refer and Earn"}),(0,s.jsxs)("div",{className:"flex justify-between items-center text-white p-2 gap-2 w-full lg:h-16 md:h-16 h-16 dark:bg-white/10 bg-black/10 rounded-[10px]",children:[(0,s.jsx)("div",{className:"ml-2 truncate",children:(null==t?void 0:t.referralCode)||"No code"}),(0,s.jsx)("div",{className:"flex items-center gap-2",children:(0,s.jsx)(g,{code:(null==t?void 0:t.referralCode)||"",success:u})})]})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("div",{className:"h-px bg-gray-700 w-full py-1"}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2 border-b border-white",children:[(0,s.jsx)("div",{className:"text-gray-400 font-semibold text-sm ",children:"My Referrals"}),(0,s.jsx)(c.default,{tvl:O,label:"Current TVL:"})]}),(0,s.jsx)("div",{className:"h-px bg-gray-700 w-full mb-2"}),(0,s.jsx)("div",{className:"max-h-[500px] overflow-y-auto px-3 rounded-md scrollbar-thin scrollbar-thumb-white/20",children:k.length>0?(0,s.jsxs)(s.Fragment,{children:[k.map((e,t)=>(0,s.jsx)("div",{className:"text-white text-sm",children:(0,x.R1)(e,!0)},t)),(0,s.jsx)(w,{onLoadMore:()=>{let e=M+1;S(e),_(e)}})]}):(0,s.jsx)("div",{className:"text-gray-500 text-sm",children:"No referrals yet"})})]})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2 border-b border-white",children:(0,s.jsx)("div",{className:"text-gray-400 font-semibold text-sm mb-2",children:"My Group Network"})}),(0,s.jsx)("div",{className:"h-px bg-gray-700 w-full py-1"}),(0,s.jsx)("div",{className:"max-h-[500px] overflow-y-auto px-3 rounded-md scrollbar-thin scrollbar-thumb-white/20",children:B.length>0?(0,s.jsxs)(s.Fragment,{children:[B.map((e,t)=>(0,s.jsx)("div",{className:"text-white text-sm",children:(0,x.R1)(e.wallet||e.name||e.username,!0)},t)),(0,s.jsx)(w,{onLoadMore:()=>{let e=L+1;H(e),D(null==t?void 0:t.id,e)}})]}):(0,s.jsx)("div",{className:"text-gray-500 text-sm",children:"No descendent yet"})})]})]})})]}),y&&(0,s.jsx)(a.u_,{onClose:Z,backgroundColor:"transparent",children:(0,s.jsx)(a.u_.Body,{children:(0,s.jsxs)("div",{className:"bg-[#8349FF] w-[390px] h-[288px] rounded-[16px] flex flex-col items-center justify-center text-white",children:[(0,s.jsx)("h3",{className:"text-2xl font-semibold mb-4",children:"Success!"}),(0,s.jsxs)("p",{className:"text-lg mb-8",children:["You have collected ",(null==t?void 0:null===(e=t.totalBonus)||void 0===e?void 0:e.toLocaleString())||0," DCAI"]}),(0,s.jsx)("button",{onClick:Z,className:"px-8 py-2 bg-white/20 hover:bg-white/30 rounded-full",children:"Done"})]})})})]})})}}}]);
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.