import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Component, ElementRef, Inject, ViewChild } from '@angular/core';
import { Validators } from '@angular/forms';
import { debounceTime, distinctUntilChanged, finalize, startWith } from 'rxjs/operators';
import _ from 'lodash';
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/router";
import * as i6 from "@angular/common";
import * as i7 from "@angular/material/legacy-card";
import * as i8 from "@angular/material/legacy-form-field";
import * as i9 from "@angular/material/icon";
import * as i10 from "@angular/material/legacy-select";
import * as i11 from "@angular/material/legacy-core";
import * as i12 from "@angular/material/progress-spinner";
export class ApprovalRequestFormComponent {
    constructor(dialogRef, data, fb, cdRef, sharedService, snackBar, router) {
        this.dialogRef = dialogRef;
        this.data = data;
        this.fb = fb;
        this.cdRef = cdRef;
        this.sharedService = sharedService;
        this.snackBar = snackBar;
        this.router = router;
        this.loading = false;
        this.mdoFilterEnable = false;
        this.isLoadingMoremdos = false;
        this.mdoOffset = 0;
        this.odcsmdoCount = 0;
        this.defaultSearchmdoCount = 0;
        this.mdoListLoadCount = 50;
        this.mdoDefaultLoadCount = 50;
        this.noMoreLegacymdos = false;
        this.mdoSearchText = '';
        this.mdoInitInProgress = false;
        this.scrollListenerAttached = false;
        this.masterData = {};
        this.role_mapping_ids = [];
        this.role_mapping_ids = data;
        this.masterData = {
            mdoBackup: [],
            mdoFiltered: [], // filtered search results
        };
    }
    ngOnInit() {
        this.initializeForm();
        console.log('this.role_mapping_ids--', this.role_mapping_ids);
        const searchControl = this.approvalRequestForm.get('searchmdo');
        if (searchControl) {
            searchControl.valueChanges
                .pipe(debounceTime(100), distinctUntilChanged(), startWith(''))
                .subscribe(res => {
                const txt = res?.toString()?.trim() ?? '';
                if (txt?.length) {
                    this.mdoFilterEnable = true;
                    this.masterData.mdoFiltered =
                        this.masterData.mdoBackup.filter((item) => item.name.toLowerCase().includes(txt.toLowerCase()));
                    // show initial page of filtered results
                    this.masterData.mdo = this.masterData.mdoFiltered.slice(0, this.mdoListLoadCount);
                }
                else {
                    this.mdoFilterEnable = false;
                    // show first page from backup
                    this.masterData.mdo = this.masterData.mdoBackup.slice(0, this.mdoDefaultLoadCount);
                    this.mdoListLoadCount = this.mdoDefaultLoadCount;
                    this.mdoOffset = 0;
                }
            });
        }
        console.log(this.masterData['mdoBackup']);
        if (!this.masterData['mdoBackup'].length) {
            this.getmdoSafe();
        }
    }
    getmdoSafe() {
        if (this.mdoInitInProgress || this.isLoadingMoremdos) {
            return;
        }
        this.mdoInitInProgress = true;
        this.getmdo();
    }
    initializeForm() {
        this.approvalRequestForm = this.fb.group({
            mdo_name: ['', Validators.required],
            request_name: ['', [
                    Validators.required,
                    Validators.maxLength(100),
                    Validators.pattern(/^(?!\s*$)[A-Za-z0-9 ]+$/)
                ]],
            searchmdo: [''],
        });
    }
    cancelForm() {
        this.dialogRef.close();
    }
    savemdo() {
        const requestName = this.approvalRequestForm.value.request_name?.trim();
        if (!requestName) {
            this.snackBar.open('Request name is required', 'X', {
                duration: 3000
            });
            return;
        }
        const selectedmdo = this.approvalRequestForm.get('mdo_name')?.value;
        if (!selectedmdo) {
            this.snackBar.open('Please select an mdo leader/admin', '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,
            role_mapping_ids: this.role_mapping_ids.map((item) => item.id),
            request_name: requestName,
        };
        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 mdo
        const req = {
            ...baseObj,
            mdo_id: selectedmdo
        };
        this.sharedService.saveApprovalRequest(req)
            .pipe(finalize(() => this.loading = false))
            .subscribe({
            next: () => {
                this.snackBar.open('Request successfully submitted for approval.', 'X', {
                    duration: 3000,
                    panelClass: ['snackbar-success']
                });
                this.dialogRef.close('saved');
                this.router.navigate(['/ai/approve-requests']);
            },
            error: (error) => {
                console.log('error', error);
                this.snackBar.open((error?.error?.detail || 'Failed to send request'), 'X', {
                    duration: 3000,
                    panelClass: ['snackbar-error']
                });
            }
        });
    }
    closeDialog() {
        this.dialogRef.close();
    }
    getmdo(searchText, offset) {
        // clear any previous debug hooks
        if (!searchText || searchText?.length === 0) {
            // noop
        }
        const reqOffset = (typeof offset === 'number') ? offset : this.mdoOffset;
        let reqLimit = this.mdoDefaultLoadCount;
        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.noMoreLegacymdos = false;
            reqLimit = 50;
        }
        // const requestBody: any = {
        //   filterCriteriaMap: {
        //     status: 'Active'
        //   },
        //   requestedFields: [],
        //   pageNumber: pageIndex,
        //   pageSize: reqLimit,
        // }
        const requestBody = {
            "request": {
                "filters": {
                    "organisations.roles": [
                        "MDO_LEADER",
                        "MDO_ADMIN"
                    ],
                    "rootOrgId": this.sharedService.cbpPlanFinalObj.departments ? this.sharedService.cbpPlanFinalObj.departments : this.sharedService.cbpPlanFinalObj.ministry.identifier
                },
                "fields": [
                    "firstName",
                    "lastName",
                    "id",
                    "rootOrgId",
                    "organisations",
                    "roles"
                ],
                pageNumber: pageIndex,
                pageSize: reqLimit,
            }
        };
        if (searchText?.length) {
            requestBody['request']["query"] = searchText;
            // when searching, start from first page
            requestBody.pageNumber = 0;
            // allow larger page for search if needed
            requestBody.pageSize = pageIndex === 0 ? 50 : this.mdoListLoadCount;
            // reset guard when performing a fresh search
            this.noMoreLegacymdos = false;
        }
        // indicate loading state so scroll handlers don't trigger parallel calls
        this.isLoadingMoremdos = true;
        console.log('requestBody', requestBody);
        this.sharedService.searchPublicmdo(requestBody).pipe(finalize(() => {
            this.isLoadingMoremdos = false;
            this.mdoInitInProgress = false;
        }))
            .subscribe({
            next: (res) => {
                const content = _.get(res, 'admins', []);
                console.log('content--', content);
                const mapped = content.map((item) => ({
                    id: item?.id,
                    name: `${item?.first_name} ${item?.last_name}` || '',
                    status: item?.status || 'Active',
                    role_type: item?.role_type,
                    department_name: item?.department_name
                }));
                // total count may be present in different keys depending on API version.
                // Prefer 'result.result.totalcount' (legacy lower-case) then data.totalCount, then totalCount
                const total = _.get(res, 'count', _.get(res, 'count', _.get(res, 'count', 0)));
                this.defaultSearchmdoCount = total;
                // If offset is zero (first page) replace backup, otherwise append + dedupe
                if (!this.masterData['mdoBackup'] || reqOffset === 0) {
                    this.masterData['mdoBackup'] = mapped;
                }
                else {
                    const combined = (this.masterData['mdoBackup'] || []).concat(mapped);
                    this.masterData['mdoBackup'] = _.uniqBy(combined, (it) => (it?.name || '').toLowerCase());
                }
                // If server returned no new items, mark as no-more-data to stop further scroll requests
                if (!mapped || mapped?.length === 0) {
                    this.noMoreLegacymdos = true;
                }
                // If we've loaded at least the total count, mark no-more-data
                if (this.defaultSearchmdoCount && (this.masterData['mdoBackup'] || []).length >= this.defaultSearchmdoCount) {
                    this.noMoreLegacymdos = true;
                }
                // Ensure visible list matches the requested display count
                this.masterData['mdo'] = (this.masterData['mdoBackup'] || []).slice(0, this.mdoListLoadCount);
                // loading flag cleared in finalize()
                this.checkCurrentmdoPresent();
            },
            error: () => {
                // Stop further automatic calls on repeated errors to avoid tight loops
                // loading flag cleared in finalize()
                this.noMoreLegacymdos = true;
                // this.matSnackBar.open('Unable to fetch mdo details, please try again later!')
            }
        });
    }
    checkCurrentmdoPresent() {
        const selectedmdo = this.approvalRequestForm.get('mdo_name')?.value;
        if (!selectedmdo || !this.masterData?.mdo)
            return;
        const exists = this.masterData.mdo.some((item) => item?.name?.toLowerCase() === selectedmdo?.toLowerCase());
        if (!exists) {
            const newmdo = {
                name: selectedmdo,
                status: 'Active',
                id: 'custom-' + Date.now()
            };
            this.masterData.mdoBackup = this.masterData.mdoBackup || [];
            this.masterData.mdoBackup.unshift(newmdo);
            this.masterData.mdo.unshift(newmdo);
        }
    }
    onmdoDropdownClosed() {
        // Keep the mdo value but clear the search input
        const currentmdo = this.approvalRequestForm.get('mdo_name').value;
        setTimeout(() => {
            if (this.approvalRequestForm.get('searchmdo')) {
                this.approvalRequestForm.get('searchmdo').setValue('');
            }
            // Ensure the mdo value remains selected
            if (currentmdo) {
                const mdoControl = this.approvalRequestForm.get('mdo_name');
                if (mdoControl) {
                    mdoControl.setValue(currentmdo);
                }
            }
        }, 100);
    }
    mdoSearch(evt) {
        const searchText = evt?.target?.value;
        const txt = (searchText || '').toString().trim();
        if (this.isLoadingMoremdos)
            return;
        this.mdoSearchText = txt;
        if (txt?.length) {
            this.mdoFilterEnable = true;
            this.isLoadingMoremdos = true;
            this.getmdo(txt, 0);
        }
        else if (this.masterData && this.masterData?.mdoBackup) {
            this.masterData.mdo = this.masterData?.mdoBackup.slice(0, this.mdoDefaultLoadCount);
            this.mdoFilterEnable = false;
            this.checkCurrentmdoPresent();
        }
    }
    setupScrollListener(opened) {
        if (opened) {
            if (!this.scrollListenerAttached) {
                this.scrollListenerAttached = true;
                this.mdoFilterEnable = false;
                this.mdoListLoadCount = this.mdoDefaultLoadCount;
                this.mdoOffset = 0;
                this.isLoadingMoremdos = true;
                this.getmdo(undefined, 0);
                // Clear search box once
                if (this.approvalRequestForm.get('searchmdo')) {
                    this.approvalRequestForm.get('searchmdo').setValue('');
                }
                setTimeout(() => {
                    const searchInput = document.querySelector('.search-input');
                    if (searchInput) {
                        searchInput.focus();
                    }
                }, 100);
                // Attach scroll listener safely
                setTimeout(() => {
                    const panel = document.querySelector('.mat-select-panel.search-panel');
                    if (panel) {
                        // align panel width to trigger
                        try {
                            const triggerEl = this.mdoRef && this.mdoRef.nativeElement;
                            if (triggerEl) {
                                const rect = triggerEl.getBoundingClientRect();
                                // set width and left so panel aligns exactly below the trigger
                                panel.style.width = `${Math.round(rect.width)}px`;
                                // leave left to overlay positioning but nudge if necessary
                                // compute left relative to viewport and apply to panel
                                const overlayLeft = rect.left;
                                panel.style.left = `${Math.round(overlayLeft)}px`;
                            }
                        }
                        catch (e) {
                            // ignore DOM errors in SSR or unexpected cases
                        }
                        const scrollHandler = this.onmdoSelectScroll.bind(this);
                        panel.addEventListener('scroll', scrollHandler, { passive: true });
                    }
                }, 150);
            }
        }
        else {
            // Dropdown closed — reset scroll flag so it can reattach next time
            this.scrollListenerAttached = false;
        }
    }
    onmdoSelectScroll(event) {
        const element = event?.target;
        if (!this.mdoFilterEnable) {
            // Check if user has scrolled to the bottom (with a small threshold)
            if (element.scrollTop + element?.clientHeight >= element?.scrollHeight - 5) {
                // Only load more if not already loading and if there are potentially more items
                if (!this.isLoadingMoremdos) {
                    // If org uses IGOT mdo taxonomy, request more from the API by increasing the limit
                    if (this.masterData?.mdoBackup?.length > this.masterData?.mdo?.length) {
                        // Local pagination: expand the sliced list
                        this.isLoadingMoremdos = true;
                        this.mdoListLoadCount += this.mdoDefaultLoadCount;
                        // Update the filtered list with more items
                        setTimeout(() => {
                            this.masterData.mdo = this.masterData?.mdoBackup?.slice(0, this.mdoListLoadCount);
                            this.checkCurrentmdoPresent();
                            this.isLoadingMoremdos = false;
                        }, 500); // Small timeout to simulate loading and prevent multiple triggers
                    }
                    else {
                        // Legacy (server) pagination: request next page if total not reached
                        const loadedLegacy = (this.masterData?.mdoBackup || []).length;
                        if (!this.noMoreLegacymdos && this.defaultSearchmdoCount && loadedLegacy < this.defaultSearchmdoCount) {
                            this.isLoadingMoremdos = true;
                            this.mdoOffset = (this.mdoOffset || 0) + this.mdoDefaultLoadCount;
                            // increase display count to include newly fetched items
                            this.mdoListLoadCount += this.mdoDefaultLoadCount;
                            this.getmdo(undefined, this.mdoOffset);
                        }
                    }
                }
            }
        }
    }
    get searchmdoControl() {
        return this.approvalRequestForm.get('searchmdo');
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ApprovalRequestFormComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i2.FormBuilder }, { token: i0.ChangeDetectorRef }, { token: i3.SharedService }, { token: i4.MatSnackBar }, { token: i5.Router }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ApprovalRequestFormComponent, selector: "app-approval-request-form", viewQueries: [{ propertyName: "mdoRef", first: true, predicate: ["mdo"], 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\">Send For Approval</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]=\"approvalRequestForm\">\n        <mat-card class=\"mt-1\">\n            <div class=\"mt-2 section\">\n                <div class=\"sub-heading\">\n                    <p>Request Name <span class=\"required\">*</span></p>\n                </div>\n                <div class=\"mt-4 additional-details\">\n                    <input type=\"text\" formControlName=\"request_name\" [value]=\"\" placeholder=\"Enter a name for this request...\"\n                        maxlength=\"100\" \n                        style=\"border-radius: 25px; border: 1px solid #ccc; padding: 8px 12px; width:100%;font-size: 14px;font-family: 'Lato';\">\n                      <mat-error\n                        *ngIf=\"\n                        approvalRequestForm.get('request_name')?.touched &&\n                        approvalRequestForm.get('request_name')?.hasError('required')\n                        \"\n                    >\n                        Request name is required\n                    </mat-error>\n\n                    <mat-error\n                        *ngIf=\"\n                        approvalRequestForm.get('request_name')?.touched &&\n                        approvalRequestForm.get('request_name')?.hasError('pattern')\n                        \"\n                    >\n                        Only letters, numbers, spaces are allowed\n                    </mat-error>\n                </div>\n            </div>\n            <div class=\"mt-2 section\">\n                <div class=\"sub-heading\">\n                    <p>Select MDO Admin/Leader <span class=\"required\">*</span></p>\n                </div>\n                <div class=\"section-header mt-4\">\n                    <!-- <input type=\"text\" formControlName=\"mdo_name\" placeholder=\"Enter mdo\" [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 #position formControlName=\"mdo_name\"\n                            placeholder=\"Select MDO Admin/Leader\" (closed)=\"onmdoDropdownClosed()\"\n                            panelClass=\"search-panel\" (openedChange)=\"setupScrollListener($event)\">\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 mdo admin/leader\"\n                                        formControlName=\"searchmdo\" class=\"search-input\"\n                                        (keydown)=\"$event.stopPropagation()\"\n                                        (keydown.enter)=\"$event.preventDefault(); $event.stopPropagation()\"\n                                        (keyup)=\"mdoSearch($event)\" autocomplete=\"off\">\n                                    <button *ngIf=\"searchmdoControl?.value\" type=\"button\" class=\"clear-button\"\n                                        (click)=\"searchmdoControl.setValue('')\">\n                                        \u2715 Clear Search\n                                    </button>\n                                </div>\n                            </div>\n                            <!-- Options list -->\n                            <mat-option [value]=\"mdo?.id\" *ngFor=\"let mdo of masterData?.mdo\">\n                                {{mdo?.name}}\n                            </mat-option>\n                            <!-- Loading indicator -->\n                            <div *ngIf=\"isLoadingMoremdos\" class=\"loading-indicator\">\n                                Load More...\n                            </div>\n                            <!-- No results message -->\n                            <mat-option *ngIf=\"(masterData?.mdo )?.length === 0\" disabled>\n                                <!-- No matches found -->\n                                <div class=\"mat-error txt-size\">No MDO Admin/Leader mapped. Please contact system administrator.</div>\n                            </mat-option>\n                        </mat-select>\n                        <!-- <mat-error class=\"text-xs\"\n                            *ngIf=\"approvalRequestForm?.get('mdo_name')?.touched && approvalRequestForm?.get('mdo_name')?.invalid\">\n                            Please select at least one mdo.\n                        </mat-error> -->\n                    </mat-form-field>\n                </div>\n            </div>\n\n            \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            \n            <button [disabled]=\"approvalRequestForm?.invalid\"\n                [ngClass]=\"approvalRequestForm?.invalid ? 'btn-disable':'btn-active'\" type=\"button\"\n                (click)=\"savemdo()\" ><mat-icon>send</mat-icon> Send Request</button>\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%}::ng-deep mat-form-field{background-color:#fff!important;border-radius:25px!important;padding-left:12px;padding-right:12px;height:42px;width:100%}::ng-deep mat-select{border-radius:25px!important;background-color:#fff!important}::ng-deep .mat-select-panel{background-color:#fff!important}::ng-deep .mat-select-panel .mat-option{border-radius:0!important}::ng-deep mat-form-field .mat-form-field-underline{display:none!important}::ng-deep mat-select .mat-select-placeholder{color:#0006;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal}::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}::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}::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}::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}::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}::ng-deep .mat-select-panel.search-panel .search-input:focus{border-color:#0074b6;box-shadow:0 0 0 3px #0074b60f}::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}::ng-deep .mat-select-panel.search-panel .loading-indicator{padding:10px 12px;text-align:center;color:#666;font-size:14px}::ng-deep .mat-select-panel.search-panel .mat-option{padding-top:10px;padding-left:16px}::ng-deep .mat-select-panel.search-panel mat-option[disabled]{padding:8px 16px!important}::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}::ng-deep .mat-select-panel.align-panel .mat-option{padding-left:16px}::ng-deep .mat-select-panel.search-panel mat-option[disabled] .mat-error,::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}::ng-deep .mat-form-field{width:100%}::ng-deep .mat-text-field-wrapper{background:#fff;border-radius:25px!important;height:42px}::ng-deep .mat-notched-outline{border-radius:25px!important}::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline{border-radius:25px!important}::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline-start,::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline-end{border-width:1px!important;min-width:0!important}::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline{color:transparent!important}::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick{color:transparent!important}::ng-deep .mat-form-field-appearance-outline .mat-form-field-flex{border-radius:25px;height:42px;align-items:center;padding:0 16px;background:#fff}::ng-deep .mat-select-panel{border:1px solid rgba(0,0,0,.16);border-radius:8px;box-shadow:0 6px 18px #0000001f}mat-error{color:#f44336!important;font-size:12px;margin-top:4px}::ng-deep .mat-mdc-form-field-error{color:#d32f2f!important}::ng-deep .mat-mdc-form-field-error{color:#f44336!important;font-size:12px}.required{color:#f44336!important}\n"], dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.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: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8.MatLegacyError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i8.MatLegacyFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i9.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i10.MatLegacySelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i11.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: i12.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: ApprovalRequestFormComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-approval-request-form', template: "<div class=\"view-cbp-plan\">\n    <div class=\"popup-container\">\n        <div class=\"popup-header\">\n            <div>\n                <div class=\"heading\">Send For Approval</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]=\"approvalRequestForm\">\n        <mat-card class=\"mt-1\">\n            <div class=\"mt-2 section\">\n                <div class=\"sub-heading\">\n                    <p>Request Name <span class=\"required\">*</span></p>\n                </div>\n                <div class=\"mt-4 additional-details\">\n                    <input type=\"text\" formControlName=\"request_name\" [value]=\"\" placeholder=\"Enter a name for this request...\"\n                        maxlength=\"100\" \n                        style=\"border-radius: 25px; border: 1px solid #ccc; padding: 8px 12px; width:100%;font-size: 14px;font-family: 'Lato';\">\n                      <mat-error\n                        *ngIf=\"\n                        approvalRequestForm.get('request_name')?.touched &&\n                        approvalRequestForm.get('request_name')?.hasError('required')\n                        \"\n                    >\n                        Request name is required\n                    </mat-error>\n\n                    <mat-error\n                        *ngIf=\"\n                        approvalRequestForm.get('request_name')?.touched &&\n                        approvalRequestForm.get('request_name')?.hasError('pattern')\n                        \"\n                    >\n                        Only letters, numbers, spaces are allowed\n                    </mat-error>\n                </div>\n            </div>\n            <div class=\"mt-2 section\">\n                <div class=\"sub-heading\">\n                    <p>Select MDO Admin/Leader <span class=\"required\">*</span></p>\n                </div>\n                <div class=\"section-header mt-4\">\n                    <!-- <input type=\"text\" formControlName=\"mdo_name\" placeholder=\"Enter mdo\" [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 #position formControlName=\"mdo_name\"\n                            placeholder=\"Select MDO Admin/Leader\" (closed)=\"onmdoDropdownClosed()\"\n                            panelClass=\"search-panel\" (openedChange)=\"setupScrollListener($event)\">\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 mdo admin/leader\"\n                                        formControlName=\"searchmdo\" class=\"search-input\"\n                                        (keydown)=\"$event.stopPropagation()\"\n                                        (keydown.enter)=\"$event.preventDefault(); $event.stopPropagation()\"\n                                        (keyup)=\"mdoSearch($event)\" autocomplete=\"off\">\n                                    <button *ngIf=\"searchmdoControl?.value\" type=\"button\" class=\"clear-button\"\n                                        (click)=\"searchmdoControl.setValue('')\">\n                                        \u2715 Clear Search\n                                    </button>\n                                </div>\n                            </div>\n                            <!-- Options list -->\n                            <mat-option [value]=\"mdo?.id\" *ngFor=\"let mdo of masterData?.mdo\">\n                                {{mdo?.name}}\n                            </mat-option>\n                            <!-- Loading indicator -->\n                            <div *ngIf=\"isLoadingMoremdos\" class=\"loading-indicator\">\n                                Load More...\n                            </div>\n                            <!-- No results message -->\n                            <mat-option *ngIf=\"(masterData?.mdo )?.length === 0\" disabled>\n                                <!-- No matches found -->\n                                <div class=\"mat-error txt-size\">No MDO Admin/Leader mapped. Please contact system administrator.</div>\n                            </mat-option>\n                        </mat-select>\n                        <!-- <mat-error class=\"text-xs\"\n                            *ngIf=\"approvalRequestForm?.get('mdo_name')?.touched && approvalRequestForm?.get('mdo_name')?.invalid\">\n                            Please select at least one mdo.\n                        </mat-error> -->\n                    </mat-form-field>\n                </div>\n            </div>\n\n            \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            \n            <button [disabled]=\"approvalRequestForm?.invalid\"\n                [ngClass]=\"approvalRequestForm?.invalid ? 'btn-disable':'btn-active'\" type=\"button\"\n                (click)=\"savemdo()\" ><mat-icon>send</mat-icon> Send Request</button>\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%}::ng-deep mat-form-field{background-color:#fff!important;border-radius:25px!important;padding-left:12px;padding-right:12px;height:42px;width:100%}::ng-deep mat-select{border-radius:25px!important;background-color:#fff!important}::ng-deep .mat-select-panel{background-color:#fff!important}::ng-deep .mat-select-panel .mat-option{border-radius:0!important}::ng-deep mat-form-field .mat-form-field-underline{display:none!important}::ng-deep mat-select .mat-select-placeholder{color:#0006;font-family:Lato;font-size:14px;font-style:normal;font-weight:400;line-height:normal}::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}::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}::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}::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}::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}::ng-deep .mat-select-panel.search-panel .search-input:focus{border-color:#0074b6;box-shadow:0 0 0 3px #0074b60f}::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}::ng-deep .mat-select-panel.search-panel .loading-indicator{padding:10px 12px;text-align:center;color:#666;font-size:14px}::ng-deep .mat-select-panel.search-panel .mat-option{padding-top:10px;padding-left:16px}::ng-deep .mat-select-panel.search-panel mat-option[disabled]{padding:8px 16px!important}::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}::ng-deep .mat-select-panel.align-panel .mat-option{padding-left:16px}::ng-deep .mat-select-panel.search-panel mat-option[disabled] .mat-error,::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}::ng-deep .mat-form-field{width:100%}::ng-deep .mat-text-field-wrapper{background:#fff;border-radius:25px!important;height:42px}::ng-deep .mat-notched-outline{border-radius:25px!important}::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline{border-radius:25px!important}::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline-start,::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline-end{border-width:1px!important;min-width:0!important}::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline{color:transparent!important}::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick{color:transparent!important}::ng-deep .mat-form-field-appearance-outline .mat-form-field-flex{border-radius:25px;height:42px;align-items:center;padding:0 16px;background:#fff}::ng-deep .mat-select-panel{border:1px solid rgba(0,0,0,.16);border-radius:8px;box-shadow:0 6px 18px #0000001f}mat-error{color:#f44336!important;font-size:12px;margin-top:4px}::ng-deep .mat-mdc-form-field-error{color:#d32f2f!important}::ng-deep .mat-mdc-form-field-error{color:#f44336!important;font-size:12px}.required{color:#f44336!important}\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 }, { type: i5.Router }]; }, propDecorators: { mdoRef: [{
                type: ViewChild,
                args: ['mdo', { read: ElementRef }]
            }] } });
//# sourceMappingURL=data:application/json;base64, 