import{_,d as k,Q as v,m as b,p as i,r as C,c as E,h as T,o as d,f as c,a,w as s,S as n,O as $,z as h,B as w,D as S}from"./app-BOG5ezKh.js";import{A as g,f as B}from"./fields-CE_84ULI.js";const D=k({props:{btnType:{default:"default"},tooltip:{default:!0},customType:{default:"button"}},emits:["onAddSuccess"],components:{PlusOutlined:v,AddEdit:g},setup(e,{emit:p}){const{permsArray:m}=b(),{customerInitData:l,customerAddEditUrl:f}=B(),o=i(!1),r=i("add"),t=i({...l});return{permsArray:m,visible:o,addEditType:r,customerAddEditUrl:f,formData:t,addEditSuccess:()=>{o.value=!1,t.value={...l},p("onAddSuccess")},onClose:()=>{o.value=!1},showAdd:()=>{o.value=!0}}}}),O={key:0};function P(e,p,m,l,f,o){const r=$,t=C("PlusOutlined"),u=w,y=S,A=C("AddEdit");return e.permsArray.includes("customers_create")||e.permsArray.includes("admin")?(d(),E("div",O,[e.customType=="menu"?(d(),c(r,{onClick:e.showAdd,key:"customers"},{icon:s(()=>[n(e.$slots,"icon")]),default:s(()=>[n(e.$slots,"default")]),_:3},8,["onClick"])):(d(),E(h,{key:1},[e.tooltip?(d(),c(y,{key:0,placement:"topLeft",title:e.$t("customer.add"),"arrow-point-at-center":""},{default:s(()=>[a(u,{onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:s(()=>[a(t)]),default:s(()=>[n(e.$slots,"default")]),_:3},8,["onClick","type"])]),_:3},8,["title"])):(d(),c(u,{key:1,onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:s(()=>[a(t)]),default:s(()=>[n(e.$slots,"default")]),_:3},8,["onClick","type"]))],64)),a(A,{addEditType:e.addEditType,visible:e.visible,url:e.customerAddEditUrl,onAddEditSuccess:e.addEditSuccess,onClosed:e.onClose,addEditData:e.formData,data:e.formData,pageTitle:e.$t("customer.add"),successMessage:e.$t("customer.created")},null,8,["addEditType","visible","url","onAddEditSuccess","onClosed","addEditData","data","pageTitle","successMessage"])])):T("v-if",!0)}const M=_(D,[["render",P],["__file","/Users/rajeshkumawat/sites/stockifly/resources/js/main/views/users/CustomerAddButton.vue"]]);export{M as C};
