1import{j as e}from"./vendor-ui-DyWmBLFh.js";import{h as g,r as m,u as p}from"./vendor-react-BgCmZe45.js";import{a as f}from"./vendor-utils-42ANG6Sg.js";import{L as j}from"./LoadingSpinner-BGFRUFT-.js";const b=t=>t?Array.isArray(t)?t.map(a=>a.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()):typeof t=="string"?t.split(/\s+/).map(a=>a.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()):[]:[],x=(t,a)=>{const l=a||t;if(!l)return"N/A";const i=l.split(" ")[0].split("T")[0],[s,n,o]=i.split("-");return!s||!n||!o?"N/A":`${o}-${n}-${s}`},h=t=>t?Object.values(t).some(a=>a&&a!=="N/A"&&a!=="REDACTED FOR PRIVACY"&&a!=="DATA REDACTED"&&!String(a).toLowerCase().includes("redacted")):!1,N=t=>{if(!t)return null;const a=String(t).toLowerCase();return a.includes("redacted")||a==="data redacted"||a.includes("select contact domain holder")?"Redacted for privacy":t},C=()=>{const{domain:t}=g(),[a,l]=m.useState(null),[i,s]=m.useState(!1),n=p();if(m.useEffect(()=>{f.get(`https://backend.mnchost.com/whois/${t}`).then(c=>l(c.data)).catch(console.error)},[t]),!a)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx(j,{})});const o=a.estimatedDomainAge;return e.jsx("section",{className:"py-10 px-6",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsx("div",{className:"mb-4",children:e.jsxs("button",{onClick:()=>n(-1),className:"group inline-flex items-center gap-2 bg-white text-sm font-medium text-gray-700 hover:text-[#1570c9] transition-all duration-200 cursor-pointer",children:[e.jsx("span",{className:"transition-transform duration-200 group-hover:-translate-x-1",children:"â"}),"Back"]})}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-3xl font-semibold text-gray-900",children:"WHOIS Search Results"}),e.jsx("p",{className:"text-[#666666] mt-2 text-sm",children:"Domain registration and ownership information"})]}),e.jsxs("div",{className:"bg-white rounded-3xl shadow-lg border border-gray-200 overflow-hidden",children:[e.jsx("div",{className:"px-8 py-6 border-b bg-white",children:e.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:"Domain Information"})}),e.jsxs("div",{className:"px-8 py-8 space-y-10",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-600 mb-4",children:"General Details"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-14 gap-y-7",children:[e.jsx(r,{label:"Domain Name",value:a.domainName?.toUpperCase()}),e.jsx(r,{label:"Registered On",value:x(a.createdDate,a.createdDateNormalized)}),e.jsx(r,{label:"Expires On",value:x(a.expiresDate,a.expiresDateNormalized)}),e.jsx(r,{label:"Last Updated",value:x(a.updatedDate,a.updatedDateNormalized)}),o&&e.jsx(r,{label:"Domain Age",value:`${o} day${o!==1?"s":""}`}),a.dnssec&&e.jsx(r,{label:"DNSSEC",value:a.dnssec})]})]}),a.registrarName&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-600 mb-4",children:"Registrar Information"}),e.jsx("div",{className:"bg-[#f8fafc] rounded-2xl px-5 py-5",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-14 gap-y-5",children:[e.jsx(r,{label:"Registrar",value:a.registrarName,light:!0}),a.registrarIANAID&&e.jsx(r,{label:"IANA ID",value:a.registrarIANAID,light:!0}),a.whoisServer&&e.jsx(r,{label:"WHOIS Server",value:a.whoisServer,light:!0})]})})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-600 mb-4",children:"Domain Status"}),e.jsx("div",{className:"bg-[#f8fafc] rounded-2xl px-4 py-5 space-y-2 text-sm font-medium text-gray-800",children:b(a.status).map((c,d)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-gray-400"}),e.jsx("span",{children:c})]},d))})]}),a.registrant&&h(a.registrant)&&e.jsx(u,{title:"Registrant (Owner)",contact:a.registrant}),a.administrativeContact&&h(a.administrativeContact)&&e.jsx(u,{title:"Administrative Contact",contact:a.administrativeContact}),a.technicalContact&&h(a.technicalContact)&&e.jsx(u,{title:"Technical Contact",contact:a.technicalContact}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-600 mb-4",children:"Name Servers"}),e.jsx("div",{className:"bg-[#f8fafc] rounded-2xl px-4 py-5 space-y-2 text-sm font-medium text-gray-900",children:a.nameServers?.hostNames?.map((c,d)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-500"}),e.jsx("span",{children:c})]},d))})]}),a.rawText&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>s(!i),className:"flex items-center gap-2 text-sm font-semibold text-[#1570c9] hover:text-[#125ba8] transition cursor-pointer",children:[e.jsx("span",{className:`transition-transform duration-200 ${i?"rotate-90":""}`,children:"â¶"}),i?"Hide":"Show"," Raw WHOIS Data"]}),i&&e.jsx("div",{className:"mt-3 bg-[#1a1a2e] text-[#e0e0e0] rounded-2xl p-5 overflow-x-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap font-mono leading-relaxed",children:a.rawText})})]})]})]})]})})},u=({title:t,contact:a})=>{const i=[{label:"Name",key:"name"},{label:"Organization",key:"organization"},{label:"Street",key:"street"},{label:"City",key:"city"},{label:"State / Province",key:"state"},{label:"Postal Code",key:"postalCode"},{label:"Country",key:"country"},{label:"Email",key:"email"},{label:"Phone",key:"telephone"}].map(s=>({...s,value:N(a[s.key])})).filter(s=>s.value);return i.length===0?null:e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-600 mb-4",children:t}),e.jsx("div",{className:"bg-[#f8fafc] rounded-2xl px-5 py-5",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-14 gap-y-5",children:i.map((s,n)=>e.jsx(r,{label:s.label,value:s.value,light:!0},n))})})]})},r=({label:t,value:a,light:l})=>e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-gray-500 mb-1",children:t}),e.jsx("div",{className:`text-base font-semibold break-all ${l?"text-gray-800":"text-gray-900"}`,children:a||"N/A"})]});
1export{C 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.