PageSourceSearch

https://www.growlytics.app/assets/WhitelabelDashboard-Be3om4de.js

js growlytics.app collected 2026-10-02 01:15:23 UTC 68,585 bytes, 1 lines download raw bytes

1import{aV as ua,aU as pa,r as a,j as e,am as Kt}from"./vendor-libs-DqTTukLt.js";import{a as xa,u as ma,$ as u}from"./index-DnZkLQpb.js";import{C as ba}from"./ConfirmModal-CG1WZSBu.js";import"./vendor-heavy-BYAivpjp.js";const ja=()=>{var Lt,Dt;const{addToast:o}=xa(),{user:z}=ma(),Ot=ua(),Wt=pa(),m=(()=>{const t=Wt.pathname.split("/"),s=t[t.length-1];return["overview","clients","plans","branding","keys","smtp","billing"].includes(s)?s:"overview"})(),Bt=t=>{Ot(`/whitelabel/${t}`)},[$t,ve]=a.useState(!0),[p,h]=a.useState(!1),[Ut,je]=a.useState(!1),[R,ke]=a.useState(1),[V,Ne]=a.useState(""),[q,we]=a.useState(""),[H,_e]=a.useState(""),[G,Ce]=a.useState(""),[j,Se]=a.useState(""),[Y,Pe]=a.useState("openai"),[X,Ae]=a.useState(""),[zt,Rt]=a.useState("gemini"),[Vt,qt]=a.useState(""),[J,Ie]=a.useState(""),[Q,Fe]=a.useState(""),[Z,Ee]=a.useState(""),[E,Me]=a.useState(""),[c,M]=a.useState(""),[T,Te]=a.useState(""),[k,ee]=a.useState("#ff6b00"),[N,Le]=a.useState(""),[w,De]=a.useState(""),[Ke,Oe]=a.useState(!1),[We,Be]=a.useState(!1),[te,$e]=a.useState(!0),[Ue,ze]=a.useState(3),[Re,Ve]=a.useState(!0),[Ht,qe]=a.useState("default"),[He,Ge]=a.useState(24),[y,_]=a.useState([]),[f,C]=a.useState([]),[Ye,Xe]=a.useState(""),[Je,Qe]=a.useState(""),[Ze,et]=a.useState(""),[tt,at]=a.useState(""),[rt,st]=a.useState(!1),[ae,S]=a.useState(null),[lt,P]=a.useState(""),[nt,ot]=a.useState(""),[it,dt]=a.useState(587),[ct,ut]=a.useState(""),[pt,xt]=a.useState(""),[mt,bt]=a.useState("tls"),[ht,gt]=a.useState(""),[yt,ft]=a.useState(""),[A,re]=a.useState(!1),[L,vt]=a.useState(!1),[D,jt]=a.useState([]),[kt,Gt]=a.useState(0),[Yt,se]=a.useState(!1),[Nt,le]=a.useState(""),[wt,ne]=a.useState(""),[oe,ie]=a.useState(""),[Xt,_t]=a.useState(3),[Jt,Ct]=a.useState(10),[Qt,St]=a.useState(5),[de,K]=a.useState(""),[g,Pt]=a.useState(null),[Zt,I]=a.use
1State(!1),[O,At]=a.useState({title:"",message:"",confirmText:"Confirm",onConfirm:()=>{}}),[ea,W]=a.useState(!1),[x,ta]=a.useState([]),[F,It]=a.useState(null),[aa,ce]=a.useState(!1),[ue,pe]=a.useState(""),[xe,me]=a.useState(0),[be,he]=a.useState(""),[d,b]=a.useState({project_limit:3,keyword_monitor_limit:10,competitor_monitor_limit:5,opportunities:!0,competitor_activities:!0,ai_visibility:!0,content_planner:!0,backlinks_outreach:!0,backlinks_network:!0,opp_channel_twitter:!0,opp_channel_reddit:!0,opp_channel_facebook:!0,opp_channel_linkedin:!0,opp_mention_brand:!0,opp_mention_competitor:!0,comp_act_website:!0,comp_act_seo:!0,comp_act_pricing:!0,comp_act_social:!0,comp_act_new_page:!0,comp_act_backlinks:!0,comp_act_keywords:!0,comp_act_reviews:!0,comp_act_blog:!0,comp_act_google_ads:!0,comp_act_meta_ads:!0}),Ft=async()=>{var t,s;try{const l=await u.get("/whitelabel/settings");if(l.data){const{keys:r,settings:n}=l.data;r&&(Ne(r.openai_key||""),we(r.gemini_key||""),_e(r.claude_key||""),Ce(r.perplexity_key||""),Se(r.apify_key||""),Pe(r.analysis_provider||"openai"),Ae(r.analysis_key||""),Rt(r.visibility_provider||"gemini"),qt(r.visibility_key||""),Ie(r.stripe_key||""),Fe(r.stripe_secret||""),Ee(r.stripe_webhook_secret||""),re(!!r.keys_verified)),n&&(Me(n.company_name||""),M(n.subdomain||""),Te(n.custom_domain||""),ee(n.primary_color||"#ff6b00"),Le(n.logo_url||""),De(n.favicon_url||""),Oe(!!n.pricing_enabled),Be(!!n.signup_enabled),$e(!!n.trial_enabled),ze(n.trial_days||3),Ve(!!n.allow_signup_without_payment),je(!!n.setup_completed),qe(n.opportunity_fetch_speed_mode||"default"),Ge(n.opportunity_fetch_speed_interval||24),ot(n.smtp_host||""),dt(n.smtp_port||587),ut(n.smtp_username||""),xt(n.smtp_password||""),bt(n.smtp_encryption||"tls"),gt(n.from_email||""),ft(n.from_name||""),_(n.header_links||[]),C(n.footer_links||[]),Xe(n.privacy_policy||""),Qe(n.terms_of_service||""),et(n.hero_title||""),at(n.hero_description||""))}}catch(l){o(((s=(t=l.response)==null?void 0:t.data)==null?void 0:s.message)||"Failed to fetch whitelabel settings.","error")}},ge=async()=>{var t,s;try{const l=await u.get("/whitelabel/clients");jt(l.data.clients||[]),Gt(l.data.max_clients||0)}catch(l){o(((s=(t=l.response)==null?void 0:t.data)==null?void 0:s.message)||"Failed to fetch clients list.","error")}},ye=async()=>{var t,s;try{const r=(await u.get("/whitelabel/plans")).data.plans||[];ta(r),r.length>0&&K(r[0].id.toString())}catch(l){o(((s=(t=l.response)==null?void 0:t.data)==null?void 0:s.message)||"Failed to fetch plans.","error")}},ra=async()=>{ve(!0),await Promise.all([Ft(),ge(),ye()]),ve(!1)};a.useEffect(()=>{ra()},[]),a.useEffect(()=>{if(!c||c.length<3){S(null),P("");return}if(!/^[a-z0-9\-]+$/.test(c)){S(!1),P("Only lowercase letters, numbers, and hyphens are allowed.");return}st(!0);const s=setTimeout(async()=>{try{const l=await u.get(`/whitelabel/check-subdomain?subdomain=${c}`);l.data.available?(S(!0),P("Subdomain is available!")):(S(!1),P(l.data.reason||"This subdomain is already taken."))}catch{S(null),P("Error verifying availability.")}finally{st(!1)}},450);return()=>clearTimeout(s)},[c]);const B=async t=>{var s,l;t&&t.preventDefault(),h(!0);try{await u.post("/whitelabel/settings",{keys:{openai_key:V,gemini_key:q,claude_key:H,perplexity_key:G,apify_key:j,analysis_provider:Y,analysis_key:X,visibility_provider:zt,visibility_key:Vt,stripe_key:J,stripe_secret:Q,stripe_webhook_secret:Z},settings:{company_name:E,subdomain:c,custom_domain:T,primary_color:k,logo_url:N,favicon_url:w,pricing_enabled:Ke,signup_enabled:We,trial_enabled:te,trial_days:Ue,allow_signup_without_payment:Re,setup_completed:!0,opportunity_fetch_speed_mode:Ht,opportunity_fetch_speed_interval:He,smtp_host:nt,smtp_port:it,smtp_username:ct,smtp_password:pt,smtp_encryption:mt,from_email:ht,from_name:yt,header_links:y,footer_links:f,privacy_policy:Ye,terms_of_service:Je,hero_title:Ze,hero_description:tt}}),je(!0),o("Whitelabel settings saved successfully!","success")}catch(r){o(((l=(s=r.response)==null?void 0:s.data)==null?void 0:l.message)||"Failed to save settings.","error")}finally{h(!1)}},Et=async(t,s=!1)=>{var l,r;if(t&&t.preventDefault(),!s&&!j.trim()){o("Apify API Token is required. You cannot save settings without providing it.","error");return}vt(!0);try{const n=await u.post("/whitelabel/test-keys",{openai_key:V,gemini_key:q,claude_key:H,perplexity_key:G,apify_key:j,analysis_provider:Y,analysis_key:X,stripe_key:J,stripe_secret:Q,stripe_webhook_secret:Z});n.data&&n.data.success&&(o(n.data.message||"API keys verified and saved successfully!","success"),re(!0),Ft())}catch(n){o(((r=(l=n.response)==null?void 0:l.data)==null?void 0:r.error)||"API keys validation failed. Please check your credentials.","error"),re(!1)}finally{vt(!1)}},$=async(t,s)=>{var n,i,U;const l=(n=t.target.files)==null?void 0:n[0];if(!l)return;const r=new FormData;r.append("file",l);try{const v=await u.post("/whitelabel/upload",r,{headers:{"Content-Type":"multipart/form-data"}});v.data&&v.data.success&&(s==="logo"?Le(v.data.url):De(v.data.url),o(`${s==="logo"?"Logo":"Favicon"} uploaded successfully!`,"success"))}catch(v){o(((U=(i=v.response)==null?void 0:i.data)==null?void 0:U.error)||"File upload failed.","error")}},sa=t=>{It(t.id),pe(t.name),me(t.price),he(t.stripe_price_id||""),b({...t.features}),ce(!0)},fe=()=>{ce(!1),It(null),pe(""),me(0),he(""),b({project_limit:3,keyword_monitor_limit:10,competitor_monitor_limit:5,opportunities:!0,competitor_activities:!0,ai_visibility:!0,content_planner:!0,backlinks_outreach:!0,backlinks_network:!0,opp_channel_twitter:!0,opp_channel_reddit:!0,opp_channel_facebook:!0,opp_channel_linkedin:!0,opp_mention_brand:!0,opp_mention_competitor:!0,comp_act_website:!0,comp_act_seo:!0,comp_act_pricing:!0,comp_act_social:!0,comp_act_new_page:!0,comp_act_backlinks:!0,comp_act_keywords:!0,comp_act_reviews:!0,comp_act_blog:!0,comp_act_google_ads:!0,comp_act_meta_ads:!0})},la=async t=>{var s,l;t.preventDefault(),h(!0);try{F?(await u.put(`/whitelabel/plans/${F}`,{name:ue,price:xe,stripe_price_id:be,features:d}),o("Agency plan updated successfully!","success")):(await u.post("/whitelabel/plans",{name:ue,price:xe,stripe_price_id:be,features:d}),o("Agency plan created successfully!","success")),fe(),ye()}catch(r){o(((l=(s=r.response)==null?void 0:s.data)==null?void 0:l.message)||"Failed to save plan.","error")}finally{h(!1)}},na=t=>{Pt(t.id),le(t.name),ne(t.email),ie(""),K(t.agency_plan_id?String(t.agency_plan_id):""),_t(t.max_websites),Ct(t.max_keywords),St(t.max_competitors),se(!0)},Mt=()=>{se(!1),Pt(null),le(""),ne(""),ie(""),_t(3),Ct(10),St(5),K("")},oa=t=>{At({title:"Delete Custom Plan",message:"Are you sure you want to delete this custom plan?",confirmText:"Delete",onConfirm:async()=>{var s,l;W(!0);try{await u.delete(`/whitelabel/plans/${t}`),o("Plan deleted successfully.","success"),ye(),I(!1)}catch(r){o(((l=(s=r.response)==null?void 0:s.data)==null?void 0:l.message)||"Failed to delete plan.","error")}finally{W(!1)}}}),I(!0)},ia=async t=>{var s,l,r,n;t.preventDefault(),h(!0);try{const i={name:Nt,email:wt};if(oe.trim())i.password=oe;else if(!g){o("Password is required for new clients.","error"),h(!1);return}if(de?i.agency_plan_id=parseInt(de):(i.max_websites=Xt,i.max_keywords=Jt,i.max_competitors=Qt),g)await u.put(`/whitelabel/clients/${g}`,i),o("Client updated successfully.","success");else{const U=await u.post("/whitelabel/clients",i);o(U.data.message||"Client created successfully.","success")}Mt(),ge()}catch(i){o(((l=(s=i.response)==null?void 0:s.data)==null?void 0:l.error)||((n=(r=i.response)==null?void 0:r.data)==null?void 0:n.message)||"Failed to save client.","error")}finally{h(!1)}},da=t=>{At({title:"Delete Client Sub-account",message:"Are you sure you want to delete this client sub-
1account? All their projects and data will be permanently wiped.",confirmText:"Delete",onConfirm:async()=>{var s,l;W(!0);try{const r=await u.delete(`/whitelabel/clients/${t}`);o(r.data.message||"Client deleted successfully.","success"),ge(),I(!1)}catch(r){o(((l=(s=r.response)==null?void 0:s.data)==null?void 0:l.message)||"Failed to delete client.","error")}finally{W(!1)}}}),I(!0)},ca=async t=>{var s,l;try{const r=await u.patch(`/whitelabel/clients/${t}/toggle`);r.data&&(o(r.data.message||"Client status updated.","success"),jt(n=>n.map(i=>i.id===t?{...i,is_active:r.data.is_active}:i)))}catch(r){o(((l=(s=r.response)==null?void 0:s.data)==null?void 0:l.message)||"Failed to update client status.","error")}},Tt=t=>{Me(t);const s=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)+/g,"");M(s)};return $t?e.jsx("div",{className:"flex-1 bg-white dark:bg-neutral-950 p-8 flex flex-col justify-center items-center",children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full border-4 border-neutral-100 dark:border-neutral-800 border-t-brand-primary animate-spin"}),e.jsx("p",{className:"text-xs text-neutral-400 dark:text-neutral-500 font-bold uppercase tracking-wider animate-pulse",children:"Loading settings..."})]})}):Ut?e.jsx("div",{className:"flex-1 overflow-y-auto p-6 lg:p-8 bg-white dark:bg-neutral-900 text-neutral-800 dark:text-neutral-100",children:e.jsxs("div",{className:"max-w-7xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center border-b border-neutral-200 dark:border-neutral-800 pb-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Whitelabel Agency Control Panel"}),e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400 text-sm mt-1",children:"Configure agency branding, custom plans, client sub-accounts, and API settings."})]}),e.jsx("div",{className:"flex items-center gap-3",children:e.jsx("a",{href:T?`https://${T}`:c?`https://${c}.growlytics.app`:"/",target:"_blank",rel:"noreferrer",className:"px-4 py-2 border border-neutral-300 dark:border-neutral-700 text-sm font-semibold rounded-lg hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors cursor-pointer",children:"Visit Agency Landing Page"})})]}),e.jsx("div",{className:"flex space-x-1 border-b border-neutral-200 dark:border-neutral-800",children:["overview","clients","plans","branding","keys","billing","smtp"].map(t=>e.jsx("button",{onClick:()=>Bt(t),className:`px-4 py-2.5 text-sm font-semibold capitalize border-b-2 transition-all ${m===t?"border-brand-primary text-brand-primary":"border-transparent text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200"}`,children:t==="billing"?"Billing & Signup":t},t))}),m==="overview"&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"bg-white dark:bg-neutral-800 p-6 rounded-xl border border-neutral-200 dark:border-neutral-750 shadow-sm space-y-2",children:[e.jsx("div",{className:"text-sm font-semibold text-neutral-550 dark:text-neutral-400",children:"Total Clients"}),e.jsxs("div",{className:"text-3xl font-extrabold",children:[D.length," / ",kt]}),e.jsx("div",{className:"w-full bg-neutral-100 dark:bg-neutral-700 h-2 rounded-full overflow-hidden",children:e.jsx("div",{className:"bg-brand-primary h-full",style:{width:`${D.length/(kt||1)*100}%`}})})]}),e.jsxs("div",{className:"bg-white dark:bg-neutral-800 p-6 rounded-xl border border-neutral-200 dark:border-neutral-750 shadow-sm space-y-2",children:[e.jsx("div",{className:"text-sm font-semibold text-neutral-550 dark:text-neutral-400",children:"Custom Plans Mapped"}),e.jsx("div",{className:"text-3xl font-extrabold",children:x.length}),e.jsx("div",{className:"text-xs text-neutral-400",children:"Active billing subscriptions for clients"})]}),e.jsxs("div",{className:"bg-white dark:bg-neutral-800 p-6 rounded-xl border border-neutral-200 dark:border-neutral-750 shadow-sm space-y-2",children:[e.jsx("div",{className:"text-sm font-semibold text-neutral-550 dark:text-neutral-400",children:"White Label Status"}),e.jsxs("div",{className:"text-3xl font-extrabold text-emerald-500 flex items-center gap-2",children:[e.jsx("span",{className:"w-2.5 h-2.5 bg-emerald-500 rounded-full animate-pulse"}),"Active"]}),e.jsxs("div",{className:"text-xs text-neutral-400",children:["Subdomain: ",c,".growlytics.app"]})]})]}),m==="clients"&&e.jsxs("div",{className:"space-y-4",children:[!A||x.length===0?e.jsxs("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-255 dark:border-amber-900/50 rounded-xl p-4 flex items-start gap-3",children:[e.jsx("span",{className:"text-xl",children:"⚠️"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"font-bold text-amber-850 dark:text-amber-300 text-sm",children:"Action Required to Add Clients"}
1),e.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 leading-relaxed",children:!A&&x.length===0?"You must test and verify your API keys under the API Credentials tab AND create at least one custom subscription plan before you can add clients.":A?"You must create at least one custom subscription plan under the Plans tab before you can add clients.":"You must test and verify your API keys under the API Credentials tab before you can add clients."})]})]}):null,e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h3",{className:"font-bold text-lg",children:"Active Clients"}),e.jsx("button",{disabled:!A||x.length===0,onClick:()=>se(!0),className:"bg-brand-primary text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-opacity-90 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:"Add New Client"})]}),e.jsx("div",{className:"bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-800 rounded-xl overflow-hidden shadow-sm",children:e.jsxs("table",{className:"min-w-full divide-y divide-neutral-200 dark:divide-neutral-800 text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 dark:bg-neutral-800/50 text-neutral-500 dark:text-neutral-400 font-medium",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3",children:"Client details"}),e.jsx("th",{className:"px-6 py-3",children:"Assigned Plan"}),e.jsx("th",{className:"px-6 py-3",children:"Websites Limit"}),e.jsx("th",{className:"px-6 py-3",children:"Keywords Limit"}),e.jsx("th",{className:"px-6 py-3",children:"Competitors Limit"}),e.jsx("th",{className:"px-6 py-3",children:"Status"}),e.jsx("th",{className:"px-6 py-3",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-neutral-200 dark:divide-neutral-800",children:D.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"text-center py-8 text-neutral-400",children:"No clients added yet."})}):D.map(t=>{const s=x.find(l=>l.id===t.agency_plan_id);return e.jsxs("tr",{children:[e.jsxs("td",{className:"px-6 py-4",children:[e.jsx("div",{className:"font-semibold text-neutral-850 dark:text-neutral-100",children:t.name}),e.jsx("div",{className:"text-xs text-neutral-400",children:t.email})]}),e.jsx("td",{className:"px-6 py-4 font-semibold text-indigo-500",children:s?s.name:"Custom Limits"}),e.jsxs("td",{className:"px-6 py-4 font-medium",children:[t.project_count," / ",t.max_websites]}),e.jsx("td",{className:"px-6 py-4 font-medium",children:t.max_keywords}),e.jsx("td",{className:"px-6 py-4 font-medium",children:t.max_competitors}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:!!t.is_active,onChange:()=>ca(t.id),className:"sr-only peer"}),e.jsx("div",{className:"w-9 h-5 bg-neutral-250 dark:bg-neutral-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-neutral-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-emerald-500"}),e.jsx("span",{className:"ml-2 text-xs font-semibold text-neutral-600 dar
1k:text-neutral-400",children:t.is_active?"Active":"Suspended"})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>na(t),className:"text-brand-primary hover:text-opacity-80 font-bold",children:"Edit"}),e.jsx("button",{onClick:()=>da(t.id),className:"text-red-500 hover:text-red-600 font-bold",children:"Delete"})]})})]},t.id)})})]})})]}),m==="plans"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h3",{className:"font-bold text-lg",children:"Custom Agency Billing Plans"}),e.jsx("button",{onClick:()=>ce(!0),className:"bg-brand-primary text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-opacity-90",children:"Create New Plan"})]}),e.jsx("div",{className:"bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-800 rounded-xl overflow-hidden shadow-sm",children:e.jsxs("table",{className:"min-w-full divide-y divide-neutral-200 dark:div
1ide-neutral-800 text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 dark:bg-neutral-800/50 text-neutral-500 dark:text-neutral-400 font-medium",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3",children:"Plan Name"}),e.jsx("th",{className:"px-6 py-3",children:"Monthly Price"}),e.jsx("th",{className:"px-6 py-3",children:"Stripe Price ID"}),e.jsx("th",{className:"px-6 py-3",children:"Resource Limits"}),e.jsx("th",{className:"px-6 py-3",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-neutral-200 dark:divide-neutral-800",children:x.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"text-center py-8 text-neutral-400",children:"No plans created yet. Setup pricing plans to bill client sub-accounts."})}):x.map(t=>e.jsxs("tr",{className:"hover:bg-neutral-50/50 dark:hover:bg-neutral-800/10",children:[e.jsx("td",{className:"px-6 py-4 font-bold text-neutral-850 dark:text-neutral-100",children:t.name}),e.jsxs("td",{className:"px-6 py-4 font-semibold text-neutral-800 dark:text-neutral-250",children:["$",t.price," / mo"]}),e.jsx("td",{className:"px-6 py-4 font-mono text-xs text-neutral-450 dark:text-neutral-400",children:t.stripe_price_id||"Not Set"}),e.jsxs("td",{className:"px-6 py-4 text-xs font-semibold text-neutral-600 dar
1k:text-neutral-400",children:[t.features.project_limit," Websites · ",t.features.keyword_monitor_limit," Keywords · ",t.features.competitor_monitor_limit," Competitors"]}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>sa(t),className:"text-xs text-brand-primary hover:text-opacity-80 font-bold",children:"Edit"}),e.jsx("button",{onClick:()=>oa(t.id),className:"text-xs text-red-500 hover:text-red-600 font-bold",children:"Delete"})]})})]},t.id))})]})})]}),m==="branding"&&e.jsxs("form",{onSubmit:B,className:"bg-white dark:bg-neutral-900 p-6 rounded-xl border border-neutral-200 dark:border-neutral-800 shadow-sm space-y-6",children:[e.jsx("h3",{className:"text-lg font-bold",children:"White-Label Branding Settings"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-semibold",children:"Company Name"}),e.jsx("input",{type:"text",value:E,onChange:t=>Tt(t.target.value),placeholder:"e.g. Acme Agency",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none focus:border-brand-primary"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-semibold",children:"Subdomain Slug"}),e.jsxs("div",{className:"flex",children:[e.jsx("input",{type:"text",value:c,onChange:t=>M(t.target.value),placeholder:"e.g. acme",className:"flex-1 px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-l-lg focus:outline-none focus:border-brand-primary"}),e.jsx("span",{className:"inline-flex items-center px-3 border border-l-0 border-neutral-250 dark:border-neutral-700 bg-neutral-100 dark:bg-neutral-800 text-neutral-500 rounded-r-lg text-sm",children:".growlytics.app"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-semibold",children:"Custom Portal Domain (CNAME)"}),e.jsx("input",{type:"text",value:T,onChange:t=>Te(t.target.value),placeholder:"e.g. portal.myagency.com",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none focus:border-brand-primary"}),e.jsxs("p",{className:"text-xs text-neutral-400",children:["Point your CNAME record (e.g., ",e.jsx("code",{children:"portal"}),") at your domain DNS registrar to point to your generated agency subdomain: ",e.jsx("code",{className:"font-semibold text-brand-primary",children:c?`${c}.growlytics.app`:"yoursubdomain.growlytics.app"})]})]}),e.jsxs("div",{className:"space-y-2 col-span-2 grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm font-semibold block",children:"Logo Image"}),e.jsx("input",{type:"file",accept:"image/*",onChange:t=>$(t,"logo"),className:"w-full text-xs text-neutral-500 border border-dashed p-3 rounded-lg border-neutral-350"}),N&&e.jsx("img",{src:N,className:"h-8 object-contain mt-2",alt:"Preview"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm font-semibold block",children:"Favicon"}),e.jsx("input",{type:"file",accept:"image/*",onChange:t=>$(t,"favicon"),className:"w-full text-xs text-neutral-500 border border-dashed p-3 rounded-lg border-neutral-350"}),w&&e.jsx("img",{src:w,className:"h-6 object-contain mt-2",alt:"Preview"})]})]}),e.jsxs("div",{className:"space-y-2 col-span-2",children:[e.jsx("label",{className:"text-sm font-semibold",children:"Primary Theme Color"}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx("input",{type:"color",value:k,onChange:t=>ee(t.target.value),className:"w-10 h-10 border-none bg-transparent cursor-pointer"}),e.jsx("span",{className:"text-sm font-semibold",children:k})]})]}),e.jsxs("div",{className:"space-y-2 col-span-2 border-t border-neutral-200 dark:border-neutral-800 pt-6",children:[e.jsx("h4",{className:"text-sm font-bold text-neutral-800 dark:text-neutral-200",children:"Custom Landing Page Hero Content"}),e.jsx("p",{className:"text-xs text-neutral-400",children:"Override the main landing page hero title and description message."}
1),e.jsxs("div",{className:"space-y-4 mt-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-semibold",children:"Hero Title"}),e.jsx("input",{type:"text",value:Ze,onChange:t=>et(t.target.value),placeholder:"e.g. Get active buyers today, dominate search engines tomorrow.",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none focus:border-brand-primary text-sm"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-semibold",children:"Hero Description"}),e.jsx("textarea",{value:tt,onChange:t=>at(t.target.value),placeholder:"e.g. Monitor and engage active leads on Reddit, LinkedIn, Facebook, and X in real-time.",rows:3,className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none focus:border-brand-primary text-sm"})]})]})]}),e.jsx("div",{className:"space-y-2 col-span-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"pricingEnabled",checked:Ke,onChange:t=>Oe(t.target.checked),className:"w-4 h-4 rounded text-brand-primary accent-brand-primary"}),e.jsx("label",{htmlFor:"pricingEnabled",className:"text-sm font-semibold",children:"Enable Custom Pricing Landing Page"})]})}),e.jsxs("div",{className:"space-y-3 col-span-2 border-t border-neutral-200 dark:border-neutral-800 pt-6",children:[e.jsx("h4",{className:"text-sm font-bold text-neutral-800 dark:text-neutral-200",children:"Custom Header Navigation Links"}),e.jsx("p",{className:"text-xs text-neutral-400",children:"Add external links or custom navigation headers to display on your landing page."}),e.jsxs("div",{className:"space-y-2",children:[y.map((t,s)=>e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("input",{type:"text",value:t.label,placeholder:"Label (e.g. Features)",onChange:l=>{const r=[...y];r[s].label=l.target.value,_(r)},className:"flex-1 px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg text-sm"}),e.jsx("input",{type:"text",value:t.url,placeholder:"URL (e.g. #features or /custom)",onChange:l=>{const r=[...y];r[s].url=l.target.value,_(r)},className:"flex-2 px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg text-sm"}),e.jsx("button",{type:"button",onClick:()=>_(y.filter((l,r)=>r!==s)),className:"px-3 py-2 text-red-550 hover:text-red-700 text-sm font-bold cursor-pointer",children:"Remove"})]},s)),e.jsx("button",{type:"button",onClick:()=>_([...y,{label:"",url:""}]),className:"text-brand-primary text-xs font-bold hover:underline cursor-pointer",children:"+ Add Header Link"})]})]}),e.jsxs("div",{className:"space-y-3 col-span-2 border-t border-neutral-200 dark:border-neutral-800 pt-6",children:[e.jsx("h4",{className:"text-sm font-bold text-neutral-800 dark:text-neutral-200",children:"Custom Footer Navigation Links"}),e.jsx("p",{className:"text-xs text-neutral-400",children:"Add links for your footer, such as social handles or company info pages."}),e.jsxs("div",{className:"space-y-2",children:[f.map((t,s)=>e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("input",{type:"text",value:t.label,placeholder:"Label (e.g. Twitter)",onChange:l=>{const r=[...f];r[s].label=l.target.value,C(r)},className:"flex-1 px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg text-sm"}),e.jsx("input",{type:"text",value:t.url,placeholder:"URL (e.g. https://twitter.com/acme)",onChange:l=>{const r=[...f];r[s].url=l.target.value,C(r)},className:"flex-2 px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg text-sm"}),e.jsx("button",{type:"button",onClick:()=>C(f.filter((l,r)=>r!==s)),className:"px-3 py-2 text-red-550 hover:text-red-700 text-sm font-bold cursor-pointer",children:"Remove"})]},s)),e.jsx("button",{type:"button",onClick:()=>C([...f,{label:"",url:""}]),className:"text-brand-primary text-xs font-bold hover:underline cursor-pointer",children:"+ Add Footer Link"})]})]}),e.jsxs("div",{className:"space-y-2 col-span-2 border-t border-neutral-200 dark:border-neutral-800 pt-6",children:[e.jsx("label",{className:"text-sm font-bold block text-neutral-800 dark:text-neutral-200",children:"Privacy Policy Document Content"}),e.jsx("p",{className:"text-xs text-neutral-400",children:"Specify your agency's custom Privacy Policy statement (Markdown or HTML allowed)."}),e.jsx("textarea",{value:Ye,onChange:t=>Xe(t.target.value),placeholder:"Acme Agency values your privacy...",rows:6,className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent roun
1ded-lg focus:outline-none focus:border-brand-primary text-sm font-mono text-neutral-800 dark:text-neutral-100"})]}),e.jsxs("div",{className:"space-y-2 col-span-2 border-t border-neutral-200 dark:border-neutral-800 pt-6",children:[e.jsx("label",{className:"text-sm font-bold block text-neutral-800 dark:text-neutral-200",children:"Terms of Service Document Content"}),e.jsx("p",{className:"text-xs text-neutral-400",children:"Specify your agency's custom Terms of Service statement (Markdown or HTML allowed)."}),e.jsx("textarea",{value:Je,onChange:t=>Qe(t.target.value),placeholder:"Welcome to Acme Agency. By using our website...",rows:6,className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none focus:border-brand-primary text-sm font-mono text-neutral-800 dark:text-neutral-100"})]})]}),e.jsx("div",{className:"flex justify-start",children:e.jsx("button",{type:"submit",disabled:p,className:"bg-brand-primary text-white px-6 py-2.5 rounded-lg text-sm font-bold shadow-md hover:bg-opacity-95 cursor-pointer",children:p?"Saving...":"Save Branding"})})]}),m==="keys"&&e.jsx("div",{className:"space-y-6",children:e.jsxs("form",{onSubmit:t=>Et(t,!1),className:"bg-white dark:bg-neutral-900 p-6 rounded-xl border border-neutral-200 dark:border-neutral-800 shadow-sm space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center border-b dark:border-neutral-800 pb-3",children:[e.jsx("h3",{className:"text-lg font-bold",children:"API & Search Integration Keys"}),A?e.jsx("span",{className:"bg-emerald-50 dark:bg-emerald-950/30 text-emerald-600 dark:text-emerald-400 border border-emerald-250 dark:border-emerald-800/50 text-xs font-bold px-3 py-1 rounded-full flex items-center gap-1",children:"Validated ✅"}):e.jsx("span",{className:"bg-rose-50 dark:bg-rose-950/30 text-rose-600 dar
1k:text-rose-400 border border-rose-250 dark:border-rose-800/50 text-xs font-bold px-3 py-1 rounded-full flex items-center gap-1",children:"Unverified ⚠️"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[e.jsxs("div",{className:"space-y-4 border-b dark:border-neutral-800 pb-5",children:[e.jsx("h4",{className:"font-bold text-sm text-neutral-800 dark:text-neutral-200",children:"Apify Integration & Fetch Speed"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 max-w-3xl",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500 block",children:"Apify API Token"}),e.jsx("input",{type:"password",value:j,onChange:t=>Se(t.target.value),placeholder:"apify_api_...",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none text-sm bg-white dark:bg-neutral-800"}),!j.trim()&&e.jsx("p",{className:"text-[11px] text-red-500 font-medium mt-1",children:"* Apify API Token is required to configure opportunity speeds and enable fetching for clients."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500 block",children:"Client Opportunity Fetch Speed (Interval)"}),e.jsxs("select",{value:He,onChange:t=>{Ge(parseInt(t.target.value)),qe("fast")},className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none focus:border-brand-primary text-sm bg-white dark:bg-neutral-800",children:[e.jsx("option",{value:1,children:"Every 1 hour"}),e.jsx("option",{value:2,children:"Every 2 hours"}),e.jsx("option",{value:3,children:"Every 3 hours"}),e.jsx("option",{value:4,children:"Every 4 hours"}),e.jsx("option",{value:5,children:"Every 5 hours"}),e.jsx("option",{value:6,children:"Every 6 hours"}),e.jsx("option",{value:12,children:"Every 12 hours"}),e.jsx("option",{value:24,children:"Every 24 hours"})]}),e.jsx("p",{className:"text-[11px] text-neutral-500 mt-1",children:"Configures custom fast-mode opportunity scan rate intervals for client accounts."})]})]})]}),e.jsxs("div",{className:"space-y-4 pb-2",children:[e.jsx("h4",{className:"font-bold text-sm text-neutral-800 dark:text-neutral-200",children:"Isolated AI Platform Keys"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500 block",children:"Analysis AI Provider & Token (For opportunities & content generation)"}),e.jsxs("div",{className:"flex gap-2 max-w-xl",children:[e.jsxs("select",{value:Y,onChange:t=>Pe(t.target.value),className:"bg-transparent border border-neutral-250 dark:border-neutral-700 px-3 py-2 rounded-lg text-xs",children:[e.jsx("option",{value:"openai",children:"OpenAI"}),e.jsx("option",{value:"gemini",children:"Gemini"})]}),e.jsx("input",{type:"password",value:X,onChange:t=>Ae(t.target.value),placeholder:"Analysis API Key...",className:"flex-1 px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none text-sm"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500 block",children:"Search Engine AI Visibility Keys (Provide keys for the platforms you wish to support)"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 max-w-xl",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[10px] uppercase font-bold text-neutral-400",children:"OpenAI Key"}),e.jsx("input",{type:"password",value:V,onChange:t=>Ne(t.target.value),placeholder:"sk-proj-...",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-750 bg-transparent rounded-lg focus:outline-none text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[10px] uppercase font-bold text-neutral-400",children:"Gemini Key"}),e.jsx("input",{type:"password",value:q,onChange:t=>we(t.target.value),placeholder:"AIzaSy...",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-750 bg-transparent roun
1ded-lg focus:outline-none text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[10px] uppercase font-bold text-neutral-400",children:"Claude Key"}),e.jsx("input",{type:"password",value:H,onChange:t=>_e(t.target.value),placeholder:"sk-ant-...",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-750 bg-transparent rounded-lg focus:outline-none text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[10px] uppercase font-bold text-neutral-400",children:"Perplexity Key"}),e.jsx("input",{type:"password",value:G,onChange:t=>Ce(t.target.value),placeholder:"pplx-...",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-750 bg-transparent rounded-lg focus:outline-none text-sm"})]})]})]})]})]}),e.jsx("div",{className:"flex justify-start pt-2 border-t dark:border-neutral-800",children:e.jsx("button",{type:"submit",disabled:L,className:"bg-brand-primary text-white px-6 py-2.5 rounded-lg text-sm font-bold shadow-md hover:bg-opacity-95 disabled:opacity-50 flex items-center gap-2 cursor-pointer",children:L?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Validating API Keys..."]}):"Validate & Save API Keys"})})]})}),m==="billing"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 rounded-2xl p-6 shadow-sm space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-extrabold text-base text-neutral-900 dark:text-neutral-100",children:"Client Signup Flow Configuration"}),e.jsx("p",{className:"text-xs text-neutral-400 mt-1",children:"Configure how new client accounts are registered and activated when they sign up through your whitelabel landing page."})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"flex items-start justify-between p-4 bg-neutral-50 dark:bg-neutral-900/50 rounded-xl border border-neutral-150 dark:border-neutral-800",children:[e.jsxs("div",{className:"space-y-0.5 max-w-[85%]",children:[e.jsx("label",{className:"text-sm font-bold text-neutral-850 dark:text-neutral-200",children:"Enable Client Registration"}),e.jsx("p",{className:"text-[11px] text-neutral-400 leading-normal",children:"Allow new clients to register directly on your whitelabel portal."})]}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer mt-1",children:[e.jsx("input",{type:"checkbox",checked:We,onChange:t=>Be(t.target.checked),className:"sr-only peer"}),e.jsx("div",{className:"w-10 h-5.5 bg-neutral-200 dark:bg-neutral-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-neutral-300 after:border after:rounded-full after:h-4.5 after:w-4.5 after:transition-all peer-checked:bg-brand-primary"})]})]}),e.jsxs("div",{className:"flex items-start justify-between p-4 bg-neutral-50 dark:bg-neutral-900/50 rounded-xl border border-neutral-150 dark:border-neutral-800",children:[e.jsxs("div",{className:"space-y-0.5 max-w-[85%]",children:[e.jsx("label",{className:"text-sm font-bold text-neutral-850 dark:text-neutral-200",children:"Allow Registration Without Upfront Payment"}),e.jsx("p",{className:"text-[11px] text-neutral-400 leading-normal",children:"Allow signups even if Stripe plans/payments are not set up yet (accounts will default to active status)."})]}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer mt-1",children:[e.jsx("input",{type:"checkbox",checked:Re,onChange:t=>Ve(t.target.checked),className:"sr-only peer"}),e.jsx("div",{className:"w-10 h-5.5 bg-neutral-200 dark:bg-neutral-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-neutral-300 after:border after:rounded-full after:h-4.5 after:w-4.5 after:transition-all peer-checked:bg-brand-primary"})]})]}),e.jsxs("div",{className:"flex items-start justify-between p-4 bg-neutral-50 dark:bg-neutral-900/50 rounded-xl border border-neutral-150 dark:border-neutral-800",children:[e.jsxs("div",{className:"space-y-0.5 max-w-[85%]",children:[e.jsx("label",{className:"text-sm font-bold text-neutral-850 dark:text-neutral-200",children:"Enable Free Trial Period"}),e.jsx("p",{className:"text-[11px] text-neutral-400 leading-normal",children:"Activate a temporary trial plan for new signups using your API credentials."})]}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer mt-1",children:[e.jsx("input",{type:"checkbox",checked:te,onChange:t=>$e(t.target.checked),className:"sr-only peer"}),e.jsx("div",{className:"w-10 h-5.5 bg-neutral-200 dark:bg-neutral-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-neutral-300 after:border after:rounded-full after:h-4.5 after:w-4.5 after:transition-all peer-checked:bg-brand-primary"})]})]}),te&&e.jsxs("div",{className:"p-4 bg-neutral-50 dark:bg-neutral-900/50 rounded-xl border border-neutral-150 dark:border-neutral-800 flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"text-sm font-bold text-neutral-850 dark:text-neutral-200",children:"Trial Duration"}),e.jsx("p",{className:"text-[11px] text-neutral-400",children:"Specify trial length in days."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",min:1,max:90,value:Ue,onChange:t=>ze(parseInt(t.target.value)||3),className:"w-20 px-3 py-1.5 text-sm bg-white dark:bg-neutral-800 border rounded-lg focus:outline-none focus:ring-2 focus:ring-brand-primary text-center font-bold"}),e.jsx("span",{className:"text-xs text-neutral-450 font-semibold",children:"Days"})]})]})]}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx("button",{onClick:()=>B(),className:"bg-brand-primary text-white text-xs font-bold px-5 py-2.5 rounded-xl hover:bg-opacity-90 shadow-sm transition-all",children:"Save Signup Configuration"})})]}),e.jsxs("form",{onSubmit:t=>Et(t,!0),className:"bg-white dark:bg-neutral-900 p-6 rounded-xl border border-neutral-200 dark:border-neutral-800 shadow-sm space-y-6",children:[e.jsxs("div",{className:"border-b dark:border-neutral-800 pb-3",children:[e.jsx("h3",{className:"text-lg font-bold",children:"Stripe Payments Setup (For Client Subscriptions)"}),e.jsx("p",{className:"text-xs text-neutral-400 mt-1",children:"Configure Stripe credentials to allow your clients to buy custom agency plan subscriptions."})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"Stripe Publishable Key"}),e.jsx("input",{type:"text",value:J,onChange:t=>Ie(t.target.value),placeholder:"pk_live_...",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent roun
1ded-lg focus:outline-none text-sm bg-white dark:bg-neutral-800"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"Stripe Secret Key"}),e.jsx("input",{type:"password",value:Q,onChange:t=>Fe(t.target.value),placeholder:"sk_live_...",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none text-sm bg-white dark:bg-neutral-800"})]})]}),e.jsxs("div",{className:"space-y-1 max-w-xl",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500 block",children:"Stripe Webhook Signing Secret"}),e.jsx("input",{type:"password",value:Z,onChange:t=>Ee(t.target.value),placeholder:"whsec_...",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none text-sm bg-white dark:bg-neutral-800"})]}),e.jsxs("div",{className:"bg-neutral-50 dark:bg-neutral-800 p-4 rounded-xl max-w-xl text-xs space-y-1",children:[e.jsx("span",{className:"font-bold text-neutral-700 dark:text-neutral-300",children:"Stripe Webhook Target:"}),e.jsxs("div",{className:"font-mono text-[10px] break-all text-neutral-600 dar
1k:text-neutral-400",children:[(((Dt=(Lt=import.meta)==null?void 0:Lt.env)==null?void 0:Dt.VITE_API_URL)||"https://api.growlytics.app/api").replace("pageoptixapi.test","api.growlytics.app"),"/webhooks/agency/",z==null?void 0:z.id]})]}),e.jsx("div",{className:"flex justify-start pt-2 border-t dark:border-neutral-800",children:e.jsx("button",{type:"submit",disabled:L,className:"bg-brand-primary text-white px-6 py-2.5 rounded-lg text-sm font-bold shadow-md hover:bg-opacity-95 disabled:opacity-50 flex items-center gap-2 cursor-pointer",children:L?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Saving Stripe Credentials..."]}):"Save Billing Credentials"})})]})]}),m==="smtp"&&e.jsxs("form",{onSubmit:B,className:"bg-white dark:bg-neutral-900 p-6 rounded-xl border border-neutral-200 dark:border-neutral-800 shadow-sm space-y-6",children:[e.jsx("h3",{className:"text-lg font-bold",children:"SMTP Custom Mail Server Setup"}),e.jsx("p",{className:"text-xs text-neutral-400",children:"Configure your agency's SMTP to send notifications (daily digests, instant opportunities) from your custom sender email."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 max-w-3xl",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"SMTP Host"}),e.jsx("input",{type:"text",value:nt,onChange:t=>ot(t.target.value),placeholder:"smtp.mailgun.org",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"SMTP Port"}),e.jsx("input",{type:"number",value:it,onChange:t=>dt(parseInt(t.target.value)),placeholder:"587",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"SMTP Username"}),e.jsx("input",{type:"text",value:ct,onChange:t=>ut(t.target.value),placeholder:"[email protected]",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"SMTP Password"}),e.jsx("input",{type:"password",value:pt,onChange:t=>xt(t.target.value),placeholder:"••••••••••••••",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"SMTP Encryption"}),e.jsxs("select",{value:mt,onChange:t=>bt(t.target.value),className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none text-sm",children:[e.jsx("option",{value:"tls",children:"TLS"}),e.jsx("option",{value:"ssl",children:"SSL"}),e.jsx("option",{value:"none",children:"None"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"From Address (Sender Email)"}),e.jsx("input",{type:"email",value:ht,onChange:t=>gt(t.target.value),placeholder:"[email protected]",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg focus:outline-none text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"From Name (Sender Name)"}),e.jsx("input",{type:"text",value:yt,onChange:t=>ft(t.target.value),placeholder:"Acme Alerts",className:"w-full px-4 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent roun
1ded-lg focus:outline-none text-sm"})]})]}),e.jsx("div",{className:"flex justify-start",children:e.jsx("button",{type:"submit",disabled:p,className:"bg-brand-primary text-white px-6 py-2.5 rounded-lg text-sm font-bold shadow-md hover:bg-opacity-95",children:p?"Saving...":"Save SMTP Configuration"})})]}),Yt&&Kt.createPortal(e.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center z-[9999] p-4",children:e.jsxs("div",{className:"bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-800 rounded-2xl p-6 max-w-md w-full space-y-4 shadow-xl",children:[e.jsx("h3",{className:"text-lg font-bold",children:g?"Edit Client Sub-account":"Add Client Sub-account"}),e.jsxs("form",{onSubmit:ia,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"Client Name"}),e.jsx("input",{type:"text",required:!0,value:Nt,onChange:t=>le(t.target.value),className:"w-full px-3 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"Client Email (Login ID)"}),e.jsx("input",{type:"email",required:!0,value:wt,onChange:t=>ne(t.target.value),className:"w-full px-3 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg text-sm"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"Password"}),e.jsx("input",{type:"password",required:!g,value:oe,onChange:t=>ie(t.target.value),placeholder:g?"Leave blank to keep current":"",className:"w-full px-3 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg text-sm"})]}),x.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-neutral-500",children:"Select Custom Plan"}),e.jsxs("select",{required:!0,value:de,onChange:t=>K(t.target.value),className:"w-full px-3 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg text-sm",children:[e.jsx("option",{value:"",children:"-- Select custom plan --"}),x.map(t=>e.jsxs("option",{value:t.id,children:[t.name," ($",t.price,"/mo)"]},t.id))]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx("button",{type:"button",onClick:()=>Mt(),className:"px-4 py-2 border border-neutral-200 dark:border-neutral-700 rounded-lg text-sm font-semibold",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:p,className:"bg-brand-primary text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-opacity-90 disabled:opacity-50",children:p?"Saving...":g?"Save Changes":"Create Client"})]})]})]})}),document.body),aa&&Kt.createPortal(e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-md flex items-center justify-center z-[9999] p-4 animate-fadeIn",children:e.jsxs("div",{className:"bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-800 rounded-2xl shadow-2xl max-w-2xl w-full flex flex-col max-h-[85vh] overflow-hidden transform transition-all duration-300 scale-100",children:[e.jsxs("div",{className:"flex justify-between items-center px-6 py-4 border-b border-neutral-150 dark:border-neutral-800",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-extrabold text-neutral-900 dark:text-neutral-100",children:F?"Edit Custom Billing Plan":"Create Custom Billing Plan"}),e.jsx("p",{className:"text-[11px] text-neutral-450 dark:text-neutral-450 mt-0.5",children:"Define features and resources for your custom subscription tier."})]}),e.jsx("button",{onClick:()=>fe(),className:"w-8 h-8 rounded-full flex items-center justify-center hover:bg-neutral-100 dark:hover:bg-neutral-800 text-neutral-400 hover:text-neutral-600 dar
1k:hover:text-neutral-200 transition-colors",children:"✕"})]}),e.jsxs("form",{onSubmit:la,className:"flex flex-col flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-1 md:col-span-1",children:[e.jsx("label",{className:"text-xs font-bold text-neutral-500 block",children:"Plan Name"}),e.jsx("input",{type:"text",required:!0,value:ue,onChange:t=>pe(t.target.value),placeholder:"e.g. Pro Plan",className:"w-full px-3 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg text-sm bg-white dark:bg-neutral-800 focus:ring-2 focus:ring-brand-primary focus:border-transparent outline-none transition-all"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-bold text-neutral-500 block",children:"Monthly Price ($)"}),e.jsx("input",{type:"number",required:!0,value:xe,onChange:t=>me(parseFloat(t.target.value)),className:"w-full px-3 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg text-sm bg-white dark:bg-neutral-800 focus:ring-2 focus:ring-brand-primary focus:border-transparent outline-none transition-all"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-bold text-neutral-500 block",children:"Stripe Price ID (Optional)"}),e.jsx("input",{type:"text",value:be,onChange:t=>he(t.target.value),placeholder:"price_...",className:"w-full px-3 py-2 border border-neutral-250 dark:border-neutral-700 bg-transparent rounded-lg text-sm bg-white dark:bg-neutral-800 focus:ring-2 focus:ring-brand-primary focus:border-transparent outline-none transition-all"})]})]}),e.jsxs("div",{className:"bg-neutral-50 dark:bg-neutral-900/50 border border-neutral-150 dark:border-neutral-800 p-4 rounded-xl space-y-3",children:[e.jsx("h4",{className:"font-extrabold text-xs text-neutral-800 dark:text-neutral-200",children:"Plan Resource Limits"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[10px] text-neutral-450 block font-bold uppercase tracking-wider",children:"Websites Limit"}),e.jsx("input",{type:"number",min:"1",required:!0,value:d.project_limit,onChange:t=>b({...d,project_limit:parseInt(t.target.value)}),className:"w-full px-3 py-2 border rounded-lg text-sm bg-white dark:bg-neutral-800 border-neutral-250 dark:border-neutral-700 focus:ring-2 focus:ring-brand-primary focus:border-transparent outline-none"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[10px] text-neutral-450 block font-bold uppercase tracking-wider",children:"Keywords Limit"}),e.jsx("input",{type:"number",min:"1",required:!0,value:d.keyword_monitor_limit,onChange:t=>b({...d,keyword_monitor_limit:parseInt(t.target.value)}),className:"w-full px-3 py-2 border rounded-lg text-sm bg-white dark:bg-neutral-800 border-neutral-250 dark:border-neutral-700 focus:ring-2 focus:ring-brand-primary focus:border-transparent outline-none"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[10px] text-neutral-450 block font-bold uppercase tracking-wider",children:"Competitors Limit"}),e.jsx("input",{type:"number",min:"1",required:!0,value:d.competitor_monitor_limit,onChange:t=>b({...d,competitor_monitor_limit:parseInt(t.target.value)}),className:"w-full px-3 py-2 border rounded-lg text-sm bg-white dark:bg-neutral-800 border-neutral-250 dark:border-neutral-700 focus:ring-2 focus:ring-brand-primary focus:border-transparent outline-none"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"font-extrabold text-xs text-neutral-800 dark:text-neutral-250",children:"Module & Feature Access Control"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[{id:"feat_opps",key:"opportunities",label:"Opportunities Module",desc:"Allows monitoring social channels for growth leads"},{id:"feat_comp",key:"competitor_activities",label:"Competitor Activities",desc:"Allows monitoring competitor SEO & social changes"},{id:"feat_vis",key:"ai_visibility",label:"AI Visibility Search",desc:"Allows analyzing share of voice on AI search engines"},{id:"feat_content",key:"content_planner",label:"AI Content Planner",desc:"Allows scheduling and drafting optimized articles"},{id:"feat_outreach",key:"backlinks_outreach",label:"Backlink Outreach Manager",desc:"Allows outreach templates and prospects lists"},{id:"feat_net",key:"backlinks_network",label:"Backlink Exchange Network",desc:"Allows publishing link inserts to target sites"}].map(t=>e.jsxs("div",{className:"flex items-start gap-3 p-3 border border-neutral-150 dark:border-neutral-800/80 rounded-xl hover:bg-neutral-50/50 dark:hover:bg-neutral-800/20 transition-colors",children:[e.jsx("input",{type:"checkbox",id:t.
1id,checked:!!d[t.key],onChange:s=>b({...d,[t.key]:s.target.checked}),className:"mt-0.5 w-4 h-4 rounded text-brand-primary accent-brand-primary cursor-pointer"}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{htmlFor:t.id,className:"text-xs font-bold text-neutral-800 dark:text-neutral-200 cursor-pointer",children:t.label}),e.jsx("p",{className:"text-[10px] text-neutral-450 dark:text-neutral-400 leading-normal",children:t.desc})]})]},t.id))})]}),d.opportunities&&e.jsxs("div",{className:"bg-neutral-50/60 dark:bg-neutral-900/30 border border-neutral-150 dark:border-neutral-800 p-4 rounded-xl space-y-3",children:[e.jsx("div",{className:"font-extrabold text-[10px] text-neutral-550 dark:text-neutral-350 uppercase tracking-wider",children:"Enabled Opportunity Channels"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3 text-xs",children:[{id:"opp_tw",key:"opp_channel_twitter",label:"Twitter Channel"},{id:"opp_rd",key:"opp_channel_reddit",label:"Reddit Channel"},{id:"opp_fb",key:"opp_channel_facebook",label:"Facebook Channel"},{id:"opp_li",key:"opp_channel_linkedin",label:"LinkedIn Channel"},{id:"opp_bm",key:"opp_mention_brand",label:"Brand Mentions"},{id:"opp_cm",key:"opp_mention_competitor",label:"Competitor Mentions"}].map(t=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:t.id,checked:!!d[t.key],onChange:s=>b({...d,[t.key]:s.target.checked}),className:"w-4 h-4 rounded text-brand-primary accent-brand-primary cursor-pointer"}),e.jsx("label",{htmlFor:t.id,className:"text-xs text-neutral-700 dark:text-neutral-350 cursor-pointer",children:t.label})]},t.id))})]}),d.competitor_activities&&e.jsxs("div",{className:"bg-neutral-50/60 dark:bg-neutral-900/30 border border-neutral-150 dark:border-neutral-800 p-4 rounded-xl space-y-3",children:[e.jsx("div",{className:"font-extrabold text-[10px] text-neutral-550 dark:text-neutral-350 uppercase tracking-wider",children:"Monitored Competitor Activities"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3 text-xs",children:[{id:"act_web",key:"comp_act_website",label:"Website Changes"},{id:"act_seo",key:"comp_act_seo",label:"SEO Metadata"},{id:"act_pr",key:"comp_act_pricing",label:"Pricing Updates"},{id:"act_soc",key:"comp_act_social",label:"Social Mentions"},{id:"act_np",key:"comp_act_new_page",label:"New Pages Added"},{id:"act_bl",key:"comp_act_backlinks",label:"Backlink Gains"},{id:"act_kw",key:"comp_act_keywords",label:"Keyword Changes"},{id:"act_rv",key:"comp_act_reviews",label:"Reviews & Ratings"},{id:"act_bg",key:"comp_act_blog",label:"Blog Posts"},{id:"act_ga",key:"comp_act_google_ads",label:"Google Search Ads"},{id:"act_ma",key:"comp_act_meta_ads",label:"Meta/Facebook Ads"}].map(t=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:t.id,checked:!!d[t.key],onChange:s=>b({...d,[t.key]:s.target.checked}),className:"w-4 h-4 rounded text-brand-primary accent-brand-primary cursor-pointer"}),e.jsx("label",{htmlFor:t.id,className:"text-xs text-neutral-700 dark:text-neutral-350 cursor-pointer",children:t.label})]},t.id))})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-neutral-150 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-900/60",children:[e.jsx("button",{type:"button",onClick:()=>fe(),className:"px-4 py-2 border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-neutral-800 hover:bg-neutral-50 dark:hover:bg-neutral-700 rounded-xl text-xs font-bold transition-all",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:p,className:"bg-brand-primary text-white px-5 py-2 rounded-xl text-xs font-bold shadow-md hover:bg-opacity-90 disabled:opacity-50 transition-all",children:p?F?"Saving...":"Creating...":F?"Save Changes":"Create Plan"})]})]})]})}),document.body),e.jsx(ba,{isOpen:Zt,onClose:()=>I(!1),onConfirm:O.onConfirm,title:O.title,message:O.message,confirmText:O.confirmText,isLoading:ea})]})}):e.jsx("div",{className:"flex-1 min-h-screen bg-white dark:bg-neutral-950 p-6 flex flex-col justify-center items-center font-sans",children:e.jsxs("div",{className:"max-w-xl w-full backdrop-blur-md bg-white/70 dark:bg-neutral-900/70 border border-neutral-200/50 dark:border-neutral-800/50 rounded-3xl p-8 shadow-[0_20px_50px_rgba(0,0,0,0.05)] dark:shadow-[0_20px_50px_rgba(0,0,0,0.3)] space-y-8 relative overflow-hidden transition-all duration-300",children:[e.jsx("div",{className:"absolute -top-12 -left-12 w-32 h-32 bg-indigo-500/10 rounded-full blur-2xl"}),e.jsx("div",{className:"absolute -top-12 -right-12 w-32 h-32 bg-brand-primary/10 rounded-full blur-2xl"}),e.jsxs("div",{className:"space-y-3 text-center relative z-10",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 roun
1ded-2xl bg-gradient-to-tr from-brand-primary to-orange-400 shadow-md shadow-brand-primary/20 text-white text-2xl font-bold animate-bounce",children:"🚀"}),e.jsx("h2",{className:"text-2xl font-extrabold tracking-tight bg-gradient-to-r from-neutral-900 to-neutral-700 dark:from-white dark:to-neutral-300 bg-clip-text text-transparent",children:"Whitelabel Agency Setup"}),e.jsxs("div",{className:"pt-2 max-w-xs mx-auto",children:[e.jsxs("div",{className:"flex justify-between items-center text-[10px] font-bold text-neutral-400 dark:text-neutral-500 uppercase tracking-widest mb-1.5",children:[e.jsx("span",{children:"Domain Setup"}),e.jsx("span",{children:"Branding"})]}),e.jsx("div",{className:"h-1.5 w-full bg-neutral-200 dark:bg-neutral-800 rounded-full overflow-hidden flex",children:e.jsx("div",{className:"bg-gradient-to-r from-brand-primary to-orange-500 h-full rounded-full transition-all duration-550",style:{width:`${R/2*100}%`}})})]})]}),e.jsxs("div",{className:"relative z-10 min-h-[220px] transition-all duration-300",children:[R===1&&e.jsxs("div",{className:"space-y-5 animate-fadeIn",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-bold text-neutral-800 dark:text-neutral-200",children:"Step 1: Set Company & Portal Domain"}),e.jsx("p",{className:"text-xs text-neutral-400",children:"Establish your agency identity and custom access portal link."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-bold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider block",children:"Agency / Company Name"}),e.jsx("input",{type:"text",value:E,onChange:t=>Tt(t.target.value),placeholder:"e.g. Acme Studio",className:"w-full px-4 py-2.5 border border-neutral-250 dark:border-neutral-800 bg-white/50 dark:bg-neutral-950/50 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-brand-primary/50 focus:border-brand-primary transition-all shadow-sm"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-bold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider block",children:"Auto-Generated Subdomain"}),e.jsxs("div",{className:"flex shadow-sm rounded-xl overflow-hidden border border-neutral-250 dark:border-neutral-800 focus-within:ring-2 focus-within:ring-brand-primary/50 focus-within:border-brand-primary transition-all",children:[e.jsx("input",{type:"text",value:c,onChange:t=>M(t.target.value),placeholder:"acme",className:"flex-1 px-4 py-2.5 bg-white/50 dark:bg-neutral-950/50 text-sm focus:outline-none"}),e.jsx("span",{className:"inline-flex items-center px-4 bg-neutral-100 dark:bg-neutral-900 border-l border-neutral-250 dark:border-neutral-800 text-neutral-500 dark:text-neutral-400 text-sm font-semibold select-none",children:".growlytics.app"})]}),c&&e.jsx("div",{className:"pt-1 flex items-center gap-1.5 text-xs",children:rt?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin h-3.5 w-3.5 text-neutral-500",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),e.jsx("span",{className:"text-neutral-500",children:"Checking availability..."})]}):ae===!0?e.jsxs("span",{className:"text-emerald-500 font-medium flex items-center gap-1",children:["✅ ",lt]}):ae===!1?e.jsxs("span",{className:"text-red-500 font-medium flex items-center gap-1",children:["❌ ",lt]}):null})]}),e.jsx("button",{disabled:!E||!c||ae!==!0||rt,onClick:()=>ke(2),className:"w-full bg-gradient-to-r from-brand-primary to-orange-500 text-white py-3 rounded-xl font-bold hover:shadow-lg hover:shadow-brand-primary/20 hover:opacity-95 transition-all disabled:opacity-50 text-sm mt-2 cursor-pointer",children:"Next: Brand Styles & Assets →"})]}),R===2&&e.jsxs("div",{className:"space-y-5 animate-fadeIn",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-bold text-neutral-800 dark:text-neutral-200",children:"Step 2: Upload Branding Assets"}),e.jsx("p",{className:"text-xs text-neutral-400",children:"Override Growlytics theme assets with your custom branding values."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-bold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider block",children:"Logo Image"}),e.jsxs("div",{className:"border-2 border-dashed border-neutral-200 dark:border-neutral-800 rounded-xl p-3 text-center hover:bg-neutral-50 dark:hover:bg-neutral-900/55 transition-all relative group",children:[e.jsx("input",{type:"file",accept:"image/*",onChange:t=>
1$(t,"logo"),className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"}),e.jsx("div",{className:"text-xs text-neutral-500 group-hover:text-neutral-700",children:"Choose File"})]}),N&&e.jsx("img",{src:N,className:"h-8 mx-auto object-contain mt-2",alt:"Preview Logo"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-bold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider block",children:"Favicon Icon"}),e.jsxs("div",{className:"border-2 border-dashed border-neutral-200 dark:border-neutral-800 rounded-xl p-3 text-center hover:bg-neutral-50 dark:hover:bg-neutral-900/55 transition-all relative group",children:[e.jsx("input",{type:"file",accept:"image/*",onChange:t=>$(t,"favicon"),className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"}),e.jsx("div",{className:"text-xs text-neutral-500 group-hover:text-neutral-700",children:"Choose File"})]}),w&&e.jsx("img",{src:w,className:"h-6 mx-auto object-contain mt-2",alt:"Preview Favicon"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-bold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider block",children:"Primary Brand Color"}),e.jsxs("div",{className:"flex gap-4 items-center bg-white/50 dark:bg-neutral-950/50 p-2.5 rounded-xl border border-neutral-200 dark:border-neutral-800",children:[e.jsx("input",{type:"color",value:k,onChange:t=>ee(t.target.value),className:"w-10 h-10 border-none bg-transparent cursor-pointer rounded-lg overflow-hidden"}),e.jsx("span",{className:"text-sm font-semibold tracking-wider",children:k})]})]}),e.jsxs("div",{className:"flex justify-between gap-4 pt-2",children:[e.jsx("button",{onClick:()=>ke(1),className:"w-1/2 border border-neutral-250 dark:border-neutral-800 py-3 rounded-xl font-bold hover:bg-neutral-50 dark:hover:bg-neutral-900 text-sm transition-all cursor-pointer",children:"← Back"}),e.jsx("button",{disabled:p,onClick:()=>B(),className:"w-1/2 bg-gradient-to-r from-indigo-600 to-violet-600 text-white py-3 rounded-xl font-bold hover:shadow-lg hover:opacity-95 transition-all text-sm cursor-pointer",children:p?"Saving...":"Complete Onboarding!"})]})]})]})]})})};export{ja 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.