1import{c as Ee,d as L,f as $,g as j,h as R,t as De}from"./chunk-D6GPMTLZ.js";import{a as ke}from"./chunk-URGM36D6.js";import"./chunk-CBW46YMX.js";import{a as we,b as ze}from"./chunk-XQ5GZ5BZ.js";import"./chunk-KKEWBXZS.js";import"./chunk-3TH27S4Q.js";import"./chunk-PVYVAJDQ.js";import{$a as he,A as ue,Cb as Se,Db as xe,Eb as Fe,Fb as z,G as fe,Gb as N,Hb as V,Ib as h,O as ge,Q as P,Ua as be,W as ve,X as E,Ya as A,Za as I,e as de,f as ce,gb as Ce,w as W}from"./chunk-A2K2AXLW.js";import{$b as re,$c as q,Ab as H,Bb as te,Cb as b,Dd as me,Eb as f,Ec as le,Fb as m,Fd as _e,Gb as ie,Hb as G,Hd as ye,Rb as p,Sa as s,Sb as w,Tb as ne,Tc as O,Ub as U,_b as T,bb as _,ca as J,cb as Y,cc as oe,da as K,fb as ee,ga as c,hb as y,lb as l,nb as C,oa as g,pa as v,rb as x,sa as Q,ub as k,uc as se,vb as M,vc as ae,wa as D,wb as r,xa as S,xb as o,xc as pe,yb as u,zb as B}from"./chunk-5EMGELEC.js";var Ne=(e,a)=>a.id;function Ve(e,a){if(e&1){let t=b();r(0,"tr")(1,"td",8),p(2),o(),r(3,"td",8),p(4),o(),r(5,"td",8)(6,"div",10)(7,"button",11),f("click",function(){let n=g(t).$index,d=m();return v(d.edit(n))}),u(8,"i",12),o(),r(9,"button",11),f("click",function(){let n=g(t).$index,d=m();return v(d.deleteDepartment.emit(n))}),u(10,"i",13),o()()()()}if(e&2){let t=a.$implicit;s(2),w(t.title),s(2),w(t.activities==null?null:t.activities.length)}}var Me=(()=>{class e{constructor(){this.editDepartment=new S,this.deleteDepartment=new S}edit(t){this.editDepartment.emit(this.departmentsArray.controls[t])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=_({type:e,selectors:[["f-wizard-departments-list"]],inputs:{departmentsArray:"departmentsArray"},outputs:{editDepartment:"editDepartment",deleteDepartment:"deleteDepartment"},decls:17,vars:0,consts:[[1,"row"],[1,"col-lg-12"],[1,"card"],[1,"card-body"],[1,"table-responsive","table-card"],[1,"table","align-middle","table-nowrap","table-hover"],[1,"text-muted"],[1,"bg-light"],[1,"text-center"],[1,"list","form-check-all"],[1,"d-flex","gap-3","justify-content-center"],["type","button",1,"btn","btn-ghost-primary","btn-icon","btn-sm","favourite-btn",3,"click"],[1,"ri-edit-box-line","fs-13"],[1,"ri-delete-bin-6-line","fs-13"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"table",5)(6,"thead",6)(7,"tr",7)(8,"th",8),p(9,"Department"),o(),r(10,"th",8),p(11,"Activities"),o(),r(12,"th",8),p(13,"Action"),o()()(),r(14,"tbody",9),k(15,Ve,11,2,"tr",null,Ne),o()()()()()()()),i&2&&(s(15),M(n.departmentsArray.value))},encapsulation:2})}}return e})();function Le(e,a){if(e&1){let t=b();r(0,"f-wizard-departments-list",5),f("deleteDepartment",function(n){g(t);let d=m();return v(d.onDepartmentDelete(n))})("editDepartment",function(n){g(t);let d=m();return v(d.onDepartmentEdit(n))}),o()}if(e&2){let t=m();l("departmentsArray",t.form.controls.departments)}}var Te=(()=>{class e{constructor(){this.isEdit=!1,this.groups=[],this.controlsApiService=c(ce),this.formService=c(E),this.destroyRef=c(D)}ngOnInit(){this.currentForm=this.formService.getDepartmentForm(),this.controlsApiService.getGroups().pipe(A(this.destroyRef)).subscribe(t=>{this.groups=t})}addOrEditDepartment(){this.isEdit?this.isEdit=!1:this.form.controls.departments.push(this.currentForm),this.currentForm=this.formService.getDepartmentForm()}onDepartmentEdit(t){this.currentForm=t,this.isEdit=!0}onDepartmentDelete(t){this.form.controls.departments.controls[t]===this.currentForm&&(this.isEdit=!1),this.form.controls.departments.removeAt(t)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=_({type:e,selectors:[["f-wizard-department"]],inputs:{form:"form"},decls:6,vars:7,consts:[[3,"addDepartment","departmentFormSetter","groups","isEdit","isWizard"],[3,"departmentsArray"],[1,"d-flex","align-items-start","gap-3","mt-4"],["cdkStepperNext","","data-nexttab","pills-info-desc-tab","type","button",1,"btn","btn-success","btn-label","right","ms-auto","nexttab","nexttab"],[1,"ri-arrow-right-line","label-icon","align-middle","fs-16","ms-2"],[3,"deleteDepartment","editDepartment","departmentsArray"]],template:function(i,n){i&1&&(r(0,"f-department-create",0),f("addDepartment",function(){return n.addOrEditDepartment()}),o(),y(1,Le,1,1,"f-wizard-departments-list",1),r(2,"div",2)(3,"button",3),u(4,"i",4),p(5,"To users "),o()()),i&2&&(l("departmentFormSetter",n.currentForm)("groups",n.groups)("isEdit",n.isEdit)("isWizard",!0),s(),x(n.form.value.departments!=null&&n.form.value.departments.length?1:-1),s(2),C("disabled",n.form.controls.departments.invalid))},dependencies:[we,Me,h,N],encapsulation:2})}}return e})();var $e=(e,a)=>a.id;function je(e,a){if(e&1&&(r(0,"div",13),p(1),o()),e&2){let t=m().$implicit;s(),U(" ",t.firstName[0],"",t.lastName[0]," ")}}function Re(e,a){if(e&1){let t=b();r(0,"tr")(1,"td",10)(2,"div",11)(3,"div",12),y(4,je,2,2,"div",13),o(),p(
15),o()(),r(6,"td",8),p(7),o(),r(8,"td",8)(9,"div",14)(10,"button",15),f("click",function(){let n=g(t).$index,d=m();return v(d.edit(n))}),u(11,"i",16),o(),r(12,"button",15),f("click",function(){let n=g(t).$index,d=m();return v(d.deleteEmployee.emit(n))}),u(13,"i",17),o()()()()}if(e&2){let t=a.$implicit;s(4),x(t.firstName&&t.lastName?4:-1),s(),U(" ",t.firstName," ",t.lastName," "),s(2),w(t.department)}}var Oe=(()=>{class e{constructor(){this.editEmployee=new S,this.deleteEmployee=new S}edit(t){this.editEmployee.emit(this.employeesArray.controls[t])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=_({type:e,selectors:[["f-wizard-employees-list"]],inputs:{employeesArray:"employeesArray"},outputs:{editEmployee:"editEmployee",deleteEmployee:"deleteEmployee"},decls:17,vars:0,consts:[[1,"row"],[1,"col-lg-12"],[1,"card"],[1,"card-body"],[1,"table-responsive","table-card"],[1,"table","align-middle","table-nowrap","table-hover"],[1,"text-muted"],[1,"bg-light"],[1,"text-center"],[1,"list","form-check-all"],[1,"customer_name"],[1,"d-flex","align-items-center","justify-content-center"],[1,"flex-shrink-0","avatar-xs","me-2"],[1,"avatar-title","bg-success-subtle","text-success","rounded-circle","fs-13"],[1,"d-flex","gap-3","justify-content-center"],["type","button",1,"btn","btn-ghost-primary","btn-icon","btn-sm","favourite-btn",3,"click"],[1,"ri-edit-box-line","fs-13"],[1,"ri-delete-bin-6-line","fs-13"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"table",5)(6,"thead",6)(7,"tr",7)(8,"th",8),p(9,"Name"),o(),r(10,"th",8),p(11,"Department"),o(),r(12,"th",8),p(13,"Action"),o()()(),r(14,"tbody",9),k(15,Re,14,4,"tr",null,$e),o()()()()()()()),i&2&&(s(15),M(n.employeesArray.value))},encapsulation:2})}}return e})();var Be=()=>[];function He(e,a){if(e&1&&(r(0,"div",3),u(1,"f-employee-create-edit",12),o()),e&2){let t=m();s(),l("departments",t.form.controls.departments.value||re(2,Be))("employeeForm",t.currentForm)}}function Ge(e,a){if(e&1){let t=b();r(0,"f-wizard-employees-list",13),f("deleteEmployee",function(n){g(t);let d=m();return v(d.goToDeleteEmployee(n))})("editEmployee",function(n){g(t);let d=m();return v(d.goToEditEmployee(n))}),o()}if(e&2){let t=m();l("employeesArray",t.form.controls.employees)}}var We=(()=>{class e{constructor(){this.isEdit=!1,this.formService=c(E),this.currentForm=this.formService.getEmployeeForm(
1),this.employeesFormArray=this.formService.getEmployeesFormArray()}addEditEmployee(){if(this.currentForm.invalid){O.updateFormValidation(this.employeesFormArray);return}this.isEdit?this.isEdit=!1:this.form.controls.employees.push(this.currentForm),this.currentForm=this.formService.getEmployeeForm()}goToEditEmployee(t){this.isEdit=!0,this.currentForm=t}goToDeleteEmployee(t){this.form.controls.employees.controls[t]===this.currentForm&&(this.isEdit=!1),this.form.controls.employees.removeAt(t)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=_({type:e,selectors:[["f-wizard-employees"]],inputs:{form:"form"},decls:17,vars:5,consts:[[1,"modal-content"],[1,"modal-header","border-0"],[1,"modal-title"],[1,"modal-body"],[1,"modal-footer","border-0"],["type","button",1,"btn","btn-primary","btn-sm",3,"click"],[3,"employeesArray"],[1,"d-flex","align-items-start","gap-3","mt-4"],["cdkStepperPrevious","","data-previous","pills-gen-info-tab","type","button",1,"btn","btn-link","text-decoration-none","btn-label","previestab"],[1,"ri-arrow-left-line","label-icon","align-middle","fs-16","me-2"],["cdkStepperNext","","data-nexttab","pills-success-tab","type","button",1,"btn","btn-success","btn-label","right","ms-auto","nexttab"],[1,"ri-arrow-right-line","label-icon","align-middle","fs-16","ms-2"],[3,"departments","employeeForm"],[3,"deleteEmployee","editEmployee","employeesArray"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"div",1)(2,"h1",2),p(3,"Add new user"),o()(),y(4,He,2,3,"div",3),r(5,"div",4)(6,"button",5),f("click",function(){return n.addEditEmployee()}),p(7),o()()(),y(8,Ge,1,1,"f-wizard-employees-list",6),u(9,"div",4),r(10,"div",7)(11,"button",8),u(12,"i",9),p(13," Back to Departments "),o(),r(14,"button",10),u(15,"i",11),p(16,"To Settings "),o()()),i&2&&(s(4),x(n.currentForm?4:-1),s(3),ne(" ",n.isEdit?"Edit":"Add"," "),s(),x(n.form.value.employees!=null&&n.form.value.employees.length?8:-1),s(6),C("disabled",n.form.controls.employees.invalid))},dependencies:[P,ze,Oe,h,N,V],encapsulation:2})}}return e})();var Pe=(()=>{class e{constructor(){this.stepSubmit=new S,this.actionsType=q,this.FActionsType=q}submitStep(){if(this.form.invalid){O.updateFormValidation(this.form);return}this.stepSubmit.emit()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=_({type:e,selectors:[["f-wizard-settings"]],inputs:{form:"form"},outputs:{stepSubmit:"stepSubmit"},decls:7,vars:3,consts:[[3,"formGroup","isWizard"],[1,"d-flex","align-items-start","gap-3","mt-4"],["type","button","data-previous","pills-gen-info-tab","cdkStepperPrevious","",1,"btn","btn-link","text-decoration-none","btn-label","previestab"],[1,"ri-arrow-left-line","label-icon","align-middle","fs-16","me-2"],["type","button","data-nexttab","pills-success-tab",1,"btn","btn-success","right","ms-auto","nexttab",3,"click","fHasPermission"]],template:function(i,n){i&1&&(u(0,"f-working-time-settings",0),r(1,"div",1)(2,"button",2),u(3,"
1i",3),p(4," Back to users "),o(),r(5,"button",4),f("click",function(){return n.submitStep()}),p(6," Save "),o()()),i&2&&(l("formGroup",n.form.controls.settings)("isWizard",!0),s(5),l("fHasPermission",n.actionsType.WIZARD_SAVE))},dependencies:[P,ue,fe,ke,h,V,Ce],encapsulation:2})}}return e})();var Z=(()=>{class e{constructor(){this.fb=c(ge),this.userService=c(I),this.settingsFormService=c(ve),this.formService=c(E)}initForm(){return this.fb.group({organizationId:[this.userService.company$.getValue().id,W.required],departments:this.fb.array([],W.required),employees:this.fb.array([],W.required),settings:this.settingsFormService.getOrganizationSettingsForm()})}getModelToSave(t){return{organizationId:t.value.organizationId,departments:t.controls.departments.controls.map(i=>this.formService.getDepartmentFormForSave(i)),employees:t.value.employees,settings:this.settingsFormService.getOrganizationSettingsModelToSave(t.controls.settings)}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=J({token:e,factory:e.\u0275fac})}}return e})();var Ue=[[["",8,"step-bullet"]],[["",8,"step-title"]]],qe=[".step-bullet",".step-title"],Xe=(e,a,t)=>({active:e,completed:a,done:t});function Ze(e,a){if(e&1){let t=b();B(0),r(1,"li",6),f("click",function(){let n=g(t).index,d=m();return v(d.selectedIndex=n)}),B(2,7),G(3),G(4,1),H(),o(),H()}if(e&2){let t=a.$implicit,i=a.index,n=m();s(),l("ngClass",oe(2,Xe,n.selectedIndex===i,t.completed&&i<n.selectedIndex,t.state==="done"&&i===n.selectedIndex)),s(),l("ngTemplateOutlet",t.stepLabel.template)}}function Je(e,a){if(e&1&&(r(0,"div",8),te(1,7),o()),e&2){let t=a.$implicit,i=a.index,n=m();C("active",n.selectedIndex===i),l("@stepTransition",n._getAnimationDirection(i)),s(),l("ngTemplateOutlet",t.content)}}var Ae=(()=>{class e extends z{ngOnInit(){}}return e.\u0275fac=(()=>{let a;return function(i){return(a||(a=Q(e)))(i||e)}})(),e.\u0275cmp=_({type:e,selectors:[["ng-stepper"]],standalone:!1,features:[T([{provide:z,useExisting:e},{provide:xe,useValue:{displayDefaultIndicatorType:!1}}]),ee],ngContentSelectors:qe,decls:6,vars:2,consts:[[1,"stepper"],[1,"stepper-header"],[1,"steps"],[4,"ngFor","ngForOf"],[1,"stepper-body"],["class","content",3,"active",4,"ngFor","ngForOf"],[1,"step",3,"click","ngClass"],[3,"ngTemplateOutlet"],[1,"content"]],template:function(t,i){t&1&&(ie(Ue),r(0,"div",0)(1,"div",1)(2,"ol",2),y(3,Ze,5,6,"ng-container",3),o()(),r(4,"div",4),y(5,Je,2,4,"div",5),o()()),t&2&&(s(3),l("ngForOf",i.steps),s(2),l("ngForOf",i._steps))},dependencies:[se,ae,pe],styles:['[_nghost-%COMP%]{display:block;overflow:hidden}.stepper-header[_ngcontent-%COMP%] .steps[_ngcontent-%COMP%]{width:100%;list-style:none;display:inline-flex;align-items:center;margin:0 auto}.stepper-header[_ngcontent-%COMP%] .steps[_ngcontent-%COMP%] .step[_ngcontent-%COMP%]{text-align:center;font-size:1em}.stepper-header[_ngcontent-%COMP%] .steps[_ngcontent-%COMP%] .step .step-bullet{position:relative;display:inline-flex;justify-content:center;align-items:center;height:40px;width:40px;background-color:#b3babe;border-radius:50%;color:#fff;font-size:1.3rem;text-align:center;text-decoration:none;cursor:pointer}.stepper-header[_ngcontent-%COMP%] .steps[_ngcontent-%COMP%] .step .step-title{position:absolute;right:0;bottom:-5px;left:0;margin:auto 0;height:0}.stepper-header[_ngcontent-%COMP%] .steps[_ngcontent-%COMP%] .step.active .step-bullet{background-color:#306bff}.stepper-header[_ngcontent-%COMP%] .steps[_ngcontent-%COMP%] .step.completed .step-bullet{background-color:#32e67f}.stepper-header[_ngcontent-%COMP%] .steps[_ngcontent-%COMP%] .step.done .step-bullet{background-color:#32e67f}.stepper-body[_ngcontent-%COMP%]{margin:25px auto;padding:1rem}.stepper-body[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]:not(.active){height:0;overflow:hidden}.step[_ngcontent-%COMP%]{position:relative;width:33.33%}.step[_ngcontent-%COMP%]:after{content:"";position:absolute;width:100%;height:3px;background-color:#b3babe;top:50%;left:-50%;z-index:-1}.step[_ngcontent-%COMP%]:first-child:after{content:none}.step.completed[_ngcontent-%COMP%] + .step[_ngcontent-%COMP%]:after{background-color:#32e67f}'],data:{animation:[Ee("stepTransition",[j("previous",$({transform:"translateX(-100%)",opacity:0}
1)),j("current",$({transform:"translateX(0)",opacity:1})),j("next",$({transform:"translateX(100%)",opacity:0})),R(":enter",L(0)),R("previous => current",L("500ms cubic-bezier(0.35, 0, 0.25, 1)")),R("next => current",L("500ms cubic-bezier(0.35, 0, 0.25, 1)"))])]}}),e})(),Ie=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=Y({type:e}),e.\u0275inj=K({imports:[le,h]}),e})();function Qe(e,a){e&1&&(r(0,"button",14),p(1," 1 "),o())}function Ye(e,a){if(e&1&&(r(0,"button",15),p(1," 2 "),o()),e&2){let t=m();C("pointer-event-none",t.form.controls.departments.invalid)}}function et(e,a){if(e&1&&(r(0,"button",16),p(1," 3 "),o()),e&2){let t=m();C("pointer-event-none",t.form.controls.departments.invalid||t.form.controls.employees.invalid)}}var yi=(()=>{class e{constructor(){this.config=c(me),this.router=c(ye),this.route=c(_e),this.wizardFormService=c(Z),this.wizardApiService=c(de),this.userService=c(I),this.loadingService=c(he),this.errorHandlingService=c(be),this.destroyRef=c(D)}ngOnInit(){this.form=this.wizardFormService.initForm(),this.userService.setCompanyById(+this.route.snapshot.params.company_id)}save(){this.loadingService.showLoading(),this.wizardApiService.create(this.wizardFormService.getModelToSave(this.form)).pipe(A(this.destroyRef)).subscribe({next:()=>{this.userService.setIsWizardView$(!1),this.router.navigate(["company",this.userService.company$.getValue().id,this.config.routes.company.childRoutes.home.path])},error:this.errorHandlingService.openErrorDialog}).add(this.loadingService.hideLoading)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=_({type:e,selectors:[["f-wizard"]],features:[T([Z])],decls:18,vars:8,consts:[["id","layout-wrapper"],[3,"isWizard"],[1,"main-content","overflow-auto"],[1,"page-content","pb-0"],[1,"container"],[1,"card","mb-0","overflow-auto"],[1,"card-body","form-steps"],["id","custom-progress-bar",1,"progress-nav"],["cdkStepper","",1,"cdksteppercontent","nav","nav-pills","progress-bar-tab","custom-nav",3,"linear"],[3,"optional"],["cdkStepLabel","",1,"wizard-nav","mb-5"],[3,"form"],["cdkStepLabel",""],[3,"stepSubmit","form"],["data-progressbar","custom-progress-bar","id","pills-gen-info-tab","data-bs-toggle","pill","data-bs-target","#pills-gen-info","type","button","role","tab","aria-controls","pills-gen-info","aria-selected","true",1,"nav-link","rounded-pill","active"],["data-progressbar","custom-progress-bar","id","pills-info-desc-tab","data-bs-toggle","pill","data-bs-target","#pills-info-desc","type","button","role","tab","aria-controls","pills-info-desc","aria-selected","false",1,"nav-link","rounded-pill"],["data-progressbar","custom-progress-bar","id","pills-success-tab","data-bs-toggle","pill","data-bs-target","#pills-success","type","button","role","tab","aria-controls","pills-success","aria-selected","false",1,"nav-link","rounded-pill"]],template:function(i,n){i&1&&(r(0,"div",0),u(1,"f-top-bar",1),r(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7)(8,"ng-stepper",8)(9,"cdk-step",9),y(10,Qe,2,0,"ng-template",10),u(11,"f-wizard-department",11),o(),r(12,"cdk-step",9),y(13,Ye,2,2,"ng-template",12),u(14,"f-wizard-employees",11),o(),r(15,"cdk-step",9),y(16,et,2,2,"ng-template",12),r(17,"f-wizard-settings",13),f("stepSubmit",function(){return n.save()}),o()()()()()()()()()()),i&2&&(s(),l("isWizard",!0),s(7),l("linear",!0),s(),l("optional",!1),s(2),l("form",n.form),s(),l("optional",!1),s(2),l("form",n.form),s(),l("optional",!1),s(2),l("form",n.form))},dependencies:[Te,We,Pe,De,Ie,Ae,h,Fe,z,Se],styles:[".main-content[_ngcontent-%COMP%]{margin:auto}.card-body.form-steps[_ngcontent-%COMP%]{height:85vh} li:has(>button.pointer-event-none){pointer-events:none} li.step.completed+li.step:after{background-color:var(--focust-color)!important} li.step:after{pointer-events:none}"]})}}return e})();export{yi as FWizardComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.