import"./chunk-WDDFYXZ3.js";import{b as G,c as p,d as _,e as k,f as I,i as s,l as M,o as j,q,x as B}from"./chunk-CGR7IOZB.js";import{a as D}from"./chunk-6753ERK4.js";import{Ba as e,Ca as n,Da as a,Gc as y,Hc as x,Ja as f,Jb as F,Ta as i,ab as l,ba as o,ca as d,ha as C,ld as b,md as w,ob as g,oc as h,od as S,qa as r,qd as E,rd as N,sd as A,vb as v}from"./chunk-7SK34GC7.js";import"./chunk-JKOY2XUY.js";var T=()=>({g:1}),R=()=>({g:2}),X=(()=>{class c{constructor(t,m){this.router=t,this.apiService=m,this.customerForm=new I({name:new s("",[p.required]),email:new s("",[p.required]),phone:new s("",[p.required])})}addCustomer(){console.log(this.customerForm.value),this.apiService.addCustomer(this.customerForm.value).subscribe({next:t=>{alert(t.message),this.router.navigate(["store/customers"])},error:t=>{console.error(t)}})}static{this.\u0275fac=function(m){return new(m||c)(d(F),d(D))}}static{this.\u0275cmp=C({type:c,selectors:[["app-add"]],decls:33,vars:9,consts:[[1,"bg-light","dark:bg-transparent","d-flex","flex-row","align-items-center"],["position","fixed","placement","top-center",3,"ngClass"],[1,"justify-content-center"],["lg","12","md","9","xl","6"],[1,"mx-2"],[1,"p-4"],[3,"formGroup"],[1,"text-body-secondary"],[1,"mb-3",3,"gutter"],["md",""],["cFormFloating",""],["autoComplete","name","cFormControl","","formControlName","name","placeholder","Enter Name","type","text"],["cLabel","","for","floatingInputGrid"],[3,"gutter"],[1,"mb-3",3,"cFormFloating"],["autoComplete","current-password","cFormControl","","formControlName","email","placeholder","Enter Email","type","text"],["cLabel","","for","floatingInput"],["autoComplete","current-password","cFormControl","","formControlName","phone","placeholder","Enter Phone","type","text"],[1,"d-grid","mt-2"],["cButton","","color","success","type","button",1,"text-white",3,"click"]],template:function(m,u){m&1&&(e(0,"div",0),a(1,"c-toaster",1),e(2,"c-container")(3,"c-row",2)(4,"c-col",3)(5,"c-card",4)(6,"c-card-body",5)(7,"form",6)(8,"h1"),i(9,"Add Customer"),n(),e(10,"p",7),i(11,"Add a new customer"),n(),e(12,"c-row",8)(13,"c-col",9)(14,"div",10),a(15,"input",11),e(16,"label",12),i(17,"Enter Name"),n()()()(),e(18,"c-row",13)(19,"c-col",9)(20,"div",14),a(21,"input",15),e(22,"label",16),i(23,"Enter Email"),n()()()(),e(24,"c-row",13)(25,"c-col",9)(26,"div",10),a(27,"input",17),e(28,"label",12),i(29,"Enter Phone"),n()()()(),e(30,"div",18)(31,"button",19),f("click",function(){return u.addCustomer()}),i(32,"Create Account"),n()()()()()()()()()),m&2&&(o(),r("ngClass","p-3"),o(6),r("formGroup",u.customerForm),o(5),r("gutter",l(6,T)),o(6),r("gutter",l(7,R)),o(2),r("cFormFloating",!0),o(4),r("gutter",l(8,R)))},dependencies:[v,g,S,N,E,A,w,x,y,b,h,B,M,G,_,k,j,q],encapsulation:2})}}return c})();export{X as AddComponent};
