import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Component, ElementRef, Inject, ViewChild } from '@angular/core';
import { Validators } from '@angular/forms';
import { catchError, debounceTime, distinctUntilChanged, finalize } from 'rxjs/operators';
import * as _ from 'lodash';
import { forkJoin, of } from 'rxjs';
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/dialog";
import * as i2 from "@angular/forms";
import * as i3 from "../../modules/shared/services/shared.service";
import * as i4 from "@angular/material/snack-bar";
import * as i5 from "@angular/common";
import * as i6 from "@angular/material/legacy-card";
import * as i7 from "@angular/material/legacy-form-field";
import * as i8 from "@angular/material/icon";
import * as i9 from "@angular/material/legacy-select";
import * as i10 from "@angular/material/legacy-core";
import * as i11 from "@angular/material/progress-spinner";
export class AddDesignationComponent {
    constructor(dialogRef, data, fb, cdRef, sharedService, snackBar) {
        this.dialogRef = dialogRef;
        this.data = data;
        this.fb = fb;
        this.cdRef = cdRef;
        this.sharedService = sharedService;
        this.snackBar = snackBar;
        this.maxFileSizeMB = 25;
        this.allowedTypes = [
            'application/pdf',
            'application/msword',
            'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
            'application/vnd.ms-excel',
            'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
            'text/plain'
        ];
        this.uploadError = null;
        this.uploadedFile = null;
        this.loading = false;
        this.desigantionFilterEnable = false;
        this.isLoadingMoreDesignations = false;
        this.designationOffset = 0;
        this.odcsDesignationCount = 0;
        this.defaultSearchDesignationCount = 0;
        this.designationListLoadCount = 50;
        this.designationDefaultLoadCount = 50;
        this.noMoreLegacyDesignations = false;
        this.designationSearchText = '';
        this.designationInitInProgress = false;
        this.scrollListenerAttached = false;
        this.masterData = {};
        this.searchDesignationLoadCount = 50;
        this.matchedDesignationIds = [];
        this.masterData = {
            designationBackup: [],
            designationFiltered: [], // filtered search results
        };
    }
    ngOnInit() {
        console.log('this.matched_role_mappings', this.data?.matched_role_mappings);
        this.matchedDesignationIds = this.data?.matched_role_mappings?.map((item) => item?.igot_designation_id) || [];
        this.initializeForm();
        const searchControl = this.designationForm.get('searchDesignation');
        if (searchControl) {
            searchControl.valueChanges
                .pipe(debounceTime(300), distinctUntilChanged())
                .subscribe((res) => {
                const txt = res?.toString()?.trim() ?? '';
                this.designationSearchText = txt;
                // RESET SEARCH PAGINATION
                this.searchDesignationLoadCount = 50;
                if (txt?.length) {
                    this.desigantionFilterEnable = true;
                    // API SEARCH ONLY
                    this.getDesignation(txt, 0);
                }
                else {
                    this.desigantionFilterEnable = false;
                    this.masterData.designation =
                        (this.masterData.designationBackup || []).slice(0, this.designationDefaultLoadCount);
                    this.designationListLoadCount =
                        this.designationDefaultLoadCount;
                    this.designationOffset = 0;
                    this.checkCurrentDesignationPresent();
                }
            });
        }
        if (!this.masterData.designationBackup ||
            this.masterData.designationBackup.length === 0) {
            this.getDesignationSafe();
        }
    }
    getDesignationSafe() {
        if (this.designationInitInProgress || this.isLoadingMoreDesignations) {
            return;
        }
        this.designationInitInProgress = true;
        this.getDesignation();
    }
    initializeForm() {
        this.designationForm = this.fb.group({
            designation_name: [[], Validators.required],
            instruction: ['', Validators.required],
            uploadDoc: [null, []],
            searchDesignation: [''],
        });
        this.designationForm.get('designation_name')?.valueChanges
            .subscribe(() => {
            this.checkCurrentDesignationPresent();
        });
    }
    onFileChange(event) {
        const file = event.target.files[0];
        if (!file) {
            return;
        }
        // Validate file size
        const maxBytes = this.maxFileSizeMB * 1024 * 1024;
        if (file.size > maxBytes) {
            this.uploadError = `File exceeds maximum size of ${this.maxFileSizeMB}MB`;
            this.designationForm.get('uploadDoc')?.setErrors({ maxSize: true });
            return;
        }
        // Validate file type
        if (!this.allowedTypes.includes(file.type)) {
            this.uploadError = `Invalid file type. Allowed: PDF, Word, Excel, TXT`;
            this.designationForm.get('uploadDoc')?.setErrors({ fileType: true });
            return;
        }
        this.uploadedFile = file;
        this.uploadError = null;
        this.designationForm.patchValue({ uploadDoc: file });
        this.designationForm.get('uploadDoc')?.updateValueAndValidity();
    }
    cancelForm() {
        this.dialogRef.close();
    }
    // saveDesignation() {
    //   this.loading = true
    //   const formData = new FormData();
    //   formData.append('designationName', this.designationForm.get('designationName')?.value);
    //   formData.append('roleDetails', this.designationForm.get('roleDetails')?.value);
    //   if (this.uploadedFile) {
    //     formData.append('uploadDoc', this.uploadedFile);
    //   }
    //   this.cbpPlanFinalObj = this.sharedService.getCBPPlanLocalStorage()
    //   console.log('this.designationForm', this.designationForm)
    //   let req: any = {
    //     "state_center_id": this.sharedService.cbpPlanFinalObj.ministry.identifier,
    //     "state_center_name": this.sharedService.cbpPlanFinalObj.ministry.orgName,
    //     // "department_id": "",
    //     "designation_name": this.designationForm.value.designation_name,
    //     "instruction": this.designationForm.value.instruction,
    //   }
    //   if (this.sharedService.cbpPlanFinalObj?.ministry?.sbOrgType === 'state' && this.sharedService.cbpPlanFinalObj.department_name) {
    //     req['department_id'] = this.sharedService.cbpPlanFinalObj.departments
    //     req['department_name'] = this.sharedService.cbpPlanFinalObj.department_name
    //   }
    //   if (this.sharedService.cbpPlanFinalObj?.ministry?.sbOrgType === 'ministry' && this.sharedService.cbpPlanFinalObj.department_name) {
    //     req['department_id'] = this.sharedService.cbpPlanFinalObj.departments
    //     req['department_name'] = this.sharedService.cbpPlanFinalObj.department_name
    //   }
    //   console.log('req', req)
    //   this.sharedService.addDesignation(req).subscribe({
    //     next: (_res) => {
    //       this.loading = false
    //       this.snackBar.open('Designation Added Successfully', 'X', {
    //         duration: 3000,
    //         panelClass: ['snackbar-success']
    //       });
    //       this.dialogRef.close('saved')
    //     },
    //     error: (error) => {
    //       this.loading = false
    //       this.snackBar.open('Failed to add designation. Please try again.', 'X', {
    //         duration: 5000,
    //         panelClass: ['snackbar-error']
    //       });
    //       console.error('Error adding designation:', error);
    //     }
    //   })
    // }
    saveDesignation() {
        const selectedDesignations = this.designationForm.get('designation_name')?.value || [];
        if (!selectedDesignations.length) {
            this.snackBar.open('Please select at least one designation', 'X', { duration: 3000 });
            return;
        }
        this.loading = true;
        const baseObj = {
            state_center_id: this.sharedService.cbpPlanFinalObj.ministry.identifier,
            state_center_name: this.sharedService.cbpPlanFinalObj.ministry.orgName,
            instruction: this.designationForm.value.instruction,
        };
        if (this.sharedService.cbpPlanFinalObj?.ministry?.sbOrgType === 'state' && this.sharedService.cbpPlanFinalObj.department_name) {
            baseObj['department_id'] = this.sharedService.cbpPlanFinalObj.departments;
            baseObj['department_name'] = this.sharedService.cbpPlanFinalObj.department_name;
        }
        if (this.sharedService.cbpPlanFinalObj?.ministry?.sbOrgType === 'ministry' && this.sharedService.cbpPlanFinalObj.department_name) {
            baseObj['department_id'] = this.sharedService.cbpPlanFinalObj.departments;
            baseObj['department_name'] = this.sharedService.cbpPlanFinalObj.department_name;
        }
        // Create an array of observables, one per designation
        const apiCalls = selectedDesignations.map(designationName => {
            const req = {
                ...baseObj,
                designation_name: designationName,
            };
            return this.sharedService.addDesignation(req).pipe(catchError(error => {
                console.error(`Failed to add designation: ${designationName}`, error);
                // Return observable that emits an error object but does not break forkJoin
                return of({ error: true, designation: designationName });
            }));
        });
        // Wait for all API calls to complete
        forkJoin(apiCalls).subscribe(results => {
            this.loading = false;
            // Check if any call failed
            const failed = results.filter(res => res?.error);
            if (failed.length > 0) {
                const failedNames = failed.map(f => f.designation).join(', ');
                this.snackBar.open(`Failed to add designations: ${failedNames}`, 'X', {
                    duration: 5000,
                    panelClass: ['snackbar-error']
                });
            }
            else {
                this.snackBar.open('All designations added successfully', 'X', {
                    duration: 3000,
                    panelClass: ['snackbar-success']
                });
                this.dialogRef.close('saved');
            }
        });
    }
    closeDialog() {
        this.dialogRef.close();
    }
    getDesignation(searchText, offset) {
        // clear any previous debug hooks
        if (!searchText || searchText?.length === 0) {
            // noop
        }
        const reqOffset = (typeof offset === 'number') ? offset : this.designationOffset;
        let reqLimit = this.designationDefaultLoadCount;
        const pageIndex = reqLimit > 0 ? Math.floor(reqOffset / reqLimit) : 0;
        // if we're requesting from first page, clear the no-more-data guard
        if (pageIndex === 0) {
            this.noMoreLegacyDesignations = false;
            reqLimit = 50;
        }
        const requestBody = {
            filterCriteriaMap: {
                status: 'Active'
            },
            requestedFields: [],
            pageNumber: pageIndex,
            pageSize: reqLimit,
        };
        if (searchText?.length) {
            requestBody['searchString'] = searchText;
            // when searching, start from first page
            requestBody.pageNumber = 0;
            // allow larger page for search if needed
            requestBody.pageSize = pageIndex === 0 ? 50 : this.designationListLoadCount;
            // reset guard when performing a fresh search
            this.noMoreLegacyDesignations = false;
        }
        // indicate loading state so scroll handlers don't trigger parallel calls
        this.isLoadingMoreDesignations = true;
        this.sharedService.searchPublicDesignation(requestBody).pipe(finalize(() => {
            this.isLoadingMoreDesignations = false;
            this.designationInitInProgress = false;
        }))
            .subscribe({
            next: (res) => {
                const content = _.get(res, 'result.result.data', []);
                const matchedIds = new Set(this.matchedDesignationIds);
                const mapped = content
                    .filter((item) => !matchedIds.has(item?.id))
                    .map((item) => ({
                    id: item?.id,
                    name: item?.designation || '',
                    status: item?.status || 'Active',
                }));
                const total = _.get(res, 'result.result.totalcount', _.get(res, 'result.result.data.totalCount', _.get(res, 'result.result.totalCount', 0)));
                this.defaultSearchDesignationCount = total;
                // =========================
                // SEARCH MODE
                // =========================
                if (searchText?.length) {
                    this.masterData.designationFiltered = mapped;
                    this.masterData.designation =
                        this.masterData.designationFiltered.slice(0, this.searchDesignationLoadCount);
                    this.checkCurrentDesignationPresent();
                    return;
                }
                // =========================
                // NORMAL MODE
                // =========================
                if (!this.masterData['designationBackup'] || reqOffset === 0) {
                    this.masterData['designationBackup'] = mapped;
                }
                else {
                    const combined = (this.masterData['designationBackup'] || []).concat(mapped);
                    this.masterData['designationBackup'] = _.uniqBy(combined, (it) => (it?.name || '').toLowerCase());
                }
                this.masterData.designation =
                    (this.masterData.designationBackup || []).slice(0, this.designationListLoadCount);
                // selected value preserve
                const designationControl = this.designationForm.get('designation_name');
                if (designationControl) {
                    const currentValues = designationControl.value || [];
                    const validValues = currentValues.filter((value) => this.masterData.designationBackup.some((item) => item?.name === value));
                    if (validValues.length !== currentValues.length) {
                        designationControl.setValue(validValues);
                    }
                }
                // no more data
                if (!mapped || mapped.length === 0) {
                    this.noMoreLegacyDesignations = true;
                }
                if (this.defaultSearchDesignationCount &&
                    (this.masterData['designationBackup'] || []).length >=
                        this.defaultSearchDesignationCount) {
                    this.noMoreLegacyDesignations = true;
                }
                this.checkCurrentDesignationPresent();
            },
            error: () => {
                // Stop further automatic calls on repeated errors to avoid tight loops
                // loading flag cleared in finalize()
                this.noMoreLegacyDesignations = true;
                // this.matSnackBar.open('Unable to fetch designation details, please try again later!')
            }
        });
    }
    // FIX 2: Also inject selected items into designationBackup
    checkCurrentDesignationPresent() {
        const selectedDesignations = this.designationForm.get('designation_name')?.value || [];
        if (!this.masterData?.designation) {
            return;
        }
        // Create selected entries
        const selectedItems = selectedDesignations.map((name) => ({
            name,
            status: 'Active'
        }));
        // Remove selected items from current lists
        const remainingVisible = (this.masterData.designation || []).filter((item) => !selectedDesignations.some(selected => selected.toLowerCase() === item?.name?.toLowerCase()));
        const remainingBackup = (this.masterData.designationBackup || []).filter((item) => !selectedDesignations.some(selected => selected.toLowerCase() === item?.name?.toLowerCase()));
        // Put selected items on top
        this.masterData.designation = _.uniqBy([...selectedItems, ...remainingVisible], (item) => item?.name?.toLowerCase());
        this.masterData.designationBackup = _.uniqBy([...selectedItems, ...remainingBackup], (item) => item?.name?.toLowerCase());
    }
    onDesignationDropdownClosed() {
        // Keep the designation value but clear the search input
        const currentDesignation = this.designationForm.get('designation_name').value;
        setTimeout(() => {
            if (this.designationForm.get('searchDesignation')) {
                this.designationForm.get('searchDesignation').setValue('');
            }
            // Ensure the designation value remains selected
            if (currentDesignation) {
                const designationControl = this.designationForm.get('designation_name');
                if (designationControl) {
                    designationControl.setValue(currentDesignation);
                }
            }
        }, 100);
    }
    // designationSearch(evt: any) {
    //   const searchText = evt?.target?.value
    //   const txt = (searchText || '').toString().trim()
    //   if (this.isLoadingMoreDesignations) return
    //   this.designationSearchText = txt
    //   if (txt?.length) {
    //     this.desigantionFilterEnable = true
    //     this.isLoadingMoreDesignations = true
    //     this.getDesignation(txt, 0)
    //   } else if (this.masterData && this.masterData?.designationBackup) {
    //     this.masterData.designation = this.masterData?.designationBackup.slice(0, this.designationDefaultLoadCount)
    //     this.desigantionFilterEnable = false
    //     this.checkCurrentDesignationPresent()
    //   }
    // }
    setupScrollListener(opened) {
        if (!opened) {
            this.scrollListenerAttached = false;
            return;
        }
        if (this.scrollListenerAttached)
            return;
        this.scrollListenerAttached = true;
        this.desigantionFilterEnable = false;
        // ✅ Only reset pagination if we have no data yet
        if (!this.masterData.designationBackup?.length) {
            this.designationListLoadCount = this.designationDefaultLoadCount;
            this.designationOffset = 0;
            this.getDesignation(undefined, 0);
        }
        else {
            // ✅ Restore from backup without resetting offset
            this.masterData.designation = this.masterData.designationBackup.slice(0, this.designationListLoadCount);
            this.checkCurrentDesignationPresent();
        }
        // focus search input
        setTimeout(() => {
            const searchInput = document.querySelector('.search-input');
            if (searchInput) {
                searchInput.focus();
            }
        }, 200);
        // attach scroll
        setTimeout(() => {
            const panel = document.querySelector('.mat-select-panel.search-panel');
            if (!panel) {
                return;
            }
            // REMOVE OLD LISTENER
            panel.removeEventListener('scroll', this.onDesignationSelectScroll);
            panel.addEventListener('scroll', this.onDesignationSelectScroll.bind(this), { passive: true });
        }, 300);
    }
    onDesignationSelectScroll(event) {
        const element = event?.target;
        const reachedBottom = element.scrollTop + element.clientHeight >=
            element.scrollHeight - 5;
        if (!reachedBottom || this.isLoadingMoreDesignations) {
            return;
        }
        // =========================
        // SEARCH MODE
        // =========================
        if (this.desigantionFilterEnable) {
            this.isLoadingMoreDesignations = true;
            this.searchDesignationLoadCount += 50;
            setTimeout(() => {
                this.masterData.designation =
                    this.masterData.designationFiltered.slice(0, this.searchDesignationLoadCount);
                this.checkCurrentDesignationPresent();
                this.isLoadingMoreDesignations = false;
            }, 300);
            return;
        }
        // =========================
        // NORMAL MODE
        // =========================
        // local pagination
        if (this.masterData?.designationBackup?.length >
            this.masterData?.designation?.length) {
            this.isLoadingMoreDesignations = true;
            this.designationListLoadCount +=
                this.designationDefaultLoadCount;
            setTimeout(() => {
                this.masterData.designation =
                    this.masterData.designationBackup.slice(0, this.designationListLoadCount);
                this.checkCurrentDesignationPresent();
                this.isLoadingMoreDesignations = false;
            }, 300);
            return;
        }
        // server pagination
        const loadedLegacy = (this.masterData?.designationBackup || []).length;
        if (!this.noMoreLegacyDesignations &&
            this.defaultSearchDesignationCount &&
            loadedLegacy < this.defaultSearchDesignationCount) {
            this.isLoadingMoreDesignations = true;
            this.designationOffset =
                (this.designationOffset || 0) +
                    this.designationDefaultLoadCount;
            this.designationListLoadCount +=
                this.designationDefaultLoadCount;
            this.getDesignation(undefined, this.designationOffset);
        }
    }
    get searchDesignationControl() {
        return this.designationForm.get('searchDesignation');
    }
    clearDesignationSearch(event) {
        this.searchDesignationLoadCount = 50;
        event.stopPropagation();
        this.searchDesignationControl.setValue('');
        this.desigantionFilterEnable = false;
        this.masterData.designation =
            (this.masterData.designationBackup || []).slice(0, this.designationDefaultLoadCount);
        this.designationListLoadCount = this.designationDefaultLoadCount;
        this.designationOffset = 0;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AddDesignationComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i2.FormBuilder }, { token: i0.ChangeDetectorRef }, { token: i3.SharedService }, { token: i4.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AddDesignationComponent, selector: "app-add-designation", viewQueries: [{ propertyName: "designationRef", first: true, predicate: ["designation"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"view-cbp-plan\">\n    <div class=\"popup-container\">\n        <div class=\"popup-header\">\n            <div>\n                <div class=\"heading\">Add New Designation</div>\n            </div>\n            <div class=\"cursor-pointer\" (click)=\"closeDialog()\">\n                <mat-icon>close</mat-icon>\n            </div>\n        </div>\n    </div>\n    <div class=\"section-container\" [formGroup]=\"designationForm\">\n        <mat-card class=\"mt-1\">\n            <div class=\"mt-2 section\">\n                <div class=\"sub-heading\">\n                    <p>Designation Name</p>\n                </div>\n                <div class=\"section-header mt-4\">\n                    <!-- <input type=\"text\" formControlName=\"designation_name\" placeholder=\"Enter Designation\" [value]=\"\"\n                        style=\"border-radius: 25px; border: 1px solid #ccc; padding: 8px 12px; width: 100%;font-size: 14px;font-family: 'Lato';\"> -->\n                    <mat-form-field appearance=\"outline\" class=\"margin-top-s w-full required-select\">\n                        <mat-select multiple #position formControlName=\"designation_name\"\n                            placeholder=\"Select designation\" (closed)=\"onDesignationDropdownClosed()\"\n                            panelClass=\"search-panel\" (openedChange)=\"setupScrollListener($event)\"\n                            >\n\n                            <!-- Sticky search input container -->\n                            <div class=\"sticky-search-container\" (click)=\"$event.stopPropagation()\">\n                                <div class=\"search-input-wrapper\">\n                                    <input type=\"text\" placeholder=\"Search designation\" style=\"width:100%\"\n                                        formControlName=\"searchDesignation\" class=\"search-input\"\n                                        (keydown)=\"$event.stopPropagation()\"\n                                        (keydown.enter)=\"$event.preventDefault(); $event.stopPropagation()\"\n                                         autocomplete=\"off\">\n                                         <!-- (keyup)=\"designationSearch($event)\" -->\n                                    <div *ngIf=\"searchDesignationControl?.value\" type=\"button\" class=\"clear-icon\"\n                                        (click)=\"clearDesignationSearch($event)\">\n                                        <mat-icon>close</mat-icon>\n                                </div>\n                                </div>\n                            </div>\n                            <!-- Options list -->\n                            <mat-option [value]=\"designation?.name\" *ngFor=\"let designation of masterData?.designation\">\n                                {{designation?.name}}\n                            </mat-option>\n                            <!-- Loading indicator -->\n                            <div *ngIf=\"isLoadingMoreDesignations\" class=\"loading-indicator\">\n                                Load More...\n                            </div>\n                            <!-- No results message -->\n                            <mat-option *ngIf=\"(masterData?.designation)?.length === 0\" disabled class=\"no-data-option\">\n\n                                Designation Not Found.\n\n                            </mat-option>\n                        </mat-select>\n                        <!-- <mat-error class=\"text-xs\"\n                            *ngIf=\"designationForm?.get('designation_name')?.touched && designationForm?.get('designation_name')?.invalid\">\n                            Please select at least one designation.\n                        </mat-error> -->\n                    </mat-form-field>\n                </div>\n            </div>\n\n            <div class=\"mt-2 section\">\n                <div class=\"sub-heading\">\n                    <p>Role & responsibilities /Additional details</p>\n                </div>\n                <div class=\"mt-4 additional-details\">\n                    <textarea class=\"custom-textarea\" formControlName=\"instruction\" rows=\"5\"\n                        placeholder=\"Add Instructions\" [value]=\"\"></textarea>\n                </div>\n            </div>\n            <!-- <div class=\"mt-2 section\">\n                <div class=\"sub-heading\">\n                    <p>Upload Document (PDF/Word/Excel/TXT)</p>\n                </div>\n                <div class=\"file-upload-wrapper\">\n                    <label for=\"uploadDoc\" class=\"file-upload-label\">\n                        <span class=\"file-upload-icon\">\uD83D\uDCCE</span>\n                        <span>{{ uploadedFile?.name || 'Choose a file (PDF, Word, Excel, TXT)' }}</span>\n                    </label>\n\n                    <small class=\"file-upload-hint\">Max file size: 25MB</small>\n\n                    <input id=\"uploadDoc\" type=\"file\" (change)=\"onFileChange($event)\"\n                        accept=\".pdf,.doc,.docx,.xls,.xlsx,.txt\" class=\"file-upload-input\" />\n\n                    <div *ngIf=\"uploadError\" class=\"error\">{{ uploadError }}</div>\n                </div>\n            </div> -->\n\n        </mat-card>\n    </div>\n    <div class=\"popup-footer\">\n        <div>\n            <input class=\"btn-active\" type=\"button\" value=\"Cancel\" (click)=\"cancelForm()\" />\n        </div>\n        <div>\n            <input [disabled]=\"designationForm?.invalid\"\n                [ngClass]=\"designationForm?.invalid ? 'btn-disable':'btn-active'\" type=\"button\" value=\"Generate CBP\"\n                (click)=\"saveDesignation()\" />\n        </div>\n    </div>\n</div>\n<div class=\"overlay-loader\" *ngIf=\"loading\">\n    <mat-spinner diameter=\"50\"></mat-spinner>\n</div>", styles: [".container{margin:10px auto}.sub-heading p{color:#000;font-family:Montserrat;font-size:16px;font-style:normal;font-weight:600;line-height:normal}.radio-label{color:#000;font-family:Lato;font-size:16px;font-style:normal;font-weight:400;line-height:normal}.radio-btn-group{display:flex;width:32px;height:32px;padding:2px;gap:10px}.label{color:var(--Body-Text-Body-Color, #212529);font-family:Lato;font-size:14px;font-style:normal;font-weight:700;line-height:150%}:host ::ng-deep mat-form-field{background-color:#fff!important;border-radius:25px!important;padding-left:12px;padding-right:12px;height:42px;width:100%}:host ::ng-deep mat-select{border-radius:25px!important;background-color:#fff!important}:host ::ng-deep .mat-select-panel{background-color:#fff!important}:host ::ng-deep .mat-select-panel .mat-option{border-radius:0!important}:host ::ng-deep mat-form-field .mat-form-field-underline{display:none!important}:host ::ng-deep mat-select .mat-select-placeholder{color:#0006;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal}:host ::ng-deep mat-select .mat-select-value-text{color:#000;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal;line-height:normal!important;padding-top:0!important;padding-bottom:0!important}:host ::ng-deep mat-select .mat-select-value{display:flex!important;align-items:center!important;height:100%!important}.additional-details textarea{display:flex;padding:16px 16px 0;flex-direction:column;align-items:flex-start;gap:10px;flex:1 0 0;align-self:stretch;width:100%;color:#000;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal;resize:none}.section-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.btn-disable{border-radius:var(--Radius-Full-Round, 9999999px);opacity:.4;background:var(--Primary-KB-Primary-Light, #1B4CA1);color:var(--white-kb-white-100, #FFF);text-align:center;font-family:Lato;font-size:14px;font-style:normal;font-weight:700;line-height:normal;display:flex;height:32px;padding:0 16px;justify-content:center;align-items:center;gap:8px;border:none}.btn-group{display:flex;flex-direction:row;justify-content:space-between}.pl-2{padding-left:5px}.search-filter-section{display:flex;flex-direction:row;justify-content:space-between}.search .rsearch{position:relative}.search .search-icon{position:absolute;top:10px;font-size:20px;left:10px}.search .sinput{border-radius:4px;border:1px solid #d5d0d0;padding:15px 36px;font:400 14px Lato}.select-map-route-container{display:flex;flex-direction:row}.selected-mapping-route p{color:#1b4ca1;font-family:Lato;font-size:20px;font-style:normal;font-weight:400;line-height:normal;text-decoration-line:underline;text-decoration-style:solid;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;text-decoration-thickness:auto;text-underline-offset:auto;text-underline-position:from-font}.edit-plan{display:flex;padding:4px;justify-content:center;align-items:center;gap:8px;border-radius:4px;background:#1b4ca129;color:#1b4ca1;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal;margin-left:10px}.search-container{display:flex;flex-direction:row}.course-container{display:flex;width:100%;padding:16px;flex-direction:column;align-items:flex-start;gap:24px;grid-row:2/span 1;grid-column:1/span 1;border-radius:12px;border:1px solid var(--borders-black-border-16-black, rgba(0, 0, 0, .16));background:#fff}.course-header{display:flex;flex-direction:row;justify-content:space-between;width:100%}.course-pill{display:flex;height:24px;padding:8px;align-items:center;gap:4px;border-radius:16px;border:1px solid var(--borders-border-fill-focussed-4-light-100, #EF951E);background:#fefaf4}.ai-recommened-pill{display:flex;padding:4px 8px;align-items:center;gap:8px;border-radius:var(--Radius-4, 4px);border:1px solid #1B4CA1;background:#1b4ca129}.igot-platform-pill{display:flex;padding:4px 8px;align-items:center;gap:8px;border-radius:var(--Radius-4, 4px);border:1px solid #EF951E;background:#ef951e29}.course-title{color:var(--Primary-KB-Primary-Light, #1B4CA1);font-family:Montserrat;font-size:20px;font-style:normal;font-weight:600;line-height:30px}.course-desc{color:#0009;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal}.relevancy,.competencies-matched{color:var(--accessbility-shades-with-opacity-kb-greys-black-60, rgba(0, 0, 0, .6));font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal;align-items:center}.percentage{color:#1d8923;font-family:Lato;font-size:14px;font-style:normal;font-weight:800;line-height:normal}.relevancy-container,.competencies-matched-container{display:flex;flex-direction:row;align-items:center}.dash{padding:0 5px}:host ::ng-deep .mat-radio-checked .mat-radio-inner-circle{background:#1b4ca1!important}.course-list-container{display:flex;flex-wrap:wrap;gap:16px}.course-list-item{flex:0 0 48%;box-sizing:border-box;border:1px solid #ccc;padding:16px;background-color:#fff;border-radius:8px}.checked-course-container{display:flex}.ml-2{margin-left:8px}:host ::ng-deep .mat-checkbox-checked .mat-checkbox-background{background:#1b4ca1!important}.ai-recommened-pill-text,.igot-platform-pill-text{color:#1b4ca1;font-family:Lato;font-size:12px;font-style:normal;font-weight:700;line-height:normal}.course-pill-text{color:var(--accessbility-shades-without-opacity-kb-greys-black-87, #212121);text-align:center;font-family:Poppins;font-size:12px;font-style:normal;font-weight:400;line-height:normal}.ai-loader-icon img,.igot-platform-icon img{width:15.714px;height:15.714px;flex-shrink:0}.competency-container{display:flex;justify-content:space-between;flex-direction:row}.outside-layer-total{display:flex;padding:4px 12px;justify-content:center;align-items:center;gap:16px;border-radius:12px;border-left:2px solid #1B4CA1;border-right:2px solid #1B4CA1;background:#edf1f8;margin:0 10px}.outside-layer-functional{display:flex;padding:4px 12px;justify-content:center;align-items:center;gap:16px;border-radius:12px;border-left:2px solid #E24577;border-right:2px solid #E24577;background:#f8d2de;margin:0 10px}.outside-layer-domain{display:flex;padding:4px 12px;justify-content:center;align-items:center;gap:16px;border-radius:12px;border-left:2px solid #7B47A4;border-right:2px solid #7B47A4;background:#dfd3e9;margin:0 10px}.outside-layer-behavioral{display:flex;padding:4px 12px;justify-content:center;align-items:center;gap:16px;border-radius:12px;border-left:2px solid #F8B861;border-right:2px solid #F8B861;background:#fde8cc;margin:0 10px}.inside-layer{color:#1b4ca1;font-family:Lato;font-size:12px;font-style:normal;font-weight:400;line-height:normal}.count{color:#1b4ca1;font-family:Montserrat;font-size:16px;font-style:normal;font-weight:600;line-height:normal}.suggest-courses-header{display:flex;flex-direction:row;justify-content:space-between}.suggest-course-control{display:flex;flex-direction:row}.course-card-container{width:172px;border-radius:3.307px;border:.827px solid var(--borders-border-8-black, rgba(0, 0, 0, .08));background-color:#fff}.highlight-ai{font-family:Montserrat;font-size:24px;font-style:normal;font-weight:600;line-height:normal;background:linear-gradient(90deg,#3b27ff,#2de3d6);background-clip:text;-webkit-background-clip:text;color:transparent;-webkit-text-fill-color:transparent;display:inline-block}.ai-loader-icon-medium img{width:40px;height:40px;flex-shrink:0}.heading{color:#000;font-family:Montserrat;font-size:20px;font-style:normal;font-weight:600;line-height:normal;margin:10px 0}.progress-popup{display:flex;flex-direction:column;justify-content:center;align-items:center}.progress-popup .desc{color:#000000de;text-align:center;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal}.behavioural-pill{display:flex;padding:0 8px;justify-content:center;align-items:center;gap:10px;border-radius:32px;border:1px solid #F8B861;background:linear-gradient(0deg,#f8b86152 0% 100%),#fff;margin:5px 0}.functional-pill{display:flex;padding:0 8px;justify-content:center;align-items:center;gap:10px;border-radius:32px;border:1px solid #E24577;background:linear-gradient(0deg,#e245773d 0% 100%),#fff;margin:5px 0}.domain-pill{display:flex;padding:0 8px;justify-content:center;align-items:center;gap:10px;border-radius:32px;border:1px solid #7B47A4;background:linear-gradient(0deg,#7b47a43d 0% 100%),#fff;margin:5px 0}.popup-header{display:flex;flex-direction:row;justify-content:space-between}.popup-footer{display:flex;flex-direction:row;justify-content:end}.view-cbp-plan{margin:10px;padding:10px}.view-cbp-plan-popup{padding:24px;max-height:70vh;overflow-y:auto}.section{border-radius:8px;background:#1b4ca114;padding:16px}.popup-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #ddd;font-weight:700;flex-shrink:0}.popup-footer{display:flex;justify-content:flex-end;gap:16px;padding:16px 24px;border-top:1px solid #ddd;background-color:#fff;flex-shrink:0;position:sticky;bottom:0}.section-container{overflow-y:auto;flex:1 1 auto}.competency-list{display:flex;flex-direction:row;gap:6px}.competency-text{color:#000;font-family:Lato;font-size:10px;font-style:normal;font-weight:400;line-height:normal;padding:5px}.competency-sub-heading{color:#1b4ca1;font-family:Montserrat;font-size:12px;font-style:normal;font-weight:600;line-height:normal}.cursor-pointer{cursor:pointer}.btn-active{border-radius:var(--Radius-Full-Round, 9999999px);opacity:1;background:var(--Primary-KB-Primary-Light, #1B4CA1);color:var(--white-kb-white-100, #FFF);text-align:center;font-family:Lato;font-size:14px;font-style:normal;font-weight:700;line-height:normal;display:flex;height:32px;padding:0 16px;justify-content:center;align-items:center;gap:8px;border:none}.custom-textarea{color:#000;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal}.overlay-loader{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#ffffffbf;z-index:9999;display:flex;justify-content:center;align-items:center}.close .mat-icon{height:18px!important;width:18px!important}:host ::ng-deep .mat-select-arrow-wrapper{height:6px!important}.file-upload-wrapper{position:relative;margin:16px 0}.file-upload-label{display:inline-flex;align-items:center;padding:10px 16px;background-color:#1b4ca1;color:#fff;font-weight:500;cursor:pointer;transition:background-color .3s;-webkit-user-select:none;user-select:none;border-radius:8px}.file-upload-label:hover{background-color:#1b4ca1}.file-upload-icon{margin-right:8px;font-size:18px}.file-upload-input{display:none}.error{color:red;margin-top:6px;font-size:.875rem}.file-upload-hint{display:block;font-size:1rem;color:#000;font-family:Lato;font-size:14px;margin-top:4px;margin-bottom:8px}:host ::ng-deep .mat-select-panel.search-panel .search-input{flex:1 1 auto;width:100%;padding:8px 10px;border:1px solid rgba(0,0,0,.12);border-radius:4px;font-size:14px;color:#333;outline:none;box-sizing:border-box}:host ::ng-deep .mat-select-panel.search-panel .search-input:focus{border-color:#0074b6;box-shadow:0 0 0 3px #0074b60f}:host ::ng-deep .mat-select-panel.search-panel .clear-button{background:transparent;border:none;cursor:pointer;font-size:16px;color:#666;padding:6px;line-height:1}:host ::ng-deep .mat-select-panel.search-panel .loading-indicator{padding:10px 12px;text-align:center;color:#666;font-size:14px}:host ::ng-deep .mat-select-panel.search-panel .mat-option{padding-top:10px;padding-left:16px}:host ::ng-deep .mat-select-panel.search-panel mat-option[disabled]{padding:8px 16px!important}:host ::ng-deep .mat-select-panel.align-panel{padding:0!important;box-sizing:border-box;margin-left:0!important;min-width:340px!important;max-width:340px!important}:host ::ng-deep .mat-select-panel.align-panel .mat-option{padding-left:16px}:host ::ng-deep .mat-select-panel.search-panel mat-option[disabled] .mat-error,:host ::ng-deep .mat-select-panel.search-panel .mat-error{margin:0!important;padding:0!important;font-size:14px!important;line-height:1.4!important;color:#f44336}:host ::ng-deep .mat-form-field{width:100%}:host ::ng-deep .mat-text-field-wrapper{background:#fff;border-radius:25px!important;height:42px}:host ::ng-deep .mat-notched-outline{border-radius:25px!important}:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline{border-radius:25px!important}:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline-start,:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline-end{border-width:1px!important;min-width:0!important}:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline{color:transparent!important}:host ::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick{color:transparent!important}:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-flex{border-radius:25px;height:42px;align-items:center;padding:0 16px;background:#fff}:host ::ng-deep .mat-select-panel{border:1px solid rgba(0,0,0,.16);border-radius:8px;box-shadow:0 6px 18px #0000001f}:host ::ng-deep .mat-select-panel.search-panel{max-height:300px!important;overflow-y:auto!important;box-sizing:border-box}::ng-deep .search-panel .sticky-search-container{position:sticky;top:0;z-index:100;background:#fff;padding:8px;border-bottom:1px solid #eee}:host ::ng-deep .search-panel .search-input-wrapper{display:flex;gap:8px;align-items:center}:host ::ng-deep .search-panel .search-input{width:100%;height:32px;padding:6px 10px}:host ::ng-deep .search-panel .mat-option{padding:8px 16px!important}:host ::ng-deep .search-panel .mat-pseudo-checkbox{margin-right:8px}:host ::ng-deep .search-panel .no-data-option{padding:10px 16px;font-size:14px;color:#f44336}::ng-deep .search-panel .no-data-option .mat-pseudo-checkbox{display:none!important}.search-input-wrapper{position:relative;width:100%;display:flex;align-items:center}.search-input{width:100%;padding-right:40px;height:40px;line-height:40px;box-sizing:border-box}.clear-icon{position:absolute;right:10px;cursor:pointer;font-size:20px;color:#666;display:flex;align-items:center;height:100%}.clear-icon:hover{color:#000}:host ::ng-deep .search-panel .mat-option:first-child{margin-top:0}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.MatLegacyCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i7.MatLegacyFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i9.MatLegacySelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i10.MatLegacyOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i11.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AddDesignationComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-add-designation', template: "<div class=\"view-cbp-plan\">\n    <div class=\"popup-container\">\n        <div class=\"popup-header\">\n            <div>\n                <div class=\"heading\">Add New Designation</div>\n            </div>\n            <div class=\"cursor-pointer\" (click)=\"closeDialog()\">\n                <mat-icon>close</mat-icon>\n            </div>\n        </div>\n    </div>\n    <div class=\"section-container\" [formGroup]=\"designationForm\">\n        <mat-card class=\"mt-1\">\n            <div class=\"mt-2 section\">\n                <div class=\"sub-heading\">\n                    <p>Designation Name</p>\n                </div>\n                <div class=\"section-header mt-4\">\n                    <!-- <input type=\"text\" formControlName=\"designation_name\" placeholder=\"Enter Designation\" [value]=\"\"\n                        style=\"border-radius: 25px; border: 1px solid #ccc; padding: 8px 12px; width: 100%;font-size: 14px;font-family: 'Lato';\"> -->\n                    <mat-form-field appearance=\"outline\" class=\"margin-top-s w-full required-select\">\n                        <mat-select multiple #position formControlName=\"designation_name\"\n                            placeholder=\"Select designation\" (closed)=\"onDesignationDropdownClosed()\"\n                            panelClass=\"search-panel\" (openedChange)=\"setupScrollListener($event)\"\n                            >\n\n                            <!-- Sticky search input container -->\n                            <div class=\"sticky-search-container\" (click)=\"$event.stopPropagation()\">\n                                <div class=\"search-input-wrapper\">\n                                    <input type=\"text\" placeholder=\"Search designation\" style=\"width:100%\"\n                                        formControlName=\"searchDesignation\" class=\"search-input\"\n                                        (keydown)=\"$event.stopPropagation()\"\n                                        (keydown.enter)=\"$event.preventDefault(); $event.stopPropagation()\"\n                                         autocomplete=\"off\">\n                                         <!-- (keyup)=\"designationSearch($event)\" -->\n                                    <div *ngIf=\"searchDesignationControl?.value\" type=\"button\" class=\"clear-icon\"\n                                        (click)=\"clearDesignationSearch($event)\">\n                                        <mat-icon>close</mat-icon>\n                                </div>\n                                </div>\n                            </div>\n                            <!-- Options list -->\n                            <mat-option [value]=\"designation?.name\" *ngFor=\"let designation of masterData?.designation\">\n                                {{designation?.name}}\n                            </mat-option>\n                            <!-- Loading indicator -->\n                            <div *ngIf=\"isLoadingMoreDesignations\" class=\"loading-indicator\">\n                                Load More...\n                            </div>\n                            <!-- No results message -->\n                            <mat-option *ngIf=\"(masterData?.designation)?.length === 0\" disabled class=\"no-data-option\">\n\n                                Designation Not Found.\n\n                            </mat-option>\n                        </mat-select>\n                        <!-- <mat-error class=\"text-xs\"\n                            *ngIf=\"designationForm?.get('designation_name')?.touched && designationForm?.get('designation_name')?.invalid\">\n                            Please select at least one designation.\n                        </mat-error> -->\n                    </mat-form-field>\n                </div>\n            </div>\n\n            <div class=\"mt-2 section\">\n                <div class=\"sub-heading\">\n                    <p>Role & responsibilities /Additional details</p>\n                </div>\n                <div class=\"mt-4 additional-details\">\n                    <textarea class=\"custom-textarea\" formControlName=\"instruction\" rows=\"5\"\n                        placeholder=\"Add Instructions\" [value]=\"\"></textarea>\n                </div>\n            </div>\n            <!-- <div class=\"mt-2 section\">\n                <div class=\"sub-heading\">\n                    <p>Upload Document (PDF/Word/Excel/TXT)</p>\n                </div>\n                <div class=\"file-upload-wrapper\">\n                    <label for=\"uploadDoc\" class=\"file-upload-label\">\n                        <span class=\"file-upload-icon\">\uD83D\uDCCE</span>\n                        <span>{{ uploadedFile?.name || 'Choose a file (PDF, Word, Excel, TXT)' }}</span>\n                    </label>\n\n                    <small class=\"file-upload-hint\">Max file size: 25MB</small>\n\n                    <input id=\"uploadDoc\" type=\"file\" (change)=\"onFileChange($event)\"\n                        accept=\".pdf,.doc,.docx,.xls,.xlsx,.txt\" class=\"file-upload-input\" />\n\n                    <div *ngIf=\"uploadError\" class=\"error\">{{ uploadError }}</div>\n                </div>\n            </div> -->\n\n        </mat-card>\n    </div>\n    <div class=\"popup-footer\">\n        <div>\n            <input class=\"btn-active\" type=\"button\" value=\"Cancel\" (click)=\"cancelForm()\" />\n        </div>\n        <div>\n            <input [disabled]=\"designationForm?.invalid\"\n                [ngClass]=\"designationForm?.invalid ? 'btn-disable':'btn-active'\" type=\"button\" value=\"Generate CBP\"\n                (click)=\"saveDesignation()\" />\n        </div>\n    </div>\n</div>\n<div class=\"overlay-loader\" *ngIf=\"loading\">\n    <mat-spinner diameter=\"50\"></mat-spinner>\n</div>", styles: [".container{margin:10px auto}.sub-heading p{color:#000;font-family:Montserrat;font-size:16px;font-style:normal;font-weight:600;line-height:normal}.radio-label{color:#000;font-family:Lato;font-size:16px;font-style:normal;font-weight:400;line-height:normal}.radio-btn-group{display:flex;width:32px;height:32px;padding:2px;gap:10px}.label{color:var(--Body-Text-Body-Color, #212529);font-family:Lato;font-size:14px;font-style:normal;font-weight:700;line-height:150%}:host ::ng-deep mat-form-field{background-color:#fff!important;border-radius:25px!important;padding-left:12px;padding-right:12px;height:42px;width:100%}:host ::ng-deep mat-select{border-radius:25px!important;background-color:#fff!important}:host ::ng-deep .mat-select-panel{background-color:#fff!important}:host ::ng-deep .mat-select-panel .mat-option{border-radius:0!important}:host ::ng-deep mat-form-field .mat-form-field-underline{display:none!important}:host ::ng-deep mat-select .mat-select-placeholder{color:#0006;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal}:host ::ng-deep mat-select .mat-select-value-text{color:#000;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal;line-height:normal!important;padding-top:0!important;padding-bottom:0!important}:host ::ng-deep mat-select .mat-select-value{display:flex!important;align-items:center!important;height:100%!important}.additional-details textarea{display:flex;padding:16px 16px 0;flex-direction:column;align-items:flex-start;gap:10px;flex:1 0 0;align-self:stretch;width:100%;color:#000;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal;resize:none}.section-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.btn-disable{border-radius:var(--Radius-Full-Round, 9999999px);opacity:.4;background:var(--Primary-KB-Primary-Light, #1B4CA1);color:var(--white-kb-white-100, #FFF);text-align:center;font-family:Lato;font-size:14px;font-style:normal;font-weight:700;line-height:normal;display:flex;height:32px;padding:0 16px;justify-content:center;align-items:center;gap:8px;border:none}.btn-group{display:flex;flex-direction:row;justify-content:space-between}.pl-2{padding-left:5px}.search-filter-section{display:flex;flex-direction:row;justify-content:space-between}.search .rsearch{position:relative}.search .search-icon{position:absolute;top:10px;font-size:20px;left:10px}.search .sinput{border-radius:4px;border:1px solid #d5d0d0;padding:15px 36px;font:400 14px Lato}.select-map-route-container{display:flex;flex-direction:row}.selected-mapping-route p{color:#1b4ca1;font-family:Lato;font-size:20px;font-style:normal;font-weight:400;line-height:normal;text-decoration-line:underline;text-decoration-style:solid;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;text-decoration-thickness:auto;text-underline-offset:auto;text-underline-position:from-font}.edit-plan{display:flex;padding:4px;justify-content:center;align-items:center;gap:8px;border-radius:4px;background:#1b4ca129;color:#1b4ca1;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal;margin-left:10px}.search-container{display:flex;flex-direction:row}.course-container{display:flex;width:100%;padding:16px;flex-direction:column;align-items:flex-start;gap:24px;grid-row:2/span 1;grid-column:1/span 1;border-radius:12px;border:1px solid var(--borders-black-border-16-black, rgba(0, 0, 0, .16));background:#fff}.course-header{display:flex;flex-direction:row;justify-content:space-between;width:100%}.course-pill{display:flex;height:24px;padding:8px;align-items:center;gap:4px;border-radius:16px;border:1px solid var(--borders-border-fill-focussed-4-light-100, #EF951E);background:#fefaf4}.ai-recommened-pill{display:flex;padding:4px 8px;align-items:center;gap:8px;border-radius:var(--Radius-4, 4px);border:1px solid #1B4CA1;background:#1b4ca129}.igot-platform-pill{display:flex;padding:4px 8px;align-items:center;gap:8px;border-radius:var(--Radius-4, 4px);border:1px solid #EF951E;background:#ef951e29}.course-title{color:var(--Primary-KB-Primary-Light, #1B4CA1);font-family:Montserrat;font-size:20px;font-style:normal;font-weight:600;line-height:30px}.course-desc{color:#0009;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal}.relevancy,.competencies-matched{color:var(--accessbility-shades-with-opacity-kb-greys-black-60, rgba(0, 0, 0, .6));font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal;align-items:center}.percentage{color:#1d8923;font-family:Lato;font-size:14px;font-style:normal;font-weight:800;line-height:normal}.relevancy-container,.competencies-matched-container{display:flex;flex-direction:row;align-items:center}.dash{padding:0 5px}:host ::ng-deep .mat-radio-checked .mat-radio-inner-circle{background:#1b4ca1!important}.course-list-container{display:flex;flex-wrap:wrap;gap:16px}.course-list-item{flex:0 0 48%;box-sizing:border-box;border:1px solid #ccc;padding:16px;background-color:#fff;border-radius:8px}.checked-course-container{display:flex}.ml-2{margin-left:8px}:host ::ng-deep .mat-checkbox-checked .mat-checkbox-background{background:#1b4ca1!important}.ai-recommened-pill-text,.igot-platform-pill-text{color:#1b4ca1;font-family:Lato;font-size:12px;font-style:normal;font-weight:700;line-height:normal}.course-pill-text{color:var(--accessbility-shades-without-opacity-kb-greys-black-87, #212121);text-align:center;font-family:Poppins;font-size:12px;font-style:normal;font-weight:400;line-height:normal}.ai-loader-icon img,.igot-platform-icon img{width:15.714px;height:15.714px;flex-shrink:0}.competency-container{display:flex;justify-content:space-between;flex-direction:row}.outside-layer-total{display:flex;padding:4px 12px;justify-content:center;align-items:center;gap:16px;border-radius:12px;border-left:2px solid #1B4CA1;border-right:2px solid #1B4CA1;background:#edf1f8;margin:0 10px}.outside-layer-functional{display:flex;padding:4px 12px;justify-content:center;align-items:center;gap:16px;border-radius:12px;border-left:2px solid #E24577;border-right:2px solid #E24577;background:#f8d2de;margin:0 10px}.outside-layer-domain{display:flex;padding:4px 12px;justify-content:center;align-items:center;gap:16px;border-radius:12px;border-left:2px solid #7B47A4;border-right:2px solid #7B47A4;background:#dfd3e9;margin:0 10px}.outside-layer-behavioral{display:flex;padding:4px 12px;justify-content:center;align-items:center;gap:16px;border-radius:12px;border-left:2px solid #F8B861;border-right:2px solid #F8B861;background:#fde8cc;margin:0 10px}.inside-layer{color:#1b4ca1;font-family:Lato;font-size:12px;font-style:normal;font-weight:400;line-height:normal}.count{color:#1b4ca1;font-family:Montserrat;font-size:16px;font-style:normal;font-weight:600;line-height:normal}.suggest-courses-header{display:flex;flex-direction:row;justify-content:space-between}.suggest-course-control{display:flex;flex-direction:row}.course-card-container{width:172px;border-radius:3.307px;border:.827px solid var(--borders-border-8-black, rgba(0, 0, 0, .08));background-color:#fff}.highlight-ai{font-family:Montserrat;font-size:24px;font-style:normal;font-weight:600;line-height:normal;background:linear-gradient(90deg,#3b27ff,#2de3d6);background-clip:text;-webkit-background-clip:text;color:transparent;-webkit-text-fill-color:transparent;display:inline-block}.ai-loader-icon-medium img{width:40px;height:40px;flex-shrink:0}.heading{color:#000;font-family:Montserrat;font-size:20px;font-style:normal;font-weight:600;line-height:normal;margin:10px 0}.progress-popup{display:flex;flex-direction:column;justify-content:center;align-items:center}.progress-popup .desc{color:#000000de;text-align:center;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal}.behavioural-pill{display:flex;padding:0 8px;justify-content:center;align-items:center;gap:10px;border-radius:32px;border:1px solid #F8B861;background:linear-gradient(0deg,#f8b86152 0% 100%),#fff;margin:5px 0}.functional-pill{display:flex;padding:0 8px;justify-content:center;align-items:center;gap:10px;border-radius:32px;border:1px solid #E24577;background:linear-gradient(0deg,#e245773d 0% 100%),#fff;margin:5px 0}.domain-pill{display:flex;padding:0 8px;justify-content:center;align-items:center;gap:10px;border-radius:32px;border:1px solid #7B47A4;background:linear-gradient(0deg,#7b47a43d 0% 100%),#fff;margin:5px 0}.popup-header{display:flex;flex-direction:row;justify-content:space-between}.popup-footer{display:flex;flex-direction:row;justify-content:end}.view-cbp-plan{margin:10px;padding:10px}.view-cbp-plan-popup{padding:24px;max-height:70vh;overflow-y:auto}.section{border-radius:8px;background:#1b4ca114;padding:16px}.popup-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #ddd;font-weight:700;flex-shrink:0}.popup-footer{display:flex;justify-content:flex-end;gap:16px;padding:16px 24px;border-top:1px solid #ddd;background-color:#fff;flex-shrink:0;position:sticky;bottom:0}.section-container{overflow-y:auto;flex:1 1 auto}.competency-list{display:flex;flex-direction:row;gap:6px}.competency-text{color:#000;font-family:Lato;font-size:10px;font-style:normal;font-weight:400;line-height:normal;padding:5px}.competency-sub-heading{color:#1b4ca1;font-family:Montserrat;font-size:12px;font-style:normal;font-weight:600;line-height:normal}.cursor-pointer{cursor:pointer}.btn-active{border-radius:var(--Radius-Full-Round, 9999999px);opacity:1;background:var(--Primary-KB-Primary-Light, #1B4CA1);color:var(--white-kb-white-100, #FFF);text-align:center;font-family:Lato;font-size:14px;font-style:normal;font-weight:700;line-height:normal;display:flex;height:32px;padding:0 16px;justify-content:center;align-items:center;gap:8px;border:none}.custom-textarea{color:#000;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal}.overlay-loader{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#ffffffbf;z-index:9999;display:flex;justify-content:center;align-items:center}.close .mat-icon{height:18px!important;width:18px!important}:host ::ng-deep .mat-select-arrow-wrapper{height:6px!important}.file-upload-wrapper{position:relative;margin:16px 0}.file-upload-label{display:inline-flex;align-items:center;padding:10px 16px;background-color:#1b4ca1;color:#fff;font-weight:500;cursor:pointer;transition:background-color .3s;-webkit-user-select:none;user-select:none;border-radius:8px}.file-upload-label:hover{background-color:#1b4ca1}.file-upload-icon{margin-right:8px;font-size:18px}.file-upload-input{display:none}.error{color:red;margin-top:6px;font-size:.875rem}.file-upload-hint{display:block;font-size:1rem;color:#000;font-family:Lato;font-size:14px;margin-top:4px;margin-bottom:8px}:host ::ng-deep .mat-select-panel.search-panel .search-input{flex:1 1 auto;width:100%;padding:8px 10px;border:1px solid rgba(0,0,0,.12);border-radius:4px;font-size:14px;color:#333;outline:none;box-sizing:border-box}:host ::ng-deep .mat-select-panel.search-panel .search-input:focus{border-color:#0074b6;box-shadow:0 0 0 3px #0074b60f}:host ::ng-deep .mat-select-panel.search-panel .clear-button{background:transparent;border:none;cursor:pointer;font-size:16px;color:#666;padding:6px;line-height:1}:host ::ng-deep .mat-select-panel.search-panel .loading-indicator{padding:10px 12px;text-align:center;color:#666;font-size:14px}:host ::ng-deep .mat-select-panel.search-panel .mat-option{padding-top:10px;padding-left:16px}:host ::ng-deep .mat-select-panel.search-panel mat-option[disabled]{padding:8px 16px!important}:host ::ng-deep .mat-select-panel.align-panel{padding:0!important;box-sizing:border-box;margin-left:0!important;min-width:340px!important;max-width:340px!important}:host ::ng-deep .mat-select-panel.align-panel .mat-option{padding-left:16px}:host ::ng-deep .mat-select-panel.search-panel mat-option[disabled] .mat-error,:host ::ng-deep .mat-select-panel.search-panel .mat-error{margin:0!important;padding:0!important;font-size:14px!important;line-height:1.4!important;color:#f44336}:host ::ng-deep .mat-form-field{width:100%}:host ::ng-deep .mat-text-field-wrapper{background:#fff;border-radius:25px!important;height:42px}:host ::ng-deep .mat-notched-outline{border-radius:25px!important}:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline{border-radius:25px!important}:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline-start,:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline-end{border-width:1px!important;min-width:0!important}:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline{color:transparent!important}:host ::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick{color:transparent!important}:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-flex{border-radius:25px;height:42px;align-items:center;padding:0 16px;background:#fff}:host ::ng-deep .mat-select-panel{border:1px solid rgba(0,0,0,.16);border-radius:8px;box-shadow:0 6px 18px #0000001f}:host ::ng-deep .mat-select-panel.search-panel{max-height:300px!important;overflow-y:auto!important;box-sizing:border-box}::ng-deep .search-panel .sticky-search-container{position:sticky;top:0;z-index:100;background:#fff;padding:8px;border-bottom:1px solid #eee}:host ::ng-deep .search-panel .search-input-wrapper{display:flex;gap:8px;align-items:center}:host ::ng-deep .search-panel .search-input{width:100%;height:32px;padding:6px 10px}:host ::ng-deep .search-panel .mat-option{padding:8px 16px!important}:host ::ng-deep .search-panel .mat-pseudo-checkbox{margin-right:8px}:host ::ng-deep .search-panel .no-data-option{padding:10px 16px;font-size:14px;color:#f44336}::ng-deep .search-panel .no-data-option .mat-pseudo-checkbox{display:none!important}.search-input-wrapper{position:relative;width:100%;display:flex;align-items:center}.search-input{width:100%;padding-right:40px;height:40px;line-height:40px;box-sizing:border-box}.clear-icon{position:absolute;right:10px;cursor:pointer;font-size:20px;color:#666;display:flex;align-items:center;height:100%}.clear-icon:hover{color:#000}:host ::ng-deep .search-panel .mat-option:first-child{margin-top:0}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }, { type: i2.FormBuilder }, { type: i0.ChangeDetectorRef }, { type: i3.SharedService }, { type: i4.MatSnackBar }]; }, propDecorators: { designationRef: [{
                type: ViewChild,
                args: ['designation', { read: ElementRef }]
            }] } });
//# sourceMappingURL=data:application/json;base64, 