1import{r,j as e}from"./vendor-react-ChCU2QM8.js";import{L as b}from"./vendor-router-DDDcE-w_.js";import{u as f,t as g}from"./index-DztznN9U.js";import{g as j,az as k,r as y,Z as c}from"./vendor-icons-BishvROv.js";import"./vendor-query-C2JOA1b6.js";import"./vendor-supabase-Bn8gZks7.js";import"./vendor-radix-C6yXmdLL.js";function A(){const[t,d]=r.useState(null),[o,i]=r.useState(null),[m,n]=r.useState(!1),[x,p]=r.useState(!0);f({title:"Sales Access | Nelson Admin",description:"Reveal Nelson sales library master token.",url:"/admin/sales-access",noIndex:!0}),r.useEffect(()=>{(async()=>{try{const{data:s,error:a}=await g.functions.invoke("get-sales-master-token",{method:"GET"});a||!(s!=null&&s.masterToken)?i((s==null?void 0:s.error)??(a==null?void 0:a.message)??"Unable to retrieve token"):d(s.masterToken)}catch(s){i(String(s))}finally{p(!1)}})()},[]);async function h(){t&&(await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),2e3))}const u=window.location.origin,l=t?`${u}/sell-sheets?t=${encodeURIComponent(t)}`:"";return e.jsxs("div",{className:"min-h-screen bg-nelson-cream",children:[e.jsx("section",{className:"pt-24 pb-12 md:pt-32 md:pb-16 border-b border-border bg-background",children:e.jsxs("div",{className:"nelson-container max-w-4xl",children:[e.jsxs(b,{to:"/sell-sheets",className:"inline-flex items-center gap-2 font-montserrat font-bold text-xs uppercase tracking-[0.15em] text-primary hover:text-foreground mb-6",children:[e.jsx(j,{className:"h-4 w-4"})," Sell Sheet Library"]}),e.jsx("p",{className:"font-montserrat font-bold text-xs uppercase tracking-[0.22em] text-primary mb-4",children:"Admin · Sales Access"}),e.jsx("h1",{className:"font-montserrat font-extrabold text-4xl md:text-5xl text-foreground leading-[1.05] tracking-tight",children:"Master access key."}),e.jsx("p",{className:"mt-5 font-inter text-base text-muted-foreground max-w-2xl leading-relaxed",children:"Use this single key to bookmark the sales library or send a generic link to a prospect. Personalized per-client proposals with telemetry ship in the next phase."})]})}),e.jsx("section",{className:"py-12 md:py-16",children:e.jsxs("div",{className:"nelson-container max-w-4xl",children:[x&&e.jsx("p",{className:"font-inter text-sm text-muted-foreground",children:"Loadingâ¦"}),o&&e.jsxs("div",{className:"border border-destructive/30 bg-destructive/5 p-6",children:[e.jsx("p",{className:"font-montserrat font-bold text-xs uppercase tracking-[0.18em] text-destructive mb-2",children:"Access denied"}),e.jsxs("p",{className:"font-inter text-sm text-foreground",children:[o,". You need the ",e.jsx("strong",{children:"admin"})," or"," ",e.jsx("strong",{children:"proposals"})," role."]})]}),t&&e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border border-border bg-background p-6",children:[e.jsxs("p",{className:"font-montserrat font-bold text-xs uppercase tracking-[0.18em] text-foreground mb-3 flex items-center gap-2",children:[e.jsx(k,{className:"h-3.5 w-3.5"})," Master Token"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("code",{className:"flex-1 px-4 py-3 bg-nelson-cream font-mono text-sm break-all",children:t}),e.jsx("button",{type:"button",onClick:h,className:"px-4 py-3 bg-foreground text-background font-montserrat font-bold text-xs uppercase tracking-[0.15em] hover:bg-primary transition-colors flex items-center gap-2",children:m?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"h-4 w-4"})," Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"h-4 w-4"})," Copy"]})})]})]}),e.jsxs("div",{className:"border border-border bg-background p-6",children:[e.jsx("p",{className:"font-montserrat font-bold text-xs uppercase tracking-[0.18em] text-foreground mb-3",children:"Pre-authenticated Link"}),e.jsx("p",{className:"font-inter text-xs text-muted-foreground mb-3",children:"Share this URL with anyone who needs access. The first visit validates the token and stores it for 30 days in their browser, so subsequent visits skip the gate entirely."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("code",{className:"flex-1 px-4 py-3 bg-nelson-cream font-mono text-xs break-all",children:l}),e.jsxs("button",{type:"button",onClick:async()=>{await navigator.clipboard.writeText(l),n(!0),setTimeout(()=>n(!1),2e3)},className:"px-4 py-3 bg-primary text-primary-foreground font-montserrat font-bold text-xs uppercase tracking-[0.15em] hover:bg-primary/90 transition-colors flex items-center gap-2",children:[e.jsx(c,{className:"h-4 w-4"})," Copy Link"]})]})]}),e.jsxs("div",{className:"border border-border bg-background p-6",children:[e.jsx("p",{className:"font-montserrat font-bold text-xs uppercase tracking-[0.18em] text-foreground mb-3",children:"Coming in Phase 2"}),e.jsxs("ul",{className:"font-inter text-sm text-muted-foreground space-y-1.5 list-disc pl-5",children:[e.jsx("li",{children:"Personalized per-client proposal links with custom intro + featured case studies"}),e.jsx("li",{children:"Telemetry: which sections each prospect viewed and for how long"}),e.jsx("li",{children:'"Hot lead" alerts when a prospect spends >60s in the library'}),e.jsx("li",{children:"Server-rendered PDFs via Puppeteer edge function (proper filenames, emailable)"}),e.jsx("li",{children:"The /explore interactive sales environment"})]})]})]})]})})]})}export{A 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.