import{_ as T,a as j}from"./CFPZ5lrL.js";import{_ as q}from"./DaLgO_IH.js";import{d as K,I as M,i as D,c as s,b as t,w as r,e as f,q as h,f as a,t as m,u as e,n as g,_ as P,F as _,a as c,g as B,v as W}from"./B2UyoCas.js";import{_ as J}from"./C9KnTrrC.js";import{_ as O}from"./CImxwpj3.js";import{_ as Q}from"./DvpWg0hF.js";import{_ as X}from"./DzX7OmD3.js";import{u as Y}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 Z={class:"flex flex-col gap-4"},tt={class:"font-medium text-lg p-2"},et={key:0,class:"flex items-center justify-center p-12"},ot={class:"flex items-center gap-2"},nt={key:1,class:"pt-4"},xt=K({__name:"woocommerce",setup(st){const{getComponentData:E,getHealthData:I}=Y(),{componentData:S,componentStatus:U,componentError:k}=E(),{healthData:i,healthStatus:A,healthError:l}=I(),{t:N}=M(),p=D(()=>{var u;const o=(u=l.value)==null?void 0:u.cause;return o!=null&&o.identifier?N(`errors.${o.identifier}`):null}),V=D(()=>{var o;return!!((o=S.value)!=null&&o.components[0].component)});return(o,u)=>{const F=T,y=q,G=P,H=J,z=W,v=j,C=O,L=Q,R=X;return t(),s(R,{"check-key":"plugins.woocommerce.settings"},{default:r(()=>[f("div",Z,[h(y,{class:"mb-4"},{header:r(()=>[f("div",tt,m(o.$t("WooCommerce Integration")),1),h(F)]),_:1}),e(U)==="pending"?(t(),a("div",et,[h(G,{name:"svg-spinners:90-ring-with-bg",class:"size-6 mr-2"}),g(" "+m(o.$t("Loading...")),1)])):(t(),a(_,{key:1},[e(V)?(t(),a(_,{key:0},[e(p)?(t(),s(H,{key:0,class:"mb-4",variant:"subtle",color:"info",description:e(p)},null,8,["description"])):c("",!0),e(A)==="success"?(t(),s(y,{key:1,class:"o_mb-4 o_p-4"},{default:r(()=>{var b,x;return[(b=e(i))!=null&&b.isGrouped?(t(),s(C,{key:0,items:e(i).getGroups,variant:"link",ui:{root:"w-full",list:"o_gap-6",content:"o_pt-8"}},{default:r(({item:n})=>[f("div",ot,[g(m(o.$t(n.name))+" ",1),n.notifications?(t(),s(z,{key:0,size:"sm",color:"error"},{default:r(()=>[g(m(n.notifications),1)]),_:2},1024)):c("",!0)])]),content:r(({item:n})=>{var $,w;return[(t(!0),a(_,null,B((w=($=e(i))==null?void 0:$.groupedStats)==null?void 0:w[n.name],d=>(t(),s(v,{id:d.id,key:d.id,component:d,class:"mb-5"},null,8,["id","component"]))),128))]}),_:1},8,["items"])):(t(),a("div",nt,[(t(!0),a(_,null,B((x=e(i))==null?void 0:x.healthDataResults,n=>(t(),s(v,{id:n.id,key:n.id,component:n,class:"mb-5"},null,8,["id","component"]))),128))]))]}),_:1})):c("",!0),(e(k)||e(l))&&!e(p)?(t(),s(L,{key:2,error:e(k)||e(l),refresh:()=>{},"with-refresh":!1},null,8,["error"])):c("",!0)],64)):c("",!0)],64))])]),_:1})}}});export{xt as default};
