import{T as w,r as $,c,o as l,b as t,a as o,i as D,t as a,F as b,g as V,w as m,d as f,e as v,u as e,h as k,N as p,j as F}from"./app-B4kV47qU.js";import{_ as g}from"./Modal-ChMy0A7y.js";import{_ as B}from"./Paginate-DtQjslkz.js";import{_ as N}from"./NoDataFound-su6Kbmdk.js";import{_ as y}from"./SpinnerBtn-B3fjBeDL.js";import{s as Y}from"./sharedComposable-VJJUONp6.js";import{_ as j}from"./UserLayout-DG2qUs8x.js";import{u as L}from"./modalStore-BgORG3Nn.js";import{h as A}from"./moment-BAtM24Ew.js";import"./toastComposable-CvcyPmJb.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ToastrContainer-Cfx6wOd2.js";import"./AssetModal-vtiWQmiY.js";import"./IntersectionObserver-DbdokySM.js";import"./assetStore-cDK0Afhq.js";const I={class:"table-responsive mt-4 w-full"},U={class:"table"},q={class:"w-[40%]"},O={class:"w-[50%] !text-right"},R={class:"w-[10%] !text-right"},W={key:0,class:"tbody"},z={class:"!text-right"},G={class:"flex justify-end"},H={class:"dropdown","data-placement":"bottom-start"},J={class:"dropdown-toggle"},K={class:"dropdown-content w-56"},P={class:"dropdown-list"},Q={class:"dropdown-list-item"},X={class:"dropdown-list-item"},Z=["onClick"],tt={class:"dropdown-list-item"},st=["onClick"],et={class:"w-full"},ot={class:"mb-2"},nt={class:"mt-2 text-end"},at={class:"mb-2"},rt={class:"mt-2 text-end"},yt=Object.assign({layout:j},{__name:"Index",props:["warmers"],setup(u){const h=L(),{deleteRow:x}=Y(),i=w({title:""}),C=()=>{i.post(route("user.whatsapp-web.warmer.store"),{onSuccess:()=>{h.close("warmerCreate"),i.reset()}})},r=w({id:null,title:""}),T=()=>{r.put(route("user.whatsapp-web.warmer.update",{warmer:r.id}),{onSuccess:()=>h.close("warmerEdit")})},E=s=>{r.id=s.id,r.title=s.title,h.open("warmerEdit")};return(s,d)=>{const _=$("Link");return l(),c(b,null,[t("div",I,[t("table",U,[t("thead",null,[t("tr",null,[t("th",q,a(s.trans("Title")),1),t("th",O,a(s.trans("Date")),1),t("th",R,a(s.trans("Action")),1)])]),u.warmers.data.length?(l(),c("tbody",W,[(l(!0),c(b,null,V(u.warmers.data,(n,M)=>(l(),c("tr",{key:M},[t("td",null,[o(_,{class:"underline",href:s.route("user.whatsapp-web.warmer.show",n.id)},{default:m(()=>[t("span",null,a(n.title),1)]),_:2},1032,["href"])]),t("td",z,a(e(A)(n.created_at).format("DD MMM, YYYY h:mm A")),1),t("td",null,[t("div",G,[t("div",H,[t("div",J,[o(e(p),{class:"h-5 text-3xl text-slate-400",icon:"bx:dots-vertical-rounded"})]),t("div",K,[t("ul",P,[t("li",Q,[o(_,{class:"dropdown-link",href:s.route("user.whatsapp-web.warmer.show",n.id)},{default:m(()=>[o(e(p),{icon:"bx:show"}),t("span",null,a(s.trans("Manage")),1)]),_:2},1032,["href"])]),t("li",X,[t("button",{type:"button",class:"dropdown-link",onClick:S=>E(n)},[o(e(p),{icon:"bx:bxs-edit-alt"}),t("span",null,a(s.trans("Edit")),1)],8,Z)]),t("li",tt,[t("button",{type:"button",class:"dropdown-link delete-confirm",onClick:S=>e(x)(s.route("user.whatsapp-web.warmer.destroy",n.id))},[o(e(p),{icon:"bx:trash"}),F(" "+a(s.trans("Delete")),1)],8,st)])])])])])])]))),128))])):(l(),D(N,{key:1,forTable:!0}))]),t("div",et,[o(B,{links:u.warmers.links},null,8,["links"])])]),o(g,{state:"warmerCreate"},{default:m(()=>[t("form",{onSubmit:f(C,["prevent"])},[t("div",ot,[t("label",null,a(s.trans("Title")),1),v(t("input",{type:"text","onUpdate:modelValue":d[0]||(d[0]=n=>e(i).title=n),class:"input",placeholder:"Title",required:""},null,512),[[k,e(i).title]])]),t("div",nt,[o(y,{classes:"btn btn-primary",processing:e(i).processing,"btn-text":s.trans("Create")},null,8,["processing","btn-text"])])],32)]),_:1}),o(g,{state:"warmerEdit"},{default:m(()=>[t("form",{onSubmit:f(T,["prevent"])},[t("div",at,[t("label",null,a(s.trans("Title")),1),v(t("input",{type:"text","onUpdate:modelValue":d[1]||(d[1]=n=>e(r).title=n),class:"input"},null,512),[[k,e(r).title]])]),t("div",rt,[o(y,{classes:"btn btn-primary",processing:e(r).processing,"btn-text":s.trans("Save Changes")},null,8,["processing","btn-text"])])],32)]),_:1})],64)}}});export{yt as default};
