import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; import { FormService } from '../../services/form.service'; import { PublicForm } from '../../models/publicForm.model'; import { ToastrService } from 'ngx-toastr'; import { Router } from '@angular/router'; import { DataService } from '../../services/data.service'; import { RecaptchaService } from '../../services/recaptcha.service'; import { ValidationService } from '../../services/validation.service'; import { ElementTrackerService } from '../../services/element-tracker.service'; import { NavigationTabsComponent } from '../navigation-tabs/navigation-tabs.component'; import { FormValidationService } from '../../services/form-validation.service'; import { AggregationFunctionService } from '../../services/aggregate.service'; import { EmitterDTO } from '../../models/emitters.model'; import { ScoreCalculationService } from '../../services/score.service'; import { MatDialog } from '@angular/material/dialog'; import { WhenClauseService } from '../../services/whenClause.service'; import { HiddenFieldService } from '../../services/hidden-field.service'; import * as i0 from "@angular/core"; interface Answer { questionId: string; answer: any; answerId?: string; deleteFiles?: string[]; fields?: any; } interface Submission { submissionId?: string; answers: Answer[]; } interface Form { formId: string; deleted?: boolean; deletedSubmissions: any[]; submissions: Submission[]; copiedForms: string[]; scores?: { scoreType: string; score: number; }[]; maximumPossibleScore?: number; show?: boolean; } interface CopyForms { id: string; title: string; description: string; parentSubform: string; questionRelation: Record; } interface WhenClauseElements { elementId: string; entityType: string; show: boolean; } interface QuestionAnswersWrapper { parentId: string; answers: Answer[]; forms: Form[]; copySubForms: CopyForms[]; scores?: { scoreType: string; score: number; }[]; maximumPossibleScore?: number; whenClauseElements: WhenClauseElements[]; } interface SubmissionScore { scoreType: string; score: number; } export declare class SubmitFormComponent implements OnInit, OnDestroy { private formService; private toastr; private router; private dataService; private recaptchaService; private validationService; private changeDetectorRef; private elementTracker; private formValidationService; private aggregateService; private scoreCalcService; dialog: MatDialog; private whenClauseService; private hiddenFieldService; question: PublicForm | null; moduleName: string; edit: boolean; submissionId: string; acceptedLanguage: string; skipMargin: boolean; skipValidation: boolean; navigateTo: string; country: string; submit: EventEmitter; apiCalled: EventEmitter; currentPageIndexChange: EventEmitter; showCancelButton: boolean; cancel: EventEmitter; child: NavigationTabsComponent; isActionTriggered: boolean; isLoading: boolean; name: string; saveAutomatically: boolean; saveInterval: number; customizeFont: boolean; fontFamily: string; fontSize: number; validationSkip: boolean; enableDataExport: boolean; fileFormats: string[]; enableQuestionNumbering: boolean; questionNumbering: string; enableGoogleRecaptcha: boolean; googleRecaptchaKey: string; googleRecaptchaSecret: string; navigation: string; markAllQuestionsAsRequired: boolean; pages: any; currentPageIndex: number; previousPage: any; currentPage: any; nextPage: any; lastTab: boolean; questionAnswers: QuestionAnswersWrapper; webhook: any; files: { questionId: string; file: any; show?: boolean; }[]; parentQuestions: any; submission: any; parentQuestionAnswers: any; parentSubmissionId: string; submissionInProgress: boolean; submissionInDraft: boolean; recaptchaToken: string; private isRefreshing; private intervalId; pageDetails: any; pageNumber: number; rowSet: number; rowSetCount: [number]; retryCount: number; maxRetries: number; eligibleForSubmission: { status: boolean; message: string; }; webhookPayloadArray: any[]; inValidQuestions: Map; visitedRows: Map; allElementIds: string[]; private debounceTimer; primaryColor: string; secondaryColor: string; isLoadingPages: boolean; copySubforms: CopyForms[]; emitters: EmitterDTO[]; maxPossibleScore: number; maxPossibleGoodScore: number; maxPossibleBadScore: number; sumOfFindings: number; sumOfGoodFindings: number; sumOfBadFindings: number; draft: boolean; submissionProgress: number; showSubmissionLoader: boolean; progressInterval: any; currentStep: string; animatedDots: string; private dotInterval; constructor(formService: FormService, toastr: ToastrService, router: Router, dataService: DataService, recaptchaService: RecaptchaService, validationService: ValidationService, changeDetectorRef: ChangeDetectorRef, elementTracker: ElementTrackerService, formValidationService: FormValidationService, aggregateService: AggregationFunctionService, scoreCalcService: ScoreCalculationService, dialog: MatDialog, whenClauseService: WhenClauseService, hiddenFieldService: HiddenFieldService); ngOnDestroy(): void; ngOnChanges(changes: SimpleChanges): void; ngOnInit(): void; recaptchaInitialized(): Promise; getToken(): Promise; loadFont(fontName: string): void; getFormData(): void; getSubmittedFormData(): void; setUpFontFamily(response: any): void; navigateToFormElement(): void; assignQuestionProperties(question: PublicForm): void; navigateToNextPage(): void; navigateToPreviousPage(): void; checkSubmissionEligibility(): void; setCurrentPage(index: number): void; loadMoreData(index: number): void; generateQuestionAnswers(): void; clearEmptySubmissions(submissions: any): any; validateAllElementLoaded(): { status: boolean; message: string; }; saveasDraftPopup(): void; saveAsDraft(): void; submitForm(): Promise; setProgress(value: number): void; startSubmissionLoader(): void; completeSubmissionLoader(): void; resetSubmissionLoader(): void; startTextLoader(): void; updateStepText(progress: number): void; calculateFormFinalScore(): SubmissionScore[]; mapEmittersToValues(): { [key: string]: any; }; parseErrorsToMap(errorString: string): Map; navigateToFirstError(): Promise; private scrollToElementWithRetry; private scrollAndFocus; private fallbackScroll; private debounce; findQuestionPageIndex(questionErrors: Map): void; private checkAndStoreInvalidQuestions; focusQuestionElement(container: HTMLElement): void; validateForm(jsonData: any): { isValid: boolean; message: string; pageIndex: number | 0; }; validateSubForm(element: any): void; private findQuestionById; updateSubFormWithSubmissions(event: any): void; updateSubForm: (pages: any[], updatedSubForm: any) => void; extractGroupedWebhookData(webhooks: any[]): { headers: Record; params: Record; pathVariables: Record; requestBodies: Record; }; getValueFromStorage(source: 'LOCAL_STORAGE' | 'SESSION_STORAGE', key: string): string | null; cancelled(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};