PageSourceSearch

https://getvsble.com/assets/CustomDomainPage-veeWihG4.js

js getvsble.com collected 2026-10-09 04:55:04 UTC 7,928 bytes, 1 lines download raw bytes

1import{b as G,u as L,H as R,r as c,s as h,j as e,B as S,av as U,G as g,c as p,C as b,h as w,p as W,aK as f}from"./index-ByYYWl6V.js";import{R as q,a as B}from"./radio-group-Dj8DJm3J.js";import{S as H}from"./shield-BxVvGnYN.js";import{C as P}from"./chart-column-Dvs6e4en.js";import"./index-CnBNeFET.js";import"./circle-DcpkfI2n.js";function V({domain:m,t:s}){const a=m?`https://${m}/share/my-project`:"https://your-domain.com/share/my-project";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-card shadow-lg overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/60 border-b border-border",children:[e.jsxs("span",{className:"flex gap-1.5",children:[e.jsx("span",{className:"h-3 w-3 rounded-full bg-destructive/60"}),e.jsx("span",{className:"h-3 w-3 rounded-full bg-accent/60"}),e.jsx("span",{className:"h-3 w-3 rounded-full bg-primary/40"})]}),e.jsx("div",{className:"flex-1 mx-2",children:e.jsxs("div",{className:"flex items-center gap-1.5 rounded-md bg-background border border-border px-3 py-1 text-xs text-muted-foreground truncate",children:[e.jsx(w,{className:"h-3 w-3 shrink-0 text-green-500"}),e.jsx("span",{className:"truncate",children:a})]})})]}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsx("div",{className:"h-24 rounded-lg bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center",children:e.jsx("span",{className:"text-sm font-medium text-primary/60",children:s("fileSharing.customDomain.galleryHeader")})}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[1,2,3].map(d=>e.jsx("div",{className:"aspect-square rounded-md bg-muted/50 border border-border"},d))}),e.jsx("div",{className:"h-3 w-2/3 rounded bg-muted/40"}),e.jsx("div",{className:"h-3 w-1/2 rounded bg-muted/30"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground",children:s("fileSharing.customDomain.benefits")}),[{icon:H,text:s("fileSharing.customDomain.benefitBrand")},{icon:b,text:s("fileSharing.customDomain.benefitTrust")},{icon:w,text:s("fileSharing.customDomain.benefitSsl")},{icon:P,text:s("fileSharing.customDomain.benefitSeo")},{icon:W,text:s("fileSharing.customDomain.benefitSearch")}].map(({icon:d,text:o})=>e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(d,{className:"h-4 w-4 text-primary shrink-0"}),o]},o))]}),m&&e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:s("fileSharing.customDomain.linksAppearAs")}),e.jsxs("p",{className:"text-sm font-mono text-foreground break-all",children:["https://",m,"/share/…"]})]})]})}function O(){const m=G(),{user:s}=L(),{t:a}=R(),d=["[email protected]","[email protected]"].includes((s==null?void 0:s.email)||""),o=window.location.host,[n,u]=c.useState("default"),[l,j]=c.useState(""),[N,_]=c.useState(""),[y,k]=c.useState([]),[C,z]=c.useState(!0);c.useEffect(()=>{s&&(async()=>{const[{data:t},{data:r}]=await Promise.all([h.from("websites").select("id, name, domain, premium_domain").eq("user_id",s.id).is("deleted_at",null).order("name"),h.from("fs_user_settings").select("custom_domain_mode, custom_domain").eq("user_id",s.id).maybeSingle()]);if(t&&k(t.map(i=>({id:i.id,name:i.name,nativeUrl:i.domain?`${i.domain}.govsble.com`:"",premiumDomain:i.premium_domain}))),r){const i=r.custom_domain_mode||"default";u(i),i==="existing"&&r.custom_domain&&j(r.custom_domain),i==="external"&&r.custom_domain&&_(r.custom_domain)}z(!1)})()},[s]);const x=n==="existing"?l:n==="external"?N.trim():"",E=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i.test(N.trim()),v=async(t,r)=>{s&&await h.from("fs_user_settings").upsert({user_id:s.id,custom_domain_mode:t,custom_domain:r},{onConflict:"user_id"})},A=async()=>{if(n==="external"&&!E){f.error(a("fileSharing.customDomain.invalidDomain"));return}await v(n,x),f.success(a("fileSharing.customDomain.domainSaved"))},D=async t=>{j(t),u("existing"),await v("existing",t),f.success(a("fileSharing.customDomain.domainSelected"))};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("header",{className:"flex h-14 items-center gap-3 border-b border-border px-4",children:[e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>m("/file-sharing"),children:e.jsx(U,{className:"h-5 w-5"})}),e.jsx(g,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"text-base font-semibold text-foreground",children:a("fileSharing.nav.customDomain")})]}),e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-8 grid gap-10 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:a("fileSharing.customDomain.chooseYourDomain")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a("fileSharing.customDomain.domainDesc")})]}),e.jsx(q,{value:n,onValueChange:t=>u(t),className:"space-y-4",children:e.jsxs("label",{className:p("flex items-start gap-3 rounded-lg border p-4 cursor-pointer transition-colors",n==="existing"?"border-primary bg-primary/5":"border-border hover:border-muted-foreground
1/30"),children:[e.jsx(B,{value:"existing",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:a("fileSharing.customDomain.useExistingVsble")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a("fileSharing.customDomain.useExistingDesc")})]}),n==="existing"&&e.jsx("div",{className:"space-y-1.5",children:C?e.jsx("p",{className:"text-xs text-muted-foreground",children:a("fileSharing.customDomain.loadingWebsites")}):e.jsxs(e.Fragment,{children:[d&&e.jsxs("button",{type:"button",onClick:()=>D(o),className:p("flex w-full items-center justify-between rounded-md border px-3 py-2 text-sm transition-colors text-left",l===o&&n==="existing"?"border-primary bg-primary/10 text-foreground":"border-border bg-background hover:bg-muted/50 text-foreground"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(g,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"truncate",children:o}),e.jsx("span",{className:"shrink-0 rounded bg-accent px-1.5 py-0.5 text-[10px] font-medium text-accent-foreground",children:a("fileSharing.customDomain.currentWindow")})]}),l===o&&n==="existing"&&e.jsx(b,{className:"h-4 w-4 shrink-0 text-primary"})]}),y.length===0&&!d?e.jsx("p",{className:"text-xs text-muted-foreground",children:a("fileSharing.customDomain.noWebsites")}):y.map(t=>{const r=[];return t.nativeUrl&&r.push(t.nativeUrl),t.premiumDomain&&r.push(t.premiumDomain),r.map(i=>e.jsxs("button",{type:"button",onClick:()=>D(i),className:p("flex w-full items-center justify-between rounded-md border px-3 py-2 text-sm transition-colors text-left",l===i&&n==="existing"?"border-primary bg-primary/10 text-foreground":"border-border bg-background hover:bg-muted/50 text-foreground"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(g,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"truncate",children:i}),i===t.premiumDomain&&e.jsx("span",{className:"shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:a("fileSharing.customDomain.premium")})]}),l===i&&n==="existing"&&e.jsx(b,{className:"h-4 w-4 shrink-0 text-primary"})]},i))})]})})]})]})}),e.jsx("div",{className:"flex",children:e.jsx(S,{onClick:A,disabled:!x,children:a("fileSharing.customDomain.saveDomainChoice")})})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx("div",{className:"sticky top-8",children:e.jsx(V,{domain:x,t:a})})})]})]})}export{O 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.