PageSourceSearch

https://nwivisas.com/assets/AffiliateDashboard-zhdgu_1H.js

js nwivisas.com collected 2026-09-26 06:25:59 UTC 23,795 bytes, 43 lines download raw bytes

1import{Q as _,u as q,r as o,j as e,t as A,N as I,U as V,B as u,H as y,E as Q,F as U}from"./index-GkWPVvRs.js";import{M as W,L as Y,C as N,D as O}from"./mouse-pointer-click-DavVKjLk.js";import{U as Z}from"./user-check-CxTa1bgm.js";import{D as M}from"./dollar-sign-ChkcjJ8V.js";import{Q as S}from"./qr-code-B7JENy_M.js";import{C as z}from"./calendar-B92lTu5R.js";const B=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],H=_("code",B),k=new Set(["Assigned to Case Manager","Documents Shared","Welcome Call Scheduled","Welcome Call Done","Visa Doc List Sent","Visa Docs Received","Visa App Submitted","Aus Skills Doc List Sent","Aus Skills Docs Received","Aus Skills Submitted","Aus Skills Approved","Aus EOI Prepared","Aus EOI Submitted","Aus EOI Invitation Received","Aus State Doc List Sent","Aus State Docs Received","Aus State Submitted","Aus State Approved","Aus Visa Doc List Sent","Aus Visa Docs Received","Aus Visa App Submitted","SA SAQA Doc List Sent","SA SAQA Docs Received","SA SAQA Submitted","SA SAQA Approved","SA Visa Doc List Sent","SA Visa Docs Received","SA Visa App Submitted","NZ Skills Doc List Sent","NZ Skills Docs Received","NZ Skills Submitted","NZ Skills Approved","NZ Visa Doc List Sent","NZ Visa Docs Received","NZ Visa App Submitted","CAN Skills Doc List Sent","CAN Skills Docs Received","CAN Skills Submitted","CAN Skills Approved","CAN Visa Doc List Sent","CAN Visa Docs Received","CAN Visa App Submitted","Application Approved","Application Rejected"]);Array.from(k);function G(r){return r?k.has(r.trim()):!1}function J(r){const t=r.toLowerCase();return t==="new lead"?{color:"text-blue-700",bg:"bg-blue-50 border-blue-200"}:t==="attempting contact"?{color:"text-indigo-700",bg:"bg-indigo-50 border-indigo-200"}:t==="discovery"?{color:"text-violet-700",bg:"bg-violet-50 border-violet-200"}:t.includes("quote sent")||t.includes("quote follow")?{color:"text-purple-700",bg:"bg-purple-50 border-purple-200"}:t==="quote accepted"?{color:"text-fuchsia-700",bg:"bg-fuchsia-50 border-fuchsia-200"}:t==="case sold"?{color:"text-emerald-700",bg:"bg-emerald-50 border-emerald-200"}:t.includes("lost")||t.includes("dnq")||t.includes("rejected")?{color:"text-red-600",bg:"bg-red-50 border-red-200"}:t.includes("assigned")||t.includes("documents shared")?{color:"text-teal-700",bg:"bg-teal-50 border-teal-200"}:t.includes("welcome call")?{color:"text-cyan-700",bg:"bg-cyan-50 border-cyan-200"}:t.includes("doc list sent")?{color:"text-amber-700",bg:"bg-amber-50 border-amber-200"}:t.includes("docs received")||t.includes("docu")?{color:"text-yellow-700",bg:"bg-yellow-50 border-yellow-200"}:t.includes("submitted")?{color:"text-orange-700",bg:"bg-orange-50 border-orange-200"}:t.includes("approved")?{color:"text-emerald-700",bg:"bg-emerald-50 border-emerald-200"}:t.includes("eoi prepared")?{color:"text-sky-700",bg:"bg-sky-50 border-sky-200"}:t.includes("eoi submitted")||t.includes("eoi invitation")?{color:"text-blue-700",bg:"bg-blue-50 border-blue-200"}:t.includes("app submitted")||t.includes("visa app")?{color:"text-orange-700",bg:"bg-orange-50 border-orange-200"}:{color:"text-gray-700",bg:"bg-gray-50 border-gray-200"}}function K(){const r=localStorage.getItem("nwi_affiliate_token");return r?{Authorization:`Bearer ${r}`,"Content-Type":"application/json"}:{}}function X({referralCode:r,embedCopied:t,setEmbedCopied:h}){const m=`${window.location.origin}/embed/nwi_assessment_form.js`,x=`<!doctype html>
2<html>
3  <head>
4    <meta charset="utf-8">
5    <title>Visa Assessment</title>
6  </head>
7  <body>
8    <!-- Your content -->
9    <div id="form1"></div>
10    <script src="${m}"><\/script>
11    <script>
12      nwi_assessment_form(
13        '${r}',  // Your unique referral code
14        '',                 // Current country
15        '',                 // Destination country
16        '',                 // Reason for travel
17        'form1',            // Element where form renders
18        ''                  // Theme (empty for light, 'dark' for dark)
19      );
20    <\/script>
21  </body>
22</html>`,b=`<!doctype html>
23<html>
24  <head>
25    <meta charset="utf-8">
26    <title>Visa Assessment</title>
27  </head>
28  <body>
29    <!-- Your content -->
30    <div id="form1"></div>
31    <script src="${m}"><\/script>
32    <script>
33      nwi_assessment_form(
34        '${r}',      // Your unique referral code
35        'United Kingdom',       // Current country (pre-selected)
36        'South Africa',         // Destination country (pre-selected)
37        'Work',                 // Reason for travel (pre-selected)
38        'form1',                // Element where form renders
39        'dark'                  // Theme: 'dark' for dark mode
40      );
41    <\/script>
42  </body>
43</html>`,a=(d,p)=>{navigator.clipboard.writeText(d),h(p),setTimeout(()=>h(null),2e3)};return e.jsxs("div",{className:"p-6 space-y-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#2A2A2A] mb-1","data-testid":"text-embed-title",children:"Embed Enquiry Form"}),e.jsx("p",{className:"text-sm text-gray-500 mb-6",children:"Add the NWI visa assessment form directly to your website. When visitors complete the form, they'll be directed to the full assessment with your referral code attached automatically."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-base font-bold text-[#2A2A2A]",children:"Simple Integration (No Defaults)"}),e.jsx(u,{onClick:()=>a(x,"simple"),size:"sm",className:`rounded-lg h-8 px-3 text-xs font-semibold ${t==="simple"?"bg-emerald-500 hover:bg-emerald-600 text-white":"bg-[#f5da8a] hover:bg-[#e6c96f] text-[#0F4C5C]"}`,"data-testid":"button-copy-simple",children:t==="simple"?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-3 h-3 mr-1"})," Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"w-3 h-3 mr-1"})," Copy Code"]})})]}),e.jsx("p",{className:"text-xs text-gray-400 mb-2",children:"Visitors will select all 3 fields themselves. Best for general-purpose pages."}),e.jsx("pre",{className:"bg-[#1a1a2e] text-gray-300 rounded-xl p-5 text-xs leading-relaxed overflow-x-auto font-mono","data-testid":"code-simple",children:x})]}),e.jsx("div",{className:"border-t border-gray-100"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-base font-bold text-[#2A2A2A]",children:"Advanced Integration (Defaults)"}),e.jsx(u,{onClick:()=>a(b,"advanced"),size:"sm",className:`rounded-lg h-8 px-3 text-xs font-semibold ${t==="advanced"?"bg-emerald-500 hover:bg-emerald-600 text-white":"bg-[#f5da8a] hover:bg-[#e6c96f] text-[#0F4C5C]"}`,"data-testid":"button-copy-advanced",children:t==="advanced"?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-3 h-3 mr-1"})," Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"w-3 h-3 mr-1"})," Copy Code"]})})]}),e.jsx("p",{className:"text-xs text-gray-400 mb-2",children:"Pre-fill the country and route fields for targeted landing pages. Edit the values in the code to match your audience."}),e.jsx("pre",{className:"bg-[#1a1a2e] text-gray-300 rounded-xl p-5 text-xs leading-relaxed overflow-x-auto font-mono","data-testid":"code-advanced",children:b})]}),e.jsxs("div",{className:"bg-[#F8F6F2] rounded-xl p-5 border border-gray-100",children:[e.jsx("h4",{className:"text-sm font-bold text-[#2A2A2A] mb-3",children:"Parameters Reference"}),e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3",children:[e.jsx("code",{className:"text-[#0F4C5C] font-semibold whitespace-nowrap sm:min-w-[140px]",children:"affiliateCode"}),e.jsx("span",{className:"text-gray-600",children:"Your unique referral code, automatically included in the snippets above"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3",children:[e.jsx("code",{className:"text-[#0F4C5C] font-semibold whitespace-nowrap sm:min-w-[140px]",children:"currentCountry"}),e.jsx("span",{className:"text-gray-600",children:"Pre-select the visitor's current country (leave empty for no default)"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3",children:[e.jsx("code",{className:"text-[#0F4C5C] font-semibold whitespace-nowrap sm:min-w-[140px]",children:"destinationCountry"}),e.jsx("span",{className:"text-gray-600",children:"Pre-select the destination country (leave empty for no default)"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3",children:[e.jsx("code",{className:"text-[#0F4C5C] font-semibold whitespace-nowrap sm:min-w-[140px]",children:"route"}),e.jsx("span",{className:"text-gray-600",children:"Pre-select the goal: Work, Study, Ret
43ire, Join Family, Visit for Tourism, etc."})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3",children:[e.jsx("code",{className:"text-[#0F4C5C] font-semibold whitespace-nowrap sm:min-w-[140px]",children:"containerId"}),e.jsx("span",{className:"text-gray-600",children:'The HTML element ID where the form will render (default: "form1")'})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3",children:[e.jsx("code",{className:"text-[#0F4C5C] font-semibold whitespace-nowrap sm:min-w-[140px]",children:"theme"}),e.jsx("span",{className:"text-gray-600",children:'Set to "dark" for dark mode, or leave empty for light theme'})]})]})]})]})}function ee({licenseNumber:r,landingUrl:t,partnerName:h}){const[i,m]=o.useState(null),x=async a=>{try{m(a);const d=localStorage.getItem("nwi_affiliate_token"),p=await fetch(`/api/affiliate/qr-pdf?size=${a}`,{headers:d?{Authorization:`Bearer ${d}`}:{}});if(!p.ok)throw new Error("Failed to download PDF");const j=await p.blob(),f=URL.createObjectURL(j),c=document.createElement("a");c.href=f,c.download=`NWI-LicensedPartner-${r||""}-${a}.pdf`,document.body.appendChild(c),c.click(),c.remove(),URL.revokeObjectURL(f)}catch(d){console.error(d),alert("Could not generate the PDF. Please try again.")}finally{m(null)}},b=[{code:"A4",name:"A4 Poster",desc:"Full-page poster (210 × 297 mm), best for shop windows, noticeboards & event tables."},{code:"A5",name:"A5 Flyer",desc:"Half-page flyer (148 × 210 mm), perfect for handing out at events or expos."},{code:"A6",name:"A6 Card",desc:"Postcard size (105 × 148 mm), fits in a wallet, ideal for one-on-one networking."}];return e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#2A2A2A] mb-1","data-testid":"text-qr-title",children:"QR Code Posters"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Download printable PDF posters with your unique QR code. Anyone who scans the code is taken straight to your branded landing page where they can start their free assessment."})]}),e.jsx("div",{className:"bg-[#F8F6F2] rounded-xl p-5 border border-gray-100",children:e.jsxs("div",{className:"grid sm:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-1",children:"Partner Name"}),e.jsx("p",{className:"font-semibold text-[#2A2A2A]","data-testid":"text-qr-partner-name",children:h})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-1",children:"Licensed Partner #"}),e.jsx("p",{className:"font-semibold text-[#0F4C5C] font-mono","data-testid":"text-qr-partner-license",children:r??"—"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-1",children:"QR Links To"}),e.jsx("p",{className:"font-mono text-xs text-[#0F4C5C] truncate",title:t,"data-testid":"text-qr-landing-url",children:t})]})]})}),e.jsx("div",{className:"grid sm:grid-cols-3 gap-4",children:b.map(a=>e.jsxs("div",{className:"border border-gray-100 rounded-2xl p-5 flex flex-col","data-testid":`card-qr-${a.code.toLowerCase()}`,children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#f5da8a]/30 flex items-center justify-center mb-3",children:e.jsx(S,{className:"w-6 h-6 text-[#0F4C5C]"})}),e.jsx("h3",{className:"text-base font-bold text-[#2A2A2A] mb-1",children:a.name}),e.jsx("p",{className:"text-xs text-gray-500 leading-relaxed mb-4 flex-1",children:a.desc}),e.jsx(u,{onClick:()=>x(a.code),disabled:i===a.code,className:"w-full bg-[#0F4C5C] hover:bg-[#0a3640] text-white rounded-xl h-10 text-sm font-semibold","data-testid":`button-download-${a.code.toLowerCase()}`,children:i===a.code?e.jsx(e.Fragment,{children:"Generating..."}):e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"w-4 h-4 mr-2"})," Download ",a.code," PDF"]})})]},a.code))}),e.jsx("p",{className:"text-xs text-gray-400",children:"Tip: Print on standard white paper or have them professionally printed. The QR works from any smartphone camera, no app needed."})]})}
43function ie(){const[,r]=q(),[t,h]=o.useState(null),[i,m]=o.useState(null),[x,b]=o.useState([]),[a,d]=o.useState(!0),[p,j]=o.useState(!1),[f,c]=o.useState(!1),[g,w]=o.useState("referrals"),[F,D]=o.useState(null);o.useEffect(()=>{if(!localStorage.getItem("nwi_affiliate_token")){r("/affiliate/login");return}const n=K();Promise.all([fetch("/api/affiliate/me",{headers:n}).then(l=>l.ok?l.json():Promise.reject()),fetch("/api/affiliate/stats",{headers:n}).then(l=>l.ok?l.json():Promise.reject()),fetch("/api/affiliate/referrals",{headers:n}).then(l=>l.ok?l.json():Promise.reject())]).then(([l,T,E])=>{h(l),m(T),b(E.referrals||[])}).catch(()=>{localStorage.removeItem("nwi_affiliate_token"),localStorage.removeItem("nwi_affiliate"),r("/affiliate/login")}).finally(()=>d(!1))},[]);const L=()=>{localStorage.removeItem("nwi_affiliate_token"),localStorage.removeItem("nwi_affiliate"),r("/affiliate/login")},C=t?`${window.location.origin}?ref=${t.referralCode}`:"",v=t?`${window.location.origin}/r/${t.referralCode}`:"",R=()=>{navigator.clipboard.writeText(C),j(!0),setTimeout(()=>j(!1),2e3)},$=()=>{navigator.clipboard.writeText(v),c(!0),setTimeout(()=>c(!1),2e3)};if(a)return e.jsx("div",{className:"min-h-screen bg-[#F8F6F2] flex items-center justify-center",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-4 border-[#0F4C5C] border-t-transparent rounded-full"})});if(!t||!i)return null;const P=[{label:"Total Clicks",value:i.clicks,icon:W,color:"text-blue-600",bg:"bg-blue-50"},{label:"Assessments Completed",value:i.referrals,icon:A,color:"text-amber-600",bg:"bg-amber-50"},{label:"Clients Signed",value:i.conversions,icon:Z,color:"text-emerald-600",bg:"bg-emerald-50"},{label:"Total Commission",value:`R ${parseFloat(i.totalCommission||"0").toLocaleString()}`,icon:M,color:"text-purple-600",bg:"bg-purple-50"}];return e.jsxs("div",{className:"min-h-screen bg-[#F8F6F2]",children:[e.jsx(I,{}),e.jsx("div",{className:"pt-24 pb-16",children:e.jsxs("div",{className:"container mx-auto px-6 max-w-6xl",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-8",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold text-[#2A2A2A] font-heading","data-testid":"text-dashboard-title",children:["Welcome back, ",t.name.split(" ")[0]]}),e.jsxs("p",{className:"text-gray-500 text-sm mt-1",children:[e.jsx(V,{className:"w-3.5 h-3.5 inline mr-1"}),t.email,t.company&&e.jsx("span",{className:"ml-3",children:t.company})]})]}),e.jsxs(u,{onClick:L,variant:"outline",className:"border-gray-200 text-gray-600 hover:bg-gray-50 rounded-xl h-10 px-4 text-sm","data-testid":"button-logout",children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),"Sign Out"]})]}),e.jsx("div",{className:"bg-white rounded-2xl border border-gray-100 shadow-sm p-6 mb-8",children:e.jsx("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-500 mb-2",children:"Your Referral Link"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("code",{className:"flex-1 min-w-0 truncate bg-[#F8F6F2] px-4 py-3 rounded-xl text-sm text-[#0F4C5C] font-mono border border-gray-100","data-testid":"text-referral-link",children:C}),e.jsx(u,{onClick:R,className:`rounded-xl h-11 px-5 text-sm font-semibold shrink-0 ${p?"bg-emerald-500 hover:bg-emerald-600 text-white":"bg-[#f5da8a] hover:bg-[#e6c96f] text-[#0F4C5C]"}`,"data-testid":"button-copy-link",children:p?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-4 h-4 mr-1"})," Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"w-4 h-4 mr-1"})," Copy Link"]})})]}),e.jsxs("p",{className:"text-xs text-gray-400 mt-2",children:["Share this link with your contacts. Code: ",e.jsx("span",{className:"font-semibold text-[#0F4C5C]",children:t.referralCode})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[e.jsx("p",{className:"text-sm font-medium text-gray-500 mb-2",children:"Your Landing Page"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("code",{className:"flex-1 min-w-0 truncate bg-[#F8F6F2] px-4 py-3 rounded-xl text-sm text-[#0F4C5C] font-mono border border-gray-100","data-testid":"text-landing-link",children:v}),e.jsx(u,{onClick:$,className:`rounded-xl h-11 px-5 text-sm font-semibold shrink-0 ${f?"bg-emerald-500 hover:bg-emerald-600 text-white":"bg-[#f5da8a] hover:bg-[#e6c96f] text-[#0F4C5C]"}`,"data-testid":"button-copy-landing",children:f?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-4 h-4 mr-1"})," Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"w-4 h-4 mr-1"})," Copy Link"]})})]}),e.jsx("p",{className:"text-xs text-gray-400 mt-2",children:"A branded page with built-in assessment form, perfect for sharing with prospects."})]}),e.jsxs("div",{className:"flex flex-wrap gap-4 mt-3 text-xs text-gray-500",children:[t.licenseNumber&&e.jsxs("span",{"data-testid":"text-license-number",children:["Licensed Partner #: ",e.jsx("span",{className:"font-mono font-semibold text-[#0F4C5C]",children:t.licenseNumber})]}),e.jsxs("span",{"data-testid":"text-affiliate-uid",children:["Account ID: ",e.jsx("span",{className:"font-mono text-gray-600",children:t.affiliateUid})]}),t.owner&&e.jsxs("span",{"data-testid":"text-affiliate-owner",children:["Account Manager: ",e.jsx("span",{className:"font-semibold text-[#0F4C5C]",children:t.owner})]})]})]})})}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:P.map((s,n)=>e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-100 shadow-sm p-5","data-testid":`card-stat-${n}`,children:[e.jsx("div",{className:`w-10 h-10 rounded-xl ${s.bg} flex items-center justify-center mb-3`,children:e.jsx(s.icon,{className:`w-5 h-5 ${s.color}`})}),e.jsx("p",{className:"text-2xl font-bold text-[#2A2A2A]",children:s.value}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s.label})]},n))}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"flex border-b border-gray-100 overflow-x-auto scrollbar-hide",children:[e.jsxs("button",{onClick:()=>w("referrals"),className:`flex items-center gap-2 px-4 sm:px-6 py-4 text-sm font-semibold border-b-2 transition-colors flex-shrink-0 ${g==="referrals"?"border-[#0F4
43C5C] text-[#0F4C5C]":"border-transparent text-gray-400 hover:text-gray-600"}`,"data-testid":"tab-referrals",children:[e.jsx(A,{className:"w-4 h-4"}),"Your Referrals"]}),e.jsxs("button",{onClick:()=>w("embed"),className:`flex items-center gap-2 px-4 sm:px-6 py-4 text-sm font-semibold border-b-2 transition-colors flex-shrink-0 ${g==="embed"?"border-[#0F4C5C] text-[#0F4C5C]":"border-transparent text-gray-400 hover:text-gray-600"}`,"data-testid":"tab-embed",children:[e.jsx(H,{className:"w-4 h-4"}),"Embed Enquiry Form"]}),e.jsxs("button",{onClick:()=>w("qr"),className:`relative flex items-center gap-2 px-4 sm:px-6 py-4 text-sm font-bold border-b-2 transition-colors flex-shrink-0 ${g==="qr"?"border-[#0F4C5C] text-[#0F4C5C] bg-[#f5da8a]/30":"border-[#f5da8a] text-[#0F4C5C] bg-[#f5da8a]/20 hover:bg-[#f5da8a]/40"}`,"data-testid":"tab-qr",children:[e.jsx(S,{className:"w-4 h-4"}),"QR Code Posters",e.jsx("span",{className:"ml-1 inline-flex items-center rounded-full bg-[#0F4C5C] px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide text-white",children:"New"})]})]}),g==="referrals"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-6 border-b border-gray-100",children:[e.jsx("h2",{className:"text-lg font-bold text-[#2A2A2A]","data-testid":"text-referrals-title",children:"Your Referrals"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Track the progress of everyone referred through your link"})]}),x.length===0?e.jsxs("div",{className:"p-12 text-center",children:[e.jsx(Q,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-500 font-medium mb-2",children:"No referrals yet"}),e.jsx("p",{className:"text-gray-400 text-sm max-w-sm mx-auto",children:"Share your referral link to start tracking leads. When someone completes an assessment through your link, they'll appear here."})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#F8F6F2] text-left text-xs font-semibold text-gray-500 uppercase tracking-wider",children:[e.jsx("th",{className:"px-6 py-3",children:"Name"}),e.jsx("th",{className:"px-6 py-3",children:"Destination"}),e.jsx("th",{className:"px-6 py-3",children:"Route"}),e.jsx("th",{className:"px-6 py-3",children:"Score"}),e.jsx("th",{className:"px-6 py-3",children:"Stage"}),e.jsx("th",{className:"px-6 py-3",children:"Commission"}),e.jsx("th",{className:"px-6 py-3",children:"Date"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:x.map(s=>{const n=J(s.stage);return e.jsxs("tr",{className:"hover:bg-gray-50/50","data-testid":`row-referral-${s.id}`,children:[e.jsxs("td",{className:"px-6 py-4",children:[e.jsxs("p",{className:"text-sm font-medium text-[#2A2A2A]",children:[s.firstName||""," ",s.lastName||""]}),e.jsx("p",{className:"text-xs text-gray-400",children:s.email||"-"})]}),e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600",children:s.destinationCountry||"-"}),e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600",children:s.route||"-"}),e.jsx("td",{className:"px-6 py-4",children:s.score!==null?e.jsxs("span",{className:"text-sm font-semibold text-[#0F4C5C]",children:[s.score,"/100"]}):"-"}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:`inline-flex px-2.5 py-1 rounded-full text-xs font-semibold border ${n.bg} ${n.color}`,title:s.stage,children:s.stage})}),e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600",children:s.commissionAmount&&parseFloat(s.commissionAmount)>0?G(s.stage)?e.jsxs("span",{className:"font-semibold text-emerald-700","data-testid":`text-commission-earned-${s.id}`,children:["R ",parseFloat(s.commissionAmount).toLocaleString()]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5",title:"Commission becomes earned once the lead is Assigned to Case Manager","data-testid":`text-commission-pending-${s.id}`,children:[e.jsxs("span",{className:"text-gray-400",children:["R ",parseFloat(s.commissionAmount).toLocaleString()]}),e.jsx("span",{className:"px-1.5 py-0.5 rounded-full text-[10px] font-semibold bg-amber-50 text-amber-700 border border-amber-200",children:"Pending"})]}):"-"}),e.jsxs("td",{className:"px-6 py-4 text-xs text-gray-400",children:[e.jsx(z,{className:"w-3 h-3 inline mr-1"}),s.createdAt?new Date(s.createdAt).toLocaleDateString():"-"]})]},s.id)})})]})})]}),g==="embed"&&e.jsx(X,{referralCode:t.referralCode,embedCopied:F,setEmbedCopied:D}),g==="qr"&&e.jsx(ee,{licenseNumber:t.licenseNumber||null,landingUrl:v,partnerName:t.name})]})]})}),e.jsx(U,{})]})}
43export{ie 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.