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AAcvB,KAAKuB,aACnBC,UAAWxB,KAAKwB,Y,YAKhB,YAAA8E,UAAN,W,uGACqC,QAAjB,EAAAtG,KAAK+B,oBAAY,eAAEC,kBAGnC,GAAMhC,KAAK+B,aAAaC,iBAAiBsE,aADvC,M,OACF,S,mCAKE,YAAAC,aAAN,W,uGACqC,QAAjB,EAAAvG,KAAK+B,oBAAY,eAAEC,kBAGnC,GAAMhC,KAAK+B,aAAaC,iBAAiBuE,gBADvC,M,OACF,S,mCAKE,YAAAC,mBAAN,W,uGACqC,QAAjB,EAAAxG,KAAK+B,oBAAY,eAAEC,kBAGnC,GAAMhC,KAAK+B,aAAaC,iBAAiBwE,sBADvC,M,OACF,S,mCAIE,YAAAC,iBAAN,W,0EACEzG,KAAKpB,MACF8H,OACAC,QAAQ,KAAc,CACrBC,SAAU5G,KAAKY,GACfiG,8BAA+B7G,KAAKQ,SACpCsG,WAAY9G,KAAKW,WACjBE,WAAYb,KAAKa,aAElBkG,YAAY,CAAExG,KAAM,Y,WAGzB,sBACI,kCAAmB,C,IADvB,WAEE,OAAOP,KAAKR,iBACd,E,gCAHA,IAAC,IAAAwH,cAAa,qB,2FAp3BG,IADlB,IAAAC,c,uBA0D+B,mB,OAAA,IAAb,UAAa,SACJ,mBADI,OACJ,IAAT,YAAS,SACI,mBADJ,OACI,IAAd,YAAc,SACL,mBADK,OACL,IAAV,YAAU,SACG,mBADH,OACG,IAAf,EAAAC,iBAAA,EAAAA,iBAAe,SACA,mBADA,OACA,IAAZ,UAAY,SACC,mBADD,OACC,IAAT,EAAAC,WAAA,EAAAA,WAAS,SACD,mBADC,OACD,IAAZ,UAAY,YAhEjBC,E,CAAb,E","sources":["webpack://iadviser/./src/routes/app-adviser/diagnostics/diagnostics.ts?405d","webpack://iadviser/./src/routes/app-adviser/client/wizard/wizard.html","webpack://iadviser/./src/routes/app-adviser/client/wizard/wizard.ts"],"sourcesContent":["module.exports = function(cb) {\n\trequire.ensure([], function(require) {\n\t\tcb(require(\"!!../../../../node_modules/ts-loader/index.js??ruleSet[1].rules[3].use[0]!./diagnostics.ts\"));\n\t}, \"diagnostics\");\n}","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","import { mapActionTypeToEntityActionType, EntityActionTypeToActionTypeLabel } from 'resources/map-entity-type';\r\nimport { QuoteStepMap, ClaimStepMap, UserFormStepMap } from './steps/quote/config';\r\nimport { ConfirmModalActions } from 'components/ia-modal/ia-modal';\r\nimport { environment } from 'environment';\r\nimport { HttpClient } from 'aurelia-fetch-client';\r\nimport { log } from 'resources/services/log-service';\r\nimport { AppRouter } from 'aurelia-router';\r\nimport { ClaimsService } from 'resources/services/claims-service';\r\nimport { autoinject, computedFrom, TaskQueue } from 'aurelia-framework';\r\nimport styles from '../quotes/quotes.css';\r\nimport { IaToastService } from 'resources/services/ia-toast-service';\r\nimport { captureException } from '@sentry/core';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { AureliaHooks } from 'resources/services/aurelia-hooks';\r\nimport { EntityMode, EntityActionType, EntityType } from 'routes/app-adviser/client/quotes/interfaces';\r\nimport { DocumentPack } from 'components/document-pack/document-pack';\r\nimport { ModalService } from 'components/modal/modal-service';\r\n@autoinject()\r\nexport class Wizard {\r\n public styles = styles;\r\n\r\n public forwardButtonDisabled = false;\r\n public currentDirection;\r\n public stepClickedValue;\r\n\r\n // Assume no permission by default\r\n public noPermission = true;\r\n public entityMode: EntityMode = EntityMode.None;\r\n public actionType: EntityActionType;\r\n public mappedActionType: string;\r\n public entityType: EntityType;\r\n\r\n public showSaveConfirmModal = false;\r\n public showCloseConfirmModal = false;\r\n public showStepTransitionConfirmModal = false;\r\n public showRiskModal = false;\r\n\r\n public steps = QuoteStepMap;\r\n\r\n public currentStep;\r\n public currentStepIndex = 0;\r\n public clickedStep;\r\n\r\n public id;\r\n public entityId;\r\n public step;\r\n public newActionType;\r\n public policyId;\r\n\r\n public backButtonDisabled = false;\r\n public viewModelRef;\r\n public composeModel;\r\n\r\n public stepTransitioning = false;\r\n public stepTransitionMessage;\r\n\r\n public discardTitle = '';\r\n\r\n public hasQuoteDocumentPack = false;\r\n public hasPolicyDocumentPack = false;\r\n\r\n public policyVersionId;\r\n public isCorrection = false;\r\n\r\n public statusTypeId;\r\n public versionNo;\r\n public isTakeUp;\r\n public isEditTakeUpAction;\r\n\r\n private clientNavLabel;\r\n private formId;\r\n private formWizardRoute;\r\n public isUserForm = false;\r\n\r\n constructor(\r\n public claims: ClaimsService,\r\n public router: AppRouter,\r\n public toast: IaToastService,\r\n public http: HttpClient,\r\n public ea: EventAggregator,\r\n public hooks: AureliaHooks,\r\n public taskQueue: TaskQueue,\r\n public modal: ModalService\r\n ) {}\r\n\r\n async stepRendered() {\r\n }\r\n\r\n async bind() {\r\n // Allow current step validation check to be run via an action\r\n this.hooks.addAction('wizard:validateCurrentStep', this.currentStepValidation);\r\n this.hasQuoteDocumentPack = await this.claims.hasAsync(\r\n 'IadviserProcessingQuoteQuoteSearchContextMenuQuoteDocumentPack',\r\n );\r\n this.hasPolicyDocumentPack = await this.claims.hasAsync(\r\n 'IadviserProcessingPolicyPolicyMaintenanceContextMenuPolicyDocumentPack',\r\n );\r\n }\r\n\r\n unbind() {\r\n this.hooks.removeAction('wizard:validateCurrentStep', this.currentStepValidation);\r\n }\r\n\r\n async saveCallback(type: ConfirmModalActions) {\r\n this.stepTransitioning = false;\r\n\r\n if (type === 'donotsave') {\r\n if (this.entityId) {\r\n let endpoint;\r\n let uri;\r\n\r\n const method = 'DELETE';\r\n\r\n if (this.entityType === 'quote') {\r\n endpoint = environment.clientEndpoints.quotes.delete;\r\n uri = endpoint.uri([this.id, this.entityId]);\r\n } else if (this.entityType === 'incomplete') {\r\n endpoint = environment.clientEndpoints.wizard.delete;\r\n uri = endpoint.uri([this.id, this.actionType, this.entityType, this.entityId]);\r\n } else if (this.entityType === EntityType.Claim) {\r\n endpoint = environment.clientEndpoints.claims.delete;\r\n uri = endpoint.uri([this.id, this.entityId]);\r\n }\r\n\r\n const requestTypes = ['quote', 'incomplete', 'claim'];\r\n\r\n if (requestTypes.includes(this.entityType)) {\r\n await this.http.fetch(uri, {\r\n method: method,\r\n });\r\n }\r\n }\r\n\r\n sessionStorage.removeItem('is_draft_entity');\r\n\r\n if (this.entityType === 'quote') {\r\n this.router.navigateToRoute('clientQuotes', { id: this.id, quoteId: this.entityId });\r\n } else if (this.entityType === 'policy' || this.entityType === 'incomplete') {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n });\r\n } else if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n } else if (this.entityType === EntityType.Form) {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n }\r\n\r\n if (type === 'save') {\r\n let stepValid = false;\r\n\r\n // don't validate when user closes the wizard on the convert step\r\n if (this.currentStepIndex === 10) {\r\n stepValid = true;\r\n } else {\r\n stepValid = await this.currentStepValidation(false, null);\r\n }\r\n\r\n if (stepValid) {\r\n sessionStorage.removeItem('is_draft_entity');\r\n\r\n if (this.entityType === 'quote') {\r\n this.router.navigateToRoute('clientQuotes', { id: this.id, quoteId: this.entityId });\r\n } else if (this.entityType === 'policy' || this.entityType === 'incomplete') {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: parseInt(this.versionNo) + 1,\r\n });\r\n } else if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n } else if (this.entityType === EntityType.Form) {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n }\r\n }\r\n\r\n this.showSaveConfirmModal = false;\r\n }\r\n\r\n async stepTransitionPrompt(type: ConfirmModalActions) {\r\n this.toast.destroyAllToasts();\r\n this.stepTransitioning = false;\r\n\r\n if (type === 'confirm') {\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n\r\n if (viewModel) {\r\n if (this.stepClickedValue) {\r\n this.visitStep(this.stepClickedValue);\r\n } else {\r\n this.visitStep(this.currentStepIndex - 1);\r\n }\r\n }\r\n }\r\n\r\n this.showStepTransitionConfirmModal = false;\r\n }\r\n\r\n async closeConfirmCallback(type: ConfirmModalActions) {\r\n this.stepTransitioning = false;\r\n\r\n if (type === 'save') {\r\n let stepValid = false;\r\n\r\n // don't validate when user closes the wizard on the convert step\r\n if (this.currentStepIndex === 10) {\r\n stepValid = true;\r\n } else {\r\n stepValid = await this.currentStepValidation(false, null);\r\n }\r\n\r\n if (stepValid) {\r\n if (this.entityType === 'quote') {\r\n this.router.navigateToRoute('clientQuotes', { id: this.id, quoteId: this.entityId });\r\n } else if (this.entityType === 'policy' || this.entityType === 'incomplete') {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n });\r\n } else if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n } else if (this.entityType === EntityType.Form) {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n }\r\n }\r\n\r\n if (type === 'donotsave') {\r\n if (this.entityType === 'quote') {\r\n this.router.navigateToRoute('clientQuotes', { id: this.id, quoteId: this.entityId });\r\n } else if (this.entityType === 'policy' || this.entityType === 'incomplete') {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n });\r\n } else if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n } else if (this.entityType === EntityType.Form) {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n }\r\n\r\n this.showCloseConfirmModal = false;\r\n }\r\n\r\n incompleteRiskQuestionsCallback(type: ConfirmModalActions) {\r\n this.stepTransitioning = false;\r\n\r\n // reset hasRiskUpdated flag on viewModel\r\n if (type === 'cancel') {\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n }\r\n\r\n // allow navigation\r\n if (type === 'confirm') {\r\n if (typeof this.stepClickedValue !== 'undefined') {\r\n this.visitStep(this.stepClickedValue);\r\n } else {\r\n if (this.currentDirection === 'forward') {\r\n this.visitStep(this.currentStepIndex + 1);\r\n } else if (this.currentDirection === 'back') {\r\n this.visitStep(this.currentStepIndex - 1);\r\n }\r\n }\r\n }\r\n\r\n this.showRiskModal = false;\r\n }\r\n\r\n setActiveStep(stepIndex: number) {\r\n this.steps.forEach((step) => {\r\n step.active = step.step === stepIndex ? true : false;\r\n });\r\n }\r\n\r\n async canActivate(\r\n {\r\n id,\r\n parentEntityId,\r\n entityId,\r\n actionType,\r\n entityType,\r\n entityMode,\r\n step,\r\n statusTypeId,\r\n versionNo,\r\n newActionType,\r\n isTakeUp,\r\n isEditTakeUpAction,\r\n formId\r\n },\r\n route,\r\n ) {\r\n this.statusTypeId = statusTypeId;\r\n this.versionNo = versionNo;\r\n this.isTakeUp = isTakeUp;\r\n this.isEditTakeUpAction = isEditTakeUpAction;\r\n\r\n const entityTypeLabel = entityType.replace(/^\\w/, (c) => c.toUpperCase());\r\n route.settings.clientNavLabel = entityTypeLabel;\r\n\r\n if (isNaN(Number(step))) {\r\n step = 1;\r\n }\r\n\r\n if (entityType === 'quote') {\r\n this.discardTitle = 'New Quote';\r\n\r\n if (entityMode === 'view') {\r\n this.steps = QuoteStepMap.slice(0, 9);\r\n }\r\n\r\n if (entityMode === 'edit' || entityMode === 'new') {\r\n this.steps = QuoteStepMap;\r\n }\r\n }\r\n\r\n if (entityType === 'policy' || entityType === 'incomplete') {\r\n this.discardTitle = `New ${EntityActionTypeToActionTypeLabel(newActionType ? newActionType : actionType)}`;\r\n\r\n // prevent users from changing view policy route to edit\r\n if (entityType === 'policy' && !newActionType && entityMode === 'edit') {\r\n const hasCorrection = await this.claims.hasAsync(\r\n 'IadviserProcessingPolicyPolicyMaintenanceContextMenuCorrection',\r\n );\r\n const hasNewTakeup = await this.claims.hasAsync(\r\n 'IadviserProcessingQuoteNewTakeUp',\r\n );\r\n if (hasCorrection || (hasNewTakeup && this.isEditTakeUpAction === 'true')) {\r\n this.isCorrection = true;\r\n this.steps = QuoteStepMap.slice(0, 9);\r\n } else {\r\n entityMode = 'view';\r\n }\r\n }\r\n\r\n if (entityMode === 'view') {\r\n this.steps = QuoteStepMap.slice(0, 9);\r\n }\r\n\r\n // *** this block can be removed when all modules are complete - START\r\n // prevent users from changing view incomplete route to edit for action types not yet released\r\n const mappedActionTyped = mapActionTypeToEntityActionType(actionType);\r\n const nonViewActionTypes = [\r\n EntityActionType.Renewal,\r\n EntityActionType.Endorsement,\r\n EntityActionType.Reinstatement,\r\n EntityActionType.Cancellation,\r\n ];\r\n\r\n if (entityType === 'incomplete' && !nonViewActionTypes.includes(mappedActionTyped)) {\r\n entityMode = 'view';\r\n }\r\n // *** this block can be removed when all modules are complete - END\r\n }\r\n\r\n if (entityType === EntityType.Claim) {\r\n this.discardTitle = 'New Claim';\r\n this.steps = ClaimStepMap;\r\n }\r\n\r\n if (entityType === EntityType.Form) {\r\n this.formId = formId;\r\n this.formWizardRoute = route.name;\r\n this.steps = UserFormStepMap;\r\n this.isUserForm = route.name === 'userFormWizard';\r\n }\r\n\r\n // No step number provided or invalid step number provided, default to step 1\r\n if (!step || step === '1') {\r\n this.currentStepIndex = 1;\r\n this.currentStep = this.steps[this.currentStepIndex - 1];\r\n }\r\n\r\n this.id = id;\r\n this.policyId = parentEntityId;\r\n this.entityId = entityId;\r\n this.actionType = actionType;\r\n this.mappedActionType = mapActionTypeToEntityActionType(actionType, true);\r\n this.entityType = entityType;\r\n this.entityMode = entityMode;\r\n this.step = isNaN(Number(step)) ? '1' : step;\r\n this.newActionType = newActionType;\r\n\r\n const parsedNewActionType = parseInt(newActionType);\r\n\r\n // If we have no entityId, it's a new entity, so the other params except \"id\" are not required\r\n // If new action type is not undefined, it's a new type of something not quote related\r\n if (!isNaN(parsedNewActionType) || !entityId) {\r\n this.noPermission = false;\r\n\r\n sessionStorage.setItem('is_draft_entity', 'true');\r\n }\r\n\r\n let userHasViewPermission;\r\n let userHasEditPermission;\r\n\r\n if (this.entityType === EntityType.Quote) {\r\n userHasViewPermission = await this.claims.hasAsync('IadviserProcessingQuoteFindQuoteView');\r\n userHasEditPermission = await this.claims.hasAsync('IadviserProcessingQuoteFindQuoteEdit');\r\n } else if (this.entityType === EntityType.Incomplete || this.entityType === EntityType.Policy) {\r\n userHasViewPermission = await this.claims.hasAsync('IadviserProcessingPolicyFindPolicyView');\r\n userHasEditPermission = await this.claims.hasAsync('IadviserProcessingPolicyFindPolicyEdit');\r\n } else if (this.entityType === EntityType.Claim) {\r\n userHasViewPermission = await this.claims.hasAsync('IadviserProcessingClaimsFindClaimView');\r\n userHasEditPermission = await this.claims.hasAsync('IadviserProcessingClaimsFindClaimEdit');\r\n } else if (this.entityType === EntityType.Form) {\r\n userHasViewPermission = await this.claims.hasAsync('IadviserProcessingWebFormsQuoteView');\r\n userHasEditPermission = await this.claims.hasAsync('IadviserProcessingWebFormsQuoteEdit');\r\n }\r\n\r\n // User has one or more of these claims\r\n if ((isNaN(parsedNewActionType) && userHasViewPermission) || userHasEditPermission) {\r\n // User has permission, but what level? Let's find out\r\n this.noPermission = false;\r\n\r\n // User has edit and view permissions\r\n if (userHasViewPermission && userHasEditPermission) {\r\n // If entityMode is already set via the route as 'view' (user selects 'View Quote') set as 'view'; else 'edit'\r\n // this.entityMode = this.entityMode === EntityMode.View ? EntityMode.View : EntityMode.Edit;\r\n }\r\n // User has view permission only\r\n else if (this.entityMode === EntityMode.View && (userHasViewPermission || userHasEditPermission)) {\r\n this.entityMode = EntityMode.View;\r\n }\r\n // User has edit permission only\r\n else if (this.entityMode === EntityMode.Edit && userHasEditPermission) {\r\n this.entityMode = EntityMode.Edit;\r\n }\r\n }\r\n\r\n if (!userHasViewPermission && !userHasEditPermission) {\r\n this.entityMode = EntityMode.None;\r\n this.noPermission = true;\r\n } else {\r\n this.noPermission = false;\r\n\r\n if (!isNaN(parsedNewActionType)) {\r\n this.entityMode = EntityMode.New;\r\n }\r\n }\r\n\r\n if (!this.noPermission && step) {\r\n log.info('Step provided in URL, display step', step);\r\n this.visitStep(parseInt(step));\r\n }\r\n\r\n this.composeModel = {\r\n id: this.id,\r\n parentEntityId: this.policyId,\r\n entityId: this.entityId,\r\n step: this.step,\r\n entityMode: this.entityMode,\r\n actionType: this.actionType,\r\n entityType: this.entityType,\r\n newActionType: this.newActionType,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n isTakeUp: this.isTakeUp,\r\n isEditTakeUpAction: this.isEditTakeUpAction,\r\n formId: this.formId,\r\n };\r\n }\r\n\r\n async stepClicked(step, index: number) {\r\n this.stepTransitioning = true;\r\n this.forwardButtonDisabled = false;\r\n\r\n const direction = index + 1 > this.currentStepIndex ? 'forward' : 'back';\r\n\r\n this.hooks.doAction('wizard:stepClicked', direction, this);\r\n\r\n this.stepClickedValue = step.step;\r\n\r\n const currentStepIsValid = await this.currentStepValidation(true, direction);\r\n\r\n if (currentStepIsValid) {\r\n this.visitStep(step.step);\r\n } else {\r\n this.stepTransitioning = false;\r\n }\r\n }\r\n\r\n async visitStep(step: number) {\r\n if (!this.entityId) {\r\n this.updateCurrentStep(step, 'any');\r\n return;\r\n }\r\n\r\n this.stepClickedValue = undefined;\r\n\r\n try {\r\n this.updateCurrentStep(step, 'any');\r\n\r\n if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute(\r\n 'claimWizard',\r\n {\r\n id: this.id,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType ?? EntityType.Claim,\r\n step: step,\r\n policyVersionId: this.policyVersionId,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else if (this.entityType === EntityType.Form) {\r\n this.router.navigateToRoute(\r\n this.formWizardRoute,\r\n {\r\n id: this.id,\r\n formId: this.formId,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType ?? EntityType.Form,\r\n actionType: this.actionType,\r\n step: step,\r\n isEditTakeUpAction: false\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else {\r\n this.router.navigateToRoute(\r\n 'wizard',\r\n {\r\n id: this.id,\r\n parentEntityId: this.policyId,\r\n entityId: this.entityId,\r\n entityMode: this.entityMode,\r\n actionType: this.actionType,\r\n entityType: this.entityType,\r\n newActionType: this.newActionType,\r\n step: step,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n isTakeUp: this.isTakeUp,\r\n isEditTakeUpAction: this.isEditTakeUpAction,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n }\r\n\r\n setTimeout(() => this.stepRendered(), 500);\r\n } catch (error) {\r\n this.handleError(error);\r\n }\r\n }\r\n\r\n async currentStepValidation(redirectAfterCreation = true, direction) {\r\n if (this.viewModelRef?.currentViewModel) {\r\n this.currentDirection = direction;\r\n\r\n if (await this.hooks.applyFilter('showRiskQuestionModal', false)) {\r\n this.showRiskModal = true;\r\n return false;\r\n }\r\n\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n\r\n // step unchanged - allow navigating back without validating\r\n if (!viewModel?.isDirty && this.currentDirection === 'back') {\r\n return true;\r\n }\r\n\r\n if (viewModel) {\r\n /* istanbul ignore next */\r\n if (viewModel.quoteOrPolicyVersionId) {\r\n this.entityId = viewModel.quoteOrPolicyVersionId;\r\n }\r\n\r\n // validate step\r\n const result = await viewModel.validate(redirectAfterCreation);\r\n\r\n // step changed and invalid\r\n if (!result && this.currentDirection === 'back') {\r\n // show \"This step must be completed in order to save\" modal\r\n this.showStepTransitionConfirmModal = true;\r\n }\r\n\r\n return result;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /* istanbul ignore next */\r\n async continue() {\r\n this.stepClickedValue = undefined;\r\n this.stepTransitioning = true;\r\n\r\n const currentStepValid = await this.currentStepValidation(true, 'forward');\r\n\r\n if (currentStepValid) {\r\n this.nextStep();\r\n } else {\r\n this.stepTransitioning = false;\r\n }\r\n }\r\n\r\n /* istanbul ignore next */\r\n async back() {\r\n this.stepClickedValue = undefined;\r\n this.stepTransitioning = true;\r\n\r\n const currentStepValid = await this.currentStepValidation(true, 'back');\r\n\r\n if (currentStepValid) {\r\n this.previousStep();\r\n } else {\r\n this.stepTransitioning = false;\r\n }\r\n }\r\n\r\n closeButtonCallback() {\r\n // If it's a draft quote/new quote and there are changes\r\n if (this.composeModel.entityMode === EntityMode.New || sessionStorage.getItem('is_draft_entity') !== null) {\r\n this.showSaveConfirmModal = true;\r\n } else {\r\n // The current step has changes, show confirm modal\r\n if (this.viewModelRef?.currentViewModel?.isDirty) {\r\n this.showCloseConfirmModal = true;\r\n } else {\r\n if (this.entityType === 'quote') {\r\n this.router.navigateToRoute('clientQuotes', { id: this.id, quoteId: this.entityId });\r\n } else if (this.entityType === 'policy' || this.entityType === 'incomplete') {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n });\r\n } else if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n } else if (this.entityType === EntityType.Form) {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n }\r\n }\r\n }\r\n\r\n /* istanbul ignore next */\r\n async handleError(error: Error) {\r\n captureException(error);\r\n log.error('Entity Wizard Error =>', error);\r\n }\r\n\r\n updateCurrentStep(step, direction) {\r\n if (step !== undefined && step !== null) {\r\n this.currentStepIndex = step;\r\n }\r\n\r\n if (direction === 'previous' && this.currentStepIndex > 1) {\r\n this.currentStepIndex--;\r\n }\r\n\r\n this.currentStep = this.steps[this.currentStepIndex - 1];\r\n\r\n this.setActiveStep(this.currentStepIndex);\r\n\r\n if (this.currentStepIndex === 1) {\r\n this.backButtonDisabled = true;\r\n } else {\r\n this.backButtonDisabled = false;\r\n }\r\n\r\n this.ea.subscribe('stepRendered', (message = 'Loading...') => {\r\n this.taskQueue.queueMicroTask(() => {\r\n this.stepTransitioning = false;\r\n this.stepTransitionMessage = message;\r\n });\r\n });\r\n }\r\n\r\n async nextStep() {\r\n this.hooks.doAction('wizard:nextStep');\r\n\r\n try {\r\n const hasNextStep = Object.keys(this.steps).length < Object.keys(this.steps).length + 1;\r\n\r\n if (hasNextStep) {\r\n this.currentStepIndex++;\r\n\r\n this.updateCurrentStep(null, 'next');\r\n\r\n if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute(\r\n 'claimWizard',\r\n {\r\n id: this.id,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType ?? EntityType.Claim,\r\n policyVersionId: this.policyVersionId,\r\n step: this.currentStepIndex,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else if (this.entityType === EntityType.Form) {\r\n this.router.navigateToRoute(\r\n this.formWizardRoute,\r\n {\r\n id: this.id,\r\n formId: this.formId,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType ?? EntityType.Form,\r\n actionType: this.actionType,\r\n step: this.currentStepIndex,\r\n isEditTakeUpAction: false\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else {\r\n this.router.navigateToRoute(\r\n 'wizard',\r\n {\r\n id: this.id,\r\n parentEntityId: this.policyId,\r\n entityId: this.entityId,\r\n entityMode: this.entityMode,\r\n actionType: this.actionType,\r\n entityType: this.entityType,\r\n step: this.currentStepIndex,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n isTakeUp: this.isTakeUp,\r\n isEditTakeUpAction: this.isEditTakeUpAction,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n }\r\n }\r\n\r\n setTimeout(() => this.stepRendered(), 500);\r\n } catch (error) {\r\n this.handleError(error);\r\n }\r\n }\r\n\r\n async previousStep() {\r\n this.hooks.doAction('wizard:previousStep');\r\n\r\n try {\r\n this.updateCurrentStep(null, 'previous');\r\n\r\n if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute(\r\n 'claimWizard',\r\n {\r\n id: this.id,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType ?? EntityType.Claim,\r\n policyVersionId: this.policyVersionId,\r\n step: this.currentStepIndex,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else if (this.entityType === EntityType.Form) {\r\n this.router.navigateToRoute(\r\n this.formWizardRoute,\r\n {\r\n id: this.id,\r\n formId: this.formId,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType ?? EntityType.Form,\r\n actionType: this.actionType,\r\n step: this.currentStepIndex,\r\n isEditTakeUpAction: false\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else {\r\n this.router.navigateToRoute(\r\n 'wizard',\r\n {\r\n id: this.id,\r\n parentEntityId: this.policyId,\r\n entityId: this.entityId,\r\n entityMode: this.entityMode,\r\n actionType: this.actionType,\r\n entityType: this.entityType,\r\n step: this.currentStepIndex,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n isTakeUp: this.isTakeUp,\r\n isEditTakeUpAction: this.isEditTakeUpAction,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n }\r\n\r\n setTimeout(() => this.stepRendered(), 500);\r\n\r\n this.forwardButtonDisabled = false;\r\n } catch (error) {\r\n this.handleError(error);\r\n }\r\n }\r\n\r\n // Special case for claims, forms && policy correction\r\n async finish() {\r\n if (this.entityType === EntityType.Claim && this.currentStepIndex === 8) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n }\r\n if (this.entityType === EntityType.Form && this.currentStepIndex === 5) {\r\n if(this.isUserForm) {\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n if (viewModel && await this.claims.hasAsync('IadviserProcessingWebFormsQuoteSubmit')) {\r\n const result = await this.viewModelRef.currentViewModel.submitForm();\r\n if(result) {\r\n this.router.navigateToRoute('userFormHomeComplete');\r\n }\r\n }\r\n }else {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n }\r\n if (this.isCorrection) {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n });\r\n }\r\n }\r\n\r\n async bindQuote() {\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n\r\n if (viewModel) {\r\n await this.viewModelRef.currentViewModel.bindQuote();\r\n }\r\n }\r\n\r\n // Open request quote modal\r\n async requestQuote() {\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n\r\n if (viewModel) {\r\n await this.viewModelRef.currentViewModel.requestQuote();\r\n }\r\n }\r\n\r\n // Open cancel quote request modal\r\n async cancelQuoteRequest() {\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n\r\n if (viewModel) {\r\n await this.viewModelRef.currentViewModel.cancelQuoteRequest();\r\n }\r\n }\r\n\r\n async loadDocumentPack() {\r\n this.modal\r\n .show()\r\n .content(DocumentPack, {\r\n clientId: this.id,\r\n quoteOrPolicyVersionOrClaimId: this.entityId,\r\n policyType: this.entityType,\r\n actionType: this.actionType,\r\n })\r\n .withOptions({ type: 'wide-lg' });\r\n }\r\n\r\n @computedFrom('stepTransitioning')\r\n get wizardStepsDisabled() {\r\n return this.stepTransitioning;\r\n }\r\n}\r\n"],"names":["module","exports","cb","require","claims","router","toast","http","ea","hooks","taskQueue","modal","styles","forwardButtonDisabled","noPermission","entityMode","showSaveConfirmModal","showCloseConfirmModal","showStepTransitionConfirmModal","showRiskModal","steps","currentStepIndex","backButtonDisabled","stepTransitioning","discardTitle","hasQuoteDocumentPack","hasPolicyDocumentPack","isCorrection","isUserForm","stepRendered","bind","this","addAction","currentStepValidation","hasAsync","unbind","removeAction","saveCallback","type","entityId","endpoint","uri","entityType","id","actionType","includes","fetch","method","sessionStorage","removeItem","navigateToRoute","quoteId","policyId","policyVersionId","statusTypeId","versionNo","claimId","formId","stepValid","parseInt","stepTransitionPrompt","destroyAllToasts","viewModelRef","currentViewModel","stepClickedValue","visitStep","closeConfirmCallback","incompleteRiskQuestionsCallback","currentDirection","setActiveStep","stepIndex","forEach","step","active","canActivate","route","parentEntityId","newActionType","isTakeUp","isEditTakeUpAction","entityTypeLabel","replace","c","toUpperCase","settings","clientNavLabel","isNaN","Number","hasCorrection","hasNewTakeup","mappedActionTyped","nonViewActionTypes","formWizardRoute","name","currentStep","mappedActionType","parsedNewActionType","setItem","userHasViewPermission","userHasEditPermission","composeModel","stepClicked","index","direction","doAction","updateCurrentStep","undefined","trigger","setTimeout","error","handleError","redirectAfterCreation","applyFilter","viewModel","isDirty","quoteOrPolicyVersionId","validate","result","continue","nextStep","back","previousStep","closeButtonCallback","getItem","subscribe","message","queueMicroTask","stepTransitionMessage","Object","keys","length","finish","submitForm","bindQuote","requestQuote","cancelQuoteRequest","loadDocumentPack","show","content","clientId","quoteOrPolicyVersionOrClaimId","policyType","withOptions","computedFrom","autoinject","EventAggregator","TaskQueue","Wizard"],"sourceRoot":""}