1import{k as c,j as e}from"./react-vendor-CmuEGgtt.js";import{R as v}from"./site-CMMCmqVg.js";import"./x-CAppInM7.js";import"./radix-26y85DbF.js";import"./motion-DxYJUoZ7.js";const k=["/","/robots.txt","/sitemap.xml"],y=["x-robots-tag","x-mcf-worker","content-type","cf-cache-status","cf-ray","server","location"],r={ok:"text-emerald-400",warn:"text-amber-400",bad:"text-rose-400",dim:"text-muted-foreground"};async function E(s){const u=`${s}${s.includes("?")?"&":"?"}_seo=${Date.now()}`;try{const o=await fetch(u,{method:"GET",cache:"no-store",redirect:"follow"}),l={};o.headers.forEach((n,d)=>{l[d.toLowerCase()]=n});let i=null,m;if((l["content-type"]||"").includes("text/html")){const n=await o.text(),d=n.match(/<meta[^>]+name=["']robots["'][^>]*content=["']([^"']+)["']/i);i=d?d[1]:null,m=n.slice(0,400)}return{url:s,status:o.status,finalUrl:o.url,redirected:o.redirected,headers:l,metaRobots:i,bodySnippet:m}}catch(o){return{url:s,status:null,headers:{},error:o instanceof Error?o.message:String(o)}}}function S(s){return s?/noindex|nofollow|none/i.test(s)?{label:s,tone:"bad"}:{label:s,tone:"warn"}:{label:"absent (good)",tone:"ok"}}function R(s){return s===void 0?{label:"â",tone:"dim"}:s===null?{label:"absent (good)",tone:"ok"}:/noindex|nofollow|none/i.test(s)?{label:s,tone:"bad"}:{label:s,tone:"warn"}}function $(s){return s?{label:s,tone:"ok"}:{label:"missing",tone:"bad"}}function A(s){return s?/id-preview--.*\.lovable\.app/.test(s)?{label:"redirected to Lovable preview (BAD)",tone:"bad"}:/\.lovable\.app/.test(s)&&!/musickcreekfalls/i.test(s)?{label:"redirected to lovable.app",tone:"warn"}:{label:"stays on origin",tone:"ok"}:{label:"â",tone:"dim"}}function H(){v({title:"SEO Diagnostics",description:"Internal SEO diagnostics."}),c.useEffect(()=>{let t=document.head.querySelector('meta[name="robots"]');const a=t?.getAttribute("content")??null;return t||(t=document.createElement("meta"),t.setAttribute("name","robots"),document.head.appendChild(t)),t.setAttribute("content","noindex,nofollow"),()=>{a===null?t?.remove():t?.setAttribute("content",a)}},[]);const[s,u]=c.useState([]),[o,l]=c.useState(!1),[i,m]=c.useState(0),x=c.useCallback(async()=>{l(!0);const t=await Promise.all(k.map(a=>E(a)));u(t),m(a=>a+1),l(!1)},[]);c.useEffect(()=>{x()},[x]);const n=typeof window<"u"?window.location.host:"",d=/^(www\.)?musickcreekfalls\.com$/i.test(n),w=/id-preview--.*\.lovable\.app$/i.test(n);return e.jsx("main",{className:"min-h-screen bg-background px-4 py-10 text-foreground",children:e.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[e.jsxs("header",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"SEO Diagnostics"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Probes ",e.jsx("code",{children:"/"}),", ",e.jsx("code",{children:"/robots.txt"}),", and"," ",e.jsx("code",{children:"/sitemap.xml"})," same-origin and reports the headers and meta tags that decide whether Googlebot indexes the page."]}),e.jsxs("div",{className:"rounded-md border border-border bg-card p-3 text-sm",children:[e.jsxs("div",{children:["Current host: ",e.jsx("code",{className:"font-mono",children:n})," ",d?e.jsx("span",{className:r.ok,children:"(production)"}):w?e.jsx("span",{className:r.bad,children:"(Lovable preview â should never be indexed)"}):e.jsx("span",{className:r.warn,children:"(other)"})]}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["For a true bot-eye view of the production site, also run"," ",e.jsx("code",{children:"curl -I https://musickcreekfalls.com/"})," from a terminal â the browser cannot see cross-origin headers."]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:()=>{x()},disabled:o,className:"rounded-md border border-border bg-muted px-3 py-1.5 text-sm font-medium hover:bg-muted/70 disabled:opacity-50",children:o?"Probingâ¦":"Re-run probes"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Round #",i," · ",new Date().toLocaleTimeString()]})]})]}),e.jsx("section",{className:"space-y-4",children:s.map(t=>{const a=t.headers["x-robots-tag"],N=t.headers["x-mcf-worker"],b=S(a),f=$(N),p=A(t.finalUrl),g=t.url==="/"?R(t.metaRobots):{label:"â",tone:"dim"};return e.jsxs("article",{className:"rounded-lg border border-border bg-card p-4 shadow-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("h2",{className:"font-mono text-base font-semibold",children:t.url}),e.jsxs("div",{className:"text-sm",children:["status: ",e.jsx("span",{className:"font-mono",children:t.status??"ERR"}),t.redirected?e.jsx("span",{className:`ml-2 ${r.warn}`,children:"(redirected)"}):null]})]}),t.finalUrl&&t.finalUrl!==new URL(t.url,window.location.href).href+(t.url.includes("?"),"")?e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground break-all",children:["final: ",e.jsx("span",{className:"font-mono",children:t.finalUrl})]}):null,t.error?e.jsx("p",{className:`mt-2 text-sm ${r.bad}`,children:t.error}):e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:"mt-3 grid grid-cols-1 gap-x-4 gap-y-1 text-xs sm:grid-cols-[max-content_1fr]",children:[e.jsx("dt",{className:"font-mono text-muted-foreground",children:"x-robots-tag"}),e.jsx("dd",{className:`font-mono ${r[b.tone]}`,children:b.label}),e.jsx("dt",{className:"font-mono text-muted-foreground",children:"x-mcf-worker"}),e.jsx("dd",{className:`font-mono ${r[f.tone]}`,children:f.label}),e.jsx("dt",{className:"font-mono text-muted-foreground",children:"preview leak"}),e.jsx("dd",{className:`font-mono ${r[p.tone]}`,children:p.label}),t.url==="/"?e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"font-mono text-muted-foreground",children:"<meta robots>"}),e.jsx("dd",{className:`font-mono ${r[g.tone]}`,children:g.label})]}):null]}),e.jsxs("details",{className:"mt-3",children:[e.jsx("summary",{className:"cursor-pointer text-xs text-muted-foreground hover:text-foreground",children:"All response headers"}),e.jsx("dl",{className:"mt-2 grid grid-cols-1 gap-x-4 gap-y-1 text-xs sm:grid-cols-[max-content_1fr]",children:y.map(h=>{const j=t.headers[h];return j?e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"font-mono text-muted-foreground",children:h}),e.jsx("dd",{className:"break-all font-mono",children:j})]},h):null})})]}),t.bodySnippet?e.jsxs("details",{className:"mt-3",children:[e.jsx("summary",{className:"cursor-pointer text-xs text-muted-foreground hover:text-foreground",children:"First 400 chars of body"}),e.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:t.bodySnippet})]}):null]})]},t.url)})}),e.jsxs("footer",{className:"space-y-2 text-xs text-muted-foreground",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Expected on production (musickcreekfalls.com):"})," ",e.jsx("code",{children:"x-robots-tag"})," absent, ",e.jsx("code",{children:"x-mcf-worker"})," present, no preview redirect, ",e.jsx("code",{children:"<meta robots>"})," absent or set to ",e.jsx("code",{children:"index,follow"}),"."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Expected on Lovable preview:"})," ",e.jsx("code",{children:"x-robots-tag: noindex, nofollow"})," â this is correct, the preview should never be indexed."]})]})]})})}export{H 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.