PageSourceSearch

https://quickgrowth.ai/static/js/2773.4f4eae67.chunk.js

js quickgrowth.ai collected 2026-10-05 15:26:04 UTC 11,552 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkquickGrowth=self.webpackChunkquickGrowth||[]).push([[2773],{2773(e,l,t){t.r(l),t.d(l,{default:()=>d});var o=t(2555),r=t(5043),s=t(5016),a=t(3976),n=t(579);const i=[{key:"web_design",label:"Web Design"},{key:"seo",label:"SEO"},{key:"social_media",label:"Social Media"},{key:"branding",label:"Branding"},{key:"mobile_app",label:"Mobile App"},{key:"ecommerce",label:"E-Commerce"},{key:"ppc",label:"PPC / Paid Ads"},{key:"ai_chatbot",label:"AI Chatbot"},{key:"hosting",label:"Hosting"},{key:"content",label:"Content"},{key:"other",label:"Other"}];const d=function(){var e,l,t,d,c;const{user:m,profile:u,setProfile:x}=(0,s.As)(),[b,p]=(0,r.useState)(!1),[h,y]=(0,r.useState)(!1),[v,f]=(0,r.useState)(""),[g,j]=(0,r.useState)(""),[w,N]=(0,r.useState)({full_name:(null===u||void 0===u?void 0:u.full_name)||"",phone:(null===u||void 0===u?void 0:u.phone)||"",company_name:(null===u||void 0===u?void 0:u.company_name)||""}),[k,_]=(0,r.useState)((()=>{const e=null===u||void 0===u?void 0:u.specialties;if(Array.isArray(e))return e;try{return JSON.parse(e||"[]")}catch(l){return[]}})),[S,C]=(0,r.useState)(!1),[A,D]=(0,r.useState)(""),[P,E]=(0,r.useState)(!1),I="sales_rep"===(null===u||void 0===u?void 0:u.role),L="contractor"===(null===u||void 0===u?void 0:u.role)||"contractor_admin"===(null===u||void 0===u?void 0:u.role),M=e=>{N((0,o.A)((0,o.A)({},w),{},{[e.target.name]:e.target.value}))},T=(0,r.useCallback)((async()=>{C(!0);try{const{error:e}=await a.supabase.from("profiles").update({specialties:k,updated_at:(new Date).toISOString()}).eq("id",m.id);if(e)throw e;D("Specialties saved!"),setTimeout((()=>D("")),3e3)}catch(e){console.error("Failed to save specialties:",e)}finally{C(!1)}}),[m.id,k]),R={client:"Client",sales_rep:"Sales Representative",admin:"Administrator",contractor:"Contractor",contractor_admin:"Contractors Admin"};return(0,n.jsxs)("div",{className:"max-w-2xl mx-auto space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-2xl font-bold text-primary",children:"My Profile"}),(0,n.jsx)("p",{className:"text-secondary mt-1",children:"View and manage your account information"})]}),v&&(0,n.jsx)("div",{className:"bg-green-500/10 border border-green-500/30 text-green-400 px-4 py-3 rounded-lg text-sm",children:v}),g&&(0,n.jsx)("div",{className:"bg-red-500/10 border border-red-500/30 text-red-400 px-4 py-3 rounded-lg text-sm",children:g}),(0,n.jsxs)("div",{className:"bg-input border border-theme rounded-xl p-6",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-4 mb-6 pb-6 border-b border-theme",children:[(0,n.jsx)("div",{className:"w-16 h-16 rounded-full bg-yellow-500/10 border-2 border-yellow-500/20 flex items-center justify-center",children:(0,n.jsx)("span",{className:"text-yellow-500 text-2xl font-bold",children:(null===u||void 0===u||null===(e=u.full_name)||void 0===e||null===(l=e.charAt(0))||void 0===l?void 0:l.toUpperCase())||(null===m||void 0===m||null===(t=m.email)||void 0===t||null===(d=t.charAt(0))||void 0===d?void 0:d.toUpperCase())||"U"})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-xl font-semibold text-primary",children:(null===u||void 0===u?void 0:u.full_name)||"User"}),(0,n.jsx)("p",{className:"text-yellow-500 text-sm font-medium",children:R[null===u||void 0===u?void 0:u.role]||(null===u||void 0===u?void 0:u.role)}),(0,n.jsx)("p",{className:"text-muted text-sm",children:null===m||void 0===m?void 0:m.email})]})]}),(0,n.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),y(!0),j(""),f("");try{const{error:e}=await a.supabase.from("profiles").update({full_name:w.full_name,phone:w.phone,company_name:w.company_name,updated_at:(new Date).toISOString()}).eq("id",m.id);if(e)throw e;f("Profile updated successfully!"),p(!1),setTimeout((()=>f("")),3e3)}catch(l){j(l.message||"Failed to update profile")}finally{y(!1)}},className:"space-y-5",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-secondary mb-2",children:"Email"}),(0,n.jsx)("input",{type:"email",value:(null===m||void 0===m?void 0:m.email)||"",disabled:!0,className:"w-full bg-card border border-theme-hover text-muted rounded-lg px-4 py-3 cursor-not-allowed"}),(0,n.jsx)("p",{className:"text-xs text-muted mt-1",children:"Email cannot be changed"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-secondary mb-2",children:"Role"}),(0,n.jsx)("input",{type:"text",value:R[null===u||void 0===u?void 0:u.role]||(null===u||void 0===u?void 0:u.role)||"",disabled:!0,className:"w-full bg-card border border-theme-hover text-muted rounded-lg px-4 py-3 cursor-not-allowed"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-secondary mb-2",children:"Full Name"}),(0,n.jsx)("input",{type:"text",name:"full_name",value:w.full_name,onChange:M,disabled:!b,className:"w-full bg-card border border-theme-hover rounded-lg px-4 py-3 focus:outline-none transition-colors ".concat(b?"text-primary focus:border-yellow-500":"text-secondary cursor-not-allowed")})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-secondary mb-2",children:"Phone"}),(0,n.jsx)("input",{type:"tel",name:"phone",value:w.phone,onChange:M,disabled:!b,placeholder:"Enter your phone number",className:"w-full bg-card border border-theme-hover rounded-lg px-4 py-3 focus:outline-none transition-colors placeholder-muted ".concat(b?"text-primary focus:border-yellow-500":"text-secondary cursor-not-allowed")})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-secondary mb-2",children:"Company Name"}),(0,n.jsx)("input",{type:"text",name:"company_name",value:w.company_name,onChange:M,disabled:!b,placeholder:"Enter your company name",className:"w-full bg-card border border-theme-hover rounded-lg px-4 py-3 focus:outline-none transition-colors placeholder-muted ".concat(b?"text-primary focus:border-yellow-500":"text-secondary cursor-not-allowed")})]}),(null===u||void 0===u?void 0:u.referral_code)&&(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-secondary mb-2",children:"Referral Code"}),(0,n.jsx)("input",{type:"text",value:u.referral_code,disabled:!0,className:"w-full bg-card border border-theme-hover text-yellow-500 rounded-lg px-4 py-3 cursor-not-allowed font-mono"})]}),(0,n.jsx)("div",{className:"flex items-center space-x-3 pt-2",children:b?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"submit",disabled:h,className:"px-6 py-3 bg-yellow-500 text-black font-semibold rounded-lg hover:bg-yellow-400 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:h?"Saving...":"Save Changes"}),(0,n.jsx)("button",{type:"button",onClick:()=>{p(!1),N({full_name:(null===u||void 0===u?void 0:u.full_name)||"",phone:(null===u||void 0===u?void 0:u.phone)||"",company_name:(null===u||void 0===u?void 0:u.company_name)||""}),j("")},className:"px-6 py-3 border border-theme-hover text-secondary rounded-lg hover:text-primary hover:border-theme-hover transition-colors",children:"Cancel"})]}):(0,n.jsx)("button",{type:"button",onClick:()=>p(!0),className:"px-6 py-3 bg-yellow-500 text-black font-semibold rounded-lg hover:bg-yellow-400 transition-colors",children:"Edit Profile"})})]})]}),L&&(0,n.jsxs)("div",{className:"bg-input border border-theme rounded-xl p-6",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-primary",children:"My Specialties"}),A&&(0,n.jsx)("span",{className:"text-xs text-green-400 font-medium",children:A})]}),(0,n.jsx)("p",{className:"text-xs text-muted mb-4",children:"Select the service categories you specialise in. You'll only receive job notifications for matching categories. Leave all unchecked to receive notifications for every job."}),(0,n.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 mb-4",children:i.map((e=>
1{const l=k.includes(e.key);return(0,n.jsxs)("button",{onClick:()=>{return l=e.key,void _((e=>e.includes(l)?e.filter((e=>e!==l)):[...e,l]));var l},className:"flex items-center gap-2 px-3 py-2.5 rounded-xl border text-sm font-medium transition-all text-left ".concat(l?"bg-yellow-500/15 border-yellow-500/40 text-yellow-400":"bg-white/3 border-white/10 text-secondary hover:border-white/20 hover:text-primary"),children:[(0,n.jsx)("span",{className:"w-4 h-4 rounded border flex-shrink-0 flex items-center justify-center transition-colors ".concat(l?"bg-yellow-500 border-yellow-500":"border-white/30"),children:l&&(0,n.jsx)("svg",{className:"w-2.5 h-2.5 text-black",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),e.label]},e.key)}))}),0===k.length&&(0,n.jsx)("p",{className:"text-xs text-yellow-500/70 mb-3",children:"All unchecked \u2014 you'll see notifications for all job types."}),(0,n.jsx)("button",{onClick:T,disabled:S,className:"px-5 py-2 bg-yellow-500 text-black text-sm font-semibold rounded-lg hover:bg-yellow-400 transition-colors disabled:opacity-50",children:S?"Saving\u2026":"Save Specialties"})]}),I&&(0,n.jsx)("div",{className:"bg-input border border-theme rounded-xl p-6",children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-primary mb-1",children:"Dashboard Tour"}),(0,n.jsx)("p",{className:"text-sm text-secondary",children:"Restart the onboarding walkthrough to revisit how the platform works \u2014 leads, pipeline, commissions, and payouts."}),P&&(0,n.jsx)("p",{className:"mt-2 text-xs text-green-400 font-medium",children:"Tour reset. It will start automatically next time you visit your dashboard."})]}),(0,n.jsxs)("button",{type:"button",onClick:()=>{var e;null!==m&&void 0!==m&&m.id&&(localStorage.removeItem((e=m.id,"qg_sales_tutorial_done_".concat(e))),E(!0),setTimeout((()=>E(!1)),4e3))},disabled:P,className:"flex-shrink-0 flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-semibold border border-yellow-500/40 text-yellow-400 bg-yellow-500/10 hover:bg-yellow-500/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),P?"Tour Reset!":"Restart Tour"]})]})}),(0,n.jsxs)("div",{className:"bg-input border border-theme rounded-xl p-6",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-primary mb-2",children:"Account Information"}),(0,n.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-secondary",children:"Member Since"}),(0,n.jsx)("span",{className:"text-primary",children:null!==u&&void 0!==u&&u.created_at?new Date(u.created_at).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}):"-"})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-secondary",children:"Account ID"}),(0,n.jsx)("span",{className:"text-muted font-mono text-xs",children:(null===m||void 0===m||null===(c=m.id)||void 0===c?void 0:c.slice(0,8))||"-"})]})]})]})]})}}}]);
2//# sourceMappingURL=2773.4f4eae67.chunk.js.map

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.