import{_ as N,a as S}from"./CJoE0CJ9.js";import{_ as V}from"./xjUEazAQ.js";import{d as A,J as P,g as f,c as n,o as t,w as m,b as _,a as l,e as s,t as h,m as e,n as U,_ as F,F as p,l as a,r as L}from"./B08CJtNn.js";import{_ as R}from"./DbksU3dH.js";import{_ as j}from"./BY0xeA_q.js";import{_ as z}from"./C7P8NXhi.js";import{u as G}from"./BFzs4N3j.js";import"./BTwP6ady.js";import"./BjQaO-K3.js";import"./BzioJ4ms.js";import"./BRNs145u.js";import"./BXavTXDM.js";import"./CD8fUNjX.js";import"./-yL-v0KX.js";import"./7feIV7Ht.js";import"./gjovfe2x.js";const J={class:"flex flex-col gap-4"},K={class:"font-medium text-lg p-2"},M={key:0,class:"flex items-center justify-center p-12"},T={class:"pt-4"},le=A({__name:"healthCheck",setup(W){const{getComponentData:g,getHealthData:k}=G(),{componentData:y,componentStatus:x,componentError:u}=g(),{healthData:v,healthStatus:b,healthError:r}=k(),{t:C}=P(),c=f(()=>{const o=r.value?.cause;return o?.identifier?C(`errors.${o.identifier}`):null}),D=f(()=>!!y.value?.components[0].component);return(o,q)=>{const $=N,d=V,E=F,w=R,B=S,H=j,I=z;return t(),n(I,{"flag-name":"page:integrations.healthCheck","tracking-context":{components:"HealthCheckPage"}},{default:m(()=>[_("div",J,[l(d,{class:"mb-4"},{header:m(()=>[_("div",K,h(o.$t("WooCommerce Integration")),1),l($)]),_:1}),e(x)==="pending"?(t(),s("div",M,[l(E,{name:"svg-spinners:90-ring-with-bg",class:"size-6 mr-2"}),U(" "+h(o.$t("Loading...")),1)])):(t(),s(p,{key:1},[e(D)?(t(),s(p,{key:0},[e(c)?(t(),n(w,{key:0,class:"mb-4",variant:"subtle",color:"info",description:e(c)},null,8,["description"])):a("",!0),e(b)==="success"?(t(),n(d,{key:1,class:"o_mb-4 o_p-4"},{default:m(()=>[_("div",T,[(t(!0),s(p,null,L(e(v)?.healthDataResults,i=>(t(),n(B,{id:i.id,key:i.id,component:i,class:"mb-5"},null,8,["id","component"]))),128))])]),_:1})):a("",!0),(e(u)||e(r))&&!e(c)?(t(),n(H,{key:2,error:e(u)||e(r),refresh:()=>{},"with-refresh":!1},null,8,["error"])):a("",!0)],64)):a("",!0)],64))])]),_:1})}}});export{le as default};
