PageSourceSearch

https://mypremiumservice.com/assets/PartnerLeads-wr4kRrDO.js

js mypremiumservice.com collected 2026-10-02 00:33:01 UTC 6,428 bytes, 1 lines download raw bytes

1import{a as w,y as C,r as d,ba as D,e as x,j as e,B as j,U as L,t as m}from"./index-CvEPeg3_.js";import{I as i}from"./input-DslCEC8W.js";import{T as S}from"./textarea-YKJcLsd3.js";import{L as n}from"./label-cSRRwfX6.js";import{B as g}from"./badge-tm6ABMXD.js";import{D as B,f as P,a as k,b as T,c as I}from"./dialog-CPzQ-dXC.js";import{P as E}from"./plus-DftMvCUB.js";import{C as G}from"./circle-check-Dmj9aRqm.js";import{C as U}from"./circle-x-B_rO38Er.js";import{C as O}from"./clock-Bfit6bxw.js";function J(){const{t:s}=w(),{user:l}=C(),[c,_]=d.useState(null),[p,f]=d.useState([]),[v,u]=d.useState(!1),[a,r]=d.useState({contact_name:"",company_name:"",business_email:"",company_website:"",country:"",product_interest:"",estimated_value:"",expected_timeframe:"",notes:"",contact_consent:!1});d.useEffect(()=>{h()},[l]);const h=async()=>{if(!(l!=null&&l.email))return;const t=await D(),o=await x.entities.GrowthPartner.filter({email:l.email,platform_id:t.platform_id});o!=null&&o[0]&&_(o[0]);const y=await x.entities.GrowthLeadRegistration.filter({partner_email:l.email,platform_id:t.platform_id},"-created_date");f(y||[])},N=async()=>{if(!a.contact_name||!a.business_email){m.error(s("plead.toast.required"));return}if(!a.contact_consent){m.error(s("plead.toast.consent"));return}try{await x.entities.GrowthLeadRegistration.create({platform_id:(c==null?void 0:c.platform_id)||"mpnerds",partner_email:l.email,partner_id:(c==null?void 0:c.id)||"",...a,estimated_value:a.estimated_value?Number(a.estimated_value):null,currency:"USD",status:"pending_review",protection_expires_at:new Date(Date.now()+2880*60*60*1e3).toISOString()}),m.success(s("plead.toast.submitted")),u(!1),r({contact_name:"",company_name:"",business_email:"",company_website:"",country:"",product_interest:"",estimated_value:"",expected_timeframe:"",notes:"",contact_consent:!1}),h()}catch(t){m.error(t.message)}},b=t=>t==="approved"?e.jsx(G,{className:"w-4 h-4 text-green-500"}):t==="rejected"||t==="expired"?e.jsx(U,{className:"w-4 h-4 text-red-500"}):e.jsx(O,{className:"w-4 h-4 text-amber-500"});return e.jsxs("div",{className:"p-5 md:p-8 max-w-5xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-display font-bold",children:s("plead.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("plead.subtitle")})]}),e.jsxs(B,{open:v,onOpenChange:u,children:[e.jsx(P,{asChild:!0,children:e.jsxs(j,{className:"gradient-primary text-white",children:[e.jsx(E,{className:"w-4 h-4"})," ",s("plead.registerBtn")]})}),e.jsxs(k,{className:"max-w-lg",children:[e.jsx(T,{children:e.jsx(I,{children:s("plead.registerTitle")})}),e.jsxs("div",{className:"space-y-3 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(n,{className:"text-xs",children:s("plead.contactName")}),e.jsx(i,{value:a.contact_name,onChange:t=>r({...a,contact_name:t.target.value})})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-xs",children:s("plead.companyName")}),e.jsx(i,{value:a.company_name,onChange:t=>r({...a,company_name:t.target.value})})]})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-xs",children:s("plead.businessEmail")}),e.jsx(i,{type:"email",value:a.business_email,onChange:t=>r({...a,business_email:t.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(n,{className:"text-xs",children:s("plead.companyWebsite")}),e.jsx(i,{value:a.company_website,onChange:t=>r({...a,company_website:t.target.value})})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-xs",children:s("plead.country")}),e.jsx(i,{value:a.country,onChange:t=>r({...a,country:t.target.value})})]})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-xs",children:s("plead.productInterest")}),e.jsx(i,{value:a.product_interest,onChange:t=>r({...a,product_interest:t.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(n,{className:"text-xs",children:s("plead.estimatedValue")}),e.jsx(i,{type:"number",value:a.estimated_value,onChange:t=>r({...a,estimated_value:t.target.value})})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-xs",children:s("plead.expectedTimeframe")}),e.jsx(i,{value:a.expected_timeframe,onChange:t=>r({...a,expected_timeframe:t.target.value}),placeholder:s("plead.timeframePlaceholder")})]})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-xs",children:s("plead.supportingNotes")}),e.jsx(S,{rows:3,value:a.notes,onChange:t=>r({...a,notes:t.target.value})})]}),e.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:a.contact_consent,onChange:t=>r({...a,contact_consent:t.target.checked}),className:"mt-1"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:s("plead.consent")})]}),e.jsx(j,{className:"w-full gradient-primary text-white",onClick:N,children:s("plead.submitBtn")})]})]})]})]}),e.jsx("div",{className:"bg-card border border-border rounded-2xl p-5",children:p.length===0?e.jsxs("div",{className:"text-center py-10",children:[e.jsx(L,{className:"w-10 h-10 mx-auto mb-3 text-muted-foreground
1/40"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:s("plead.noLeads")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("plead.noLeadsDesc")})]}):e.jsx("div",{className:"space-y-2",children:p.map(t=>e.jsxs("div",{className:"flex items-center justify-between border border-border rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[b(t.status),e.jsxs("div",{children:[e.jsxs("p",{className:"font-medium text-sm",children:[t.contact_name," ",t.company_name&&`· ${t.company_name}`]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.business_email," · ",t.product_interest||s("plead.noProduct")]}),t.duplicate_flag&&e.jsx(g,{variant:"outline",className:"text-xs mt-1 text-amber-500",children:s("plead.mayBeDuplicate")})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx(g,{variant:"outline",className:"text-xs capitalize",children:t.status.replace(/_/g," ")}),t.protection_expires_at&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s("plead.protectedUntil",{date:new Date(t.protection_expires_at).toLocaleDateString()})})]})]},t.id))})})]})}export{J 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.