import{_ as T}from"./DvpWg0hF.js";import{d as $,I as b,a2 as A,i as B,a3 as D,f as p,b as r,c as d,a as g,u as e,e as E,q as w,n as K,_ as L,t as N}from"./B2UyoCas.js";import{_ as S}from"./Bw4qhTdR.js";import"./C9KnTrrC.js";import"./88opOQSr.js";const l={BASE_URL:"https://api.koalityguide.com/?identifier=",pageSize:"monitoring.performance.pagesize",uptime:"monitoring.uptime.uptime",browserTimings:"monitoring.performance.browserspeed",serverTimings:"monitoring.performance.serverspeed",lighthouse:"monitoring.performance.lighthouse",seoscore:"monitoring.seo.lighthouse",sitemapmobile:"monitoring.seo.sitemap",contentBroken:"monitoring.content.content",javascript:"monitoring.technology.technology",certs:"monitoring.security.https",cookiesCount:"monitoring.security.cookieCount",cookieCount:"monitoring.security.cookieCount",insecureElements:"monitoring.security.insecureElements"},U={key:1,class:"transition-discrete delay-700 duration-1000 ease-in-out starting:opacity-0 ending:opacity-100"},V={class:"text-sm text-uiText-toned flex items-center gap-2"},z=$({__name:"AdvisorContent",props:{infoType:{},guideKey:{}},setup(_){const t=_,{locale:s}=b(),{setCachedData:f,addTimeToProcessedData:y}=A(),h=B(()=>t.guideKey?`advisor-${t.guideKey.replace(".","-")}-${s.value}`:`advisor-${t.infoType}-${s.value}`),{data:i,error:a,status:c,refresh:v}=D(h.value,async()=>await $fetch(`${l.BASE_URL}${t.guideKey||l[t.infoType]}&language=${s.value}&format=md&fallbackLanguage=en`),{transform:o=>y(o,36e5),getCachedData:(o,k,n)=>{if(!(n.cause==="refresh:manual"||n.cause==="refresh:hook"))return f(o)}});return(o,k)=>{var u,m;const n=T,x=L,C=S;return r(),p("div",null,[e(a)?(r(),d(n,{key:0,error:e(a),refresh:e(v)},null,8,["error","refresh"])):e(c)==="pending"?(r(),p("div",U,[E("p",V,[w(x,{name:"svg-spinners:90-ring-with-bg",class:"size-4"}),K(" "+N(o.$t("Loading advisor content...")),1)])])):g("",!0),e(c)==="success"&&((u=e(i))!=null&&u.content)?(r(),d(C,{key:2,text:(m=e(i))==null?void 0:m.content,markdown:"","big-typo":!0,class:"text-uiText-muted transition-discrete duration-300 ease-in-out opacity-100 starting:opacity-0"},null,8,["text"])):g("",!0)])}}}),H=Object.assign(z,{__name:"AdvisorContent"});export{H as default};
