import{L as u}from"./Layout-DhxLvS0V.js";import{X as C,B as b,C as i,j as f,t as p,m as s,k as r,H as y,z as w,y as m,E as D,x}from"./vendor-CoimUlS3.js";import{_}from"./DeleteConfirmation-DUAM5X1V.js";import{T}from"./TextInput-UGcC5hIa.js";import{L as V}from"./LoadingButton-BqD68voa.js";import{_ as k}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./LogoutButton-BZlSuKxY.js";import"./app-W9XHfen4.js";import"./utils-CXPYudwi.js";/* empty css                                                                 */import"./ui-CI37mw-K.js";import"./Logo-DiOikIGZ.js";import"./FlashMessages-D1juQjH6.js";const B={layout:u,metaInfo(){return{title:this.form.name}},components:{Layout:u,LoadingButton:V,TextInput:T,Link:b,Head:C,DeleteConfirmation:_},props:{title:String,status:Object},remember:"form",data(){return{form:this.$inertia.form({name:this.status.name,slug:this.status.slug}),showDeleteModal:!1,deleteConfig:{title:"Are you sure?",message:"This action cannot be undone.",itemName:"this item",itemType:"item",deleteUrl:"",deleteMethod:"delete",deleteData:{},confirmButtonText:"Delete",cancelButtonText:"Cancel"}}},methods:{update(){this.form.put(this.route("statuses.update",this.status.id))},showDeleteConfirmation(o,t=null){Object.assign(this.deleteConfig,o),this.showDeleteModal=!0,t&&(this.deleteConfig.onConfirmCallback=t)},hideDeleteConfirmation(){this.showDeleteModal=!1,this.deleteConfig.onConfirmCallback=null},confirmDelete(){this.deleteConfig.onConfirmCallback&&this.deleteConfig.onConfirmCallback(),this.hideDeleteConfirmation()},destroy(){this.showDeleteConfirmation({title:"Delete Status",message:"This action cannot be undone.",itemName:this.status.name,itemType:"status",deleteUrl:this.route("statuses.destroy",this.status.id),deleteMethod:"delete"})}},restore(){confirm("Are you sure you want to restore this status?")&&this.$inertia.put(this.route("statuses.restore",this.status.id))}},v={class:"bg-white rounded-md shadow overflow-hidden max-w-3xl"},M={class:"p-8 -mr-6 -mb-8 flex flex-wrap"},N={class:"px-8 py-4 bg-gray-50 border-t border-gray-100 flex items-center"};function S(o,t,a,U,e,n){const g=i("Head"),d=i("text-input"),h=i("loading-button"),c=i("DeleteConfirmation");return p(),f("div",null,[s(g,{title:o.$t(a.title)},null,8,["title"]),r("div",v,[r("form",{onSubmit:t[3]||(t[3]=y((...l)=>n.update&&n.update(...l),["prevent"]))},[r("div",M,[s(d,{modelValue:e.form.name,"onUpdate:modelValue":t[0]||(t[0]=l=>e.form.name=l),error:e.form.errors.name,class:"pr-6 pb-8 w-full lg:w-1/2",label:o.$t("Name")},null,8,["modelValue","error","label"]),s(d,{modelValue:e.form.slug,"onUpdate:modelValue":t[1]||(t[1]=l=>e.form.slug=l),error:e.form.errors.slug,class:"pr-6 pb-8 w-full lg:w-1/2",label:o.$t("Slug")},null,8,["modelValue","error","label"])]),r("div",N,[["closed","pending","processing"].includes(a.status.slug)?w("",!0):(p(),f("button",{key:0,class:"text-red-600 hover:underline",tabindex:"-1",type:"button",onClick:t[2]||(t[2]=(...l)=>n.destroy&&n.destroy(...l))},m(o.$t("Delete"))+" "+m(o.$t("Status")),1)),s(h,{loading:e.form.processing,class:"btn-indigo ml-auto",type:"submit"},{default:D(()=>[x(m(o.$t("Update"))+" "+m(o.$t("Status")),1)]),_:1},8,["loading"])])],32)]),s(c,{show:e.showDeleteModal,title:e.deleteConfig.title,message:e.deleteConfig.message,"item-name":e.deleteConfig.itemName,"item-type":e.deleteConfig.itemType,"delete-url":e.deleteConfig.deleteUrl,"delete-method":e.deleteConfig.deleteMethod,"delete-data":e.deleteConfig.deleteData,"confirm-button-text":e.deleteConfig.confirmButtonText,"cancel-button-text":e.deleteConfig.cancelButtonText,onClose:n.hideDeleteConfirmation,onConfirm:n.confirmDelete},null,8,["show","title","message","item-name","item-type","delete-url","delete-method","delete-data","confirm-button-text","cancel-button-text","onClose","onConfirm"])])}const K=k(B,[["render",S]]);export{K as default};
