PageSourceSearch

https://app.repairsnap.ai/assets/settings-vg0HkfwX.js

js repairsnap.ai collected 2026-10-05 14:21:11 UTC 23,489 bytes, 1 lines download raw bytes

1import{r as s,j as e,B as E,ac as Ce,ad as Se,C as N,I as k,n as ke,ae as Ee,b as Me,af as Le,a9 as Re,P as V,H as ae,L as _,ag as Be,ah as De,ai as I,aj as $,ak as Pe,al as Ae,a1 as Te}from"./index-BTqgdxf7.js";import{C as Ie}from"./chevron-right-De9wuZEB.js";function $e(i){const l=Array.from({length:25},()=>Array(25).fill(!1)),v=(r,h)=>{for(let n=0;n<7;n++)for(let o=0;o<7;o++){const m=n===0||n===6||o===0||o===6,w=n>=2&&n<=4&&o>=2&&o<=4;l[r+n][h+o]=m||w}};v(0,0),v(0,18),v(18,0);for(let r=8;r<17;r++)l[6][r]=r%2===0,l[r][6]=r%2===0;const x=18;for(let r=-2;r<=2;r++)for(let h=-2;h<=2;h++){const n=Math.abs(r)===2||Math.abs(h)===2,o=r===0&&h===0;l[x+r][x+h]=n||o}let g=0;for(let r=0;r<i.length;r++)g=(g<<5)-g+i.charCodeAt(r)|0;const p=Math.abs(g);let f=0;for(let r=24;r>=1;r-=2){const h=r===6?r-1:r;for(let n=0;n<25;n++)for(let o=0;o<=1;o++){const m=h-o;if(m<0||m>=25||Fe(n,m,25))continue;const y=(f<i.length*8?i.charCodeAt(Math.floor(f/8))>>7-f%8&1:(p>>f%31^f*7+3)&1)^((n+m)%2===0?1:0);l[n][m]=y===1,f++}}return l}function Fe(i,a,l){return i<9&&a<9||i<9&&a>=l-8||i>=l-8&&a<9||i===6||a===6||Math.abs(i-18)<=2&&Math.abs(a-18)<=2}function ze({url:i,size:a=200,shopName:l}){const v=s.useRef(null),x=s.useMemo(()=>$e(i),[i]),g=x.length,p=a/(g+2),f=p,r=s.useCallback(async()=>{if(!v.current)return;const n=document.createElement("canvas"),o=4;n.width=a*o,n.height=a*o;const m=n.getContext("2d");if(!m)return;m.fillStyle="#ffffff",m.fillRect(0,0,n.width,n.height),m.fillStyle="#000000";for(let y=0;y<g;y++)for(let d=0;d<g;d++)x[y][d]&&m.fillRect((f+d*p)*o,(f+y*p)*o,p*o,p*o);const w=document.createElement("a");w.download=`${l?l.replace(/\s+/g,"-").toLowerCase():"repairsnap"}-qr-code.png`,w.href=n.toDataURL("image/png"),w.click()},[x,a,g,p,f,l]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-white rounded-xl p-4 inline-block",children:e.jsxs("svg",{ref:v,width:a,height:a,viewBox:`0 0 ${a} ${a}`,xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{width:a,height:a,fill:"white"}),x.map((h,n)=>h.map((o,m)=>o?e.jsx("rect",{x:f+m*p,y:f+n*p,width:p,height:p,fill:"black"},`${n}-${m}`):null))]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(E,{variant:"outline",size:"sm",onClick:r,children:"Download as PNG"}),e.jsx("p",{className:"text-xs text-muted",children:"Print this QR code and place it in your waiting area, front desk, or on business cards. Customers can scan it to get an instant repair estimate from their phone."})]})]})}function Ue({shopId:i}){const[a,l]=s.useState([]),[v,x]=s.useState(!0),[g,p]=s.useState(""),[f,r]=s.useState(!1),[h,n]=s.useState(""),[o,m]=s.useState("");s.useEffect(()=>{let d=!1;async function j(){try{const S=await Ee(i);d||l(S.data??[])}catch{}finally{d||x(!1)}}return j(),()=>{d=!0}},[i]);const w=s.useCallback(async d=>{if(d.preventDefault(),!!g.trim()){r(!0),n(""),m("");try{const j=await Ce(i,g.trim());l(S=>[j.data,...S]),p(""),m(`Invitation sent to ${g.trim()}`),setTimeout(()=>m(""),3e3)}catch(j){n(j instanceof Error?j.message:"Failed to send invitation")}finally{r(!1)}}},[i,g]),y=s.useCallback(async d=>{try{await Se(i,d),l(j=>j.filter(S=>S.id!==d))}catch(j){n(j instanceof Error?j.message:"Failed to remove member")}},[i]);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(N,{children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-3",children:"Invite Team Member"}),e.jsx("p",{className:"text-sm text-muted mb-4",children:"Staff members can view conversations, manage leads, and track appointments. They cannot change shop settings."}),e.jsxs("form",{onSubmit:w,className:"flex items-end gap-3",children:[e.jsx("div",{className:"flex-1",children:e.jsx(k,{id:"invite-email",label:"Email address",type:"email",value:g,onChange:d=>p(d.target.value),placeholder:"[email protected]",className:"bg-surface"})}),e.jsx(E,{type:"submit",loading:f,loadingText:"Sending...",size:"sm",children:"Send Invite"})]}),h&&e.jsx("p",{className:"text-sm text-destructive-text mt-2",children:h}),o&&e.jsx("p",{className:"text-sm text-success-text mt-2",children:o})]}),e.jsxs(N,{padding:"none",children:[e.jsx("div",{className:"px-6 py-4 border-b border-border",children:e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Team Members"})}),v?e.jsx("div",{className:"px-6 py-8 text-center text-muted",children:"Loading team..."}):a.length===0?e.jsxs("div",{className:"px-6 py-8 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-elevated flex items-center justify-center mx-auto mb-3",children:e.jsx("svg",{className:"w-6 h-6 text-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 
10 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),e.jsx("p",{className:"text-foreground font-medium mb-1",children:"No team members yet"}),e.jsx("p",{className:"text-sm text-muted",children:"Invite team members to help manage your shop."})]}):e.jsx("div",{className:"divide-y divide-border",children:a.map(d=>e.jsxs("div",{className:"px-6 py-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:d.invitedEmail}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx(ke,{variant:d.role==="owner"?"info":"default",size:"sm",children:d.role==="owner"?"Owner":"Staff"}),d.acceptedAt?e.jsx("span",{className:"text-xs text-success-text",children:"Active"}):e.jsx("span",{className:"text-xs text-warning-text",children:"Pending invite"})]})]}),d.role!=="owner"&&e.jsx("button",{type:"button",onClick:()=>y(d.id),className:"text-xs text-muted hover:text-destructive-text transition-colors px-2 py-1",children:"Remove"})]},d.id))})]})]})}function Oe(i){const a=i.replace(/\D/g,"").slice(0,10);return a.length<=3?a:a.length<=6?`(${a.slice(0,3)}) ${a.slice(3)}`:`(${a.slice(0,3)}) ${a.slice(3,6)}-${a.slice(6)}`}function Y(i){return/^#[0-9A-Fa-f]{6}$/.test(i)}const ne=["#3B82F6","#2563EB","#1D4ED8","#10B981","#059669","#047857","#8B5CF6","#7C3AED","#6D28D9","#F59E0B","#D97706","#B45309","#EF4444","#DC2626","#B91C1C","#06B6D4","#0891B2","#0E7490"],We=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],He=["Collision Repair","Bumper Repair","Dent Repair","Paint Services","Frame Repair","Glass Repair","Mechanical Repair","Detailing","Insurance Claims","Fleet Services"];function Ve(){const{isAuthenticated:i}=Me(),a=s.useRef(null),[l,v]=s.useState(null),[x,g]=s.useState(null),[p,f]=s.useState(!0),[r,h]=s.useState(""),[n,o]=s.useState(""),[m,w]=s.useState(""),[y,d]=s.useState(""),[j,S]=s.useState(""),[z,q]=s.useState(""),[M,L]=s.useState("#3B82F6"),[R,B]=s.useState("#10B981"),[re,D]=s.useState("#3B82F6"),[ie,P]=s.useState("#10B981"),[U,J]=s.useState(null),[O,K]=s.useState(null),[Z,A]=s.useState("idle"),[X,ee]=s.useState(""),[le,T]=s.useState({}),[oe,te]=s.useState([]),[W,ce]=s.useState(""),[de,H]=s.useState(!1),[se,G]=s.useState("#3B82F6"),[me,Q]=s.useState("#3B82F6"),[ue,xe]=s.useState(!0),[he,ge]=s.useState(!0),[pe,fe]=s.useState(!1);s.useEffect(()=>{if(!i)return;let t=!1;async function u(){try{const b=await Pe();if(t)return;if(!b.data||b.data.length===0){h("No shop found. Set up your shop first."),f(!1);return}const c=b.data[0];v(c),o(c.name),w(c.phone),d(c.email),S(c.address??""),q(c.defaultInsurerEmail??""),L(c.primaryColor),B(c.accentColor),D(c.primaryColor),P(c.accentColor),K(c.logoUrl),G(c.primaryColor),Q(c.primaryColor),T(c.businessHours??{}),te(c.services??[]);const[C,we]=await Promise.all([Ae(c.id).catch(()=>({data:null})),Te(c.id).catch(()=>({data:{embedCode:`<script src="https://widget.repairsnap.ai/v1/embed.js" data-shop="${c.slug}"><\/script>`}}))]);t||(g(C.data),ce(we.data.embedCode))}catch(b){t||h(b instanceof Error?b.message:"Failed to load shop")}finally{t||f(!1)}}return u(),()=>{t=!0}},[i]);const be=s.useCallback(t=>{var C;const u=(C=t.target.files)==null?void 0:C[0];if(!u||!["image/png","image/jpeg","image/svg+xml","image/webp"].includes(u.type)||u.size>2*1024*1024)return;J(u);const c=URL.createObjectURL(u);K(c)},[]),ve=s.useCallback(async t=>{if(t.preventDefault(),!!l){A("saving"),ee("");try{let b=(await Le(l.id,{name:n.trim(),phone:m,email:y.trim(),address:j.trim(),primaryColor:M,accentColor:R,defaultInsurerEmail:z.trim()||null})).data;if(U){const c=await Re(l.id,U);b={...b,logoUrl:c.data.logoUrl}}v(b),J(null),A("saved"),setTimeout(()=>A("idle"),2e3)}catch(u){A("error"),ee(u instanceof Error?u.message:"Failed to save changes")}}},[l,n,m,y,j,M,R,z,U]),je=s.useCallback(async()=>{try{await navigator.clipboard.writeText(W),H(!0),setTimeout(()=>H(!1),2e3)}catch{H(!1)}},[W]),Ne=s.useCallback(t=>{te(u=>u.includes(t)?u.filter(b=>b!==t):[...u,t])},[]);if(p)return e.jsx(V,{children:e.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-12",children:[e.jsx(ae,{variant:"heading",className:"w-1/3 mb-8"}),e.jsx(N,{children:[1,2,3,4].map(t=>e.jsx(ae,{variant:"text",className:"mb-3"},t))})]})});if(r||!l)return e.jsx(V,{children:e.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-12 text-center",children:[e.jsx("p",{className:"text-destructive-text mb-4",children:r||"Shop not found"}),e.jsx(_,{to:"/app/shop/setup",children:e.jsx(E,{variant:"primary",children:"Set Up Your Shop"})})]})});const ye=`https://app.repairsnap.ai/widget?shop=${l.slug}`;return e.jsx(V,{children:e.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-8",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted mb-6",children:[e.jsx(_,{to:"/app/shop",className:"hover:text-secondary transition-colors",children:"Dashboard"}),e.jsx(Ie,{className:"w-4 h-4"}),e.jsx("span",{className:"text-foreground",children:"Settings"})]}),e.jsx("h1",{className:"text-2xl font-bold mb-2 text-foreground",children:"Shop Settings"}),e.jsx("p",{className:"text-muted mb-6",children:"Manage your shop profile, widget, notifications, and team."}),e.jsxs(Be,{defaultValue:"profile",children:[e.jsxs(De,{className:"mb-6",children:[e.jsx(I,{value:"profile",children:"Shop Profile"}),e.jsx(I,{value:"widget",children:"Widget & Website"}),e.jsx(I,{value:"notifications",children:"Notifications"}),e.jsx(I,{value:"account",children:"Account"})]}),e.jsx($,{value:"profile",children:e.jsxs("form",{onSubmit:ve,children:[e.jsxs(N,{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4",children:"Logo"}),e.jsxs("div",{className:"flex items-center gap-4",children:[O?e.jsx("img",{src:O,alt:"Logo",className:"h-16 w-auto object-contain rounded-lg"}):e.jsx("div",{className:"w-16 h-16 rounded-lg bg-elevated flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),e.jsxs("div",{children:[e.jsx(E,{type:"button",variant:"outline",size:"sm",onClick:()=>{var t;return(t=a.current)==null?void 0:t.click()},children:O?"Change Logo":"Upload Logo"}),e.jsx("p",{className:"text-xs text-subtle mt-1",children:"PNG, JPG, SVG, or WebP. Min 200x200px, max 2MB."})]}),e.jsx("input",{ref:a,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp",onChange:be,className:"hidden"})]})]}),e.jsxs(N,{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4",children:"Brand Colors"}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-secondary mb-2",children:"Primary Color"}),e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("input",{type:"color",value:M,onChange:t=>{L(t.target.value),D(t.target.value)}
1,className:"w-8 h-8 rounded border border-border cursor-pointer"}),e.jsx(k,{id:"settings-primary-color",value:re,onChange:t=>{D(t.target.value),Y(t.target.value)&&L(t.target.value)},className:"font-mono bg-surface max-w-[120px]"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:ne.slice(0,9).map(t=>e.jsx("button",{type:"button",className:`w-5 h-5 rounded-full border ${M===t?"border-foreground":"border-transparent"}`,style:{backgroundColor:t},onClick:()=>{L(t),D(t)}},t))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-secondary mb-2",children:"Accent Color"}),e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("input",{type:"color",value:R,onChange:t=>{B(t.target.value),P(t.target.value)},className:"w-8 h-8 rounded border border-border cursor-pointer"}),e.jsx(k,{id:"settings-accent-color",value:ie,onChange:t=>{P(t.target.value),Y(t.target.value)&&B(t.target.value)},className:"font-mono bg-surface max-w-[120px]"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:ne.slice(0,9).map(t=>e.jsx("button",{type:"button",className:`w-5 h-5 rounded-full border ${R===t?"border-foreground":"border-transparent"}`,style:{backgroundColor:t},onClick:()=>{B(t),P(t)}},t))})]})]})]}),e.jsxs(N,{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4",children:"Shop Information"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(k,{id:"settings-shop-name",label:"Shop Name",value:n,onChange:t=>o(t.target.value),className:"bg-surface"}),e.jsx(k,{id:"settings-phone",label:"Phone Number",value:m,onChange:t=>w(Oe(t.target.value)),type:"tel",className:"bg-surface"}),e.jsx(k,{id:"settings-email",label:"Email Address",value:y,onChange:t=>d(t.target.value),type:"email",className:"bg-surface"}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"settings-address",className:"block text-sm font-medium text-secondary mb-1.5",children:"Address"}),e.jsx("textarea",{id:"settings-address",value:j,onChange:t=>S(t.target.value),rows:2,className:"flex w-full rounded-lg border border-border bg-surface px-4 py-3 text-foreground placeholder:text-muted transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1 focus-visible:ring-offset-background resize-none"})]}),e.jsxs("div",{children:[e.jsx(k,{id:"settings-insurer-email",label:"Default Insurer Email",value:z,onChange:t=>q(t.target.value),type:"email",placeholder:"[email protected]",className:"bg-surface"}),e.jsx("p",{className:"text-xs text-subtle mt-1",children:"Pre-fills the adjuster address when you send a supplement to the insurer. Leave blank to set it per-supplement."})]})]})]}),e.jsxs(N,{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4",children:"Business Hours"}),e.jsx("div",{className:"space-y-3",children:We.map(t=>{const u=le[t],b=u!=null;return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("label",{className:"flex items-center gap-2 w-28",children:[e.jsx("input",{type:"checkbox",checked:b,onChange:c=>{T(C=>({...C,[t]:c.target.checked?{open:"08:00",close:"17:00"}:null}))},className:"rounded border-border"}),e.jsx("span",{className:"text-sm font-medium text-foreground capitalize",children:t})]}),b&&u&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"time",value:u.open,onChange:c=>T(C=>({...C,[t]:{...u,open:c.target.value}})),className:"px-2 py-1 text-sm rounded border border-border bg-surface text-foreground"}),e.jsx("span",{className:"text-xs text-muted",children:"to"}),e.jsx("input",{type:"time",value:u.close,onChange:c=>T(C=>({...C,[t]:{...u,close:c.target.value}})),className:"px-2 py-1 text-sm rounded border border-border bg-surface text-foreground"})]}),!b&&e.jsx("span",{className:"text-xs text-muted",children:"Closed"})]},t)})})]}),e.jsxs(N,{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4",children:"Services Offered"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:He.map(t=>e.jsxs("label",{className:"flex items-center gap-2 p-2 rounded-lg hover:bg-elevated transition-colors cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:oe.includes(t),onChange:()=>Ne(t),className:"rounded border-border"}),e.jsx("span",{className:"text-sm text-foreground",children:t})]},t))})]}),X&&e.jsx("p",{className:"text-sm text-destructive-text mb-4",children:X}),e.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[e.jsx(E,{type:"submit",loading:Z==="saving",loadingText:"Saving...",children:"Save Changes"}),Z==="saved"&&e.jsx("span",{className:"text-sm text-success-text",children:"Changes saved"})]})]})}),e.jsx($,{value:"widget",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs(N,{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Embed Code"}),e.jsx("p",{className:"text-sm text-muted mb-3",children:"Paste this snippet into your website HTML to display the estimator widget."}),e.jsx("pre",{className:"bg-background rounded-lg p-4 text-sm font-mono text-primary-text overflow-x-auto whitespace-pre-wrap break-all mb-3",children:W}),e.jsx(E,{variant:"outline",size:"sm",onClick:je,children:de?"Copied!":"Copy Embed Code"})]}),e.jsxs(N,{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Widget Appearance"}),e.jsx("p",{className:"text-sm text-muted mb-4",children:"Customize how the chat widget looks on your website."}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-secondary mb-1.5",children:"Widget Color"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"color",value:se,onChange:t=>{G(t.target.value),Q(t.target.value)}
1,className:"w-8 h-8 rounded border border-border cursor-pointer"}),e.jsx(k,{id:"widget-color",value:me,onChange:t=>{Q(t.target.value),Y(t.target.value)&&G(t.target.value)},className:"font-mono bg-surface max-w-[120px]"})]})]}),e.jsx("div",{className:"flex-1 flex justify-end",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 rounded-full shadow-lg flex items-center justify-center cursor-pointer",style:{backgroundColor:se},children:e.jsx("svg",{className:"w-7 h-7 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),e.jsx("span",{className:"text-xs text-muted mt-1 block text-center",children:"Preview"})]})})]})]}),e.jsxs(N,{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"QR Code"}),e.jsx("p",{className:"text-sm text-muted mb-4",children:"Generate a QR code that links directly to your chat widget. Customers can scan it to start a conversation."}),e.jsx(ze,{url:ye,shopName:l.name})]}),x&&e.jsxs(N,{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4",children:"Usage This Month"}),e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{className:"text-sm text-muted",children:[x.estimatesUsed," / ",x.estimatesLimit," estimates used"]}),e.jsxs("span",{className:"text-sm font-mono text-foreground",children:[Math.round(x.estimatesUsed/x.estimatesLimit*100),"%"]})]}),e.jsx("div",{className:"h-2 bg-elevated rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${Math.min(100,x.estimatesUsed/x.estimatesLimit*100)}%`}})}),x.estimatesUsed>=x.estimatesLimit&&e.jsx("p",{className:"text-xs text-warning-text mt-2",children:"You've reached your monthly limit. Additional estimates are $2/each."})]})]})}),e.jsx($,{value:"notifications",children:e.jsxs(N,{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4",children:"Email Notifications"}),e.jsx("p",{className:"text-sm text-muted mb-6",children:"Control which email notifications you receive."}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(F,{id:"notify-new-lead",label:"New lead notification",description:"Get an email when a new customer submits a lead through the widget.",checked:ue,onChange:xe}),e.jsx(F,{id:"notify-appointment",label:"Appointment booked",description:"Get an email when a customer books an appointment through the AI agent.",checked:he,onChange:ge}),e.jsx(F,{id:"notify-daily-digest",label:"Daily digest",description:"Receive a daily summary of leads, appointments, and analytics.",checked:pe,onChange:fe}),e.jsxs("div",{className:"border-t border-border pt-4 mt-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"SMS Alerts"}),e.jsx("p",{className:"text-xs text-muted",children:"SMS notifications for urgent events. Coming soon."}),e.jsx("div",{className:"mt-3 opacity-50 pointer-events-none",children:e.jsx(F,{id:"notify-sms",label:"SMS for new leads",description:"Get a text message when a high-value lead comes in.",checked:!1,onChange:()=>{}})})]})]})]})}),e.jsx($,{value:"account",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs(N,{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Billing"}),e.jsx("p",{className:"text-sm text-muted mb-3",children:"Manage your subscription and payment method."}),e.jsx(_,{to:"/app/settings/billing",children:e.jsx(E,{variant:"outline",size:"sm",children:"Manage Billing"})})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4",children:"Team"}),e.jsx(Ue,{shopId:l.id})]}),e.jsxs(N,{className:"border-destructive/30",children:[e.jsx("h2",{className:"text-lg font-semibold text-destructive-text mb-2",children:"Danger Zone"}),e.jsx("p",{className:"text-sm text-muted mb-4",children:"Permanently delete your shop and all associated data. This action cannot be undone."}),e.jsx(E,{variant:"outline",size:"sm",className:"border-destructive/50 text-destructive-text hover:bg-destructive/10",onClick:()=>{window.confirm("Are you sure you want to delete this shop? All data including leads, conversations, and appointments will be permanently removed.")&&alert("Shop deletion is not yet available. Please contact support.")},children:"Delete Shop"})]})]})})]})]})})}function F({id:i,label:a,description:l,checked:v,onChange:x}){return e.jsxs("div",{className:"flex items-start justify-between gap-4 py-2",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:i,className:"text-sm font-medium text-foreground cursor-pointer",children:a}),e.jsx("p",{className:"text-xs text-muted mt-0.5",children:l})]}),e.jsx("button",{id:i,type:"button",role:"switch","aria-checked":v,onClick:()=>x(!v),className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 ${v?"bg-primary":"bg-elevated"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition duration-200 ease-in-out ${v?"translate-x-5":"translate-x-0"}`})})]})}export{Ve 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.