PageSourceSearch

https://www.resida.app/_next/static/chunks/7727.75a5ad248616050f.js

js resida.app collected 2026-10-02 01:16:02 UTC 17,146 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3575,7727],{17727:(e,t,a)=>{a.r(t),a.d(t,{default:()=>_});var s=a(95155),l=a(12115),r=a(5917),n=a(75426),i=a(17181),c=a(23327),d=a(91169),o=a(1524),x=a(26983),m=a(78435),p=a(35299),h=a(6132),u=a(60709),g=a(65229),b=a(24924),f=a(43575),y=a(5218);let j=e=>new Intl.NumberFormat("en-NG",{style:"currency",currency:"NGN",minimumFractionDigits:0,maximumFractionDigits:0}).format(null!=e?e:0),v=e=>e?new Date(e).toLocaleDateString("en-NG",{day:"numeric",month:"short",year:"numeric"}):"",N={pending:{dot:"bg-clay-400",text:"text-clay-700",bg:"bg-clay-50",label:"Pending"},registered:{dot:"bg-[#99C0FF]",text:"text-[#0039B5]",bg:"bg-[#EBF1FF]",label:"Registered"},kyc_pending:{dot:"bg-amber-400",text:"text-amber-700",bg:"bg-amber-50",label:"KYC pending"},converted:{dot:"bg-indigo-400",text:"text-indigo-700",bg:"bg-indigo-50",label:"Converted"},rewarded:{dot:"bg-sage-400",text:"text-sage-700",bg:"bg-sage-50",label:"Rewarded"}},w={pending:{dot:"bg-clay-400",text:"text-clay-700",bg:"bg-clay-50",label:"In hold"},available:{dot:"bg-sage-400",text:"text-sage-700",bg:"bg-sage-50",label:"Available"},used:{dot:"bg-[#99C0FF]",text:"text-[#0039B5]",bg:"bg-[#EBF1FF]",label:"Used"},expired:{dot:"bg-gray-300",text:"text-gray-500",bg:"bg-gray-50",label:"Expired"},reversed:{dot:"bg-rose-400",text:"text-rose-700",bg:"bg-rose-50",label:"Reversed"}},F={referral_bonus:"Referral bonus",rent_cashback:"Rent savings cashback",redemption:"Applied to payment",adjustment:"Admin adjustment",reversal:"Reversal"};function k(e){let{status:t,map:a=N}=e,l=a[t]||a.pending;return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold ".concat(l.text," ").concat(l.bg),children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full ".concat(l.dot)}),l.label]})}function A(e){let{active:t,onClick:a,children:l}=e;return(0,s.jsx)("button",{onClick:a,className:"flex-1 py-2.5 text-xs font-semibold border-b-2 transition-colors ".concat(t?"border-[#0052FF] text-[#0039B5]":"border-transparent text-gray-400 hover:text-gray-700"),children:l})}function S(e){var t,a,u,g;let{open:y}=e,[N,w]=(0,l.useState)(null),[F,A]=(0,l.useState)([]),[S,C]=(0,l.useState)(0),[_,R]=(0,l.useState)(1),[E,B]=(0,l.useState)(!0),[I,T]=(0,l.useState)(""),[D,P]=(0,l.useState)(null),[M,O]=(0,l.useState)(""),[U,J]=(0,l.useState)(!1),[Z,z]=(0,l.useState)(!1),[G,K]=(0,l.useState)(""),[L,Y]=(0,l.useState)(""),[W,q]=(0,l.useState)(""),$=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;B(!0),T("");try{var t,a,s;let[l,r]=await Promise.all([(0,b.t0r)(),(0,b.xNT)({page:e,limit:10})]);w(null!=(t=null==l?void 0:l.data)?t:l);let n=null!=(a=null==r?void 0:r.data)?a:r;A(Array.isArray(n)?n:[]),C(null!=(s=null==r?void 0:r.total)?s:0),R(e)}catch(e){T("Failed to load referral data.")}finally{B(!1)}},[]);(0,l.useEffect)(()=>{y&&($(1),(0,b.Lpk)().then(e=>{var t;let a=null!=(t=null==e?void 0:e.data)?t:e;P((null==a?void 0:a.referral_code)||null),O((null==a?void 0:a.share_url)||"")}).catch(()=>{}))},[y,$]);let H=()=>{(0,f.ZA)({entityType:"referral",channel:"copy"}),navigator.clipboard.writeText(M).then(()=>{J(!0),setTimeout(()=>J(!1),2e3)}).catch(()=>{})},Q=async e=>{if(e.preventDefault(),Y(""),q(""),!G.trim())return void Y("Email is required");z(!0);try{await (0,b.uoc)({referred_email:G.trim(),referral_type:"tenant"}),q("Invite sent to ".concat(G.trim(),".")),K(""),$(1)}catch(e){var t,a;Y((null==e||null==(a=e.response)||null==(t=a.data)?void 0:t.detail)||"Failed to send invite.")}finally{z(!1)}};return(0,s.jsxs)("div",{children:[D&&(0,s.jsxs)("div",{className:"m-4 bg-[#1F1F1F] rounded-[28px] p-4 text-white",children:[(0,s.jsx)("p",{className:"text-[10px] font-semibold text-blue-300 uppercase tracking-wider mb-1",children:"Your referral link"}),(0,s.jsx)("p",{className:"text-[11px] text-white/60 mb-3",children:"Earn ₦1,000 reward credit for every friend who joins and verifies their identity."}),(0,s.jsxs)("div",{className:"bg-white/10 rounded-xl px-3 py-2.5 flex items-center justify-between gap-2 mb-3",children:[(0,s.jsx)("p",{className:"font-mono text-base font-black tracking-widest",children:D}),(0,s.jsxs)("button",{onClick:H,className:"flex items-center gap-1 text-[11px] font-semibold text-white/80 hover:text-white",children:[U?(0,s.jsx)(r.A,{className:"w-3 h-3 text-sage-400"}):(0,s.jsx)(n.A,{className:"w-3 h-3"}),U?"Copied":"Copy"]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>{(0,f.ZA)({entityType:"referral",channel:"whatsapp"}),window.open("https://wa.me/?text=".concat(encodeURIComponent("".concat("Find verified homes on Resida. Sign up with my link:"," ").concat(M))),"_blank","noopener")},className:"flex-1 bg-[#25D366] text-white py-2 rounded-full font-semibold text-xs hover:opacity-90 transition-opacity",children:"Share on WhatsApp"}),(0,s.jsxs)("button",{onClick:H,className:"flex items-center gap-1.5 border border-white/20 text-white/90 text-xs font-medium px-3 py-2 rounded-full hover:bg-white/10 transition-colors",children:[(0,s.jsx)(i.A,{className:"w-3.5 h-3.5"}),"Copy link"]})]})]}),(0,s.jsxs)("div",{className:"mx-4 mb-4 flex gap-2 p-3 bg-[#EBF1FF] border border-[#CCE0FF] rounded-xl text-[11px] text-[#0039B5] leading-relaxed",children:[(0,s.jsx)(c.A,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),(0,s.jsx)("span",{children:"Reward credits are non-cash. They can be applied to rent or shortlet payments when you choose to use them. They expire after 24 months."})]}),N&&(0,s.jsx)("div",{className:"grid grid-cols-2 gap-3 px-4 mb-4",children:[{icon:d.A,label:"Sent",value:null!=(t=N.total_sent)?t:0,color:"text-[#0052FF]",bg:"bg-[#EBF1FF]"},{icon:o.A,label:"Converted",value:null!=(a=N.converted)?a:0,color:"text-indigo-600",bg:"bg-indigo-50"},{icon:x.A,label:"Pending",value:j(null!=(u=N.pending_earnings)?u:0),color:"text-clay-600",bg:"bg-clay-50"},{icon:m.A,label:"Total earned",value:j(null!=(g=N.total_earned)?g:0),color:"text-sage-600",bg:"bg-sage-50"}].map(e=>{let{icon:t,label:a,value:l,color:r,bg:n}=e;return(0,s.jsxs)("div",{className:"bg-gray-50 ring-1 ring-black/5 rounded-[28px] p-3 flex items-center gap-2.5",children:[(0,s.jsx)("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center shrink-0 ".concat(n),children:(0,s.jsx)(t,{className:"w-3.5 h-3.5 ".concat(r)})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-xs font-bold text-gray-900 truncate",children:l}),(0,s.jsx)("p",{className:"text-[10px] text-gray-400",children:a})]})]},a)})}),(0,s.jsxs)("div",{className:"px-4 mb-4",children:[(0,s.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-widest text-gray-400 mb-2",children:"Send email invite"}),(0,s.jsxs)("form",{onSubmit:Q,className:"flex gap-2",children:[(0,s.jsx)("input",{type:"email",value:G,onChange:e=>K(e.target.value),placeholder:"[email protected]",className:"flex-1 h-9 px-3 rounded-xl border border-gray-200 text-xs focus:outline-none focus:ring-2 focus:ring-[#0052FF]/30"}),(0,s.jsx)("button",{type:"submit",disabled:Z,className:"h-9 px-4 bg-[#0052FF] text-white text-xs font-semibold rounded-xl flex items-center gap-1.5 hover:bg-[#0039B5] disabled:opacity-50",children:Z?(0,s.jsx)(p.A,{className:"w-3.5 h-3.5 animate-spin"}):"Send"})]}),L&&(0,s.jsx)("p",{className:"mt-2 text-[11px] text-rose-600",children:L}),W&&(0,s.jsx)("p",{className:"mt-2 text-[11px] text-sage-700",children:W})]}),(0,s.jsxs)("div",{className:"px-4 pb-6",children:[(0,s.jsxs)("p",{className:"text-[10px] font-bold uppercase tracking-widest text-gray-400 mb-3",children:["Your referrals ",S>0&&(0,s.jsxs)("span",{className:"text-gray-300 font-normal",children:["\xb7 ",S]})]}),E?(0,s.jsx)("div",{className:"flex items-center justify-center py-10",children:(0,s.jsx)(p.A,{className:"w-5 h-5 text-[#0052FF]/80 animate-spin"})}):I?(0,s.jsxs)("div",{className:"flex items-center gap-2 p-3 text-sm text-rose-600",children:[(0,s.jsx)(h.A,{className:"w-4 h-4 shrink-0"}),I]}):0===F.length?(0,s.jsxs)("div",{className:"flex flex-col items-center py-10 gap-2 text-gray-300",children:[(0,s.jsx)(d.A,{className:"w-9 h-9 opacity-40"}),(0,s.jsx)("p",{className:"text-xs",children:"No referrals yet. Share your link!"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"space-y-2",children:F.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-[#F8F9FA] rounded-[20px]",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-900 truncate",children:e.referred_name||e.referred_email}),(0,s.jsxs)("p",{className:"text-[10px] text-gray-400 mt-0.5",children:["Referred ",v(e.created_at)]})]}),(0,s.jsxs)("div",{className:"shrink-0 text-right",children:[(0,s.jsx)(k,{status:e.status}),"rewarded"===e.status&&e.reward_amount>0&&(0,s.jsx)("p",{className:"text-[10px] font-bold text-sage-600 mt-1",children:j(e.reward_amount)}),"kyc_pending"===e.status&&(0,s.jsx)("p",{className:"text-[9px] text-amber-600 mt-1",children:"Awaiting ID verification"})]})]},e.id))}),S>10&&(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,s.jsx)("button",{onClick:()=>$(_-1),disabled:1===_,className:"text-xs text-gray-500 hover:text-gray-700 disabled:opacity-30",children:"Prev"}),(0,s.jsxs)("span",{className:"text-[10px] text-gray-400",children:[_," / ",Math.ceil(S/10)]}),(0,s.jsx)("button",{onClick:()=>$(_+1),disabled:_>=Math.ceil(S/10),className:"text-xs text-gray-500 hover:text-gray-700 disabled:opacity-30",children:"Next"})]})]})]})]})}function C(e){let{open:t}=e,[a,r]=(0,l.useState)(null),[n,i]=(0,l.useState)([]),[d,o]=(0,l.useState)(0),[x,m]=(0,l.useState)(1),[g,f]=(0,l.useState)(!0),[y,N]=(0,l.useState)(""),A=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;f(!0),N("");try{var t,a,s;let[l,n]=await Promise.all([(0,b.d$K)(),(0,b.hxj)({page:e,limit:10})]);r(null!=(t=null==l?void 0:l.data)?t:null);let c=null!=(a=null==n?void 0:n.data)?a:[];
1i(Array.isArray(c)?c:[]),o(null!=(s=null==n?void 0:n.total)?s:0),m(e)}catch(e){N("Failed to load reward data.")}finally{f(!1)}},[]);return(0,l.useEffect)(()=>{t&&A(1)},[t,A]),(0,s.jsxs)("div",{children:[a&&(0,s.jsxs)("div",{className:"m-4 bg-[#1F1F1F] rounded-[28px] p-5 text-white",children:[(0,s.jsx)("p",{className:"text-[10px] font-semibold text-[#CCE0FF] uppercase tracking-wider mb-1",children:"Reward credits"}),(0,s.jsx)("p",{className:"text-3xl font-black tabular-nums mt-1",children:j(a.balance)}),(0,s.jsx)("p",{className:"text-[11px] text-white/60 mb-4",children:"Available now"}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-3",children:[{label:"In hold",value:j(a.earned_total-a.redeemed_total-a.balance)},{label:"Total earned",value:j(a.earned_total)},{label:"Redeemed",value:j(a.redeemed_total)},{label:"Available",value:j(a.balance)}].map(e=>{let{label:t,value:a}=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[9px] text-white/50 uppercase tracking-wider",children:t}),(0,s.jsx)("p",{className:"text-sm font-bold",children:a})]},t)})})]}),(0,s.jsxs)("div",{className:"mx-4 mb-4 flex gap-2 p-3 bg-[#EBF1FF] border border-[#CCE0FF] rounded-xl text-[11px] text-[#0039B5] leading-relaxed",children:[(0,s.jsx)(c.A,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),(0,s.jsx)("span",{children:"Credits can be applied to rent & shortlet payments when you opt in at checkout. They cannot be withdrawn or transferred. Unused credits expire after 24 months."})]}),(0,s.jsxs)("div",{className:"px-4 pb-6",children:[(0,s.jsxs)("p",{className:"text-[10px] font-bold uppercase tracking-widest text-gray-400 mb-3",children:["Reward history ",d>0&&(0,s.jsxs)("span",{className:"text-gray-300 font-normal",children:["\xb7 ",d]})]}),g?(0,s.jsx)("div",{className:"flex items-center justify-center py-10",children:(0,s.jsx)(p.A,{className:"w-5 h-5 text-[#0052FF]/80 animate-spin"})}):y?(0,s.jsxs)("div",{className:"flex items-center gap-2 p-3 text-sm text-rose-600",children:[(0,s.jsx)(h.A,{className:"w-4 h-4 shrink-0"}),y]}):0===n.length?(0,s.jsxs)("div",{className:"flex flex-col items-center py-10 gap-2 text-gray-300",children:[(0,s.jsx)(u.A,{className:"w-9 h-9 opacity-40"}),(0,s.jsx)("p",{className:"text-xs",children:"No reward transactions yet."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"space-y-2",children:n.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-[#F8F9FA] rounded-[20px]",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-900 truncate",children:F[e.type]||e.type}),(0,s.jsx)("p",{className:"text-[10px] text-gray-400 mt-0.5",children:v(e.created_at)}),e.reward_hold_until&&"pending"===e.status&&(0,s.jsxs)("p",{className:"text-[10px] text-amber-600 mt-0.5",children:["Available ",v(e.reward_hold_until)]})]}),(0,s.jsxs)("div",{className:"shrink-0 text-right",children:[(0,s.jsx)(k,{status:e.status,map:w}),(0,s.jsxs)("p",{className:"text-xs font-bold mt-1 ".concat("redemption"===e.type?"text-rose-600":"text-sage-600"),children:["redemption"===e.type?"-":"+",j(e.amount)]})]})]},e.id))}),d>10&&(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,s.jsx)("button",{onClick:()=>A(x-1),disabled:1===x,className:"text-xs text-gray-500 hover:text-gray-700 disabled:opacity-30",children:"Prev"}),(0,s.jsxs)("span",{className:"text-[10px] text-gray-400",children:[x," / ",Math.ceil(d/10)]}),(0,s.jsx)("button",{onClick:()=>A(x+1),disabled:x>=Math.ceil(d/10),className:"text-xs text-gray-500 hover:text-gray-700 disabled:opacity-30",children:"Next"})]})]})]})]})}function _(e){let{open:t,onClose:a}=e;(0,y.K)(t);let[r,n]=(0,l.useState)("referrals");return t?(0,s.jsxs)("div",{className:"fixed inset-0 z-[90] flex",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/30",onClick:a}),(0,s.jsxs)("div",{className:"relative ml-auto w-full max-w-lg bg-[#F0F4F9] h-full flex flex-col gw-panel-right overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-5 border-b border-gray-100 shrink-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-xl bg-[#EBF1FF] flex items-center justify-center",children:(0,s.jsx)(u.A,{className:"w-4 h-4 text-[#0052FF]"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-bold text-gray-900",children:"Refer & Earn"}),(0,s.jsx)("p",{className:"text-[10px] text-gray-400",children:"Invite friends \xb7 earn reward credits"})]})]}),(0,s.jsx)("button",{onClick:a,className:"p-2 hover:bg-gray-100 rounded-full transition-colors",children:(0,s.jsx)(g.A,{className:"w-4 h-4 text-gray-500"})})]}),(0,s.jsxs)("div",{className:"flex border-b border-gray-100 shrink-0",children:[(0,s.jsx)(A,{active:"referrals"===r,onClick:()=>n("referrals"),children:"Referrals"}),(0,s.jsx)(A,{active:"rewards"===r,onClick:()=>n("rewards"),children:"Rewards"})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto",children:"referrals"===r?(0,s.jsx)(S,{open:t}):(0,s.jsx)(C,{open:t})})]})]}):null}},23327:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(71847).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},43575:(e,t,a)=>{a.d(t,{JW:()=>d,ZA:()=>o,clearStoredRef:()=>n,getStoredRefCode:()=>r,rO:()=>l});let s="resida_ref";function l(){try{let e=(new URLSearchParams(window.location.search).get("ref")||"").trim();if(!e||r())return;localStorage.setItem(s,JSON.stringify({code:e.toUpperCase().slice(0,32),capturedAt:Date.now()}))}catch(e){}}function r(){try{let e=localStorage.getItem(s);if(!e)return null;let{code:t,capturedAt:a}=JSON.parse(e);if(!t||!a||Date.now()-a>2592e6)return localStorage.removeItem(s),null;return t}catch(e){return null}}function n(){try{localStorage.removeItem(s)}catch(e){}}function i(){try{var e;return(null==(e=JSON.parse(localStorage.getItem("resida-open-auth")))?void 0:e.state)||null}catch(e){return null}}function c(){var e,t;return(null==(t=i())||null==(e=t.user)?void 0:e.referral_code)||null}function d(e){let t=c(),a=e.includes("?")?"&":"?";return t?"".concat(e).concat(a,"ref=").concat(encodeURIComponent(t)):"".concat(e).concat(a,"src=share")}function o(e){let{entityType:t,entityId:a=null,channel:s}=e;try{var l;"function"==typeof window.gtag&&window.gtag("event","share",{entity_type:t,channel:s});let e=(null==(l=i())?void 0:l.accessToken)||null;fetch("".concat("https://api.resida.app","/api/v1/growth/share-events"),{method:"POST",headers:{"Content-Type":"application/json",...e?{Authorization:"Bearer ".concat(e)}:{}},body:JSON.stringify({entity_type:t,entity_id:a,channel:s,ref_code:c()}),keepalive:!0}
1).catch(()=>{})}catch(e){}}},78435:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(71847).A)("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])}}]);

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.