PageSourceSearch

https://neoloop.ai/chunk-RZIB2FSP.js

js neoloop.ai collected 2026-09-24 11:02:20 UTC 324,792 bytes, 2 lines download raw bytes

1import{a as di,b as ci,c as mi,d as pi}from"./chunk-XLJQMBWS.js";import"./chunk-ZQB6SXE3.js";import{a as ae}from"./chunk-3CM64ZDJ.js";import{a as qt}from"./chunk-AVZCNZJT.js";import{a as ee}from"./chunk-PRNE23UF.js";import{a as ui}from"./chunk-5B6TE7WL.js";import{a as At}from"./chunk-J45TRQFB.js";import"./chunk-MRJL67J5.js";import{a as Ae}from"./chunk-ISG4QZ54.js";import{d as ri}from"./chunk-NVUVE2OP.js";import{Y as le}from"./chunk-T7RXMGEX.js";import{c as en}from"./chunk-FDH7XV3Z.js";import{b as O}from"./chunk-76WE5NDP.js";import{A as We,B as Xe,D as It,E as Pt,I as ie,J as li,R as D,c as oi,d as Ye,e as Je,f as si,g as wt,i as Fe,j as De}from"./chunk-A7RCACWV.js";import{D as j,E as _e,H as ce,K as Y,N as J,Q as Oe,W as tn,X as nn,Y as an,i as de,s as ke,v as Tt,x as Lt,y as Mt}from"./chunk-EXV7FKEW.js";import{Ca as Ie,la as te,ma as ne,na as je}from"./chunk-VPLVNNCX.js";import{A as se,C as qe,E as Q,F as ai,G as N,c as R,e as _,h as V,i as U,l as dt,n as Pe,o as oe,r as ct,u as H,v as K,z as mt}from"./chunk-WPKM7IVS.js";import{f as Xt,i as Zt,n as ii}from"./chunk-IXFPINUV.js";import{k as Re,l as Qe,m as Ve,r as ti,u as ni,x as Se}from"./chunk-FYTIWII5.js";import{$b as r,Ba as w,Bc as M,Da as Et,Dc as Z,E as pe,Eb as x,Fc as lt,Ga as Yn,Gc as s,Hc as S,I as xt,Ic as L,Jc as Me,Kc as xe,M as St,Ub as y,Uc as vt,V as Rn,Vb as C,Vc as Le,W as Jt,X as Ct,Xb as Ce,Yb as A,Yc as Ke,Zb as F,Zc as Zn,_b as c,_c as z,a as Qn,ac as a,bc as p,cb as Te,d as st,da as Wt,fc as tt,fd as Vt,gc as nt,gd as ei,hd as Vn,ia as b,ib as l,ic as E,j as be,k as Ue,n as Yt,oc as u,p as ve,pa as h,pd as k,qa as f,ra as jn,rc as m,sb as B,ud as ue,v as He,vc as Jn,wc as Wn,xc as Xn,yb as P}from"./chunk-VKSHKACQ.js";import{a as I,b as X,k as ze}from"./chunk-ZOCHBAGS.js";var rn=i=>({disabled:i}),Gi=i=>({active:i});function Ri(i,t){if(i&1){let e=E();r(0,"tr")(1,"td",44),s(2),a(),r(3,"td",45)(4,"p",46),s(5),a(),r(6,"span",47),s(7),a()(),r(8,"td",45),s(9),a(),r(10,"td",48)(11,"button",49),u("click",function(){let o=h(e).$implicit,d=m();return f(d.openCompanyType(o))}),s(12,"\xD6ffnen"),a()()()}if(i&2){let e=t.$implicit,n=t.index,o=m();l(2),S(o.startRecord+n),l(3),S(e.type_name),l(2),L("(",o.country_details==null?null:o.country_details.germanName,")"),l(2),L(" ",e.description," ")}}function Vi(i,t){i&1&&(r(0,"tr")(1,"td"),p(2,"app-no-data"),a()())}function qi(i,t){if(i&1){let e=E();r(0,"li",51)(1,"a",52),u("click",function(){let o=h(e).$implicit,d=m(2);return f(d.setPage(o))}),s(2),a()()}if(i&2){let e=t.$implicit,n=m(2);c("ngClass",z(2,Gi,n.pager.currentPage===e)),l(2),S(e)}}function $i(i,t){if(i&1){let e=E();r(0,"ul",50)(1,"li",51)(2,"a",52),u("click",function(){h(e);let o=m();return f(o.setPage(1))}),s(3," << "),a()(),r(4,"li",51)(5,"a",52),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager.currentPage-1))}),s(6," < "),a()(),x(7,qi,3,4,"li",53),r(8,"li",51)(9,"a",52),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager.currentPage+1))}),s(10,">"),a()(),r(11,"li",51)(12,"a",52),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager.totalPages))}),s(13,">>"),a()()()}if(i&2){let e=m();l(),c("ngClass",z(5,rn,e.pager.currentPage===1)),l(3),c("ngClass",z(7,rn,e.pager.currentPage===1)),l(3),c("ngForOf",e.pager.pages),l(),c("ngClass",z(9,rn,e.pager.currentPage===e.pager.totalPages)),l(3),c("ngClass",z(11,rn,e.pager.currentPage===e.pager.totalPages))}}var on=class i{constructor(t,e,n,o){this.userService=t;this.pagerService=e;this.fb=n;this.sweetAlert=o;this.countryId="";this.superCompany=!0;this.country_details={};this.pager={};this.companyTypeList=[];this.dates=[];this.months=JSON.parse(JSON.stringify(this.userService.months));this.holidayFormGroupDirty=!1;this.companyTypeFormGroupDirty=!1;this.isHovering=!1}ngOnInit(){for(let t=1;t<=31;t++)this.dates.push(t<10?"0"+t:t);this.getCountryDetails(),this.holidayFormGroup=this.fb.group({holiday_id:[""],type:["0",_.required],state:[""],name:["",_.required],description:[""],date_type:["0",_.required],duration_type:["0",_.required],full_date:[""],date:[""],month:[""],from_full_date:[""],to_full_date:[""],from_date:[""],from_month:[""],to_date:[""],to_month:[""]}),this.companyTypeFormGroup=this.fb.group({company_type_id:[""],type_name:["",[_.required,_.maxLength(100)]],description:["",[_.required,_.maxLength(500)]]})}getCountryDetails(){$("#loaderouterid").css("display","flex");let t=this.superCompany?"get_global_tax_by_country":"get_tax_by_company_country";this.userService[t]({country_id:this.countryId}).subscribe(e=>{$("#loaderouterid").css("display","none"),console.log("check the country response = ",e),this.superCompany?this.country_details=e:(this.country_details=e.data,this.country_details.germanName=e.data.country),this.country_details.searched_states=this.country_details.states&&this.country_details.states?.length>0?JSON.parse(JSON.stringify(this.country_details.states)):[],this.companyTypeList=this.country_details?.company_types&&this.country_details?.company_types?.length>0?JSON.parse(JSON.stringify(this.country_details.company_types)):[],this.setPage(1)})}dateValidations(){setTimeout(()=>{let t=["date","month","from_date","from_month","to_date","to_month","full_date","from_full_date","to_full_date"],e=[];this.holidayFormGroup.value.date_type=="0"&&this.holidayFormGroup.value.duration_type=="0"?e=["date","month"]:this.holidayFormGroup.value.date_type=="0"&&this.holidayFormGroup.value.duration_type=="1"?e=["from_date","from_month","to_date","to_month"]:this.holidayFormGroup.value.date_type=="1"&&this.holidayFormGroup.value.duration_type=="0"?e=["full_date"]:this.holidayFormGroup.value.date_type=="1"&&this.holidayFormGroup.value.duration_type=="1"&&(e=["from_full_date","to_full_date"]),t.map(n=>{e.includes(n)?this.holidayFormGroup.controls[n].setValidators(_.required):(this.holidayFormGroup.controls[n].clearValidators(),this.holidayFormGroup.patchValue({[n]:""}
1)),this.holidayFormGroup.controls[n].updateValueAndValidity()})},500)}setPage(t,e=this.companyTypeList){this.pager=this.pagerService.getPager(e.length,t),this.pagedItems=e.slice(this.pager.startIndex,this.pager.endIndex+1),e.length>0?(this.startRecord=this.pager.currentPage*this.pagerService.getDefaultPageSize()-this.pagerService.getDefaultPageSize()+1,this.endRecord=this.pager.currentPage*this.pagerService.getDefaultPageSize()>e.length?e.length:this.pager.currentPage*this.pagerService.getDefaultPageSize()):(this.startRecord=0,this.endRecord=0)}addNewHoliday(){this.open_modal("HolidayModal"),this.holidayFormGroupDirty=!1,this.holidayFormGroup.valueChanges.subscribe(t=>{this.holidayFormGroupDirty=!0})}searchState(t){["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter"].includes(t.key)||(this.country_details.searched_states=[],this.country_details.states.map(e=>{e.toLowerCase().includes(t.target.value.toLowerCase())&&this.country_details.searched_states.push(e)}))}openHoliday(t){this.holidayFormGroup.patchValue({holiday_id:t._id,type:t.type,state:t.state||"",name:t.name,description:t.description||"",date_type:t.date_type,duration_type:t.duration_type,full_date:t.full_date||"",date:t.date||"",month:t.month||"",from_full_date:t.from_full_date||"",to_full_date:t.to_full_date||"",from_date:t.from_date||"",from_month:t.from_month||"",to_date:t.to_date||"",to_month:t.to_month||""}),this.open_modal("HolidayModal"),this.holidayFormGroupDirty=!1,this.holidayFormGroup.valueChanges.subscribe(e=>{this.holidayFormGroupDirty=!0})}modal_valid(){this.companyTypeFormGroupDirty?this.sweetAlert.confirm("Sind Sie sicher?","Die eingetragenen Daten werden gel\xF6scht.",{type:"warning",confirmText:"Ja, L\xF6schen",cancelText:"Abbrechen"}).subscribe(t=>{t&&this.closeCompanyType()}):this.closeCompanyType()}search(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key))if(t.target.value){let e=[];this.companyTypeList.map(n=>{n.type_name.toLowerCase().includes(t.target.value.toLowerCase())&&e.push(n)}),this.setPage(1,e)}else this.setPage(1)}open_modal(t){$("#"+t).appendTo("body")}close_modal(t,e){$("#"+t).appendTo("#"+e)}saveCompanyType(){let t={},e="";this.companyTypeFormGroup.value.company_type_id?e=this.superCompany?"updateCountryCompanyType":"update_company_holidays_notimplemented":e=this.superCompany?"addCountryCompanyType":"add_tax_category_holiday_notimplemented",e=="addCountryCompanyType"?t.company_type=this.companyTypeFormGroup.value:t.updated_company_type=this.companyTypeFormGroup.value,t.country_id=this.countryId,console.log("check saveCompanyType data beore sending = ",t),$("#loaderouterid").css("display","flex"),this.userService[e](t).subscribe(n=>{console.log(n,"RESPONSE ADD",e),$("#loaderouterid").css("display","none"),n.status=="200"?this.sweetAlert.html("Unternehmenstyp erfolgreich "+(this.companyTypeFormGroup.value.type_id?"aktualisiert.":"hinzugef\xFCgt."),"Unternehmenstyp <label class='button-primary p-1 m-1 rounded'>"+this.companyTypeFormGroup.value.type_name+"</label> wurde erfolgreich "+(this.companyTypeFormGroup.value.type_id?"aktualisiert.":"hinzugef\xFCgt."),{type:"success"}).subscribe(()=>{this.closeCompanyType(),this.getCountryDetails()}):this.sweetAlert.error("Etwas ist schiefgelaufen, bitte versuchen Sie es erneut.","","OK")})}onSaveChangesClick(){if(!this.companyTypeFormGroup.valid){this.sweetAlert.info("Bitte alle Pflichtfelder ausf\xFCllen.","Bitte f\xFCllen Sie alle erforderlichen Felder aus, um fortzufahren.","OK").subscribe(),this.companyTypeFormGroup.markAllAsTouched();return}this.saveCompanyType()}openCompanyType(t){console.log(t,"Cjiejfefi----"),this.companyTypeFormGroup.patchValue({company_type_id:t._id,type_name:t.type_name,description:t.description}),this.open_modal("companyTypeModal"),this.companyTypeFormGroupDirty=!1,this.companyTypeFormGroup.valueChanges.subscribe(e=>{this.companyTypeFormGroupDirty=!0})}closeCompanyType(){this.companyTypeFormGroup.reset(),this.companyTypeFormGroup.patchValue({companyType_id:null,type_name:"",description:""}),$("#companyTypeModal").modal("hide"),this.close_modal("companyTypeModal","companyTypeModal_parent")}addNewCompanyType(){this.open_modal("companyTypeModal"),this.companyTypeFormGroupDirty=!1,this.companyTypeFormGroup.valueChanges.subscribe(t=>{this.companyTypeFormGroupDirty=!0})}static{this.\u0275fac=function(e){return new(e||i)(B(le),B(Ae),B(Q),B(O))}}static{this.\u0275cmp=P({type:i,selectors:[["app-country-companytype"]],inputs:{countryId:"c
1ountryId",superCompany:"superCompany"},decls:68,vars:12,consts:[[1,"w-100","p-2"],[1,"table-min-height"],[1,"second-section","shadow-none","mt-0"],[1,"row"],[1,"col-sm-4","pr-1"],["type","text","name","search","placeholder","z.B. Unternehmenstyp","type","text",1,"search","myInput",3,"keyup"],[1,"col-sm-4","pl-1"],["mat-button","","data-toggle","modal","data-target","#companyTypeModal",1,"button-primary","botton-hover",3,"click","mouseover","mouseout"],[1,"menu-image",3,"src"],[1,"ml-2"],[1,"col-sm-4"],[1,"table-count"],[1,"w-100","shadow-none","mt-0","pt-0"],[1,"w-100","position-relative"],[1,"customTable"],[1,"tableInnerScroll"],[1,"table"],[2,"width","10%","min-width","60px"],["data-order","asc","data-name","name",1,"fa","fa-sort-desc",3,"appSort"],[2,"width","10%","min-width","100px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"d-flex","justify-content-end","pagination-main","mt-3"],["class","pagination m-0 pagerAction",4,"ngIf"],["id","companyTypeModal_parent"],["data-backdrop","static","data-keyboard","false","id","companyTypeModal",1,"modal","fade","p-0"],["role","document",1,"modal-dialog","customModal",2,"max-width","800px"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"close",3,"click"],["src","../assets/closeModel.svg","alt","Close",2,"width","20px","height","20px","display","block"],[1,"modal-body"],[1,"row",3,"formGroup"],[1,"col-sm-12","mb-3"],[1,"field-heading-parent"],[1,"field-heading","mb-0"],[1,"p-3","pb8"],["appearance","outline",1,"w-100"],["matInput","","placeholder","Unternehmenstyp","formControlName","type_name"],[1,"col-sm-12"],["matInput","","placeholder","Beschreibung","rows","3","formControlName","description"],[1,"modal-footer"],[1,"btn","button-primary","botton-hover",3,"click"],[1,"customer-id"],[1,"customer-Unternehmensname"],[1,"mb-0"],[1,"neoloop-font-color","f-size-x-small"],[1,"customer-Unternehmensname","mb-2"],["data-toggle","modal","data-target","#companyTypeModal",1,"btn","btn-sm","button-primary","botton-hover","m-1",3,"click"],[1,"pagination","m-0","pagerAction"],[1,"page-item",3,"ngClass"],[1,"page-link",3,"click"],["class","page-item",3,"ngClass",4,"ngFor","ngForOf"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"input",5),u("keyup",function(d){return n.search(d)}),a()(),r(6,"div",6)(7,"button",7),u("click",function(){return n.addNewCompanyType()})("mouseover",function(){return n.isHovering=!0})("mouseout",function(){return n.isHovering=!1}),p(8,"img",8),r(9,"span",9),s(10,"Unternehmenstypen hinzuf\xFCgen"),a()()(),r(11,"div",10)(12,"span",11),s(13),a()()()(),r(14,"div")(15,"div",12)(16,"div",13)(17,"div",14)(18,"div",15)(19,"table",16)(20,"thead")(21,"tr")(22,"th",17),s(23,"#"),a(),r(24,"th"),s(25," Unternehmenstyp "),p(26,"i",18),a(),r(27,"th"),s(28,"Beschreibung"),a(),r(29,"th",19),s(30,"Interaktionen"),a()()(),r(31,"tbody"),x(32,Ri,13,4,"tr",20)(33,Vi,3,0,"tr",21),a()()()(),r(34,"div",22),x(35,$i,14,13,"ul",23),a()()()(),r(36,"div",24)(37,"div",25)(38,"div",26)(39,"div",27)(40,"div",28)(41,"h5",29),s(42),a(),r(43,"button",30),u("click",function(){return n.modal_valid()}),p(44,"img",31),a()(),r(45,"div",32)(46,"div",33)(47,"div",34)(48,"div",35)(49,"h6",36),s(50,"Bitte geben Sie den Namen des Unternehmenstyps ein:"),a(),r(51,"div",37)(52,"mat-form-field",38)(53,"mat-label"),s(54,"Unternehmenstyp"),a(),p(55,"input",39),a()()()(),r(56,"div",40)(57,"div",35)(58,"h6",36),s(59,"Bitte geben Sie eine Beschreibung f\xFCr den Unternehmenstyp ein:"),a(),r(60,"div",37)(61,"mat-form-field",38)(62,"mat-label"),s(63,"Beschreibung"),a(),p(64,"textarea",41),a()()()()()(),r(65,"div",42)(66,"button",43),u("click",function(){return n.onSaveChangesClick()}),s(67),a()()()()()()()()),e&2&&(l(8),c("src",n.isHovering?"../assets/plus icon.svg":"../assets/plus1.svg",Te),l(5),xe("Anzahl der Ergebnisse: ",n.startRecord," - ",n.endRecord," / ",n.companyTypeList.length),l(13),c("appSort",n.pagedItems),l(6),c("ngForOf",n.pagedItems),l(),c("ngIf",n.companyTypeList.length==0),l(2),c("ngIf",n.companyTypeList.length),l(7),Me("",n.country_details.germanName," Unternehmenstyp ",n.companyTypeFormGroup.value.company_type_id?"bearbeiten":"hinzuf\xFCgen"),l(4),c("formGroup",n.companyTypeFormGroup),l(21),S(n.companyTypeFormGroup.value.company_type_id?"\xC4nderungen speichern":"Hinzuf\xFCgen"))},dependencies:[Se,Re,Qe,Ve,N,R,V,U,K,H,D,Ie,Y,j,J,At,ee],styles:[".menu-image[_ngcontent-%COMP%]{height:32px}"]})}};var dn=i=>({disabled:i}),Bi=i=>({active:i});function zi(i,t){if(i&1){let e=E();r(0,"tr")(1,"td"),s(2),a(),r(3,"td")(4,"p",48),s(5),a()(),r(6,"td"),s(7),a(),r(8,"td"),s(9),a(),r(10,"td")(11,"button",49),u("click",function(){let o=h(e).$implicit,d=m();return f(d.openCompanyType(o))}),s(12," \xD6ffnen "),a()()()}if(i&2){let e=t.$implicit,n=t.index,o=m();l(2),S(o.startRecord+n),l(3),S(e.code),l(2),L(" ",e.label," "),l(2),L(" ",e.de
1scription," ")}}function Ui(i,t){i&1&&(r(0,"tr")(1,"td",50),p(2,"app-no-data",51),a()()),i&2&&(l(2),c("message","Keine Eintr\xE4ge gefunden"))}function Hi(i,t){if(i&1){let e=E();r(0,"li",53)(1,"a",54),u("click",function(){let o=h(e).$implicit,d=m(2);return f(d.setPage(o))}),s(2),a()()}if(i&2){let e=t.$implicit,n=m(2);c("ngClass",z(2,Bi,n.pager.currentPage===e)),l(2),S(e)}}function Ki(i,t){if(i&1){let e=E();r(0,"ul",52)(1,"li",53)(2,"a",54),u("click",function(){h(e);let o=m();return f(o.setPage(1))}),s(3,"\xAB"),a()(),r(4,"li",53)(5,"a",54),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager.currentPage-1))}),s(6,"<"),a()(),x(7,Hi,3,4,"li",55),r(8,"li",53)(9,"a",54),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager.currentPage+1))}),s(10,">"),a()(),r(11,"li",53)(12,"a",54),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager.totalPages))}),s(13,"\xBB"),a()()()}if(i&2){let e=m();l(),c("ngClass",z(5,dn,e.pager.currentPage===1)),l(3),c("ngClass",z(7,dn,e.pager.currentPage===1)),l(3),c("ngForOf",e.pager.pages),l(),c("ngClass",z(9,dn,e.pager.currentPage===e.pager.totalPages)),l(3),c("ngClass",z(11,dn,e.pager.currentPage===e.pager.totalPages))}}var cn=class i{constructor(t,e,n,o){this.userService=t;this.pagerService=e;this.fb=n;this.sweetAlert=o;this.countryId="";this.superCompany=!0;this.country_details={};this.pager={};this.absenceTypeList=[];this.dates=[];this.months=JSON.parse(JSON.stringify(this.userService.months));this.holidayFormGroupDirty=!1;this.companyTypeFormGroupDirty=!1;this.isHovering=!1}ngOnInit(){for(let t=1;t<=31;t++)this.dates.push(t<10?"0"+t:t);this.getAbsenceTypes(),this.companyTypeFormGroup=this.fb.group({company_type_id:[""],type_name:["",[_.required,_.maxLength(100)]],description:["",[_.required,_.maxLength(500)]]}),this.absenceTypeFormGroup=this.fb.group({code:["",[_.required]],description:["",[_.required,_.maxLength(500)]],label:["",[_.required]],country_id:[""],_id:[""]})}getCountryDetails(){$("#loaderouterid").css("display","flex");let t=this.superCompany?"get_global_tax_by_country":"get_tax_by_company_country";this.userService[t]({country_id:this.countryId}).subscribe(e=>{$("#loaderouterid").css("display","none"),console.log("check the country response = ",e),this.superCompany?this.country_details=e:(this.country_details=e.data,this.country_details.germanName=e.data.country),this.country_details.searched_states=this.country_details.states&&this.country_details.states?.length>0?JSON.parse(JSON.stringify(this.country_details.states)):[],this.absenceTypeList=this.country_details?.company_types&&this.country_details?.company_types?.length>0?JSON.parse(JSON.stringify(this.country_details.company_types)):[],this.setPage(1)})}getAbsenceTypes(){$("#loaderouterid").css("display","flex"),this.userService.getAbsenceTypesByCountry(this.countryId).subscribe({next:t=>{$("#loaderouterid").css("display","none"),this.absenceTypeList=t.data,this.setPage(1)}})}setPage(t,e=this.absenceTypeList){this.pager=this.pagerService.getPager(e.length,t),this.pagedItems=e.slice(this.pager.startIndex,this.pager.endIndex+1),e.length>0?(this.startRecord=this.pager.currentPage*this.pagerService.getDefaultPageSize()-this.pagerService.getDefaultPageSize()+1,this.endRecord=this.pager.currentPage*this.pagerService.getDefaultPageSize()>e.length?e.length:this.pager.currentPage*this.pagerService.getDefaultPageSize()):(this.startRecord=0,this.endRecord=0)}modal_valid(){this.companyTypeFormGroupDirty?this.sweetAlert.confirm("Sind Sie sicher?","Die eingetragenen Daten werden gel\xF6scht.",{type:"warning",confirmText:"Ja, L\xF6schen",cancelText:"Abbrechen"}).subscribe(t=>{t&&this.closeCompanyType()}):this.closeCompanyType()}search(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key))if(t.target.value){let e=[];this.absenceTypeList.map(n=>{(n.code.toLowerCase().includes(t.target.value.toLowerCase())||n.label.toLowerCase().includes(t.target.value.toLowerCase()))&&e.push(n)}),this.setPage(1,e)}else this.setPage(1)}open_modal(t){$("#"+t).appendTo("body")}close_modal(t,e){$("#"+t).appendTo("#"+e)}saveCompanyType(){let t={},e="";this.absenceTypeFormGroup.value.company_type_id?e=this.superCompany?"updateCountryCompanyType":"update_company_holidays_notimplemented":e=this.superCompany?"addCountryCompanyType":"add_tax_category_holiday_notimplemented",e=="addCountryCompanyType"?t.company_type=this.absenceTypeFormGroup.value:t.updated_company_type=this.absenceTypeFormGroup.value,t.country_id=this.countryId,console.log("check saveCompanyType data beore sending = ",t),$("#loaderouterid").css("display","flex"),this.userService[e](t).subscribe(n=>{console.log(n,"RESPONSE ADD",e),$("#loaderouterid").css("display","none"),n.status==="200"?this.sweetAlert.html("Erfolgreich","Unternehmenstyp <label class='button-primary p-1 m-1 rounded'>"+this.companyTypeFormGroup.value.type_name+"</label> wurde erfolgreich "+(this.companyTypeFormGroup.value.type_name?"aktualisiert.":"hinzugef\xFCgt."),{type:"success"}).subscribe(()=>{this.closeCompanyType(),this.getCountryDetails()}):this.sweetAlert.error("Etwas ist schiefgelaufen, bitte versuchen Sie es erneut.","","OK")})}openCompanyType(t){console.log(t,"Cjiejfefi----"),this.absenceTypeFormGroup.patchValue({code:t.code,description:t.label,label:t.description,_id:t._id}),this.open_modal("companyTypeModal"),this.companyTypeFormGroupDirty=!1,this.absenceTypeFormGroup.valueChanges.subscribe(e=>{this.companyTypeFormGroupDirty=!0})}closeCompanyType(){this.absenceTypeFormGroup.reset(),this.absenceTypeFormGroup.patchValue({code:"",description:"",label:"",country_id:""}),$("#companyTypeModal").modal("hide"),this.close_modal("companyTypeModal","companyTypeModal_parent")}addNewCompanyType(){this.open_modal("companyTypeModal"),this.companyTypeFormGroupDirty=!1,this.absenceTypeFormGroup.valueChanges.subscribe(t=>{this.companyTypeFormGroupDirty=!0})}
1saveAbsenceType(){if(this.absenceTypeFormGroup.invalid){this.absenceTypeFormGroup.markAllAsTouched();return}this.absenceTypeFormGroup.patchValue({country_id:this.countryId});let t="createAbsenceType";this.absenceTypeFormGroup.get("_id").value&&(t="updateAbsenceType");let e=this.absenceTypeFormGroup.value;this.userService[t](e).subscribe({next:n=>{console.log("Created successfully:",n.data),$("#loaderouterid").css("display","none"),n.status==="200"?this.sweetAlert.html("Erfolgreich","Abwesenheitsstatus <label class='button-primary p-1 m-1 rounded'>"+this.absenceTypeFormGroup.get("code")?.value+"</label> wurde erfolgreich "+(this.absenceTypeFormGroup.get("_id")?.value?"aktualisiert.":"hinzugef\xFCgt."),{type:"success"}).subscribe(()=>{this.absenceTypeFormGroup.reset(),this.closeCompanyType(),this.getAbsenceTypes()}):this.sweetAlert.error("Etwas ist schiefgelaufen, bitte versuchen Sie es erneut.","","OK")},error:n=>{console.error("Create error:",n),n==="Code already exists"?this.sweetAlert.error("K\xFCrzel existiert bereits.","").subscribe(()=>{this.absenceTypeFormGroup.reset(),this.closeCompanyType()}):this.sweetAlert.error("Etwas ist schiefgelaufen, bitte versuchen Sie es erneut.","").subscribe(()=>{this.absenceTypeFormGroup.reset(),this.closeCompanyType()})}})}onSaveChangesClick(){if(!this.absenceTypeFormGroup.valid){this.sweetAlert.info("Bitte alle Pflichtfelder ausf\xFCllen.","Bitte f\xFCllen Sie alle erforderlichen Felder aus, um fortzufahren.","OK").subscribe(),this.absenceTypeFormGroup.markAllAsTouched();return}this.saveAbsenceType()}updateAbsenceType(){}static{this.\u0275fac=function(e){return new(e||i)(B(le),B(Ae),B(Q),B(O))}}static{this.\u0275cmp=P({type:i,selectors:[["app-country-absencetype"]],inputs:{countryId:"countryId",superCompany:"superCompany"},decls:81,vars:12,consts:[[1,"w-100","p-2"],[1,"table-min-height"],[1,"second-section","shadow-none","mt-0"],[1,"container-fluid"],[1,"row"],[1,"col-sm-4","pr-1"],["type","text","name","search","placeholder","z.B. Abwesenheitsstatus","type","text",1,"search","myInput",3,"keyup"],[1,"col-sm-4","pl-1"],["mat-button","","data-toggle","modal","data-target","#companyTypeModal",1,"button-primary","botton-hover",3,"click","mouseover","mouseout"],[1,"menu-image",3,"src"],[1,"ml-2"],[1,"col-sm-4"],[1,"table-count"],[1,"w-100","shadow-none","mt-0","pt-0"],[1,"w-100","position-relative"],[1,"customTable","mt-2"],[1,"tableInnerScroll"],[1,"table"],[2,"width","5%","min-width","50px"],[2,"width","15%","min-width","150px"],["data-order","asc","data-name","name",1,"fa","fa-sort-desc",3,"appSort"],[2,"min-width","150px"],[2,"width","10%","min-width","100px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"d-flex","justify-content-end","pagination-main","mt-3"],["class","pagination m-0 pagerAction",4,"ngIf"],["id","companyTypeModal_parent"],["data-backdrop","static","data-keyboard","false","id","companyTypeModal",1,"modal","fade","p-0"],["role","document",1,"modal-dialog","customModal",2,"max-width","700px"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"close",3,"click"],["src","../assets/closeModel.svg","alt","Close",2,"width","20px","height","20px","display","block"],[1,"modal-body"],[1,"",3,"formGroup"],[1,"col-sm-12","mb-3"],[1,"field-heading-parent"],[1,"field-heading"],[1,"p-3","pb8"],["appearance","outline",1,"w-100"],["matInput","","placeholder","K\xFCrzel","formControlName","code"],["matInput","","placeholder","Ferienbeschreibung","rows","3","formControlName","label"],[1,"col-sm-12"],["matInput","","placeholder","Abwesenheitsbeschreibung","rows","3","formControlName","description"],[1,"modal-footer"],[1,"btn","button-primary","botton-hover",3,"click"],[1,"mb-0"],["data-toggle","modal","data-target","#companyTypeModal",1,"btn","btn-sm","button-primary","botton-hover","m-1",3,"click"],["colspan","5"],[3,"message"],[1,"pagination","m-0","pagerAction"],[1,"page-item",3,"ngClass"],[1,"page-link",3,"click"],["class","page-item",3,"ngClass",4,"ngFor","ngForOf"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"input",6),u("keyup",function(d){return n.search(d)}),a()(),r(7,"div",7)(8,"button",8),u("click",function(){return n.addNewCompanyType()})("mouseover",function(){return n.isHovering=!0})("mouseout",function(){return n.isHovering=!1}),p(9,"img",9),r(10,"span",10),s(11,"Unternehmenstypen hinzuf\xFCgen"),a()()(),r(12,"div",11)(13,"span",12),s(14),a()()()()(),r(15,"div")(16,"div",13)(17,"div",14)(18,"div",15)(19,"div",16)(20,"table",17)(21,"thead")(22,"tr")(23,"th",18),s(24,"#"),a(),r(25,"th",19),s(26," K\xFCrzel "),p(27,"i",20),a(),r(28,"th",21),s(29,"Bezeichnung"),a(),r(30,"th",21),s(31,"Beschreibung"),a(),r(32,"th",22),s(33,"Interaktionen"),a()()(),r(34,"tbody"),x(35,zi,13,4,"tr",23)(36,Ui,3,1,"tr",24),a()()()(),r(37,"div",25),x(38,Ki,14,13,"ul",26),a()()()(),r(39,"div",27)(40,"div",28)(41,"div",29)(42,"div",30)(43,"div",31)(44,"h5",32),s(45),a(),r(46,"button",33),u("click",function(){return n.modal_valid()}),p(47,"img",34),a()(),r(48,"div",35)(49,"div",36)(50,"div",4)(51,"div",37)(52,"div",38)(53,"h6",39),s(54,"Bitte geben Sie das K\xFCrzel der Abwesenheitsart ein:"),a(),r(55,"div",40)(56,"mat-form-field",41)(57,"mat-label"),s(58,"K\xFCrzel"),a(),p(
159,"input",42),a()()()(),r(60,"div",37)(61,"div",38)(62,"h6",39),s(63,"Bitte geben Sie die Bezeichnung f\xFCr die Abwesenheitsart ein:"),a(),r(64,"div",40)(65,"mat-form-field",41)(66,"mat-label"),s(67,"Bezeichnung"),a(),p(68,"textarea",43),a()()()(),r(69,"div",44)(70,"div",38)(71,"h6",39),s(72,"Bitte geben Sie eine Beschreibung f\xFCr die Abwesenheitsart ein:"),a(),r(73,"div",40)(74,"mat-form-field",41)(75,"mat-label"),s(76,"Abwesenheitsbeschreibung"),a(),p(77,"textarea",45),a()()()()()()(),r(78,"div",46)(79,"button",47),u("click",function(){return n.onSaveChangesClick()}),s(80),a()()()()()()()()),e&2&&(l(9),c("src",n.isHovering?"../assets/plus icon.svg":"../assets/plus1.svg",Te),l(5),xe("Anzahl der Ergebnisse: ",n.startRecord," - ",n.endRecord," / ",n.absenceTypeList.length),l(13),c("appSort",n.pagedItems),l(8),c("ngForOf",n.pagedItems),l(),c("ngIf",n.absenceTypeList.length===0),l(2),c("ngIf",n.absenceTypeList.length),l(7),Me("",n.country_details.germanName," Unternehmenstyp ",n.companyTypeFormGroup.value.company_type_id?"bearbeiten":"hinzuf\xFCgen"),l(4),c("formGroup",n.absenceTypeFormGroup),l(31),S(n.absenceTypeFormGroup.value._id?"\xC4nderungen speichern":"Hinzuf\xFCgen"))},dependencies:[Se,Re,Qe,Ve,N,R,V,U,K,H,D,Ie,Y,j,J,At,ee],styles:[".menu-image[_ngcontent-%COMP%]{height:32px}"]})}};var q=class i{constructor(){this.API_URL=ii.API_URL;this.http=b(Zt)}getTrainingLessons(t,e={}){let n=new Xt;return e.framework_type&&(n=n.set("framework_type",e.framework_type)),e.page&&(n=n.set("page",String(e.page))),e.limit&&(n=n.set("limit",String(e.limit))),e.search?.trim()&&(n=n.set("search",e.search.trim())),this.http.get(`${this.API_URL}license_framework/get-license-framework/${t}`,{params:n})}createTrainingLesson(t){return this.http.post(`${this.API_URL}license_framework/create-update-license-framework`,t).pipe(pe(e=>(console.error("Error creating training lesson",e),Ue(()=>e))))}updateLessonStatus(t,e){return this.http.patch(`${this.API_URL}license_framework/change-license-framework-status/${t}`,{status:e},{withCredentials:!0}).pipe(pe(n=>(console.error("Error updating lesson status",n),Ue(()=>n))))}getDrivingLicenseClasses(t,e){let n=this.buildMappingDataQueryParams(e);return this.http.get(`${this.API_URL}license_framework/get-mapping-data/${t}`,{params:n})}createQualificationPath(t){return this.http.post(`${this.API_URL}license_framework/create-update-qualification-path`,t,{withCredentials:!0}).pipe(pe(e=>(console.error("Error creating qualification path",e),Ue(()=>e))))}getQualificationPathsList(t,e){let n=new Xt().set("path_type",e.path_type).set("page",String(e.page??1)).set("limit",String(e.limit??10));return e.search?.trim()&&(n=n.set("search",e.search.trim())),this.http.get(`${this.API_URL}license_framework/get-qualification-path-list/${t}`,{params:n}).pipe(pe(o=>(console.error("Error getting qualification paths list",o),Ue(()=>o))))}getQualificationPathMappingData(t,e){let n=this.buildMappingDataQueryParams(e);return this.http.get(`${this.API_URL}license_framework/get-mapping-data/${t}`,{params:n})}buildMappingDataQueryParams(t){let e={};return t.qualification_path_id?(e.qualification_path_id=t.qualification_path_id,t.status_tab&&(e.status_tab=t.status_tab)):t.license_class_id&&(e.license_class_id=t.license_class_id),t.framework_type&&(e.framework_type=t.framework_type),t.page&&(e.page=t.page),t.limit&&(e.limit=t.limit),t.search?.trim()&&(e.search=t.search.trim()),t.category_type&&(e.category_type=t.category_type),t.filter_status&&t.filter_status!=="ALL"&&(e.filter_status=t.filter_status),e}changeQualificationPathStatus(t,e){return this.http.patch(`${this.API_URL}license_framework/change-qualification-path-status/${t}`,{status:e},{withCredentials:!0}).pipe(pe(n=>(console.error("Error changing qualification path status",n),Ue(()=>n))))}getClassFrameworkData(t,e){return this.http.post(`${this.API_URL}license_framework/get-class-framework-data/${t}`,e,{withCredentials:!0}).pipe(pe(n=>(console.error("Error getting class framework data",n),Ue(()=>n))))}createOrUpdateGrantType(t){return this.http.post(`${this.API_URL}grantType/create-update-grant-type`,t,{withCredentials:!0}).pipe(pe(e=>(console.error("Error creating or updating grant type",e),Ue(()=>e))))}getGrantTypesList(t,e={}){let n=new Xt().set("page",String(e.page??1)).set("limit",String(e.limit??10));return e.search?.trim()&&(n=n.set("search",e.search.trim())),this.http.get(`${this.API_URL}
1grantType/get-grant-type-list/${t}`,{params:n}).pipe(pe(o=>(console.error("Error getting grant types list",o),Ue(()=>o))))}changeGrantTypeStatus(t,e){return this.http.patch(`${this.API_URL}grantType/change-grant-type-status/${t}`,{status:e},{withCredentials:!0}).pipe(pe(n=>(console.error("Error changing grant type status",n),Ue(()=>n))))}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275prov=Wt({token:i,factory:i.\u0275fac,providedIn:"root"})}};var Ze=[{value:"ALL",label:"Alle ausw\xE4hlen"},{value:"IN_PERSON",label:"Pr\xE4senz"},{value:"ONLINE",label:"Online"},{value:"HYBRID",label:"Hybrid"},{value:"SIMULATOR",label:"Simulator"},{value:"LIVE_SESSION",label:"Live-Sitzung"}],pt=[{value:"CLASS_SPECIFIC",label:"Zusatzstoff"},{value:"BASIC",label:"Grundstoff"}],gi={CLASS_SPECIFIC:"Zusatzstoff",BASIC:"Grundstoff"};function it(i){return Ze.find(t=>t.value===i)?.label??i}function Qi(i){return gi[i]??i}function bt(i){let t=i?.delivery_methods??i?.delivery_method;return Array.isArray(t)?t.filter(e=>e!=="ALL"):typeof t=="string"&&t.trim()?t.split(",").map(e=>e.trim()):[]}function ji(i){return i?.length?i.map(it).join(", "):"-"}function at(i,t){let e=Number(i)||0,n=Number(t)||0;return e*60+n}function Bt(i){if(i&&typeof i=="object")return{hours:Number(i.hours)||0,minutes:Number(i.minutes)||0};let t=Number(i)||0;return{hours:Math.floor(t/60),minutes:t%60}}function Yi(i){let{hours:t,minutes:e}=Bt(i);return at(t,e)}function zt(i){return i===1||i==="1"||i===!0||i==="active"?"active":"inactive"}function ut(i){let t={lesson_name:i.lesson_name,default_duration:{hours:Number(i.hours)||0,minutes:Number(i.minutes)||0},status:i.isActive?1:0,framework_type:i.framework_type,category_type:i.category,delivery_method:i.delivery_methods,country_id:i.country_id};return i.licenseFrameworkId&&(t.licenseFrameworkId=i.licenseFrameworkId),t}function Ut(i){let t=bt(i),e=i?.category_type??i?.category_code??i?.category??"",n=Yi(i?.default_duration??i?.duration);return X(I({},i),{duration:n,status:zt(i?.status),category_code:e,category:Qi(e),delivery_methods:t,delivery_method:ji(t)})}function gt(i,t,e=[]){if(i)return!0;let n=[...t].sort(),o=[...e].sort();return n.length!==o.length?!0:n.some((d,g)=>d!==o[g])}var Dt={basic:0,basic_with_previous:0,basic_reduction_enabled:!1,class_specific:0,class_specific_with_previous:0,class_specific_reduction_enabled:!1},pd={normal:I({},Dt),experience:I({},Dt)},mn={theory:{normal:I({},Dt),experience:I({},Dt)},practical:{normal:I({},Dt),experience:I({},Dt)}},fe=class i{constructor(){this.selections=w({});this.licenseClassSettings=w(structuredClone(mn));this.dirty=w(!1);this.settingsManuallyConfiguredKeys=w({})}isDirty(){return this.dirty()}markDirty(){this.dirty.set(!0)}markClean(){this.dirty.set(!1)}areSettingsManuallyConfigured(t,e="STANDARD"){return t?!!this.settingsManuallyConfiguredKeys()[this.settingsKey(t,e)]:Object.values(this.settingsManuallyConfiguredKeys()).some(Boolean)}markSettingsManuallyConfigured(t,e="STANDARD"){let n=this.settingsKey(t,e);this.settingsManuallyConfiguredKeys.update(o=>X(I({},o),{[n]:!0}))}syncPageLessons(t,e,n){let o=I({},this.selections());t.forEach(d=>{let g=d.framework_id??d._id;if(!g)return;let v=this.buildKey(e,n,g),T=d.status_mapping==="INCLUDED"?"INCLUDED":"EXCLUDED",W=o[v];o[v]={license_framework_id:g,quantity:this.normalizeQuantity(d.quantity),framework_type:e,status_tab:n,status_mapping:T,category_type:d.category_type??d.category_code??d.category??W?.category_type}}),this.selections.set(o)}getLessons(){return Object.values(this.selections())}seedLessons(t){let e=I({},this.selections());t.forEach(n=>{if(!n.license_framework_id)return;let o=this.buildKey(n.framework_type,n.status_tab,n.license_framework_id);e[o]=I(I({},e[o]),n)}),this.selections.set(e)}seedMissingLessons(t){let e=I({},this.selections());t.forEach(n=>{if(!n.license_framework_id)return;let o=this.buildKey(n.framework_type,n.status_tab,n.license_framework_id);e[o]||(e[o]=n)}),this.selections.set(e)}applyStoredSelectionsToItems(t,e,n){return t.map(o=>{let d=o.framework_id??o._id;if(!d)return o;let g=this.selections()[this.buildKey(e,n,d)];return g?X(I({},o),{quantity:g.quantity,status_mapping:g.status_mapping}):o})}getLicenseClassSettings(){return structuredClone(this.licenseClassSettings())}getCategorySettings(t,e){let n=t==="THEORY"?"theory":"practical",o=e==="STANDARD"?"normal":"experience";return I({},this.licenseClassSettings()[n][o])}autoSyncSettingsFromIncludedLessons(t,e="STANDARD"){if(this.areSettingsManuallyConfigured(t,e))return;
1let n=this.getCategorySettings(t,e),o=this.deriveCategorySettingsFromIncludedLessons(t,e,n);this.applyCategorySettings(t,e,o)}autoSyncAllCreateSettingsFromIncludedLessons(t){this.autoSyncSettingsFromIncludedLessons("THEORY","STANDARD"),this.autoSyncSettingsFromIncludedLessons("PRACTICAL","STANDARD"),t?.includeTheoryExperience&&this.autoSyncSettingsFromIncludedLessons("THEORY","EXPERIENCE"),t?.includePracticalExperience&&this.autoSyncSettingsFromIncludedLessons("PRACTICAL","EXPERIENCE")}deriveCategorySettingsFromIncludedLessons(t,e,n){let o=n??this.getCategorySettings(t,e),d=0,g=0;return this.getLessons().forEach(v=>{if(v.framework_type!==t||v.status_tab!==e||v.status_mapping!=="INCLUDED")return;let T=(v.category_type||"").toUpperCase();T==="BASIC"?d+=1:T==="CLASS_SPECIFIC"&&(g+=1)}),X(I({},o),{basic:d,class_specific:g})}updateCategorySettings(t,e,n){this.applyCategorySettings(t,e,n),this.markSettingsManuallyConfigured(t,e),this.markDirty()}setLicenseClassSettings(t){this.licenseClassSettings.set(structuredClone(t))}clear(){this.selections.set({}),this.licenseClassSettings.set(structuredClone(mn)),this.settingsManuallyConfiguredKeys.set({}),this.markClean()}applyCategorySettings(t,e,n){let o=t==="THEORY"?"theory":"practical",d=e==="STANDARD"?"normal":"experience";this.licenseClassSettings.update(g=>X(I({},g),{[o]:X(I({},g[o]),{[d]:{basic:this.normalizeQuantity(n.basic),basic_with_previous:this.normalizeQuantity(n.basic_with_previous),basic_reduction_enabled:!!n.basic_reduction_enabled,class_specific:this.normalizeQuantity(n.class_specific),class_specific_with_previous:this.normalizeQuantity(n.class_specific_with_previous),class_specific_reduction_enabled:!!n.class_specific_reduction_enabled}})}))}settingsKey(t,e){return`${t}_${e}`}normalizeQuantity(t){let e=Number(t);return Number.isNaN(e)||e<0?0:Math.floor(e)}buildKey(t,e,n){return`${t}_${e}_${n}`}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275prov=Wt({token:i,factory:i.\u0275fac})}};function pn(i){let t=Number(i?.basic),e=Number(i?.basic_with_previous),n=Number(i?.class_specific),o=Number(i?.class_specific_with_previous);return{basic:Number.isNaN(t)||t<0?0:Math.floor(t),basic_with_previous:Number.isNaN(e)||e<0?0:Math.floor(e),basic_reduction_enabled:!!i?.basic_reduction_enabled,class_specific:Number.isNaN(n)||n<0?0:Math.floor(n),class_specific_with_previous:Number.isNaN(o)||o<0?0:Math.floor(o),class_specific_reduction_enabled:!!i?.class_specific_reduction_enabled}}function $n(i){return i?{theory:{normal:pn(i.theory?.normal),experience:pn(i.theory?.experience)},practical:{normal:pn(i.practical?.normal),experience:pn(i.practical?.experience)}}:structuredClone(mn)}function rt(i,t){!i||!t?.license_class_settings||i.setLicenseClassSettings($n(t.license_class_settings))}function Ht(i,t){if(!i&&!t)return null;let e=t?.experience_required??i?.experience_required??{};return X(I(I({},i),t),{experience_required:e,description:t?.description??i?.description??"",from_class:i?.from_class??t?.from_class,to_class:i?.to_class??t?.to_class,classes:t?.classes??i?.classes??[]})}function un(i){let t=i?.experience_required??{},e=t.theoretical_enabled??i?.has_previous_theory_knowledge??!1,n=t.practical_enabled??i?.has_previous_practical_knowledge??!1;return{has_previous_theory_knowledge:!!e,has_previous_practical_knowledge:!!n,theory_previous_duration:t.min_theoretical??i?.theory_previous_duration??null,practical_previous_duration:t.min_practical??i?.practical_previous_duration??null}}function gn(i,t){console.log(`[${i}] experience_required toggle values`,{theoretical_enabled:t.has_previous_theory_knowledge,practical_enabled:t.has_previous_practical_knowledge,min_theoretical:t.theory_previous_duration,min_practical:t.practical_previous_duration})}function me(i,t,e){if(!t){e();return}i.custom({type:"warning",title:"Nicht gespeicherte \xC4nderungen",content:"Die \xC4nderungen werden gel\xF6scht. M\xF6chten Sie fortfahren?",isHtml:!1,showCancel:!0,confirmText:"Ja",cancelText:"Nein",confirmButtonClass:"btn-primary",cancelButtonClass:"btn-cancel",disableClose:!0}).subscribe(n=>{n&&e()})}function _t(i,t,e=!1){return i||t.isDirty()}var _i={"License framework created successfully":"Die Stunde wurde erfolgreich erstellt.","License framework updated successfully":"Die Stunde wurde erfolgreich aktualisiert.","License framework activated successfully":"Die Stunde wurde erfolgreich aktiviert.","License framework deactivated successfully":"Die Stunde wurde erfolgreich deaktiviert.","License framework fetched successfully":"Stunden wurden erfolgreich geladen.","A lesson with this name already exists for this country and type":"Eine Stunde mit diesem Namen existiert bereits f\xFCr dieses Land und diesen Typ.","License framework not found":"Stunde nicht gefunden.","Framework type is required":"Framework-Typ ist erforderlich.","Failed to fetch license framework":"Fehler beim Laden der Stunden.","No framework found for the specified framework type":"Kein Framework f\xFCr den angegebenen Typ gefunden.","Internal server error":"Ein interner Serverfehler ist aufgetreten."},hi={LICENSE_FRAMEWORK_ALREADY_EXISTS:"Eine Stunde mit diesem Namen existiert bereits f\xFCr dieses Land und diesen Typ.",LICENSE_FRAMEWORK_NOT_FOUND:"Stunde nicht gefunden.",FRAMEWORK_TYPE_REQUIRED:"Framework-Typ ist erforderlich.",FRAMEWORK_NOT_FOUND:"Kein Framework f\xFCr den angegebenen Typ gefunden.",FETCH_FAILED:"Fehler beim Laden der Stunden.",INTERNAL_SERVER_ERROR:"Ein interner Serverfehler ist aufgetreten.",VALIDATION_ERROR:"Validierungsfehler. Bitte \xFCberpr\xFCfen Sie Ihre Eingaben."};function Bn(i){if(!i)return"";let t=i.trim();if(_i[t])return _i[t];let e=t.toLowerCase();return e.includes("created successfully")?"Die Stunde wurde erfolgreich erstellt.":e.includes("updated successfully")?"Die Stunde wurde erfolgreich aktualisiert.":e.includes("activated successfully")?"Die Stunde wurde erfolgreich aktiviert.":e.includes("deactivated successfully")?"Die Stunde wurde erfolgreich deaktiviert.":e.includes("fetched successfully")?"Stunden wurden erfolgreich geladen.":e.includes("already exists")?"Eine Stunde mit diesem Namen existiert bereits f\xFCr dieses Land und diesen Typ.":e.includes("not found")?"Stunde nicht gefunden.":e.includes("internal server error")?"Ein interner Serverfehler ist aufgetreten.":t}function ht(i,t){return i?.message&&Bn(i.message)||t}function fi(i,t){let e=i?.error;return e?e.errorCode&&hi[e.errorCode]?hi[e.errorCode]:Array.isArray(e.errors)&&e.errors.length?e.errors.map(Bn).join(`
2`):e.message&&Bn(e.message)||t:t}var we={INTERNAL_SERVER_ERROR:"Etwas ist schiefgelaufen. Bitte versuchen Sie es sp\xE4ter erneut.",VALIDATION_ERROR:"Bitte \xFCberpr\xFCfen Sie Ihre Eingaben und versuchen Sie es erneut.",MISSING_REQUIRED_FIELDS:"Klasse und Bezeichnung sind Pflichtfelder.",MISSING_COUNTRY_ID:"Land ist erforderlich.",MISSING_CLASS_IDS:"Von-Klasse und Nach-Klasse sind f\xFCr den Erweiterungspfad erforderlich.",MISSING_FRAMEWORK_ID:"Die Lizenzrahmen-ID ist f\xFCr die Lektionen erforderlich.",MISSING_FRAMEWORK_TYPE:"Der Framework-Typ ist erforderlich.",MISSING_STATUS_TAB:"Der Status-Tab ist f\xFCr die Qualifikationszuordnung erforderlich.",CLASS_ALREADY_EXISTS:"Diese F\xFChrerscheinklasse existiert bereits.",CLASS_NOT_FOUND:"F\xFChrerscheinklasse nicht gefunden.",INVALID_DATE_RANGE:"Das 'G\xFCltig von'-Datum muss vor dem 'G\xFCltig bis'-
2Datum liegen.",LICENSE_FRAMEWORK_NOT_FOUND:"Lizenzrahmen nicht gefunden.",LICENSE_FRAMEWORK_ALREADY_EXISTS:"Eine Lektion mit diesem Namen existiert bereits.",FRAMEWORK_NOT_FOUND:"F\xFCr den ausgew\xE4hlten Framework-Typ wurde kein Framework gefunden.",FRAMEWORK_TYPE_REQUIRED:"Der Framework-Typ ist erforderlich.",FETCH_FAILED:"Der Lizenzrahmen konnte nicht geladen werden.",QUALIFICATION_PATH_NOT_FOUND:"Qualifikationspfad nicht gefunden.",QUALIFICATION_PATH_ALREADY_EXISTS:"Dieser Qualifikationspfad existiert bereits.",INVALID_PATH_TYPE:"Ung\xFCltiger Qualifikationspfad-Typ.",SAME_CLASS_IDS:"Von-Klasse und Nach-Klasse d\xFCrfen nicht identisch sein.",FROM_CLASS_NOT_FOUND:"Von-Klasse nicht gefunden.",TO_CLASS_NOT_FOUND:"Nach-Klasse nicht gefunden.",INSUFFICIENT_CLASS_IDS:"Bitte w\xE4hlen Sie mindestens zwei Klassen aus.",DUPLICATE_CLASS_IDS:"Doppelte Klassen sind nicht zul\xE4ssig.",SOME_CLASSES_NOT_FOUND:"Eine oder mehrere ausgew\xE4hlte Klassen wurden nicht gefunden.",MISSING_MIN_THEORETICAL:"Die Mindestanzahl theoretischer Unterrichtseinheiten ist erforderlich.",MISSING_MIN_PRACTICAL:"Die Mindestanzahl praktischer Unterrichtseinheiten ist erforderlich.",INVALID_FRAMEWORK_TYPE:"Ung\xFCltiger Framework-Typ.",INVALID_STATUS_TAB:"Ung\xFCltiger Status-Tab.",INVALID_QUANTITY:"Die Anzahl muss gr\xF6\xDFer als 0 sein.",MAPPING_NOT_FOUND:"Zuordnung nicht gefunden."};var yi=(i,t)=>t.value;function Ji(i,t){if(i&1&&(r(0,"mat-option",23),s(1),a()),i&2){let e=t.$implicit;c("value",e.value),l(),S(e.label)}}function Wi(i,t){if(i&1&&(r(0,"mat-option",23),s(1),a()),i&2){let e=t.$implicit;c("value",e.value),l(),S(e.label)}}function Xi(i,t){if(i&1){let e=E();r(0,"img",33),u("click",function(){h(e);let o=m().$implicit,d=m(2);return f(d.removeDeliveryMethod(o))}),a()}}function Zi(i,t){if(i&1&&(r(0,"button",31),s(1),y(2,Xi,1,0,"img",32),a()),i&2){let e=t.$implicit,n=m(2);l(),L(" ",n.getDeliveryMethodLabel(e)," "),l(),C(n.isPreview?-1:2)}}function ea(i,t){if(i&1&&A(0,Zi,3,2,"button",31,Ce),i&2){let e=m();F(e.selectedDeliveryMethods())}}function ta(i,t){i&1&&p(0,"app-no-data",28),i&2&&c("message","Liefermethode wurde noch nicht ausgew\xE4hlt")}function na(i,t){i&1&&(r(0,"div",29)(1,"button",34),s(2," Speichern "),a()())}var kt=class i{constructor(){this.dialogRef=b(te);this.data=b(ne);this.fb=b(Q);this.sweetAlert=b(O);this.theoryLessonsService=b(q);this.isPreview=!1;this.showLoader=w(!1);this.selectedDeliveryMethods=w(bt(this.data?.lesson));this.initialDeliveryMethods=bt(this.data?.lesson);this.deliveryMethodOptions=Ze;this.categoryOptions=pt;this.ERROR_MESSAGES=we}ngOnInit(){let t=this.data?.lesson;this.isPreview=!!t?.isPreview;let e=Bt(t?.default_duration??t?.duration);this.lessonForm=this.fb.group({lesson_name:[t?.lesson_name??"",[_.required,_.maxLength(200)]],hours:[e.hours,[_.min(0)]],minutes:[e.minutes,[_.min(0),_.max(59)]],isActive:[zt(t?.status)==="active"],category:[t?.category_type??t?.category_code??t?.category??"",_.required]}),this.isPreview&&this.lessonForm.disable({emitEvent:!1})}onDeliveryMethodsChange(t){let e=this.deliveryMethodOptions.filter(n=>n.value!=="ALL").map(n=>n.value);if(t?.includes("ALL")){let n=e.every(o=>this.selectedDeliveryMethods().includes(o));this.selectedDeliveryMethods.set(n?[]:[...e]);return}this.selectedDeliveryMethods.set(t?.filter(n=>n!=="ALL")??[])}getDeliveryMethodLabel(t){return it(t)}removeDeliveryMethod(t){this.selectedDeliveryMethods.update(e=>e.filter(n=>n!==t))}saveLesson(){if(this.isPreview)return;if(this.lessonForm.invalid){this.lessonForm.markAllAsTouched(),this.showValidationError("Bitte f\xFCllen Sie alle Pflichtfelder korrekt aus.");return}if(!this.selectedDeliveryMethods().length){this.showValidationError("Bitte w\xE4hlen Sie mindestens eine Liefermethode aus.");return}let t=this.lessonForm.value;if(at(t.hours,t.minutes)<=0){this.showValidationError("Bitte geben Sie eine g\xFCltige Dauer ein.");return}if(!this.data?.countryId||!this.data?.lesson?._id){this.showValidationError("Erforderliche Daten fehlen. Bitte versuchen Sie es erneut.");return}let n=ut({lesson_name:t.lesson_name?.trim(),category:t.category,hours:t.hours,minutes:t.minutes,delivery_methods:this.selectedDeliveryMethods(),isActive:!!t.isActive,country_id:this.data.countryId,framework_type:this.data.lessonType??"THEORY",licenseFrameworkId:this.data.lesson._id});this.showLoader.set(!0),this.theoryLessonsService.createTrainingLesson(n).subscribe({next:o=>{this.showLoader.set(!1),this.sweetAlert.success("Erfolgreich gespeichert",ht(o,"Die Theorieeinheit wurde erfolgreich aktualisiert."),"OK").subscribe(()=>this.dialogRef.close(!0))},error:o=>{this.showLoader.set(!1);let d=o?.error?.errorCode,g=d?this.ERROR_MESSAGES[d]:"";this.sweetAlert.error("Fehler",g||"Beim Aktualisieren der Theorieeinheit ist ein Fehler aufgetreten.","O
2K").subscribe()}})}closeModal(){if(this.isPreview){this.dialogRef.close(!1);return}me(this.sweetAlert,gt(this.lessonForm.dirty,this.selectedDeliveryMethods(),this.initialDeliveryMethods),()=>this.dialogRef.close(!1))}showValidationError(t){this.sweetAlert.warning("Pflichtfelder erforderlich",t,"OK").subscribe()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-edit-theory-lesson"]],decls:78,vars:9,consts:[[1,"modal-content"],[1,"custom-mat-modal-header"],[1,"title"],["type","button",1,"btn-close",3,"click"],["src","../../../assets/closeModel.svg","alt","closeModel",2,"height","20px"],[3,"ngSubmit","formGroup"],[1,"modal-body"],[1,"row"],[1,"col-md-6","d-flex","flex-column"],[1,"mb-3"],[1,"field-heading-parent"],[1,"field-heading"],[1,"p-2"],["appearance","outline",1,"w-100"],["matInput","","placeholder","Stundenname","formControlName","lesson_name"],[1,"col-6"],["matInput","","type","number","min","0","formControlName","hours"],["matTextSuffix",""],["matInput","","type","number","min","0","max","59","formControlName","minutes"],[1,"p-3"],["formControlName","isActive"],[1,"col-md-6"],["formControlName","category"],[3,"value"],["multiple","",3,"selectionChange","value","disabled"],[1,"mt-2"],[1,"fw-medium"],[1,"scroll-main-div"],[3,"message"],[1,"modal-footer"],[3,"visible"],["type","button",1,"btn","button-primary","delivery-method-btn","mr-2","mb-2"],["src","../assets/closeModel.svg","alt","Close","width","10","height","10",1,"ms-2"],["src","../assets/closeModel.svg","alt","Close","width","10","height","10",1,"ms-2",3,"click"],["type","submit",1,"btn","primary-button"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"h2",2),s(3),a(),r(4,"button",3),u("click",function(){return n.closeModal()}),p(5,"img",4),a()(),r(6,"form",5),u("ngSubmit",function(){return n.saveLesson()}),r(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"h6",11),s(13,"Stundenname :"),a(),r(14,"div",12)(15,"mat-form-field",13)(16,"mat-label"),s(17,"Stundenname"),a(),p(18,"input",14),a()()()(),r(19,"div",9)(20,"div",10)(21,"h6",11),s(22,"Dauer :"),a(),r(23,"div",12)(24,"div",7)(25,"div",15)(26,"mat-form-field",13)(27,"mat-label"),s(28,"Stunden"),a(),p(29,"input",16),r(30,"span",17),s(31,"Stunde"),a()()(),r(32,"div",15)(33,"mat-form-field",13)(34,"mat-label"),s(35,"Minuten"),a(),p(36,"input",18),r(37,"span",17),s(38,"Minute"),a()()()()()()(),r(39,"div",9)(40,"div",10)(41,"h6",11),s(42,"Status :"),a(),r(43,"div",19)(44,"mat-slide-toggle",20),s(45," Status Aktiv ? "),a()()()()(),r(46,"div",21)(47,"div",9)(48,"div",10)(49,"h6",11),s(50,"Kategorie :"),a(),r(51,"div",12)(52,"mat-form-field",13)(53,"mat-label"),s(54,"Kategorie"),a(),r(55,"mat-select",22),A(56,Ji,2,2,"mat-option",23,yi),a()()()()(),r(58,"div",9)(59,"div",10)(60,"h6",11),s(61,"Liefermethode :"),a(),r(62,"div",12)(63,"mat-form-field",13)(64,"mat-label"),s(65,"Liefermethode"),a(),r(66,"mat-select",24),u("selectionChange",function(d){return n.onDeliveryMethodsChange(d.value)}),A(67,Wi,2,2,"mat-option",23,yi),a()(),r(69,"div",25)(70,"label",26),s(71,"Ausgew\xE4hlte Liefermethode :"),a(),r(72,"div",12)(73,"div",27),y(74,ea,2,0)(75,ta,1,1,"app-no-data",28),a()()()()()()()()(),y(76,na,3,0,"div",29),a()(),p(77,"app-loader",30)),e&2&&(Z("preview-mode",n.isPreview),l(3),S(n.isPreview?"Theorieeinheit vorschauen:":"Theorieeinheit bearbeiten:"),l(3),c("formGroup",n.lessonForm),l(50),F(n.categoryOptions),l(10),c("value",n.selectedDeliveryMethods())("disabled",n.isPreview),l(),F(n.deliveryMethodOptions),l(7),C(n.selectedDeliveryMethods().length>0?74:75),l(2),C(n.isPreview?-1:76),l(),c("visible",n.showLoader()))},dependencies:[ae,D,Y,j,ce,J,Oe,de,ie,ee,N,Pe,R,oe,V,U,se,mt,K,H],styles:[".delivery-method-btn[_ngcontent-%COMP%]:hover   img[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}[_nghost-%COMP%]     .preview-mode .mdc-text-field--disabled{background-color:#fff!important}[_nghost-%COMP%]     .preview-mode .mat-mdc-input-element:disabled, [_nghost-%COMP%]     .preview-mode .mat-mdc-select-disabled .mat-mdc-select-value, [_nghost-%COMP%]     .preview-mode .mat-mdc-select-disabled .mat-mdc-select-arrow, [_nghost-%COMP%]     .preview-mode .mdc-floating-label--float-above, [_nghost-%COMP%]     .preview-mode .mdc-floating-label{color:#515966!important;opacity:1!important}[_nghost-%COMP%]     .preview-mode .mdc-switch--disabled{opacity:1!important}[_nghost-%COMP%]     .preview-mode .mat-mdc-slide-toggle.mat-mdc-slide-toggle-disabled{opacity:1!important}[_nghost-%COMP%]     .preview-mode .mat-mdc-slide-toggle.mat-mdc-slide-toggle-disabled .mdc-label{color:#515966!important;opacity:1!important}"]})}};var Ci=(i,t)=>t.value;function ia(i,t){if(i&1&&(r(0,"mat-option",23),s(1),a()),i&2){let e=t.$implicit;c("value",e.value),l(),S(e.label)}}function aa(i,t){if(i&1&&(r(0,"mat-option",23),s(1),a()),i&2){let e=t.$implicit;c("value",e.value),l(),S(e.label)}}function ra(i,t){if(i&1){let e=E();r(0,"img",33),u("click",function(){h(e);let o=m().$implicit,d=m(2);return f(d.removeDeliveryMethod(o))}),a()}}function oa(i,t){if(i&1&&(r(0,"button",31),s(1),y(2,ra,1,0,"img",32),a()),i&2){let e=t.$implicit,n=m(2);l(),L(" ",n.getDeliveryMethodLabel(e)," "),l(),C(n.isPreview?-1:2)}}function sa(i,t){if(i&1&&A(0,oa,3,2,"button",31,Ce),i&2){let e=m();F(e.selectedDeliveryMethods())}}function la(i,t){i&1&&p(0,"app-no-data",28),i&2&&c("message","Liefermethode wurde noch nicht ausgew\xE4hlt")}function da(i,t){i&1&&(r(0,"div",29)(1,"button",34),s(2," Speichern "),a()())}var Ot=class i{constructor(){this.dialogRef=b(te);this.data=b(ne);
2this.fb=b(Q);this.sweetAlert=b(O);this.theoryLessonsService=b(q);this.showLoader=w(!1);this.isPreview=!1;this.selectedDeliveryMethods=w(bt(this.data?.lesson));this.initialDeliveryMethods=bt(this.data?.lesson);this.deliveryMethodOptions=Ze;this.categoryOptions=pt;this.ERROR_MESSAGES=we}ngOnInit(){let t=this.data?.lesson;this.isPreview=!!t?.isPreview;let e=Bt(t?.default_duration??t?.duration);this.lessonForm=this.fb.group({lesson_name:[t?.lesson_name??"",[_.required,_.maxLength(200)]],hours:[e.hours,[_.min(0)]],minutes:[e.minutes,[_.min(0),_.max(59)]],isActive:[zt(t?.status)==="active"],category:[t?.category_type??t?.category_code??t?.category??"",_.required]}),this.isPreview&&this.lessonForm.disable({emitEvent:!1})}onDeliveryMethodsChange(t){let e=this.deliveryMethodOptions.filter(n=>n.value!=="ALL").map(n=>n.value);if(t?.includes("ALL")){let n=e.every(o=>this.selectedDeliveryMethods().includes(o));this.selectedDeliveryMethods.set(n?[]:[...e]);return}this.selectedDeliveryMethods.set(t?.filter(n=>n!=="ALL")??[])}getDeliveryMethodLabel(t){return it(t)}removeDeliveryMethod(t){this.selectedDeliveryMethods.update(e=>e.filter(n=>n!==t))}saveLesson(){if(this.isPreview)return;if(this.lessonForm.invalid){this.lessonForm.markAllAsTouched(),this.showValidationError("Bitte f\xFCllen Sie alle Pflichtfelder korrekt aus.");return}if(!this.selectedDeliveryMethods().length){this.showValidationError("Bitte w\xE4hlen Sie mindestens eine Liefermethode aus.");return}let t=this.lessonForm.value;if(at(t.hours,t.minutes)<=0){this.showValidationError("Bitte geben Sie eine g\xFCltige Dauer ein.");return}if(!this.data?.countryId||!this.data?.lesson?._id){this.showValidationError("Erforderliche Daten fehlen. Bitte versuchen Sie es erneut.");return}let n=ut({lesson_name:t.lesson_name?.trim(),category:t.category,hours:t.hours,minutes:t.minutes,delivery_methods:this.selectedDeliveryMethods(),isActive:!!t.isActive,country_id:this.data.countryId,framework_type:this.data.lessonType??"PRACTICAL",licenseFrameworkId:this.data.lesson._id});this.showLoader.set(!0),this.theoryLessonsService.createTrainingLesson(n).subscribe({next:o=>{this.showLoader.set(!1),this.sweetAlert.success("Erfolgreich gespeichert",ht(o,"Die Fahrstunde wurde erfolgreich aktualisiert."),"OK").subscribe(()=>this.dialogRef.close(!0))},error:o=>{this.showLoader.set(!1);let d=o?.error?.errorCode,g=d?this.ERROR_MESSAGES[d]:"";this.sweetAlert.error("Fehler",g||"Beim Aktualisieren der Fahrstunde ist ein Fehler aufgetreten.","OK").subscribe()}})}closeModal(){if(this.isPreview){this.dialogRef.close(!1);return}me(this.sweetAlert,gt(this.lessonForm.dirty,this.selectedDeliveryMethods(),this.initialDeliveryMethods),()=>this.dialogRef.close(!1))}showValidationError(t){this.sweetAlert.warning("Pflichtfelder erforderlich",t,"OK").subscribe()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-edit-practical-lesson"]],decls:78,vars:9,consts:[[1,"modal-content"],[1,"custom-mat-modal-header"],[1,"title"],["type","button",1,"btn-close",3,"click"],["src","../../../assets/closeModel.svg","alt","closeModel",2,"height","20px"],[3,"ngSubmit","formGroup"],[1,"modal-body"],[1,"row"],[1,"col-md-6","d-flex","flex-column"],[1,"mb-3"],[1,"field-heading-parent"],[1,"field-heading"],[1,"p-2"],["appearance","outline",1,"w-100"],["matInput","","placeholder","Stundenname","formControlName","lesson_name"],[1,"col-6"],["matInput","","type","number","min","0","formControlName","hours"],["matTextSuffix",""],["matInput","","type","number","min","0","max","59","formControlName","minutes"],[1,"p-3"],["formControlName","isActive"],[1,"col-md-6"],["formControlName","category"],[3,"value"],["multiple","",3,"selectionChange","value","disabled"],[1,"mt-2"],[1,"fw-medium"],[1,"scroll-main-div"],[3,"message"],[1,"modal-footer"],[3,"visible"],["type","button",1,"btn","button-primary","delivery-method-btn","mr-2","mb-2"],["src","../assets/closeModel.svg","alt","Close","width","10","height","10",1,"ms-2"],["src","../assets/closeModel.svg","alt","Close","width","10","height","10",1,"ms-2",3,"click"],["type","submit",1,"btn","primary-button"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"h2",2),s(3),a(),r(4,"button",3),u("click",function(){return n.closeModal()}),p(5,"img",4),a()(),r(6,"form",5),u("ngSubmit",function(){return n.saveLesson()}),r(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"h6",11),s(13,"Stundenname :"),a(),r(14,"div",12)(15,"mat-form-field",13)(16,"mat-label"),s(17,"Stundenname"),a(),p(18,"input",14),a()()()(),r(19,"div",9)(20,"div",10)(21,"h6",11),s(22,"Dauer :"),a(),r(23,"div",12)(24,"div",7)(25,"div",15)(26,"mat-form-field",13)(27,"mat-label"),s(28,"Stunden"),a(),p(29,"input",16),r(30,"span",17),s(31,"Stunde"),a()()(),r(32,"div",15)(33,"mat-form-field",13)(34,"mat-label"),s(35,"Minuten"),a(),p(36,"input",18),r(37,"span",17),s(38,"Minute"),a()()()()()()(),r(39,"div",9)(40,"div",10)(41,"h6",11),s(42,"Status :"),a(),r(43,"div",19)(44,"mat-slide-toggle",20),s(45," Status Aktiv ? "),a()()()()(),r(46,"div",21)(47,"div",9)(48,"div",10)(49,"h6",11),s(50,"Kategorie :"),a(),r(51,"div",12)(52,"mat-form-field",13)(53,"mat-label"),s(54,"Kategorie"),a(),r(55,"mat-select",22),A(56,ia,2,2,"mat-option",23,Ci),a()()()()(),r(58,"div",9)(59,"div",10)(60,"h6",11),s(61,"Liefermethode :"),a(),r(62,"div",12)(63,"mat-form-field",13)(64,"mat-label"),s(65,"Liefermethode"),a(),r(66,"mat-select",24),u("selectionChange",function(d){return n.onDeliveryMethodsChange(d.value)}),A(67,aa,2,2,"mat-option",23,Ci),a()(),r(69,"div",25)(70,"label",26),s(71,"Ausgew\xE4hlte Liefermethode :"),a(),r(72,"div",12)(73,"div",27),y(74,sa,2,0)(75,la,1,1,"app-no-data",28),a()()()()()()()()(),y(76,da,3,0,"div",29),a()(),p(77,"app-loader",30)),e&2&&(Z("preview-mode",n.isPreview),l(3),S(n.isPreview?"Fahrstunde vorschauen:":"Fahrstunde bearbeiten:"),l(3),c("formGroup",n.lessonForm),l(50),F(n.categoryOptions),l(10),c("value",n.selectedDeliveryMethods())("disabled",n.isPreview),l(),F(n.deliveryMethodOptions),l(7),C(n.selectedDeliveryMethods().length>0?74:75),l(2),C(n.isPreview?-1:76),l(),c("visible",n.showLoader()))},dependencies:[ae,D,Y,j,ce,J,Oe,de,ie,ee,N,Pe,R,oe,V,U,se,mt,K,H],styles:[".delivery-method-btn[_ngcontent-%COMP%]:hover   img[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}[_nghost-%COMP%]     .preview-mode .mdc-text-field--disabled{background-color:#fff!important}[_nghost-%COMP%]     .preview-mode .mat-mdc-input-element:disabled, [_nghost-%COMP%]     .preview-mode .mat-mdc-select-disabled .mat-mdc-select-value, [_nghost-%COMP%]     .preview-mode .mat-mdc-select-disabled .mat-mdc-select-arrow, [_nghost-%COMP%]     .preview-mode .mdc-floating-label--float-above, [_nghost-%COMP%]     .preview-mode .mdc-floating-label{color:#515966!important;opacity:1!important}[_nghost-%COMP%]     .preview-mode .mdc-switch--disabled{opacity:1!important}[_nghost-%COMP%]     .preview-mode .mat-mdc-slide-toggle.mat-mdc-slide-toggle-disabled{opacity:1!important}[_nghost-%COMP%]     .preview-mode .mat-mdc-slide-toggle.mat-mdc-slide-toggle-disabled .mdc-label{color:#515966!important;opacity:1!important}"]})}};function ca(i,t){i&1&&(r(0,"div",16)(1,"mat-form-field",20)(2,"mat-label"),s(3,"Ohne Vorbesitz \u2014 erforderlich"),a(),p(4,"input",21),a(),r(5,"mat-form-field",20)(6,"mat-label"),s(7,"Mit Vorbesitz \u2014 erforderlich"),a(),p(8,"input",22),a()())}function ma(i,t){i&1&&(r(0,"mat-form-field",17)(1,"mat-label"),s(2,"Erforderlich"),a(),p(3,"input",21),a())}function pa(i,t){i&1&&(r(0,"div",16)(1,"mat-form-field",20)(2,"mat-label"),s(3,"Ohne Vorbesitz \u2014 erforderlich"),a(),p(4,"input",23),a(),r(5,"mat-form-field",20)(6,"mat-label"),s(7,"Mit Vorbesitz \u2014 erforderlich"),a(),p(8,"input",24),a()())}function ua(i,t){i&1&&(r(0,"mat-form-field",17)(1,"mat-label"),s(2,"Erforderlich"),a(),p(3,"input",23),a())}function ga(i,t){if(i&1&&(r(0,"div",8),s(1,"Vorbesitz-Regelung"),a(),r(2,"div",9),p(3,"img",10),r(4,"span"),s(5," Legen Sie fest, wie viele Lektionen pro Kategorie erforderlich sind \u2014 abh\xE4ngig davon, ob der Sch\xFCler bereits eine Fahrerlaubnis besitzt. Diese Regel gilt f\xFCr jede Fahrerlaubnis; ein spezifischer Erweiterungspfad hat Vorrang. "),a()(),r(6,"div",11)(7,"div",12),s(8," Grundstoff \u2014 Pflichtlektionen "),a(),r(9,"div",13)(10,"div",14)(11,"span"),s(12,"Reduzierung bei Vorbesitz aktivieren"),a(),p(13,"mat-slide-toggle",15),a(),y(14,ca,9,0,"div",16)(15,ma,4,0,"mat-form-field",17),a()(),r(16,"div",18)(17,"div",12),s(18," Zusatzstoff \u2014 Pflichtlektionen "),a(),r(19,"div",13)(20,"div",14)(21,"span"),s(22,"Reduzierung bei Vorbesitz aktivieren"),a(),p(23,"mat-slide-toggle",19),a(),y(24,pa,9,0,"div",16)(25,ua,4,0,"mat-form-field",17),a()()),i&2){let e=m();l(14),C(e.basicReductionEnabled?14:15),l(10),C(e.classSpecificReductionEnabled?24:25)}}function _a(i,t){i&1&&(r(0,"div",9),p(1,"img",10),r(2,"span"),s(3," Legen Sie fest, wie viele Lektionen pro Kategorie erforderlich sind \u2014 abh\xE4ngig davon, ob der Sch\xFCler bereits eine Fahrerlaubnis besitzt. Diese Regel gilt f\xFCr jede Fahrerlaubnis; ein spezifischer Erweiterungspfad hat Vorrang. "),a()(),r(4,"div",11)(5,"div",12),s(6," Grundstoff (Sch\xFCler Kann w\xE4hlen) : "),a(),r(7,"div",13)(8,"mat-form-field",17)(9,"mat-label"),s(10,"Lektionen"),a(),p(11,"input",21),r(12,"span",25),s(13,"Lektionen"),a()()()(),r(14,"div",18)(15,"div",12),s(16," Zusatzstoff (Sch\xFCler Kann w\xE4hlen) : "),a(),r(17,"div",13)(18,"mat-form-field",17)(19,"mat-label"),s(20,"Lektionen"),a(),p(21,"input",23),r(22,"span",25),s(23,"Lektionen"),a()()()())}var _n=class i{constructor(){this.dialogRef=b(te);
2this.fb=b(Q);this.data=b(ne);this.showPriorPossessionSettings=!!this.data.showPriorPossessionSettings;this.settingsForm=this.fb.group({basic_reduction_enabled:[!1],basic:[0,[_.required,_.min(0)]],basic_with_previous:[0,[_.required,_.min(0)]],class_specific_reduction_enabled:[!1],class_specific:[0,[_.required,_.min(0)]],class_specific_with_previous:[0,[_.required,_.min(0)]]})}ngOnInit(){let t=this.data.lessonStateService.getCategorySettings(this.data.frameworkType,this.data.statusTab);this.settingsForm.patchValue(t)}get basicReductionEnabled(){return!!this.settingsForm.get("basic_reduction_enabled")?.value}get classSpecificReductionEnabled(){return!!this.settingsForm.get("class_specific_reduction_enabled")?.value}closeModal(){this.dialogRef.close(!1)}saveSettings(){if(this.settingsForm.invalid){this.settingsForm.markAllAsTouched();return}let t=this.settingsForm.getRawValue(),e=this.data.lessonStateService.getCategorySettings(this.data.frameworkType,this.data.statusTab),n=this.showPriorPossessionSettings?t:X(I({},e),{basic:Number(t.basic)||0,class_specific:Number(t.class_specific)||0,basic_reduction_enabled:!1,basic_with_previous:0,class_specific_reduction_enabled:!1,class_specific_with_previous:0});this.data.lessonStateService.updateCategorySettings(this.data.frameworkType,this.data.statusTab,n),this.dialogRef.close(!0)}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-settings-modal"]],decls:14,vars:5,consts:[[1,"modal-content","add-settings-modal"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["src","../../../assets/closeModel.svg","alt","closeModel",2,"height","20px"],[1,"custom-mat-modal-body",3,"formGroup"],[1,"modal-footer-custom"],["type","button",1,"primary-button",3,"click"],[1,"section-label","mb-2"],[1,"info-box","mb-4"],["src","assets/infoIcon.svg","alt","info","width","20"],[1,"selection-card","mb-4"],[1,"card-header"],[1,"card-body-custom"],[1,"toggle-row","mb-3"],["formControlName","basic_reduction_enabled"],[1,"fields-row"],["appearance","outline",1,"w-100"],[1,"selection-card"],["formControlName","class_specific_reduction_enabled"],["appearance","outline",1,"field-half"],["matInput","","type","number","min","0","formControlName","basic"],["matInput","","type","number","min","0","formControlName","basic_with_previous"],["matInput","","type","number","min","0","formControlName","class_specific"],["matInput","","type","number","min","0","formControlName","class_specific_with_previous"],["matTextSuffix",""]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"h6",2),s(3),a(),r(4,"button",3),u("click",function(){return n.closeModal()}),p(5,"img",4),a()(),r(6,"div",5),y(7,ga,26,2)(8,_a,24,0),r(9,"div",6)(10,"button",7),u("click",function(){return n.closeModal()}),s(11," Abbrechen "),a(),r(12,"button",7),u("click",function(){return n.saveSettings()}),s(13," Speichern "),a()()()()),e&2&&(l(3),L(" ",n.showPriorPossessionSettings?"Lektionen-Einstellungen":"Auswahl-Einstellungen"," "),l(3),c("formGroup",n.settingsForm),l(),C(n.showPriorPossessionSettings?7:8),l(2),Z("footer-between",!n.showPriorPossessionSettings))},dependencies:[N,R,oe,V,U,se,K,H,D,Y,j,ce,J,ie],styles:[".custom-mat-modal-body[_ngcontent-%COMP%]{padding:20px}.section-label[_ngcontent-%COMP%]{color:#8a8f98;font-size:13px;font-weight:500}.info-box[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px;background:#f5f5f5;border-radius:8px;padding:12px 14px;color:#5f6368;font-size:14px;line-height:1.45}.selection-card[_ngcontent-%COMP%]{border:1px solid #d9e7f5;border-radius:8px;overflow:hidden;background:#fff}.card-header[_ngcontent-%COMP%]{background:#eaf4ff;padding:12px 14px;font-weight:600;color:#5f6368;font-size:16px}.card-body-custom[_ngcontent-%COMP%]{padding:16px 14px 8px}.toggle-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#5f6368;font-size:14px}.fields-row[_ngcontent-%COMP%]{display:flex;gap:12px}.field-half[_ngcontent-%COMP%]{flex:1;min-width:0}.w-100[_ngcontent-%COMP%]{width:100%}.modal-footer-custom[_ngcontent-%COMP%]{margin-top:28px;display:flex;justify-content:space-between;gap:12px}.modal-footer-custom.footer-between[_ngcontent-%COMP%]{justify-content:space-between;margin-top:50px}  .selection-card .mat-mdc-form-field{width:100%}  .selection-card .mdc-text-field--outlined{border-radius:8px}  .mat-mdc-form-field-text-suffix{font-weight:500;color:#555;padding-right:10px}  .mat-mdc-form-field-subscript-wrapper{display:none}@media(max-width:640px){.fields-row[_ngcontent-%COMP%]{flex-direction:column;gap:0}}"]})}};function vi(i,t=!1){if(!i)return;let e=i instanceof Date?new Date(i):new Date(i);if(!Number.isNaN(e.getTime()))return t?e.setHours(23,59,59,999):e.setHours(0,0,0,0),e.toISOString()}function Kt(i,t,e="STANDARD"){return(i??[]).map(n=>{let o=n.framework_id??n._id;if(!o)return null;let d=Number(n.quantity),g=n.status_mapping==="INCLUDED"?"INCLUDED":"EXCLUDED",v=n.category_type??n.category_code??n.category;return I({license_framework_id:o,quantity:Number.isNaN(d)||d<0?0:Math.floor(d),framework_type:t,status_tab:e,status_mapping:g},v?{category_type:String(v)}:{})}).filter(n=>n!==null)}function ha(i){return i.filter(t=>!!t.license_framework_id).map(t=>({license_framework_id:t.license_framework_id,quantity:t.quantity,status_mapping:t.status_mapping,mapping_context:"CLASS",framework_type:t.framework_type}))}function fa(i){return{theory:{normal:I({},i.theory.normal)},practical:{normal:I({},i.practical.normal)}}}function bi(i,t,e,n,o=!0){let d={class_code:i.class_code?.trim()??"",class_name:i.class_name?.trim()??"",class_description:i.class_description?.trim()||void 0,valid_from:vi(i.valid_from),valid_to:vi(i.valid_to,!0),status:i.status??"active",country_id:t};return o&&(d.license_class_settings=fa(n),d.classSpecificMappingData=ha(e)),d}var xi=1e3;function Si(i){return i(1).pipe(Jt(t=>{let e=t?.data??[],n=Number(t?.pagination?.totalPages)||1;if(n<=1)return be(e);let o=Array.from({length:n-1},(d,g)=>i(g+2));return He(o).pipe(ve(d=>[...e,...d.flatMap(g=>g?.data??[])]))}))}function Qt(i,t,e,n){return e.length?Si(o=>i.getClassFrameworkData(t,{license_class_ids:e,framework_type:n,page:o,limit:xi,search:null,filter_status:"ALL"})):be([])}function Ei(i,t,e,n){return Si(o=>i.getDrivingLicenseClasses(t,{license_class_id:n,framework_type:e,page:o,limit:xi,filter_status:"ALL"}))}function Nt(i,t,e,n){let o=Kt(i,t,e);return n?o.map(d=>{let g=i.find(v=>(v.framework_id??v._id)===d.license_framework_id);return g?.status_mapping==="INCLUDED"||g?.status_mapping==="EXCLUDED"?d:X(I({},d),{status_mapping:n})}):o}function hn(i){let{theoryLessonsService:t,lessonStateService:e,countryId:n,licenseClassIds:o,includeTheoryExperience:d=!1,includePracticalExperience:g=!1}=i;if(!n||!o.length)return Promise.resolve();let v=[Qt(t,n,o,"THEORY").pipe(ve(T=>Nt(T,"THEORY","STANDARD","EXCLUDED"))),Qt(t,n,o,"PRACTICAL").pipe(ve(T=>Nt(T,"PRACTICAL","STANDARD","EXCLUDED")))];return d&&v.push(Qt(t,n,o,"THEORY").pipe(ve(T=>Nt(T,"THEORY","EXPERIENCE","EXCLUDED")))),g&&v.push(Qt(t,n,o,"PRACTICAL").pipe(ve(T=>Nt(T,"PRACTICAL","EXPERIENCE","EXCLUDED")))),Yt(He(v)).then(T=>{e.seedMissingLessons(T.flat())})}function wi(i){let{theoryLessonsService:t,lessonStateService:e,countryId:n,frameworkTypes:o=["THEORY","PRACTICAL"]}=i;
2if(!n||!o.length)return Promise.resolve();let d=o.map(g=>Ei(t,n,g).pipe(ve(v=>Nt(v,g,"STANDARD","INCLUDED"))));return Yt(He(d)).then(g=>{e.seedMissingLessons(g.flat())})}function Ti(i){let{theoryLessonsService:t,lessonStateService:e,countryId:n,frameworkType:o,statusTab:d="STANDARD",licenseClassIds:g=[],licenseClassId:v,defaultStatusMapping:T}=i;if(!n)return Promise.resolve();let W=g.length>0?Qt(t,n,g,o):Ei(t,n,o,v);return Yt(W.pipe(ve(G=>Nt(G,o,d,T)))).then(G=>{e.seedMissingLessons(G)})}var ya=["menuTrigger"],Ca=(i,t)=>t.framework_id;function va(i,t){if(i&1){let e=E();r(0,"div",17)(1,"button",35),u("click",function(){h(e);let o=m();return f(o.openSettingsModal())}),jn(),r(2,"svg",36),p(3,"path",37)(4,"circle",38),a()()()}}function ba(i,t){i&1&&(r(0,"div",19),p(1,"img",39),r(2,"span"),s(3," Legen Sie fest, wie viele Stunden ein Sch\xFCler pro Kategorie aus den aktivierten Stunden w\xE4hlen kann. "),a()())}function xa(i,t){if(i&1){let e=E();r(0,"tr")(1,"td"),s(2),a(),r(3,"td"),s(4),a(),r(5,"td")(6,"div",40)(7,"input",41),u("input",function(o){let d=h(e).$implicit,g=m();return f(g.onQuantityInput(d,o))}),a(),r(8,"div",42)(9,"div",43),u("click",function(){let o=h(e).$implicit,d=m();return f(d.decrement(o))}),s(10,"\u2212"),a(),p(11,"div",44),r(12,"div",43),u("click",function(){let o=h(e).$implicit,d=m();return f(d.increment(o))}),s(13,"+"),a()()()(),r(14,"td",45),s(15),a(),r(16,"td"),s(17),a(),r(18,"td",46)(19,"mat-slide-toggle",47),u("change",function(o){let d=h(e).$implicit,g=m();return f(g.onStatusMappingToggle(d,o))}),a()(),r(20,"td",48)(21,"div",49)(22,"button",50),u("click",function(){let o=h(e).$implicit,d=m();return f(d.openPreview(o))}),s(23," Vorschau "),a()()()()}if(i&2){let e=t.$implicit,n=t.$index,o=m();l(2),S((o.currentPage()-1)*o.limit()+n+1),l(2),S(e.lesson_name),l(3),c("value",e.quantity),l(8),L(" ",e.category_type==="CLASS_SPECIFIC"?"Zusatzstoff":e.category_type==="BASIC"?"Grundstoff":"-"," "),l(2),Me("",e.default_duration.hours," Std. ",e.default_duration.minutes," Min"),l(2),c("checked",e.status_mapping==="INCLUDED")}}function Sa(i,t){if(i&1&&(r(0,"tr")(1,"td",51),p(2,"app-no-data",52),a()()),i&2){let e=m();l(2),c("message",e.emptyLessonsMessage())}}function Ea(i,t){if(i&1){let e=E();r(0,"li",31),u("click",function(){let o=h(e).$implicit,d=m();return f(d.goToPage(o))}),r(1,"a",32),s(2),a()()}if(i&2){let e=t.$implicit,n=m();Z("active",e===n.currentPage()),l(2),S(e)}}function wa(i,t){if(i&1){let e=E();r(0,"button",53),u("click",function(){h(e);let o=m(2);return f(o.goNextStep1(o.stepper()))}),s(1," Weiter "),a()}}function Ta(i,t){if(i&1){let e=E();r(0,"button",53),u("click",function(){h(e);let o=m(2);return f(o.onFinalStepAction())}),s(1,"Speichern"),a()}}function La(i,t){if(i&1){let e=E();r(0,"div",34)(1,"button",53),u("click",function(){h(e);let o=m();return f(o.stepper().previous())}),s(2,"Zur\xFCck"),a(),y(3,wa,2,0,"button",54)(4,Ta,2,0,"button",54),a()}if(i&2){let e=m();l(3),C(e.stepper().selectedIndex===1?3:4)}}var $e=class i{constructor(){this.stepper=ue(null);this.showStepperNav=ue(!0);this.saveHandler=ue(null);this.countryId=ue("");this.frameworkType=ue("THEORY");this.qualificationPathId=ue("");this.licenseClassId=ue("");this.licenseClassIds=ue([]);this.showInfoMessage=ue(!1);this.statusTab=ue("STANDARD");this.enablePriorPossessionSettings=ue(!1);this.autoDeriveSettings=ue(!1);this.showLoader=w(!1);this.drivingLicenseClasses=w([]);this.selectedStatusLabel=w("ALL");this.selectedStatusDisplayLabel=k(()=>{switch(this.selectedStatusLabel()){case"INCLUDED":return"Erforderlich";case"EXCLUDED":return"Nicht erforderlich";default:return"Alle"}});this.emptyLessonsMessage=k(()=>this.selectedStatusLabel()==="ALL"?"Keine Lektionen gefunden. Bitte legen Sie zuerst Lektionen im Tab \u201EAusbildung\u201C an.":"Keine Lektionen gefunden.");this.totalResults=w(0);this.currentPage=w(1);this.totalPages=w(1);this.limit=w(10);this.searchKeyword=new dt("",{nonNullable:!0});this.destroy$=new st;this.theoryLessonsService=b(q);this.matDialog=b(je);this.lessonStateService=b(fe,{optional:!0});this.autoSettingsSeedKeys=new Set;this.canOpenSettings=k(()=>!!this.lessonStateService);this.pages=k(()=>Array.from({length:this.totalPages()},(t,e)=>e+1));this.startRecord=k(()=>this.totalResults()===0?0:(this.currentPage()-1)*this.limit()+1);this.endRecord=k(()=>this.totalResults()===0?0:Math.min(this.currentPage()*this.limit(),this.totalResults()));this.isQualificationPathEditMode=k(()=>
2!!this.qualificationPathId());this.useClassFrameworkData=k(()=>!this.isQualificationPathEditMode()&&this.licenseClassIds().length>0)}ngOnInit(){this.searchKeyword.valueChanges.pipe(xt(400),St(),Ct(this.destroy$)).subscribe(()=>{this.currentPage.set(1),this.loadLessons()}),this.loadLessons()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}goNextStep1(t){t.next()}selectStatus(t){this.selectedStatusLabel.set(t),this.currentPage.set(1),this.loadLessons()}normalizeQuantity(t){let e=Number(t);return Number.isNaN(e)||e<0?0:Math.floor(e)}onQuantityInput(t,e){let n=e.target;t.quantity=this.normalizeQuantity(n.value),this.syncLessonSelectionsFromUserEdit()}increment(t){t.quantity=this.normalizeQuantity(t.quantity)+1,this.syncLessonSelectionsFromUserEdit()}decrement(t){this.normalizeQuantity(t.quantity)>0&&(t.quantity--,this.syncLessonSelectionsFromUserEdit())}onStatusMappingChange(t){t&&console.log("[TheoryLession] lesson toggle value",{lesson_name:t.lesson_name,framework_id:t.framework_id,status_mapping:t.status_mapping,toggle_checked:t.status_mapping==="INCLUDED",frameworkType:this.frameworkType(),statusTab:this.statusTab()}),this.syncLessonSelectionsFromUserEdit()}onStatusMappingToggle(t,e){t.status_mapping=e.checked?"INCLUDED":"EXCLUDED",this.onStatusMappingChange(t)}onFinalStepAction(){let t=this.saveHandler();if(t){t();return}this.stepper()?.next()}goToPage(t){t<1||t>this.totalPages()||t===this.currentPage()||(this.currentPage.set(t),this.loadLessons())}openPreview(t){let e=this.frameworkType(),n={width:"100%",maxWidth:"1200px",panelClass:"custom-mat-modal-container",disableClose:!0,data:{countryId:this.countryId(),lessonType:e,lesson:X(I({},t),{_id:t.framework_id??t._id,isPreview:!0})}};(e==="PRACTICAL"?this.matDialog.open(Ot,n):this.matDialog.open(kt,n)).afterClosed().subscribe(d=>{d&&this.loadLessons()})}loadLessons(){if(this.isQualificationPathEditMode()){this.loadQualificationPathMappingData();return}if(this.useClassFrameworkData()){this.loadClassFrameworkData();return}this.loadDrivingLicenseClasses()}mapLessonItem(t,e){return X(I({},t),{quantity:this.normalizeQuantity(t.quantity),status_mapping:t.status_mapping??e})}
2buildMappingRequestParams(){let t={framework_type:this.frameworkType(),page:this.currentPage(),limit:this.limit(),search:this.searchKeyword.value.trim(),filter_status:this.selectedStatusLabel()};return this.isQualificationPathEditMode()?X(I({},t),{qualification_path_id:this.qualificationPathId(),status_tab:this.statusTab()}):X(I({},t),{license_class_id:this.licenseClassId()||void 0})}buildClassFrameworkRequestPayload(){let t=this.searchKeyword.value.trim();return{license_class_ids:this.licenseClassIds(),framework_type:this.frameworkType(),page:this.currentPage(),limit:this.limit(),search:t||null,filter_status:this.selectedStatusLabel()}}loadClassFrameworkData(){this.showLoader.set(!0),this.theoryLessonsService.getClassFrameworkData(this.countryId(),this.buildClassFrameworkRequestPayload()).subscribe({next:t=>{this.showLoader.set(!1),this.autoDeriveSettings()||this.applyLicenseClassSettingsFromContext(t?.context_data),this.applyLessonsResponse(t,"EXCLUDED")},error:t=>{this.showLoader.set(!1),console.log(t),this.drivingLicenseClasses.set([]),this.totalResults.set(0),this.currentPage.set(1),this.totalPages.set(1)}})}applyLessonsResponse(t,e){let n=(t.data||[]).map(o=>this.mapLessonItem(o,e));this.lessonStateService&&(n=this.lessonStateService.applyStoredSelectionsToItems(n,this.frameworkType(),this.statusTab())),this.drivingLicenseClasses.set(n),this.totalResults.set(t.pagination?.total||0),this.currentPage.set(t.pagination?.page||1),this.limit.set(t.pagination?.limit||this.limit()),this.totalPages.set(t.pagination?.totalPages||1),this.syncLessonSelections()}loadQualificationPathMappingData(){this.showLoader.set(!0),this.theoryLessonsService.getQualificationPathMappingData(this.countryId(),this.buildMappingRequestParam
2s()).subscribe({next:t=>{this.showLoader.set(!1),this.autoDeriveSettings()||this.applyLicenseClassSettingsFromContext(t?.context_data),this.applyLessonsResponse(t,"EXCLUDED")},error:t=>{this.showLoader.set(!1),console.log(t),this.drivingLicenseClasses.set([]),this.totalResults.set(0),this.currentPage.set(1),this.totalPages.set(1)}})}loadDrivingLicenseClasses(){this.showLoader.set(!0);let t=this.licenseClassId();this.theoryLessonsService.getDrivingLicenseClasses(this.countryId(),this.buildMappingRequestParams()).subscribe({next:e=>{this.showLoader.set(!1),t&&!this.autoDeriveSettings()&&this.applyLicenseClassSettingsFromContext(e?.context_data);let n=t?"EXCLUDED":"INCLUDED";this.applyLessonsResponse(e,n)},error:e=>{this.showLoader.set(!1),console.log(e),this.drivingLicenseClasses.set([]),this.totalResults.set(0),this.currentPage.set(1),this.totalPages.set(1)}})}openSettingsModal(){return ze(this,null,function*(){this.lessonStateService&&(yield this.maybeAutoDeriveSettings(),this.matDialog.open(_n,{width:"100%",maxWidth:"760px",panelClass:"custom-mat-modal-container",disableClose:!0,data:{frameworkType:this.frameworkType(),statusTab:this.statusTab(),lessonStateService:this.lessonStateService,showPriorPossessionSettings:this.enablePriorPossessionSettings()}}))})}applyLicenseClassSettingsFromContext(t){rt(this.lessonStateService,t),t?.license_class_settings&&console.log("[TheoryLession] license_class_settings patched",$n(t.license_class_settings))}syncLessonSelections(){this.lessonStateService&&(this.lessonStateService.syncPageLessons(this.drivingLicenseClasses(),this.frameworkType(),this.statusTab()),this.maybeAutoDeriveSettings())}syncLessonSelectionsFromUserEdit(){this.syncLessonSelections(),this.lessonStateService?.markDirty()}maybeAutoDeriveSettings(){return ze(this,null,function*(){!this.autoDeriveSettings()||!this.lessonStateService||(yield this.ensureAllPagesSeededForAutoSettings(),this.lessonStateService.autoSyncSettingsFromIncludedLessons(this.frameworkType(),this.statusTab()))})}ensureAllPagesSeededForAutoSettings(){return ze(this,null,function*(){if(!this.lessonStateService||!this.countryId())return;let t=this.frameworkType(),e=this.statusTab(),n=`${t}_${e}_${this.licenseClassIds().join(",")}_${this.licenseClassId()}`;if(this.autoSettingsSeedKeys.has(n))return;let o=this.useClassFrameworkData()||this.licenseClassId()?"EXCLUDED":"INCLUDED";try{yield Ti({theoryLessonsService:this.theoryLessonsService,lessonStateService:this.lessonStateService,countryId:this.countryId(),frameworkType:t,statusTab:e,licenseClassIds:this.licenseClassIds(),licenseClassId:this.licenseClassId()||void 0,defaultStatusMapping:o}),this.autoSettingsSeedKeys.add(n)}catch(d){console.error("[TheoryLession] failed to seed all lessons for settings count",d)}})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-theory-lession"]],viewQuery:function(e,n){if(e&1&&Jn(ya,5),e&2){let o;Wn(o=Xn())&&(n.menuTrigger=o.first)}},inputs:{stepper:[1,"stepper"],showStepperNav:[1,"showStepperNav"],saveHandler:[1,"saveHandler"],countryId:[1,"countryId"],frameworkType:[1,"frameworkType"],qualificationPathId:[1,"qualificationPathId"],licenseClassId:[1,"licenseClassId"],licenseClassIds:[1,"licenseClassIds"],showInfoMessage:[1,"showInfoMessage"],statusTab:[1,"statusTab"],enablePriorPossessionSettings:[1,"enablePriorPossessionSettings"],autoDeriveSettings:[1,"autoDeriveSettings"]},decls:68,vars:24,consts:[["menuTrigger","matMenuTrigger"],["theoryMenu","matMenu"],[1,"cluster-managment"],[3,"visible"],[1,"mt-4","custom-padding"],[1,"row","gy-2","align-items-center"],[1,"col-lg-6"],[1,"d-flex","align-items-center",2,"gap","20px"],["type","text","placeholder","z.\u202FB. Stundenname suchen",1,"search","myInput","new-myInput",3,"formControl"],[1,"slector-dropdown"],["mat-button","",3,"matMenuTriggerFor"],[1,"ml-2","d-none","d-md-inline"],[1,"ml-2","d-md-none"],[1,"fa","fa-caret-down","ml-1"],[1,"qna-dropdown-menu","slector-dropdown-items",3,"overlapTrigger"],["mat-menu-item","",3,"click"],[1,"col-lg-6","d-flex","justify-content-end"],[1,"qna-settings-wrap","flex-shrink-0","mr-2"],[1,"new-tableCount"],[1,"info-box","mt-3"],[1,"main-tableBlock"],[1,"customTable","w-100","mt-3"],[1,"w-100"],[2,"width","5%","min-width","40px"],[2,"width","35%","min-width","150px"],[2,"width","10%","min-width","120px"],[2,"width","20%","min-width","150px"],[2,"width","10%","min-width","100px"],[2,"width","10%","min-width","60px"],[1,"d-flex","justify-content-end","pagination-main","mt-3","editing-something"],[1,"pagination","m-0","pagerAction"],[1,"page-item",3,"click"],[1,"page-link"],[1,"page-item",3,"active"],[1,"stepper-buttons","d-flex","justify-content-between","align-items-center"],["type","button","aria-label","Einstellungen",1,"qna-settings-btn",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","30","height","24","viewBox","0 0 24 24","fill","none","stroke","#75787d","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true"],["d","M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"],["cx","12","cy","12","r","3"],["src","assets/infoIcon.svg","alt","info","width","20"],[1,"counter"],["type","text","inputmode","numeric","pattern","[0-9]*",1,"form-control","counter-value","text-center",2,"width","48px","height","30px",3,"input","value"],[1,"counter-buttons"],[1,"counter-btn",3,"click"],[1,"divi
2der"],[2,"gap","10px"],[1,"start"],["labelPosition","before",3,"change","checked"],[1,"text-center"],[1,"action-btn"],[1,"open-btn",3,"click"],["colspan","7"],[3,"message"],["type","button",1,"primary-button",3,"click"],["type","button",1,"primary-button"]],template:function(e,n){if(e&1&&(r(0,"section",2),p(1,"app-loader",3),r(2,"div",4)(3,"div",5)(4,"div",6)(5,"div",7),p(6,"input",8),r(7,"div",9)(8,"button",10,0)(10,"span",11),s(11),a(),r(12,"span",12),s(13,"Frage"),a(),p(14,"i",13),a(),r(15,"mat-menu",14,1)(17,"button",15),u("click",function(){return n.selectStatus("ALL")}),s(18," Alle "),a(),r(19,"button",15),u("click",function(){return n.selectStatus("INCLUDED")}),s(20," Erforderlich "),a(),r(21,"button",15),u("click",function(){return n.selectStatus("EXCLUDED")}),s(22," Nicht erforderlich "),a()()()()(),r(23,"div",16),y(24,va,5,0,"div",17),r(25,"span",18),s(26),a()()(),y(27,ba,4,0,"div",19),r(28,"div",20)(29,"div",21)(30,"table",22)(31,"thead")(32,"tr")(33,"th",23),s(34,"#"),a(),r(35,"th",24),s(36,"Stundenname"),a(),r(37,"th",25),s(38,"Anzahl"),a(),r(39,"th",26),s(40,"Kategorie"),a(),r(41,"th",27),s(42,"Dauer"),a(),r(43,"th",28),s(44,"Erforderlich"),a(),r(45,"th",27),s(46,"Interaktion"),a()()(),r(47,"tbody"),A(48,xa,24,7,"tr",null,Ca,!1,Sa,3,1,"tr"),a()()()(),r(51,"div",29)(52,"ul",30)(53,"li",31),u("click",function(){return n.goToPage(1)}),r(54,"a",32),s(55,"<<"),a()(),r(56,"li",31),u("click",function(){return n.goToPage(n.currentPage()-1)}),r(57,"a",32),s(58,"<"),a()(),A(59,Ea,3,3,"li",33,Ce),r(61,"li",31),u("click",function(){return n.goToPage(n.currentPage()+1)}),r(62,"a",32),s(63,">"),a()(),r(64,"li",31),u("click",function(){return n.goToPage(n.totalPages())}),r(65,"a",32),s(66,">>"),a()()()()(),y(67,La,5,1,"div",34),a()),e&2){let o=M(9),d=M(16);l(),c("visible",n.showLoader()),l(5),c("formControl",n.searchKeyword),l(2),Z("menu-open",o.menuOpen),c("matMenuTriggerFor",d),l(3),S(n.selectedStatusDisplayLabel()),l(3),Z("rotated",o.menuOpen),l(),c("overlapTrigger",!1),l(9),C(n.canOpenSettings()?24:-1),l(2),xe(" Anzahl der Ergebnisse: ",n.startRecord()," - ",n.endRecord()," / ",n.totalResults()," "),l(),C(n.showInfoMessage()?27:-1),l(21),F(n.drivingLicenseClasses()),l(5),Z("disabled",n.currentPage()===1),l(3),Z("disabled",n.currentPage()===1),l(3),F(n.pages()),l(2),Z("disabled",n.currentPage()===n.totalPages()),l(3),Z("disabled",n.currentPage()===n.totalPages()),l(3),C(n.showStepperNav()&&n.stepper()?67:-1)}},dependencies:[li,ie,si,Ye,oi,Je,ae,N,R,V,ct,ee],styles:[".action-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:15px}.status.bg-warning[_ngcontent-%COMP%]{background-color:#ffc107}.status.bg-success[_ngcontent-%COMP%]{background-color:#28a745}.status.bg-danger[_ngcontent-%COMP%]{background-color:#dc3545}  .mat-mdc-button.mat-mdc-button-base{min-width:40px!important;padding:1%!important;line-height:20px!important;height:100%!important}  .mat-mdc-menu-panel{min-width:130px!important;border-radius:6px!important;padding:8px}  .mat-mdc-menu-panel .mat-mdc-menu-content{padding:0;display:grid;gap:10px}  .mdc-linear-progress__bar-inner{border-color:#1388fe!important}.myInput[_ngcontent-%COMP%]{height:50px!important}.pagination-main[_ngcontent-%COMP%]{margin-top:20px;padding:15px 0}.pagination[_ngcontent-%COMP%]{display:flex;gap:0}.pagination[_ngcontent-%COMP%]   .page-link[_ngcontent-%COMP%]{cursor:pointer;color:#4a4a4a;background:#fff;border:1px solid #e0e0e0;padding:8px 14px;text-decoration:none}.pagination[_ngcontent-%COMP%]   .page-item.active[_ngcontent-%COMP%]   .page-link[_ngcontent-%COMP%]{background-color:#d0e7ff;border-color:#a6d9ff;color:#4a4a4a;font-weight:500}.pagination[_ngcontent-%COMP%]   .page-item.disabled[_ngcontent-%COMP%]   .page-link[_ngcontent-%COMP%]{cursor:not-allowed;opacity:.6}.pagination-main[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:first-child   .page-link[_ngcontent-%COMP%]{border-top-left-radius:8px;border-bottom-left-radius:8px}.pagination-main[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:last-child   .page-link[_ngcontent-%COMP%]{border-top-right-radius:8px;border-bottom-right-radius:8px}
2.counter[_ngcontent-%COMP%]{display:flex;align-items:center;background:#d0e7ff;border-radius:10px;padding:2px}.counter-value[_ngcontent-%COMP%]{background:#fff;color:#232323;padding:1px 7px;width:50px;max-height:36px;height:100%;max-width:75px;min-width:45px;border-radius:10px;font-size:17px;text-align:center}.counter-buttons[_ngcontent-%COMP%]{display:flex;align-items:center;margin-left:2px}.counter-btn[_ngcontent-%COMP%]{padding:1px 2px;color:#232323;font-size:18px;font-weight:700;cursor:pointer;transition:all .2s ease}.counter-btn.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:default;pointer-events:none}.counter-buttons.disabled[_ngcontent-%COMP%]{opacity:.6}.counter-value[_ngcontent-%COMP%]:disabled{opacity:.7;cursor:default;background-color:#f5f5f5}.divider[_ngcontent-%COMP%]{width:1px;border:.5px solid #232323;margin:0 5px;height:15px}.button-primary[_ngcontent-%COMP%]   .fa-caret-down.rotated[_ngcontent-%COMP%], .button-primary.menu-open[_ngcontent-%COMP%]   .fa-caret-down[_ngcontent-%COMP%], .button-primary[aria-expanded=true][_ngcontent-%COMP%]   .fa-caret-down[_ngcontent-%COMP%], .button-primary.cdk-focused[_ngcontent-%COMP%]   .fa-caret-down[_ngcontent-%COMP%]{transform:rotate(180deg)}.slector-dropdown[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{padding:5px 16px!important;border:solid 1px #cbcbcb;border-radius:12px;font-size:16px;line-height:1.3;font-weight:400;color:#515966;position:relative;white-space:nowrap;height:50px;background-color:transparent}.slector-dropdown[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]     .mdc-button__label{display:flex;align-items:center}[_nghost-%COMP%]     .cdk-overlay-pane .mat-mdc-menu-panel.qna-dropdown-menu, [_nghost-%COMP%]     .mat-mdc-menu-panel.qna-dropdown-menu{border-radius:8px!important;
2min-width:200px!important;margin-top:5px!important;box-shadow:0 2px 8px #00000026!important;overflow:hidden!important}[_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-content{padding:0!important}[_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item{padding:12px 20px!important;font-size:14px!important;color:#3a3d44!important;min-height:48px!important;line-height:24px!important;cursor:pointer!important}[_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item:hover, [_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item.mdc-list-item:hover, [_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item:focus, [_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item.mdc-list-item:focus, [_nghost-%COMP%]     .qna-dropdown-menu .mdc-list-item:hover{background-color:#f0f0f0!important}[_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item:hover .mdc-list-item__ripple, [_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item:focus .mdc-list-item__ripple, [_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item .mdc-list-item:hover .mdc-list-item__ripple{background-color:#f0f0f0!important;opacity:1!important}[_nghost-%COMP%]     .qna-dropdown-menu .mdc-list-item:hover .mdc-list-item__content, [_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item:hover .mdc-list-item__content{background-color:transparent!important}[_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item:hover .mdc-list-item, [_nghost-%COMP%]     .qna-dropdown-menu .mdc-list-item:hover{background-color:#f0f0f0!important}[_nghost-%COMP%]     .cdk-overlay-container .qna-dropdown-menu .mat-mdc-menu-item:hover, [_nghost-%COMP%]     .cdk-overlay-container .qna-dropdown-menu .mdc-list-item:hover{background-color:#f0f0f0!important}[_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item .mdc-list-item__ripple:before{background-color:transparent!important}[_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item:hover .mdc-list-item__ripple:before, [_nghost-%COMP%]     .qna-dropdown-menu .mdc-list-item:hover .mdc-list-item__ripple:before{background-color:#f0f0f0!important;opacity:1!important}[_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item .mdc-list-item__primary-text{font-weight:500!important;color:#3a3d44!important}[_nghost-%COMP%]     .qna-dropdown-menu .mat-mdc-menu-item *{pointer-events:auto!important}.button-primary[_ngcontent-%COMP%]{max-width:200px;white-space:nowrap}.custom-padding[_ngcontent-%COMP%]{padding:0 16px}.button-primary[_ngcontent-%COMP%]   .fa-caret-down[_ngcontent-%COMP%]{font-size:12px;margin-left:5px;transition:transform .3s ease;vertical-align:middle;display:inline-block}.qna-settings-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:50px;height:50px;padding:0;border:none;border-radius:12px;background-color:#d0e7ff;color:#313c4f;cursor:pointer;transition:background-color .2s ease,transform .15s ease,box-shadow .2s ease}.qna-settings-btn[_ngcontent-%COMP%]:hover{background-color:#c5dff5;box-shadow:0 2px 8px #06294c14}.qna-settings-btn[_ngcontent-%COMP%]:active{transform:scale(.97)}.info-box[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;background:#f7f8fa;border-radius:8px;padding:12px 16px;font-size:14px;color:#515966}"]})}};function Pa(i,t){i&1&&(r(0,"mat-icon"),s(1,"check"),a())}function Aa(i,t){i&1&&(r(0,"mat-error"),s(1," Klassencode ist erforderlich "),a())}function Fa(i,t){i&1&&(r(0,"mat-error"),s(1," Klassencode darf maximal 10 Zeichen lang sein "),a())}function Da(i,t){i&1&&(r(0,"mat-error"),s(1," Sonderzeichen nicht erlaubt "),a())}function ka(i,t){i&1&&(r(0,"mat-error"),s(1," Klassenname ist erforderlich "),a())}function Oa(i,t){i&1&&(r(0,"mat-error"),s(1," Klassenname darf maximal 100 Zeichen lang sein "),a())}function Na(i,t){i&1&&(r(0,"mat-error"),s(1," Sonderzeichen nicht erlaubt "),a())}function Ga(i,t){i&1&&(r(0,"mat-error"),s(1," Beide Datumsfelder m\xFCssen ausgef\xFCllt werden "),a())}function Ra(i,t){i&1&&(r(0,"mat-error"),s(1,' "G\xFCltig bis" muss nach "G\xFCltig von" liegen '),a())}function Va(i,t){i&1&&(r(0,"mat-error"),s(1," Beide Datumsfelder m\xFCssen ausgef\xFCllt werden "),a())}function qa(i,t){i&1&&(r(0,"mat-error"),s(1,' "G\xFCltig bis" muss nach "G\xFCltig von" liegen '),a())}function $a(i,t){if(i&1&&p(0,"app-theory-lession",47),i&2){m();let e=M(1),n=m();c("stepper",e)("showStepperNav",!0)("countryId",n.data.countryId)("frameworkType","THEORY")("enablePriorPossessionSettings",!0)("autoDeriveSettings",!0)}}function Ba(i,t){if(i&1&&p(0,"app-theory-lession",48),i&2){m();let e=M(1),n=m();c("stepper",e)("showStepperNav",!0)("countryId",n.data.countryId)("frameworkType","PRACTICAL")("saveHandler",n.saveCategoryHandler)("enablePriorPossessionSettings",!0)("autoDeriveSettings",!0)}}function za(i,t){if(i&1){let e=E();r(0,"mat-stepper",13,0),u("selectionChange",function(o){h(e);let d=m();return f(d.onStepChange(o))}),x(2,Pa,2,0,"ng-template",14),r(3,"mat-step",15)(4,"div",16)(5,"div",17)(6,"div",18)(7,"div",19)(8,"div",20)(9,"div",21)(10,"h6",22),s(11,"Klassencode:"),a(),r(12,"div",23)(13,"mat-form-field",24)(14,"mat-label"),s(1
25,"Klassencode"),a(),p(16,"input",25),x(17,Aa,2,0,"mat-error",26)(18,Fa,2,0,"mat-error",26)(19,Da,2,0,"mat-error",26),a()()()(),r(20,"div",20)(21,"div",21)(22,"h6",22),s(23,"Klassenname:"),a(),r(24,"div",23)(25,"mat-form-field",24)(26,"mat-label"),s(27,"Klassenname"),a(),p(28,"input",27),x(29,ka,2,0,"mat-error",26)(30,Oa,2,0,"mat-error",26)(31,Na,2,0,"mat-error",26),a()()()(),r(32,"div",28)(33,"div",21)(34,"h6",22),s(35,"Klassenbeschreibung:"),a(),r(36,"div",23)(37,"mat-form-field",24)(38,"mat-label"),s(39,"Klassenbeschreibung"),a(),p(40,"textarea",29),a()()()(),r(41,"div",30)(42,"div",21)(43,"h6",22),s(44,"G\xFCltig von:"),a(),r(45,"div",23)(46,"mat-form-field",24)(47,"mat-label"),s(48,"G\xFCltig von"),a(),p(49,"input",31)(50,"mat-datepicker-toggle",32)(51,"mat-datepicker",null,1),x(53,Ga,2,0,"mat-error",26)(54,Ra,2,0,"mat-error",26),a()()()(),r(55,"div",30)(56,"div",21)(57,"h6",22),s(58,"G\xFCltig bis:"),a(),r(59,"div",23)(60,"mat-form-field",24)(61,"mat-label"),s(62,"G\xFCltig bis"),a(),p(63,"input",33)(64,"mat-datepicker-toggle",32)(65,"mat-datepicker",null,2),x(67,Va,2,0,"mat-error",26)(68,qa,2,0,"mat-error",26),a()()()(),r(69,"div",34)(70,"div",21)(71,"h6",22),s(72,"Status:"),a(),r(73,"div",35)(74,"div",36),p(75,"i",37),r(76,"span",38),s(77),a()(),r(78,"div")(79,"button",39),u("click",function(){h(e);let o=m();return f(o.toggleModalStatus())}),p(80,"i",40),s(81),a()()()()()()()()(),r(82,"div",41)(83,"button",42),u("click",function(){h(e);let o=M(1),d=m();return f(d.goNextStep1(o))}),s(84," Weiter "),a()()(),r(85,"mat-step",43),x(86,$a,1,6,"app-theory-lession",44),a(),r(87,"mat-step",45),x(88,Ba,1,7,"app-theory-lession",46),a()()}if(i&2){let e,n,o,d,g,v,T,W,G,ot,ft,yt,ye,zn,Un,Hn=M(52),Kn=M(66),re=m();c("linear",!0),l(5),c("formGroup",re.categoryFormGroup),l(12),c("ngIf",(e=re.categoryFormGroup.get("class_code"))==null?null:e.hasError("required")),l(),c("ngIf",(n=re.categoryFormGroup.get("class_code"))==null?null:n.hasError("maxlength")),l(),c("ngIf",(o=re.categoryFormGroup.get("class_code"))==null?null:o.hasError("specialChars")),l(10),c("ngIf",(d=re.categoryFormGroup.get("class_name"))==null?null:d.hasError("required")),l(),c("ngIf",(g=re.categoryFormGroup.get("class_name"))==null?null:g.hasError("maxlength")),l(),c("ngIf",(v=re.categoryFormGroup.get("class_name"))==null?null:v.hasError("specialChars")),l(18),c("matDatepicker",Hn),l(),c("for",Hn),l(3),c("ngIf",re.categoryFormGroup.hasError("dateRangeMissing")&&((T=re.categoryFormGroup.get("valid_from"))==null?null:T.touched)),l(),c("ngIf",re.categoryFormGroup.hasError("dateRangeInvalid")&&((W=re.categoryFormGroup.get("valid_from"))==null?null:W.touched)),l(9),c("matDatepicker",Kn),l(),c("for",Kn),l(3),c("ngIf",re.categoryFormGroup.hasError("dateRangeMissing")&&((G=re.categoryFormGroup.get("valid_to"))==null?null:G.touched)),l(),c("ngIf",re.categoryFormGroup.hasError("dateRangeInvalid")&&((ot=re.categoryFormGroup.get("valid_to"))==null?null:ot.touched)),l(7),c("ngClass",((ft=re.categoryFormGroup.get("status"))==null?null:ft.value)==="active"?"text-success":"text-danger"),l(2),L(" ",((yt=re.categoryFormGroup.get("status"))==null?null:yt.value)==="active"?"Aktiv":"Inaktiv"," "),l(2),c("ngClass",((ye=re.categoryFormGroup.get("status"))==null?null:ye.value)==="active"?"btn-danger":"btn-success"),l(),c("ngClass",((zn=re.categoryFormGroup.get("status"))==null?null:zn.value)==="active"?"fa-times-circle":"fa-check-circle"),l(),L(" ",((Un=re.categoryFormGroup.get("status"))==null?null:Un.value)==="active"?"Deaktivieren":"Aktivieren"," "),l(5),c("ngIf",re.theoryLoaded),l(2),c("ngIf",re.practicalLoaded)}}function Ua(i,t){i&1&&(r(0,"mat-error"),s(1," Klassencode ist erforderlich "),a())}function Ha(i,t){i&1&&(r(0,"mat-error"),s(1," Klassencode darf maximal 10 Zeichen lang sein "),a())}function Ka(i,t){i&1&&(r(0,"mat-error"),s(1," Sonderzeichen nicht erlaubt "),a())}function Qa(i,t){i&1&&(r(0,"mat-error"),s(1," Klassenname ist erforderlich "),a())}function ja(i,t){i&1&&(r(0,"mat-error"),s(1," Klassenname darf maximal 100 Zeichen lang sein "),a())}function Ya(i,t){i&1&&(r(0,"mat-error"),s(1," Sonderzeichen nicht erlaubt "),a())}function Ja(i,t){i&1&&(r(0,"mat-error"),s(1," Beide Datumsfelder m\xFCssen ausgef\xFCllt werden "),a())}function Wa(i,t){i&1&&(r(0,"mat-error"),s(1,' "G\xFCltig bis" muss nach "G\xFCltig von" liegen '),a())}function Xa(i,t){i&1&&(r(0,"mat-error"),s(1," Beide Datumsfelder m\xFCssen ausgef\xFCllt werden "),a())}function Za(i,t){i&1&&(r(0,"mat-error"),s(1,' "G\xFCltig bis" muss nach "G\xFCltig von" liegen '),a())}function er(i,t){if(i&1&&(r(0,"div",54)(1,"div",17)(2,"div",18)(3,"div",19)(4,"div",20)(5,"div",21)(6,"h6",22),s(7,"Klassencode:"),a(),r(8,"div",23)(9,"mat-form-field",24)(10,"mat-label"),s(11,"Klassencode"),a(),p(12,"input",25),x(13,Ua,2,0,"mat-error",26)(14,Ha,2,0,"mat-error",26)(15,Ka,2,0,"mat-error",26),a()()()(),r(16,"div",20)(17,"div",21)(18,"h6",22),s(19,"Klassenname:"),a(),r(20,"div",23)(21,"mat-form-field",24)(22,"mat-label"),s(23,"Klassenname"),a(),p(24,"input",27),x(25,Qa,2,0,"mat-error",26)(26,ja,2,0,"mat-error",26)(27,Ya,2,0,"mat-error",26),a()()()(),r(28,"div",28)(29,"div",21)(30,"h6",22),s(31,"Klassenbeschreibung:"),a(),r(32,"div",23)(33,"mat-form-field",24)(34,"mat-label"),s(35,"Klassenbeschreibung"),a(),p(36,"textarea",29),a()()()(),r(37,"div",30)(38,"div",21)(39,"h6",22),s(40,"G\xFCltig von:"),a(),r(41,"div",23)(42,"mat-form-field",24)(43,"mat-label"),s(44,"G\xFCltig von"),a(),p(45,"input",31)(46,"mat-datepicker-toggle",32)(47,"mat-datepicker",null,3),x(49,Ja,2,0,"mat-error",26)(50,Wa,2,0,"mat-error",26),a()()()(),r(51,"div",30)(52,"div",21)(53,"h6",22),s(54,"G\xFCltig bis:"),a(),r(55,"div",23)(56,"mat-form-field",24)(57,"mat-label"),s(58,"G\xFCltig bis"),a(),p(
259,"input",33)(60,"mat-datepicker-toggle",32)(61,"mat-datepicker",null,4),x(63,Xa,2,0,"mat-error",26)(64,Za,2,0,"mat-error",26),a()()()()()()()()),i&2){let e,n,o,d,g,v,T,W,G,ot,ft=M(48),yt=M(62),ye=m(2);l(),c("formGroup",ye.categoryFormGroup),l(12),c("ngIf",(e=ye.categoryFormGroup.get("class_code"))==null?null:e.hasError("required")),l(),c("ngIf",(n=ye.categoryFormGroup.get("class_code"))==null?null:n.hasError("maxlength")),l(),c("ngIf",(o=ye.categoryFormGroup.get("class_code"))==null?null:o.hasError("specialChars")),l(10),c("ngIf",(d=ye.categoryFormGroup.get("class_name"))==null?null:d.hasError("required")),l(),c("ngIf",(g=ye.categoryFormGroup.get("class_name"))==null?null:g.hasError("maxlength")),l(),c("ngIf",(v=ye.categoryFormGroup.get("class_name"))==null?null:v.hasError("specialChars")),l(18),c("matDatepicker",ft),l(),c("for",ft),l(3),c("ngIf",ye.categoryFormGroup.hasError("dateRangeMissing")&&((T=ye.categoryFormGroup.get("valid_from"))==null?null:T.touched)),l(),c("ngIf",ye.categoryFormGroup.hasError("dateRangeInvalid")&&((W=ye.categoryFormGroup.get("valid_from"))==null?null:W.touched)),l(9),c("matDatepicker",yt),l(),c("for",yt),l(3),c("ngIf",ye.categoryFormGroup.hasError("dateRangeMissing")&&((G=ye.categoryFormGroup.get("valid_to"))==null?null:G.touched)),l(),c("ngIf",ye.categoryFormGroup.hasError("dateRangeInvalid")&&((ot=ye.categoryFormGroup.get("valid_to"))==null?null:ot.touched))}}function tr(i,t){if(i&1&&p(0,"app-theory-lession",56),i&2){let e=m(3);c("showStepperNav",!1)("saveHandler",e.saveCategoryHandler)("countryId",e.data.countryId)("licenseClassId",e.categoryFormGroup.value._id)("frameworkType","THEORY")("enablePriorPossessionSettings",!0)}}function nr(i,t){if(i&1&&x(0,tr,1,6,"app-theory-lession",55),i&2){let e=m(2);c("ngIf",e.theoryLoaded)}}function ir(i,t){if(i&1&&p(0,"app-theory-lession",58),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("saveHandler",e.saveCategoryHandler)("countryId",e.data.countryId)("licenseClassId",e.categoryFormGroup.value._id)("frameworkType","PRACTICAL")("enablePriorPossessionSettings",!0)}}function ar(i,t){if(i&1&&x(0,ir,1,7,"app-theory-lession",57),i&2){let e=m(2);c("ngIf",e.practicalLoaded)}}function rr(i,t){if(i&1){let e=E();r(0,"mat-tab-group",49),u("selectedTabChange",function(o){h(e);let d=m();return f(d.onEditTabChange(o))}),r(1,"mat-tab",15),x(2,er,65,15,"ng-template",50),a(),r(3,"mat-tab",43),x(4,nr,1,1,"ng-template",50),a(),r(5,"mat-tab",51),x(6,ar,1,1,"ng-template",50),a()(),r(7,"div",52)(8,"button",53),u("click",function(){h(e);let o=m();return f(o.saveCategory())}),s(9,"Speichern"),a()()}}var jt=class i{constructor(t,e,n,o,d){this.fb=t;this.userService=e;this.sweetAlert=n;this.dialogRef=o;this.data=d;this.isEditMode=!1;this.saveCategoryHandler=()=>{this.saveCategory()};this.lessonStateService=b(fe);this.theoryLessonsService=b(q);this.showLoader=w(!1);this.theoryLoaded=!1;this.practicalLoaded=!1}noSpecialCharsClassCode(t){return t.value?/^[a-zA-Z0-9\s-]+$/.test(t.value)?null:{specialChars:!0}:null}noSpecialCharsClassName(t){return t.value?/^[a-zA-Z0-9\s\-äöüÄÖÜß.,()]+$/.test(t.value)?null:{specialChars:!0}:null}dateRangeValidator(t){let e=t.get("valid_from")?.value,n=t.get("valid_to")?.value;if(e&&!n||!e&&n)return{dateRangeMissing:!0};if(e&&n){let o=new Date(e);if(new Date(n)<=o)return{dateRangeInvalid:!0}}return null}ngOnInit(){this.categoryFormGroup=this.fb.group({_id:[""],class_code:["",[_.required,_.pattern(/^(?!\s*$).+/),_.maxLength(10),this.noSpecialCharsClassCode.bind(this)]],class_name:["",[_.required,_.pattern(/^(?!\s*$).+/),_.maxLength(100),this.noSpecialCharsClassName.bind(this)]],class_description:[""],valid_from:[""],valid_to:[""],status:["active"]},{validators:this.dateRangeValidator.bind(this)}),this.data?.category&&(this.categoryFormGroup.patchValue(this.data.category),this.categoryFormGroup.markAsPristine(),this.isEditMode=!0,rt(this.lessonStateService,this.data.category),this.preloadExistingLessons(this.data.category._id)),console.log("categoryFormGroup",this.isEditMode)}preloadExistingLessons(t){if(!t||!this.data.countryId)return;let e=n=>this.theoryLessonsService.getDrivingLicenseClasses(this.data.countryId,{license_class_id:t,framework_type:n,page:1,limit:1e3,filter_status:"ALL"}).pipe(pe(()=>be({data:[]})));He({theory:e("THEORY"),practical:e("PRACTICAL")}).subscribe(({theory:n,practical:o})=>{this.lessonStateService.seedLessons([...Kt(n?.data,"THEORY"),...Kt(o?.data,"PRACTICAL")])})}closeCategory(){me(this.sweetAlert,this.categoryFormGroup.dirty||this.lessonStateService.isDirty(),()=>this.dialogRef.close(!1))}toggleModalStatus(){let e=this.categoryFormGroup.get("status")?.value==="active"?"inactive":"active";this.categoryFormGroup.patchValue({status:e}),this.categoryFormGroup.markAsDirty()}saveCategory(){return ze(this,null,function*(){if(this.categoryFormGroup.invalid){Object.keys(this.categoryFormGroup.controls).forEac
2h(T=>{this.categoryFormGroup.get(T)?.markAsTouched()});let o=this.categoryFormGroup.errors,d=this.categoryFormGroup.get("class_code"),g=this.categoryFormGroup.get("class_name"),v="Bitte f\xFCllen Sie alle Pflichtfelder korrekt aus.";d?.hasError("pattern")||g?.hasError("pattern")?v="Pflichtfelder d\xFCrfen nicht leer oder nur aus Leerzeichen bestehen.":o?.dateRangeMissing?v='Wenn "G\xFCltig von" oder "G\xFCltig bis" gesetzt ist, m\xFCssen beide Felder ausgef\xFCllt werden.':o?.dateRangeInvalid&&(v='Das "G\xFCltig bis"-Datum muss nach dem "G\xFCltig von"-Datum liegen.'),this.sweetAlert.custom({type:"warning",title:"Pflichtfelder erforderlich",content:v,isHtml:!1,showCancel:!1,confirmText:"OK",confirmButtonClass:"btn-warning"}).subscribe();return}if(this.isEditMode&&!this.categoryFormGroup.dirty&&!this.theoryLoaded&&!this.practicalLoaded){this.sweetAlert.custom({type:"warning",title:"Keine \xC4nderungen",content:"Keine \xC4nderungen vorgenommen. Bitte \xE4ndern Sie ein Feld, um zu speichern.",isHtml:!1,showCancel:!1,confirmText:"OK",confirmButtonClass:"btn-warning"}).subscribe();return}if(!this.data?.countryId){this.sweetAlert.custom({type:"error",title:"Fehler",content:"Land-ID nicht gefunden. Bitte melden Sie sich erneut an.",isHtml:!1,showCancel:!1,confirmText:"OK",confirmButtonClass:"btn-cancel"}).subscribe();return}if(this.showLoader.set(!0),!this.isEditMode)try{let o=[];this.theoryLoaded&&o.push("THEORY"),this.practicalLoaded&&o.push("PRACTICAL"),o.length===0&&o.push("THEORY","PRACTICAL"),yield wi({theoryLessonsService:this.theoryLessonsService,lessonStateService:this.lessonStateService,countryId:this.data.countryId,frameworkTypes:o}),this.lessonStateService.autoSyncAllCreateSettingsFromIncludedLessons()}catch(o){this.showLoader.set(!1),console.error("Failed to seed all lessons for settings count",o),this.sweetAlert.custom({type:"error",title:"Fehler",content:"Die Lektionen konnten nicht vollst\xE4ndig geladen werden. Bitte versuchen Sie es erneut.",isHtml:!1,showCancel:!1,confirmText:"OK",confirmButtonClass:"btn-cancel"}).subscribe();return}let t=this.categoryFormGroup.value,e=!this.isEditMode||this.theoryLoaded||this.practicalLoaded,n=bi(t,this.data.countryId,this.lessonStateService.getLessons(),this.lessonStateService.getLicenseClassSettings(),e);if(console.log("Payload categoryData",n),t._id){let o=t._id;this.userService.updateDrivingLicenseClass(o,n).subscribe({next:()=>this.handleSaveSuccess(),error:d=>this.handleSaveError(d)});return}this.userService.createDrivingLicenseClass(n).subscribe({next:()=>this.handleSaveSuccess(),error:o=>this.handleSaveError(o)})})}handleSaveSuccess(){this.showLoader.set(!1),this.lessonStateService.markClean(),this.sweetAlert.custom({type:"success",title:"Erfolgreich gespeichert",content:"Die F\xFChrerscheinklasse wurde erfolgreich gespeichert.",isHtml:!1,showCancel:!1,confirmText:"OK",confirmButtonClass:"btn-success"}).subscribe(()=>this.dialogRef.close(!0))}handleSaveError(t){this.showLoader.set(!1);let e=t.error?.message||"Beim Speichern der Klasse ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.";this.sweetAlert.custom({type:"error",title:"Speichern fehlgeschlagen",content:e,isHtml:!1,showCancel:!1,confirmText:"OK",confirmButtonClass:"btn-cancel"}).subscribe()}onStepChange(t){t.selectedIndex===1&&(this.theoryLoaded=!0),t.selectedIndex===2&&(this.practicalLoaded=!0)}onEditTabChange(t){t.index===1&&(this.theoryLoaded=!0),t.index===2&&(this.practicalLoaded=!0)}goNextStep1(t){t.next()}get classTitle(){let t=this.categoryFormGroup.get("class_code")?.value||"",e=this.categoryFormGroup.get("class_name")?.value||"";return`Klasse ${t} \u2013 ${e}`}static{this.\u0275fac=function(e){return new(e||i)(B(Q),B(le),B(O),B(te),B(ne))}}static{this.\u0275cmp=P({type:i,selectors:[["app-add-dlform"]],features:[Ke([fe])],decls:11,vars:3,consts:[["stepper",""],["pickerFrom",""],["pickerTo",""],["pickerFromEdit",""],["pickerToEdit",""],[1,"add-dlform-modal"],[1,"modal-content"],[1,"custom-mat-modal-header"],[1,"title"],["type","button",1,"btn-close",3,"click"],[1,"custom-mat-modal-body"],[1,"custom-stepper",3,"linear"],[3,"visible"],[1,"custom-stepper",3,"selectionChange","linear"],["matStepperIcon","edit"],["label","Allgemeine Informationen"],[1,"modal-body"],[1,"row","m-0",3,"formGroup"],[1,"col-sm-12"],[1,"row","pb-2","d-flex","justify-content-between"],[1,"col-md-6","col-sm-12","custom-padding"],[1,"field-heading-parent"],[1,"field-heading","mb-2"],[1,"px-2"],["appearance","outline",1,"w-100","bg-white"],["type","text","matInput","","formControlName","class_code","placeholder","z.B. B, BE, A1, A2, C, CE ...","maxlength","10"],[4,"ngIf"],["type","text","matInput","","formControlName","class_name","placeholder","z.B. Pkw, Motorrad, Lkw ...","maxlength","100"],[1,"col-sm-12","custom-padding","mt-3"],["matInput","","formControlName","class_description","placeholder","Beschreibung der F\xFChrerscheinklasse ...","rows","3"],[1,"col-md-6","col-sm-12","custom-padding","mt-3"],["matInput","","formControlName","valid_from","placeholder","TT.MM.JJJJ",3,"matDatepicker"],["matSuffix","",3,"for"],["matInput","","formControlName","valid_to","placeholder","TT.MM.JJJJ",3,"matDatepicker"],[1,"col-sm-12","mt-3","d-none"],[1,"px-2","d-flex","align-items-center"],[1,"mr-3"],[1,"fa","fa-circle",3,"ngClass"],[1,"ml-2","font-weight-bold"],["type","button",1,"btn","btn-sm",3,"click","ngClass"],[1,"fa",3,"ngClass"],[1,"stepper-buttons"],["type","button",1,"primary-button","mt-4",2,"margin-left","auto",3,"click"],["label","Theorieanforderungen"],[3,"stepper","showStepperNav","countryId","frameworkType","enablePriorPossessionSettings","autoDeriveSettings",4,"ngIf"],["label","Praktische Anforderungen "],[3,"stepper","showStepperNav","countryId","frameworkType","saveHandler","enablePriorPossessionSettings","autoDeriveSettings",4,"ngIf"],[3,"stepper","showStepperNav","countryId","frameworkType","enablePriorPossessionSettings","autoDeriveSettings"],[3,"stepper","showStepperNav","countryId","frameworkType","saveHandler","enablePriorPossessionSettings","autoDeriveSettings"],["mat-stretch-tabs","false","mat-align-tabs","start",1,"custom-stepper",3,"selectedTabChange"],["matTabContent",""],["label","Praktische Anforderungen"],[1,"stepper-buttons","d-flex","justify-content-end","mt-3","p-3"],["type","button",1,"primary-button",3,"click"],[1,"modal-body","mt-3"],[3,"showStepperNav","saveHandler","countryId","licenseClassId","frameworkType","enablePriorPossessionSettings",4,"ngIf"],[3,"showStepperNav","saveHandler","countryId","licenseClassId","frameworkType","enablePriorPossessionSettings"],[3,"showStepperNav","showInfoMessage","saveHandler","countryId","licenseClassId","frameworkType","enablePriorPossessionSettings",4,"ngIf"],[3,"showStepperNav","showInfoMessage","saveHandler","countryId","licenseClassId","frameworkType","enablePriorPossessionSettings"]],template:function(e,n){e&1&&(r(0,"div",5)(1,"div",6)(2,"div",7)(3,"h2",8),s(4),a(),r(5,"button",9),u("click",function(){return n.closeCategory()}),s(6,"\xD7"),a()(),r(7,"div",10),y(8,za,89,23,"mat-stepper",11)(9,rr,10,0),a()()(),p(10,"app-loader",12)),e&2&&(l(4),L(" ",n.categoryFormGroup.value._id?n.classTitle:"F\xFChrerscheinklassen hinzuf\xFCgen:"," "),l(4),C(n.isEditMode?9:8),l(2),c("visible",n.showLoader()))},dependencies:[Se,Re,Ve,N,R,V,U,qe,K,H,D,wt,Fe,De,Lt,Mt,Tt,ke,Y,j,_e,ce,J,tn,nn,an,$e,ae],styles:[".add-dlform-modal[_ngcontent-%COMP%]     .mat-mdc-tab-body-content{overflow:hidden!important}
2.custom-mat-modal-body[_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%]{padding:0!important}.custom-padding[_ngcontent-%COMP%]{padding:0 0 0 10px!important}.mat-horizontal-content-container[_ngcontent-%COMP%]{padding:0 12px 24px 24px!important}"]})}};var Mi=(i,t)=>t.value;function or(i,t){i&1&&(r(0,"mat-error"),s(1,"Stundenname ist erforderlich"),a())}function sr(i,t){if(i&1&&(r(0,"mat-option",23),s(1),a()),i&2){let e=t.$implicit;c("value",e.value),l(),S(e.label)}}function lr(i,t){i&1&&(r(0,"mat-error"),s(1,"Kategorie ist erforderlich"),a())}function dr(i,t){if(i&1&&(r(0,"mat-option",23),s(1),a()),i&2){let e=t.$implicit;c("value",e.value),l(),S(e.label)}}function cr(i,t){if(i&1){let e=E();r(0,"button",32),s(1),r(2,"img",33),u("click",function(){let o=h(e).$implicit,d=m(2);return f(d.removeDeliveryMethod(o))}),a()()}if(i&2){let e=t.$implicit,n=m(2);l(),L(" ",n.getDeliveryMethodLabel(e)," ")}}function mr(i,t){if(i&1&&A(0,cr,3,1,"button",32,Ce),i&2){let e=m();F(e.selectedDeliveryMethods())}}function pr(i,t){i&1&&p(0,"app-no-data",28),i&2&&c("message","Liefermethode wurde noch nicht ausgew\xE4hlt")}var yn=class i{constructor(){this.dialogRef=b(te);this.data=b(ne);this.fb=b(Q);this.sweetAlert=b(O);this.theoryLessonsService=b(q);this.showLoader=w(!1);this.selectedDeliveryMethods=w([]);this.deliveryMethodOptions=Ze;this.categoryOptions=pt;this.ERROR_MESSAGES=we}ngOnInit(){this.lessonForm=this.fb.group({lesson_name:["",[_.required,_.maxLength(200)]],hours:[0,[_.min(0)]],minutes:[0,[_.min(0),_.max(59)]],isActive:[!0],category:["",_.required]})}onDeliveryMethodsChange(t){let e=this.deliveryMethodOptions.filter(n=>n.value!=="ALL").map(n=>n.value);if(t?.includes("ALL")){let n=e.every(o=>this.selectedDeliveryMethods().includes(o));this.selectedDeliveryMethods.set(n?[]:[...e]);return}this.selectedDeliveryMethods.set(t?.filter(n=>n!=="ALL")??[])}getDeliveryMethodLabel(t){return it(t)}removeDeliveryMethod(t){this.selectedDeliveryMethods.update(e=>e.filter(n=>n!==t))}saveLesson(){if(this.lessonForm.invalid){this.lessonForm.markAllAsTouched(),this.showValidationError("Bitte f\xFCllen Sie alle Pflichtfelder korrekt aus.");return}if(!this.selectedDeliveryMethods().length){this.showValidationError("Bitte w\xE4hlen Sie mindestens eine Liefermethode aus.");return}let t=this.lessonForm.value;if(at(t.hours,t.minutes)<=0){this.showValidationError("Bitte geben Sie eine g\xFCltige Dauer ein.");return}if(!this.data?.countryId){this.showValidationError("Land-ID nicht gefunden. Bitte melden Sie sich erneut an.");return}let n=ut({lesson_name:t.lesson_name?.trim(),category:t.category,hours:t.hours,minutes:t.minutes,delivery_methods:this.selectedDeliveryMethods(),isActive:!!t.isActive,country_id:this.data.countryId,framework_type:this.data.lessonType??"THEORY"});this.showLoader.set(!0),this.theoryLessonsService.createTrainingLesson(n).subscribe({next:o=>{this.showLoader.set(!1),this.sweetAlert.success("Erfolgreich gespeichert",ht(o,"Die Theorieeinheit wurde erfolgreich gespeichert."),"OK").subscribe(()=>this.dialogRef.close(!0))},error:o=>{this.showLoader.set(!1);let d=o?.error?.errorCode,g=d?this.ERROR_MESSAGES[d]:"";this.sweetAlert.error("Fehler",g||"Beim Speichern der Theorieeinheit ist ein Fehler aufgetreten.","OK").subscribe()}})}closeModal(){me(this.sweetAlert,gt(this.lessonForm.dirty,this.selectedDeliveryMethods()),()=>this.dialogRef.close(!1))}showValidationError(t){this.sweetAlert.warning("Pflichtfelder erforderlich",t,"OK").subscribe()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-add-theory-lesson"]],decls:82,vars:6,consts:[[1,"modal-content"],[1,"custom-mat-modal-header"],[1,"title"],["type","button",1,"btn-close",3,"click"],["src","../../../assets/closeModel.svg","alt","closeModel",2,"height","20px"],[3,"ngSubmit","formGroup"],[1,"modal-body"],[1,"row"],[1,"col-md-6","d-flex","flex-column"],[1,"mb-3"],[1,"field-heading-parent"],[1,"field-heading"],[1,"p-2"],["appearance","outline",1,"w-100"],["matInput","","placeholder","Stundenname","formControlName","lesson_name"],[1,"col-6"],["matInput","","type","number","min","0","formControlName","hours"],["matTextSuffix",""],["matInput","","type","number","min","0","max","59","formControlName","minutes"],[1,"p-3"],["formControlName","isActive"],[1,"col-md-6"],["formControlName","category"],[3,"value"],["multiple","",3,"selectionChange","value"],[1,"mt-2"],[1,"fw-medium"],[1,"scroll-main-div"],[3,"message"],[1,"modal-footer"],["type","submit",1,"btn","primary-button"],[3,"visible"],["type","button",1,"btn","button-primary","delivery-method-btn","mr-2","mb-2"],["src","../assets/closeModel.svg","alt","Close","width","10","height","10",1,"ms-2",3,"click"]],template:function(e,n){if(e&1&&(r(0,"div",0)(1,"div",1)(2,"h2",2),s(3,"Theorieeinheit hinzuf\xFCgen"),a(),r(4,"button",3),u("click",function(){return n.closeModal()}),p(5,"img",4),a()(),r(6,"form",5),u("ngSubmit",function(){return n.saveLesson()}),r(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"h6",11),s(13,"Stundenname :"),a(),r(14,"div",12)(15,"mat-form-field",13)(16,"mat-label"),s(17,"Stundenname"),a(),p(18,"input",14),y(19,or,2,0,"mat-error"),a()()()(),r(20,"div",9)(21,"div",10)(22,"h6",11),s(23,"Dauer :"),a(),r(24,"div",12)(25,"div",7)(26,"div",15)(27,"mat-form-field",13)(28,"mat-label"),s(29,"Stunden"),a(),p(30,"input",16),r(31,"span",17),s(32,"Stunde"),a()()(),r(33,"div",15)(34,"mat-form-field",13)(35,"mat-label"),s(36,"Minuten"),a(),p(37,"input",18),r(38,"span",17),s(39,"Minute"),a()()()()()()(),r(40,"div",9)(41,"div",10)(42,"h6",11),s(43,"Status :"),a(),r(44,"div",19)(45,"mat-slide-toggle",20),s(46," Status Aktiv ? "),a()()()()(),r(47,"div",21)(48,"div",9)(49,"div",10)(50,"h6",11),s(51,"Kategorie :"),a(),r(52,"div",12)(53,"mat-form-field",13)(54,"mat-label"),s(55,"Kategorie"),a(),r(56,"mat-select",22),A(57,sr,2,2,"mat-option",23,Mi),a(),y(59,lr,2,0,"mat-error"),a()()()(),r(60,"div",9)(61,"div",10)(62,"h6",11),s(63,"Liefermethode :"),a(),r(64,"div",12)(65,"mat-form-field",13)(66,"mat-label"),s(67,"Liefermethode"),a(),r(68,"mat-select",24),u("selectionChange",function(d){return n.onDeliveryMethodsChange(d.value)}),A(69,dr,2,2,"mat-option",23,Mi),a()(),r(71,"div",25)(72,"label",26),s(73,"Ausgew\xE4hlte Liefermethode :"),a(),r(74,"div",12)(75,"div",27),y(76,mr,2,0)(77,pr,1,1,"app-no-data",28),a()()()()()()()()(),r(78,"div",29)(79,"button",30),s(80," Speichern "),a()()()(),p(81,"app-loader",31)),e&2){let o,d;l(6),c("formGroup",n.lessonForm),l(13),C((o=n.lessonForm.get("lesson_name"))!=null&&o.invalid&&((o=n.lessonForm.get("lesson_name"))!=null&&o.touched)?19:-1),l(38),F(n.categoryOptions),l(2),C((d=n.lessonForm.get("category"))!=null&&d.invalid&&((d=n.lessonForm.get("category"))!=null&&d.touched)?59:-1),l(9),c("value",n.selectedDeliveryMethods()),l(),F(n.deliveryMethodOptions),l(7),C(n.selectedDeliveryMethods().length>0?76:77),l(5),c("visible",n.showLoader())}},dependencies:[ae,D,Y,j,_e,ce,J,Oe,de,ie,ee,N,Pe,R,oe,V,U,se,mt,K,H],styles:[".delivery-method-btn[_ngcontent-%COMP%]:hover   img[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}"]})}};var Ii=(i,t)=>t.value;function ur(i,t){i&1&&(r(0,"mat-error"),s(1,"Stundenname ist erforderlich"),a())}function gr(i,t){if(i&1&&(r(0,"mat-option",23),s(1),a()),i&2){let e=t.$implicit;c("value",e.value),l(),S(e.label)}}function _r(i,t){i&1&&(r(0,"mat-error"),s(1,"Kategorie ist erforderlich"),a())}function hr(i,t){if(i&1&&(r(0,"mat-option",23),s(1),a()),i&2){let e=t.$implicit;c("value",e.value),l(),S(e.label)}}function fr(i,t){if(i&1){let e=E();r(0,"button",32),s(1),r(2,"img",33),u("click",function(){let o=h(e).$implicit,d=m(2);return f(d.removeDeliveryMethod(o))}),a()()}if(i&2){let e=t.$implicit,n=m(2);l(),L(" ",n.getDeliveryMethodLabel(e)," ")}}function yr(i,t){if(i&1&&A(0,fr,3,1,"button",32,Ce),i&2){let e=m();F(e.selectedDeliveryMethods())}}function Cr(i,t){i&1&&p(0,"app-no-data",28),i&2&&c("message","Liefermethode wurde noch nicht ausgew\xE4hlt")}var Cn=class i{constructor(){this.dialogRef=b(te);this.data=b(ne);
2this.fb=b(Q);this.sweetAlert=b(O);this.theoryLessonsService=b(q);this.showLoader=w(!1);this.selectedDeliveryMethods=w([]);this.deliveryMethodOptions=Ze;this.categoryOptions=pt;this.ERROR_MESSAGES=we}ngOnInit(){this.lessonForm=this.fb.group({lesson_name:["",[_.required,_.maxLength(200)]],hours:[0,[_.min(0)]],minutes:[0,[_.min(0),_.max(59)]],isActive:[!0],category:["",_.required]})}onDeliveryMethodsChange(t){let e=this.deliveryMethodOptions.filter(n=>n.value!=="ALL").map(n=>n.value);if(t?.includes("ALL")){let n=e.every(o=>this.selectedDeliveryMethods().includes(o));this.selectedDeliveryMethods.set(n?[]:[...e]);return}this.selectedDeliveryMethods.set(t?.filter(n=>n!=="ALL")??[])}getDeliveryMethodLabel(t){return it(t)}removeDeliveryMethod(t){this.selectedDeliveryMethods.update(e=>e.filter(n=>n!==t))}saveLesson(){if(this.lessonForm.invalid){this.lessonForm.markAllAsTouched(),this.showValidationError("Bitte f\xFCllen Sie alle Pflichtfelder korrekt aus.");return}if(!this.selectedDeliveryMethods().length){this.showValidationError("Bitte w\xE4hlen Sie mindestens eine Liefermethode aus.");return}let t=this.lessonForm.value;if(at(t.hours,t.minutes)<=0){this.showValidationError("Bitte geben Sie eine g\xFCltige Dauer ein.");return}if(!this.data?.countryId){this.showValidationError("Land-ID nicht gefunden. Bitte melden Sie sich erneut an.");return}let n=ut({lesson_name:t.lesson_name?.trim(),category:t.category,hours:t.hours,minutes:t.minutes,delivery_methods:this.selectedDeliveryMethods(),isActive:!!t.isActive,country_id:this.data.countryId,framework_type:this.data.lessonType??"PRACTICAL"});this.showLoader.set(!0),this.theoryLessonsService.createTrainingLesson(n).subscribe({next:o=>{this.showLoader.set(!1),this.sweetAlert.success("Erfolgreich gespeichert",ht(o,"Die Fahrstunde wurde erfolgreich gespeichert."),"OK").subscribe(()=>this.dialogRef.close(!0))},error:o=>{this.showLoader.set(!1);let d=o?.error?.errorCode,g=d?this.ERROR_MESSAGES[d]:"";this.sweetAlert.error("Fehler",g||"Beim Speichern der Fahrstunde ist ein Fehler aufgetreten.","OK").subscribe()}})}closeModal(){me(this.sweetAlert,gt(this.lessonForm.dirty,this.selectedDeliveryMethods()),()=>this.dialogRef.close(!1))}showValidationError(t){this.sweetAlert.warning("Pflichtfelder erforderlich",t,"OK").subscribe()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-add-practical-lesson"]],decls:82,vars:6,consts:[[1,"modal-content"],[1,"custom-mat-modal-header"],[1,"title"],["type","button",1,"btn-close",3,"click"],["src","../../../assets/closeModel.svg","alt","closeModel",2,"height","20px"],[3,"ngSubmit","formGroup"],[1,"modal-body"],[1,"row"],[1,"col-md-6","d-flex","flex-column"],[1,"mb-3"],[1,"field-heading-parent"],[1,"field-heading"],[1,"p-2"],["appearance","outline",1,"w-100"],["matInput","","placeholder","Stundenname","formControlName","lesson_name"],[1,"col-6"],["matInput","","type","number","min","0","formControlName","hours"],["matTextSuffix",""],["matInput","","type","number","min","0","max","59","formControlName","minutes"],[1,"p-3"],["formControlName","isActive"],[1,"col-md-6"],["formControlName","category"],[3,"value"],["multiple","",3,"selectionChange","value"],[1,"mt-2"],[1,"fw-medium"],[1,"scroll-main-div"],[3,"message"],[1,"modal-footer"],["type","submit",1,"btn","primary-button"],[3,"visible"],["type","button",1,"btn","button-primary","delivery-method-btn","mr-2","mb-2"],["src","../assets/closeModel.svg","alt","Close","width","10","height","10",1,"ms-2",3,"click"]],template:function(e,n){if(e&1&&(r(0,"div",0)(1,"div",1)(2,"h2",2),s(3,"Fahrstunde hinzuf\xFCgen"),a(),r(4,"button",3),u("click",function(){return n.closeModal()}),p(5,"img",4),a()(),r(6,"form",5),u("ngSubmit",function(){return n.saveLesson()}),r(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"h6",11),s(13,"Stundenname :"),a(),r(14,"div",12)(15,"mat-form-field",13)(16,"mat-label"),s(17,"Stundenname"),a(),p(18,"input",14),y(19,ur,2,0,"mat-error"),a()()()(),r(20,"div",9)(21,"div",10)(22,"h6",11),s(23,"Dauer :"),a(),r(24,"div",12)(25,"div",7)(26,"div",15)(27,"mat-form-field",13)(28,"mat-label"),s(29,"Stunden"),a(),p(30,"input",16),r(31,"span",17),s(32,"Stunde"),a()()(),r(33,"div",15)(34,"mat-form-field",13)(35,"mat-label"),s(36,"Minuten"),a(),p(37,"input",18),r(38,"span",17),s(39,"Minute"),a()()()()()()(),r(40,"div",9)(41,"div",10)(42,"h6",11),s(43,"Status :"),a(),r(44,"div",19)(45,"mat-slide-toggle",20),s(46," Status Aktiv ? "),a()()()()(),r(47,"div",21)(48,"div",9)(49,"div",10)(50,"h6",11),s(51,"Kategorie :"),a(),r(52,"div",12)(53,"mat-form-field",13)(54,"mat-label"),s(55,"Kategorie"),a(),r(56,"mat-select",22),A(57,gr,2,2,"mat-option",23,Ii),a(),y(59,_r,2,0,"mat-error"),a()()()(),r(60,"div",9)(61,"div",10)(62,"h6",11),s(63,"Liefermethode :"),a(),r(64,"div",12)(65,"mat-form-field",13)(66,"mat-label"),s(67,"Liefermethode"),a(),r(68,"mat-select",24),u("selectionChange",function(d){return n.onDeliveryMethodsChange(d.value)}),A(69,hr,2,2,"mat-option",23,Ii),a()(),r(71,"div",25)(72,"label",26),s(73,"Ausgew\xE4hlte Liefermethode :"),a(),r(74,"div",12)(75,"div",27),y(76,yr,2,0)(77,Cr,1,1,"app-no-data",28),a()()()()()()()()(),r(78,"div",29)(79,"button",30),s(80," Speichern "),a()()()(),p(81,"app-loader",31)),e&2){let o,d;l(6),c("formGroup",n.lessonForm),l(13),C((o=n.lessonForm.get("lesson_name"))!=null&&o.invalid&&((o=n.lessonForm.get("lesson_name"))!=null&&o.touched)?19:-1),l(38),F(n.categoryOptions),l(2),C((d=n.lessonForm.get("category"))!=null&&d.invalid&&((d=n.lessonForm.get("category"))!=null&&d.touched)?59:-1),l(9),c("value",n.selectedDeliveryMethods()),l(),F(n.deliveryMethodOptions),l(7),C(n.selectedDeliveryMethods().length>0?76:77),l(5),c("visible",n.showLoader())}},dependencies:[ae,D,Y,j,_e,ce,J,Oe,de,ie,ee,N,Pe,R,oe,V,U,se,mt,K,H],styles:[".delivery-method-btn[_ngcontent-%COMP%]:hover   img[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}"]})}};var vn=i=>({disabled:i}),vr=i=>({active:i});function br(i,t){if(i&1){let e=E();r(0,"button",37),u("click",function(){h(e);let o=m().$implicit,d=m();return f(d.updateStatus(o))}),s(1," Aktivieren "),a()}}function xr(i,t){if(i&1){let e=E();r(0,"button",38),u("click",function(){h(e);let o=m().$implicit,d=m();return f(d.updateStatus(o))}),s(1," Deaktivieren "),a()}}function Sr(i,t){if(i&1){let e=E();r(0,"tr")(1,"td",28),s(2),a(),r(3,"td",29),s(4),a(),r(5,"td",30),s(6),a(),r(7,"td",30),s(8),a(),r(9,"td",30),s(10),a(),r(11,"td",30),p(12,"span"),a(),r(13,"td",31)(14,"div",32)(15,"button",33),u("click",function(){let o=h(e).$implicit,d=m();return f(d.editLesson(o))}),s(16," \xD6ffnen "),a(),r(17,"button",34)(18,"mat-icon"),s(19,"menu"),a()(),r(20,"mat-menu",null,1),y(22,br,2,0,"button",35),y(23,xr,2,0,"button",36),a()()()()}if(i&2){let e=t.$implicit,n=t.index,o=M(21),d=m();l(2),S(d.startRecord()+n),l(2),S(e.lesson_name||"-"),l(2),S(e.category||"-"),l(2),S(d.formatDuration(e.duration)),l(2),S(e.delivery_method||"-"),l(2),lt(e.status==="active"?"status-bullet status-active":"status-bullet status-inactive"),l(5),c("matMenuTriggerFor",o),l(5),C(e.status!=="active"?22:-1),l(),C(e.status==="active"?23:-1)}}function Er(i,t){if(i&1&&(r(0,"tr")(1,"td",39),p(2,"app-no-data",40),a()()),i&2){let e=m();l(2),c("message",e.emptyMessage())}}function wr(i,t){if(i&1){let e=E();r(0,"li",42)(1,"a",43),u("click",function(){let o=h(e).$implicit,d=m(2);return f(d.setPage(o))}),s(2),a()()}if(i&2){let e=t.$implicit,n=m(2);c("ngClass",z(2,vr,n.pager().currentPage===e)),l(2),S(e)}}function Tr(i,t){if(i&1){let e=E();r(0,"ul",41)(1,"li",42)(2,"a",43),u("click",function(){h(e);let o=m();return f(o.setPage(1))}),s(3,"<<"),a()(),r(4,"li",42)(5,"a",43),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager().currentPage-1))}),s(6,"<"),a()(),x(7,wr,3,4,"li",44),r(8,"li",42)(9,"a",43),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager().currentPage+1))}),s(10,">"),a()(),r(11,"li",42)(12,"a",43),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager().totalPages))}),s(13,">>"),a()()()}if(i&2){let e=m();l(),c("ngClass",z(5,vn,e.pager().currentPage===1)),l(3),c("ngClass",z(7,vn,e.pager().currentPage===1)),l(3),c("ngForOf",e.pager().pages),l(),c("ngClass",z(9,vn,e.pager().currentPage===e.pager().totalPages)),l(3),c("ngClass",z(11,vn,e.pager().currentPage===e.pager().totalPages))}}var bn=class i{constructor(){this.countryId=ue("");this.lessonType=ue("THEORY");this.matDialog=b(je);this.userService=b(le);this.theoryLessonsService=b(q);this.sweetAlert=b(O);this.router=b(en);this.pagerService=b(Ae);this.pageSize=15;this.lessonList=w([]);this.searchQuery=w("");this.pagedItems=w([]);this.pager=w({});this.startRecord=w(0);this.endRecord=w(0);this.isHovering=w(!1);this.isPractical=()=>this.lessonType()==="PRACTICAL";this.searchPlaceholder=()=>this.isPractical()?"Nach Fahrstunde suchen...":"Nach Theoriestunde suchen...";this.addButtonLabel=()=>this.isPractical()?"Fahrstunde hinzuf\xFCgen":"Theorieeinheit hinzuf\xFCgen";this.emptyMessage=()=>this.isPractical()?"Keine Fahrstunden gefunden":"Keine Theoriestunden gefunden";this.reloadLessons=Et(()=>{this.countryId(),this.lessonType(),this.searchQuery.set(""),this.loadLessons()})}loadLessons(){if(!this.countryId()){this.lessonList.set([]),this.setPage(1);return}$("#loaderouterid").css("display","flex"),this.loadLessonsPage(1,[])}loadLessonsPage(t,e){this.theoryLessonsService.getTrainingLessons(this.countryId(),{framework_type:this.lessonType(),page:t,limit:100}).subscribe({next:n=>{let o=(n?.data||[]).map(v=>Ut(v)),d=[...e,...o],g=n?.pagination?.totalPages??1;if(t<g){this.loadLessonsPage(t+1,d);return}$("#loaderouterid").css("display","none"),this.lessonList.set(d),this.setPage(1)},error:n=>{$("#loaderouterid").css("display","none");let o=this.getStaticLessons();this.lessonList.set(o),this.setPage(1),o.length||this.sweetAlert.custom({type:"error",title:"Fehler",content:n.error?.message||"Fehler beim Laden der Stunden",isHtml:!1,showCancel:!1,confirmText:"OK",confirmButtonClass:"btn-primary"}).subscribe()}})}getStaticLessons(){return this.isPractical()?[Ut({_id:"practical-1",lesson_name:"\xDCberlandfahrt",category:"CLASS_SPECIFIC",duration:45,delivery_methods:["HYBRID"],status:"active"})]:[Ut({_id:"theory-1",lesson_name:"Grundlagentheorie",category:"BASIC",duration:90,delivery_methods:["ONLINE","IN_PERSON"],status:"active"})]}getFilteredList(){let t=this.searchQuery().trim().toLowerCase(),e=this.lessonList();return t?e.filter(n=>n.lesson_name?.toLowerCase().includes(t)||n.category?.toLowerCase().includes(t)||n.delivery_method?.toLowerCase().includes(t)):e}setPage(t,e=this.getFilteredList()){let n=this.pagerService.getPager(e.length,t,this.pageSize);if(this.pager.set(n),this.pagedItems.set(e.slice(n.startIndex,n.endIndex+1)),e.length>0){let o=n.pageSize||this.pageSize;this.startRecord.set(n.currentPage*o-o+1),this.endRecord.set(n.currentPage*o>e.length?e.length:n.currentPage*o)}else this.startRecord.set(0),this.endRecord.set(0)}search(t){if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key))return;let e=t.target.value;this.searchQuery.set(e),this.setPage(1)}formatDuration(t){if(t==null||t==="")return"-";let e=Number(t);if(Number.isNaN(e))return String(t);if(e>=60){let n=Math.floor(e/60),o=e%60;return o>0?`${n} Std. ${o} Min`:`${n} Std.`}return`${e} Min`}addTheoryLesson(){this.matDialog.open(yn,{width:"100%",maxWidth:"1200px",panelClass:"custom-mat-modal-container",disableClose:!0,data:{countryId:this.countryId(),lessonType:"THEORY"}}).afterClosed().subscribe(e=>{e&&this.loadLessons()})}addPracticalLesson(){this.matDialog.open(Cn,{width:"100%",maxWidth:"1200px",panelClass:"custom-mat-modal-container",disableClose:!0,data:{countryId:this.countryId(),lessonType:"PRACTICAL"}}).afterClosed().subscribe(e=>{e&&this.loadLessons()})}editLesson(t){let e={width:"100%",maxWidth:"1200px",panelClass:"custom-mat-modal-container",disableClose:!0,data:{countryId:this.countryId(),lessonType:this.lessonType(),lesson:t}};(this.isPractical()?this.matDialog.open(Ot,e):this.matDialog.open(kt,e)).afterClosed().subscribe(o=>{o&&this.loadLessons()})}updateStatus(t){if(!t?._id)return;let e=t.status==="active"?0:1,n=e===1?"aktivieren":"deaktivieren";this.sweetAlert.confirm("Status \xE4ndern?",`M\xF6chten Sie die Stunde "${t.lesson_name}" wirklich ${n}?`,{type:"warning",confirmText:`Ja, ${n}`,cancelText:"Abbrechen"}).subscribe(o=>{o&&($("#loaderouterid").css("display","flex"),this.theoryLessonsService.updateLessonStatus(t._id,e).subscribe({next:d=>{$("#loaderouterid").css("display","none");let g=Ut(d?.data??{});this.lessonList.update(W=>W.map(G=>G._id===t._id?I(I({},G),g):G)),this.setPage(this.pager().currentPage||1);let v=g.lesson_name??t.lesson_name,T=v?e===1?`Die Stunde \u201E${v}\u201C wurde erfolgreich aktiviert.`:`Die Stunde \u201E${v}\u201C wurde erfolgreich deaktiviert.`:e===1?"Die Stunde wurde erfolgreich aktiviert.":"Die Stunde wurde erfolgreich deaktiviert.";this.sweetAlert.success("Status ge\xE4ndert",T,"OK")},error:d=>{$("#loaderouterid").css("display","none"),this.sweetAlert.error("Fehler",fi(d,"Status konnte nicht ge\xE4ndert werden"),"OK")}}))})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-training-lessons"]],inputs:{countryId:[1,"countryId"],lessonType:[1,"lessonType"]},decls:39,vars:10,consts:[["table",""],["statusMenu","matMenu"],[1,"table-min-height"],[1,"editing-something","top-search-block",2,"margin-top","26px"],[1,"top-search-block-row"],[1,"input-block"],["type","text",1,"search","myInput","w-100","new-myInput",2,"max-width","490px !important",3,"keyup","placeholder","value"],[1,"slector-dropdown"],["mat-button","",1,"button-primary","botton-hover",3,"click","mouseover","mouseout"],[1,"menu-image",3,"src"],[1,"ml-2","d-none","d-md-inline"],[1,"table-count-box","d-flex","align-items-center","justify-content-end","flex-shrink-0"],[1,"new-tableCount"],[1,"w-100","shadow-none","mt-0","pt-0"],[1,"w-100","position-relative"],["id","accordion",1,"main-table-card"],[1,"w-100"],[1,"editing-something"],[2,"width","6%","min-width","50px"],[1,"",2,"width","24%","min-width","180px"],[2,"width","18%","min-width","140px"],[2,"width","14%","min-width","130px"],[2,"width","20%","min-width","140px"],[2,"width","8%","min-width","78px"],[2,"width","10%","min-width","120px","text-align","start"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end","pagination-main","mt-3"],["class","pagination m-0 pagerAction",4,"ngIf"],[1,"customer-id"],[1,"customer-Unternehmensname","title-style"],[1,"customer-Unternehmensname"],[1,"customer-action"],[1,"qna-action"],["type","button",1,"openclass","offnen-btn","click",3,"click"],["matButton","",1,"",3,"matMenuTriggerFor"],[1,"openclass","offnen-btn","click","openClassHover"],[1,"offnen-btn","click","delete-sm"],[1,"openclass","offnen-btn","click","openClassHover",3,"click"],[1,"offnen-btn","click","delete-sm",3,"click"],["colspan","7"],[3,"message"],[1,"pagination","m-0","pagerAction"],[1,"page-item",3,"ngClass"],[1,"page-link",3,"click"],["class","page-item",3,"ngClass",4,"ngFor","ngForOf"]],template:function(e,n){e&1&&(r(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"input",6),u("keyup",function(d){return n.search(d)}),a(),r(5,"div",7)(6,"button",8),u("click",function(){return n.isPractical()?n.addPracticalLesson():n.addTheoryLesson()})("mouseover",function(){return n.isHovering.set(!0)})("mouseout",function(){return n.isHovering.set(!1)}),p(7,"img",9),r(8,"span",10),s(9),a()()()(),r(10,"div",11)(11,"span",12),s(12),a()()()(),r(13,"div",13)(14,"div",14)(15,"div",15)(16,"table",16,0)(18,"thead")(19,"tr",17)(20,"th",18),s(21,"#"),a(),r(22,"th",19),s(23," Stundenname "),a(),r(24,"th",20),s(25," Kategorie "),a(),r(26,"th",21),s(27," Dauer "),a(),r(28,"th",22),s(29," Liefermethode "),a(),r(30,"th",23),s(31," Status "),a(),r(32,"th",24),s(33," Aktion "),a()()(),r(34,"tbody"),x(35,Sr,24,10,"tr",25),y(36,Er,3,1,"tr"),a()()(),r(37,"div",26),x(38,Tr,14,13,"ul",27),a()()()()),e&2&&(l(4),c("placeholder",n.searchPlaceholder())("value",n.searchQuery()),l(3),c("src",n.isHovering()?"../assets/plus icon.svg":"../assets/plus1.svg",Te),l(2),S(n.addButtonLabel()),l(3),xe(" Anzahl der Ergebnisse: ",n.startRecord()," - ",n.endRecord()," / ",n.lessonList().length," "),l(23),c("ngForOf",n.pagedItems()),l(),C(n.pagedItems().length?-1:36),l(2),c("ngIf",n.lessonList().length)
2)},dependencies:[Se,Re,Qe,Ve,D,Ye,Je,Ie,ke,ee],styles:[".top-search-block-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:30px}.input-block[_ngcontent-%COMP%]{display:flex;align-items:center;gap:15px;flex:1 1 0;min-width:0}.myInput[_ngcontent-%COMP%]{height:48px!important}.new-myInput[_ngcontent-%COMP%]::placeholder{color:#5159666e;font-size:14px;line-height:1.3;font-weight:500}.slector-dropdown[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{padding:16px!important;border-radius:12px;font-size:16px;line-height:1.3;font-weight:400;color:#515966;position:relative;white-space:nowrap}.slector-dropdown[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]     .mdc-button__label{display:flex;align-items:center}.main-table-card[_ngcontent-%COMP%]{border:solid 1px #cbcbcb;border-radius:5px;overflow-x:auto;overflow-y:hidden}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:10px}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{font-size:16px;padding:16px 10px;line-height:1.3;color:#75787d;font-weight:700}.main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{font-size:16px;line-height:1.3;color:#515966;font-weight:400}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]:first-child, .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:first-child{padding-left:20px}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]:last-child, .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:last-child{padding-right:20px}table.w-100[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]{border-bottom:1px solid #e9ecef}table.w-100[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:1px solid #e9ecef;padding:10px}.title-style[_ngcontent-%COMP%]{font-weight:500}.status-bullet[_ngcontent-%COMP%]{display:inline-block;width:12px;height:12px;border-radius:50%}.status-bullet.status-active[_ngcontent-%COMP%]{background-color:#28a745}.status-bullet.status-inactive[_ngcontent-%COMP%]{background-color:#dc3545}.qna-action[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.customer-action[_ngcontent-%COMP%]{white-space:nowrap;vertical-align:middle!important}.menu-trigger-btn[_ngcontent-%COMP%]{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:auto!important;width:28px!important;height:28px!important;padding:0!important;line-height:1;vertical-align:middle}.menu-trigger-btn[_ngcontent-%COMP%]     .mat-mdc-button-touch-target{width:28px!important;height:28px!important}.menu-trigger-btn[_ngcontent-%COMP%]     .mdc-icon-button{display:flex!important;align-items:center!important;justify-content:center!important;width:28px!important;height:28px!important;padding:0!important}.menu-trigger-btn[_ngcontent-%COMP%]     .mdc-icon-button__icon{display:flex;align-items:center;justify-content:center}.menu-trigger-btn[_ngcontent-%COMP%]   i.fa[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;font-size:15px;line-height:1}.offnen-btn[_ngcontent-%COMP%]{background-color:#d0e7ff;border-radius:5px;padding:6px 10px;font-size:14px;line-height:1.3;font-weight:500;border:none}.openclass[_ngcontent-%COMP%]{background-color:#e0f2ff!important;border:none!important;color:#515966!important}.openclass[_ngcontent-%COMP%]:hover{border:none!important;background:#1388fe!important;color:#fff!important}.delete-sm[_ngcontent-%COMP%]{background-color:#fff0f0!important;color:#eb3737!important;border:none!important;transition:.3s}.delete-sm[_ngcontent-%COMP%]:hover{background-color:#eb3737!important;color:#fff!important}  .mat-mdc-menu-content{margin:0;padding:8px!important;outline:0!important}.mat-mdc-button.mat-mdc-button-base[_ngcontent-%COMP%]{min-width:0px!important;padding:1%!important;height:100%!important}"]})}};function Pi(i){return{theoretical_enabled:!!i.has_previous_theory_knowledge,practical_enabled:!!i.has_previous_practical_knowledge,min_theoretical:i.has_previous_theory_knowledge?Number(i.theory_previous_duration)||0:null,min_practical:i.has_previous_practical_knowledge?Number(i.practical_previous_duration)||0:null}}function xn(i){return{basic:i.basic,class_specific:i.class_specific}}function Ai(i){return{theory:{normal:xn(i.theory.normal),experience:xn(i.theory.experience)},practical:{normal:xn(i.practical.normal),experience:xn(i.practical.experience)}}}function Sn(i,t,e,n,o){let d={path_type:"EXTENSION",description:i.description?.trim()||"",country_id:t,from_class_id:i.existing_class?._id??null,to_class_id:i.new_class?._id??null,experience_required:Pi(i),status:i.isActive?1:0,lessons:e,license_class_settings:Ai(n)};return o&&(d._id=o,d.qualificationPathId=o),d}function En(i,t,e,n,o,d){let g=(i.license_classes??[]).map(T=>n.find(W=>
2W.class_code===T)?._id).filter(Boolean),v={path_type:"COMBINATION_CLASS",description:i.description?.trim()||"",country_id:t,class_ids:g,experience_required:Pi(i),status:i.isActive?1:0,lessons:e,license_class_settings:Ai(o)};return d&&(v._id=d,v.qualificationPathId=d),v}var Fi=(i,t)=>t._id;function Lr(i,t){i&1&&(r(0,"mat-icon"),s(1,"check"),a())}function Mr(i,t){if(i&1&&(r(0,"mat-option",23),s(1),a()),i&2){let e=t.$implicit,n=m();c("value",e),l(),L(" ",n.getClassOptionLabel(e)," ")}}function Ir(i,t){i&1&&(r(0,"mat-option",24),s(1,"Keine Klassen gefunden"),a())}function Pr(i,t){i&1&&(r(0,"mat-error"),s(1,"Ausgangsklasse ist erforderlich"),a())}function Ar(i,t){if(i&1&&(r(0,"mat-option",23),s(1),a()),i&2){let e=t.$implicit,n=m();c("value",e),l(),L(" ",n.getClassOptionLabel(e)," ")}}function Fr(i,t){i&1&&(r(0,"mat-option",24),s(1,"Keine Klassen gefunden"),a())}function Dr(i,t){i&1&&(r(0,"mat-error"),s(1,"Zielklasse ist erforderlich"),a())}function kr(i,t){i&1&&(r(0,"mat-form-field",36)(1,"mat-label"),s(2,"Mindestvorbesitzdauer"),a(),p(3,"input",47),r(4,"span",48),s(5,"Jahre"),a()())}function Or(i,t){i&1&&(r(0,"mat-form-field",36)(1,"mat-label"),s(2,"Mindestvorbesitzdauer"),a(),p(3,"input",49),r(4,"span",48),s(5,"Jahre"),a()())}function Nr(i,t){if(i&1&&p(0,"app-theory-lession",51),i&2){let e=m(2),n=M(8);c("stepper",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","THEORY")("statusTab","STANDARD")("autoDeriveSettings",!0)}}function Gr(i,t){if(i&1&&p(0,"app-theory-lession",51),i&2){let e=m(2),n=M(8);c("stepper",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","THEORY")("statusTab","EXPERIENCE")("autoDeriveSettings",!0)}}function Rr(i,t){if(i&1&&(r(0,"mat-tab-group")(1,"mat-tab",50),y(2,Nr,1,8,"app-theory-lession",51),a(),r(3,"mat-tab",52),y(4,Gr,1,8,"app-theory-lession",51),a()()),i&2){let e,n=m();l(2),C(n.theoryLoaded?2:-1),l(),c("label",Le("",(e=n.extensionFormGroup.get("theory_previous_duration"))==null?null:e.value," Jahre Vorbesitz")),l(),C(n.theoryLoaded?4:-1)}}function Vr(i,t){if(i&1&&p(0,"app-theory-lession",51),i&2){let e=m(2),n=M(8);c("stepper",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","THEORY")("statusTab","STANDARD")("autoDeriveSettings",!0)}}function qr(i,t){if(i&1&&y(0,Vr,1,8,"app-theory-lession",51),i&2){let e=m();C(e.theoryLoaded?0:-1)}}function $r(i,t){if(i&1&&p(0,"app-theory-lession",53),i&2){let e=m(2),n=M(8);c("stepper",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","PRACTICAL")("statusTab","STANDARD")("saveHandler",e.saveExtension)("autoDeriveSettings",!0)}}function Br(i,t){if(i&1&&p(0,"app-theory-lession",53),i&2){let e=m(2),n=M(8);c("stepper",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","PRACTICAL")("statusTab","EXPERIENCE")("saveHandler",e.saveExtension)("autoDeriveSettings",!0)}}function zr(i,t){if(i&1&&(r(0,"mat-tab-group")(1,"mat-tab",50),y(2,$r,1,9,"app-theory-lession",53),a(),r(3,"mat-tab",52),y(4,Br,1,9,"app-theory-lession",53),a()()),i&2){let e,n=m();l(2),C(n.practicalLoaded?2:-1),l(),c("label",Le("",(e=n.extensionFormGroup.get("practical_previous_duration"))==null?null:e.value," Jahre Vorbesitz")),l(),C(n.practicalLoaded?4:-1)}}function Ur(i,t){if(i&1&&p(0,"app-theory-lession",53),i&2){let e=m(2),n=M(8);c("stepper",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","PRACTICAL")("statusTab","STANDARD")("saveHandler",e.saveExtension)("autoDeriveSettings",!0)}}function Hr(i,t){if(i&1&&y(0,Ur,1,9,"app-theory-lession",53),i&2){let e=m();C(e.practicalLoaded?0:-1)}}var wn=class i{constructor(){this.dialogRef=b(te);this.formBuilder=b(Q);this.userService=b(le);this.lessonStateService=b(fe);this.sweetAlert=b(O);this.theoryLessonsService=b(q);this.showLoader=w(!1);this.ERROR_MESSAGES=we;this.saveExtension=()=>{this.saveQualificationPath()};this.data=b(ne,{optional:!0})??{countryId:"",drivingLicenseClasses:[]};this.drivingLicenseClasses=w(this.data.drivingLicenseClasses??[]);this.existingClassSearch=w("");this.newClassSearch=w("");this.selectedExistingClassCode=w("");this.theoryLoaded=!1;this.practicalLoaded=!1;this.activeDrivingLicenseClasses=k(()=>this.drivingLicenseClasses().filter(t=>t.status==="active"));this.filteredExistingClasses=k(()=>this.filterLicenseClasses(this.activeDrivingLicenseClasses(),this.existingClassSearch()));this.filteredNewClasses=k(()=>{let t=this.selectedExistingClassCode(),e=t?this.activeDrivingLicenseClasses().filter(n=>n.class_code!==t):this.activeDrivingLicenseClasses();return this.filterLicenseClasses(e,this.newClassSearch())});this.extensionFormGroup=this.formBuilder.group({existing_class:[null,[_.required,this.licenseClassValidator.bind(this)]],new_class:[null,[_.required,this.licenseClassValidator.bind(this)]],description:[""],has_previous_theory_knowledge:[!1],has_previous_practical_knowledge:[!1],theory_previous_duration:[null],practical_previous_duration:[null],isActive:[!0]});this.displayClassFn=t=>t?typeof t=="string"?t:this.getClassOptionLabel(t):""}ngOnInit(){!this.drivingLicenseClasses().length&&this.data.countryId&&this.loadDrivingLicenseClasses(),this.bindClassSearch("existing_class",this.existingClassSearch,this.selectedExistingClassCode),this.bindClassSearch("new_class",this.newClassSearch)}get licenseClassIds(){let t=this.extensionFormGroup.get("new_class")?.value,e=typeof t=="object"&&t?._id?t._id:"";return e?[e]:[]}closeModal(){me(this.sweetAlert,_t(this.extensionFormGroup.dirty,this.lessonStateService,!0),()=>this.dialogRef.close(!1))}onStepChange(t){switch(t.selectedIndex){case 1:this.theoryLoaded=!0;break;case 2:this.practicalLoaded=!0;break}}goNextStep1(t){if(this.extensionFormGroup.invalid){this.extensionFormGroup.markAllAsTouched(),this.showValidationError(this.getExtensionStepValidationMessage());return}t.next()}getClassOptionLabel(t){return`${t.class_code} - ${t.class_name}`}get dialogTitle(){let t="Erweiterung hinzuf\xFCgen",e=this.getSelectedClassCode(this.extensionFormGroup.get("existing_class")?.value),n=this.getSelectedClassCode(this.extensionFormGroup.get("new_class")?.value);return e&&n?`${t}: ${e} \u2192 ${n}`:e||n?`${t}: ${e||n}`:t}getSelectedClassCode(t){return!t||typeof t=="string"?"":t.class_code||""}bindClassSearch(t,e,n){this.extensionFormGroup.get(t)?.valueChanges.subscribe(o=>
2{if(typeof o=="string"){e.set(o),n&&n.set("");return}if(e.set(""),n&&o?.class_code){n.set(o.class_code);let d=this.extensionFormGroup.get("new_class")?.value;d&&typeof d!="string"&&d.class_code===o.class_code&&this.extensionFormGroup.patchValue({new_class:null})}})}licenseClassValidator(t){let e=t.value;return!e||typeof e=="string"?{required:!0}:e.class_code?null:{required:!0}}filterLicenseClasses(t,e){let n=e.trim().toLowerCase();return n?t.filter(o=>o.class_code?.toLowerCase().includes(n)||o.class_name?.toLowerCase().includes(n)):t}loadDrivingLicenseClasses(){this.userService.getdrivingLicenseClasses(this.data.countryId).subscribe({next:t=>{this.drivingLicenseClasses.set(t?.data??[])},error:()=>{this.drivingLicenseClasses.set([])}})}saveQualificationPath(){return ze(this,null,function*(){if(this.extensionFormGroup.invalid){this.extensionFormGroup.markAllAsTouched(),this.showValidationError(this.getExtensionStepValidationMessage());return}this.showLoader.set(!0);let t=!!this.extensionFormGroup.get("has_previous_theory_knowledge")?.value,e=!!this.extensionFormGroup.get("has_previous_practical_knowledge")?.value;try{yield hn({theoryLessonsService:this.theoryLessonsService,lessonStateService:this.lessonStateService,countryId:this.data.countryId,licenseClassIds:this.licenseClassIds,includeTheoryExperience:t,includePracticalExperience:e})}catch(o){this.showLoader.set(!1),console.error("Failed to load full lesson mappings",o),this.sweetAlert.error("Fehler","Die Lektionszuordnungen konnten nicht vollst\xE4ndig geladen werden. Bitte versuchen Sie es erneut.");return}this.lessonStateService.autoSyncAllCreateSettingsFromIncludedLessons({includeTheoryExperience:t,includePracticalExperience:e});let n=Sn(this.extensionFormGroup.getRawValue(),this.data.countryId,this.lessonStateService.getLessons(),this.lessonStateService.getLicenseClassSettings());this.theoryLessonsService.createQualificationPath(n).subscribe({next:()=>{this.showLoader.set(!1),this.lessonStateService.markClean(),this.sweetAlert.success("Erfolg","Erweiterung erfolgreich gespeichert"),this.dialogRef.close(!0)},error:o=>{this.showLoader.set(!1);let d=o?.error?.errorCode,g=d?this.ERROR_MESSAGES[d]:"";this.sweetAlert.error("Fehler",g||o?.error?.message||"Erweiterung konnte nicht gespeichert werden")}})})}getExtensionStepValidationMessage(){let t=this.extensionFormGroup.get("existing_class"),e=this.extensionFormGroup.get("new_class");return t?.invalid?"Ausgangsklasse ist erforderlich.":e?.invalid?"Zielklasse ist erforderlich.":"Bitte f\xFCllen Sie alle Pflichtfelder korrekt aus."}showValidationError(t){this.sweetAlert.warning("Pflichtfelder erforderlich",t,"OK").subscribe()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-add-extension"]],features:[Ke([fe])],decls:95,vars:18,consts:[["stepper",""],["existingClassAuto","matAutocomplete"],["newClassAuto","matAutocomplete"],[1,"modal-content","add-extension-modal"],[1,"custom-mat-modal-header"],[1,"title"],["type","button",1,"btn-close",3,"click"],["src","../../../assets/closeModel.svg","alt","closeModel",2,"height","20px"],[1,"custom-mat-modal-body"],[1,"custom-stepper",3,"selectionChange","linear"],["matStepperIcon","edit"],["label","Erweiterungsdetails"],[1,"modal-body"],[1,"row","m-0",3,"formGroup"],[1,"col-sm-12"],[1,"row","pb-2","d-flex","justify-content-between"],[1,"col-md-6","col-sm-12","custom-padding"],[1,"field-heading-parent"],[1,"field-heading","mb-2"],[1,"px-2"],["appearance","outline",1,"w-100","bg-white"],["type","text","matInput","","formControlName","existing_class","placeholder","Klasse suchen...",3,"matAutocomplete"],[3,"displayWith"],[3,"value"],["disabled",""],["type","text","matInput","","formControlName","new_class","placeholder","Klasse suchen...",3,"matAutocomplete"],[1,"col-sm-12","custom-padding","mt-3","mb-3"],["matInput","","formControlName","description","placeholder","Beschreibung der Erweiterung ...","maxlength","500","rows","3"],[1,"col-12","col-md-12","col-sm-12","custom-padding"],[1,"p-3"],[1,"row"],[1,"col-md-6","col-sm-12","custom-padding-toggle"],[1,"d-flex","justify-content-between","align-items-center","mb-2"],[1,"d-flex","align-items-center","gap-2"],["formControlName","has_previous_theory_knowledge"],[1,"ml-2","toggle-label"],["appearance","outline",1,"w-100","mt-2"],[1,"d-flex","align-items-center"],["formControlName","has_previous_practical_knowledge"],[1,"col-sm-12","custom-padding","mt-3"],[1,"field-heading"],["formControlName","isActive"],[1,"stepper-buttons"],["type","button",1,"primary-button",2,"margin-left","auto",3,"click"],["label","Theorieanforderungen"],["label","Praxisanforderungen"],[3,"visible"],["matInput","","type","number","min","0","formControlName","theory_previous_duration"],["matTextSuffix",""],["matInput","","type","number","min","0","formControlName","practical_previous_duration"],["label","Standard"],[3,"stepper","showInfoMessage","showStepperNav","countryId","licenseClassIds","frameworkType","statusTab","autoDeriveSettings"],[3,"label"],[3,"stepper","showInfoMessage","showStepperNav","countryId","licenseClassIds","frameworkType","statusTab","saveHandler","autoDeriveSettings"]],template:function(e,n){if(e&1){let o=E();r(0,"div",3)(1,"div",4)(2,"h2",5),s(3),a(),r(4,"button",6),u("click",function(){return n.closeModal()}),p(5,"img",7),a()(),r(6,"div",8)(7,"mat-stepper",9,0),u("selectionChange",function(g){return n.onStepChange(g)}),x(9,Lr,2,0,"ng-template",10),r(10,"mat-step",11)(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"div",16)(16,"div",17)(17,"h6",18),s(18,"Ausgangsklasse (bestehend) :"),a(),r(19,"div",19)(20,"mat-form-field",20)(21,"mat-label"),s(22,"Ausgangsklasse"),a(),p(23,"input",21),r(24,"mat-autocomplete",22,1),A(26,Mr,2,2,"mat-option",23,Fi,!1,Ir,2,0,"mat-option",24),a(),y(29,Pr,2,0,"mat-error"),a()()()(),r(30,"div",16)(31,"div",17)(32,"h6",18),s(33,"Zielklasse :"),a(),r(34,"div",19)(35,"mat-form-field",20)(36,"mat-label"),s(37,"Zielklasse"),a(),p(38,"input",25),r(39,"mat-autocomplete",22,2),A(41,Ar,2,2,"mat-option",23,Fi,!1,Fr,2,0,"mat-option",24),a(),y(44,Dr,2,0,"mat-error"),a()()()(),r(45,"div",26)(46,"div",17)(47,"h6",18),s(48,"Beschreibung :"),a(),r(49,"div",19)(50,"mat-form-field",20)(51,"mat-label"),s(52,"Beschreibung"),a(),p(
253,"textarea",27),a()()()(),r(54,"div",28)(55,"div",17)(56,"h6",18),s(57,"Vorbesitzeinstellungen :"),a(),r(58,"div",29)(59,"div",30)(60,"div",31)(61,"div",32)(62,"span"),s(63," Abweichende Theoriestunden basierend auf Vorbesitzdauer? "),a(),r(64,"div",33),p(65,"mat-slide-toggle",34),r(66,"span",35),s(67),a()()(),y(68,kr,6,0,"mat-form-field",36),a(),r(69,"div",31)(70,"div",32)(71,"span"),s(72," Abweichende Praxisstunden basierend auf Vorbesitzdauer? "),a(),r(73,"div",37),p(74,"mat-slide-toggle",38),r(75,"span",35),s(76),a()()(),y(77,Or,6,0,"mat-form-field",36),a()()()()(),r(78,"div",39)(79,"div",17)(80,"h6",40),s(81,"Status :"),a(),r(82,"div",29)(83,"mat-slide-toggle",41),s(84," Status Aktiv ? "),a()()()()()()()(),r(85,"div",42)(86,"button",43),u("click",function(){h(o);let g=M(8);return f(n.goNextStep1(g))}),s(87," Weiter "),a()()(),r(88,"mat-step",44),y(89,Rr,5,4,"mat-tab-group")(90,qr,1,1),a(),r(91,"mat-step",45),y(92,zr,5,4,"mat-tab-group")(93,Hr,1,1),a()()()(),p(94,"app-loader",46)}if(e&2){let o,d,g,v,T,W,G,ot,ft=M(25),yt=M(40);l(3),S(n.dialogTitle),l(4),c("linear",!0),l(5),c("formGroup",n.extensionFormGroup),l(11),c("matAutocomplete",ft),l(),c("displayWith",n.displayClassFn),l(2),F(n.filteredExistingClasses()),l(3),C((o=n.extensionFormGroup.get("existing_class"))!=null&&o.hasError("required")&&((o=n.extensionFormGroup.get("existing_class"))!=null&&o.touched)?29:-1),l(9),c("matAutocomplete",yt),l(),c("displayWith",n.displayClassFn),l(2),F(n.filteredNewClasses()),l(3),C((d=n.extensionFormGroup.get("new_class"))!=null&&d.hasError("required")&&((d=n.extensionFormGroup.get("new_class"))!=null&&d.touched)?44:-1),l(23),L(" ",(g=n.extensionFormGroup.get("has_previous_theory_knowledge"))!=null&&g.value?"Ja":"Nein"," "),l(),C((v=n.extensionFormGroup.get("has_previous_theory_knowledge"))!=null&&v.value?68:-1),l(8),L(" ",(T=n.extensionFormGroup.get("has_previous_practical_knowledge"))!=null&&T.value?"Ja":"Nein"," "),l(),C((W=n.extensionFormGroup.get("has_previous_practical_knowledge"))!=null&&W.value?77:-1),l(12),C((G=n.extensionFormGroup.get("has_previous_theory_knowledge"))!=null&&G.value?89:90),l(3),C((ot=n.extensionFormGroup.get("has_previous_practical_knowledge"))!=null&&ot.value?92:93),l(2),c("visible",n.showLoader())}},dependencies:[N,R,oe,V,U,qe,se,K,H,D,Fe,De,Lt,Mt,Tt,ke,Y,j,_e,ce,J,de,We,Xe,ie,$e,ae],styles:[".custom-mat-modal-body[_ngcontent-%COMP%], .modal
2-body[_ngcontent-%COMP%]{padding:0!important}.custom-padding[_ngcontent-%COMP%]{padding:0 0 0 10px!important}.add-extension-modal[_ngcontent-%COMP%]     .mat-horizontal-content-container{padding:0 12px 24px 24px!important}.stepper-buttons[_ngcontent-%COMP%]{margin-top:24px;display:flex;gap:16px;justify-content:space-between;align-items:center}.custom-padding-toggle[_ngcontent-%COMP%]{padding:0 15px}"]})}};var Kr=(i,t)=>t._id;function Qr(i,t){i&1&&(r(0,"mat-icon"),s(1,"check"),a())}function jr(i,t){if(i&1&&(r(0,"mat-option",22),s(1),a()),i&2){let e=t.$implicit,n=m();c("value",e),l(),L(" ",n.getClassOptionLabel(e)," ")}}function Yr(i,t){i&1&&(r(0,"mat-option",23),s(1,"Keine Klassen gefunden"),a())}function Jr(i,t){i&1&&(r(0,"mat-error"),s(1,"Mindestens zwei F\xFChrerscheinklassen sind erforderlich"),a())}function Wr(i,t){if(i&1){let e=E();r(0,"button",50),s(1),r(2,"img",51),u("click",function(o){let d=h(e).$implicit,g=m(3);return f(g.removeLicenseClass(d,o))}),a()()}if(i&2){let e=t.$implicit,n=m(3);l(),L(" ",n.getLicenseClassLabel(e)," ")}}function Xr(i,t){if(i&1&&A(0,Wr,3,1,"button",50,Ce),i&2){let e=m(2);F(e.selectedLicenseClasses)}}function Zr(i,t){i&1&&p(0,"app-no-data",49),i&2&&c("message","Keine F\xFChrerscheinklasse ausgew\xE4hlt")}function eo(i,t){if(i&1&&(r(0,"div",24)(1,"label",46),s(2," Ausgew\xE4hlte F\xFChrerscheinklassen : "),a(),r(3,"div",47)(4,"div",48),y(5,Xr,2,0)(6,Zr,1,1,"app-no-data",49),a()()()),i&2){let e=m();l(5),C(e.selectedLicenseClasses.length>0?5:6)}}function to(i,t){i&1&&(r(0,"mat-form-field",35)(1,"mat-label"),s(2,"Mindestvorbesitzdauer"),a(),p(3,"input",52),r(4,"span",53),s(5,"Jahre"),a()())}function no(i,t){i&1&&(r(0,"mat-form-field",35)(1,"mat-label"),s(2,"Mindestvorbesitzdauer"),a(),p(3,"input",54),r(4,"
2span",53),s(5,"Jahre"),a()())}function io(i,t){if(i&1&&p(0,"app-theory-lession",56),i&2){let e=m(2),n=M(8);c("stepper",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","THEORY")("statusTab","STANDARD")("autoDeriveSettings",!0)}}function ao(i,t){if(i&1&&p(0,"app-theory-lession",56),i&2){let e=m(2),n=M(8);c("stepper",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","THEORY")("statusTab","EXPERIENCE")("autoDeriveSettings",!0)}}function ro(i,t){if(i&1&&(r(0,"mat-tab-group")(1,"mat-tab",55),y(2,io,1,8,"app-theory-lession",56),a(),r(3,"mat-tab",57),y(4,ao,1,8,"app-theory-lession",56),a()()),i&2){let e,n=m();l(2),C(n.theoryLoaded?2:-1),l(),c("label",Le("",(e=n.combinationFormGroup.get("theory_previous_duration"))==null?null:e.value," Jahre Vorbesitz")),l(),C(n.theoryLoaded?4:-1)}}function oo(i,t){if(i&1&&p(0,"app-theory-lession",56),i&2){let e=m(2),n=M(8);c("step
2per",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","THEORY")("statusTab","STANDARD")("autoDeriveSettings",!0)}}function so(i,t){if(i&1&&y(0,oo,1,8,"app-theory-lession",56),i&2){let e=m();C(e.theoryLoaded?0:-1)}}function lo(i,t){if(i&1&&p(0,"app-theory-lession",58),i&2){let e=m(2),n=M(8);c("stepper",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","PRACTICAL")("statusTab","STANDARD")("saveHandler",e.saveCombinationClass)("autoDeriveSettings",!0)}}function co(i,t){if(i&1&&p(0,"app-theory-lession",58),i&2){let e=m(2),n=M(8);c("stepper",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","PRACTICAL")("statusTab","EXPERIENCE")("saveHandler",e.saveCombinationClass)("autoDeriveSettings",!0)}}function mo(i,t){if(i&1&&(r(0,"mat-tab-group")(1,"mat-tab",55),y(2,lo,1,9,"app-theory-lession",58),a(),r(3,"mat-tab",57),y(4,co,1,9,"app-theory-lession",58),a()()),i&2){let e,n=m();l(2),C(n.practicalLoaded?2:-1),l(),c("label",Le("",(e=n.combinationFormGroup.get("practical_previous_duration"))==null?null:e.value," Jahre Vorbesitz")),l(),C(n.practicalLoaded?4:-1)}}function po(i,t){if(i&1&&p(0,"app-theory-lession",58),i&2){let e=m(2),n=M(8);c("stepper",n)("showInfoMessage",!0)("showStepperNav",!0)("countryId",e.data.countryId)("licenseClassIds",e.licenseClassIds)("frameworkType","PRACTICAL")("statusTab","STANDARD")("saveHandler",e.saveCombinationClass)("autoDeriveSettings",!0)}}function uo(i,t){if(i&1&&y(0,po,1,9,"app-theory-lession",58),i&2){let e=m();C(e.practicalLoaded?0:-1)}}var Ln=class i{constructor(){this.dialogRef=b(te);
2this.fb=b(Q);this.userService=b(le);this.lessonStateService=b(fe);this.sweetAlert=b(O);this.theoryLessonsService=b(q);this.showLoader=w(!1);this.ERROR_MESSAGES=we;this.saveCombinationClass=()=>{this.saveQualificationPath()};this.data=b(ne,{optional:!0})??{countryId:"",drivingLicenseClasses:[]};this.drivingLicenseClasses=w(this.data.drivingLicenseClasses??[]);this.licenseClassSearch=w("");this.licenseClassInput=new dt("");this.theoryLoaded=!1;this.practicalLoaded=!1;this.combinationFormGroup=this.fb.group({license_classes:this.fb.control([],[this.licenseClassesValidator.bind(this)]),description:[""],has_previous_theory_knowledge:[!1],has_previous_practical_knowledge:[!1],theory_previous_duration:[null],practical_previous_duration:[null],isActive:[!0]});this.activeDrivingLicenseClasses=k(()=>this.drivingLicenseClasses().filter(t=>t.status==="active"));this.filteredLicenseClasses=k(()=>{let t=this.selectedLicenseClasses,e=this.activeDrivingLicenseClasses().filter(n=>!t.includes(n.class_code));return this.filterLicenseClasses(e,this.licenseClassSearch())})}ngOnInit(){!this.drivingLicenseClasses().length&&this.data.countryId&&this.loadDrivingLicenseClasses(),this.licenseClassInput.valueChanges.subscribe(t=>{this.licenseClassSearch.set(typeof t=="string"?t:"")}),this.combinationFormGroup.get("license_classes")?.valueChanges.subscribe(()=>{this.syncLicenseClassFieldError()})}get form(){return this.combinationFormGroup}get selectedLicenseClasses(){return this.combinationFormGroup.get("license_classes")?.value??[]}get licenseClassIds(){return this.selectedLicenseClasses.map(t=>this.drivingLicenseClasses().find(e=>e.class_code===t)?._id).filter(t=>!!t)}closeModal(){me(this.sweetAlert,_t(this.combinationFormGroup.dirty,this.lessonStateService,!0),()=>this.dialogRef.close(!1))}goNextStep1(t){if(this.form.invalid){this.form.markAllAsTouched(),this.syncLicenseClassFieldError(),this.showValidationError(this.getCombinationStepValidationMessage());return}t.next()}onStepChange(t){this.theoryLoaded=t.selectedIndex>=1,this.practicalLoaded=t.selectedIndex>=2}onLicenseClassSelected(t){if(!t?.class_code)return;let e=[...this.selectedLicenseClasses];e.includes(t.class_code)||(e.push(t.class_code),this.combinationFormGroup.patchValue({license_classes:e}),this.combinationFormGroup.get("license_classes")?.markAsTouched()),this.licenseClassInput.setValue("",{emitEvent:!1}),this.licenseClassSearch.set("")}getClassOptionLabel(t){return`${t.class_code} - ${t.class_name}`}getLicenseClassLabel(t){let e=this.drivingLicenseClasses().find(n=>n.class_code===t);return e?this.getClassOptionLabel(e):t}removeLicenseClass(t,e){e?.stopPropagation();let n=this.selectedLicenseClasses.filter(o=>o!==t);this.combinationFormGroup.patchValue({license_classes:n}),this.combinationFormGroup.get("license_classes")?.markAsTouched()}filterLicenseClasses(t,e){let n=e.trim().toLowerCase();return n?t.filter(o=>o.class_code?.toLowerCase().includes(n)||o.class_name?.toLowerCase().includes(n)):t}loadDrivingLicenseClasses(){this.userService.getdrivingLicenseClasses(this.data.countryId).subscribe({next:t=>{this.drivingLicenseClasses.set(t?.data??[])},error:()=>{this.drivingLicenseClasses.set([])}})}saveQualificationPath(){return ze(this,null,function*(){if(this.combinationFormGroup.invalid){this.combinationFormGroup.markAllAsTouched(),this.syncLicenseClassFieldError(),this.showValidationError(this.getCombinationStepValidationMessage());return}this.showLoader.set(!0);let t=!!this.combinationFormGroup.get("has_previous_theory_knowledge")?.value,e=!!this.combinationFormGroup.get("has_previous_practical_knowledge")?.value;try{yield hn({theoryLessonsService:this.theoryLessonsService,lessonStateService:this.lessonStateService,countryId:this.data.countryId,licenseClassIds:this.licenseClassIds,includeTheoryExperience:t,includePracticalExperience:e})}catch(o){this.showLoader.set(!1),console.error("Failed to load full lesson mappings",o),this.sweetAlert.error("Fehler","Die Lektionszuordnungen konnten nicht vollst\xE4ndig geladen werden. Bitte versuchen Sie es erneut.");return}this.lessonStateService.autoSyncAllCreateSettingsFromIncludedLessons({includeTheoryExperience:t,includePracticalExperience:e});let n=En(this.combinationFormGroup.getRawValue(),this.data.countryId,this.lessonStateService.getLessons(),this.drivingLicenseClasses(),this.lessonStateService.getLicenseClassSettings());this.theoryLessonsService.createQualificationPath(n).subscribe({next:()=>{this.showLoader.set(!1),this.lessonStateService.markClean(),this.sweetAlert.success("Erfolg","Kombination erfolgreich gespeichert"),this.dialogRef.close(!0)},error:o=>{this.showLoader.set(!1);let d=o?.error?.errorCode,g=d?this.ERROR_MESSAGES[d]:"";this.sweetAlert.error("Fehler",g||o?.error?.message||"Kombination konnte nicht gespeichert werden")}})})}licenseClassesValidator(t){let e=t.value;return!Array.isArray(e)||e.length<2?{minClasses:!0}:null}syncLicenseClassFieldError(){let t=this.combinationFormGroup.get("license_classes");
2if(t?.invalid&&t.touched){this.licenseClassInput.setErrors({minClasses:!0}),this.licenseClassInput.markAsTouched();return}(this.licenseClassInput.hasError("minClasses")||this.licenseClassInput.hasError("required"))&&this.licenseClassInput.setErrors(null)}getCombinationStepValidationMessage(){return this.combinationFormGroup.get("license_classes")?.invalid?"Bitte w\xE4hlen Sie mindestens zwei F\xFChrerscheinklassen aus.":"Bitte f\xFCllen Sie alle Pflichtfelder korrekt aus."}showValidationError(t){this.sweetAlert.warning("Pflichtfelder erforderlich",t,"OK").subscribe()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-add-combinationclass"]],features:[Ke([fe])],decls:81,vars:14,consts:[["stepper",""],["licenseClassAuto","matAutocomplete"],[1,"modal-content","add-combinationclass-modal"],[1,"custom-mat-modal-header"],[1,"title"],["type","button",1,"btn-close",3,"click"],["src","../../../assets/closeModel.svg","alt","closeModel",2,"height","20px"],[1,"custom-mat-modal-body"],[1,"custom-stepper",3,"selectionChange","linear"],["matStepperIcon","edit"],["label","Kombinationsdetails"],[1,"modal-body"],[1,"row","m-0",3,"formGroup"],[1,"col-sm-12"],[1,"row","pb-2","d-flex","justify-content-between"],[1,"col-sm-12","custom-padding"],[1,"field-heading-parent"],[1,"field-heading","mb-2"],[1,"px-2"],["appearance","outline",1,"w-100","bg-white"],["type","text","matInput","","placeholder","Klasse suchen und ausw\xE4hlen...",3,"formControl","matAutocomplete"],[3,"optionSelected"],[3,"value"],["disabled",""],[1,"mt-2"],[1,"col-sm-12","custom-padding","mt-3","mb-3"],["matInput","","formControlName","description","placeholder","Beschreibung der Kombination ...","maxlength","500","rows","3"],[1,"col-12","col-md-12","col-sm-12","custom-padding"],[1,"p-3"],[1,"row"],[1,"col-md-6","col-sm-12","custom-padding-toggle"],[1,"d-flex","justify-content-between","align-items-center","mb-2"],[1,"d-flex","align-items-center","gap-2"],["formControlName","has_previous_theory_knowledge"],[1,"ml-2","toggle-label"],["appearance","outline",1,"w-100","mt-2"],[1,"d-flex","align-items-center"],["formControlName","has_previous_practical_knowledge"],[1,"col-sm-12","custom-padding","mt-3"],[1,"field-heading"],["formControlName","isActive"],[1,"stepper-buttons"],["type","button",1,"primary-button",2,"margin-left","auto",3,"click"],["label","Theorieanforderungen"],["label","Praxisanforderungen"],[3,"visible"],[1,"fw-medium"],[1,"p-2"],[1,"scroll-main-div"],[3,"message"],["type","button",1,"btn","button-primary","delivery-method-btn","mr-2"],["src","../../../assets/closeModel.svg","alt","Close","width","10","height","10",1,"ms-2",3,"click"],["matInput","","type","number","min","0","formControlName","theory_previous_duration"],["matTextSuffix",""],["matInput","","type","number","min","0","formControlName","practical_previous_duration"],["label","Standard"],[3,"stepper","showInfoMessage","showStepperNav","countryId","licenseClassIds","frameworkType","statusTab","autoDeriveSettings"],[3,"label"],[3,"stepper","showInfoMessage","showStepperNav","countryId","licenseClassIds","frameworkType","statusTab","saveHandler","autoDeriveSettings"]],template:function(e,n){if(e&1){let o=E();r(0,"div",2)(1,"div",3)(2,"h2",4),s(3,"Kombination hinzuf\xFCgen"),a(),r(4,"button",5),u("click",function(){return n.closeModal()}),p(5,"img",6),a()(),r(6,"div",7)(7,"mat-stepper",8,0),u("selectionChange",function(g){return n.onStepChange(g)}),x(9,Qr,2,0,"ng-template",9),r(10,"mat-step",10)(11,"div",11)(12,"div",12)(13,"div",13)(14,"div",14)(15,"div",15)(16,"div",16)(17,"h6",17),s(18," F\xFChrerscheinklassen : "),a(),r(19,"div",18)(20,"mat-form-field",19)(21,"mat-label"),s(22,"F\xFChrerscheinklassen"),a(),p(23,"input",20),r(24,"mat-autocomplete",21,1),u("optionSelected",function(g){return n.onLicenseClassSelected(g.option.value)}),A(26,jr,2,2,"mat-option",22,Kr,!1,Yr,2,0,"mat-option",23),a(),y(29,Jr,2,0,"mat-error"),a(),y(30,eo,7,1,"div",24),a()()(),r(31,"div",25)(32,"div",16)(33,"h6",17),s(34,"Beschreibung :"),a(),r(35,"div",18)(36,"mat-form-field",19)(37,"mat-label"),s(38,"Beschreibung"),a(),p(39,"textarea",26),a()()()(),r(40,"div",27)(41,"div",16)(42,"h6",17),s(43,"Vorbesitzeinstellungen :"),a(),r(44,"div",28)(45,"div",29)(46,"div",30)(47,"div",31)(48,"span"),s(49," Abweichende Theoriestunden basierend auf Vorbesitzdauer? "),a(),r(50,"div",32),p(51,"mat-slide-toggle",33),r(52,"span",34),s(53),a()()(),y(54,to,6,0,"mat-form-field",35),a(),r(55,"div",30)(56,"div",31)(57,"span"),s(58," Abweichende Praxisstunden basierend auf Vorbesitzdauer? "),a(),r(59,"div",36),p(60,"mat-slide-toggle",37),r(61,"span",34),s(62),a()()(),y(63,no,6,0,"mat-form-field",35),a()()()()(),r(64,"div",38)(65,"div",16)(66,"h6",39),s(67,"Status :"),a(),r(68,"div",28)(69,"mat-slide-toggle",40),s(70," Status Aktiv ? "),a()()()()()()()(),r(71,"div",41)(72,"button",42),u("click",function(){h(o);let g=M(8);return f(n.goNextStep1(g))}),s(73," Weiter "),a()()(),r(74,"mat-step",43),y(75,ro,5,4,"mat-tab-group")(76,so,1,1),a(),r(77,"mat-step",44),y(78,mo,5,4,"mat-tab-group")(79,uo,1,1),a()()()(),p(80,"app-loader",45)}if(e&2){let o,d,g,v,T,W,G=M(25);l(7),c("linear",!0),l(5),c("formGroup",n.combinationFormGroup),l(11),c("formControl",n.licenseClassInput)("matAutocomplete",G),l(3),F(n.filteredLicenseClasses()),l(3),C(n.licenseClassInput.hasError("minClasses")&&n.licenseClassInput.touched?29:-1),l(),C(n.selectedLicenseClasses.length>0?30:-1),l(23),L(" ",(o=n.combinationFormGroup.get("has_previous_theory_knowledge"))!=null&&o.value?"Ja":"Nein"," "),l(),C((d=n.combinationFormGroup.get("has_previous_theory_knowledge"))!=null&&d.value?54:-1),l(8),L(" ",(g=n.combinationFormGroup.get("has_previous_practical_knowledge"))!=null&&g.value?"Ja":"Nein"," "),l(),C((v=n.combinationFormGroup.get("has_previous_practical_knowledge"))!=null&&v.value?63:-1),l(12),C((T=n.combinationFormGroup.get("has_previous_theory_knowledge"))!=null&&T.value?75:76),l(3),C((W=n.combinationFormGroup.get("has_previous_practical_knowledge"))!=null&&W.value?78:79),l(2),c("visible",n.showLoader())}},dependencies:[N,R,oe,V,U,qe,se,ct,K,H,D,Fe,De,Lt,Mt,Tt,ke,Y,j,_e,ce,J,de,We,Xe,ie,$e,ee,ae],styles:[".custom-mat-modal-body[_ngcontent-%COMP%], .modal
2-body[_ngcontent-%COMP%]{padding:0!important}.custom-padding[_ngcontent-%COMP%]{padding:0 0 0 10px!important}.add-combinationclass-modal[_ngcontent-%COMP%]     .mat-horizontal-content-container{padding:0 12px 24px 24px!important}.stepper-buttons[_ngcontent-%COMP%]{margin-top:24px;display:flex;gap:16px;justify-content:space-between;align-items:center}.custom-padding-toggle[_ngcontent-%COMP%]{padding:0 15px}.delivery-method-btn[_ngcontent-%COMP%]:hover   img[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}"]})}};var Di=(i,t)=>t._id;function go(i,t){if(i&1&&(r(0,"mat-option",25),s(1),a()),i&2){let e=t.$implicit,n=m(2);c("value",e),l(),L(" ",n.getClassOptionLabel(e)," ")}}function _o(i,t){i&1&&(r(0,"mat-option",26),s(1,"Keine Klassen gefunden"),a())}function ho(i,t){i&1&&(r(0,"mat-error"),s(1,"Ausgangsklasse ist erforderlich"),a())}function fo(i,t){if(i&1&&(r(0,"mat-option",25),s(1),a()),i&2){let e=t.$implicit,n=m(2);c("value",e),l(),L(" ",n.getClassOptionLabel(e)," ")}}function yo(i,t){i&1&&(r(0,"mat-option",26),s(1,"Keine Klassen gefunden"),a())}function Co(i,t){i&1&&(r(0,"mat-error"),s(1,"Zielklasse ist erforderlich"),a())}function vo(i,t){i&1&&(r(0,"mat-form-field",38)(1,"mat-label"),s(2,"Mindestvorbesitzdauer"),a(),p(3,"input",46),r(4,"span",47),s(5,"Jahre"),a()())}function bo(i,t){i&1&&(r(0,"mat-form-field",38)(1,"mat-label"),s(2,"Mindestvorbesitzdauer"),a(),p(3,"input",48),r(4,"span",47),s(5,"Jahre"),a()())}function xo(i,t){if(i&1){let e=E();r(0,"div",14)(1,"div",15)(2,"div",16)(3,"div",17)(4,"div",18)(5,"div",19)(6,"h6",20),s(7,"Ausgangsklasse (bestehend) :"),a(),r(8,"div",21)(9,"mat-form-field",22)(10,"mat-label"),s(11,"Ausgangsklasse"),a(),p(12,"input",23),r(13,"mat-autocomplete",24,0),A(15,go,2,2,"mat-option",25,Di,!1,_o,2,0,"mat-option",26),a(),y(18,ho,2,0,"mat-error"),a()()()(),r(19,"div",18)(20,"div",19)(21,"h6",20),s(22,"Zielklasse :"),a(),r(23,"div",21)(24,"mat-form-field",22)(25,"mat-label"),s(26,"Zielklasse"),a(),p(27,"input",27),r(28,"mat-autocomplete",24,1),A(30,fo,2,2,"mat-option",25,Di,!1,yo,2,0,"mat-option",26),a(),y(33,Co,2,0,"mat-error"),a()()()(),r(34,"div",28)(35,"div",19)(36,"h6",20),s(37,"Beschreibung :"),a(),r(38,"div",21)(39,"mat-form-field",22)(40,"mat-label"),s(41,"Beschreibung"),a(),p(42,"textarea",29),a()()()(),r(43,"div",30)(44,"div",19)(45,"h6",20),s(46,"Vorbesitzeinstellungen :"),a(),r(47,"div",31)(48,"div",32)(49,"div",33)(50,"div",34)(51,"span"),s(52," Abweichende Theoriestunden basierend auf Vorbesitzdauer? "),a(),r(53,"div",35),p(54,"mat-slide-toggle",36),r(55,"span",37),s(56),a()()(),y(57,vo,6,0,"mat-form-field",38),a(),r(58,"div",33)(59,"div",34)(60,"span"),s(61," Abweichende Praxisstunden basierend auf Vorbesitzdauer? "),a(),r(62,"div",39),p(63,"mat-slide-toggle",40),r(64,"span",37),s(65),a()()(),y(66,bo,6,0,"mat-form-field",38),a()()()()(),r(67,"div",41)(68,"div",19)(69,"h6",42),s(70,"Status :"),a(),r(71,"div",31)(72,"mat-slide-toggle",43),s(73," Status Aktiv ? "),a()()()()()()(),r(74,"div",44)(75,"button",45),u("click",function(){h(e);let o=m();return f(o.saveDetailsTab())}),s(76," Speichern "),a()()()}if(i&2){let e,n,o,d,g,v,T=M(14),W=M(29),G=m();l(),c("formGroup",G.extensionFormGroup),l(11),c("matAutocomplete",T),l(),c("displayWith",G.displayClassFn),l(2),F(G.filteredExistingClasses()),l(3),C((e=G.extensionFormGroup.get("existing_class"))!=null&&e.hasError("required")&&((e=G.extensionFormGroup.get("existing_class"))!=null&&e.touched)?18:-1),l(9),c("matAutocomplete",W),l(),c("displayWith",G.displayClassFn),l(2),F(G.filteredNewClasses()),l(3),C((n=G.extensionFormGroup.get("new_class"))!=null&&n.hasError("required")&&((n=G.extensionFormGroup.get("new_class"))!=null&&n.touched)?33:-1),l(23),L(" ",(o=G.extensionFormGroup.get("has_previous_theory_knowledge"))!=null&&o.value?"Ja":"Nein"," "),l(),C((d=G.extensionFormGroup.get("has_previous_theory_knowledge"))!=null&&d.value?57:-1),l(8),L(" ",(g=G.extensionFormGroup.get("has_previous_practical_knowledge"))!=null&&g.value?"Ja":"Nein"," "),l(),C((v=G.extensionFormGroup.get("has_previous_practical_knowledge"))!=null&&v.value?66:-1)}}function So(i,t){if(i&1&&p(0,"app-theory-lession",50),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","THEORY")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","STANDARD")}}function Eo(i,t){if(i&1&&p(0,"app-theory-lession",50),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","THEORY")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","EXPERIENCE")}}function wo(i,t){if(i&1&&(r(0,"mat-tab-group")(1,"mat-tab",49),y(2,So,1,7,"app-theory-lession",50),a(),r(3,"mat-tab",51),y(4,Eo,1,7,"app-theory-lession",50),a()()),i&2){let e=m(2);l(2),C(e.theoryLoaded?2:-1),l(),c("label",Le("",e.theoryExperienceYears," Jahre V
2orbesitz")),l(),C(e.theoryLoaded?4:-1)}}function To(i,t){if(i&1&&p(0,"app-theory-lession",50),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","THEORY")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","STANDARD")}}function Lo(i,t){if(i&1&&y(0,To,1,7,"app-theory-lession",50),i&2){let e=m(2);C(e.theoryLoaded?0:-1)}}function Mo(i,t){if(i&1){let e=E();y(0,wo,5,4,"mat-tab-group")(1,Lo,1,1),r(2,"div",44)(3,"button",45),u("click",function(){h(e);let o=m();return f(o.saveTheoryTab())}),s(4," Speichern "),a()()}if(i&2){let e=m();C(e.hasTheoryExperienceTabs?0:1)}}function Io(i,t){if(i&1&&p(0,"app-theory-lession",50),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","PRACTICAL")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","STANDARD")}}function Po(i,t){if(i&1&&p(0,"app-theory-lession",50),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","PRACTICAL")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","EXPERIENCE")}}function Ao(i,t){if(i&1&&(r(0,"mat-tab-group")(1,"mat-tab",49),y(2,Io,1,7,"app-theory-lession",50),a(),r(3,"mat-tab",51),y(4,Po,1,7,"app-theory-lession",50),a()()),i&2){let e=m(2);l(2),C(e.practicalLoaded?2:-1),l(),c("label",Le("",e.practicalExperienceYears," Jahre Vorbesitz")),l(),C(e.practicalLoaded?4:-1)}}function Fo(i,t){if(i&1&&p(0,"app-theory-lession",50),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","PRACTICAL")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","STANDARD")}}function Do(i,t){if(i&1&&y(0,Fo,1,7,"app-theory-lession",50),i&2){let e=m(2);C(e.practicalLoaded?0:-1)}}function ko(i,t){if(i&1){let e=E();y(0,Ao,5,4,"mat-tab-group")(1,Do,1,1),r(2,"div",44)(3,"button",45),u("click",function(){h(e);let o=m();return f(o.savePracticalTab())}),s(4," Speichern "),a()()}if(i&2){let e=m();C(e.hasPracticalExperienceTabs?0:1)}}var Mn=class i{constructor(){this.dialogRef=b(te);this.formBuilder=b(Q);this.userService=b(le);this.theoryLessonsService=b(q);this.lessonStateService=b(fe);this.sweetAlert=b(O);this.showLoader=w(!1);this.ERROR_MESSAGES=we;this.data=b(ne,{optional:!0})??{countryId:"",drivingLicenseClasses:[]};this.drivingLicenseClasses=w(this.data.drivingLicenseClasses??[]);this.existingClassSearch=w("");this.newClassSearch=w("");this.selectedExistingClassCode=w("");this.theoryLoaded=!1;this.practicalLoaded=!1;this.activeDrivingLicenseClasses=k(()=>this.drivingLicenseClasses().filter(t=>t.status==="active"));this.filteredExistingClasses=k(()=>this.filterLicenseClasses(this.activeDrivingLicenseClasses(),this.existingClassSearch()));this.filteredNewClasses=k(()=>{let t=this.selectedExistingClassCode(),e=t?this.activeDrivingLicenseClasses().filter(n=>n.class_code!==t):this.activeDrivingLicenseClasses();return this.filterLicenseClasses(e,this.newClassSearch())});this.extensionFormGroup=this.formBuilder.group({existing_class:[null,[_.required,this.licenseClassValidator.bind(this)]],new_class:[null,[_.required,this.licenseClassValidator.bind(this)]],description:[""],has_previous_theory_knowledge:[!1],has_previous_practical_knowledge:[!1],theory_previous_duration:[null],practical_previous_duration:[null],isActive:[!0]});this.displayClassFn=t=>t?typeof t=="string"?t:this.getClassOptionLabel(t):""}ngOnInit(){this.bindClassSearch("existing_class",this.existingClassSearch,this.selectedExistingClassCode),this.bindClassSearch("new_class",this.newClassSearch),this.initializeEditData()}get hasTheoryExperienceTabs(){return!!this.extensionFormGroup.get("has_previous_theory_knowledge")?.value}get hasPracticalExperienceTabs(){return!!this.extensionFormGroup.get("has_previous_practical_knowledge")?.value}get theoryExperienceYears(){return this.extensionFormGroup.get("theory_previous_duration")?.value??null}get practicalExperienceYears(){return this.extensionFormGroup.get("practical_previous_duration")?.value??null}get qualificationPathId(){return this.data.extension?._id??""}get licenseClassId(){return this.data.extension?.to_class?._id??this.data.extension?.to_class_id??this.extensionFormGroup.get("new_class")?.value?._id??""}closeModal(){me(this.sweetAlert,_t(this.extensionFormGroup.dirty,this.lessonStateService),()=>this.dialogRef.close(!1))}saveExtension(){this.saveQualificationPath("Erweiterung erfolgreich gespeichert")}saveDetailsTab(){this.saveQualificationPath("Erweiterungsdetails erfolgreich gespeichert")}saveTheoryTab(){this.saveQualificationPath("Theorieanforderungen erfolgreich gespeichert")}savePracticalTab(){this.saveQualificationPath("Praxisanforderungen erfolgreich gespeichert")}saveQualificationPath(t){if(this.extensionFormGroup.invalid){this.extensionFormGroup.markAllAsTouched();return}let e=Sn(this.extensionFormGroup.getRawValue(),this.data.countryId,this.lessonStateService.getLessons(),this.lessonStateService.getLicenseClassSettings(),this.qual
2ificationPathId);this.showLoader.set(!0),this.theoryLessonsService.createQualificationPath(e).subscribe({next:()=>{this.showLoader.set(!1),this.lessonStateService.markClean(),this.sweetAlert.success("Erfolg",t,"OK").subscribe(()=>{this.dialogRef.close(!0),this.data.onSaved?.()})},error:n=>{this.showLoader.set(!1);let o=n?.error?.errorCode,d=o?this.ERROR_MESSAGES[o]:"";this.sweetAlert.error("Fehler",d||n?.error?.message||"Erweiterung konnte nicht gespeichert werden")}})}onTabChange(t){t.index===1&&(this.theoryLoaded=!0),t.index===2&&(this.practicalLoaded=!0)}getClassOptionLabel(t){return`${t.class_code} - ${t.class_name}`}get dialogTitle(){let t="Erweiterung bearbeiten",e=this.getSelectedClassCode(this.extensionFormGroup.get("existing_class")?.value),n=this.getSelectedClassCode(this.extensionFormGroup.get("new_class")?.value);return e&&n?`${t}: ${e} \u2192 ${n}`:e||n?`${t}: ${e||n}`:t}getSelectedClassCode(t){return!t||typeof t=="string"?"":t.class_code||""}bindClassSearch(t,e,n){this.extensionFormGroup.get(t)?.valueChanges.subscribe(o=>{if(typeof o=="string"){e.set(o),n&&n.set("");return}if(e.set(""),n&&o?.class_code){n.set(o.class_code);let d=this.extensionFormGroup.get("new_class")?.value;d&&typeof d!="string"&&d.class_code===o.class_code&&this.extensionFormGroup.patchValue({new_class:null})}})}licenseClassValidator(t){let e=t.value;return!e||typeof e=="string"?{required:!0}:e.class_code?null:{required:!0}}filterLicenseClasses(t,e){let n=e.trim().toLowerCase();return n?t.filter(o=>o.class_code?.toLowerCase().includes(n)||o.class_name?.toLowerCase().includes(n)):t}findClassByCode(t){return this.drivingLicenseClasses().find(e=>e.class_code===t)??null}findClassById(t){return this.drivingLicenseClasses().find(e=>e._id===t)??null}resolveLicenseClass(t){return t?this.findClassById(t._id??"")??this.findClassByCode(t.class_code??"")??t:null}initializeEditData(){let t=this.data.extension;if(!t||!this.data.countryId)return;let e=t._id??"",n=t.to_class?._id??t.to_class_id??"";if(!e||!n){this.loadDrivingLicenseClassesAndPatch(t);return}this.showLoader.set(!0);let o=this.drivingLicenseClasses().length?be(this.drivingLicenseClasses()):this.userService.getdrivingLicenseClasses(this.data.countryId).pipe(ve(g=>g?.data??[]),pe(()=>be([]))),d=this.theoryLessonsService.getQualificationPathMappingData(this.data.countryId,{qualification_path_id:e,framework_type:"THEORY",status_tab:"STANDARD",page:1,limit:1}).pipe(pe(()=>be(null)));He({classes:o,context:d}).subscribe({next:({classes:g,context:v})=>{this.showLoader.set(!1),this.drivingLicenseClasses.set(g),console.log("[EditExtension] mapping context_data",v?.context_data),rt(this.lessonStateService,v?.context_data);let T=Ht(t,v?.context_data);this.patchFormFromExtension(T)},error:g=>{this.showLoader.set(!1),console.log("[EditExtension] error loading context",g),this.loadDrivingLicenseClassesAndPatch(t)}})}loadDrivingLicenseClassesAndPatch(t){if(!this.drivingLicenseClasses().length&&this.data.countryId){this.userService.getdrivingLicenseClasses(this.data.countryId).subscribe({next:e=>{this.drivingLicenseClasses.set(e?.data??[]),this.patchFormFromExtension(t??this.data.extension)},error:()=>{this.drivingLicenseClasses.set([]),this.patchFormFromExtension(t??this.data.extension)}});return}this.patchFormFromExtension(t??this.data.extension)}patchFormFromExtension(t){if(!t)return;let e=un(t),n=t.from_class,o=t.to_class,d=String(t.combination||"").split("+").map(T=>T.trim()).filter(Boolean),g=n?.class_code??t.existing_class??d[0]??"",v=o?.class_code??t.new_class??d[1]??"";this.extensionFormGroup.patchValue(X(I({existing_class:this.resolveLicenseClass(n)??this.findClassByCode(g),new_class:this.resolveLicenseClass(o)??this.findClassByCode(v),description:t.description??""},e),{isActive:t.isActive??(t.status===1||t.status==="active")})),g&&this.selectedExistingClassCode.set(g),gn("EditExtension",e),console.log("[EditExtension] experience_required from API",t.experience_required)}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-edit-extension"]],features:[Ke([fe])],decls:15,vars:2,consts:[["existingClassAuto","matAutocomplete"],["newClassAuto","matAutocomplete"],[1,"modal-content","edit-extension-modal"],[1,"custom-mat-modal-header"],[1,"title"],["type","button",1,"btn-close",3,"click"],["src","../../../assets/closeModel.svg","alt","closeModel",2,"height","20px"],[1,"custom-mat-modal-body"],["mat-stretch-tabs","false","mat-align-tabs","start",1,"custom-stepper",3,"selectedTabChange"],["label","Erweiterungsdetails"],["matTabContent",""],["label","Theorieanforderungen"],["label","Praxisanforderungen"],[3,"visible"],[1,"modal-body","mt-3"],[1,"row","m-0",3,"formGroup"],[1,"col-sm-12"],[1,"row","pb-2","d-flex","justify-content-between"],[1,"col-md-6","col-sm-12","custom-padding"],[1,"field-heading-parent"],[1,"field-heading","mb-2"],[1,"px-2"],["appearance","outline",1,"w-100","bg-white"],["type","text","matInput","","formControlName","existing_class","placeholder","Klasse suchen...",3,"matAutocomplete"],[3,"displayWith"],[3,"value"],["disabled",""],["type","text","matInput","","formControlName","new_class","placeholder","Klasse suchen...",3,"matAutocomplete"],[1,"col-sm-12","custom-padding","mt-3","mb-3"],["matInput","","formControlName","description","placeholder","Beschreibung der Erweiterung ...","maxlength","500","rows","3"],[1,"col-12","col-md-12","col-sm-12","custom-padding"],[1,"p-3"],[1,"row"],[1,"col-md-6","col-sm-12","custom-padding-toggle"],[1,"d-flex","justify-content-between","align-items-center","mb-2"],[1,"d-flex","align-items-center","gap-2"],["formControlName","has_previous_theory_knowledge"],[1,"ml-2","toggle-label"],["appearance","outline",1,"w-100","mt-2"],[1,"d-flex","align-items-center"],["formControlName","has_previous_practical_knowledge"],[1,"col-sm-12","custom-padding","mt-3"],[1,"field-heading"],["formControlName","isActive"],[1,"stepper-buttons","d-flex","justify-content-end","mt-3","px-3","pb-3"],["type","button",1,"primary-button",3,"click"],["matInput","","type","number","min","0","formControlName","theory_previous_duration"],["matTextSuffix",""],["matInput","","type","number","min","0","formControlName","practical_previous_duration"],["label","Standard"],[3,"showStepperNav","showInfoMessage","countryId","frameworkType","qualificationPathId","licenseClassId","statusTab"],[3,"label"]],template:function(e,n){e&1&&(r(0,"div",2)(1,"div",3)(2,"h2",4),s(3),a(),r(4,"button",5),u("click",function(){return n.closeModal()}),p(5,"img",6),a()(),r(6,"div",7)(7,"mat-tab-group",8),u("selectedTabChange",function(d){return n.onTabChange(d)}),r(8,"mat-tab",9),x(9,xo,77,13,"ng-template",10),a(),r(10,"mat-tab",11),x(11,Mo,5,1,"ng-template",10),a(),r(12,"mat-tab",12),x(13,ko,5,1,"ng-template",10),a()()()(),p(14,"app-loader",13)),e&2&&(l(3),S(n.dialogTitle),l(11),c("visible",n.showLoader()))},dependencies:[N,R,oe,V,U,qe,se,K,H,D,wt,Fe,De,Y,j,_e,ce,J,de,We,Xe,ie,$e,ae],styles:[".custom-mat-modal-body[_ngcontent-%COMP%], .modal
2-body[_ngcontent-%COMP%]{padding:0!important}.custom-padding[_ngcontent-%COMP%]{padding:0 0 0 10px!important}.edit-extension-modal[_ngcontent-%COMP%]     .mat-horizontal-content-container, .edit-extension-modal[_ngcontent-%COMP%]     .mat-mdc-tab-body-content{padding:0 12px 24px 24px!important}.stepper-buttons[_ngcontent-%COMP%]{margin-top:24px;display:flex;gap:16px;justify-content:space-between;align-items:center}.custom-padding-toggle[_ngcontent-%COMP%]{padding:0 15px}"]})}};var Oo=(i,t)=>t._id;function No(i,t){if(i&1&&(r(0,"mat-option",24),s(1),a()),i&2){let e=t.$implicit,n=m(2);c("value",e),l(),L(" ",n.getClassOptionLabel(e)," ")}}function Go(i,t){i&1&&(r(0,"mat-option",25),s(1,"Keine Klassen gefunden"),a())}function Ro(i,t){i&1&&(r(0,"mat-error"),s(1,"F\xFChrerscheinklassen ist erforderlich"),a())}function Vo(i,t){if(i&1){let e=E();r(0,"button",49),s(1),r(2,"img",50),u("click",function(o){let d=h(e).$implicit,g=m(3);return f(g.removeLicenseClass(d,o))}),a()()}if(i&2){let e=t.$implicit,n=m(3);l(),L(" ",n.getLicenseClassLabel(e)," ")}}function qo(i,t){if(i&1&&A(0,Vo,3,1,"button",49,Ce),i&2){let e=m(2);F(e.selectedLicenseClasses)}}function $o(i,t){i&1&&p(0,"app-no-data",30),i&2&&c("message","Keine F\xFChrerscheinklasse ausgew\xE4hlt")}function Bo(i,t){i&1&&(r(0,"mat-form-field",41)(1,"mat-label"),s(2,"Mindestvorbesitzdauer"),a(),p(3,"input",51),r(4,"span",52),s(5,"Jahre"),a()())}function zo(i,t){i&1&&(r(0,"mat-form-field",41)(1,"mat-label"),s(2,"Mindestvorbesitzdauer"),a(),p(3,"input",53),r(4,"span",52),s(5,"Jahre"),a()())}function Uo(i,t){if(i&1){let e=E();r(0,"div",13)(1,"div",14)(2,"div",15)(3,"div",16)(4,"div",17)(5,"div",18)(6,"h6",19),s(7,"F\xFChrerscheinklassen :"),a(),r(8,"div",20)(9,"mat-form-field",21)(10,"mat-label"),s(11,"F\xFChrerscheinklassen"),a(),p(12,"input",22),r(13,"mat-autocomplete",23,0),u("optionSelected",function(o){h(e);let d=m();return f(d.onLicenseClassSelected(o.option.value))}),A(15,No,2,2,"mat-option",24,Oo,!1,Go,2,0,"mat-option",25),a(),y(18,Ro,2,0,"mat-error"),a(),r(19,"div",26)(20,"label",27),s(21," Ausgew\xE4hlte F\xFChrerscheinklassen : "),a(),r(22,"div",28)(23,"div",29),y(24,qo,2,0)(25,$o,1,1,"app-no-data",30),a()()()()()(),r(26,"div",31)(27,"div",18)(28,"h6",19),s(29,"Beschreibung :"),a(),r(30,"div",20)(31,"mat-form-field",21)(32,"mat-label"),s(33,"Beschreibung"),a(),p(34,"textarea",32),a()()()(),r(35,"div",33)(36,"div",18)(37,"h6",19),s(38,"Vorbesitzeinstellungen :"),a(),r(39,"div",34)(40,"div",35)(41,"div",36)(42,"div",37)(43,"span"),s(44," Abweichende Theoriestunden basierend auf Vorbesitzdauer? "),a(),r(45,"div",38),p(46,"mat-slide-toggle",39),r(47,"span",40),s(48),a()()(),y(49,Bo,6,0,"mat-form-field",41),a(),r(50,"div",36)(51,"div",37)(52,"span"),s(53," Abweichende Praxisstunden basierend auf Vorbesitzdauer? "),a(),r(54,"div",42),p(55,"mat-slide-toggle",43),r(56,"span",40),s(57),a()()(),y(58,zo,6,0,"mat-form-field",41),a()()()()(),r(59,"div",44)(60,"div",18)(61,"h6",45),s(62,"Status :"),a(),r(63,"div",34)(64,"mat-slide-toggle",46),s(65," Status Aktiv ? "),a()()()()()()(),r(66,"div",47)(67,"button",48),u("click",function(){h(e);let o=m();return f(o.saveDetailsTab())}),s(68," Speichern "),a()()()}if(i&2){let e,n,o,d,g,v=M(14),T=m();l(),c("formGroup",T.combinationFormGroup),l(11),c("formControl",T.licenseClassInput)("matAutocomplete",v),l(3),F(T.filteredLicenseClasses()),l(3),C((e=T.combinationFormGroup.get("license_classes"))!=null&&e.hasError("required")&&((e=T.combinationFormGroup.get("license_classes"))!=null&&e.touched)?18:-1),l(6),C(T.selectedLicenseClasses.length>0?24:25),l(24),L(" ",(n=T.combinationFormGroup.get("has_previous_theory_knowledge"))!=null&&n.value?"Ja":"Nein"," "),l(),C((o=T.combinationFormGroup.get("has_previous_theory_knowledge"))!=null&&o.value?49:-1),l(8),L(" ",(d=T.combinationFormGroup.get("has_previous_practical_knowledge"))!=null&&d.value?"Ja":"Nein"," "),l(),C((g=T.combinationFormGroup.get("has_previous_practical_knowledge"))!=null&&g.value?58:-1)}}function Ho(i,t){if(i&1&&p(0,"app-theory-lession",55),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","THEORY")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","STANDARD")}}function Ko(i,t){if(i&1&&p(0,"app-theory-lession",55),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","THEORY")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","EXPERIENCE")}}function Qo(i,t){if(i&1&&(r(0,"mat-tab-group")(1,"mat-tab",54),y(2,Ho,1,7,"app-theory-lession",55),a(),r(3,"mat-tab",56),y(4,Ko,1,7,"app-theory-lession",55),a()()),i&2){let e=m(2);l(2),C(e.theoryLoaded?2:-1),l(),c("label",Le("",e.theoryExperienceYears," Jahre V
2orbesitz")),l(),C(e.theoryLoaded?4:-1)}}function jo(i,t){if(i&1&&p(0,"app-theory-lession",55),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","THEORY")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","STANDARD")}}function Yo(i,t){if(i&1&&y(0,jo,1,7,"app-theory-lession",55),i&2){let e=m(2);C(e.theoryLoaded?0:-1)}}function Jo(i,t){if(i&1){let e=E();y(0,Qo,5,4,"mat-tab-group")(1,Yo,1,1),r(2,"div",47)(3,"button",48),u("click",function(){h(e);let o=m();return f(o.saveTheoryTab())}),s(4," Speichern "),a()()}if(i&2){let e=m();C(e.hasTheoryExperienceTabs?0:1)}}function Wo(i,t){if(i&1&&p(0,"app-theory-lession",55),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","PRACTICAL")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","STANDARD")}}function Xo(i,t){if(i&1&&p(0,"app-theory-lession",55),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","PRACTICAL")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","EXPERIENCE")}}function Zo(i,t){if(i&1&&(r(0,"mat-tab-group")(1,"mat-tab",54),y(2,Wo,1,7,"app-theory-lession",55),a(),r(3,"mat-tab",56),y(4,Xo,1,7,"app-theory-lession",55),a()()),i&2){let e=m(2);l(2),C(e.practicalLoaded?2:-1),l(),c("label",Le("",e.practicalExperienceYears," Jahre Vorbesitz")),l(),C(e.practicalLoaded?4:-1)}}function es(i,t){if(i&1&&p(0,"app-theory-lession",55),i&2){let e=m(3);c("showStepperNav",!1)("showInfoMessage",!0)("countryId",e.data.countryId)("frameworkType","PRACTICAL")("qualificationPathId",e.qualificationPathId)("licenseClassId",e.licenseClassId)("statusTab","STANDARD")}}function ts(i,t){if(i&1&&y(0,es,1,7,"app-theory-lession",55),i&2){let e=m(2);C(e.practicalLoaded?0:-1)}}function ns(i,t){if(i&1){let e=E();y(0,Zo,5,4,"mat-tab-group")(1,ts,1,1),r(2,"div",47)(3,"button",48),u("click",function(){h(e);let o=m();return f(o.savePracticalTab())}),s(4," Speichern "),a()()}if(i&2){let e=m();C(e.hasPracticalExperienceTabs?0:1)}}var In=class i{constructor(){this.dialogRef=b(te);this.formBuilder=b(Q);this.userService=b(le);this.theoryLessonsService=b(q);this.lessonStateService=b(fe);this.sweetAlert=b(O);this.showLoader=w(!1);this.ERROR_MESSAGES=we;this.data=b(ne,{optional:!0})??{countryId:"",drivingLicenseClasses:[]};this.drivingLicenseClasses=w(this.data.drivingLicenseClasses??[]);this.licenseClassSearch=w("");this.licenseClassInput=new dt("");this.theoryLoaded=!1;this.practicalLoaded=!1;this.combinationFormGroup=this.formBuilder.group({license_classes:[[],_.required],description:[""],has_previous_theory_knowledge:[!1],has_previous_practical_knowledge:[!1],theory_previous_duration:[null],practical_previous_duration:[null],isActive:[!0]});this.activeDrivingLicenseClasses=k(()=>this.drivingLicenseClasses().filter(t=>t.status==="active"));this.filteredLicenseClasses=k(()=>{let t=this.selectedLicenseClasses,e=this.activeDrivingLicenseClasses().filter(n=>!t.includes(n.class_code));return this.filterLicenseClasses(e,this.licenseClassSearch())})}ngOnInit(){this.licenseClassInput.valueChanges.subscribe(t=>{this.licenseClassSearch.set(typeof t=="string"?t:"")}),this.initializeEditData()}get hasTheoryExperienceTabs(){return!!this.combinationFormGroup.get("has_previous_theory_knowledge")?.value}get hasPracticalExperienceTabs(){return!!this.combinationFormGroup.get("has_previous_practical_knowledge")?.value}get theoryExperienceYears(){return this.combinationFormGroup.get("theory_previous_duration")?.value??null}get practicalExperienceYears(){return this.combinationFormGroup.get("practical_previous_duration")?.value??null}get qualificationPathId(){return this.data.combinationClass?._id??""}get licenseClassId(){let t=this.data.combinationClass?.classes??[];if(t.length)return t[0]._id??"";let e=this.selectedLicenseClasses;return e.length?this.drivingLicenseClasses().find(n=>n.class_code===e[0])?._id??"":""}get selectedLicenseClasses(){return this.combinationFormGroup.get("license_classes")?.value??[]}get dialogTitle(){let t="Kombination bearbeiten",e=this.selectedLicenseClasses;return e.length?`${t}: ${e.join(" + ")}`:t}onLicenseClassSelected(t){if(!t?.class_code)return;let e=[...this.selectedLicenseClasses];e.includes(t.class_code)||(e.push(t.class_code),this.combinationFormGroup.patchValue({license_classes:e}),this.combinationFormGroup.get("license_classes")?.markAsTouched()),this.licenseClassInput.setValue("",{emitEvent:!1}),this.licenseClassSearch.set("")}getClassOptionLabel(t){return`${t.class_code} - ${t.class_name}`}getLicenseClassLabel(t){let e=this.drivingLicenseClasses().find(n=>n.class_code===t);return e?this.getClassOptionLabel(e):t}removeLicenseClass(t,e){e?.stopPropagation();let n=this.selectedLicenseClasses.filter(o=>o!==t);this.combinationFormGroup.patchValue({license_classes:n}),this.combinationFormGroup.get("license_classes")?.markAsTouched()}closeModal(){me(this.sweetAlert,_t(this.combinationFormGroup.dirty,this.lessonStateService),()=>this.dialogRef.close(!1))}
2saveCombinationClass(){this.saveQualificationPath("Kombination erfolgreich gespeichert")}saveDetailsTab(){this.saveQualificationPath("Kombinationsdetails erfolgreich gespeichert")}saveTheoryTab(){this.saveQualificationPath("Theorieanforderungen erfolgreich gespeichert")}savePracticalTab(){this.saveQualificationPath("Praxisanforderungen erfolgreich gespeichert")}saveQualificationPath(t){if(this.combinationFormGroup.invalid){this.combinationFormGroup.markAllAsTouched();return}let e=En(this.combinationFormGroup.getRawValue(),this.data.countryId,this.lessonStateService.getLessons(),this.drivingLicenseClasses(),this.lessonStateService.getLicenseClassSettings(),this.qualificationPathId);this.showLoader.set(!0),this.theoryLessonsService.createQualificationPath(e).subscribe({next:()=>{this.showLoader.set(!1),this.lessonStateService.markClean(),this.sweetAlert.success("Erfolg",t,"OK").subscribe(()=>{this.dialogRef.close(!0),this.data.onSaved?.()})},error:n=>{this.showLoader.set(!1);let o=n?.error?.errorCode,d=o?this.ERROR_MESSAGES[o]:"";this.sweetAlert.error("Fehler",d||n?.error?.message||"Kombination konnte nicht gespeichert werden")}})}onTabChange(t){t.index===1&&(this.theoryLoaded=!0),t.index===2&&(this.practicalLoaded=!0)}filterLicenseClasses(t,e){let n=e.trim().toLowerCase();return n?t.filter(o=>o.class_code?.toLowerCase().includes(n)||o.class_name?.toLowerCase().includes(n)):t}resolveLicenseClassId(t){let e=t?.classes??[];if(e.length)return e[0]._id??"";let n=t?.license_classes??String(t?.combination||"").split("+").map(o=>o.trim()).filter(Boolean);return n.length?this.drivingLicenseClasses().find(o=>o.class_code===n[0])?._id??"":""}initializeEditData(){let t=this.data.combinationClass;if(!t||!this.data.countryId)return;let e=t._id??"",n=this.resolveLicenseClassId(t);if(!e||!n){this.loadDrivingLicenseClassesAndPatch(t);return}this.showLoader.set(!0);let o=this.drivingLicenseClasses().length?be(this.drivingLicenseClasses()):this.userService.getdrivingLicenseClasses(this.data.countryId).pipe(ve(g=>g?.data??[]),pe(()=>be([]))),d=this.theoryLessonsService.getQualificationPathMappingData(this.data.countryId,{qualification_path_id:e,framework_type:"THEORY",status_tab:"STANDARD",page:1,limit:1}).pipe(pe(()=>be(null)));He({classes:o,context:d}).subscribe({next:({classes:g,context:v})=>{this.showLoader.set(!1),this.drivingLicenseClasses.set(g),console.log("[EditCombinationClass] mapping context_data",v?.context_data),rt(this.lessonStateService,v?.context_data);let T=Ht(t,v?.context_data);this.patchFormFromCombinationClass(T)},error:g=>{this.showLoader.set(!1),console.log("[EditCombinationClass] error loading context",g),this.loadDrivingLicenseClassesAndPatch(t)}})}loadDrivingLicenseClassesAndPatch(t){let e=t??this.data.combinationClass;if(!this.drivingLicenseClasses().length&&this.data.countryId){this.userService.getdrivingLicenseClasses(this.data.countryId).subscribe({next:n=>{this.drivingLicenseClasses.set(n?.data??[]),this.loadContextAndPatch(e)},error:()=>{this.drivingLicenseClasses.set([]),this.patchFormFromCombinationClass(e)}});return}this.loadContextAndPatch(e)}loadContextAndPatch(t){if(!t?._id||!this.data.countryId){this.patchFormFromCombinationClass(t);return}if(!this.resolveLicenseClassId(t)){this.patchFormFromCombinationClass(t);return}this.theoryLessonsService.getQualificationPathMappingData(this.data.countryId,{qualification_path_id:t._id,framework_type:"THEORY",status_tab:"STANDARD",page:1,limit:1}).pipe(pe(()=>be(null))).subscribe(n=>{rt(this.lessonStateService,n?.context_data);let o=Ht(t,n?.context_data);this.patchFormFromCombinationClass(o)})}patchFormFromCombinationClass(t){if(!t)return;let e=un(t),n=(t.classes??[]).map(d=>
2d?.class_code).filter(Boolean),o=t.license_classes??String(t.combination||"").split("+").map(d=>d.trim()).filter(Boolean);this.combinationFormGroup.patchValue(X(I({license_classes:n.length?n:o,description:t.description??""},e),{isActive:t.isActive??(t.status===1||t.status==="active")})),gn("EditCombinationClass",e),console.log("[EditCombinationClass] experience_required from API",t.experience_required)}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-edit-combination-class"]],features:[Ke([fe])],decls:15,vars:2,consts:[["licenseClassAuto","matAutocomplete"],[1,"modal-content","edit-combinationclass-modal"],[1,"custom-mat-modal-header"],[1,"title"],["type","button",1,"btn-close",3,"click"],["src","../../../assets/closeModel.svg","alt","closeModel",2,"height","20px"],[1,"custom-mat-modal-body"],["mat-stretch-tabs","false","mat-align-tabs","start",1,"custom-stepper",3,"selectedTabChange"],["label","Kombinationsdetails"],["matTabContent",""],["label","Theorieanforderungen"],["label","Praxisanforderungen"],[3,"visible"],[1,"modal-body","mt-3"],[1,"row","m-0",3,"formGroup"],[1,"col-sm-12"],[1,"row","pb-2","d-flex","justify-content-between"],[1,"col-sm-12","custom-padding"],[1,"field-heading-parent"],[1,"field-heading","mb-2"],[1,"px-2"],["appearance","outline",1,"w-100","bg-white"],["type","text","matInput","","placeholder","Klasse suchen und ausw\xE4hlen...",3,"formControl","matAutocomplete"],[3,"optionSelected"],[3,"value"],["disabled",""],[1,"mt-2"],[1,"fw-medium"],[1,"p-2"],[1,"scroll-main-div"],[3,"message"],[1,"col-sm-12","custom-padding","mt-3","mb-3"],["matInput","","formControlName","description","placeholder","Beschreibung der Kombination ...","maxlength","500","rows","3"],[1,"col-12","col-md-12","col-sm-12","custom-padding"],[1,"p-3"],[1,"row"],[1,"col-md-6","col-sm-12","custom-padding-toggle"],[1,"d-flex","justify-content-between","align-items-center","mb-2"],[1,"d-flex","align-items-center","gap-2"],["formControlName","has_previous_theory_knowledge"],[1,"ml-2","toggle-label"],["appearance","outline",1,"w-100","mt-2"],[1,"d-flex","align-items-center"],["formControlName","has_previous_practical_knowledge"],[1,"col-sm-12","custom-padding","mt-3"],[1,"field-heading"],["formControlName","isActive"],[1,"stepper-buttons","d-flex","justify-content-end","mt-3","px-3","pb-3"],["type","button",1,"primary-button",3,"click"],["type","button",1,"btn","button-primary","delivery-method-btn","mr-2"],["src","../../../assets/closeModel.svg","alt","Close","width","10","height","10",1,"ms-2",3,"click"],["matInput","","type","number","min","0","formControlName","theory_previous_duration"],["matTextSuffix",""],["matInput","","type","number","min","0","formControlName","practical_previous_duration"],["label","Standard"],[3,"showStepperNav","showInfoMessage","countryId","frameworkType","qualificationPathId","licenseClassId","statusTab"],[3,"label"]],template:function(e,n){e&1&&(r(0,"div",1)(1,"div",2)(2,"h2",3),s(3),a(),r(4,"button",4),u("click",function(){return n.closeModal()}),p(5,"img",5),a()(),r(6,"div",6)(7,"mat-tab-group",7),u("selectedTabChange",function(d){return n.onTabChange(d)}),r(8,"mat-tab",8),x(9,Uo,69,10,"ng-template",9),a(),r(10,"mat-tab",10),x(11,Jo,5,1,"ng-template",9),a(),r(12,"mat-tab",11),x(13,ns,5,1,"ng-template",9),a()()()(),p(14,"app-loader",12)),e&2&&(l(3),S(n.dialogTitle),l(11),c("visible",n.showLoader()))},dependencies:[N,R,oe,V,U,qe,se,ct,K,H,D,wt,Fe,De,Y,j,_e,ce,J,de,We,Xe,ie,$e,ee,ae],styles:[".custom-mat-modal-body[_ngcontent-%COMP%], .modal
2-body[_ngcontent-%COMP%]{padding:0!important}.custom-padding[_ngcontent-%COMP%]{padding:0 0 0 10px!important}.edit-combinationclass-modal[_ngcontent-%COMP%]     .mat-horizontal-content-container, .edit-combinationclass-modal[_ngcontent-%COMP%]     .mat-mdc-tab-body-content{padding:0 12px 24px 24px!important}.stepper-buttons[_ngcontent-%COMP%]{margin-top:24px;display:flex;gap:16px;justify-content:space-between;align-items:center}.custom-padding-toggle[_ngcontent-%COMP%]{padding:0 15px}.delivery-method-btn[_ngcontent-%COMP%]:hover   img[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}"]})}};var is=()=>[],as=(i,t)=>t._id;function rs(i,t){if(i&1){let e=E();r(0,"button",32),u("click",function(){h(e);let o=m().$implicit,d=m();return f(d.updateStatus(o))}),s(1," Aktivieren "),a()}}function os(i,t){if(i&1){let e=E();r(0,"button",33),u("click",function(){h(e);let o=m().$implicit,d=m();return f(d.updateStatus(o))}),s(1," Deaktivieren "),a()}}function ss(i,t){if(i&1){let e=E();r(0,"tr")(1,"td"),s(2),a(),r(3,"td"),s(4),a(),r(5,"td"),s(6),a(),r(7,"td"),s(8),a(),r(9,"td"),s(10),a(),r(11,"td"),p(12,"span"),a(),r(13,"td",26)(14,"div",27)(15,"button",28),u("click",function(){let o=h(e).$implicit,d=m();return f(d.isExtension()?d.editExtension(o):d.editCombinationClass(o))}),s(16," \xD6ffnen "),a(),r(17,"button",29)(18,"mat-icon"),s(19,"menu"),a()(),r(20,"mat-menu",null,1),y(22,rs,2,0,"button",30),y(23,os,2,0,"button",31),a()()()()}if(i&2){let e=t.$implicit,n=t.$index,o=M(21),d=m();l(2),S(d.startRecord()+n),l(2),S(d.getCombinationLabel(e)),l(2),S(e.description||"-"),l(2),S(d.getLessonDisplay(e.theory)),l(2),S(d.getLessonDisplay(e.practical)),l(2),lt(d.isItemActive(e)?"status-bullet status-active":"status-bullet status-inactive"),l(5),c("matMenuTriggerFor",o),l(5),C(d.isItemActive(e)?-1:22),l(),C(d.isItemActive(e)?23:-1)}}function ls(i,t){if(i&1&&(r(0,"tr")(1,"td",34),p(2,"app-no-data",35),a()()),i&2){let e=m();l(2),c("message",e.emptyMessage())}}function ds(i,t){if(i&1){let e=E();r(0,"li",36)(1,"a",37),u("click",function(){let o=h(e).$implicit,d=m(2);return f(d.setPage(o))}),s(2),a()()}if(i&2){let e=t.$implicit,n=m(2);Z("active",n.pager().currentPage===e),l(2),S(e)}}function cs(i,t){if(i&1){let e=E();r(0,"ul",25)(1,"li",36)(2,"a",37),u("click",function(){h(e);let o=m();return f(o.setPage(1))}),s(3,"<<"),a()(),r(4,"li",36)(5,"a",37),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager().currentPage-1))}),s(6,"<"),a()(),A(7,ds,3,3,"li",38,Ce),r(9,"li",36)(10,"a",37),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager().currentPage+1))}),s(11,">"),a()(),r(12,"li",36)(13,"a",37),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager().totalPages))}),s(14,">>"),a()()()}if(i&2){let e=m();l(),Z("disabled",e.pager().currentPage===1),l(3),Z("disabled",e.pager().currentPage===1),l(3),F(e.pager().pages||Zn(8,is)),l(2),Z("disabled",e.pager().currentPage===e.pager().totalPages),l(3),Z("disabled",e.pager().currentPage===e.pager().totalPages)}}var Pn=class i{constructor(){this.qualificationType=ue("");this.countryId=ue("");this.matDialog=b(je);this.userService=b(le);this.theoryLessonsService=b(q);this.sweetAlert=b(O);this.destroy$=new st;this.listRequest$=new st;this.searchTerm="";this.lastContextKey="";this.searchKeyword=new dt("",{nonNullable:!0});this.drivingLicenseClasses=w([]);this.isHovering=w(!1);this.currentPage=w(1);this.pageSize=10;this.totalResults=w(0);this.totalPages=w(1);this.qualificationPathsList=w([]);this.pagerService=b(Ae);this.isExtension=k(()=>
2this.qualificationType()==="EXTENSION");this.searchPlaceholder=k(()=>this.isExtension()?"Nach Erweiterung suchen...":"Nach Kombinationsklasse suchen...");this.addButtonLabel=k(()=>this.isExtension()?"Erweiterung hinzuf\xFCgen":"Kombination hinzuf\xFCgen");this.emptyMessage=k(()=>this.isExtension()?"Keine Erweiterungen gefunden":"Keine Kombinationen gefunden");this.combinationColumnLabel=k(()=>this.isExtension()?"Erweiterung":"Kombination");this.pager=k(()=>this.pagerService.getPager(this.totalResults(),this.currentPage(),this.pageSize));this.startRecord=k(()=>this.totalResults()===0?0:(this.currentPage()-1)*this.pageSize+1);this.endRecord=k(()=>this.totalResults()===0?0:Math.min(this.currentPage()*this.pageSize,this.totalResults()));this.listRequest$.pipe(Jt(t=>($("#loaderouterid").css("display","flex"),this.theoryLessonsService.getQualificationPathsList(t.countryId,{path_type:t.pathType,page:t.page,limit:this.pageSize,search:t.search}).pipe(ve(e=>({response:e,request:t,error:!1})),pe(e=>(console.log("error getting qualification path list",e),be({response:null,request:t,error:!0})))))),Ct(this.destroy$)).subscribe(({response:t,request:e,error:n})=>{if($("#loaderouterid").css("display","none"),n){this.qualificationPathsList.set([]),this.totalResults.set(0),this.currentPage.set(1),this.totalPages.set(1);return}let o=t?.pagination??{},d=Number(o.total??0)||0,g=Math.max(Number(o.totalPages??1)||1,1),v=Math.min(Math.max(e.page,1),g);this.qualificationPathsList.set(t?.data??[]),this.totalResults.set(d),this.totalPages.set(g),this.currentPage.set(v)}),Et(()=>{let t=this.countryId(),e=this.qualificationType(),n=`${t}|${e}`;t&&this.getdrivingLicenseClasses(t),!(!t||!e)&&n!==this.lastContextKey&&(this.lastContextKey=n,this.searchTerm="",this.searchKeyword.setValue("",{emitEvent:!1}),this.currentPage.set(1),this.getQualificationPathList())})}ngOnInit(){this.searchKeyword.valueChanges.pipe(xt(400),St(),Ct(this.destroy$)).subscribe(t=>{this.searchTerm=t.trim(),this.currentPage.set(1),this.getQualificationPathList()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.listRequest$.complete()}setPage(t){let e=this.pager().totalPages||this.totalPages()||1;t<1||t>e||t===this.currentPage()||(this.currentPage.set(t),this.getQualificationPathList())}getdrivingLicenseClasses(t){this.userService.getdrivingLicenseClasses(t).subscribe({next:e=>{this.drivingLicenseClasses.set(e?.data??[])},error:e=>{console.log("error getting driving classes details",e),this.drivingLicenseClasses.set([])}})}addExtension(){this.matDialog.open(wn,{width:"100%",maxWidth:"1200px",panelClass:"custom-mat-modal-container",disableClose:!0,data:{countryId:this.countryId(),drivingLicenseClasses:this.drivingLicenseClasses()}}).afterClosed().subscribe(t=>{t&&this.getQualificationPathList()})}addCombinationClass(){this.matDialog.open(Ln,{width:"100%",maxWidth:"1200px",panelClass:"custom-mat-modal-container",disableClose:!0,data:{countryId:this.countryId(),drivingLicenseClasses:this.drivingLicenseClasses()}}).afterClosed().subscribe(t=>{t&&this.getQualificationPathList()})}updateStatus(t){if(!t?._id)return;let e=this.isItemActive(t)?0:1;$("#loaderouterid").css("display","flex"),this.theoryLessonsService.changeQualificationPathStatus(t._id,e).subscribe({next:n=>{$("#loaderouterid").css("display","none");let o=n?.data??{},d=o.status??e;this.qualificationPathsList.update(g=>g.map(v=>v._id===t._id?X(I(I({},v),o),{status:d}):v)),this.sweetAlert.success("Erfolg",e===1?"Erfolgreich aktiviert":"Erfolgreich deaktiviert")},error:n=>{$("#loaderouterid").css("display","none"),this.sweetAlert.error("Fehler",n?.error?.message||"Status konnte nicht ge\xE4ndert werden")}})}getCombinationLabel(t){if(this.isExtension()){let n=t?.from_class?.class_code,o=t?.to_class?.class_code;if(n&&o)return`${n} \u2192 ${o}`}let e=(t?.classes??[]).map(n=>
2n?.class_code).filter(Boolean);return e.length?e.join(" + "):t?.combination??"-"}getLessonDisplay(t){return t?t.display?t.display:`${t.included??0}/${t.total??0}`:"-"}isItemActive(t){let e=t?.status;return e===1||e==="1"||e==="active"}editExtension(t){this.matDialog.open(Mn,{width:"100%",maxWidth:"1200px",panelClass:"custom-mat-modal-container",disableClose:!0,data:{countryId:this.countryId(),extension:t,drivingLicenseClasses:this.drivingLicenseClasses(),onSaved:()=>this.getQualificationPathList()}})}editCombinationClass(t){this.matDialog.open(In,{width:"100%",maxWidth:"1200px",panelClass:"custom-mat-modal-container",disableClose:!0,data:{countryId:this.countryId(),combinationClass:t,drivingLicenseClasses:this.drivingLicenseClasses(),onSaved:()=>this.getQualificationPathList()}})}getQualificationPathList(){let t=this.countryId(),e=this.qualificationType();!t||!e||this.listRequest$.next({countryId:t,pathType:e,page:this.currentPage(),search:this.searchTerm})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-qualification-paths"]],inputs:{qualificationType:[1,"qualificationType"],countryId:[1,"countryId"]},decls:40,vars:10,consts:[["table",""],["statusMenu","matMenu"],[1,"table-min-height"],[1,"editing-something","top-search-block",2,"margin-top","26px"],[1,"top-search-block-row"],[1,"input-block"],["type","text",1,"search","myInput","w-100","new-myInput",2,"max-width","490px !important",3,"placeholder","formControl"],[1,"slector-dropdown"],["mat-button","",1,"btn","button-primary","botton-hover",3,"click","mouseover","mouseout"],[1,"menu-image",3,"src"],[1,"ml-2","d-none","d-md-inline"],[1,"table-count-box","d-flex","align-items-center","justify-content-end","flex-shrink-0"],[1,"new-tableCount"],[1,"w-100","shadow-none","mt-0","pt-0"],[1,"w-100","position-relative"],["id","accordion",1,"main-table-card"],[1,"w-100"],[1,"editing-something"],[1,"customer-id",2,"width","6%","min-width","50px"],[1,"customer-Unternehmensname",2,"width","18%","min-width","140px"],[1,"customer-Unternehmensname",2,"width","22%","min-width","180px"],[1,"customer-Unternehmensname",2,"width","18%","min-width","160px"],[1,"customer-Unternehmensname",2,"width","8%","min-width","80px"],[1,"customer-action",2,"width","10%","min-width","120px","text-align","start"],[1,"d-flex","justify-content-end","pagination-main","mt-3"],[1,"pagination","m-0","pagerAction"],[1,"customer-action"],[1,"qna-action"],["type","button",1,"openclass","offnen-btn","click",3,"click"],["matButton","",1,"",3,"matMenuTriggerFor"],[1,"openclass","offnen-btn","click","openClassHover"],[1,"offnen-btn","click","delete-sm"],[1,"openclass","offnen-btn","click","openClassHover",3,"click"],[1,"offnen-btn","click","delete-sm",3,"click"],["colspan","7"],[3,"message"],[1,"page-item"],[1,"page-link",3,"click"],[1,"page-item",3,"active"]],template:function(e,n){e&1&&(r(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5),p(4,"input",6),r(5,"div",7)(6,"button",8),u("click",function(){return n.isExtension()?n.addExtension():n.addCombinationClass()})("mouseover",function(){return n.isHovering.set(!0)})("mouseout",function(){return n.isHovering.set(!1)}),p(7,"img",9),r(8,"span",10),s(9),a()()()(),r(10,"div",11)(11,"span",12),s(12),a()()()(),r(13,"div",13)(14,"div",14)(15,"div",15)(16,"table",16,0)(18,"thead")(19,"tr",17)(20,"th",18),s(21,"#"),a(),r(22,"th",19),s(23),a(),r(24,"th",20),s(25," Beschreibung "),a(),r(26,"th",21),s(27," Theorie (Pflicht / Gesamt) "),a(),r(28,"th",21),s(29," Praxis (Pflicht / Gesamt) "),a(),r(30,"th",22),s(31," Status "),a(),r(32,"th",23),s(33," Aktion "),a()()(),r(34,"tbody"),A(35,ss,24,10,"tr",null,as,!1,ls,3,1,"tr"),a()()(),r(38,"div",24),y(39,cs,15,9,"ul",25),a()()()()),e&2&&(l(4),c("placeholder",n.searchPlaceholder())("formControl",n.searchKeyword),l(3),c("src",n.isHovering()?"../assets/plus icon.svg":"../assets/plus1.svg",Te),l(2),S(n.addButtonLabel()),l(3),xe(" Anzahl der Ergebnisse: ",n.startRecord()," - ",n.endRecord()," / ",n.totalResults()," "),l(11),L(" ",n.combinationColumnLabel()," "),l(12),F(n.qualificationPathsList()),l(4),C(n.totalResults()?39:-1))},dependencies:[Se,ee,D,Ye,Je,Ie,ke,N,R,V,ct],styles:[".top-search-block-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:30px}.input-block[_ngcontent-%COMP%]{display:flex;align-items:center;gap:15px;flex:1 1 0;min-width:0}.myInput[_ngcontent-%COMP%]{height:48px!important}.new-myInput[_ngcontent-%COMP%]::placeholder{color:#5159666e;font-size:14px;line-height:1.3;font-weight:500}.slector-dropdown[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{padding:16px!important;border-radius:12px;font-size:16px;line-height:1.3;font-weight:400;color:#515966;position:relative;white-space:nowrap}.slector-dropdown[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]     .mdc-button__label{display:flex;align-items:center}.main-table-card[_ngcontent-%COMP%]{border:solid 1px #cbcbcb;border-radius:5px;overflow-x:auto;overflow-y:hidden}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:10px}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{font-size:16px;padding:16px 10px;line-height:1.3;color:#75787d;font-weight:700}.main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{font-size:16px;line-height:1.3;color:#515966;font-weight:400}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]:first-child, .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:first-child{padding-left:20px}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]:last-child, .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:last-child{padding-right:20px}table.w-100[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]{border-bottom:1px solid #e9ecef}table.w-100[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:1px solid #e9ecef;padding:10px}.title-style[_ngcontent-%COMP%]{font-weight:500}.status-bullet[_ngcontent-%COMP%]{display:inline-block;width:12px;height:12px;border-radius:50%}.status-bullet.status-active[_ngcontent-%COMP%]{background-color:#28a745}.status-bullet.status-inactive[_ngcontent-%COMP%]{background-color:#dc3545}.qna-action[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.customer-action[_ngcontent-%COMP%]{white-space:nowrap;vertical-align:middle!important}.menu-trigger-btn[_ngcontent-%COMP%]{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:auto!important;width:28px!important;height:28px!important;padding:0!important;line-height:1;vertical-align:middle}.menu-trigger-btn[_ngcontent-%COMP%]     .mat-mdc-button-touch-target{width:28px!important;height:28px!important}.menu-trigger-btn[_ngcontent-%COMP%]     .mdc-icon-button{display:flex!important;align-items:center!important;justify-content:center!important;width:28px!important;height:28px!important;padding:0!important}.menu-trigger-btn[_ngcontent-%COMP%]     .mdc-icon-button__icon{display:flex;align-items:center;justify-content:center}.menu-trigger-btn[_ngcontent-%COMP%]   i.fa[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;font-size:15px;line-height:1}.offnen-btn[_ngcontent-%COMP%]{background-color:#d0e7ff;border-radius:5px;padding:6px 10px;font-size:14px;line-height:1.3;font-weight:500;border:none}.openclass[_ngcontent-%COMP%]{background-color:#e0f2ff!important;border:none!important;color:#515966!important}.openclass[_ngcontent-%COMP%]:hover{border:none!important;background:#1388fe!important;color:#fff!important}.delete-sm[_ngcontent-%COMP%]{background-color:#fff0f0!important;color:#eb3737!important;border:none!important;transition:.3s}.delete-sm[_ngcontent-%COMP%]:hover{background-color:#eb3737!important;color:#fff!important}  .mat-mdc-menu-content{margin:0;padding:8px!important;outline:0!important}.mat-mdc-button.mat-mdc-button-base[_ngcontent-%COMP%]{min-width:0px!important;padding:1%!important;height:100%!important}"]})}};function ms(i){return i===!0||i===1||i==="active"?"active":"inactive"}function ki(i,t){if(i!=="fixed"||t===""||t===null||t===void 0)return null;let e=Number(t);return Number.isNaN(e)||e<0?null:Math.floor(e)}function An(i,t){let e=i.theory_type==="case"?"case":"fixed",n=i.practical_type==="case"?"case":"fixed",o={country_id:t,grant_type:i.grant_type?.trim()??"",status:ms(i.status),theory_type:e,theory_lessons_required:e==="fixed",theory_lessons:ki(e,i.theory_lessons),practical_type:n,practical_lessons_required:n==="fixed",practical_lessons:ki(n,i.practical_lessons),theory_exam:i.theory_exam==="no"||i.theory_exam==="conditional"?i.theory_exam:"yes",practical_exam:i.practical_exam==="no"||i.practical_exam==="conditional"?i.practical_exam:"yes",notes:i.notes?.trim()||void 0};return i._id&&(o._id=i._id),o}function ps(i,t){i&1&&(r(0,"mat-error"),s(1,"Erteilungsart ist erforderlich"),a())}function us(i,t){i&1&&(r(0,"mat-error"),s(1,"Erteilungsart darf maximal 100 Zeichen enthalten"),a())}function gs(i,t){i&1&&(r(0,"mat-error"),s(1,"Theorielektionen sind erforderlich"),a())}function _s(i,t){i&1&&(r(0,"mat-error"),s(1,"Wert darf nicht negativ sein"),a())}function hs(i,t){if(i&1&&(r(0,"mat-form-field",20)(1,"mat-label"),s(2,"Erforderlich"),a(),p(3,"input",33),y(4,gs,2,0,"mat-error"),y(5,_s,2,0,"mat-error"),a()),i&2){let e,n,o=m();l(4),C((e=o.addGrantTypeFormGroup.get("theory_lessons"))!=null&&e.hasError("required")?4:-1),l(),C((n=o.addGrantTypeFormGroup.get("theory_lessons"))!=null&&n.hasError("min")?5:-1)}}function fs(i,t){i&1&&(r(0,"mat-error"),s(1,"Praktische Lektionen sind erforderlich"),a())}function ys(i,t){i&1&&(r(0,"mat-error"),s(1,"Wert darf nicht negativ sein"),a())}function Cs(i,t){if(i&1&&(r(0,"mat-form-field",20)(1,"mat-label"),s(2,"Erforderlich"),a(),p(3,"input",34),y(4,fs,2,0,"mat-error"),y(5,ys,2,0,"mat-error"),a()),i&2){let e,n,o=m();l(4),C((e=o.addGrantTypeFormGroup.get("practical_lessons"))!=null&&e.hasError("required")?4:-1),l(),C((n=o.addGrantTypeFormGroup.get("practical_lessons"))!=null&&n.hasError("min")?5:-1)}}function vs(i,t){i&1&&(r(0,"mat-error"),s(1,"Theoriepr\xFCfung ist erforderlich"),a())}function bs(i,t){i&1&&(r(0,"mat-error"),s(1,"Praktische Pr\xFCfung ist erforderlich"),a())}var Fn=class i{constructor(){this.dialogRef=b(te);
2this.fb=b(Q);this.sweetAlert=b(O);this.theoryLessonsService=b(q);this.data=b(ne,{optional:!0})??{countryId:""};this.showLoader=w(!1);this.addGrantTypeFormGroup=this.fb.group({grant_type:["",[_.required,_.maxLength(100)]],status:[!0],theory_type:["fixed",_.required],theory_lessons:[1,[_.required,_.min(0)]],practical_type:["fixed",_.required],practical_lessons:[1,[_.required,_.min(0)]],theory_exam:["yes",_.required],practical_exam:["yes",_.required],notes:[""]});this.applyConditionalValidators(),this.addGrantTypeFormGroup.get("theory_type")?.valueChanges.subscribe(()=>this.applyConditionalValidators()),this.addGrantTypeFormGroup.get("practical_type")?.valueChanges.subscribe(()=>this.applyConditionalValidators())}applyConditionalValidators(){let t=this.addGrantTypeFormGroup.get("theory_type")?.value,e=this.addGrantTypeFormGroup.get("practical_type")?.value,n=this.addGrantTypeFormGroup.get("theory_lessons"),o=this.addGrantTypeFormGroup.get("practical_lessons");t==="fixed"?(n?.setValidators([_.required,_.min(0)]),(n?.value===null||n?.value===void 0)&&n?.setValue(1,{emitEvent:!1})):(n?.clearValidators(),n?.setValue(null,{emitEvent:!1})),n?.updateValueAndValidity({emitEvent:!1}),e==="fixed"?(o?.setValidators([_.required,_.min(0)]),(o?.value===null||o?.value===void 0)&&o?.setValue(1,{emitEvent:!1})):(o?.clearValidators(),o?.setValue(null,{emitEvent:!1})),o?.updateValueAndValidity({emitEvent:!1})}closeModal(){me(this.sweetAlert,this.addGrantTypeFormGroup.dirty,()=>this.dialogRef.close(!1))}saveGrantType(){if(this.addGrantTypeFormGroup.invalid){this.addGrantTypeFormGroup.markAllAsTouched(),this.sweetAlert.warning("Pflichtfelder erforderlich",this.getValidationErrorMessage(),"OK").subscribe();return}if(!this.data.countryId){this.sweetAlert.error("Fehler","Land-ID nicht gefunden. Bitte erneut versuchen.","OK").subscribe();return}this.sweetAlert.confirm("Speichern?","M\xF6chten Sie die Erteilungsart wirklich speichern?",{type:"warning",confirmText:"Ja",cancelText:"Abbrechen"}).subscribe(t=>{if(!t)return;let e=An(this.addGrantTypeFormGroup.getRawValue(),this.data.countryId);this.showLoader.set(!0),this.theoryLessonsService.createOrUpdateGrantType(e).subscribe({next:()=>{this.showLoader.set(!1),this.sweetAlert.success("Erfolg","Erteilungsart erfolgreich gespeichert","OK").subscribe(()=>this.dialogRef.close(!0))},error:n=>{this.showLoader.set(!1),this.sweetAlert.error("Fehler",n?.error?.message||"Erteilungsart konnte nicht gespeichert werden","OK")}})})}getValidationErrorMessage(){let t=this.addGrantTypeFormGroup.get("grant_type"),e=this.addGrantTypeFormGroup.get("theory_lessons"),n=this.addGrantTypeFormGroup.get("practical_lessons");return t?.hasError("required")||t?.hasError("pattern")?"Erteilungsart ist erforderlich und darf nicht nur aus Leerzeichen bestehen.":t?.hasError("maxlength")?"Erteilungsart darf maximal 100 Zeichen enthalten.":e?.invalid&&this.addGrantTypeFormGroup.get("theory_type")?.value==="fixed"?"Bitte geben Sie eine g\xFCltige Anzahl f\xFCr Theorielektionen ein.":n?.invalid&&this.addGrantTypeFormGroup.get("practical_type")?.value==="fixed"?"Bitte geben Sie eine g\xFCltige Anzahl f\xFCr praktische Lektionen ein.":this.addGrantTypeFormGroup.get("theory_exam")?.invalid?"Theoriepr\xFCfung ist erforderlich.":this.addGrantTypeFormGroup.get("practical_exam")?.invalid?"Praktische Pr\xFCfung ist erforderlich.":"Bitte f\xFCllen Sie alle Pflichtfelder korrekt aus."}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-add-grant-type"]],decls:95,vars:8,consts:[[1,"modal-content","add-grant-type-modal"],[1,"custom-mat-modal-header"],[1,"title"],["type","button",1,"btn-close",3,"click"],["src","../../../assets/closeModel.svg","alt","closeModel",2,"height","20px"],[1,"custom-mat-modal-body"],[3,"formGroup"],[1,"row"],[1,"col-md-6","custom-padding"],[1,"field-heading-parent"],[1,"field-heading","mb-2"],[1,"px-2"],["appearance","outline",1,"w-100","bg-white"],["matInput","","formControlName","grant_type","placeholder","z. B. Wiedererteilung"],[1,"p-3"],["formControlName","status"],[1,"col-md-6","custom-padding","mt-3"],["formControlName","theory_type"],["value","fixed"],["value","case"],["appearance","outline",1,"w-100","mt-3"],["formControlName","practical_type"],["appearance","outline",1,"w-100"],["formControlName","theory_exam"],["value","yes"],["value","no"],["value","conditional"],["formControlName","practical_exam"],[1,"col-12","custom-padding","mt-3"],["matInput","","rows","5","formControlName","notes","placeholder","Bitte geben Sie die Bedingung ein..."],[1,"modal-footer"],[1,"btn","button-primary",3,"click"],[3,"visible"],["matInput","","type","number","formControlName","theory_lessons","min","0"],["matInput","","type","number","formControlName","practical_lessons","min","0"]],template:function(e,n){if(e&1&&(r(0,"div",0)(1,"div",1)(2,"h2",2),s(3,"Erteilungsart hinzuf\xFCgen"),a(),r(4,"button",3),u("click",function(){return n.closeModal()}),p(5,"img",4),a()(),r(6,"div",5)(7,"form",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"h6",10),s(12," Erteilungsart : "),a(),r(13,"div",11)(14,"mat-form-field",12)(15,"mat-label"),s(16,"Erteilungsart"),a(),p(17,"input",13),y(18,ps,2,0,"mat-error"),y(19,us,2,0,"mat-error"),a()()()(),r(20,"div",8)(21,"div",9)(22,"h6",10),s(23," Status : "),a(),r(24,"div",14)(25,"mat-slide-toggle",15),s(26," Status Aktiv? "),a()()()(),r(27,"div",16)(28,"div",9)(29,"h6",10),s(30," Theoriestunden : "),a(),r(31,"div",14)(32,"mat-radio-group",17)(33,"mat-radio-button",18),s(34,"Fester Wert"),a(),r(35,"mat-radio-button",19),s(36,"Einzelfall"),a()(),y(37,hs,6,2,"mat-form-field",20),a()()(),r(38,"div",16)(39,"div",9)(40,"h6",10),s(41," Fahrstunden : "),a(),r(42,"div",14)(43,"mat-radio-group",21)(44,"mat-radio-button",18),s(45,"Fester Wert"),a(),r(46,"mat-radio-button",19),s(47,"Einzelfall"),a()(),y(48,Cs,6,2,"mat-form-field",20),a()()(),r(49,"div",16)(50,"div",9)(51,"h6",10),s(52," Theoriepr\xFCfung : "),a(),r(53,"div",11)(54,"mat-form-field",22)(
255,"mat-label"),s(56,"Theoriepr\xFCfung"),a(),r(57,"mat-select",23)(58,"mat-option",24),s(59,"Ja"),a(),r(60,"mat-option",25),s(61,"Nein"),a(),r(62,"mat-option",26),s(63,"Bedingt"),a()(),y(64,vs,2,0,"mat-error"),a()()()(),r(65,"div",16)(66,"div",9)(67,"h6",10),s(68," Praktische Pr\xFCfung : "),a(),r(69,"div",11)(70,"mat-form-field",22)(71,"mat-label"),s(72,"Praktische Pr\xFCfung"),a(),r(73,"mat-select",27)(74,"mat-option",24),s(75,"Ja"),a(),r(76,"mat-option",25),s(77,"Nein"),a(),r(78,"mat-option",26),s(79,"Bedingt"),a()(),y(80,bs,2,0,"mat-error"),a()()()(),r(81,"div",28)(82,"div",9)(83,"h6",10),s(84," Bedingung / Hinweis : "),a(),r(85,"div",11)(86,"mat-form-field",22)(87,"mat-label"),s(88,"Bedingung / Hinweis"),a(),r(89,"textarea",29),s(90,"                "),a()()()()()()()(),r(91,"div",30)(92,"button",31),u("click",function(){return n.saveGrantType()}),s(93,"Speichern"),a()()(),p(94,"app-loader",32)),e&2){let o,d,g,v,T,W;l(7),c("formGroup",n.addGrantTypeFormGroup),l(11),C((o=n.addGrantTypeFormGroup.get("grant_type"))!=null&&o.hasError("required")?18:-1),l(),C((d=n.addGrantTypeFormGroup.get("grant_type"))!=null&&d.hasError("maxlength")?19:-1),l(18),C(((g=n.addGrantTypeFormGroup.get("theory_type"))==null?null:g.value)==="fixed"?37:-1),l(11),C(((v=n.addGrantTypeFormGroup.get("practical_type"))==null?null:v.value)==="fixed"?48:-1),l(16),C((T=n.addGrantTypeFormGroup.get("theory_exam"))!=null&&T.hasError("required")?64:-1),l(16),C((W=n.addGrantTypeFormGroup.get("practical_exam"))!=null&&W.hasError("required")?80:-1),l(14),c("visible",n.showLoader())}},dependencies:[D,Y,j,_e,J,Oe,de,It,Pt,ie,N,Pe,R,oe,V,U,se,K,H,ae],encapsulation:2})}};function xs(i,t){i&1&&(r(0,"mat-error"),s(1,"Erteilungsart ist erforderlich"),a())}function Ss(i,t){i&1&&(r(0,"mat-error"),s(1,"Erteilungsart darf maximal 100 Zeichen enthalten"),a())}function Es(i,t){i&1&&(r(0,"mat-error"),s(1,"Theorielektionen sind erforderlich"),a())}function ws(i,t){i&1&&(r(0,"mat-error"),s(1,"Wert darf nicht negativ sein"),a())}function Ts(i,t){if(i&1&&(r(0,"mat-form-field",20)(1,"mat-label"),s(2,"Erforderlich"),a(),p(3,"input",33),y(4,Es,2,0,"mat-error"),y(5,ws,2,0,"mat-error"),a()),i&2){let e,n,o=m();l(4),C((e=o.editGrantTypeFormGroup.get("theory_lessons"))!=null&&e.hasError("required")?4:-1),l(),C((n=o.editGrantTypeFormGroup.get("theory_lessons"))!=null&&n.hasError("min")?5:-1)}}function Ls(i,t){i&1&&(r(0,"mat-error"),s(1,"Praktische Lektionen sind erforderlich"),a())}function Ms(i,t){i&1&&(r(0,"mat-error"),s(1,"Wert darf nicht negativ sein"),a())}function Is(i,t){if(i&1&&(r(0,"mat-form-field",20)(1,"mat-label"),s(2,"Erforderlich"),a(),p(3,"input",34),y(4,Ls,2,0,"mat-error"),y(5,Ms,2,0,"mat-error"),a()),i&2){let e,n,o=m();l(4),C((e=o.editGrantTypeFormGroup.get("practical_lessons"))!=null&&e.hasError("required")?4:-1),l(),C((n=o.editGrantTypeFormGroup.get("practical_lessons"))!=null&&n.hasError("min")?5:-1)}}function Ps(i,t){i&1&&(r(0,"mat-error"),s(1,"Theoriepr\xFCfung ist erforderlich"),a())}function As(i,t){i&1&&(r(0,"mat-error"),s(1,"Praktische Pr\xFCfung ist erforderlich"),a())}var Dn=class i{constructor(){this.dialogRef=b(te);
2this.fb=b(Q);this.sweetAlert=b(O);this.theoryLessonsService=b(q);this.data=b(ne,{optional:!0})??{countryId:""};this.showLoader=w(!1);this.editGrantTypeFormGroup=this.fb.group({_id:[""],grant_type:["",[_.required,_.maxLength(100)]],status:[!0],theory_type:["fixed",_.required],theory_lessons:[1,[_.required,_.min(0)]],practical_type:["fixed",_.required],practical_lessons:[1,[_.required,_.min(0)]],theory_exam:["yes",_.required],practical_exam:["yes",_.required],notes:[""]});this.patchInitialData(),this.applyConditionalValidators(),this.editGrantTypeFormGroup.markAsPristine(),this.editGrantTypeFormGroup.get("theory_type")?.valueChanges.subscribe(()=>this.applyConditionalValidators()),this.editGrantTypeFormGroup.get("practical_type")?.valueChanges.subscribe(()=>this.applyConditionalValidators())}closeModal(){me(this.sweetAlert,this.editGrantTypeFormGroup.dirty,()=>this.dialogRef.close(!1))}updateGrantType(){if(this.editGrantTypeFormGroup.invalid){this.editGrantTypeFormGroup.markAllAsTouched(),this.sweetAlert.warning("Pflichtfelder erforderlich",this.getValidationErrorMessage(),"OK").subscribe();return}if(!this.editGrantTypeFormGroup.dirty){this.sweetAlert.warning("Keine \xC4nderungen","Keine \xC4nderungen vorgenommen. Bitte \xE4ndern Sie ein Feld, um zu speichern.","OK").subscribe();return}if(!this.data.countryId){this.sweetAlert.error("Fehler","Land-ID nicht gefunden. Bitte erneut versuchen.","OK").subscribe();return}this.sweetAlert.confirm("Aktualisieren?","M\xF6chten Sie die Erteilungsart wirklich aktualisieren?",{type:"warning",confirmText:"Ja",cancelText:"Abbrechen"}).subscribe(t=>{if(!t)return;let e=An(this.editGrantTypeFormGroup.getRawValue(),this.data.countryId);this.showLoader.set(!0),this.theoryLessonsService.createOrUpdateGrantType(e).subscribe({next:()=>{this.showLoader.set(!1),this.sweetAlert.success("Erfolg","Erteilungsart erfolgreich aktualisiert","OK").subscribe(()=>this.dialogRef.close(!0))},error:n=>{this.showLoader.set(!1),this.sweetAlert.error("Fehler",n?.error?.message||"Erteilungsart konnte nicht aktualisiert werden","OK")}})})}patchInitialData(){let t=this.data.item;if(!t)return;let e={_id:t._id??"",grant_type:t.grant_type??"",status:t.status==="active"||t.status===1||t.status===!0,theory_type:t.theory_type==="case"||t.theory_lessons_required===!1?"case":"fixed",theory_lessons:t.theory_lessons??(t.theory_type==="fixed"||t.theory_lessons_required===!0?1:null),practical_type:t.practical_type==="case"||t.practical_lessons_required===!1?"case":"fixed",practical_lessons:t.practical_lessons??(t.practical_type==="fixed"||t.practical_lessons_required===!0?1:null),theory_exam:t.theory_exam??"yes",practical_exam:t.practical_exam??"yes",notes:t.notes??""};this.editGrantTypeFormGroup.patchValue(e,{emitEvent:!1})}applyConditionalValidators(){let t=this.editGrantTypeFormGroup.get("theory_type")?.value,e=this.editGrantTypeFormGroup.get("practical_type")?.value,n=this.editGrantTypeFormGroup.get("theory_lessons"),o=this.editGrantTypeFormGroup.get("practical_lessons");t==="fixed"?(n?.setValidators([_.required,_.min(0)]),(n?.value===null||n?.value===void 0)&&n?.setValue(1,{emitEvent:!1})):(n?.clearValidators(),n?.setValue(null,{emitEvent:!1})),n?.updateValueAndValidity({emitEvent:!1}),e==="fixed"?(o?.setValidators([_.required,_.min(0)]),(o?.value===null||o?.value===void 0)&&o?.setValue(1,{emitEvent:!1})):(o?.clearValidators(),o?.setValue(null,{emitEvent:!1})),o?.updateValueAndValidity({emitEvent:!1})}getValidationErrorMessage(){let t=this.editGrantTypeFormGroup.get("grant_type"),e=this.editGrantTypeFormGroup.get("theory_lessons"),n=this.editGrantTypeFormGroup.get("practical_lessons");return t?.hasError("required")||t?.hasError("pattern")?"Erteilungsart ist erforderlich und darf nicht nur aus Leerzeichen bestehen.":t?.hasError("maxlength")?"Erteilungsart darf maximal 100 Zeichen enthalten.":e?.invalid&&this.editGrantTypeFormGroup.get("theory_type")?.value==="fixed"?"Bitte geben Sie eine g\xFCltige Anzahl f\xFCr Theorielektionen ein.":n?.invalid&&this.editGrantTypeFormGroup.get("practical_type")?.value==="fixed"?"Bitte geben Sie eine g\xFCltige Anzahl f\xFCr praktische Lektionen ein.":this.editGrantTypeFormGroup.get("theory_exam")?.invalid?"Theoriepr\xFCfung ist erforderlich.":this.editGrantTypeFormGroup.get("practical_exam")?.invalid?"Praktische Pr\xFCfung ist erforderlich.":"Bitte f\xFCllen Sie alle Pflichtfelder k
2orrekt aus."}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-edit-grant-type"]],decls:95,vars:8,consts:[[1,"modal-content","add-grant-type-modal"],[1,"custom-mat-modal-header"],[1,"title"],["type","button",1,"btn-close",3,"click"],["src","../../../assets/closeModel.svg","alt","closeModel",2,"height","20px"],[1,"custom-mat-modal-body"],[3,"formGroup"],[1,"row"],[1,"col-md-6","custom-padding"],[1,"field-heading-parent"],[1,"field-heading","mb-2"],[1,"px-2"],["appearance","outline",1,"w-100","bg-white"],["matInput","","formControlName","grant_type","placeholder","z. B. Wiedererteilung"],[1,"p-3"],["formControlName","status"],[1,"col-md-6","custom-padding","mt-3"],["formControlName","theory_type"],["value","fixed"],["value","case"],["appearance","outline",1,"w-100","mt-3"],["formControlName","practical_type"],["appearance","outline",1,"w-100"],["formControlName","theory_exam"],["value","yes"],["value","no"],["value","conditional"],["formControlName","practical_exam"],[1,"col-12","custom-padding","mt-3"],["matInput","","rows","5","formControlName","notes","placeholder","Bitte geben Sie die Bedingung ein..."],[1,"modal-footer"],[1,"btn","button-primary",3,"click"],[3,"visible"],["matInput","","type","number","formControlName","theory_lessons","min","0"],["matInput","","type","number","formControlName","practical_lessons","min","0"]],template:function(e,n){if(e&1&&(r(0,"div",0)(1,"div",1)(2,"h2",2),s(3,"Erteilungsart bearbeiten"),a(),r(4,"button",3),u("click",function(){return n.closeModal()}),p(5,"img",4),a()(),r(6,"div",5)(7,"form",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"h6",10),s(12," Erteilungsart : "),a(),r(13,"div",11)(14,"mat-form-field",12)(15,"mat-label"),s(16,"Erteilungsart"),a(),p(17,"input",13),y(18,xs,2,0,"mat-error"),y(19,Ss,2,0,"mat-error"),a()()()(),r(20,"div",8)(21,"div",9)(22,"h6",10),s(23," Status : "),a(),r(24,"div",14)(25,"mat-slide-toggle",15),s(26," Status Aktiv? "),a()()()(),r(27,"div",16)(28,"div",9)(29,"h6",10),s(30," Theoriestunden : "),a(),r(31,"div",14)(32,"mat-radio-group",17)(33,"mat-radio-button",18),s(34,"Fester Wert"),a(),r(35,"mat-radio-button",19),s(36,"Einzelfall"),a()(),y(37,Ts,6,2,"mat-form-field",20),a()()(),r(38,"div",16)(39,"div",9)(40,"h6",10),s(41," Fahrstunden : "),a(),r(42,"div",14)(43,"mat-radio-group",21)(44,"mat-radio-button",18),s(45,"Fester Wert"),a(),r(46,"mat-radio-button",19),s(47,"Einzelfall"),a()(),y(48,Is,6,2,"mat-form-field",20),a()()(),r(49,"div",16)(50,"div",9)(51,"h6",10),s(52," Theoriepr\xFCfung : "),a(),r(53,"div",11)(54,"mat-form-field",22)(55,"mat-label"),s(56,"Theoriepr\xFCfung"),a(),r(57,"mat-select",23)(58,"mat-option",24),s(59,"Ja"),a(),r(60,"mat-option",25),s(61,"Nein"),a(),r(62,"mat-option",26),s(63,"Bedingt"),a()(),y(64,Ps,2,0,"mat-error"),a()()()(),r(65,"div",16)(66,"div",9)(67,"h6",10),s(68," Praktische Pr\xFCfung : "),a(),r(69,"div",11)(70,"mat-form-field",22)(71,"mat-label"),s(72,"Praktische Pr\xFCfung"),a(),r(73,"mat-select",27)(74,"mat-option",24),s(75,"Ja"),a(),r(76,"mat-option",25),s(77,"Nein"),a(),r(78,"mat-option",26),s(79,"Bedingt"),a()(),y(80,As,2,0,"mat-error"),a()()()(),r(81,"div",28)(82,"div",9)(83,"h6",10),s(84," Bedingung / Hinweis : "),a(),r(85,"div",11)(86,"mat-form-field",22)(87,"mat-label"),s(88,"Bedingung / Hinweis"),a(),r(89,"textarea",29),s(90,"                "),a()()()()()()()(),r(91,"div",30)(92,"button",31),u("click",function(){return n.updateGrantType()}),s(93,"Aktualisieren"),a()()(),p(94,"app-loader",32)),e&2){let o,d,g,v,T,W;l(7),c("formGroup",n.editGrantTypeFormGroup),l(11),C((o=n.editGrantTypeFormGroup.get("grant_type"))!=null&&o.hasError("required")?18:-1),l(),C((d=n.editGrantTypeFormGroup.get("grant_type"))!=null&&d.hasError("maxlength")?19:-1),l(18),C(((g=n.editGrantTypeFormGroup.get("theory_type"))==null?null:g.value)==="fixed"?37:-1),l(11),C(((v=n.editGrantTypeFormGroup.get("practical_type"))==null?null:v.value)==="fixed"?48:-1),l(16),C((T=n.editGrantTypeFormGroup.get("theory_exam"))!=null&&T.hasError("required")?64:-1),l(16),C((W=n.editGrantTypeFormGroup.get("practical_exam"))!=null&&W.hasError("required")?80:-1),l(14),c("visible",n.showLoader())}},dependencies:[D,Y,j,_e,J,Oe,de,It,Pt,ie,N,Pe,R,oe,V,U,se,K,H,ae],encapsulation:2})}};var Fs=(i,t)=>t._id||i;function Ds(i,t){if(i&1){let e=E();r(0,"button",36),u("click",function(){h(e);let o=m().$implicit,d=m();return f(d.updateStatus(o))}),s(1," Aktivieren "),a()}}function ks(i,t){if(i&1){let e=E();r(0,"button",37),u("click",function(){h(e);let o=m().$implicit,d=m();return f(d.updateStatus(o))}),s(1," Deaktivieren "),a()}}function Os(i,t){if(i&1){let e=E();r(0,"tr")(1,"td",27),s(2),a(),r(3,"td",28),s(4),a(),r(5,"td",29),s(6),a(),r(7,"td",29),s(8),a(),r(9,"td",29),s(10),a(),r(11,"td",29),s(12),a(),r(13,"td",29),p(14,"span"),a(),r(15,"td",30)(16,"div",31)(17,"button",32),u("click",function(){let o=h(e).$implicit,d=m();return f(d.editGrantType(o))}),s(18," \xD6ffnen "),a(),r(19,"button",33)(20,"mat-icon"),s(21,"menu"),a()(),r(22,"mat-menu",null,1),y(24,Ds,2,0,"button",34),y(25,ks,2,0,"button",35),a()()()()}if(i&2){let e=t.$implicit,n=t.$index,o=M(23),d=m();l(2),S(d.startRecord()+n),l(2),S(e.grant_type||"-"),l(2),S(d.formatRequired(e.theory_type,e.theory_lessons,e.theory_lessons_required)),l(2),S(d.formatRequired(e.practical_type,e.practical_lessons,e.practical_lessons_required)),l(2),S(d.formatExam(e.theory_exam)),l(2),S(d.formatExam(e.practical_exam)),l(2),lt(d.isActive(e)?"status-bullet status-active":"status-bullet status-inactive"),l(5),c("matMenuTriggerFor",o),l(5),C(d.isActive(e)?-1:24),l(),C(d.isActive(e)?25:-1)}}function Ns(i,t){if(i&1&&(r(0,"tr")(1,"td",38),p(2,"app-no-data",39),a()()),i&2){let e=m();l(2),c("message",e.emptyMessage)}}function Gs(i,t){if(i&1){let e=E();r(0,"li",40)(1,"a",41),u("click",function(){let o=h(e).$implicit,d=m(2);return f(d.setPage(o))}),s(2),a()()}if(i&2){let e=t.$implicit,n=m(2);Z("active",n.pager().currentPage===e),l(2),S(e)}}function Rs(i,t){if(i&1){let e=E();r(0,"ul",26)(1,"li",40)(2,"a",41),u("click",function(){h(e);let o=m();return f(o.setPage(1))}),s(3,"<<"),a()(),r(4,"li",40)(5,"a",41),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager().currentPage-1))}),s(6,"<"),a()(),A(7,Gs,3,3,"li",42,Ce),r(9,"li",40)(10,"a",41),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager().currentPage+1))}),s(11,">"),a()(),r(12,"li",40)(13,"a",41),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager().totalPages))}),s(14,">>"),a()()()}if(i&2){let e=m();l(),Z("disabled",e.pager().currentPage===1),l(3),Z("disabled",e.pager().currentPage===1),l(3),F(e.pager().pages),l(2),Z("disabled",e.pager().currentPage===e.pager().totalPages),l(3),Z("disabled",e.pager().currentPage===e.pager().totalPages)}}var kn=class i{constructor(){this.countryId=ue("");this.matDialog=b(je);this.pagerService=b(Ae);this.theoryLessonsService=b(q);this.sweetAlert=b(O);this.destroy$=new st;this.searchInput$=new st;this.searchTerm="";this.pageSize=15;this.currentPage=w(1);this.totalResults=w(0);this.totalPages=w(1);this.grantTypeList=w([]);this.searchQuery=w("");this.isHovering=w(!1);this.emptyMessage="Keine Erteilungsarten gefunden";this.pager=k(()=>this.pagerService.getPager(this.totalResults(),this.currentPage(),this.pageSize));this.startRecord=k(()=>this.totalResults()===0?0:(this.currentPage()-1)*this.pageSize+1);this.endRecord=k(()=>this.totalResults()===0?0:Math.min(this.currentPage()*this.pageSize,this.totalResults()));Et(()=>{let t=this.countryId();this.searchTerm="",this.searchQuery.set(""),this.currentPage.set(1),t?this.loadGrantTypes():(this.grantTypeList.set([]),this.totalResults.set(0),this.totalPages.set(1))})}ngOnInit(){this.searchInput$.pipe(xt(400),St(),Ct(this.destroy$)).subscribe(t=>{this.searchTerm=t.trim(),this.currentPage.set(1),this.loadGrantTypes()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.searchInput$.complete()}onSearchInput(t){let e=t.target.value;this.searchQuery.set(e),this.searchInput$.next(e)}loadGrantTypes(){if(!this.countryId()){this.grantTypeList.set([]),this.totalResults.set(0),this.totalPages.set(1),this.currentPage.set(1);return}$("#loaderouterid").css("display","flex"),this.theoryLessonsService.getGrantTypesList(this.countryId(),{page:this.currentPage(),limit:this.pageSize,search:this.searchTerm}).subscribe({next:t=>{$("#loaderouterid").css("display","none");let e=(t?.data??[]).map(v=>
2({_id:v._id,country_id:v.country_id,grant_type:v.grant_type,status:v.status,theory_type:v.theory_type,theory_lessons:v.theory_lessons,theory_lessons_required:v.theory_lessons_required,practical_type:v.practical_type,practical_lessons:v.practical_lessons,practical_lessons_required:v.practical_lessons_required,theory_exam:v.theory_exam,practical_exam:v.practical_exam,notes:v.notes})),n=t?.pagination??{},o=Number(n.total??e.length)||0,d=Number(n.page??this.currentPage())||1,g=Number(n.totalPages??1)||1;this.grantTypeList.set(e),this.totalResults.set(o),this.currentPage.set(d),this.totalPages.set(g)},error:()=>{$("#loaderouterid").css("display","none"),this.grantTypeList.set([]),this.totalResults.set(0),this.currentPage.set(1),this.totalPages.set(1)}})}setPage(t){t<1||t>this.totalPages()||t===this.currentPage()||(this.currentPage.set(t),this.loadGrantTypes())}addGrantType(){this.matDialog.open(Fn,{width:"100%",maxWidth:"1200px",panelClass:"custom-mat-modal-container",disableClose:!0,data:{countryId:this.countryId()}}).afterClosed().subscribe(e=>{e&&(this.currentPage.set(1),this.loadGrantTypes())})}editGrantType(t){this.matDialog.open(Dn,{width:"100%",maxWidth:"1200px",panelClass:"custom-mat-modal-container",disableClose:!0,data:{countryId:this.countryId(),item:t}}).afterClosed().subscribe(n=>{n&&this.loadGrantTypes()})}updateStatus(t){if(!t?._id)return;let e=this.isActive(t)?"inactive":"active";$("#loaderouterid").css("display","flex"),this.theoryLessonsService.changeGrantTypeStatus(t._id,e).subscribe({next:n=>{$("#loaderouterid").css("display","none");let o=n?.data??{},d=o.status??e;this.grantTypeList.update(g=>g.map(v=>v._id===t._id?X(I(I({},v),o),{status:d}):v)),this.sweetAlert.success("Erfolg",e==="active"?"Erfolgreich aktiviert":"Erfolgreich deaktiviert","OK")},error:n=>{$("#loaderouterid").css("display","none"),this.sweetAlert.error("Fehler",n?.error?.message||"Status konnte nicht ge\xE4ndert werden","OK")}})}formatRequired(t,e,n){return t==="case"||n===!1||n===0||n==="false"?"Einzelfall":e!=null&&e!==""?Str
2ing(e):n===!0||n===1||n==="true"||n==="yes"?"Ja":"-"}formatExam(t){return t==null||t===""?"-":typeof t=="boolean"?t?"Ja":"Nein":t==="yes"?"Ja":t==="no"?"Nein":t==="conditional"?"Bedingt":String(t)}isActive(t){return t.status==="active"||t.status===1}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-grant-type-management"]],inputs:{countryId:[1,"countryId"]},decls:46,vars:7,consts:[["table",""],["statusMenu","matMenu"],[1,"table-min-height"],[1,"editing-something","top-search-block",2,"margin-top","26px"],[1,"top-search-block-row"],[1,"input-block"],["type","text","placeholder","Erteilungsart suchen...",1,"search","myInput","w-100","new-myInput",2,"max-width","490px !important",3,"input","value"],[1,"slector-dropdown"],["mat-button","",1,"button-primary","botton-hover",3,"click","mouseover","mouseout"],[1,"menu-image",3,"src"],[1,"ml-2","d-none","d-md-inline"],[1,"table-count-box","d-flex","align-items-center","justify-content-end","flex-shrink-0"],[1,"new-tableCount"],[1,"w-100","shadow-none","mt-0","pt-0"],[1,"w-100","position-relative"],["id","accordion",1,"main-table-card"],[1,"w-100"],[1,"editing-something"],[1,"customer-id",2,"width","5%","min-width","50px"],[1,"customer-Unternehmensname","title-width",2,"width","16%","min-width","140px"],[1,"customer-Unternehmensname",2,"width","14%","min-width","150px"],[1,"customer-Unternehmensname",2,"width","12%","min-width","120px"],[1,"customer-Unternehmensname",2,"width","12%","min-width","130px"],[1,"customer-Unternehmensname",2,"width","8%","min-width","78px"],[1,"customer-action",2,"width","10%","min-width","120px","text-align","start"],[1,"d-flex","justify-content-end","pagination-main","mt-3"],[1,"pagination","m-0","pagerAction"],[1,"customer-id"],[1,"customer-Unternehmensname","title-style"],[1,"customer-Unternehmensname"],[1,"customer-action"],[1,"qna-action"],["type","button",1,"openclass","offnen-btn","click",3,"click"],["matButton","",1,"",3,"matMenuTriggerFor"],[1,"openclass","offnen-btn","click","openClassHover"],[1,"offnen-btn","click","delete-sm"],[1,"openclass","offnen-btn","click","openClassHover",3,"click"],[1,"offnen-btn","click","delete-sm",3,"click"],["colspan","8"],[3,"message"],[1,"page-item"],[1,"page-link",3,"click"],[1,"page-item",3,"active"]],template:function(e,n){e&1&&(r(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"input",6),u("input",function(d){return n.onSearchInput(d)}),a(),r(5,"div",7)(6,"button",8),u("click",function(){return n.addGrantType()})("mouseover",function(){return n.isHovering.set(!0)})("mouseout",function(){return n.isHovering.set(!1)}),p(7,"img",9),r(8,"span",10),s(9,"Erteilungsart hinzuf\xFCgen"),a()()()(),r(10,"div",11)(11,"span",12),s(12),a()()()(),r(13,"div",13)(14,"div",14)(15,"div",15)(16,"table",16,0)(18,"thead")(19,"tr",17)(20,"th",18),s(21,"#"),a(),r(22,"th",19),s(23," Erteilungsart "),a(),r(24,"th",20),s(25," Theorielektionen"),p(26,"br"),s(27,"(Erforderlich) "),a(),r(28,"th",20),s(29," Praktische Lektionen"),p(30,"br"),s(31,"(Erforderlich) "),a(),r(32,"th",21),s(33," Theoriepr\xFCfung "),a(),r(34,"th",22),s(35," Praktische Pr\xFCfung "),a(),r(36,"th",23),s(37," Status "),a(),r(38,"th",24),s(39," Aktion "),a()()(),r(40,"tbody"),A(41,Os,26,11,"tr",null,Fs,!1,Ns,3,1,"tr"),a()()(),r(44,"div",25),y(45,Rs,15,8,"ul",26),a()()()()),e&2&&(l(4),c("value",n.searchQuery()),l(3),c("src",n.isHovering()?"../assets/plus icon.svg":"../assets/plus1.svg",Te),l(5),xe(" Anzahl der Ergebnisse: ",n.startRecord()," - ",n.endRecord()," / ",n.totalResults()," "),l(29),F(n.grantTypeList()),l(4),C(n.totalResults()?45:-1))},dependencies:[Se,D,Ye,Je,Ie,ke,ee],styles:[".top-search-block-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:30px}.input-block[_ngcontent-%COMP%]{display:flex;align-items:center;gap:15px;flex:1 1 0;min-width:0}.myInput[_ngcontent-%COMP%]{height:48px!important}.new-myInput[_ngcontent-%COMP%]::placeholder{color:#5159666e;font-size:14px;line-height:1.3;font-weight:500}.slector-dropdown[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{padding:16px!important;border-radius:12px;font-size:16px;line-height:1.3;font-weight:400;color:#515966;position:relative;white-space:nowrap}.slector-dropdown[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]     .mdc-button__label{display:flex;align-items:center}.main-table-card[_ngcontent-%COMP%]{border:solid 1px #cbcbcb;border-radius:5px;overflow-x:auto;overflow-y:hidden}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:10px}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{font-size:16px;padding:16px 10px;line-height:1.3;color:#75787d;font-weight:700}.main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{font-size:16px;line-height:1.3;color:#515966;font-weight:400}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]:first-child, .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:first-child{padding-left:20px}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]:last-child, .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:last-child{padding-right:20px}table.w-100[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]{border-bottom:1px solid #e9ecef}table.w-100[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:1px solid #e9ecef;padding:10px}.title-style[_ngcontent-%COMP%]{font-weight:500}.status-bullet[_ngcontent-%COMP%]{display:inline-block;width:12px;height:12px;border-radius:50%}.status-bullet.status-active[_ngcontent-%COMP%]{background-color:#28a745}.status-bullet.status-inactive[_ngcontent-%COMP%]{background-color:#dc3545}.qna-action[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.customer-action[_ngcontent-%COMP%]{white-space:nowrap;vertical-align:middle!important}.offnen-btn[_ngcontent-%COMP%]{background-color:#d0e7ff;border-radius:5px;padding:6px 10px;font-size:14px;line-height:1.3;font-weight:500;border:none}.openclass[_ngcontent-%COMP%]{background-color:#e0f2ff!important;border:none!important;color:#515966!important}.openclass[_ngcontent-%COMP%]:hover{border:none!important;background:#1388fe!important;color:#fff!important}.delete-sm[_ngcontent-%COMP%]{background-color:#fff0f0!important;color:#eb3737!important;border:none!important;transition:.3s}.delete-sm[_ngcontent-%COMP%]:hover{background-color:#eb3737!important;color:#fff!important}  .mat-mdc-menu-content{margin:0;padding:8px!important;outline:0!important}.mat-mdc-button.mat-mdc-button-base[_ngcontent-%COMP%]{min-width:0px!important;padding:1%!important;height:100%!important}"]})}};var On=i=>({disabled:i}),Vs=i=>({active:i}),qs=(i,t)=>t._id;function $s(i,t){if(i&1){let e=E();r(0,"button",48),u("click",function(){h(e);let o=m().$implicit,d=m();return f(d.toggleStatus(o))}),s(1," Aktivieren "),a()}}function Bs(i,t){if(i&1){let e=E();r(0,"button",49),u("click",function(){h(e);let o=m().$implicit,d=m();return f(d.toggleStatus(o))}),s(1," Deaktivieren "),a()}}function zs(i,t){if(i&1){let e=E();r(0,"tr")(1,"td",40),s(2),a(),r(3,"td"),s(4),a(),r(5,"td",41),s(6),a(),r(7,"td"),s(8),Vt(9,"date"),a(),r(10,"td"),s(11),Vt(12,"date"),a(),r(13,"td"),p(14,"span"),a(),r(15,"td",42)(16,"div",43)(17,"button",44),u("click",function(){let o=h(e).$implicit,d=m();
2return f(d.editCategory(o))}),s(18," \xD6ffnen "),a(),r(19,"button",45)(20,"mat-icon"),s(21,"menu"),a()(),r(22,"mat-menu",null,1),y(24,$s,2,0,"button",46),y(25,Bs,2,0,"button",47),a()()()()}if(i&2){let e=t.$implicit,n=t.$index,o=M(23),d=m();l(2),S(d.startRecord+n),l(2),S(e.class_code),l(2),S(e.class_name),l(2),L(" ",e.valid_from?Vn(9,10,e.valid_from,"dd.MM.yyyy"):"-"," "),l(3),L(" ",e.valid_to?Vn(12,13,e.valid_to,"dd.MM.yyyy"):"-"," "),l(3),lt(e.status==="active"?"status-bullet status-active":"status-bullet status-inactive"),l(5),c("matMenuTriggerFor",o),l(5),C(e.status!=="active"?24:-1),l(),C(e.status==="active"?25:-1)}}function Us(i,t){i&1&&(r(0,"tr")(1,"td",50),p(2,"app-no-data",51),a()()),i&2&&(l(2),c("message","Keine Klassen gefunden"))}function Hs(i,t){if(i&1){let e=E();r(0,"li",53)(1,"a",54),u("click",function(){let o=h(e).$implicit,d=m(2);return f(d.setPage(o))}),s(2),a()()}if(i&2){let e=t.$implicit,n=m(2);c("ngClass",z(2,Vs,n.pager.currentPage===e)),l(2),S(e)}}function Ks(i,t){if(i&1){let e=E();r(0,"ul",52)(1,"li",53)(2,"a",54),u("click",function(){h(e);let o=m();return f(o.setPage(1))}),s(3,"<<"),a()(),r(4,"li",53)(5,"a",54),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager.currentPage-1))}),s(6,"<"),a()(),x(7,Hs,3,4,"li",55),r(8,"li",53)(9,"a",54),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager.currentPage+1))}),s(10,">"),a()(),r(11,"li",53)(12,"a",54),u("click",function(){h(e);let o=m();return f(o.setPage(o.pager.totalPages))}),s(13,">>"),a()()()}if(i&2){let e=m();l(),c("ngClass",z(5,On,e.pager.currentPage===1)),l(3),c("ngClass",z(7,On,e.pager.currentPage===1)),l(3),c("ngForOf",e.pager.pages),l(),c("ngClass",z(9,On,e.pager.currentPage===e.pager.totalPages)),l(3),c("ngClass",z(11,On,e.pager.currentPage===e.pager.totalPages))}}var Nn=class i{constructor(t,e,n,o){this.userService=t;this.pagerService=e;this.sweetAlert=n;this.addDLFormDialog=o;this.categoryList=[];this.pager={};this.pageSize=15;this.isHovering=!1;this.countryId=""}ngOnInit(){this.countryId?this.loadCategories():console.warn("Driving License Class: countryId not provided")}ngOnChanges(t){t.countryId&&!t.countryId.firstChange&&(this.countryId?this.loadCategories():(this.categoryList=[],this.setPage(1)))}loadCategories(){$("#loaderouterid").css("display","flex"),this.userService.getdrivingLicenseClasses(this.countryId).subscribe({next:t=>{$("#loaderouterid").css("display","none"),t.success&&(this.categoryList=t.data||[],this.setPage(1))},error:t=>{$("#loaderouterid").css("display","none"),console.error("Error loading categories:",t),this.sweetAlert.custom({type:"error",title:"Fehler",content:"Fehler beim Laden der Klassen",isHtml:!1,showCancel:!1,confirmText:"OK",confirmButtonClass:"btn-primary",disableClose:!0}).subscribe()}})}setPage(t,e=this.categoryList){if(this.pager=this.pagerService.getPager(e.length,t,this.pageSize),this.pagedItems=e.slice(this.pager.startIndex,this.pager.endIndex+1),e.length>0){let n=this.pager.pageSize||this.pageSize;this.startRecord=this.pager.currentPage*n-n+1,this.endRecord=this.pager.currentPage*n>e.length?e.length:this.pager.currentPage*n}else this.startRecord=0,this.endRecord=0}search(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key))if(t.target.value){let e=[];this.categoryList.map(n=>{(n.class_code&&n.class_code.toLowerCase().includes(t.target.value.toLowerCase())||n.class_name&&n.class_name.toLowerCase().includes(t.target.value.toLowerCase()))&&e.push(n)}),this.setPage(1,e)}else this.setPage(1)}addCategory(){this.addDLFormDialog.open(jt,{width:"100%",maxWidth:"1200px",disableClose:!1,panelClass:"custom-mat-modal-container",hasBackdrop:!0,data:{countryId:this.countryId}}).afterClosed().subscribe(e=>{e&&this.loadCategories()})}editCategory(t){console.log("category getting",t),this.addDLFormDialog.open(jt,{width:"100%",maxWidth:"1200px",disableClose:!1,panelClass:"custom-mat-modal-container",hasBackdrop:!0,data:{countryId:this.countryId,category:t}}).afterClosed().subscribe(n=>{n&&this.loadCategories()})}toggleStatus(t){let e=t.status==="active"?"inactive":"active",n=e==="active"?"aktivieren":"deaktivieren";this.sweetAlert.custom({type:"warning",title:"Status \xE4ndern?",content:`M\xF6chten Sie die Klasse "${t.class_code}" wirklich ${n}
2?`,isHtml:!1,showCancel:!0,confirmText:`Ja, ${n}`,cancelText:"Abbrechen",confirmButtonClass:"btn-primary",cancelButtonClass:"btn-cancel"}).subscribe(o=>{if(o){$("#loaderouterid").css("display","flex");let d={status:e};this.userService.updateDrivingLicenseClass(t._id,d).subscribe({next:g=>{$("#loaderouterid").css("display","none"),this.loadCategories(),this.sweetAlert.custom({type:"success",title:"Status ge\xE4ndert",content:`Die Klasse wurde erfolgreich ${e==="active"?"aktiviert":"deaktiviert"}.`,isHtml:!1,showCancel:!1,confirmText:"OK",confirmButtonClass:"btn-primary"}).subscribe()},error:g=>{$("#loaderouterid").css("display","none");let v=g.error?.message||"Beim \xC4ndern des Status ist ein Fehler aufgetreten.";this.sweetAlert.custom({type:"error",title:"Fehler",content:v,isHtml:!1,showCancel:!1,confirmText:"OK",confirmButtonClass:"btn-cancel"}).subscribe()}})}})}deleteCategory(t){this.sweetAlert.custom({type:"warning",title:"Sind Sie sicher?",content:`M\xF6chten Sie die Klasse "${t.class_code}" wirklich l\xF6schen?`,isHtml:!1,showCancel:!0,confirmText:"Ja, l\xF6schen",cancelText:"Abbrechen",confirmButtonClass:"btn-cancel",cancelButtonClass:"btn-secondary",disableClose:!0}).subscribe(e=>{e&&($("#loaderouterid").css("display","flex"),this.userService.deleteDrivingLicenseClass(t._id).subscribe({next:n=>{$("#loaderouterid").css("display","none"),this.loadCategories(),this.sweetAlert.custom({type:"success",title:"Gel\xF6scht!",content:"Die Klasse wurde erfolgreich gel\xF6scht.",isHtml:!1,showCancel:!1,disableClose:!0}).subscribe(()=>{})},error:n=>{$("#loaderouterid").css("display","none");let o=n.error?.message||"Beim L\xF6schen ist ein Fehler aufgetreten.";this.sweetAlert.custom({type:"error",title:"Fehler!",content:o,isHtml:!1,showCancel:!1,disableClose:!0}).subscribe(()=>{})}}))})}static{this.\u0275fac=function(e){return new(e||i)(B(le),B(Ae),B(O),B(je))}}static{this.\u0275cmp=P({type:i,selectors:[["app-driving-license-class"]],inputs:{countryId:"countryId"},features:[Yn],decls:57,vars:11,consts:[["table",""],["statusMenu","matMenu"],[1,"w-100","p-2"],["label","Klassen"],[1,"table-min-height"],[1,"editing-something","top-search-block",2,"margin-top","26px"],[1,"top-search-block-row"],[1,"input-block"],["type","text","placeholder","Suchen...",1,"search","myInput","w-100","new-myInput",2,"max-width","490px !important",3,"keyup"],[1,"slector-dropdown"],["mat-button","",1,"button-primary","botton-hover",3,"click","mouseover","mouseout"],[1,"menu-image",3,"src"],[1,"ml-2","d-none","d-md-inline"],[1,"table-count-box","d-flex","align-items-center","justify-content-end","flex-shrink-0"],[1,"new-tableCount"],[1,"w-100","shadow-none","mt-0","pt-0"],[1,"w-100","customTable","position-relative"],[1,"tableInnerScroll"],[1,"w-100","table"],[1,"editing-something"],[2,"width","6%","min-width","50px"],[2,"width","14%","min-width","126px"],[1,"customer-Unternehmensname","title-width",2,"width","30%","min-width","210px"],[2,"width","16%","min-width","110px"],[2,"width","8%","min-width","78px"],[1,"customer-action",2,"width","10%","min-width","150px","text-align","start"],[1,"d-flex","justify-content-end","pagination-main","mt-3"],["class","pagination m-0 pagerAction",4,"ngIf"],["label","Ausbildung"],["label","Theoriestunden"],["lessonType","THEORY",3,"countryId"],["label","Fahrstunden"],["lessonType","PRACTICAL",3,"countryId"],["label","Qualifikationspfade"],["label","Erweiterung"],["qualificationType","EXTENSION",3,"countryId"],["label","Kombinationsklassen"],["qualificationType","COMBINATION_CLASS",3,"countryId"],["label","Erteilungsarten"],[3,"countryId"],[1,"customer-id"],[1,"customer-Unternehmensname","title-style"],[2,"text-align","left"],[1,"qna-action"],["type","button",1,"openclass","offnen-btn","click",3,"click"],["matButton","",1,"",3,"matMenuTriggerFor"],["type","button",1,"openclass","offnen-btn","click","openClassHover"],["type","button",1,"offnen-btn","click","delete-sm"],["type","button",1,"openclass","offnen-btn","click","openClassHover",3,"click"],["type","button",1,"offnen-btn","click","delete-sm",3,"click"],["colspan","7"],[3,"message"],[1,"pagination","m-0","pagerAction"],[1,"page-item",3,"ngClass"],[1,"page-link",3,"click"],["class","page-item",3,"ngClass",4,"ngFor","ngForOf"]],template:function(e,n){e&1&&(r(0,"div",2)(1,"mat-tab-group")(2,"mat-tab",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"div",7)(7,"input",8),u("keyup",function(d){return n.search(d)}),a(),r(8,"div",9)(9,"button",10),u("click",function(){return n.addCategory()})("mouseover",function(){return n.isHovering=!0})("mouseout",function(){return n.isHovering=!1}),p(10,"img",11),r(11,"span",12),s(12,"Klasse hinzuf\xFCgen"),a()()()(),r(13,"div",13)(14,"span",14),s(15),a()()()(),r(16,"div",15)(17,"div",16)(18,"div",17)(19,"table",18,0)(21,"thead")(22,"tr",19)(23,"th",20),s(24,"#"),a(),r(25,"th",21),s(26," Klassencode "),a(),r(27,"th",22),s(28," Klassenname "),a(),r(29,"th",23),s(30," G\xFCltig von "),a(),r(31,"th",23),s(32," G\xFCltig bis "),a(),r(33,"th",24),s(34," Status "),a(),r(35,"th",25),s(36," Interaktionen "),a()()(),r(37,"tbody"),A(38,zs,26,16,"tr",null,qs,!1,Us,3,1,"tr"),a()()()(),r(41,"div",26),x(42,Ks,14,13,"ul",27),a()()()(),r(43,"mat-tab",28)(44,"mat-tab-group")(45,"mat-tab",29),p(46,"app-training-lessons",30),a(),r(47,"mat-tab",31),p(48,"app-training-lessons",32),a()()(),r(49,"mat-tab",33)(50,"mat-tab-group")(51,"mat-tab",34),p(52,"app-qualification-paths",35),a(),r(53,"mat-tab",36),p(54,"app-qualification-paths",37),a()()(),r(55,"mat-tab",38),p(56,"app-grant-type-management",39),a()()()),e&2&&(l(10),c("src",n.isHovering?"../assets/plus icon.svg":"../assets/plus1.svg",Te),l(5),xe(" Anzahl der Ergebnisse: ",n.startRecord," - ",n.endRecord," / ",n.categoryList.length," "),l(23),F(n.pagedItems),l(4),c("ngIf",n.categoryList.length),l(4),c("countryId",n.countryId),l(2),c("countryId",n.countryId),l(4),c("countryId",n.countryId),l(2),c("countryId",n.countryId),l(2),c("countryId",n.countryId))},dependencies:[Se,Re,Qe,Ve,N,D,Ye,Je,Fe,De,Ie,ke,ai,bn,Pn,ee,kn,ni],styles:[".mat-error{font-size:12px;line-height:1.4;margin-top:1.25em}  .mat-mdc-tab-body-active>.mat-mdc-tab-body-content{overflow-y:hidden}.top-search-block-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:30px}.input-block[_ngcontent-%COMP%]{display:flex;align-items:center;gap:15px;flex:1 1 0;min-width:0}.question-management[_ngcontent-%COMP%]   .new-myInput[_ngcontent-%COMP%]{max-width:600px;height:50px;padding:8px 20px 6px 39px}.myInput[_ngcontent-%COMP%]{height:48px!important}.new-myInput[_ngcontent-%COMP%]::placeholder{color:#5159666e;font-size:14px;line-height:1.3;font-weight:500}.slector-dropdown[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{padding:16px!important;border-radius:12px;font-size:16px;line-height:1.3;font-weight:400;color:#515966;position:relative;white-space:nowrap}.slector-dropdown[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]     .mdc-button__label{display:flex;align-items:center}.main-table-card[_ngcontent-%COMP%]{border:solid 1px #cbcbcb;border-radius:5px;overflow-x:auto;overflow-y:hidden}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:10px}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{font-size:16px;padding:16px 10px;line-height:1.3;color:#75787d;font-weight:700}.main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{font-size:16px;line-height:1.3;color:#515966;font-weight:400}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]:first-child, .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:first-child{padding-left:20px}.main-table-card[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]:last-child, .main-table-card[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:last-child{padding-right:20px}table.w-100[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]{border-bottom:1px solid #e9ecef}table.w-100[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:1px solid #e9ecef;padding:10px}.title-style[_ngcontent-%COMP%]{font-weight:500}.status-bullet[_ngcontent-%COMP%]{display:inline-block;width:12px;height:12px;border-radius:50%}.status-bullet.status-active[_ngcontent-%COMP%]{background-color:#28a745}.status-bullet.status-inactive[_ngcontent-%COMP%]{background-color:#dc3545}.qna-action[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.offnen-btn[_ngcontent-%COMP%]{background-color:#d0e7ff;border-radius:5px;padding:6px 10px;font-size:14px;line-height:1.3;font-weight:500;border:none}.openclass[_ngcontent-%COMP%]{background-color:#e0f2ff!important;border:none!important;color:#515966!important}.openclass[_ngcontent-%COMP%]:hover{border:none!important;background:#1388fe!important;color:#fff!important}.delete-sm[_ngcontent-%COMP%]{background-color:#fff0f0!important;color:#eb3737!important;border:none!important;transition:.3s}.delete-sm[_ngcontent-%COMP%]:hover{background-color:#eb3737!important;color:#fff!important}.mat-mdc-button.mat-mdc-button-base[_ngcontent-%COMP%]{min-width:0px!important;padding:1%!important;height:100%!important}"]})}};var Gn=i=>({disabled:i}),Qs=i=>({active:i});function js(i,t){if(i&1){let e=E();r(0,"tr",109)(1,"td",110),s(2),a(),r(3,"td",111),s(4),a(),r(5,"td",111),s(6),a(),r(7,"td",112),s(8),a(),r(9,"td",111),s(10),a(),r(11,"td",113)(12,"button",114),u("click",function(){let o=h(e).$implicit,d=m(2);return d.editCountry(o),f(d.currentTabIndex=0)}),s(13,"\xD6ffnen"),a()()()}if(i&2){let e=t.$implicit,n=t.index,o=m(2);c("id",Le("ul",e._id)),l(2),S(o.startRecord+n),l(2),L(" ",e.germanName," "),l(2),L(" ",e.code," "),l(2),L(" ",e.number_of_states," "),l(2),L(" ",e.currencyString," "),l(2),c("id",Le("click",e._id))}}function Ys(i,t){i&1&&(r(0,"tr")(1,"td",115),s(2,"Keine L\xE4nder gefunden"),a()())}function Js(i,t){if(i&1){let e=E();r(0,"li",117)(1,"a",118),u("click",function(){let o=h(e).$implicit,d=m(3);return f(d.setPage(o))}),s(2),a()()}if(i&2){let e=t.$implicit,n=m(3);c("ngClass",z(2,Qs,n.pager.currentPage===e)),l(2),S(e)}}function Ws(i,t){if(i&1){let e=E();r(0,"ul",116)(1,"li",117)(2,"a",118),u("click",function(){h(e);let o=m(2);return f(o.setPage(1))}),s(3," << "),a()(),r(4,"li",117)(5,"a",118),u("click",function(){h(e);let o=m(2);return f(o.setPage(o.pager.currentPage-1))}),s(6," < "),a()(),x(7,Js,3,4,"li",119),r(8,"li",117)(9,"a",118),u("click",function(){h(e);let o=m(2);return f(o.setPage(o.pager.currentPage+1))}),s(10,"> "),a()(),r(11,"li",117)(12,"a",118),u("click",function(){h(e);let o=m(2);return f(o.setPage(o.pager.totalPages))}),s(13," >> "),a()()()}if(i&2){let e=m(2);l(),c("ngClass",z(5,Gn,e.pager.currentPage===1)),l(3),c("ngClass",z(7,Gn,e.pager.currentPage===1)),l(3),c("ngForOf",e.pager.pages),l(),c("ngClass",z(9,Gn,e.pager.currentPage===e.pager.totalPages)),l(3),c("ngClass",z(11,Gn,e.pager.currentPage===e.pager.totalPages))}}function Xs(i,t){if(i&1){let e=E();r(0,"div",81)(1,"div",82)(2,"div",83)(3,"div",58)(4,"div",84)(5,"input",85),u("keyup",function(o){h(e);let d=m();
2return f(d.filterTable(o))}),a()(),r(6,"div",86)(7,"button",87),u("click",function(){h(e);let o=m();return f(o.addNewTax())})("mouseover",function(){h(e);let o=m();return f(o.isHovering=!0)})("mouseout",function(){h(e);let o=m();return f(o.isHovering=!1)}),p(8,"img",88),r(9,"span",89),s(10,"L\xE4nder hinzuf\xFCgen"),a()()(),r(11,"div",90)(12,"span",91),s(13),a()()()()(),r(14,"div")(15,"div",92)(16,"div",93)(17,"div",94)(18,"table",95)(19,"thead")(20,"tr")(21,"th",96),s(22,"#"),a(),r(23,"th",97),s(24," L\xE4ndername "),p(25,"i",98),a(),r(26,"th",99),s(27," L\xE4nderk\xFCrzel "),p(28,"i",100),a(),r(29,"th",101),s(30," Anzahl der Bundesl\xE4nder "),p(31,"i",102),a(),r(32,"th",103),s(33," Landesw\xE4hrung "),p(34,"i",104),a(),r(35,"th",105),s(36," Interaktionen "),a()()(),r(37,"tbody"),x(38,js,14,9,"tr",106)(39,Ys,3,0,"tr",64),a()()()(),r(40,"div",107),x(41,Ws,14,13,"ul",108),a()()()()}if(i&2){let e=m();l(8),c("src",e.isHovering?"../assets/plus icon.svg":"../assets/plus1.svg",Te),l(5),xe("Anzahl der Ergebnisse: ",e.startRecord," - ",e.endRecord," / ",e.countriesList.length),l(12),c("appSort",e.pagedItems),l(3),c("appSort",e.pagedItems),l(3),c("appSort",e.pagedItems),l(3),c("appSort",e.pagedItems),l(4),c("ngForOf",e.pagedItems),l(),c("ngIf",!e.countriesList.length),l(2),c("ngIf",e.countriesList.length)}}function Zs(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",e),l(),Me(" ",e.symbol," - ",e.countryName," ")}}function el(i,t){if(i&1){let e=E();r(0,"span",160)(1,"span"),s(2),a(),r(3,"i",161),u("click",function(){let o=h(e).$implicit,d=m(3);
2return d.deleteUpdateCurrencyList(o),f(d.formDirty.editCountryFormGroup=!0)}),a()()}if(i&2){let e=t.$implicit;l(2),S(e.symbol)}}function tl(i,t){if(i&1&&(tt(0),r(1,"p",157),s(2,"Gew\xE4hlt Landesw\xE4hrung:"),a(),r(3,"div",158),x(4,el,4,1,"span",159),a(),nt()),i&2){let e=m(2);l(4),c("ngForOf",e.updateCurrencyList)}}function nl(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",e.name),l(),Me(" ",e.name," (",e.code,") ")}}function il(i,t){if(i&1){let e=E();r(0,"span",163),s(1),r(2,"i",164),u("click",function(){let o=h(e).index,d=m(3);return f(d.removeLanguage(o,!1))}),a()()}if(i&2){let e=t.$implicit;l(),Me(" ",e.name," (",e.code,") ")}}function al(i,t){if(i&1&&(tt(0),r(1,"p",157),s(2,"Ausgew\xE4hlte Sprachen:"),a(),r(3,"div",158),x(4,il,3,2,"span",162),a(),nt()),i&2){let e=m(2);l(4),c("ngForOf",e.languagesList)}}function rl(i,t){i&1&&(r(0,"div",34)(1,"p",165),s(2,"Kein Bundesstaat gefunden"),a()())}function ol(i,t){if(i&1){let e=E();r(0,"div",166)(1,"div",167)(2,"div",168)(3,"div",169),p(4,"img",170),s(5,"\xA0 "),r(6,"h6",171),s(7),r(8,"label",172),s(9),a()()(),r(10,"img",173),u("click",function(){let o=h(e).$implicit,d=m(2);return f(d.removeState(o,"edit"))}),a()()()()}if(i&2){let e=t.$implicit,n=m(2);l(7),L(" ",e," "),l(2),S(n.openedCountry==null?null:n.openedCountry.germanName)}}function sl(i,t){if(i&1){let e=E();r(0,"div",174)(1,"button",175),u("click",function(){h(e);let o=m(2);return f(o.updateCountry())}),s(2," \xC4nderungen speichern "),a()()}if(i&2){let e=m(2);l(),c("disabled",e.updateCurrencyList.length==0||!e.formDirty.editCountryFormGroup||!e.editCountryFormGroup.valid)}}function ll(i,t){if(i&1){let e=E();r(0,"div",81)(1,"div",92)(2,"div",120)(3,"h6",121)(4,"label",122),u("click",function(){h(e);let o=m();return f(o.close_edit_country())}),s(5,"L\xE4nder Management"),a(),r(6,"span",123),s(7,"/"),a(),r(8,"span",124),s(9),a()()(),r(10,"mat-tab-group",125),u("selectedTabChange",function(o){h(e);let d=m();return f(d.currentTabIndex=o.index)}),r(11,"mat-tab",126)(12,"div",127)(13,"div",59)(14,"div",128)(15,"h6",129),p(16,"img",77),s(17,"Land:"),a(),r(18,"div",60)(19,"mat-form-field",42)(20,"mat-label"),s(21,"Land ausw\xE4hlen"),a(),p(22,"input",130),a()()()(),r(23,"div",59)(24,"div",128)(25,"h6",129),p(26,"img",77),s(27,"L\xE4nderk\xFCrzel:"),a(),r(28,"div",60)(29,"mat-form-field",42)(30,"mat-label"),s(31,"L\xE4nderk\xFCrzel"),a(),r(32,"input",65),u("keyup",function(o){h(e);let d=m();return f(d.updateSelectedCountry.code=o.target.value)}),a()()()()(),r(33,"div",131)(34,"div",128)(35,"h6",129),p(36,"img",132),s(37),a(),r(38,"div",60)(39,"mat-form-field",133)(40,"mat-label"),s(41,"Landesw\xE4hrung"),a(),r(42,"input",134,7),u("keyup",function(o){h(e);let d=m();return f(d.filterCurrency(o))}),a(),r(44,"mat-autocomplete",62,8),u("optionSelected",function(o){h(e);let d=m();return f(d.setUpdatedCurrencyList(o))}),x(46,Zs,2,3,"mat-option",63),a()(),x(47,tl,5,1,"ng-container",64),a()()(),r(48,"div",135)(49,"div",128)(50,"h6",129),p(51,"img",77),s(52," Sprache(n): "),a(),r(53,"div",60)(54,"mat-form-field",42)(55,"mat-label"),s(56,"Sprache(n) ausw\xE4hlen"),a(),r(57,"input",136,9),u("keyup",function(o){h(e);let d=m();return f(d.filterLanguages(o))}),a(),r(59,"mat-autocomplete",62,10),u("optionSelected",function(o){h(e);let d=m();return f(d.setLanguagesList(o,!1))}),x(61,nl,2,3,"mat-option",63),a()(),x(62,al,5,1,"ng-container",64),a()()()()(),r(63,"mat-tab",137)(64,"div",138)(65,"div",139)(66,"div",84)(67,"input",140),u("keyup.enter",function(o){h(e);let d=m();return f(d.searchState(o,"edit"))}),a()(),r(68,"div",86)(69,"button",141),u("click",function(){h(e);let o=m();return f(o.open_modal("StateModal"))})("mouseover",function(){h(e);let o=m();return f(o.isHovering=!0)})("mouseout",function(){h(e);let o=m();return f(o.isHovering=!1)}),p(70,"img",88),r(71,"span",89),s(72,"Bundesl\xE4nder hinzuf\xFCgen"),a()()(),r(73,"div",90)(74,"span",91),s(75),a()()(),r(76,"div",142),x(77,rl,3,0,"div",48),a(),r(78,"div",143),x(79,ol,11,2,"div",144),a()()(),r(80,"mat-tab",145),p(81,"app-country-tax",146),a(),r(82,"mat-tab",147),p(83,"app-country-holidays",146
2),a(),r(84,"mat-tab",148),p(85,"app-country-companytype",146),a(),r(86,"mat-tab",149),p(87,"app-country-ledger",150),a(),r(88,"mat-tab",151),p(89,"app-country-absencetype",146),a(),r(90,"mat-tab",152),p(91,"app-country-timezone",153),a(),r(92,"mat-tab",154),p(93,"app-driving-license-class",146),a()(),x(94,sl,3,1,"div",155),a()()}if(i&2){let e=M(45),n=M(60),o=m();l(9),S(o.openedCountry==null?null:o.openedCountry.germanName),l(3),c("formGroup",o.editCountryFormGroup),l(10),c("value",o.updateSelectedCountry.germanName),l(10),c("value",o.updateSelectedCountry.code)("disabled",o.updateSelectedCountry.code!=""),l(5),L("Bitte w\xE4hlen Sie die Landesw\xE4hrung ",o.countryFormGroup.value.country?"f\xFCr "+o.countryFormGroup.value.country:""," aus:"),l(5),c("matAutocomplete",e)("readonly",o.updateSelectedCountry.germanName===""),l(4),c("ngForOf",o.filteredCurrencyList),l(),c("ngIf",o.updateCurrencyList.length>0),l(10),c("matAutocomplete",n),l(4),c("ngForOf",o.filteredLanguages),l(),c("ngIf",o.languagesList.length>0),l(8),c("src",o.isHovering?"../assets/plus icon.svg":"../assets/plus1.svg",Te),l(5),Me("Anzahl der Ergebnisse: 1 - ",o.editCountryFormGroup.value==null||o.editCountryFormGroup.value.searched_states==null?null:o.editCountryFormGroup.value.searched_states.length," / ",o.editCountryFormGroup.value==null||o.editCountryFormGroup.value.searched_states==null?null:o.editCountryFormGroup.value.searched_states.length),l(2),c("ngIf",!(o.editCountryFormGroup.value!=null&&o.editCountryFormGroup.value.searched_states)||(o.editCountryFormGroup.value==null||o.editCountryFormGroup.value.searched_states==null?null:o.editCountryFormGroup.value.searched_states.length)==0),l(2),c("ngForOf",o.editCountryFormGroup.value==null?null:o.editCountryFormGroup.value.searched_states),l(2),c("countryId",o.countryId),l(2),c("countryId",o.countryId),l(2),c("countryId",o.countryId),l(2),c("countryId",o.countryId)("type","global"),l(2),c("countryId",o.countryId),l(2),c("type","global")("countryId",o.countryId)("openedCountry",o.openedCountry),l(2),c("countryId",o.countryId),l(),c("ngIf",o.currentTabIndex==0||o.currentTabIndex==1)}}function dl(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",e),l(),S(e)}}function cl(i,t){if(i&1&&(tt(0),x(1,dl,2,2,"mat-option",63),nt()),i&2){let e=m(2);l(),c("ngForOf",e.countryFormGroup.value.searched_states)}}function ml(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",e),l(),S(e)}}function pl(i,t){if(i&1&&(tt(0),x(1,ml,2,2,"mat-option",63),nt()),i&2){let e=m(2);l(),c("ngForOf",e.editCountryFormGroup.value.searched_states)}}function ul(i,t){if(i&1){let e=E();r(0,"div",41)(1,"p",35),s(2,"Bitte w\xE4hlen Sie den Bundesstaat aus, f\xFCr den Sie diesen Feiertag hinzuf\xFCgen:"),a(),r(3,"mat-form-field",42)(4,"mat-label"),s(5,"Bundesstaat ausw\xE4hlen"),a(),r(6,"input",176),u("keyup",function(o){h(e);let d=m();return f(d.searchState(o,d.editHolidayFormGroup.value.action))}),a(),r(7,"mat-autocomplete",null,11),x(9,cl,2,1,"ng-container",64)(10,pl,2,1,"ng-container",64),a()()()}if(i&2){let e=M(8),n=m();l(6),c("matAutocomplete",e),l(3),c("ngIf",n.editHolidayFormGroup.value.action=="add"),l(),c("ngIf",n.editHolidayFormGroup.value.action=="edit")}}function gl(i,t){if(i&1&&(r(0,"p",35),s(1),a()),i&2){let e=m();l(),L(" ",e.editHolidayFormGroup.value.duration_type=="0"?"Bitte w\xE4hlen Sie das Datum des Feiertags:":"Bitte w\xE4hlen Sie Start- und Enddaten der Feiertage:"," ")}}function _l(i,t){if(i&1&&(r(0,"p",35),s(1),a()),i&2){let e=m();l(),L(" ",e.editHolidayFormGroup.value.duration_type=="0"?"Bitte w\xE4hlen Sie das Datum und den Monat des Feiertags:":"Bitte w\xE4hlen Sie das Startdatum, den Monat und das Enddatum, den Monat der Feiertage aus:"," ")}}function hl(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",vt(e)),l(),S(e)}}function fl(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",vt(e.serial)),l(),S(e.german)}}function yl(i,t){if(i&1&&(r(0,"div",177)(1,"mat-form-field",42)(2,"mat-label"),s(3,"Feiertagsdatum"),a(),r(4,"mat-select",178),x(5,hl,2,3,"mat-option",63),a()(),s(6,"\xA0 "),r(7,"mat-form-field",42)(8,"mat-label"),s(9,"Ferienmonat"),a(),r(10,"mat-select",179),x(11,fl,2,3,"mat-option",63),a()()()),i&2){let e=m();l(5),c("ngForOf",e.dates),l(6),c("ngForOf",e.months)}}function Cl(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",vt(e)),l(),S(e)}}function vl(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",vt(e.serial)),l(),S(e.german)}}function bl(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",vt(e)),l(),S(e)}}function xl(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",vt(e.serial)),l(),S(e.german)}}function Sl(i,t){if(i&1&&(r(0,"div",34)(1,"div",29)(2,"div",180)(3,"mat-form-field",42)(4,"mat-label"),s(5,"Startdatum "),a(),r(6,"mat-select",181),x(7,Cl,2,3,"mat-option",63),a()()(),r(8,"div",180)(9,"mat-form-field",42)(10,"mat-label"),s(11,"Startmonat"),a(),r(12,"mat-select",182),x(13,vl,2,3,"mat-option",63),a()()(),r(14,"div",183)(15,"mat-form-field",42)(16,"mat-label"),s(17,"Enddatum "),a(),r(18,"mat-select",184),x(19,bl,2,3,"mat-option",63),a()()(),r(20,"div",183)(21,"mat-form-field",42)(22,"mat-label"),s(23,"Endmonat"),a(),r(24,"mat-select",185),x(25,xl,2,3,"mat-option",63),a()()()()()),i&2){let e=m();l(7),c("ngForOf",e.dates),l(6),c("ngForOf",e.months),l(6),c("ngForOf",e.dates),l(6),c("ngForOf",e.months)}}function El(i,t){if(i&1&&(tt(0),r(1,"mat-form-field",42)(2,"mat-label"),s(3,"Feiertagsdatum"),a(),p(4,"input",186)(5,"mat-datepicker-toggle",187)(6,"mat-datepicker",188,12),a(),nt()),i&2){let e=M(7);l(4),c("matDatepicker",e),l(),c("for",e)}}function wl(i,t){if(i&1&&(tt(0),r(1,"mat-form-field",42)(2,"mat-label"),s(3,"Startdatum "),a(),p(4,"input",189)(5,"mat-datepicker-toggle",187)(6,"mat-datepicker",188,13),a(),s(8,"\xA0\xA0 "),r(9,"mat-form-field",42)(10,"mat-label"),s(11,"Enddatum"),a(),p(12,"input",190)(13,"mat-datepicker-toggle",187)(14,"mat-datepicker",188,14),a(),nt()),i&2){let e=M(7),n=M(15);l(4),c("matDatepicker",e),l(),c("for",e),l(7),c("matDatepicker",n),l(),c("for",n)}}function Tl(i,t){if(i&1&&(r(0,"div",177),x(1,El,8,2,"ng-container",64)(2,wl,16,4,"ng-container",64),a()),i&2){let e=m();l(),c("ngIf",e.editHolidayFormGroup.value.duration_type=="0"),l(),c("ngIf",e.editHolidayFormGroup.value.duration_type=="1")}}function Ll(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",e),l(),L(" ",e," ")}}function Ml(i,t){i&1&&(r(0,"mat-error"),s(1," Land ist erforderlich "),a())}function Il(i,t){i&1&&(r(0,"mat-error"),s(1," Land muss mindestens 2 Zeichen haben "),a())}function Pl(i,t){i&1&&(r(0,"mat-error"),s(1," Land darf h\xF6chstens 20 Zeichen haben "),a())}function Al(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",e),l(),Me(" ",e.symbol," - ",e.countryName," ")}}function Fl(i,t){if(i&1){let e=E();r(0,"span",160)(1,"span"),s(2),a(),r(3,"i",161),u("click",function(){let o=h(e).$implicit,d=m(2);return f(d.deleteCurrencyList(o))}),a()()}if(i&2){let e=t.$implicit;l(2),S(e.symbol)}}function Dl(i,t){if(i&1&&(tt(0),r(1,"p",191),s(2,"Gew\xE4hlt Landesw\xE4hrung:"),a(),r(3,"div",158),x(4,Fl,4,1,"span",159),a(),nt()),i&2){let e=m();l(4),c("ngForOf",e.currencyList)}}function kl(i,t){if(i&1&&(r(0,"mat-option",156),s(1),a()),i&2){let e=t.$implicit;c("value",e.name),l(),Me(" ",e.name," (",e.code,") ")}}function Ol(i,t){if(i&1){let e=E();r(0,"span",163),s(1),r(2,"i",164),u("click",function(){let o=h(e).index,d=m(2);return f(d.removeLanguage(o,!0))}),a()()}if(i&2){let e=t.$implicit;l(),Me(" ",e.name," (",e.code,") ")}}function Nl(i,t){if(i&1&&(tt(0),r(1,"p",157),s(2,"Ausgew\xE4hlte Sprachen:"),a(),r(3,"div",158),x(4,Ol,3,2,"span",162),a(),nt()),i&2){let e=m();l(4),c("ngForOf",e.languagesList)}}var Ni=class i{constructor(t,e,n,o,d,g,v,T){this.router=t;this.authService=e;this.userService=n;this._formBuilder=o;this.httpService=d;this.pagerService=g;this.validationAlerts=v;this.sweetAlert=T;this.title=localStorage.getItem("token");this.lastname=localStorage.getItem("token");this.firstname=localStorage.getItem("token");this.year=new Date().getFullYear();this.loginRole=localStorage.getItem("currentActiveRole");this.selectedCountry={englishName:"",germanName:"",code:"",currency:""};this.countriesList=[];this.filteredCountriesList=[];this.countriesArray=[];this.autoOptions=[];this.currencyArray=[];this.filteredCurrencyList=[];this.currencyList=[];this.updateSelectedCountry={id:"",englishName:"",germanName:"",code:"",currency:""};this.updateCurrencyList=[];this.pager={};this.months=[{serial:"01",english:"January",german:"Januar",days:31},{serial:"02",english:"February",german:"Februar",days:29}
2,{serial:"03",english:"March",german:"M\xE4rz",days:31},{serial:"04",english:"April",german:"April",days:30},{serial:"05",english:"May",german:"Mai",days:31},{serial:"06",english:"June",german:"Juni",days:30},{serial:"07",english:"July",german:"Juli",days:31},{serial:"08",english:"August",german:"August",days:31},{serial:"09",english:"September",german:"September",days:30},{serial:"10",english:"October",german:"Oktober",days:31},{serial:"11",english:"November",german:"November",days:30},{serial:"12",english:"December",german:"Dezember",days:31}];this.dates=[];this.holidayFilters={holidayFilter:"",stateFilter:""};this.formDirty={holidayFormGroup:!1,editHolidayFormGroup:!1,editCountryFormGroup:!1};this.formSubscriptions={editHolidayFormGroup:Qn};this.currentScreen=0;this.countryId="";this.currentTabIndex=0;this.availableLanguages=qt;this.filteredLanguages=qt;this.languagesList=[];this.isHovering=!1}ngOnInit(){for(let n=1;n<=31;n++)this.dates.push(n<10?"0"+n:n);this.title=this.userService.getDecodedAccessToken(this.title).title,this.lastname=this.userService.getDecodedAccessToken(this.lastname).lastname,this.firstname=this.userService.getDecodedAccessToken(this.firstname).firstname,$("#loaderouterid").css("display","flex"),this.getCountriesList(),this.httpService.get("./assets/countries.json").subscribe(n=>{Object.entries(n).map(o=>{this.httpService.get("./assets/countries-de.json",{responseType:"text"}).subscribe(d=>{let v=JSON.parse(d).find(T=>T.alpha2===o[1].iso_alpha2.toLowerCase());v&&(this.countriesArray.push({englishName:o[1].name,germanName:v.name?v.name:"",code:o[1].iso_alpha2,currency:o[1].currency_symbol,states:v.states}),this.autoOptions.push(v.name),o[1].currency_symbol!==" "&&o[1].currency_symbol!==""&&(this.currencyArray.push({symbol:o[1].currency_symbol,code:o[1].iso_alpha2,countryName:v.name}),this.filteredCurrencyList.push({symbol:o[1].currency_symbol,code:o[1].iso_alpha2,countryName:v.name})))})}),console.log("check countries array"),console.log(this.countriesArray),$("#loaderouterid").css("display","none")}),this.countryFormGroup=this._formBuilder.group({country:["",[_.required,_.minLength(2),_.maxLength(50)]],currency:[""],languageSearch:[""],tax_required:[!1,_.required],small_companies_tax_solution:[!1],tax_length:[""],tax_prefix:[""],taxes:this._formBuilder.array([]),states:[],searched_states:[],holidays:[],searched_holidays:[],languages:[]}),this.editCountryFormGroup=this._formBuilder.group({country:[""],currency:[""],languageSearch:[""],tax_required:[!1],small_companies_tax_solution:[!1],tax_length:[""],tax_prefix:[""],editTaxes:this._formBuilder.array([]),states:[],searched_states:[],holidays:[],searched_holidays:[],languages:[]}),this.holidayFormGroup=this._formBuilder.group({type:["0",_.required],state:[""],name:["",_.required],description:["",_.required],date_type:["0",_.required],duration_type:["0",_.required],full_date:[""],date:[""],month:[""],from_full_date:[""],to_full_date:[""],from_date:[""],from_month:[""],to_date:[""],to_month:[""]}),this.editHolidayFormGroup=this._formBuilder.group({index:["",_.required],action:["",_.required],type:["0",_.required],state:[""],name:["",_.required],description:["",_.required],date_type:["0",_.required],duration_type:["0",_.required],full_date:[""],date:[""],month:[""],from_full_date:[""],to_full_date:[""],from_date:[""],from_month:[""],to_date:[""],to_month:[""]});let t=this.countryFormGroup.controls;this.filteredOptions=t.country.valueChanges.pipe(Rn(""),ve(n=>this._filter(n||"")));let e=this.editCountryFormGroup.controls;this.updateFilteredOptions=e.country.valueChanges.pipe(Rn(""),ve(n=>this.updateFilter(n||"")))}get taxes(){return this.countryFormGroup.controls.taxes}add_taxes(t="auto"){t=="manual"&&this.taxes.controls.at(-1).patchValue({opened:!1}),this.taxes.push(this.taxes_formgroup())}get editTaxes(){return this.editCountryFormGroup.controls.editTaxes}add_editTaxes(t="auto"){t=="manual"&&this.editTaxes.controls.at(-1).patchValue({opened:!1}),this.editTaxes.push(this.taxes_formgroup())}taxes_formgroup(){return this._formBuilder.group({_id:[""],tax_name:["",_.required],private_tax_required:[!0,_.required],private_tax_name:["",_.required],private_tax:["",_.required],private_description:[""],company_tax_required:[!0,_.required],company_tax_name:["",_.required],company_tax_on_wrong_length:["",_.required],company_tax_on_correct_length:["",_.required],wrong_length_error_message:[""],correct_length_message:[""],opened:[!0]})}_filter(t){let e=t!==""?t.toLowerCase():"";if(e!=""){let n=this.countriesArray.find(o=>o.germanName.toLowerCase()==e);return n?(this.currencyList=[],this.selectedCountry=JSON.parse(JSON.stringify(n)),this.currencyList.push({symbol
2:this.selectedCountry.currency,code:this.selectedCountry.code,countryName:this.selectedCountry.germanName})):this.selectedCountry={englishName:"",germanName:"",code:"",currency:""},this.autoOptions.filter(o=>o.toLowerCase().includes(e))}else return this.autoOptions}countryChanged(){setTimeout(()=>{let t=this.countriesArray.find(e=>e.germanName==this.countryFormGroup.value.country).states;this.countryFormGroup.patchValue({states:t,searched_states:t,holidays:[],searched_holidays:[]}),this.holidayFilters={holidayFilter:"",stateFilter:""}},500)}addHoliday(t){let e=t=="add"?"countryFormGroup":"editCountryFormGroup",n=this[e].value.holidays||[];n.push(this.holidayFormGroup.value),this[e].patchValue({holidays:n,searched_states:this[e].value.states}),this.holidayFormGroup.reset(),this.holidayFormGroup.patchValue({type:"0",date_type:"0",duration_type:"0"}),this.filterHolidays("add")}filterHolidays(t){let e=t=="add"?"countryFormGroup":"editCountryFormGroup";if(this.holidayFilters.holidayFilter=="all"||this.holidayFilters.holidayFilter=="")this[e].patchValue({searched_holidays:this[e].value.holidays});else{let n=[];this[e].value.holidays.map(o=>{(this.holidayFilters.holidayFilter=="statewise"&&o.type=="1"&&(this.holidayFilters.stateFilter!="all"&&this.holidayFilters.stateFilter!=""&&o.state==this.holidayFilters.stateFilter||this.holidayFilters.stateFilter=="all"||this.holidayFilters.stateFilter=="")||this.holidayFilters.holidayFilter=="countrywise"&&o.type=="0")&&n.push(o)}),this[e].patchValue({searched_holidays:n})}console.log("lets check what happend in filter"),console.log(this[e].value.holidays)}isLoggedIn(){let t=this.authService.checkRouteRedirect(this.loginRole);this.router.navigate([t])}addCountry(){let t=this.languagesList.map(n=>n.name),e={englishName:this.selectedCountry.englishName,germanName:this.selectedCountry.germanName,code:this.selectedCountry.code,currency:this.currencyList,states:this.countryFormGroup.value.states,languages:t};console.log("check data before sending = ",e),$("#loaderouterid").css("display","flex"),this.userService.addNewCountry(e).subscribe(n=>{this.getCountriesList(),$("#loaderouterid").css("display","none"),this.sweetAlert.html("",`<label class="button-primary p-1 m-1">${this.selectedCountry.germanName}</label> Land erfolgreich hinzugef\xFCgt.`,{type:"success"}).subscribe(()=>{$("#closeAddCountryModal").trigger("click"),this.close_modal("addCountryModal","addCountryModal_parent"),this.reloadCurrentRoute()})},n=>{$("#loaderouterid").css("display","none"),this.sweetAlert.error("Dieses Land wurde bereits hinzugef\xFCgt.","","OK").subscribe()})}onSaveChangesClick(){if(!this.countryFormGroup.valid){this.sweetAlert.info("Bitte alle Pflichtfelder ausf\xFCllen.","Bitte f\xFCllen Sie alle erforderlichen Felder aus, um fortzufahren.","OK").subscribe(),this.countryFormGroup.markAllAsTouched();return}this.addCountry()}patchState(t,e){let n=e=="add"?"countryFormGroup":"editCountryFormGroup",o=this[n].controls.states.value||[];o.findIndex(d=>d==t?.address_components?.find(g=>g.types.includes("administrative_area_level_1"))?.long_name)==-1&&(o.push(t?.address_components?.find(d=>d.types.includes("administrative_area_level_1"))?.long_name),this[n].patchValue({states:o})),$("#stateSearch").val("")}removeState(t,e){let n=e=="add"?"countryFormGroup":"editCountryFormGroup",o=this[n].value.states;o.splice(o.findIndex(d=>d==t),1),this[n].patchValue({states:o})}searchState(t,e){let n=e=="add"?"countryFormGroup":"editCountryFormGroup";if(t.target.value){let o=[];this[n].value.states.map(d=>{d.toLowerCase().includes(t.target.value.toLowerCase())&&o.push(d)}),this[n].patchValue({searched_states:o})}else this[n].patchValue({searched_states:this[n].value.states})}resetAddHolidayModal(){this.holidayFormGroup.reset(),this.holidayFormGroup.patchValue({type:"0",date_type:"0",duration_type:"0"})}checkValidation(){return!(this.selectedCountry.englishName!==""&&this.currencyList.length!==0&&this.selectedCountry.code!=="")}getCountriesList(){this.userService.getAllCountries().subscribe(t=>{this.countriesList=t.map(e=>X(I({},e),{currencyString:e.currency.map(n=>n.symbol).join(", "),number_of_states:e?.states?.length||0})),this.setPage(1)})}setPage(t){this.pager=this.pagerService.getPager(this.countriesList.length,t),this.pagedItems=this.countriesList.slice(this.pager.startIndex,this.pager.endIndex+1),this.countriesList.length>0?(this.startRecord=this.pager.currentPage*this.pagerService.getDefaultPageSize()-this.pagerService.getDefaultPageSize()+1,this.endRecord=this.pager.currentPage*this.pagerService.getDefaultPageSize()>this.countriesList.length?this.countriesList.length:this.pager.currentPage*this.pagerService.getDefaultPageSize()):(this.startRecord=0,this.endRecord=0)}filterTable(t){let e=t.target.value.toLowerCase();e===""?this.setPage(1):(this.filteredCountriesList=JSON.parse(JSON.stringify(this.countriesList)),this.pagedItems=this.filteredCountriesList.filter(n=>n.germanName.toLowerCase().includes(e)))}filterCurrency(t){let e=t.target.value.toLowerCase();this.filteredCurrencyList=[];for(let n=0;n<this.currencyArray.length;n++)this.currencyArray[n].countryName.toLowerCase().indexOf(e)!=-1&&this.filteredCurrencyList.push(this.currencyArray[n])}setCurrencyList(t){this.countryFormGroup.controls.currency.setValue(""),this.currencyList.find(o=>o.symbol===t.option.value.symbol)?this.sweetAlert.error("W\xE4hrung bereits hinzugef\xFCgt.","","OK").subscribe():(this.currencyList.push(t.option.value),document.getElementById("currencySelect").blur()
2)}deleteCurrencyList(t){this.currencyList=this.currencyList.filter(e=>e.symbol!==t.symbol||e.code!==t.code)}filterLanguages(t){let e=t.target.value.toLowerCase();e?this.filteredLanguages=this.availableLanguages.filter(n=>n.name.toLowerCase().includes(e)||n.code.toLowerCase().includes(e)):this.filteredLanguages=[...this.availableLanguages]}setLanguagesList(t,e=!1){let n=t.option.value,o=this.availableLanguages.find(v=>v.name===n);if(!o){console.error("Selected language not found:",n);return}let d=e?this.editCountryFormGroup:this.countryFormGroup;d.patchValue({languageSearch:""}),this.languagesList.some(v=>v.name===o.name)?this.sweetAlert.error("Sprache bereits hinzugef\xFCgt.","","OK").subscribe():(this.languagesList.push(o),d.patchValue({languages:this.languagesList.map(v=>v.name)}),e&&(this.formDirty.editCountryFormGroup=!0));let g=document.querySelector(e?"#editLanguageSelect":"#addLanguageSelect");g&&g.blur()}removeLanguage(t,e=!1){this.languagesList.splice(t,1),(e?this.editCountryFormGroup:this.countryFormGroup).patchValue({languages:this.languagesList.map(o=>o.name)}),e&&(this.formDirty.editCountryFormGroup=!0)}close_edit_country(){$("body").removeClass("modal-open"),this.formDirty.editCountryFormGroup&&this.updateCurrencyList.length>0&&this.editCountryFormGroup.valid?this.sweetAlert.confirm("Bist du sicher?","Die eingetragenen Daten werden gel\xF6scht.",{type:"warning",confirmText:"Ja, L\xF6schen",cancelText:"Abbrechen"}).subscribe(t=>{t&&this.reloadCurrentRoute()}):($(".click").html("\xD6ffnen"),this.reloadCurrentRoute())}editCountry(t){$("#click"+t._id).html()=="\xD6ffnen"?(this.countryId=t?._id,$("#ul"+t._id).css({filter:"none","pointer-events":"auto"}),$(".click").html("\xD6ffnen"),$("#click"+t._id).html("Schlie\xDFen"),this.openedCountry=JSON.parse(JSON.stringify(t)),this.currentScreen=1,this.editCountryFormGroup.patchValue({country:t.germanName,tax_required:t.tax_required||!1,small_companies_tax_solution:t.small_companies_tax_solution||!1,tax_prefix:t.tax_prefix,tax_length:t.tax_length,states:t.states||[],searched_states:t.states||[],holidays:t.holidays||[],searched_holidays:t.holidays||[],languages:[]}),this.languagesList=(t.languages||[]).map(e=>{if(typeof e=="string")return qt.find(n=>n.name===e);if(e&&e.name)return qt.find(n=>n.name===e.name)}).filter(e=>e!==void 0),this.editCountryFormGroup.patchValue({languages:this.languagesList.map(e=>e.name)}),t.tax_required&&t.tax.length>0&&t.tax.map((e,n)=>{this.add_editTaxes(),this.editTaxes.controls[n].patchValue({_id:e._id,tax_name:e.tax_name,private_tax_required:e.private_tax_required,private_tax_name:e.private_tax_name,private_tax:e.private_tax,private_description:e.private_description,company_tax_required:e.company_tax_required,company_tax_name:e.company_tax_name,company_tax_on_wrong_length:e.company_tax_on_wrong_length,company_tax_on_correct_length:e.company_tax_on_correct_length,wrong_length_error_message:e.wrong_length_error_message,correct_length_message:e.correct_length_message,opened:!1})}),this.updateSelectedCountry={id:t._id,englishName:t.englishName,germanName:t.germanName,code:t.code,currency:""},this.updateCurrencyList=JSON.parse(JSON.stringify(t.currency)),setTimeout(()=>{this.formDirty.editCountryFormGroup=!1,this.editCountryFormGroup.valueChanges.subscribe(()=>{this.formDirty.editCountryFormGroup=!0})},1e3)):$("#click"+t._id).html()=="Schlie\xDFen"&&this.close_edit_country()}updateFilter(t){let e=t!==""?t.toLowerCase():"";if(e!=""){let n=this.countriesArray.find(o=>o.germanName.toLowerCase()==e);return n?this.updateSelectedCountry=JSON.parse(JSON.stringify(n)):this.updateSelectedCountry={id:"",englishName:"",germanName:"",code:"",currency:""},this.autoOptions.filter(o=>o.toLowerCase().includes(e))}else return this.autoOptions}setUpdatedCurrencyList(t){this.editCountryFormGroup.controls.currency.setValue(""),this.currencyList.find(o=>o.symbol===t.option.value.symbol)?this.sweetAlert.error("W\xE4hrung bereits hinzugef\xFCgt.","","OK").subscribe():(this.updateCurrencyList.push(t.option.value),document.getElementById("updatedCurrencySelect").blur())}updateCountry(){$("#loaderouterid").css("display","flex");let t=this.languagesList.map(n=>n.name),e={id:this.updateSelectedCountry.id,currency:this.updateCurrencyList,states:this.editCountryFormGroup.value.states,languages:t};console.log("check the data in update = ",e),this.userService.updateCountry(e).subscribe(n=>{this.getCountriesList(),this.userService.removeBodyClass("modal-open"),$("#loaderouterid").css("display","none"),this.sweetAlert.html("",`<label class='button-primary p-1 m-1'>${this.updateSelectedCountry.germanName}</label> Land erfolgreich aktualisiert.`,{type:"success"}).subscribe(()=>this.reloadCurrentRoute())},n=>{$("#loaderouterid").css("display","none"),this.sweetAlert.error("L\xE4nderaktualisierung fehlgeschlagen","","OK").subscribe()})}
2deleteUpdateCurrencyList(t){this.updateCurrencyList=this.updateCurrencyList.filter(e=>e.symbol!==t.symbol||e.code!==t.code)}open_modal(t){$("#"+t).appendTo("body")}close_modal(t,e){$("#"+t).appendTo("#"+e)}modal_valid(){!this.checkValidation()&&this.countryFormGroup.valid?this.sweetAlert.confirm("\xC4nderungen speichern ?","",{type:"warning",confirmText:"Ja",cancelText:"Nein"}).subscribe(t=>{t?this.addCountry():($("#closeAddCountryModal").trigger("click"),this.close_modal("addCountryModal","addCountryModal_parent"))}):($("#closeAddCountryModal").trigger("click"),this.close_modal("addCountryModal","addCountryModal_parent"))}editHoliday(t,e){let n=t=="add"?"countryFormGroup":"editCountryFormGroup",o=JSON.parse(JSON.stringify(this[n].value.holidays[e]));Object.keys(o).map(d=>{this.editHolidayFormGroup.patchValue({[d]:o[d]})}),this.editHolidayFormGroup.patchValue({index:e,action:t}),this.formSubscriptions.editHolidayFormGroup=this.editHolidayFormGroup.valueChanges.subscribe(()=>{this.formDirty.editHolidayFormGroup=!0}),$("#editHolidayModal").modal("show"),this.open_modal("editHolidayModal")}update_holiday(){let t=this.editHolidayFormGroup.value.action=="add"?"countryFormGroup":"editCountryFormGroup",e=JSON.parse(JSON.stringify(this[t].value.holidays));Object.keys(e[this.editHolidayFormGroup.value.index]).map(n=>{e[this.editHolidayFormGroup.value.index][n]=this.editHolidayFormGroup.value[n]}),this[t].patchValue({holidays:e}),this.filterHolidays(this.editHolidayFormGroup.value.action),this.userService.addBodyClass("modal-open",500)}checkEditHolidayModal(){this.editHolidayFormGroup.valid&&this.formDirty.editHolidayFormGroup?this.sweetAlert.confirm("\xC4nderungen speichern ?","",{type:"warning",confirmText:"Ja",cancelText:"Nein"}).subscribe(t=>{t?this.update_holiday():this.userService.addBodyClass("modal-open",500)}):this.userService.addBodyClass("modal-open",500)}reloadCurrentRoute(){for(this.currentScreen=0;this.editTaxes.length>0;)this.editTaxes.removeAt(0);for(;this.taxes.length>0;)this.taxes.removeAt(0);this.selectedCountry={englishName:"",germanName:"",code:"",currency:""},this.countryFormGroup.reset(),this.countryFormGroup.patchValue({tax_required:!1,small_companies_tax_solution:!1}),this.holidayFormGroup.reset(),this.editCountryFormGroup.reset(),this.currencyList=[],this.languagesList=[],this.formDirty={holidayFormGroup:!1,editHolidayFormGroup:!1,editCountryFormGroup:!1},this.openedCountry={},$("#addCountryModal").modal("hide"),this.close_modal("addCountryModal","addCountryModal_parent")}removeTax(t,e){this.sweetAlert.confirm("","Sind Sie sicher, dass Sie die Steuer "+(t.controls[e].value.tax_name?"<label class='button-primary p-1 m-1'>"+t.controls[e].value.tax_name+"</label>":"")+" l\xF6schen m\xF6chten?",{type:"warning",confirmText:"Ja, l\xF6schen",cancelText:"Abbrechen"}).subscribe(n=>{n&&t.removeAt(e)})}addNewTax(){for(;this.taxes.length>0;)this.taxes.removeAt(0);this.selectedCountry={englishName:"",germanName:"",code:"",currency:""},this.countryFormGroup.reset(),this.countryFormGroup.patchValue({tax_required:!1,small_companies_tax_solution:!1}),this.holidayFormGroup.reset(),this.currencyList=[],this.languagesList=[],this.formDirty={holidayFormGroup:!1,editHolidayFormGroup:!1,editCountryFormGroup:!1},this.openedCountry={},$("#addCountryModal").modal("show"),this.open_modal("addCountryModal")}tax_requirement_changed(t,e){let n=e=="add"?"taxes":"editTaxes";if(t.checked)this["add_"+n](),this.countryFormGroup.controls.tax_length.setValidators(_.required);else{for(;this[n].length>0;)this[n].removeAt(0);this.countryFormGroup.controls.tax_length.clearValidators()}this.countryFormGroup.controls.tax_length.updateValueAndValidity()}edit_tax_requirement_multiple(t,e,n){({private:["private_tax_required","private_tax_name","private_tax"],company:["company_tax_required","company_tax_name","company_tax_on_wrong_length","company_tax_on_correct_length"]})[e].map(d=>{t.checked?n.controls[d].setValidators(_.required):n.controls[d].clearValidators(),n.controls[d].updateValueAndValidity()})}saveState(t){let e=this.editCountryFormGroup.value.states||[];e.push(t.value),this.editCountryFormGroup.patchValue({states:e,searched_states:e}),t.value="",$("#StateModal").modal("hide"),this.close_modal("StateModal","StateModal_parent")}static{this.\u0275fac=function(e){return new(e||i)(B(en),B(ri),B(le),B(Q),B(Zt),B(Ae),B(ui),B(O))}}static{this.\u0275cmp=P({type:i,selectors:[["app-country"]],decls:176,vars:29,consts:[["fsp","ngForm"],["auto","matAutocomplete"],["currencySelect",""],["currencyType","matAutocomplete"],["editLanguageSelect",""],["editLanguageType","matAutocomplete"],["stateName",""],["updatedCurrencySelect",""],["updateCurrencyType","matAutocomplete"],["addLanguageSelect",""],["addLanguageType","matAutocomplete"],["stateauto","matAutocomplete"],["picker",""],["picker1",""],["picker2",""],["fxLayout","column",1,"app-background"],["fxFlex","","fxLayout","column"],["fxFlex",""],["fxLayout","row wrap","fxLayoutAlign","center center","fxLayoutGap","0px"],["class","table-min-height",4,"ngIf"],["id","editHolidayModal_parent"],["data-backdrop","static","data-keyboard","false","id","editHolidayModal",1,"modal","fade","p-0"],["role","document",1,"modal-dialog",2,"max-width","50%"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"close",3,"click"],["src","../assets/closeModel.svg","alt","Close",2,"width","20px","height","20px","display","block"],[1,"modal-body"],[1,"row","m-0"],[1,"col-sm-12",3,"formGroup"],[1,"field-heading-parent"],[1,"field-heading"],[1,"row","mx-0","pb-2"],[1,"col-sm-12"],[1,"mb-1","text-secondary"],["formControlName","type"],["value","0"],[1,"f-size-small"],["value","1"],["class","col-sm-12 mt-3",4,"ngIf"],[1,"col-sm-12","mt-3"],["appearance","outline",1,"w-100"],["matInput","","placeholder","Feriennamen","formControlName","name"],["formControlName","date_type"],["formControlName","duration_type"],["class","mb-1 text-secondary",4,"ngIf"],["class","col-sm-12 d-flex",4,"ngIf"],["class","col-sm-12",4,"ngIf"],["matInput","","placeholder","Ferienbeschreibung","rows","3","formControlName","description"],[1,"col-sm-12","mt-2","text-right"],[1,"btn","button-primary","botton-hover",3,"click","disabled"],["id","addCountryModal_parent"],["data-backdrop","static","data-keyboard","false","id","addCountryModal",1,"modal","fade","p-0"],["role","document",1,"modal-dialog","customModal",2,"width","1200px","max-width","95%"],["type","button","data-dismiss","modal","aria-label","Close","id","closeAddCountryModal",1,"d-none"],["type","button",1,"close","btn-close",3,"click"],[1,"w-100",3,"formGroup"],[1,"row"],[1,"col-sm-4"],[1,"p-2"],["type","text","placeholder","Land","matInput","","formControlName","country","maxlength","50",3,"matAutocomplete"],[3,"optionSelected"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["type","text","matInput","","placeholder","L\xE4nderk\xFCrzel",3,"keyup","value","disabled"],["type","text","placeholder","Landesw\xE4hrung","matInput","","formControlName","currency","id","currencySelect",3,"keyup","matAutocomplete","readonly"],[1,"col-sm-4","mt-3"],[1,"fieild-heading-text"],["type","text","placeholder","Sprache(n) w\xE4hlen","matInput","","formControlName","languageSearch","id","editLanguageSelect",3,"keyup","matAutocomplete"],[1,"col-sm-12","text-right","my-2"],[1,"btn","button-primary","botton-hover",3,"click"],["id","StateModal_parent"],["data-backdrop","static","data-keyboard","false","id","StateModal",1,"modal","fade","p-0"],["role","document",1,"modal-dialog","customModal",2,"width","100%","max-width","700px"],["type","button","data-dismiss","modal",1,"close","close-btn","p-0",3,"click"],[1,"heading-div-bg","p-2","rounded","text-secondary","d-flex","align-items-center"],["height","18","width","18","src","assets/infoIcon.svg",1,"mr-1"],[1,"pt-2","px-3","pb-1"],["matInput","","placeholder","Bundesstaates"],[1,"modal-footer"],[1,"table-min-height"],[1,"second-section","editing-something"],[1,"container-fluid"],[1,"col-sm-4","pr-1"],["type","text","name","search","placeholder","z.B. L\xE4ndername","type","text",1,"search","myInput",3,"keyup"],[1,"col-sm-3","pl-1"],["mat-button","",1,"button-primary","botton-hover",3,"click","mouseover","mouseout"],[1,"menu-image",3,"src"],[1,"ml-2"],[1,"col-sm-5"],[1,"table-count"],[1,"table-section"],[1,"customTable"],["id","cardbodyid",1,"tableInnerScroll"],["id","accordion",1,"table"],[2,"width","5%","min-width","60px"],[2,"width","15%","min-width","120px"],["data-order","asc","data-name","germanName",1,"fa","fa-sort-desc",3,"appSort"],[2,"width","20%","min-width","140px"],["data-order","asc","data-name","code",1,"fa","fa-sort-desc",3,"appSort"],[2,"width","30%","min-width","230px"],["data-order","asc","data-name","number_of_states",1,"fa","fa-sort-desc",3,"appSort"],[2,"width","20%","min-width","150px"],["data-order","asc","data-name","currency",1,"fa","fa-sort-desc",3,"appSort"],[2,"width","10%","min-width","120px"],[3,"id",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end","pagination-main","mt-3","editing-something"],["class","pagination m-0 pagerAction",4,"ngIf"],[3,"id"],[1,"customer-id"],[1,"customer-Unternehmensname"],[1,"customer-Unternehmensname","w-25"],[1,"customer-Unternehmensname","mb-2"],["data-toggle","collapse",1,"m-1","openclass","offnen-cls","btn","btn-sm","button-primary","botton-hover","click",3,"click","id"],["colspan","6",1,"text-center","text-secondary"],[1,"pagination","m-0","pagerAction"],[1,"page-item",3,"ngClass"],[1,"page-link",3,"click"],["class","page-item",3,"ngClass",4,"ngFor","ngForOf"],[1,"w-100"],[1,"mb-0","left-to-right-fading","w-50","p-1"],["role","button",1,"neoloop-font-color","links1","mb-0",3,"click"],[1,"mx-2"],[1,"neoloop-font-color"],[3,"selectedTabChange"],["label","L\xE4nderdetails"],[1,"row","mx-0","mt-2",3,"formGroup"],[1,"w-100","shadow","rounded"],[1,"heading-div-bg","f-size-small","p-1","rounded-top","py-1","d-flex","align-items-center"],["type","text","placeholder","Land","matInput","","formControlName","country","readonly","",3,"value"],[1,"col-sm-4","mb-3"],["src","assets/infoIcon.svg","height","18","width","18",1,"mr-1"],["appearance","outline",1,"w-100","mat-form-field-remove-padding-bottom"],["type","text","placeholder","Landesw\xE4hrung","matInput","","formControlName","currency","id","updatedCurrencySelect",3,"keyup","matAutocomplete","readonly"],[1,"col-sm-4","mt-3","mb-3"],["type","text","placeholder","Sprache(n) w\xE4hlen","matInput","","formControlName","languageSearch","id","addLanguageSelect",3,"keyup","matAutocomplete"],["label","Bundesl\xE4nder"],[1,"px-3","pb-2"],[1,"row","mt-3"],["type","text","name","search","placeholder","z.B. Bundesl\xE4nder","type","text",1,"search","myInput",3,"keyup.enter"],["mat-button","","data-toggle","modal","data-target","#StateModal",1,"button-primary","botton-hover",3,"click","mouseover","mouseout"],[1,"row","mx-0","mt-3"],[1,"bundesl\xE4nder-row"],["class","bundesl\xE4nder-col",4,"ngFor","ngForOf"],["label","Steuereinstellungen"],[3,"countryId"],["label","Feiertage"],["label","Unternehmenstypen"],["label","Sachkonten"],[3,"countryId","type"],["label","Abwesenheitsstatus"],["label","Zeitzone"],[3,"type","countryId","openedCountry"],["label","F\xFChrerscheinklassen "],["class","col-sm-12 text-right mt-3 border-top pt-3",4,"ngIf"],[3,"value"],[1,"w-100","small","my-1","left-to-right-fading","p-1","mt-2"],[1,"d-flex","flex-wrap","justify-content-start","align-items-center","w-100"],["class","button-primary p-1 m-1",4,"ngFor","ngForOf"],[1,"button-primary","p-1","m-1"],["aria-hidden","true",1,"fa","fa-times","ml-2",2,"cursor","pointer","font-size","15px",3,"click"],["class","button-primary mr-1 me-2 mb-1 p-1 d-flex align-items-center","style","gap: 0.5rem;",4,"ngFor","ngForOf"],[1,"button-primary","mr-1","me-2","mb-1","p-1","d-flex","align-items-center",2,"gap","0.5rem"],[1,"fa","fa-times","cursor-pointer",3,"click"],[1,"text-secondary","text-center"],[1,"bundesl\xE4nder-col"],[1,"neoloop-div-bg","p-1","rounded","h-100"],[1,"bg-white","rounded","position-relative","h-100","p-2","pr-3","d-flex","justify-content-between"],[1,"d-flex"],["src","assets/states.svg",1,"state-image"],[1,"neoloop-font-color","mb-0","f-size-small"],[1,"text-secondary","f-size-x-small","d-block","mb-0"],["src","../assets/closeModel.svg","alt","Close","role","button",1,"float-right","text-danger","position-absolute","links",2,"width","14px","height","14px","top","5px","right","5px","display","block","cursor","pointer",3,"click"],[1,"col-sm-12","text-right","mt-3","border-top","pt-3"],["type","button",1,"btn","button-primary","botton-hover",3,"click","disabled"],["type","text","placeholder","Bundesstaat","matInput","","formControlName","state",3,"keyup","matAutocomplete"],[1,"col-sm-12","d-flex"],["appearance","outline","formControlName","date",1,"bg-white","w-100"],["appearance","outline","formControlName","month",1,"bg-white","w-100"],[1,"col-sm-6"],["appearance","outline","formControlName","from_date",1,"bg-white","w-100"],["appearance","outline","formControlName","from_month",1,"bg-white","w-100"],[1,"col-sm-6","mt-2"],["appearance","outline","formControlName","to_date",1,"bg-white","w-100"],["appearance","outline","formControlName","to_month",1,"bg-white","w-100"],["matInput","","placeholder","Feiertagsdatum","formControlName","full_date",3,"matDatepicker"],["matSuffix","",3,"for"],["format","dd\\MM\\yyyy"],["matInput","","placeholder","Startdatum","formControlName","from_full_date",3,"matDatepicker"],["matInput","","placeholder","Endd
2atum","formControlName","to_full_date",3,"matDatepicker"],[1,"w-100","small","my-1"]],template:function(e,n){if(e&1){let o=E();r(0,"div",15)(1,"div",16)(2,"div",17)(3,"div",18),x(4,Xs,42,11,"div",19)(5,ll,95,29,"div",19),a()(),p(6,"div",17),a()(),r(7,"div",20)(8,"div",21)(9,"div",22)(10,"div",23)(11,"div",24)(12,"h6",25),s(13,"Feiertag bearbeiten"),a(),r(14,"button",26),u("click",function(){return n.checkEditHolidayModal()}),p(15,"img",27),a()(),r(16,"div",28)(17,"div",29)(18,"div",30)(19,"div",31)(20,"h6",32),s(21,"Bitte f\xFCge einen Feiertag hinzu:"),a(),r(22,"div",33)(23,"div",34)(24,"p",35),s(25,"Bitte geben Sie an, ob der Feiertag f\xFCr einen bestimmten Bundesstaat oder f\xFCr das gesamte Land hinzugef\xFCgt wird:"),a(),r(26,"mat-radio-group",36)(27,"mat-radio-button",37)(28,"span",38),s(29,"Gesamtes Land"),a()(),s(30,"\xA0 "),r(31,"mat-radio-button",39)(32,"span",38),s(33,"Bundesstaat"),a()()()(),x(34,ul,11,3,"div",40),r(35,"div",41)(36,"p",35),s(37,"Bitte geben Sie den Namen des Feiertags ein:"),a(),r(38,"mat-form-field",42)(39,"mat-label"),s(40,"Feriennamen"),a(),p(41,"input",43),a()(),r(42,"div",41)(43,"p",35),s(44,"Welche Art von Feiertag m\xF6chten Sie hinzuf\xFCgen?"),a(),r(45,"mat-radio-group",44)(46,"mat-radio-button",37)(47,"span",38),s(48,"Fester Datum (z.B., Neujahr, Tag der Arbeit)"),a()(),s(49,"\xA0 "),r(50,"mat-radio-button",39)(51,"span",38),s(52,"Variabler Datum (z.B., Ostern, Erntedankfest)"),a()()()(),r(53,"div",41)(54,"p",35),s(55,"Ist dieser Feiertag ein eint\xE4giges Ereignis oder eine mehrere Tage dauernde Feier?"),a(),r(56,"mat-radio-group",45)(57,"mat-radio-button",37)(58,"span",38),s(59,"Eint\xE4gig"),a()(),s(60,"\xA0 "),r(61,"mat-radio-button",39)(62,"span",38),s(63,"Mehrere Tage"),a()()()(),r(64,"div",41),x(65,gl,2,1,"p",46)(66,_l,2,1,"p",46),a(),x(67,yl,12,2,"div",47)(68,Sl,26,4,"div",48)(69,Tl,3,2,"div",47),r(70,"div",41)(71,"p",35),s(72,"Bitte geben Sie eine Beschreibung f\xFCr den Feiertag ein:"),a(),r(73,"mat-form-field",42)(74,"mat-label"),s(75,"Ferienbeschreibung"),a(),p(76,"textarea",49),a()(),r(77,"div",50)(78,"button",51),u("click",function(){return n.update_holiday()}),s(79,"\xC4nderungen speichern"),a()()()()()()()()()()(),r(80,"div",52)(81,"div",53)(82,"div",54)(83,"div",23)(84,"div",24)(85,"h4",25),s(86,"Land hinzuf\xFCgen"),a(),p(87,"button",55),r(88,"button",56),u("click",function(){return n.modal_valid()}),p(89,"img",27),a()(),r(90,"div",28)(91,"form",57,0)(93,"div",58)(94,"div",59)(95,"div",31)(96,"h6",32),s(97,"Bitte w\xE4hlen Sie ein Land aus:"),a(),r(98,"div",60)(99,"mat-form-field",42)(100,"mat-label"),s(101,"Land ausw\xE4hlen"),a(),p(102,"input",61),r(103,"mat-autocomplete",62,1),u("optionSelected",function(){return n.countryChanged()}),x(105,Ll,2,2,"mat-option",63),Vt(106,"async"),a(),x(107,Ml,2,0,"mat-error",64)(108,Il,2,0,"mat-error",64)(109,Pl,2,0,"mat-error",64),a()()()(),r(110,"div",59)(111,"div",31)(112,"h6",32),s(113,"Bitte geben Sie das L\xE4nderk\xFCrzel ein:"),a(),r(114,"div",60)(115,"mat-form-field",42)(116,"mat-label"),s(117,"L\xE4nderk\xFCrzel"),a(),r(118,"input",65),u("keyup",function(g){return n.selectedCountry.code=g.target.value}),a()()()()(),r(119,"div",59)(120,"div",31)(121,"h6",32),s(122),a(),r(123,"div",60)(124,"mat-form-field",42)(125,"mat-label"),s(126,"Landesw\xE4hrung"),a(),r(127,"input",66,2),u("keyup",function(g){return n.filterCurrency(g)}),a(),r(129,"mat-autocomplete",62,3),u("optionSelected",function(g){return n.setCurrencyList(g)}),x(131,Al,2,3,"mat-option",63),a()(),x(132,Dl,5,1,"ng-container",64),a()()(),r(133,"div",67)(134,"div",31)(135,"h6",32)(136,"span",68),s(137," Bitte w\xE4hlen Sie eine oder mehrere Sprachen aus: "),a()(),r(138,"div",60)(139,"mat-form-field",42)(140,"mat-label"),s(141,"Sprachen ausw\xE4hlen"),a(),r(142,"input",69,4),u("keyup",function(g){return n.filterLanguages(g)}),a(),r(144,"mat-autocomplete",62,5),u("optionSelected",function(g){return n.setLanguagesList(g,!0)}),x(146,kl,2,3,"mat-option",63),a()(),x(147,Nl,5,1,"ng-container",64),a()()(),r(148,"div",70)(149,"button",71),u("click",function(){return n.onSaveChangesClick()}),s(150,"Hinzuf\xFCgen"),a()()()()()()()()(),r(151,"div",72)(152,"div",73)(153,"div",74)(154,"div",23)(155,"div",24)(156,"h4",25),s(157,"Bundesl\xE4nder hinzuf\xFCgen"),a(),r(158,"button",75),u("click",function(){return n.close_modal("StateModal","StateModal_parent")}),p(159,"img",27),a()(),r(160,"div",28)(161,"div",58)(162,"div",34)(163,"div",31)(164,"h6",76),p(165,"img",77),s(166," Bitte geben Sie den Namen des Bundesstaates ein: "),a(),r(167,"div",78)(168,"mat-form-field",42)(169,"mat-label"),s(170,"Bundesstaates"),a(),p(171,"input",79,6),a()()()()()(),r(173,"div",80)(174,"button",51),u("click",function(){h(o);let g=M(172);return f(n.saveState(g))}),s(175,"Hinzuf\xFCgen"),a()()()()()()}if(e&2){let o,d,g,v=M(104),T=M(130),W=M(145),G=M(172);l(4),c("ngIf",n.currentScreen==0),l(),c("ngIf",n.currentScreen==1),l(13),c("formGroup",n.editHolidayFormGroup),l(16),c("ngIf",n.editHolidayFormGroup.value.type=="1"),l(31),c("ngIf",n.editHolidayFormGroup.value.date_type=="1"),l(),c("ngIf",n.editHolidayFormGroup.value.date_type=="0"),l(),c("ngIf",n.editHolidayFormGroup.value.date_type=="0"&&n.editHolidayFormGroup.value.duration_type=="0"),l(),c("ngIf",n.editHolidayFormGroup.value.date_type=="0"&&n.editHolidayFormGroup.value.duration_type=="1"),l(),c("ngIf",n.editHolidayFormGroup.value.date_type=="1"),l(9),c("disabled",!n.editHolidayFormGroup.valid||!n.formDirty.editHolidayFormGroup),l(13),c("formGroup",n.countryFormGroup),l(11),c("matAutocomplete",v),l(3),c("ngForOf",ei(106,27,n.filteredOptions)),l(2),c("ngIf",(o=n.countryFormGroup.get("country"))==null?null:o.hasError("required")),l(),c("ngIf",(d=n.countryFormGroup.get("country"))==null?null:d.hasError("minlength")),l(),c("ngIf",(g=n.countryFormGroup.get("country"))==null?null:g.hasError("maxlength")),l(9),c("value",n.selectedCountry.code)("disabled",n.selectedCountry.code!=""),l(4),L("Bitte w\xE4hlen Sie die Landesw\xE4hrung ",n.countryFormGroup.value.country?"f\xFCr "+n.countryFormGroup.value.country:""," aus:"),l(5),c("matAutocomplete",T)("readonly",n.selectedCountry.germanName===""),l(4),c("ngForOf",n.filteredCurrencyList),l(),c("ngIf",n.currencyList.length>0),l(10),c("matAutocomplete",W),l(4),c("ngForOf",n.filteredLanguages),l(),c("ngIf",n.languagesList.length>0),l(27),c("disabled",!G.value)}},dependencies:[Se,Re,Qe,Ve,N,Pe,R,V,U,qe,K,H,di,ci,on,mi,cn,pi,D,Fe,De,Ie,Y,j,_e,ce,J,Oe,de,We,Xe,It,Pt,tn,nn,an,At,Nn,ti],styles:[".tagsclass[_ngcontent-%COMP%]{border-radius:30px;border:1px solid;width:auto;display:inline-block;padding:0 24px;
2cursor:pointer;color:#fff;background:#169298}.modal-dialog[_ngcontent-%COMP%]{min-height:calc(100vh - 60px);display:flex;flex-direction:column;justify-content:center}@media(max-width:768px){.modal-dialog[_ngcontent-%COMP%]{min-height:calc(100vh - 20px)}}.state-image[_ngcontent-%COMP%]{height:25px}.menu-image[_ngcontent-%COMP%]{height:32px}.bundesl\\e4nder-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px}"]})}};export{Ni as CountryComponent};

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.