import{_ as b}from"./AdminLayout-bd13ff9d.js";import{_ as k}from"./Paginate-f61b79b2.js";import{_ as w}from"./PageHeader-8c638686.js";import{s as y,p as a,h as f,c as u,a as n,u as l,b as t,t as s,F as P,r as $,e as _,i as g,g as A,o as r,j as m,k as x,n as S}from"./app-13978987.js";import{_ as E}from"./NoDataFound-bc81d7fa.js";import{_ as N}from"./Filter-ccd66554.js";import V from"./OverviewGrid-21ea6fc2.js";import"./dropdown-45d66330.js";const q={class:"container flex-grow p-4 sm:p-6"},B={class:"space-y-6"},U={class:"table-responsive whitespace-nowrap rounded-primary"},D={class:"table"},I={class:"text-left"},L={class:"text-left"},O={key:0,class:"list"},j={class:"flex items-center gap-3"},z={class:"avatar avatar-circle"},F=["src"],T={class:"whitespace-nowrap text-sm font-medium text-slate-700 dark:text-slate-100"},R={class:"truncate text-xs text-slate-500 dark:text-slate-400"},G={class:"text-center"},H={class:"text-center"},J={class:"text-center"},K={class:"dropdown","data-placement":"bottom-start"},M={class:"dropdown-toggle"},Q={class:"dropdown-content w-40"},W={class:"dropdown-list"},X={class:"dropdown-list-item"},Y={class:"dropdown-list-item"},Z={class:"dropdown-list-item"},tt=A({layout:b}),ut=Object.assign(tt,{__name:"Index",props:["segments","buttons","customers","request","type","totalCustomers","totalActiveCustomers","totalSuspendedCustomers","totalExpiredCustomers"],setup(e){const{deleteRow:v}=y(),i=e,C=[{value:i.totalCustomers,title:a("Total Customers"),iconClass:"bx:box"},{value:i.totalActiveCustomers,title:a("Active Customers"),iconClass:"bx:dollar-circle"},{value:i.totalExpiredCustomers,title:a("Expired Customers"),iconClass:"ti ti-thumb-up"},{value:i.totalSuspendedCustomers,title:a("Suspended Customers"),iconClass:"ti ti-message-2-cog"}];return(h,et)=>{const c=f("Link"),d=f("Icon");return r(),u("main",q,[n(w,{title:l(a)("Customers"),buttons:e.buttons},null,8,["title","buttons"]),t("div",B,[n(V,{items:C}),n(N,{request:e.request},null,8,["request"]),t("div",U,[t("table",D,[t("thead",null,[t("tr",null,[t("th",null,s(l(a)("Customer")),1),t("th",null,s(l(a)("Plan")),1),t("th",null,s(l(a)("Orders")),1),t("th",null,s(l(a)("Expire Date")),1),t("th",null,s(l(a)("Status")),1),t("th",I,s(l(a)("Created At")),1),t("th",L,s(l(a)("Action")),1)])]),e.customers.length!=0?(r(),u("tbody",O,[(r(!0),u(P,null,$(e.customers.data,o=>{var p;return r(),u("tr",{key:o.id},[t("td",null,[t("div",j,[t("div",z,[t("img",{class:"avatar-img",src:o.avatar,onerror:"this.src = '/images/avatar1.png'"},null,8,F)]),t("div",null,[t("h6",T,[n(c,{href:h.route("admin.customer.show",o),class:"text-dark"},{default:m(()=>[x(s(o.name),1)]),_:2},1032,["href"])]),t("p",R,s(o.email),1)])])]),t("td",null,s(((p=o.subscription)==null?void 0:p.title)??"NA"),1),t("td",G,s(o.orders_count),1),t("td",H,s(o.will_expire),1),t("td",null,[t("span",{class:S(o.status==1?"badge badge-success":"badge badge-danger")},s(o.status==1?"Active":"Suspended"),3)]),t("td",J,s(o.created_at_date),1),t("td",null,[t("div",K,[t("div",M,[n(d,{class:"text-2xl",icon:"bx:dots-horizontal-rounded"})]),t("div",Q,[t("ul",W,[t("li",X,[n(c,{href:h.route("admin.customer.show",o.id),class:"dropdown-link"},{default:m(()=>[n(d,{icon:"fe:external-link"}),t("span",null,s(l(a)("View")),1)]),_:2},1032,["href"])]),t("li",Y,[n(c,{href:`/admin/customer/${o.id}/edit`,class:"dropdown-link"},{default:m(()=>[n(d,{icon:"fe:edit"}),t("span",null,s(l(a)("Edit")),1)]),_:2},1032,["href"])]),t("li",Z,[n(c,{as:"button",href:"#",onClick:st=>l(v)("/admin/customer/"+o.id),class:"dropdown-link"},{default:m(()=>[n(d,{icon:"fe:trash"}),x(" "+s(l(a)("Delete")),1)]),_:2},1032,["onClick"])])])])])])])}),128))])):_("",!0)]),e.customers.length==0?(r(),g(E,{key:0,type:"info",text:l(a)("Opps you have not created any plan....")},null,8,["text"])):_("",!0),e.customers.length!=0?(r(),g(k,{key:1,links:e.customers.links,currentPage:e.customers.current_page,from:e.customers.from,lastPage:e.customers.last_page,lastPageUrl:e.customers.last_page_url,nextpageurl:e.customers.next_page_url,perPage:e.customers.per_page,prevPageUrl:e.customers.prev_page_url,to:e.customers.to,total:e.customers.total},null,8,["links","currentPage","from","lastPage","lastPageUrl","nextpageurl","perPage","prevPageUrl","to","total"])):_("",!0)])])])}}});export{ut as default};
