UNPKG

decocms

Version:

Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools

4 lines • 51 kB
import{c as E,b as B,J as he,j as s,m as V,r as z,G as q,a1 as Z,q as Pe,K as ge,a as Se,i as Ce,a2 as Re}from"./index-DoEtSiIe.js";import{r as $e,c as T,R as M,u as Ae,a as oe,b as Ee,d as Le,e as Te}from"./track-xlpKzX88.js";import{d as Ge}from"./delay-CnY5UFtP.js";import{a as Ie}from"./auth-entry-Bk_VrJBw.js";import"./Fingerprint04-DlIWxzRc.js";import"./backoff-CrEUbyZT.js";function ae(o){let e=(o??"").trim().toLowerCase();return e=e.replace(/^https?:\/\//,""),e=e.replace(/^www\./,""),e=e.split(/[/?#]/)[0]??"",e.replace(/\/+$/,"")}function Fe(o){return(ae(o).split(".")[0]||o).replace(/[-_]/g," ").split(" ").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function ie(o,e=64){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(ae(o))}&sz=${e}`}function Me(o,e){const t=o.trim();if(t.length<=e)return t;const r=t.slice(0,e-1),n=r.lastIndexOf(" ");return`${(n>e*.6?r.slice(0,n):r).trimEnd()}…`}function Oe(o){const{brand:e,domain:t,score:r}=o,n=typeof r=="number"?`${e} Deco Score — ${Math.round(r)}/100 · decocms`:`${e} Deco Score · decocms`,l=Me(`How does ${t} really perform? See the full ${e} Deco Score — SEO, performance, conversion & AEO signals scored by decocms.`,200);return{title:n,description:l}}class Be extends Error{constructor(e){super(`reports API HTTP ${e}`),this.status=e,this.name="ReportsApiError"}status}async function re(o){if(!o.ok)throw new Be(o.status);return await o.json()}function xe(o,e){const t=e?`?${new URLSearchParams({lang:e}).toString()}`:"";return fetch(`/api/_reports/site/${encodeURIComponent(o)}${t}`).then(r=>re(r))}function Ue(o){return fetch("/api/_reports/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).then(e=>re(e))}function De(o){return fetch(`/api/_reports/status?id=${encodeURIComponent(o)}`).then(e=>re(e))}function He(o){return fetch(`/api/_reports/link-token/${encodeURIComponent(o)}`).then(e=>re(e))}function We(o,e){const t=e?`?${new URLSearchParams({lang:e}).toString()}`:"";return`/report/${encodeURIComponent(o)}.md${t}`}function be(o,e){const t=new URLSearchParams({siteUrl:o});e&&t.set("fix",e);const r=$e(typeof window>"u"?"":window.location.search);for(const[n,l]of Object.entries(r))typeof l=="string"&&t.set(n,l);return`/reports-onboarding?${t.toString()}`}function ye(o,e){T("report_cta_clicked",{domain:e.domain,placement:e.placement,destination:"studio_onboarding",...e.checkId?{check_id:e.checkId}:{},surface:M},{transport:"sendBeacon"})}const je={critical:"bad",important:"warn",worth:"mid"},Ke={critical:"reports.onePager.bucketCritical",important:"reports.onePager.bucketImportant",worth:"reports.onePager.bucketWorth"},qe={Sessions:"reports.onePager.driverSessions",CR:"reports.onePager.driverConversion",AOV:"reports.onePager.driverOrderValue","Frequency-LTV":"reports.onePager.driverRepeat"},ze={"Deco-controllable":"reports.onePager.controlAgent","Client-dependent":"reports.onePager.controlClient",External:"reports.onePager.controlExternal"},me={"tool-auth":"reports.onePager.blockedToolAuth","data-unavailable":"reports.onePager.blockedDataUnavailable","precondition-unmet":"reports.onePager.blockedPrecondition","tool-unavailable":"reports.onePager.blockedToolUnavailable","not-run":"reports.onePager.blockedNotRun","interview-required":"reports.onePager.blockedInterview","manual-required":"reports.onePager.blockedManual"},Ve={home:"reports.onePager.pageHome",pdp:"reports.onePager.pageProduct",plp:"reports.onePager.pageCategory",blog:"reports.onePager.pageBlog"},ce=o=>o>=75?"good":o>=50?"warn":"bad";function ne(o){if(o)try{const e=new URL(o);return e.protocol==="https:"||e.protocol==="http:"?o:void 0}catch{return}}function _e(o,e){if(!o)return"";const t=new Date(o);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(e,{day:"2-digit",month:"long",year:"numeric"})}const le=(o,e,t)=>{const r=e[t];return r?o(r):t};function Ye(o){const e=decodeURIComponent(window.location.hash.slice(1));if(!e.startsWith("check-"))return;const t=Array.from(o.querySelectorAll("details")).find(r=>r.id===e);t&&(t.open=!0,t.scrollIntoView({block:"start"}))}function Je(o){T("report_viewed",{domain:o.domain,score:o.score,failed:o.totals.failed,surface:M});const e=new URLSearchParams(window.location.search),t=e.get("share_id");t&&q()&&Z.setPersonProperties(void 0,{inbound_share_id:t});const r=e.get("d");if(!r||e.get("utm_source")!=="email")return;const n=e.get("email_run_id");T("report_email_link_opened",{domain:o.domain,surface:M,...n?{email_run_id:n}:{}}),He(r).then(l=>{q()&&Z.setPersonProperties(void 0,{...n?{inbound_email_run_id:n}:{},...l?{inbound_email_domain:l.domain}:{}})}).catch(()=>{n&&q()&&Z.setPersonProperties(void 0,{inbound_email_run_id:n})})}function Qe(o){const e=E.c(75),{report:t}=o,r=B(),[n]=he(),{language:l}=n;let d;e[0]!==t?(d=I=>{I&&(Je(t),Ye(I))},e[0]=t,e[1]=d):d=e[1];const m=d;let a,c,p,i,u,f,h,x,g;if(e[2]!==l||e[3]!==m||e[4]!==t||e[5]!==r){const I=t.buckets.filter(Xe);c="dg-page",p=m,i="dg",u=t.lang||void 0,e[15]!==l||e[16]!==t?(f=s.jsx(et,{report:t,locale:l}),e[15]=l,e[16]=t,e[17]=f):f=e[17],e[18]!==t?(h=s.jsx(st,{report:t}),x=s.jsx(rt,{report:t}),g=s.jsx(ot,{report:t}),e[18]=t,e[19]=h,e[20]=x,e[21]=g):(h=e[19],x=e[20],g=e[21]),a=I.length?I.map(U=>s.jsxs("section",{className:"dg-bucket",id:U.id,children:[s.jsxs("h2",{children:[s.jsx("span",{className:V("dg-dot",`dg-${je[U.id]}`)}),r(Ke[U.id]),s.jsx("span",{className:"dg-count",children:U.items.length})]}),s.jsx("div",{className:"dg-rows",children:U.items.map(K=>s.jsx(nt,{domain:t.domain,bucket:U.id,item:K},K.check_id))})]},U.id)):s.jsx("section",{className:"dg-bucket",children:s.jsx("p",{className:"dg-empty",children:r("reports.onePager.noFailures")})}),e[2]=l,e[3]=m,e[4]=t,e[5]=r,e[6]=a,e[7]=c,e[8]=p,e[9]=i,e[10]=u,e[11]=f,e[12]=h,e[13]=x,e[14]=g}else a=e[6],c=e[7],p=e[8],i=e[9],u=e[10],f=e[11],h=e[12],x=e[13],g=e[14];let b;e[22]!==t?(b=s.jsx(dt,{report:t}),e[22]=t,e[23]=b):b=e[23];let y;e[24]!==r?(y=r("reports.onePager.ctaTitle"),e[24]=r,e[25]=y):y=e[25];let _;e[26]!==y?(_=s.jsx("h2",{children:y}),e[26]=y,e[27]=_):_=e[27];let v;e[28]!==r?(v=r("reports.onePager.ctaText"),e[28]=r,e[29]=v):v=e[29];let k;e[30]!==v?(k=s.jsx("p",{children:v}),e[30]=v,e[31]=k):k=e[31];const N=`https://${t.domain}/`;let P;e[32]!==N?(P=be(N),e[32]=N,e[33]=P):P=e[33];let S;e[34]!==t.domain?(S=I=>ye(I,{domain:t.domain,placement:"report_footer"}),e[34]=t.domain,e[35]=S):S=e[35];let C;e[36]!==r?(C=r("reports.onePager.ctaButton"),e[36]=r,e[37]=C):C=e[37];let A;e[38]!==P||e[39]!==S||e[40]!==C?(A=s.jsx("a",{href:P,onClick:S,children:C}),e[38]=P,e[39]=S,e[40]=C,e[41]=A):A=e[41];let R;e[42]!==_||e[43]!==k||e[44]!==A?(R=s.jsxs("section",{className:"dg-cta",children:[_,k,A]}),e[42]=_,e[43]=k,e[44]=A,e[45]=R):R=e[45];let $;e[46]!==r?($=r("reports.onePager.footerGenerated"),e[46]=r,e[47]=$):$=e[47];const F=t.domain;let L;e[48]!==l||e[49]!==t.scanned_at?(L=_e(t.scanned_at,l),e[48]=l,e[49]=t.scanned_at,e[50]=L):L=e[50];let w;e[51]!==r?(w=r("reports.onePager.footerPublicOnly"),e[51]=r,e[52]=w):w=e[52];let G;e[53]!==t.domain||e[54]!==$||e[55]!==L||e[56]!==w?(G=[$,F,L,w].filter(Boolean),e[53]=t.domain,e[54]=$,e[55]=L,e[56]=w,e[57]=G):G=e[57];const H=G.join(" · ");let W;e[58]!==H?(W=s.jsx("footer",{className:"dg-foot",children:H}),e[58]=H,e[59]=W):W=e[59];let O;e[60]!==a||e[61]!==b||e[62]!==R||e[63]!==W||e[64]!==p||e[65]!==i||e[66]!==u||e[67]!==f||e[68]!==h||e[69]!==x||e[70]!==g?(O=s.jsxs("article",{ref:p,className:i,lang:u,children:[f,h,x,g,a,b,R,W]}),e[60]=a,e[61]=b,e[62]=R,e[63]=W,e[64]=p,e[65]=i,e[66]=u,e[67]=f,e[68]=h,e[69]=x,e[70]=g,e[71]=O):O=e[71];let D;return e[72]!==c||e[73]!==O?(D=s.jsx("div",{className:c,children:O}),e[72]=c,e[73]=O,e[74]=D):D=e[74],D}function Xe(o){return o.items.length>0}function Ze(o){const e=E.c(20),{score:t}=o,r=B(),n=2*Math.PI*47.5,l=n*Math.max(0,Math.min(100,t))/100;let d;e[0]!==t?(d=ce(t),e[0]=t,e[1]=d):d=e[1];const m=`dg-${d}`;let a;e[2]!==m?(a=V("dg-ring",m),e[2]=m,e[3]=a):a=e[3];let c;e[4]!==t||e[5]!==r?(c=r("reports.onePager.scoreAria",{score:t}),e[4]=t,e[5]=r,e[6]=c):c=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("circle",{cx:52,cy:52,r:47.5,fill:"none",stroke:"var(--dg-track)",strokeWidth:"7"}),e[7]=p):p=e[7];let i;e[8]!==l?(i=l.toFixed(1),e[8]=l,e[9]=i):i=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=n.toFixed(1),e[10]=u):u=e[10];const f=`${i} ${u}`;let h;e[11]!==f?(h=s.jsx("circle",{cx:52,cy:52,r:47.5,fill:"none",stroke:"currentColor",strokeWidth:"7",strokeLinecap:"round",strokeDasharray:f,transform:"rotate(-90 52 52)"}),e[11]=f,e[12]=h):h=e[12];let x;e[13]!==t?(x=s.jsx("text",{x:"50%",y:"50%",dy:"0.06em",textAnchor:"middle",dominantBaseline:"middle",className:"dg-ring-num",children:t}),e[13]=t,e[14]=x):x=e[14];let g;return e[15]!==x||e[16]!==a||e[17]!==c||e[18]!==h?(g=s.jsxs("svg",{className:a,width:104,height:104,viewBox:"0 0 104 104",role:"img","aria-label":c,children:[p,h,x]}),e[15]=x,e[16]=a,e[17]=c,e[18]=h,e[19]=g):g=e[19],g}function et(o){const e=E.c(57),{report:t,locale:r}=o,n=B();let l;e[0]!==t.favicon?(l=ne(t.favicon),e[0]=t.favicon,e[1]=l):l=e[1];const d=l;let m,a,c,p,i,u,f;if(e[2]!==d||e[3]!==r||e[4]!==t||e[5]!==n){const k=_e(t.scanned_at,r),N=[[t.totals.failed,"reports.onePager.statFailed"],[t.totals.passed,"reports.onePager.statPassed"],[t.totals.blocked,"reports.onePager.statBlocked"]];u="dg-head";let P;e[13]!==d?(P=d&&s.jsx("img",{src:d,alt:"",width:36,height:36}),e[13]=d,e[14]=P):P=e[14];let S;e[15]!==t.brand?(S=s.jsx("h1",{children:t.brand}),e[15]=t.brand,e[16]=S):S=e[16];let C;e[17]!==t.domain?(C=s.jsx("p",{className:"dg-domain",children:t.domain}),e[17]=t.domain,e[18]=C):C=e[18];let A;e[19]!==S||e[20]!==C?(A=s.jsxs("div",{children:[S,C]}),e[19]=S,e[20]=C,e[21]=A):A=e[21];let R;e[22]!==A||e[23]!==P?(R=s.jsxs("div",{className:"dg-brand",children:[P,A]}),e[22]=A,e[23]=P,e[24]=R):R=e[24];let $;e[25]!==t?($=s.jsx(tt,{report:t}),e[25]=t,e[26]=$):$=e[26],e[27]!==R||e[28]!==$?(f=s.jsxs("div",{className:"dg-head-top",children:[R,$]}),e[27]=R,e[28]=$,e[29]=f):f=e[29],i="dg-head-main",c="dg-head-facts";const F=k?n("reports.onePager.ledeScanned",{date:k}):n("reports.onePager.lede");e[30]!==F?(p=s.jsx("p",{className:"dg-lede",children:F}),e[30]=F,e[31]=p):p=e[31],m="dg-stats",a=N.map(L=>{const[w,G]=L;return s.jsxs("span",{className:"dg-stat",children:[s.jsx("b",{children:w})," ",n(G)]},G)}),e[2]=d,e[3]=r,e[4]=t,e[5]=n,e[6]=m,e[7]=a,e[8]=c,e[9]=p,e[10]=i,e[11]=u,e[12]=f}else m=e[6],a=e[7],c=e[8],p=e[9],i=e[10],u=e[11],f=e[12];let h;e[32]!==m||e[33]!==a?(h=s.jsx("p",{className:m,children:a}),e[32]=m,e[33]=a,e[34]=h):h=e[34];let x;e[35]!==t.totals.measured||e[36]!==t.totals.registry_total||e[37]!==n?(x=t.totals.registry_total>0?n("reports.onePager.coverageOf",{measured:t.totals.measured,total:t.totals.registry_total}):n("reports.onePager.coverage",{measured:t.totals.measured}),e[35]=t.totals.measured,e[36]=t.totals.registry_total,e[37]=n,e[38]=x):x=e[38];let g;e[39]!==x?(g=s.jsx("p",{className:"dg-meta",children:x}),e[39]=x,e[40]=g):g=e[40];let b;e[41]!==g||e[42]!==c||e[43]!==p||e[44]!==h?(b=s.jsxs("div",{className:c,children:[p,h,g]}),e[41]=g,e[42]=c,e[43]=p,e[44]=h,e[45]=b):b=e[45];let y;e[46]!==t.band||e[47]!==t.score?(y=t.score!==null&&s.jsxs("div",{className:"dg-head-score",children:[s.jsx(Ze,{score:t.score}),s.jsx("p",{className:V("dg-band",`dg-${ce(t.score)}`),children:t.band})]}),e[46]=t.band,e[47]=t.score,e[48]=y):y=e[48];let _;e[49]!==b||e[50]!==y||e[51]!==i?(_=s.jsxs("div",{className:i,children:[b,y]}),e[49]=b,e[50]=y,e[51]=i,e[52]=_):_=e[52];let v;return e[53]!==_||e[54]!==u||e[55]!==f?(v=s.jsxs("header",{className:u,children:[f,_]}),e[53]=_,e[54]=u,e[55]=f,e[56]=v):v=e[56],v}function tt(o){const e=E.c(9),{report:t}=o,r=B(),[n,l]=z.useState(!1);let d;e[0]!==t.brand||e[1]!==t.domain?(d=async()=>{const p=`${t.domain}:report:${crypto.randomUUID().slice(0,8)}`,i=new URLSearchParams({share_id:p,utm_source:"share",utm_medium:"report",utm_campaign:"report"}),u=`${window.location.origin}/report/${encodeURIComponent(t.domain)}?${i.toString()}`,f=h=>T("report_shared",{domain:t.domain,surface:M,method:h,share_id:p,sharer_person_id:q()?Z.get_distinct_id():void 0});if(window.matchMedia("(pointer: coarse)").matches&&navigator.share){try{await navigator.share({title:t.brand,url:u}),f("web_share")}catch{}return}try{await navigator.clipboard.writeText(u),f("copy_link"),l(!0),setTimeout(()=>l(!1),1800)}catch{}},e[0]=t.brand,e[1]=t.domain,e[2]=d):d=e[2];const m=d;let a;e[3]!==n||e[4]!==r?(a=r(n?"reports.onePager.linkCopied":"reports.onePager.share"),e[3]=n,e[4]=r,e[5]=a):a=e[5];let c;return e[6]!==m||e[7]!==a?(c=s.jsx("button",{type:"button",className:"dg-share",onClick:m,children:a}),e[6]=m,e[7]=a,e[8]=c):c=e[8],c}function st({report:o}){const e=B(),[t,r]=z.useState("idle"),n=We(o.domain,o.lang),l=async()=>{const d=fetch(n).then(async m=>{if(!m.ok)throw new Error(`markdown HTTP ${m.status}`);const a=await m.text();return`${e("reports.onePager.promptPrefix",{domain:o.domain})}

${a}`});try{typeof ClipboardItem<"u"&&navigator.clipboard.write?await navigator.clipboard.write([new ClipboardItem({"text/plain":d.then(m=>new Blob([m],{type:"text/plain"}))})]):await navigator.clipboard.writeText(await d),r("copied"),T("report_prompt_copied",{domain:o.domain,surface:M})}catch{r("failed")}setTimeout(()=>r("idle"),2500)};return s.jsxs("section",{className:"dg-agent",children:[s.jsxs("p",{className:"dg-agent-text",children:[s.jsx("strong",{children:e("reports.onePager.agentTitle")})," ",e("reports.onePager.agentText")]}),s.jsxs("span",{className:"dg-agent-actions",children:[s.jsx("button",{type:"button",className:"dg-copy","data-done":t==="copied"?"":void 0,onClick:l,children:e(t==="copied"?"reports.onePager.copied":t==="failed"?"reports.onePager.copyFailed":"reports.onePager.copyPrompt")}),s.jsx("a",{className:"dg-agent-link",href:n,target:"_blank",rel:"noopener",onClick:()=>T("report_markdown_opened",{domain:o.domain,surface:M}),children:e("reports.onePager.openMarkdown")})]})]})}function rt(o){const e=E.c(15),{report:t}=o,r=B(),[n,l]=z.useState(null),d=t.screenshots;let m,a;if(e[0]!==n||e[1]!==t.screenshots||e[2]!==r){a=Symbol.for("react.early_return_sentinel");e:{let c;e[5]!==r?(c=g=>{const b=ne(g.image_url);if(!b)return[];const y=g.page_type?Ve[g.page_type]:void 0,_=y?r(y):g.url,v=g.viewport==="mobile"?r("reports.onePager.shotMobile",{label:_}):_;return[{...g,src:b,label:v,href:ne(g.url)}]},e[5]=r,e[6]=c):c=e[6];const p=d.flatMap(c);if(!p.length){a=null;break e}const i=n===null?void 0:p[n];let u;e[7]!==r?(u=r("reports.onePager.shotsTitle"),e[7]=r,e[8]=u):u=e[8];let f;e[9]!==r?(f=r("reports.onePager.shotsLede"),e[9]=r,e[10]=f):f=e[10];let h;e[11]!==f?(h=s.jsx("p",{className:"dg-lede",children:f}),e[11]=f,e[12]=h):h=e[12];let x;e[13]!==r?(x=(g,b)=>s.jsxs("button",{type:"button",className:V("dg-shot",g.viewport==="mobile"&&"dg-shot-mobile"),"aria-label":r("reports.onePager.enlarge",{label:g.label}),onClick:()=>l(b),children:[s.jsx("img",{src:g.src,alt:g.label,loading:"lazy"}),s.jsx("span",{className:"dg-shot-cap",children:g.label})]},`${g.src}-${b}`),e[13]=r,e[14]=x):x=e[14],m=s.jsxs("section",{className:"dg-shots",id:"capturas",children:[s.jsxs("h2",{children:[u,s.jsx("span",{className:"dg-count",children:p.length})]}),h,s.jsx("div",{className:"dg-shot-grid",children:p.map(x)}),i&&s.jsxs("div",{className:"dg-box",role:"dialog","aria-modal":"true","aria-label":i.label,onKeyDown:g=>{g.key==="Escape"&&l(null)},children:[s.jsx("button",{type:"button",className:"dg-box-bg","aria-label":r("reports.onePager.close"),onClick:()=>l(null)}),s.jsxs("figure",{children:[s.jsxs("figcaption",{children:[i.label,i.href&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:i.href,rel:"noopener nofollow",children:new URL(i.href).pathname||"/"})]}),s.jsx("button",{type:"button",className:"dg-box-close","aria-label":r("reports.onePager.close"),autoFocus:!0,onClick:()=>l(null),children:"✕"})]}),s.jsx("img",{src:i.src,alt:i.label})]})]})]})}e[0]=n,e[1]=t.screenshots,e[2]=r,e[3]=m,e[4]=a}else m=e[3],a=e[4];return a!==Symbol.for("react.early_return_sentinel")?a:m}function ot(o){const e=E.c(17),{report:t}=o,r=B();if(!t.categories.length)return null;let n;e[0]!==r?(n=r("reports.onePager.areasTitle"),e[0]=r,e[1]=n):n=e[1];let l;e[2]!==t.categories.length?(l=s.jsx("span",{className:"dg-count",children:t.categories.length}),e[2]=t.categories.length,e[3]=l):l=e[3];let d;e[4]!==n||e[5]!==l?(d=s.jsxs("h2",{children:[n,l]}),e[4]=n,e[5]=l,e[6]=d):d=e[6];let m;if(e[7]!==t.categories||e[8]!==r){let p;e[10]!==r?(p=i=>s.jsxs("div",{className:"dg-area",children:[s.jsx("span",{className:"dg-area-name",children:i.label}),s.jsx("span",{className:"dg-bar",children:s.jsx("span",{className:V("dg-bar-fill",`dg-bg-${i.score===null?"none":ce(i.score)}`),style:{width:`${i.score??0}%`}})}),i.score===null?s.jsx("span",{className:"dg-muted",children:"—"}):s.jsx("span",{className:"dg-area-score",children:i.score}),s.jsxs("span",{className:"dg-area-meta",children:[i.score===null?r("reports.onePager.areaInsufficient"):i.band," · ",r("reports.onePager.areaMeasured",{count:i.pass+i.fail})]})]},i.key),e[10]=r,e[11]=p):p=e[11],m=t.categories.map(p),e[7]=t.categories,e[8]=r,e[9]=m}else m=e[9];let a;e[12]!==m?(a=s.jsx("div",{className:"dg-area-list",children:m}),e[12]=m,e[13]=a):a=e[13];let c;return e[14]!==d||e[15]!==a?(c=s.jsxs("section",{className:"dg-areas",id:"areas",children:[d,a]}),e[14]=d,e[15]=a,e[16]=c):c=e[16],c}function te(o){const e=E.c(5),{title:t,children:r}=o;let n;e[0]!==t?(n=s.jsx("h4",{children:t}),e[0]=t,e[1]=n):n=e[1];let l;return e[2]!==r||e[3]!==n?(l=s.jsxs("div",{className:"dg-part",children:[n,r]}),e[2]=r,e[3]=n,e[4]=l):l=e[4],l}function nt(o){const e=E.c(94),{domain:t,bucket:r,item:n}=o,l=B(),d=je[r];let m;e[0]!==n.value_driver||e[1]!==l?(m=n.value_driver&&le(l,qe,n.value_driver),e[0]=n.value_driver,e[1]=l,e[2]=m):m=e[2];let a;e[3]!==n.controllability||e[4]!==l?(a=n.controllability&&le(l,ze,n.controllability),e[3]=n.controllability,e[4]=l,e[5]=a):a=e[5];let c;e[6]!==n.category||e[7]!==m||e[8]!==a?(c=[n.category,m,a].filter(it),e[6]=n.category,e[7]=m,e[8]=a,e[9]=c):c=e[9];const p=c,i=n.impact??n.why;let u;e[10]!==r||e[11]!==t||e[12]!==n.check_id?(u=Ne=>{Ne.currentTarget.open&&T("report_finding_opened",{domain:t,check_id:n.check_id,bucket:r,surface:M})},e[10]=r,e[11]=t,e[12]=n.check_id,e[13]=u):u=e[13];const f=u,h=`check-${n.check_id}`,x=`dg-${d}`;let g;e[14]!==x?(g=V("dg-x",x),e[14]=x,e[15]=g):g=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs("svg",{viewBox:"0 0 20 20",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[s.jsx("circle",{cx:"10",cy:"10",r:"7.4"}),s.jsx("path",{d:"M7.4 7.4l5.2 5.2M12.6 7.4l-5.2 5.2"})]}),e[16]=b):b=e[16];let y;e[17]!==g?(y=s.jsx("span",{className:g,"aria-hidden":"true",children:b}),e[17]=g,e[18]=y):y=e[18];let _;e[19]!==l?(_=l("reports.onePager.failedSr"),e[19]=l,e[20]=_):_=e[20];let v;e[21]!==_?(v=s.jsx("span",{className:"dg-sr",children:_}),e[21]=_,e[22]=v):v=e[22];let k;e[23]!==n.title?(k=s.jsx("h3",{children:n.title}),e[23]=n.title,e[24]=k):k=e[24];let N;e[25]!==p?(N=p.map(at),e[25]=p,e[26]=N):N=e[26];let P;e[27]!==n.value_band||e[28]!==l?(P=n.value_band==="lever"&&s.jsx("span",{className:"dg-chip dg-chip-lever",children:l("reports.onePager.chipLever")}),e[27]=n.value_band,e[28]=l,e[29]=P):P=e[29];let S;e[30]!==N||e[31]!==P?(S=s.jsxs("div",{className:"dg-chips",children:[N,P]}),e[30]=N,e[31]=P,e[32]=S):S=e[32];let C;e[33]!==k||e[34]!==S?(C=s.jsxs("div",{className:"dg-row-text",children:[k,S]}),e[33]=k,e[34]=S,e[35]=C):C=e[35];let A;e[36]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("span",{className:"dg-toggle","aria-hidden":"true"}),e[36]=A):A=e[36];let R;e[37]!==v||e[38]!==C||e[39]!==y?(R=s.jsxs("summary",{className:"dg-row-head",children:[y,v,C,A]}),e[37]=v,e[38]=C,e[39]=y,e[40]=R):R=e[40];let $;e[41]!==n.description||e[42]!==l?($=n.description&&s.jsx(te,{title:l("reports.onePager.partWhat"),children:s.jsx("p",{className:"dg-body-p",children:n.description})}),e[41]=n.description,e[42]=l,e[43]=$):$=e[43];let F;e[44]!==l||e[45]!==i?(F=i&&s.jsx(te,{title:l("reports.onePager.partWhy"),children:s.jsx("p",{className:"dg-body-p",children:i})}),e[44]=l,e[45]=i,e[46]=F):F=e[46];let L;e[47]!==n.tasks||e[48]!==l?(L=n.tasks.length>0&&s.jsx(te,{title:l("reports.onePager.partHow"),children:s.jsx("ol",{className:"dg-tasks",children:n.tasks.map(lt)})}),e[47]=n.tasks,e[48]=l,e[49]=L):L=e[49];let w;e[50]!==l?(w=l("reports.onePager.partEvidence"),e[50]=l,e[51]=w):w=e[51];let G;e[52]!==n.evidence?(G=n.evidence&&s.jsx("p",{className:"dg-ev",children:n.evidence}),e[52]=n.evidence,e[53]=G):G=e[53];let H;e[54]!==l?(H=l("reports.onePager.metaCheck"),e[54]=l,e[55]=H):H=e[55];const W=`#check-${n.check_id}`;let O;e[56]!==n.check_id?(O=s.jsx("code",{children:n.check_id}),e[56]=n.check_id,e[57]=O):O=e[57];let D;e[58]!==W||e[59]!==O?(D=s.jsx("a",{href:W,children:O}),e[58]=W,e[59]=O,e[60]=D):D=e[60];let I;e[61]!==H||e[62]!==D?(I=s.jsxs("p",{className:"dg-meta",children:[H," ",D]}),e[61]=H,e[62]=D,e[63]=I):I=e[63];let U;e[64]!==n.sample_scope||e[65]!==l?(U=n.sample_scope&&s.jsx("p",{className:"dg-meta",children:l("reports.onePager.metaSample",{value:n.sample_scope})}),e[64]=n.sample_scope,e[65]=l,e[66]=U):U=e[66];let K;e[67]!==n.sources||e[68]!==l?(K=n.sources.length>0&&s.jsx("p",{className:"dg-meta",children:l("reports.onePager.metaSource",{value:n.sources.join(", ")})}),e[67]=n.sources,e[68]=l,e[69]=K):K=e[69];let Y;e[70]!==n.pages||e[71]!==l?(Y=n.pages.length>0&&s.jsx("p",{className:"dg-meta",children:l("reports.onePager.metaPages",{value:n.pages.join(", ")})}),e[70]=n.pages,e[71]=l,e[72]=Y):Y=e[72];let J;e[73]!==w||e[74]!==G||e[75]!==I||e[76]!==U||e[77]!==K||e[78]!==Y?(J=s.jsxs(te,{title:w,children:[G,I,U,K,Y]}),e[73]=w,e[74]=G,e[75]=I,e[76]=U,e[77]=K,e[78]=Y,e[79]=J):J=e[79];let Q;e[80]!==t||e[81]!==n?(Q=s.jsx("div",{className:"dg-actions",children:s.jsx(ct,{domain:t,item:n})}),e[80]=t,e[81]=n,e[82]=Q):Q=e[82];let X;e[83]!==$||e[84]!==F||e[85]!==L||e[86]!==J||e[87]!==Q?(X=s.jsxs("div",{className:"dg-row-body",children:[$,F,L,J,Q]}),e[83]=$,e[84]=F,e[85]=L,e[86]=J,e[87]=Q,e[88]=X):X=e[88];let ee;return e[89]!==f||e[90]!==R||e[91]!==X||e[92]!==h?(ee=s.jsxs("details",{className:"dg-row",id:h,onToggle:f,children:[R,X]}),e[89]=f,e[90]=R,e[91]=X,e[92]=h,e[93]=ee):ee=e[93],ee}function lt(o){return s.jsx("li",{children:o},o)}function at(o){return s.jsx("span",{className:"dg-chip",children:o},o)}function it(o){return!!o}function ct(o){const e=E.c(24),{domain:t,item:r}=o,n=B();if(r.controllability==="Deco-controllable"){const m=`https://${t}/`;let a;e[0]!==r.check_id||e[1]!==m?(a=be(m,r.check_id),e[0]=r.check_id,e[1]=m,e[2]=a):a=e[2];let c;e[3]!==t||e[4]!==r.check_id?(c=x=>ye(x,{domain:t,placement:"finding_fix",checkId:r.check_id}),e[3]=t,e[4]=r.check_id,e[5]=c):c=e[5];let p;e[6]!==n?(p=n("reports.onePager.fix"),e[6]=n,e[7]=p):p=e[7];let i;e[8]!==a||e[9]!==c||e[10]!==p?(i=s.jsx("a",{className:"dg-fix",href:a,onClick:c,children:p}),e[8]=a,e[9]=c,e[10]=p,e[11]=i):i=e[11];let u;e[12]!==n?(u=n("reports.onePager.fixNote"),e[12]=n,e[13]=u):u=e[13];let f;e[14]!==u?(f=s.jsx("span",{className:"dg-fix-note",children:u}),e[14]=u,e[15]=f):f=e[15];let h;return e[16]!==i||e[17]!==f?(h=s.jsxs(s.Fragment,{children:[i,f]}),e[16]=i,e[17]=f,e[18]=h):h=e[18],h}if(!r.controllability)return null;let l;e[19]!==r.controllability||e[20]!==n?(l=r.controllability==="Client-dependent"?n("reports.onePager.fixDependsClient"):n("reports.onePager.fixDependsExternal"),e[19]=r.controllability,e[20]=n,e[21]=l):l=e[21];let d;return e[22]!==l?(d=s.jsx("span",{className:"dg-fix-note",children:l}),e[22]=l,e[23]=d):d=e[23],d}function dt(o){const e=E.c(44),{report:t}=o,r=B();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("span",{className:"dg-dot dg-good"}),e[0]=n):n=e[0];let l;e[1]!==r?(l=r("reports.onePager.passingTitle"),e[1]=r,e[2]=l):l=e[2];let d;e[3]!==t.passing.count?(d=s.jsx("span",{className:"dg-count",children:t.passing.count}),e[3]=t.passing.count,e[4]=d):d=e[4];let m;e[5]!==l||e[6]!==d?(m=s.jsxs("summary",{children:[n,l,d]}),e[5]=l,e[6]=d,e[7]=m):m=e[7];let a;e[8]!==t.passing.items?(a=t.passing.items.map(pt),e[8]=t.passing.items,e[9]=a):a=e[9];let c;e[10]!==a?(c=s.jsx("ul",{className:"dg-list",children:a}),e[10]=a,e[11]=c):c=e[11];let p;e[12]!==t.passing.count||e[13]!==t.passing.items.length||e[14]!==r?(p=t.passing.count>t.passing.items.length&&s.jsx("p",{className:"dg-meta",children:r("reports.onePager.showingOf",{shown:t.passing.items.length,total:t.passing.count})}),e[12]=t.passing.count,e[13]=t.passing.items.length,e[14]=r,e[15]=p):p=e[15];let i;e[16]!==m||e[17]!==c||e[18]!==p?(i=s.jsxs("details",{className:"dg-fold",children:[m,c,p]}),e[16]=m,e[17]=c,e[18]=p,e[19]=i):i=e[19];let u;e[20]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"dg-dot dg-none"}),e[20]=u):u=e[20];let f;e[21]!==r?(f=r("reports.onePager.notMeasuredTitle"),e[21]=r,e[22]=f):f=e[22];let h;e[23]!==t.not_measured.count?(h=s.jsx("span",{className:"dg-count",children:t.not_measured.count}),e[23]=t.not_measured.count,e[24]=h):h=e[24];let x;e[25]!==f||e[26]!==h?(x=s.jsxs("summary",{children:[u,f,h]}),e[25]=f,e[26]=h,e[27]=x):x=e[27];let g;e[28]!==r?(g=r("reports.onePager.notMeasuredNote"),e[28]=r,e[29]=g):g=e[29];let b;e[30]!==g?(b=s.jsx("p",{className:"dg-meta",children:g}),e[30]=g,e[31]=b):b=e[31];let y;if(e[32]!==t.not_measured.groups||e[33]!==r){let k;e[35]!==r?(k=N=>s.jsxs("div",{className:"dg-blocked",children:[s.jsx("strong",{children:N.reason in me?le(r,me,N.reason):N.label})," ",s.jsx("span",{className:"dg-muted",children:r("reports.onePager.checksCount",{count:N.count})}),s.jsx("ul",{className:"dg-list",children:N.checks.map(mt)})]},N.reason),e[35]=r,e[36]=k):k=e[36],y=t.not_measured.groups.map(k),e[32]=t.not_measured.groups,e[33]=r,e[34]=y}else y=e[34];let _;e[37]!==x||e[38]!==b||e[39]!==y?(_=s.jsxs("details",{className:"dg-fold",children:[x,b,y]}),e[37]=x,e[38]=b,e[39]=y,e[40]=_):_=e[40];let v;return e[41]!==_||e[42]!==i?(v=s.jsxs("section",{className:"dg-coverage",id:"cobertura",children:[i,_]}),e[41]=_,e[42]=i,e[43]=v):v=e[43],v}function mt(o){return s.jsx("li",{children:o},o)}function pt(o){return s.jsxs("li",{children:[s.jsx("code",{children:o.check_id})," ",o.title]},o.check_id)}const ft=4e3,ut=180,de=o=>`report:pending:${o}`,ht=o=>{try{return JSON.parse(localStorage.getItem(de(o))??"null")}catch{return null}},gt=o=>{try{localStorage.setItem(de(o),JSON.stringify({startedAt:Date.now()}))}catch{}},se=o=>{try{localStorage.removeItem(de(o))}catch{}};async function xt(o,e,t,r,n){try{T("report_scan_triggered",{domain:o,surface:M});const l=await Ue({domain:o,distinctId:e});if(t.aborted)return;if(l.state==="blocked")return se(o),T("report_scan_failed",{domain:o,phase:"blocked",reason:"blocked",surface:M}),r.onPhase("blocked");let d=l.state==="running"?l.id:null;l.state==="running"&&(r.onPhase("pending"),T("report_pending_screen_shown",{domain:o,surface:M}),gt(o));for(let m=0;m<ut&&!t.aborted;m++){const a=await xe(o,n);if(t.aborted)return;if(a.status==="ready")return se(o),T("report_scan_completed",{domain:o,surface:M}),r.onReport(a.report);if(d){const c=await De(d);if(t.aborted)return;c.done&&(d=null,T("report_run_done_deck_pending",{domain:o,surface:M}),r.onPhase("empty"))}await Ge(ft,{signal:t})}t.aborted||(se(o),T("report_scan_failed",{domain:o,phase:"empty",reason:"poll_timeout",surface:M}),r.onPhase("empty"))}catch{t.aborted||(se(o),T("report_scan_failed",{domain:o,phase:"error",reason:"exception",surface:M}),r.onPhase("error"))}}const j={bg:"#ffffff",ink:"#282524",muted:"#78726e",faint:"#a6a09d",border:"rgba(40,37,36,0.09)",surface:"#ffffff",primary:"#282524",primaryFg:"#ffffff",soft:"#8caa25",limeTint:"#eff6cc"},bt=[{src:"/logos/summit/fila.svg",alt:"Fila",w:100,h:34},{src:"/logos/summit/osklen.svg",alt:"Osklen",w:152,h:21},{src:"/logos/summit/farm-rio.svg",alt:"Farm Rio",w:159,h:23},{src:"/logos/summit/electrolux.svg",alt:"Electrolux",w:154,h:35},{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",w:116,h:61},{src:"/logos/summit/technos.svg",alt:"Technos",w:141,h:29},{src:"/logos/summit/bagaggio.svg",alt:"Bagaggio",w:149,h:22},{src:"/logos/summit/le-biscuit.svg",alt:"Le Biscuit",w:141,h:24},{src:"/logos/summit/miess.svg",alt:"Miess",w:113,h:43},{src:"/logos/summit/casa-e-video.svg",alt:"Casa & Video",w:145,h:18},{src:"/logos/summit/hering-fill.svg",alt:"Hering",w:140,h:30}],yt=4,jt=2400;function _t(o){const e=Array.from({length:o},()=>[]);return bt.forEach((t,r)=>e[r%o]?.push(t)),e}function ve(o){const e=E.c(22),{logos:t,delayMs:r,last:n,bottomRow:l}=o,[d,m]=z.useState(0);let a;e[0]!==r||e[1]!==t.length?(a=k=>{if(!k)return;let N;const P=setTimeout(()=>{N=setInterval(()=>m(S=>(S+1)%t.length),jt)},r);return()=>{clearTimeout(P),N&&clearInterval(N)}},e[0]=r,e[1]=t.length,e[2]=a):a=e[2];const c=a,p=t[d%t.length]??t[0];if(!p)return null;const i=Math.min(78/p.w,22/p.h);let u;e[3]!==p.w||e[4]!==i?(u=Math.round(p.w*i),e[3]=p.w,e[4]=i,e[5]=u):u=e[5];const f=u;let h;e[6]!==p.h||e[7]!==i?(h=Math.round(p.h*i),e[6]=p.h,e[7]=i,e[8]=h):h=e[8];const x=h,g=n?void 0:`1px solid ${j.border}`,b=l?`1px solid ${j.border}`:void 0;let y;e[9]!==g||e[10]!==b?(y={borderRight:g,borderTop:b},e[9]=g,e[10]=b,e[11]=y):y=e[11];let _;e[12]!==d||e[13]!==p.alt||e[14]!==p.src||e[15]!==x||e[16]!==f?(_=s.jsx("img",{src:p.src,alt:p.alt,width:f,height:x,className:"logo-carousel-enter block"},d),e[12]=d,e[13]=p.alt,e[14]=p.src,e[15]=x,e[16]=f,e[17]=_):_=e[17];let v;return e[18]!==c||e[19]!==y||e[20]!==_?(v=s.jsx("div",{ref:c,className:"flex min-w-0 flex-1 items-center justify-center overflow-hidden py-3",style:y,children:_}),e[18]=c,e[19]=y,e[20]=_,e[21]=v):v=e[21],v}function vt(){const o=E.c(1);let e;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const t=_t(yt);e=s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 overflow-hidden rounded-xl sm:hidden",style:{border:`1px solid ${j.border}`},children:t.map(kt)}),s.jsx("div",{className:"hidden overflow-hidden rounded-xl sm:flex",style:{border:`1px solid ${j.border}`},children:t.map((r,n)=>s.jsx(ve,{logos:r,delayMs:n*380,last:n===t.length-1},r[0]?.src))})]}),o[0]=e}else e=o[0];return e}function kt(o,e){return s.jsx(ve,{logos:o,delayMs:e*380,last:e%2===1,bottomRow:e>=2},o[0]?.src)}function ke(o){const e=E.c(12),{compact:t}=o,r=t===void 0?!1:t,n=B(),l=r?"mt-5 pt-5":"mt-8 pt-6";let d;e[0]!==l?(d=V(l),e[0]=l,e[1]=d):d=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m={borderTop:`1px solid ${j.border}`},e[2]=m):m=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={color:j.faint},e[3]=a):a=e[3];let c;e[4]!==n?(c=n("reports.socialProof.alreadyReceived"),e[4]=n,e[5]=c):c=e[5];let p;e[6]!==c?(p=s.jsx("p",{className:"mb-4 text-center text-[11px] uppercase tracking-[0.04em]",style:a,children:c}),e[6]=c,e[7]=p):p=e[7];let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(vt,{}),e[8]=i):i=e[8];let u;return e[9]!==d||e[10]!==p?(u=s.jsxs("div",{className:d,style:m,children:[p,i]}),e[9]=d,e[10]=p,e[11]=u):u=e[11],u}const pe=/^\/(?!\/|\\|%2f|%5c)[\w\-.+/@]*(?:\?[\w\-.+/=&%@]*)?$/;function wt(o){const e=`/report/${encodeURIComponent(o)}`,t=pe.test(e)?e:"/";if(typeof window>"u")return t;const r=new URLSearchParams(window.location.search).toString(),n=r?`${t}?${r}`:t;return pe.test(n)?n:t}const Nt={"--background":"oklch(0.99 0.003 73)","--foreground":"oklch(0.145 0.01 60)","--card":"oklch(1 0 0)","--card-foreground":"oklch(0.145 0.01 60)","--muted-foreground":"oklch(0.46 0.012 60)","--accent":"oklch(0.955 0.008 80)","--accent-foreground":"oklch(0.2 0.01 60)","--border":"oklch(0.915 0.005 80)","--input":"oklch(0.88 0.006 80)","--ring":"oklch(0.205 0.012 60)","--primary":"oklch(0.205 0.012 60)","--primary-foreground":"oklch(0.98 0.005 60)","--destructive":"oklch(0.58 0.22 27)","--destructive-foreground":"oklch(0.97 0.01 17)","--success":"oklch(0.6 0.17 149)","--success-foreground":"oklch(0.98 0.02 156)"};function Pt(o){return{otpSendFailed:o("reports.authGate.otpSendFailed"),invalidCode:o("reports.authGate.invalidCode"),invalidEmail:o("reports.authGate.invalidEmail"),networkError:o("reports.authGate.networkError"),tooManyAttempts:o("reports.authGate.tooManyAttempts"),invalidOrExpiredCode:o("reports.authGate.invalidOrExpiredCode"),genericError:o("reports.authGate.genericError"),verificationCodeTitle:o("reports.authGate.verificationCodeTitle"),codeSentTo:e=>o("reports.authGate.codeSentTo",{email:e}),continueWith:e=>o("reports.authGate.continueWith",{provider:e}),divider:o("reports.authGate.divider"),emailLabel:o("reports.authGate.emailLabel"),emailPlaceholder:o("reports.authGate.emailPlaceholder"),sending:o("reports.authGate.sending"),sendCode:o("reports.authGate.sendCode"),verificationCodeLabel:o("reports.authGate.verificationCodeLabel"),verifying:o("reports.authGate.verifying"),useDifferentEmail:o("reports.authGate.useDifferentEmail")}}function St(o){const e=E.c(51),{domain:t}=o,r=B(),n=Pe();let l;e[0]!==t?(l=w=>{const G="provider"in w?w.provider:void 0,H="mode"in w?w.mode:void 0,O={method:w.method==="social"?G??"social":w.method,provider:G,auth_mode:H},D=Ae(t,O),I={domain:t,surface:M,...oe(D),...O};w.type==="started"?T("report_auth_started",I):w.type==="otp_sent"?T("report_auth_otp_sent",I):w.type==="otp_submitted"?T("report_auth_otp_submitted",I):w.type==="failed"&&T("report_auth_failed",{...I,failure_stage:w.stage,error_type:Ee(w.error)})},e[0]=t,e[1]=l):l=e[1];const d=l;let m;e[2]!==t||e[3]!==n?(m=()=>n.invalidateQueries({queryKey:ge.reportAll(t)}),e[2]=t,e[3]=n,e[4]=m):m=e[4];const a=m;let c;e[5]!==t?(c=w=>{if(!w)return;const G=Le(t);w.dataset.tracked==="true"||!q()||(w.dataset.tracked="true",T("report_auth_gate_shown",{domain:t,surface:M,...oe(G)}))},e[5]=t,e[6]=c):c=e[6];const p=c;let i;e[7]!==r?(i=r("reports.authGate.accessYourReport"),e[7]=r,e[8]=i):i=e[8];let u;e[9]!==t?(u=wt(t),e[9]=t,e[10]=u):u=e[10];let f;e[11]!==r?(f=r("reports.authGate.accessYourReport"),e[11]=r,e[12]=f):f=e[12];let h;e[13]!==r?(h=r("reports.authGate.authSubtitle"),e[13]=r,e[14]=h):h=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=["google"],e[15]=x):x=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g={borderColor:j.border,background:j.bg},e[16]=g):g=e[16];let b;e[17]!==t?(b=ie(t),e[17]=t,e[18]=b):b=e[18];let y;e[19]!==b?(y=s.jsx("img",{src:b,alt:"",className:"h-4 w-4 shrink-0 rounded object-contain"}),e[19]=b,e[20]=y):y=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_={color:j.muted},e[21]=_):_=e[21];let v;e[22]!==t?(v=s.jsx("span",{className:"truncate text-[13px]",style:_,children:t}),e[22]=t,e[23]=v):v=e[23];let k;e[24]!==y||e[25]!==v?(k=s.jsxs("div",{className:"inline-flex min-w-0 items-center gap-2 rounded-full border px-3 py-1.5",style:g,children:[y,v]}),e[24]=y,e[25]=v,e[26]=k):k=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 shrink-0"}),e[27]=N):N=e[27];let P;e[28]!==k?(P=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[k,N]}),e[28]=k,e[29]=P):P=e[29];let S;e[30]!==r?(S=Pt(r),e[30]=r,e[31]=S):S=e[31];let C;e[32]!==d||e[33]!==a||e[34]!==P||e[35]!==S||e[36]!==u||e[37]!==f||e[38]!==h?(C=s.jsx(Ie,{callbackUrl:u,title:f,subtitle:h,variant:"compact",allowedSocialProviders:x,allowPassword:!1,onAuthEvent:d,onAuthenticated:a,brand:P,copy:S}),e[32]=d,e[33]=a,e[34]=P,e[35]=S,e[36]=u,e[37]=f,e[38]=h,e[39]=C):C=e[39];let A;e[40]===Symbol.for("react.memo_cache_sentinel")?(A={color:j.faint},e[40]=A):A=e[40];let R;e[41]!==r?(R=r("reports.authGate.freeAccess"),e[41]=r,e[42]=R):R=e[42];let $;e[43]!==R?($=s.jsx("p",{className:"mt-4 text-xs leading-5",style:A,children:R}),e[43]=R,e[44]=$):$=e[44];let F;e[45]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(ke,{compact:!0}),e[45]=F):F=e[45];let L;return e[46]!==C||e[47]!==$||e[48]!==i||e[49]!==p?(L=s.jsxs("section",{ref:p,role:"dialog","aria-modal":"true","aria-label":i,className:"w-full max-w-[440px] rounded-2xl bg-white px-6 py-6 shadow-edge sm:rounded-3xl sm:px-8 sm:py-8",style:Nt,children:[C,$,F]}),e[46]=C,e[47]=$,e[48]=i,e[49]=p,e[50]=L):L=e[50],L}function Ct(o){const e=E.c(7),{domain:t,onClose:r}=o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={color:j.ink,fontFamily:"Switzer, 'Inter var', Helvetica, Arial, sans-serif",WebkitFontSmoothing:"antialiased"},e[0]=n):n=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"absolute inset-0 bg-white/70 backdrop-blur-sm"}),e[1]=l):l=e[1];let d;e[2]!==t?(d=s.jsx("div",{className:"relative z-10",onClick:Rt,children:s.jsx(St,{domain:t})}),e[2]=t,e[3]=d):d=e[3];let m;return e[4]!==r||e[5]!==d?(m=s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-3 py-5 sm:px-6 sm:py-10",style:n,onClick:r,children:[l,d]}),e[4]=r,e[5]=d,e[6]=m):m=e[6],m}function Rt(o){return o.stopPropagation()}const $t="#D0EC1A",we="#07401A",fe="0 1px 2px rgba(40,37,36,0.05), 0 18px 48px -18px rgba(40,37,36,0.28)",At=()=>q()?Z.get_distinct_id():void 0;function Et(o){const e=E.c(15),{domain:t,initial:r,sessionEmail:n,lang:l}=o,[d,m]=z.useState(r.report);let a;e[0]!==t?(a=()=>ht(t)?"pending":"scanning",e[0]=t,e[1]=a):a=e[1];const[c,p]=z.useState(a);let i;e[2]!==t||e[3]!==r.status||e[4]!==l?(i=x=>{if(!x||r.status==="ready")return;const g=new AbortController;return xt(t,At(),g.signal,{onPhase:p,onReport:m},l),()=>g.abort()},e[2]=t,e[3]=r.status,e[4]=l,e[5]=i):i=e[5];const u=i;if(d){let x;return e[6]!==d?(x=s.jsx(Qe,{report:d}),e[6]=d,e[7]=x):x=e[7],x}let f;e[8]!==t||e[9]!==c||e[10]!==n?(f=s.jsx(Tt,{domain:t,phase:c,email:n}),e[8]=t,e[9]=c,e[10]=n,e[11]=f):f=e[11];let h;return e[12]!==u||e[13]!==f?(h=s.jsx("div",{ref:u,children:f}),e[12]=u,e[13]=f,e[14]=h):h=e[14],h}const ue=[{id:"initiated",labelKey:"reports.scanGate.stageInitiated",detail:null},{id:"collecting",labelKey:"reports.scanGate.stageCollecting",detail:null},{id:"building",labelKey:"reports.scanGate.stageBuilding",detail:null},{id:"ready",labelKey:"reports.scanGate.stageReady",detail:null}];function Lt(o){return o==="scanning"?["done","active","pending","pending"]:o==="pending"?["done","done","active","pending"]:o==="empty"?["done","done","done","active"]:["done","done","done","pending"]}function Tt(o){const e=E.c(27),{domain:t,phase:r,email:n}=o,l=B(),d=r==="scanning"||r==="pending"||r==="empty";let m;e[0]!==r?(m=Lt(r),e[0]=r,e[1]=m):m=e[1];const a=m;let c;e[2]!==r||e[3]!==l?(c=r==="blocked"?l("reports.scanGate.errorBlocked"):r==="error"?l("reports.scanGate.errorFailed"):null,e[2]=r,e[3]=l,e[4]=c):c=e[4];const p=c;let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i={background:j.bg,color:j.ink,fontFamily:"Switzer, 'Inter var', Helvetica, Arial, sans-serif",WebkitFontSmoothing:"antialiased"},e[5]=i):i=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={background:"rgba(255,255,255,0.15)"},e[6]=u):u=e[6];let f;e[7]!==d?(f=d&&s.jsx("div",{className:"animate-indeterminate h-full w-2/5",style:{background:$t}}),e[7]=d,e[8]=f):f=e[8];let h;e[9]!==f?(h=s.jsx("div",{className:"fixed inset-x-0 top-0 z-10 h-[2px] overflow-hidden",style:u,children:f}),e[9]=f,e[10]=h):h=e[10];let x;e[11]!==t||e[12]!==n||e[13]!==d||e[14]!==r||e[15]!==a||e[16]!==l?(x=d&&s.jsxs("div",{className:"max-h-full w-full max-w-[460px] overflow-y-auto rounded-2xl sm:rounded-3xl px-5 pt-5 pb-6 sm:px-8 sm:pt-8 sm:pb-9",style:{background:"#fff",boxShadow:fe},children:[s.jsxs("div",{className:"mb-4 sm:mb-6 inline-flex items-center gap-2 rounded-full border px-3 py-1.5",style:{borderColor:j.border,background:"#FAFAF9"},children:[s.jsx("img",{src:ie(t),alt:"",className:"h-4 w-4 rounded object-contain"}),s.jsxs("span",{className:"text-[13px]",style:{color:j.muted},children:[s.jsx("span",{style:{opacity:.5},children:"https://"}),t]})]}),s.jsxs("h1",{className:"text-[24px] sm:text-[32px] font-normal leading-[1.18] tracking-[-0.025em]",style:{color:j.ink},children:[l("reports.scanGate.headlineStart"),s.jsx("br",{}),s.jsx("span",{style:{color:j.soft},children:l("reports.scanGate.headlineEnd")})]}),s.jsx("p",{className:"mt-2 sm:mt-3 text-[13px] sm:text-[14px] leading-[1.6]",style:{color:j.muted},children:l("reports.scanGate.subtitle")}),s.jsxs("div",{className:"mt-4 sm:mt-5 rounded-xl sm:rounded-2xl px-4 sm:px-5 py-4 sm:py-5",style:{background:"#F2F1EF"},children:[s.jsx("p",{className:"mb-2.5 sm:mb-3 text-[15px] sm:text-[16px]",style:{color:j.ink},children:l(n?"reports.scanGate.notificationLabel":"reports.scanGate.anonymousLabel")}),n?s.jsx(Ft,{email:n}):s.jsx(It,{domain:t})]}),s.jsx("div",{className:"mt-5 sm:mt-7 rounded-xl sm:rounded-2xl overflow-hidden",style:{border:`1px solid ${j.border}`},children:ue.map((_,v)=>{const k=a[v]??"pending",N=v===ue.length-1;return s.jsxs("div",{className:"flex items-start gap-3 sm:gap-4 px-4 sm:px-5 py-3 sm:py-4",style:{borderTop:v>0?`1px solid ${j.border}`:void 0,background:k==="active"?j.limeTint:void 0},children:[s.jsxs("div",{className:"flex flex-col items-center self-stretch pt-0.5",children:[s.jsx(Gt,{state:k}),!N&&s.jsx("div",{className:"w-px flex-1 mt-2",style:{background:k==="done"?j.soft:j.border,opacity:k==="done"?.5:1}})]}),s.jsxs("div",{className:"min-w-0 flex-1 py-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[13px] sm:text-[14px] leading-5",style:{color:k==="pending"?j.faint:j.ink,fontWeight:k==="active"?500:400},children:l(_.labelKey)}),k==="active"&&s.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded-md font-medium",style:{background:j.limeTint,color:we,border:"1px solid rgba(7,64,26,0.15)"},children:l("reports.scanGate.stageNow")})]}),_.detail&&k!=="pending"&&s.jsx("p",{className:"mt-0.5 text-[12px] leading-4",style:{color:j.faint},children:_.detail})]})]},_.id)})}),r==="empty"?s.jsxs("p",{className:"mt-5 sm:mt-7 text-[12px] leading-4",style:{color:j.faint},children:[l("reports.scanGate.errorEmpty")," ",s.jsx("a",{href:"https://decocms.com/diagnostico",className:"underline",children:l("reports.scanGate.tryAnother")})]}):s.jsx(ke,{compact:!0})]}),e[11]=t,e[12]=n,e[13]=d,e[14]=r,e[15]=a,e[16]=l,e[17]=x):x=e[17];let g;e[18]!==p||e[19]!==l?(g=p&&s.jsxs("div",{className:"w-full max-w-[460px] rounded-3xl px-8 py-10",style:{background:"#fff",boxShadow:fe},children:[s.jsx("div",{className:"mb-5 flex h-10 w-10 items-center justify-center rounded-full",style:{background:"rgba(212,61,61,0.08)"},children:s.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 22 22",fill:"none","aria-hidden":"true",children:[s.jsx("path",{d:"M11 7v5M11 15h.01",stroke:"#d43d3d",strokeWidth:"2",strokeLinecap:"round"}),s.jsx("circle",{cx:"11",cy:"11",r:"9",stroke:"#d43d3d",strokeWidth:"1.5"})]})}),s.jsx("p",{className:"text-[20px] font-normal leading-snug tracking-[-0.02em]",style:{color:j.ink},children:p}),s.jsx("a",{href:"https://decocms.com/diagnostico",className:"mt-5 inline-flex items-center gap-2 rounded-xl px-4 py-2.5 text-[14px] font-medium transition-transform active:scale-[0.98]",style:{background:j.primary,color:j.primaryFg},children:l("reports.scanGate.tryAnother")})]}),e[18]=p,e[19]=l,e[20]=g):g=e[20];let b;e[21]!==x||e[22]!==g?(b=s.jsxs("div",{className:"relative z-10 flex h-full flex-col items-center justify-center px-3 py-4 sm:px-5 sm:py-8",children:[x,g]}),e[21]=x,e[22]=g,e[23]=b):b=e[23];let y;return e[24]!==h||e[25]!==b?(y=s.jsxs("div",{className:"fixed inset-0 overflow-hidden",style:i,children:[h,b]}),e[24]=h,e[25]=b,e[26]=y):y=e[26],y}function Gt(o){const e=E.c(5),{state:t}=o;if(t==="done"){let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={background:j.soft},e[0]=n):n=e[0];let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-full",style:n,children:s.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M1.5 4.5l2 2L7.5 2.5",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e[1]=l):l=e[1],l}if(t==="active"){let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"absolute h-full w-full rounded-full animate-ping opacity-30",style:{background:j.soft}}),e[2]=n):n=e[2];let l;return e[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"relative flex h-[18px] w-[18px] shrink-0 items-center justify-center",children:[n,s.jsx("div",{className:"h-3 w-3 rounded-full",style:{background:j.soft}})]}),e[3]=l):l=e[3],l}let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"h-[18px] w-[18px] shrink-0 rounded-full",style:{border:`1.5px solid ${j.border}`}}),e[4]=r):r=e[4],r}function It(o){const e=E.c(18),{domain:t}=o,r=B(),[n,l]=z.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>l(!0),e[0]=d):d=e[0];let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m={background:j.primary,color:j.primaryFg},e[1]=m):m=e[1];let a;e[2]!==r?(a=r("reports.scanGate.anonymousSignIn"),e[2]=r,e[3]=a):a=e[3];let c;e[4]!==a?(c=s.jsx("button",{type:"button",onClick:d,className:"flex h-11 w-full items-center justify-center rounded-lg px-5 text-[14px] font-medium transition-transform active:scale-[0.98]",style:m,children:a}),e[4]=a,e[5]=c):c=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:j.muted},e[6]=p):p=e[6];let i;e[7]!==r?(i=r("reports.scanGate.anonymousHelp"),e[7]=r,e[8]=i):i=e[8];let u;e[9]!==i?(u=s.jsx("p",{className:"mt-2.5 text-[12px] leading-4",style:p,children:i}),e[9]=i,e[10]=u):u=e[10];let f;e[11]!==t||e[12]!==n?(f=n&&s.jsx(Ct,{domain:t,onClose:()=>l(!1)}),e[11]=t,e[12]=n,e[13]=f):f=e[13];let h;return e[14]!==c||e[15]!==u||e[16]!==f?(h=s.jsxs(s.Fragment,{children:[c,u,f]}),e[14]=c,e[15]=u,e[16]=f,e[17]=h):h=e[17],h}function Ft(o){const e=E.c(14),{email:t}=o,r=B();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={background:j.limeTint},e[0]=n):n=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={background:j.soft},e[1]=l):l=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full",style:l,children:s.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M2 6l2.5 2.5L10 3.5",stroke:"#fff",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),e[2]=d):d=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m={color:we},e[3]=m):m=e[3];let a;e[4]!==t?(a=s.jsx("p",{className:"truncate text-[13px] font-medium",style:m,children:t}),e[4]=t,e[5]=a):a=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c={color:j.soft},e[6]=c):c=e[6];let p;e[7]!==r?(p=r("reports.scanGate.notificationHelp"),e[7]=r,e[8]=p):p=e[8];let i;e[9]!==p?(i=s.jsx("p",{className:"text-[12px]",style:c,children:p}),e[9]=p,e[10]=i):i=e[10];let u;return e[11]!==a||e[12]!==i?(u=s.jsxs("div",{className:"flex min-w-0 items-center gap-3 rounded-xl px-4 py-3",style:n,children:[d,s.jsxs("div",{className:"min-w-0",children:[a,i]})]}),e[11]=a,e[12]=i,e[13]=u):u=e[13],u}const Mt=Re("/report/$domain");function Ot(o,e,t){return r=>{if(!r||!o)return;const n=document.title;document.title=e;const l=t||ie(o,64),d=document.head,m=Array.from(d.querySelectorAll('link[rel~="icon"]')).filter(c=>!c.hasAttribute("data-domain-favicon"));m.forEach(c=>{c.dataset.prevRel=c.getAttribute("rel")??"",c.setAttribute("rel","decocms-icon-disabled")});const a=document.createElement("link");return a.rel="icon",a.href=l,a.setAttribute("data-domain-favicon",""),d.appendChild(a),()=>{document.title=n,a.remove(),m.forEach(c=>{c.setAttribute("rel",c.dataset.prevRel??"icon"),delete c.dataset.prevRel})}}}function Bt(o){const e=E.c(24),{retry:t}=o,r=B();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={background:j.bg,fontFamily:"Switzer, 'Inter var', Helvetica, Arial, sans-serif"},e[0]=n):n=e[0];let l;e[1]!==r?(l=r("routes.reports.failedToLoadReportAriaLabel"),e[1]=r,e[2]=l):l=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={background:j.surface,color:j.ink},e[3]=d):d=e[3];let m;e[4]!==r?(m=r("routes.reports.failedToLoadReportTitle"),e[4]=r,e[5]=m):m=e[5];let a;e[6]!==m?(a=s.jsx("h1",{className:"text-xl font-medium leading-7",children:m}),e[6]=m,e[7]=a):a=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c={color:j.muted},e[8]=c):c=e[8];let p;e[9]!==r?(p=r("routes.reports.failedToLoadReportDescription"),e[9]=r,e[10]=p):p=e[10];let i;e[11]!==p?(i=s.jsx("p",{className:"mt-2 text-sm leading-6",style:c,children:p}),e[11]=p,e[12]=i):i=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u={background:j.primary,color:j.primaryFg},e[13]=u):u=e[13];let f;e[14]!==r?(f=r("routes.reports.retryButton"),e[14]=r,e[15]=f):f=e[15];let h;e[16]!==t||e[17]!==f?(h=s.jsx("button",{type:"button",onClick:t,className:"mt-6 inline-flex h-11 items-center justify-center rounded-lg px-6 text-sm font-medium transition-transform duration-300 ease-out hover:scale-[1.03]",style:u,children:f}),e[16]=t,e[17]=f,e[18]=h):h=e[18];let x;return e[19]!==h||e[20]!==l||e[21]!==a||e[22]!==i?(x=s.jsx("div",{className:"fixed inset-0 overflow-y-auto",style:n,children:s.jsx("div",{className:"relative z-10 flex min-h-full items-center justify-center px-4 py-10",children:s.jsxs("section",{role:"alert","aria-label":l,className:"w-full max-w-[440px] rounded-3xl px-7 py-8 shadow-edge",style:d,children:[a,i,h]})})}),e[19]=h,e[20]=l,e[21]=a,e[22]=i,e[23]=x):x=e[23],x}function zt(){const o=E.c(16),{domain:e}=Mt.useParams(),t=ae(e),r=Se.useSession(),n=!!r.data?.user,[l]=he(),{language:d}=l,m=Ce({queryKey:ge.report(t,d),queryFn:()=>xe(t,d),staleTime:1/0,retry:1}),a=m.data?.report??null,{title:c}=Oe({brand:a?.brand.trim()||Fe(t),domain:t,score:a?.score});let p;o[0]!==n||o[1]!==t?(p=g=>{if(!g||!n||g.dataset.authCompletionTracked==="true"||!q())return;const b=Te(t);b&&(g.dataset.authCompletionTracked="true",T("report_auth_succeeded",{domain:t,surface:M,...oe(b),method:b.method??"unknown",time_to_auth_ms:Math.max(0,Date.now()-b.gate_shown_at),...b.provider?{provider:b.provider}:{},...b.auth_mode?{auth_mode:b.auth_mode}:{}}))},o[0]=n,o[1]=t,o[2]=p):p=o[2];const i=p;let u;o[3]!==t||o[4]!==m||o[5]!==d||o[6]!==r.data?.user?.email?(u=m.isPending?s.jsx("div",{className:"fixed inset-0",style:{background:j.bg},"aria-busy":"true"}):m.isError?s.jsx(Bt,{retry:()=>{m.refetch()}}):s.jsx(Et,{domain:t,initial:m.data,sessionEmail:r.data?.user?.email??"",lang:d}),o[3]=t,o[4]=m,o[5]=d,o[6]=r.data?.user?.email,o[7]=u):u=o[7];const f=u;let h;o[8]!==i||o[9]!==t||o[10]!==a?.favicon||o[11]!==c?(h=g=>{const b=Ot(t,c,a?.favicon)(g);return i(g),b},o[8]=i,o[9]=t,o[10]=a?.favicon,o[11]=c,o[12]=h):h=o[12];let x;return o[13]!==f||o[14]!==h?(x=s.jsx("div",{ref:h,children:f}),o[13]=f,o[14]=h,o[15]=x):x=o[15],x}export{zt as default};