import{_ as V,a as F}from"./CFPZ5lrL.js";import{_ as H}from"./DaLgO_IH.js";import{d as U,I as L,i as g,c as s,b as o,w as _,e as l,q as p,f as n,t as k,u as e,n as R,_ as j,F as u,a as r,g as q}from"./B2UyoCas.js";import{_ as z}from"./C9KnTrrC.js";import{_ as G}from"./DvpWg0hF.js";import{_ as K}from"./DzX7OmD3.js";import{u as M}from"./Cu6YsGbd.js";import"./DeNTsafF.js";import"./khFVj9yI.js";import"./DyQtVBit.js";import"./DmViyvlQ.js";import"./CsNNGtvO.js";import"./d7uC5V4A.js";import"./CHIgUVhi.js";import"./DrZRFQXy.js";import"./C7qbYC45.js";const P={class:"flex flex-col gap-4"},T={class:"font-medium text-lg p-2"},W={key:0,class:"flex items-center justify-center p-12"},J={class:"pt-4"},pe=U({__name:"healthCheck",setup(O){const{getComponentData:y,getHealthData:x}=M(),{componentData:v,componentStatus:b,componentError:d}=y(),{healthData:D,healthStatus:C,healthError:a}=x(),{t:$}=L(),c=g(()=>{var i;const t=(i=a.value)==null?void 0:i.cause;return t!=null&&t.identifier?$(`errors.${t.identifier}`):null}),E=g(()=>{var t;return!!((t=v.value)!=null&&t.components[0].component)});return(t,i)=>{const I=V,f=H,w=j,A=z,B=F,N=G,S=K;return o(),s(S,{"check-key":"plugins.healthCheck.settings"},{default:_(()=>[l("div",P,[p(f,{class:"mb-4"},{header:_(()=>[l("div",T,k(t.$t("WooCommerce Integration")),1),p(I)]),_:1}),e(b)==="pending"?(o(),n("div",W,[p(w,{name:"svg-spinners:90-ring-with-bg",class:"size-6 mr-2"}),R(" "+k(t.$t("Loading...")),1)])):(o(),n(u,{key:1},[e(E)?(o(),n(u,{key:0},[e(c)?(o(),s(A,{key:0,class:"mb-4",variant:"subtle",color:"info",description:e(c)},null,8,["description"])):r("",!0),e(C)==="success"?(o(),s(f,{key:1,class:"o_mb-4 o_p-4"},{default:_(()=>{var h;return[l("div",J,[(o(!0),n(u,null,q((h=e(D))==null?void 0:h.healthDataResults,m=>(o(),s(B,{id:m.id,key:m.id,component:m,class:"mb-5"},null,8,["id","component"]))),128))])]}),_:1})):r("",!0),(e(d)||e(a))&&!e(c)?(o(),s(N,{key:2,error:e(d)||e(a),refresh:()=>{},"with-refresh":!1},null,8,["error"])):r("",!0)],64)):r("",!0)],64))])]),_:1})}}});export{pe as default};
