import{A as E,S as k,f as S}from"./SubscriptionModuleVisibility-Cq301U5h.js";import{_ as T,x as $,Z as v,a as h,r as c,e as p,o as s,f as n,w as o,g as _,V as a,F as g,c as i,J as w,p as z,B,ah as D}from"./app-DNXD_-wA.js";const V=$({props:{size:{default:"middle"},btnType:{default:"default"},tooltip:{default:!0},customType:{default:"button"}},emits:["onAddSuccess"],components:{PlusOutlined:v,AddEdit:E,SubscriptionModuleVisibility:k},setup(e,{emit:m}){const{permsArray:f}=h(),{initData:l,addEditUrl:y}=S(),t=c(!1),u=c("add"),d=c({...l});return{permsArray:f,visible:t,addEditType:u,addEditUrl:y,formData:d,addEditSuccess:()=>{t.value=!1,d.value={...l},m("onAddSuccess")},onClose:()=>{t.value=!1},showAdd:()=>{t.value=!0}}}}),M={key:0};function P(e,m,f,l,y,t){const u=z,d=p("PlusOutlined"),r=B,b=D,A=p("AddEdit"),C=p("SubscriptionModuleVisibility");return s(),n(C,{moduleName:"product"},{default:o(()=>[e.permsArray.includes("products_create")||e.permsArray.includes("admin")?(s(),_("div",M,[e.customType=="menu"?(s(),n(u,{onClick:e.showAdd,key:"products"},{icon:o(()=>[a(e.$slots,"icon")]),default:o(()=>[a(e.$slots,"default")]),_:3},8,["onClick"])):(s(),_(g,{key:1},[e.tooltip?(s(),n(b,{key:0,placement:"topLeft",title:e.$t("product.add"),"arrow-point-at-center":""},{default:o(()=>[i(r,{size:e.size,onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:o(()=>[i(d)]),default:o(()=>[a(e.$slots,"default")]),_:3},8,["size","onClick","type"])]),_:3},8,["title"])):(s(),n(r,{key:1,size:e.size,onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:o(()=>[i(d)]),default:o(()=>[a(e.$slots,"default")]),_:3},8,["size","onClick","type"]))],64)),i(A,{addEditType:e.addEditType,visible:e.visible,url:e.addEditUrl,onAddEditSuccess:e.addEditSuccess,onClosed:e.onClose,formData:e.formData,data:e.formData,pageTitle:e.$t("product.add"),successMessage:e.$t("product.created")},null,8,["addEditType","visible","url","onAddEditSuccess","onClosed","formData","data","pageTitle","successMessage"])])):w("",!0)]),_:3})}const F=T(V,[["render",P]]);export{F as P};
