{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../node_modules/moment/locale sync ^\\.\\/.*$","webpack:///./utils/moments/ranges.js","webpack:///./utils/getSeasonsByEffectiveRanges.js","webpack:///./utils/hasHadState.js","webpack:///./constants.js","webpack:///./layout/headers/main-header/index.js","webpack:///./services/globs/reporting/compliance/index.ts","webpack:///./layout/headers/main-header/index.html","webpack:///./services/hotkeyConfig.js","webpack:///./routes.js","webpack:///./services/globs/reporting/types/states/index.ts","webpack:///./services/globs/reporting/types/index.ts","webpack:///./services/globs/types/aliases/index.ts","webpack:///./services/globs/types/inventory/operations/index.ts","webpack:///./services/globs/types/inventory/index.ts","webpack:///./services/globs/types/products/index.ts","webpack:///./services/globs/types/geometries/index.ts","webpack:///./services/globs/types/tokens/index.ts","webpack:///./services/globs/types/identifiers/index.ts","webpack:///./services/globs/types/classifications/index.ts","webpack:///./services/globs/types/effective/index.ts","webpack:///./services/globs/types/contacts/index.ts","webpack:///./services/globs/types/related/index.ts","webpack:///./services/globs/businesses/fees/index.ts","webpack:///./services/globs/businesses/products/index.ts","webpack:///./services/globs/businesses/index.ts","webpack:///./services/globs/types/index.ts","webpack:///./services/globs/index.ts","webpack:///./services/globs/reporting/index.ts","webpack:///./services/globs/reports/index.ts","webpack:///./services/globs/reports/fields/index.ts","webpack:///./services/globs/feedback/index.ts","webpack:///./services/globs/exports/index.ts","webpack:///./services/globs/subjects/index.ts","webpack:///./services/globs/tokens/index.ts","webpack:///./services/security/glob.ts","webpack:///./services/security/actionScopes.ts","webpack:///./services/security/commonScopes.ts","webpack:///./layout/main-nav.js","webpack:///./layout/index.js","webpack:///./layout/main-nav.html","webpack:///./config/interceptors/etagInterceptor.js","webpack:///./config/interceptors/statusInterceptor.js","webpack:///./config/interceptors/mocks/all-forms-are-jamesified.js","webpack:///./config/interceptors/mocks/draft-reports.js","webpack:///./config/interceptors/mocks/item-deactivated-at.js","webpack:///./config/interceptors/mocks/msdmr-add-entity-filter-rule.js","webpack:///./config/interceptors/mocks/grace-period-entity.js","webpack:///./config/interceptors/mocks/rule-validations/findValidFieldId.js","webpack:///./config/interceptors/mocks/rule-validations/add-unknown-engine.js","webpack:///./config/interceptors/mocks/rule-validations/add-no-engine.js","webpack:///./config/interceptors/mocks/rule-validations/add-no-conditions.js","webpack:///./config/interceptors/mocks/rule-validations/add-unknown-trigger.js","webpack:///./config/interceptors/mocks/rule-validations/add-unknown-field-id.js","webpack:///./config/interceptors/mocks/rule-validations/add-invalid-children.js","webpack:///./config/interceptors/mocks/rule-validations/add-children-with-engine.js","webpack:///./config/interceptors/mocks/rule-validations/add-online-engine.js","webpack:///./config/interceptors/mocks/rule-validations/add-readonly-trigger.js","webpack:///./config/interceptors/mocks/fake-number-response.js","webpack:///./config/interceptors/mocks/add-random-entity-permission.js","webpack:///./config/interceptors/mocks/add-proxy-datetime.js","webpack:///./config/interceptors/mocks/add-translations.js","webpack:///./config/interceptors/mocks/add-entity-translations.js","webpack:///./config/interceptors/mocks/add-proxy-file-uploader.js","webpack:///./config/interceptors/mocks/security-blob-mutations/deny-all-feedback.js","webpack:///./config/interceptors/mocks/security-blob-mutations/deny-show-markdown.js","webpack:///./config/interceptors/mocks/security-blob-mutations/deny-vesl-feedback.js","webpack:///./config/interceptors/mocks/security-blob-mutations/deny-agency-feedback.js","webpack:///./config/interceptors/mocks/security-blob-mutations/deny-show-agency-phonenumber.js","webpack:///./config/interceptors/mocks/security-blob-mutations/deny-show-agency-email.js","webpack:///./config/interceptors/mocks/security-blob-mutations/deny-show-vesl-phonenumber.js","webpack:///./config/interceptors/mocks/security-blob-mutations/deny-show-vesl-email.js","webpack:///./config/interceptors/mocks/security-blob-mutations/deny-all-compliance.js","webpack:///./config/interceptors/mocks/security-blob-mutations/change-exports.js","webpack:///./config/interceptors/mocks/security-blob-mutations/deny-inventory-operation.js","webpack:///./config/interceptors/mocks/security-blob-mutations/allow-token-management.js","webpack:///./config/interceptors/mocks/security-blob-mutations/security-exception.js","webpack:///./config/interceptors/mocks/security-blob-mutations/allow-alias-management.js","webpack:///./config/interceptors/mocks/security-blob-mutations/allow-business-management.js","webpack:///./config/interceptors/mocks/security-blob-mutations/allow-product-management.js","webpack:///./config/interceptors/mocks/security-blob-mutations/allow-inventory-management.js","webpack:///./config/interceptors/mocks/security-blob-mutations/allow-geometry-management.js","webpack:///./config/interceptors/mocks/security-blob-mutations/entity-security-allow-all.js","webpack:///./config/interceptors/mocks/security-blob-mutations/entity-security-deny-all.js","webpack:///./config/interceptors/mocks/form-properties/add-stale-timeout.js","webpack:///./config/interceptors/mocks/form-properties/add-invalid-timeout.js","webpack:///./config/interceptors/mocks/force-match-entities.js","webpack:///./config/interceptors/mocks/modify-agency-types.ts","webpack:///./config/interceptors/mocks/modify-forms-agency-types.ts","webpack:///./config/interceptors/mocks/fake-get-businesses.ts","webpack:///./config/interceptors/mocks/fake-get-business-charges.ts","webpack:///./config/interceptors/mocks/fake-get-business-products.ts","webpack:///./config/interceptors/mocks/add-depredation-fields.ts","webpack:///./config/interceptors/mockDataInterceptor.js","webpack:///./config/interceptors/shims/declaredStatus.js","webpack:///./config/interceptors/shims/effectiveRange.js","webpack:///./config/interceptors/shims/cleanChildRuleIdsAndCodes.ts","webpack:///./config/interceptors/shimmer.js","webpack:///./config/route.js","webpack:///./config/index.js","webpack:///./services/console-shim.js","webpack:///./config/tooltip-provider.js","webpack:///./config/datepicker-provider.js","webpack:///./config/datepicker-popup-config.js","webpack:///./config/http.js","webpack:///./layout/unauthenticated-wrapper.html","webpack:///./layout/authenticated-wrapper.html","webpack:///./config/route-transitions.js","webpack:///./config/toastr-config.js","webpack:///./behaviors/auto-focus.js","webpack:///./behaviors/aria-from-attr.js","webpack:///./behaviors/btn-ripple.js","webpack:///./behaviors/compare-to.js","webpack:///./behaviors/date-time-input.js","webpack:///./behaviors/html-viewer.js","webpack:///./behaviors/input-ripple.js","webpack:///./behaviors/ui-mask.js","webpack:///./behaviors/on-trigger.js","webpack:///./utils/accessibility/createDescriptionTextNode.js","webpack:///./behaviors/select-box.js","webpack:///./utils/selectors/tabbable-elements.js","webpack:///./behaviors/select-on-focus.js","webpack:///./behaviors/programmatic-submit.js","webpack:///./behaviors/trap-focus.js","webpack:///./behaviors/vesl-no-unicode.js","webpack:///./behaviors/window-resize.js","webpack:///./behaviors/uib-modal-window.js","webpack:///./behaviors/uib-tooltip.js","webpack:///./behaviors/on-escape.js","webpack:///./behaviors/prevent-scroll.js","webpack:///./behaviors/authorize/authorize.js","webpack:///./behaviors/authorize/authorize-attribute.js","webpack:///./behaviors/authorize/authorize-component.js","webpack:///./services/i18nService.ts","webpack:///./behaviors/i18n.js","webpack:///./behaviors/index.js","webpack:///./components/entities/entity-contacts/entity-contacts.js","webpack:///./components/entities/entity-contacts/entity-contacts.html","webpack:///./components/entities/entity-contact/entity-contact.js","webpack:///./components/entities/entity-contact/entity-contact.html","webpack:///./components/entities/entity-business/entity-business.js","webpack:///./components/entities/entity-business/entity-business.html","webpack:///./services/string-service.js","webpack:///./components/entities/entity-business/entity-business-modal/entity-business-modal.js","webpack:///./components/entities/entity-business/entity-business-modal/entity-business-modal.html","webpack:///./components/entities/entity-business/entity-business-profile/entity-business-profile.js","webpack:///./components/entities/entity-business/entity-business-profile/entity-business-profile.html","webpack:///./components/entities/entity-business/entity-business-charges/entity-business-charges.js","webpack:///./components/entities/entity-business/entity-business-charges/entity-business-charges.html","webpack:///./components/entities/entity-business/entity-business-charges/entity-business-charge-modal/entity-business-charge-modal.js","webpack:///./components/entities/entity-business/entity-business-charges/entity-business-charge-modal/entity-business-charge-modal.html","webpack:///./components/entities/entity-business/entity-business-products/entity-business-products.js","webpack:///./components/entities/entity-business/entity-business-products/entity-business-products.html","webpack:///./components/entities/entity-business/entity-business-products/entity-business-product-modal/entity-business-product-modal.js","webpack:///./components/entities/entity-business/entity-business-products/entity-business-product-modal/entity-business-product-modal.html","webpack:///./components/entities/entity-contact/entity-contact-modal/entity-contact-modal.js","webpack:///./components/entities/entity-contact/entity-contact-modal/entity-contact-modal.html","webpack:///./components/entities/isSupportedOrNullish.ts","webpack:///./components/entities/getAllowedClassifications.ts","webpack:///./components/entities/entity-form/entity-form.js","webpack:///./components/entities/entity-form/entity-form.html","webpack:///./components/entities/name-or-contact/name-or-contact.js","webpack:///./components/entities/name-or-contact/name-or-contact.html","webpack:///./components/entities/entity-modal/entity-modal.js","webpack:///./components/entities/entity-modal/entity-modal.html","webpack:///./components/entities/entity-assoc/entity-assoc.js","webpack:///./components/entities/entity-assoc/entity-assoc.html","webpack:///./components/entities/entity-assoc/entity-header-modal/entity-header-modal.js","webpack:///./components/entities/entity-assoc/entity-header-modal/entity-header-modal.html","webpack:///./components/entities/entity-users/entity-users.js","webpack:///./components/entities/entity-users/entity-users.html","webpack:///./components/entities/getAllowedIdentifiers.ts","webpack:///./components/entities/entity-identifiers/entity-identifiers.js","webpack:///./components/entities/entity-identifiers/entity-identifiers.html","webpack:///./components/entities/entity-tokens/entity-tokens.js","webpack:///./components/entities/entity-tokens/entity-tokens.html","webpack:///./components/entities/entity-inventory/entity-inventory-operations/entity-inventory-operations.js","webpack:///./components/entities/entity-inventory/entity-inventory-operations/entity-inventory-operations.html","webpack:///./components/entities/entity-inventory/entity-inventory.js","webpack:///./components/entities/entity-inventory/entity-inventory.html","webpack:///./components/entities/entity-classifications/entity-classifications.js","webpack:///./components/entities/entity-classifications/entity-classifications.html","webpack:///./components/entities/entity-effective-ranges/entity-effective-ranges.js","webpack:///./components/entities/entity-effective-ranges/entity-effective-ranges.html","webpack:///./components/entities/entity-identifiers/edit-identifier/edit-identifier.js","webpack:///./components/entities/entity-identifiers/edit-identifier/edit-identifier.html","webpack:///./components/entities/entity-classifications/edit-classification/edit-classification.js","webpack:///./components/entities/entity-classifications/edit-classification/edit-classification.html","webpack:///./components/entities/entity-effective-ranges/edit-effective-range/edit-effective-range.js","webpack:///./components/entities/entity-effective-ranges/edit-effective-range/edit-effective-range.html","webpack:///./components/entities/entity-reporting/entity-reporting.js","webpack:///./components/entities/entity-reporting/entity-reporting.html","webpack:///./components/entities/entity-reporting/edit-report-number/edit-report-number.js","webpack:///./components/entities/index.js","webpack:///./components/entities/entity-reporting/edit-report-number/edit-report-number.html","webpack:///./components/environment-notifier/online-notifier.js","webpack:///./components/environment-notifier/index.js","webpack:///./components/environment-notifier/api-updated-notifier.js","webpack:///./components/change-password-modal/change-password-modal.js","webpack:///./components/change-password-modal/change-password-modal.html","webpack:///./components/choices-select/choices-select.js","webpack:///./components/choices-select/choices-select.html","webpack:///./components/effective-range-actions/effective-range-actions.js","webpack:///./components/effective-range-actions/effective-range-actions.html","webpack:///./components/form-selector/form-selector.js","webpack:///./components/form-selector/form-selector.html","webpack:///./components/form-selector/form-selector-modal/form-selector-modal.js","webpack:///./components/form-selector/form-selector-modal/form-selector-modal.html","webpack:///./components/loading-tracker/index.js","webpack:///./components/loading-tracker/index.html","webpack:///./images/edge-logo.svg","webpack:///./images/firefox-logo.svg","webpack:///./images/chrome-logo.svg","webpack:///./components/ie-overlay/ie-overlay.js","webpack:///./components/ie-overlay/ie-overlay.html","webpack:///./components/message-notifications/message-notifications.js","webpack:///./components/message-notifications/message-notifications.html","webpack:///./components/message-notification/message-notification.js","webpack:///./components/message-notification/message-notification.html","webpack:///./components/message-list-item/message-list-item.js","webpack:///./components/message-list-item/message-list-item.html","webpack:///./components/message-bubble/message-bubble.js","webpack:///./components/message-bubble/message-bubble.html","webpack:///./utils/effectiveRanges/effectiveRangeStatus.js","webpack:///./components/reporting-entity-selector/reporting-entity-selector.js","webpack:///./components/reporting-entity-selector/reporting-entity-selector.html","webpack:///./services/polyfills.js","webpack:///./services/geo-service.js","webpack:///./utils/entities/findEntityRecursively.js","webpack:///./components/report-details/report-details.js","webpack:///./components/report-details/report-details.html","webpack:///./screens/rule-provider/constants.js","webpack:///./components/report-details/report-details-modal/report-details-modal.js","webpack:///./components/report-details/report-details-modal/report-details-modal.html","webpack:///./components/report-actions/report-actions.js","webpack:///./components/report-actions/report-actions.html","webpack:///./components/inventory-actions/confirmActionPrompt.js","webpack:///./components/inventory-actions/inventory-actions.js","webpack:///./components/inventory-actions/inventory-actions.html","webpack:///./components/inventory-actions/quantity-modal/quantity-modal.js","webpack:///./components/inventory-actions/quantity-modal/quantity-modal.html","webpack:///./components/report-form/report-field.config.js","webpack:///./components/report-form/field-types/boolAndCheckbox/boolAndCheckbox.js","webpack:///./components/report-form/field-types/boolAndCheckbox/bool.html","webpack:///./components/report-form/field-types/boolAndCheckbox/checkbox.html","webpack:///./components/report-form/field-types/date-time/date-time.js","webpack:///./components/report-form/field-types/date-time/date-time.html","webpack:///./components/report-form/field-types/date/date.js","webpack:///./components/report-form/field-types/date/date.html","webpack:///./components/report-form/field-types/number/number.js","webpack:///./components/report-form/field-types/number/number.html","webpack:///./screens/edit-report/prompts/confirmUnsavedChangesWillBeLost.js","webpack:///./screens/edit-report/prompts/confirmWithdrawReport.js","webpack:///./screens/edit-report/prompts/confirmDirtySubmission.js","webpack:///./screens/edit-report/prompts/confirmRuleWarningsOnReport.js","webpack:///./screens/edit-report/prompts/notifyTimezoneDiscrepancy.js","webpack:///./screens/edit-report/prompts/notifyTimezoneError.js","webpack:///./screens/edit-report/prompts/alertDeactivatedSelection.js","webpack:///./screens/edit-report/prompts/showNotConnectedOnRefreshError.js","webpack:///./components/field-helpers/lookup.config.js","webpack:///./services/entity-manager.js","webpack:///./components/report-form/field-types/selection/selection.js","webpack:///./components/report-form/field-types/selection/selection.html","webpack:///./components/report-form/field-types/simple-selection/simple-selection.js","webpack:///./components/report-form/field-types/simple-selection/simple-selection.html","webpack:///./components/report-form/field-types/pre-select/pre-select.js","webpack:///./components/report-form/field-types/pre-select/pre-select.html","webpack:///./components/report-form/field-types/entity-contact-selector/entity-contact-selector.js","webpack:///./components/report-form/field-types/entity-contact-selector/entity-contact-selector.html","webpack:///./components/report-form/field-types/multi-select/multi-select.js","webpack:///./components/report-form/field-types/multi-select/multi-select.html","webpack:///./components/report-form/field-types/text/text.js","webpack:///./components/report-form/field-types/text/text.html","webpack:///./components/report-form/field-types/text-area/textarea.js","webpack:///./components/report-form/field-types/text-area/textarea.html","webpack:///./components/report-form/field-types/degree-minute/degree-minute.js","webpack:///./components/report-form/field-types/degree-minute/degree-minute.html","webpack:///./components/report-form/field-types/coordinate/modes/dms.js","webpack:///./components/report-form/field-types/coordinate/modes/dms.html","webpack:///./services/math-service.js","webpack:///./components/report-form/field-types/coordinate/modes/decimal-degrees.js","webpack:///./components/report-form/field-types/coordinate/modes/decimal-degrees.html","webpack:///./components/report-form/field-types/coordinate/coordinate.js","webpack:///./components/report-form/field-types/coordinate/coordinate.html","webpack:///./components/report-form/field-types/year-month/year-month.js","webpack:///./components/report-form/field-types/year-month/year-month.html","webpack:///./components/report-form/field-sub-components/degree-minute-field/degree-minute-field.js","webpack:///./components/report-form/field-sub-components/degree-minute-field/degree-minute-field.html","webpack:///./components/report-form/field-sub-components/number-field/number-field.js","webpack:///./components/report-form/report-field.js","webpack:///./components/report-form/field-sub-components/number-field/number-field.html","webpack:///./components/report-form/report-form.js","webpack:///./components/report-form/report-form.html","webpack:///./components/report-status/index.js","webpack:///./components/report-status/index.html","webpack:///./screens/exports/constants.ts","webpack:///./components/export-status/index.js","webpack:///./components/export-status/index.html","webpack:///./components/pagination/index.js","webpack:///./components/pagination/index.html","webpack:///./components/user/user-profile/index.js","webpack:///./components/user/user-profile/index.html","webpack:///./components/user/user-entities/user-entities.js","webpack:///./components/user/user-entities/user-entities.html","webpack:///./components/user/user-form/user-form.js","webpack:///./components/user/user-form/user-form.html","webpack:///./components/user/user-modal/user-modal.js","webpack:///./components/user/user-modal/user-modal.html","webpack:///./components/user/user-requests/user-requests.js","webpack:///./components/user/user-requests/user-requests.html","webpack:///./components/user/user-entities/user-entity-association/user-entity-association.js","webpack:///./components/user/user-entities/user-entity-association/user-entity-association.html","webpack:///./components/support-info/index.js","webpack:///./components/support-info/index.html","webpack:///./components/notices/flyout/index.js","webpack:///./components/notices/flyout/index.html","webpack:///./components/notices/banner/index.js","webpack:///./components/notices/banner/index.html","webpack:///./components/tiered-select/tiered-select.js","webpack:///./components/tiered-select/tiered-select.html","webpack:///./components/validation-callout/validation-callout.js","webpack:///./components/validation-callout/validation-callout.html","webpack:///./components/compliance-period-message.js","webpack:///./components/field-helpers/area-selector/modal.js","webpack:///./components/field-helpers/area-selector/modal.html","webpack:///./components/field-helpers/area-selector/index.js","webpack:///./components/field-helpers/location-selector/CustomPopup.js","webpack:///./components/field-helpers/location-selector/modal.js","webpack:///./components/field-helpers/location-selector/modal.html","webpack:///./components/field-helpers/location-selector/index.js","webpack:///./components/field-helpers/not-available/index.js","webpack:///./components/field-helpers/advanced-search/modal.js","webpack:///./components/field-helpers/advanced-search/modal.html","webpack:///./components/field-helpers/advanced-search/index.js","webpack:///./components/field-helpers/custom-input/index.js","webpack:///./components/field-helpers/selection-lookup.js","webpack:///./components/require-role.js","webpack:///./components/date-range-selector/date-range-selector.js","webpack:///./components/date-range-selector/date-range-selector.html","webpack:///./components/export-configuration-selector/export-configuration-selector.js","webpack:///./components/export-configuration-selector/export-configuration-selector.html","webpack:///./components/date-time-picker/date-time-picker.js","webpack:///./components/date-time-picker/template.html","webpack:///./components/action-info-block/index.js","webpack:///./components/action-info-block/index.html","webpack:///./components/modals/terms-modal/index.js","webpack:///./components/modals/terms-modal/index.html","webpack:///./components/modals/accessibility-modal/accessibility-modal.js","webpack:///./components/modals/accessibility-modal/accessibility-modal.html","webpack:///./components/modals/settings-modal/settings-modal.js","webpack:///./components/modals/settings-modal/settings-modal.html","webpack:///./components/modals/support-feedback-modal/index.js","webpack:///./components/modals/support-feedback-modal/index.html","webpack:///./components/modals/remote-support-modal/index.js","webpack:///./components/modals/remote-support-modal/index.html","webpack:///./components/modals/privacy-policy-modal/index.js","webpack:///./components/modals/privacy-policy-modal/index.html","webpack:///./components/modals/account-deletion-modal/index.js","webpack:///./components/modals/account-deletion-modal/index.html","webpack:///./utils/effectiveRanges/entityEffectiveStatus.js","webpack:///./utils/effectiveRanges/comparePeriodStartDateAscending.js","webpack:///./components/modals/primary-selector-modal/primary-selector.js","webpack:///./components/modals/primary-selector-modal/primary-selector.html","webpack:///./components/modals/build-information-modal/index.js","webpack:///./components/modals/build-information-modal/index.html","webpack:///./components/modals/card-swipe-modal/card-swipe-modal.js","webpack:///./utils/effectiveRanges/nestedEntityEffectiveRangeStatus.js","webpack:///./components/modals/card-swipe-modal/card-swipe-modal.html","webpack:///./components/modals/proxy-modal/add-ons/datetime.js","webpack:///./components/modals/proxy-modal/add-ons/templates/datetime/wrapper.html","webpack:///./components/modals/proxy-modal/add-ons/templates/datetime/dateOnlyWrapper.html","webpack:///./components/modals/proxy-modal/add-ons/templates/datetime/datetime-add-on.js","webpack:///./components/modals/proxy-modal/add-ons/templates/base-64-upload/controller.js","webpack:///./components/modals/proxy-modal/add-ons/templates/base-64-upload/provider.js","webpack:///./components/modals/proxy-modal/add-ons/base-64-upload.js","webpack:///./components/modals/proxy-modal/add-ons/templates/base-64-upload/template.html","webpack:///./components/modals/proxy-modal/add-ons/templates/base-64-upload/base-64-config.js","webpack:///./components/modals/proxy-modal/add-ons/templates/entity/controller.js","webpack:///./components/modals/proxy-modal/add-ons/templates/entity/wrapper.html","webpack:///./components/modals/proxy-modal/add-ons/entity.js","webpack:///./components/modals/proxy-modal/add-ons/templates/entity/template.html","webpack:///./components/modals/proxy-modal/add-ons/templates/entity/entity-add-on.js","webpack:///./components/modals/proxy-modal/proxy-modal.js","webpack:///./components/modals/proxy-modal/proxy-modal.html","webpack:///./components/modals/negative-report-modal/negative-report-modal.js","webpack:///./components/modals/negative-report-modal/negative-report-modal.html","webpack:///./components/modals/export-information-modal/single-export-detail/index.js","webpack:///./components/modals/export-information-modal/single-export-detail/index.html","webpack:///./components/modals/export-information-modal/index.js","webpack:///./components/modals/export-information-modal/index.html","webpack:///./components/index.js","webpack:///./components/modals/form-acceptance-modal/index.js","webpack:///./components/modals/form-acceptance-modal/index.html","webpack:///./filters/capitalize.js","webpack:///./filters/filters.js","webpack:///./filters/formatCharge.js","webpack:///./filters/formatE164Phone.js","webpack:///./filters/index.js","webpack:///./screens/public/privacy/index.js","webpack:///./screens/public/privacy/index.html","webpack:///./screens/public/account-deletion/index.js","webpack:///./screens/public/account-deletion/index.html","webpack:///./screens/public/oauth-login/index.html","webpack:///./screens/public/oauth-login/redirect.js","webpack:///./screens/public/oauth-login/splash.js","webpack:///./screens/public/failed-route/index.js","webpack:///./screens/public/index.js","webpack:///./screens/public/failed-route/index.html","webpack:///./screens/compliance/compliance.js","webpack:///./screens/compliance/compliance.html","webpack:///./utils/effectiveRanges/isPeriodInEffectiveRanges.js","webpack:///./screens/dashboard/index.js","webpack:///./screens/dashboard/index.html","webpack:///./screens/welcome/prompts/index.js","webpack:///./screens/welcome/prompts/invalid-phone-number.html","webpack:///./screens/welcome/prompts/invalid-dateofbirth.html","webpack:///./screens/welcome/prompts/submitted-request.html","webpack:///./screens/welcome/index.js","webpack:///./screens/welcome/index.html","webpack:///./screens/edit-report/edit-report.js","webpack:///./screens/edit-report/edit-report.html","webpack:///./screens/edit-report/prompts/showForceRefresh.js","webpack:///./screens/entities/entities.js","webpack:///./screens/entities/entities.html","webpack:///./screens/exports/create-new-export/index.js","webpack:///./screens/exports/create-new-export/index.html","webpack:///./screens/exports/view-export/information-tab/index.js","webpack:///./screens/exports/view-export/information-tab/index.html","webpack:///./screens/exports/view-export/metadata-tab/index.js","webpack:///./screens/exports/view-export/metadata-tab/index.html","webpack:///./screens/exports/view-export/reports-tab/report-export-actions/metadata-modal/metadata-modal.js","webpack:///./screens/exports/view-export/reports-tab/report-export-actions/metadata-modal/metadata-modal.html","webpack:///./screens/exports/view-export/reports-tab/report-export-actions/report-export-actions.js","webpack:///./screens/exports/view-export/reports-tab/report-export-actions/report-export-actions.html","webpack:///./screens/exports/view-export/reports-tab/index.js","webpack:///./screens/exports/view-export/reports-tab/index.html","webpack:///./screens/exports/view-export/index.js","webpack:///./screens/exports/view-export/index.html","webpack:///./screens/exports/exports.js","webpack:///./screens/exports/exports.html","webpack:///./screens/messaging/messaging.js","webpack:///./screens/messaging/messaging.html","webpack:///./config/permissions.js","webpack:///./screens/report-list/report-list.js","webpack:///./screens/report-list/report-list.html","webpack:///./screens/rule-provider/rule-provider.js","webpack:///./screens/proxies/proxies.js","webpack:///./screens/proxies/proxies.html","webpack:///./screens/users/users.js","webpack:///./screens/screens.js","webpack:///./screens/users/users.html","webpack:///./services/api.js","webpack:///./services/basePermissions.const.js","webpack:///./services/baseRolePermissions.const.js","webpack:///./services/app-state.js","webpack:///./services/auth.js","webpack:///./services/dataloader.js","webpack:///./services/dynamic-component.js","webpack:///./services/event-bus.js","webpack:///./services/feature-callbacks.js","webpack:///./services/feature-helper.js","webpack:///./services/interval-service.js","webpack:///./services/loading-service.js","webpack:///./services/logging.js","webpack:///./services/map-helpers.js","webpack:///./services/messaging-service.js","webpack:///./services/report-helper.js","webpack:///./services/detail-helper.js","webpack:///./services/table-helper.js","webpack:///./services/ui-helpers.js","webpack:///./services/timezone-service.js","webpack:///./services/validation-service.js","webpack:///./services/card-swipe-service.js","webpack:///./services/rule-service.js","webpack:///./services/rule-config-service.js","webpack:///./services/filter-service.js","webpack:///./services/formService/buildFormTranslations.ts","webpack:///./services/formService/formService.js","webpack:///./services/formService/formsService.js","webpack:///./services/feature-flags.js","webpack:///./services/user-profile.js","webpack:///./services/oidcService.js","webpack:///./services/rule-validator.js","webpack:///./services/noticeService.js","webpack:///./services/security/adapters/actionAdapter.ts","webpack:///./services/security/adapters/actionsAdapter.ts","webpack:///./services/security/index.ts","webpack:///./services/initialization-service.js","webpack:///./services/index.js","webpack:///./index.ts","webpack:///./bootstrapper.ts"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","0","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","map","webpackContext","req","id","webpackContextResolve","e","Error","code","keys","resolve","INTERVALS","year","quarter","month","week","day","hour","minute","second","DateRange","start","end","_classCallCheck","arguments","undefined","_typeof","_start","_slicedToArray","_isoSplit","isoSplit","_isoSplit2","this","moment","other","sameStartEnd","isSame","sameEndStart","valueOf","options","adjacent","overlaps","constructor","min","max","interval","excludeEnd","step","range","_defineProperty","iterator","diff","Math","abs","iteration","exclusive","next","current","clone","add","done","unit","floor","Infinity","center","excludeStart","oStart","oEnd","startInRange","endInRange","precise","otherStart","otherEnd","isOtherZeroLength","point","isEqual","intersects","intersect","subtract","startOf","endOf","toDate","format","isoString","split","rangeFromInterval","count","date","isMoment","isValid","dateWithInterval","dates","rangeFromISOString","isoTimeInterval","momentStrings","parseZone","parseZoneRange","fn","isRange","within","contains","extendMoment","Date_MAX","Date","getSeasonsByEffectiveRanges","effectiveRanges","seasons","useFederalScopeOverride","reduce","includedSeasons","currentSeason","seasonBegin","BeginInclusive","seasonEnd","EndExclusive","some","season","Id","_step","matchingSeasons","_iterator","_createForOfIteratorHelper","_loop","_range$End","rangeStart","Start","rangeEnd","End","isSameOrAfter","isSameOrBefore","Scope","currentSeasonCopy","cloneDeep","isBefore","isAfter","Periods","filter","err","f","concat","_toConsumableArray","allSeasons","matchingSeason","find","uniqBy","sort","a","b","hasHadState","state","report","History","entry","State","Code","fieldEvent","fieldId","fieldIdRepeatEvent","repeatDataId","eventData","EVENT_SET_FEATURE_DATA","type","EVENT_SET_VALUE","EVENT_SET_DEFAULT_VALUE","EVENT_CLEAR_VALUE","EVENT_FILTER_BY_DETAILS","EVENT_UNCLEAR_VALUE","EVENT_CLEAR_ROW","EVENT_FILTER_CURRENT_OPTIONS","EVENT_FILTER_ALL_OPTIONS","EVENT_REMOVE_OPTIONS","EVENT_LOAD_OPTIONS","EVENT_VALUE_CHANGED","EVENT_FIELD_DISABLE","EVENT_FIELD_ENABLE","EVENT_SECTION_FIELD_VISIBILTY_CHANGE","sectionId","EVENT_TIMEZONE_SET","EVENT_GET_VALUE","EVENT_SEND_VALUE","EVENT_ENABLE_SUCCESSOR_LOCK","repeatId","EVENT_DISABLE_SUCCESSOR_LOCK","EVENT_HANDLE_SUCCESSOR_LOCK","EVENT_LOGOUT","PROXY_FIELDS","ENTITY_TYPES","VESSEL","Name","PluralName","Icon","DEALER","FISHERMAN","LICENSE","GROUP","CAPTAIN","BUSINESS","DEFAULT","RELATIONSHIP_TYPES","NOMENCLATURE","PositiveReport","NegativeReport","ReportFooter","PrimaryEntity","PrimaryDate","SupportEmail","SupportNumber","Season","LogoUrl","SupportMarkdown","FormUseAcceptance","REPORT_SCOPES","detail","details","reportAndDetails","metadata","UNITS","singular","plural","abbreviation","decoration","per","meter","foot","FIELD_TEMPLATES","Coordinate","DateTime","YearMonth","Location","Number","EntitySelector","EntityContactSelector","Selection","Tags","TextArea","Text","Boolean","FEATURE_TYPES","FIELD_KEYS","FIELD_TYPES","SECURITY_ROLES","SYSADMIN","display","level","AGENT","SUSER","USER","TIME_ZONES","isDST","ianaCode","FORM_TIMEZONE_TYPES","TIME_DISPLAY_OPTIONS","TWENTY_FOUR_HOUR","TWELVE_HOUR","PIVOT_TYPES","All","Repeat","RecentlyUsed","IDENTIFIER_TYPES","DL","CGN","PLATE","TOKEN","PREFIX","GARFO","isFederal","SERO","CFID","CLASSIFICATION_TYPES","NAME_SUFFIX_LIST","show","NAME_TITLE_LIST","IS_NOT_AVAILABLE_OPTIONS","FUSE_DEFAULTS","shouldSort","caseSensitive","tokenize","matchAllTokens","includeScore","threshold","tokenSeparator","location","distance","maxPatternLength","minMatchCharLength","SELECTORS","READ_ONLY_MODES","REPORT_STATES","submitted","deleted","pending","declared","SEVERITY_LEVELS","CRITICAL","order","icon","cssClass","ERROR","WARNING","INFO","UNKNOWN","angular","base","component","template","controller","uiState","appState","$uibModal","eventBus","$scope","$featureFlags","$state","noticeService","$logger","ctrl","refreshDataFromService","notices","hasNewNotices","hasUnreadNotices","openModal","modalName","size","closeSidebar","open","sidebar","$onInit","forms","items","form","selected","permissions","register","$watch","prev","openSettingsModal","openAccessibilityModal","showMessaging","getFeature","FEATURES","Messaging","OPEN_FORM_SWITCHER","callback","combo","description","DASHBOARD","NEW_REPORT","label","REPORT_LIST","REPORT_COMPLIANCE","SHOW_NAVIGATION_BAR","DIAGNOSTICS","ADD_DETAIL","SAVE_HEADER","SUBMIT_TICKET","DETAILS","LOCK_FIELD","allowIn","SAVE_DETAIL","SAVE_AND_ADD_DETAIL","ENTITIES","ENTITY_CONTACTS_GET","formId","entityId","ENTITY_CONTACTS_CREATE","ENTITY_CONTACTS_UPDATE","contactId","ENTITY_CONTACTS_DELETE","ENTITY_CONTACTS_RESTORE","FORM_ENTITY","FORM_ENTITY_CREATE","FORM_ENTITY_USERS","FORM_ENTITY_DETAILS","FORM_ENTITY_ASSOCIATION","FORM_ENTITY_IDENTIFIERS","FORM_ENTITY_IDENTIFIERS_UPDATE","identifierId","FORM_ENTITY_IDENTIFIER_ACTIVATE","identifierType","identifierValue","FORM_ENTITY_IDENTIFIER_DEACTIVATE","FORM_ENTITY_CLASSIFICATIONS","FORM_ENTITY_CLASSIFICATION","classificationCode","encoded","encodeURIComponent","FORM_ENTITY_EFFECTIVE_RANGES","FORM_ENTITY_EFFECTIVE_RANGE","FORM_ENTITIES_ASSIGNED","FORM_ENTITY_NUMBERS","FORM_USERS_ENTITIES","userAccountId","FORM_ENTITIES","FORM_ENTITY_TOKENS","FORM_TOKEN_DEACTIVATE","tokenId","FORM_ENTITY_INVENTORIES","FORM_ENTITY_INVENTORY_ITEM","itemId","FORM_ENTITY_INVENTORY_SET","FORM_ENTITY_INVENTORY_ATTEST","FORM_ENTITY_INVENTORY_RESET","FORM_ENTITY_BUSINESSES","FORM_BUSINESS","businessId","FORM_BUSINESS_CHARGES","isAppliedToAllCurrentProducts","FORM_BUSINESS_PRODUCTS","FORM_EXPORT_REPORTS","FORM_EXPORT_CONFIGS","FORM_EXPORT_QUEUE_FOR_CONFIG","configCode","FORM_EXPORT_CREATE","FORM_EXPORT_LOG_ID","FORM_EXPORT_LOG_PAGE","FORM_EXPORTS","configuration","FORM_EXPORT_LOGS","exportLogId","FORMS_REQUESTABLE","FORMS_REQUEST","userId","FORMS_PROCESS_REQUEST","requestId","FORMS_PENDING_REQUESTS","FORM_CONFIG","FORM_REPORT","reportId","FORM_REPORT_QUERY","params","querystring","stringify","FORM_REPORTS_BY_ID","FORM_REPORT_CREATE","FORM_REPORT_UPDATE","FORM_REPORT_DELETE","FORM_REPORT_DETAILS","FORM_REPORT_SUBMIT","FORM_REPORT_RESTORE","FORM_REPORT_WITHDRAW","FORM_PROXIES","FORM_PROXY_DETAILS","proxyId","FORM_PROXY_EXECUTE","proxy","payloadObject","baseUri","Method","queryParams","forEach","param","qs","join","REPORT_DETAIL_DELETE","detailId","REPORT_DETAIL_RESTORE","FORM_REPORT_PREVIOUS","FORM_REPORT_NEXT","FORM_USERS","FORM_USER","subjectId","FORM_USER_ROLES","FORM_USER_FAVORITES","targetType","relationshipType","FORM_PERMISSIONS","FORM_NOTICES","ACCOUNT_NOTICE_READ","noticeId","PASSWORD_RESET","INVITE_RESEND","USER_PERMIT_ENTITY","USER_REVOKE_ENTITY","TOKEN_STATUS","token","USER_IMPERSONATE","EXTRACT_PAGE_NAME","route","substr","indexOf","BASE_REPORT","EDIT_REPORT","DX_REPORT","ENTITIES_SCREEN","EXPORTS_SCREEN","REPORTING_SCREEN","statesGlob","self","copy","typesGlob","read","states","aliasGlob","baseArea","byCode","INVENTORY_OPERATIONS","operationsGlob","byOperation","operationType","inventoryGlob","typeCode","operations","productGlob","geometriesGlob","tokenGlob","identifiersGlob","identifierTypeCode","update","deactivate","reactivate","classificationsGlob","classificationTypeCode","remove","effectiveGlob","effectiveCode","delete","contactsGlob","contactCode","relatedGlob","relationshipCode","types","feesGlob","byType","productsGlob","businessGlob","fees","products","write","inventory","tokens","aliases","geometries","identifiers","classifications","effective","contacts","related","business","globs","reporting","compliance","reports","byId","fields","fieldCode","edit","feedback","vesl","phoneNumber","email","agency","markdown","remoteSupport","exportConfiguration","logs","entityTypes","subjects","assigned","build","present","scan","anyOf","Glob","path","matcher","Minimatch","head","Segment","parse","_createClass","match","_ref","_ref2","isCongruentTo","isCongruent","previous","_this$previous","isGlobstar","SegmentType","Globstar","isWild","test","isStatic","Static","isPattern","Pattern","isHead","_this$next","isTail","tail","segment","segments","append","left","right","isGlobCongruentTo","isWildCongruentTo","isPatternCongruentTo","isStaticCongruentTo","isNextCongruent","_left$matcher","endsInGlobStar","scopes","adapter","check","Any","_step2","_iterator2","Action","action","isAllowed","pattern","hasCongruency","ActionOrPattern","_Any","_inherits","_super","_createSuper","actionOrPattern","isAnyTypePermittedScope","canReadAnyTypeGlob","canReadAnyTypePattern","canAnySubjectReadTypeGlob","canAnySubjectReadTypePattern","deps","mainHeader","$rootScope","$element","hotkeys","cardSwipeService","securityService","anyTypeAccessible","canViewEntities","isActionScopeAllowed","on","target","$evalAsync","canCardSwipe","Features","Type","Reporting","IsDisabled","Actions","CanCreate","hotkeyConfigs","nomenclature","transitionTo","reload","go","Compliance","addHotKeys","$destroy","off","goTo","initCardSwipe","initializeCardSwipe","routes","close","document","querySelector","focus","canReadExportLogs","canReadExports","canCreateExport","canViewExportScreenScope","etagInterceptor","request","config","_config$data","ifMatch","headers","response","_response$data","_response$data2","_response$data$Data$e","Array","isArray","Data","_objectSpread","etag","statusInterceptor","$q","$injector","resp","_resp$data","_resp$data2","_resp$data3","_resp$data$Errors","Success","handleErrorMessage","Errors","reject","responseError","message","status","success","error","jamesifyForm","url","endsWith","draftReports","random","itemDeactivatedAt","_resp$data$Data","Fields","field","item","DeactivatedAt","ruleJson","addEntityFilter","Rules","applicable","addNotStartedInGrace","entity","Effective","NoEarlierThan","NoLaterThan","addEndedNotInGrace","addEndedInGrace","alterRanges","alterMethod","Entities","Entity","modify","_field$Type","_field$Data","IsEntity","_step3","_iterator3","gracePeriodAfterEnd","gracePeriodBeforeStart","gracePeriodNone","findValidFieldId","_config$Fields$","addUnknownEngine","ruleWithUnknownEngine","addNoEngine","ruleWithNoEngine","addNoConditions","ruleWithNoConditions","addUnknownTrigger","ruleWithUnknownTrigger","addUnknownFieldId","_resp$data$Data2","invalidFieldId","validFieldIds","ruleWithUnknownFieldId","addInvalidChildren","addChildrenWithEngine","ruleWithChildrenAndEngine","addOnlineEngine","addReadonlyTrigger","fakeNumberResponse","Informations","addRandomEntityPermission","_resp$data$Data$Permi","_resp$data$Data$Permi2","_resp$data$Data$Permi3","_resp$data$Data$Permi4","Permissions","Administration","PAUL","KnownAs","Identifiers","Relationships","addProxyDatetime","method","Schema","properties","dateValue","title","valueTime","addTranslations","Translations","Agency","Types","addEntityTranslations","_resp$data$Data$Agenc","_resp$data$Data$Agenc2","_resp$data$Data$Agenc3","addProxyFileUploader","blob","maxSize","Form","placeholder","denyAllFeedback","Assigned","role","Roles","Path","Effect","denyShowMarkdown","denyVeslFeedback","denyAgencyFeedback","denyShowAgencyPhonenumber","denyShowAgencyEmail","denyShowVeslPhonenumber","denyShowVeslEmail","denyAllCompliance","changeExports","denyInventoryOperation","allowTokenManagement","securityException","allowAliasManagement","allowAliases","allowBusinessManagement","allowProductManagement","allowProducts","allowInventoryManagement","allowInventory","allowGeometryManagement","allowGeometry","entitySecurityAllowAll","entitySecurityDenyAll","addStaleTimeout","StaleTimeout","addInvalidTimeout","InvalidTimeout","forceMatchEntities","Key","IsFavorite","modifyAgencyTypes","Businesses","IsSupported","console","log","modifyFormsAgencyTypes","Logo","fakeBusinesses","_resp$config","IsValid","Profile","PhoneNumbers","Value","Addresses","AddressLine1","Locale","Territory","PostalCode","Country","fakeBusinessCharges","_resp$config2","Amount","IsActive","fakeBusinessProducts","Unit","Price","IsInvoiceDefault","Fees","depredationSection","Order","primaryBottomType","Section","Template","Description","primaryBoatMovement","numberOfSites","IsSmall","isDepredated","predatorType","whichSites","depredatedQty","IsDetail","IsDetailColumnHeader","addDepredationFields","Sections","mockDataInterceptor","activeMocks","currentMocks","values","mocks","mock","includes","accumulatedResp","currentMock","availableMocks","_JSON$parse","storedMocks","localStorage","getItem","JSON","unmockAll","unmockRequest","mockRequest","setItem","_JSON$parse2","removeItem","declaredStatus","effectiveRangify","seasonLookup","_entity$Form","Seasons","effectiveRange","_resp$data$Data$Seaso","keyBy","removeChildRuleCodesAndIds","_resp$data$Data$Rules","cleanRuleCodesAndIds","rule","isTopLevelRule","Children","shimmer","context","shims","shim","currentShim","clearSplash","deferral","loader","element","addClass","setTimeout","settings","ENVIRONMENT_CONFIGURATION","nopify","noop","_i","_methods","shimConsole","buildDate","toISOString","clientId","support","phone","header","searchToggled","environment","uiRouter","constant","$uibTooltipProvider","setTriggers","appendToBody","uibDatepickerConfig","showWeeks","uibDatepickerPopupConfig","onOpenFocus","$httpProvider","interceptors","$stateProvider","$urlRouterProvider","$locationProvider","abstract","bodyClassName","logout","$userProfile","clearFeatures","clear","reset","splash","defer","promise","apiState","api","then","rootResponse","apiMoment","ServerTime","localMoment","skew","user","openIdService","auth","toastr","fromRouteName","transition","to","userManager","getUserManager","fromRouteParams","getUser","userInfo","setFromRoute","signinRedirect","catch","setAuthData","formsService","formService","loadingService","Promise","loadFeaturesForCurrentUser","getForms","selectedForm","targetState","abort","watch","noticePromise","getNotices","all","finally","via","errorMsg","disallow","system","permissionKeys","entityIds","array","reloadOnSearch","controllerAs","$stateParams","currentFormId","requestedFormId","requestedReportId","IsNegative","FormId","selectByFormId","trigger","from","atob","b64","custom","showValidations","isNewReport","actionScope","otherwise","html5Mode","enabled","requireBase","$transitionsProvider","routeLookups","getTargetRoute","parent","onSuccess","trans","targetDefinition","targetRequested","targetUrl","router","stateService","href","absolute","injector","targetRoute","view","recordPageView","Function","onEnter","transitionAuthCriteria","index","permissionBlob","priority","onBefore","stateClass","onError","toastrConfig","extend","allowHtml","closeButton","timeOut","extendedTimeOut","tapToDismiss","progressBar","onShown","toast","toastElement","el","scope","toastType","setAttribute","positionClass","preventOpenDuplicates","directive","$parse","$timeout","link","attrs","model","autoFocus","restrict","targetAttribute","getAttribute","ariaFromAttr","hasClass","Waves","attach","init","require","otherModelValue","attributes","ngModel","$validators","compareTo","modelValue","$validate","_formatters","formatters","input","matchableRegex","replace","x","hours","mins","period","toUpperCase","_input$split2","_toArray","time","iframe","createElement","appendChild","contentWindow","content","querySelectorAll","onBlur","className","parentNode","closestByClass","val","removeClass","onFocus","$on","maskDefinitions","clearOnBlur","clearOnBlurPlaceholder","escChar","eventsToHandle","addDefaultPlaceholder","allowInvalidValue","provider","$get","uiMaskConfig","tempOptions","prop","isObject","maskConfig","isFocused","elem","activeElement","hasFocus","tabIndex","compile","iElement","iAttrs","maskCaretMap","maskPatterns","maskPlaceholder","maskComponents","minRequiredLength","oldValue","oldValueUnmasked","oldCaretPosition","oldSelectionLength","preventBackspace","maskProcessed","eventsBound","originalPlaceholder","originalMaxlength","maxlength","originalIsEmpty","$isEmpty","initialize","maskAttr","isDefined","mask","characterCount","isString","isOptional","numberOfOptionalCharacters","splitMask","inEscape","chr","linkOptions","defaultPlaceholderChar","uiMaskPlaceholder","uiMaskPlaceholderChar","toLowerCase","getPlaceholderChar","pop","components","maskPlaceholderChars","isNaN","maskPlaceholderCopy","offset","componentPosition","position","getMaskComponents","processRawMask","unmaskValue","$modelValue","maskValue","validateValue","attr","viewValue","idx","$formatters","$viewValue","$render","initializeElement","blurHandler","mouseDownUpHandler","keydownHandler","eventHandler","bindEventListeners","uninitialize","initPlaceholder","placeholderAttr","modelViewValue","formatter","fromModelValue","$setValidity","$observe","unbind","unbindEventListeners","removeAttr","valueOffset","valueUnmasked","maskPatternsCopy","selectionStart","selectionEnd","getSelectionLength","tempValue","toString","valueDelta","substring","valArray","isSeparator","unmaskedValue","valueMasked","maskCaretMapCopy","charAt","uiOptions","$eval","original","uiMask","unshift","$parsers","fromViewValue","prevValue","$apply","$pristine","$setViewValue","currentVal","isTemporarilyEmpty","change","isFunction","Event","fireEvent","bubbles","cancelable","ex","createEvent","initEvent","dispatchEvent","triggerChangeEvent","mouseoutHandler","isKeyBackspace","which","caretPos","getCaretPosition","isCtrlZ","ctrlKey","isValidCaretPosition","setCaretPosition","preventDefault","eventWhich","eventType","valMasked","valOld","valAltered","valUnmasked","valUnmaskedOld","caretPosOld","caretPosDelta","caretPosMin","caretPosMax","selectionLenOld","isSelected","wasSelected","isAddition","isDeletion","isSelection","shiftKey","isKeyDelete","caretBumpBack","charIndex","pos","selection","createRange","moveStart","text","offsetWidth","offsetHeight","setSelectionRange","createTextRange","collapse","moveEnd","select","getSelection","searchElement","TypeError","len","k","onTriggerHandler","debounce","ignoreClick","event","ignoreSpace","keyCode","ignoreEnter","onTriggerFocus","createDescriptionTextNode","messageNode","createTextNode","helperText","uuid","classList","search","single","setDisplay","setBox","simple","isReadonly","nodeName","box","choices","itemSelectText","renderChoiceLimit","searchEnabled","searchResultLimit","searchFields","removeItemButton","fuseOptions","callbackOnCreateTemplates","_this","classNames","choice","_data$customPropertie","_data$customPropertie2","itemChoice","highlighted","highlightedState","itemSelectable","active","disabled","customProperties","deactivatedAt","isRecent","_scope$setDisplay","_data$customPropertie3","_data$customPropertie4","itemDisplay","isActive","disable","originalSetValueByChoice","setValueByChoice","currentValue","getValue","hookupSameChoiceChangePrevention","containerOuter","addEventListener","_box$choiceList$query","_box$choiceList$query2","choiceList","dataset","stopImmediatePropagation","passedElement","hideDropdown","containedWithin","_containedWithin","tabbables","hasAttribute","offsetParent","hookupPickOnTab","isSelectMultipleElement","currentState","style","width","hookupMultiSelectInputBehavior","newReadonly","enable","hookupReadOnlyBehavior","onfocus","blur","onblur","hookupFocusAndBlur","ariaLabel","removeItemsByValue","addAccessibilityHelpers","$window","setSelection","formController","$submit","$setSubmitted","ngSubmit","children","first","last","onFirstWithShift","onLastNoShift","pastedData","clipboardData","getData","innerWidth","oldWidth","newWidth","$ctrl","isMobile","windowResizeMobileCallback","windowResizeDesktopCallback","resizeBind","modal","setDefaultAttr","getHeaderId","attributeName","uibTooltip","insertBefore","preventScrollListener","unlink","checkAuthorization","authorizePattern","authorizeAction","authorizeActionOrPattern","authorizeActionScope","isPatternAllowed","isActionAllowed","isActionOrPatternAllowed","authorize","multiElement","notAuthorized","authorizeAttribute","authorizeComponent","bindings","$onChanges","changes","transclude","ENTITY_TRANSLATION_KEYS","LABELS","ExternalKey","Classification","Timezone","I18NextContext","entityCode","translationKey","defaultFallback","valueCount","i18n","exists","parseInt","_valueCount","_init","regeneratorRuntime","mark","_callee","wrap","_context","Instance","i18next","resources","debug","fallbackLng","lowerCaseLng","cleanCode","defaultNS","errors","abrupt","stop","_x","btnRipple","dateTimeInput","inputRipple","onTrigger","onEscape","htmlViewer","uibModalWindow","selectBox","selectOnFocus","submit","trapFocus","preventScroll","veslNoUnicode","windowResize","$compile","i18nKey","i18nType","i18nCount","defaultText","updateTranslations","translatedText","translateEntityType","html","translateKey","contents","$parent","load","_load","_asyncToGenerator","entityContacts","sent","Contact","Contacts","contact","$Id","hasInactive","saveContact","_x2","_saveContact","_callee2","selectedFormId","_context2","Title","FirstName","trim","MiddleName","LastName","Suffix","DateOfBirth","put","post","_openEditOrCreateEntityContactModal","_callee3","_entityContact$Name","entityContact","displayName","_args3","_context3","CanAdd","CanEdit","t0","_remove","_callee4","_context4","_restore","_callee5","_context5","suffixOptions","suffixMap","openEditOrCreateEntityContactModal","promiseTracker","getTracker","_x3","shouldDisplayContact","includeInactive","restore","_x4","canAddPattern","typeConfig","editPattern","editAction","reactivateOrDeactivateActionScope","canDeactivateAction","canReactivateAction","titleOptions","birthdate","dateOptions","formatYear","startingDay","minDate","altInputFormats","opened","toggle","updateBirthday","_loadBusinesses","getBusinesses","businesses","Business","saveBusiness","_saveBusiness","loadBusinesses","canCreateBusinessGlob","canCreateEntityBusinessGlob","canCreateActionScope","editBusiness","backdrop","save","isStringNullishOrEmpty","str","$onDestroy","cancel","_ctrl$resolve$busines","onOk","payload","AddressLine2","ph","validate","modalInstance","dismiss","_payload$Addresses","_payload$PhoneNumbers","validationStrings","address","errorList","swal","fire","showCloseButton","loadBusiness","_loadBusiness","businessProfile","canUpdateBusinessGlob","_ctrl$businessProfile","saveCharge","_saveCharge","charge","verb","ApplyToCurrentProducts","loadCharges","_loadCharges","canReadCharges","getCharges","charges","canReadBusinessFeesGlob","availableCharges","canUpdateBusinessFeeGlob","canCreateBusinessFeeGlob","editCharge","chargeUpdate","matchindex","findIndex","chargeTypes","setTemplate","templateName","_ctrl$charge$Value","_ctrl$charge$Type","saveProduct","_saveProduct","product","loadProducts","_loadProducts","canReadProducts","getProducts","canReadBusinessProductsGlob","canUpdateBusinessProductGlob","canCreateBusinessProductGlob","editProduct","templates","_ctrl$product$Fees","Fee","_ctrl$product$Price","isSupportedOrNullish","byName","getAllowedClassifications","allClassifications","_type$Items","startsWith","Items","_filter","ac","Item","getPrimaryClassificationsForType","IsPrimary","entityManager","uiHelpers","_createEntity","entityPayload","entityType","showEntityConfirmation","newEntity","_ctrl$entity$Name","showRefreshModal","shouldRefresh","_showEntityConfirmation","_readonlyOnCreateValu","_ctrl$formEntity$Time","_ctrl$formEntity$Time2","showExternalKey","showCode","showName","readonlyOnCreateValues","confirmValText","IsExternalKeySystemManaged","formEntity","IsCodeSystemManaged","IsNameDefaultedToCodeWhenNoContact","tooltipTranslations","classification","externalKey","TimeZone","showCancelButton","confirmButtonColor","confirmButtonText","focusCancel","reverseButtons","_showRefreshModal","_ctrl$entityType$Clas","_ctrl$entityType$Exte","timezones","entityTypeName","hasSystemKeyInputs","isNewEntity","Classifications","TimeMode","defaultName","oldType","getClassificationById","hasSystemKeyValues","setClassificationBox","classificationBox","selectionChoices","recentlyUsedEnabled","hideCode","setChoices","fieldVariable","warn","handleClassificationValueChanged","modelVal","modelValInt","selectedClassification","saveEntity","_ctrl$formEntity$Exte","friendlies","_ctrl$entityType$Clas2","_ctrl$entityType$Exte2","IsRequired","CodePattern","RegExp","NamePattern","updateEntity","createEntity","readonly","nameComponentOptions","pickNameComponent","useNameComponent","editContact","nameComponentSwitchable","$onChange","switchNameType","entityNameTypeMap","resetTabs","selectedType","_ctrl$permissions$sel2","currentType","canViewInventoryTab","showInventoryTab","Inventory","canViewTokensTab","showTokensTab","Tokens","canViewAliasesTab","showAliasesTab","canViewProductsTab","showProductsTab","canViewGeometriesTab","showGeometriesTab","canViewIdentifiersTab","showIdentifiersTab","canViewClassificationsTab","showClassificationsTab","canViewEffectiveTab","showEffectiveTab","canViewContactsTab","showContactsTab","canViewAssociatedTab","_ctrl$permissions$sel","_ctrl$resolve$typeCon","showAssociatedTab","canReadEntityBusiness","canReadBusiness","canViewBusinessTab","showBusinessTab","selectedTypeName","tabs","Users","Aliases","Geometries","Products","EffectiveRanges","selectedTab","handleClose","_entityNameTypeMap$ct","nameComponent","isEntityReadonly","changeEntity","$sce","_ctrl$typeConfig$Rela","_ctrl$typeConfig$Rela2","allTypePermissions","thisType","availableRelationshipTypeCodes","availableAssociations","_t$Relationships","_t$Relationships$Item","canAddSource","canAddRelationshipType","canRelateToType","relationships","errorString","exception","relationship","loadRelatedEntities","addRelated","saveNewAssociation","newEntityType","associatedList","hasClassifications","hasKeys","_ENTITY_TYPES$e$Type$","_ENTITY_TYPES$e$Type$2","nameCodeLabel","trustAsHtml","nameCode","entitiesByType","acc","thisEntityGroup","g","TypeCode","TypeName","TypePluralName","pluralize","_ctrl$typeConfig$Clas","_ctrl$typeConfig$Exte","entityHeader","timezone","users","getUsers","getAllowedIdentifiers","allIdentifiers","_filter2","saveIdentifier","identifier","existingIndex","checkRequiredIdentifiers","requiredIdentifiersNotPresent","requiredIdentifiers","ri","addIdentifier","IncludeIdentifiers","isTypeReadonly","updated","editIdentifier","activate","identifierTypes","IdentifierTypes","addNewIdentifierPattern","editIdentifierPattern","editIdentifierAction","_ctrl$typeConfig","isEditingIndex","IsExpected","_identifiers$filter","_loadTokens","CanDeactivate","checkForInactiveTokens","hasInactiveTokens","loadTokens","canDeactivate","canRead","newToken","thisTokenIndex","_loadInventoryItem","_item$Operations","loadPromise","forEntity","inventoryOperations","Operations","Occurred","inventoryItem","loadInventoryItem","inventoryOperationsModal","_loadInventories","inventoriedItems","loadInventories","viewOperations","addClassification","existing","newClassification","getClassification","canRemoveAction","canAddAction","classificationTypes","isPrimary","el1","el2","canUpdateActionOrPattern","canUpdate","canDelete","loadEffectiveRanges","ranges","orderBy","now","statusClass","canUpdateOrDeleteAnyActionScope","numColumns","CanRemove","formatDate","addEffectiveRange","newEffectiveRange","editEffectiveRange","timeZone","onUpdate","handleSave","ValuePattern","availableIdentifiers","_ctrl$resolve$typeCon2","_ctrl$classificationT","IsAttribute","canReadClassification","canAddClassification","modelValues","_this$modelValues$Sco","AsEarlyAs","errs","moments","asEarlyAs","noLaterThan","scopeAction","local","setNextReportNumber","number","NextNumber","nextNumber","Next","positiveNomenclature","editNextNumber","showLessThanCurrentWarning","proceed","entityBusiness","entityBusinessModal","entityBusinessProfile","entityBusinessCharges","entityBusinessChargeModal","entityBusinessProducts","entityBusinessProductModal","entityContactModal","entityForm","entityModal","entityAssociated","entityUsers","entityIdentifiers","entityInventory","entityClassifications","entityEffectiveRanges","editEffectiveRangeModal","editClassification","entityReporting","entityTokens","entityHeaderModal","nameOrContact","_window","actions","changePassword","CurrentPassword","currentPassword","Password","newPassword","Controller","boolVal","selectModel","valStr","labelStr","strVal","clearStore","handleValueChanged","removeActiveItems","selectId","canEdit","canSet","endNow","onRangeUpdate","_ctrl$form$Agency$Log","isCollapsed","showSwitcher","logo","openFormSelectorModal","onInit","agencies","_form$Agency$Logo","existingAgency","initials","Initials","selectedAgency","showFormSelector","setForm","setSelected","clearSelectedEntity","selectAgency","keySelectAgency","keyEvent","$transclude","$postLink","tracker","browserList","buildIeOverlayEvent","userProfile","timeDismissed","setUserProfile","isOpen","getUserProfile","browsers","encodeURI","edgeLogo","firefoxLogo","chromeLogo","shuffle","handleExternalNav","overlayEnabled","ieNotification","buildWebEvent","documentMode","sendMessage","Message","hasMessages","messageSnippet","MessageListItem","nonThisParticipants","participants","thisUserid","primary","isGroupContact","buildAvatarColors","firstName","lastName","hexBkColor","stringToHexColour","avatarBkColor","intToHexColorString","avatarTextColor","textColorForHexBk","curr","highlight","MessageBubble","bkColor","alignRight","effectiveRangeStatus","asOf","isInGrace","isEither","clearSelected","getAssociatedEntities","_getAssociatedEntities","entities","associatedEntities","getPrimaryFieldEntities","default","setDefault","entityQueryConfiguration","primaryEntityQueryConfiguration","keepSelected","_selected","_selected2","getSelectedEntity","allFriendlies","friendly","thisFriendly","thisPrimary","selectEntity","setPrimarySwitcherButton","handleValueChange","onChanged","showPrimarySwitcher","shouldRequestPrimaryUpdate","selector","callbacks","_","fieldIdentifier","switchPrimary","setSelectBox","isSelf","isAllPrimaries","setValue","fieldLabel","truncate","isFinite","String","trimLeft","trimRight","dmsToDegrees","dmsValue","degrees","minutes","fractionalMinutes","fullDegrees","isNegative","parseFloat","toFixed","degreesToDms","rawDegrees","isStrict","strictDecompose","roundingDecompose","dmsVal","roundedMinutes","minutesAsDecimal","round","minfloat","secfloat","EPSILON","findEntityRecursively","depth","found","_depth","validationServiceFactory","hydrateValue","_fields$value$FieldId","applicableField","FieldId","IsNotAvailable","_code","EntityQueryConfiguration","RelationshipType","hydratedValue","EntityId","getSeasons","DataId","_hydratedValue2$Class","_entity$Effective","getDataItemName","_item$Name","IsCustomEntryEnabled","getEntityItemName","_item$match$Name2","_item$0$Name","_item$match$Name","setCallbacks","setValidations","validations","registerValueProvider","getValues","fieldsById","groupBy","detailFields","getDetailFields","allDetailVals","v","DetailId","isDeleted","toggleDetailsExpansion","getErrMessage","handleDetailDelete","detailValues","IsDeleted","detailsTable","hasDeleted","appendCalculatedFields","reportDetailEventBuilder","toggleDeleted","showDeleted","showOrHideDeleted","handleDetailRestore","getTableDataSuffix","getTableDataPrefix","isTableEmpty","toggleDetail","isExpanded","every","expandAdditionalDetails","onClickDetail","detailWithErrors","hasErrors","warnings","hasWarnings","onDetailSelect","selectedDetail","validationService","getCurrentValidationService","detailVals","selectionFields","detailField","detailFieldValues","detailRowVals","detailFieldValue","itemValue","findPrimaryEntity","columnFields","fieldDictionary","totalField","additionalFields","separateDetails","table","units","Abbreviation","detailColumnVals","mainVals","additionalDetails","extraVals","extraDetailVal","additionalField","IsNotReported","IsHidden","detailValue","tooltipValue","tableValues","isNumber","isEmpty","columnQuantity","row","enableAddDetail","allDetails","columns","hasAdditionalDetails","prepareDetailsTable","dms","Latitude","Longitude","missing","formatString","RoundingPoint","repeat","numeral","PreSelect","rules","detailErrors","validationScope","detailWarnings","expandOverride","friendlyEntity","primaryId","calculateQuantityPriceProduct","fieldValueDictionary","calcluateOysterTotal","quantity","price","tagBegin","tableDetails","_maxBy","calculator","calculationFields","maxBy","totalSum","forOwn","fieldValues","_detailVals$values","nextVal","formattedTotalSum","toLocaleString","currency","columnFieldIds","additionalFieldIds","handleKeypressAsButtonClick","editDetail","getDetail","showAddDetail","modifiedDates","dirtyDetails","isSubmitted","dateHelper","fieldValue","conditionValue","utcOffset","periodDatePoints","OpensInclusive","ClosesExclusive","Deadline","toUnix","dateEvaluator","evaluator","condition","relevantFieldValues","_condition$Scope","_condition$Scope2","compareToValue","CompareToField","Field","selectedDate","compareToDate","CONDITION_SCOPES","milliseconds","seconds","Time","minValue","MinValue","maxValue","MaxValue","parts","decomposePeriodConfiguration","currentPeriod","dateMoment","foundSeasonPeriod","beginMoment","endMoment","getCurrentPeriodRange","periodFieldTime","mapValues","conditionAsMoment","ISO_8601","selectedDateInUnix","RULE_OPERATORS","OPERATOR_ACTIONS","AND","_len","args","_key","OR","_len2","_key2","NAND","_len3","_key3","NOR","_len4","_key4","XOR","_len5","_key5","sum","AGGREGATION_ACTIONS","ALL","_len6","_key6","ANY","_len7","_key7","NONE","_len8","_key8","SOME","_len9","_key9","CONDITION_OPERATORS","INCLUSIVE","INCLUSIVEEXCLUSIVE","EXCLUSIVEINCLUSIVE","EXCLUSIVE","GREATERTHAN","GREATERTHANOREQUALTO","LESSTHAN","LESSTHANOREQUALTO","EQUALTO","NOTEQUALTO","IS","ISNOT","HASBEEN","HASNOTBEEN","ISCURRENTLY","ISNOTCURRENTLY","WITHENTITY","ISONLINE","ISINTERACTIVE","CONDITION_EVALUATIONS","compareFunctions","greaterThan","compareVals","greaterThanOrEqualTo","lessThan","lessThanOrEqualTo","equalTo","notEqualTo","beginningCommaRegex","endingCommaRegex","twoCommasRegex","ENGINE_EVALUATIONS","inclusive","inclusiveExclusive","exclusiveInclusive","compare","any","evaluate","required","idRequired","notAvailable","customEntry","withEntity","is","isNot","regex","exp","empty","isOnline","isInteractive","unique","detailStrings","_Object$values","thisDetailString","entries","fieldVal","thisFieldValue","ContactId","compareVal","uniq","hasBeen","stateValue","_metadata$report","h","hasNotBeen","_metadata$report2","isCurrently","_metadata$report3","orderedHistory","isNotCurrently","_metadata$report4","combination","valueDictionaries","cleanedCombo","_ref3","_ref4","_ref5","aFieldId","_ref6","bFieldId","aCondition","Conditions","bCondition","_ref7","_ref8","flatMap","_v$","_v$0$DataId","_v$2","comboRegex","Blob","combinations","comparison","comparator","defaultOnEmpty","evaluated","TRIGGER_METHODS","service","TRIGGER_METHODS_SERVICE","methods","VISIBILITY","operator","matched","oldVisible","visible","Matched","initReadOnly","visibilityChanged","READONLY","suppressed","NotMatched","REQUIRED","isRequired","HIGHLIGHT","filters","compareValues","TRIGGER_TYPES","UI_OPERATOR_TYPES","ENGINE_TYPES","RANGE","function","isAggregate","COMPARE","VALUE","CLASSIFICATION","REGEX","IDENTIFIER","ENVIRONMENT","isMetadataEngine","UNIQUE","INTERSECT","EMPTY","NOTAVAILABLE","LENGTH","CHANGE","CONTAINS","EXISTING","CUSTOMENTRY","PERIOD","STATE","COMBINATION","isConditionAggregate","LOCATION","ROLE","EVALUATION_PREPARERS","TEMPLATE_VALUE_PREPARERS","_condition$Scope3","conditionFieldValues","_condition$Field","compareToField","_condition$CompareToF","mappedFieldVal","mappedCompareToVal","_condition$CompareToF2","_condition$Field2","MultiSelect","Metadata","conditionValues","factor","factoredValue","num","fv","_ref9","_ref10","_ref11","_fv$EntityId","TRIGGER_OPERATOR_CODES","blockSubmit","blockSave","warning","visibility","VALIDATION_OPERATORS","criticalLevel","detailMessage","messageSubmitted","detailMessageSubmitted","isWarning","ReportDetailsModalController","detailHelper","dirtyFields","returnValue","detailValidationScopes","detailScope","_this2","allDetailValues","allValues","uniqueFieldId","findSingleFieldUnique","loadRulesForDetailModal","handleDisplayValidations","rendered","triggerFieldFilters","filterExistingDetailItems","initializeFields","updateFieldErrors","setHotKeys","handleCancel","displayAlertIfDirty","_this3","hasLockableFields","IsLockable","lockHotkeyExists","bindTo","shouldHoldOpen","_this4","doNotClose","updates","getFormValues","results","explodePivotedRowsAndAssignLinkKeys","repeatToKeyMap","repeatToLinkKeyMap","keyToIdMap","detailsByKey","u","DetailLinkKey","saveDetails","newDetail","detailVal","isNewDetail","returnPromise","onSave","allResults","checkBlockSave","commitValidations","lockedFieldIds","isLocked","Pivot","lockedValues","uniqueLockedValues","_this5","blockSaveRules","updateTriggeredRules","triggeredRules","tr","Triggers","Operator","_this6","itemIdsToRemove","$$postDigest","uniqueDetailRule","Engine","childrenRules","uniqueChild","_this7","hasValidationWarning","hasValidationError","ruleHasNoDetailId","resolveHasNoValues","ruleScopeIsReportDetails","ruleDetailIdEqualsResolveDetailId","shouldCheckForWarningCode","appliedFieldIds","highlightTriggers","_this8","blockSaveOnly","allValidations","pendingValidations","detailValidations","newType","_this9","clearPendingValidations","removeEventListener","checkAccesses","currentHistory","canWithdraw","canRestore","showExportIcon","Exports","CanViewExports","canBeWithdrawn","canBeDeleted","canBeRestored","CanWithdraw","operatingUserRole","CanDelete","CanRestore","handlePrint","print","buildReportEvent","withdraw","handleWithdraw","handleDelete","handleRestore","handleViewExport","_ctrl$report","confirmAction","verbiage","openQuantityModal","_openQuantityModal","uri","instance","Quantity","apiAction","canAttest","canReset","canAttestAction","canSetAction","canResetAction","hasAnyInventoryActionPermission","attest","set","newValue","$toastr","defaultResolve","fieldSettings","setFieldDirty","pivotRow","pivotColumn","fieldMap","props","Checkbox","featureHelper","_scope","_eventBus","_unregister","reportFormCtrl","registerFieldController","initValue","revertValue","cleared","setPristine","initialValue","DefaultValue","defaultValue","isApiCall","buildResult","isDirty","thisValue","boolField","checkboxField","initializationService","thisUserProfile","hasApplicablePermission","canEditAction","isTwelveHour","timeDisplay","externalSet","dateDisabled","modelOptions","monthNumber","maskOptions","timeMask","maxDate","_ctrl$selection","getTime","updateFieldDirty","handleChange","suppressNextDateWatch","showTimePicker","timepickerDate","setInitialValue","localShiftedMoment","tz","needsTimezone","unregisterTz","_this$selection","_this$selection2","currentMoment","paramsMoment","isWithinAnHour","initializedDate","setHours","setMinutes","setSeconds","setMilliseconds","hasResultForRuleRun","outgoingDate","runWhenPageLoaded","isDisabled","outgoingDateStr","currentResult","getCurrentValue","$event","stopPropagation","_toastr","trailingComma","incrementingStep","digitCount","MAX_FIELD_VALUE","rangeErrorRepeatIds","setFeatures","IncrementingStep","decimalSplit","filterOptions","placeHolder","setOptions","ids","disableField","setUnitSelection","isFieldLockable","enableField","setDefaultUnit","_this$selection$unit","lookups","_result","_this$selection$unit2","_result2","Factor","hasRangeError","_this$selection$unit3","_result3","_result4","hasFullResult","mapFeature","features","lookup","geoJsons","locationFields","isDirtyUnit","IsDefault","confirmUnsavedChangesWillBeLost","_confirmUnsavedChangesWillBeLost","confirmWithdrawReport","_confirmWithdrawReport","confirmDirtySubmission","_confirmDirtySubmission","numDirtyDetails","confirmRuleWarningsOnReport","_confirmRuleWarningsOnReport","validation","inputValue","inputValidator","inputPlaceholder","_notifyTimezoneDiscrepancy","currentTimezoneCode","newTimezoneCode","fieldTitle","allowOutsideClick","allowEscapeKey","allowEnterKey","showConfirmButton","_notifyFormTimezoneError","_notifyUserTimezoneError","notifyMultipleEntityTimezoneError","_notifyMultipleEntityTimezoneError","fieldName","notifyNoEntityTimezoneError","_notifyNoEntityTimezoneError","alertDeactivatedSelection","_alertDeactivatedSelection","showNotConnectedOnRefreshError","_showNotConnectedOnRefreshError","res","fieldHelpers","Map","onSelect","MapPoint","MapWithoutBoundary","NotAvailable","AdvancedSearch","CustomInput","UNIQUE_TIMEZONE_ERRORS","EntityManager","fieldOptions","primaries","findFriendlyByPrimaryId","allEntities","entityIdToFieldIdMap","allEntityConfigs","userScopedEntities","userScopedEntityTypes","primaryFieldEntities","selectedEntity","allPrimaries","primaryFieldId","primaryFieldLabel","isFriendly","thisUser","selectedEntityId","friendlyId","friendlyIds","has","idBreakIndex","trueFieldId","getEntity","fId","allTimezones","getEntityPairs","bothEntities","_e$TimeZone","uniqueTimezones","allFieldEntities","fieldEntities","seasonCode","classificationId","uniqueTypes","uniqWith","Primary","Friendly","fieldIds","updatedEntity","loadSeasons","loadClassifications","entityFields","loadEntityField","eqc","IsUserScoped","_this6$userScopedEnti","_this6$userScopedEnti2","_this6$userScopedEnti3","entityArray","toArray","uniqueEntityTypes","_field$Type2","loadEntityListData","$index","loadConfiguration","subEntities","sub","entityIndex","loadClassificationsIntoEntity","loadIdentifiersIntoEntity","IncludeClassifications","featureCallbacks","_item$Entities","isItemFavorited","IsFavoriteEnabled","_this$initialValue$Da","_this$initialValue","_this$initialValue2","initialValueInOptions","_this$initialValue$Da2","_this$initialValue3","_this$initialValue4","initialDataItem","IsRecent","hasDescendentRecent","autoSelect","forceSelection","_selection$primary","_this$initialValue5","primaryDate","nestedEntityDateFilter","valid","validLicenses","setCurrentValue","setFavorite","thisDataItem","thisField","thisItemIndex","databaseId","checkForPrimary","getClassifications","isCustomInput","isNotAvailable","deactivatedDate","checkNotAvailable","setNotAvailable","hasEffectiveRanges","setDefaultEntity","setupCustomEntryFeature","setupNotAvailableFeature","disableHelpers","isReady","runOnReady","func","_showCustomInputWarning","textFieldId","selectFieldId","subFieldCtrl","loadFieldData","setAdvancedSearch","registerForEvents","registerPrimaryDateFilter","feature","getCustomInputFeature","setCustomInput","valueSet","isNotAvailableFeatureEnabled","getNotAvailableFeature","IsRecentlyUsedEnabled","isInitializedValue","isFieldLocakble","enableHelpers","exceptedName","filterDataOnPrimaryDate","_d$Entities","_this$field$rootField","rootFieldId","IsCodeHidden","isFavoriteEnabled","matchSpecificity","MatchSpecificity","handleAdvancedSearchAction","refresh","_this$selection$frien","_this$selection2$prim","_this$selection$prima","newSelection","initializing","skipRangeCheck","isDefaultValue","updateCustomInputState","validEntities","selectionChanged","isDeactivated","featureActive","showCustomInputWarning","_this10","getElementById","txt","newState","inputLookup","_this$selection$prima2","_this$selection$frien2","_this11","setEntityTimezone","_this$selection$prima3","_this$selection$prima4","_this$selection$frien3","timezoneCode","getUniqueTimezoneForEntity","hasInitialValue","isSelectionValid","triggerValueChanged","filteredData","showExpand","setOptionIdType","registerEvents","isThisValueInNewForm","initialValueSet","hasHelperButtons","getOwnPropertyNames","updateFilteredData","hasSomeRecents","allowPivot","_this$field$EntityQue","_this$field$EntityQue2","_this$field$EntityQue3","_this$field$EntityQue4","_this$field$EntityQue5","forceTrigger","triggerLockUpdate","removeOptions","dataItems","newOptionIds","activeParams","suppressAutoselect","setChoice","customHelper","isInitializing","IncludeEffectiveRanges","_this$field$Rendering","_this$field$Rendering2","_this$field$Rendering3","_this$field$Rendering4","_this$field$Rendering5","_this$field$Rendering6","_this$field$Rendering7","_this$field$Rendering8","_this$field$Rendering9","hasSecondRowDirective","RenderingDirectives","Display","Selected","selectedItemDirectives","Print","getEntityDisplay","shouldFilterPrimaryOnStart","filterEnableNA","postOptionsChange","isFromInitialValue","opts","filteredDataArray","optionOne","optionTwo","intersectionWith","forcedNA","removeIsNotAvailableFeature","setupIsNotAvailableFeature","updateNotAvailableState","retainValue","silent","deletedChoice","_this$field$Rendering10","_this$field$Rendering11","activeOptions","option","listRenderingDirectives","List","recentOptions","lastVal","setupMapFeature","setupAdvancedSearchFeature","turnOnFeature","isNotAvailableFeatureIndex","AdvancedSearchEnabled","optionIdType","_this12","_this$selection$Class","_this$selection$Ident","hasUnhydratedClassifications","_value$this$optionIdT","_this13","_future$Id","_this14","compareValue","lastValue","future","_o$Id","warnBeforeChangeTrigger","showTriggerWarning","updateValue","_this15","preSelectValue","dataDictionary","preselectedValue","_fullResult$Entity","_fullResult$Contact","fullResult","fieldController","fieldControllers","_this$entityField","initialized","contactField","entityField","noSelfChange","fullEntity","force","forceInitValueChangeTrigger","_autoVessel$Contacts","_autoVessel$Entities","autoVessel","autoVesselContacts","contactValues","entityValues","_fullEntity$Contacts","_find","_selected$value","activeContacts","vals","flatten","contactVal","entityVal","initialValues","selections","mapPointFeature","areaIds","xorWith","groupRecents","selectValue","showNotAvailableSelections","updateSelectValue","checkForDirty","autoExpand","tagName","IsDirty","height","computed","getComputedStyle","getPropertyValue","scrollHeight","_self$currentValue","setCompassDirection","propName","forcePositive","fullMinutes","compassLetter","triggerDirtyEvent","newInitial","fromEvent","buoys","valueFields","isUpdatable","degreeMapper","isMapRequest","dmsDegrees","dmsMinutes","longitude","latitude","latCompassLetter","lonCompassLetter","lonDms","latDms","latDegrees","lonDegrees","defaultPosition","Center","Zoom","zoom","lat","lng","roundToNearestIncrement","evalValue","RangeError","maxCount","deltaFromLow","roundToFourDigits","low","high","retVal","IsZeroPadded","dec","isValidPartialNumber","roundToRoundingPoint","places","getPrecision","_self$currentValue2","lonDeg","latDeg","isDirtyLat","isDirtyLon","roundingPoint","deg","months","selectedMonth","utc","availableYears","earliestYear","currentYear","allOptions","years","monthLabel","yearLabel","monthFieldId","yearFieldId","convertJsDateToYearMonth","getJsDate","_this$selectedMonth2","_this$selectedMonth","isMonthReady","_this$selectedMonth4","_this$selectedMonth3","isYearReady","_this$selectedMonth5","monthBox","_this$selectedMonth6","monthChoices","_this$selectedMonth7","yearBox","_this$selectedMonth8","yearChoices","initialMinutes","initialDegrees","onNumberChanged","checkDirty","isMinutesDirty","isDegreesDirty","triggerNumberValueChange","_this$fieldValue","lastSetValue","_this$fieldValue2","_this$fieldValue2$num","initialFieldValue","_this$fieldValue3","ceil","roundToField","handleNumberUpdate","hasRepeatError","isThisField","validationErrorRepeatIds","validationWarningRepeatIds","skipUpdateTrigger","dateTime","entityContactSelector","simpleSelection","multiSelect","degreeMinute","preSelect","textarea","degreeMinuteField","coordinate","hideArrows","yearMonth","dynamicComponent","componentMap","locals","$new","_showTriggerWarning","repeatFields","isPivotExpanded","disableMultiEntryButton","pivotFields","pivotTypes","primaryPivotOptionIds","optionId","handleExpandedPivot","primaryPivotIds","primaryPivotType","triggerFieldId","triggeringControllers","expandPivot","refilterThis","clearPivoted","getFieldValues","fc","staticFields","sections","staticSectionedFields","staticUnsectionedFields","noSection","pivotedFields","isVisible","thisSection","hasPivotValue","sec","pivotField","configureTriggerWarnings","baseField","triggerField","recentItems","fullPivotOptions","orderedPivotOptions","setupVaryByField","disableMultiEntryCollapse","showLocks","hideTooltipFieldTypes","getForm","formIdentifier","toggleFieldLock","getReportStatus","_ctrl$report$History","reverseSortedHistory","Submitted","canAmend","getFormattedTime","LastModified","fromNow","hasBeenSubmitted","CanAmend","FILTER_OPERATORS","SORT_DIRECTIONS","CURSOR_DIRECTIONS","EXPORT_STATUSES","getStatus","_exportLog$Committed","_exportLog$Suppressed","externalStatus","loadExternalStatus","exportLog","Errored","Pending","Committed","Suppressed","resetPage","nextTotalItems","prevTotalItems","getCurrentOffset","currentPage","totalItems","itemsPerPage","getCurrentMaxPage","filterNonChange","suppressCallback","maxPage","updateRoute","updatePage","scroll","top","$current","page","_ctrl$options","_ctrl$options$itemsPe","_ctrl$options2","_ctrl$options3","pageSizes","defaultPageSize","updateUserPreference","signOut","signoutRedirect","openChangePasswordModal","openVersionInfo","roles","loadEntities","assignedPromise","friendlyEntities","formEntities","Association","_ENTITY_TYPES$l$Type$","_ENTITY_TYPES$l$Type$2","_l$Type$Name","targetTypeCode","getEntitiesForAllFields","assignConfigTypesToEntity","entityConfig","showDuplicateAssociationWarning","assns","assnsHtml","handleEntityAssociation","addPromise","entityQueryConfigurations","removeEntity","possibleRemove","addEntity","fakeLookup","getSelections","duplicateAssociations","val1","val2","newAssociations","differenceWith","handleEntitySelection","entityPermissions","groups","_groups$key","names","query","setSelector","viewEntity","appEntity","User","saveUser","ClientId","UserName","Username","userUpdate","apiRole","_appState$forms$selec9","Security","_appState$forms$selec10","userRole","roleUpdate","fullUpdate","_appState$forms$selec5","_appState$forms$selec6","_ctrl$userRole","_ctrl$userRole2","_appState$forms$selec7","_appState$forms$selec8","Role","setUser","createUser","_thisUserProfile$user","_thisUserProfile$user2","_thisUserProfile$user3","_thisUserProfile$user4","thisUserRoleCode","thisUserRole","securityRoles","invalidSuffix","_appState$forms$selec","_appState$forms$selec2","_appState$forms$selec3","_appState$forms$selec4","currentRole","securityRoleCode","loadUserDetails","CanPermit","requests","unprocessedRequests","IsProcessed","obj","tab","entityNomenclature","openRequests","dobString","process","_ctrl$resolve$entityC","_ctrl$resolve$entityC2","addAllLicenses","licensesToAdd","entityDetail","_ctrl$resolve$entityC3","handleDeselectDetails","primaryPluralNomenclature","_ctrl$form","_ctrl$form$nomenclatu","_ctrl$form2","_ctrl$form2$nomenclat","supportInfo","marked","_uibModal","onPrivacyClick","onSupportAndFeedbackClick","onTermsClick","canViewVeslFeedback","canViewAgencyFeedback","canViewAgencyPhoneNumber","canViewAgencyEmail","canViewAgencyMarkdown","getSeverityIcon","notice","Severity","markRead","Read","reading","readNotice","markAllRead","readingNotices","readAllNotices","_notices","isNoticeValid","showNoticeUnread","_SEVERITY_LEVELS$a$Se","_SEVERITY_LEVELS$a$Se2","_SEVERITY_LEVELS$b$Se","_SEVERITY_LEVELS$b$Se2","_SEVERITY_LEVELS$n$Se","severityDetails","logger","isTiered","filterDate","configureSelectbox","_this$renderingOption","_this$renderingOption2","renderingOptions","_this$entityQueryConf","_this$entityQueryConf2","isEntitySelf","setPrimary","activateModal","triggerParentChange","_this$renderingOption3","_this$renderingOption4","_this$renderingOption5","_this$renderingOption6","_this$renderingOption7","_this$renderingOption8","hidePrimary","validationQty","detailValidationQty","groupedValidations","ruleTitles","_rule$validationScope","_rule$validationScope2","_rule$validationScope3","_rule$Engine","IsAggregate","showAll","limit","compact","getComplianceMessage","_ctrl$status","Negative","hasBegun","messages","goToReportDetails","timeZoneCode","begin","Period","showLink","pixelOffset","mapHelpers","$base64","google","maps","InfoWindow","Marker","infoWindow","marker","_mapHelpers","_base64","lastEnteredArea","debouncedLoadElevation","loadElevation","oxford","initializeMap","setMapLayers","handleSelection","revertStyle","layer","overrideStyle","fillOpacity","elevationLoader","elevation","isAboveSeaLevel","meters","feet","currentWindowPosition","showInfoWindow","Polygon","geometry","polygonCenter","coordinates","Point","mouseover","getProperty","setHoverStyle","mouseout","click","setContent","setPosition","mapInstance","setMap","setFieldValueForFeature","LatLng","gestureHandling","streetViewControl","setMapTypeId","MapTypeId","HYBRID","bounds","LatLngBounds","getGeometry","forEachLatLng","latlng","fitBounds","getZoom","setZoom","addToLayer","setStyle","strokeColor","strokeOpacity","strokeWeight","fillColor","optimized","scaledSize","Size","events","getEvents","addListener","geoJson","decode","Shape","GeoJson","featureCollection","extractGeoJson","addGeoJson","CustomPopup","bubbleAnchor","containerDiv","draw","getPanes","floatPane","parentElement","removeChild","_this$getProjection","divPosition","getProjection","fromLatLngToDivPixel","y","innerHTML","firstChild","selectedZoom","defaultUSABounds","north","south","east","west","updatable","setMapLayer","locationVals","latLng","calloutHtml","setStationaryMarker","newVal","updateInfoWindow","currentPosition","getCoordinates","throttledUpdateInfoBox","throttle","updateInfoBoxPosition","mousemove","showFullInfo","hoverHtml","popup","setText","__proto__","OverlayView","setCenter","setBuoyLayer","depthDisplay","latDMS","lngDMS","lookupId","locationPromises","fieldPromise","registration","locationValue","_degreesToDms","unregister","fieldKey","activateCoupledModal","activateUncoupledModal","showTooltip","_center","valuesObj","setField","exactMatchTerms","primaryIdentifiers","fuzzySearchTerm","predicate","direction","onlyMatchExact","filterBy","paginatorOptions","hasLicenses","fuse","getClientDataFromField","loadClientDataIntoTable","showAdvancedSearch","selectedEntityType","clientData","source","applyfuzzySearchTermProperties","identifierColumn","extraData","dataBlock","identifierDisplay","codes","entityDisplay","list","matches","_element","_dynamicComponent","lookupSettings","areaSelector","advancedSearch","locationSelector","customInput","startPopupOpen","endPopupOpen","allMonths","rangeData","LMonth","startDate","endDate","CurWeek","CurMonth","CurYear","LYear","Custom","selectedYear","startModel","rangeOptions","optionKey","thisRange","matchingOption","endModel","startModelYear","endModelYear","startModelMonth","endModelMonth","paramMatch","currentRangeOption","onDateChange","onDateUpdate","configCall","configs","allowedConfigs","toDisplay","configurations","_c$Name","selectedConfiguration","onSelectionChanged","_this$configurations","loadConfigurations","DateTimeController","isTimepickerShown","isDatepickerShown","popupOpen","_this$form$TimeMode","_this$form$TimeMode2","timeZoneMode","_this$form$TimeZone","isDateOnly","modelMoment","_ctrl$valueTime","_ctrl$valueTime2","nextMoment","ngModelCtrl","schema","handleToggleIsExpanded","reportStates","timeToModify","getFullDate","getLastSubmittedDate","lastEntry","shortcutsEnabled","unpause","pause","timeDisplayOptions","onRemoteSupportClick","canViewVeslPhoneNumber","canViewVeslEmail","canViewRemoteSupport","showClose","onSupportClick","entityEffectiveStatus","asOfDate","comparePeriodStartDateAscending","shown","isShown","btnIsExpanded","_e$Entity$Effective","orderedEntities","mostRecentRangeStartMoment","unix","sortedRanges","eOne","eTwo","OutOfSeasonLicenses","_ENTITY_TYPES$e$Entit","_ENTITY_TYPES$e$Entit2","_e$Entity$Type","_ENTITY_TYPES$DEFAULT","primaryMoment","statusForPrimaryDate","unformatted","toggleButton","localBuildDate","BUILD_DATE","timeSinceBuildDate","enableCardReader","selectedDealer","sel","clearData","dealerField","formConfig","filterEntitiesByEffective","closed","onDealerValueChange","candidates","_status$children","_status$children2","nestedEntityEffectiveRangeStatus","agg","child","childStatus","hasValid","hasGrace","hasEither","grace","reportResponse","fishermanField","reportInfo","fishermanLicense","isDetail","vessel","vesselField","saveAndClose","cardData","findUnbrokenCardData","cardInfo","ExtractDataFromTrack","GetFormDataFromTrackData","beginIndex","lastIndexOf","endIndex","track","searchEndIndex","searchStartIndex","thisDataString","licenseCardData","extractSubdataFromCardField","yearCode","vesselCode","cardsIssued","agencyCode","licenseNumber","trackData","thisVesselLicense","thisVessel","thisFishermanLicense","fisherman","vesselLicense","run","$templateCache","schemaFormDecoratorsProvider","sfBuilderProvider","schemaFormProvider","defaults","datetime","defineAddOn","stdBuilders","base64FileUploadConfig","dropAreaHover","file","fileError","dropText","getFile","base64FileUpload","validateFile","reader","FileReader","ext","src","URL","createObjectURL","hasFile","fileSize","humanSize","onloadstart","loadingFile","onload","prefix","readAsDataURL","isImage","removeFile","files","dropArea","inputField","clickArea","dragOver","dragLeave","drop","dataTransfer","setDropText","base64Controller","base64Provider","sfPathProvider","string","stdFormObj","EntityController","entitySelectorFieldId","subjectEntity","modelProperty","entityController","mediaType","filename","downloadData","getProxyInfo","displayAction","proxySuccess","hasRun","currentProxy","validateModel","Body","Content","runAction","MediaType","showLoader","filetype","b64toBlob","navigator","msSaveOrOpenBlob","msSaveBlob","download","body","b64Data","contentType","byteCharacters","byteArrays","byteNumbers","charCodeAt","byteArray","Uint8Array","_Object$entries","NegativeReportModalController","periods","periodYear","beginDropdownDisplay","periodEndDay","endDropdownDisplay","sortIndex","beginPeriod","startPeriodIndex","endPeriod","beginPeriods","endPeriods","showValidationErrors","customReasonVal","negative","apiCall","numErrors","fill","singleExportDetail","export","exportInformationModal","exportsByConfiguration","_e$Log$Configuration$","Log","Configuration","IsCommitted","statusText","IsSuppressed","Created","showMore","actionInfoBlock","accessibilityModal","buildInformationModal","changePasswordModal","choicesSelect","compliancePeriodMessage","dateRangeSelector","dateTimePicker","environmentNotifier","formSelector","formSelectorModal","helpers","ieOverlay","loadingTracker","messageNotifications","messageNotification","messageListItem","messageBubble","pagination","primarySelector","privacy","reportActions","reportDetails","reportDetailsModal","reportForm","reportingEntitySelector","reportStatus","requireRole","supportFeedback","terms","tieredSelect","userEntities","userForm","userModal","userRequests","userEntityAssociation","validationCallout","settingsModal","cardSwipeModal","proxyModal","negativeReportModal","_ctrl$resolve","_ctrl$resolve$nomencl","accept","formAcceptance","decline","shouldPersistAcceptance","acceptAlways","noticesFlyout","noticeBanner","deletion","exportStatus","inventoryActions","inventoryQuantityModal","exportConfigurationSelector","effectiveRangeActions","exportInformationModals","fullNameFilter","$filter","collection","modified","_more","utcDateString","includeCount","fee","cleaned","formatCharge","capitalize","mgr","oidcProvider","fromRoute","getFromRoute","signinRedirectCallback","oauthRedirect","oauthSplash","errorMessage","periodNameMapper","reportHelper","timezoneService","complianceClasses","showTimeline","featureFlagCompliance","negativeFields","_friendly$Entities","_friendly$Effective","primaryReportingEntity","hasFedIdentifier","areAnyPrimaryEffectiveRangesScoped","areAnyFriendlyEffectiveRangesScoped","formSeasonIds","selectedSeason","entityMapper","_primary$Effective","_primary$Classificati","_friendly$Classificat","_primary$Identifiers","_friendly$Identifiers","seasonIds","primaryClassification","licenses","cachedReports","complianceTables","renderComplianceReports","selectedEntityIds","thisTable","currentPeriodIndex","currentPeriodPage","grid","paginationOptions","pageSet","watchCurrentPeriodIndex","defaultComplianceTable","pageComplianceTable","updateTableDataRangeToTimeline","_ctrl$timeline","_ctrl$timeline$itemsD","timeline","itemsData","rangify","at","scale","durationOfRange","duration","dataInRange","_data$filter2","minimumRange","fallbackRange","inRangeData","_data$filter","isBetween","_i2","_arr","dataWindowSize","momentify","newWindow","growth","pow","setWindow","setTimelineZoom","updateReportingEntitySelector","legendIsExpanded","fileNegative","isSelectedEntityHMS","clickedTable","thisPeriodIndex","consecutivePeriods","startingIndex","filterCallback","consecutiveData","findConsecutivePeriods","Compliant","hasOpened","hasClosed","firstIndexOffset","initialIndex","multiplePeriods","apiResponse","negatives","dataItem","newNegative","updateAlertSummaries","configureVis","deleteNegative","getFormattedOpenDate","getEmptyTableString","primaryEntityFirstChar","article","getComplianceIcon","iconProp","complianceIcons","compliant","notOpened","openNotCurrent","hasEnded","isPastDeadline","ended","pastDeadline","getComplianceColor","complianceStatusColors","periodNotOpen","periodNotStarted","currentPeriodWithNoReports","periodEndedWithNoReports","setSelectedReportingIndex","updateSeason","lastSelectedSeasonId","orderedTableIds","orderedTables","tlSkipBack","_getTimelineRange","getTimelineRange","tlSkipNext","_getTimelineRange2","tlZoomIn","_getTimelineRange3","rangeDiff","tlZoomOut","_getTimelineRange4","tableWidthCss","isAlertSummaryExpanded","timelineRange","alertSummaries","showAllAlerts","alertSummaryShowCount","ComplianceTimeline","visibleSeasons","beginInclusive","endExclusive","seasonId","visibleSeasonId","group","entityPeriodIndex","getComplianceClassName","vis","DataSet","setGroups","setItems","container","Timeline","stack","zoomMax","zoomMin","margin","axis","onTimelineItemClick","onTimelineRangeChanged","initializeTimeline","loadComplianceReportForPrimary","primaryEntity","_primaryEntity$rangeS","entitySeasons","rangeSeasons","selectedSeasons","currentDate","seasonIsBeforeFrame","seasonPromises","entityName","unsorted","filtered","seasonScope","isPeriodInEffectiveRanges","sortBy","tableData","seasonName","isObscured","seasonRangeLabel","compliancePeriod","matchingTable","_matchingTable$data","sortTableData","newTable","displayData","timeRangedTableData","snapshot","getComplianceSeasonForEntity","selectedReportIndex","aMoment","bMoment","what","hideTable","tableId","lastPage","startIndex","useFriendlyEntity","configuredTimezone","getConfiguredTimezoneCode","promises","_friendlyEntity$Entit","_friendlyEntity$Effec","hasPrimaryEntityRanges","_entity$Entity$Effect","hasFriendlyEntityRanges","loadPrimaryEffectiveRanges","_allSeasons","primaryRangeSeasons","uniquePrimaryRangeSeasons","overlapsWith","detectOverlappingPeriodsOfGreaterSpecificity","periodA","periodB","beginInclusiveMoment","isObscuredPeriod","keyedResults","displayText","loadSeasonsForEntity","hasWarningIcon","hasOpenIcon","updateComplianceTables","reportInformation","setTableItem","selectedItemIndex","selectedItemPage","moveTo","_data","endExclusiveMoment","periodsUnobscuredRange","openRange","candidate","againstPeriod","statusColor","statusIcon","statusLabel","reportName","hasAlerts","timeWindow","getWindow","canReadCompliance","dateOfBirth","noTimezoneFormCodes","setAgencyOptions","agencyBox","handleAgencyValueChanged","clearModel","birthDate","loadCurrentRequests","_loadCurrentRequests","_ctrl$selectedForm4","pendingRequests","datepickerMode","selectedTimeZone","entityDescriptor","collectTimeZone","requestableForms","setAgencyBox","setFormBox","formBox","setTimeZoneBox","timeZoneBox","userTimeZoneGuess","guess","sc","agencyForms","hmsPermitNumber","handleFormValueChanged","setFormOptions","isCheckedCode","_ctrl$checkboxes","checkboxes","_ctrl$selectedForm","_ctrl$selectedForm2","_ctrl$selectedForm3","_ctrl$selectedForm$No","_ctrl$selectedForm$No2","Nomenclature","entityLabel","requiredField","requiredFieldDataCode","agencyPhone","handleTimeZoneValueChanged","submitting","_value$toString","phoneInvalid","promptValidationError","birthdateInvalid","birthdayMoment","makeRequest","checkboxVals","optionalValues","identifiersString","PhoneNumber","openDatepicker","$transitions","filterService","ruleService","detailValuesKey","reportScopes","_unsubscribe","isProcessingRules","dirtyDetailTracking","isReportDirty","dirtyHeaderFields","ruleProvider","subscribe","didFormReload","staleTimeoutAt","invalidTimeoutPadded","reloadForm","reportFields","staticDetailFields","pivotedDetailFields","setReportMetadata","reportMetadata","isNew","footerNomenclature","getNewValidationService","initializeFeatures","setFieldOptions","setupTimezoneOverride","initializeRules","loaded","asyncInit","deregisterTransitionHook","detailModalInstance","alertUserIfDirty","_handleDelete","_handleWithdraw","_handleRestore","handleDetailSave","saveValues","newDetails","headerVals","hasBlockSave","prevPromise","ruleAcc","_valuesByScope","valuesByScope","evals","checkEvalsForBlockSave","runDetailsRules","currentDetailEval","reportValues","setReportState","leading","handleDetailSelected","saveReport","handleSubmit","_handleSubmit","setValidationsForDetails","processRules","ruleScopes","commit","nextReport","Prefer","updateReport","createReport","prevReport","detailModalIsOpen","_detail$detailId","currentDetailId","valueDictionary","thisDetailValueArray","getValuesByType","filterValues","triggerFilters","triggerPrimaryDateFilter","initializeNewField","getAllValues","valueProviderRegistrar","headerModifiedDates","validationScopes","suppressDetails","fakeDetailValidation","showActionInfoBlock","ActionInfoBlock","canCopyToNew","submitEventBuilder","unsavedChangesEvent","reportSaveEventBuilder","newReport","_newReport$History","_newReport","_ctrl$reportMetadata$","_ctrl$reportMetadata$2","initial","reportStateCopy","reportRules","groupReportValues","primaryEntityName","setPrimaryEntityName","_reportValues","primaryEntityFieldConfig","primaryEntityValue","_reportValues2","isReportCopy","reportDetailValues","detailsById","detailIdKey","buildReportOpenedEvent","setApiValidations","updateRuleMetadata","pageIsLoaded","IsFieldDefaultEnabled","_ctrl$currentHistory","initiator","minBy","initiatorField","reportValue","reportField","uiValidations","suppressErrors","updateApiValidations","disableLockOnDataFields","setReportReadonlyStatus","isSuppressed","updateReportDirty","onExit","_ctrl$currentHistory2","confirm","undeletedDetailsNested","undeletedDetails","lockOnDetailDataFields","lockOnDetailData","_ctrl$currentHistory3","_ctrl$currentHistory4","dateFields","notifyUserTimezoneError","timezoneAbbr","primaryEntityField","thisReportEntityValue","thisReportEntityTimezoneCode","notifyTimezoneDiscrepancy","z","tzAbbr","notifyFormTimezoneError","isSimpleRangeRule","rangeRule","srr","hcrr","IsFullWidth","setFieldSize","_data$Effective","ReadOnlyMode","parentFields","fi","IsSticky","registerDetailFieldForPrimaryDate","pf","feat","mapPoint","featureField","featureProperties","isInitiator","fieldFeature","registerFilterEvent","selectedField","executeFilter","filterField","selectedFields","searchBy","nextIds","truncatedData","distinctIds","handleFilterEvent","protocol","hostname","port","btoa","ready","propertiesToStrip","whitelistedProperties","cleanValue","returnVal","Detail","nonWhitelistedPropertiesRemaining","isApi","allNonWhitelistedProperties","_cleanValue","detailValArray","_cleanValue2","valueConfig","uniqueNonWhitelistedProperties","invalidTimeoutAt","getRuleValidationsOfType","setRecentlyUsed","setModifiedDates","readOnlyModeFields","_resp$Data","LinkKey","matchingVal","serverRules","keyedEvals","newDetailTableVals","flatMapDeep","ruleValidations","ruleProcessingPromise","registeredConditionFieldIds","uiRules","visibilityRules","filterRules","runProcessVisibilityRules","isProcessingQueueInUse","processingQueueTimer","clearTimeout","sectionScope","valueScopes","runScopes","ruleProcesses","visibleFieldIds","detailItem","mergedDetails","mergeDetails","rulesToProcess","scopeValues","processed","isProcessingQueueUnsettled","groupEnd","lastProcess","ruleIds","conditionFieldId","thisFilterRules","executeFilterTriggers","fieldRuleMap","triggerTypes","initializeConditionsOrChildren","rootRuleId","ruleTriggerFieldIds","newRuleTriggerFieldIds","_t$Field2","conditionField","childRule","_t$Field","fr","rpvalues","showHeaderValidationsOnly","_resp$Data4","t1","_callee6","submitRequestEvent","_context6","submitPromise","_activeBlockSave$rule","_activeBlockSave$rule2","_activeBlockSubmit$ru","_activeBlockSubmit$ru2","_activeWarnings$rules","_activeWarnings$rules2","activeBlockSave","activeBlockSubmit","activeWarnings","reportIsDirty","continueSubmission","dirtyFieldCount","dirtyDetailCount","saveBlocked","submitBlocked","withWarnings","confirmed","submitReport","runSubmit","_resp$Data2","_resp$Data3","fieldsToTrigger","triggerFields","triggerValues","thisFilterValue","reportVal","primaryDateValue","primaryDateFilter","primaryDateFields","primaryDateField","copyToNew","allReportValues","merged","detailIdToLinkKeyMap","_v$Detail","_v$DetailId","_v$Detail2","thisDetailId","tableHelper","_loadEntities","_entityType$Name","additionalHeaders","anyEntitySubPath","pluralName","createAuthorizeAction","canModify","setTableData","_typeConfig$ExternalK","_typeConfig$ExternalK2","rank","hasExternalKeys","hideCodeColumn","legacyPermittedTypes","allEntityTypes","allowedEntityTypes","preventEdit","Count","applicableEntityFields","onCollapse","createExportModal","_saveReport","exportReports","exportNegatives","exportLogReports","exportLogRequest","enqueue","includedReports","includedNegatives","Report","Reports","selectedConfig","loadPendingReports","_loadPendingReports","_exportableReports$It","exportableReportsPromise","exportableReports","augmentedReports","exportableReportIds","Filter","Cursor","Direction","_friendly$Entities$fi","getFriendlyForPrimaryId","thisEntity","periodIds","seasonPeriod","matchingPeriod","periodLabel","periodRange","availableConfigs","dateLabel","areAllReportsSelected","areAllNegativesSelected","handleSaveExport","updateConfig","selectAllReports","toggleReportSelection","selectAllNegatives","toggleNegativeSelection","viewReport","informationTab","aggregateReportExports","_ctrl$exportLog$Repor","_ctrl$exportLog","_reports$length","totalReports","committed","sumBy","errored","_r$Errors","metadataTab","clipboard","canClipboard","supported","reportExport","metadataModal","_openMetadataModal","viewMetadata","openMetadataModal","reportsTab","reportExportActions","_loadReports","_reports$Items","_exportReport$Errors","exportReport","elr","loadReports","viewExportModal","_loadExportLog","fullExportLog","loadExportLog","allowedConfigsToCreate","getExports","_getExports","_ctrl$currentLogs$Dat","_getDateRangeFilter","selectedExportConfig","totalLogs","getDateRangeFilter","And","Sort","By","Page","currentLogs","Total","millisecond","exportItems","_ctrl$totalLogs2","_ctrl$totalLogs","exportConfigurations","hasAnyUxAction","isByChangedConfig","_ctrl$paginatorOption","_ctrl$paginatorOption2","_ctrl$paginatorOption3","_ctrl$paginatorOption4","dateStart","dateEnd","exportData","keyboard","tableDataUpdate","updateSearchFilter","clearSearchFilter","updateDateFilter","onExportSelectionChanged","createNewExport","_ctrl$paginatorOption5","_ctrl$paginatorOption6","_ctrl$paginatorOption7","_ctrl$paginatorOption8","MessagingScreen","messagingService","featureFlags","threads","getThreadList","getAllContacts","currentThread","thread","fullThread","getThread","threadId","loadThreadHeader","thisUserId","participantArray","participantString","participantInitials","avTextColor","threadHeader","subject","newMessage","ROLE_TYPES","pagePreference","timeFormat","dateOnlyFormat","statusOptions","updateReportSearch","statusKey","licenseIds","license","buildReportListEvent","Ids","ie","userAgent","ie11","ieEDGE","ieVer","version","textFileAsBlob","fileNameToSaveAs","selectReports","clearSelection","selectAll","getEditButtonIcon","editable","getExtraData","_ctrl$extraColumns","extraColumns","col","rawItemData","autoParseAttempt","indexOfUnit","itemUnit","rawItemNumber","rounding","extractColumnData","endDateParam","startDateParam","editReport","getDateTime","dateData","_thisMoment","thisMoment","primaryDateColumn","onStatusSelectorChange","updateUrl","onLicenseSelectorChange","currentProfile","showFriendlyEntitySelector","selectedLicenseIsNotValid","primaryAssociatedEntityName","anyNotSelected","isFriendlySelf","BeginDate","EndDate","buildReportsRequest","IsIncludedInHeaderSummary","fieldInfo","dateColumns","formField","entitiesTimeZones","uniqueZones","timeZoneAbbr","getTimezoneByIANACode","currentEntity","dateTzMoment","lmTzMoment","EntityName","singleExtraDataColumn","momented","overridden","fishermanColumn","Fisherman","sellerColumn","reportsLabel","entityIdsParam","triggerMethods","ruleConfigService","observers","providers","valuesArrays","evalScopes","validationRules","filteredRules","groupedRules","ruleEvaluations","isDetailPivoted","scopeEvals","executeTriggers","headerResult","detailResult","_triggerMetadata","triggerMetadata","processingDetailId","notDeletedValues","groupedVals","headerVal","detailValuesById","comboVal","allProcessedRules","Aggregation","aggregationAction","detailResults","ruleResult","processSingleRule","_rule$visibilityScope","comboResults","visibilityScope","singleRuleResult","headerOnlyResult","shouldReRun","validatedRules","mapping","_r$Operator","_r$validationScope","_r$visibilityScope","Result","Details","groupCollapsed","vr","thisResult","triggerReturn","notify","validatePromise","cb","reportScope","_run","proxyHeader","singularItemLabel","pluralItemLabel","proxyFilter","proxies","complianceReport","dashboard","messaging","publicPages","reportList","_resendInvite","createName","_user$Username","meta","username","IsRequestOutstanding","allData","isSysAdmin","resetPassword","resendInvite","onLastLoginChange","impersonate","signinTracker","loginRanges","rangeBegin","lastLoginRange","welcome","apiServiceModule","factory","isRetrying","showErrorToastAndLogout","timeout","getAccessToken","requestError","rejection","signinSilent","$http","http","baseUrl","apiUrl","setDefaultHeader","common","endpoint","httpConfig","downloadCsv","Accept","baseEntityPermission","allTypePermissionsTransform","merge","defaultPermissions","rolePermissionTransforms","defaultRolePermissions","ruleValidator","initProfiles","getDefaultState","sessionStorage","toJson","_userProfile$formAcce","hash","CryptoJS","SHA256","userFormHash","formAcceptances","enc","Hex","loadForm","windowClass","formCode","_userProfile$formAcce2","mustSelect","foundForm","isServiceUnavailable","swalInstance","updatedForm","durationPattern","durationEnd","parseDuration","timeoutDuration","paddedDurationInMs","toSeconds","fullSection","section","_field$Section","csvText","Binary","mapFeaturesToFields","setAssociatedEntities","loadEntityFieldData","filterToValidRules","conditionFields","evaluatedConditionFieldIds","assignFieldOrders","getVisibilityRuleScope","applyFunctionToAllChildRules","_childRule$Blob","_childRule$Blob2","translations","buildFormTranslations","addResourceBundle","securityResponse","apiRoles","_apiRoles$Assigned","_formConfig$Permissio","_formConfig$Permissio2","_formConfig$Permissio3","_permissions$assigned","assignedRoleCode","assignedRole","ro","defaultRoleNames","assignedRoleName","webSpecificPermissions","Web","allUserPermissions","getPermissions","loadPermissions","formSecurityRoleIndex","updateContacts","mapRecentlyUsedUpdate","assign","getRecentlyUsed","setUnavailable","isBackgroundRequest","onOpen","clearUnavailable","fromJson","toUpdateIndex","updatedItem","getCurrentUrl","oAuthUser","accessObject","decoder","access_token","userDbId","profile","authData","expires","issued","nbf","preferred_username","DEFAULT_MAP_ID","Loader","batchCall","_ref$wait","wait","_ref$mapKeyFn","mapKeyFn","_ref$cacheArgFn","cacheArgFn","_ref$limit","cache","queuedKeys","processBatch","debouncedProcessBatch","getResolvablePromise","flush","rej","immediate","callNow","later","newLoader","_construct","hostElement","invoke","defaultProps","kebabCase","unbinder","$emit","FeatureCallbacks","inGrace","initialIsNotAvailableState","initialIsCustomInputState","areaDefinition","fieldDataPoints","shapeFields","dp","sf","IsNotAvailableEnabled","$interval","refreshAccessToken","loadingModal","svc","loadingModalScope","activationDelay","minDuration","loadingMessage","overlayLoader","getCircularReplacer","seen","WeakSet","simplify","rest","simplified","shouldLog","appInsights","Mousetrap","telemetryCallback","originalBind","LEVELS","Warning","Info","Critical","Verbose","Debug","NotImplemented","PageView","Snapshot","processMessage","_console","severity","SeverityLevel","color","background","Information","Trace","trackTrace","severityLevel","critical","info","trace","verbose","debugWhen","_len10","_key10","_len11","_key11","_len12","objs","_key12","_len13","_key13","_len14","_key14","trackException","telemetryContext","telemetryTrace","traceID","Util","newId","trackPageView","measurements","exec","diagnostics","trackEvent","timeEnd","timeLog","timeStamp","_console2","_console3","_console4","setAuthenticatedUserContext","clearAuthenticatedUserContext","_console5","ApplicationInsights","connectionString","enableDebug","verboseLogging","enableCorsCorrelation","maxAjaxCallsPerView","autoTrackPageVisitTime","correlationHeaderExcludedDomains","loadAppInsights","envelope","RemoteDependencyData","envelopeType","baseData","responseCode","initializer","addTelemetryInitializer","enablePageViewConsole","enableEventConsole","enableVerboseConsole","setupAi","originalCallback","shortcut","loggingCallback","otherBindArgs","dataloader","elevator","ElevationService","latLngObjs","locations","getElevationForLocations","enhancedResults","enhancedResult","rawValue","MessagingService","messageId","timestamp","_loadingService","thisThread","ReportHelper","_err$Data","_resp$Rules","handleStatusChangeError","_resp$Rules2","DetailHelper","fieldDefinitions","hasPivotedRows","groupedValues","assignDetailLinkKeys","detailGroupedValues","rowValues","linkKey","detailValueArrays","keyedValArray","va","TableHelper","score","getFn","isNoFilterSorted","verifyScore","LastLogin","$anchorScroll","flash","elementId","_options","mapped","_item$Id$toString","_item$Id","searchOptions","slots","getRenderingSlots","slot","hasOption","hasData","itemIsDeactivated","badge","mapItems","displayBlocks","renderingOption","appliedClass","friendlyCopy","_getRenderingSlots2","slot0Data","slot1Data","slot2Data","slot3Data","getSlotDisplay","_slot$data","getHtmlForDirective","getDefaultEntityDisplay","getLastFour","subStringOf","subString","colour","colorNum","redVal","greenVal","blueVal","getAdvancedDirectiveValue","nestedSelectedEntity","advancedRenderingOption","getSingleRenderedValue","optionValue","_item$option","isBold","isItalic","styleProp","findDataItem","dataValue","dataModifiers","padLeft","minLength","padStart","padRight","padEnd","renderingSlotDefinitions","_renderedOptionData$","renderedOptionData","opt","foundData","getSlotData","friendlyDisplay","primaryDisplay","singleKey","nestedOption","nestedData","arrayData","keyValOption","dataItemArray","foundDataItem","findItemInArray","filteredArrayData","TimezoneService","_entity$primary","_entity$friendly","entityTimeZoneCode","exact","userTimeZoneCode","hasPendingValidations","formRules","formFields","getRuleFields","findTriggeredRules","updateRuleValidations","currRule","lastRule","isSameDetail","validationOperator","pendingType","combinedRules","ruleId","Rule","thisTriggeredRule","formRule","updateFieldHighlights","findConditionField","checkDetailId","isRuleForDetail","isField","findTriggerFields","applyErrorValidation","applyWarningValidation","cond","_cond$Field","validationServiceInstantiator","CardSwipeService","createCardSwipeReport","selectedPrimaryEntityValue","trueShortCircuitEngines","falseShortCircuitEngines","RuleService","operatorAction","childrenEvaluations","reportState","currentValues","IsNot","evaluateAllConditions","postInverter","conditionEvaluations","evaluateCondition","handleChildEvaluations","templateField","engineType","engine","onLine","preparedValuesByDetailId","valuesByDetailId","valuesForDetail","RuleConfigService","fieldConfigs","conditionFieldIds","_rule$Triggers","_t$Type","_t$Operator","_fieldConfigs$find","evaluatees","evaluatedFieldIds","highlightTriggerFields","visibilityTriggers","uxTriggerFields","triggerFieldIds","evaluatedTriggerFieldIds","_rule$Conditions","_rule$Children","updater","_rule$Children2","getFullItemValue","currentItem","parentItem","isEntityItem","_parentItem$Classific","_currentItem$Classifi","evaluateValueCombination","triggerAddedValues","dataItemId","ruleFilterTriggers","triggeringFieldId","getOrderedRuleFilterTriggers","allDataItemFilters","allFilterFieldIds","isEntityTriggerField","triggerRemovedValues","entityItem","ruleEval","trueEvaluations","dataItemIds","nomenclatureTranslationKeyMap","language","isDefault","_form$Translations$la","_form$Translations","nomenclatureTranslations","mapNomenclatureToTranslations","typesTranslations","getTypesTranslations","final","_text","nextKey","getTypeTranslations","getTypeKeyPrefix","_type$Translations","_type$Translations$la","_type$Translations2","Labels","ExternalKey_other","Classification_other","loading","setNomenclature","featureValues","featureFlagClient","initPromise","featuresLoaded","loadFeatures","featurePromises","featureName","featurePromise","userObject","complete","configcat","configCat","forceRefreshAsync","allProfiles","oidcSettings","authority","ssoUrl","client_id","redirect_uri","silent_redirect_uri","post_logout_redirect_uri","response_type","automaticSilentRenew","OpenIdService","showLoaderOnConfirm","preConfirm","_preConfirm","routeName","routeParams","fromRouteJSON","UserManager","addSilentRenewError","renewError","clearStaleState","RuleValidator","_rule$Conditions2","conditions","engineFuncName","_c$Operator","_c$Operator2","_ENGINE_EVALUATIONS$e","thisConditionOperator","validTriggerOperators","validators","validateRule","checkRuleForPresenceOfChildrenOrEngine","checkRuleForValidEngineAndEvaluation","checkRuleForValidTriggers","checkRuleForValidFields","noticeBegin","noticeEnd","Interval","lastRead","_notice$Interval$spli2","part","totalDurationInSeconds","noticeIndex","allRead","allResp","Notice","SecurityActionEffects","ActionAdapter","glob","isMatch","pathOrGlob","$action","$glob","_Symbol$iterator","ActionsAdapter","subpath","$actions","effect","denies","deny","SecurityService","securityBlob","_formSecurity$Assigne","_formSecurity$Assigne2","formSecurity","selectedRoleCode","selectedRole","formActionAdapters","securityActions","hasSubpath","InitializationService","pageLoaded","intervalService","userProfileSvc","uibs","angularToastr","uiSelect","focusIf","layout","services","screens","behaviors"],"mappings":"mBACE,SAASA,qBAAqBC,MAQ7B,IAPA,IAMIC,SAAUC,QANVC,SAAWH,KAAK,GAChBI,YAAcJ,KAAK,GACnBK,eAAiBL,KAAK,GAIHM,EAAI,EAAGC,SAAW,GACpCD,EAAIH,SAASK,OAAQF,IACzBJ,QAAUC,SAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,gBAAiBX,UAAYW,gBAAgBX,UACpFK,SAASO,KAAKD,gBAAgBX,SAAS,IAExCW,gBAAgBX,SAAW,EAE5B,IAAID,YAAYG,YACZK,OAAOC,UAAUC,eAAeC,KAAKR,YAAaH,YACpDc,QAAQd,UAAYG,YAAYH,WAKlC,IAFGe,qBAAqBA,oBAAoBhB,MAEtCO,SAASC,QACdD,SAASU,OAATV,GAOD,OAHAW,gBAAgBJ,KAAKK,MAAMD,gBAAiBb,gBAAkB,IAGvDe,uBAER,SAASA,uBAER,IADA,IAAIC,OACIf,EAAI,EAAGA,EAAIY,gBAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,eAAiBJ,gBAAgBZ,GACjCiB,WAAY,EACRC,EAAI,EAAGA,EAAIF,eAAed,OAAQgB,IAAK,CAC9C,IAAIC,MAAQH,eAAeE,GACG,IAA3BX,gBAAgBY,SAAcF,WAAY,GAE3CA,YACFL,gBAAgB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G,KCtDd,SACd7iG,WACA8iG,eACA92G,QACAyW,OACAjW,SAEAwT,WAAWhU,QAAUA,QAErB82G,eAAe/rE,IAAI,4BAvBO,8RAyB1B5E,2BAAee,SAASlX,KAAKxvB,YD6C9Bb,+BAAkBqW,SAAU,CAAC","file":"app.7b30e885d8b2f605f40c.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([843,1]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","var map = {\n\t\"./af\": 212,\n\t\"./af.js\": 212,\n\t\"./ar\": 213,\n\t\"./ar-dz\": 214,\n\t\"./ar-dz.js\": 214,\n\t\"./ar-kw\": 215,\n\t\"./ar-kw.js\": 215,\n\t\"./ar-ly\": 216,\n\t\"./ar-ly.js\": 216,\n\t\"./ar-ma\": 217,\n\t\"./ar-ma.js\": 217,\n\t\"./ar-sa\": 218,\n\t\"./ar-sa.js\": 218,\n\t\"./ar-tn\": 219,\n\t\"./ar-tn.js\": 219,\n\t\"./ar.js\": 213,\n\t\"./az\": 220,\n\t\"./az.js\": 220,\n\t\"./be\": 221,\n\t\"./be.js\": 221,\n\t\"./bg\": 222,\n\t\"./bg.js\": 222,\n\t\"./bm\": 223,\n\t\"./bm.js\": 223,\n\t\"./bn\": 224,\n\t\"./bn.js\": 224,\n\t\"./bo\": 225,\n\t\"./bo.js\": 225,\n\t\"./br\": 226,\n\t\"./br.js\": 226,\n\t\"./bs\": 227,\n\t\"./bs.js\": 227,\n\t\"./ca\": 228,\n\t\"./ca.js\": 228,\n\t\"./cs\": 229,\n\t\"./cs.js\": 229,\n\t\"./cv\": 230,\n\t\"./cv.js\": 230,\n\t\"./cy\": 231,\n\t\"./cy.js\": 231,\n\t\"./da\": 232,\n\t\"./da.js\": 232,\n\t\"./de\": 233,\n\t\"./de-at\": 234,\n\t\"./de-at.js\": 234,\n\t\"./de-ch\": 235,\n\t\"./de-ch.js\": 235,\n\t\"./de.js\": 233,\n\t\"./dv\": 236,\n\t\"./dv.js\": 236,\n\t\"./el\": 237,\n\t\"./el.js\": 237,\n\t\"./en-au\": 238,\n\t\"./en-au.js\": 238,\n\t\"./en-ca\": 239,\n\t\"./en-ca.js\": 239,\n\t\"./en-gb\": 240,\n\t\"./en-gb.js\": 240,\n\t\"./en-ie\": 241,\n\t\"./en-ie.js\": 241,\n\t\"./en-il\": 242,\n\t\"./en-il.js\": 242,\n\t\"./en-in\": 243,\n\t\"./en-in.js\": 243,\n\t\"./en-nz\": 244,\n\t\"./en-nz.js\": 244,\n\t\"./en-sg\": 245,\n\t\"./en-sg.js\": 245,\n\t\"./eo\": 246,\n\t\"./eo.js\": 246,\n\t\"./es\": 247,\n\t\"./es-do\": 248,\n\t\"./es-do.js\": 248,\n\t\"./es-us\": 249,\n\t\"./es-us.js\": 249,\n\t\"./es.js\": 247,\n\t\"./et\": 250,\n\t\"./et.js\": 250,\n\t\"./eu\": 251,\n\t\"./eu.js\": 251,\n\t\"./fa\": 252,\n\t\"./fa.js\": 252,\n\t\"./fi\": 253,\n\t\"./fi.js\": 253,\n\t\"./fil\": 254,\n\t\"./fil.js\": 254,\n\t\"./fo\": 255,\n\t\"./fo.js\": 255,\n\t\"./fr\": 256,\n\t\"./fr-ca\": 257,\n\t\"./fr-ca.js\": 257,\n\t\"./fr-ch\": 258,\n\t\"./fr-ch.js\": 258,\n\t\"./fr.js\": 256,\n\t\"./fy\": 259,\n\t\"./fy.js\": 259,\n\t\"./ga\": 260,\n\t\"./ga.js\": 260,\n\t\"./gd\": 261,\n\t\"./gd.js\": 261,\n\t\"./gl\": 262,\n\t\"./gl.js\": 262,\n\t\"./gom-deva\": 263,\n\t\"./gom-deva.js\": 263,\n\t\"./gom-latn\": 264,\n\t\"./gom-latn.js\": 264,\n\t\"./gu\": 265,\n\t\"./gu.js\": 265,\n\t\"./he\": 266,\n\t\"./he.js\": 266,\n\t\"./hi\": 267,\n\t\"./hi.js\": 267,\n\t\"./hr\": 268,\n\t\"./hr.js\": 268,\n\t\"./hu\": 269,\n\t\"./hu.js\": 269,\n\t\"./hy-am\": 270,\n\t\"./hy-am.js\": 270,\n\t\"./id\": 271,\n\t\"./id.js\": 271,\n\t\"./is\": 272,\n\t\"./is.js\": 272,\n\t\"./it\": 273,\n\t\"./it-ch\": 274,\n\t\"./it-ch.js\": 274,\n\t\"./it.js\": 273,\n\t\"./ja\": 275,\n\t\"./ja.js\": 275,\n\t\"./jv\": 276,\n\t\"./jv.js\": 276,\n\t\"./ka\": 277,\n\t\"./ka.js\": 277,\n\t\"./kk\": 278,\n\t\"./kk.js\": 278,\n\t\"./km\": 279,\n\t\"./km.js\": 279,\n\t\"./kn\": 280,\n\t\"./kn.js\": 280,\n\t\"./ko\": 281,\n\t\"./ko.js\": 281,\n\t\"./ku\": 282,\n\t\"./ku.js\": 282,\n\t\"./ky\": 283,\n\t\"./ky.js\": 283,\n\t\"./lb\": 284,\n\t\"./lb.js\": 284,\n\t\"./lo\": 285,\n\t\"./lo.js\": 285,\n\t\"./lt\": 286,\n\t\"./lt.js\": 286,\n\t\"./lv\": 287,\n\t\"./lv.js\": 287,\n\t\"./me\": 288,\n\t\"./me.js\": 288,\n\t\"./mi\": 289,\n\t\"./mi.js\": 289,\n\t\"./mk\": 290,\n\t\"./mk.js\": 290,\n\t\"./ml\": 291,\n\t\"./ml.js\": 291,\n\t\"./mn\": 292,\n\t\"./mn.js\": 292,\n\t\"./mr\": 293,\n\t\"./mr.js\": 293,\n\t\"./ms\": 294,\n\t\"./ms-my\": 295,\n\t\"./ms-my.js\": 295,\n\t\"./ms.js\": 294,\n\t\"./mt\": 296,\n\t\"./mt.js\": 296,\n\t\"./my\": 297,\n\t\"./my.js\": 297,\n\t\"./nb\": 298,\n\t\"./nb.js\": 298,\n\t\"./ne\": 299,\n\t\"./ne.js\": 299,\n\t\"./nl\": 300,\n\t\"./nl-be\": 301,\n\t\"./nl-be.js\": 301,\n\t\"./nl.js\": 300,\n\t\"./nn\": 302,\n\t\"./nn.js\": 302,\n\t\"./oc-lnc\": 303,\n\t\"./oc-lnc.js\": 303,\n\t\"./pa-in\": 304,\n\t\"./pa-in.js\": 304,\n\t\"./pl\": 305,\n\t\"./pl.js\": 305,\n\t\"./pt\": 306,\n\t\"./pt-br\": 307,\n\t\"./pt-br.js\": 307,\n\t\"./pt.js\": 306,\n\t\"./ro\": 308,\n\t\"./ro.js\": 308,\n\t\"./ru\": 309,\n\t\"./ru.js\": 309,\n\t\"./sd\": 310,\n\t\"./sd.js\": 310,\n\t\"./se\": 311,\n\t\"./se.js\": 311,\n\t\"./si\": 312,\n\t\"./si.js\": 312,\n\t\"./sk\": 313,\n\t\"./sk.js\": 313,\n\t\"./sl\": 314,\n\t\"./sl.js\": 314,\n\t\"./sq\": 315,\n\t\"./sq.js\": 315,\n\t\"./sr\": 316,\n\t\"./sr-cyrl\": 317,\n\t\"./sr-cyrl.js\": 317,\n\t\"./sr.js\": 316,\n\t\"./ss\": 318,\n\t\"./ss.js\": 318,\n\t\"./sv\": 319,\n\t\"./sv.js\": 319,\n\t\"./sw\": 320,\n\t\"./sw.js\": 320,\n\t\"./ta\": 321,\n\t\"./ta.js\": 321,\n\t\"./te\": 322,\n\t\"./te.js\": 322,\n\t\"./tet\": 323,\n\t\"./tet.js\": 323,\n\t\"./tg\": 324,\n\t\"./tg.js\": 324,\n\t\"./th\": 325,\n\t\"./th.js\": 325,\n\t\"./tl-ph\": 326,\n\t\"./tl-ph.js\": 326,\n\t\"./tlh\": 327,\n\t\"./tlh.js\": 327,\n\t\"./tr\": 328,\n\t\"./tr.js\": 328,\n\t\"./tzl\": 329,\n\t\"./tzl.js\": 329,\n\t\"./tzm\": 330,\n\t\"./tzm-latn\": 331,\n\t\"./tzm-latn.js\": 331,\n\t\"./tzm.js\": 330,\n\t\"./ug-cn\": 332,\n\t\"./ug-cn.js\": 332,\n\t\"./uk\": 333,\n\t\"./uk.js\": 333,\n\t\"./ur\": 334,\n\t\"./ur.js\": 334,\n\t\"./uz\": 335,\n\t\"./uz-latn\": 336,\n\t\"./uz-latn.js\": 336,\n\t\"./uz.js\": 335,\n\t\"./vi\": 337,\n\t\"./vi.js\": 337,\n\t\"./x-pseudo\": 338,\n\t\"./x-pseudo.js\": 338,\n\t\"./yo\": 339,\n\t\"./yo.js\": 339,\n\t\"./zh-cn\": 340,\n\t\"./zh-cn.js\": 340,\n\t\"./zh-hk\": 341,\n\t\"./zh-hk.js\": 341,\n\t\"./zh-mo\": 342,\n\t\"./zh-mo.js\": 342,\n\t\"./zh-tw\": 343,\n\t\"./zh-tw.js\": 343\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 671;","/* eslint-disable no-prototype-builtins */\r\nimport moment from \"moment\";\r\n\r\n//from: https://github.com/rotaready/moment-range\r\n//copied since not maintained, and lib is massive\r\nconst INTERVALS = {\r\n\tyear: true,\r\n\tquarter: true,\r\n\tmonth: true,\r\n\tweek: true,\r\n\tday: true,\r\n\thour: true,\r\n\tminute: true,\r\n\tsecond: true\r\n};\r\n\r\nexport class DateRange {\r\n\tconstructor(start, end) {\r\n\t\tlet s = start;\r\n\t\tlet e = end;\r\n\r\n\t\tif(arguments.length === 1 || end === undefined) {\r\n\t\t\tif(typeof start === \"object\" && start.length === 2) {\r\n\t\t\t\t[s, e] = start;\r\n\t\t\t}\r\n\t\t\telse if(typeof start === \"string\") {\r\n\t\t\t\t[s, e] = isoSplit(start);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.start = s || s === 0 ? moment(s) : moment(-8640000000000000);\r\n\t\tthis.end = e || e === 0 ? moment(e) : moment(8640000000000000);\r\n\t}\r\n\r\n\tadjacent(other) {\r\n\t\tconst sameStartEnd = this.start.isSame(other.end);\r\n\t\tconst sameEndStart = this.end.isSame(other.start);\r\n\r\n\t\treturn (sameStartEnd && (other.start.valueOf() <= this.start.valueOf())) || (sameEndStart && (other.end.valueOf() >= this.end.valueOf()));\r\n\t}\r\n\r\n\tadd(other, options = { adjacent: false }) {\r\n\t\tif(this.overlaps(other, options)) {\r\n\t\t\treturn new this.constructor(moment.min(this.start, other.start), moment.max(this.end, other.end));\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\tby(interval, options = { excludeEnd: false, step: 1 }) {\r\n\t\tconst range = this;\r\n\r\n\t\treturn {\r\n\t\t\t[Symbol.iterator]() {\r\n\t\t\t\tconst step = options.step || 1;\r\n\t\t\t\tconst diff = Math.abs(range.start.diff(range.end, interval)) / step;\r\n\t\t\t\tlet excludeEnd = options.excludeEnd || false;\r\n\t\t\t\tlet iteration = 0;\r\n\r\n\t\t\t\tif(options.hasOwnProperty(\"exclusive\")) {\r\n\t\t\t\t\texcludeEnd = options.exclusive;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\tnext() {\r\n\t\t\t\t\t\tconst current = range.start.clone().add((iteration * step), interval);\r\n\t\t\t\t\t\tconst done = excludeEnd\r\n\t\t\t\t\t\t\t? !(iteration < diff)\r\n\t\t\t\t\t\t\t: !(iteration <= diff);\r\n\r\n\t\t\t\t\t\titeration++;\r\n\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tdone,\r\n\t\t\t\t\t\t\tvalue: (done ? undefined : current)\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tbyRange(interval, options = { excludeEnd: false, step: 1 }) {\r\n\t\tconst range = this;\r\n\t\tconst step = options.step || 1;\r\n\t\tconst diff = this.valueOf() / interval.valueOf() / step;\r\n\t\tconst unit = Math.floor(diff);\r\n\t\tlet excludeEnd = options.excludeEnd || false;\r\n\t\tlet iteration = 0;\r\n\r\n\t\tif(options.hasOwnProperty(\"exclusive\")) {\r\n\t\t\texcludeEnd = options.exclusive;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\t[Symbol.iterator]() {\r\n\t\t\t\tif(unit === Infinity) {\r\n\t\t\t\t\treturn { done: true };\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\tnext() {\r\n\t\t\t\t\t\tconst current = moment(range.start.valueOf() + (interval.valueOf() * iteration * step));\r\n\t\t\t\t\t\tconst done = ((unit === diff) && excludeEnd)\r\n\t\t\t\t\t\t\t? !(iteration < unit)\r\n\t\t\t\t\t\t\t: !(iteration <= unit);\r\n\r\n\t\t\t\t\t\titeration++;\r\n\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tdone,\r\n\t\t\t\t\t\t\tvalue: (done ? undefined : current)\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tcenter() {\r\n\t\tconst center = this.start.valueOf() + this.diff() / 2;\r\n\r\n\t\treturn moment(center);\r\n\t}\r\n\r\n\tclone() {\r\n\t\treturn new this.constructor(this.start.clone(), this.end.clone());\r\n\t}\r\n\r\n\tcontains(other, options = { excludeStart: false, excludeEnd: false }) {\r\n\t\tconst start = this.start.valueOf();\r\n\t\tconst end = this.end.valueOf();\r\n\t\tlet oStart = other.valueOf();\r\n\t\tlet oEnd = other.valueOf();\r\n\t\tlet excludeStart = options.excludeStart || false;\r\n\t\tlet excludeEnd = options.excludeEnd || false;\r\n\r\n\t\tif(options.hasOwnProperty(\"exclusive\")) {\r\n\t\t\texcludeStart = excludeEnd = options.exclusive;\r\n\t\t}\r\n\r\n\t\tif(other instanceof DateRange) {\r\n\t\t\toStart = other.start.valueOf();\r\n\t\t\toEnd = other.end.valueOf();\r\n\t\t}\r\n\r\n\t\tconst startInRange = (start < oStart) || ((start <= oStart) && !excludeStart);\r\n\t\tconst endInRange = (end > oEnd) || ((end >= oEnd) && !excludeEnd);\r\n\r\n\t\treturn (startInRange && endInRange);\r\n\t}\r\n\r\n\tdiff(unit, precise) {\r\n\t\treturn this.end.diff(this.start, unit, precise);\r\n\t}\r\n\r\n\tduration(unit, precise) {\r\n\t\treturn this.diff(unit, precise);\r\n\t}\r\n\r\n\tintersect(other) {\r\n\t\tconst start = this.start.valueOf();\r\n\t\tconst end = this.end.valueOf();\r\n\t\tconst otherStart = other.start.valueOf();\r\n\t\tconst otherEnd = other.end.valueOf();\r\n\t\tconst isZeroLength = (start == end);\r\n\t\tconst isOtherZeroLength = (otherStart == otherEnd);\r\n\r\n\t\t// Zero-length ranges\r\n\t\tif(isZeroLength) {\r\n\t\t\tconst point = start;\r\n\r\n\t\t\tif((point == otherStart) || (point == otherEnd)) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\telse if((point > otherStart) && (point < otherEnd)) {\r\n\t\t\t\treturn this.clone();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(isOtherZeroLength) {\r\n\t\t\tconst point = otherStart;\r\n\r\n\t\t\tif((point == start) || (point == end)) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\telse if((point > start) && (point < end)) {\r\n\t\t\t\treturn new this.constructor(point, point);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Non zero-length ranges\r\n\t\tif((start <= otherStart) && (otherStart < end) && (end < otherEnd)) {\r\n\t\t\treturn new this.constructor(otherStart, end);\r\n\t\t}\r\n\t\telse if((otherStart < start) && (start < otherEnd) && (otherEnd <= end)) {\r\n\t\t\treturn new this.constructor(start, otherEnd);\r\n\t\t}\r\n\t\telse if((otherStart < start) && (start <= end) && (end < otherEnd)) {\r\n\t\t\treturn this.clone();\r\n\t\t}\r\n\t\telse if((start <= otherStart) && (otherStart <= otherEnd) && (otherEnd <= end)) {\r\n\t\t\treturn new this.constructor(otherStart, otherEnd);\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\tisEqual(other) {\r\n\t\treturn this.start.isSame(other.start) && this.end.isSame(other.end);\r\n\t}\r\n\r\n\tisSame(other) {\r\n\t\treturn this.isEqual(other);\r\n\t}\r\n\r\n\toverlaps(other, options = { adjacent: false }) {\r\n\t\tconst intersects = (this.intersect(other) !== null);\r\n\r\n\t\tif(options.adjacent && !intersects) {\r\n\t\t\treturn this.adjacent(other);\r\n\t\t}\r\n\r\n\t\treturn intersects;\r\n\t}\r\n\r\n\treverseBy(interval, options = { excludeStart: false, step: 1 }) {\r\n\t\tconst range = this;\r\n\r\n\t\treturn {\r\n\t\t\t[Symbol.iterator]() {\r\n\t\t\t\tconst step = options.step || 1;\r\n\t\t\t\tconst diff = Math.abs(range.start.diff(range.end, interval)) / step;\r\n\t\t\t\tlet excludeStart = options.excludeStart || false;\r\n\t\t\t\tlet iteration = 0;\r\n\r\n\t\t\t\tif(options.hasOwnProperty(\"exclusive\")) {\r\n\t\t\t\t\texcludeStart = options.exclusive;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\tnext() {\r\n\t\t\t\t\t\tconst current = range.end.clone().subtract((iteration * step), interval);\r\n\t\t\t\t\t\tconst done = excludeStart\r\n\t\t\t\t\t\t\t? !(iteration < diff)\r\n\t\t\t\t\t\t\t: !(iteration <= diff);\r\n\r\n\t\t\t\t\t\titeration++;\r\n\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tdone,\r\n\t\t\t\t\t\t\tvalue: (done ? undefined : current)\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\treverseByRange(interval, options = { excludeStart: false, step: 1 }) {\r\n\t\tconst range = this;\r\n\t\tconst step = options.step || 1;\r\n\t\tconst diff = this.valueOf() / interval.valueOf() / step;\r\n\t\tconst unit = Math.floor(diff);\r\n\t\tlet excludeStart = options.excludeStart || false;\r\n\t\tlet iteration = 0;\r\n\r\n\t\tif(options.hasOwnProperty(\"exclusive\")) {\r\n\t\t\texcludeStart = options.exclusive;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\t[Symbol.iterator]() {\r\n\t\t\t\tif(unit === Infinity) {\r\n\t\t\t\t\treturn { done: true };\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\tnext() {\r\n\t\t\t\t\t\tconst current = moment(range.end.valueOf() - (interval.valueOf() * iteration * step));\r\n\t\t\t\t\t\tconst done = ((unit === diff) && excludeStart)\r\n\t\t\t\t\t\t\t? !(iteration < unit)\r\n\t\t\t\t\t\t\t: !(iteration <= unit);\r\n\r\n\t\t\t\t\t\titeration++;\r\n\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tdone,\r\n\t\t\t\t\t\t\tvalue: (done ? undefined : current)\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tsnapTo(interval) {\r\n\t\tconst r = this.clone();\r\n\r\n\t\t// Snap if not open-ended range\r\n\t\tif(!r.start.isSame(moment(-8640000000000000))) {\r\n\t\t\tr.start = r.start.startOf(interval);\r\n\t\t}\r\n\t\tif(!r.end.isSame(moment(8640000000000000))) {\r\n\t\t\tr.end = r.end.endOf(interval);\r\n\t\t}\r\n\r\n\t\treturn r;\r\n\t}\r\n\r\n\tsubtract(other) {\r\n\t\tconst start = this.start.valueOf();\r\n\t\tconst end = this.end.valueOf();\r\n\t\tconst oStart = other.start.valueOf();\r\n\t\tconst oEnd = other.end.valueOf();\r\n\r\n\t\tif(this.intersect(other) === null) {\r\n\t\t\treturn [this];\r\n\t\t}\r\n\t\telse if((oStart <= start) && (start < end) && (end <= oEnd)) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\t\telse if((oStart <= start) && (start < oEnd) && (oEnd < end)) {\r\n\t\t\treturn [new this.constructor(oEnd, end)];\r\n\t\t}\r\n\t\telse if((start < oStart) && (oStart < end) && (end <= oEnd)) {\r\n\t\t\treturn [new this.constructor(start, oStart)];\r\n\t\t}\r\n\t\telse if((start < oStart) && (oStart < oEnd) && (oEnd < end)) {\r\n\t\t\treturn [new this.constructor(start, oStart), new this.constructor(oEnd, end)];\r\n\t\t}\r\n\t\telse if((start < oStart) && (oStart < end) && (oEnd < end)) {\r\n\t\t\treturn [new this.constructor(start, oStart), new this.constructor(oStart, end)];\r\n\t\t}\r\n\r\n\t\treturn [];\r\n\t}\r\n\r\n\ttoDate() {\r\n\t\treturn [this.start.toDate(), this.end.toDate()];\r\n\t}\r\n\r\n\ttoString() {\r\n\t\treturn this.start.format() + \"/\" + this.end.format();\r\n\t}\r\n\r\n\tvalueOf() {\r\n\t\treturn this.end.valueOf() - this.start.valueOf();\r\n\t}\r\n\r\n}\r\n\r\n\r\n//-----------------------------------------------------------------------------\r\n// Moment Extensions\r\n//-----------------------------------------------------------------------------\r\n\r\nfunction extendMoment(moment) {\r\n\t/**\r\n\t * Build a date range.\r\n\t */\r\n\tmoment.range = function range(start, end) {\r\n\t\tconst m = this;\r\n\r\n\t\tif(typeof start === \"string\" && INTERVALS.hasOwnProperty(start)) {\r\n\t\t\treturn new DateRange(moment(m).startOf(start), moment(m).endOf(start));\r\n\t\t}\r\n\r\n\t\treturn new DateRange(start, end);\r\n\t};\r\n\r\n\t/**\r\n\t * Build a date range between a date (or now) and a specified interval.\r\n\t * @param {String} interval The type of interval\r\n\t * @param {Number} [count=1] The number of intervals (positive or negative)\r\n\t * @param {Moment|Date} [date=moment()] The date to use\r\n\t * @return {DateRange}\r\n\t */\r\n\tmoment.rangeFromInterval = function(interval, count = 1, date = moment()) {\r\n\t\tif(!moment.isMoment(date)) date = moment(date);\r\n\t\tif(!date.isValid())throw new Error(\"Invalid date.\");\r\n\r\n\t\tconst dateWithInterval = date.clone().add(count, interval);\r\n\r\n\t\t// Handle negative interval counts by assembling the dates in chronological order.\r\n\t\tconst dates = [];\r\n\t\tdates.push(moment.min(date, dateWithInterval));\r\n\t\tdates.push(moment.max(date, dateWithInterval));\r\n\r\n\t\treturn new DateRange(dates);\r\n\t};\r\n\r\n\t/**\r\n\t * Uses moment.parseZone on both the start and end of the given time interval\r\n\t * to preserve the time zones on the resulting DateRange object.\r\n\t * @param {string} isoTimeInterval the timeInterval to be parsed\r\n\t * @return {DateRange} constructed using moments that will preserve the time zones\r\n\t */\r\n\tmoment.rangeFromISOString = function(isoTimeInterval) {\r\n\t\tconst momentStrings = isoSplit(isoTimeInterval);\r\n\t\tconst start = moment.parseZone(momentStrings[0]);\r\n\t\tconst end = moment.parseZone(momentStrings[1]);\r\n\t\treturn new DateRange(start, end);\r\n\t};\r\n\r\n\tmoment.parseZoneRange = moment.rangeFromISOString; // DEPRECATED 4.0.0\r\n\r\n\t/**\r\n\t * Alias of static constructor.\r\n\t */\r\n\tmoment.fn.range = moment.range;\r\n\r\n\t/**\r\n\t * Expose constructor\r\n\t */\r\n\tmoment.range.constructor = DateRange;\r\n\r\n\t/**\r\n\t * Check if the current object is a date range.\r\n\t */\r\n\tmoment.isRange = function(range) {\r\n\t\treturn range instanceof DateRange;\r\n\t};\r\n\r\n\t/**\r\n\t * Check if the current moment is within a given date range.\r\n\t */\r\n\tmoment.fn.within = function(range) {\r\n\t\treturn range.contains(this.toDate());\r\n\t};\r\n\r\n\treturn moment;\r\n}\r\n\r\nfunction isoSplit(isoString) {\r\n\treturn isoString.split(\"/\");\r\n}\r\n\r\nextendMoment(moment);","import {\r\n\tcloneDeep, \r\n\tuniqBy\r\n} from \"lodash\";\r\nimport moment from \"moment\";\r\n\r\n//2243 sometime...\r\nconst Date_MAX = new Date(8640000000000);\r\n\r\n/**\r\n * Get all seasons that touch the given effectiveRanges\r\n * @param {*array} effectiveRanges \r\n * @param {*array} seasons \r\n * @returns {*array} matchedSeasons \r\n */\r\n\r\nexport function getSeasonsByEffectiveRanges(effectiveRanges, seasons, useFederalScopeOverride) {\r\n\tconst reducer = (includedSeasons, currentSeason) => {\r\n\t\tconst seasonBegin = moment(currentSeason.BeginInclusive);\r\n\t\tconst seasonEnd = moment(currentSeason.EndExclusive);\r\n\r\n\t\tif(includedSeasons.some(season => season.Id === currentSeason.Id)) {\r\n\t\t\treturn includedSeasons;\r\n\t\t}\r\n\r\n\t\tconst matchingSeasons = [];\r\n\t\tfor(const range of effectiveRanges) {\r\n\t\t\tconst rangeStart = moment(range.Start);\r\n\t\t\tconst rangeEnd = moment(range.End ?? Date_MAX);\r\n\t\t\tif(rangeStart.isSameOrAfter(seasonEnd) || rangeEnd.isSameOrBefore(seasonBegin) || ((useFederalScopeOverride ? \"FED\" : range.Scope) !== currentSeason.Scope)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} \r\n\t\t\tconst currentSeasonCopy = cloneDeep(currentSeason);\r\n\t\t\tif((rangeStart.isSameOrBefore(seasonBegin) && rangeEnd.isBefore(seasonEnd))\r\n\t\t\t\t|| (rangeStart.isAfter(seasonBegin) && rangeEnd.isSameOrAfter(seasonEnd))) {\r\n\t\t\t\tcurrentSeasonCopy.Periods = currentSeasonCopy.Periods.filter(\r\n\t\t\t\t\tp => moment(p.EndExclusive).isAfter(rangeStart) && moment(p.BeginInclusive).isSameOrBefore(rangeEnd)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tmatchingSeasons.push(currentSeasonCopy);\r\n\t\t}\r\n\t\treturn matchingSeasons.length ? [...includedSeasons, ...matchingSeasons] : includedSeasons;\r\n\t};\r\n\tconst matchedSeasons = seasons.reduce(reducer, []);\r\n\r\n\tconst recombinedSeasons = matchedSeasons.reduce((allSeasons, currentSeason) => {\r\n\t\tif(allSeasons.some(season => season.Id === currentSeason.Id)) {\r\n\t\t\tconst matchingSeason = allSeasons.find(s => s.Id === currentSeason.Id);\r\n\t\t\tmatchingSeason.Periods = matchingSeason.Periods.concat(currentSeason.Periods);\r\n\t\t\tmatchingSeason.Periods = uniqBy(matchingSeason.Periods, p => p.Id);\r\n\t\t\tmatchingSeason.Periods.sort((a, b) => moment(a.BeginInclusive).isSame(moment(b.BeginInclusive)) ? 0 : moment(a.BeginInclusive).isBefore(b.BeginInclusive) ? -1 : 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tallSeasons.push(currentSeason);\r\n\t\t}\r\n\r\n\t\treturn allSeasons;\r\n\t}, []);\r\n\r\n\treturn recombinedSeasons;\r\n}","export function hasHadState(state, report) { \r\n\treturn report && report.History && report.History.some(entry => entry.State.Code === state);\r\n}\r\n","import moment from \"moment\";\r\n\r\nconst fieldEvent = (name, fieldId) => `${name} ::: ${fieldId}`;\r\n\r\nconst fieldIdRepeatEvent = (name, fieldId, repeatDataId) => {\r\n\tlet eventData = fieldEvent(name, fieldId);\r\n\r\n\tif(repeatDataId !== null) {\r\n\t\teventData += ` ::: ${repeatDataId || \"undefined\"}`;\r\n\t}\r\n\treturn eventData;\r\n};\r\n\r\nexport const EVENT_NEW_REPORTING_ENTITY = \"EVENT_NEW_REPORTING_ENTITY\";\r\nexport const EVENT_RESET_REPORTING_ENTITY = \"EVENT_RESET_REPORTING_ENTITY\";\r\nexport const EVENT_UPDATE_REPORTING_ENTITY_SELECTOR = \"EVENT_UPDATE_REPORTING_ENTITY_SELECTOR\";\r\nexport const EVENT_REQUEST_REPORTING_ENTITY = \"EVENT_REQUEST_REPORTING_ENTITY\";\r\nexport const EVENT_NEW_FORM = \"EVENT_NEW_FORM\";\r\nexport const EVENT_HOTKEY_LOCK = \"EVENT_HOTKEY_LOCK\";\r\nexport const EVENT_PROCESS_UI_RULES = \"EVENT_PROCESS_UI_RULES\";\r\nexport const EVENT_PROCESS_FILTER_RULES = \"EVENT_PROCESS_FILTER_RULES\";\r\nexport const EVENT_TRIGGER_RULE = (fieldId) => fieldEvent(\"EVENT_TRIGGER_RULE\", fieldId);\r\nexport const EVENT_PROCESS_VALIDATIONS = \"EVENT_PROCESS_VALIDATIONS\";\r\nexport const EVENT_PAGE_LOADED = \"EVENT_PAGE_LOADED\";\r\nexport const EVENT_SET_FORM_DIRTY = \"EVENT_SET_FORM_DIRTY\";\r\nexport const ACTION_EXPAND_DETAILS = \"ACTION_EXPAND_DETAILS\";\r\nexport const ACTION_COLLAPSE_DETAILS = \"ACTION_COLLAPSE_DETAILS\";\r\n\r\nexport const EVENT_FILTER_PRIMARYDATE = \"EVENT_FILTER_PRIMARYDATE\";\r\n\r\nexport const EVENT_SET_FEATURE_DATA = (type) => `EVENT_SET_FEATURE_DATA ::: ${type}`;\r\nexport const EVENT_SET_VALUE = (fieldId) => fieldEvent(\"EVENT_SET_VALUE\", fieldId);\r\nexport const EVENT_SET_DEFAULT_VALUE = (fieldId) => fieldEvent(\"EVENT_SET_DEFAULT_VALUE\", fieldId);\r\nexport const EVENT_CLEAR_VALUE = (fieldId, repeatDataId) => fieldIdRepeatEvent(\"EVENT_CLEAR_VALUE\", fieldId, repeatDataId);\r\nexport const EVENT_FILTER_BY_DETAILS = (fieldId) => fieldEvent(\"EVENT_FILTER_BY_DETAILS\", fieldId);\r\nexport const EVENT_UNCLEAR_VALUE = (fieldId, repeatDataId) => fieldIdRepeatEvent(\"EVENT_UNCLEAR_VALUE\", fieldId, repeatDataId);\r\nexport const EVENT_CLEAR_ROW = (repeatDataId) => fieldEvent(\"EVENT_CLEAR_ROW\", repeatDataId);\r\nexport const EVENT_VALUE_CLEARED = (fieldId) => fieldEvent(\"EVENT_VALUE_CLEARED\", fieldId);\r\nexport const EVENT_FILTER_CURRENT_OPTIONS = (fieldId, repeatDataId) => fieldIdRepeatEvent(\"EVENT_FILTER_CURRENT_OPTIONS\", fieldId, repeatDataId);\r\nexport const EVENT_FILTER_ALL_OPTIONS = (fieldId) => fieldEvent(\"EVENT_FILTER_ALL_OPTIONS\", fieldId);\r\nexport const EVENT_REMOVE_OPTIONS = (fieldId) => fieldEvent(\"EVENT_REMOVE_OPTIONS\", fieldId);\r\nexport const EVENT_LOAD_OPTIONS = (fieldId) => fieldEvent(\"EVENT_LOAD_OPTIONS\", fieldId);\r\nexport const ENTITY_SELECTOR_REFERENCE = \"ENTITY_SELECTOR\";\r\n\r\nexport const EVENT_VALUE_CHANGED = (fieldId, repeatDataId) => fieldIdRepeatEvent(\"EVENT_VALUE_CHANGED\", fieldId, repeatDataId);\r\n\r\nexport const EVENT_FIELD_DISABLE = (fieldId) => fieldEvent(\"EVENT_FIELD_DISABLE\", fieldId);\r\nexport const EVENT_FIELD_ENABLE = (fieldId) => fieldEvent(\"EVENT_FIELD_ENABLE\", fieldId);\r\nexport const EVENT_SECTION_FIELD_VISIBILTY_CHANGE = (sectionId) => fieldEvent(\"EVENT_SECTION_FIELD_VISIBILITY_CHANGE\", sectionId);\r\nexport const EVENT_TIMEZONE_SET = (fieldId) => fieldEvent(\"EVENT_TIMEZONE_SET\", fieldId);\r\n\r\nexport const EVENT_FIELD_DIRTY = \"EVENT_FIELD_DIRTY\";\r\nexport const EVENT_SET_FORM_PRISTINE = \"EVENT_SET_FORM_PRISTINE\";\r\nexport const EVENT_DETAIL_DIRTY = \"EVENT_DETAIL_DIRTY\";\r\nexport const EVENT_DETAIL_TOGGLE = \"EVENT_DETAIL_TOGGLE\";\r\nexport const EVENT_REPORT_LOCKED = \"EVENT_REPORT_LOCKED\";\r\nexport const EVENT_REPORT_UNLOCKED = \"EVENT_REPORT_UNLOCKED\";\r\nexport const EVENT_REPORT_STATUS_CHANGE = \"EVENT_REPORT_STATUS_CHANGE\";\r\nexport const EVENT_REPORT_SAVED = \"EVENT_REPORT_SAVED\";\r\nexport const EVENT_DETAILS_SUPPRESSION_TOGGLED = \"EVENT_DETAILS_SUPPRESSION_TOGGLED\";\r\nexport const EVENT_TRIGGER_REPORT_SAVE = \"EVENT_TRIGGER_REPORT_SAVE\";\r\nexport const EVENT_EXPAND_MULTI_ENTRY_LIST = \"EVENT_EXPAND_MULTI_ENTRY_LIST\";\r\nexport const EVENT_REVERT_VALUES = \"EVENT_REVERT_VALUES\";\r\nexport const EVENT_PROCESS_RULES_SETTLED = \"EVENT_PROCESS_RULES_SETTLED\";\r\n\r\nexport const EVENT_GET_VALUE = (fieldId) => fieldEvent(\"EVENT_GET_VALUE\", fieldId);\r\nexport const EVENT_SEND_VALUE = (fieldId) => fieldEvent(\"EVENT_SEND_VALUE\", fieldId);\r\n\r\nexport const EVENT_ENABLE_SUCCESSOR_LOCK = (fieldId, repeatId) => fieldIdRepeatEvent(\"EVENT_ENABLE_SUCCESSOR_LOCK\", fieldId, repeatId);\r\nexport const EVENT_DISABLE_SUCCESSOR_LOCK = (fieldId, repeatId) => fieldIdRepeatEvent(\"EVENT_DISABLE_SUCCESSOR_LOCK\", fieldId, repeatId);\r\nexport const EVENT_HANDLE_SUCCESSOR_LOCK = (fieldId) => fieldEvent(\"EVENT_HANDLE_SUCCESSOR_LOCK\", fieldId);\r\n\r\nexport const EVENT_LOGOUT = \"EVENT_LOGOUT\";\r\n\r\nexport const PROXY_FIELDS = {\r\n\tDATETIME: \"PROXY_DATETIME_FIELD\",\r\n\tENTITY: \"PROXY_ENTITY_FIELD\"\r\n};\r\n\r\nexport const openIdCallbackSuffix = \"/user/callback\";\r\n\r\n//Misc.\r\n\r\nexport const ENTITY_TYPES = {\r\n\tVESSEL: { Code: \"VESSEL\", Name: \"Vessel\", PluralName: \"Vessels\", Icon: \"zmdi-boat\" },\r\n\tDEALER: { Code: \"DEALER\", Name: \"Dealer\", PluralName: \"Dealers\", Icon: \"zmdi-store\" },\r\n\tFISHERMAN: { Code: \"FISHERMAN\", Name: \"Fisherman\", PluralName: \"Fishermen\", Icon: \"zmdi-account-o\" },\r\n\tLICENSE: { Code: \"LICENSE\", Name: \"License\", PluralName: \"Licenses\", Icon: \"zmdi-card\" },\r\n\tGROUP: { Code: \"GROUP\", Name: \"Group\", PluralName: \"Groups\", Icon: \"zmdi-card\" },\r\n\tCAPTAIN: { Code: \"CAPTAIN\", Name: \"Captain\", PluralName: \"Captains\", Icon: \"zmdi-card\" },\r\n\tBUSINESS: { Code: \"BUSINESS\", Name: \"Business\", PluralName: \"Businesses\", Icon: \"zmdi-store\" },\r\n\tDEFAULT: { Icon: \"zmdi-account-o\" }\r\n};\r\n\r\nexport const RELATIONSHIP_TYPES = {\r\n\tSelf: \"SELF\"\r\n};\r\n\r\nexport const LOADING_MESSAGES = [\r\n\t\"Battening the hatches\",\r\n\t\"Setting the sails\",\r\n\t\"Setting out the lines\",\r\n\t\"Releasing the Kraken\",\r\n\t\"Outrunning the Kraken\",\r\n\t\"Assembling all hands on deck\",\r\n\t\"Casting off\",\r\n\t\"Feeding the Kraken\"\r\n];\r\n\r\nexport const NOMENCLATURE = {\r\n\tPositiveReport: \"FORM.REPORTING.POSITIVE\",\r\n\tNegativeReport: \"FORM.REPORTING.NEGATIVE\",\r\n\tReportFooter: \"FORM.REPORTING.FOOTER\",\r\n\tPrimaryEntity: \"FORM.PRIMARY.ENTITY\",\r\n\tPrimaryDate: \"FORM.PRIMARY.DATE\",\r\n\tSupportEmail: \"FORM.SUPPORT.EMAIL\",\r\n\tSupportNumber: \"FORM.SUPPORT.PHONE\",\r\n\tSeason: \"FORM.SEASON\",\r\n\tLogoUrl: \"FORM.LOGO\",\r\n\tSupportMarkdown: \"FORM.SUPPORT.MARKDOWN\",\r\n\tFormUseAcceptance: \"FORM.ACCEPTANCE\"\r\n};\r\n\r\nexport const REPORT_SCOPES = {\r\n\treport: \"REPORT\",\r\n\tdetail: \"DETAIL\",\r\n\tdetails: \"DETAILS\",\r\n\treportAndDetails: \"REPORTANDDETAILS\",\r\n\tmetadata: \"METADATA\"\r\n};\r\n\r\nexport const UNITS = {\r\n\tfeet: { \r\n\t\tsingular: \"foot\",\r\n\t\tplural: \"feet\",\r\n\t\tabbreviation: \"ft\",\r\n\t\tdecoration: \"'\",\r\n\t\tper: {\r\n\t\t\tmeter: 3.28084\r\n\t\t}\r\n\t},\r\n\tmeter: {\r\n\t\tsingular: \"meter\",\r\n\t\tplural: \"meters\",\r\n\t\tabbreviation: \"m\",\r\n\t\tper: {\r\n\t\t\tfoot: 0.3048\r\n\t\t}\r\n\t}\r\n};\r\n\r\nexport const FIELD_TEMPLATES = {\r\n\tCoordinate: \"Coordinate\",\r\n\tDate: \"Date\",\r\n\tDateTime: \"DateTime\",\r\n\tYearMonth: \"YearMonth\",\r\n\tLocation: \"Location\",\r\n\tNumber: \"Number\",\r\n\tEntitySelector: \"EntitySelector\",\r\n\tEntityContactSelector: \"EntityContactSelector\",\r\n\tSelection: \"Selection\",\r\n\tTags: \"MultiSelect\",\r\n\tTextArea: \"TextArea\",\r\n\tText: \"Text\",\r\n\tBoolean: \"Boolean\"\r\n};\r\n\r\nexport const FEATURE_TYPES = {\r\n\tfilter: \"Filter\",\r\n\tmap: \"Map\",\r\n\tmapPoint: \"MapPoint\",\r\n\tboundlessMapPoint: \"MapWithoutBoundary\",\r\n\tpropagate: \"PropagateValue\",\r\n\tdateRangeDefaultYearMonth: \"DateRangeDefaultYearMonth\",\r\n\twebCardSwipe: \"WebCardSwipe\",\r\n\tadvancedCompliance: \"AdvancedCompliance\"\r\n};\r\n\r\nexport const FIELD_KEYS = {\r\n\tquantity: \"TRIP.DETAILS.SPECIES.QUANTITY.COUNT\",\r\n\tprice: \"TRIP.DETAILS.PRICE.VALUE\",\r\n\tlatitude: \"TRIP.AREAS.LATITUDE.SINGLE\",\r\n\tlongitude: \"TRIP.AREAS.LONGITUDE.SINGLE\",\r\n\tlocation: \"TRIP.AREAS.SUBAREAS.SINGLE\",\r\n\ttripType: \"TRIP.TYPES.SINGLE\",\r\n\ttagBegin: \"HARVEST.DETAILS.TAG.BEGIN\",\r\n\ttagEnd: \"HARVEST.DETAILS.TAG.END\"\r\n};\r\n\r\nexport const FIELD_TYPES = {\r\n\tentity: \"ENTITY\",\r\n\tentityContact: \"ENTITYCONTACT\"\r\n};\r\n\r\nexport const SECURITY_ROLES = {\r\n\tSYSADMIN: { name: \"SYSADMIN\", display: \"System Admin\", level: 0 },\r\n\tAGENT: { name: \"AGENT\", display: \"Agent\", level: 40 },\r\n\tSUSER: { name: \"SUSER\", display: \"Super User\", level: 75 },\r\n\tUSER: { name: \"USER\", display: \"User\", level: 100 }\r\n};\r\n\r\nexport const TIME_ZONES = [\r\n\t{\r\n\t\tname: \"Eastern Time\",\r\n\t\tcode: (date) => moment(date).isDST() ? \"EDT\" : \"EST\",\r\n\t\tianaCode: \"America/New_York\"\r\n\t},\r\n\t{\r\n\t\tname: \"Central Time\",\r\n\t\tcode: (date) => moment(date).isDST() ? \"CDT\" : \"CST\",\r\n\t\tianaCode: \"America/Chicago\"\r\n\t},\r\n\t{\r\n\t\tname: \"Mountain Time\",\r\n\t\tcode: (date) => moment(date).isDST() ? \"MDT\" : \"MST\",\r\n\t\tianaCode: \"America/Denver\"\r\n\t},\r\n\t{\r\n\t\tname: \"Pacific Time\",\r\n\t\tcode: (date) => moment(date).isDST() ? \"PDT\" : \"PST\",\r\n\t\tianaCode: \"America/Los_Angeles\"\r\n\t},\r\n\t{\r\n\t\tname: \"Atlantic Time\",\r\n\t\tcode: date => moment(date).isDST() ? \"ADT\" : \"AST\",\r\n\t\tianaCode: \"America/St_Thomas\"\r\n\t}\r\n];\r\n\r\nexport const FORM_TIMEZONE_TYPES = {\r\n\tByEntity: \"BYENTITY\",\r\n\tByForm: \"BYFORM\",\r\n\tByUser: \"BYUSER\"\r\n};\r\n\r\nexport const TIME_DISPLAY_OPTIONS = {\r\n\tTWENTY_FOUR_HOUR: \"24h\",\r\n\tTWELVE_HOUR: \"12h\"\r\n};\r\n\r\nexport const PIVOT_TYPES = {\r\n\tAll: \"All\",\r\n\tRepeat: \"Repeat\",\r\n\tRecentlyUsed: \"RecentlyUsed\"\r\n};\r\n\r\nexport const IDENTIFIER_TYPES = {\r\n\t\"ACCSP:ID\": { code: \"ACCSP:ID\", name: \"ACCSP Unique Id\" },\r\n\t\"GARFO:ACCSP:ID\": { code: \"GARFO:ACCSP:ID\", name: \"GARFO ACCSP Unique Id\" },\r\n\tDL: { code: \"DL\", name: \"Driver's License No.\" },\r\n\tCGN: { code: \"CGN\", name: \"Coast Guard No.\" },\r\n\t\"STATE:REGISTRATION\": { code: \"STATE:REGISTRATION\", name: \"State Registration No.\" },\r\n\tPLATE: { code: \"PLATE\", name: \"Plate Number\" },\r\n\tTOKEN: { code: \"TOKEN\", name: \"Token\" },\r\n\tPREFIX: { code: \"PREFIX\", name: \"Prefix\" },\r\n\tGARFO: { code: \"GARFO\", name: \"GARFO Permit Number\", isFederal: true },\r\n\tSERO: { code: \"SERO\", name: \"SERO Permit Number\", isFederal: true },\r\n\t\"SERO:GULF\": { code: \"SERO:GULF\", name: \"SERO Gulf Permit Number\" },\r\n\tVESSEL: { code: \"VESSEL\", name: \"Vessel\" },\r\n\tCFID: { code: \"CFID\", name: \"Commercial Fisheries ID\" },\r\n\t\"ACCSP:VESSEL:ID\": { code: \"ACCSP:VESSEL:ID\", name: \"ACCSP Permit Id\" },\r\n\t\"LOCALE\": { code: \"LOCALE\", name: \"Locale\" }\r\n};\r\n\r\nexport const CLASSIFICATION_TYPES = {\r\n\tTUNA: \"TUNA\",\r\n\tSHARK: \"SHARK\",\r\n\tSWORDFISH: \"SWORDFISH\"\r\n};\r\n\r\nexport const NAME_SUFFIX_LIST = [\r\n\t{ key: \"Jr.\", display: \"Jr.\", show: true },\r\n\t{ key: \"Sr.\", display: \"Sr.\", show: true },\r\n\t{ key: \"II\", display: \"II\", show: true },\r\n\t{ key: \"III\", display: \"III\", show: true },\r\n\t{ key: \"IV\", display: \"IV\", show: true },\r\n\t{ key: \"V\", display: \"V\", show: true },\r\n\t{ key: \"VI\", display: \"VI\", show: true },\r\n\t{ key: \"JR\", display: \"Jr.\" },\r\n\t{ key: \"JR.\", display: \"Jr.\" },\r\n\t{ key: \"L\", display: \"\" },\r\n\t{ key: \"I\", display: \"\" },\r\n\t{ key: \"SR\", display: \"Sr.\" },\r\n\t{ key: \"J\", display: \"Jr.\" }\r\n];\r\n\r\nexport const NAME_TITLE_LIST = [\r\n\t{ key: \"Mr.\", display: \"Mr.\", value: \"Mr\", show: true },\r\n\t{ key: \"Ms.\", display: \"Ms.\", value: \"Ms\", show: true },\r\n\t{ key: \"Mrs.\", display: \"Mrs.\", value: \"Mrs\", show: true },\r\n\t{ key: \"Capt.\", display: \"Capt.\", value: \"Capt\", show: true },\r\n\t{ key: \"Dr.\", display: \"Dr.\", value: \"Dr\", show: true }\r\n];\r\n\r\nexport const IS_NOT_AVAILABLE_OPTIONS = {\r\n\talways: \"Always\",\r\n\tnever: \"Never\",\r\n\tsupported: \"Supported\"\r\n};\r\n\r\nexport const FUSE_DEFAULTS = {\r\n\tshouldSort: true,\r\n\tcaseSensitive: false,\r\n\ttokenize: true,\r\n\tmatchAllTokens: true,\r\n\tincludeScore: true,\r\n\tthreshold: 0.2,\r\n\t// eslint-disable-next-line no-useless-escape\r\n\ttokenSeparator: /[ ,()!#$%^&*`~/\\[\\]\\\\\\{\\}|;':\\\"<>?/]+/g,\r\n\tlocation: 0,\r\n\tdistance: 32,\r\n\tmaxPatternLength: 32,\r\n\tminMatchCharLength: 1,\r\n\tkeys: [\r\n\t\t\"Name\",\r\n\t\t\"Code\"\r\n\t]\r\n};\r\n\r\nexport const SELECTORS = {\r\n\tTabbableElements: 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\r\n};\r\n\r\nexport const READ_ONLY_MODES = {\r\n\tafterCreate: \"AfterCreate\",\r\n\tafterFirstSet: \"AfterFirstSet\",\r\n\tsystem: \"System\",\r\n\talways: \"Always\"\r\n};\r\n\r\nexport const REPORT_STATES = {\r\n\tsubmitted: {\r\n\t\tcode: \"SUBMITTED\",\r\n\t\tdisplay: \"Submitted\"\r\n\t},\r\n\tdeleted: {\r\n\t\tcode: \"DELETED\",\r\n\t\tdisplay: \"Deleted\"\r\n\t},\r\n\tpending: {\r\n\t\tcode: \"PENDING\",\r\n\t\tdisplay: \"Pending\"\r\n\t},\r\n\tdeclared: {\r\n\t\tcode: \"DECLARED\",\r\n\t\tdisplay: \"Declared\"\r\n\t}\r\n};\r\n\r\nexport const SEVERITY_LEVELS = {\r\n\tCRITICAL: {\r\n\t\torder: 0,\r\n\t\ticon: \"zmdi-alert-polygon\",\r\n\t\tcssClass: \"critical\"\r\n\t},\r\n\tERROR: {\r\n\t\torder: 1,\r\n\t\ticon: \"zmdi-alert-octagon\",\r\n\t\tcssClass: \"error\"\r\n\t},\r\n\tWARNING: {\r\n\t\torder: 2,\r\n\t\ticon: \"zmdi-alert-triangle\",\r\n\t\tcssClass: \"warning\"\r\n\t},\r\n\tINFO: {\r\n\t\torder: 3,\r\n\t\ticon: \"zmdi-info\",\r\n\t\tcssClass: \"info\"\r\n\t},\r\n\tUNKNOWN: {\r\n\t\torder: 4,\r\n\t\ticon: undefined,\r\n\t\tcssClass: \"unknown\"\r\n\t}\r\n};\r\n","import \"./index.less\";\r\nimport template from \"./index.html\";\r\nimport { EVENT_NEW_FORM } from \"../../../constants\";\r\n\r\nfunction controller(\r\n\tuiState,\r\n\tappState,\r\n\t$uibModal,\r\n\teventBus,\r\n\t$scope,\r\n\t$featureFlags,\r\n\t$state, \r\n\tnoticeService, \r\n\t$logger\r\n) {\r\n\r\n\tconst ctrl = this;\r\n\tctrl.uiState = uiState;\r\n\tctrl.$state = $state;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.openSettingsModal = () => openModal(\"settings-modal\");\r\n\tctrl.openAccessibilityModal = () => openModal(\"accessibility-modal\");\r\n\tctrl.closeSidebar = closeSidebar;\r\n\tctrl.showMessaging = $featureFlags.getFeature($featureFlags.FEATURES.Messaging);\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.forms = appState.forms.items;\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.permissions = appState.permissions;\r\n\t\trefreshDataFromService();\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_NEW_FORM,\r\n\t\t\t() => {\r\n\t\t\t\tctrl.form = appState.forms.selected;\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\r\n\t\t$scope.$watch(() => noticeService.notices, (next, prev) => {\r\n\t\t\tif(next !== prev) {\r\n\t\t\t\trefreshDataFromService(next);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction refreshDataFromService(notices) {\r\n\t\tctrl.notices = notices ?? noticeService.notices;\r\n\t\tctrl.hasNewNotices = noticeService.hasUnreadNotices;\r\n\t}\r\n\r\n\tfunction openModal(modalName, size = \"lg\", resolve = {}) {\r\n\t\tcloseSidebar();\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: modalName,\r\n\t\t\tsize: size,\r\n\t\t\tresolve: resolve\r\n\t\t});\r\n\t}\r\n\r\n\tfunction closeSidebar() {\r\n\t\tctrl.uiState.sidebar.open = false;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.layout.main-header\", [])\r\n\t.component(\"mainHeader\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","const rootArea = \"/compliance\";\r\n\r\nexport const complianceGlob = (base: string) => ({\r\n\tself: `${base}${rootArea}`,\r\n\tread: `${base}${rootArea}/read`\r\n});\r\n","export default \"\\r\\n\\t\\r\\n\";","export default {\r\n\tGLOBAL: {\r\n\t\tOPEN_FORM_SWITCHER: (callback) => {\r\n\t\t\treturn {\r\n\t\t\t\tcombo: \"ctrl+shift+f\",\r\n\t\t\t\tdescription: \"Open form switcher\",\r\n\t\t\t\tcallback: callback\r\n\t\t\t};\r\n\t\t},\r\n\t\tDASHBOARD: (callback) => {\r\n\t\t\treturn {\r\n\t\t\t\tcombo: \"alt+shift+1\",\r\n\t\t\t\tdescription: \"Dashboard\",\r\n\t\t\t\tcallback: callback\r\n\t\t\t};\r\n\t\t},\r\n\t\tNEW_REPORT: (label, callback) => {\r\n\t\t\treturn {\r\n\t\t\t\tcombo: \"alt+shift+n\",\r\n\t\t\t\tdescription: label,\r\n\t\t\t\tcallback: callback\r\n\t\t\t};\r\n\t\t},\r\n\t\tREPORT_LIST: (label, callback) => {\r\n\t\t\treturn {\r\n\t\t\t\tcombo: \"alt+shift+f\",\r\n\t\t\t\tdescription: label,\r\n\t\t\t\tcallback: callback\r\n\t\t\t};\r\n\t\t},\r\n\t\tREPORT_COMPLIANCE: (callback) => {\r\n\t\t\treturn {\r\n\t\t\t\tcombo: \"alt+shift+r\",\r\n\t\t\t\tdescription: \"Reporting Status\",\r\n\t\t\t\tcallback: callback\r\n\t\t\t};\r\n\t\t},\r\n\t\tSHOW_NAVIGATION_BAR: (callback) => {\r\n\t\t\treturn {\r\n\t\t\t\tcombo: \"alt+shift+q\",\r\n\t\t\t\tdescription: \"Open/Close side navigation bar\",\r\n\t\t\t\tcallback: callback\r\n\t\t\t};\r\n\t\t}\r\n\t},\r\n\tEDIT_REPORT: {\r\n\t\tDIAGNOSTICS: (callback) => {\r\n\t\t\treturn {\r\n\t\t\t\tcombo: \"alt+shif1t+x\",\r\n\t\t\t\t// description: \"This description is commented to suppress showing in cheatsheet. This shortcut outputs a report to the console\",\r\n\t\t\t\tcallback: callback\r\n\t\t\t};\t\r\n\t\t},\r\n\t\tADD_DETAIL: (callback) => {\r\n\t\t\treturn {\r\n\t\t\t\tcombo: \"alt+shift+s\",\r\n\t\t\t\tdescription: \"Add new detail row\",\r\n\t\t\t\tcallback: callback\r\n\t\t\t};\r\n\t\t},\r\n\t\tSAVE_HEADER: (callback) => {\r\n\t\t\treturn {\r\n\t\t\t\tcombo: \"alt+shift+h\",\r\n\t\t\t\tdescription: \"Save header\",\r\n\t\t\t\tcallback: callback\r\n\t\t\t};\r\n\t\t},\r\n\t\tSUBMIT_TICKET: (label, callback) => {\r\n\t\t\treturn {\r\n\t\t\t\tcombo: \"alt+shift+t\",\r\n\t\t\t\tdescription: label,\r\n\t\t\t\tcallback: callback\r\n\t\t\t};\r\n\t\t},\r\n\t\tDETAILS: {\r\n\t\t\tLOCK_FIELD: (callback) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tallowIn: [\"INPUT\", \"SELECT\", \"TEXTAREA\"],\r\n\t\t\t\t\tcombo: \"alt+l\",\r\n\t\t\t\t\tdescription: \"Toggle lock feature on focused field.\",\r\n\t\t\t\t\tcallback: callback\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tSAVE_DETAIL: (callback) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tcombo: \"alt+s\",\r\n\t\t\t\t\tallowIn: [\"INPUT\", \"SELECT\", \"TEXTAREA\"],\r\n\t\t\t\t\tdescription: \"Save detail and close\",\r\n\t\t\t\t\tcallback: callback\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tSAVE_AND_ADD_DETAIL: (callback) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tcombo: \"ctrl+shift+s\",\r\n\t\t\t\t\tallowIn: [\"INPUT\", \"SELECT\", \"TEXTAREA\"],\r\n\t\t\t\t\tdescription: \"Save detail and create new\",\r\n\t\t\t\t\tcallback: callback\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n","import { forEach } from \"lodash\";\r\nimport querystring from \"querystring\";\r\n\r\n//API Paths\r\nexport const ENTITIES = \"api/entities\";\r\n\r\nexport const ENTITY_CONTACTS_GET = (formId, entityId) => `api/forms/${formId}/entities/${entityId}/contacts`;\r\nexport const ENTITY_CONTACTS_CREATE = (formId, entityId) => `api/forms/${formId}/entities/${entityId}/contacts`;\r\nexport const ENTITY_CONTACTS_UPDATE = (formId, entityId, contactId) => `api/forms/${formId}/entities/${entityId}/contacts/${contactId}`;\r\nexport const ENTITY_CONTACTS_DELETE = (formId, entityId, contactId) => `api/forms/${formId}/entities/${entityId}/contacts/${contactId}/delete`;\r\nexport const ENTITY_CONTACTS_RESTORE = (formId, entityId, contactId) => `api/forms/${formId}/entities/${entityId}/contacts/${contactId}/restore`;\r\n\r\nexport const FORM_ENTITY = (formId, entityId) => `api/forms/${formId}/entities/${entityId}`;\r\nexport const FORM_ENTITY_CREATE = (formId) => `api/forms/${formId}/entities`;\r\nexport const FORM_ENTITY_USERS = (formId, entityId) => `/api/forms/${formId}/entities/${entityId}/users`;\r\nexport const FORM_ENTITY_DETAILS = (formId, entityId) => `api/forms/${formId}/entities/${entityId}/related`;\r\nexport const FORM_ENTITY_ASSOCIATION = (formId, entityId) => `api/forms/${formId}/entities/${entityId}/related`;\r\nexport const FORM_ENTITY_IDENTIFIERS = (formId, entityId) => `api/forms/${formId}/entities/${entityId}/identifiers`;\r\nexport const FORM_ENTITY_IDENTIFIERS_UPDATE = (formId, entityId, identifierId) => `api/forms/${formId}/entities/${entityId}/identifiers/${identifierId}`;\r\nexport const FORM_ENTITY_IDENTIFIER_ACTIVATE = (formId, entityId, identifierType, identifierValue) =>\r\n\t`api/forms/${formId}/entities/${entityId}/identifiers/types/${identifierType}/${identifierValue}/activate`;\r\nexport const FORM_ENTITY_IDENTIFIER_DEACTIVATE = (formId, entityId, identifierType, identifierValue) =>\r\n\t`api/forms/${formId}/entities/${entityId}/identifiers/types/${identifierType}/${identifierValue}/deactivate`;\r\nexport const FORM_ENTITY_CLASSIFICATIONS = (formId, entityId) => `api/forms/${formId}/entities/${entityId}/classifications`;\r\nexport const FORM_ENTITY_CLASSIFICATION = (formId, entityId, classificationCode) => {\r\n\tconst encoded = encodeURIComponent(classificationCode);\r\n\treturn `api/forms/${formId}/entities/${entityId}/classifications/${encoded}`;\r\n};\r\nexport const FORM_ENTITY_EFFECTIVE_RANGES = (formId, entityId) => `api/forms/${formId}/entities/${entityId}/effective`;\r\nexport const FORM_ENTITY_EFFECTIVE_RANGE = (formId, entityId, id) => `api/forms/${formId}/entities/${entityId}/effective/${id}`;\r\nexport const FORM_ENTITIES_ASSIGNED = (formId) => `api/forms/${formId}/entities/assigned`;\r\nexport const FORM_ENTITY_NUMBERS = (formId, entityId) => `api/forms/${formId}/reports/entities/${entityId}/numbers`;\r\nexport const FORM_USERS_ENTITIES = (formId, userAccountId) => `api/forms/${formId}/users/${userAccountId}/entities`;\r\nexport const FORM_ENTITIES = (formId) => `/api/forms/${formId}/entities/by/query`;\r\nexport const FORM_ENTITY_TOKENS = (formId, entityId) => `api/forms/${formId}/entities/${entityId}/tokens`;\r\nexport const FORM_TOKEN_DEACTIVATE = (formId, tokenId) => `api/forms/${formId}/tokens/${tokenId}/deactivate`;\r\nexport const FORM_ENTITY_INVENTORIES = (formId, entityId) => `api/forms/${formId}/entities/${entityId}/inventory`;\r\nexport const FORM_ENTITY_INVENTORY_ITEM = (formId, entityId, itemId) => `api/forms/${formId}/entities/${entityId}/inventory/${itemId}`;\r\nexport const FORM_ENTITY_INVENTORY_SET = (formId, entityId, itemId) => `api/forms/${formId}/entities/${entityId}/inventory/${itemId}/set`;\r\nexport const FORM_ENTITY_INVENTORY_ATTEST = (formId, entityId, itemId) => `api/forms/${formId}/entities/${entityId}/inventory/${itemId}/attest`;\r\nexport const FORM_ENTITY_INVENTORY_RESET = (formId, entityId, itemId) => `api/forms/${formId}/entities/${entityId}/inventory/${itemId}/reset`;\r\nexport const FORM_ENTITY_BUSINESSES = (formId, entityId) => `api/forms/${formId}/entities/${entityId}/businesses`;\r\nexport const FORM_BUSINESS = (formId, businessId) => `api/forms/${formId}/businesses/${businessId}`;\r\nexport const FORM_BUSINESS_CHARGES = (formId, businessId, isAppliedToAllCurrentProducts) => \r\n\t!isAppliedToAllCurrentProducts \r\n\t\t? `api/forms/${formId}/businesses/${businessId}/fees` \r\n\t\t: `api/forms/${formId}/businesses/${businessId}/fees?isAppliedToAllCurrentProducts=${isAppliedToAllCurrentProducts}`;\r\nexport const FORM_BUSINESS_PRODUCTS = (formId, businessId) => `api/forms/${formId}/businesses/${businessId}/products`;\r\n\r\nexport const FORM_EXPORT_REPORTS = (formId) => `api/forms/${formId}/exports/by/reports/`;\r\nexport const FORM_EXPORT_CONFIGS = (formId) => `api/forms/${formId}/exports/configurations`;\r\nexport const FORM_EXPORT_QUEUE_FOR_CONFIG = (formId, configCode) => `api/forms/${formId}/exports/configurations/${configCode}/queue`;\r\nexport const FORM_EXPORT_CREATE = (formId) => `api/forms/${formId}/exports`;\r\nexport const FORM_EXPORT_LOG_ID = (formId) => `api/forms/${formId}/export/logs/by/id`;\r\nexport const FORM_EXPORT_LOG_PAGE = (formId) => `api/forms/${formId}/export/logs/by/page`;\r\nexport const FORM_EXPORTS = (formId, configuration) => `api/forms/${formId}/exports/current?doNotLog=true&configuration=${configuration}`;\r\nexport const FORM_EXPORT_LOGS = (formId, exportLogId) => `api/forms/${formId}/export/logs/${exportLogId}`;\r\n\r\nexport const FORMS_REQUESTABLE = \"api/forms?requestable=true\";\r\nexport const FORMS_REQUEST = (formId, userId) => `api/forms/${formId}/users/${userId}/requests`;\r\nexport const FORMS_PROCESS_REQUEST = (formId, userId, requestId) => `api/forms/${formId}/users/${userId}/requests/${requestId}/processed`;\r\nexport const FORMS_PENDING_REQUESTS = (formId, userId) => `api/forms/${formId}/users/${userId}/requests`;\r\nexport const FORM_CONFIG = (formId) => `api/forms/${formId}`;\r\nexport const FORM_REPORT = (formId, reportId) => `api/forms/${formId}/reports/${reportId}`;\r\nexport const FORM_REPORT_QUERY = (formId, params) => `api/forms/${formId}/reports?${querystring.stringify(params)}`;\r\nexport const FORM_REPORTS_BY_ID = (formId) => `api/forms/${formId}/reports/by/id`;\r\nexport const FORM_REPORT_CREATE = (formId) => `api/forms/${formId}/reports`;\r\nexport const FORM_REPORT_UPDATE = (formId, reportId) => `api/forms/${formId}/reports/${reportId}`;\r\nexport const FORM_REPORT_DELETE = (formId, reportId) => `api/forms/${formId}/reports/${reportId}/delete`;\r\nexport const FORM_REPORT_DETAILS = (formId, reportId) => `api/forms/${formId}/reports/${reportId}/details`;\r\nexport const FORM_REPORT_SUBMIT = (formId, reportId) => `api/forms/${formId}/reports/${reportId}/submit`;\r\nexport const FORM_REPORT_RESTORE = (formId, reportId) => `api/forms/${formId}/reports/${reportId}/restore`;\r\nexport const FORM_REPORT_WITHDRAW = (formId, reportId) => `api/forms/${formId}/reports/${reportId}/withdraw`;\r\n\r\nexport const FORM_PROXIES = (formId) => `api/forms/${formId}/proxies`;\r\nexport const FORM_PROXY_DETAILS = (formId, proxyId) => `api/forms/${formId}/proxies/${proxyId}`;\r\nexport const FORM_PROXY_EXECUTE = (formId, proxy, payloadObject) => {\r\n\tconst baseUri = `api/forms/${formId}/proxies/${proxy.Code}`;\r\n\r\n\tif(proxy.Method !== \"GET\") {\r\n\t\treturn baseUri;\r\n\t}\r\n\r\n\tconst queryParams = [];\r\n\r\n\tforEach(payloadObject, (param, key) => {\r\n\t\tif(param !== null && param !== undefined) {\r\n\t\t\tqueryParams.push(`${key}=${param}`);\r\n\t\t}\r\n\t});\r\n\r\n\tconst qs = queryParams.length > 0 ? `?${queryParams.join(\"&\")}` : \"\";\r\n\r\n\treturn `${baseUri}${qs}`;\r\n};\r\n\r\nexport const REPORT_DETAIL_DELETE = (formId, reportId, detailId) => `api/forms/${formId}/reports/${reportId}/details/${detailId}/delete/`;\r\nexport const REPORT_DETAIL_RESTORE = (formId, reportId, detailId) => `api/forms/${formId}/reports/${reportId}/details/${detailId}/restore/`;\r\nexport const FORM_REPORT_PREVIOUS = (formId, reportId) => `api/forms/${formId}/reports/${reportId}/previous`;\r\nexport const FORM_REPORT_NEXT = (formId, reportId) => `api/forms/${formId}/reports/${reportId}/next`;\r\n\r\nexport const FORM_USERS = (formId) => `api/forms/${formId}/users`;\r\nexport const FORM_USER = (formId, subjectId) => `api/forms/${formId}/users/${subjectId}`;\r\nexport const FORM_USER_ROLES = (formId, subjectId) => `api/forms/${formId}/users/${subjectId}/roles`;\r\nexport const FORM_USER_FAVORITES = (formId, subjectId, entityId, targetType, relationshipType) => \r\n\t`api/forms/${formId}/users/${subjectId}/favorite/entity/${entityId}?targetType=${targetType}&relationshipType=${relationshipType}`;\r\n\r\nexport const FORM_PERMISSIONS = (formId) => `api/forms/${formId}/security`;\r\nexport const FORM_NOTICES = (formId) => `api/forms/${formId}/notices`;\r\n\r\nexport const ACCOUNT_NOTICE_READ = (noticeId) => `api/account/notices/${noticeId}/read`;\r\n\r\nexport const PASSWORD_RESET = \"api/account/password/reset\";\r\nexport const INVITE_RESEND = \"api/users/invite\";\r\n\r\n// export const USER_ENTITIES_ASSOCIATION = (userId, entityId) => `api/users/${userId}/entities/${entityId}`;\r\nexport const USER_PERMIT_ENTITY = (formId, userId, entityId, relationshipType, targetType) =>\r\n\t`api/forms/${formId}/users/${userId}/permit/entity/${entityId}?relationshipType=${relationshipType}&targetType=${targetType}`;\r\nexport const USER_REVOKE_ENTITY = (formId, userId, entityId, relationshipType, targetType) =>\r\n\t`api/forms/${formId}/users/${userId}/revoke/entity/${entityId}?relationshipType=${relationshipType}&targetType=${targetType}`;\r\n\r\nexport const TOKEN_STATUS = (token) => `api/authenticate/status?token=${token}`;\r\nexport const USER_IMPERSONATE = (userId) => `api/authenticate/impersonate/${userId}`;\r\n\r\n//Helper Functions\r\nexport const EXTRACT_PAGE_NAME = (route) => route.substr(route.indexOf(\".\") + 1);\r\n\r\n//UI Routes\r\nexport const BASE_REPORT = \"authenticated.report\";\r\nexport const NEW_REPORT = \"authenticated.report.create\";\r\nexport const EDIT_REPORT = \"authenticated.report.edit\";\r\nexport const DX_REPORT = \"authenticated.report.dx\";\r\nexport const DASHBOARD = \"authenticated.dashboard\";\r\nexport const ENTITIES_SCREEN = \"authenticated.entities\";\r\nexport const EXPORTS_SCREEN = \"authenticated.exports\";\r\nexport const REPORTING_SCREEN = \"authenticated.reporting\";\r\n","const rootArea = \"/states\";\r\n\r\ntype REPORTING_STATE = \"PENDING\" | \"DELETED\" | \"SUBMITTED\" | \"SUBMITTING\";\r\n\r\nexport const statesGlob = (base: string) => (state?: REPORTING_STATE) => ({\r\n\tself: `${base}${rootArea}`,\r\n\tcopy: `${base}${rootArea}/${state}/copy.execute`\r\n});\r\n","import { statesGlob } from \"./states\";\r\n\r\nconst rootArea = \"/types\";\r\n\r\ntype REPORTING_TYPE = \"POSITIVE\" | \"NEGATIVE\"\r\n\r\nexport const typesGlob = (base: string) => (type?: REPORTING_TYPE) => ({\r\n\tread: `${base}${rootArea}/read`,\r\n\tstates: statesGlob(`${base}${rootArea}/${type}`)\r\n});\r\n","const rootArea = \"/aliases\";\r\n\r\nexport const aliasGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyCode: (configCode: string) => ({ \t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${configCode}/read`\r\n\t})\r\n});","const rootArea = \"/operations\";\r\n\r\nexport const INVENTORY_OPERATIONS = {\r\n\tattestation: \"ATTESTATION\" as const,\r\n\tset: \"SET\" as const,\r\n\treset: \"RESET\" as const\r\n};\r\n\r\nexport type InventoryOperationTypes = typeof INVENTORY_OPERATIONS[keyof typeof INVENTORY_OPERATIONS];\r\n\r\nexport const operationsGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyOperation: (operationType: InventoryOperationTypes) => ({\r\n\t\tself: `${baseArea}${rootArea}/${operationType}`,\r\n\t\tread: `${baseArea}${rootArea}/${operationType}/read`,\r\n\t\tcreate: `${baseArea}${rootArea}/${operationType}/create`\r\n\t})\r\n});","import { operationsGlob } from \"./operations\";\r\n\r\nconst rootArea = \"/inventory\";\r\n\r\nexport const inventoryGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyCode: (typeCode: string) => ({ \t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${typeCode}/read`,\r\n\t\toperations: operationsGlob(`${baseArea}${rootArea}/${typeCode}`)\r\n\t})\r\n});","const rootArea = \"/products\";\r\n\r\nexport const productGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyCode: (configCode: string) => ({ \t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${configCode}/read`\r\n\t})\r\n});","const rootArea = \"/geometries\";\r\n\r\nexport const geometriesGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyCode: (configCode: string) => ({ \t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${configCode}/read`\r\n\t})\r\n});","const rootArea = \"/tokens\";\r\n\r\nexport const tokenGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyCode: (configCode: string) => ({ \t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${configCode}/read`\r\n\t})\r\n});","const rootArea = \"/identifiers\";\r\n\r\nexport const identifiersGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyCode: (identifierTypeCode: string) => ({ \t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${identifierTypeCode}/read`,\r\n\t\tcreate: `${baseArea}${rootArea}/${identifierTypeCode}/create`,\r\n\t\tupdate: `${baseArea}${rootArea}/${identifierTypeCode}/update`,\r\n\t\tdeactivate: `${baseArea}${rootArea}/${identifierTypeCode}/deactivate`,\r\n\t\treactivate: `${baseArea}${rootArea}/${identifierTypeCode}/reactivate`\r\n\t})\r\n});","const rootArea = \"/classifications\";\r\n\r\nexport const classificationsGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyCode: (classificationTypeCode: string) => ({ \t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${classificationTypeCode}/read`,\r\n\t\tremove: `${baseArea}${rootArea}/${classificationTypeCode}/remove`,\r\n\t\tadd: `${baseArea}${rootArea}/${classificationTypeCode}/add`\r\n\t})\r\n});","const rootArea = \"/effective\";\r\n\r\nexport const effectiveGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyCode: (effectiveCode: string) => ({ \t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${effectiveCode}/read`,\r\n\t\tcreate: `${baseArea}${rootArea}/${effectiveCode}/create`,\r\n\t\tupdate: `${baseArea}${rootArea}/${effectiveCode}/update`,\r\n\t\tdelete: `${baseArea}${rootArea}/${effectiveCode}/delete`\r\n\t})\r\n});","const rootArea = \"/contacts\";\r\n\r\nexport const contactsGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyCode: (contactCode: string) => ({ \t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${contactCode}/read`,\r\n\t\tcreate: `${baseArea}${rootArea}/${contactCode}/create`,\r\n\t\tupdate: `${baseArea}${rootArea}/${contactCode}/update`,\r\n\t\tdeactivate: `${baseArea}${rootArea}/${contactCode}/deactivate`,\r\n\t\treactivate: `${baseArea}${rootArea}/${contactCode}/reactivate`\r\n\t})\r\n});","import { typesGlob } from \"..\";\r\n\r\nconst rootArea = \"/related\";\r\n\r\nexport const relatedGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyCode: (relationshipCode: string) => ({ \t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${relationshipCode}/read`,\r\n\t\tcreate: `${baseArea}${rootArea}/${relationshipCode}/create`,\r\n\t\tupdate: `${baseArea}${rootArea}/${relationshipCode}/update`,\r\n\t\tdeactivate: `${baseArea}${rootArea}/${relationshipCode}/deactivate`,\r\n\t\treactivate: `${baseArea}${rootArea}/${relationshipCode}/reactivate`,\r\n\t\ttypes: typesGlob(`${baseArea}${rootArea}/${relationshipCode}`)\r\n\t})\r\n});","const rootArea = \"/fees\";\r\n\r\nexport const feesGlob = (baseArea = \"\") => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyType: (typeCode: string) => ({ \t\t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${typeCode}/read`,\r\n\t\tcreate: `${baseArea}${rootArea}/${typeCode}/create`,\r\n\t\tupdate: `${baseArea}${rootArea}/${typeCode}/update`\r\n\t})\r\n});","const rootArea = \"/products\";\r\n\r\nexport const productsGlob = (baseArea = \"\") => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyType: (typeCode: string) => ({ \t\t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${typeCode}/read`,\r\n\t\tcreate: `${baseArea}${rootArea}/${typeCode}/create`,\r\n\t\tupdate: `${baseArea}${rootArea}/${typeCode}/update`\r\n\t})\r\n});","import { typesGlob } from \"../types\";\r\nimport { feesGlob } from \"./fees\";\r\nimport { productsGlob } from \"./products\";\r\n\r\nconst rootArea = \"/businesses\";\r\n\r\nexport const businessGlob = (baseArea = \"\") => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyType: (typeCode: string) => ({ \t\t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${typeCode}/read`,\r\n\t\tcreate: `${baseArea}${rootArea}/${typeCode}/create`,\r\n\t\tupdate: `${baseArea}${rootArea}/${typeCode}/update`,\r\n\t\ttypes: typesGlob(`${baseArea}${rootArea}`),\r\n\t\tfees: feesGlob(`${baseArea}${rootArea}`),\r\n\t\tproducts: productsGlob(`${baseArea}${rootArea}`)\r\n\t})\r\n});","import { aliasGlob } from \"./aliases\";\r\nimport { inventoryGlob } from \"./inventory\";\r\nimport { productGlob } from \"./products\";\r\nimport { geometriesGlob } from \"./geometries\";\r\nimport { tokenGlob } from \"./tokens\";\r\nimport { identifiersGlob } from \"./identifiers\";\r\nimport { classificationsGlob } from \"./classifications\";\r\nimport { effectiveGlob } from \"./effective\";\r\nimport { contactsGlob } from \"./contacts\";\r\nimport { relatedGlob } from \"./related\";\r\nimport { businessGlob } from \"../businesses\";\r\n\r\nconst rootArea = \"/types\";\r\n\r\nexport const typesGlob = (baseArea = \"\") => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyType: (typeCode: string) => ({ \t\r\n\t\tself: `${baseArea}${rootArea}/${typeCode}`,\r\n\t\tread: `${baseArea}${rootArea}/${typeCode}/read`,\r\n\t\twrite: `${baseArea}${rootArea}/${typeCode}/write`,\r\n\t\tadd: `${baseArea}${rootArea}/${typeCode}/add`,\r\n\t\tinventory: inventoryGlob(`${baseArea}${rootArea}/${typeCode}`),\r\n\t\ttokens: tokenGlob(`${baseArea}${rootArea}/${typeCode}`),\r\n\t\taliases: aliasGlob(`${baseArea}${rootArea}/${typeCode}`),\r\n\t\tproducts: productGlob(`${baseArea}${rootArea}/${typeCode}`),\r\n\t\tgeometries: geometriesGlob(`${baseArea}${rootArea}/${typeCode}`),\r\n\t\tidentifiers: identifiersGlob(`${baseArea}${rootArea}/${typeCode}`),\r\n\t\tclassifications: classificationsGlob(`${baseArea}${rootArea}/${typeCode}`),\r\n\t\teffective: effectiveGlob(`${baseArea}${rootArea}/${typeCode}`),\r\n\t\tcontacts: contactsGlob(`${baseArea}${rootArea}/${typeCode}`),\r\n\t\trelated: relatedGlob(`${baseArea}${rootArea}/${typeCode}`),\r\n\t\tbusiness: businessGlob(`${baseArea}${rootArea}/${typeCode}`)\r\n\t})\r\n});\r\n","import { reportsGlob } from \"./reports\";\r\nimport { reportingGlob } from \"./reporting\";\r\nimport { feedbackGlob } from \"./feedback\";\r\nimport { exportsGlob } from \"./exports\";\r\nimport { tokenGlob } from \"./tokens\";\r\nimport { typesGlob } from \"./types\";\r\nimport { subjectGlob } from \"./subjects\";\r\nimport { businessGlob } from \"./businesses\";\r\n\r\nexport const globs = {\r\n\tbusiness: businessGlob(),\r\n\treporting: reportingGlob(),\r\n\treports: reportsGlob(),\r\n\tfeedback: feedbackGlob(),\r\n\texports: exportsGlob,\r\n\tentityTypes: typesGlob(),\r\n\tsubjects: subjectGlob(),\r\n\ttokens: tokenGlob()\r\n};\r\n\r\nexport const anyOf = (base: string) => `${base}/**/*`;\r\nexport {\r\n\tINVENTORY_OPERATIONS, \r\n\tInventoryOperationTypes \r\n} from \"./types/inventory/operations/index\";","import { complianceGlob } from \"./compliance\";\r\nimport { typesGlob } from \"./types\";\r\n\r\nconst rootArea = \"/reporting\";\r\n\r\nexport const reportingGlob = () => ({\r\n\tself: rootArea,\r\n\tcompliance: complianceGlob(rootArea),\r\n\ttypes: typesGlob(rootArea)\r\n});\r\n","import { fieldGlob } from \"./fields\";\r\n\r\nconst rootArea = \"/reports\";\r\n\r\nexport const reportsGlob = () => ({\r\n\tself: rootArea,\r\n\tbyId: (reportId: string) => ({ \t\r\n\t\tself: `${rootArea}/${reportId}`,\t\t\r\n\t\tfields: fieldGlob(`${rootArea}/${reportId}`)\r\n\t})\r\n});\r\n","const rootArea = \"/fields\";\r\n\r\nexport const fieldGlob = (baseArea: string) => ({\r\n\tself: `${baseArea}${rootArea}`,\r\n\tbyCode: (fieldCode: string) => ({ \t\t\t\t\t\r\n\t\tread: `${baseArea}${rootArea}/${fieldCode}/read`, \t\t\t\r\n\t\tedit: `${baseArea}${rootArea}/${fieldCode}/edit`\r\n\t})\r\n});","const rootArea = \"/feedback\";\r\n\r\nexport const feedbackGlob = () => ({\r\n\tread: `${rootArea}/read`, \r\n\tvesl: {\r\n\t\tread: `${rootArea}/vesl/read`,\r\n\t\tphoneNumber: { read: `${rootArea}/vesl/phoneNumber/read` },\r\n\t\temail: { read: `${rootArea}/vesl/email/read` }\r\n\t},\r\n\tagency: {\r\n\t\tread: `${rootArea}/agency/read`,\r\n\t\tphoneNumber: { read: `${rootArea}/agency/phoneNumber/read` },\r\n\t\temail: { read: `${rootArea}/agency/email/read` },\r\n\t\tmarkdown: { read: `${rootArea}/agency/markdown/read` }\r\n\t},\r\n\tremoteSupport: { read: `${rootArea}/remoteSupport/read` }\r\n});\r\n","const rootArea = \"/exports\";\r\n\r\nexport const exportsGlob = (exportConfiguration: string) => ({\r\n\tread: `${rootArea}/${exportConfiguration}/read`,\r\n\tcreate: `${rootArea}/${exportConfiguration}/create`,\r\n\tlogs: (exportLogId: string) => ({\r\n\t\tread: `${rootArea}/${exportConfiguration}/logs/${exportLogId}/read`\r\n\t})\r\n});\r\n","import { typesGlob } from \"../types\";\r\n\r\nconst rootArea = \"/subjects\";\r\n\r\nexport const subjectGlob = () => ({\r\n\tself: rootArea,\r\n\tbyType: (type: string) => ({ \t\t\t\t\t\t\r\n\t\tassigned: typesGlob(`${rootArea}/${type}/assigned`)\r\n\t})\r\n});","const rootArea = \"/tokens\";\r\n\r\nexport const tokenGlob = () => ({\r\n\tself: rootArea,\r\n\tbyType: (type: string) => ({ \t\t\t\t\t\t// type is token configuration code (a guid)\r\n\t\tread: `${rootArea}/${type}/read`, \t\t\t\t// read a saved token\r\n\t\tcreate: `${rootArea}/${type}/create`, \t\t\t// save a built token\r\n\t\tbuild: `${rootArea}/${type}/build`, \t\t\t// enter into create token flow, does not include saving\r\n\t\tdelete: `${rootArea}/${type}/delete`, \t\t\t// delete a saved token\r\n\t\twrite: `${rootArea}/${type}/write`, \t\t\t// write token to card\r\n\t\tpresent: `${rootArea}/${type}/present`, \t\t// display QR or use HCE\r\n\t\tscan: `${rootArea}/${type}/scan`, \t\t\t\t// scan a token from a device or card\r\n\t\tdeactivate: `${rootArea}/${type}/deactivate`\t// scan a token from a device or card\r\n\t})\r\n});","import { Minimatch } from \"minimatch\";\r\n\r\nexport interface IGlob {\r\n\tpath: string;\r\n\r\n\tisMatch(path: string): boolean;\r\n\tisCongruent(path: string | IGlob): boolean;\r\n}\r\n\r\nexport class Glob implements IGlob {\r\n\tpath: string;\r\n\tmatcher: Minimatch;\r\n\tprivate head: Segment;\r\n\r\n\tconstructor(path: string) {\r\n\t\tthis.path = path;\r\n\t\tthis.matcher = new Minimatch(path);\r\n\t\tthis.head = Segment.parse(this.path);\r\n\t}\r\n\r\n\tpublic isMatch(path: string) {\r\n\t\treturn this.matcher.match(path, false);\r\n\t}\r\n\r\n\tpublic isCongruent(path: string | IGlob): boolean {\r\n\t\tif((path as Glob)?.head) {\r\n\t\t\treturn this.head.isCongruentTo((path as Glob).head);\r\n\t\t}\r\n\t\tif((path as IGlob)?.path) {\r\n\t\t\treturn this.isCongruent((path as IGlob).path);\r\n\t\t}\r\n\r\n\t\treturn this.isCongruent(new Glob(path as string));\r\n\t}\r\n}\r\n\r\nclass Segment {\r\n\tprivate static readonly SegmentType = {\r\n\t\tGlobstar: \"Globstar\",\r\n\t\tGlob: \"Glob\",\r\n\t\tPattern: \"Pattern\",\r\n\t\tStatic: \"Static\"\r\n\t} as const;\r\n\r\n\tprivate previous: Segment;\r\n\tprivate next: Segment;\r\n\tprivate matcher: Minimatch;\r\n\r\n\tprivate value: string;\r\n\tprivate type: string;\r\n\r\n\tprivate isGlobstar = false;\r\n\tprivate isWild = false;\r\n\tprivate isPattern = false;\r\n\tprivate isStatic = false;\r\n\r\n\tprivate isHead = false;\r\n\tprivate head: Segment;\r\n\r\n\tprivate get isTail(): boolean {\r\n\t\treturn this.next === undefined;\r\n\t}\r\n\r\n\tprivate get tail(): Segment {\r\n\t\treturn this.isTail ? this : this.next?.tail;\r\n\t}\r\n\r\n\tprivate constructor(previous: Segment, value: string) {\r\n\t\tthis.previous = previous;\r\n\t\tthis.value = value;\r\n\t\tthis.value = value.length === 0 ? \"/\" : value;\r\n\r\n\t\tif(this.value === \"**\") {\r\n\t\t\tthis.isGlobstar = (this.type = Segment.SegmentType.Globstar) === Segment.SegmentType.Globstar;\r\n\t\t}\r\n\t\telse if(this.value === \"*\") {\r\n\t\t\tthis.isWild = (this.type = Segment.SegmentType.Glob) === Segment.SegmentType.Glob;\r\n\t\t}\r\n\t\telse if(this.value === \"/\" || /^[a-zA-Z]+$/.test(this.value)) {\r\n\t\t\tthis.isStatic = (this.type = Segment.SegmentType.Static) === Segment.SegmentType.Static;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.isPattern = (this.type = Segment.SegmentType.Pattern) === Segment.SegmentType.Pattern;\r\n\t\t}\r\n\r\n\t\tthis.isHead = this.previous === undefined;\r\n\t\tthis.head = this.isHead ? this : this.previous?.head;\r\n\r\n\t\tif(this.isPattern) {\r\n\t\t\tthis.matcher = new Minimatch(this.value);\r\n\t\t}\r\n\t}\r\n\r\n\tpublic static parse(path: string): Segment {\r\n\t\tif(!path) {\r\n\t\t\tthrow new Error(\"ArgumentNullException: path\");\r\n\t\t}\r\n\r\n\t\tconst segments = path.split(\"/\");\r\n\r\n\t\tconst head = new Segment(undefined, segments[0]);\r\n\t\tif(segments.length > 1) {\r\n\t\t\tlet tail = head;\r\n\t\t\tfor(let i = 1; i < segments.length; i++) {\r\n\t\t\t\ttail = tail.append(segments[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn head;\r\n\t}\r\n\r\n\tprivate static isCongruent(left: Segment, right: Segment): boolean {\r\n\t\tif(left.isGlobstar) {\r\n\t\t\treturn Segment.isGlobCongruentTo(left, right);\r\n\t\t}\r\n\t\tif(right.isGlobstar) {\r\n\t\t\treturn Segment.isGlobCongruentTo(right, left);\r\n\t\t}\r\n\r\n\t\tif(left.isWild) {\r\n\t\t\treturn Segment.isWildCongruentTo(left, right);\r\n\t\t}\r\n\t\tif(right.isWild) {\r\n\t\t\treturn Segment.isWildCongruentTo(right, left);\r\n\t\t}\r\n\r\n\t\tif(left.isPattern) {\r\n\t\t\treturn Segment.isPatternCongruentTo(left, right);\r\n\t\t}\r\n\t\tif(right.isPattern) {\r\n\t\t\treturn Segment.isPatternCongruentTo(right, left);\r\n\t\t}\r\n\r\n\t\treturn Segment.isStaticCongruentTo(left, right);\r\n\t}\r\n\r\n\tprivate static isGlobCongruentTo(left: Segment, right: Segment): boolean {\r\n\t\tif(left.isTail) {\r\n\t\t\t// this globstar will encompass EVERYTHING\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tlet other = right;\r\n\r\n\t\t// start at depth 0 of the segment (other)\r\n\t\t// globstars are 0 or more consumed directories\r\n\t\t// iterate deeper and check again until match\r\n\t\tdo {\r\n\t\t\tif(Segment.isCongruent(left.next, other)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tother = other.next;\r\n\r\n\t\t\tif(other.isTail && Segment.isCongruent(left.next, other)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(!other.isTail);\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tprivate static isWildCongruentTo(left: Segment, right: Segment): boolean {\r\n\t\treturn Segment.isNextCongruent(left, right);\r\n\t}\r\n\r\n\tprivate static isPatternCongruentTo(left: Segment, right: Segment): boolean {\r\n\t\tif(!left.matcher?.match(right.value, false)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn Segment.isNextCongruent(left, right);\r\n\t}\r\n\r\n\tprivate static isStaticCongruentTo(left: Segment, right: Segment): boolean {\r\n\t\tif(!(left.value === right.value)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn Segment.isNextCongruent(left, right);\r\n\t}\r\n\r\n\tprivate static isNextCongruent(left: Segment, right: Segment): boolean {\r\n\t\tif(left.isTail && right.isTail) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif(left.isTail) {\r\n\t\t\treturn Segment.endsInGlobStar(right.next);\r\n\t\t}\r\n\t\tif(right.isTail) {\r\n\t\t\treturn Segment.endsInGlobStar(left.next);\r\n\t\t}\r\n\r\n\t\treturn Segment.isCongruent(left.next, right.next);\r\n\t}\r\n\r\n\tprivate static endsInGlobStar(segment: Segment | undefined): boolean {\r\n\t\twhile(segment !== undefined && segment.isGlobstar) {\r\n\t\t\tif(segment.isTail) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tsegment = segment.next;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tpublic isCongruentTo(segment: Segment): boolean {\r\n\t\treturn Segment.isCongruent(this, segment);\r\n\t}\r\n\r\n\tprivate append(segment: string): Segment {\r\n\t\tif(this.next !== undefined) {\r\n\t\t\tthrow new Error(\"InvalidOperationException\");\r\n\t\t}\r\n\r\n\t\treturn (this.next = new Segment(this, segment));\r\n\t}\r\n}","import { ActionsAdapter } from \"./adapters/actionsAdapter\";\r\nimport { Glob } from \"./glob\";\r\n\r\nexport type ActionScope = {\r\n\tcheck(adapter: ActionsAdapter): boolean;\r\n}\r\n\r\nexport class All implements ActionScope {\r\n\tscopes: ActionScope[];\r\n\r\n\tconstructor(scopes: ActionScope[]) {\r\n\t\tthis.scopes = scopes;\r\n\t}\r\n\r\n\tcheck(adapter: ActionsAdapter): boolean {\r\n\t\tif(this.scopes.length == 0)\r\n\t\t\treturn false;\r\n\r\n\t\tfor(const scope of this.scopes) {\r\n\t\t\tif(!scope.check(adapter))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n}\r\n\r\nexport class Any implements ActionScope {\r\n\tscopes: ActionScope[];\r\n\r\n\tconstructor(scopes: ActionScope[]) {\r\n\t\tthis.scopes = scopes;\r\n\t}\r\n\r\n\tcheck(adapter: ActionsAdapter): boolean {\r\n\t\tif(this.scopes.length == 0)\r\n\t\t\treturn false;\r\n\r\n\t\tfor(const scope of this.scopes) {\r\n\t\t\tif(scope.check(adapter))\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nexport class Action implements ActionScope {\r\n\taction: string;\r\n\r\n\tconstructor(action: string) {\r\n\t\tthis.action = action;\r\n\t}\r\n\r\n\tcheck(adapter: ActionsAdapter): boolean {\r\n\t\treturn adapter.isAllowed(this);\r\n\t}\r\n}\r\n\r\nexport class Pattern implements ActionScope {\r\n\tpattern: Glob;\r\n\r\n\tconstructor(pattern: string) {\r\n\t\tthis.pattern = new Glob(pattern);\r\n\t}\r\n\r\n\tcheck(adapter: ActionsAdapter): boolean {\r\n\t\treturn adapter.hasCongruency(this);\r\n\t}\r\n}\r\n\r\nexport class ActionOrPattern extends Any {\r\n\tconstructor(actionOrPattern: string) {\r\n\t\tsuper([\r\n\t\t\tnew Action(actionOrPattern),\r\n\t\t\tnew Pattern(actionOrPattern)\r\n\t\t]);\r\n\t}\r\n}\r\n","import { globs } from \"../globs\";\r\nimport {\r\n\tActionScope,\r\n\tAny, \r\n\tPattern \r\n} from \"./actionScopes\";\r\n\r\nexport const isAnyTypePermittedScope = (): ActionScope => {\r\n\tconst canReadAnyTypeGlob = globs.entityTypes.byType(\"*\").read;\r\n\tconst canReadAnyTypePattern = new Pattern(canReadAnyTypeGlob);\r\n\r\n\tconst canAnySubjectReadTypeGlob = globs.subjects.byType(\"*\").assigned.byType(\"*\").read;\r\n\tconst canAnySubjectReadTypePattern = new Pattern(canAnySubjectReadTypeGlob);\r\n\r\n\tconst anyTypeScope = new Any([canReadAnyTypePattern, canAnySubjectReadTypePattern]);\r\n\r\n\treturn anyTypeScope;\r\n};\r\n\r\nexport const isTypePermittedScope = (typeCode: string): ActionScope => {\r\n\tconst canReadAnyTypeGlob = globs.entityTypes.byType(typeCode).read;\r\n\tconst canReadAnyTypePattern = new Pattern(canReadAnyTypeGlob);\r\n\r\n\tconst canAnySubjectReadTypeGlob = globs.subjects.byType(\"*\").assigned.byType(typeCode).read;\r\n\tconst canAnySubjectReadTypePattern = new Pattern(canAnySubjectReadTypeGlob);\r\n\r\n\tconst anyTypeScope = new Any([canReadAnyTypePattern, canAnySubjectReadTypePattern]);\r\n\r\n\treturn anyTypeScope;\r\n};","/* eslint-disable no-undef */\r\nimport template from \"./main-nav.html\";\r\nimport {\r\n\tFEATURE_TYPES,\r\n\tEVENT_NEW_FORM\r\n} from \"constants.js\";\r\nimport hotkeyConfigs from \"../services/hotkeyConfig\";\r\nimport * as routes from \"routes.js\";\r\nimport \"./main-nav.less\";\r\nimport { globs } from \"../services/globs\";\r\nimport {\r\n\tActionOrPattern,\r\n\tAny\r\n} from \"../services/security/actionScopes\";\r\nimport { isAnyTypePermittedScope } from \"../services/security/commonScopes\";\r\n\r\nfunction controller($rootScope, $scope, $element, appState, hotkeys, $state, cardSwipeService, eventBus, $logger, securityService) {\r\n\t$scope.uiState = $rootScope.uiState;\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$destroy = onDestroy;\r\n\tctrl.goTo = goTo;\r\n\tctrl.initCardSwipe = initCardSwipe;\r\n\tctrl.routes = routes;\r\n\tctrl.close = close;\r\n\r\n\tctrl.canReadExportLogs = globs.exports(\"*\").logs(\"*\").read;\r\n\tctrl.canReadExports = globs.exports(\"*\").read;\r\n\tctrl.canCreateExport = globs.exports(\"*\").create;\r\n\tctrl.canViewExportScreenScope = new Any([\r\n\t\tnew ActionOrPattern(this.canReadExportLogs),\r\n\t\tnew ActionOrPattern(this.canReadExports),\r\n\t\tnew ActionOrPattern(this.canCreateExport)\r\n\t]);\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.permissions = appState.permissions;\r\n\r\n\t\tconst anyTypeAccessible = isAnyTypePermittedScope();\r\n\t\tctrl.canViewEntities = securityService.isActionScopeAllowed(anyTypeAccessible);\r\n\r\n\t\tif(!ctrl.form)\r\n\t\t\treturn;\r\n\r\n\t\t$element.on(\"click\", e => {\r\n\t\t\tif($element[0] === e.target) {\r\n\t\t\t\t$scope.uiState.sidebar.open = false;\r\n\t\t\t\t$scope.$evalAsync();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tctrl.canCardSwipe = ctrl.form.Features && ctrl.form.Features.filter(f => f.Type === FEATURE_TYPES.webCardSwipe).length > 0;\r\n\r\n\t\taddHotKeys();\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_NEW_FORM,\r\n\t\t\t() => {\r\n\t\t\t\tctrl.form = appState.forms.selected;\r\n\t\t\t\tctrl.canCardSwipe = ctrl.form.Features && ctrl.form.Features.filter(f => f.Type === FEATURE_TYPES.webCardSwipe).length > 0;\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\t}\r\n\r\n\tfunction addHotKeys() {\r\n\t\tif(!ctrl.permissions.Reporting.IsDisabled && ctrl.permissions.Reporting.Actions.CanCreate) {\r\n\t\t\thotkeys.add(hotkeyConfigs.GLOBAL.NEW_REPORT(`New ${ctrl.form.nomenclature.PositiveReport}`, () => {\r\n\t\t\t\t$state.transitionTo(NEW_REPORT, { \"via\": \"keyboard-shortcut\" }, { reload: NEW_REPORT });\r\n\t\t\t}));\r\n\t\t}\r\n\r\n\t\tif(!ctrl.permissions.History.IsDisabled) {\r\n\t\t\thotkeys.add(hotkeyConfigs.GLOBAL.REPORT_LIST(`Find ${ctrl.form.nomenclature.PositiveReport}`, () => {\r\n\t\t\t\t$state.go(\"authenticated.report-list\", { \"via\": \"keyboard-shortcut\" });\r\n\t\t\t}));\r\n\t\t}\r\n\r\n\t\thotkeys.add(hotkeyConfigs.GLOBAL.DASHBOARD(() => {\r\n\t\t\t$state.go(\"authenticated.dashboard\", { \"via\": \"keyboard-shortcut\" });\r\n\t\t}));\r\n\r\n\t\thotkeys.add(hotkeyConfigs.GLOBAL.SHOW_NAVIGATION_BAR(() => {\r\n\t\t\t$scope.uiState.sidebar.open = !$scope.uiState.sidebar.open;\r\n\t\t}));\r\n\r\n\t\tif(!ctrl.permissions.Compliance.IsDisabled) {\r\n\t\t\thotkeys.add(hotkeyConfigs.GLOBAL.REPORT_COMPLIANCE(() => {\r\n\t\t\t\t$state.go(\"authenticated.compliance\", { \"via\": \"keyboard-shortcut\" });\r\n\t\t\t}));\r\n\t\t}\r\n\t}\r\n\r\n\tfunction onDestroy() {\r\n\t\t$element.off(\"click\");\r\n\t}\r\n\r\n\tfunction goTo(route) {\r\n\t\t$state.transitionTo(route, { \"via\": \"main-nav\" }, { location: true, reload: route });\r\n\t}\r\n\r\n\tfunction initCardSwipe() {\r\n\t\tcardSwipeService.initializeCardSwipe();\r\n\t}\r\n\r\n\tfunction close() {\r\n\t\t$scope.uiState.sidebar.open = false;\r\n\t\tdocument.querySelector(\"[on-trigger-focus=main-nav]\").focus();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.layout.main-nav\", [])\r\n\t.component(\"mainNav\", { template, controller }).name;\r\n","import \"./index.less\";\r\n\r\nimport mainHeader from \"./headers/main-header/index.js\";\r\nimport mainNav from \"./main-nav.js\";\r\n\r\nconst deps = [mainHeader, mainNav];\r\n\r\nexport default angular.module(\"vesl.layout\", deps).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tDashboard\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tReporting Status\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tCreate {{$ctrl.form.nomenclature.PositiveReport}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tCreate {{$ctrl.form.nomenclature.NegativeReport}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tFind {{$ctrl.form.nomenclature.PositiveReport}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tCreate {{$ctrl.form.nomenclature.PositiveReport}} with Card\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tManage\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\r\\n\";","export function etagInterceptor($logger) {\r\n\treturn {\r\n\t\trequest: (config) => {\r\n\t\t\tif(config?.data?.ifMatch !== undefined) {\r\n\t\t\t\tif(config.headers === undefined) {\r\n\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t}\r\n\t\t\t\tconfig.headers[\"If-Match\"] = config.data.ifMatch;\r\n\t\t\t\tdelete config.data.ifMatch;\r\n\t\t\t}\r\n\r\n\t\t\treturn config;\r\n\t\t},\r\n\t\tresponse: (response) => {\r\n\t\t\tif(Array.isArray(response?.data?.Data) || response?.headers(\"etag\") === undefined || response?.data?.Data === undefined) {\r\n\t\t\t\treturn response;\r\n\t\t\t}\r\n\r\n\t\t\treturn {\r\n\t\t\t\t...response,\r\n\t\t\t\tdata: {\r\n\t\t\t\t\t...response.data,\r\n\t\t\t\t\tData: {\r\n\t\t\t\t\t\t...response.data.Data,\r\n\t\t\t\t\t\tetag: response.data.Data.etag ?? response.headers(\"etag\")\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t}\r\n\t};\r\n}","\r\nexport function statusInterceptor(\r\n\t$q,\r\n\t$injector\r\n) {\r\n\treturn {\r\n\t\tresponse(resp) {\r\n\t\t\tif(resp?.data?.Success !== undefined && resp?.data?.Success != null && !resp?.data?.Success) {\r\n\t\t\t\thandleErrorMessage(resp.data.Errors?.[0]);\r\n\t\t\t\treturn $q.reject(resp);\r\n\t\t\t}\r\n\t\t\treturn resp;\r\n\t\t},\r\n\r\n\t\tresponseError(response) {\r\n\t\t\t// DO NOT REMOVE: will reimplement later when server supports it\r\n\t\t\t// if(response.status == 503) {\r\n\t\t\t// \tresponse.data.Success = true;\r\n\r\n\t\t\t// \tlet isBackgroundRequest = false;\r\n\t\t\t// \tif(response.config.url.indexOf(\"api\") < 0 || response.config.url.indexOf(\"api/authenticate/token\") > -1) {\r\n\t\t\t// \t\tisBackgroundRequest = true;\r\n\t\t\t// \t}\r\n\r\n\t\t\t// \tconst appState = $injector.get(\"appState\");\r\n\t\t\t// \tappState.setUnavailable(response.data.Errors[0], isBackgroundRequest);\r\n\r\n\t\t\t// \tconst api = $injector.get(\"api\");\r\n\t\t\t// \tconst timeout = $injector.get(\"$timeout\");\r\n\r\n\t\t\t// \treturn timeout(() => {\r\n\t\t\t// \t\treturn api.http(response.config)\r\n\t\t\t// \t\t\t.then((response) => {\r\n\t\t\t// \t\t\t\tappState.clearUnavailable();\r\n\t\t\t// \t\t\t\treturn response;\r\n\t\t\t// \t\t\t})\r\n\t\t\t// \t\t\t.catch(() => {\r\n\t\t\t// \t\t\t\tappState.clearUnavailable();\r\n\t\t\t// \t\t\t});\r\n\t\t\t// \t}, 30000);\r\n\t\t\t// }\r\n\t\t\t// else {\r\n\t\t\tlet message;\r\n\r\n\t\t\tif(response.status == -1) {\r\n\t\t\t\tmessage = \"Unable to connect to the internet. Please ensure you are connected.\";\r\n\t\t\t}\r\n\t\t\telse if(response.status !== 404 && response.data && (response.data.Errors || []).length) {\r\n\t\t\t\tmessage = `Errors from server:

${response.data.Errors.join(\"

\")}`;\r\n\t\t\t}\r\n\r\n\t\t\tif(response.status !== 400 || !response.success) {\r\n\t\t\t\thandleErrorMessage(message);\r\n\t\t\t}\r\n\r\n\t\t\treturn $q.reject(response);\r\n\t\t}\r\n\t\t// }\r\n\t};\r\n\r\n\tfunction handleErrorMessage(message) {\r\n\t\tif(message) {\r\n\t\t\t$injector.get(\"toastr\").error(message);\r\n\t\t}\r\n\t}\r\n}\r\n","const key = \"jamesify-forms-names\";\r\n\r\nconst applicable = (resp) => resp.config.url.endsWith(\"api/forms\");\r\n\r\nconst modify = (resp) => {\r\n\tresp.data.Data.forEach(form => form.Name += \" jamesified\");\r\n};\r\n\r\nexport const jamesifyForm = [key, applicable, modify];","const key = \"draft-reports\";\r\n\r\nconst applicable = (resp) => resp.config.url.match(/api\\/forms\\/[0-9]+\\/reports\\?/g);\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data?.Data.length) {\r\n\t\treturn;\r\n\t}\r\n\tconst data = resp.data.Data;\r\n\tdata[Math.floor(Math.random() * (data.length))].Date = undefined;\r\n\tdata[Math.floor(Math.random() * (data.length))].Date = undefined;\r\n};\r\n\r\nexport const draftReports = [key, applicable, modify];","const key = \"item-deactivated-at\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Fields)\r\n\t\treturn;\r\n\tresp.data.Data.Fields.forEach(field => {\r\n\t\tif(!field.Data)\r\n\t\t\treturn;\r\n\r\n\t\tlet count = 0;\r\n\t\t\r\n\t\t// this is intended to test items with no deactivatedAt property, a distant one, and a past one.\r\n\t\tfield.Data.forEach(item => {\r\n\t\t\tswitch((count++) % 3) {\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\titem.DeactivatedAt = \"2021-04-01T05:00:00.000Z\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1: \r\n\t\t\t\t\titem.DeactivatedAt = \"2100-01-01T06:00:00.000Z\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault: \r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcount++;\r\n\t\t});\r\n\t});\r\n};\r\n\r\nexport const itemDeactivatedAt = [key, applicable, modify];","const key = \"add-entity-filter\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/12$/);\r\n};\r\n\r\nconst ruleJson = {\r\n\t\"Id\": 1,\r\n\t\"Title\": \"Fisherman classified 11 only allows vessel MS4321\",\r\n\t\"Operator\":\r\n\t{\r\n\t\t\"Id\": 2,\r\n\t\t\"Code\": \"OR\",\r\n\t\t\"Name\": \"Or\"\r\n\t},\r\n\t\"Children\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Id\": 1,\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 2,\r\n\t\t\t\t\"Code\": \"OR\",\r\n\t\t\t\t\"Name\": \"Or\"\r\n\t\t\t},\r\n\t\t\t\"Engine\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 2,\r\n\t\t\t\t\"Code\": \"CLASSIFICATION\",\r\n\t\t\t\t\"Name\": \"Classification\"\r\n\t\t\t},\r\n\t\t\t\"Conditions\":\r\n\t\t\t[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\t\"Field\":\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"Id\": 905\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"Operator\":\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"Id\": 7,\r\n\t\t\t\t\t\t\"Code\": \"ISNOT\",\r\n\t\t\t\t\t\t\"Name\": \"Classification : Is Not Classified As\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"Value\": \"55\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"Id\": 2,\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 2,\r\n\t\t\t\t\"Code\": \"OR\",\r\n\t\t\t\t\"Name\": \"Or\"\r\n\t\t\t},\r\n\t\t\t\"Engine\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 2,\r\n\t\t\t\t\"Code\": \"COMPARE\",\r\n\t\t\t\t\"Name\": \"Compare\"\r\n\t\t\t},\r\n\t\t\t\"Conditions\":\r\n\t\t\t[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"Id\": 3,\r\n\t\t\t\t\t\"Field\":\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"Id\": 921\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"Operator\":\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"Id\": 99,\r\n\t\t\t\t\t\t\"Code\": \"EQUALTO\",\r\n\t\t\t\t\t\t\"Name\": \"Equal To\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"Value\": \"MS4321\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t],\r\n\t\"Triggers\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Field\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 921\r\n\t\t\t},\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 13,\r\n\t\t\t\t\"Code\": \"FILTER\",\r\n\t\t\t\t\"Name\": \"Filter\"\r\n\t\t\t},\r\n\t\t\t\"Type\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 2,\r\n\t\t\t\t\"Code\": \"USERINTERFACE\",\r\n\t\t\t\t\"Name\": \"User Interface\"\r\n\t\t\t}\r\n\t\t}\r\n\t],\r\n\t\"Scope\":\r\n\t{\r\n\t\t\"Code\": \"REPORT\"\r\n\t}\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Rules) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tresp.data.Data.Rules.push(ruleJson);\r\n};\r\n\r\nexport const addEntityFilter = [key, applicable, modify];","import moment from \"moment\";\r\n\r\nconst applicable = (resp) => resp.config.url.match(/api\\/forms\\/[0-9]*$/g);\r\n\r\n// const testOptions = {\r\n// \tendedInGrace: \"ENDED_IN_GRACE\",\r\n// \tnotStartedInGrace: \"NOT_STARTED_IN_GRACE\",\r\n// \tendedNotInGrace: \"ENDED_NOT_IN_GRACE\"\r\n// };\r\n\r\n// const alterationMethods = {\r\n// \tendedInGrace: (range, entity) => entity.Effective = {\r\n// \t\t...range,\r\n// \t\tEnd: moment().subtract(1, \"month\"),\r\n// \t\tNoLaterThan: moment().add(1, \"month\"),\r\n// \t\tNoEarlierThan: range.Start\r\n// \t},\r\n// \tendedNotInGrace: (range, entity) => entity.Effective = {\r\n// \t\t...range,\r\n// \t\tStart: moment().add(1, \"month\"),\r\n// \t\tNoLaterThan: moment().add(12, \"month\"),\r\n// \t\tNoEarlierThan: moment().subtract(1, \"month\")\r\n// \t}\r\n// notStartedInGrace: {\r\n\t\t\r\n// }\r\n// }; \r\n\r\nconst addNotStartedInGrace = (entity) => {\r\n\treturn entity.Effective = entity.Effective.map(range => ({\r\n\t\t...range,\r\n\t\tStart: moment().add(1, \"month\"),\r\n\t\tNoEarlierThan: moment().subtract(1, \"month\"),\r\n\t\tEnd: moment().add(1, \"month\"),\r\n\t\tNoLaterThan: moment().add(1, \"month\")\r\n\t})); \r\n};\r\n\r\nconst addEndedNotInGrace = entity => { \r\n\treturn entity.Effective = entity.Effective.map(range => ({\r\n\t\t...range,\r\n\t\tEnd: moment().subtract(1, \"month\"),\r\n\t\tStart: moment().subtract(3, \"month\"),\r\n\t\tNoLaterThan: moment().subtract(1, \"month\"),\r\n\t\tNoEarlierThan: moment().subtract(3, \"month\")\r\n\t})); \r\n};\r\n\r\nconst addEndedInGrace = entity => {\r\n\treturn entity.Effective = entity.Effective.map(range => ({\r\n\t\t...range,\r\n\t\tEnd: moment().subtract(1, \"month\"),\r\n\t\tNoLaterThan: moment().add(1, \"month\"),\r\n\t\tNoEarlierThan: range.Start\r\n\t}));\r\n};\r\n\r\n\r\n\r\nconst alterRanges = (alterMethod, entity) => {\r\n\tif(entity?.Effective) {\r\n\t\t// change effective ranges to add a variety of grace period test cases\r\n\t\treturn alterMethod(entity);\r\n\t\t// return entity.Effective = entity.Effective.map(range => {\r\n\t\t// \treturn {\r\n\t\t// \t\t...range,\r\n\t\t// \t\tStart: moment().add(1, \"month\"),\r\n\t\t// \t\tNoEarlierThan: moment().subtract(1, \"month\"),\r\n\t\t// \t\tEnd: moment().add(1, \"month\"),\r\n\t\t// \t\tNoLaterThan: moment().add(1, \"month\")\r\n\t\t// \t};\r\n\t\t// });\r\n\t}\r\n\r\n\tif(entity.Entities) {\r\n\t\tfor(const related of entity.Entities) {\r\n\t\t\talterRanges(alterMethod, related.Entity);\r\n\t\t}\r\n\t}\r\n\r\n\treturn false; \r\n};\r\n\r\nconst modify = (alterMethod, resp) => {\r\n\tif(!resp.data?.Data) {\r\n\t\treturn resp;\r\n\t}\r\n\t// const seasons = keyBy(resp.data.Data.Seasons ?? [], season => season.Code);\r\n\tfor(const field of resp.data.Data.Fields || []) {\r\n\t\tif(field.Type?.IsEntity !== true) \r\n\t\t\tcontinue;\r\n \r\n\t\tif(field.Data?.length < 1) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tfor(const entity of field.Data) {\r\n\t\t\talterRanges(alterMethod, entity);\r\n\t\t}\r\n\t}\r\n\r\n\treturn resp;\r\n};\r\n\r\nconst modifyNotStartedInGrace = (resp) => modify(addNotStartedInGrace, resp);\r\nconst notStartedInGraceKey = \"grace-period:before-start\";\r\n\r\nconst modifyEndedNotInGrace = (resp) => modify(addEndedNotInGrace, resp);\r\nconst endedNotInGraceKey = \"grace-period:none\";\r\n\r\nconst modifyEndedInGrace = (resp) => modify(addEndedInGrace, resp);\r\nconst endedInGraceKey = \"grace-period:ended\";\r\n\r\nexport const gracePeriodAfterEnd = [endedInGraceKey, applicable, modifyEndedInGrace];\r\nexport const gracePeriodBeforeStart = [notStartedInGraceKey, applicable, modifyNotStartedInGrace];\r\nexport const gracePeriodNone = [endedNotInGraceKey, applicable, modifyEndedNotInGrace];","export const findValidFieldId = (config) => {\r\n\tif(config.Fields) {\r\n\t\treturn config.Fields[0]?.Id;\r\n\t}\r\n};","import { findValidFieldId } from \"./findValidFieldId\";\r\n\r\nconst key = \"add-unknown-engine\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst ruleJson = (validFieldId) => ({\r\n\t\"Id\": 1,\r\n\t\"Title\": \"Unknown Engine\",\r\n\t\"Operator\":\r\n\t{\r\n\t\t\"Id\": 2,\r\n\t\t\"Code\": \"OR\",\r\n\t\t\"Name\": \"Or\"\r\n\t},\r\n\t\"Engine\":\r\n\t{\r\n\t\t\"Id\": 1,\r\n\t\t\"Code\": \"RANDOM-UNKNOWN\",\r\n\t\t\"Name\": \"NotKnown\"\r\n\t},\r\n\t\"Conditions\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Id\": 1,\r\n\t\t\t\"Field\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": validFieldId\r\n\t\t\t}\r\n\t\t}\r\n\t],\r\n\t\"Triggers\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"BLOCKSAVE\",\r\n\t\t\t\t\"Name\": \"Block Saving\"\r\n\t\t\t},\r\n\t\t\t\"Type\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"VALIDATION\",\r\n\t\t\t\t\"Name\": \"Validation\"\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n});\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Rules) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst ruleWithUnknownEngine = ruleJson(findValidFieldId(resp.data.Data));\r\n\tresp.data.Data.Rules.push(ruleWithUnknownEngine);\r\n};\r\n\r\nexport const addUnknownEngine = [key, applicable, modify];","import { findValidFieldId } from \"./findValidFieldId\";\r\n\r\nconst key = \"add-no-engine\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst ruleJson = (validFieldId) => ({\r\n\t\"Id\": 5,\r\n\t\"Title\": \"No Engine\",\r\n\t\"Operator\":\r\n\t{\r\n\t\t\"Id\": 2,\r\n\t\t\"Code\": \"OR\",\r\n\t\t\"Name\": \"Or\"\r\n\t},\r\n\t\"Conditions\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Id\": 1,\r\n\t\t\t\"Field\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": validFieldId\r\n\t\t\t}\r\n\t\t}\r\n\t],\r\n\t\"Triggers\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"BLOCKSAVE\",\r\n\t\t\t\t\"Name\": \"Block Saving\"\r\n\t\t\t},\r\n\t\t\t\"Type\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"VALIDATION\",\r\n\t\t\t\t\"Name\": \"Validation\"\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n});\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Rules) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst ruleWithNoEngine = ruleJson(findValidFieldId(resp.data.Data));\r\n\tresp.data.Data.Rules.push(ruleWithNoEngine);\r\n};\r\n\r\nexport const addNoEngine = [key, applicable, modify];","const key = \"add-no-conditions\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst ruleJson = () => ({\r\n\t\"Id\": 6,\r\n\t\"Title\": \"No Conditions\",\r\n\t\"Operator\":\r\n\t{\r\n\t\t\"Id\": 2,\r\n\t\t\"Code\": \"OR\",\r\n\t\t\"Name\": \"Or\"\r\n\t},\r\n\t\"Engine\":\r\n\t{\r\n\t\t\"Id\": 4,\r\n\t\t\"Code\": \"EMPTY\",\r\n\t\t\"Name\": \"Empty\"\r\n\t},\r\n\t\"Triggers\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"BLOCKSAVE\",\r\n\t\t\t\t\"Name\": \"Block Saving\"\r\n\t\t\t},\r\n\t\t\t\"Type\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"VALIDATION\",\r\n\t\t\t\t\"Name\": \"Validation\"\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n});\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Rules) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst ruleWithNoConditions = ruleJson();\r\n\tresp.data.Data.Rules.push(ruleWithNoConditions);\r\n};\r\n\r\nexport const addNoConditions = [key, applicable, modify];","import { findValidFieldId } from \"./findValidFieldId\";\r\n\r\nconst key = \"add-unknown-trigger\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst ruleJson = (validFieldId) => ({\r\n\t\"Id\": 2,\r\n\t\"Title\": \"Unknown Trigger\",\r\n\t\"Operator\":\r\n\t{\r\n\t\t\"Id\": 2,\r\n\t\t\"Code\": \"OR\",\r\n\t\t\"Name\": \"Or\"\r\n\t},\r\n\t\"Engine\":\r\n\t{\r\n\t\t\"Id\": 4,\r\n\t\t\"Code\": \"EMPTY\",\r\n\t\t\"Name\": \"Empty\"\r\n\t},\r\n\t\"Conditions\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Id\": 1,\r\n\t\t\t\"Field\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": validFieldId\r\n\t\t\t}\r\n\t\t}\r\n\t],\r\n\t\"Triggers\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 50,\r\n\t\t\t\t\"Code\": \"UNKNOWN-TRIGGER-OPERATOR\",\r\n\t\t\t\t\"Name\": \"What\"\r\n\t\t\t},\r\n\t\t\t\"Type\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"VALIDATION\",\r\n\t\t\t\t\"Name\": \"Validation\"\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n});\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Rules) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst ruleWithUnknownTrigger = ruleJson(findValidFieldId(resp.data.Data));\r\n\tresp.data.Data.Rules.push(ruleWithUnknownTrigger);\r\n};\r\n\r\nexport const addUnknownTrigger = [key, applicable, modify];","const key = \"add-unknown-field\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst ruleJson = (invalidFieldId) => ({\r\n\t\"Id\": 3,\r\n\t\"Title\": \"Unknown Field\",\r\n\t\"Operator\":\r\n\t{\r\n\t\t\"Id\": 2,\r\n\t\t\"Code\": \"OR\",\r\n\t\t\"Name\": \"Or\"\r\n\t},\r\n\t\"Engine\":\r\n\t{\r\n\t\t\"Id\": 4,\r\n\t\t\"Code\": \"EMPTY\",\r\n\t\t\"Name\": \"Empty\"\r\n\t},\r\n\t\"Conditions\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Id\": 1,\r\n\t\t\t\"Field\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": invalidFieldId\r\n\t\t\t}\r\n\t\t}\r\n\t],\r\n\t\"Triggers\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"BLOCKSAVE\",\r\n\t\t\t\t\"Name\": \"Block Saving\"\r\n\t\t\t},\r\n\t\t\t\"Type\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"VALIDATION\",\r\n\t\t\t\t\"Name\": \"Validation\"\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n});\r\n\r\nfunction getRandomInt(max) {\r\n\treturn Math.floor(Math.random() * max);\r\n}\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Rules || !resp.data.Data?.Fields) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst validFieldIds = resp.data.Data.Fields.map(f => f.Id);\r\n\r\n\tlet invalidFieldId;\r\n\tdo {\r\n\t\tinvalidFieldId = getRandomInt(10000); \r\n\t} while(validFieldIds.indexOf(invalidFieldId) > -1); \r\n\r\n\tconst ruleWithUnknownFieldId = ruleJson(invalidFieldId);\r\n\tresp.data.Data.Rules.push(ruleWithUnknownFieldId);\r\n};\r\n\r\nexport const addUnknownFieldId = [key, applicable, modify];","import { findValidFieldId } from \"./findValidFieldId\";\r\n\r\nconst key = \"add-invalid-children\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst ruleJson = (validFieldId) => ({\r\n\t\"Id\": 4,\r\n\t\"Title\": \"Invalid children\",\r\n\t\"Operator\":\r\n\t{\r\n\t\t\"Id\": 2,\r\n\t\t\"Code\": \"OR\",\r\n\t\t\"Name\": \"Or\"\r\n\t},\r\n\t\"Children\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Id\": 4,\r\n\t\t\t\"Title\": \"Unknown Engine\",\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 2,\r\n\t\t\t\t\"Code\": \"OR\",\r\n\t\t\t\t\"Name\": \"Or\"\r\n\t\t\t},\r\n\t\t\t\"Engine\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"RANDOM-UNKNOWN\",\r\n\t\t\t\t\"Name\": \"NotKnown\"\r\n\t\t\t},\r\n\t\t\t\"Conditions\":\r\n\t\t\t[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\t\"Field\":\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"Id\": validFieldId\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t],\r\n\t\"Triggers\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"BLOCKSAVE\",\r\n\t\t\t\t\"Name\": \"Block Saving\"\r\n\t\t\t},\r\n\t\t\t\"Type\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"VALIDATION\",\r\n\t\t\t\t\"Name\": \"Validation\"\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n});\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Rules) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst ruleWithUnknownTrigger = ruleJson(findValidFieldId(resp.data.Data));\r\n\tresp.data.Data.Rules.push(ruleWithUnknownTrigger);\r\n};\r\n\r\nexport const addInvalidChildren = [key, applicable, modify];","import { findValidFieldId } from \"./findValidFieldId\";\r\n\r\nconst key = \"add-children-with-engine\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst ruleJson = (validFieldId) => ({\r\n\t\"Id\": 7,\r\n\t\"Title\": \"Children With Engine\",\r\n\t\"Operator\":\r\n\t{\r\n\t\t\"Id\": 2,\r\n\t\t\"Code\": \"OR\",\r\n\t\t\"Name\": \"Or\"\r\n\t},\r\n\t\"Engine\":\r\n\t{\r\n\t\t\"Id\": 4,\r\n\t\t\"Code\": \"EMPTY\",\r\n\t\t\"Name\": \"Empty\"\r\n\t},\r\n\t\"Children\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Id\": 4,\r\n\t\t\t\"Title\": \"Empty\",\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 2,\r\n\t\t\t\t\"Code\": \"OR\",\r\n\t\t\t\t\"Name\": \"Or\"\r\n\t\t\t},\r\n\t\t\t\"Engine\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 4,\r\n\t\t\t\t\"Code\": \"EMPTY\",\r\n\t\t\t\t\"Name\": \"Empty\"\r\n\t\t\t},\r\n\t\t\t\"Conditions\":\r\n\t\t\t[\r\n\t\t\t\t{\r\n\t\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\t\"Field\":\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"Id\": validFieldId\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t],\r\n\t\"Triggers\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"BLOCKSAVE\",\r\n\t\t\t\t\"Name\": \"Block Saving\"\r\n\t\t\t},\r\n\t\t\t\"Type\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"VALIDATION\",\r\n\t\t\t\t\"Name\": \"Validation\"\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n});\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Rules) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst ruleWithChildrenAndEngine = ruleJson(findValidFieldId(resp.data.Data));\r\n\tresp.data.Data.Rules.push(ruleWithChildrenAndEngine);\r\n};\r\n\r\nexport const addChildrenWithEngine = [key, applicable, modify];","const key = \"add-online-engine\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst ruleJson = () => ({\r\n\t\"Id\": 1,\r\n\t\"Title\": \"App must be online to perform this action\",\r\n\t\"Operator\":\r\n\t{\r\n\t\t\"Id\": 2,\r\n\t\t\"Code\": \"OR\",\r\n\t\t\"Name\": \"Or\"\r\n\t},\r\n\t\"Engine\":\r\n\t{\r\n\t\t\"Id\": 1,\r\n\t\t\"Code\": \"ENVIRONMENT\",\r\n\t\t\"Name\": \"Environment\"\r\n\t},\r\n\t\"Conditions\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Id\": 1,\r\n\t\t\t\"Operator\": {\r\n\t\t\t\tId: 2,\r\n\t\t\t\tCode: \"ISONLINE\",\r\n\t\t\t\tName: \"Is the device online\"\r\n\t\t\t},\r\n\t\t\t\"Value\": true\r\n\t\t}\r\n\t],\r\n\t\"Triggers\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"BLOCKSAVE\",\r\n\t\t\t\t\"Name\": \"Block Saving\"\r\n\t\t\t},\r\n\t\t\t\"Type\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"VALIDATION\",\r\n\t\t\t\t\"Name\": \"Validation\"\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n});\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Rules) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst ruleWithNoEngine = ruleJson();\r\n\tresp.data.Data.Rules.push(ruleWithNoEngine);\r\n};\r\n\r\nexport const addOnlineEngine = [key, applicable, modify];","const key = \"add-readonly-trigger\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/4$/);\r\n};\r\n\r\nconst ruleJson = (validFieldId, readonlyFieldId) => ({\r\n\t\"Id\": 2,\r\n\t\"Title\": \"Readonly Trigger\",\r\n\t\"Operator\":\r\n\t{\r\n\t\t\"Id\": 2,\r\n\t\t\"Code\": \"OR\",\r\n\t\t\"Name\": \"Or\"\r\n\t},\r\n\t\"Engine\":\r\n\t{\r\n\t\t\"Id\": 4,\r\n\t\t\"Code\": \"REQUIRED\",\r\n\t\t\"Name\": \"Required\"\r\n\t},\r\n\t\"Conditions\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Id\": 1,\r\n\t\t\t\"Field\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": validFieldId\r\n\t\t\t}\r\n\t\t}\r\n\t],\r\n\t\"Triggers\":\r\n\t[\r\n\t\t{\r\n\t\t\t\"Operator\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 50,\r\n\t\t\t\t\"Code\": \"READONLY\",\r\n\t\t\t\t\"Name\": \"Make Field Readonly\"\r\n\t\t\t},\r\n\t\t\t\"Type\":\r\n\t\t\t{\r\n\t\t\t\t\"Id\": 1,\r\n\t\t\t\t\"Code\": \"USERINTERFACE\",\r\n\t\t\t\t\"Name\": \"User Interface\"\r\n\t\t\t},\r\n\t\t\t\"Field\": {\r\n\t\t\t\t\"Id\": readonlyFieldId\r\n\t\t\t},\r\n\t\t\t\"Matched\": \"ENABLE\",\r\n\t\t\t\"NotMatched\": \"DISABLE\"\r\n\t\t}\r\n\t]\r\n});\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Rules) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst ruleWithUnknownTrigger = ruleJson(68, 69);\r\n\tresp.data.Data.Rules.push(ruleWithUnknownTrigger);\r\n};\r\n\r\nexport const addReadonlyTrigger = [key, applicable, modify];","const key = \"fake-number-response\";\r\n\r\nconst applicable = (resp) => resp.config.url.endsWith(\"/numbers\");\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.status !== 404) {\r\n\t\tthrow resp;\r\n\t}\r\n\r\n\tresp.status = 200;\r\n\tresp.data.Success = true;\r\n\tdelete resp.data.Errors;\r\n\tdelete resp.data.Informations;\r\n\tresp.data.Data = {\r\n\t\tNumber: 4,\r\n\t\tetag: \"abc123\"\r\n\t};\r\n\r\n\treturn resp;\r\n};\r\n\r\nexport const fakeNumberResponse = [key, applicable, modify];","const key = \"add-random-entity-permission\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Permissions) {\r\n\t\tresp.data.Data = {\r\n\t\t\t...resp.data.Data,\r\n\t\t\tPermissions: {\r\n\t\t\t\tSYSADMIN: {}\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\tresp.data.Data.Permissions = {\r\n\t\t...resp.data.Data.Permissions,\r\n\t\tSYSADMIN: {\r\n\t\t\t...resp.data.Data.Permissions.SYSADMIN ?? {},\r\n\t\t\tAdministration: {\r\n\t\t\t\t...resp.data.Data.Permissions.SYSADMIN.Administration ?? {},\r\n\t\t\t\tEntity: {\r\n\t\t\t\t\t...resp.data.Data.Permissions.SYSADMIN.Administration.Entity ?? {},\r\n\t\t\t\t\tType: {\r\n\t\t\t\t\t\tPAUL: {\r\n\t\t\t\t\t\t\tKnownAs: \"Paul\",\r\n\t\t\t\t\t\t\tIsDisabled: false,\r\n\t\t\t\t\t\t\tIdentifiers: { IsDisabled: false },\r\n\t\t\t\t\t\t\tRelationships: { IsDisabled: false }\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t...resp.data.Data.Permissions.SYSADMIN.Administration.Entity.Type ?? {}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n};\r\n\r\nexport const addRandomEntityPermission = [key, applicable, modify];","const key = \"proxy-datetime\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.method === \"GET\" && resp.config.url.match(/api\\/forms\\/[0-9]*\\/proxies\\/[0-9]*$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tresp.data.Data = {\r\n\t\t...resp.data.Data,\r\n\t\tSchema: {\r\n\t\t\t...resp.data.Data.Schema,\r\n\t\t\tproperties: {\r\n\t\t\t\t...resp.data.Data.Schema.properties,\r\n\t\t\t\tdateValue: {\r\n\t\t\t\t\tformat: \"date\",\r\n\t\t\t\t\ttitle: \"Date Test\",\r\n\t\t\t\t\ttype: \"date\",\r\n\t\t\t\t\tvalueTime: \"end\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\treturn resp;\r\n};\r\n\r\nexport const addProxyDatetime = [key, applicable, modify];","const key = \"add-translations\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.method === \"GET\" && resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tresp.data.Data = {\r\n\t\t...resp.data.Data,\r\n\t\tTranslations: {\r\n\t\t\t...resp.data.Data.Translations,\r\n\t\t\t\"en-us\": {\r\n\t\t\t\t\"report\": \"ticket\"\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tresp.data.Data.Agency.Types[0].Translations = {\r\n\t\t\"en-us\": {\r\n\t\t\t\"name\": \"paul\"\r\n\t\t}\r\n\t};\r\n\r\n\treturn resp;\r\n};\r\n\r\nexport const addTranslations = [key, applicable, modify];","const key = \"add-entity-translations\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.method === \"GET\" && resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tresp.data.Data = {\r\n\t\t...resp.data.Data,\r\n\t\tTranslations: {\r\n\t\t\t...resp.data.Data.Translations,\r\n\t\t\t\"en-us\": {\r\n\t\t\t\t\"report\": \"ticket\"\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t(resp.data.Data.Agency.Types.find(t => t.Code === \"DEALER_LICENSE\") ?? {}).Translations = {\r\n\t\t\"en-us\": {\r\n\t\t\t\"Name\": \"entity\",\r\n\t\t\t\"Name_one\": \"entity(s)\",\r\n\t\t\t\"Name_other\": \"entities\",\r\n\t\t\t\"Labels\": {\r\n\t\t\t\t\"Code\": \"paul\",\r\n\t\t\t\t\"Code_one\": \"paul(s)\",\r\n\t\t\t\t\"Code_other\": \"pauls\",\r\n\t\t\t\t\"Name\": \"tony\",\r\n\t\t\t\t\"Name_one\": \"tony(s)\",\r\n\t\t\t\t\"Name_other\": \"tonyes\",\r\n\t\t\t\t\"ExternalKey\": \"key\",\r\n\t\t\t\t\"ExternalKey_one\": \"key(s)\",\r\n\t\t\t\t\"ExternalKey_other\": \"keys\",\r\n\t\t\t\t\"Classification\": \"Primary classification\",\r\n\t\t\t\t\"Classification_one\": \"attribute\",\r\n\t\t\t\t\"Classification_other\": \"attributes\"\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t(resp.data.Data.Agency.Types.find(t => t.Code === \"FISHERMAN\") ?? {}).Translations = {\r\n\t\t\"en-us\": {\r\n\t\t\t\"Name\": \"fisherman-sub\",\r\n\t\t\t\"Name_one\": \"fisherman-sub(s)\",\r\n\t\t\t\"Name_other\": \"fisherman-subs\"\r\n\t\t}\r\n\t};\r\n\r\n\t(resp.data.Data.Agency.Types.find(t => t.Code === \"VESSEL\") ?? {}).Translations = {\r\n\t\t\"en-us\": {\r\n\t\t\t\"Name\": \"vessel-sub\",\r\n\t\t\t\"Name_one\": \"vessel-sub(s)\",\r\n\t\t\t\"Name_other\": \"vessel-subs\"\r\n\t\t}\r\n\t};\r\n\r\n\treturn resp;\r\n};\r\n\r\nexport const addEntityTranslations = [key, applicable, modify];","const key = \"proxy-file-uploader\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.method === \"GET\" && resp.config.url.match(/api\\/forms\\/[0-9]*\\/proxies\\/[0-9]*$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tresp.data.Data = {\r\n\t\t...resp.data.Data,\r\n\t\tSchema: {\r\n\t\t\t...resp.data.Data.Schema,\r\n\t\t\tproperties: {\r\n\t\t\t\t...resp.data.Data.Schema.properties,\r\n\t\t\t\tblob: {\r\n\t\t\t\t\tformat: \"base64\",\r\n\t\t\t\t\ttitle: \"File Upload\",\r\n\t\t\t\t\ttype: \"string\",\r\n\t\t\t\t\tmaxSize: \"10000000\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tForm: [\r\n\t\t\t{\r\n\t\t\t\tkey: \"blob\",\r\n\t\t\t\tplaceholder: \"Click here or drop files to upload\"\r\n\t\t\t}\r\n\t\t]\r\n\t};\r\n\r\n\treturn resp;\r\n};\r\n\r\nexport const addProxyFileUploader = [key, applicable, modify];","import { remove } from \"lodash\";\r\n\r\nconst key = \"deny-all-feedback\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\tremove(role.Actions, a => a.Path.indexOf(\"feedback\") > -1);\r\n\r\n\tconst newDeny = { Effect: \"Deny\", Path: \"/feedback/**/*\" };\r\n\trole.Actions.push(newDeny);\r\n\r\n};\r\n\r\nexport const denyAllFeedback = [key, applicable, modify];","const key = \"deny-show-markdown\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst newDeny = { Effect: \"Deny\", Path: \"/feedback/agency/markdown/read\" };\r\n\trole.Actions.push(newDeny);\r\n};\r\n\r\nexport const denyShowMarkdown = [key, applicable, modify];","const key = \"deny-vesl-feedback\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst newDeny = { Effect: \"Deny\", Path: \"/feedback/vesl/**/*\" };\r\n\trole.Actions.push(newDeny);\r\n};\r\n\r\nexport const denyVeslFeedback = [key, applicable, modify];","const key = \"deny-agency-feedback\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst newDeny = { Effect: \"Deny\", Path: \"/feedback/agency/**/*\" };\r\n\trole.Actions.push(newDeny);\r\n};\r\n\r\nexport const denyAgencyFeedback = [key, applicable, modify];","const key = \"deny-show-agency-phonenumber\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst newDeny = { Effect: \"Deny\", Path: \"/feedback/agency/phoneNumber/read\" };\r\n\trole.Actions.push(newDeny);\r\n};\r\n\r\nexport const denyShowAgencyPhonenumber = [key, applicable, modify];","const key = \"deny-show-agency-email\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst newDeny = { Effect: \"Deny\", Path: \"/feedback/agency/email/read\" };\r\n\trole.Actions.push(newDeny);\r\n};\r\n\r\nexport const denyShowAgencyEmail = [key, applicable, modify];","const key = \"deny-show-vesl-phonenumber\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst newDeny = { Effect: \"Deny\", Path: \"/feedback/vesl/phoneNumber/read\" };\r\n\trole.Actions.push(newDeny);\r\n};\r\n\r\nexport const denyShowVeslPhonenumber = [key, applicable, modify];","const key = \"deny-show-vesl-email\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst newDeny = { Effect: \"Deny\", Path: \"/feedback/vesl/email/read\" };\r\n\trole.Actions.push(newDeny);\r\n};\r\n\r\nexport const denyShowVeslEmail = [key, applicable, modify];","import { remove } from \"lodash\";\r\n\r\nconst key = \"deny-all-compliance\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\tremove(role.Actions, a => a.Path.indexOf(\"compliance\") > -1);\r\n\r\n\tconst newDeny = { Effect: \"Deny\", Path: \"/reporting/compliance/**/*\" };\r\n\trole.Actions.push(newDeny);\r\n\r\n};\r\n\r\nexport const denyAllCompliance = [key, applicable, modify];","import { remove } from \"lodash\";\r\n\r\nconst key = \"change-exports\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\tremove(role.Actions, a => a.Path.indexOf(\"exports\") > -1);\r\n\r\n\t// const newDeny = { Effect: \"Deny\", Path: \"/exports/nightly/logs/*\" };\r\n\t// const newAllow = { Effect: \"Allow\", Path: \"/exports/state/logs/*\" };\r\n\r\n\tconst newAllow = { Effect: \"Allow\", Path: \"/exports/**/*\" };\r\n\r\n\trole.Actions.push(newAllow);\r\n\r\n};\r\n\r\nexport const changeExports = [key, applicable, modify];","const key = \"deny-inventory-operation\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst newDeny = { Effect: \"Deny\", Path: \"/types/LICENSE/inventory/SPECIES/operations/set\" };\r\n\trole.Actions.push(newDeny);\r\n};\r\n\r\nexport const denyInventoryOperation = [key, applicable, modify];","const key = \"allow-token-management\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst allowReadTokens = { Effect: \"Allow\", Path: \"/types/DEALER/tokens/*/read\" };\r\n\tconst allowDeactivate = { Effect: \"Allow\", Path: \"/tokens/*/deactivate\" };\r\n\trole.Actions.push(allowReadTokens, allowDeactivate);\r\n\r\n};\r\n\r\nexport const allowTokenManagement = [key, applicable, modify];","const key = \"security-exception\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = () => {\r\n\tthrow new Error(\"Mock error on security endpoint\");\r\n};\r\n\r\nexport const securityException = [key, applicable, modify];","import { globs } from \"../../../../services/globs\";\r\n\r\nconst key = \"allow-alias-management\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst allowAliases = { Effect: \"Allow\", Path: globs.entityTypes.byType(\"DEALER\").aliases.byCode(\"*\").read };\r\n\trole.Actions.push(allowAliases);\r\n\r\n};\r\n\r\nexport const allowAliasManagement = [key, applicable, modify];","const key = \"allow-business-management\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst allowReadBusiness = { Effect: \"Allow\", Path: \"/types/DEALER/business/*/read\" };\r\n\trole.Actions.push(allowReadBusiness);\r\n\r\n};\r\n\r\nexport const allowBusinessManagement = [key, applicable, modify];","import { globs } from \"../../../../services/globs\";\r\n\r\nconst key = \"allow-product-management\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst allowProducts = { Effect: \"Allow\", Path: globs.entityTypes.byType(\"DEALER\").products.byCode(\"*\").read };\r\n\trole.Actions.push(allowProducts);\r\n\r\n};\r\n\r\nexport const allowProductManagement = [key, applicable, modify];","import { globs } from \"../../../../services/globs\";\r\n\r\nconst key = \"allow-inventory-management\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst allowInventory = { Effect: \"Allow\", Path: globs.entityTypes.byType(\"DEALER\").inventory.byCode(\"*\").read };\r\n\trole.Actions.push(allowInventory);\r\n\r\n};\r\n\r\nexport const allowInventoryManagement = [key, applicable, modify];","import { globs } from \"../../../../services/globs\";\r\n\r\nconst key = \"allow-geometry-management\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tconst allowGeometry = { Effect: \"Allow\", Path: globs.entityTypes.byType(\"DEALER\").geometries.byCode(\"*\").read };\r\n\trole.Actions.push(allowGeometry);\r\n\r\n};\r\n\r\nexport const allowGeometryManagement = [key, applicable, modify];","import { remove } from \"lodash\";\r\n\r\nconst key = \"entity-security-allow-all\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tremove(role.Actions, a => a.Path === \"/types/**/*\");\r\n\r\n\tconst allowCreateDealer = { Effect: \"Allow\", Path: \"/types/DEALER/write\" };\r\n\trole.Actions.push(allowCreateDealer);\r\n\r\n\tconst allowManageIdentifiers = { Effect: \"Allow\", Path: \"/types/DEALER/identifiers/*/read\" };\r\n\trole.Actions.push(allowManageIdentifiers);\r\n\r\n\tconst allowManageIdentifiers2 = { Effect: \"Deny\", Path: \"/types/DEALER/identifiers/GARFO/read\" };\r\n\trole.Actions.push(allowManageIdentifiers2);\r\n\r\n\tconst allowAddIdentifiers = { Effect: \"Allow\", Path: \"/types/DEALER/identifiers/*/create\" };\r\n\trole.Actions.push(allowAddIdentifiers);\r\n\r\n\tconst allowAllUpdateIdentifiers = { Effect: \"Allow\", Path: \"/types/DEALER/identifiers/*/update\" };\r\n\trole.Actions.push(allowAllUpdateIdentifiers);\r\n\r\n\tconst allowDeactivateIdentifiers = { Effect: \"Allow\", Path: \"/types/DEALER/identifiers/*/deactivate\" };\r\n\trole.Actions.push(allowDeactivateIdentifiers);\r\n\r\n\tconst allowReactivateIdentifiers = { Effect: \"Allow\", Path: \"/types/DEALER/identifiers/*/reactivate\" };\r\n\trole.Actions.push(allowReactivateIdentifiers);\r\n\r\n\r\n\tconst allowEditHarvester = { Effect: \"Allow\", Path: \"/types/FISHERMAN/write\" };\r\n\trole.Actions.push(allowEditHarvester);\r\n\t\r\n\tconst allowManageClassifications = { Effect: \"Allow\", Path: \"/types/FISHERMAN/classifications/*/read\" };\r\n\trole.Actions.push(allowManageClassifications);\r\n\r\n\tconst allowAddClassifications = { Effect: \"Allow\", Path: \"/types/FISHERMAN/classifications/*/add\" };\r\n\trole.Actions.push(allowAddClassifications);\r\n\r\n\tconst allowDeactivateClassifications = { Effect: \"Allow\", Path: \"/types/FISHERMAN/classifications/*/remove\" };\r\n\trole.Actions.push(allowDeactivateClassifications);\r\n\r\n\t\r\n\tconst allowEditDealerLicense = { Effect: \"Allow\", Path: \"/types/DEALER_LICENSE/write\" };\r\n\trole.Actions.push(allowEditDealerLicense);\r\n\r\n\tconst allowReadEffective = { Effect: \"Allow\", Path: \"/types/DEALER_LICENSE/effective/*/read\" };\r\n\trole.Actions.push(allowReadEffective);\r\n\r\n\t// const allowAddEffective = { Effect: \"Deny\", Path: \"/types/DEALER_LICENSE/effective/*/create\" };\r\n\t// role.Actions.push(allowAddEffective);\r\n\r\n\tconst allowUpdateEffective = { Effect: \"Allow\", Path: \"/types/DEALER_LICENSE/effective/PAUL/update\" };\r\n\trole.Actions.push(allowUpdateEffective);\r\n\r\n\tconst allowDeactivateEffective = { Effect: \"Allow\", Path: \"/types/DEALER_LICENSE/effective/JAMES/delete\" };\r\n\trole.Actions.push(allowDeactivateEffective);\r\n\r\n\tconst denySpecificScope = { Effect: \"Allow\", Path: \"/types/DEALER_LICENSE/effective/JAMES/create\" };\r\n\trole.Actions.push(denySpecificScope);\r\n\r\n\t\r\n\tconst allowEditVessel = { Effect: \"Allow\", Path: \"/types/VESSEL/write\" };\r\n\trole.Actions.push(allowEditVessel);\r\n\t\r\n\tconst allowManageContacts = { Effect: \"Allow\", Path: \"/types/VESSEL/contacts/*/read\" };\r\n\trole.Actions.push(allowManageContacts);\r\n\r\n\tconst allowAddContacts = { Effect: \"Allow\", Path: \"/types/VESSEL/contacts/*/create\" };\r\n\trole.Actions.push(allowAddContacts);\r\n\r\n\tconst allowUpdateContacts = { Effect: \"Allow\", Path: \"/types/VESSEL/contacts/*/update\" };\r\n\trole.Actions.push(allowUpdateContacts);\r\n\r\n\tconst allowDeactivateContacts = { Effect: \"Allow\", Path: \"/types/VESSEL/contacts/PAUL/deactivate\" };\r\n\trole.Actions.push(allowDeactivateContacts);\r\n\r\n\tconst allowReactivateContacts = { Effect: \"Allow\", Path: \"/types/VESSEL/contacts/CAPTAIN/reactivate\" };\r\n\trole.Actions.push(allowReactivateContacts);\r\n\r\n\tconst allowManageRelationships = { Effect: \"Deny\", Path: \"/types/DEALER/related/*/read\" };\r\n\trole.Actions.push(allowManageRelationships);\r\n};\r\n\r\nexport const entitySecurityAllowAll = [key, applicable, modify];","import { remove } from \"lodash\";\r\n\r\nconst key = \"entity-security-deny-all\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]+\\/security$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.data.Success !== true || !resp.data.Data) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst assigned = resp.data.Data.Assigned;\r\n\tconst role = resp.data.Data.Roles.find(r => r.Code === assigned[0].Code);\r\n\r\n\tremove(role.Actions, a => a.Path === \"/types/**/*\");\r\n\t\r\n\tconst denyCreateDealer = { Effect: \"Deny\", Path: \"/types/DEALER/write\" };\r\n\trole.Actions.push(denyCreateDealer);\r\n\r\n\tconst denyManageIdentifiers = { Effect: \"Deny\", Path: \"/types/DEALER/identifiers/*/read\" };\r\n\trole.Actions.push(denyManageIdentifiers);\r\n\r\n\tconst denyAddIdentifiers = { Effect: \"Deny\", Path: \"/types/DEALER/identifiers/*/create\" };\r\n\trole.Actions.push(denyAddIdentifiers);\r\n\r\n\tconst denyUpdateIdentifiers = { Effect: \"Deny\", Path: \"/types/DEALER/identifiers/*/update\" };\r\n\trole.Actions.push(denyUpdateIdentifiers);\r\n\r\n\tconst denyDeactivateIdentifiers = { Effect: \"Deny\", Path: \"/types/DEALER/identifiers/*/deactivate\" };\r\n\trole.Actions.push(denyDeactivateIdentifiers);\r\n\r\n\tconst denyReactivateIdentifiers = { Effect: \"Deny\", Path: \"/types/DEALER/identifiers/*/reactivate\" };\r\n\trole.Actions.push(denyReactivateIdentifiers);\r\n\r\n\r\n\tconst denyManageClassifications = { Effect: \"Deny\", Path: \"/types/DEALER/classifications/*/read\" };\r\n\trole.Actions.push(denyManageClassifications);\r\n\r\n\tconst denyAddClassifications = { Effect: \"Deny\", Path: \"/types/DEALER/classifications/*/add\" };\r\n\trole.Actions.push(denyAddClassifications);\r\n\r\n\tconst denyDeactivateClassifications = { Effect: \"Deny\", Path: \"/types/DEALER/classifications/*/remove\" };\r\n\trole.Actions.push(denyDeactivateClassifications);\r\n\r\n\t\r\n\tconst denyReadEffective = { Effect: \"Deny\", Path: \"/types/DEALER/effective/*/read\" };\r\n\trole.Actions.push(denyReadEffective);\r\n\r\n\tconst denyAddEffective = { Effect: \"Deny\", Path: \"/types/DEALER/effective/*/create\" };\r\n\trole.Actions.push(denyAddEffective);\r\n\r\n\tconst denyUpdateEffective = { Effect: \"Deny\", Path: \"/types/DEALER/effective/*/update\" };\r\n\trole.Actions.push(denyUpdateEffective);\r\n\r\n\tconst denyDeactivateEffective = { Effect: \"Deny\", Path: \"/types/DEALER/effective/*/delete\" };\r\n\trole.Actions.push(denyDeactivateEffective);\r\n\r\n\t\r\n\tconst denyManageContacts = { Effect: \"Deny\", Path: \"/types/DEALER/contacts/*/read\" };\r\n\trole.Actions.push(denyManageContacts);\r\n\r\n\tconst denyAddContacts = { Effect: \"Deny\", Path: \"/types/DEALER/contacts/*/create\" };\r\n\trole.Actions.push(denyAddContacts);\r\n\r\n\tconst denyUpdateContacts = { Effect: \"Deny\", Path: \"/types/DEALER/contacts/*/update\" };\r\n\trole.Actions.push(denyUpdateContacts);\r\n\r\n\tconst denyDeactivateContacts = { Effect: \"Deny\", Path: \"/types/DEALER/contacts/*/deactivate\" };\r\n\trole.Actions.push(denyDeactivateContacts);\r\n\r\n\tconst denyReactivateContacts = { Effect: \"Deny\", Path: \"/types/DEALER/contacts/*/reactivate\" };\r\n\trole.Actions.push(denyReactivateContacts);\r\n\r\n\tconst denyManageRelationships = { Effect: \"Deny\", Path: \"/types/DEALER/related/*/read\" };\r\n\trole.Actions.push(denyManageRelationships);\r\n};\r\n\r\nexport const entitySecurityDenyAll = [key, applicable, modify];","const key = \"add-stale-timeout\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp?.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp?.data?.Data)\r\n\t\treturn;\r\n\t\r\n\tresp.data.Data.StaleTimeout = \"PT2M\"; // 2 minutes\r\n};\r\n\r\nexport const addStaleTimeout = [key, applicable, modify];","const key = \"add-invalid-timeout\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp?.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp?.data?.Data)\r\n\t\treturn;\r\n\t\r\n\tresp.data.Data.InvalidTimeout = \"PT3M\"; // 3 minutes\r\n};\r\n\r\nexport const addInvalidTimeout = [key, applicable, modify];","const key = \"force-match-entities\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data.Data?.Fields) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tconst entityFields = resp.data.Data.Fields.filter(f => f.Type.Code === \"ENTITY\");\r\n\r\n\t// entityFields.forEach(f => f.matchSpecificity = true);\r\n\r\n\tconst dealerField = entityFields.find(f => f.Key.Code === \"REPORT.ENTITIES.DEALERS.LICENSES.SINGLE\");\r\n\tdealerField.Data[0].IsFavorite = true;\r\n\t// dealerField.Data[1].IsFavorite = true;\r\n};\r\n\r\nexport const forceMatchEntities = [key, applicable, modify];","import { TypeDto } from \"../../../models/agency-types\";\r\n\r\nconst key = \"modify-agency-types\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.method === \"GET\" && resp.config.url.match(/api\\/forms\\/[0-9]*$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n\tconst types = resp.data.Data.Agency.Types as TypeDto[];\r\n\r\n\t// if(types.some(t => t.Code === \"LICENSE\")) {\r\n\t// \tconst license = types.find(t => t.Code === \"LICENSE\");\r\n\r\n\t// \tlicense.IsExternalKeySystemManaged = true;\r\n\t// }\r\n\r\n\tif(types.some(t => t.Code === \"DEALER\")) {\r\n\t\tconst dealer = types.find(t => t.Code === \"DEALER\");\r\n\r\n\t\tdealer.Businesses = { IsSupported: true }; \r\n\t}\r\n\r\n\t// const identifiers = resp.data.Data.Agency.IdentifierTypes;\r\n\t// const garfoIdentifier = identifiers?.find(i => i.Code === \"GARFO\");\r\n\t// if(garfoIdentifier !== undefined) {\r\n\t// \tgarfoIdentifier.ValuePattern = \"^ID[A-Za-z0-9]{6}:\\\\d{3}$\";\r\n\t// }\r\n\r\n\t// eslint-disable-next-line no-console\r\n\tconsole.log(\"modified agency types\", resp.data.Data);\r\n\treturn resp;\r\n};\r\n\r\nexport const modifyAgencyTypes = [key, applicable, modify];","const key = \"modify-forms-agency-types\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.method === \"GET\" && resp.config.url.match(/api\\/forms$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\t// eslint-disable-next-line max-len\r\n\tconst logo = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQoAAAFmCAMAAACiIyTaAAABv1BMVEUAAAB5S0dJSkpISkpLTU3pSzzoTD3oSzzoTD3kSjvoTD1GRUbeSDpFREVCQULpSzzoTD3c3d3gSTrg4uDm5uZFRETbRznoTD3oTD1JR0iXlYXaRzncRzhBQUDnSjtNS0zUzsdnZmVLSEpMSEoyNjPm5eSZmYfm6ekzNTOloI42ODbm6Oiioo/h4eEzODbm5+eop5SiopCiopDl396hloaDg3ToTD3m5uZMS03///9RTlAAAADy8vIgICA2NzY4OzYPM0fa29qgoI7/zMnj4+PW19VGRkbqPi7v7/D6+vr09fXyTj4rKSvhSTo/Pj/oSDnlMyLsNCI0MTP0///tTT7ZRjizOi+6PDDmLRyenZ7oKRfExMT/TzvobGEVFBWGhYUAGjLW8/ToXVADLUZ8e33/2tfRRTdWVFTFQDT1u7aSkZIADib+5eFwcHHW+/z70tDwkIesPTPW6+teXV2xsbG7u7vY4+Lre3DMzM2qp6jilIxsPT7lg3kdO07m/f4AJjuwsJzftK/fpZ7woJjoVUZBWGj1zMdTaXfcvrrzq6Tby8f+8u8wSlYZNDaQRUKfr7d9j5lpf4vx5ePMsLF/o64s+PNlAAAANnRSTlMAC1IoljoZWm2yloPRGWiJfdjEEk037Esq7Pn24EKjpiX+z7rJNNWB5pGxZ1m2mZY/gXOlr43C+dBMAAAmkklEQVR42uzay86bMBAF4MnCV1kCeQFIRn6M8xZe+v1fpVECdtPSy5822Bi+JcujmfEApl3IIRhBFyIJ3Em6UMTDSKfHsOB0dhILQ2fX4+4aF0tVXC3yJJB4OrcJV1msIhJN52avslhpZOfcvyepfceIaARw5t2CWTwYRhSQTdSum1TGqE5Mr0kg6Ukj66hZ3GExaEaJQsYIWXzmd6P2KHxn6Nj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a6fo508azf/FMFPwB+4ZiyTYnf/gAAAABJRU5ErkJggg==\";\r\n\t\r\n\tresp.data.Data.forEach(f => {\r\n\t\tf.Agency.Logo = logo;\r\n\t});\r\n\t\r\n\t// eslint-disable-next-line no-console\r\n\tconsole.log(\"modified forms\", resp.data.Data);\r\n\treturn resp;\r\n};\r\n\r\nexport const modifyFormsAgencyTypes = [key, applicable, modify];","const key = \"fake-businesses\";\r\n\r\nconst applicable = (resp) => {\r\n\t// api/forms/${formId}/entities/${entityId}/businesses\r\n\treturn (resp.config.method === \"GET\" || resp.config.method === \"POST\") && resp.config.url.match(/api\\/forms\\/[0-9]*\\/entities\\/[0-9]*\\/businesses$/);\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.status !== 404 && resp.status !== 403 && resp.status !== 405) {\r\n\t\tthrow resp;\r\n\t}\r\n\r\n\tresp.status = 200;\r\n\tresp.data.Success = true;\r\n\tdelete resp.data.Errors;\r\n\tdelete resp.data.Informations;\r\n\t\r\n\tif(resp.config.method === \"GET\") {\r\n\r\n\t\tresp.data.Data = [\r\n\t\t\t{\r\n\t\t\t\tIsValid: true,\r\n\t\t\t\tProfile: {\r\n\t\t\t\t\tId: 1101,\r\n\t\t\t\t\tCode: \"c0508cc0-b53f-4366-afe1-dc22aaee90b1\",\r\n\t\t\t\t\tName: \"TEST GSAD Dealer\",\r\n\t\t\t\t\tPhoneNumbers: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tValue: \"+1 2253417622\",\r\n\t\t\t\t\t\t\tType: {\r\n\t\t\t\t\t\t\t\tCode: \"PRIMARY\"\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\t\t\t\t\tAddresses: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tAddressLine1: \"18476 Lake Camellia Ave\",\r\n\t\t\t\t\t\t\tLocale: \"Baton Rouge\",\r\n\t\t\t\t\t\t\tTerritory: \"LA\",\r\n\t\t\t\t\t\t\tPostalCode: \"70817\",\r\n\t\t\t\t\t\t\tCountry: \"USA\",\r\n\t\t\t\t\t\t\tType: {\r\n\t\t\t\t\t\t\t\tCode: \"PHYSICAL\"\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tIsValid: false,\r\n\t\t\t\tProfile: {\r\n\t\t\t\t\tId: 1103,\r\n\t\t\t\t\tCode: \"3096e22c-2d97-423d-b356-d03786c63d42\",\r\n\t\t\t\t\tName: \"BBB-TEST GSAD Dealer\",\r\n\t\t\t\t\tPhoneNumbers: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tValue: \"+1 2253123452\",\r\n\t\t\t\t\t\t\tType: {\r\n\t\t\t\t\t\t\t\tCode: \"PRIMARY\"\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\t\t\t\t\tAddresses: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tAddressLine1: \"18476 Lake Camellia Ave\",\r\n\t\t\t\t\t\t\tLocale: \"Baton Rouge\",\r\n\t\t\t\t\t\t\tTerritory: \"LA\",\r\n\t\t\t\t\t\t\tPostalCode: \"70817\",\r\n\t\t\t\t\t\t\tCountry: \"USA\",\r\n\t\t\t\t\t\t\tType: {\r\n\t\t\t\t\t\t\t\tCode: \"PHYSICAL\"\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t];\r\n\t}\r\n\r\n\tif(resp.config.method === \"POST\") {\r\n\t\tresp.data.Data = {\r\n\t\t\t...resp.config?.data,\r\n\t\t\tId: 1103,\r\n\t\t\tCode: \"cad4958d-6d80-4b56-bc67-84e8c6a3154e\"\r\n\t\t};\r\n\t}\r\n\r\n\treturn resp;\r\n};\r\n\r\nexport const fakeBusinesses = [key, applicable, modify];","const key = \"fake-business-charges\";\r\n\r\nconst applicable = (resp) => {\r\n\t// api/businesses/${businessCode}/fees\r\n\treturn (resp.config.method === \"GET\" || resp.config.method === \"POST\" || resp.config.method === \"PUT\") \r\n\t\t&& (resp.config.url.match(/api\\/businesses\\/[0-9]*\\/fees$/) || resp.config.url.match(/api\\/businesses\\/[0-9]*\\/fees\\/[0-9]*$/));\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.status !== 404 && resp.status !== 403 && resp.status !== 405) {\r\n\t\tthrow resp;\r\n\t}\r\n\r\n\tresp.status = 200;\r\n\tresp.data.Success = true;\r\n\tdelete resp.data.Errors;\r\n\tdelete resp.data.Informations;\r\n\tif(resp.config.method === \"GET\") {\r\n\t\tresp.data.Data = [\r\n\t\t\t{\r\n\t\t\t\tCode: \"6230d4e6-bb01-4fcf-8327-f6d13b6037f4\",\r\n\t\t\t\tName: \"Sales Tax\",\r\n\t\t\t\tType: { Code: \"PERCENT\" },\r\n\t\t\t\tAmount: 5.5,\r\n\t\t\t\tIsActive: true\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tCode: \"e38f6658-5bdd-41dc-b48d-457ee013ee76\",\r\n\t\t\t\tName: \"Slime fee\",\r\n\t\t\t\tType: { Code: \"FLAT\" },\r\n\t\t\t\tAmount: 10.25,\r\n\t\t\t\tIsActive: true\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tCode: \"63fa26fa-9683-4d25-8d2f-9244f75a2ea8\",\r\n\t\t\t\tName: \"Sales Tax (old)\",\r\n\t\t\t\tType: { Code: \"PERCENT\" },\r\n\t\t\t\tAmount: 20.5,\r\n\t\t\t\tIsActive: false\r\n\t\t\t}\r\n\t\t];\r\n\t}\r\n\r\n\tif(resp.config.method === \"POST\") {\r\n\t\tresp.data.Data = {\r\n\t\t\t...resp.config?.data,\r\n\t\t\tCode: \"3cfe1b0a-de89-43a2-8794-bd8acd49c3ac\"\r\n\t\t};\r\n\t}\r\n\r\n\tif(resp.config.method === \"PUT\") {\r\n\t\tresp.data.Data = {\r\n\t\t\t...resp.config?.data\r\n\t\t};\r\n\t}\r\n\r\n\treturn resp;\r\n};\r\n\r\nexport const fakeBusinessCharges = [key, applicable, modify];","const key = \"fake-business-products\";\r\n\r\nconst applicable = (resp) => {\r\n\t// api/businesses/${businessCode}/products\r\n\treturn (resp.config.method === \"GET\" || resp.config.method === \"POST\" || resp.config.method === \"PUT\") \r\n\t\t&& (resp.config.url.match(/api\\/businesses\\/[0-9]*\\/products$/));\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(resp.status !== 404 && resp.status !== 403 && resp.status !== 405) {\r\n\t\tthrow resp;\r\n\t}\r\n\r\n\tresp.status = 200;\r\n\tresp.data.Success = true;\r\n\tdelete resp.data.Errors;\r\n\tdelete resp.data.Informations;\r\n\tif(resp.config.method === \"GET\") {\r\n\t\tresp.data.Data = [\r\n\t\t\t{\r\n\t\t\t\tCode: \"a0ac9ec3-3add-46c1-bfb6-9116222aa5e3\",\r\n\t\t\t\tName: \"Bag of ice\",\r\n\t\t\t\tUnit: \"Bag\",\r\n\t\t\t\tPrice: 5.5,\r\n\t\t\t\tIsInvoiceDefault: false,\r\n\t\t\t\tIsActive: true,\r\n\t\t\t\tFees: [\r\n\t\t\t\t\t{ Code: \"6230d4e6-bb01-4fcf-8327-f6d13b6037f4\" },\r\n\t\t\t\t\t{ Code: \"e38f6658-5bdd-41dc-b48d-457ee013ee76\" }\r\n\t\t\t\t]\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tCode: \"a837a86f-f182-440f-8eb6-ce051fb5c014\",\r\n\t\t\t\tName: \"Gasoline\",\r\n\t\t\t\tUnit: \"Gallon\",\r\n\t\t\t\tPrice: 10,\r\n\t\t\t\tIsInvoiceDefault: true,\r\n\t\t\t\tIsActive: true\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tCode: \"a0f444aa-1900-4e19-9c8c-b19ada9b4884\",\r\n\t\t\t\tName: \"Gloves\",\r\n\t\t\t\tUnit: \"Pair\",\r\n\t\t\t\tPrice: 4,\r\n\t\t\t\tIsInvoiceDefault: false,\r\n\t\t\t\tIsActive: false\r\n\t\t\t}\r\n\t\t];\r\n\t}\r\n\r\n\tif(resp.config.method === \"POST\") {\r\n\t\tresp.data.Data = {\r\n\t\t\t...resp.config?.data,\r\n\t\t\tCode: \"35f622ac-7474-4207-b6f8-0d8019046af6\"\r\n\t\t};\r\n\t}\r\n\r\n\tif(resp.config.method === \"PUT\") {\r\n\t\tresp.data.Data = {\r\n\t\t\t...resp.config?.data\r\n\t\t};\r\n\t}\r\n\r\n\treturn resp;\r\n};\r\n\r\nexport const fakeBusinessProducts = [key, applicable, modify];","const key = \"add-depredation-fields\";\r\n\r\nconst applicable = (resp) => {\r\n\treturn resp.config.method === \"GET\" && resp.config.url.match(/api\\/forms\\/17*$/);\r\n};\r\n\r\nconst depredationSection = {\r\n\tId: -1,\r\n\tCode: \"64af3118-78df-49da-9638-733e991a4aaf\",\r\n\tName: \"Depredation\",\r\n\tOrder: 4.5\r\n};\r\n\r\nconst primaryBottomType = {\r\n\tData: [],\r\n\tId: -1, \r\n\tName: \"Primary Bottom Type\",\r\n\tOrder: 25,\r\n\tSection: { Code: \"a843d66f-b278-46be-9c9d-8b0fd4a30946\", Id: 144 },\r\n\tTemplate: \"Selection\",\r\n\tDescription: \"description\",\r\n\tType: { Code: \"PRIMARY_BOTTOM\" }\r\n};\r\n\r\nconst primaryBoatMovement = {\r\n\tData: [],\r\n\tId: -2, \r\n\tName: \"Primary Boat Movement\",\r\n\tOrder: 26,\r\n\tSection: { Code: \"a843d66f-b278-46be-9c9d-8b0fd4a30946\", Id: 144 },\r\n\tTemplate: \"Selection\",\r\n\tDescription: \"description\",\r\n\tType: { Code: \"PRIMARY_MOVEMENT\" }\r\n};\r\n\r\nconst numberOfSites = {\r\n\tData: [{ Code: \"#\", Id: 1858, Name: \"Whole Number\" }],\r\n\tId: -3, \r\n\tName: \"# of Fishing Sites\",\r\n\tIsSmall: true,\r\n\tOrder: 19,\r\n\tSection: { Code: \"c5d2cfaa-e4a5-4417-a0d6-580da249dc4f\", Id: 145 },\r\n\tTemplate: \"Number\",\r\n\tDescription: \"description\",\r\n\tType: { Code: \"NUMBER\" }\r\n};\r\n\r\nconst isDepredated = {\r\n\tId: -4, \r\n\tName: \"Was Any Catch Depredated?\",\r\n\tOrder: 1,\r\n\tSection: { Code: \"64af3118-78df-49da-9638-733e991a4aaf\", Id: -1 },\r\n\tTemplate: \"Boolean\",\r\n\tDescription: \"description\",\r\n\tType: { Code: \"BOOLEAN\" }\r\n};\r\n\r\nconst predatorType = {\r\n\tData: [],\r\n\tId: -5, \r\n\tName: \"Predator Type\",\r\n\tOrder: 2,\r\n\tSection: { Code: \"64af3118-78df-49da-9638-733e991a4aaf\", Id: -1 },\r\n\tTemplate: \"Selection\",\r\n\tDescription: \"description\",\r\n\tType: { Code: \"PREDATOR_TYPE\" }\r\n};\r\n\r\nconst whichSites = {\r\n\tData: [],\r\n\tId: -6, \r\n\tName: \"Which Sites?\",\r\n\tOrder: 3,\r\n\tSection: { Code: \"64af3118-78df-49da-9638-733e991a4aaf\", Id: -1 },\r\n\tTemplate: \"Selection\",\r\n\tDescription: \"description\",\r\n\tType: { Code: \"PREDATOR_SITES\" }\r\n};\r\n\r\nconst depredatedQty = {\r\n\tData: [],\r\n\tId: -6, \r\n\tIsDetail: true,\r\n\tIsDetailColumnHeader: true,\r\n\tName: \"# Depredated\",\r\n\tOrder: 50,\r\n\tSection: { Code: \"235e7487-8629-43de-9c37-15c7ba173a62\", Id: 467 },\r\n\tKey: { Code: \"paul's code\" },\r\n\tTemplate: \"Number\",\r\n\tDescription: \"description\",\r\n\tType: { Code: \"NUMBER\" }\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tconst fields = resp.data.Data.Fields;\r\n\tconst sections = resp.data.Data.Sections;\r\n\t\r\n\tsections.push(depredationSection);\r\n\tfields.push(primaryBottomType, primaryBoatMovement, numberOfSites, isDepredated, predatorType, whichSites, depredatedQty);\r\n\r\n\t// console.log(\"added fields\", resp.data.Data);\r\n\treturn resp;\r\n};\r\n\r\nexport const addDepredationFields = [key, applicable, modify];","import * as mocks from \"./mocks\";\r\n\r\nconst mockingKey = \"mocked\";\r\n\r\nwindow.availableMocks = () => {\r\n\treturn Object.values(mocks).map(m => m[0]);\r\n};\r\n\r\nwindow.currentMocks = () => {\r\n\tlet storedMocks = window.localStorage.getItem(mockingKey);\r\n\tstoredMocks = JSON.parse(storedMocks) ?? {};\r\n\r\n\treturn storedMocks;\r\n};\r\n\r\nwindow.unmockAll = () => {\r\n\tconst current = Object.keys(window.currentMocks());\r\n\r\n\tcurrent.forEach(m => window.unmockRequest(m));\r\n};\r\n\r\nwindow.mockRequest = (key) => {\r\n\tconst currentMocks = window.currentMocks();\r\n\tcurrentMocks[key] = true;\r\n\r\n\twindow.localStorage.setItem(mockingKey, JSON.stringify(currentMocks));\r\n};\r\n\r\nwindow.unmockRequest = (key) => {\r\n\tlet storedMocks = window.localStorage.getItem(mockingKey);\r\n\tstoredMocks = JSON.parse(storedMocks) ?? {};\r\n\tdelete storedMocks[key];\r\n\r\n\tif(Object.keys(storedMocks).length === 0)\r\n\t\twindow.localStorage.removeItem(mockingKey);\r\n\telse\r\n\t\twindow.localStorage.setItem(mockingKey, JSON.stringify(storedMocks));\r\n};\r\n\r\n//this will follow the form of ['key-for-mock', (uri) => bool, {} | (resp) => resp]\r\nexport function mockDataInterceptor() {\r\n\treturn {\r\n\t\tresponse(resp) {\r\n\t\t\tconst activeMocks = Object.keys(window.currentMocks());\r\n\r\n\t\t\tif(activeMocks.length === 0)\r\n\t\t\t\treturn resp;\r\n\r\n\t\t\tconst applicable = Object.values(mocks)\r\n\t\t\t\t.filter(mock => activeMocks.includes(mock[0]))\r\n\t\t\t\t.filter(mock => mock[1](resp));\r\n\t\t\t\r\n\t\t\tif(applicable?.length) {\r\n\t\t\t\tfor(const mock of applicable) {\r\n\t\t\t\t\tmock[2](resp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn resp;\r\n\t\t}, \r\n\t\tresponseError: (err) => {\r\n\t\t\tconst activeMocks = Object.keys(window.currentMocks());\r\n\r\n\t\t\tif(activeMocks.length === 0)\r\n\t\t\t\tthrow err;\r\n\t\t\t\r\n\t\t\tconst resp = Object.values(mocks)\r\n\t\t\t\t.filter(mock => mock?.[1](err) && activeMocks.includes(mock[0]))\r\n\t\t\t\t.reduce((accumulatedResp, currentMock) => {\r\n\t\t\t\t\treturn currentMock[2](accumulatedResp); \r\n\t\t\t\t}, err);\r\n\r\n\t\t\treturn resp;\r\n\t\t}\r\n\t};\r\n}\r\n","import { REPORT_STATES } from \"../../../constants\";\r\n\r\nconst applicable = (resp) => resp?.config.url.match(/api\\/forms\\/[0-9]+\\/reports\\?/g);\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data?.Data) {\r\n\t\treturn resp;\r\n\t}\r\n\tfor(const data of resp.data.Data) {\r\n\t\tif(!data.Date && data.History[data.History.length - 1].State.Code === REPORT_STATES.pending.code) {\r\n\t\t\tdata.History[data.History.length - 1].State = { \r\n\t\t\t\tCode: REPORT_STATES.declared.code, Name: REPORT_STATES.declared.display\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\treturn resp;\r\n};\r\n\r\nexport const declaredStatus = [applicable, modify];","import { keyBy } from \"lodash\";\r\nconst applicable = (resp) => resp?.config.url.match(/api\\/forms\\/[0-9]*$/g);\r\n\r\nconst effectiveRangify = (seasonLookup, entity) => {\r\n\tif(entity.Effective)\r\n\t\treturn true;\r\n\t\t\r\n\tif(entity?.Form?.Seasons) {\r\n\t\tentity.Effective = entity.Form.Seasons.map(season => {\r\n\t\t\tconst match = seasonLookup[season.Code];\r\n\t\t\treturn ({\r\n\t\t\t\tScope: match.Scope,\r\n\t\t\t\tStart: match.BeginInclusive,\r\n\t\t\t\tEnd: match.EndExclusive\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t// mock the server not sending this at all\r\n\t\tentity.Form.Seasons = undefined;\r\n\t}\r\n\r\n\tif(entity.Entities) {\r\n\t\tfor(const related of entity.Entities) {\r\n\t\t\tif(effectiveRangify(seasonLookup, related.Entity))\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false; \r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data?.Data) {\r\n\t\treturn resp;\r\n\t}\r\n\tconst seasons = keyBy(resp.data.Data.Seasons ?? [], season => season.Code);\r\n\tfor(const field of resp.data.Data.Fields || []) {\r\n\t\tif(field.Type?.IsEntity !== true) \r\n\t\t\tcontinue;\r\n \r\n\t\tif(field.Data?.length < 1) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tfor(const entity of field.Data) {\r\n\t\t\tif(effectiveRangify(seasons, entity))\r\n\t\t\t\treturn resp;\r\n\t\t}\r\n\t}\r\n\r\n\treturn resp;\r\n};\r\n\r\nexport const effectiveRange = [applicable, modify];","const applicable = (resp) => resp?.config.url.match(/api\\/forms\\/[0-9]+$/g);\r\n\r\nconst cleanRuleCodesAndIds = (rule, isTopLevelRule?: boolean): void => {\r\n\tif(Array.isArray(rule.Children)) {\r\n\t\trule.Children.forEach(r => cleanRuleCodesAndIds(r));\r\n\t}\r\n\t\r\n\tif(isTopLevelRule === true) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(rule.Id !== undefined) {\r\n\t\tdelete rule.Id;\r\n\t}\r\n\r\n\tif(rule.Code !== undefined) {\r\n\t\tdelete rule.Code;\r\n\t}\r\n};\r\n\r\nconst modify = (resp) => {\r\n\tif(!resp.data?.Data) {\r\n\t\treturn resp;\r\n\t}\r\n\r\n\tconst rules = resp.data.Data.Rules ?? [];\r\n\r\n\trules.forEach(r => cleanRuleCodesAndIds(r, true));\r\n\r\n\treturn resp;\r\n};\r\n\r\nexport const removeChildRuleCodesAndIds = [applicable, modify];","import * as shims from \"./shims/index\";\r\n\r\nexport function shimmer($logger) {\r\n\tconst context = {};\r\n\r\n\treturn {\r\n\t\trequest: (config) => {\r\n\t\t\tcontext[config.url] = config?.context;\r\n\r\n\t\t\treturn config;\r\n\t\t},\r\n\t\tresponse: (resp) => {\r\n\t\t\tresp = Object.values(shims)\r\n\t\t\t\t.filter(shim => shim?.[0](resp))\r\n\t\t\t\t.reduce((accumulatedResp, currentShim) => currentShim[1](accumulatedResp, context[resp.config.url]), resp);\r\n\r\n\t\t\treturn resp;\r\n\t\t}, \r\n\t\tresponseError: (err) => {\r\n\t\t\tconst resp = Object.values(shims)\r\n\t\t\t\t.filter(shim => shim?.[0](err))\r\n\t\t\t\t.reduce((accumulatedResp, currentShim) => {\r\n\t\t\t\t\treturn currentShim[1](accumulatedResp, context[err.config.url]); \r\n\t\t\t\t}, err);\r\n\r\n\t\t\treturn resp;\r\n\t\t}\r\n\t};\r\n}","import authenticatedWrapper from \"../layout/authenticated-wrapper.html\";\r\nimport unauthenticatedWrapper from \"../layout/unauthenticated-wrapper.html\";\r\nimport {\r\n\tDASHBOARD,\r\n\tFORM_REPORT,\r\n\tBASE_REPORT,\r\n\tNEW_REPORT,\r\n\tDX_REPORT,\r\n\tEDIT_REPORT, \r\n\tENTITIES_SCREEN\r\n} from \"routes.js\";\r\nimport {\r\n\tEVENT_NEW_FORM,\r\n\topenIdCallbackSuffix\r\n} from \"constants.js\";\r\nimport { forEach } from \"lodash\";\r\nimport moment from \"moment\";\r\nimport { EXPORTS_SCREEN } from \"../routes\";\r\nimport { isAnyTypePermittedScope } from \"../services/security/commonScopes\";\r\n\r\nfunction clearSplash(deferral) {\r\n\tconst loader = angular.element(document.querySelector(\"#vesl-splash\"));\r\n\r\n\tloader.addClass(\"fadeOut\");\r\n\r\n\tsetTimeout(function() {\r\n\t\tloader.remove();\r\n\t}, 1150);\r\n\r\n\tdeferral.resolve();\r\n}\r\n\r\nexport default function routeConfig($stateProvider, $urlRouterProvider, $locationProvider) {\r\n\t$stateProvider\r\n\t\t.state(\"unauthenticated\", {\r\n\t\t\tabstract: true,\r\n\t\t\turl: \"\",\r\n\t\t\ttemplate: unauthenticatedWrapper,\r\n\t\t\tdata: {\r\n\t\t\t\tbodyClassName: \"login-content\"\r\n\t\t\t},\r\n\t\t\tresolve: {\r\n\t\t\t\tlogout($featureFlags, $userProfile, appState) {\r\n\t\t\t\t\t$featureFlags.clearFeatures();\r\n\t\t\t\t\t$userProfile.clear();\r\n\t\t\t\t\tappState.reset();\r\n\t\t\t\t},\r\n\t\t\t\tsplash: function($q) {\r\n\t\t\t\t\tconst deferral = $q.defer();\r\n\r\n\t\t\t\t\t// handle unauthenticated route specific things here\r\n\t\t\t\t\tclearSplash(deferral);\r\n\r\n\t\t\t\t\treturn deferral.promise;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(\"authenticated\", {\r\n\t\t\tabstract: true,\r\n\t\t\turl: \"\",\r\n\t\t\ttemplate: authenticatedWrapper,\r\n\t\t\tresolve: {\r\n\t\t\t\tapiState: function(api, appState) {\r\n\t\t\t\t\tif(appState.apiState) {\r\n\t\t\t\t\t\treturn appState.apiState;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn api.get(\"\").then((rootResponse) => {\r\n\t\t\t\t\t\tconst apiMoment = moment(rootResponse.ServerTime);\r\n\t\t\t\t\t\tconst localMoment = moment();\r\n\r\n\t\t\t\t\t\trootResponse.skew = localMoment.diff(apiMoment, \"minutes\");\r\n\r\n\t\t\t\t\t\tappState.apiState = rootResponse;\r\n\t\t\t\t\t\treturn rootResponse;\r\n\t\t\t\t\t});\r\n\t\t\t\t},\r\n\t\t\t\tuser: function($q, $state, openIdService, auth, apiState, toastr) {\r\n\t\t\t\t\tif(apiState.skew > 5 || apiState.skew < -5) {\r\n\t\t\t\t\t\ttoastr.error(\"Local time is not within 5 minutes of server time. Your device may have an inaccurate time\");\r\n\r\n\t\t\t\t\t\tthrow `Local time is ${Math.abs(apiState.skew)} minutes ${apiState.skew > 0 ? \"more than\" : \"less than\"} server time.\r\n\t\t\t\t\t\t \\nLocal time should be within 5 minutes of server time.\r\n\t\t\t\t\t\t \\nPlease adjust your computer's date, clock, or timezone as needed.\r\n\t\t\t\t\t\t \\nThen, close and re-open your browser, and try again.`;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst fromRouteName = $state.transition.to().name;\r\n\t\t\t\t\tconst userManager = openIdService.getUserManager();\r\n\t\t\t\t\tconst fromRouteParams = {};\r\n\r\n\t\t\t\t\tforEach($state.transition.params(), (p, key) => {\r\n\t\t\t\t\t\tif(p !== undefined && p !== null) {\r\n\t\t\t\t\t\t\tfromRouteParams[key] = p;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\treturn userManager.getUser().then((userInfo) => {\r\n\t\t\t\t\t\tif(userInfo === null) {\r\n\t\t\t\t\t\t\topenIdService.setFromRoute(fromRouteName, fromRouteParams);\r\n\r\n\t\t\t\t\t\t\t// this returns a promise; will reject if auth server is down\r\n\t\t\t\t\t\t\tconst signin = userManager.signinRedirect().catch(() => {\r\n\t\t\t\t\t\t\t\tthrow \"Authentication failed\";\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\treturn signin;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tauth.setAuthData(userInfo);\r\n\r\n\t\t\t\t\t\treturn userInfo;\r\n\t\t\t\t\t});\r\n\t\t\t\t},\r\n\t\t\t\tforms(formsService, formService, loadingService, $featureFlags, $userProfile, user, $state, $logger) {\r\n\t\t\t\t\tif(!$userProfile.getUser() && !user) {\r\n\t\t\t\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\treject(\"user does not exist in profile service\");\r\n\t\t\t\t\t\t\t}, 15000);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst promise = $featureFlags.loadFeaturesForCurrentUser().then(() => {\r\n\t\t\t\t\t\treturn formsService.getForms()\r\n\t\t\t\t\t\t\t.then(selectedForm => {\r\n\t\t\t\t\t\t\t\tif(\r\n\t\t\t\t\t\t\t\t\tselectedForm.length === 0\r\n\t\t\t\t\t\t\t\t\t&& $state.transition.targetState().name() != \"authenticated.welcome\"\r\n\t\t\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\t\t\t$state.transition.abort();\r\n\t\t\t\t\t\t\t\t\t$state.go(\"authenticated.welcome\");\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\treturn selectedForm;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\treturn loadingService.watch(promise, \"Loading...\");\r\n\t\t\t\t},\r\n\t\t\t\tsplash: function($q, user, forms, noticeService, $logger) {\r\n\t\t\t\t\tconst deferral = $q.defer();\r\n\t\t\t\t\tconst noticePromise = forms.Id !== undefined ? noticeService.getNotices(forms.Id) : undefined;\r\n\r\n\t\t\t\t\tPromise.all([user, forms, noticePromise])\r\n\t\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\t\tclearSplash(deferral);\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\treturn deferral.promise;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tparams: {\r\n\t\t\t\tvia: null\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(\"unauthenticated.privacy\", {\r\n\t\t\ttitle: \"Privacy Policy\",\r\n\t\t\turl: \"/privacy\",\r\n\t\t\tcomponent: \"privacy\"\r\n\t\t})\r\n\t\t.state(\"unauthenticated.deletion\", {\r\n\t\t\ttitle: \"Account Deletion\",\r\n\t\t\turl: \"/account-deletion\",\r\n\t\t\tcomponent: \"deletion\"\r\n\t\t})\r\n\t\t.state(\"unauthenticated.failed\", {\r\n\t\t\ttitle: \"Oops\",\r\n\t\t\turl: \"/oops\",\r\n\t\t\tcomponent: \"failedRoute\",\r\n\t\t\tparams: {\r\n\t\t\t\terrorMsg: null\r\n\t\t\t},\r\n\t\t\tresolve: {\r\n\t\t\t\tdisallow: function($q, $state) {\r\n\t\t\t\t\tconst { system } = $state.transition.targetState().params();\r\n\t\t\t\t\tif(!system) {\r\n\t\t\t\t\t\t$state.transition.abort();\r\n\t\t\t\t\t\t$state.go(DASHBOARD);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(\"unauthenticated.oauth-login\", {\r\n\t\t\ttitle: \"Logging in\",\r\n\t\t\turl: openIdCallbackSuffix,\r\n\t\t\tcomponent: \"oauthLogin\"\r\n\t\t})\r\n\t\t.state(\"unauthenticated.oauth-splash\", {\r\n\t\t\ttitle: \"Login\",\r\n\t\t\turl: \"/loggingin\",\r\n\t\t\tcomponent: \"oauthSplash\"\r\n\t\t})\r\n\t\t.state(\"authenticated.dashboard\", {\r\n\t\t\ttitle: \"Dashboard\",\r\n\t\t\turl: \"/user/dashboard\",\r\n\t\t\tcomponent: \"dashboard\"\r\n\t\t})\r\n\t\t.state(\"authenticated.welcome\", {\r\n\t\t\ttitle: \"Welcome\",\r\n\t\t\turl: \"/welcome?{agency:string}&{form:string}\",\r\n\t\t\tcomponent: \"welcome\"\r\n\t\t})\r\n\t\t.state(\"authenticated.compliance\", {\r\n\t\t\ttitle: \"Compliance\",\r\n\t\t\turl: \"/compliance\",\r\n\t\t\tcomponent: \"complianceReport\",\r\n\t\t\tdata: {\r\n\t\t\t\tpermissionKeys: \"Compliance\"\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(\"authenticated.messaging\", {\r\n\t\t\ttitle: \"Messaging\",\r\n\t\t\turl: \"/messaging\",\r\n\t\t\tcomponent: \"messaging\"\r\n\t\t})\r\n\t\t.state(\"authenticated.report-list\", {\r\n\t\t\ttitle: \"Reports\",\r\n\t\t\turl: \"/reportlist?{start:date}&{end:date}&{page:string}&{itemsPerPage:string}&{sort:string}&{status:string}&{entityIds}\",\r\n\t\t\tparams: { entityIds: { array: true } },\r\n\t\t\tcomponent: \"reportList\",\r\n\t\t\treloadOnSearch: false,\r\n\t\t\tdata: {\r\n\t\t\t\tpermissionKeys: \"History\"\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(BASE_REPORT, {\r\n\t\t\tabstract: true,\r\n\t\t\turl: \"/report\",\r\n\t\t\tdata: {\r\n\t\t\t\tpermissionKeys: \"Reporting\"\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(NEW_REPORT, {\r\n\t\t\ttitle: \"New Report\",\r\n\t\t\turl: \"\",\r\n\t\t\ttemplate: `\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t`,\r\n\t\t\tcontrollerAs: \"$ctrl\",\r\n\t\t\tcontroller(report) {\r\n\t\t\t\tthis.report = report;\r\n\t\t\t},\r\n\t\t\tparams: {\r\n\t\t\t\treport: null\r\n\t\t\t},\r\n\t\t\tresolve: {\r\n\t\t\t\treport($stateParams) {\r\n\t\t\t\t\tif($stateParams.report) {\r\n\t\t\t\t\t\treturn $stateParams.report;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn undefined;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(EDIT_REPORT, {\r\n\t\t\ttitle: \"Edit Report\",\r\n\t\t\turl: \"?{id:int}\",\r\n\t\t\ttemplate: `\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t`,\r\n\t\t\tcontrollerAs: \"$ctrl\",\r\n\t\t\tcontroller(report) {\r\n\t\t\t\tthis.report = report;\r\n\t\t\t},\r\n\t\t\tparams: {\r\n\t\t\t\treport: null\r\n\t\t\t},\r\n\t\t\tresolve: {\r\n\t\t\t\treport($stateParams, appState, api, loadingService, $state, eventBus, toastr, $logger) {\r\n\t\t\t\t\tif($stateParams.report) {\r\n\t\t\t\t\t\treturn $stateParams.report;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst form = appState.forms.selected;\r\n\t\t\t\t\tconst promise = api\r\n\t\t\t\t\t\t.get(FORM_REPORT(form.Id, $stateParams.id))\r\n\t\t\t\t\t\t.then((response) => {\r\n\t\t\t\t\t\t\tif(!response) {\r\n\t\t\t\t\t\t\t\t$logger.error(\"Form report response was falsy\", {\r\n\t\t\t\t\t\t\t\t\tcurrentFormId: (appState.forms.selected || {}).Id,\r\n\t\t\t\t\t\t\t\t\trequestedFormId: form.Id,\r\n\t\t\t\t\t\t\t\t\trequestedReportId: $stateParams.id\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\tthrow new Error(\"Form report response was falsy\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(response.IsNegative === true) {\r\n\t\t\t\t\t\t\t\t$state.transition.abort();\r\n\t\t\t\t\t\t\t\t$state.transitionTo(DASHBOARD, {}, { location: \"replace\", reload: DASHBOARD });\r\n\t\t\t\t\t\t\t\ttoastr.error(\"You can't navigate to a negative report\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(response.FormId !== form.Id) {\r\n\t\t\t\t\t\t\t\treturn appState.forms.selectByFormId(response.FormId).then(() => {\r\n\t\t\t\t\t\t\t\t\teventBus.trigger(EVENT_NEW_FORM);\r\n\t\t\t\t\t\t\t\t\treturn response;\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\treturn response;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.catch(() => {\r\n\t\t\t\t\t\t\tif($state.transition && $state.transition.targetState().name() !== \"unauthenticated.signin\") {\r\n\t\t\t\t\t\t\t\t$state.transition.abort();\r\n\r\n\t\t\t\t\t\t\t\tif($state.transition.from().name === \"\") {\r\n\t\t\t\t\t\t\t\t\t$state.transitionTo(NEW_REPORT, {}, { location: \"replace\", reload: NEW_REPORT });\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn undefined;\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\treturn loadingService.watch(promise);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(DX_REPORT, {\r\n\t\t\ttitle: \"Diagnose Report\",\r\n\t\t\turl: \"/dx?{b64:string}\",\r\n\t\t\ttemplate: `\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t`,\r\n\t\t\tcontrollerAs: \"$ctrl\",\r\n\t\t\tcontroller(report) {\r\n\t\t\t\tthis.report = report;\r\n\t\t\t},\r\n\t\t\tparams: {\r\n\t\t\t\treport: null\r\n\t\t\t},\r\n\t\t\tresolve: {\r\n\t\t\t\treport($state, $stateParams) {\r\n\t\t\t\t\tconst report = JSON.parse(atob($stateParams.b64));\r\n\r\n\t\t\t\t\treturn $state.go(\r\n\t\t\t\t\t\tEDIT_REPORT,\r\n\t\t\t\t\t\t{ id: report.Id, report: report },\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tlocation: \"replace\",\r\n\t\t\t\t\t\t\tcustom: {\r\n\t\t\t\t\t\t\t\tshowValidations: true,\r\n\t\t\t\t\t\t\t\tisNewReport: false\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(\"authenticated.analytics\", {\r\n\t\t\ttitle: \"Analytics\",\r\n\t\t\turl: \"/analytics\",\r\n\t\t\tcomponent: \"proxies\",\r\n\t\t\tdata: {\r\n\t\t\t\tpermissionKeys: \"Administration>Analytics\"\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(\"authenticated.operations\", {\r\n\t\t\ttitle: \"Operations\",\r\n\t\t\turl: \"/operations\",\r\n\t\t\tcomponent: \"proxies\",\r\n\t\t\tdata: {\r\n\t\t\t\tpermissionKeys: \"Administration>Operations\"\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(\"authenticated.reporting\", {\r\n\t\t\ttitle: \"Reporting\",\r\n\t\t\turl: \"/reporting\",\r\n\t\t\tcomponent: \"proxies\",\r\n\t\t\tdata: {\r\n\t\t\t\tpermissionKeys: \"Administration>Reporting\"\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(ENTITIES_SCREEN, {\r\n\t\t\tcomponent: \"entities\",\r\n\t\t\turl: \"/entities\",\r\n\t\t\ttitle: \"Entity Management\",\r\n\t\t\tdata: {\r\n\t\t\t\tpermissionKeys: \"Administration>Entity\",\r\n\t\t\t\tactionScope: isAnyTypePermittedScope()\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(\"authenticated.users\", {\r\n\t\t\ttitle: \"User Management\",\r\n\t\t\turl: \"/users\",\r\n\t\t\tcomponent: \"users\",\r\n\t\t\tdata: {\r\n\t\t\t\tpermissionKeys: \"Administration>User\"\r\n\t\t\t}\r\n\t\t})\r\n\t\t.state(EXPORTS_SCREEN, {\r\n\t\t\tcomponent: \"exports\",\r\n\t\t\turl: \"/exports\",\r\n\t\t\ttitle: \"Export Management\"\r\n\t\t});\r\n\r\n\t$urlRouterProvider.otherwise(\"/user/dashboard\");\r\n\t$locationProvider.html5Mode({\r\n\t\tenabled: true,\r\n\t\trequireBase: false\r\n\t});\r\n}\r\n","import uiRouter from \"@uirouter/angularjs\";\r\nimport \"angular-hotkeys\";\r\n\r\nimport httpConfig from \"./http.js\";\r\nimport routeConfig from \"./route.js\";\r\nimport tooltipConfig from \"./tooltip-provider.js\";\r\nimport toastrConfig from \"./toastr-config.js\";\r\nimport datepickerConfig from \"./datepicker-provider\";\r\nimport datepickerPopupConfig from \"./datepicker-popup-config\";\r\nimport routeTransitionsConfig from \"./route-transitions.js\";\r\nimport { consoleShim } from \"../services/console-shim.js\";\r\n\r\nconst settings = getEnvironmentSettings();\r\n\r\nconsoleShim.shimConsole();\r\n\r\nconst buildDate = new Date().toISOString();\r\n\r\nexport const config = {\r\n\t...settings,\r\n\tbuildDate,\r\n\tclientId: \"vesl-web\",\r\n\tsupport: {\r\n\t\temail: \"support@vesldata.com\",\r\n\t\tphone: {\r\n\t\t\tdisplay: \"(202) 883-8375\",\r\n\t\t\tvalue: \"2028838375\"\r\n\t\t}\r\n\t}\r\n};\r\n\r\nexport const uiState = {\r\n\theader: { searchToggled: false },\r\n\tsidebar: { open: false },\r\n\tenvironment: settings.environment\r\n};\r\n\r\nfunction getEnvironmentSettings() {\r\n\r\n\t// eslint-disable-next-line no-undef\r\n\treturn ENVIRONMENT_CONFIGURATION;\r\n}\r\n\r\nconst deps = [uiRouter, \"cfp.hotkeys\"];\r\n\r\nexport default angular\r\n\t.module(\"vesl.config\", deps)\r\n\t.constant(\"config\", config)\r\n\t.constant(\"uiState\", uiState)\r\n\t.config(tooltipConfig)\r\n\t.config(datepickerConfig)\r\n\t.config(datepickerPopupConfig)\r\n\t.config(httpConfig)\r\n\t.config(routeConfig)\r\n\t.config(routeTransitionsConfig)\r\n\t.config(toastrConfig).name;\r\n","/* eslint-disable no-console */\r\nexport const consoleShim = {\r\n\tnopify: function() {\r\n\t\tconst methods = [\"assert\", \"cd\", \"clear\", \"count\", \"countReset\",\r\n\t\t\t\"debug\", \"dir\", \"dirxml\", \"error\", \"exception\", \"group\", \"groupCollapsed\",\r\n\t\t\t\"groupEnd\", \"info\", \"log\", \"markTimeline\", \"profile\", \"profileEnd\",\r\n\t\t\t\"select\", \"table\", \"time\", \"timeEnd\", \"timeStamp\", \"timeline\",\r\n\t\t\t\"timelineEnd\", \"trace\", \"warn\"];\r\n\r\n\t\tconst noop = function() { };\r\n\t\tfor(const method of methods) {\r\n\t\t\tif(!console[method])\r\n\t\t\t\tconsole[method] = noop;\r\n\t\t}\r\n\t},\r\n\r\n\tshimConsole: function() {\r\n\t\twindow.vesl = window.vesl || {};\r\n\r\n\t\tthis.nopify();\r\n\t}\r\n};\r\n","export default function tooltipConfig($uibTooltipProvider) {\r\n\t$uibTooltipProvider.setTriggers({\r\n\t\t\"mouseenter\": \"mouseleave blur click\",\r\n\t\t\"click\": \"click\",\r\n\t\t\"focus\": \"blur\",\r\n\t\t\"never\": \"mouseleave\"\r\n\t});\r\n\t$uibTooltipProvider.options({\r\n\t\tappendToBody: \"true\"\r\n\t});\r\n}","export default function datepickerConfig(uibDatepickerConfig) {\r\n\tuibDatepickerConfig.showWeeks = false;\r\n}\r\n","export default function datepickerPopupConfig(uibDatepickerPopupConfig) {\r\n\tuibDatepickerPopupConfig.onOpenFocus = false;\r\n}","import { etagInterceptor } from \"./interceptors/etagInterceptor\";\r\nimport { statusInterceptor } from \"./interceptors/statusInterceptor\";\r\nimport { mockDataInterceptor } from \"./interceptors/mockDataInterceptor\";\r\nimport { shimmer } from \"./interceptors/shimmer\";\r\n\r\nexport default function httpConfig($httpProvider, config) {\r\n\t$httpProvider.interceptors.push(etagInterceptor, statusInterceptor, shimmer);\r\n\tif([\"dev\", \"beta\", \"local\", \"staging\"].indexOf(config.environment) > -1)\r\n\t\t$httpProvider.interceptors.push(mockDataInterceptor);\r\n}\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t
\\r\\n
\\r\\n\";","export default \"\\r\\n\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t\\r\\n\";","export default function routeTransitionsConfig($transitionsProvider) {\r\n\tconst routeLookups = {};\r\n\r\n\tconst recordPageView = (transition) => {\r\n\t\ttry {\r\n\t\t\tconst targetDefinition = transition.to();\r\n\t\t\tconst targetRequested = transition.targetState();\r\n\t\t\tconst targetUrl = transition.router.stateService.href(targetDefinition.name, targetRequested.params, { absolute: true });\r\n\t\t\tconst $logger = transition.injector().get(\"$logger\");\r\n\t\t\tconst via = targetRequested.params().via;\r\n\r\n\t\t\tif(routeLookups[targetDefinition.name] === undefined) {\r\n\t\t\t\trouteLookups[targetDefinition.name] = getTargetRoute(targetRequested.$state());\r\n\t\t\t}\r\n\r\n\t\t\tconst targetRoute = routeLookups[targetDefinition.name];\r\n\r\n\t\t\t$logger.view(targetRoute, targetUrl, { via });\r\n\t\t}\r\n\t\tcatch(error) {\r\n\t\t\t// do nothing on exception\r\n\t\t}\r\n\t};\r\n\r\n\tconst getTargetRoute = (targetState) => {\r\n\t\tif(targetState.parent) {\r\n\t\t\treturn `${getTargetRoute(targetState.parent)}${targetState.self.url}`;\r\n\t\t}\r\n\t\treturn targetState.self.url;\r\n\t};\r\n\r\n\tconst setTitle = (transition) => {\r\n\t\tlet title = transition.to().title;\r\n\r\n\t\tif(title) {\r\n\t\t\tif(title instanceof Function) {\r\n\t\t\t\ttitle = title.call(transition.to(), transition.params());\r\n\t\t\t}\r\n\t\t\twindow.document.title = title;\r\n\t\t}\r\n\t};\r\n\r\n\t$transitionsProvider.onSuccess({}, trans => {\r\n\t\trecordPageView(trans);\r\n\t\tsetTitle(trans);\r\n\t});\r\n\r\n\t$transitionsProvider.onEnter(transitionAuthCriteria, transitionAuthHandler, {\r\n\t\tpriority: 10\r\n\t});\r\n\r\n\t$transitionsProvider.onBefore({ to: () => true }, transitionClassHandler, {\r\n\t\tpriority: 10\r\n\t});\r\n\r\n\t$transitionsProvider.onError({}, (transition) => {\r\n\t\tconst error = transition.error();\r\n\r\n\t\tif(error.type === 6) {\r\n\t\t\ttransition.router.stateService.go(\"unauthenticated.failed\", { system: true, errorMsg: error.detail }, { location: false });\r\n\t\t}\r\n\r\n\t}, { priority: 10 });\r\n\r\n\tconst transitionAuthCriteria = {\r\n\t\tto: state => {\r\n\t\t\treturn state.data && state.data.permissionKeys;\r\n\t\t}\r\n\t};\r\n\r\n\tfunction transitionAuthHandler(transition) {\r\n\t\tconst { data } = transition.targetState().state();\r\n\t\tconst appState = transition.injector().get(\"appState\");\r\n\r\n\t\tif(data?.actionScope) {\r\n\t\t\tconst securityService = transition.injector().get(\"securityService\");\r\n\t\t\tif(securityService.isActionScopeAllowed(data.actionScope)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse if(!data?.permissionKeys) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(data?.permissionKeys) {\r\n\t\t\tconst keys = data.permissionKeys.split(\">\");\r\n\r\n\t\t\tlet index = 0;\r\n\t\t\tlet permissionBlob = appState.permissions[keys[index++]];\r\n\t\t\twhile(index < keys.length) {\r\n\t\t\t\tif(permissionBlob.IsDisabled) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tpermissionBlob = permissionBlob[keys[index++]];\r\n\t\t\t}\r\n\r\n\t\t\tif(permissionBlob.IsDisabled) {\r\n\t\t\t\tconst $state = transition.router.stateService;\r\n\t\t\t\treturn $state.target(\"authenticated.dashboard\", undefined, {\r\n\t\t\t\t\tlocation: true\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\tfunction transitionClassHandler(transition) {\r\n\t\tconst data = transition.targetState().state().data;\r\n\t\tconst uiState = transition.injector().get(\"uiState\");\r\n\t\tif(data && data.bodyClassName) {\r\n\t\t\tuiState.stateClass = data.bodyClassName;\r\n\t\t} else {\r\n\t\t\tuiState.stateClass = null;\r\n\t\t}\r\n\r\n\t\tuiState.sidebar.open = false;\r\n\t}\r\n}\r\n","export default function toastrConfig(toastrConfig) {\r\n\tangular.extend(toastrConfig, {\r\n\t\tallowHtml: true,\r\n\t\tcloseButton: true,\r\n\t\t// why does setting the extendedTimeOut to zero make it show indefinitely?\r\n\t\t// No idea. Timeouts are broken in this package.\r\n\t\t// https://github.com/Foxandxss/angular-toastr/issues/233\r\n\t\ttimeOut: 8000,\r\n\t\textendedTimeOut: 4000,\r\n\t\ttapToDismiss: false,\r\n\t\tprogressBar: true,\r\n\t\tonShown: (toast) => {\r\n\t\t\tconst toastElement = toast.el[0];\r\n\t\t\t// accessibility recommendations taken from the below resources\r\n\t\t\t// https://medium.com/@sheribyrnehaber/designing-toast-messages-for-accessibility-fb610ac364be\r\n\t\t\t// https://github.com/jackbsteinberg/std-toast\r\n\t\t\tif(toast.scope.toastType === \"toast-error\") {\r\n\t\t\t\ttoastElement.setAttribute(\"role\", \"alert\");\r\n\t\t\t\ttoastElement.setAttribute(\"aria-live\", \"assertive\");\r\n\t\t\t} else {\r\n\t\t\t\ttoastElement.setAttribute(\"role\", \"status\");\r\n\t\t\t\ttoastElement.setAttribute(\"aria-live\", \"polite\");\r\n\t\t\t}\r\n\t\t},\r\n\t\tpositionClass: \"toast-top-center\",\r\n\t\tpreventOpenDuplicates: true\r\n\t});\r\n}\r\n","function autoFocus($parse, $timeout) {\r\n\treturn {\r\n\t\tlink: function(scope, element, attrs) {\r\n\t\t\tconst model = $parse(attrs.autoFocus);\r\n\r\n\t\t\tif(!!model()) {\r\n\t\t\t\tscope.$watch(model, function(value) {\r\n\t\t\t\t\tif(!!value) {\r\n\t\t\t\t\t\t$timeout(function() {\r\n\t\t\t\t\t\t\telement[0].focus();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.auto-focus\", [])\r\n\t.directive(\"autoFocus\", autoFocus).name;\r\n","function ariaFromAttr() {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\t\tlink: function(scope, element, attrs) {\r\n\t\t\tconst targetAttribute = element[0].getAttribute(attrs.ariaFromAttr);\r\n\t\t\telement[0].setAttribute(\"aria-label\", targetAttribute);\r\n\t\t}\r\n\t};\r\n}\r\nexport default angular\r\n\t.module(\"vesl.behaviors.aria-from-attr\", [])\r\n\t.directive(\"ariaFromAttr\", ariaFromAttr).name;\r\n","import Waves from \"node-waves\";\r\n\r\nfunction btnRipple() {\r\n\treturn {\r\n\t\trestrict: \"C\",\r\n\t\tlink: function(scope, element) {\r\n\t\t\tif(element.hasClass(\"btn-icon\") || element.hasClass(\"btn-float\")) {\r\n\t\t\t\tWaves.attach(element, [\"waves-circle\"]);\r\n\t\t\t} else if(element.hasClass(\"btn-light\")) {\r\n\t\t\t\tWaves.attach(element, [\"waves-light\"]);\r\n\t\t\t} else {\r\n\t\t\t\tWaves.attach(element);\r\n\t\t\t}\r\n\r\n\t\t\tWaves.init();\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.btn-ripple\", [])\r\n\t.directive(\"btn\", btnRipple).name;\r\n","function compareTo() {\r\n\treturn {\r\n\t\trequire: \"ngModel\",\r\n\t\tscope: {\r\n\t\t\totherModelValue: \"=compareTo\"\r\n\t\t},\r\n\t\tlink: function(scope, element, attributes, ngModel) {\r\n\t\t\tngModel.$validators.compareTo = function(modelValue) {\r\n\t\t\t\treturn modelValue == scope.otherModelValue;\r\n\t\t\t};\r\n\r\n\t\t\tscope.$watch(\"otherModelValue\", function() {\r\n\t\t\t\tngModel.$validate();\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.compare-to\", [])\r\n\t.directive(\"compareTo\", compareTo).name;\r\n","import moment from \"moment\";\r\n\r\nfunction dateTimeInput() {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\t\trequire: \"ngModel\",\r\n\t\tlink() {\r\n\t\t\tconst formatters = {\r\n\t\t\t\t[\"date\"](input) {\r\n\t\t\t\t\treturn moment(input).format(\"L\");\r\n\t\t\t\t},\r\n\t\t\t\t[\"time\"](input) {\r\n\t\t\t\t\tconst matchableRegex = /^0?([1-9]|1[0-2])(?::?([0-5][0-9]))?\\s?((?:[A|a]|[P|p])(?:[M|m]?))$/g;\r\n\t\t\t\t\tif(!input.match(matchableRegex)) {\r\n\t\t\t\t\t\treturn input;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn input.replace(matchableRegex, (x, hours, mins, period) => {\r\n\t\t\t\t\t\tmins = mins || \"00\";\r\n\t\t\t\t\t\tperiod = `${period}${period\r\n\t\t\t\t\t\t\t.toUpperCase()\r\n\t\t\t\t\t\t\t.includes(\"M\") ? \"\" : \"M\"}`;\r\n\r\n\t\t\t\t\t\treturn `${hours}:${mins} ${period}`.toUpperCase();\r\n\t\t\t\t\t});\r\n\t\t\t\t},\r\n\t\t\t\t[\"date-time\"](input) {\r\n\t\t\t\t\tconst [date, ...timePieces] = input.split(\" \");\r\n\t\t\t\t\tconst time = timePieces.join(\" \");\r\n\r\n\t\t\t\t\treturn `${formatters.date(date)} ${formatters.time(time)}`;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\t// element.on('blur', () => {\r\n\t\t\t// const formatter = formatters[attrs.dateTime];\r\n\t\t\t// if (!formatter) {\r\n\t\t\t// return;\r\n\t\t\t// }\r\n\t\t\t// const value = formatter(ngModel.$modelValue);\r\n\t\t\t// element.val(value);\r\n\t\t\t// ngModel.$setViewValue(value);\r\n\t\t\t// scope.$evalAsync();\r\n\t\t\t// });\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.date-time-input\", [])\r\n\t.directive(\"dateTimeInput\", dateTimeInput).name;\r\n","function htmlViewer() {\r\n\tfunction link(scope, element) {\r\n\t\tconst iframe = document.createElement(\"iframe\");\r\n\t\tconst element0 = element[0];\r\n\t\telement0.appendChild(iframe);\r\n\r\n\t\tscope.$watch(\"content\", function() {\r\n\t\t\tiframe.contentWindow.document.open(\"text/htmlreplace\");\r\n\t\t\tiframe.contentWindow.document.write(scope.content);\r\n\t\t\tiframe.contentWindow.document.close();\r\n\t\t});\r\n\t}\r\n\r\n\treturn {\r\n\t\tlink: link,\r\n\t\trestrict: \"E\",\r\n\t\tscope: {\r\n\t\t\tcontent: \"=\"\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.behaviors.html-viewer\", []).directive(\"htmlViewer\", htmlViewer).name;\r\n","function inputRipple() {\r\n\treturn {\r\n\t\trestrict: \"C\",\r\n\t\tlink(scope, element) {\r\n\t\t\tconst target = angular.element(\r\n\t\t\t\telement[0].querySelectorAll(\".form-control\")\r\n\t\t\t);\r\n\r\n\t\t\ttarget.on(\"focus\", onFocus);\r\n\t\t\ttarget.on(\"blur\", onBlur);\r\n\r\n\t\t\tscope.$on(\"$destroy\", () => {\r\n\t\t\t\telement.off(\"focus\", onFocus);\r\n\t\t\t\telement.off(\"blur\", onBlur);\r\n\t\t\t});\r\n\r\n\t\t\tfunction onBlur() {\r\n\t\t\t\tconst p = closestByClass(target, \"form-group\");\r\n\r\n\t\t\t\tif(p && p.hasClass(\"fg-float\")) {\r\n\t\t\t\t\tif(!target.val()) {\r\n\t\t\t\t\t\telement.removeClass(\"fg-toggled\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\telement.removeClass(\"fg-toggled\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onFocus() {\r\n\t\t\t\telement.addClass(\"fg-toggled\");\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction closestByClass(el, className) {\r\n\twhile(el) {\r\n\t\tif(angular.element(el).hasClass(className)) {\r\n\t\t\treturn el;\r\n\t\t}\r\n\t\tel = el.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.input-ripple\", [])\r\n\t.directive(\"fgLine\", inputRipple).name;\r\n","/*\r\n Attaches input mask onto input element\r\n\r\n This is no longer the version in git. I've modified it specifically for VESL date masking.\r\n */\r\nexport default angular.module(\"ui.mask\", [])\r\n\t.value(\"uiMaskConfig\", {\r\n\t\tmaskDefinitions: {\r\n\t\t\t\"9\": /\\d/,\r\n\t\t\t\"A\": /[a-zA-Z]/,\r\n\t\t\t\"*\": /[a-zA-Z0-9]/\r\n\t\t},\r\n\t\tclearOnBlur: true,\r\n\t\tclearOnBlurPlaceholder: false,\r\n\t\tescChar: \"\\\\\",\r\n\t\teventsToHandle: [\"input\", \"keyup\", \"click\", \"focus\"],\r\n\t\taddDefaultPlaceholder: true,\r\n\t\tallowInvalidValue: false\r\n\t})\r\n\t.provider(\"uiMask.Config\", function() {\r\n\t\tconst options = {};\r\n\r\n\t\tthis.maskDefinitions = function(maskDefinitions) {\r\n\t\t\treturn options.maskDefinitions = maskDefinitions;\r\n\t\t};\r\n\t\tthis.clearOnBlur = function(clearOnBlur) {\r\n\t\t\treturn options.clearOnBlur = clearOnBlur;\r\n\t\t};\r\n\t\tthis.clearOnBlurPlaceholder = function(clearOnBlurPlaceholder) {\r\n\t\t\treturn options.clearOnBlurPlaceholder = clearOnBlurPlaceholder;\r\n\t\t};\r\n\t\tthis.eventsToHandle = function(eventsToHandle) {\r\n\t\t\treturn options.eventsToHandle = eventsToHandle;\r\n\t\t};\r\n\t\tthis.addDefaultPlaceholder = function(addDefaultPlaceholder) {\r\n\t\t\treturn options.addDefaultPlaceholder = addDefaultPlaceholder;\r\n\t\t};\r\n\t\tthis.allowInvalidValue = function(allowInvalidValue) {\r\n\t\t\treturn options.allowInvalidValue = allowInvalidValue;\r\n\t\t};\r\n\t\tthis.$get = [\"uiMaskConfig\", function(uiMaskConfig) {\r\n\t\t\tconst tempOptions = uiMaskConfig;\r\n\t\t\tfor(const prop in options) {\r\n\t\t\t\tif(angular.isObject(options[prop]) && !angular.isArray(options[prop])) {\r\n\t\t\t\t\tangular.extend(tempOptions[prop], options[prop]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempOptions[prop] = options[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn tempOptions;\r\n\t\t}];\r\n\t})\r\n\t.directive(\"uiMask\", [\"uiMask.Config\", function(maskConfig) {\r\n\t\tfunction isFocused(elem) {\r\n\t\t\treturn elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tpriority: 100,\r\n\t\t\trequire: \"ngModel\",\r\n\t\t\trestrict: \"A\",\r\n\t\t\tcompile: function uiMaskCompilingFunction() {\r\n\t\t\t\tconst options = angular.copy(maskConfig);\r\n\r\n\t\t\t\treturn function uiMaskLinkingFunction(scope, iElement, iAttrs, controller) {\r\n\t\t\t\t\tlet maskProcessed = false;\r\n\t\t\t\t\tlet eventsBound = false;\r\n\t\t\t\t\tlet maskCaretMap, maskPatterns, maskPlaceholder, maskComponents, //eslint-disable-line prefer-const\r\n\t\t\t\t\t\tvalueMasked, //eslint-disable-line @typescript-eslint/no-unused-vars\r\n\t\t\t\t\t\t// Minimum required length of the value to be considered valid\r\n\t\t\t\t\t\tminRequiredLength,//eslint-disable-line prefer-const\r\n\t\t\t\t\t\tvalue, isValid; //eslint-disable-line prefer-const\r\n\t\t\t\t\t\t// Vars for initializing/uninitializing\r\n\t\t\t\t\tconst originalPlaceholder = iAttrs.placeholder;\r\n\t\t\t\t\tconst originalMaxlength = iAttrs.maxlength;\r\n\t\t\t\t\t// Vars used exclusively in eventHandler()\r\n\t\t\t\t\tlet oldValue, oldValueUnmasked, oldCaretPosition, oldSelectionLength, //eslint-disable-line prefer-const\r\n\t\t\t\t\t\t// Used for communicating if a backspace operation should be allowed between\r\n\t\t\t\t\t\t// keydownHandler and eventHandler\r\n\t\t\t\t\t\tpreventBackspace;\r\n\r\n\t\t\t\t\tconst originalIsEmpty = controller.$isEmpty;\r\n\t\t\t\t\tcontroller.$isEmpty = function(value) {\r\n\t\t\t\t\t\tif(maskProcessed) {\r\n\t\t\t\t\t\t\treturn originalIsEmpty(unmaskValue(value || \"\"));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\treturn originalIsEmpty(value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction initialize(maskAttr) {\r\n\t\t\t\t\t\tif(!angular.isDefined(maskAttr)) {\r\n\t\t\t\t\t\t\treturn uninitialize();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tprocessRawMask(maskAttr);\r\n\t\t\t\t\t\tif(!maskProcessed) {\r\n\t\t\t\t\t\t\treturn uninitialize();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tinitializeElement();\r\n\t\t\t\t\t\tbindEventListeners();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction initPlaceholder(placeholderAttr) {\r\n\t\t\t\t\t\tif(!placeholderAttr) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmaskPlaceholder = placeholderAttr;\r\n\r\n\t\t\t\t\t\t// If the mask is processed, then we need to update the value\r\n\t\t\t\t\t\t// but don't set the value if there is nothing entered into the element\r\n\t\t\t\t\t\t// and there is a placeholder attribute on the element because that\r\n\t\t\t\t\t\t// will only set the value as the blank maskPlaceholder\r\n\t\t\t\t\t\t// and override the placeholder on the element\r\n\t\t\t\t\t\tif(maskProcessed && !(iElement.val().length === 0 && angular.isDefined(iAttrs.placeholder))) {\r\n\t\t\t\t\t\t\tiElement.val(maskValue(unmaskValue(iElement.val())));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction initPlaceholderChar() {\r\n\t\t\t\t\t\treturn initialize(iAttrs.uiMask);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet modelViewValue = false;\r\n\t\t\t\t\tiAttrs.$observe(\"modelViewValue\", function(val) {\r\n\t\t\t\t\t\tif(val === \"true\") {\r\n\t\t\t\t\t\t\tmodelViewValue = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tiAttrs.$observe(\"allowInvalidValue\", function(val) {\r\n\t\t\t\t\t\tlinkOptions.allowInvalidValue = val === \"\" ?\r\n\t\t\t\t\t\t\ttrue :\r\n\t\t\t\t\t\t\t!!val;\r\n\t\t\t\t\t\tformatter(controller.$modelValue);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tfunction formatter(fromModelValue) {\r\n\t\t\t\t\t\tif(!maskProcessed) {\r\n\t\t\t\t\t\t\treturn fromModelValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvalue = unmaskValue(fromModelValue || \"\");\r\n\t\t\t\t\t\tisValid = validateValue(value);\r\n\t\t\t\t\t\tcontroller.$setValidity(\"mask\", isValid);\r\n\r\n\t\t\t\t\t\tif(!value.length)return undefined;\r\n\t\t\t\t\t\tif(isValid || linkOptions.allowInvalidValue) {\r\n\t\t\t\t\t\t\treturn maskValue(value);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\treturn undefined;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction parser(fromViewValue) {\r\n\t\t\t\t\t\tif(!maskProcessed) {\r\n\t\t\t\t\t\t\treturn fromViewValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvalue = unmaskValue(fromViewValue || \"\");\r\n\t\t\t\t\t\tisValid = validateValue(value);\r\n\t\t\t\t\t\t// We have to set viewValue manually as the reformatting of the input\r\n\t\t\t\t\t\t// value performed by eventHandler() doesn't happen until after\r\n\t\t\t\t\t\t// this parser is called, which causes what the user sees in the input\r\n\t\t\t\t\t\t// to be out-of-sync with what the controller's $viewValue is set to.\r\n\t\t\t\t\t\tcontroller.$viewValue = value.length ? maskValue(value) : \"\";\r\n\t\t\t\t\t\tcontroller.$setValidity(\"mask\", isValid);\r\n\r\n\t\t\t\t\t\tif(isValid || linkOptions.allowInvalidValue) {\r\n\t\t\t\t\t\t\treturn modelViewValue ? controller.$viewValue : value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet linkOptions = {};\r\n\r\n\t\t\t\t\tif(iAttrs.uiOptions) {\r\n\t\t\t\t\t\tlinkOptions = scope.$eval(\"[\" + iAttrs.uiOptions + \"]\");\r\n\t\t\t\t\t\tif(angular.isObject(linkOptions[0])) {\r\n\t\t\t\t\t\t\t// we can't use angular.copy nor angular.extend, they lack the power to do a deep merge\r\n\t\t\t\t\t\t\tlinkOptions = (function(original, current) {\r\n\t\t\t\t\t\t\t\tfor(const i in original) {\r\n\t\t\t\t\t\t\t\t\tif(Object.prototype.hasOwnProperty.call(original, i)) {\r\n\t\t\t\t\t\t\t\t\t\tif(current[i] === undefined) {\r\n\t\t\t\t\t\t\t\t\t\t\tcurrent[i] = angular.copy(original[i]);\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\tif(angular.isObject(current[i]) && !angular.isArray(current[i])) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tcurrent[i] = angular.extend({}, original[i], current[i]);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\treturn current;\r\n\t\t\t\t\t\t\t})(options, linkOptions[0]);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlinkOptions = options; //gotta be a better way to do this..\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tlinkOptions = options;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tiAttrs.$observe(\"uiMask\", initialize);\r\n\t\t\t\t\tif(angular.isDefined(iAttrs.uiMaskPlaceholder)) {\r\n\t\t\t\t\t\tiAttrs.$observe(\"uiMaskPlaceholder\", initPlaceholder);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tiAttrs.$observe(\"placeholder\", initPlaceholder);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(angular.isDefined(iAttrs.uiMaskPlaceholderChar)) {\r\n\t\t\t\t\t\tiAttrs.$observe(\"uiMaskPlaceholderChar\", initPlaceholderChar);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcontroller.$formatters.unshift(formatter);\r\n\t\t\t\t\tcontroller.$parsers.unshift(parser);\r\n\r\n\t\t\t\t\tfunction uninitialize() {\r\n\t\t\t\t\t\tmaskProcessed = false;\r\n\t\t\t\t\t\tunbindEventListeners();\r\n\r\n\t\t\t\t\t\tif(angular.isDefined(originalPlaceholder)) {\r\n\t\t\t\t\t\t\tiElement.attr(\"placeholder\", originalPlaceholder);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tiElement.removeAttr(\"placeholder\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(angular.isDefined(originalMaxlength)) {\r\n\t\t\t\t\t\t\tiElement.attr(\"maxlength\", originalMaxlength);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tiElement.removeAttr(\"maxlength\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tiElement.val(controller.$modelValue);\r\n\t\t\t\t\t\tcontroller.$viewValue = controller.$modelValue;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction initializeElement() {\r\n\t\t\t\t\t\tvalue = oldValueUnmasked = unmaskValue(controller.$modelValue || \"\");\r\n\t\t\t\t\t\tvalueMasked = oldValue = maskValue(value);\r\n\t\t\t\t\t\tisValid = validateValue(value);\r\n\t\t\t\t\t\tif(iAttrs.maxlength) { // Double maxlength to allow pasting new val at end of mask\r\n\t\t\t\t\t\t\tiElement.attr(\"maxlength\", maskCaretMap[maskCaretMap.length - 1] * 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!originalPlaceholder && linkOptions.addDefaultPlaceholder) {\r\n\t\t\t\t\t\t\tiElement.attr(\"placeholder\", maskPlaceholder);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlet viewValue = controller.$modelValue;\r\n\t\t\t\t\t\tlet idx = controller.$formatters.length;\r\n\t\t\t\t\t\twhile(idx--) {\r\n\t\t\t\t\t\t\tviewValue = controller.$formatters[idx](viewValue);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcontroller.$viewValue = viewValue || \"\";\r\n\t\t\t\t\t\tcontroller.$render();\r\n\t\t\t\t\t\t// Not using $setViewValue so we don't clobber the model value and dirty the form\r\n\t\t\t\t\t\t// without any kind of user interaction.\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction bindEventListeners() {\r\n\t\t\t\t\t\tif(eventsBound) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tiElement.bind(\"blur\", blurHandler);\r\n\t\t\t\t\t\tiElement.bind(\"mousedown mouseup\", mouseDownUpHandler);\r\n\t\t\t\t\t\tiElement.bind(\"keydown\", keydownHandler);\r\n\t\t\t\t\t\tiElement.bind(linkOptions.eventsToHandle.join(\" \"), eventHandler);\r\n\t\t\t\t\t\teventsBound = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction unbindEventListeners() {\r\n\t\t\t\t\t\tif(!eventsBound) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tiElement.unbind(\"blur\", blurHandler);\r\n\t\t\t\t\t\tiElement.unbind(\"mousedown\", mouseDownUpHandler);\r\n\t\t\t\t\t\tiElement.unbind(\"mouseup\", mouseDownUpHandler);\r\n\t\t\t\t\t\tiElement.unbind(\"keydown\", keydownHandler);\r\n\t\t\t\t\t\tiElement.unbind(\"input\", eventHandler);\r\n\t\t\t\t\t\tiElement.unbind(\"keyup\", eventHandler);\r\n\t\t\t\t\t\tiElement.unbind(\"click\", eventHandler);\r\n\t\t\t\t\t\tiElement.unbind(\"focus\", eventHandler);\r\n\t\t\t\t\t\teventsBound = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction validateValue(value) {\r\n\t\t\t\t\t\t// Zero-length value validity is ngRequired's determination\r\n\t\t\t\t\t\treturn value.length ? value.length >= minRequiredLength : true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction unmaskValue(value) {\r\n\t\t\t\t\t\tlet valueUnmasked = \"\";\r\n\t\t\t\t\t\tconst input = iElement[0];\r\n\t\t\t\t\t\tconst maskPatternsCopy = maskPatterns.slice();\r\n\t\t\t\t\t\tconst selectionStart = oldCaretPosition;\r\n\t\t\t\t\t\tconst selectionEnd = selectionStart + getSelectionLength(input);\r\n\t\t\t\t\t\tlet valueOffset, tempValue = \"\"; //eslint-disable-line prefer-const\r\n\t\t\t\t\t\t// Preprocess by stripping mask components from value\r\n\t\t\t\t\t\tvalue = value.toString();\r\n\t\t\t\t\t\tvalueOffset = 0;\r\n\t\t\t\t\t\tconst valueDelta = value.length - maskPlaceholder.length;\r\n\t\t\t\t\t\tangular.forEach(maskComponents, function(component) {\r\n\t\t\t\t\t\t\tlet position = component.position;\r\n\t\t\t\t\t\t\t//Only try and replace the component if the component position is not within the selected range\r\n\t\t\t\t\t\t\t//If component was in selected range then it was removed with the user input so no need to try and remove that component\r\n\t\t\t\t\t\t\tif(!(position >= selectionStart && position < selectionEnd)) {\r\n\t\t\t\t\t\t\t\tif(position >= selectionStart) {\r\n\t\t\t\t\t\t\t\t\tposition += valueDelta;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(value.substring(position, position + component.value.length) === component.value) {\r\n\t\t\t\t\t\t\t\t\ttempValue += value.slice(valueOffset, position); // + value.slice(position + component.value.length);\r\n\t\t\t\t\t\t\t\t\tvalueOffset = position + component.value.length;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tvalue = tempValue + value.slice(valueOffset);\r\n\r\n\t\t\t\t\t\tconst valArray = value.split(\"\");\r\n\r\n\t\t\t\t\t\tfor(let i = 0; i < valArray.length; i++) {\r\n\t\t\t\t\t\t\tlet chr = valArray[i];\r\n\r\n\t\t\t\t\t\t\tchr = chr.toUpperCase();\r\n\r\n\t\t\t\t\t\t\tif(maskPatternsCopy.length && maskPatternsCopy[0].test(chr)) {\r\n\t\t\t\t\t\t\t\tif(isSeparator(chr)) {\r\n\t\t\t\t\t\t\t\t\tchr = valArray[i - 1];\r\n\t\t\t\t\t\t\t\t\tvalArray[i] = chr;\r\n\t\t\t\t\t\t\t\t\tvalueUnmasked = `${valueUnmasked.substring(0, valueUnmasked.length - 1)}0`;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tvalueUnmasked += chr;\r\n\t\t\t\t\t\t\t\tmaskPatternsCopy.shift();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn valueUnmasked;\r\n\r\n\t\t\t\t\t\tfunction isSeparator(chr) {\r\n\t\t\t\t\t\t\treturn (chr === \"/\" || chr === \"-\" || chr === \".\" || chr === \":\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction maskValue(unmaskedValue) {\r\n\t\t\t\t\t\tlet valueMasked = \"\",\r\n\t\t\t\t\t\t\tmaskCaretMapCopy = maskCaretMap.slice(); //eslint-disable-line prefer-const\r\n\r\n\t\t\t\t\t\tangular.forEach(maskPlaceholder.split(\"\"), function(chr, i) {\r\n\t\t\t\t\t\t\tif(unmaskedValue.length && i === maskCaretMapCopy[0]) {\r\n\t\t\t\t\t\t\t\tvalueMasked += unmaskedValue.charAt(0) || \"_\";\r\n\t\t\t\t\t\t\t\tunmaskedValue = unmaskedValue.substr(1);\r\n\t\t\t\t\t\t\t\tmaskCaretMapCopy.shift();\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvalueMasked += chr;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\treturn valueMasked;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction getPlaceholderChar(i) {\r\n\t\t\t\t\t\tlet placeholder = angular.isDefined(iAttrs.uiMaskPlaceholder) ? iAttrs.uiMaskPlaceholder : iAttrs.placeholder, //eslint-disable-line prefer-const\r\n\t\t\t\t\t\t\tdefaultPlaceholderChar;\r\n\r\n\t\t\t\t\t\tif(angular.isDefined(placeholder) && placeholder[i]) {\r\n\t\t\t\t\t\t\treturn placeholder[i];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tdefaultPlaceholderChar = angular.isDefined(iAttrs.uiMaskPlaceholderChar) && iAttrs.uiMaskPlaceholderChar ? iAttrs.uiMaskPlaceholderChar : \"_\";\r\n\t\t\t\t\t\t\treturn (defaultPlaceholderChar.toLowerCase() === \"space\") ? \" \" : defaultPlaceholderChar[0];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Generate array of mask components that will be stripped from a masked value\r\n\t\t\t\t\t// before processing to prevent mask components from being added to the unmasked value.\r\n\t\t\t\t\t// E.g., a mask pattern of '+7 9999' won't have the 7 bleed into the unmasked value.\r\n\t\t\t\t\tfunction getMaskComponents() {\r\n\t\t\t\t\t\tlet maskPlaceholderChars = maskPlaceholder.split(\"\"), //eslint-disable-line prefer-const\r\n\t\t\t\t\t\t\tcomponents;\r\n\r\n\t\t\t\t\t\t//maskCaretMap can have bad values if the input has the ui-mask attribute implemented as an obversable property, e.g. the demo page\r\n\t\t\t\t\t\tif(maskCaretMap && !isNaN(maskCaretMap[0])) {\r\n\t\t\t\t\t\t\t//Instead of trying to manipulate the RegEx based on the placeholder characters\r\n\t\t\t\t\t\t\t//we can simply replace the placeholder characters based on the already built\r\n\t\t\t\t\t\t\t//maskCaretMap to underscores and leave the original working RegEx to get the proper\r\n\t\t\t\t\t\t\t//mask components\r\n\t\t\t\t\t\t\tangular.forEach(maskCaretMap, function(value) {\r\n\t\t\t\t\t\t\t\tmaskPlaceholderChars[value] = \"_\";\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconst maskPlaceholderCopy = maskPlaceholderChars.join(\"\"); \r\n\t\t\t\t\t\tcomponents = maskPlaceholderCopy.replace(/[_]+/g, \"_\").split(\"_\");\r\n\t\t\t\t\t\tcomponents = components.filter(function(s) {\r\n\t\t\t\t\t\t\treturn s !== \"\";\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// need a string search offset in cases where the mask contains multiple identical components\r\n\t\t\t\t\t\t// E.g., a mask of 99.99.99-999.99\r\n\t\t\t\t\t\tlet offset = 0;\r\n\t\t\t\t\t\treturn components.map(function(c) {\r\n\t\t\t\t\t\t\tconst componentPosition = maskPlaceholderCopy.indexOf(c, offset);\r\n\t\t\t\t\t\t\toffset = componentPosition + 1;\r\n\t\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t\tvalue: c,\r\n\t\t\t\t\t\t\t\tposition: componentPosition\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction processRawMask(mask) {\r\n\t\t\t\t\t\tlet characterCount = 0;\r\n\r\n\t\t\t\t\t\tmaskCaretMap = [];\r\n\t\t\t\t\t\tmaskPatterns = [];\r\n\t\t\t\t\t\tmaskPlaceholder = \"\";\r\n\r\n\t\t\t\t\t\tif(angular.isString(mask)) {\r\n\t\t\t\t\t\t\tminRequiredLength = 0;\r\n\r\n\t\t\t\t\t\t\tlet isOptional = false,\r\n\t\t\t\t\t\t\t\tnumberOfOptionalCharacters = 0;\r\n\t\t\t\t\t\t\tconst splitMask = mask.split(\"\");\r\n\r\n\t\t\t\t\t\t\tlet inEscape = false;\r\n\t\t\t\t\t\t\tangular.forEach(splitMask, function(chr, i) {\r\n\t\t\t\t\t\t\t\tif(inEscape) {\r\n\t\t\t\t\t\t\t\t\tinEscape = false;\r\n\t\t\t\t\t\t\t\t\tmaskPlaceholder += chr;\r\n\t\t\t\t\t\t\t\t\tcharacterCount++;\r\n\t\t\t\t\t\t\t\t} else if(linkOptions.escChar === chr) {\r\n\t\t\t\t\t\t\t\t\tinEscape = true;\r\n\t\t\t\t\t\t\t\t} else if(linkOptions.maskDefinitions[chr]) {\r\n\t\t\t\t\t\t\t\t\tmaskCaretMap.push(characterCount);\r\n\r\n\t\t\t\t\t\t\t\t\tmaskPlaceholder += getPlaceholderChar(i - numberOfOptionalCharacters);\r\n\t\t\t\t\t\t\t\t\tmaskPatterns.push(linkOptions.maskDefinitions[chr]);\r\n\r\n\t\t\t\t\t\t\t\t\tcharacterCount++;\r\n\t\t\t\t\t\t\t\t\tif(!isOptional) {\r\n\t\t\t\t\t\t\t\t\t\tminRequiredLength++;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tisOptional = false;\r\n\t\t\t\t\t\t\t\t} else if(chr === \"?\") {\r\n\t\t\t\t\t\t\t\t\tisOptional = true;\r\n\t\t\t\t\t\t\t\t\tnumberOfOptionalCharacters++;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tmaskPlaceholder += chr;\r\n\t\t\t\t\t\t\t\t\tcharacterCount++;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Caret position immediately following last position is valid.\r\n\t\t\t\t\t\tmaskCaretMap.push(maskCaretMap.slice().pop() + 1);\r\n\r\n\t\t\t\t\t\tmaskComponents = getMaskComponents();\r\n\t\t\t\t\t\tmaskProcessed = maskCaretMap.length > 1 ? true : false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet prevValue = iElement.val();\r\n\r\n\t\t\t\t\tfunction blurHandler() {\r\n\t\t\t\t\t\tif(linkOptions.clearOnBlur || ((linkOptions.clearOnBlurPlaceholder) && (value.length === 0) && iAttrs.placeholder)) {\r\n\t\t\t\t\t\t\toldCaretPosition = 0;\r\n\t\t\t\t\t\t\toldSelectionLength = 0;\r\n\t\t\t\t\t\t\tif(!isValid || value.length === 0) {\r\n\t\t\t\t\t\t\t\tvalueMasked = \"\";\r\n\t\t\t\t\t\t\t\tiElement.val(\"\");\r\n\t\t\t\t\t\t\t\tscope.$apply(function() {\r\n\t\t\t\t\t\t\t\t\t//only $setViewValue when not $pristine to avoid changing $pristine state.\r\n\t\t\t\t\t\t\t\t\tif(!controller.$pristine) {\r\n\t\t\t\t\t\t\t\t\t\tcontroller.$setViewValue(\"\");\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Check for different value and trigger change.\r\n\t\t\t\t\t\t//Check for different value and trigger change.\r\n\t\t\t\t\t\tif(value !== prevValue) {\r\n\t\t\t\t\t\t\t// #157 Fix the bug from the trigger when backspacing exactly on the first letter (emptying the field)\r\n\t\t\t\t\t\t\t// and then blurring out.\r\n\t\t\t\t\t\t\t// Angular uses html element and calls setViewValue(element.value.trim()), setting it to the trimmed mask\r\n\t\t\t\t\t\t\t// when it should be empty\r\n\t\t\t\t\t\t\tconst currentVal = iElement.val();\r\n\t\t\t\t\t\t\tconst isTemporarilyEmpty = value === \"\" && currentVal && angular.isDefined(iAttrs.uiMaskPlaceholderChar) && iAttrs.uiMaskPlaceholderChar === \"space\";\r\n\t\t\t\t\t\t\tif(isTemporarilyEmpty) {\r\n\t\t\t\t\t\t\t\tiElement.val(\"\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttriggerChangeEvent(iElement[0]);\r\n\t\t\t\t\t\t\tif(isTemporarilyEmpty) {\r\n\t\t\t\t\t\t\t\tiElement.val(currentVal);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tprevValue = value;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction triggerChangeEvent(element) {\r\n\t\t\t\t\t\tlet change;\r\n\t\t\t\t\t\tif(angular.isFunction(window.Event) && !element.fireEvent) {\r\n\t\t\t\t\t\t\t// modern browsers and Edge\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tchange = new Event(\"change\", {\r\n\t\t\t\t\t\t\t\t\tview: window,\r\n\t\t\t\t\t\t\t\t\tbubbles: true,\r\n\t\t\t\t\t\t\t\t\tcancelable: false\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}catch(ex) {\r\n\t\t\t\t\t\t\t\t//this is for certain mobile browsers that have the Event object\r\n\t\t\t\t\t\t\t\t//but don't support the Event constructor #168\r\n\t\t\t\t\t\t\t\tchange = document.createEvent(\"HTMLEvents\");\r\n\t\t\t\t\t\t\t\tchange.initEvent(\"change\", false, true);\r\n\t\t\t\t\t\t\t}finally {\r\n\t\t\t\t\t\t\t\telement.dispatchEvent(change);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if(\"createEvent\" in document) {\r\n\t\t\t\t\t\t\t// older browsers\r\n\t\t\t\t\t\t\tchange = document.createEvent(\"HTMLEvents\");\r\n\t\t\t\t\t\t\tchange.initEvent(\"change\", false, true);\r\n\t\t\t\t\t\t\telement.dispatchEvent(change);\r\n\t\t\t\t\t\t} else if(element.fireEvent) {\r\n\t\t\t\t\t\t\t// IE <= 11\r\n\t\t\t\t\t\t\telement.fireEvent(\"onchange\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction mouseDownUpHandler(e) {\r\n\t\t\t\t\t\tif(e.type === \"mousedown\") {\r\n\t\t\t\t\t\t\tiElement.bind(\"mouseout\", mouseoutHandler);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tiElement.unbind(\"mouseout\", mouseoutHandler);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tiElement.bind(\"mousedown mouseup\", mouseDownUpHandler);\r\n\r\n\t\t\t\t\tfunction mouseoutHandler() {\r\n\t\t\t\t\t\t/*jshint validthis: true */\r\n\t\t\t\t\t\toldSelectionLength = getSelectionLength(this);\r\n\t\t\t\t\t\tiElement.unbind(\"mouseout\", mouseoutHandler);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction keydownHandler(e) {\r\n\t\t\t\t\t\t/*jshint validthis: true */\r\n\t\t\t\t\t\tconst isKeyBackspace = e.which === 8;\r\n\t\t\t\t\t\tlet caretPos = getCaretPosition(this) - 1 || 0; //value in keydown is pre change so bump caret position back to simulate post change\r\n\t\t\t\t\t\tconst isCtrlZ = e.which === 90 && e.ctrlKey; //ctrl+z pressed\r\n\r\n\t\t\t\t\t\tif(isKeyBackspace) {\r\n\t\t\t\t\t\t\twhile(caretPos >= 0) {\r\n\t\t\t\t\t\t\t\tif(isValidCaretPosition(caretPos)) {\r\n\t\t\t\t\t\t\t\t\t//re-adjust the caret position.\r\n\t\t\t\t\t\t\t\t\t//Increment to account for the initial decrement to simulate post change caret position\r\n\t\t\t\t\t\t\t\t\tsetCaretPosition(this, caretPos + 1);\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tcaretPos--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tpreventBackspace = caretPos === -1;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(isCtrlZ) {\r\n\t\t\t\t\t\t\t// prevent IE bug - value should be returned to initial state\r\n\t\t\t\t\t\t\tiElement.val(\"\");\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction eventHandler(e) {\r\n\t\t\t\t\t\t/*jshint validthis: true */\r\n\t\t\t\t\t\te = e || {};\r\n\t\t\t\t\t\t// Allows more efficient minification\r\n\t\t\t\t\t\tconst eventWhich = e.which,\r\n\t\t\t\t\t\t\teventType = e.type;\r\n\r\n\t\t\t\t\t\t// Prevent shift and ctrl from mucking with old values\r\n\t\t\t\t\t\tif(eventWhich === 16 || eventWhich === 91) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst val = iElement.val();\r\n\t\t\t\t\t\tlet caretPos = getCaretPosition(this) || 0;\r\n\r\n\t\t\t\t\t\tconst valOld = oldValue;\r\n\t\t\t\t\t\tlet valMasked,\r\n\t\t\t\t\t\t\tvalAltered = false,\r\n\t\t\t\t\t\t\tvalUnmasked = unmaskValue(val);\r\n\t\t\t\t\t\tconst valUnmaskedOld = oldValueUnmasked;\r\n\t\t\t\t\t\tconst caretPosOld = oldCaretPosition || 0;\r\n\t\t\t\t\t\tconst caretPosDelta = caretPos - caretPosOld;\r\n\t\t\t\t\t\tconst caretPosMin = maskCaretMap[0];\r\n\t\t\t\t\t\tconst caretPosMax = maskCaretMap[valUnmasked.length] || maskCaretMap.slice().shift();\r\n\t\t\t\t\t\tconst selectionLenOld = oldSelectionLength || 0;\r\n\t\t\t\t\t\tconst isSelected = getSelectionLength(this) > 0;\r\n\t\t\t\t\t\tconst wasSelected = selectionLenOld > 0;\r\n\t\t\t\t\t\t// Case: Typing a character to overwrite a selection\r\n\t\t\t\t\t\tconst isAddition = (val.length > valOld.length) || (selectionLenOld && val.length > valOld.length - selectionLenOld);\r\n\t\t\t\t\t\t// Case: Delete and backspace behave identically on a selection\r\n\t\t\t\t\t\tconst isDeletion = (val.length < valOld.length) || (selectionLenOld && val.length === valOld.length - selectionLenOld);\r\n\t\t\t\t\t\tconst isSelection = (eventWhich >= 37 && eventWhich <= 40) && e.shiftKey; // Arrow key codes\r\n\t\t\t\t\t\tconst isKeyLeftArrow = eventWhich === 37;\r\n\t\t\t\t\t\t// Necessary due to \"input\" event not providing a key code\r\n\t\t\t\t\t\tconst isKeyBackspace = eventWhich === 8 || (eventType !== \"keyup\" && isDeletion && (caretPosDelta === -1));\r\n\t\t\t\t\t\tconst isKeyDelete = eventWhich === 46 || (eventType !== \"keyup\" && isDeletion && (caretPosDelta === 0) && !wasSelected);\r\n\t\t\t\t\t\t// Handles cases where caret is moved and placed in front of invalid maskCaretMap position. Logic below\r\n\t\t\t\t\t\t// ensures that, on click or leftward caret placement, caret is moved leftward until directly right of\r\n\t\t\t\t\t\t// non-mask character. Also applied to click since users are (arguably) more likely to backspace\r\n\t\t\t\t\t\t// a character when clicking within a filled input.\r\n\t\t\t\t\t\tconst caretBumpBack = (isKeyLeftArrow || isKeyBackspace || eventType === \"click\") && caretPos > caretPosMin;\r\n\r\n\t\t\t\t\t\toldSelectionLength = getSelectionLength(this);\r\n\r\n\r\n\t\t\t\t\t\t// These events don't require any action\r\n\t\t\t\t\t\tif(isSelection || (isSelected && (eventType === \"click\" || eventType === \"keyup\" || eventType === \"focus\"))) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(isKeyBackspace && preventBackspace) {\r\n\t\t\t\t\t\t\tiElement.val(maskPlaceholder);\r\n\t\t\t\t\t\t\t// This shouldn't be needed but for some reason after aggressive backspacing the controller $viewValue is incorrect.\r\n\t\t\t\t\t\t\t// This keeps the $viewValue updated and correct.\r\n\t\t\t\t\t\t\tscope.$apply(function() {\r\n\t\t\t\t\t\t\t\tcontroller.$setViewValue(\"\"); // $setViewValue should be run in angular context, otherwise the changes will be invisible to angular and user code.\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tsetCaretPosition(this, caretPosOld);\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Value Handling\r\n\t\t\t\t\t\t// ==============\r\n\r\n\t\t\t\t\t\t// User attempted to delete but raw value was unaffected--correct this grievous offense\r\n\t\t\t\t\t\tif((eventType === \"input\") && isDeletion && !wasSelected && valUnmasked === valUnmaskedOld) {\r\n\t\t\t\t\t\t\twhile(isKeyBackspace && caretPos > caretPosMin && !isValidCaretPosition(caretPos)) {\r\n\t\t\t\t\t\t\t\tcaretPos--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\twhile(isKeyDelete && caretPos < caretPosMax && maskCaretMap.indexOf(caretPos) === -1) {\r\n\t\t\t\t\t\t\t\tcaretPos++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconst charIndex = maskCaretMap.indexOf(caretPos);\r\n\t\t\t\t\t\t\t// Strip out non-mask character that user would have deleted if mask hadn't been in the way.\r\n\t\t\t\t\t\t\tvalUnmasked = valUnmasked.substring(0, charIndex) + valUnmasked.substring(charIndex + 1);\r\n\r\n\t\t\t\t\t\t\t// If value has not changed, don't want to call $setViewValue, may be caused by IE raising input event due to placeholder\r\n\t\t\t\t\t\t\tif(valUnmasked !== valUnmaskedOld)\r\n\t\t\t\t\t\t\t\tvalAltered = true;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Update values\r\n\t\t\t\t\t\tvalMasked = maskValue(valUnmasked); //eslint-disable-line prefer-const\r\n\r\n\t\t\t\t\t\toldValue = valMasked;\r\n\t\t\t\t\t\toldValueUnmasked = valUnmasked;\r\n\r\n\t\t\t\t\t\t//additional check to fix the problem where the viewValue is out of sync with the value of the element.\r\n\t\t\t\t\t\t//better fix for commit 2a83b5fb8312e71d220a497545f999fc82503bd9 (I think)\r\n\t\t\t\t\t\tif(!valAltered && val.length > valMasked.length)\r\n\t\t\t\t\t\t\tvalAltered = true;\r\n\r\n\t\t\t\t\t\tiElement.val(valMasked);\r\n\r\n\t\t\t\t\t\t//we need this check. What could happen if you don't have it is that you'll set the model value without the user\r\n\t\t\t\t\t\t//actually doing anything. Meaning, things like pristine and touched will be set.\r\n\t\t\t\t\t\tif(valAltered) {\r\n\t\t\t\t\t\t\tscope.$apply(function() {\r\n\t\t\t\t\t\t\t\tcontroller.$setViewValue(valMasked); // $setViewValue should be run in angular context, otherwise the changes will be invisible to angular and user code.\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Caret Repositioning\r\n\t\t\t\t\t\t// ===================\r\n\r\n\t\t\t\t\t\t// Ensure that typing always places caret ahead of typed character in cases where the first char of\r\n\t\t\t\t\t\t// the input is a mask char and the caret is placed at the 0 position.\r\n\t\t\t\t\t\tif(isAddition && (caretPos <= caretPosMin)) {\r\n\t\t\t\t\t\t\tcaretPos = caretPosMin + 1;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(caretBumpBack) {\r\n\t\t\t\t\t\t\tcaretPos--;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Make sure caret is within min and max position limits\r\n\t\t\t\t\t\tcaretPos = caretPos > caretPosMax ? caretPosMax : caretPos < caretPosMin ? caretPosMin : caretPos;\r\n\r\n\t\t\t\t\t\t// Scoot the caret back or forth until it's in a non-mask position and within min/max position limits\r\n\t\t\t\t\t\twhile(!isValidCaretPosition(caretPos) && caretPos > caretPosMin && caretPos < caretPosMax) {\r\n\t\t\t\t\t\t\tcaretPos += caretBumpBack ? -1 : 1;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif((caretBumpBack && caretPos < caretPosMax) || (isAddition && !isValidCaretPosition(caretPosOld))) {\r\n\t\t\t\t\t\t\tcaretPos++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\toldCaretPosition = caretPos;\r\n\t\t\t\t\t\tsetCaretPosition(this, caretPos);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction isValidCaretPosition(pos) {\r\n\t\t\t\t\t\treturn maskCaretMap.indexOf(pos) > -1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction getCaretPosition(input) {\r\n\t\t\t\t\t\tif(!input)\r\n\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\tif(input.selectionStart !== undefined) {\r\n\t\t\t\t\t\t\treturn input.selectionStart;\r\n\t\t\t\t\t\t} else if(document.selection) {\r\n\t\t\t\t\t\t\tif(isFocused(iElement[0])) {\r\n\t\t\t\t\t\t\t\t// Curse you IE\r\n\t\t\t\t\t\t\t\tinput.focus();\r\n\t\t\t\t\t\t\t\tconst selection = document.selection.createRange();\r\n\t\t\t\t\t\t\t\tselection.moveStart(\"character\", input.value ? -input.value.length : 0);\r\n\t\t\t\t\t\t\t\treturn selection.text.length;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction setCaretPosition(input, pos) {\r\n\t\t\t\t\t\tif(!input)\r\n\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\tif(input.offsetWidth === 0 || input.offsetHeight === 0) {\r\n\t\t\t\t\t\t\treturn; // Input's hidden\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(input.setSelectionRange) {\r\n\t\t\t\t\t\t\tif(isFocused(iElement[0])) {\r\n\t\t\t\t\t\t\t\tinput.focus();\r\n\t\t\t\t\t\t\t\tinput.setSelectionRange(pos, pos);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if(input.createTextRange) {\r\n\t\t\t\t\t\t\t// Curse you IE\r\n\t\t\t\t\t\t\tconst range = input.createTextRange();\r\n\t\t\t\t\t\t\trange.collapse(true);\r\n\t\t\t\t\t\t\trange.moveEnd(\"character\", pos);\r\n\t\t\t\t\t\t\trange.moveStart(\"character\", pos);\r\n\t\t\t\t\t\t\trange.select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction getSelectionLength(input) {\r\n\t\t\t\t\t\tif(!input)\r\n\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\tif(input.selectionStart !== undefined) {\r\n\t\t\t\t\t\t\treturn (input.selectionEnd - input.selectionStart);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(window.getSelection) {\r\n\t\t\t\t\t\t\treturn (window.getSelection().toString().length);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(document.selection) {\r\n\t\t\t\t\t\t\treturn (document.selection.createRange().text.length);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf\r\n\t\t\t\t\tif(!Array.prototype.indexOf) {\r\n\t\t\t\t\t\tArray.prototype.indexOf = function(searchElement /*, fromIndex */) {\r\n\t\t\t\t\t\t\tif(this === null) {\r\n\t\t\t\t\t\t\t\tthrow new TypeError();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconst t = Object(this);\r\n\t\t\t\t\t\t\tconst len = t.length >>> 0;\r\n\t\t\t\t\t\t\tif(len === 0) {\r\n\t\t\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tlet n = 0;\r\n\t\t\t\t\t\t\tif(arguments.length > 1) {\r\n\t\t\t\t\t\t\t\tn = Number(arguments[1]);\r\n\t\t\t\t\t\t\t\tif(n !== n) { // shortcut for verifying if it's NaN\r\n\t\t\t\t\t\t\t\t\tn = 0;\r\n\t\t\t\t\t\t\t\t} else if(n !== 0 && n !== Infinity && n !== -Infinity) {\r\n\t\t\t\t\t\t\t\t\tn = (n > 0 || -1) * Math.floor(Math.abs(n));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(n >= len) {\r\n\t\t\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tlet k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);\r\n\t\t\t\t\t\t\tfor(; k < len; k++) {\r\n\t\t\t\t\t\t\t\tif(k in t && t[k] === searchElement) {\r\n\t\t\t\t\t\t\t\t\treturn k;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t};\r\n\t}]).name;\r\n","import { debounce } from \"lodash\";\r\nimport { SELECTORS } from \"../constants.js\";\r\n\r\nfunction onTrigger($parse) {\r\n\treturn {\r\n\t\tscope: {\r\n\t\t\tfn: \"&onTrigger\"\r\n\t\t},\r\n\r\n\t\tlink: function(scope, element, attrs) {\r\n\r\n\t\t\tconst onTriggerHandler = debounce(() => scope.$apply(scope.fn()), 200, { \"leading\": true, \"trailing\": false });\r\n\r\n\t\t\telement.on(\"click\", function() {\r\n\t\t\t\tif(\r\n\t\t\t\t\t!$parse(attrs.ignoreClick || \"false\")(scope)\r\n\t\t\t\t) {\r\n\t\t\t\t\tonTriggerHandler();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.on(\"keyup\", function(event) {\r\n\t\t\t\tif(\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t(!$parse(attrs.ignoreSpace || \"false\")(scope) && event.keyCode == 32) //if not space is ignored and key is space\r\n\t\t\t\t\t\t|| (!$parse(attrs.ignoreEnter || \"false\")(scope) && event.keyCode == 13) //if not enter is ignored and key is enter\r\n\t\t\t\t\t)\r\n\t\t\t\t) {\r\n\t\t\t\t\tonTriggerHandler();\r\n\r\n\t\t\t\t\tif(attrs.onTriggerFocus) {\r\n\t\t\t\t\t\t//find an element to target \"within\"\r\n\t\t\t\t\t\tconst target = document.querySelector(attrs.onTriggerFocus);\r\n\r\n\t\t\t\t\t\t//find an element within the target that is selectable\r\n\t\t\t\t\t\tconst tabbee = target.querySelector(SELECTORS.TabbableElements);\r\n\r\n\t\t\t\t\t\t//focus it\r\n\t\t\t\t\t\ttabbee.focus();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.on-trigger\", [])\r\n\t.directive(\"onTrigger\", onTrigger).name;\r\n","import { uuid } from \"../index\";\r\n\r\nexport function createDescriptionTextNode(message) {\r\n\t// create the helper element and add content\r\n\tconst messageNode = document.createTextNode(message);\r\n\r\n\tconst helperText = document.createElement(\"span\");\r\n\thelperText.id = `help-text:${uuid()}`;\r\n\thelperText.classList.add(\"sr-only\");\r\n\thelperText.appendChild(messageNode);\r\n\r\n\treturn helperText;\r\n}\r\n","import choices from \"choices.js\";\r\nimport { FUSE_DEFAULTS } from \"../constants\";\r\nimport { createDescriptionTextNode } from \"../utils/accessibility\";\r\nimport { tabbableElements } from \"../utils/selectors\";\r\n\r\nfunction selectBox($timeout, $logger) {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\t\tscope: { label: \"<\", search: \"<\", single: \"<\", setDisplay: \"&\", setBox: \"&\", simple: \"<\", isReadonly: \"<\", onFocus: \"&\", onBlur: \"&\" },\r\n\t\tlink: function(scope, element) {\r\n\t\t\tif(element[0].nodeName !== \"SELECT\") {\r\n\t\t\t\t$logger.error(\"select-box directive added to invalid element\", { nodeName: element[0].nodeName });\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconst box = new choices(element[0], {\r\n\t\t\t\t\titemSelectText: \"\",\r\n\t\t\t\t\tshouldSort: false,\r\n\t\t\t\t\trenderChoiceLimit: 500,\r\n\t\t\t\t\tsearchEnabled: scope.search,\r\n\t\t\t\t\tsearchResultLimit: 100,\r\n\t\t\t\t\tsearchFields: [\"customProperties.searchBy\"],\r\n\t\t\t\t\tplaceholder: false,\r\n\t\t\t\t\tremoveItemButton: true,\r\n\t\t\t\t\tfuseOptions: FUSE_DEFAULTS,\r\n\t\t\t\t\tcallbackOnCreateTemplates: scope.simple ? null : function(template) {\r\n\t\t\t\t\t\tconst classNames = this.config.classNames;\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tchoice: (data) => {\r\n\t\t\t\t\t\t\t\tif(data.placeholder) {\r\n\t\t\t\t\t\t\t\t\treturn template(\r\n\t\t\t\t\t\t\t\t\t\t`
\r\n\t\t\t\t\t\t\t\t\t\t\t${data.label}\r\n\t\t\t\t\t\t\t\t\t\t
`);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// aria-label=\"Pick ${scope.single ? \"a\" : \"\"} ${scope.label}\"\r\n\r\n\t\t\t\t\t\t\t\treturn template(\r\n\t\t\t\t\t\t\t\t\t`
\r\n\t\t\t\t\t\t\t\t\t\t\t${data.label}\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t`);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\titem: (data) => {\r\n\t\t\t\t\t\t\t\tlet itemDisplay = scope?.setDisplay({ value: data.value }) ?? data.label;\r\n\r\n\t\t\t\t\t\t\t\tif(data.customProperties?.isActive !== undefined && !data.customProperties.isActive) {\r\n\t\t\t\t\t\t\t\t\titemDisplay = `${itemDisplay} - Deleted`;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tconst remove = this.config.removeItemButton ?\r\n\t\t\t\t\t\t\t\t\t'' :\r\n\t\t\t\t\t\t\t\t\t\"\";\r\n\r\n\t\t\t\t\t\t\t\treturn template(`\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t${itemDisplay}${remove}\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t`);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(scope.isReadonly) {\r\n\t\t\t\t\tbox.disable();\r\n\t\t\t\t}\r\n\r\n\t\t\t\thookupSameChoiceChangePrevention(box);\r\n\r\n\t\t\t\tscope.setBox({ box });\r\n\r\n\t\t\t\thookupPickOnTab(box);\r\n\r\n\t\t\t\thookupMultiSelectInputBehavior(box);\r\n\r\n\t\t\t\thookupReadOnlyBehavior(scope, box);\r\n\r\n\t\t\t\thookupFocusAndBlur(scope, box);\r\n\r\n\t\t\t\taddAccessibilityHelpers(scope, box);\r\n\r\n\t\t\t\tscope.$on(\"$destroy\", function() {\r\n\t\t\t\t\tbox.containerOuter.onfocus = null;\r\n\t\t\t\t\tbox.containerOuter.onblur = null;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tfunction hookupSameChoiceChangePrevention(box) {\r\n\t\tconst originalSetValueByChoice = box.setValueByChoice.bind(box);\r\n\r\n\t\tbox.setValueByChoice = function(choice) {\r\n\t\t\tconst currentValue = box.getValue();\r\n\t\t\tif(choice == currentValue?.value) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\toriginalSetValueByChoice(choice);\r\n\t\t};\r\n\t}\r\n\r\n\tfunction hookupPickOnTab(box) {\r\n\t\tbox.containerOuter.addEventListener(\"keydown\", (e) => {\r\n\t\t\tif(e.key !== \"Tab\")\r\n\t\t\t\treturn;\r\n\r\n\t\t\tif(!box.containerOuter.classList.contains(\"is-open\"))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tconst choice = box.choiceList.querySelector(\".is-highlighted\")?.dataset?.value;\r\n\t\t\tif(!choice)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tconst current = box.getValue(true);\r\n\t\t\tif(current && current.length && current[0] == choice)\r\n\t\t\t\treturn;\r\n\r\n\t\t\te.preventDefault();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tbox.setValueByChoice(choice);\r\n\t\t\tbox.passedElement.dispatchEvent(new Event(\"change\"));\r\n\t\t\tbox.hideDropdown();\r\n\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tconst tabbables = tabbableElements();\r\n\t\t\t\tlet index = tabbables.indexOf(box.containerOuter) + 1;\r\n\t\t\t\tif(index == tabbables.length)\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\ttabbables[index].focus();\r\n\t\t\t}, 50);\r\n\t\t});\r\n\t}\r\n\r\n\tfunction hookupReadOnlyBehavior(scope, box) {\r\n\t\tscope.$watch(\r\n\t\t\t() => { return scope.isReadonly; },\r\n\t\t\t(newReadonly) => {\r\n\t\t\t\tif(!newReadonly) {\r\n\t\t\t\t\tbox.enable();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tbox.disable();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n\r\n\tfunction hookupMultiSelectInputBehavior(box) {\r\n\t\tif(box.isSelectMultipleElement) {\r\n\t\t\tbox.passedElement.addEventListener(\"change\", () => {\r\n\t\t\t\tif(box.currentState.choices.length === 0) {\r\n\t\t\t\t\tbox.input.classList.add(\"hidden\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tbox.input.classList.remove(\"hidden\");\r\n\t\t\t\t\tbox.input.style.width = \"\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfunction addAccessibilityHelpers(scope, box) {\r\n\t\tbox.input.ariaLabel = `Pick ${scope.single ? \"a\" : \"\"}${scope.label}`;\r\n\r\n\t\tconst helperText = createDescriptionTextNode(\"Press escape to clear field\");\r\n\t\tbox.containerOuter.appendChild(helperText);\r\n\t\tbox.containerOuter.setAttribute(\"aria-describedby\", helperText.id);\r\n\t\tbox.containerOuter.addEventListener(\"keydown\", (e) => {\r\n\t\t\tif(e.key === \"Escape\") {\r\n\t\t\t\tif(!box.containerOuter.classList.contains(\"is-open\")) {\r\n\t\t\t\t\tbox.removeItemsByValue(box.getValue(true));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction hookupFocusAndBlur(scope, box) {\r\n\t\tconst focus = function(event) {\r\n\t\t\tscope.onFocus({ \"$event\": event });\r\n\t\t\t$timeout(() => {\r\n\t\t\t\tscope.$apply();\r\n\t\t\t});\r\n\t\t};\r\n\t\tbox.containerOuter.onfocus = focus;\r\n\t\tbox.input.onfocus = focus;\r\n\r\n\t\t//apply blur methods\r\n\t\tconst blur = function(event) {\r\n\t\t\tscope.onBlur({ \"$event\": event });\r\n\r\n\t\t\t$timeout(() => {\r\n\t\t\t\tscope.$apply();\r\n\t\t\t});\r\n\t\t};\r\n\t\tbox.containerOuter.onblur = blur;\r\n\t\tbox.input.onblur = blur;\r\n\t}\r\n}\r\nexport default angular\r\n\t.module(\"vesl.behaviors.select-box\", [])\r\n\t.directive(\"selectBox\", selectBox).name;\r\n","import { SELECTORS } from \"../../constants\";\r\n\r\nexport function tabbableElements(containedWithin) {\r\n\tcontainedWithin = containedWithin ?? document;\r\n\r\n\treturn Array.from(containedWithin.querySelectorAll(SELECTORS.TabbableElements))\r\n\t\t.filter(element => !element.hasAttribute(\"tabindex\") || element.getAttribute(\"tabindex\") != -1) //remove tabindex=-1 from usually tabbables\r\n\t\t.filter(element => !!element.offsetParent); //remove non-displayed/pseudo elements https://stackoverflow.com/a/53068496\r\n}","function selectOnFocus($window) {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\t\tlink(scope, element) {\r\n\t\t\telement.on(\"focus\", setSelection);\r\n\t\t\tscope.$on(\"$destroy\", () => {\r\n\t\t\t\telement.off(\"focus\", setSelection);\r\n\t\t\t});\r\n\r\n\t\t\tfunction setSelection() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif(!$window.getSelection().toString()) {\r\n\t\t\t\t\t\tthis.setSelectionRange(0, this.value.length);\r\n\t\t\t\t\t}\r\n\t\t\t\t}catch(e) {}//eslint-disable-line no-empty\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.select-on-focus\", [])\r\n\t.directive(\"selectOnFocus\", selectOnFocus).name;\r\n","export default angular.module(\"vesl.behaviors.programmatic-submit\", []).directive(\"form\", function() {\r\n\treturn {\r\n\t\trequire: \"form\",\r\n\t\trestrict: \"E\",\r\n\t\tlink: function(scope, elem, attrs, formController) {\r\n\t\t\tformController.$submit = function() {\r\n\t\t\t\tformController.$setSubmitted();\r\n\t\t\t\tscope.$eval(attrs.ngSubmit);\r\n\t\t\t};\r\n\t\t}\r\n\t};\r\n}).name;","import { SELECTORS } from \"../constants.js\";\r\n\r\nfunction trapFocus() {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\r\n\t\tlink: function(scope, element) {\r\n\r\n\t\t\telement.on(\"keyup\", function(event) {\r\n\t\t\t\tif(event.code === \"Tab\") {\r\n\r\n\t\t\t\t\tconst children = element[0].querySelectorAll(SELECTORS.TabbableElements);\r\n\t\t\t\t\tconst first = children[0];\r\n\t\t\t\t\tconst last = children[children.length - 1];\r\n\r\n\t\t\t\t\tconst onFirstWithShift = event.target === first && event.shiftKey;\r\n\t\t\t\t\tconst onLastNoShift = event.target === last && !event.shiftKey;\r\n\r\n\t\t\t\t\tif(onFirstWithShift || onLastNoShift) {\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.on(\"keydown\", function(event) {\r\n\t\t\t\tif(event.code === \"Tab\") {\r\n\r\n\t\t\t\t\tconst children = element[0].querySelectorAll(SELECTORS.TabbableElements);\r\n\t\t\t\t\tconst first = children[0];\r\n\t\t\t\t\tconst last = children[children.length - 1];\r\n\r\n\t\t\t\t\tif(event.target === first && event.shiftKey) {\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t\tlast.focus();\r\n\t\t\t\t\t} else if(event.target === last && !event.shiftKey) {\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t\tfirst.focus();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.trap-focus\", [])\r\n\t.directive(\"trapFocus\", trapFocus).name;\r\n","function veslNoUnicode(toastr) {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\t\trequire: \"ngModel\",\r\n\t\tlink(scope, element) {\r\n\t\t\telement.on(\"keyup paste\", function(e) {\r\n\t\t\t\tconst pastedData = (e.clipboardData && e.clipboardData.getData(\"text\")) || null;\r\n\t\t\t\tif(!/^[ -~]*$/.test(pastedData)) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\ttoastr && toastr.error(`The following unicode characters can not be pasted: ${pastedData.match(/[^ -~]/g).join(\"\")}`);\r\n\t\t\t\t}\r\n\t\t\t\tconst content = this.value;\r\n\t\t\t\tif(!/^[ -~]*$/.test(content))\r\n\t\t\t\t\t//regex matches all ASCII characters except for backspace\r\n\t\t\t\t\tthis.value = content.replace(/[^ -~]/g, \"\");\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.behaviors.vesl-no-unicode\", []).directive(\"veslNoUnicode\", veslNoUnicode).name;\r\n","function windowResize() {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\t\tlink: function(scope) {\r\n\t\t\tscope.$watch(() => {\r\n\t\t\t\treturn window.innerWidth;\r\n\t\t\t}\r\n\t\t\t, (oldWidth, newWidth) => {\r\n\t\t\t\tscope.$ctrl.isMobile = (newWidth < 768) ? true : false;\r\n\r\n\t\t\t\tif(oldWidth > 768 && newWidth <= 768 && scope.$ctrl.windowResizeMobileCallback) {\r\n\t\t\t\t\tscope.$ctrl.windowResizeMobileCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(oldWidth < 768 && newWidth >= 768 && scope.$ctrl.windowResizeDesktopCallback) {\r\n\t\t\t\t\tscope.$ctrl.windowResizeDesktopCallback();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t);\r\n\r\n\t\t\tconst resizeBind = function() { scope.$apply(); };\r\n\r\n\t\t\tangular.element(window).bind(\"resize\", resizeBind);\r\n\r\n\t\t\tscope.$on(\"$destroy\", function() {\r\n\t\t\t\tangular.element(window).unbind(\"resize\", resizeBind);\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.window-resize\", [])\r\n\t.directive(\"windowResize\", windowResize).name;\r\n","// modifies uibModalWindow, to make it also add aria attributes automagically\r\nfunction uibModalWindow($timeout) {\r\n\treturn {\r\n\t\tlink: function(scope, element) {\r\n\t\t\t$timeout(function() {\r\n\t\t\t\tconst modal = element[0];\r\n\t\t\t\tsetDefaultAttr(modal, \"aria-modal\", \"true\");\r\n\t\t\t\tsetDefaultAttr(modal, \"aria-labelledby\", getHeaderId(modal));\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\t// this wraps the setAttribute function to avoid overriding manually pre-existing attributes\r\n\tfunction setDefaultAttr(element, attributeName, value) {\r\n\t\tif(!element.getAttribute(attributeName)) {\r\n\t\t\telement.setAttribute(attributeName, value);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getHeaderId(element) {\r\n\t\t// searches for first valid header tag so as to not assume that future tags will be h4\r\n\t\tconst validHeaderTags = \"h1, h2, h3, h4, h5, h6\";\r\n\t\tconst id = element.querySelector(validHeaderTags).id;\r\n\t\treturn id;\r\n\t}\r\n}\r\nexport default angular\r\n\t.module(\"vesl.behaviors.uib-modal-window\", [])\r\n\t.directive(\"uibModalWindow\", uibModalWindow).name;\r\n","import { createDescriptionTextNode } from \"../utils/accessibility\";\r\n\r\n// modifies uibTooltip, to make it also add aria attributes automagically\r\nfunction uibTooltip() {\r\n\treturn {\r\n\t\tlink: function(scope, element, attrs) {\r\n\t\t\tconst trigger = element[0];\r\n\t\t\tif(!attrs.ariaLabel) {\r\n\t\t\t\tconst description = createDescriptionTextNode(attrs.uibTooltip);\r\n\t\t\t\ttrigger.parentNode.insertBefore(description, trigger);\r\n\t\t\t\ttrigger.setAttribute(\"aria-describedby\", description.id);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t};\r\n}\r\nexport default angular\r\n\t.module(\"vesl.behaviors.uib-tooltip\", [])\r\n\t.directive(\"uibTooltip\", uibTooltip).name;\r\n","function onEscape() {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\r\n\t\tscope: {\r\n\t\t\tfn: \"&onEscape\"\r\n\t\t},\r\n\t\t// https://embed.plnkr.co/plunk/CpsjpK\r\n\r\n\t\tlink: function(scope, elem) {\r\n\t\t\telem.on(\"keydown\", function(e) {\r\n\t\t\t\tif(e.code === \"Escape\") {\r\n\t\t\t\t\tscope.fn();\r\n\t\t\t\t\tscope.$apply();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.on-escape\", [])\r\n\t.directive(\"onEscape\", onEscape).name;\r\n","const SCROLL_EVENTS = \"mousewheel DOMMouseScroll\";\r\n\r\nconst preventScrollListener = e => e.preventDefault();\r\n\r\nfunction preventScroll() {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\r\n\t\tscope: {\r\n\t\t\tfn: \"&preventScroll\"\r\n\t\t},\r\n\r\n\t\tlink: function(scope, elem) {\r\n\t\t\telem.bind(SCROLL_EVENTS, preventScrollListener);\r\n\t\t},\r\n\r\n\t\tunlink: function(scope, elem) {\r\n\t\t\telem.unbind(SCROLL_EVENTS, preventScrollListener);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.prevent-scroll\", [])\r\n\t.directive(\"preventScroll\", preventScroll).name;\r\n","export const checkAuthorization = (securityService, {\r\n\tauthorizePattern, \r\n\tauthorizeAction, \r\n\tauthorizeActionOrPattern, \r\n\tauthorizeActionScope \r\n}) => {\r\n\r\n\tlet isAllowed = false;\r\n\r\n\tif(authorizePattern !== undefined) {\r\n\t\tisAllowed = securityService.isPatternAllowed(authorizePattern);\r\n\t}\r\n\telse if(authorizeAction!== undefined) {\r\n\t\tisAllowed = securityService.isActionAllowed(authorizeAction);\r\n\t}\r\n\telse if(authorizeActionOrPattern !== undefined) {\r\n\t\tisAllowed = securityService.isActionOrPatternAllowed(authorizeActionOrPattern);\r\n\t}\r\n\telse if(authorizeActionScope !== undefined) {\r\n\t\tisAllowed = securityService.isActionScopeAllowed(authorizeActionScope);\r\n\t}\r\n\r\n\treturn isAllowed;\r\n};","import { checkAuthorization } from \"./authorize\";\r\n\r\nfunction authorize($injector) {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\t\tmultiElement: true,\r\n\t\tscope: {\r\n\t\t\tauthorizePattern: \"<\",\r\n\t\t\tauthorizeAction: \"<\",\r\n\t\t\tauthorizeActionOrPattern: \"<\",\r\n\t\t\tauthorizeActionScope: \"<\"\r\n\t\t},\r\n\t\tlink: function(scope, element) {\r\n\t\t\tconst securityService = $injector.get(\"securityService\");\r\n\r\n\t\t\tconst isAllowed = checkAuthorization(securityService, {\r\n\t\t\t\tauthorizePattern: scope.authorizePattern, \r\n\t\t\t\tauthorizeAction: scope.authorizeAction, \r\n\t\t\t\tauthorizeActionOrPattern: scope.authorizeActionOrPattern, \r\n\t\t\t\tauthorizeActionScope: scope.authorizeActionScope \r\n\t\t\t});\r\n\r\n\t\t\tif(isAllowed === false) {\r\n\t\t\t\telement.remove();\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction notAuthorized($injector) {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\t\tmultiElement: true,\r\n\t\tscope: {\r\n\t\t\tauthorizePattern: \"<\",\r\n\t\t\tauthorizeAction: \"<\",\r\n\t\t\tauthorizeActionOrPattern: \"<\",\r\n\t\t\tauthorizeActionScope: \"<\"\r\n\t\t},\r\n\t\tlink: function(scope, element) {\r\n\t\t\tconst securityService = $injector.get(\"securityService\");\r\n\r\n\t\t\tconst isAllowed = checkAuthorization(securityService, {\r\n\t\t\t\tauthorizePattern: scope.authorizePattern, \r\n\t\t\t\tauthorizeAction: scope.authorizeAction, \r\n\t\t\t\tauthorizeActionOrPattern: scope.authorizeActionOrPattern, \r\n\t\t\t\tauthorizeActionScope: scope.authorizeActionScope \r\n\t\t\t});\r\n\r\n\t\t\tif(isAllowed === true) {\r\n\t\t\t\telement.remove();\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nconst authorizeAttribute = angular\r\n\t.module(\"vesl.behaviors.authorize.directive\", [])\r\n\t.directive(\"authorize\", authorize)\r\n\t.directive(\"unauthorized\", notAuthorized)\r\n\t.directive(\"ifAuthorized\", authorize)\r\n\t.directive(\"ifUnauthorized\", notAuthorized)\r\n\t.name;\r\n\r\nexport { authorizeAttribute };\r\n","import { checkAuthorization } from \"./authorize\";\r\n\r\nconst bindings = {\r\n\tpattern: \"<\",\r\n\taction: \"<\",\r\n\tactionOrPattern: \"<\",\r\n\tactionScope: \"<\"\r\n};\r\n\r\nconst controller = function(securityService) {\r\n\tthis.isAllowed = false;\r\n\r\n\tthis.check = () => {\r\n\t\tthis.isAllowed = checkAuthorization(securityService, {\r\n\t\t\tauthorizePattern: this.pattern, \r\n\t\t\tauthorizeAction: this.action, \r\n\t\t\tauthorizeActionOrPattern: this.actionOrPattern, \r\n\t\t\tauthorizeActionScope: this.actionScope \r\n\t\t});\r\n\t};\r\n\r\n\tthis.$onChanges = (changes) => {\r\n\t\tif(changes.pattern || changes.action || changes.actionOrPattern || changes.actionScope) {\r\n\t\t\tthis.check(); \r\n\t\t}\r\n\t};\r\n\r\n\tthis.check();\r\n};\r\n\r\nconst template = `\r\n\t
\r\n\t\t\r\n\t
\r\n`;\r\n\r\nconst authorizeComponent = angular\r\n\t.module(\"vesl.behaviors.authorize.component\", [])\r\n\t.component(\"authorized\", {\r\n\t\tbindings, \r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\ttransclude: true\r\n\t})\r\n\t.name;\r\n\r\nexport { authorizeComponent };\r\n","import i18next, { i18n } from \"i18next\";\r\n\r\nexport type i18NextJson = Record;\r\nexport type LanguageSpecifier = \"en-us\" | \"en-uk\";\r\nexport type ComponentTranslationBundle = Record;\r\n\r\nexport const DEFAULT_NAMESPACE = \"form\";\r\n\r\nexport const ENTITY_TRANSLATION_KEYS = {\r\n\tName: \"Name\",\r\n\tLABELS: {\r\n\t\tName: \"Labels.Name\",\r\n\t\tCode: \"Labels.Code\",\r\n\t\tExternalKey: \"Labels.ExternalKey\",\r\n\t\tClassification: \"Labels.Classification\",\r\n\t\tTimezone: \"Labels.Timezone\"\r\n\t}\r\n};\r\n\r\nexport type ENTITY_TRANSLATION_KEY = keyof(typeof ENTITY_TRANSLATION_KEYS);\r\n\r\nexport class I18NextContext {\r\n\tpublic static Instance = new I18NextContext();\r\n\tpublic i18n: i18n;\r\n\r\n\tconstructor() {\r\n\t}\r\n\r\n\tpublic async init($logger) {\r\n\t\tif(!I18NextContext.Instance.i18n) {\r\n\t\t\tawait i18next.init(\r\n\t\t\t\t{\r\n\t\t\t\t\tresources: {},\r\n\t\t\t\t\tdebug: true,\r\n\t\t\t\t\tfallbackLng: \"en-us\",\r\n\t\t\t\t\tlowerCaseLng: true,\r\n\t\t\t\t\tcleanCode: true,\r\n\t\t\t\t\tdefaultNS: DEFAULT_NAMESPACE\r\n\t\t\t\t}, \r\n\t\t\t\t// eslint-disable-next-line no-console\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tif(err) {\r\n\t\t\t\t\t\t$logger.error(\"i18n resources load error\", { errors: err });\r\n\t\t\t\t\t} \r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$logger.debug(\"i18n resources loaded without errors\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\r\n\t\t\tI18NextContext.Instance.i18n = i18next;\r\n\r\n\t\t\treturn I18NextContext.Instance.i18n;\r\n\t\t}\r\n\t\treturn Promise.resolve(I18NextContext.Instance.i18n);\r\n\t}\r\n\r\n\tpublic translateEntityType = (entityCode: string, translationKey: ENTITY_TRANSLATION_KEY, defaultFallback: string, valueCount: string) => {\r\n\t\tconst key = `types.${entityCode}.${translationKey}`;\r\n\t\tif(this.i18n.exists(key)) {\r\n\t\t\tif(valueCount === undefined) {\r\n\t\t\t\treturn this.i18n.t(key);\r\n\t\t\t}\r\n\r\n\t\t\treturn this.i18n.t(key, { count: parseInt(valueCount, 10) });\r\n\t\t}\r\n\r\n\t\treturn defaultFallback;\r\n\t}\r\n\r\n\tpublic translateKey = (translationKey: ENTITY_TRANSLATION_KEY, defaultFallback: string, valueCount: number) => {\r\n\t\tvalueCount = valueCount ?? 1;\r\n\t\tconst key = `${translationKey}`;\r\n\t\tif(this.i18n.exists(key)) {\r\n\t\t\treturn this.i18n.t(key, { count: valueCount });\r\n\t\t}\r\n\r\n\t\treturn defaultFallback;\r\n\t}\r\n}","import { I18NextContext } from \"../services/i18nService\";\r\n\r\n// usage:\r\n//
Backup Text
\r\n// => if types.DEALER.Code exists\r\n//
{{i18n.t(types.DEALER.Code)}}
\r\n// => if types.DEALER.Code !exists\r\n//
Backup Text
\r\n// also i18n-type can be omitted to get a top level (non-entity) translation\r\n\r\nfunction i18nTranslate($compile) {\r\n\treturn {\r\n\t\trestrict: \"A\", \r\n\t\tscope: {\r\n\t\t\ti18nKey: \"@\", \r\n\t\t\ti18nType: \"@\",\r\n\t\t\ti18nCount: \"@\"\r\n\t\t},\r\n\t\tlink: function(scope, element) {\r\n\t\t\tconst defaultText = element.text() || \"\";\r\n\r\n\t\t\tfunction updateTranslations() {\r\n\t\t\t\tif(scope.i18nType) {\r\n\t\t\t\t\tconst translatedText = I18NextContext.Instance.translateEntityType(scope.i18nType, scope.i18nKey, defaultText, scope.i18nCount);\r\n\t\t\t\t\telement.html(translatedText);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconst translatedText = I18NextContext.Instance.translateKey(scope.i18nKey, defaultText, scope.i18nCount);\r\n\r\n\t\t\t\t\telement.html(translatedText);\r\n\t\t\t\t}\r\n\t\t\t\t$compile(element.contents())(scope.$parent); \r\n\t\t\t}\r\n\r\n\t\t\tupdateTranslations();\r\n\r\n\t\t\tscope.$watch(\"i18nKey\", function() {\r\n\t\t\t\tupdateTranslations();\r\n\t\t\t});\r\n\r\n\t\t\tscope.$watch(\"i18nType\", function() {\r\n\t\t\t\tupdateTranslations();\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.behaviors.i18nTranslate\", [])\r\n\t.directive(\"i18nTranslate\", i18nTranslate).name;\r\n","import autoFocus from \"./auto-focus.js\";\r\nimport ariaFromAttr from \"./aria-from-attr.js\";\r\nimport btnRipple from \"./btn-ripple.js\";\r\nimport compareTo from \"./compare-to.js\";\r\nimport dateTimeInput from \"./date-time-input\";\r\nimport htmlViewer from \"./html-viewer.js\";\r\nimport inputRipple from \"./input-ripple.js\";\r\nimport mask from \"./ui-mask.js\";\r\nimport onTrigger from \"./on-trigger.js\";\r\nimport selectBox from \"./select-box.js\";\r\nimport selectOnFocus from \"./select-on-focus.js\";\r\nimport submit from \"./programmatic-submit.js\";\r\nimport trapFocus from \"./trap-focus.js\";\r\nimport veslNoUnicode from \"./vesl-no-unicode\";\r\nimport windowResize from \"./window-resize\";\r\nimport uibModalWindow from \"./uib-modal-window.js\";\r\nimport uibTooltip from \"./uib-tooltip.js\";\r\nimport onEscape from \"./on-escape.js\";\r\nimport preventScroll from \"./prevent-scroll.js\";\r\nimport { authorizeAttribute } from \"./authorize/authorize-attribute.js\";\r\nimport { authorizeComponent } from \"./authorize/authorize-component.js\";\r\nimport i18n from \"./i18n\";\r\n\r\nconst deps = [\r\n\tautoFocus,\r\n\tariaFromAttr,\r\n\tbtnRipple,\r\n\tcompareTo,\r\n\tdateTimeInput,\r\n\tinputRipple,\r\n\tmask,\r\n\tonTrigger,\r\n\tonEscape,\r\n\thtmlViewer,\r\n\tuibModalWindow,\r\n\tuibTooltip,\r\n\tselectBox,\r\n\tselectOnFocus,\r\n\tsubmit,\r\n\ttrapFocus,\r\n\tpreventScroll,\r\n\tveslNoUnicode,\r\n\twindowResize,\r\n\tauthorizeAttribute,\r\n\tauthorizeComponent,\r\n\ti18n\r\n];\r\n\r\nexport default angular.module(\"vesl.behaviors\", deps).name;\r\n","import template from \"./entity-contacts.html\";\r\nimport \"./entity-contacts.less\";\r\nimport {\r\n\tsome,\r\n\ttrim,\r\n\tkeyBy\r\n} from \"lodash\";\r\nimport {\r\n\tENTITY_CONTACTS_GET,\r\n\tENTITY_CONTACTS_CREATE,\r\n\tENTITY_CONTACTS_UPDATE,\r\n\tENTITY_CONTACTS_DELETE,\r\n\tENTITY_CONTACTS_RESTORE\r\n} from \"routes.js\";\r\nimport { NAME_SUFFIX_LIST } from \"../../../constants\";\r\nimport { globs } from \"../../../services/globs\";\r\nimport {\r\n\tAny, \r\n\tPattern \r\n} from \"../../../services/security/actionScopes\";\r\n\r\n//entity-contacts\r\nexport function controller(\r\n\tappState,\r\n\tapi,\r\n\tloadingService,\r\n\ttoastr,\r\n\t$uibModal\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.openEditOrCreateEntityContactModal = openEditOrCreateEntityContactModal;\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\tctrl.remove = remove;\r\n\tctrl.shouldDisplayContact = shouldDisplayContact;\r\n\tctrl.restore = restore;\r\n\r\n\tctrl.canAddPattern = globs.entityTypes.byType(ctrl.typeConfig.Code).contacts.byCode(\"*\").create;\r\n\tctrl.editPattern = globs.entityTypes.byType(ctrl.typeConfig.Code).contacts.byCode(\"*\").update;\r\n\tctrl.editAction = (code) => globs.entityTypes.byType(ctrl.typeConfig.Code).contacts.byCode(code).update;\r\n\tctrl.reactivateOrDeactivateActionScope = \r\n\t\tnew Any([\r\n\t\t\tnew Pattern(globs.entityTypes.byType(ctrl.typeConfig.Code).contacts.byCode(\"*\").deactivate),\r\n\t\t\tnew Pattern(globs.entityTypes.byType(ctrl.typeConfig.Code).contacts.byCode(\"*\").reactivate)\r\n\t\t]);\r\n\tctrl.canDeactivateAction = (code) => globs.entityTypes.byType(ctrl.typeConfig.Code).contacts.byCode(code).deactivate;\r\n\tctrl.canReactivateAction = (code) => globs.entityTypes.byType(ctrl.typeConfig.Code).contacts.byCode(code).reactivate;\r\n\t\r\n\tctrl.includeInactive = false;\r\n \r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\r\n\t\tctrl.suffixOptions = [{ key: \"\", display: \"\" }].concat(NAME_SUFFIX_LIST.filter((s) => s.show === true));\r\n\t\tctrl.suffixMap = keyBy(NAME_SUFFIX_LIST, (s) => s.key);\r\n\r\n\t\tload();\r\n\t}\r\n\r\n\tfunction shouldDisplayContact(contact) {\r\n\t\treturn ctrl.includeInactive || contact.IsActive;\r\n\t}\r\n\r\n\tasync function load() {\r\n\t\tconst entityContacts = await loadingService.watch(api.get(ENTITY_CONTACTS_GET(ctrl.form.Id, ctrl.entity.Id)));\r\n\r\n\t\tctrl.Contact = null;\r\n\t\tctrl.Contacts = entityContacts.map((contact) => {\r\n\t\t\tcontact.$Id = contact.Contact.Id;\r\n\r\n\t\t\treturn contact;\r\n\t\t});\r\n\r\n\t\tctrl.entity.Contacts = ctrl.Contacts.map(contact => ({\r\n\t\t\tId: contact.Contact.Id,\r\n\t\t\tType: contact.Type,\r\n\t\t\tName: contact.Name,\r\n\t\t\tIsActive: contact.IsActive\r\n\t\t}));\r\n\r\n\t\tctrl.hasInactive = some(ctrl.entity.Contacts, i => !i.IsActive);\r\n\t}\r\n\r\n\tasync function saveContact(selectedFormId, contact) {\r\n\t\tconst request = {\r\n\t\t\tContact: {\r\n\t\t\t\tTitle: contact.Title,\r\n\t\t\t\tFirstName: trim(contact.FirstName),\r\n\t\t\t\tMiddleName: trim(contact.MiddleName) || null,\r\n\t\t\t\tLastName: trim(contact.LastName),\r\n\t\t\t\tSuffix: trim(contact.Suffix) || null,\r\n\t\t\t\tDateOfBirth: contact.DateOfBirth\r\n\t\t\t},\r\n\t\t\tType: {\r\n\t\t\t\tCode: \"CAPTAIN\"\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tconst result = await (ctrl.Contact.Id\r\n\t\t\t? api.put(ENTITY_CONTACTS_UPDATE(selectedFormId, ctrl.entity.Id, ctrl.Contact.Id), request)\r\n\t\t\t: api.post(ENTITY_CONTACTS_CREATE(selectedFormId, ctrl.entity.Id), request));\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\tasync function openEditOrCreateEntityContactModal(contact = { Contact: {} }) {\r\n\t\tctrl.Contact = { ...contact, Contact: { ...contact.Contact } };\r\n\r\n\t\ttry {\r\n\t\t\tconst entityContact = await $uibModal.open({\r\n\t\t\t\tcomponent: \"entity-contact-modal\",\r\n\t\t\t\tsize: \"sm\",\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tcontact: () => ctrl.Contact.Contact,\r\n\t\t\t\t\tisReadonly: () => !ctrl.permissions.Actions.CanAdd && !ctrl.permissions.Actions.CanEdit\r\n\t\t\t\t}\r\n\t\t\t}).result;\r\n\r\n\t\t\tawait loadingService.watch(saveContact(ctrl.form.Id, entityContact));\r\n\t\t\t\r\n\t\t\tconst displayName = entityContact.Name ?? `${entityContact.FirstName} ${entityContact.LastName}`;\r\n\t\t\tawait toastr.success(`${displayName} ${ctrl.Contact.Id ? \"updated\" : \"created\"} successfully.`);\r\n\r\n\t\t\tawait load();\r\n\t\t}catch(err) {\r\n\t\t\t// no response needed here\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tasync function remove(contact) {\r\n\t\tawait loadingService.watch(api.put(ENTITY_CONTACTS_DELETE(ctrl.form.Id, ctrl.entity.Id, contact.Id)));\r\n\t\tawait toastr.success(`${contact.Name} deleted successfully.`);\r\n\r\n\t\tawait load();\r\n\t}\r\n\r\n\tasync function restore(contact) {\r\n\t\tawait loadingService.watch(api.put(ENTITY_CONTACTS_RESTORE(ctrl.form.Id, ctrl.entity.Id, contact.Id)));\r\n\t\tawait toastr.success(`${contact.Name} restored successfully.`);\r\n\r\n\t\tawait load();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.entity-contacts\", [])\r\n\t.component(\"entityContacts\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tentity: \"=\",\r\n\t\t\tpermissions: \"<\",\r\n\t\t\ttypeConfig: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t No contacts associated to this {{$ctrl.typeConfig.Name}} \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Add Contact \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t
Name
{{contact.Name}}
\\r\\n
\";","import template from \"./entity-contact.html\";\r\nimport \"./entity-contact.less\";\r\nimport { keyBy } from \"lodash\";\r\nimport {\r\n\tNAME_SUFFIX_LIST,\r\n\tNAME_TITLE_LIST\r\n} from \"../../../constants\";\r\nimport moment from \"moment\";\r\n\r\n//entity-contacts\r\n\r\nexport function controller(\r\n\tappState,\r\n\tloadingService\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\r\n\tctrl.$onInit = onInit;\r\n\r\n\tctrl.format = \"MM/dd/yyyy\";\r\n\tctrl.dateOptions = {\r\n\t\tformatYear: \"yyyy\",\r\n\t\tstartingDay: 0,\r\n\t\tminDate: new Date(\"01/01/1920\")\r\n\t};\r\n\tctrl.altInputFormats = [\r\n\t\t\"d!-M!-yyyy\", \"d!-M!-yy\",\r\n\t\t\"d!/M!/yyyy\", \"d!/M!/yy\",\r\n\t\t\"d!.M!.yyyy\", \"d!.M!.yy\",\r\n\t\t\"shortDate\"\r\n\t];\r\n\tctrl.opened = false;\r\n\tctrl.toggle = () => {\r\n\t\tctrl.opened = !ctrl.opened;\r\n\t};\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.titleOptions = [{ key: \"\", display: \"\" }].concat(NAME_TITLE_LIST);\r\n\r\n\t\tctrl.suffixOptions = [{ key: \"\", display: \"\" }].concat(NAME_SUFFIX_LIST.filter((s) => s.show === true));\r\n\t\tctrl.suffixMap = keyBy(NAME_SUFFIX_LIST, (s) => s.key);\r\n\r\n\t\tif(ctrl.contact.DateOfBirth) {\r\n\t\t\tctrl.birthdate = new Date(ctrl.contact.DateOfBirth);\r\n\t\t}\r\n\t}\r\n\r\n\tctrl.updateBirthday = () => {\r\n\t\tif(!!ctrl.birthdate) {\r\n\t\t\tctrl.contact.DateOfBirth = moment(ctrl.birthdate).format(\"YYYY-MM-DDT00:00:00\");\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.entity-contact\", [])\r\n\t.component(\"entityContact\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tcontact: \"=\",\r\n\t\t\tisReadonly: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tRequired\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tRequired\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\r\\n\";","import template from \"./entity-business.html\";\r\nimport \"./entity-business.less\";\r\n\r\nimport { FORM_ENTITY_BUSINESSES } from \"routes\";\r\n\r\nimport {\r\n\tENTITY_TRANSLATION_KEYS, \r\n\tI18NextContext \r\n} from \"../../../services/i18nService\";\r\nimport { globs } from \"../../../services/globs\";\r\nimport {\r\n\tAll, Pattern \r\n} from \"../../../services/security/actionScopes\";\r\n\r\nexport function controller($logger, api, appState, loadingService, $uibModal, securityService) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.i18n = I18NextContext.Instance;\r\n\tctrl.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\tctrl.business = null;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tloadBusinesses();\r\n\r\n\t\tsetupSecurity();\r\n\t};\r\n\r\n\tctrl.editBusiness = async() => {\r\n\t\tif(ctrl.business === undefined) {\r\n\t\t\tctrl.business = {\r\n\t\t\t\tName: ctrl.entity.Name\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tctrl.business = await $uibModal.open({\r\n\t\t\tcomponent: \"entity-business-modal\",\r\n\t\t\tsize: \"smmd\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\tbusiness: () => ctrl.business,\r\n\t\t\t\tsave: () => saveBusiness\r\n\t\t\t}\r\n\t\t}).result;\r\n\t};\r\n\r\n\tfunction setupSecurity() {\r\n\t\tctrl.canCreateBusinessGlob = globs.business.byType(\"*\").create;\r\n\t\tctrl.canCreateEntityBusinessGlob = globs.entityTypes.byType(ctrl.typeConfig.Code).business.byType(\"*\").create;\r\n\t\tctrl.canCreateActionScope = new All([\r\n\t\t\tnew Pattern(ctrl.canCreateBusinessGlob),\r\n\t\t\tnew Pattern(ctrl.canCreateEntityBusinessGlob)\r\n\t\t]);\r\n\t}\r\n\r\n\tasync function loadBusinesses() {\r\n\t\tconst canReadBuiness = securityService.isPatternAllowed(globs.business.byType(\"*\").read);\r\n\t\tif(!canReadBuiness) {\r\n\t\t\tctrl.business = undefined;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst getBusinesses = api.get(FORM_ENTITY_BUSINESSES(appState.forms.selected.Id, ctrl.entity.Id));\r\n\t\t// returns { IsActive: boolean, Business: Profile }[]\r\n\r\n\t\tconst businesses = await loadingService.watch(getBusinesses);\r\n\r\n\t\t//businesses = businesses.filter(b => b.IsActive);\r\n\r\n\t\tif(businesses.length > 0) {\r\n\t\t\tctrl.business = businesses[0].Business;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tctrl.business = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\tasync function saveBusiness(business) {\r\n\t\tconst saveBusiness = api.post(FORM_ENTITY_BUSINESSES(appState.forms.selected.Id, ctrl.entity.Id), business);\r\n\t\tconst resp = await loadingService.watch(saveBusiness);\r\n\r\n\t\treturn resp;\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-business\", [])\r\n\t.component(\"entityBusiness\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tentity: \"<\",\r\n\t\t\ttypeConfig: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t

\\r\\n\\t\\t\\t\\tYou do not have permission to create a business profile.\\r\\n\\t\\t\\t

\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
Introducing VESL for Business
\\r\\n\\t\\t\\t\\t
\\r\\n\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t

\\r\\n\\t\\t\\t\\t\\tUnlock the full potential of your business with VESL.\\r\\n\\t\\t\\t\\t

\\r\\n\\t\\t\\t\\t

\\r\\n\\t\\t\\t\\t\\tSeamlessly set up your business profile, tax information, product list, and streamline your operations.\\r\\n\\t\\t\\t\\t

\\r\\n\\t\\t\\t\\t

\\r\\n\\r\\n\\t\\t\\t\\t\\tWhen filing with VESL, your business is front and center - allowing you to quickly create and track invoices for your customers, tracking any deductions\\r\\n\\t\\t\\t\\t\\tpreviously\\r\\n\\t\\t\\t\\t\\tentered for your customers, applying applicable tax information from your profile, as efficiently as possible. Allowing you to get back to what matters most -\\r\\n\\t\\t\\t\\t\\tyour\\r\\n\\t\\t\\t\\t\\tcustomer.\\r\\n\\t\\t\\t\\t

\\r\\n\\t\\t\\t\\t

\\r\\n\\t\\t\\t\\t\\tExperience the convenience and power of VESL's Business functionality, designed to simplify your business processes and drive success.\\r\\n\\t\\t\\t\\t

\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\tGet Started Now\\r\\n\\t\\t
\\r\\n\\t\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\";","export const isStringNullishOrEmpty = (str) => str === undefined || str === null || str.trim() === \"\";","import template from \"./entity-business-modal.html\";\r\nimport \"./entity-business-modal.less\";\r\nimport { EVENT_LOGOUT } from \"../../../../constants\";\r\nimport swal from \"sweetalert2\";\r\nimport { isStringNullishOrEmpty } from \"../../../../services/string-service\";\r\nimport cloneDeep from \"clone-deep\";\r\n\r\n// {\r\n// \tName: \"New Business\",\r\n// \tAddresses: [\r\n// \t\t{\r\n// \t\t\tAddressLine1: string; // \"123 Main St\",\r\n// \t\t\tAddressLine2: string; // \"Suite 100\",\r\n// \t\t\tAddressLine3: string; // null,\r\n// \t\t\tLocale: string; // \"Anytown\",\r\n// \t\t\tTerritory: string; //\"CA\",\r\n// \t\t\tCountry: string; // \"USA\",\r\n// \t\t\tPostalCode: string; // 5 digits: \"12345\",\r\n// \t\t\tType: {\r\n// \t\t\t\tCode: \"PHYSICAL\"\r\n// \t\t\t}\r\n// \t\t}\r\n// \t],\r\n// \tPhoneNumbers: [\r\n// \t\t{\r\n// \t\t\tValue: string; // \"+1 8005551234\",\r\n// \t\t\tType: {\r\n// \t\t\t\tCode: \"PRIMARY\"\r\n// \t\t\t}\r\n// \t\t}\r\n// \t]\r\n// }\r\n\r\nexport function controller(appState, loadingService, eventBus, $scope, $logger) {\r\n\tconst ctrl = this;\r\n\tctrl.states = [\r\n\t\t{ value: \"AL\", label: \"Alabama\" },\r\n\t\t{ value: \"AK\", label: \"Alaska\" },\r\n\t\t{ value: \"AZ\", label: \"Arizona\" },\r\n\t\t{ value: \"AR\", label: \"Arkansas\" },\r\n\t\t{ value: \"CA\", label: \"California\" },\r\n\t\t{ value: \"CO\", label: \"Colorado\" },\r\n\t\t{ value: \"CT\", label: \"Connecticut\" },\r\n\t\t{ value: \"DE\", label: \"Delaware\" },\r\n\t\t{ value: \"FL\", label: \"Florida\" },\r\n\t\t{ value: \"GA\", label: \"Georgia\" },\r\n\t\t{ value: \"HI\", label: \"Hawaii\" },\r\n\t\t{ value: \"ID\", label: \"Idaho\" },\r\n\t\t{ value: \"IL\", label: \"Illinois\" },\r\n\t\t{ value: \"IN\", label: \"Indiana\" },\r\n\t\t{ value: \"IA\", label: \"Iowa\" },\r\n\t\t{ value: \"KS\", label: \"Kansas\" },\r\n\t\t{ value: \"KY\", label: \"Kentucky\" },\r\n\t\t{ value: \"LA\", label: \"Louisiana\" },\r\n\t\t{ value: \"ME\", label: \"Maine\" },\r\n\t\t{ value: \"MD\", label: \"Maryland\" },\r\n\t\t{ value: \"MA\", label: \"Massachusetts\" },\r\n\t\t{ value: \"MI\", label: \"Michigan\" },\r\n\t\t{ value: \"MN\", label: \"Minnesota\" },\r\n\t\t{ value: \"MS\", label: \"Mississippi\" },\r\n\t\t{ value: \"MO\", label: \"Missouri\" },\r\n\t\t{ value: \"MT\", label: \"Montana\" },\r\n\t\t{ value: \"NE\", label: \"Nebraska\" },\r\n\t\t{ value: \"NV\", label: \"Nevada\" },\r\n\t\t{ value: \"NH\", label: \"New Hampshire\" },\r\n\t\t{ value: \"NJ\", label: \"New Jersey\" },\r\n\t\t{ value: \"NM\", label: \"New Mexico\" },\r\n\t\t{ value: \"NY\", label: \"New York\" },\r\n\t\t{ value: \"NC\", label: \"North Carolina\" },\r\n\t\t{ value: \"ND\", label: \"North Dakota\" },\r\n\t\t{ value: \"OH\", label: \"Ohio\" },\r\n\t\t{ value: \"OK\", label: \"Oklahoma\" },\r\n\t\t{ value: \"OR\", label: \"Oregon\" },\r\n\t\t{ value: \"PA\", label: \"Pennsylvania\" },\r\n\t\t{ value: \"RI\", label: \"Rhode Island\" },\r\n\t\t{ value: \"SC\", label: \"South Carolina\" },\r\n\t\t{ value: \"SD\", label: \"South Dakota\" },\r\n\t\t{ value: \"TN\", label: \"Tennessee\" },\r\n\t\t{ value: \"TX\", label: \"Texas\" },\r\n\t\t{ value: \"UT\", label: \"Utah\" },\r\n\t\t{ value: \"VT\", label: \"Vermont\" },\r\n\t\t{ value: \"VA\", label: \"Virginia\" },\r\n\t\t{ value: \"WA\", label: \"Washington\" },\r\n\t\t{ value: \"WV\", label: \"West Virginia\" },\r\n\t\t{ value: \"WI\", label: \"Wisconsin\" },\r\n\t\t{ value: \"WY\", label: \"Wyoming\" }\r\n\t];\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\r\n\tctrl.$onDestroy = ctrl.cancel;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.Business = cloneDeep(ctrl.resolve.business ?? {});\r\n\t\teventBus.register(EVENT_LOGOUT, () => { ctrl.cancel(); }, $scope);\r\n\t};\r\n\r\n\tctrl.onOk = async() => {\r\n\t\tconst payload = cloneDeep(ctrl.Business);\r\n\r\n\t\tif(payload.Addresses !== undefined) {\r\n\t\t\tpayload.Addresses = Object.values(payload.Addresses)\r\n\t\t\t\t.filter(a => \r\n\t\t\t\t\t!isStringNullishOrEmpty(a.AddressLine1)\r\n\t\t\t\t\t|| !isStringNullishOrEmpty(a.AddressLine2)\r\n\t\t\t\t\t|| !isStringNullishOrEmpty(a.Locale)\r\n\t\t\t\t\t|| !isStringNullishOrEmpty(a.Territory)\r\n\t\t\t\t\t|| !isStringNullishOrEmpty(a.PostalCode)\r\n\t\t\t\t)\r\n\t\t\t\t.map(a => ({\r\n\t\t\t\t\t...a,\r\n\t\t\t\t\tCountry: \"USA\",\r\n\t\t\t\t\tType: {\r\n\t\t\t\t\t\tCode: \"PHYSICAL\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}));\r\n\t\t}\r\n\r\n\t\tif(payload.PhoneNumbers !== undefined) {\r\n\t\t\tpayload.PhoneNumbers = Object.values(payload.PhoneNumbers)\r\n\t\t\t\t.filter(ph => !isStringNullishOrEmpty(ph.Value))\r\n\t\t\t\t.map(ph => ({\r\n\t\t\t\t\t...ph,\r\n\t\t\t\t\tType: {\r\n\t\t\t\t\t\tCode: \"PRIMARY\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}));\r\n\t\t}\r\n\r\n\t\tif(!validate(payload)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst result = await ctrl.resolve.save(payload);\r\n\t\tctrl.modalInstance.close(result);\r\n\t};\r\n\r\n\tctrl.cancel = () => {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t};\r\n\r\n\tconst validate = (payload) => {\r\n\t\tconst validationStrings = [];\r\n\r\n\t\t$logger.debug(\"b\", payload);\r\n\r\n\t\tif(isStringNullishOrEmpty(payload.Name)) {\r\n\t\t\tvalidationStrings.push(\"Business name is required.\");\r\n\t\t}\r\n\r\n\t\tif(payload.Addresses?.[0]) {\r\n\t\t\tconst address = payload.Addresses[0];\r\n\t\t\tconst matcher = /^[0-9]{5}(-[0-9]{4})?$/;\r\n\r\n\t\t\tif(isStringNullishOrEmpty(address.AddressLine1)) {\r\n\t\t\t\tvalidationStrings.push(\"When an address is provided, line 1 of the address must be provided\");\r\n\t\t\t}\r\n\t\t\tif(isStringNullishOrEmpty(address.Locale)) {\r\n\t\t\t\tvalidationStrings.push(\"When an address is provided, city must be provided\");\r\n\t\t\t}\r\n\t\t\tif(isStringNullishOrEmpty(address.Territory)) {\r\n\t\t\t\tvalidationStrings.push(\"When an address is provided, state must be provided\");\r\n\t\t\t}\r\n\t\t\tif(isStringNullishOrEmpty(address.PostalCode)) {\r\n\t\t\t\tvalidationStrings.push(\"When an address is provided, zip code must be provided\");\r\n\t\t\t}\r\n\t\t\telse if(!matcher.test(address.PostalCode)) {\r\n\t\t\t\tvalidationStrings.push(\"Zip code is an incorrect format.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(payload.PhoneNumbers?.[0]) {\r\n\t\t\tconst phoneNumber = payload.PhoneNumbers[0].Value;\r\n\t\t\tconst matcher = /^\\+1 [0-9]{10}$/;\r\n\r\n\t\t\tif(!matcher.test(phoneNumber)) {\r\n\t\t\t\tvalidationStrings.push(\"Phone number is an incorrect format.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(validationStrings.length > 0) {\r\n\t\t\tconst errorList = `
  • ${validationStrings.join(\"
  • \")}
`;\r\n\t\t\t\r\n\t\t\tswal.fire({\r\n\t\t\t\ttitle: \"Missing required fields\",\r\n\t\t\t\thtml: \r\n\t\t\t\t\t`

Please correct the following errors

\r\n\t\t\t\t\t${errorList}\r\n\t\t\t\t\t`,\r\n\t\t\t\tshowCloseButton: true,\r\n\t\t\t\ttype: \"warning\"\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-business-modal\", [])\r\n\t.component(\"entityBusinessModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\",\r\n\t\t\treload: \"&\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t {{$ctrl.Business.Id ? 'Edit' : 'New'}} Business \\r\\n
\\r\\n
\\r\\n\\t

\\r\\n\\t\\tTo get started, only your business name is required.\\r\\n\\t

\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t

\\r\\n\\t\\tAddress\\r\\n\\t

\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t{{state.label}}\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\tCancel\\r\\n\\t\\t\\t{{$ctrl.Business.Id ? 'Save' : 'Create'}}\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","import template from \"./entity-business-profile.html\";\r\nimport \"./entity-business-profile.less\";\r\n\r\nimport {\r\n\tFORM_ENTITY_BUSINESSES, \r\n\tFORM_BUSINESS \r\n} from \"routes\";\r\n\r\nimport {\r\n\tENTITY_TRANSLATION_KEYS, \r\n\tI18NextContext \r\n} from \"../../../../services/i18nService\";\r\nimport { globs } from \"../../../../services/globs\";\r\n\r\nexport function controller($logger, api, appState, loadingService, $uibModal, toastr) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.i18n = I18NextContext.Instance;\r\n\tctrl.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tloadBusiness();\r\n\t\tctrl.canUpdateBusinessGlob = globs.business.byType(\"*\").update;\r\n\r\n\t\tloadBusiness();\r\n\t};\r\n\r\n\tctrl.editBusiness = async() => {\r\n\t\tif(ctrl.businessProfile === undefined) {\r\n\t\t\tctrl.business = {\r\n\t\t\t\tName: ctrl.entity.Name\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tctrl.businessProfile = await $uibModal.open({\r\n\t\t\tcomponent: \"entity-business-modal\",\r\n\t\t\tsize: \"smmd\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\tbusiness: () => ctrl.businessProfile ?? ctrl.business,\r\n\t\t\t\tsave: () => saveBusiness\r\n\t\t\t}\r\n\t\t}).result;\r\n\t};\r\n\r\n\tasync function saveBusiness(business) {\r\n\t\tlet saveBusiness;\r\n\t\tif(business.Id === undefined) {\r\n\t\t\tsaveBusiness = api.post(FORM_ENTITY_BUSINESSES(appState.forms.selected.Id, ctrl.entity.Id), business);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tsaveBusiness = api.put(FORM_BUSINESS(appState.forms.selected.Id, business.Id), business);\r\n\t\t}\r\n\t\tconst resp = await loadingService.watch(saveBusiness);\r\n\r\n\t\ttoastr.success(\"Business saved successfully\");\r\n\r\n\t\treturn resp;\r\n\t}\r\n\r\n\tasync function loadBusiness() {\r\n\t\tconst business = await loadingService.watch(api.get(FORM_BUSINESS(appState.forms.selected.Id, ctrl.businessProfile.Id)));\r\n\t\t\r\n\t\tctrl.businessProfile = business;\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-business-profile\", [])\r\n\t.component(\"entityBusinessProfile\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tbusinessProfile: \"=\",\r\n\t\t\tentity: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t

\\r\\n\\t\\t\\t\\tProfile\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t

\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\t

Name

\\r\\n\\t\\t\\t\\t\\t\\t
{{$ctrl.businessProfile.Name}}
\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t

Phone

\\r\\n\\t\\t\\t\\t\\t\\t
{{$ctrl.businessProfile.PhoneNumbers[0].Value | formatE164Phone}}
\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t

Address

\\r\\n\\t\\t\\t\\t\\t\\t

{{$ctrl.businessProfile.Addresses[0].AddressLine1}}

\\r\\n\\t\\t\\t\\t\\t\\t

{{$ctrl.businessProfile.Addresses[0].AddressLine2}}

\\r\\n\\t\\t\\t\\t\\t\\t

{{$ctrl.businessProfile.Addresses[0].Locale}}, {{$ctrl.businessProfile.Addresses[0].Territory}},\\r\\n\\t\\t\\t\\t\\t\\t\\t{{$ctrl.businessProfile.Addresses[0].PostalCode}}

\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\r\\n\";","import template from \"./entity-business-charges.html\";\r\nimport \"./entity-business-charges.less\";\r\nimport cloneDeep from \"clone-deep\";\r\n\r\nimport { FORM_BUSINESS_CHARGES } from \"routes\";\r\n\r\nimport {\r\n\tENTITY_TRANSLATION_KEYS, \r\n\tI18NextContext \r\n} from \"../../../../services/i18nService\";\r\nimport { globs } from \"../../../../services/globs\";\r\n\r\n// type FeeTypeDto = { Code: 'PERCENT' | 'FLAT' };\r\n// type FeeDto = {\r\n// Type: FeeTypeDto\r\n// Amount: number //decimal\r\n// IsActive: boolean\r\n// };\r\n\r\nexport function controller($logger, api, loadingService, $uibModal, $scope, securityService, appState) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.i18n = I18NextContext.Instance;\r\n\tctrl.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.canReadBusinessFeesGlob = globs.business.byType(\"*\").fees.byType(\"*\").read;\r\n\t\tctrl.canUpdateBusinessFeeGlob = globs.business.byType(\"*\").fees.byType(\"*\").update;\r\n\t\tctrl.canCreateBusinessFeeGlob = globs.business.byType(\"*\").fees.byType(\"*\").create;\r\n\t\t\r\n\t\t$scope.$watch(() => ctrl.businessId, loadCharges);\r\n\t};\r\n\r\n\tctrl.editCharge = async(charge) => {\r\n\t\tconst chargeUpdate = await $uibModal.open({\r\n\t\t\tcomponent: \"entity-business-charge-modal\",\r\n\t\t\tsize: \"smmd\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\tcharge: () => charge,\r\n\t\t\t\tsave: () => saveCharge\r\n\t\t\t}\r\n\t\t}).result;\r\n\r\n\t\tconst matchindex = ctrl.charges.findIndex(c => c.Code === chargeUpdate.Code);\r\n\t\tif(matchindex !== -1) {\r\n\t\t\tctrl.charges[matchindex] = chargeUpdate;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tctrl.charges.push(chargeUpdate);\r\n\t\t}\r\n\r\n\t\tctrl.availableCharges = cloneDeep(ctrl.charges.filter(c => c.IsActive));\r\n\r\n\t\treturn chargeUpdate;\r\n\t};\r\n\r\n\tasync function saveCharge(charge) {\r\n\t\tconst verb = charge.Code !== undefined ? \"put\" : \"post\";\r\n\t\tconst saveBusiness = api[verb](FORM_BUSINESS_CHARGES(appState.forms.selected.Id, ctrl.businessId), charge, charge.ApplyToCurrentProducts);\r\n\t\tconst resp = await loadingService.watch(saveBusiness);\r\n\r\n\t\treturn resp;\r\n\t}\r\n\r\n\tasync function loadCharges() {\r\n\t\tconst canReadCharges = securityService.isPatternAllowed(ctrl.canReadBusinessFeesGlob);\r\n\t\tif(ctrl.businessId === undefined || !canReadCharges) {\r\n\t\t\tctrl.charges = [];\r\n\t\t\tctrl.availableCharges = [];\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst getCharges = api.get(FORM_BUSINESS_CHARGES(appState.forms.selected.Id, ctrl.businessId));\r\n\t\t\r\n\t\tconst charges = await loadingService.watch(getCharges);\r\n\t\tctrl.charges = charges.filter(c => c.IsActive);\r\n\t\tctrl.availableCharges = cloneDeep(ctrl.charges);\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-business-charges\", [])\r\n\t.component(\"entityBusinessCharges\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tbusinessId: \"<\",\r\n\t\t\tavailableCharges: \"=\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t

\\r\\n\\t\\t\\t\\tTaxes and Fees\\r\\n\\t\\t\\t

\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t Please click the \\\"Add Tax or Fee\\\" button below to add a new tax or fee \\r\\n\\t\\t\\t\\t\\t\\t No charges \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
Name Type Amount
{{charge.Name}} {{charge.Type.Code | capitalize }} {{charge | formatCharge }}
\\r\\n\\t\\t\\t\\t\\t\\t\\tAdd Tax or Fee\\r\\n\\t\\t\\t\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","import template from \"./entity-business-charge-modal.html\";\r\nimport \"./entity-business-charge-modal.less\";\r\nimport { EVENT_LOGOUT } from \"../../../../../constants\";\r\nimport swal from \"sweetalert2\";\r\nimport { isStringNullishOrEmpty } from \"../../../../../services/string-service\";\r\n\r\nexport function controller(loadingService, eventBus, $scope, $logger) {\r\n\tconst ctrl = this;\r\n\tctrl.chargeTypes = [\r\n\t\t{ Code: \"PERCENT\", label: \"Percentage\" },\r\n\t\t{ Code: \"FLAT\", label: \"Flat Rate\" }\r\n\t];\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\r\n\tctrl.$onDestroy = ctrl.cancel;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.charge = { ...ctrl.resolve.charge };\r\n\t\teventBus.register(EVENT_LOGOUT, () => { ctrl.cancel(); }, $scope);\r\n\t};\r\n\r\n\tctrl.onOk = async() => {\r\n\t\tif(!validate()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst result = await ctrl.resolve.save(ctrl.charge);\r\n\t\tctrl.modalInstance.close(result);\r\n\t};\r\n\r\n\tctrl.cancel = () => {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t};\r\n\r\n\tctrl.setTemplate = (templateName) => {\r\n\t\tswitch(templateName) {\r\n\t\t\tcase \"state-sales-tax\": {\r\n\t\t\t\tctrl.charge.Name = \"State Sales Tax\";\r\n\t\t\t\tctrl.charge.Type = ctrl.chargeTypes.find(t => t.Code === \"PERCENT\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase \"county-sales-tax\": {\r\n\t\t\t\tctrl.charge.Name = \"County Sales Tax\";\r\n\t\t\t\tctrl.charge.Type = ctrl.chargeTypes.find(t => t.Code === \"PERCENT\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase \"fee\": {\r\n\t\t\t\tctrl.charge.Name = \"Fee\";\r\n\t\t\t\tctrl.charge.Type = ctrl.chargeTypes.find(t => t.Code === \"FLAT\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t};\r\n\r\n\tconst validate = () => {\r\n\t\tconst validationStrings = [];\r\n\r\n\t\tif(isStringNullishOrEmpty(ctrl.charge.Name)) {\r\n\t\t\tvalidationStrings.push(\"Tax or fee name is required.\");\r\n\t\t}\r\n\r\n\t\tif(isStringNullishOrEmpty(ctrl.charge.Value?.toString())) {\r\n\t\t\tvalidationStrings.push(\"Tax or fee amount is required.\");\r\n\t\t}\r\n\r\n\t\tif(isStringNullishOrEmpty(ctrl.charge.Type?.Code)) {\r\n\t\t\tvalidationStrings.push(\"Tax or fee type is required.\");\r\n\t\t}\r\n\r\n\t\tif(validationStrings.length > 0) {\r\n\t\t\tconst errorList = `
  • ${validationStrings.join(\"
  • \")}
`;\r\n\t\t\t\r\n\t\t\tswal.fire({\r\n\t\t\t\ttitle: \"Missing required fields\",\r\n\t\t\t\thtml: \r\n\t\t\t\t\t`

Please correct the following errors

\r\n\t\t\t\t\t${errorList}\r\n\t\t\t\t\t`,\r\n\t\t\t\tshowCloseButton: true,\r\n\t\t\t\ttype: \"warning\"\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-business-charge-modal\", [])\r\n\t.component(\"entityBusinessChargeModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\",\r\n\t\t\treload: \"&\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t {{$ctrl.charge.Code ? 'Edit' : 'New'}} Tax or Fee \\r\\n
\\r\\n
\\r\\n\\t
\\r\\n\\t\\t

\\r\\n\\t\\t\\tIf you collect taxes for purchases on products, a tax definition allows the system to automatically collect taxes or surcharges on goods that you've indicated apply.\\r\\n\\t\\t

\\r\\n\\t\\t

\\r\\n\\t\\t\\tCommon scenarios include defining your tax information for state taxes, county and/or city taxes, and even potential surcharges applied for goods or services.\\r\\n\\t\\t

\\r\\n\\t\\t

\\r\\n\\t\\t\\tGet started by using a template, or simply fill in the necessary information:\\r\\n\\t\\t

\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\tState Sales Tax\\r\\n\\t\\t\\tCounty Sales Tax\\r\\n\\t\\t\\tFee\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\r\\n\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\tCancel\\r\\n\\t\\t\\t{{$ctrl.charge.Code ? 'Save' : 'Create'}}\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","import template from \"./entity-business-products.html\";\r\nimport \"./entity-business-products.less\";\r\n\r\nimport {\r\n\tENTITY_TRANSLATION_KEYS, \r\n\tI18NextContext \r\n} from \"../../../../services/i18nService\";\r\nimport { FORM_BUSINESS_PRODUCTS } from \"../../../../routes\";\r\nimport { globs } from \"../../../../services/globs\";\r\n\r\n// type ProfileFeeDto = { Code:string }\r\n// type Product = {\r\n// Code: string; //server managed\r\n// Name: string;\r\n// Price: decimal;\r\n// IsActive: boolean;\r\n//\t IsInvoiceDefault: boolean;\r\n// Fees: ProfileFeeDto[]; //only the Code!\r\n// }\r\n\r\nexport function controller($logger, api, loadingService, $uibModal, $scope, securityService, appState) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.i18n = I18NextContext.Instance;\r\n\tctrl.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.canReadBusinessProductsGlob = globs.business.byType(\"*\").products.byType(\"*\").read;\r\n\t\tctrl.canUpdateBusinessProductGlob = globs.business.byType(\"*\").products.byType(\"*\").update;\r\n\t\tctrl.canCreateBusinessProductGlob = globs.business.byType(\"*\").products.byType(\"*\").create;\r\n\t\t\t\t\r\n\t\t$scope.$watch(() => ctrl.businessId, loadProducts);\r\n\t};\r\n\r\n\tctrl.editProduct = async(product) => {\r\n\t\tconst update = await $uibModal.open({\r\n\t\t\tcomponent: \"entity-business-product-modal\",\r\n\t\t\tsize: \"smmd\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\tproduct: () => product,\r\n\t\t\t\tcharges: () => ([ ...ctrl.availableCharges ]),\r\n\t\t\t\tsave: () => saveProduct\r\n\t\t\t}\r\n\t\t}).result;\r\n\r\n\t\tconst matchindex = ctrl.products.findIndex(c => c.Code === update.Code);\r\n\t\tif(matchindex !== -1) {\r\n\t\t\tctrl.products[matchindex] = update;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tctrl.products.push(update);\r\n\t\t}\t\r\n\r\n\t\treturn update;\r\n\t};\r\n\r\n\tasync function saveProduct(product) {\r\n\t\tconst verb = product.Code !== undefined ? \"put\" : \"post\";\r\n\t\tconst saveBusiness = api[verb](FORM_BUSINESS_PRODUCTS(appState.forms.selected.Id, ctrl.businessId), product);\r\n\t\tconst resp = await loadingService.watch(saveBusiness);\r\n\r\n\t\treturn resp;\r\n\t}\r\n\r\n\tasync function loadProducts() {\r\n\t\tconst canReadProducts = securityService.isPatternAllowed(ctrl.canReadBusinessProductsGlob);\r\n\t\tif(ctrl.businessId === undefined || !canReadProducts) {\r\n\t\t\tctrl.products = [];\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst getProducts = api.get(FORM_BUSINESS_PRODUCTS(appState.forms.selected.Id, ctrl.businessId));\r\n\t\t\r\n\t\tconst products = await loadingService.watch(getProducts);\r\n\t\tctrl.products = products.filter(c => c.IsActive);\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-business-products\", [])\r\n\t.component(\"entityBusinessProducts\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tbusinessId: \"<\",\r\n\t\t\tavailableCharges: \"=\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t

\\r\\n\\t\\t\\t\\tProducts\\r\\n\\t\\t\\t

\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t Please click the \\\"Add Product\\\" button below to add a new product \\r\\n\\t\\t\\t\\t\\t\\t No products \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
Name Price per unit Auto Apply
{{ product.Name}} ${{ product.Price }}/{{ product.Unit }} {{ product.IsInvoiceDefault ? 'Yes' : 'No' }}
\\r\\n\\t\\t\\t\\t\\t\\t\\tAdd Product\\r\\n\\t\\t\\t\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","import template from \"./entity-business-product-modal.html\";\r\nimport \"./entity-business-product-modal.less\";\r\nimport { EVENT_LOGOUT } from \"../../../../../constants\";\r\nimport swal from \"sweetalert2\";\r\nimport { isStringNullishOrEmpty } from \"../../../../../services/string-service\";\r\n\r\nexport function controller(loadingService, eventBus, $scope, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.templates = [\r\n\t\t{ label: \"Gas\", template: \"gas\" },\r\n\t\t{ label: \"Diesel\", template: \"diesel\" },\r\n\t\t{ label: \"Ice\", template: \"ice\" },\r\n\t\t{ label: \"Slip Rent\", template: \"slip-rent\" },\r\n\t\t{ label: \"Bait\", template: \"bait\" },\r\n\t\t{ label: \"Gloves\", template: \"gloves\" },\r\n\t\t{ label: \"Salt\", template: \"salt\" },\r\n\t\t{ label: \"Supplies\", template: \"supplies\" },\r\n\t\t{ label: \"Misc\", template: \"misc\" }\r\n\t];\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\r\n\tctrl.$onDestroy = ctrl.cancel;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.product = { ...ctrl.resolve.product };\r\n\t\teventBus.register(EVENT_LOGOUT, () => { ctrl.cancel(); }, $scope);\r\n\r\n\t\tctrl.resolve.charges.forEach(c => {\r\n\t\t\tc.isSelected = (ctrl.product.Fees ?? []).some(f => f.Fee.Code === c.Code);\r\n\t\t});\r\n\t};\r\n\r\n\tctrl.onOk = async() => {\r\n\t\tif(!validate()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctrl.product.Fees = ctrl.resolve.charges\r\n\t\t\t.filter(c => c.isSelected)\r\n\t\t\t.map(c => ({ Fee: c }));\r\n\r\n\t\tconst result = await ctrl.resolve.save(ctrl.product);\r\n\t\tctrl.modalInstance.close(result);\r\n\t};\r\n\r\n\tctrl.cancel = () => {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t};\r\n\r\n\tctrl.setTemplate = (templateName) => {\r\n\t\tswitch(templateName) {\r\n\t\t\tcase \"gas\": {\r\n\t\t\t\tctrl.product.Name = \"Gas\";\r\n\t\t\t\tctrl.product.Unit = \"Gallon\";\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase \"diesel\": {\r\n\t\t\t\tctrl.product.Name = \"Diesel\";\r\n\t\t\t\tctrl.product.Unit = \"Gallon\";\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase \"ice\": {\r\n\t\t\t\tctrl.product.Name = \"Ice\";\r\n\t\t\t\tctrl.product.Unit = \"Pound\";\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase \"slip-rent\": {\r\n\t\t\t\tctrl.product.Name = \"Slip Rent\";\r\n\t\t\t\tctrl.product.Unit = \"Day\";\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase \"bait\": {\r\n\t\t\t\tctrl.product.Name = \"Bait\";\r\n\t\t\t\tctrl.product.Unit = \"Pound\";\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase \"gloves\": {\r\n\t\t\t\tctrl.product.Name = \"Gloves\";\r\n\t\t\t\tctrl.product.Unit = \"Pair\";\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase \"salt\": {\r\n\t\t\t\tctrl.product.Name = \"Salt\";\r\n\t\t\t\tctrl.product.Unit = \"Pound\";\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase \"supplies\": {\r\n\t\t\t\tctrl.product.Name = \"Supplies\";\r\n\t\t\t\tctrl.product.Unit = \"Each\";\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase \"misc\": {\r\n\t\t\t\tctrl.product.Name = \"Misc\";\r\n\t\t\t\tctrl.product.Unit = \"Each\";\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t};\r\n\r\n\tconst validate = () => {\r\n\t\tconst validationStrings = [];\r\n\r\n\t\tif(isStringNullishOrEmpty(ctrl.product.Name)) {\r\n\t\t\tvalidationStrings.push(\"Product name is required.\");\r\n\t\t}\r\n\r\n\t\tif(isStringNullishOrEmpty(ctrl.product.Price?.toString())) {\r\n\t\t\tvalidationStrings.push(\"Product price is required.\");\r\n\t\t}\r\n\r\n\t\tif(isStringNullishOrEmpty(ctrl.product.Unit)) {\r\n\t\t\tvalidationStrings.push(\"Product unit is required.\");\r\n\t\t}\r\n\r\n\t\tif(validationStrings.length > 0) {\r\n\t\t\tconst errorList = `
  • ${validationStrings.join(\"
  • \")}
`;\r\n\t\t\t\r\n\t\t\tswal.fire({\r\n\t\t\t\ttitle: \"Missing required fields\",\r\n\t\t\t\thtml: \r\n\t\t\t\t\t`

Please correct the following errors

\r\n\t\t\t\t\t${errorList}\r\n\t\t\t\t\t`,\r\n\t\t\t\tshowCloseButton: true,\r\n\t\t\t\ttype: \"warning\"\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-business-product-modal\", [])\r\n\t.component(\"entityBusinessProductModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\",\r\n\t\t\treload: \"&\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t {{$ctrl.product.Code ? 'Edit' : 'New'}} Product \\r\\n
\\r\\n
\\r\\n\\t
\\r\\n\\t\\t

\\r\\n\\t\\t\\tAdd products that your business has on hand. You can then record these on invoices or deduct the from customer balances in future invoices. For things like checks or\\r\\n\\t\\t\\tcash - instead record this directly against your customers ledger in their profile.\\r\\n\\t\\t

\\r\\n\\t\\t

\\r\\n\\t\\t\\tGet started by using any of these common templates - or create your own product by entering it's information below:\\r\\n\\t\\t

\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t{{template.label}}\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t$\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t

\\r\\n\\t\\t\\t\\tApplicable Taxes and Fees\\r\\n\\t\\t\\t

\\r\\n\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\t

No taxes or fees are available.

\\r\\n\\t\\t\\t

Add a Tax or Fee in 'Taxes and Fees' above the products table.

\\r\\n\\t\\t
\\r\\n\\t\\t 0\\\"\\r\\n\\t\\t>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t 0\\\"\\r\\n\\t\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
Tax or Fee
\\r\\n\\t\\t\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\t
{{ charge.Name }}
\\r\\n\\t\\t\\r\\n\\t\\r\\n\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\tCancel\\r\\n\\t\\t\\t{{$ctrl.product.Code ? 'Save' : 'Create'}}\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","import template from \"./entity-contact-modal.html\";\r\nimport \"./entity-contact-modal.less\";\r\nimport { EVENT_LOGOUT } from \"../../../../constants\";\r\n\r\nexport function controller(appState, loadingService, eventBus, $scope, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\r\n\tctrl.$onDestroy = ctrl.cancel;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.Contact = { ...ctrl.resolve.contact };\r\n\t\teventBus.register(EVENT_LOGOUT, () => { ctrl.cancel(); }, $scope);\r\n\t};\r\n\r\n\tctrl.onOk = () => {\r\n\t\tctrl.modalInstance.close(ctrl.Contact);\r\n\t};\r\n\r\n\tctrl.cancel = () => {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-contact-modal\", [])\r\n\t.component(\"entityContactModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\",\r\n\t\t\treload: \"&\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"\\r\\n
\\r\\n\\t {{$ctrl.Contact.Id ? 'Edit' : 'Create'}} Contact \\r\\n
\\r\\n
\\r\\n\\t\\r\\n
\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\tCancel\\r\\n\\t\\t\\tOk\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","export const isSupportedOrNullish = (property) => property === undefined || property === null || property.IsSupported;","import { ClassificationsValueDto } from \"../../models/agency-types\";\r\n\r\nconst byName = (a, b) => a.Name < b.Name ? -1 : 1;\r\n\r\nconst getAllowedClassifications = (type: ClassificationsValueDto, allClassifications, filter?: (i) => boolean) => {\r\n\tif(type === undefined) {\r\n\t\tconst classifications = (allClassifications ?? []).some(c => c.Name.startsWith(\"License Type\"))\r\n\t\t? allClassifications.filter(c => c.Name.startsWith(\"License Type\"))\r\n\t\t: [...(allClassifications ?? [])];\r\n\r\n\t\treturn classifications\r\n\t\t\t.sort(byName);\r\n\t}\r\n\tconst classifications = (type.Items ?? [])\r\n\t\t.filter(c => filter?.(c) ?? true)\r\n\t\t.map(c => (allClassifications ?? []).find(ac => ac.Code === c.Item.Code))\r\n\t\t.sort(byName);\r\n\r\n\treturn classifications;\r\n};\r\n\r\nexport const getPrimaryClassificationsForType = (type: ClassificationsValueDto, allClassifications) => \r\n\tgetAllowedClassifications(type, allClassifications, c => c.IsPrimary);\r\n\r\nexport const getAttributeClassificationsForType = (type: ClassificationsValueDto, allClassifications) => \r\n\tgetAllowedClassifications(type, allClassifications, c => c.IsAttribute);","import template from \"./entity-form.html\";\r\nimport \"./entity-form.less\";\r\n\r\nimport swal from \"sweetalert2\";\r\nimport { trim } from \"lodash\";\r\nimport { v7 as uuid } from \"uuid\";\r\n\r\nimport {\r\n\tFORM_ENTITY, \r\n\tFORM_ENTITY_CREATE\r\n} from \"routes.js\";\r\nimport { TIME_ZONES } from \"../../../constants\";\r\nimport { isSupportedOrNullish } from \"../isSupportedOrNullish\";\r\nimport { getPrimaryClassificationsForType } from \"../getAllowedClassifications\";\r\nimport {\r\n\tENTITY_TRANSLATION_KEYS, \r\n\tI18NextContext \r\n} from \"../../../services/i18nService\";\r\n\r\nexport function controller(appState, api, toastr, loadingService, entityManager, $logger, $window, uiHelpers) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.i18n = I18NextContext.Instance;\r\n\tctrl.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.timezones = [\r\n\t\t\t{\r\n\t\t\t\tcode: \"\",\r\n\t\t\t\tianaCode: \"\"\r\n\t\t\t},\r\n\t\t\t...TIME_ZONES\r\n\t\t];\r\n\r\n\t\tctrl.entityTypeName = ctrl.entityType.Code.charAt(0).toUpperCase() + ctrl.entityType.Code.slice(1).toLowerCase();\r\n\t\tctrl.hasSystemKeyInputs = !ctrl.entityType.IsCodeSystemManaged\r\n\t\t\t|| ctrl.entityType.Classification?.IsSupported\r\n\t\t\t|| ctrl.entityType.ExternalKey?.IsSupported;\r\n\r\n\t\tctrl.isNewEntity = (ctrl.entity === undefined);\r\n\r\n\t\tctrl.allClassifications = getPrimaryClassificationsForType(\r\n\t\t\tctrl.entityType.Classifications, \r\n\t\t\tappState.forms.selected.Agency.Classifications\r\n\t\t);\r\n\r\n\t\tctrl.formEntity = ctrl.entity !== undefined ? { ...ctrl.entity } \r\n\t\t\t: appState.forms.selected.TimeMode.Code === \"BYENTITY\" ? { TimeZone: { Code: \"\" } }\r\n\t\t\t: { TimeZone: { Code: appState.forms.selected.TimeZone.Code } };\r\n\r\n\t\tconst defaultName = `${ctrl.entityType.Code} ${ctrl.entityType.Code === \"FISHERMAN\" && !!ctrl.entityType.Name ? \"Info\" : \"Name\"}`;\r\n\t\tctrl.tooltipTranslations = {\r\n\t\t\tname: ctrl.i18n.translateEntityType(ctrl.entityType.Code, ENTITY_TRANSLATION_KEYS.LABELS.Name, defaultName),\r\n\t\t\tcode: ctrl.i18n.translateEntityType(ctrl.entityType.Code, ENTITY_TRANSLATION_KEYS.LABELS.Code, \"Number\"),\r\n\t\t\tclassification: ctrl.i18n.translateEntityType(ctrl.entityType.Code, ENTITY_TRANSLATION_KEYS.LABELS.Classification, \"Classification\"),\r\n\t\t\texternalKey: ctrl.i18n.translateEntityType(ctrl.entityType.Code, ENTITY_TRANSLATION_KEYS.LABELS.ExternalKey, \"External Key\")\r\n\t\t};\r\n\t\t\r\n\t\tif(ctrl.entity === undefined) {\r\n\t\t\tif(ctrl.entityType.IsCodeSystemManaged) {\r\n\t\t\t\tctrl.formEntity.Code = uuid();\r\n\t\t\t}\r\n\r\n\t\t\tif(ctrl.entityType.IsExternalKeySystemManaged) {\r\n\t\t\t\tctrl.formEntity.ExternalKey = uuid();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tloadEntity();\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.setClassificationBox = (box) => {\r\n\t\tctrl.classificationBox = box;\r\n\r\n\t\tconst selectionChoices = uiHelpers.setDisplay(\r\n\t\t\tctrl.allClassifications, \r\n\t\t\t{ \r\n\t\t\t\trecentlyUsedEnabled: false, \r\n\t\t\t\thideCode: true \r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tif(ctrl.classificationBox) {\r\n\t\t\tctrl.classificationBox.setChoices(selectionChoices, \"value\", \"label\", true);\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.setDisplay = (id, fieldVariable) => {\r\n\t\tconst item = ctrl[fieldVariable].find(i => (i.Id === parseInt(id)) || (i.Id === id));\r\n\r\n\t\tif(!item) {\r\n\t\t\t$logger.warn(`Selected ${fieldVariable} not found as an option.`);\r\n\t\t}\r\n\r\n\t\treturn item.Name || item.Code;\r\n\t};\r\n\r\n\tctrl.handleClassificationValueChanged = (modelVal) => {\r\n\t\tconst modelValInt = parseInt(modelVal);\r\n\t\tconst selectedClassification = ctrl.allClassifications.find(a => a.Id === modelValInt);\r\n\r\n\t\tctrl.formEntity.Classification = selectedClassification ? { Code: selectedClassification.Code } : undefined;\r\n\t};\r\n\r\n\tctrl.isSupportedOrNullish = isSupportedOrNullish;\r\n\r\n\tctrl.saveEntity = () => {\r\n\t\tif(ctrl.formEntity.TimeZone && ctrl.formEntity.TimeZone.Code === \"\") {\r\n\t\t\tctrl.formEntity.TimeZone = null;\r\n\t\t}\r\n\r\n\t\tctrl.formEntity.ExternalKey = ctrl.formEntity.ExternalKey?.trim();\r\n\t\tif(ctrl.formEntity.ExternalKey === \"\" || ctrl.formEntity.ExternalKey === null) {\r\n\t\t\tdelete ctrl.formEntity.ExternalKey;\r\n\t\t}\r\n\r\n\t\tconst params = {\r\n\t\t\t...ctrl.formEntity,\r\n\t\t\tCode: trim(ctrl.formEntity.Code)\r\n\t\t};\r\n\r\n\t\tif(\r\n\t\t\tctrl.entityType.Code.indexOf(\"LICENSE\") > -1 \r\n\t\t\t|| (ctrl.entityType.IsNameDefaultedToCodeWhenNoContact === true && ctrl.formEntity.Contact === undefined)\r\n\t\t) {\r\n\t\t\tparams.Name = params.Code;\r\n\t\t\tctrl.formEntity.Name = params.Code;\r\n\t\t}\r\n\r\n\t\t!!params.Entities && delete params.Entities;\r\n\t\t!!params.Type && delete params.Type;\r\n\t\t!!params.friendlies && delete params.friendlies;\r\n\t\tif((params.TimeZone && params.TimeZone.Code === \"\") || !ctrl.isSupportedOrNullish(ctrl.entityType.TimeZone)) {\r\n\t\t\tdelete params.TimeZone; \r\n\t\t}\r\n\r\n\t\tif(!validate()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(ctrl.formEntity.Id) {\r\n\t\t\tupdateEntity(params);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tcreateEntity(params);\r\n\t};\r\n\r\n\tfunction loadEntity() {\r\n\t\tconst promise = api.get(FORM_ENTITY(appState.forms.selected.Id, ctrl.formEntity.Id)).then((response) => {\r\n\t\t\tconst oldType = ctrl.formEntity.Type;\r\n\r\n\t\t\tctrl.formEntity = { ...ctrl.formEntity, ...response };\r\n\r\n\t\t\tif(ctrl.formEntity.Classification) {\r\n\t\t\t\tctrl.formEntity.Classification = entityManager.getClassificationById(ctrl.formEntity.Classification.Id);\r\n\t\t\t}\r\n\t\t\tctrl.formEntity.Type = oldType;\r\n\t\t\tif(!ctrl.formEntity.TimeZone) {\r\n\t\t\t\tctrl.formEntity.TimeZone = {\r\n\t\t\t\t\tCode: \"\"\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tctrl.hasSystemKeyValues = !ctrl.entityType.IsCodeSystemManaged\r\n\t\t\t\t|| !!ctrl.formEntity.Classification \r\n\t\t\t\t|| !!ctrl.formEntity.ExternalKey;\r\n\t\t});\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction updateEntity(entity) {\r\n\t\tconst route = FORM_ENTITY(appState.forms.selected.Id, entity.Id);\r\n\r\n\t\tconst promise = api.put(route, entity).then(\r\n\t\t\t(newEntity) => {\r\n\t\t\t\tctrl.entity.Name = newEntity.Name;\r\n\r\n\t\t\t\ttoastr.success(`${newEntity.Name} updated successfully.`);\r\n\t\t\t\tappState.updateEntity(entity);\r\n\t\t\t\tctrl.reload();\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tasync function createEntity(entity) {\r\n\t\tconst route = FORM_ENTITY_CREATE(appState.forms.selected.Id);\r\n\t\tconst entityPayload = {\r\n\t\t\t...entity,\r\n\t\t\tType: {\r\n\t\t\t\tCode: ctrl.entityType.Code\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tconst confirmed = await showEntityConfirmation();\r\n\t\t\tif(confirmed) {\r\n\t\t\t\tconst promise = api.post(route, [entityPayload])\r\n\t\t\t\t\t.then((newEntity) => {\r\n\t\t\t\t\t\tctrl.entity = newEntity[0];\r\n\t\r\n\t\t\t\t\t\ttoastr.success(`${ctrl.entity.Name ?? ctrl.entity.Code} created successfully.`);\r\n\t\t\t\t\t\tshowRefreshModal()\r\n\t\t\t\t\t\t\t.then(shouldRefresh => {\r\n\t\t\t\t\t\t\t\tif(shouldRefresh) {\r\n\t\t\t\t\t\t\t\t\t$window.location.reload();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tctrl.close({ entity: ctrl.entity });\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t)\r\n\t\t\t\t\t.catch(err => {\r\n\t\t\t\t\t\t$logger.error(\"entity creation error\", err); \r\n\t\t\t\t\t\ttoastr.error(\"There was an error creating a new entity\");\r\n\t\t\t\t\t});\r\n\t\r\n\t\t\t\treturn loadingService.watch(promise); \r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(err) {\r\n\t\t\t$logger.error(\"entity creation error\", err); \r\n\t\t\ttoastr.error(\"There was an error creating a new entity\");\r\n\t\t}\r\n\t}\r\n\r\n\tasync function showEntityConfirmation() {\r\n\t\tconst showExternalKey = !ctrl.entityType.IsExternalKeySystemManaged && ctrl.formEntity.ExternalKey !== undefined;\r\n\t\tconst showCode = !ctrl.entityType.IsCodeSystemManaged;\r\n\t\tconst showName = !ctrl.entityType.IsNameDefaultedToCodeWhenNoContact || ctrl.entityType.Contact.IsSupported;\r\n\r\n\t\tconst readonlyOnCreateValues = [];\r\n\t\tif(showCode) {\r\n\t\t\treadonlyOnCreateValues.push(ctrl.tooltipTranslations.code);\r\n\t\t}\r\n\t\tif(ctrl.formEntity.Classification !== undefined) {\r\n\t\t\treadonlyOnCreateValues.push(ctrl.tooltipTranslations.classification);\r\n\t\t}\r\n\t\tif(ctrl.formEntity.ExternalKey !== undefined && showExternalKey === true) {\r\n\t\t\treadonlyOnCreateValues.push(ctrl.tooltipTranslations.externalKey);\r\n\t\t}\r\n\r\n\t\tlet confirmValText = readonlyOnCreateValues[0] ?? \"\";\r\n\t\tif(readonlyOnCreateValues.length === 2) {\r\n\t\t\tconfirmValText = `${confirmValText} and ${readonlyOnCreateValues[1]}`;\r\n\t\t}\r\n\t\telse if(readonlyOnCreateValues.length === 3) {\r\n\t\t\tconfirmValText = `${confirmValText}, ${readonlyOnCreateValues[1]}, and ${readonlyOnCreateValues[2]}`;\r\n\t\t}\r\n\r\n\t\tconst confirmation = await swal.fire({\r\n\t\t\ttitle: \"Create Entity Confirmation\",\r\n\t\t\thtml:\r\n\t\t\t\t`

You are about to create a new ${ctrl.entityType.Code.toLowerCase()}.

\r\n\t\t\t\t
\r\n\t\t\t\t\t${ctrl.formEntity.Name !== undefined && showName ? `
${ctrl.tooltipTranslations.name}:
` : \"\"}\r\n\t\t\t\t\t${ctrl.formEntity.Name !== undefined && showName ? `
${ctrl.formEntity.Name}
` : \"\"}\r\n\t\t\t\t\t${showCode ? `
${ctrl.tooltipTranslations.code}:
` : \"\"}\r\n\t\t\t\t\t${showCode ? `
${ctrl.formEntity.Code}
` : \"\"}\r\n\t\t\t\t\t${ctrl.formEntity.Classification !== undefined ? `
${ctrl.tooltipTranslations.classification}:
` : \"\"}\r\n\t\t\t\t\t${ctrl.formEntity.Classification !== undefined ? `
${ctrl.formEntity.Classification.Code}
` : \"\"}\r\n\t\t\t\t\t${ctrl.formEntity.TimeZone?.Code !== undefined ? \"
Timezone:
\" : \"\"}\r\n\t\t\t\t\t${ctrl.formEntity.TimeZone?.Code !== undefined ? `
${ctrl.formEntity.TimeZone.Code}
` : \"\"}\r\n\t\t\t\t\t${showExternalKey ? `
${ctrl.tooltipTranslations.externalKey}:
` : \"\"}\r\n\t\t\t\t\t${showExternalKey ? `
${ctrl.formEntity.ExternalKey}
` : \"\"}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t${readonlyOnCreateValues.length > 0 ? `
${confirmValText} cannot be changed once the entity is created.
` : \"\"}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
Are these values correct?
\r\n\t\t\t\t`,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"info\",\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Create Entity\",\r\n\t\t\tfocusCancel: true,\r\n\t\t\twidth: \"400px\",\r\n\t\t\treverseButtons: true\r\n\t\t});\r\n\r\n\t\tif(confirmation.dismiss) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\tasync function showRefreshModal() {\r\n\t\tconst confirmation = await swal.fire({\r\n\t\t\ttitle: \"Refresh form?\",\r\n\t\t\thtml:\r\n\t\t\t\t`

The new ${ctrl.entityType.Code.toLowerCase()} will not be available for use until the form is reloaded.

\r\n\t\t\t\t

Would you like to reload the form now?

\r\n\t\t\t\t`,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"info\",\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Reload\",\r\n\t\t\tfocusCancel: true,\r\n\t\t\treverseButtons: true\r\n\t\t});\r\n\r\n\t\tif(confirmation.dismiss) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction validate() {\r\n\t\tconst validationStrings = [];\r\n\r\n\t\tif(ctrl.formEntity.Code === undefined) {\r\n\t\t\tvalidationStrings.push(\"Entity Number is required\");\r\n\t\t}\r\n\r\n\t\tif((ctrl.entityType.TimeZone === undefined || ctrl.entityType.TimeZone.IsRequired) && ctrl.formEntity.TimeZone === undefined) {\r\n\t\t\tvalidationStrings.push(\"Timezone is required\");\r\n\t\t}\r\n\r\n\t\tif(\r\n\t\t\tctrl.entityType.Code.indexOf(\"LICENSE\") == -1 // code is copied to name in saveEntity()\r\n\t\t\t&& (ctrl.entityType.IsNameDefaultedToCodeWhenNoContact !== true || ctrl.formEntity.Contact !== undefined) // code is copied to name in saveEntity()\r\n\t\t\t&& (\r\n\t\t\t\t(isSupportedOrNullish(ctrl.entityType.Contact) && ctrl.formEntity.Name === undefined && ctrl.formEntity.Contact === undefined)\r\n\t\t\t\t|| (ctrl.entityType.Contact.IsRequired && ctrl.formEntity.Contact === undefined)\r\n\t\t\t\t|| (!ctrl.entityType.Contact.IsSupported && ctrl.formEntity.Name === undefined)\r\n\t\t\t)\r\n\t\t) {\r\n\t\t\tvalidationStrings.push(\"Entity Name is required\");\r\n\t\t}\r\n\r\n\t\tif(ctrl.entityType.Classification?.IsRequired && ctrl.formEntity.Classification === undefined) {\r\n\t\t\tvalidationStrings.push(\"Classification is required\");\r\n\t\t}\r\n\t\t\r\n\t\tif(ctrl.entityType.ExternalKey?.IsRequired && (ctrl.formEntity.ExternalKey === undefined || ctrl.formEntity.ExternalKey.trim() === \"\")) {\r\n\t\t\tvalidationStrings.push(\"External key is required\");\r\n\t\t}\r\n\r\n\t\tif(ctrl.entityType.CodePattern !== undefined) {\r\n\t\t\tconst exp = new RegExp(ctrl.entityType.CodePattern);\r\n\t\t\tconst isMatch = exp.test(ctrl.formEntity.Code);\r\n\r\n\t\t\tif(!isMatch) {\r\n\t\t\t\tvalidationStrings.push(\"Code is not a valid pattern\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(ctrl.entityType.NamePattern !== undefined) {\r\n\t\t\tconst exp = new RegExp(ctrl.entityType.NamePattern);\r\n\t\t\tconst isMatch = exp.test(ctrl.formEntity.Name);\r\n\r\n\t\t\tif(!isMatch) {\r\n\t\t\t\tvalidationStrings.push(\"Entity Name is not a valid pattern\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(validationStrings.length > 0) {\r\n\t\t\tconst errorList = `
  • ${validationStrings.join(\"
  • \")}
`;\r\n\r\n\t\t\tswal.fire({\r\n\t\t\t\ttitle: \"Correct Missing Information\",\r\n\t\t\t\thtml:\r\n\t\t\t\t\t`

Please correct the following errors

\r\n\t\t\t\t\t${errorList}\r\n\t\t\t\t\t`,\r\n\t\t\t\tshowCloseButton: true,\r\n\t\t\t\ttype: \"warning\"\r\n\t\t\t});\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-form\", [])\r\n\t.component(\"entityForm\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tentity: \"<\",\r\n\t\t\tpermissions: \"<\",\r\n\t\t\treadonly: \"<\",\r\n\t\t\treload: \"&\",\r\n\t\t\tclose: \"&\",\r\n\t\t\tnameComponentOptions: \"<\", \r\n\t\t\tentityType: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{$ctrl.formEntity.Type.Name}} Number\\r\\n\\t\\t\\t\\t\\t{{$ctrl.formEntity.Code}}\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\tClassification\\r\\n\\t\\t\\t\\t\\t{{$ctrl.formEntity.Classification.Code || \\\"--\\\"}}\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tExternal Key\\r\\n\\t\\t\\t\\t\\t{{$ctrl.formEntity.ExternalKey || \\\"--\\\"}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t{{$ctrl.entityTypeName}} Number\\r\\n\\t\\t\\t\\t\\t\\t*\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t 0) || $ctrl.entityType.Classification.IsSupported\\\"\\r\\n\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\tClassification\\r\\n\\t\\t\\t\\t\\t\\t*\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\tExternal Key\\r\\n\\t\\t\\t\\t\\t\\t*\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{$ctrl.formEntity.TimeZone.Code}}\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t{{$ctrl.formEntity.Id ? 'Update' : 'Create'}} {{$ctrl.formEntity.Type.Name}}\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\r\\n\";","import template from \"./name-or-contact.html\";\r\nimport \"./name-or-contact.less\";\r\n\r\nimport { isSupportedOrNullish } from \"../isSupportedOrNullish\";\r\nimport {\r\n\tENTITY_TRANSLATION_KEYS, \r\n\tI18NextContext \r\n} from \"../../../services/i18nService\";\r\n\r\nexport function controller($uibModal, $logger, $scope) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.editContact = editContact;\r\n\tctrl.i18n = I18NextContext.Instance;\r\n\tctrl.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tconst defaultName = `${ctrl.typeConfig.Code} ${ctrl.typeConfig.Code === \"FISHERMAN\" && !!ctrl.typeConfig.Name ? \"Info\" : \"Name\"}`;\r\n\t\tctrl.tooltipTranslations = {\r\n\t\t\tname: ctrl.i18n.translateEntityType(ctrl.typeConfig.Code, ENTITY_TRANSLATION_KEYS.LABELS.Name, defaultName)\r\n\t\t};\r\n\t\t\r\n\t\tif(ctrl.typeConfig.Contact === undefined && ctrl.nameComponentOptions !== undefined) {\r\n\t\t\tctrl.nameComponentSwitchable = ctrl.nameComponentOptions.text === \"allowed\"\r\n\t\t\t\t\t|| ctrl.nameComponentOptions.contact === \"allowed\";\r\n\t\t}\r\n\t\telse if(ctrl.typeConfig.Contact !== undefined) {\r\n\t\t\tctrl.nameComponentSwitchable = !ctrl.typeConfig.Contact.IsRequired && !!ctrl.typeConfig.Contact.IsSupported;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tctrl.nameComponentSwitchable = false;\r\n\t\t}\r\n\t\t\r\n\t\t$scope.$watch(() => ctrl.contact, pickNameComponent);\r\n\t\t$scope.$watch(() => ctrl.name, pickNameComponent);\r\n\t};\r\n\r\n\tfunction pickNameComponent() {\r\n\t\tif(ctrl.typeConfig.Contact === undefined && ctrl.nameComponentOptions !== undefined) {\r\n\t\t\tctrl.useNameComponent = ctrl.nameComponentOptions.text === \"default\" ? \"text\"\r\n\t\t\t\t\t: ctrl.nameComponentOptions.contact === \"default\" ? \"contact\"\r\n\t\t\t\t\t: undefined;\r\n\t\t}\r\n\t\telse if(ctrl.typeConfig.Contact !== undefined) {\r\n\t\t\tctrl.useNameComponent = !ctrl.typeConfig.Contact.IsSupported ? \"text\" \r\n\t\t\t\t: ctrl.name !== undefined && ctrl.contact === undefined ? \"text\"\r\n\t\t\t\t: \"contact\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tctrl.useNameComponent = \"text\";\r\n\t\t}\r\n\t}\r\n\r\n\tctrl.$onChange = () => {\r\n\t\t$logger.debug(\"change\", ctrl);\r\n\t};\r\n\r\n\tctrl.switchNameType = () => {\r\n\t\tif(ctrl.useNameComponent === \"contact\") {\r\n\t\t\tctrl.useNameComponent = \"text\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tctrl.useNameComponent = \"contact\";\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.isSupportedOrNullish = isSupportedOrNullish;\r\n\r\n\tfunction editContact() {\r\n\t\t$logger.debug(\"c\", ctrl.contact);\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"entity-contact-modal\",\r\n\t\t\tsize: \"sm\",\r\n\t\t\tresolve: {\r\n\t\t\t\tcontact: () => ctrl.contact,\r\n\t\t\t\tisReadonly: () => ctrl.isReadonly\r\n\t\t\t}\r\n\t\t}).result\r\n\t\t\t.then((contact) => {\r\n\t\t\t\tctrl.contact = { ...contact };\r\n\t\t\t\tctrl.name = `${contact.FirstName} ${contact.LastName}`;\r\n\t\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.name-or-contact\", [])\r\n\t.component(\"nameOrContact\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tname: \"=\",\r\n\t\t\tcontact: \"=\",\r\n\t\t\tisReadonly: \"<\",\r\n\t\t\ttypeConfig: \"<\",\r\n\t\t\tnameComponentOptions: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t{{$ctrl.name}}\\r\\n\";","import template from \"./entity-modal.html\";\r\nimport \"./entity-modal.less\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\nimport { keyBy } from \"lodash\";\r\nimport { globs } from \"../../../services/globs\";\r\nimport { isSupportedOrNullish } from \"../isSupportedOrNullish\";\r\nimport {\r\n\tAll, \r\n\tPattern \r\n} from \"../../../services/security/actionScopes\";\r\n\r\nconst entityNameTypeMap = {\r\n\tVESSEL: {\r\n\t\ttext: \"default\"\r\n\t},\r\n\tGROUP: {\r\n\t\ttext: \"default\"\r\n\t},\r\n\tFISHERMAN: {\r\n\t\ttext: \"allowed\",\r\n\t\tcontact: \"default\"\r\n\t},\r\n\tDEALER: {\r\n\t\ttext: \"default\",\r\n\t\tcontact: \"allowed\"\r\n\t},\r\n\tBUSINESS: {\r\n\t\ttext: \"default\",\r\n\t\tcontact: \"allowed\"\r\n\t},\r\n\tLICENSE: {}\r\n};\r\n\r\nexport function controller(loadingService, eventBus, $scope, $logger, securityService) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = handleClose;\r\n\tctrl.isEntityReadonly = isEntityReadonly;\r\n\r\n\tctrl.tabs = [\r\n\t\t{ name: \"Entity\" }\r\n\t];\r\n\tctrl.selectedTab = ctrl.tabs[0];\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.entity = ctrl.resolve.entity;\r\n\t\tctrl.permissions = keyBy(ctrl.resolve.permissions.Type, t => t.Code);\r\n\r\n\t\tctrl.nameComponent = entityNameTypeMap[ctrl.resolve.typeConfig.Code] ?? entityNameTypeMap[\"FISHERMAN\"];\r\n\r\n\t\tresetTabs(ctrl.resolve.typeConfig);\r\n\r\n\t\teventBus.register(EVENT_LOGOUT, () => { handleClose(); }, $scope);\r\n\t}\r\n\r\n\tfunction resetTabs(selectedType) {\r\n\t\tctrl.currentType = selectedType;\r\n\r\n\t\tctrl.canViewInventoryTab = globs.entityTypes.byType(selectedType.Code).inventory.byCode(\"*\").read;\r\n\t\tconst showInventoryTab = securityService.isActionOrPatternAllowed(ctrl.canViewInventoryTab) && isSupportedOrNullish(ctrl.resolve.typeConfig.Inventory);\r\n\r\n\t\tctrl.canViewTokensTab = globs.entityTypes.byType(selectedType.Code).tokens.byCode(\"*\").read;\r\n\t\tconst showTokensTab = securityService.isActionOrPatternAllowed(ctrl.canViewTokensTab) && isSupportedOrNullish(ctrl.resolve.typeConfig.Tokens);\r\n\r\n\t\tctrl.canViewAliasesTab = globs.entityTypes.byType(selectedType.Code).aliases.byCode(\"*\").read;\r\n\t\tconst showAliasesTab = securityService.isActionOrPatternAllowed(ctrl.canViewAliasesTab);\r\n\t\t\r\n\t\tctrl.canViewProductsTab = globs.entityTypes.byType(selectedType.Code).products.byCode(\"*\").read;\r\n\t\tconst showProductsTab = securityService.isActionOrPatternAllowed(ctrl.canViewProductsTab);\r\n\r\n\t\tctrl.canViewGeometriesTab = globs.entityTypes.byType(selectedType.Code).geometries.byCode(\"*\").read;\r\n\t\tconst showGeometriesTab = securityService.isActionOrPatternAllowed(ctrl.canViewGeometriesTab);\r\n\r\n\t\tctrl.canViewIdentifiersTab = globs.entityTypes.byType(selectedType.Code).identifiers.byCode(\"*\").read;\r\n\t\tconst showIdentifiersTab = securityService.isActionOrPatternAllowed(ctrl.canViewIdentifiersTab);\r\n\r\n\t\tctrl.canViewClassificationsTab = globs.entityTypes.byType(selectedType.Code).classifications.byCode(\"*\").read;\r\n\t\tconst showClassificationsTab = securityService.isActionOrPatternAllowed(ctrl.canViewClassificationsTab);\r\n\r\n\t\tctrl.canViewEffectiveTab = globs.entityTypes.byType(selectedType.Code).effective.byCode(\"*\").read;\r\n\t\tconst showEffectiveTab = securityService.isActionOrPatternAllowed(ctrl.canViewEffectiveTab);\r\n\r\n\t\tctrl.canViewContactsTab = globs.entityTypes.byType(selectedType.Code).contacts.byCode(\"*\").read;\r\n\t\tconst showContactsTab = securityService.isActionOrPatternAllowed(ctrl.canViewContactsTab);\r\n\r\n\t\tctrl.canViewAssociatedTab = globs.entityTypes.byType(selectedType.Code).related.byCode(\"*\").read;\r\n\t\tconst showAssociatedTab = securityService.isActionOrPatternAllowed(ctrl.canViewAssociatedTab);\r\n\r\n\t\tconst canReadEntityBusiness = globs.entityTypes.byType(selectedType.Code).business.byType(\"*\").read;\r\n\t\tconst canReadBusiness = globs.business.byType(\"*\").read;\r\n\t\tconst canViewBusinessTab = new All([new Pattern(canReadEntityBusiness), new Pattern(canReadBusiness)]);\r\n\t\tconst showBusinessTab = securityService.isActionScopeAllowed(canViewBusinessTab);\r\n\r\n\t\tctrl.selectedTypeName = selectedType.Name;\r\n\t\tctrl.tabs = [\r\n\t\t\t{ name: `${ctrl.entity === undefined ? \"New \" : \"\" }${ctrl.selectedTypeName}`, permissions: ctrl.permissions[selectedType.Code] }\r\n\t\t];\r\n\r\n\t\tif(ctrl.entity !== undefined) {\r\n\t\t\tif(showAssociatedTab && isSupportedOrNullish(ctrl.resolve.typeConfig.Relationships)) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Associated\", permissions: ctrl.permissions[selectedType.Code].Relationships });\r\n\t\t\t}\r\n\r\n\t\t\tif(ctrl.permissions[selectedType.Code]?.Users !== undefined && !ctrl.permissions[selectedType.Code].Users.IsDisabled) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Users\", permissions: ctrl.permissions[selectedType.Code].Users });\r\n\t\t\t}\r\n\r\n\t\t\tif(showContactsTab && isSupportedOrNullish(ctrl.resolve.typeConfig.Contacts)) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Contacts\", permissions: ctrl.permissions[selectedType.Code].Contacts });\r\n\t\t\t}\r\n\r\n\t\t\tif(showIdentifiersTab && isSupportedOrNullish(ctrl.resolve.typeConfig.Identifiers)) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Identifiers\", permissions: ctrl.permissions[selectedType.Code].Identifiers });\r\n\t\t\t}\r\n\r\n\t\t\tif(showClassificationsTab && isSupportedOrNullish(ctrl.resolve.typeConfig.Classifications)) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Classifications\", permissions: ctrl.permissions[selectedType.Code].Classifications });\r\n\t\t\t}\r\n\r\n\t\t\tif(showInventoryTab) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Inventory\" });\r\n\t\t\t}\r\n\r\n\t\t\tif(showTokensTab) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Tokens\" });\r\n\t\t\t}\r\n\r\n\t\t\tif(showAliasesTab && isSupportedOrNullish(ctrl.resolve.typeConfig.Aliases)) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Aliases\" });\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(showGeometriesTab && isSupportedOrNullish(ctrl.resolve.typeConfig.Geometries)) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Geometries\" });\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(showProductsTab && isSupportedOrNullish(ctrl.resolve.typeConfig.Products)) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Products\" });\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(showEffectiveTab && isSupportedOrNullish(ctrl.resolve.typeConfig.EffectiveRanges)) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Effective Ranges\", permissions: ctrl.permissions[selectedType.Code].Effective });\r\n\t\t\t}\r\n\r\n\t\t\tif(showBusinessTab && ctrl.resolve.typeConfig.Businesses?.IsSupported) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Business\" });\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(ctrl.permissions[selectedType.Code]?.Reporting !== undefined && !ctrl.permissions[selectedType.Code].Reporting.IsDisabled && !!ctrl.entity) {\r\n\t\t\tctrl.tabs.push({ name: \"Reporting\", permissions: ctrl.permissions[selectedType.Code].Reporting });\r\n\t\t}\r\n\r\n\t\tctrl.selectedTab = ctrl.tabs[0];\r\n\t}\r\n\r\n\tfunction handleClose(entity) {\r\n\t\tctrl.modalInstance.close(entity ?? ctrl.entity);\r\n\t}\r\n\r\n\tfunction isEntityReadonly() {\r\n\t\treturn !securityService.isActionAllowed(globs.entityTypes.byType(ctrl.currentType.Code).write);\r\n\t}\r\n\r\n\tctrl.changeEntity = function(entity) {\r\n\t\tctrl.entity = entity;\r\n\t\tresetTabs(entity.Type);\r\n\t\tctrl.selectedTab = ctrl.tabs[0];\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-modal\", [])\r\n\t.component(\"entityModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\",\r\n\t\t\treload: \"&\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"\\r\\n
\\r\\n\\t {{$ctrl.entity.Id ? 'Edit ' + $ctrl.entity.Name : 'New ' + ($ctrl.selectedTypeName)}}\\r\\n
\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t{{tab.name}}\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t

Alias management is not currently implemented

\\r\\n\\t\\t\\t

Products management is not currently implemented

\\r\\n\\t\\t\\t

Geometries management is not currently implemented

\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\tClose\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\";","import template from \"./entity-assoc.html\";\r\nimport \"./entity-assoc.less\";\r\nimport {\r\n\tforEach,\r\n\tsome\r\n} from \"lodash\";\r\nimport {\r\n\tFORM_ENTITY_DETAILS, \r\n\tFORM_ENTITY_ASSOCIATION \r\n} from \"routes.js\";\r\nimport { ENTITY_TYPES } from \"constants.js\";\r\nimport pluralize from \"pluralize\";\r\nimport { ENTITY_TRANSLATION_KEYS } from \"../../../services/i18nService\";\r\nimport { globs } from \"../../../services/globs\";\r\nimport {\r\n\tAction, \r\n\tAll \r\n} from \"../../../services/security/actionScopes\";\r\n\r\nexport function controller(\r\n\tappState,\r\n\tapi,\r\n\tloadingService,\r\n\tentityManager,\r\n\t$uibModal,\r\n\t$sce,\r\n\t$logger,\r\n\tsecurityService,\r\n\ttoastr\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\r\n\tctrl.edit = (entity) => {\r\n\t\tctrl.changeEntity(entity);\r\n\t};\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.allTypePermissions = appState.permissions.Administration.Entity.Type;\r\n\t\tif(ctrl.entity.Type !== undefined) {\r\n\t\t\tconst thisType = ctrl.form.Agency.Types.find(t => t.Code === ctrl.entity.Type.Code);\r\n\t\t\tctrl.entity.Type.Name = thisType.Name;\r\n\t\t}\r\n\r\n\t\tconst availableRelationshipTypeCodes = ctrl.typeConfig\r\n\t\t\t.Relationships\r\n\t\t\t?.Items\r\n\t\t\t?.map(r => r.Item.Code);\r\n\t\t\r\n\t\tctrl.availableAssociations = ctrl.form.Agency.Types\r\n\t\t\t.filter(t => t.Code !== ctrl.typeConfig.Code)\r\n\t\t\t.filter(t => t.Relationships?.Items?.some(r => {\r\n\t\t\t\tconst isMatchingRelationship = availableRelationshipTypeCodes.indexOf(r.Item.Code) > -1;\r\n\t\t\t\tif(isMatchingRelationship) {\r\n\t\t\t\t\tconst canAddSource = new Action(\r\n\t\t\t\t\t\tglobs.entityTypes.byType(ctrl.typeConfig.Code).write\r\n\t\t\t\t\t);\r\n\t\t\t\t\tconst canAddRelationshipType = new Action(\r\n\t\t\t\t\t\tglobs.entityTypes.byType(ctrl.typeConfig.Code).related.byCode(r.Item.Code).create\r\n\t\t\t\t\t);\r\n\t\t\t\t\tconst canRelateToType = new Action(\r\n\t\t\t\t\t\tglobs.entityTypes.byType(ctrl.typeConfig.Code).related.byCode(r.Item.Code).types.byType(t.Code).add\r\n\t\t\t\t\t);\r\n\t\t\t\t\tconst isAllowedRelationship = securityService.isActionScopeAllowed(\r\n\t\t\t\t\t\tnew All([canAddSource, canAddRelationshipType, canRelateToType])\r\n\t\t\t\t\t);\r\n\t\t\t\t\treturn isAllowedRelationship;\r\n\t\t\t\t}\r\n\t\t\t}))\r\n\t\t\t.map(t => {\r\n\t\t\t\tconst relationships = t.Relationships.Items.filter(r => availableRelationshipTypeCodes.indexOf(r.Item.Code) > -1);\r\n\t\t\t\tif(relationships.length > 1) {\r\n\t\t\t\t\tconst errorString = `Multiple relationship types exist for the pair ${ctrl.typeConfig.Code}/${t.Code}`;\r\n\t\t\t\t\tconst err = new Error(errorString);\r\n\t\t\t\t\t$logger.exception(err, \"Multiple relationships exception\");\r\n\r\n\t\t\t\t\ttoastr.error(errorString);\r\n\t\t\t\t\treturn {};\r\n\t\t\t\t}\r\n\t\t\t\tconst relationship = relationships[0];\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttype: t,\r\n\t\t\t\t\trelationship\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\tloadRelatedEntities(); \r\n\t}\r\n\r\n\tctrl.addRelated = async(type) => {\r\n\t\tawait $uibModal\r\n\t\t\t.open({\r\n\t\t\t\tcomponent: \"entityHeaderModal\",\r\n\t\t\t\tsize: \"sm\",\r\n\t\t\t\tbackdrop: \"static\",\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\ttypeConfig: () => type.type,\r\n\t\t\t\t\tsave: () => saveNewAssociation(type)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.result;\r\n\t};\r\n\r\n\tconst saveNewAssociation = (type) => async(newEntity) => {\r\n\t\tconst newEntityType = { Code: type.type.Code };\r\n\t\tconst relationshipType = { Code: type.relationship.Item.Code };\r\n\t\tconst entityPayload = {\r\n\t\t\t...newEntity,\r\n\t\t\tType: newEntityType\r\n\t\t};\r\n\r\n\t\tconst payload = {\r\n\t\t\tType: relationshipType,\r\n\t\t\tEntity: entityPayload\r\n\t\t};\r\n\r\n\t\tawait loadingService.watch(api.post(FORM_ENTITY_ASSOCIATION(appState.forms.selected.Id, ctrl.entity.Id), payload));\r\n\t\tawait loadRelatedEntities();\r\n\t};\r\n\r\n\tfunction loadRelatedEntities() {\r\n\t\tconst promise = api.get(FORM_ENTITY_DETAILS(appState.forms.selected.Id, ctrl.entity.Id)).then((response) => {\r\n\t\t\tctrl.associatedList = response\r\n\t\t\t\t.map(r => r.Entity)\r\n\t\t\t\t.filter(e => e.Id !== ctrl.entity.Id);\r\n\r\n\t\t\tctrl.hasClassifications = some(ctrl.associatedList, e => !!e.Classification);\r\n\t\t\tctrl.hasKeys = some(ctrl.associatedList, e => !!e.ExternalKey);\r\n\r\n\t\t\tforEach(ctrl.associatedList, e => {\r\n\t\t\t\tif(e.Classification) {\r\n\t\t\t\t\te.Classification = entityManager.getClassificationById(e.Classification.Id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\te.Type.Name = ENTITY_TYPES[e.Type.Code]?.Name ?? e.Type.Name;\r\n\t\t\t\tif(e.Name === e.Code) {\r\n\t\t\t\t\te.nameCodeLabel = $sce.trustAsHtml(e.Name);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconst nameCode = `${e.Name} \\u2014 ${e.Code}`;\r\n\t\t\t\t\te.nameCodeLabel = $sce.trustAsHtml(nameCode);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tctrl.entitiesByType = ctrl.associatedList.reduce((acc, next) => {\r\n\t\t\t\tlet thisEntityGroup = acc.find(g => g.TypeCode === next.Type.Code);\r\n\t\t\t\tif(thisEntityGroup === undefined) {\r\n\t\t\t\t\tthisEntityGroup = {\r\n\t\t\t\t\t\tTypeName: next.Type.Name,\r\n\t\t\t\t\t\tTypeCode: next.Type.Code,\r\n\t\t\t\t\t\tTypePluralName: pluralize(next.Type.Name),\r\n\t\t\t\t\t\tEntities: []\r\n\t\t\t\t\t};\r\n\t\t\t\t\tacc.push(thisEntityGroup);\r\n\t\t\t\t}\r\n\t\t\t\tthisEntityGroup.Entities.push(next);\r\n\r\n\t\t\t\treturn acc;\r\n\t\t\t}, []);\r\n\t\t});\r\n\r\n\t\treturn loadingService.watch(promise);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.entity-assoc\", [])\r\n\t.component(\"entityAssociated\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tentity: \"<\",\r\n\t\t\tchangeEntity: \"=\",\r\n\t\t\tpermissions: \"<\",\r\n\t\t\ttypeConfig: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\tThere are no entities associated to this {{$ctrl.entity.Type.Name}}\\r\\n\\t
\\r\\n\\t 0\\\"\\r\\n\\t>\\r\\n\\t\\t
\\r\\n\\t\\t\\t{{type.TypePluralName}}\\r\\n\\t\\t
\\r\\n\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\tClassification\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\tExternal Key\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\tName\\r\\n\\t\\t\\t\\t\\t\\t/\\r\\n\\t\\t\\t\\t\\t\\tCode\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\tNo Entities associated to this {{$ctrl.entity.Type.Name}}\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t{{entity.Classification.Code}}\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t{{entity.ExternalKey}}\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\tAdd\\r\\n\\t\\t\\t\\t{{type.type.Name}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\";","import swal from \"sweetalert2\";\r\n\r\nimport template from \"./entity-header-modal.html\";\r\nimport \"./entity-header-modal.less\";\r\nimport { getPrimaryClassificationsForType } from \"../../getAllowedClassifications\";\r\nimport {\r\n\tEVENT_LOGOUT, \r\n\tTIME_ZONES \r\n} from \"../../../../constants\";\r\nimport {\r\n\tENTITY_TRANSLATION_KEYS, \r\n\tI18NextContext \r\n} from \"../../../../services/i18nService\";\r\nimport { isSupportedOrNullish } from \"../../isSupportedOrNullish\";\r\nimport { v7 as uuid } from \"uuid\";\r\n\r\nexport function controller(\r\n\tuiHelpers, \r\n\tappState, \r\n\tloadingService, \r\n\teventBus, \r\n\t$scope, \r\n\t$logger\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = ctrl.cancel;\r\n\tctrl.entityHeader = {};\r\n\tctrl.i18n = I18NextContext.Instance;\r\n\tctrl.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\r\n\tctrl.isSupportedOrNullish = isSupportedOrNullish;\r\n\t\r\n\tfunction onInit() {\r\n\t\tctrl.typeConfig = { ...ctrl.resolve.typeConfig };\r\n\t\tctrl.permissions = ctrl.resolve.permissions;\r\n\r\n\t\tctrl.timezones = [\r\n\t\t\t{\r\n\t\t\t\tcode: \"\",\r\n\t\t\t\tianaCode: \"\"\r\n\t\t\t},\r\n\t\t\t...TIME_ZONES\r\n\t\t];\r\n\r\n\t\tctrl.allClassifications = getPrimaryClassificationsForType(\r\n\t\t\tctrl.typeConfig.Classifications, \r\n\t\t\tappState.forms.selected.Agency.Classifications\r\n\t\t);\r\n\r\n\t\tctrl.tooltipTranslations = {\r\n\t\t\tcode: ctrl.i18n.translateEntityType(ctrl.typeConfig.Code, ENTITY_TRANSLATION_KEYS.LABELS.Code, `${ctrl.typeConfig.Name} Number`),\r\n\t\t\tname: ctrl.i18n.translateEntityType(ctrl.typeConfig.Name, ENTITY_TRANSLATION_KEYS.LABELS.Name, `${ctrl.typeConfig.Name} Name`),\r\n\t\t\tclassification: ctrl.i18n.translateEntityType(ctrl.typeConfig.Classification, ENTITY_TRANSLATION_KEYS.LABELS.Classification, \"Classification\"),\r\n\t\t\texternalKey: ctrl.i18n.translateEntityType(ctrl.typeConfig.ExternalKey, ENTITY_TRANSLATION_KEYS.LABELS.ExternalKey, \"External Key\"),\r\n\t\t\ttimezone: ctrl.i18n.translateEntityType(ctrl.typeConfig.Timezone, ENTITY_TRANSLATION_KEYS.LABELS.Timezone, \"Timezone\")\r\n\t\t};\r\n\r\n\t\tctrl.useNameComponent = !ctrl.typeConfig.Contact.IsSupported ? \"text\" : \"contact\";\r\n\t\tctrl.nameComponentSwitchable = !ctrl.typeConfig.Contact.IsRequired && !!ctrl.typeConfig.Contact.IsSupported;\r\n\r\n\t\tif(ctrl.typeConfig.IsCodeSystemManaged) {\r\n\t\t\tctrl.entityHeader.Code = uuid();\r\n\t\t}\r\n\r\n\t\tif(ctrl.typeConfig.IsExternalKeySystemManaged) {\r\n\t\t\tctrl.entityHeader.ExternalKey = uuid();\r\n\t\t}\r\n\r\n\t\teventBus.register(EVENT_LOGOUT, () => { ctrl.cancel(); }, $scope);\r\n\t}\r\n\r\n\tctrl.cancel = () => {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t};\r\n\r\n\tctrl.save = async() => {\r\n\t\tif(validate()) {\r\n\t\t\tawait ctrl.resolve.save(ctrl.entityHeader);\r\n\t\t\tctrl.modalInstance.close(ctrl.entityHeader);\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.setClassificationBox = (box) => {\r\n\t\tctrl.classificationBox = box;\r\n\r\n\t\tconst selectionChoices = uiHelpers.setDisplay(\r\n\t\t\tctrl.allClassifications, \r\n\t\t\t{ \r\n\t\t\t\trecentlyUsedEnabled: false, \r\n\t\t\t\thideCode: true \r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tif(ctrl.classificationBox) {\r\n\t\t\tctrl.classificationBox.setChoices(selectionChoices, \"value\", \"label\", true);\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.setDisplay = (id, fieldVariable) => {\r\n\t\tconst item = ctrl[fieldVariable].find(i => (i.Id === parseInt(id)) || (i.Id === id));\r\n\r\n\t\tif(!item) {\r\n\t\t\t$logger.warn(`Selected ${fieldVariable} not found as an option.`);\r\n\t\t}\r\n\r\n\t\treturn item.Name || item.Code;\r\n\t};\r\n\r\n\tctrl.handleClassificationValueChanged = (modelVal) => {\r\n\t\tconst modelValInt = parseInt(modelVal);\r\n\t\tconst selectedClassification = ctrl.allClassifications.find(a => a.Id === modelValInt);\r\n\r\n\t\tctrl.entityHeader.Classification = selectedClassification ? { Code: selectedClassification.Code } : undefined;\r\n\t};\r\n\r\n\tfunction validate() {\r\n\t\tconst validationStrings = [];\r\n\r\n\t\tif(ctrl.entityHeader.Code === undefined) {\r\n\t\t\tvalidationStrings.push(`${ctrl.tooltipTranslations.code} is required`);\r\n\t\t}\r\n\r\n\t\tif((ctrl.typeConfig.TimeZone === undefined || ctrl.typeConfig.TimeZone.IsRequired) && ctrl.entityHeader.TimeZone === undefined) {\r\n\t\t\tvalidationStrings.push(`${ctrl.tooltipTranslations.timezone} is required`);\r\n\t\t}\r\n\r\n\t\tif(\r\n\t\t\t(ctrl.typeConfig.IsNameDefaultedToCodeWhenNoContact !== true || ctrl.entityHeader.Contact !== undefined) // code is copied to name in saveEntity()\r\n\t\t\t&& (\r\n\t\t\t\t(isSupportedOrNullish(ctrl.typeConfig.Contact) && ctrl.entityHeader.Name === undefined && ctrl.entityHeader.Contact === undefined)\r\n\t\t\t\t|| (ctrl.typeConfig.Contact.IsRequired && ctrl.entityHeader.Contact === undefined)\r\n\t\t\t\t|| (!ctrl.typeConfig.Contact.IsSupported && ctrl.entityHeader.Name === undefined)\r\n\t\t\t)\r\n\t\t) {\r\n\t\t\tvalidationStrings.push(`${ctrl.tooltipTranslations.name} is required`);\r\n\t\t}\r\n\r\n\t\tif(ctrl.typeConfig.Classification?.IsRequired && ctrl.entityHeader.Classification === undefined) {\r\n\t\t\tvalidationStrings.push(`${ctrl.tooltipTranslations.classification} is required`);\r\n\t\t}\r\n\t\t\r\n\t\tif(ctrl.typeConfig.ExternalKey?.IsRequired && (ctrl.entityHeader.ExternalKey === undefined || ctrl.entityHeader.ExternalKey.trim() === \"\")) {\r\n\t\t\tvalidationStrings.push(`${ctrl.tooltipTranslations.externalKey} is required`);\r\n\t\t}\r\n\r\n\t\tif(ctrl.typeConfig.CodePattern !== undefined) {\r\n\t\t\tconst exp = new RegExp(ctrl.typeConfig.CodePattern);\r\n\t\t\tconst isMatch = exp.test(ctrl.entityHeader.Code);\r\n\r\n\t\t\tif(!isMatch) {\r\n\t\t\t\tvalidationStrings.push(\"Code is not a valid pattern\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(ctrl.typeConfig.NamePattern !== undefined) {\r\n\t\t\tconst exp = new RegExp(ctrl.typeConfig.NamePattern);\r\n\t\t\tconst isMatch = exp.test(ctrl.entityHeader.Name);\r\n\r\n\t\t\tif(!isMatch) {\r\n\t\t\t\tvalidationStrings.push(\"Entity Name is not a valid pattern\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(validationStrings.length > 0) {\r\n\t\t\tconst errorList = `
  • ${validationStrings.join(\"
  • \")}
`;\r\n\r\n\t\t\tswal.fire({\r\n\t\t\t\ttitle: \"Correct Missing Information\",\r\n\t\t\t\thtml:\r\n\t\t\t\t\t`

Please correct the following errors

\r\n\t\t\t\t\t${errorList}\r\n\t\t\t\t\t`,\r\n\t\t\t\tshowCloseButton: true,\r\n\t\t\t\ttype: \"warning\"\r\n\t\t\t});\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-header-modal\", [])\r\n\t.component(\"entityHeaderModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\",\r\n\t\t\treload: \"&\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t

Create New {{$ctrl.type.Name}}

\\r\\n
\\r\\n
\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t 0) || $ctrl.typeConfig.Classification.IsSupported\\\"\\r\\n\\t\\t>\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\r\\n\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\tCancel\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\tCreate and Add\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","import template from \"./entity-users.html\";\r\nimport \"./entity-users.less\";\r\nimport { FORM_ENTITY_USERS } from \"routes.js\";\r\n\r\nexport function controller(\r\n\tappState,\r\n\tapi,\r\n\tloadingService,\r\n\t$logger,\r\n\t$uibModal\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.edit = edit;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\r\n\t\tloadRelatedUsers();\r\n\t}\r\n\r\n\tfunction loadRelatedUsers() {\r\n\t\tconst promise = api.get(FORM_ENTITY_USERS(appState.forms.selected.Id, ctrl.entity.Id)).then((response) => {\r\n\t\t\tctrl.users = response;\r\n\t\t});\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction edit(user) {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"user-modal\",\r\n\t\t\tsize: \"xlg\",\r\n\t\t\tresolve: {\r\n\t\t\t\tuser: () => user\r\n\t\t\t},\r\n\t\t\tgetUsers: () => undefined\r\n\t\t}).result.then(() => {\r\n\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.entity-users\", [])\r\n\t.component(\"entityUsers\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tentity: \"<\",\r\n\t\t\tpermissions: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t\\t\\t\\t\\tUserName\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tFullName\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tClassification\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\tNo users associated to this {{$ctrl.entity.Type.Name}}\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{user.Username}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{user.Contact.FirstName + ' ' + user.Contact.LastName}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{entity.Classification.Code}}\\r\\n\\t\\t\\t\\t
\\r\\n
\";","import { IdentifierValueDto } from \"../../models/agency-types\";\r\n\r\nconst byName = (a, b) => a.Name < b.Name ? -1 : 1;\r\n\r\nexport const getAllowedIdentifiers = (type: IdentifierValueDto, allIdentifiers: any[], filter?: (i) => boolean) => {\r\n\tif(type === undefined) {\r\n\t\treturn allIdentifiers\r\n\t\t\t.filter(c => filter?.(c) ?? true)\r\n\t\t\t.sort(byName);\r\n\t}\r\n\tconst Identifiers = (type.Items ?? [])\r\n\t\t.filter(c => filter?.(c) ?? true)\r\n\t\t.map(c => (allIdentifiers ?? []).find(ac => ac.Code === c.Item.Code))\r\n\t\t.sort(byName);\r\n\r\n\treturn Identifiers;\r\n};\r\n\r\nexport const getRequiredIdentifiersForType = (type: IdentifierValueDto, allIdentifiers) => \r\n\tgetAllowedIdentifiers(type, allIdentifiers, c => c.IsExpected === true);","import template from \"./entity-identifiers.html\";\r\nimport \"./entity-identifiers.less\";\r\nimport {\r\n\tsome,\r\n\tfindIndex,\r\n\tkeyBy\r\n} from \"lodash\";\r\nimport {\r\n\tFORM_ENTITY_IDENTIFIERS,\r\n\tFORM_ENTITY_IDENTIFIERS_UPDATE,\r\n\tFORM_ENTITY_IDENTIFIER_ACTIVATE,\r\n\tFORM_ENTITY_IDENTIFIER_DEACTIVATE\r\n} from \"../../../routes\";\r\nimport { getRequiredIdentifiersForType } from \"../getAllowedIdentifiers\";\r\nimport { globs } from \"../../../services/globs\";\r\nimport {\r\n\tAny, Pattern \r\n} from \"../../../services/security/actionScopes\";\r\n\r\n//entity-modal\r\nexport function controller(appState, loadingService, api, $uibModal, $logger, securityService) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.addIdentifier = addIdentifier;\r\n\tctrl.editIdentifier = editIdentifier;\r\n\tctrl.deactivate = deactivate;\r\n\tctrl.activate = activate;\r\n\tctrl.identifierTypes = keyBy(appState.forms.selected.Agency.IdentifierTypes, t => t.Code);\r\n\r\n\tctrl.addNewIdentifierPattern = globs.entityTypes.byType(ctrl.typeConfig.Code).identifiers.byCode(\"*\").create;\r\n\tctrl.editIdentifierPattern = globs.entityTypes.byType(ctrl.typeConfig.Code).identifiers.byCode(\"*\").update;\r\n\tctrl.editIdentifierAction = (code) => globs.entityTypes.byType(ctrl.typeConfig.Code).identifiers.byCode(code).update;\r\n\tctrl.reactivateOrDeactivateActionScope = \r\n\t\tnew Any([\r\n\t\t\tnew Pattern(globs.entityTypes.byType(ctrl.typeConfig.Code).identifiers.byCode(\"*\").deactivate),\r\n\t\t\tnew Pattern(globs.entityTypes.byType(ctrl.typeConfig.Code).identifiers.byCode(\"*\").reactivate)\r\n\t\t]);\r\n\tctrl.canDeactivateAction = (code) => globs.entityTypes.byType(ctrl.typeConfig.Code).identifiers.byCode(code).deactivate;\r\n\tctrl.canReactivateAction = (code) => globs.entityTypes.byType(ctrl.typeConfig.Code).identifiers.byCode(code).reactivate;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.includeInactive = false;\r\n\t\tctrl.isEditingIndex = null;\r\n\r\n\t\tctrl.identifiers = [];\r\n\t\tctrl.requiredIdentifiers = getRequiredIdentifiersForType(ctrl.typeConfig?.Identifiers, appState.forms.selected.Agency.IdentifierTypes);\r\n\r\n\t\tloadIdentifiers();\r\n\t};\r\n\r\n\tfunction loadIdentifiers() {\r\n\t\tconst route = FORM_ENTITY_IDENTIFIERS(appState.forms.selected.Id, ctrl.entity.Id);\r\n\r\n\t\tconst promise = api.get(route).then(identifiers => {\r\n\t\t\tctrl.hasInactive = some(identifiers, i => !i.IsActive);\r\n\t\t\tctrl.identifiers = identifiers?.filter(i => \r\n\t\t\t\ti.Type.Code !== \"CODE\"\r\n\t\t\t\t&& securityService.isActionAllowed(globs.entityTypes.byType(ctrl.typeConfig.Code).identifiers.byCode(i.Type.Code).read)\r\n\t\t\t) ?? [];\r\n\r\n\t\t\tcheckRequiredIdentifiers();\r\n\r\n\t\t\treturn;\r\n\t\t});\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction addIdentifier() {\r\n\t\tconst instance = $uibModal.open({\r\n\t\t\tcomponent: \"edit-identifier-modal\",\r\n\t\t\tsize: \"smmd\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\tidentifier: () => null,\r\n\t\t\t\ttypes: () => ctrl.typeConfig.IncludeIdentifiers,\r\n\t\t\t\ttypeConfig: () => ctrl.typeConfig,\r\n\t\t\t\tisTypeReadonly: () => false\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tinstance.result\r\n\t\t\t.then(updated => {\r\n\t\t\t\tconst route = FORM_ENTITY_IDENTIFIERS(appState.forms.selected.Id, ctrl.entity.Id);\r\n\t\t\t\tsaveIdentifier(updated, api.post, route);\r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction editIdentifier(identifier) {\r\n\t\tconst instance = $uibModal.open({\r\n\t\t\tcomponent: \"edit-identifier-modal\",\r\n\t\t\tsize: \"smmd\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\tidentifier: () => identifier,\r\n\t\t\t\ttypes: () => ctrl.typeConfig.IncludeIdentifiers,\r\n\t\t\t\ttypeConfig: () => ctrl.typeConfig,\r\n\t\t\t\tisTypeReadonly: () => true\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tinstance.result\r\n\t\t\t.then(updated => {\r\n\t\t\t\tconst route = FORM_ENTITY_IDENTIFIERS_UPDATE(appState.forms.selected.Id, ctrl.entity.Id, updated.Id);\r\n\t\t\t\tsaveIdentifier(updated, api.put, route);\r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction saveIdentifier(identifier, verb, route) {\r\n\t\tconst promise = verb(route, identifier).then(resp => {\r\n\t\t\tconst existingIndex = findIndex(ctrl.identifiers, i => i.Id === resp.Id);\r\n\t\t\tif(existingIndex > -1) {\r\n\t\t\t\tctrl.identifiers[existingIndex] = resp;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tctrl.identifiers.push(resp);\r\n\t\t\t}\r\n\t\t\tctrl.hasInactive = some(ctrl.identifiers, i => !i.IsActive);\r\n\r\n\t\t\tcheckRequiredIdentifiers();\r\n\t\t});\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction deactivate(identifier, index) {\r\n\t\tconst route = FORM_ENTITY_IDENTIFIER_DEACTIVATE(appState.forms.selected.Id, ctrl.entity.Id, identifier.Type.Code, identifier.Value);\r\n\r\n\t\tconst promise = api.put(route).then(resp => {\r\n\t\t\tctrl.identifiers[index] = resp;\r\n\t\t\tctrl.hasInactive = some(ctrl.identifiers, i => !i.IsActive);\r\n\t\t\t\r\n\t\t\tcheckRequiredIdentifiers();\r\n\t\t});\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction activate(identifier, index) {\r\n\t\tconst route = FORM_ENTITY_IDENTIFIER_ACTIVATE(appState.forms.selected.Id, ctrl.entity.Id, identifier.Type.Code, identifier.Value);\r\n\r\n\t\tconst promise = api.put(route).then(resp => {\r\n\t\t\tctrl.identifiers[index] = resp;\r\n\t\t\tctrl.hasInactive = some(ctrl.identifiers, i => !i.IsActive);\r\n\r\n\t\t\tcheckRequiredIdentifiers();\r\n\t\t});\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction checkRequiredIdentifiers() {\r\n\t\tctrl.requiredIdentifiersNotPresent = ctrl.requiredIdentifiers\r\n\t\t\t.filter(ri => !ctrl.identifiers.some(i => i.IsActive === true && i.Type.Code === ri.Code))\r\n\t\t\t.map(i => `\"${i.Name}\"`);\r\n\t} \r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-identifiers\", [])\r\n\t.component(\"entityIdentifiers\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tentity: \"<\",\r\n\t\t\treadonly: \"<\",\r\n\t\t\tpermissions: \"<\",\r\n\t\t\ttypeConfig: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t Please click the \\\"Add Identifier\\\" button below to add identifiers \\r\\n\\t\\t\\t No identifiers \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n
Type Value
{{$ctrl.identifierTypes[identifier.Type.Code].Name}} {{identifier.Value}}
\\r\\n\\t\\t\\t\\t Add Identifier \\r\\n\\t\\t\\t
\\r\\n

0\\\">\\r\\n\\t\\r\\n\\t\\tNOTE: Identifier\\r\\n\\t\\t{{$ctrl.requiredIdentifiersNotPresent.length === 1 ? 'type' : 'types'}}\\r\\n\\t\\t{{$ctrl.requiredIdentifiersNotPresent.join(', ')}}\\r\\n\\t\\t{{$ctrl.requiredIdentifiersNotPresent.length === 1 ? 'is' : 'are'}} required but not defined.\\r\\n\\t\\r\\n

\";","import template from \"./entity-tokens.html\";\r\nimport \"./entity-tokens.less\";\r\nimport { globs } from \"../../../services/globs\";\r\nimport {\r\n\tFORM_ENTITY_TOKENS, \r\n\tFORM_TOKEN_DEACTIVATE \r\n} from \"../../../routes\";\r\n\r\nexport function controller(appState, loadingService, api, $logger, securityService) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\t// type Token = {\r\n\t\t// \tId: number;\r\n\t\t// \tCode: string;\r\n\t\t//\tHash: string;\r\n\t\t// \tCreated: string;\r\n\t\t//\tIsActive: boolean;\r\n\t\t// };\r\n\r\n\t\tctrl.tokens = []; // Token[]\r\n\r\n\t\tloadTokens();\r\n\t};\r\n\r\n\tctrl.deactivate = async(token) => {\r\n\t\tconst canDeactivate = securityService.isActionAllowed(globs.tokens.byType(token.Code).deactivate);\r\n\t\tconst canRead = securityService.isActionAllowed(globs.entityTypes.byType(ctrl.entity.Type.Code).tokens.byCode(token.Code).read);\r\n\t\tif(!canDeactivate || !canRead) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst route = FORM_TOKEN_DEACTIVATE(appState.forms.selected.Id, token.Id);\r\n\t\tconst promise = api.post(route);\r\n\r\n\t\tlet newToken = await loadingService.watch(promise);\r\n\t\tif(newToken === undefined) {\r\n\t\t\tnewToken = {\r\n\t\t\t\tCode: token.Code,\r\n\t\t\t\tCanDeactivate: false,\r\n\t\t\t\tIsActive: false\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tconst thisTokenIndex = ctrl.tokens.findIndex(t => t.Code === newToken.Code);\r\n\t\tctrl.tokens[thisTokenIndex] = {\r\n\t\t\t...ctrl.tokens[thisTokenIndex],\r\n\t\t\t...newToken\r\n\t\t};\r\n\r\n\t\tcheckForInactiveTokens();\r\n\t};\r\n\r\n\tasync function loadTokens() {\r\n\t\tconst route = FORM_ENTITY_TOKENS(appState.forms.selected.Id, ctrl.entity.Id);\r\n\r\n\t\tconst promise = api.get(route);\r\n\r\n\t\tctrl.tokens = await loadingService.watch(promise);\r\n\r\n\t\tctrl.tokens = ctrl.tokens.filter(t => securityService.isActionAllowed(globs.entityTypes.byType(ctrl.entity.Type.Code).tokens.byCode(t.Code).read));\r\n\t\tctrl.tokens.forEach(t => {\r\n\t\t\tt.CanDeactivate = t.IsActive && securityService.isActionAllowed(globs.tokens.byType(t.Code).deactivate);\r\n\t\t});\r\n\r\n\t\tcheckForInactiveTokens();\r\n\t}\r\n\r\n\tfunction checkForInactiveTokens() {\r\n\t\tctrl.hasInactiveTokens = ctrl.tokens.some(t => t.IsActive === false);\t\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-tokens\", [])\r\n\t.component(\"entityTokens\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tentity: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\tNo Tokens\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n
IdCodeCreated\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t
{{item.Id}}{{item.Code}}{{item.Created | date: 'MM-dd-yyyy HH:mm' : 'UTC'}} UTC\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\";","import template from \"./entity-inventory-operations.html\";\r\nimport \"./entity-inventory-operations.less\";\r\nimport { FORM_ENTITY_INVENTORY_ITEM } from \"../../../../routes\";\r\n\r\nexport function controller($logger, api, appState, loadingService) {\r\n\tconst ctrl = this;\r\n\tctrl.inventoryOperations = [];\r\n\r\n\tctrl.$onInit = function() {\r\n\t\t// type InventoryIOperation = {\r\n\t\t// \tId: number;\r\n\t\t// \tRecord: number;\r\n\t\t//\tValue: number\r\n\t\t// \tOccurred: string;\r\n\t\t// \tType: {\r\n\t\t//\t\tName: string;\r\n\t\t//\t\tCode: string;\r\n\t\t// };\r\n\t\t// };\r\n\r\n\t\tctrl.item = ctrl.resolve.inventoryItem;\r\n\r\n\t\tloadInventoryItem();\r\n\t};\r\n\r\n\tctrl.handleClose = () => {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t};\r\n\r\n\tasync function loadInventoryItem() {\r\n\t\tconst loadPromise = api.get(FORM_ENTITY_INVENTORY_ITEM(appState.forms.selected.Id, ctrl.resolve.forEntity.Id, ctrl.item.Item.Id));\r\n\t\tconst item = await loadingService.watch(loadPromise);\r\n\r\n\t\tctrl.inventoryOperations = item.Operations ?? [];\r\n\r\n\t\tctrl.inventoryOperations.sort((a, b) => new Date(a.Occurred) < new Date(b.Occurred) ? -1 : 1);\r\n\r\n\t\treturn item;\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-inventory-operations\", [])\r\n\t.component(\"entityInventoryOperations\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t

\\r\\n\\t\\tInventory Item Operations\\r\\n\\t

\\r\\n
\\r\\n\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t

INVENTORY ITEM

\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t

{{$ctrl.item.Item.Name || $ctrl.item.Item.Code}}

\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t

{{$ctrl.item.Item.Type.Name || $ctrl.item.Item.Type.Code}}

\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t

{{$ctrl.item.Quantity}}

\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t

{{$ctrl.item.LastModified | date: 'MM-dd-yyyy HH:mm' : 'UTC'}} UTC

\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tNo Inventory Operations\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t
TypeValueRecordOccurred
{{item.Type.Name || item.Type.Code}}{{item.Value}}{{item.Record}}{{item.Occurred | date: 'MM-dd-yyyy HH:mm' : 'UTC'}} UTC
\\r\\n\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tClose\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","import template from \"./entity-inventory.html\";\r\nimport \"./entity-inventory.less\";\r\nimport { FORM_ENTITY_INVENTORIES } from \"../../../routes\";\r\nimport inventoryOperationsModal from \"./entity-inventory-operations/entity-inventory-operations\";\r\n\r\nexport function controller(appState, loadingService, api, $logger, $uibModal) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\t// type InventoryItem = {\r\n\t\t// \tId: number;\r\n\t\t// \tItem: Entity;\r\n\t\t// \tLastModified: string;\r\n\t\t// \tOperations: InventoryOperation[];\r\n\t\t// };\r\n\r\n\t\tctrl.inventoriedItems = []; // InventoryItem[]\r\n\r\n\t\tloadInventories();\r\n\t};\r\n\r\n\tctrl.viewOperations = (inventoryItem) => {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"entity-inventory-operations\",\r\n\t\t\tsize: \"md\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\tinventoryItem: () => inventoryItem,\r\n\t\t\t\tforEntity: () => ctrl.entity\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tasync function loadInventories() {\r\n\t\tconst route = FORM_ENTITY_INVENTORIES(appState.forms.selected.Id, ctrl.entity.Id);\r\n\r\n\t\tconst promise = api.get(route);\r\n\r\n\t\tctrl.inventoriedItems = await loadingService.watch(promise);\r\n\t}\r\n}\r\n\r\nexport { inventoryOperationsModal };\r\nexport default angular.module(\"vesl.components.entity-inventory\", [inventoryOperationsModal])\r\n\t.component(\"entityInventory\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tentity: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\tNo Inventory Items\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n
ItemQuantityLast Updated
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
{{item.Item.Name || item.Item.Code}}
\\r\\n\\t\\t\\t\\t{{item.Item.Type.Name || item.Item.Type.Code}}\\r\\n\\t\\t\\t
{{item.Quantity}}{{item.LastModified | date: 'MM-dd-yyyy HH:mm' : 'UTC'}} UTC\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\";","import template from \"./entity-classifications.html\";\r\nimport \"./entity-classifications.less\";\r\nimport {\r\n\tremove as _remove,\r\n\tforEach\r\n} from \"lodash\";\r\nimport {\r\n\tFORM_ENTITY_CLASSIFICATIONS,\r\n\tFORM_ENTITY_CLASSIFICATION\r\n} from \"../../../routes\";\r\nimport { globs } from \"../../../services/globs\";\r\n\r\nexport function controller(appState, loadingService, api, $uibModal, entityManager, toastr, securityService, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.addClassification = addClassification;\r\n\tctrl.remove = remove;\r\n\r\n\tctrl.canRemoveAction = (code) => globs.entityTypes.byType(ctrl.typeConfig.Code).classifications.byCode(code).remove;\r\n\tctrl.canAddAction = (code) => globs.entityTypes.byType(ctrl.typeConfig.Code).classifications.byCode(code).add;\r\n\tctrl.canAddPattern = globs.entityTypes.byType(ctrl.typeConfig.Code).classifications.byCode(\"*\").add;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.classificationTypes = appState.forms.selected.Agency.Classifications;\r\n\t\tctrl.classifications = [];\r\n\r\n\t\tloadClassifications();\r\n\t};\r\n\r\n\tfunction loadClassifications() {\r\n\t\tconst route = FORM_ENTITY_CLASSIFICATIONS(appState.forms.selected.Id, ctrl.entity.Id);\r\n\r\n\t\tconst promise = api.get(route).then(classifications => {\r\n\t\t\tctrl.classifications = classifications.filter(c => \r\n\t\t\t\tsecurityService.isActionAllowed(globs.entityTypes.byType(ctrl.entity.Type.Code).classifications.byCode(c.Code).read)\r\n\t\t\t);\r\n\r\n\t\t\tif(ctrl.entity.Classification) {\r\n\t\t\t\tforEach(ctrl.classifications, c => {\r\n\t\t\t\t\tif(c.Id === ctrl.entity.Classification.Id) {\r\n\t\t\t\t\t\tc.isPrimary = true;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tctrl.classifications = ctrl.classifications.sort((el1, el2) => {\r\n\t\t\t\t\tif(el1.isPrimary && !el2.isPrimary) {\r\n\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse return el1.Code < el2.Code;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t});\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction addClassification() {\r\n\t\tconst instance = $uibModal.open({\r\n\t\t\tcomponent: \"edit-classification-modal\",\r\n\t\t\tsize: \"sm\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\texisting: () => ctrl.classifications,\r\n\t\t\t\ttypeConfig: () => ctrl.typeConfig\t\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tinstance.result\r\n\t\t\t.then(newClassification => {\r\n\t\t\t\tconst route = FORM_ENTITY_CLASSIFICATION(appState.forms.selected.Id, ctrl.entity.Id, newClassification);\r\n\t\t\t\tconst promise = api.post(route).then(() => {\r\n\t\t\t\t\tctrl.classifications.push({ ...entityManager.getClassification(newClassification) });\r\n\t\t\t\t\ttoastr.success(`${newClassification} classification was added.`);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tloadingService.watch(promise);\r\n\t\t\t})\r\n\t\t\t.catch(err => !!err && toastr.error(`${ctrl.entity.Name} failed to update.`));\r\n\t}\r\n\r\n\tfunction remove(classification) {\r\n\t\tconst route = FORM_ENTITY_CLASSIFICATION(appState.forms.selected.Id, ctrl.entity.Id, classification.Code);\r\n\r\n\t\tconst promise = api.delete(route)\r\n\t\t\t.then(() => {\r\n\t\t\t\t_remove(ctrl.classifications, c => c.Code === classification.Code);\r\n\t\t\t\ttoastr.success(`${classification.Code} classification was removed.`);\r\n\t\t\t})\r\n\t\t\t.catch(() => toastr.error(`${ctrl.entity.Name} failed to update.`));\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-classifications\", [])\r\n\t.component(\"entityClassifications\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tentity: \"<\",\r\n\t\t\treadonly: \"<\",\r\n\t\t\tpermissions: \"<\",\r\n\t\t\ttypeConfig: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t Please click the \\\"Add Classification\\\" button below to add classifications \\r\\n\\t\\t\\t No classifications \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n
Type Description
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t {{classification.Code}} {{classification.Name}}
\\r\\n\\t\\t\\t\\tAdd Classification\\r\\n\\t\\t\\t
\";","import { orderBy } from \"lodash\";\r\nimport template from \"./entity-effective-ranges.html\";\r\nimport \"./entity-effective-ranges.less\";\r\nimport moment from \"moment-timezone\";\r\nimport {\r\n\tFORM_ENTITY_EFFECTIVE_RANGE,\r\n\tFORM_ENTITY_EFFECTIVE_RANGES\r\n} from \"../../../routes\";\r\nimport { globs } from \"../../../services/globs\";\r\nimport {\r\n\tActionOrPattern, \r\n\tAny \r\n} from \"../../../services/security/actionScopes\";\r\n\r\nexport function controller(appState, loadingService, api, $uibModal, $logger, toastr, securityService) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.canAddPattern = globs.entityTypes.byType(ctrl.typeConfig.Code).effective.byCode(\"*\").create;\r\n\tctrl.canUpdateActionOrPattern = (scope) => {\r\n\t\treturn !!scope \r\n\t\t\t? globs.entityTypes.byType(ctrl.typeConfig.Code).effective.byCode(scope).update \r\n\t\t\t: globs.entityTypes.byType(ctrl.typeConfig.Code).effective.byCode(\"*\").update;\r\n\t};\r\n\r\n\tconst canUpdate = globs.entityTypes.byType(ctrl.typeConfig.Code).effective.byCode(\"*\").update;\r\n\tconst canDelete = globs.entityTypes.byType(ctrl.typeConfig.Code).effective.byCode(\"*\").delete;\r\n\tctrl.canUpdateOrDeleteAnyActionScope = new Any([\r\n\t\tnew ActionOrPattern(canUpdate),\r\n\t\tnew ActionOrPattern(canDelete)\r\n\t]);\r\n\t\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.effectiveRanges = [];\r\n\t\tctrl.form = appState.forms.selected;\r\n\r\n\t\tconst canUpdate = securityService.isPatternAllowed(globs.entityTypes.byType(ctrl.typeConfig.Code).effective.byCode(\"*\").update);\r\n\r\n\t\tctrl.numColumns = ctrl.permissions.Actions.CanRemove && canUpdate ? 6 \r\n\t\t\t: ctrl.permissions.Actions.CanRemove || canUpdate ? 5\r\n\t\t\t: 4;\r\n\r\n\t\tloadEffectiveRanges();\r\n\t};\r\n\r\n\tfunction loadEffectiveRanges() {\r\n\t\tconst route = FORM_ENTITY_EFFECTIVE_RANGES(appState.forms.selected.Id, ctrl.entity.Id);\r\n\r\n\t\tconst promise = api.get(route).then(ranges => {\r\n\t\t\tctrl.effectiveRanges = orderBy(ranges, [\"AsEarlyAs\", \"Start\"]);\r\n\t\t\tconst now = new Date();\r\n\t\t\tfor(const range of ctrl.effectiveRanges) {\r\n\t\t\t\tconst start = new Date(range.Start);\r\n\t\t\t\tconst end = range.End && new Date(range.End);\r\n\r\n\t\t\t\tif(now < start) {\r\n\t\t\t\t\trange.statusClass = \"future\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(end !== undefined && now >= end) {\r\n\t\t\t\t\trange.statusClass = \"past\";\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\trange.statusClass = \"current\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t});\r\n\r\n\t\treturn loadingService.watch(promise);\r\n\t}\r\n\r\n\tctrl.formatDate = (date) => {\r\n\t\tif(date === undefined) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\treturn moment(date).format(\"MM-DD-YYYY hh:mm A Z\");\r\n\t};\r\n\r\n\tctrl.addEffectiveRange = () => {\r\n\t\tconst instance = $uibModal.open({\r\n\t\t\tcomponent: \"edit-effective-range-modal\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\texisting: () => ctrl.effectiveRanges,\r\n\t\t\t\ttypeConfig: () => ctrl.typeConfig\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn instance.result\r\n\t\t\t.then(newEffectiveRange => {\r\n\t\t\t\tconst route = FORM_ENTITY_EFFECTIVE_RANGES(appState.forms.selected.Id, ctrl.entity.Id);\r\n\t\t\t\tconst promise = api.post(route, newEffectiveRange)\r\n\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\ttoastr.success(\"New effective range was added.\");\r\n\r\n\t\t\t\t\t\treturn loadEffectiveRanges();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\treturn loadingService.watch(promise);\r\n\t\t\t})\r\n\t\t\t.catch(err => !!err && toastr.error(`${ctrl.entity.Name} failed to update.`));\r\n\t};\r\n\r\n\tctrl.editEffectiveRange = (range) => {\r\n\t\tconst instance = $uibModal.open({\r\n\t\t\tcomponent: \"edit-effective-range-modal\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\texisting: () => ctrl.effectiveRanges,\r\n\t\t\t\trange: () => range,\r\n\t\t\t\ttimeZone: () => ctrl.timeZone,\r\n\t\t\t\ttypeConfig: () => ctrl.typeConfig\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn instance.result\r\n\t\t\t.then(updated => {\r\n\t\t\t\tconst route = FORM_ENTITY_EFFECTIVE_RANGE(appState.forms.selected.Id, ctrl.entity.Id, updated.Id);\r\n\t\t\t\tconst promise = api.put(route, updated)\r\n\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\ttoastr.success(\"Effective range was updated.\");\r\n\r\n\t\t\t\t\t\treturn loadEffectiveRanges();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\treturn loadingService.watch(promise);\r\n\t\t\t});\r\n\t};\r\n\r\n\tctrl.onUpdate = async() => {\r\n\t\tawait loadEffectiveRanges();\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-effective-ranges\", [])\r\n\t.component(\"entityEffectiveRanges\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tentity: \"<\",\r\n\t\t\treadonly: \"<\",\r\n\t\t\tpermissions: \"<\",\r\n\t\t\ttypeConfig: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t Please click the \\\"Add Effective Range\\\" button below to add effective ranges \\r\\n\\t\\t\\t No effective ranges \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n
Start End Scope
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
{{$ctrl.formatDate(range.Start)}}
\\r\\n\\t\\t\\t\\tAs Early As {{$ctrl.formatDate(range.AsEarlyAs)}}\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t
{{$ctrl.formatDate(range.End)}}
\\r\\n\\t\\t\\t\\tNo Later Than {{$ctrl.formatDate(range.NoLaterThan)}}\\r\\n\\t\\t\\t
{{range.Scope || \\\"--\\\"}}
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Past\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Current\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Future\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tAdd Effective Range\\r\\n\\t\\t\\t
\";","import template from \"./edit-identifier.html\";\r\nimport \"./edit-identifier.less\";\r\nimport { getAllowedIdentifiers } from \"../../getAllowedIdentifiers\";\r\nimport { cloneDeep } from \"lodash\";\r\nimport swal from \"sweetalert2\";\r\nimport { globs } from \"../../../../services/globs\";\r\n\r\nexport function controller(appState, $logger, securityService) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.handleSave = handleSave;\r\n\tctrl.identifier = cloneDeep(ctrl.resolve.identifier);\r\n\r\n\tctrl.$onInit = function() {\r\n\t\tconst availableIdentifiers = appState.forms.selected.Agency.IdentifierTypes;\r\n\r\n\t\t// TODO: This is going to break if a role is allowed to edit different identifiers that they can create.\r\n\t\t// need to discuss what \"edit\" means versus \"create\":\r\n\t\t// - is changing an identifier's type equivalent to creating a new one?\r\n\t\t// - should type be readonly on an existing identifier?\r\n\t\tctrl.identifierTypes = getAllowedIdentifiers(\r\n\t\t\tctrl.resolve.typeConfig?.Identifiers, \r\n\t\t\tavailableIdentifiers,\r\n\t\t\t(identifier) => securityService.isActionAllowed(globs.entityTypes.byType(ctrl.resolve.typeConfig?.Code).identifiers.byCode(identifier.Item.Code).create)\r\n\t\t);\r\n\r\n\t\tif(ctrl.resolve.identifier === null) {\r\n\t\t\tctrl.resolve.identifier = {\r\n\t\t\t\tType: {\r\n\t\t\t\t\tCode: ctrl.identifierTypes[0].Code\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t}\r\n\t};\r\n\r\n\tfunction handleSave() {\r\n\t\tif(!validate()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tctrl.modalInstance.close(ctrl.identifier);\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t}\r\n\r\n\tfunction validate() {\r\n\t\tconst thisType = ctrl.identifierTypes.find(t => t.Code === ctrl.identifier.Type.Code);\r\n\r\n\t\tif(thisType.ValuePattern === undefined) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst exp = new RegExp(thisType.ValuePattern);\r\n\t\tconst isMatch = exp.test(ctrl.identifier.Value);\r\n\r\n\t\tif(!isMatch) {\r\n\t\t\tswal.fire({\r\n\t\t\t\ttitle: \"Invalid Identifier Value\",\r\n\t\t\t\thtml:\r\n\t\t\t\t\t\"The identifier value entered is not in a valid format.\",\r\n\t\t\t\tshowCloseButton: true,\r\n\t\t\t\ttype: \"warning\"\r\n\t\t\t});\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.edit-identifier-modal\", [])\r\n\t.component(\"editIdentifierModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t {{JSON.stringify($ctrl.resolve.identifier)}} {{$ctrl.resolve.identifier.Id ? 'Edit' : 'New'}} {{$ctrl.identifierTypes[$ctrl.identifier.Type.Code].name || 'identifier'}} \\r\\n
\\r\\n\\r\\n\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tRequired\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tRequired\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\r\\n\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\tClose\\r\\n\\t\\t\\tSave\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","import { globs } from \"../../../../services/globs\";\r\nimport {\r\n\tAction, All \r\n} from \"../../../../services/security/actionScopes\";\r\nimport { getAttributeClassificationsForType } from \"../../getAllowedClassifications\";\r\nimport template from \"./edit-classification.html\";\r\nimport \"./edit-classification.less\";\r\nimport {\r\n\tremove,\r\n\tsome\r\n} from \"lodash\";\r\n\r\n//entity-modal\r\nexport function controller(appState, securityService, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.handleSave = handleSave;\r\n\r\n\tctrl.$onInit = function() {\r\n\t\tctrl.classificationTypes = getAttributeClassificationsForType(\r\n\t\t\tctrl.resolve.typeConfig.Classifications,\r\n\t\t\tappState.forms.selected.Agency.Classifications\r\n\t\t)\r\n\t\t\t.filter(c => {\r\n\t\t\t\tconst canReadClassification = new Action(globs.entityTypes.byType(ctrl.resolve.typeConfig.Code).classifications.byCode(c.Code).read);\r\n\t\t\t\tconst canAddClassification = new Action(globs.entityTypes.byType(ctrl.resolve.typeConfig.Code).classifications.byCode(c.Code).add);\r\n\t\t\t\t\r\n\t\t\t\treturn securityService.isActionScopeAllowed(new All([canReadClassification, canAddClassification]));\r\n\t\t\t});\r\n\t\t\r\n\t\tremove(ctrl.classificationTypes, t => some(ctrl.resolve.existing, existing => existing.Code === t.Code));\r\n\t\tctrl.classification = ctrl.classificationTypes[0]?.Code;\r\n\t};\r\n\r\n\tfunction handleSave() {\r\n\t\tctrl.modalInstance.close(ctrl.classification);\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.edit-classification-modal\", [])\r\n\t.component(\"editClassificationModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t Add Classification \\r\\n
\\r\\n\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t Close \\r\\n\\t\\t\\t Save \\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","import { globs } from \"../../../../services/globs\";\r\nimport template from \"./edit-effective-range.html\";\r\nimport \"./edit-effective-range.less\";\r\n\r\nimport moment from \"moment\";\r\n\r\nexport function controller($logger, toastr, securityService) {\r\n\tconst ctrl = this;\r\n\tthis.modelValues = {};\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.handleSave = handleSave;\r\n\r\n\tctrl.$onInit = function() {\r\n\t\tctrl.local = \"local\";\r\n\t\tif(ctrl.resolve.range) {\r\n\t\t\tctrl.modelValues = {\r\n\t\t\t\t...ctrl.resolve.range\r\n\t\t\t};\r\n\t\t}\r\n\t};\r\n\r\n\tfunction handleSave() {\r\n\t\tconst values = {\r\n\t\t\t...this.modelValues,\r\n\t\t\tStart: this.modelValues.Start,\r\n\t\t\tEnd: this.modelValues.End,\r\n\t\t\tAsEarlyAs: this.modelValues.AsEarlyAs,\r\n\t\t\tNoLaterThan: this.modelValues.NoLaterThan,\r\n\t\t\tScope: this.modelValues.Scope?.toUpperCase()\r\n\t\t};\r\n\r\n\t\tconst errs = validate(values);\r\n\t\tif(!!errs?.length) {\r\n\t\t\ttoastr.error(`${errs.map(e => `\\u2022 ${e}`).join(\"
\")}`);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tctrl.modalInstance.close(values);\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t}\r\n\r\n\tfunction validate(values) {\r\n\t\tconst errors = [];\r\n\t\tif(values.Start === undefined) {\r\n\t\t\terrors.push(\"Start value cannot be empty\");\r\n\t\t}\r\n\r\n\t\tconst moments = {\r\n\t\t\tstart: moment(values.Start),\r\n\t\t\tend: values.End && moment(values.End),\r\n\t\t\tasEarlyAs: values.AsEarlyAs && moment(values.AsEarlyAs),\r\n\t\t\tnoLaterThan: values.NoLaterThan && moment(values.NoLaterThan)\r\n\t\t};\r\n\r\n\t\tif(moments.asEarlyAs && moments.start.isBefore(moments.asEarlyAs)) {\r\n\t\t\terrors.push(\"As Early As value must be before Start value\");\r\n\t\t}\r\n\t\tif(moments.noLaterThan && moments.start.isSameOrAfter(moments.noLaterThan)) {\r\n\t\t\terrors.push(\"No Later Than value must be after Start value\");\r\n\t\t}\r\n\t\tif(moments.end) {\r\n\t\t\tif(moments.start.isAfter(moments.end)) {\r\n\t\t\t\terrors.push(\"Start value must be before End value\");\r\n\t\t\t}\r\n\t\t\tif(moments.noLaterThan && moments.noLaterThan.isBefore(moments.end)) {\r\n\t\t\t\terrors.push(\"No Later Than value must be after End value\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(values.Scope) {\r\n\t\t\tconst scopeAction = ctrl.resolve.range === undefined ? \r\n\t\t\t\tglobs.entityTypes.byType(ctrl.resolve.typeConfig.Code).effective.byCode(values.Scope).create\r\n\t\t\t\t: globs.entityTypes.byType(ctrl.resolve.typeConfig.Code).effective.byCode(values.Scope).update;\r\n\r\n\t\t\tconst isScopeAllowed = securityService.isActionAllowed(scopeAction);\r\n\r\n\t\t\tif(!isScopeAllowed) {\r\n\t\t\t\terrors.push(\"Scope is invalid.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn errors;\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.edit-effective-range-modal\", [])\r\n\t.component(\"editEffectiveRangeModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t {{$ctrl.resolve.range === undefined ? \\\"Add Effective Range\\\" : \\\"Edit Effective Range\\\"}} \\r\\n\\t (All times are local) \\r\\n
\\r\\n\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t Close \\r\\n\\t\\t\\t Save \\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","import template from \"./entity-reporting.html\";\r\nimport \"./entity-reporting.less\";\r\nimport swal from \"sweetalert2\";\r\n\r\nimport { FORM_ENTITY_NUMBERS } from \"../../../routes\";\r\n\r\nexport function controller(appState, api, toastr, loadingService, $uibModal, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tconst nomenclature = appState.forms.selected.nomenclature;\r\n\t\tctrl.positiveNomenclature = nomenclature.PositiveReport;\r\n\r\n\t\tloadNextReportNumber();\r\n\t};\r\n\r\n\tfunction loadNextReportNumber() {\r\n\t\tconst route = FORM_ENTITY_NUMBERS(appState.forms.selected.Id, ctrl.entity.Id);\r\n\t\t\r\n\t\tconst promise = api.get(route)\r\n\t\t\t.then(nextNumber => {\r\n\t\t\t\tctrl.nextNumber = nextNumber.Next;\r\n\t\t\t\tif(nextNumber.etag) {\r\n\t\t\t\t\tctrl.etag = nextNumber.etag; \r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn;\r\n\t\t\t});\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction setNextReportNumber(number) {\r\n\t\tconst route = FORM_ENTITY_NUMBERS(appState.forms.selected.Id, ctrl.entity.Id);\r\n\t\tconst payload = {\r\n\t\t\tNextNumber: number,\r\n\t\t\tifMatch: ctrl.etag\r\n\t\t};\r\n\t\t\r\n\t\tconst promise = api.put(route, payload)\r\n\t\t\t.then((success) => {\r\n\t\t\t\tctrl.nextNumber = success.Next;\r\n\t\t\t\tctrl.etag = success.etag;\r\n\r\n\t\t\t\ttoastr.success(`Successfully updated next report number to be ${number}.`);\r\n\r\n\t\t\t\treturn;\r\n\t\t\t});\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tctrl.editNextNumber = () => {\r\n\t\tconst instance = $uibModal.open({\r\n\t\t\tcomponent: \"edit-report-number-modal\",\r\n\t\t\tsize: \"sm\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\tnumber: () => ctrl.nextNumber\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tinstance.result\r\n\t\t\t.then(updated => {\r\n\t\t\t\tif(updated < ctrl.nextNumber) {\r\n\t\t\t\t\treturn showLessThanCurrentWarning()\r\n\t\t\t\t\t\t.then(proceed => {\r\n\t\t\t\t\t\t\tif(proceed.dismiss) {\r\n\t\t\t\t\t\t\t\treturn; \r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tsetNextReportNumber(updated);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsetNextReportNumber(updated);\r\n\t\t\t});\r\n\t};\r\n\r\n\tfunction showLessThanCurrentWarning() {\r\n\t\treturn swal.fire({\r\n\t\t\ttitle: \"Warning!\",\r\n\t\t\thtml:\r\n\t\t\t\t`You are attempting to set the next report number to be less than the current next number.\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\tThis may result in conflicts with existing reports.\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\tAre you sure you want to do that?`,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\",\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Yes, do it!\",\r\n\t\t\tfocusCancel: true,\r\n\t\t\treverseButtons: true\r\n\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tthis.$logger.error(err);\r\n\r\n\t\t\t\tthrow err;\r\n\t\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.entity-reporting\", [])\r\n\t.component(\"entityReporting\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tentity: \"<\",\r\n\t\t\tpermissions: \"<\",\r\n\t\t\treadonly: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tNext {{$ctrl.positiveNomenclature}} Number\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t{{$ctrl.nextNumber}}\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","import template from \"./edit-report-number.html\";\r\nimport \"./edit-report-number.less\";\r\n\r\nexport function controller() {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.handleSave = handleSave;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.number = ctrl.resolve.number;\r\n\t};\r\n\r\n\tfunction handleSave() {\r\n\t\tctrl.modalInstance.close(ctrl.number);\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.edit-report-number-modal\", [])\r\n\t.component(\"editReportNumberModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","import entityContacts from \"./entity-contacts/entity-contacts.js\";\r\nimport entityContact from \"./entity-contact/entity-contact.js\";\r\nimport entityBusiness from \"./entity-business/entity-business.js\";\r\nimport entityBusinessModal from \"./entity-business/entity-business-modal/entity-business-modal.js\";\r\nimport entityBusinessProfile from \"./entity-business/entity-business-profile/entity-business-profile.js\";\r\nimport entityBusinessCharges from \"./entity-business/entity-business-charges/entity-business-charges.js\";\r\nimport entityBusinessChargeModal from \"./entity-business/entity-business-charges/entity-business-charge-modal/entity-business-charge-modal.js\";\r\nimport entityBusinessProducts from \"./entity-business/entity-business-products/entity-business-products.js\";\r\nimport entityBusinessProductModal from \"./entity-business/entity-business-products/entity-business-product-modal/entity-business-product-modal.js\";\r\nimport entityContactModal from \"./entity-contact/entity-contact-modal/entity-contact-modal.js\";\r\nimport entityForm from \"./entity-form/entity-form.js\";\r\nimport nameOrContact from \"./name-or-contact/name-or-contact.js\";\r\nimport entityModal from \"./entity-modal/entity-modal.js\";\r\nimport entityAssociated from \"./entity-assoc/entity-assoc.js\";\r\nimport entityHeaderModal from \"./entity-assoc/entity-header-modal/entity-header-modal.js\";\r\nimport entityUsers from \"./entity-users/entity-users.js\";\r\nimport entityIdentifiers from \"./entity-identifiers/entity-identifiers.js\";\r\nimport entityTokens from \"./entity-tokens/entity-tokens.js\";\r\nimport entityInventory, { inventoryOperationsModal } from \"./entity-inventory/entity-inventory.js\";\r\nimport entityClassifications from \"./entity-classifications/entity-classifications.js\";\r\nimport entityEffectiveRanges from \"./entity-effective-ranges/entity-effective-ranges.js\";\r\nimport editIdentifier from \"./entity-identifiers/edit-identifier/edit-identifier\";\r\nimport editClassification from \"./entity-classifications/edit-classification/edit-classification\";\r\nimport editEffectiveRangeModal from \"./entity-effective-ranges/edit-effective-range/edit-effective-range\";\r\nimport entityReporting from \"./entity-reporting/entity-reporting.js\";\r\nimport editNextNumber from \"./entity-reporting/edit-report-number/edit-report-number\";\r\n\r\nconst deps = [\r\n\tentityBusiness,\r\n\tentityBusinessModal,\r\n\tentityBusinessProfile,\r\n\tentityBusinessCharges,\r\n\tentityBusinessChargeModal,\r\n\tentityBusinessProducts,\r\n\tentityBusinessProductModal,\r\n\tentityContacts,\r\n\tentityContact,\r\n\tentityContactModal,\r\n\tentityForm,\r\n\tentityModal,\r\n\tentityAssociated,\r\n\tentityUsers,\r\n\tentityIdentifiers,\r\n\tentityInventory,\r\n\tinventoryOperationsModal,\r\n\tentityClassifications,\r\n\tentityEffectiveRanges,\r\n\teditEffectiveRangeModal,\r\n\teditIdentifier,\r\n\teditClassification,\r\n\tentityReporting, \r\n\teditNextNumber,\r\n\tentityTokens,\r\n\tentityHeaderModal,\r\n\tnameOrContact\r\n];\r\n\r\nexport default angular.module(\"vesl.components.entities\", deps).name;\r\n","export default \"
\\r\\n\\t\\r\\n\\t\\tEdit Next Report Number\\r\\n\\t\\r\\n
\\r\\n\\r\\n\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tRequired\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\r\\n\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\tClose\\r\\n\\t\\t\\tSave\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\";","const template = `\r\n \r\n OFFLINE\r\n \r\n`;\r\n\r\nfunction controller($window, $scope) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.active = true;\r\n\tctrl.$onInit = onInit;\r\n\r\n\tfunction onInit() {\r\n\t\tconst _window = angular.element($window);\r\n\t\t_window.on(\"offline\", () => {\r\n\t\t\tthis.active = true;\r\n\t\t\t$scope.$evalAsync();\r\n\t\t});\r\n\t\t_window.on(\"online\", () => {\r\n\t\t\tthis.active = false;\r\n\t\t\t$scope.$evalAsync();\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.componenet.online-notifier\", [])\r\n\t.component(\"onlineNotifier\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","import apiUpdatedNotifier from \"./api-updated-notifier\";\r\nimport onlineNotifier from \"./online-notifier\";\r\n\r\nconst deps = [apiUpdatedNotifier, onlineNotifier];\r\n\r\nexport default angular\r\n\t.module(\"vesl.componenet.environment-notifier\", deps)\r\n\t.component(\"environmentNotifier\", {\r\n\t\ttemplate: `\r\n \r\n \r\n \r\n \r\n \r\n `\r\n\t})\r\n\t.component(\"notifier\", {\r\n\t\ttransclude: {\r\n\t\t\tmessage: \"notifierMessage\",\r\n\t\t\tactions: \"?notifierActions\"\r\n\t\t},\r\n\t\ttemplate: `\r\n
\r\n
\r\n `\r\n\t}).name;\r\n","const template = `\r\n \r\n UPDATES AVAILABLE\r\n \r\n \r\n \r\n \r\n`;\r\n\r\nfunction controller() {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.active = true;\r\n\tctrl.$onInit = onInit;\r\n\r\n\tfunction onInit() {\r\n\t\t// todo\r\n\t\t// - store current api version local\r\n\t\t// - pull on config variable that watches api header\r\n\t\t// watch for changes\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.componenet.api-updated-notifier\", [])\r\n\t.component(\"apiUpdatedNotifier\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","import template from \"./change-password-modal.html\";\r\n\r\n//change-password-modal\r\nexport function controller(api, loadingService, toastr) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.changePassword = changePassword;\r\n\tctrl.handleClose = handleClose;\r\n\r\n\tfunction onInit() {\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.close();\r\n\t}\r\n\t\r\n\tfunction changePassword() {\r\n\t\tconst params = {\r\n\t\t\tCurrentPassword: ctrl.currentPassword,\r\n\t\t\tPassword: ctrl.newPassword\r\n\t\t};\r\n\t\t\r\n\t\tconst promise = api\r\n\t\t\t.post(\"api/account/password/change\", params)\r\n\t\t\t.then(() => {\r\n\t\t\t\ttoastr.success(\"Your password has been updated.\");\r\n\t\t\t\tctrl.modalInstance.close();\r\n\t\t\t});\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.change-password-modal\", [])\r\n\t.component(\"changePasswordModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tmodalInstance: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t\\r\\n\\t\\tChange Password\\r\\n\\t\\r\\n
\\r\\n\\r\\n\\t

\\r\\n\\t\\tTo change the password you use to login, fill in the form below and click Save.\\r\\n\\t\\tIf you don't want to change your password now, click Cancel.\\r\\n\\t

\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\r\\n
\\r\\n\\tCancel\\r\\n\\tSave\\r\\n
\";","import template from \"./choices-select.html\";\r\nimport \"./choices-select.less\";\r\n\r\n// selection\r\nexport class Controller {\r\n\tconstructor($logger) {\r\n\t\tthis.$logger = $logger;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t}\r\n\r\n\tsetChoicesBox(box) {\r\n\t\tthis.box = box;\r\n\r\n\t\treturn this.setBox({ box: this });\r\n\t}\r\n\r\n\tenable() {\r\n\t\treturn this.box.enable();\r\n\t}\r\n\r\n\tdisable() {\r\n\t\tthis.box.hideDropdown();\r\n\t\treturn this.box.disable();\r\n\t}\r\n\r\n\tgetValue(boolVal) {\r\n\t\treturn this.box.getValue(boolVal);\r\n\t}\r\n\r\n\tremoveItemsByValue(values) {\r\n\t\tif(values === this.selectModel) {\r\n\t\t\tthis.selectModel = undefined;\r\n\t\t}\r\n\r\n\t\treturn this.box.removeItemsByValue(values);\r\n\t}\r\n\r\n\tsetChoices(choice, valStr, labelStr, boolVal) {\r\n\t\treturn this.box.setChoices(choice, valStr, labelStr, boolVal);\r\n\t}\r\n\r\n\tsetValueByChoice(strVal) {\r\n\t\treturn this.box.setValueByChoice(strVal);\r\n\t}\r\n\r\n\tclearStore() {\r\n\t\treturn this.box.clearStore();\r\n\t}\r\n\r\n\tsetChoicesDisplay(id) {\r\n\t\treturn this.setDisplay({ value: id });\r\n\t}\r\n\r\n\thandleChoicesValueChanged() {\r\n\t\tconst modelVal = this.selectModel;\r\n\t\treturn this.handleValueChanged({ value: modelVal });\r\n\t}\r\n\r\n\tclearSelected() {\r\n\t\tthis.box.removeActiveItems();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.choices-select\", [])\r\n\t.component(\"choicesSelect\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tsetDisplay: \"&\",\r\n\t\t\tsetBox: \"&\",\r\n\t\t\thandleValueChanged: \"&\",\r\n\t\t\tselectId: \"<\",\r\n\t\t\tlabel: \"<\",\r\n\t\t\tsearch: \"<\",\r\n\t\t\tisReadonly: \"<\",\r\n\t\t\tselectModel: \"=\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\r\\n\";","import template from \"./effective-range-actions.html\";\r\nimport \"./effective-range-actions.less\";\r\n\r\nimport { FORM_ENTITY_EFFECTIVE_RANGE } from \"../../routes\";\r\nimport { globs } from \"../../services/globs\";\r\n\r\nfunction controller(\r\n\t$logger,\r\n\t$uibModal, \r\n\tappState,\r\n\tapi,\r\n\ttoastr,\r\n\tloadingService,\r\n\tsecurityService\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.formId = appState.forms.selected.Id;\r\n\t\t\r\n\t\tctrl.canDelete = securityService.isActionOrPatternAllowed(globs.entityTypes.byType(ctrl.entity.Type.Code).effective.byCode(ctrl.range.Scope || \"*\").delete);\r\n\r\n\t\tconst now = new Date();\r\n\t\tconst rangeStart = new Date(ctrl.range.Start);\r\n\t\tconst rangeEnd = ctrl.range.End && new Date(ctrl.range.End);\r\n\r\n\t\tconst canEdit = securityService.isActionOrPatternAllowed(globs.entityTypes.byType(ctrl.entity.Type.Code).effective.byCode(ctrl.range.Scope || \"*\").update);\r\n\r\n\t\tctrl.canSet = canEdit === true\r\n\t\t\t&& rangeStart <= now\r\n\t\t\t&& (rangeEnd === undefined || rangeEnd > now);\r\n\t};\r\n\r\n\tctrl.endNow = () => {\r\n\t\tconst route = FORM_ENTITY_EFFECTIVE_RANGE(appState.forms.selected.Id, ctrl.entity.Id, ctrl.range.Id);\r\n\r\n\t\tconst updated = {\r\n\t\t\t...ctrl.range,\r\n\t\t\tEnd: new Date().toISOString()\r\n\t\t};\r\n\r\n\t\tdelete updated.statusClass;\r\n\r\n\t\tconst promise = api.put(route, updated)\r\n\t\t\t.then(() => {\r\n\t\t\t\ttoastr.success(\"Effective range end was updated.\");\r\n\r\n\t\t\t\treturn ctrl.onRangeUpdate();\r\n\t\t\t});\r\n\r\n\t\treturn loadingService.watch(promise);\r\n\t};\r\n\r\n\tctrl.remove = () => {\r\n\t\tconst route = FORM_ENTITY_EFFECTIVE_RANGE(appState.forms.selected.Id, ctrl.entity.Id, ctrl.range.Id);\r\n\r\n\t\tconst promise = api.delete(route)\r\n\t\t\t.then(() => {\r\n\t\t\t\ttoastr.success(\"Effective range was removed.\");\r\n\r\n\t\t\t\treturn ctrl.onRangeUpdate();\r\n\t\t\t})\r\n\t\t\t.catch((err) => {\r\n\t\t\t\t$logger.exception(err, \"attempted to remove effective range\", {\r\n\t\t\t\t\trange: ctrl.range, \r\n\t\t\t\t\tentity: ctrl.entity\r\n\t\t\t\t});\r\n\r\n\t\t\t\ttoastr.error(`${ctrl.entity.Name} failed to update.`);\r\n\t\t\t});\r\n\r\n\t\treturn loadingService.watch(promise);\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.effective-range-actions\", [])\r\n\t.component(\"effectiveRangeActions\", {\r\n\t\ttemplate,\r\n\t\ttransclude: true,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\tonRangeUpdate: \"<\",\r\n\t\t\trange: \"=\",\r\n\t\t\tentity: \"<\",\r\n\t\t\tpermissions: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Remove\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t End Now\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\r\\n\";","import template from \"./form-selector.html\";\r\nimport \"./form-selector.less\";\r\nimport hotkeyConfigs from \"../../services/hotkeyConfig\";\r\nimport { EVENT_NEW_FORM } from \"constants.js\";\r\n\r\n// formSelector\r\nexport function controller(appState, $uibModal, hotkeys, eventBus, $scope) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = init;\r\n\tctrl.onInit = init;\r\n\tctrl.appState = appState;\r\n\tctrl.openFormSelectorModal = openFormSelectorModal;\r\n\r\n\tfunction init() {\r\n\t\tctrl.isCollapsed = true;\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.showSwitcher = appState.forms.items.length > 1;\r\n\t\tctrl.logo = ctrl.form.Agency.Logo ?? ctrl.form.nomenclature.LogoUrl;\r\n\r\n\t\tif(ctrl.showSwitcher) {\r\n\t\t\thotkeys.add(hotkeyConfigs.GLOBAL.OPEN_FORM_SWITCHER(() => { openFormSelectorModal(); }));\r\n\t\t}\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_NEW_FORM,\r\n\t\t\t() => {\r\n\t\t\t\tinit();\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\t}\r\n\tfunction openFormSelectorModal() {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"form-selector-modal\",\r\n\t\t\tsize: \"md\"\r\n\t\t});\r\n\t}\r\n}\r\nexport default angular\r\n\t.module(\"vesl.components.form-selector\", [])\r\n\t.component(\"formSelector\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t

{{$ctrl.form.Name || 'VESL'}}

\\r\\n\";","import { find } from \"lodash\";\r\nimport {\r\n\tEVENT_NEW_FORM,\r\n\tEVENT_LOGOUT\r\n} from \"constants.js\";\r\nimport template from \"./form-selector-modal.html\";\r\nimport \"./form-selector-modal.less\";\r\n\r\n//formSelectorModal\r\nexport function controller(appState, eventBus, $state, $scope) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.appState = appState;\r\n\tctrl.agencies = [];\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.setForm = setForm;\r\n\tctrl.selectAgency = selectAgency;\r\n\tctrl.keySelectAgency = keySelectAgency;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\r\n\t\tctrl.agencies = appState.forms.items.reduce((agencies, form) => {\r\n\t\t\tconst existingAgency = find(agencies, (x) => x.id === form.Agency.Id);\r\n\r\n\t\t\tif(existingAgency) {\r\n\t\t\t\texistingAgency.forms = [...existingAgency.forms, { id: form.Id, name: form.Name }];\r\n\t\t\t} else {\r\n\t\t\t\tagencies = [\r\n\t\t\t\t\t...agencies,\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tid: form.Agency.Id,\r\n\t\t\t\t\t\tname: form.Agency.Name,\r\n\t\t\t\t\t\tlogo: form.Agency.Logo ?? form.nomenclature.LogoUrl,\r\n\t\t\t\t\t\tforms: [{ id: form.Id, name: form.Name }],\r\n\t\t\t\t\t\tinitials: form.Agency.Initials\r\n\t\t\t\t\t}\r\n\t\t\t\t];\r\n\t\t\t}\r\n\r\n\t\t\treturn agencies;\r\n\t\t}, []);\r\n\r\n\t\tctrl.selectedAgency = ctrl.agencies.filter((x) => x.id === ctrl.form.Agency.Id)[0];\r\n\r\n\t\tif(ctrl.selectedAgency && ctrl.selectedAgency.forms.length > 1) {\r\n\t\t\tctrl.selectedFormId = find(ctrl.selectedAgency.forms, { id: appState.forms.selected.Id }).id;\r\n\t\t\tctrl.showFormSelector = true;\r\n\t\t}\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_LOGOUT,\r\n\t\t\t() => {\r\n\t\t\t\thandleClose();\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\t}\r\n\r\n\tfunction keySelectAgency(keyEvent, agency) {\r\n\t\tif(keyEvent.which === 13) {\r\n\t\t\tthis.selectAgency(agency);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction selectAgency(agency) {\r\n\t\tif(agency.id === ctrl.selectedAgency.id) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctrl.selectedAgency = agency;\r\n\r\n\t\tif(agency.forms.length === 1) {\r\n\t\t\tctrl.showFormSelector = false;\r\n\r\n\t\t\tif(agency.id === appState.forms.selected.Agency.Id) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setForm(agency.forms[0]);\r\n\t\t} else {\r\n\t\t\tctrl.forms = agency.forms;\r\n\t\t\tctrl.showFormSelector = true;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setForm(form) {\r\n\t\tif(ctrl.selectedFormId === form.id) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctrl.selectedFormId = form.id;\r\n\r\n\t\tconst selectedForm = find(appState.forms.items, { Id: form.id });\r\n\r\n\t\tappState.forms.setSelected(selectedForm);\r\n\t\tappState.clearSelectedEntity();\r\n\r\n\t\t$state\r\n\t\t\t.go(\r\n\t\t\t\t\"authenticated.dashboard\",\r\n\t\t\t\t{},\r\n\t\t\t\t{\r\n\t\t\t\t\treload: true\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t.then(() => {\r\n\t\t\t\tctrl.modalInstance.close();\r\n\t\t\t\teventBus.trigger(EVENT_NEW_FORM);\r\n\t\t\t})\r\n\t\t\t.catch(ctrl.modalInstance.close());\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.close();\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.form-selector-modal\", []).component(\"formSelectorModal\", {\r\n\tcontroller,\r\n\ttemplate,\r\n\tbindings: {\r\n\t\tclose: \"&\",\r\n\t\tdismiss: \"&\",\r\n\t\tmodalInstance: \"<\",\r\n\t\tresolve: \"<\",\r\n\t\tgetUsers: \"&\"\r\n\t}\r\n}).name;\r\n","export default \"
\\r\\n\\t\\r\\n\\t\\tSwitch Forms\\r\\n\\t\\r\\n
\\r\\n\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
{{agency.initials}}
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t

{{$ctrl.selectedAgency.name}}

\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{form.name}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\r\\n\\r\\n\\r\\n\\tCancel\\r\\n\";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\n\r\nfunction controller($element, $transclude) {\r\n\tthis.$postLink = () => {\r\n\t\tconst content = angular.element(\r\n\t\t\t$element[0].querySelector(\".loading-content\")\r\n\t\t);\r\n\t\tcontent.append($transclude());\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.loading-tracker\", [])\r\n\t.component(\"loadingTracker\", {\r\n\t\ttransclude: true,\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\ttracker: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\r\\n
\";","export default __webpack_public_path__ + \"341cafdf3faa61ef6fa40ce180c243c8.svg\";","export default __webpack_public_path__ + \"4189af7d585db7e4c34e4fc02a5dd2c3.svg\";","export default __webpack_public_path__ + \"1bffca36b067e00ee22c9da80ab3cfff.svg\";","import moment from \"moment\";\r\nimport { shuffle } from \"lodash\";\r\n\r\nimport template from \"./ie-overlay.html\";\r\nimport \"./ie-overlay.less\";\r\nimport edgeLogo from \"../../images/edge-logo.svg\";\r\nimport firefoxLogo from \"../../images/firefox-logo.svg\";\r\nimport chromeLogo from \"../../images/chrome-logo.svg\";\r\n\r\nfunction controller($logger, $userProfile, $featureFlags) {\r\n\tconst ctrl = this;\r\n\tctrl.dismiss = dismiss;\r\n\tctrl.userProfile = $userProfile.getUserProfile();\r\n\tctrl.browsers = makeBrowserList();\r\n\tctrl.handleExternalNav = handleExternalNav;\r\n\tctrl.overlayEnabled = $featureFlags.getFeature($featureFlags.FEATURES.ieNotification);\r\n\tctrl.isOpen = false;\r\n\r\n\tconst buildIeOverlayEvent = $logger.buildWebEvent(\"ieOverlay\");\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tconst isIE = window.document.documentMode;\r\n\t\tif(isIE && ctrl.overlayEnabled) {\r\n\t\t\t// hide banner if dismissed within the past day\r\n\t\t\tif(ctrl.userProfile.timeDismissed && moment()\r\n\t\t\t\t.subtract(\"days\", 90)\r\n\t\t\t\t.isAfter(ctrl.userProfile.timeDismissed) ||\r\n\t\t\t\t!ctrl.userProfile.timeDismissed\r\n\t\t\t) {\r\n\t\t\t\tctrl.isOpen = true;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tfunction makeBrowserList() {\r\n\t\tconst browserList = [{\r\n\t\t\tname: \"Microsoft Edge\",\r\n\t\t\tlink: window.encodeURI(\"https://www.microsoft.com/en-us/edge\"),\r\n\t\t\tlogo: edgeLogo\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"Mozilla Firefox\",\r\n\t\t\tlink: window.encodeURI(\"https://www.mozilla.org/en-US/firefox/new/\"),\r\n\t\t\tlogo: firefoxLogo\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"Google Chrome\",\r\n\t\t\tlink: window.encodeURI(\"https://www.google.com/chrome/\"),\r\n\t\t\tlogo: chromeLogo\r\n\t\t}\r\n\t\t];\r\n\t\treturn shuffle(browserList);\r\n\t}\r\n\r\n\tfunction dismiss() {\r\n\t\t$logger.event(buildIeOverlayEvent(\"dismiss\")(\"clicked\"), {\r\n\t\t\tvia: \"Accept Risk\"\r\n\t\t});\r\n\t\tctrl.userProfile.timeDismissed = moment().format();\r\n\t\t$userProfile.setUserProfile(ctrl.userProfile);\r\n\r\n\t\tctrl.isOpen = false;\r\n\t}\r\n\r\n\tfunction handleExternalNav(type, name) {\r\n\t\t$logger.event(buildIeOverlayEvent(\"navigate\")(type), {\r\n\t\t\tvia: name\r\n\t\t});\r\n\t}\r\n}\r\n\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.ie-overlay\", [])\r\n\t.component(\"ieOverlay\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","export default \"\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\t You are using a dangerous, outdated browser. \\r\\n\\t\\tChoose a modern browser, and experience a better internet.\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
{{browser.name}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\tAccept Risk\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\";","import template from \"./message-notifications.html\";\r\nimport \"./message-notifications.less\";\r\n\r\n// supportInfo\r\nexport function controller(\r\n\t$scope,\r\n\tappState,\r\n\tapi,\r\n\tloadingService,\r\n\ttoastr,\r\n\teventBus,\r\n\tconfig,\r\n\t$state\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.sendMessage = sendMessage;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.hasMessages = false;\r\n\tctrl.goTo = goTo;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.support = config.support;\r\n\t}\r\n\r\n\tfunction sendMessage() {\r\n\t\tconst params = { Message: ctrl.message };\r\n\r\n\t\tconst promise = api.post(\"api/feedback\", params).then(() => {\r\n\t\t\ttoastr.success(\"Thank you for your feedback.\");\r\n\r\n\t\t\tctrl.message = null;\r\n\t\t});\r\n\r\n\t\tloadingService.watch(promise, \"Sending Feedback...\");\r\n\t}\r\n\r\n\tfunction goTo(route) {\r\n\t\t$state.go(route);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.message-notifications\", [])\r\n\t.component(\"messageNotifications\", {\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\thasMessages: \"=\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\tMessages\\r\\n\\t\\t
    \\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
  • \\r\\n\\t\\t\\t
  • 0\\\">\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
  • \\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t 0\\\"\\r\\n\\t>\\r\\n\\t\\t\\r\\n\\t\\r\\n\";","import template from \"./message-notification.html\";\r\nimport \"./message-notification.less\";\r\n\r\n// supportInfo\r\nexport function controller(\r\n\t$scope,\r\n\tappState,\r\n\tapi,\r\n\tloadingService,\r\n\ttoastr,\r\n\teventBus,\r\n\tconfig\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\t\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.support = config.support;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.message-notification\", [])\r\n\t.component(\"messageNotification\", {\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\tmessageSnippet: \"<\"\r\n\t\t}\r\n\t}).name;","export default \"\\r\\n\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\\"\\\"\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
David Belle
\\r\\n\\t\\t\\tCum sociis natoque penatibus et magnis dis parturient montes\\r\\n\\t\\t
\\r\\n\\t\\r\\n\\t\\r\\n\\t\\tNo Unread Messages!\\r\\n\\t\\r\\n
\";","import template from \"./message-list-item.html\";\r\nimport \"./message-list-item.less\";\r\n\r\nexport class MessageListItem {\r\n\tconstructor(uiHelpers) {\r\n\t\tthis.uiHelpers = uiHelpers;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.nonThisParticipants = this.header.participants.filter((item) => item.userId != this.thisUserid);\r\n\r\n\t\tthis.primary = this.nonThisParticipants[0];\r\n\t\tthis.isGroupContact = this.nonThisParticipants.length > 1;\r\n\t\tthis.buildAvatarColors();\r\n\t}\r\n\r\n\tgetInitials() {\r\n\t\treturn `${this.primary.firstName.substring(0, 1)}${this.primary.lastName.substring(0, 1)}`;\r\n\t}\r\n\r\n\tbuildAvatarColors() {\r\n\t\tconst hexBkColor = this.uiHelpers.stringToHexColour(`${this.primary.firstName}${this.primary.lastName}`);\r\n\r\n\t\tthis.avatarBkColor = this.uiHelpers.intToHexColorString(hexBkColor);\r\n\t\tthis.avatarTextColor = this.uiHelpers.textColorForHexBk(hexBkColor);\r\n\t}\r\n\r\n\tgetAllMembers() {\r\n\t\treturn this.nonThisParticipants.map((item) => `${item.firstName} ${item.lastName}`).reduce((prev, curr) => { return `${prev}, ${curr}`; });\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.message-list-item\", [])\r\n\t.component(\"messageListItem\", {\r\n\t\ttemplate,\r\n\t\tcontroller: MessageListItem,\r\n\t\tbindings: {\r\n\t\t\theader: \"<\",\r\n\t\t\tthisUserid: \"<\",\r\n\t\t\thighlight: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\t{{$ctrl.getInitials()}}\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t
{{$ctrl.primary.firstName}} {{$ctrl.primary.lastName}} {{$ctrl.isGroupContact ? '...' : ''}}
\\r\\n\\t\\t
{{$ctrl.header.subject}}
\\r\\n\\t\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\";","import template from \"./message-bubble.html\";\r\nimport \"./message-bubble.less\";\r\n\r\nexport class MessageBubble {\r\n\tconstructor(uiHelpers) {\r\n\t\tthis.uiHelpers = uiHelpers;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.contact = this.message.contact;\r\n\t\tthis.buildAvatarColors();\r\n\t}\r\n\r\n\tgetInitials() {\r\n\t\treturn `${this.contact.firstName.substring(0, 1)}${this.contact.lastName.substring(0, 1)}`;\r\n\t}\r\n\r\n\tbuildAvatarColors() {\r\n\t\tconst bkColor = this.uiHelpers.stringToHexColour(`${this.contact.firstName}${this.contact.lastName}`);\r\n\r\n\t\tthis.avatarBkColor = this.uiHelpers.intToHexColorString(bkColor);\r\n\t\tthis.avatarTextColor = this.uiHelpers.textColorForHexBk(bkColor);\r\n\t}\r\n\r\n\tgetAllMembers() {\r\n\t\treturn this.nonThisParticipants.map((item) => `${item.firstName} ${item.lastName}`).reduce((prev, curr) => { return `${prev}, ${curr}`; });\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.message-bubble\", [])\r\n\t.component(\"messageBubble\", {\r\n\t\ttemplate,\r\n\t\tcontroller: MessageBubble,\r\n\t\tbindings: {\r\n\t\t\tmessage: \"<\",\r\n\t\t\talignRight: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t\\r\\n\\t\\t{{$ctrl.getInitials()}}\\r\\n\\t
\\r\\n\\t{{$ctrl.message.message}}\\r\\n\";","import moment from \"moment\";\r\n\r\nexport const effectiveRangeStatus = (\r\n\trange,\r\n\tasOf\r\n) => {\r\n\tconst start = moment(range.Start);\r\n\r\n\tif(start.isAfter(asOf)) {\r\n\t\treturn !range.NoEarlierThan || moment(range.NoEarlierThan).isAfter(asOf)\r\n\t\t\t? { isValid: false, isInGrace: false, isEither: false }\r\n\t\t\t: { isValid: false, isInGrace: true, isEither: true };\r\n\t}\r\n\r\n\tif(!range.End)\r\n\t\treturn { isValid: true, isInGrace: false, isEither: true };\r\n\r\n\tconst end = moment(range.End);\r\n\tif(end.isAfter(asOf))\r\n\t\treturn { isValid: true, isInGrace: false, isEither: true };\r\n\r\n\treturn !range.NoLaterThan || moment(range.NoLaterThan).isSameOrBefore(asOf)\r\n\t\t? { isValid: false, isInGrace: false, isEither: false }\r\n\t\t: { isValid: false, isInGrace: true, isEither: true };\r\n};\r\n","import {\r\n\tEVENT_LOAD_OPTIONS,\r\n\tEVENT_NEW_REPORTING_ENTITY,\r\n\tEVENT_NEW_FORM,\r\n\tEVENT_REQUEST_REPORTING_ENTITY,\r\n\tEVENT_RESET_REPORTING_ENTITY\r\n} from \"constants.js\";\r\nimport { orderBy } from \"lodash\";\r\nimport template from \"./reporting-entity-selector.html\";\r\nimport \"./reporting-entity-selector.less\";\r\nimport moment from \"moment\";\r\nimport { effectiveRangeStatus } from \"../../utils/effectiveRanges/effectiveRangeStatus\";\r\n\r\n// reportingEntitySelector\r\nexport function controller(\r\n\t$scope,\r\n\tappState,\r\n\teventBus,\r\n\tentityManager,\r\n\t$logger\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.handleValueChange = handleValueChange;\r\n\tctrl.clearSelected = clearSelected;\r\n\tctrl.switchPrimary = switchPrimary;\r\n\tctrl.selected = { primary: {}, friendly: {} };\r\n\tctrl.shouldRequestPrimaryUpdate = !!this.shouldRequestPrimaryUpdate;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\r\n\t\tconst selector = {\r\n\t\t\tclearSelected: () => clearSelected(),\r\n\t\t\tenable: () => ctrl.selectBox.enable()\r\n\t\t};\r\n\r\n\t\tthis.callbacks({ selector });\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_NEW_FORM,\r\n\t\t\t() => {\r\n\t\t\t\tctrl.form = appState.forms.selected;\r\n\t\t\t\tappState.clearSelectedEntity();\r\n\t\t\t\tgetAssociatedEntities();\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\r\n\t\teventBus.register(EVENT_REQUEST_REPORTING_ENTITY, (_, { friendly }) => handleValueChange({ friendly }), $scope);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_RESET_REPORTING_ENTITY,\r\n\t\t\t() => {\r\n\t\t\t\tresetDefault();\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\r\n\t\tif(ctrl.fieldIdentifier !== undefined) {\r\n\t\t\teventBus.register(\r\n\t\t\t\tEVENT_LOAD_OPTIONS(ctrl.fieldIdentifier),\r\n\t\t\t\t(_, params) => {\r\n\t\t\t\t\tgetAssociatedEntities(params.entities);\r\n\t\t\t\t},\r\n\t\t\t\t$scope\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tgetAssociatedEntities();\r\n\t}\r\n\r\n\tctrl.setSelectBox = function(selectBox) {\r\n\t\tctrl.selectBox = selectBox;\r\n\r\n\t\tif(ctrl.selected.primary.Id || ctrl.selected.friendly.isSelf || entityManager.isAllPrimaries()) {\r\n\t\t\tctrl.selectBox.setValue(ctrl.selected.primary, ctrl.selected.friendly, false);\r\n\t\t}\r\n\t};\r\n\r\n\tfunction clearSelected() {\r\n\t\tappState.clearSelectedEntity();\r\n\t\tctrl.selectBox.clearSelected();\r\n\t}\r\n\r\n\tasync function getAssociatedEntities(entities) {\r\n\t\tif(entities !== undefined) {\r\n\t\t\tctrl.associatedEntities = entities;\r\n\t\t\tctrl.selectBox.setChoices(entities);\r\n\t\t}\r\n\r\n\t\tif(ctrl.associatedEntities === undefined) {\r\n\t\t\tctrl.associatedEntities = entityManager.getPrimaryFieldEntities();\r\n\r\n\t\t\tif(ctrl.default === true) {\r\n\t\t\t\tsetDefault();\r\n\t\t\t\teventBus.trigger(EVENT_NEW_REPORTING_ENTITY);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(ctrl.entityQueryConfiguration === undefined) {\r\n\t\t\tctrl.entityQueryConfiguration = entityManager.primaryEntityQueryConfiguration;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction resetDefault() {\r\n\t\tsetDefault(false);\r\n\t}\r\n\r\n\tfunction setDefault(keepSelected) {\r\n\t\tlet selected = keepSelected === false ? null : entityManager.getSelectedEntity();\r\n\t\tconst now = moment();\r\n\r\n\t\t//CLEANUP (JTS): It appears that allFriendlies is misused here\r\n\t\t//It is assigned an orderBy, but accessed via ctrl.allFriendlies after the scoped block\r\n\t\t//Also, it appears the elements of the control are already ordered, so another may be unnecessary\r\n\t\tlet allFriendlies = [];\r\n\r\n\t\t//if not set, set to first friendly & primary\r\n\t\tif((!selected || !((!!selected.primary && !!selected.primary.Id) || (!!selected.friendly && !!selected.friendly.Id))) && ctrl.associatedEntities.length) {\r\n\t\t\tallFriendlies = orderBy(ctrl.associatedEntities, [(entity) => entity.Name], \"asc\");\r\n\r\n\t\t\t//find first friendly that's in-season\r\n\t\t\tfor(let i = 0; i < ctrl.associatedEntities.length; i++) {\r\n\t\t\t\tconst thisFriendly = allFriendlies[i];\r\n\r\n\t\t\t\tif(!!thisFriendly.Entities && thisFriendly.Entities.length > 0) {\r\n\t\t\t\t\tfor(let j = 0; j < thisFriendly.Entities.length; j++) {\r\n\t\t\t\t\t\tconst thisPrimary = thisFriendly.Entities[j].Entity;\r\n\t\t\t\t\t\tconst status = effectiveRangeStatus(thisPrimary, now);\r\n\r\n\t\t\t\t\t\tif(status.isEither) {\r\n\t\t\t\t\t\t\tselected = {\r\n\t\t\t\t\t\t\t\tfriendly: thisFriendly,\r\n\t\t\t\t\t\t\t\tprimary: thisPrimary\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconst status = effectiveRangeStatus(thisFriendly, now);\r\n\r\n\t\t\t\t\tif(!thisFriendly.Effective || status.isEither) {\r\n\t\t\t\t\t\tselected = {\r\n\t\t\t\t\t\t\tfriendly: thisFriendly,\r\n\t\t\t\t\t\t\tprimary: {}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!selected || !selected?.friendly && !selected?.primary) {\r\n\t\t\tselected = {\r\n\t\t\t\tprimary: {},\r\n\t\t\t\tfriendly: allFriendlies[0]\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tentityManager.selectEntity(selected.friendly.Id);\r\n\t\tctrl.selected = selected;\r\n\t\tsetPrimarySwitcherButton(selected.friendly);\r\n\t}\r\n\r\n\tfunction handleValueChange(item) {\r\n\t\tif(item) {\r\n\t\t\tsetPrimarySwitcherButton(item.friendly);\r\n\t\t\tctrl.selected = item;\r\n\t\t}\r\n\t\tentityManager.selectEntity(item && (item.Id || item.friendly.Id));\r\n\r\n\t\teventBus.trigger(EVENT_NEW_REPORTING_ENTITY);\r\n\r\n\t\tif(ctrl.onChanged) {\r\n\t\t\tctrl.onChanged(item);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setPrimarySwitcherButton(friendly) {\r\n\t\tctrl.showPrimarySwitcher = !ctrl.shouldRequestPrimaryUpdate && friendly && friendly.Entities && friendly.Entities.length > 1;\r\n\t}\r\n\r\n\tfunction switchPrimary() {\r\n\t\tthis.selectBox.switchPrimary();\r\n\t}\r\n}\r\nexport default angular\r\n\t.module(\"vesl.components.reporting-entity-selector\", [])\r\n\t.component(\"reportingEntitySelector\", {\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\tonChanged: \"=\",\r\n\t\t\tdefault: \"<\",\r\n\t\t\tisReadonly: \"<\",\r\n\t\t\tcallbacks: \"&\",\r\n\t\t\tshouldRequestPrimaryUpdate: \"<\",\r\n\t\t\tassociatedEntities: \"<\",\r\n\t\t\tentityQueryConfiguration: \"<\",\r\n\t\t\tfieldLabel: \"<\",\r\n\t\t\tfieldIdentifier: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\";","//Alternative to Math.trunc()\r\nexport function truncate(value) {\r\n\tvalue = +value;\r\n\r\n\tif(!isFinite(value)) {\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn value - (value % 1) || (value < 0 ? -0 : value === 0 ? value : 0);\r\n}\r\n\r\nexport function repeat(value, count) {\r\n\t\"use strict\";\r\n\tif(value == null) {\r\n\t\tthrow new TypeError(\"can't convert \" + value + \" to object\");\r\n\t}\r\n\tlet str = \"\" + value;\r\n\tcount = +count;\r\n\tif(count != count) {\r\n\t\tcount = 0;\r\n\t}\r\n\tif(count < 0) {\r\n\t\tthrow new RangeError(\"repeat count must be non-negative\");\r\n\t}\r\n\tif(count == Infinity) {\r\n\t\tthrow new RangeError(\"repeat count must be less than infinity\");\r\n\t}\r\n\tcount = Math.floor(count);\r\n\tif(str.length == 0 || count == 0) {\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tif(str.length * count >= 1 << 28) {\r\n\t\tthrow new RangeError(\r\n\t\t\t\"repeat count must not overflow maximum string size\"\r\n\t\t);\r\n\t}\r\n\tconst maxCount = str.length * count;\r\n\tcount = Math.floor(Math.log(count) / Math.log(2));\r\n\twhile(count) {\r\n\t\tstr += str;\r\n\t\tcount--;\r\n\t}\r\n\tstr += str.substring(0, maxCount - str.length);\r\n\treturn str;\r\n}\r\n\r\nif(typeof String.prototype.trimLeft !== \"function\") {\r\n\tString.prototype.trimLeft = function() {\r\n\t\treturn this.replace(/^\\s+/, \"\");\r\n\t};\r\n}\r\n\r\nif(typeof String.prototype.trimRight !== \"function\") {\r\n\tString.prototype.trimRight = function() {\r\n\t\treturn this.replace(/\\s+$/, \"\");\r\n\t};\r\n}\r\n","import { truncate } from \"services/polyfills.js\";\r\nconst MAX_MINUTES = 60;\r\nconst MAX_MINUTE_FRACTION = (MAX_MINUTES - 1)/MAX_MINUTES;\r\n\r\nexport const dmsToDegrees = (dmsValue) => {\r\n\tif(dmsValue && dmsValue.degrees !== null && !isNaN(dmsValue.degrees)\r\n\t\t&& dmsValue.minutes !== null && !isNaN(dmsValue.minutes) !== null) {\r\n\r\n\t\tlet fractionalMinutes = (dmsValue.minutes / MAX_MINUTES);\r\n\r\n\t\tif(fractionalMinutes > MAX_MINUTE_FRACTION) {\r\n\t\t\tfractionalMinutes = 1;\r\n\t\t}\r\n\r\n\t\tlet fullDegrees = dmsValue.degrees + fractionalMinutes;\r\n\t\tif(dmsValue.isNegative) {\r\n\t\t\tfullDegrees *= -1;\r\n\t\t}\r\n\t\tfullDegrees = parseFloat(fullDegrees.toFixed(3));\r\n\t\treturn fullDegrees;\r\n\t}\r\n\r\n\treturn undefined;\r\n};\r\n\r\nexport const degreesToDms = (rawDegrees, isStrict = false) => {\r\n\tlet { degrees, minutes } = isStrict ? strictDecompose(rawDegrees) : roundingDecompose(rawDegrees);\r\n\r\n\tlet isNegative = false;\r\n\tif(rawDegrees < 0) {\r\n\t\tif(!isStrict) {\r\n\t\t\tdegrees *= -1;\r\n\t\t\tminutes *= -1;\r\n\t\t}\r\n\t\tisNegative = true;\r\n\t}\r\n\r\n\tconst dmsVal = {\r\n\t\tdegrees,\r\n\t\tminutes,\r\n\t\troundedMinutes: minutes,\r\n\t\tisNegative: isNegative\r\n\t};\r\n\r\n\treturn dmsVal;\r\n\r\n\t// This function composes decimal degrees into DMS with rounding minutes to the nearest minute\r\n\t// This version is used when dealing with decimal degrees that have lost precision at some point.\r\n\tfunction roundingDecompose(fullDegrees) {\r\n\t\tconst degrees = truncate(fullDegrees);\r\n\t\tconst minutesAsDecimal = fullDegrees - degrees;\r\n\r\n\t\tconst minutes = Math.round(minutesAsDecimal * MAX_MINUTES);\r\n\r\n\t\treturn { degrees, minutes };\r\n\t}\r\n\r\n\t// from https://stackoverflow.com/questions/5786025/decimal-degrees-to-degrees-minutes-and-seconds-in-javascript/64866682#64866682\r\n\t// This function composes decimal degrees into DMS with rolling over 60 seconds into minutes and 60 minutes into degrees.\r\n\t// This version is used when the decimal degree has not lost any precision in conversion yet.\r\n\tfunction strictDecompose(fullDegrees) {\r\n\t\tlet d = parseInt(fullDegrees.toString());\r\n\t\tconst minfloat = Math.abs((fullDegrees - d) * 60);\r\n\t\tlet m = Math.floor(minfloat);\r\n\t\tconst secfloat = (minfloat - m) * 60;\r\n\t\tlet s = Math.round((secfloat + Number.EPSILON) * 100) / 100;\r\n\t\td = Math.abs(d);\r\n\r\n\t\tif(s == 60) {\r\n\t\t\tm++;\r\n\t\t\ts = 0;\r\n\t\t}\r\n\t\tif(m == 60) {\r\n\t\t\td++;\r\n\t\t\tm = 0;\r\n\t\t}\r\n\r\n\t\tconst dms = {\r\n\t\t\tdegrees: d,\r\n\t\t\tminutes: m\r\n\t\t};\r\n\t\treturn dms;\r\n\t}\r\n};\r\n","\r\nexport const findEntityRecursively = (entities, id, depth) => entities && entities.reduce((found, entity) => {\r\n\tif(found)\r\n\t\treturn found;\r\n\t\r\n\tdepth = depth ?? 0;\r\n\r\n\tif(entity.Id == id)\r\n\t\treturn { \r\n\t\t\tdepth: depth,\r\n\t\t\tmatch: entity,\r\n\t\t\t[depth]: entity\r\n\t\t};\r\n\t\r\n\tif(!entity.Entities || !(entity.Entities.length > 0)) \r\n\t\treturn false;\r\n\r\n\tconst match = findEntityRecursively(entity.Entities.map(related => related.Entity), id, depth + 1);\r\n\tif(!match) \r\n\t\treturn false;\r\n\r\n\tmatch[depth] = entity;\r\n\r\n\treturn match;\r\n}, false);\r\n","import template from \"./report-details.html\";\r\nimport \"./report-details.less\";\r\nimport {\r\n\tcloneDeep,\r\n\tevery,\r\n\tfilter,\r\n\tfind,\r\n\tforEach,\r\n\tforOwn,\r\n\tgroupBy,\r\n\tmap,\r\n\tmaxBy,\r\n\torderBy,\r\n\tsize,\r\n\tsome\r\n} from \"lodash\";\r\nimport moment from \"moment\";\r\nimport numeral from \"numeral\";\r\nimport {\r\n\tFIELD_KEYS,\r\n\tFIELD_TEMPLATES,\r\n\tEVENT_DETAIL_TOGGLE,\r\n\tACTION_COLLAPSE_DETAILS,\r\n\tACTION_EXPAND_DETAILS\r\n} from \"constants.js\";\r\nimport { pluralize } from \"humanize-plus\";\r\nimport { degreesToDms } from \"../../services/geo-service\";\r\nimport { getSeasonsByEffectiveRanges } from \"../../utils/getSeasonsByEffectiveRanges\";\r\nimport { findEntityRecursively } from \"../../utils/entities/findEntityRecursively\";\r\n\r\nexport function controller($scope, $logger, eventBus, validationServiceFactory, appState) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.getErrMessage = getErrMessage;\r\n\tctrl.handleDetailDelete = handleDetailDelete;\r\n\tctrl.toggleDeleted = toggleDeleted;\r\n\tctrl.handleDetailRestore = handleDetailRestore;\r\n\tctrl.getTableDataSuffix = getTableDataSuffix;\r\n\tctrl.getTableDataPrefix = getTableDataPrefix;\r\n\tctrl.isTableEmpty = isTableEmpty;\r\n\tctrl.toggleDetail = toggleDetail;\r\n\tctrl.toggleDetailsExpansion = toggleDetailsExpansion;\r\n\tctrl.expandAdditionalDetails = false;\r\n\tctrl.scope = $scope;\r\n\tctrl.setValidations = setValidations;\r\n\tctrl.onClickDetail = onClickDetail;\r\n\r\n\tctrl.details = [];\r\n\tctrl.selectedDetail = null;\r\n\tctrl.validationService = validationServiceFactory.getCurrentValidationService();\r\n\r\n\t$scope.$watch(\r\n\t\t() => ctrl.detailValues,\r\n\t\t(next) => {\r\n\t\t\tif(!!next) {\r\n\t\t\t\tsetDetails(next);\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.permissions = appState.permissions.Reporting;\r\n\r\n\t\tctrl.setCallbacks({\r\n\t\t\tsetValidations: validations => setValidations(validations)\r\n\t\t});\r\n\r\n\t\tif(ctrl.registerValueProvider) {\r\n\t\t\tctrl.registerValueProvider({\r\n\t\t\t\tscope: $scope,\r\n\t\t\t\tgetValues: (api = false) => {\r\n\t\t\t\t\tconst fieldsById = groupBy(ctrl.form.detailFields, f => f.Id);\r\n\t\t\t\t\tconst details = getDetailFields();\r\n\t\t\t\t\tconst allDetailVals = [];\r\n\r\n\t\t\t\t\tforEach(details, detail => {\r\n\t\t\t\t\t\tforEach(detail.values, v => {\r\n\t\t\t\t\t\t\tif(v.DetailId === 0) {\r\n\t\t\t\t\t\t\t\tv.DetailId = detail.detailId;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(v.FieldId > 0\r\n\t\t\t\t\t\t\t\t&& detail.isDeleted !== true) {\r\n\t\t\t\t\t\t\t\tlet hydratedValue = v;\r\n\r\n\t\t\t\t\t\t\t\tif(api === false) {\r\n\t\t\t\t\t\t\t\t\thydratedValue = hydrateValue(v, fieldsById);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tallDetailVals.push(hydratedValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\treturn allDetailVals;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\teventBus.register(\r\n\t\t\tACTION_EXPAND_DETAILS,\r\n\t\t\t() => {\r\n\t\t\t\ttoggleDetailsExpansion(true);\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\r\n\t\teventBus.register(\r\n\t\t\tACTION_COLLAPSE_DETAILS,\r\n\t\t\t() => {\r\n\t\t\t\ttoggleDetailsExpansion(false);\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\t}\r\n\r\n\tfunction hydrateValue(value, fields) {\r\n\t\tconst applicableField = fields[value.FieldId]?.[0];\r\n\t\tif(value.IsNotAvailable === true) {\r\n\t\t\tvalue.Classifications = [];\r\n\t\t\tvalue._code = value.Code;\r\n\t\t\tvalue.Identifiers = [];\r\n\t\t\tvalue.Seasons = [];\r\n\t\t\t\t\r\n\t\t\treturn value;\r\n\t\t}\r\n\r\n\t\tif(!!applicableField.EntityQueryConfiguration) {\r\n\t\t\tif(applicableField.EntityQueryConfiguration.RelationshipType.Code === \"SELF\") {\r\n\t\t\t\tconst hydratedValue = find(applicableField.Data, d => d.Id === value.EntityId);\r\n\r\n\t\t\t\tvalue.Classifications = hydratedValue.Classifications;\r\n\t\t\t\tvalue._code = hydratedValue.Code;\r\n\t\t\t\tvalue.Identifiers = (hydratedValue.Identifiers || []);\r\n\t\t\t\tvalue.Seasons = getSeasons(hydratedValue);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet hydratedValue = undefined;\r\n\t\t\t\tforEach(applicableField.Data, d => {\r\n\t\t\t\t\tforEach(d.Entities, e => {\r\n\t\t\t\t\t\tif(e.Entity.Id === value.EntityId) {\r\n\t\t\t\t\t\t\thydratedValue = { primary: e.Entity, friendly: d };\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tif(!!hydratedValue) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tvalue.Classifications = !hydratedValue ? [] : [\r\n\t\t\t\t\t...(hydratedValue.friendly && hydratedValue.friendly.Classifications ? hydratedValue.friendly.Classifications : []),\r\n\t\t\t\t\t...(hydratedValue.friendly && hydratedValue.friendly.Classification ? [hydratedValue.friendly.Classification] : []),\r\n\t\t\t\t\t...(hydratedValue.primary && hydratedValue.primary.Classifications ? hydratedValue.primary.Classifications : []),\r\n\t\t\t\t\t...(hydratedValue.primary && hydratedValue.primary.Classification ? [hydratedValue.primary.Classification] : [])\r\n\t\t\t\t];\r\n\t\t\t\tvalue._code = !hydratedValue ? null : hydratedValue.primary.Code;\r\n\t\t\t\tvalue.Identifiers = !hydratedValue ? [] : (hydratedValue.friendly.Identifiers || []).concat(hydratedValue.primary.Identifiers || []);\r\n\t\t\t\tvalue.Seasons = !hydratedValue ? [] : getSeasons(hydratedValue.primary);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(value.DataId) {\r\n\t\t\tconst hydratedValue = find(applicableField.Data, d => d.Id === value.EntityId || d.Id === value.DataId);\r\n\r\n\t\t\tvalue.Classifications = hydratedValue?.Classifications ?? [];\r\n\t\t\tvalue._code = hydratedValue?.Code;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\r\n\t\tfunction getSeasons(entity) {\r\n\t\t\tif(entity.Effective?.length > 0) {\r\n\t\t\t\treturn getSeasonsByEffectiveRanges(entity.Effective, ctrl.form.Seasons);\r\n\t\t\t}\r\n\t\t\treturn ctrl.form.Seasons;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getDataItemName(field, detail) {\r\n\t\tif(field.IsCustomEntryEnabled === true && detail.String !== undefined) {\r\n\t\t\treturn detail.String;\r\n\t\t}\r\n\t\t\r\n\t\tif(field.Type.IsEntity) {\r\n\t\t\treturn getEntityItemName(field, detail);\r\n\t\t}\r\n\r\n\t\tconst item = find(field.Data, { Id: detail.DataId });\r\n\t\t\r\n\t\tlet value = item?.Name ?? item?.Code;\r\n\r\n\t\tif(field.IsCustomEntryEnabled) {\r\n\t\t\tvalue = detail.String || value;\r\n\t\t}\r\n\r\n\t\treturn value || \"--\";\r\n\t}\r\n\r\n\tfunction getEntityItemName(field, detail) {\r\n\t\tif(field.IsCustomEntryEnabled === true && detail.String !== undefined) {\r\n\t\t\treturn detail.String;\r\n\t\t}\r\n\t\tconst item = findEntityRecursively(field.Data, detail.EntityId);\r\n\r\n\t\tif(item.match) {\r\n\t\t\tif(item.depth > 0) {\r\n\t\t\t\treturn `${item[0].Name ?? item[0].Code} (${item.match.Name ?? item.match.Code})`;\r\n\t\t\t}\r\n\r\n\t\t\treturn item.match.Name ?? item.match.Code;\r\n\t\t}\r\n\r\n\t\treturn \"--\";\r\n\t}\r\n\r\n\tconst formatters = {\r\n\t\tLocation: (field, detail) => {\r\n\t\t\tconst dms = degreesToDms(detail.Number);\r\n\r\n\t\t\treturn `${dms.degrees}° ${dms.minutes}'`;\r\n\t\t},\r\n\t\tCoordinate: (field, detail) => {\r\n\t\t\tif(detail.Latitude !== undefined && detail.Longitude !== undefined) {\r\n\t\t\t\treturn `${detail.Latitude}, ${detail.Longitude}`;\r\n\t\t\t}\r\n\t\t\treturn \"--\";\r\n\t\t},\r\n\t\tTags: (field) => {\r\n\t\t\t$logger.missing(\"multiple input formatter not implemented.\", { field: field.Name, type: \"Tags\" });\r\n\t\t\treturn \"--\";\r\n\t\t},\r\n\t\tDate: (field, detail) => {\r\n\t\t\tif(detail.Date !== undefined) {\r\n\t\t\t\treturn `${moment(detail.Date).format(\"MM-DD-YYYY\")}`;\r\n\t\t\t}\r\n\t\t\treturn \"--\";\r\n\t\t},\r\n\t\tDateTime: (field, detail) => {\r\n\t\t\tif(detail.Date !== undefined) {\r\n\t\t\t\treturn `${moment(detail.Date).format(\"MM-DD-YYYY h:mm A\")}`;\r\n\t\t\t}\r\n\t\t\treturn \"--\";\r\n\t\t},\r\n\t\tNumber: (field, detail) => {\r\n\t\t\tif(detail.Number !== undefined) {\r\n\t\t\t\tlet formatString = \"0,0\";\r\n\t\t\t\tif(field.RoundingPoint > 0) {\r\n\t\t\t\t\tformatString = formatString + \".\" + \"0\".repeat(field.RoundingPoint);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn `${numeral(detail.Number).format(formatString)}`;\r\n\t\t\t}\r\n\t\t\treturn \"--\";\r\n\t\t},\r\n\t\tBoolean: (field, detail) => {\r\n\t\t\tif(detail.Boolean !== undefined) {\r\n\t\t\t\treturn `${detail.Boolean ? \"Yes\" : \"No\"}`;\r\n\t\t\t}\r\n\t\t\treturn \"--\";\r\n\t\t},\r\n\t\tPreSelect: (field, detail) => getDataItemName(field, detail),\r\n\t\tText: (field, detail) => {\r\n\t\t\treturn detail.String ? detail.String : \"--\";\r\n\t\t},\r\n\t\tSelection: (field, detail) => getDataItemName(field, detail),\r\n\t\tEntitySelector: (field, detail) => getEntityItemName(field, detail)\r\n\t};\r\n\r\n\tfunction setValidations(validations) {\r\n\t\tif(validations) {\r\n\t\t\tconst errors = validations\r\n\t\t\t\t.filter(v => v.code !== \"WARNING\")\r\n\t\t\t\t.map(v => v.rules)\r\n\t\t\t\t.reduce((a, b) => a.concat(b), []);\r\n\t\t\tconst warnings = validations\r\n\t\t\t\t.filter(v => v.code === \"WARNING\")\r\n\t\t\t\t.map(v => v.rules)\r\n\t\t\t\t.reduce((a, b) => a.concat(b), []);\r\n\r\n\t\t\tconst detailErrors = errors.filter(err => err.validationScope.Code === \"DETAIL\");\r\n\t\t\tconst detailWarnings = warnings.filter(warn => warn.validationScope.Code === \"DETAIL\");\r\n\r\n\t\t\tctrl.hasErrors = groupBy(detailErrors, e => e.DetailId);\r\n\t\t\tctrl.hasWarnings = groupBy(detailWarnings, e => e.DetailId);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getErrMessage(str, detail) {\r\n\t\treturn `${detail.length} ${pluralize(detail.length, str)}`;\r\n\t}\r\n\r\n\tfunction toggleDetail(detail) {\r\n\t\tdetail.isExpanded = !detail.isExpanded;\r\n\t\tif(!detail.isExpanded) {\r\n\t\t\tctrl.expandAdditionalDetails = false;\r\n\t\t} else if(every(ctrl.detailsTable.details, { isExpanded: true })) {\r\n\t\t\tctrl.expandAdditionalDetails = true;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction toggleDetailsExpansion(expandOverride) {\r\n\t\tctrl.expandAdditionalDetails = expandOverride || !ctrl.expandAdditionalDetails;\r\n\r\n\t\tforEach(ctrl.detailsTable.details, detail => {\r\n\t\t\tdetail.isExpanded = ctrl.expandAdditionalDetails;\r\n\t\t});\r\n\t}\r\n\r\n\tfunction setDetails(detailVals) {\r\n\t\tctrl.details = cloneDeep(detailVals);\r\n\t\tloadDetailClassifications();\r\n\r\n\t\tprepareDetailsTable(ctrl.details);\r\n\t}\r\n\r\n\tfunction loadDetailClassifications() {\r\n\t\tconst selectionFields = ctrl.form.detailFields.filter(field => {\r\n\t\t\treturn field.Template === FIELD_TEMPLATES.Selection || field.Template === FIELD_TEMPLATES.EntitySelector;\r\n\t\t});\r\n\r\n\t\tforEach(selectionFields, detailField => {\r\n\t\t\tlet detailFieldValues = [];\r\n\r\n\t\t\tforEach(ctrl.details, detail => {\r\n\t\t\t\tconst detailRowVals = filter(detail.values, v => v.FieldId === detailField.Id && v.String === undefined);\r\n\t\t\t\tif(!!detailRowVals && detailRowVals.length > 0) {\r\n\t\t\t\t\tdetailFieldValues = detailFieldValues.concat(detailRowVals);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tforEach(detailFieldValues, detailFieldValue => {\r\n\t\t\t\tlet itemValue = find(detailField.Data, item => {\r\n\t\t\t\t\treturn item.Id === detailFieldValue.DataId || item.Id === detailFieldValue.EntityId || findPrimaryEntity(item, detailFieldValue.EntityId) !== null;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(itemValue) {\r\n\t\t\t\t\tif(itemValue.Id !== detailFieldValue.DataId && itemValue.Id !== detailFieldValue.EntityId) {\r\n\t\t\t\t\t\titemValue = findPrimaryEntity(itemValue, detailFieldValue.EntityId);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(itemValue.Classifications) {\r\n\t\t\t\t\t\tdetailFieldValue.Classifications = itemValue.Classifications;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tfunction findPrimaryEntity(friendlyEntity, primaryId) {\r\n\t\tif(!friendlyEntity.Entities || friendlyEntity.Entities.length < 1 || every(friendlyEntity.Entities, primary => !primary.Entity || !primary.Entity.Id)) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tfor(let i = 0; i < friendlyEntity.Entities.length; i++) {\r\n\t\t\tconst primary = friendlyEntity.Entities[i];\r\n\t\t\tif(primary.Entity.Id === primaryId) {\r\n\t\t\t\treturn primary.Entity;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction getDetailFields() {\r\n\t\treturn ctrl.detailValues;\r\n\t}\r\n\r\n\tfunction getTableDataPrefix(data) {\r\n\t\tif(data.unit === \"$\") {\r\n\t\t\treturn \"$\";\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction getTableDataSuffix(data) {\r\n\t\tif(!!data.unit && data.unit !== \"$\") {\r\n\t\t\treturn data.unit;\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction calculateQuantityPriceProduct(fieldValueDictionary) {\r\n\t\tconst fieldValues = Object.values(fieldValueDictionary);\r\n\r\n\t\tconst hasValidValues = !fieldValues.some(v => v?.Number === undefined);\r\n\r\n\t\tif(!hasValidValues) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\tconst product = fieldValueDictionary[FIELD_KEYS.quantity].Number * fieldValueDictionary[FIELD_KEYS.price].Number;\r\n\r\n\t\treturn product;\r\n\t}\r\n\r\n\tfunction calcluateOysterTotal(fieldValueDictionary) {\r\n\t\tconst fieldValues = Object.values(fieldValueDictionary);\r\n\r\n\t\tconst hasValidValues = !fieldValues.some(v => v?.Number === undefined);\r\n\r\n\t\tif(!hasValidValues) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\tconst quantity = fieldValueDictionary[FIELD_KEYS.quantity].Number;\r\n\t\tconst price = fieldValueDictionary[FIELD_KEYS.price].Number;\r\n\t\tconst tagBegin = fieldValueDictionary[FIELD_KEYS.tagBegin].Number;\r\n\t\tconst tagEnd = fieldValueDictionary[FIELD_KEYS.tagEnd].Number;\r\n\r\n\t\tconst total = ((tagEnd - tagBegin) + 1) * quantity * price;\r\n\r\n\t\treturn total;\r\n\t}\r\n\r\n\t//temporary until API supports calculated fields\r\n\tfunction appendCalculatedFields(fields, tableDetails) {\r\n\t\tfields = fields || filter(ctrl.form.detailFields, {\r\n\t\t\tIsDetailColumnHeader: true\r\n\t\t});\r\n\t\tconst calculationFields = fields.reduce((acc, f) => {\r\n\t\t\tif(f.Key.Code === FIELD_KEYS.quantity || f.Key.Code === FIELD_KEYS.price || f.Key.Code === FIELD_KEYS.tagBegin || f.Key.Code === FIELD_KEYS.tagEnd) {\r\n\t\t\t\tacc[f.Key.Code] = f;\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\t\tlet calculator;\r\n\r\n\t\tif(Object.values(calculationFields).length === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(calculationFields[FIELD_KEYS.quantity] !== undefined && calculationFields[FIELD_KEYS.price] !== undefined) {\r\n\t\t\tif(calculationFields[FIELD_KEYS.tagBegin] !== undefined && calculationFields[FIELD_KEYS.tagEnd] !== undefined) {\r\n\t\t\t\tcalculator = calcluateOysterTotal;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcalculator = calculateQuantityPriceProduct;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst order = maxBy(fields, f => f.Order)?.Order + 1;\r\n\t\tconst totalField = {\r\n\t\t\tId: -1,\r\n\t\t\tName: \"Total\",\r\n\t\t\tOrder: order,\r\n\t\t\tTemplate: \"Number\",\r\n\t\t\tRoundingPoint: 2,\r\n\t\t\tvalues: [],\r\n\t\t\tData: [{ Id: -1, Code: \"USD\", Name: \"USD\", Abbreviation: \"$\" }]\r\n\t\t};\r\n\r\n\t\tctrl.totalSum = 0;\r\n\t\tforOwn(tableDetails, (detailVals, detailId) => {\r\n\t\t\tconst detailValue = {\r\n\t\t\t\tDetailId: parseInt(detailId),\r\n\t\t\t\tFieldId: -1, \r\n\t\t\t\tDataId: -1\r\n\t\t\t};\r\n\r\n\t\t\tconst fieldValues = Object.values(calculationFields).reduce((acc, next) => {\r\n\t\t\t\tconst nextVal = detailVals?.values?.[next.Id];\r\n\t\t\t\tacc[next.Key.Code] = nextVal;\r\n\r\n\t\t\t\treturn acc;\r\n\t\t\t}, {});\r\n\r\n\t\t\tdetailValue.Number = calculator(fieldValues);\r\n\t\t\tdetailVals.values[-1] = detailValue;\r\n\r\n\t\t\tconst isDetailDeleted = detailVals.isDeleted;\r\n\r\n\t\t\tif(!isDetailDeleted && !isNaN(detailValue.Number)) {\r\n\t\t\t\tctrl.totalSum += detailValue.Number;\r\n\t\t\t}\r\n\r\n\t\t\tctrl.formattedTotalSum = isNaN(ctrl.totalSum) ? \"--\" : `${ctrl.totalSum.toLocaleString(\"en\", { style: \"currency\", currency: \"USD\" })}`;\r\n\t\t});\r\n\r\n\t\treturn totalField;\r\n\t}\r\n\r\n\tfunction prepareDetailsTable(details = {}) {\r\n\t\tconst columnFields = filter(ctrl.form.detailFields, {\r\n\t\t\tIsDetailColumnHeader: true\r\n\t\t});\r\n\r\n\t\tif(columnFields.length === 0) {\r\n\t\t\tcolumnFields[0] = ctrl.form.detailFields[0];\r\n\t\t}\r\n\r\n\t\tconst fieldDictionary = {};\r\n\t\tconst totalField = appendCalculatedFields(columnFields, details);\r\n\t\tif(totalField) {\r\n\t\t\tcolumnFields.push(totalField);\r\n\t\t\tfieldDictionary[\"-1\"] = totalField;\r\n\t\t}\r\n\r\n\t\tconst additionalFields = filter(ctrl.form.detailFields, d => !d.IsDetailColumnHeader);\r\n\t\tseparateDetails(details, columnFields, additionalFields);\r\n\r\n\t\tconst table = [];\r\n\t\tconst units = {};\r\n\r\n\t\tforEach(ctrl.form.detailFields, field => {\r\n\t\t\tfieldDictionary[field.Id] = field;\r\n\t\t\tif(field.Template === FIELD_TEMPLATES.Number || field.Template === FIELD_TEMPLATES.Location) {\r\n\t\t\t\tunits[field.Id] = {};\r\n\t\t\t\tforEach(field.Data, unit => {\r\n\t\t\t\t\tunits[field.Id][unit.Id] = unit.Abbreviation;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tunits[\"-1\"] = { \"-1\" : \"$\" };\r\n\r\n\t\t//Loop through each property of groupBy result\r\n\t\tforEach(details, detail => {\r\n\t\t\t//Create detail with array of field values\r\n\t\t\tconst detailColumnVals = detail.mainVals;\r\n\t\t\tconst detailId = detail.detailId;\r\n\r\n\t\t\ttable.push({\r\n\t\t\t\tadditionalDetails:\r\n\t\t\t\t\tdetail.extraVals && size(detail.extraVals) > 0 &&\r\n\t\t\t\t\tObject.values(detail.extraVals).map(extraDetailVal => {\r\n\t\t\t\t\t\tconst additionalField = fieldDictionary[extraDetailVal.FieldId];\r\n\r\n\t\t\t\t\t\tif(additionalField.IsNotReported === true || additionalField.IsHidden === true) {\r\n\t\t\t\t\t\t\treturn { field: undefined };\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst detailValue = {\r\n\t\t\t\t\t\t\tfield: additionalField.Name,\r\n\t\t\t\t\t\t\tvalue: (!!extraDetailVal && formatters[additionalField.Template]) ? formatters[additionalField.Template](additionalField, extraDetailVal) : \"--\",\r\n\t\t\t\t\t\t\tunit: (!!extraDetailVal && units[extraDetailVal.FieldId]) ? units[extraDetailVal.FieldId][extraDetailVal.DataId] : undefined\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\tif(detailValue.value && detailValue.value.length > 8) {\r\n\t\t\t\t\t\t\tdetailValue.tooltipValue = `${detailValue.value}`;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn detailValue;\r\n\t\t\t\t\t}),\r\n\t\t\t\tdetailId,\r\n\t\t\t\tisDeleted: detail.isDeleted,\r\n\t\t\t\ttableValues:\r\n\t\t\t\t\tdetailColumnVals &&\r\n\t\t\t\t\torderBy(\r\n\t\t\t\t\t\tmap(columnFields, field => {\r\n\t\t\t\t\t\t\tconst d = detail.values[field.Id];\r\n\t\t\t\t\t\t\tconst isNumber = \"Number\" in (d || {});\r\n\t\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t\tvalue: (!!d && formatters[field.Template]) ? formatters[field.Template](field, d) : \"--\",\r\n\t\t\t\t\t\t\t\torder: field.Order,\r\n\t\t\t\t\t\t\t\tunit: isNumber ? units[d.FieldId][d.DataId] : undefined\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t[\"order\"]\r\n\t\t\t\t\t),\r\n\t\t\t\tisEmpty: !detailColumnVals,\r\n\t\t\t\tcolumnQuantity: columnFields.length\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tif(some(table, row => !!row.isEmpty && !row.isDeleted)) {\r\n\t\t\tctrl.enableAddDetail && ctrl.enableAddDetail(false);\r\n\t\t} else {\r\n\t\t\tctrl.enableAddDetail && ctrl.enableAddDetail(true);\r\n\t\t}\r\n\r\n\t\tctrl.allDetails = table;\r\n\r\n\t\tctrl.detailsTable = {\r\n\t\t\tcolumns: columnFields.map(f => ({ name: f.Name, code: f.Code })),\r\n\t\t\thasDeleted: some(ctrl.detailValues, { isDeleted: true }),\r\n\t\t\thasAdditionalDetails: some(table, \"additionalDetails\")\r\n\t\t};\r\n\r\n\t\tshowOrHideDeleted();\r\n\t}\r\n\r\n\tfunction separateDetails(details, columnFields, additionalFields) {\r\n\t\tconst columnFieldIds = columnFields.map(f => f.Id);\r\n\t\tconst additionalFieldIds = additionalFields.map(f => f.Id);\r\n\r\n\t\tforEach(details, detail => {\r\n\t\t\tdetail.mainVals = {};\r\n\t\t\tdetail.extraVals = {};\r\n\r\n\t\t\tforEach(detail.values, val => {\r\n\t\t\t\tif(columnFieldIds.indexOf(val.FieldId) > -1) {\r\n\t\t\t\t\tdetail.mainVals[val.FieldId] = val;\r\n\t\t\t\t}\r\n\t\t\t\telse if(additionalFieldIds.indexOf(val.FieldId) > -1) {\r\n\t\t\t\t\tdetail.extraVals[val.FieldId] = val;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tfunction toggleDeleted() {\r\n\t\tctrl.showDeleted = !ctrl.showDeleted;\r\n\t\tshowOrHideDeleted();\r\n\t}\r\n\r\n\tfunction showOrHideDeleted() {\r\n\t\tctrl.detailsTable.details = ctrl.allDetails.filter(d => !d.isDeleted || ctrl.showDeleted);\r\n\t}\r\n\r\n\tfunction handleDetailDelete(detail) {\r\n\t\tctrl.detailValues[detail.detailId].isDeleted = true;\r\n\t\tdetail.isDeleted = true;\r\n\t\tforEach(ctrl.detailValues[detail.detailId].values, v => {\r\n\t\t\tv.IsDeleted = true;\r\n\t\t});\r\n\r\n\t\tctrl.detailsTable.hasDeleted = some(ctrl.detailValues, { isDeleted: true });\r\n\t\tappendCalculatedFields(undefined, ctrl.detailValues);\r\n\r\n\t\teventBus.trigger(EVENT_DETAIL_TOGGLE, { detailId: detail.detailId });\r\n\t\t$logger.event($logger.reportDetailEventBuilder(\"deleted\"), { detailId: detail.detailId });\r\n\t}\r\n\r\n\tfunction handleDetailRestore(detail) {\r\n\t\tctrl.detailValues[detail.detailId].isDeleted = false;\r\n\t\tdetail.isDeleted = false;\r\n\t\tforEach(ctrl.detailValues[detail.detailId].values, v => {\r\n\t\t\tv.IsDeleted = false;\r\n\t\t});\r\n\r\n\t\tctrl.detailsTable.hasDeleted = some(ctrl.detailValues, { isDeleted: true });\r\n\t\tappendCalculatedFields(undefined, ctrl.detailValues);\r\n\r\n\t\teventBus.trigger(EVENT_DETAIL_TOGGLE, { detailId: detail.detailId });\r\n\t\t$logger.event($logger.reportDetailEventBuilder(\"restored\"), { detailId: detail.detailId });\r\n\t}\r\n\r\n\tfunction isTableEmpty() {\r\n\t\tif(!ctrl.detailsTable) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst detailsQty = ctrl.detailsTable.details.filter(detail => !detail.isDeleted || ctrl.showDeleted).length;\r\n\t\treturn detailsQty === 0;\r\n\t}\r\n\r\n\tfunction onClickDetail(detail) {\r\n\t\tconst detailWithErrors = {\r\n\t\t\t...detail\r\n\t\t};\r\n\r\n\t\tdetailWithErrors.errors = ctrl.hasErrors && ctrl.hasErrors[detail.detailId];\r\n\t\tdetailWithErrors.warnings = ctrl.hasWarnings && ctrl.hasWarnings[detail.detailId];\r\n\r\n\t\tctrl.onDetailSelect({ detail: detailWithErrors });\r\n\t}\r\n\r\n\tctrl.handleKeypressAsButtonClick = (event) => {\r\n\t\tif(event.key === \"Enter\" || event.key === \" \") {\r\n\t\t\tctrl.editDetail();\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.components.report-details\", []).component(\"reportDetails\", {\r\n\ttemplate,\r\n\tcontroller,\r\n\tbindings: {\r\n\t\tform: \"<\",\r\n\t\tpermissions: \"<\",\r\n\t\tonDetailSelect: \"&\",\r\n\t\tregisterValueProvider: \"&\",\r\n\t\tgetDetail: \"&\",\r\n\t\tsetCallbacks: \"&\",\r\n\t\tenableAddDetail: \"=\",\r\n\t\tshowAddDetail: \"=\",\r\n\t\tmodifiedDates: \"<\",\r\n\t\tdetailValues: \"=\",\r\n\t\teditDetail: \"<\",\r\n\t\tdirtyDetails: \"=\", \r\n\t\tisSubmitted: \"<\"\r\n\t}\r\n}).name;\r\n","export default \"\\r\\n
\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t {{header.name}} \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t Please click the \\\"Add\\\" button below to add details \\r\\n\\t\\t\\t\\t No species \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t {{$ctrl.getTableDataPrefix(tableValue)}}{{tableValue.value}} {{$ctrl.getTableDataSuffix(tableValue)}} \\r\\n\\t\\t\\t\\t -- Please edit detail row to complete -- \\r\\n\\t\\t\\t\\t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\\tuib-tooltip=\\\"View detail\\\"\\r\\n\\t\\t\\t\\t\\t\\taria-from-attr=\\\"uib-tooltip\\\"\\r\\n\\t\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t {{$ctrl.getErrMessage('Error', $ctrl.hasErrors[detail.detailId])}}\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t {{$ctrl.getErrMessage('Warning', $ctrl.hasWarnings[detail.detailId])}}\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\r\\n\\t\\t+ add\\r\\n\\t\\r\\n
\";","/* eslint-disable no-unused-vars */\r\n/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport moment from \"moment\";\r\nimport {\r\n\tmapValues,\r\n\torderBy,\r\n\tfind,\r\n\tfilter,\r\n\tsize,\r\n\tsome,\r\n\tuniq,\r\n\tsum\r\n} from \"lodash\";\r\nimport { pluralize } from \"humanize-plus\";\r\nimport {\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_UNCLEAR_VALUE,\r\n\tEVENT_DETAILS_SUPPRESSION_TOGGLED,\r\n\tEVENT_SECTION_FIELD_VISIBILTY_CHANGE\r\n} from \"constants.js\";\r\n\r\nconst dateHelper = {\r\n\tsetTime: (fieldValue, conditionValue) => {\r\n\t\treturn moment(`${fieldValue.format(\"YYYY-MM-DD\")}T${conditionValue}`).utcOffset(fieldValue.utcOffset());\r\n\t}\r\n};\r\n\r\nconst periodDatePoints = {\r\n\tBeginInclusive: \"BeginInclusive\",\r\n\tEndExclusive: \"EndExclusive\",\r\n\tOpensInclusive: \"OpensInclusive\",\r\n\tClosesExclusive: \"ClosesExclusive\",\r\n\tDeadline: \"Deadline\"\r\n};\r\n\r\nconst decomposePeriodConfiguration = (configuration) => {\r\n\tconst parts = configuration.split(\".\");\r\n\tconst scope = parts.length > 1 ? parts[0] : undefined;\r\n\tconst field = parts.length > 1 ? parts[1] : parts[0];\r\n\r\n\treturn { scope, field };\r\n};\r\n\r\nconst getCurrentPeriodRange = (configuration, date, metadata) => {\r\n\tconst dateMoment = moment(date);\r\n\r\n\tlet currentPeriod = null;\r\n\r\n\tfor(let i = 0; i < metadata.form.Seasons.length; i++) {\r\n\t\tconst season = metadata.form.Seasons[i];\r\n\t\tif(season.Scope !== configuration.scope)\r\n\t\t\tcontinue;\r\n\t\tif(moment(season.BeginInclusive).isAfter(date) || moment(season.EndExclusive).isSameOrBefore(date))\r\n\t\t\tcontinue;\r\n\r\n\t\tconst foundSeasonPeriod = season.Periods.find(p => {\r\n\t\t\tconst beginMoment = moment(p.BeginInclusive);\r\n\t\t\tconst endMoment = moment(p.EndExclusive);\r\n\r\n\t\t\treturn beginMoment.isSameOrBefore(dateMoment) && endMoment.isAfter(dateMoment);\r\n\t\t});\r\n\r\n\t\tif(!!foundSeasonPeriod) {\r\n\t\t\tcurrentPeriod = foundSeasonPeriod;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\treturn currentPeriod;\r\n};\r\n\r\nconst toUnix = (moment) => parseInt(moment.format(\"X\"));\r\n\r\nfunction dateEvaluator(evaluator, condition, metadata, relevantFieldValues) {\r\n\tconst compareToValue = find(relevantFieldValues, (v) => v.FieldId === (condition.CompareToField || {}).Id) || {};\r\n\tconst fieldValue = find(relevantFieldValues, (v) => v.FieldId === (condition.Field || {}).Id) || {};\r\n\t\r\n\tconst selectedDate = moment(fieldValue.Date);\r\n\tconst compareToDate = compareToValue.Date && moment(compareToValue.Date);\r\n\tconst now = moment();\r\n\r\n\tif(condition.Scope?.Code === CONDITION_SCOPES.Date) {\r\n\t\tselectedDate.milliseconds(0)\r\n\t\t\t.seconds(0)\r\n\t\t\t.minutes(0)\r\n\t\t\t.hours(0);\r\n\r\n\t\tnow.milliseconds(0)\r\n\t\t\t.seconds(0)\r\n\t\t\t.minutes(0)\r\n\t\t\t.hours(0);\r\n\r\n\t\tif(compareToDate) {\r\n\t\t\tcompareToDate.milliseconds(0)\r\n\t\t\t\t.seconds(0)\r\n\t\t\t\t.minutes(0)\r\n\t\t\t\t.hours(0);\r\n\t\t}\r\n\t}\r\n\r\n\tconst values = { \r\n\t\tvalue: condition.Scope?.Code === CONDITION_SCOPES.Time ?\r\n\t\t\tdateHelper.setTime(selectedDate, condition.Value) :\r\n\t\t\tcondition.Value,\r\n\t\tminValue: moment(now).add(condition.MinValue, \"minutes\"),\r\n\t\tmaxValue: moment(now).add(condition.MaxValue, \"minutes\")\r\n\t};\r\n\r\n\tif(values.value === undefined) {\r\n\t\tvalues.value = moment(compareToDate);\r\n\t}\r\n\telse if(typeof values.value === \"string\") {\r\n\t\tconst configuration = decomposePeriodConfiguration(values.value || \"\");\r\n\t\tif(configuration.field in periodDatePoints) {\r\n\t\t\tconst currentPeriod = getCurrentPeriodRange(configuration, selectedDate, metadata);\r\n\t\t\tif(!!currentPeriod) {\r\n\t\t\t\tconst periodFieldTime = moment(currentPeriod[configuration.field]);\r\n\r\n\t\t\t\treturn evaluator([toUnix(now)], { value: toUnix(periodFieldTime) }, metadata);\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tconst compareTo = mapValues(values, (v) => {\r\n\t\tif(v !== undefined) {\r\n\t\t\tconst conditionAsMoment = moment(v, moment.ISO_8601, true);\r\n\t\t\tif(conditionAsMoment.isValid()) {\r\n\t\t\t\treturn toUnix(conditionAsMoment);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn toUnix(moment(now).add(v, \"m\"));\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tconst selectedDateInUnix = toUnix(selectedDate);\r\n\r\n\treturn evaluator(fieldValue.Date ? [selectedDateInUnix] : [], compareTo, metadata);\r\n}\r\n\r\nexport const RULE_OPERATORS = {\r\n\tAND: \"AND\",\r\n\tOR: \"OR\", \r\n\tNAND: \"NAND\",\r\n\tNOR: \"NOR\",\r\n\tXOR: \"XOR\"\r\n};\r\n\r\nexport const OPERATOR_ACTIONS = {\r\n\tAND: (...args) => Object.values(...args ?? []).every(v => v),\r\n\tOR: (...args) => Object.values(...args ?? []).some(v => v), \r\n\tNAND: (...args) => !Object.values(...args ?? []).every(v => v),\r\n\tNOR: (...args) => !Object.values(...args ?? []).some(v => v),\r\n\tXOR: (...args) => !!(sum(Object.values(...args ?? []).map(a => !!a ? 1 : 0)) === 1) // cascade xor - true if there one and only one true result\r\n};\r\n\r\nexport const AGGREGATION_ACTIONS = {\r\n\tALL: (...args) => Object.values(...args ?? []).every(v => !!v),\r\n\tANY: (...args) => Object.values(...args ?? []).some(v => !!v),\r\n\tNONE: (...args) => !Object.values(...args ?? []).some(v => !!v),\r\n\tSOME: (...args) => Object.values(...args ?? []).some(v => !!v) && Object.values(...args ?? []).some(v => !v)\r\n};\r\n\r\nexport const CONDITION_OPERATORS = {\r\n\tINCLUSIVE: \"inclusive\",\r\n\tINCLUSIVEEXCLUSIVE: \"inclusiveExclusive\",\r\n\tEXCLUSIVEINCLUSIVE: \"exclusiveInclusive\",\r\n\tEXCLUSIVE: \"exclusive\",\r\n\tGREATERTHAN: \"greaterThan\",\r\n\tGREATERTHANOREQUALTO: \"greaterThanOrEqualTo\",\r\n\tLESSTHAN: \"lessThan\",\r\n\tLESSTHANOREQUALTO: \"lessThanOrEqualTo\",\r\n\tEQUALTO: \"equalTo\",\r\n\tNOTEQUALTO: \"notEqualTo\",\r\n\tIS: \"is\",\r\n\tISNOT: \"isNot\",\r\n\tHASBEEN: \"hasBeen\",\r\n\tHASNOTBEEN: \"hasNotBeen\",\r\n\tISCURRENTLY: \"isCurrently\",\r\n\tISNOTCURRENTLY: \"isNotCurrently\",\r\n\tWITHENTITY: \"withEntity\",\r\n\tISONLINE: \"isOnline\",\r\n\tISINTERACTIVE: \"isInteractive\"\r\n};\r\n\r\nexport const CONDITION_EVALUATIONS = {\r\n\tgreaterThan: \"GREATERTHAN\",\r\n\tgreaterThanOrEqualTo: \"GREATERTHANOREQUALTO\",\r\n\tlessThan: \"LESSTHAN\",\r\n\tlessThanOrEqualTo: \"LESSTHANOREQUALTO\"\r\n};\r\n\r\nexport const CONDITION_SCOPES = {\r\n\tTime: \"TIME\",\r\n\tDate: \"DATE\",\r\n\tLatitude: \"LATITUDE\",\r\n\tLongitude: \"LONGITUDE\"\r\n};\r\n\r\nexport const EVALUATE_ON = {\r\n\tONSUBMIT: \"onSubmit\",\r\n\tONSAVE: \"onSave\"\r\n};\r\n\r\nconst compareFunctions = {\r\n\tgreaterThan: (fieldValues, compareTo, metadata) =>\r\n\t\tcompareVals(fieldValues, compareTo, (a, b) => parseFloat(a) > parseFloat(b)),\r\n\tgreaterThanOrEqualTo: (fieldValues, compareTo, metadata) =>\r\n\t\tcompareVals(fieldValues, compareTo, (a, b) => parseFloat(a) >= parseFloat(b)),\r\n\tlessThan: (fieldValues, compareTo, metadata) =>\r\n\t\tcompareVals(fieldValues, compareTo, (a, b) => parseFloat(a) < parseFloat(b)),\r\n\tlessThanOrEqualTo: (fieldValues, compareTo, metadata) =>\r\n\t\tcompareVals(fieldValues, compareTo, (a, b) => parseFloat(a) <= parseFloat(b)),\r\n\tequalTo: (fieldValues, compareTo, metadata) =>\r\n\t\tcompareVals(fieldValues, compareTo, (a, b) => a === b),\r\n\tnotEqualTo: (fieldValues, compareTo, metadata) =>\r\n\t\tcompareVals(fieldValues, compareTo, (a, b) => a !== b, true)\r\n};\r\n\r\nconst beginningCommaRegex = /^,/;\r\nconst endingCommaRegex = /,$/;\r\nconst twoCommasRegex = /,,/;\r\n\r\nexport const ENGINE_EVALUATIONS = {\r\n\trange: {\r\n\t\tcode: \"RANGE\",\r\n\t\tinclusive: (fieldValues, compareTo, metadata) =>\r\n\t\t\tfieldValues.length && (compareTo.minValue <= fieldValues[0] && fieldValues[0] <= compareTo.maxValue),\r\n\t\tinclusiveExclusive: (fieldValues, compareTo, metadata) =>\r\n\t\t\tfieldValues.length && (compareTo.minValue <= fieldValues[0] && fieldValues[0] < compareTo.maxValue),\r\n\t\texclusiveInclusive: (fieldValues, compareTo, metadata) =>\r\n\t\t\tfieldValues.length && (compareTo.minValue < fieldValues[0] && fieldValues[0] <= compareTo.maxValue),\r\n\t\texclusive: (fieldValues, compareTo, metadata) =>\r\n\t\t\tfieldValues.length && (compareTo.minValue < fieldValues[0] && fieldValues[0] < compareTo.maxValue)\r\n\t},\r\n\tcompare: {\r\n\t\tcode: \"COMPARE\",\r\n\t\t...compareFunctions\r\n\t},\r\n\tlocation: {\r\n\t\tcode: \"LOCATION\",\r\n\t\t...compareFunctions\r\n\t},\r\n\tany: {\r\n\t\tcode: \"ANY\",\r\n\t\tevaluate: (fieldValues, compareTo, metadata) =>\r\n\t\t\tsize(fieldValues) > 0\r\n\t},\r\n\trequired: {\r\n\t\tcode: \"REQUIRED\",\r\n\t\tevaluate: (fieldValues, compareTo, metadata) =>\r\n\t\t\t(fieldValues.length > 0) \r\n\t\t\t&& fieldValues.every(v => \r\n\t\t\t\tv.idRequired !== true || \r\n\t\t\t\t(v.DataId !== undefined && v.DataId !== null) || \r\n\t\t\t\t(v.EntityId !== undefined && v.EntityId !== null) || \r\n\t\t\t\tv === true || \r\n\t\t\t\tv === false\r\n\t\t\t) \r\n\t},\r\n\tvalue: {\r\n\t\tcode: \"VALUE\",\r\n\t\tevaluate: (fieldValues, compareTo, metadata) =>\r\n\t\t\tENGINE_EVALUATIONS.required.evaluate(fieldValues, compareTo, metadata)\r\n\t\t\t|| ENGINE_EVALUATIONS.notAvailable.evaluate(fieldValues, compareTo, metadata)\r\n\t\t\t|| ENGINE_EVALUATIONS.customEntry.evaluate(fieldValues, compareTo, metadata)\r\n\t},\r\n\tnotAvailable: {\r\n\t\tcode: \"NOTAVAILABLE\",\r\n\t\tevaluate: (fieldValues, compareTo, metadata) => {\r\n\t\t\treturn fieldValues.length && fieldValues[0].IsNotAvailable === true;\r\n\t\t},\r\n\t\twithEntity: (fieldValues, compareTo, metadata) => {\r\n\t\t\tconst isValuePresent = fieldValues.length && fieldValues[0].IsNotAvailable === true\r\n\t\t\t\t&& (fieldValues[0].DataId !== undefined || fieldValues[0].EntityId !== undefined);\r\n\r\n\t\t\treturn isValuePresent;\r\n\t\t}\r\n\t},\r\n\tclassification: {\r\n\t\tcode: \"CLASSIFICATION\",\r\n\t\tis: (fieldValues, compareTo, metadata) =>\r\n\t\t\t!!(fieldValues.length) && (!!fieldValues[0].Classifications && some(fieldValues[0].Classifications, (c) => c.Code == compareTo.value)),\r\n\t\tisNot: (fieldValues, compareTo) =>\r\n\t\t\t!(fieldValues) || (fieldValues.length === 0) || (!fieldValues[0].Classifications) || (!some(fieldValues[0].Classifications, (c) => c.Code == compareTo.value))\r\n\t},\r\n\tidentifier: {\r\n\t\tcode: \"IDENTIFIER\",\r\n\t\tis: (fieldValues, compareTo, metadata) =>\r\n\t\t\t!!(fieldValues.length) && (!!fieldValues[0].Identifiers && some(fieldValues[0].Identifiers, (c) => c.Type.Code == compareTo.value)),\r\n\t\tisNot: (fieldValues, compareTo, metadata) =>\r\n\t\t\t!(fieldValues) || (fieldValues.length === 0) || (!fieldValues[0].Identifiers) || (!some(fieldValues[0].Identifiers, (c) => c.Type.Code == compareTo.value))\r\n\t},\r\n\tregex: {\r\n\t\tcode: \"REGEX\",\r\n\t\tis: (fieldValues, compareTo, metadata) => {\r\n\t\t\tif(!fieldValues.length)\r\n\t\t\t\treturn false;\r\n\r\n\t\t\tconst exp = new RegExp(compareTo.value);\r\n\t\t\tconst isMatch = fieldValues.length > 0 && exp.test(fieldValues[0].String);\r\n\t\t\treturn isMatch;\r\n\t\t},\r\n\t\tisNot: (fieldValues, compareTo, metadata) => {\r\n\t\t\tif(!fieldValues.length)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tconst exp = new RegExp(compareTo.value);\r\n\t\t\tconst isMatch = fieldValues.length > 0 && exp.test(fieldValues[0].String);\r\n\t\t\treturn !isMatch;\r\n\t\t}\r\n\t},\r\n\tempty: {\r\n\t\tcode: \"EMPTY\",\r\n\t\tevaluate: (fieldValues, compareTo, metadata) =>\r\n\t\t\tfieldValues.length === 0\r\n\t},\r\n\tlength: {\r\n\t\tcode: \"LENGTH\",\r\n\t\tlessThanOrEqualTo: (fieldValues, compareTo, metadata) =>\r\n\t\t\tfieldValues.length && (fieldValues[0].String.length <= compareTo.value)\r\n\t},\r\n\tchange: {\r\n\t\tcode: \"CHANGE\",\r\n\t\tevaluate: () => false\r\n\t},\r\n\tcontains: {\r\n\t\tcode: \"CONTAINS\",\r\n\t\tevaluate: () => true\r\n\t},\r\n\tintersect: {\r\n\t\tcode: \"INTERSECT\",\r\n\t\tevaluate: () => true\r\n\t},\r\n\tenvironment: {\r\n\t\tcode: \"ENVIRONMENT\",\r\n\t\tisOnline: (fieldValue, _, metadata) => fieldValue === metadata.isOnline,\r\n\t\tisInteractive: (fieldValue) => fieldValue === true\r\n\t},\r\n\tcustomEntry: {\r\n\t\tcode: \"CUSTOMENTRY\",\r\n\t\tevaluate: (fieldValues, compareTo, metadata) =>\r\n\t\t\tfieldValues.length && (fieldValues[0].String && fieldValues[0].String.length > 0)\r\n\t},\r\n\tperiod: {\r\n\t\tcode: \"PERIOD\",\r\n\t\tgreaterThan: (fieldValues, compareTo, metadata) =>\r\n\t\t\tENGINE_EVALUATIONS.compare.greaterThan(fieldValues, compareTo, metadata),\r\n\t\tgreaterThanOrEqualTo: (fieldValues, compareTo, metadata) =>\r\n\t\t\tENGINE_EVALUATIONS.compare.greaterThanOrEqualTo(fieldValues, compareTo, metadata),\r\n\t\tlessThan: (fieldValues, compareTo, metadata) =>\r\n\t\t\tENGINE_EVALUATIONS.compare.lessThan(fieldValues, compareTo, metadata),\r\n\t\tlessThanOrEqualTo: (fieldValues, compareTo, metadata) =>\r\n\t\t\tENGINE_EVALUATIONS.compare.lessThanOrEqualTo(fieldValues, compareTo, metadata),\r\n\t\tequalTo: (fieldValues, compareTo, metadata) =>\r\n\t\t\tENGINE_EVALUATIONS.compare.equalTo(fieldValues, compareTo, metadata),\r\n\t\tnotEqualTo: (fieldValues, compareTo, metadata) =>\r\n\t\t\tENGINE_EVALUATIONS.compare.notEqualTo(fieldValues, compareTo, metadata)\r\n\t},\r\n\tunique: {\r\n\t\tcode: \"UNIQUE\",\r\n\t\tevaluate: (detailValues, compareTo, metadata) => {\r\n\t\t\tconst detailStrings = [];\r\n\t\t\tfor(const detail of Object.values(detailValues)) {\r\n\t\t\t\tlet thisDetailString = \"\";\r\n\r\n\t\t\t\tObject.entries(detail).forEach(([fieldId, fieldVal]) => {\r\n\t\t\t\t\tif(fieldVal.length !== 1)\r\n\t\t\t\t\t\t; // do nothing - we do not support uniques over multi-entry fields currently\r\n\r\n\t\t\t\t\tlet thisFieldValue = fieldVal[0];\r\n\t\t\t\t\tif(!thisFieldValue)\r\n\t\t\t\t\t\t;\r\n\t\t\t\t\telse if(thisFieldValue.Number) {\r\n\t\t\t\t\t\tif(thisFieldValue.DataId !== undefined && thisFieldValue.DataId !== null) {\r\n\t\t\t\t\t\t\tthisFieldValue = `${thisFieldValue.Number}|${thisFieldValue.DataId}`;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tthisFieldValue = thisFieldValue.Number;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(thisFieldValue.EntityId) {\r\n\t\t\t\t\t\tif(thisFieldValue.ContactId) {\r\n\t\t\t\t\t\t\tthisFieldValue = `${thisFieldValue.EntityId}|${thisFieldValue.ContactId}`;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tthisFieldValue = thisFieldValue.EntityId;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(thisFieldValue.DataId !== undefined && thisFieldValue.DataId !== null) {\r\n\t\t\t\t\t\tthisFieldValue = thisFieldValue.DataId;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(thisFieldValue.compareVal) {\r\n\t\t\t\t\t\tthisFieldValue = thisFieldValue.compareVal;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthisDetailString = `${thisDetailString}|${fieldId}:${JSON.stringify(thisFieldValue)}`;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tdetailStrings.push(thisDetailString);\r\n\t\t\t}\r\n\r\n\t\t\tconst uniqueRowVals = uniq(detailStrings);\r\n\r\n\t\t\treturn uniqueRowVals.length === detailStrings.length || detailStrings.length === 0;\r\n\t\t}\r\n\t},\r\n\tstate: {\r\n\t\tcode: \"STATE\",\r\n\t\thasBeen: (stateValue, compareTo, metadata) => {\r\n\t\t\tif(!metadata?.report?.History || metadata.report.History.length === 0) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tconst hasValue = some(metadata.report.History, h => h.State.Code === stateValue);\r\n\t\t\treturn hasValue;\r\n\t\t},\r\n\t\thasNotBeen: (stateValue, compareTo, metadata) => {\r\n\t\t\tif(!metadata?.report?.History || metadata.report.History.length === 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tconst hasValue = some(metadata.report.History, h => h.State.Code === stateValue);\r\n\t\t\treturn !hasValue;\r\n\t\t},\r\n\t\tisCurrently: (stateValue, compareTo, metadata) => {\r\n\t\t\tif(!metadata?.report?.History || metadata.report.History.length === 0) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tconst orderedHistory = orderBy(metadata.report.History, h => moment(h.Occurred));\r\n\t\t\treturn orderedHistory[orderedHistory.length - 1].State.Code === stateValue;\r\n\t\t},\r\n\t\tisNotCurrently: (stateValue, compareTo, metadata) => {\r\n\t\t\tif(!metadata?.report?.History || metadata.report.History.length === 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tconst orderedHistory = orderBy(metadata.report.History, h => moment(h.Occurred));\r\n\t\t\treturn orderedHistory[orderedHistory.length - 1].State.Code !== stateValue;\r\n\t\t}\r\n\t},\r\n\tcombination: {\r\n\t\tcode: \"COMBINATION\",\r\n\t\tevaluate: (fieldValues, compareTo, metadata) => {\r\n\t\t\tconst valueDictionaries = Object.values(fieldValues ?? {})[0];\r\n\t\t\tconst sorted = [...Object.entries(valueDictionaries ?? {})]\r\n\t\t\t\t.sort(([aFieldId, a], [bFieldId, b]) => {\r\n\t\t\t\t\tconst aCondition = metadata.rule.Conditions.find(c => c.Field.Id === parseInt(aFieldId));\r\n\t\t\t\t\tconst bCondition = metadata.rule.Conditions.find(c => c.Field.Id === parseInt(bFieldId));\r\n\r\n\t\t\t\t\treturn aCondition.Order - bCondition.Order ;\r\n\t\t\t\t})\r\n\t\t\t\t.map(([entryKey, entry]) => entry);\r\n\t\t\t\r\n\t\t\tconst thisCombo = sorted\r\n\t\t\t\t.flatMap(v => !!v[0]?.IsNotAvailable ? \"$[NA]$\" : (v[0]?.DataId ?? \"\"))\r\n\t\t\t\t.filter(v => v !== undefined)\r\n\t\t\t\t.join(\",\");\r\n\r\n\t\t\tconst cleanedCombo = thisCombo\r\n\t\t\t\t.replace(beginningCommaRegex, \"(0|[1-9]\\\\d*),\")\r\n\t\t\t\t.replace(endingCommaRegex, \",(0|[1-9]\\\\d*)\")\r\n\t\t\t\t.replace(twoCommasRegex, \",(0|[1-9]\\\\d*),\")\r\n\t\t\t\t.replace(twoCommasRegex, \",(0|[1-9]\\\\d*),\");\r\n\t\t\t\r\n\t\t\tconst comboRegex = new RegExp(`^${cleanedCombo}$`);\r\n\t\t\tconst comboIsValid = metadata.rule.Blob.combinations.some(c => comboRegex.test(c));\r\n\t\t\t\r\n\t\t\treturn comboIsValid;\r\n\t\t}\r\n\t},\r\n\trole: {\r\n\t\tcode: \"ROLE\",\r\n\t\t...compareFunctions\r\n\t}\r\n};\r\n\r\nconst compareVals = (values, comparison, comparator, defaultOnEmpty = false) => {\r\n\tif(!values.length)\r\n\t\treturn defaultOnEmpty;\r\n\tif(typeof values[0] === \"object\") {\r\n\t\tif(!!values[0].compareVal && !!comparison.value && !!comparison.value.compareVal) {\r\n\t\t\tconst evaluated = comparator(values[0].compareVal, comparison.value.compareVal);\r\n\t\t\treturn evaluated;\r\n\t\t}\r\n\t\telse if(!!values[0].Code) {\r\n\t\t\treturn comparator(values[0].Code, comparison.value);\r\n\t\t}\r\n\r\n\t}\r\n\treturn comparator(values[0], comparison.value);\r\n};\r\n\r\nclass TRIGGER_METHODS_SERVICE {\r\n\tconstructor(eventBus, $logger) {\r\n\t\tthis.eventBus = eventBus;\r\n\r\n\t\tthis.methods = {\r\n\t\t\tVISIBILITY: (field, operator, matched, rule) => {\r\n\t\t\t\tconst oldVisible = !!field.visible;\r\n\t\t\t\tfield.visible = !!((matched && operator.Matched === \"SHOW\") || (!matched && operator.Matched === \"HIDE\"));\r\n\r\n\t\t\t\tif(field.Section) {\r\n\t\t\t\t\tthis.eventBus.trigger(EVENT_SECTION_FIELD_VISIBILTY_CHANGE(field.Section.Id));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfield.initReadOnly = false;\r\n\r\n\t\t\t\tif(!field.visible && !!oldVisible) {\r\n\t\t\t\t\tfield.value = [];\r\n\t\t\t\t\tthis.eventBus.trigger(EVENT_CLEAR_VALUE(field.Id));\r\n\t\t\t\t}\r\n\t\t\t\telse if(!!field.visible && !oldVisible) {\r\n\t\t\t\t\tthis.eventBus.trigger(EVENT_UNCLEAR_VALUE(field.Id));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn { visibilityChanged: oldVisible !== field.visible };\r\n\t\t\t},\r\n\r\n\t\t\tREADONLY: (field, operator, matched, rule) => {\r\n\t\t\t\tfield.isReadonly = !!((matched && operator.Matched === \"ENABLE\") || (!matched && operator.Matched === \"DISABLE\"));\r\n\r\n\t\t\t\treturn { visibilityChanged: false };\r\n\t\t\t},\r\n\r\n\t\t\tDETAILS: (field, operator, matched, rule) => {\r\n\t\t\t\tconst suppressed = matched\r\n\t\t\t\t\t? operator.Matched === \"DISABLED\"\r\n\t\t\t\t\t: operator.NotMatched === \"DISABLED\";\r\n\r\n\t\t\t\tthis.eventBus.trigger(EVENT_DETAILS_SUPPRESSION_TOGGLED, { suppressed });\r\n\t\t\t},\r\n\r\n\t\t\tREQUIRED: (field, operator, matched, rule) => {\r\n\t\t\t\tfield.isRequired = (matched && operator.Matched === \"REQUIRED\");\r\n\t\t\t},\r\n\r\n\t\t\tHIGHLIGHT: (field, operator, matched, rule) => {\r\n\t\t\t\t// implement in the futute\r\n\t\t\t},\r\n\r\n\t\t\tLESSTHANOREQUALTO: (field, operator, matched, rule) => {\r\n\t\t\t\tif(!field.filters) {\r\n\t\t\t\t\tfield.filters = {};\r\n\t\t\t\t}\r\n\t\t\t\tfield.filters[CONDITION_OPERATORS.LESSTHANOREQUALTO] = [];\r\n\r\n\t\t\t\tif(rule.compareValues.length) {\r\n\t\t\t\t\tfield.filters[CONDITION_OPERATORS.LESSTHANOREQUALTO] = rule.compareValues;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tfield.filters[CONDITION_OPERATORS.LESSTHANOREQUALTO] = null;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tGREATERTHANOREQUALTO: (field, operator, matched, rule) => {\r\n\t\t\t\tif(!field.filters) {\r\n\t\t\t\t\tfield.filters = {};\r\n\t\t\t\t}\r\n\t\t\t\tfield.filters[CONDITION_OPERATORS.GREATERTHANOREQUALTO] = [];\r\n\t\t\t\tif(rule.compareValues.length) {\r\n\t\t\t\t\tfield.filters[CONDITION_OPERATORS.GREATERTHANOREQUALTO] = rule.compareValues;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tfield.filters[CONDITION_OPERATORS.GREATERTHANOREQUALTO] = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n}\r\nexport const TRIGGER_METHODS = angular\r\n\t.module(\"vesl.services.trigger-methods\", [])\r\n\t.service(\"triggerMethods\", TRIGGER_METHODS_SERVICE).name;\r\n\r\nexport const TRIGGER_TYPES = {\r\n\tvalidation: \"VALIDATION\",\r\n\tuserInterface: \"USERINTERFACE\",\r\n\tfilter: \"FILTER\"\r\n};\r\n\r\nexport const UI_OPERATOR_TYPES = {\r\n\tvisibility: \"VISIBILITY\",\r\n\tdetails: \"DETAILS\",\r\n\tfilter: \"FILTER\",\r\n\treadonly: \"READONLY\"\r\n};\r\n\r\nexport const ENGINE_TYPES = {\r\n\tRANGE: {\r\n\t\tfunction: \"range\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tCOMPARE: {\r\n\t\tfunction: \"compare\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tANY: {\r\n\t\tfunction: \"any\",\r\n\t\tisAggregate: true\r\n\t},\r\n\tVALUE: {\r\n\t\tfunction: \"value\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tREQUIRED: {\r\n\t\tfunction: \"required\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tCLASSIFICATION: {\r\n\t\tfunction: \"classification\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tREGEX: {\r\n\t\tfunction: \"regex\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tIDENTIFIER: {\r\n\t\tfunction: \"identifier\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tENVIRONMENT: {\r\n\t\tfunction: \"environment\",\r\n\t\tisAggregate: false,\r\n\t\tisMetadataEngine: true\r\n\t},\r\n\tUNIQUE: {\r\n\t\tfunction: \"unique\",\r\n\t\tisAggregate: true\r\n\t},\r\n\tINTERSECT: {\r\n\t\tfunction: \"intersect\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tEMPTY: {\r\n\t\tfunction: \"empty\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tNOTAVAILABLE: {\r\n\t\tfunction: \"notAvailable\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tLENGTH: {\r\n\t\tfunction: \"length\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tCHANGE: {\r\n\t\tfunction: \"change\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tCONTAINS: {\r\n\t\tfunction: \"contains\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tEXISTING: {\r\n\t\tfunction: \"existing\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tCUSTOMENTRY: {\r\n\t\tfunction: \"customEntry\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tPERIOD: {\r\n\t\tfunction: \"period\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tSTATE: {\r\n\t\tfunction: \"state\",\r\n\t\tisAggregate: false,\r\n\t\tisMetadataEngine: true\r\n\t},\r\n\tCOMBINATION: {\r\n\t\tfunction: \"combination\",\r\n\t\tisAggregate: false,\r\n\t\tisConditionAggregate: true\r\n\t},\r\n\tLOCATION: {\r\n\t\tfunction: \"location\",\r\n\t\tisAggregate: false\r\n\t},\r\n\tROLE: {\r\n\t\tfunction: \"role\",\r\n\t\tisAggregate: false,\r\n\t\tisMetadataEngine: true\r\n\t}\r\n};\r\n\r\nexport const EVALUATION_PREPARERS = {\r\n\tDate: (evaluator, condition, metadata, fieldValues) => {\r\n\t\tconst mappedVals = TEMPLATE_VALUE_PREPARERS[\"Date\"](fieldValues, condition.Scope);\r\n\t\treturn dateEvaluator(evaluator, condition, metadata, mappedVals);\r\n\t},\r\n\tDateTime: (evaluator, condition, metadata, fieldValues) => {\r\n\t\tconst mappedVals = TEMPLATE_VALUE_PREPARERS[\"DateTime\"](fieldValues, condition.Scope);\r\n\t\treturn dateEvaluator(evaluator, condition, metadata, mappedVals);\r\n\t},\r\n\tYearMonth:(evaluator, condition, metadata, fieldValues) => {\r\n\t\tconst mappedVals = TEMPLATE_VALUE_PREPARERS[\"Date\"](fieldValues, condition.Scope);\r\n\t\treturn dateEvaluator(evaluator, condition, metadata, mappedVals);\r\n\t},\r\n\tNumber: (evaluator, condition, metadata, fieldValues) => {\r\n\t\tif(condition.Scope?.Code === \"DATA\") {\r\n\t\t\treturn EVALUATION_PREPARERS.Selection(evaluator, condition, metadata, fieldValues);\r\n\t\t}\r\n\t\tconst conditionFieldValues = filter(fieldValues, (v) => v.FieldId === condition.Field?.Id) || [];\r\n\t\tconst compareToField = filter(fieldValues, (v) => v.FieldId === condition.CompareToField?.Id) || [];\r\n\r\n\t\tconst mappedFieldVal = TEMPLATE_VALUE_PREPARERS[\"Number\"](conditionFieldValues, condition.Scope);\r\n\t\tconst mappedCompareToVal = TEMPLATE_VALUE_PREPARERS[\"Number\"](compareToField, condition.Scope);\r\n\r\n\t\tconst compareValues = {\r\n\t\t\tvalue: condition.Value === undefined ? mappedCompareToVal : condition.Value,\r\n\t\t\tminValue: condition.MinValue,\r\n\t\t\tmaxValue: condition.MaxValue\r\n\t\t};\r\n\r\n\t\treturn evaluator(mappedFieldVal, compareValues, metadata);\r\n\t},\r\n\tLocation: (evaluator, condition, metadata, fieldValues) => EVALUATION_PREPARERS.Number(evaluator, condition, metadata, fieldValues),\r\n\tCoordinate: (evaluator, condition, metadata, fieldValues) => {\r\n\t\tconst mappedVals = TEMPLATE_VALUE_PREPARERS[\"Coordinate\"](fieldValues, condition.Scope);\r\n\r\n\t\treturn evaluator(mappedVals, { value: condition.Value }, metadata);\r\n\t},\r\n\tSelection: (evaluator, condition, metadata, fieldValues) => {\r\n\t\tconst values = TEMPLATE_VALUE_PREPARERS[\"Selection\"](fieldValues, condition.Scope);\r\n\r\n\t\tconst compareToValue = find(values, (v) => v.FieldId === condition.CompareToField?.Id) || {};\r\n\t\tconst vals = filter(values, (v) => v.FieldId === condition.Field?.Id) || [];\r\n\t\tconst compareValues = {\r\n\t\t\tvalue: condition.Value || compareToValue\r\n\t\t};\r\n\r\n\t\treturn evaluator(vals, compareValues, metadata);\r\n\t},\r\n\tEntitySelector: (evaluator, condition, metadata, fieldValues) => {\r\n\t\tconst compareValues = {\r\n\t\t\tvalue: condition.Value\r\n\t\t};\r\n\r\n\t\tconst values = TEMPLATE_VALUE_PREPARERS[\"EntitySelector\"](fieldValues, condition.Scope);\r\n\r\n\t\treturn evaluator(values, compareValues, metadata);\r\n\t},\r\n\tEntityContactSelector: (evaluator, condition, metadata, fieldValues) => {\r\n\t\tconst compareValues = {\r\n\t\t\tvalue: condition.Value\r\n\t\t};\r\n\r\n\t\tconst values = TEMPLATE_VALUE_PREPARERS[\"EntityContactSelector\"](fieldValues, condition.Scope);\r\n\r\n\t\treturn evaluator(values, compareValues, metadata);\r\n\t},\r\n\tMultiSelect: (evaluator, condition, metadata, fieldValues) => {\r\n\t\tconst values = TEMPLATE_VALUE_PREPARERS[\"MultiSelect\"](fieldValues, condition.Scope);\r\n\r\n\t\treturn evaluator(values, {}, metadata);\r\n\t},\r\n\tText: (evaluator, condition, metadata, fieldValues) => {\r\n\t\tconst mappedVals = TEMPLATE_VALUE_PREPARERS[\"Text\"](fieldValues, condition.Scope);\r\n\r\n\t\treturn evaluator(mappedVals, { value: condition.Value }, metadata);\r\n\t},\r\n\tTextArea: (evaluator, condition, metadata, fieldValues) => {\r\n\t\tconst mappedVals = TEMPLATE_VALUE_PREPARERS[\"TextArea\"](fieldValues, condition.Scope);\r\n\r\n\t\treturn evaluator(mappedVals, { value: condition.Value }, metadata);\r\n\t},\r\n\tBoolean: (evaluator, condition, metadata, fieldValues) => {\r\n\t\tconst mappedVals = TEMPLATE_VALUE_PREPARERS[\"Boolean\"](fieldValues, condition.Scope);\r\n\r\n\t\treturn evaluator(mappedVals, { value: condition.Value }, metadata);\r\n\t},\r\n\tMetadata: (evaluator, condition, metadata, conditionValues) => {\r\n\t\treturn evaluator(conditionValues[0], !!condition.Value ? { value: condition.Value } : undefined, metadata);\r\n\t}\r\n};\r\n\r\nexport const TEMPLATE_VALUE_PREPARERS = {\r\n\tDate: (fieldValues) => {\r\n\t\treturn fieldValues;\r\n\t},\r\n\tDateTime: (fieldValues) => {\r\n\t\treturn fieldValues;\r\n\t},\r\n\tNumber: (fieldValues) => {\r\n\t\tfieldValues.map((field) => {\r\n\t\t\tif(field.factor) {\r\n\t\t\t\tfield.factoredValue = field.Number * field.factor;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfield.factoredValue = field.Number;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlet num = [];\r\n\t\tif(fieldValues && fieldValues.length > 0 && fieldValues[0].Number !== undefined) {\r\n\t\t\tif(fieldValues.length === 1) {\r\n\t\t\t\tnum = [fieldValues[0].factoredValue];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnum = fieldValues.map(fv => fv.factoredValue);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn num;\r\n\t},\r\n\tLocation: (fieldValues) => TEMPLATE_VALUE_PREPARERS.Number(fieldValues),\r\n\tCoordinate: (fieldValues, scope) => {\r\n\t\tif(scope === CONDITION_SCOPES.Latitude) {\r\n\t\t\treturn fieldValues.map(fv => ({ \r\n\t\t\t\t...fv,\r\n\t\t\t\tNumber: fv.Latitude\r\n\t\t\t}));\t\r\n\t\t}\r\n\r\n\t\tif(scope === CONDITION_SCOPES.Longitude) {\r\n\t\t\treturn fieldValues.map(fv => ({ \r\n\t\t\t\t...fv,\r\n\t\t\t\tNumber: fv.Longitude\r\n\t\t\t}));\t\r\n\t\t}\r\n\r\n\t\treturn fieldValues;\r\n\t},\r\n\tSelection: (fieldValues, scope) => {\r\n\t\tconst values = filter(fieldValues, (fv) => {\r\n\t\t\treturn (\r\n\t\t\t\tfv.IsDeleted != true\r\n\t\t\t\t&& (scope !== undefined || fv.Order !== undefined || fv.IsNotAvailable || fv.EntityId !== undefined || fv.DataId !== undefined || fv.String !== undefined)\r\n\t\t\t);\r\n\t\t})\r\n\t\t\t.map(fv => {\r\n\t\t\t\tlet compareVal = fv.EntityId ?? fv.DataId ?? fv.Order ?? fv.String ?? (fv.IsNotAvailable === true ? \"NOTAVAILABLE\" : undefined);\r\n\t\t\t\tif(scope !== undefined) {\r\n\t\t\t\t\tcompareVal = fv[scope];\r\n\t\t\t\t}\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...fv,\r\n\t\t\t\t\tcompareVal,\r\n\t\t\t\t\tCode: fv._code, \r\n\t\t\t\t\tidRequired: true\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\treturn values;\r\n\t},\r\n\tEntitySelector: (fieldValues, scope) => {\r\n\t\tconst values = filter(fieldValues, (fv) => fv.IsDeleted != true &&\r\n\t\t\t\t(fv.EntityId != undefined || fv.IsNotAvailable || !!fv.String))\r\n\t\t\t.map(fv => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...fv,\r\n\t\t\t\t\tCode: fv._code,\r\n\t\t\t\t\tClassifications: fv.Classifications,\r\n\t\t\t\t\tIsNotAvailable: fv.IsNotAvailable,\r\n\t\t\t\t\tIdentifiers: fv.Identifiers,\r\n\t\t\t\t\tidRequired: true\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\treturn values;\r\n\t},\r\n\tEntityContactSelector: (fieldValues, scope) => {\r\n\t\tconst values = filter(fieldValues,\r\n\t\t\t(fv) => {\r\n\t\t\t\tlet isValid = fv.IsDeleted !== true;\r\n\t\t\t\tif(scope?.Code !== \"CONATCT\") {\r\n\t\t\t\t\tisValid = isValid && (fv.EntityId !== undefined || fv.IsNotAvailable);\r\n\t\t\t\t}\r\n\t\t\t\tif(scope?.Code !== \"ENTITY\") {\r\n\t\t\t\t\tisValid = isValid && fv.ContactId;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn isValid;\r\n\t\t\t})\r\n\t\t\t.map((fv) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...fv,\r\n\t\t\t\t\tCode: fv._code,\r\n\t\t\t\t\tClassifications: fv.Classifications,\r\n\t\t\t\t\tIsNotAvailable: fv.IsNotAvailable,\r\n\t\t\t\t\tIdentifiers: fv.Identifiers,\r\n\t\t\t\t\tidRequired: true\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\treturn values;\r\n\t},\r\n\tMultiSelect: (fieldValues, scope) => {\r\n\t\tconst values = filter(fieldValues, (fv) => (fv.IsDeleted === undefined || fv.IsDeleted === false) && fv.DataId !== undefined)\r\n\t\t\t.map(fv => fv.DataId);\r\n\r\n\t\treturn values;\r\n\t},\r\n\tText: (fieldValues, scope) => {\r\n\t\treturn fieldValues;\r\n\t},\r\n\tTextArea: (fieldValues) => {\r\n\t\treturn fieldValues;\r\n\t},\r\n\tBoolean: (fieldValues) => {\r\n\t\tconst boolVal = fieldValues.length === 1 ? [fieldValues[0].Boolean] : [];\r\n\t\treturn boolVal;\r\n\t}\r\n};\r\n\r\nexport const TRIGGER_OPERATOR_CODES = {\r\n\tblockSubmit: \"BLOCKSUBMIT\",\r\n\tblockSave: \"BLOCKSAVE\",\r\n\twarning: \"WARNING\",\r\n\thighlight: \"HIGHLIGHT\",\r\n\tvisibility: \"VISIBILITY\", \r\n\tfilter: \"FILTER\", \r\n\tdetails: \"DETAILS\",\r\n\treadonly: \"READONLY\"\r\n};\r\n\r\nexport const VALIDATION_OPERATORS = [\r\n\t{\r\n\t\trules: [],\r\n\t\tcode: TRIGGER_OPERATOR_CODES.blockSave,\r\n\t\tcriticalLevel: 1,\r\n\t\ticon: \"zmdi-alert-octagon\",\r\n\t\tmessage: (count) => `${count} ${pluralize(count, \"error\")} must be resolved before saving.`,\r\n\t\tdetailMessage: (count) => count && `${count} ${pluralize(count, \"detail\")} ${count === 1 ? \"has an\" : \"have\"} ${pluralize(count, \"error\")} which must be resolved before saving.`\r\n\t},\r\n\t{\r\n\t\trules: [],\r\n\t\tcode: TRIGGER_OPERATOR_CODES.blockSubmit,\r\n\t\tcriticalLevel: 2,\r\n\t\ticon: \"zmdi-alert-octagon\",\r\n\t\tmessage: (count) => `${count} ${pluralize(count, \"error\")} must be resolved before submitting.`,\r\n\t\tmessageSubmitted: (count) => `This report has ${count} ${pluralize(count, \"warning\")}`,\r\n\t\tdetailMessage: (count) => count && `${count} ${pluralize(count, \"detail\")} ${count === 1 ? \"has an\" : \"have\"} ${pluralize(count, \"error\")} which must be resolved before submitting.`,\r\n\t\tdetailMessageSubmitted: (count) => count && `This report has ${count} ${pluralize(count, \"detail\")} ${count === 1 ? \"has a\" : \"have\"} ${pluralize(count, \"warning\")}`\r\n\t},\r\n\t{\r\n\t\trules: [],\r\n\t\tcode: TRIGGER_OPERATOR_CODES.warning,\r\n\t\tcriticalLevel: 3,\r\n\t\ticon: \"zmdi-alert-triangle\",\r\n\t\tmessage: (count) => `${count} ${pluralize(count, \"warning\")} must be reviewed before submitting.`,\r\n\t\tmessageSubmitted: (count) => `This report has ${count} ${pluralize(count, \"warning\")}`,\r\n\t\tdetailMessage: (count) => count && `${count} ${pluralize(count, \"detail\")} ${count === 1 ? \"has a\" : \"have\"} ${pluralize(count, \"warning\")} which must be reviewed before submitting.`,\r\n\t\tdetailMessageSubmitted: (count) => count && `This report has ${count} ${pluralize(count, \"detail\")} ${count === 1 ? \"has a\" : \"have\"} ${pluralize(count, \"warning\")}`,\r\n\t\tisWarning: true\r\n\t}\r\n];\r\n\r\n\r\n","import template from \"./report-details-modal.html\";\r\nimport \"./report-details-modal.less\";\r\nimport {\r\n\tREPORT_SCOPES,\r\n\tEVENT_REMOVE_OPTIONS,\r\n\tEVENT_LOGOUT,\r\n\tEVENT_HOTKEY_LOCK,\r\n\tEVENT_PROCESS_UI_RULES\r\n} from \"constants.js\";\r\nimport {\r\n\tfind,\r\n\tforEach,\r\n\tgroupBy,\r\n\tkeyBy,\r\n\tsome,\r\n\tsize,\r\n\tuniqBy\r\n} from \"lodash\";\r\nimport hotkeyConfigs from \"../../../services/hotkeyConfig\";\r\nimport { TRIGGER_OPERATOR_CODES } from \"../../../screens/rule-provider/constants\";\r\nimport { EVENT_FILTER_BY_DETAILS } from \"../../../constants\";\r\n\r\nclass ReportDetailsModalController {\r\n\tconstructor(\r\n\t\t$scope, \r\n\t\teventBus, \r\n\t\tvalidationServiceFactory, \r\n\t\tauth, \r\n\t\tdetailHelper, \r\n\t\thotkeys, \r\n\t\t$logger, \r\n\t\ttoastr, \r\n\t\t$timeout\r\n\t) {\r\n\t\tthis.validationService = validationServiceFactory.getCurrentValidationService();\r\n\t\tthis.detailValidationScopes = [REPORT_SCOPES.detail, REPORT_SCOPES.details];\r\n\t\tthis.detailScope = [REPORT_SCOPES.detail];\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.auth = auth;\r\n\t\tthis.detailHelper = detailHelper;\r\n\t\tthis.hotkeys = hotkeys;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.toastr = toastr;\r\n\t\tthis.$timeout = $timeout;\r\n\r\n\t\tthis.dirtyFields = {};\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.detailId = this.resolve.detailId || 0;\r\n\r\n\t\tthis.allDetailValues = !!this.resolve.allValues ? [...this.resolve.allValues] : [];\r\n\t\tthis.uniqueFieldId = this.findSingleFieldUnique(this.resolve.rules);\r\n\r\n\t\tif(this.resolve.values) {\r\n\t\t\tthis.validationService.loadRulesForDetailModal(this.resolve.detailId);\r\n\r\n\t\t\tthis.handleDisplayValidations();\r\n\t\t\tthis.modalInstance.rendered.then(() => {\r\n\t\t\t\tthis.eventBus.trigger(EVENT_PROCESS_UI_RULES, { field: { IsDetail: true } });\r\n\t\t\t\tthis.resolve.triggerFieldFilters(this.resolve.values);\r\n\t\t\t\tthis.filterExistingDetailItems(this.uniqueFieldId);\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.validationService.loadRulesForDetailModal();\r\n\t\t\tthis.modalInstance.rendered.then(() => {\r\n\t\t\t\tthis.eventBus.trigger(EVENT_PROCESS_UI_RULES, { field: { IsDetail: true } });\r\n\t\t\t\tthis.resolve.initializeFields(this.resolve.form.detailFields);\r\n\t\t\t\tthis.resolve.triggerFieldFilters([]);\r\n\t\t\t\tthis.filterExistingDetailItems(this.uniqueFieldId);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.updateFieldErrors();\r\n\t\tthis.setHotKeys();\r\n\r\n\t\tthis.eventBus.register(EVENT_LOGOUT, () => { this.handleCancel(); }, this.$scope);\r\n\r\n\t\tthis.eventBus.register(EVENT_FILTER_BY_DETAILS(this.uniqueFieldId), () => this.filterExistingDetailItems(this.uniqueFieldId), this.$scope);\r\n\r\n\t\twindow.addEventListener(\"beforeunload\", this.displayAlertIfDirty, false);\r\n\t}\r\n\r\n\tsetHotKeys() {\r\n\t\tconst hasLockableFields = some(this.resolve.form.detailFields, f => f.IsLockable);\r\n\t\tthis.lockHotkeyExists = !!this.hotkeys.get(hotkeyConfigs.EDIT_REPORT.DETAILS.LOCK_FIELD().combo);\r\n\r\n\t\tif(hasLockableFields && !this.lockHotkeyExists) {\r\n\t\t\tthis.hotkeys.bindTo(this.$scope).add(hotkeyConfigs.EDIT_REPORT.DETAILS.LOCK_FIELD(() => {\r\n\t\t\t\tthis.eventBus.trigger(EVENT_HOTKEY_LOCK);\r\n\t\t\t}));\r\n\t\t}\r\n\r\n\t\tthis.hotkeys.bindTo(this.$scope).add(hotkeyConfigs.EDIT_REPORT.DETAILS.SAVE_DETAIL(() => {\r\n\t\t\tthis.handleSave(false);\r\n\t\t}));\r\n\r\n\t\tif(!this.resolve.values) {\r\n\t\t\tthis.hotkeys.bindTo(this.$scope).add(hotkeyConfigs.EDIT_REPORT.DETAILS.SAVE_AND_ADD_DETAIL(() => {\r\n\t\t\t\tthis.handleSave(true);\r\n\t\t\t}));\r\n\t\t}\r\n\t}\r\n\r\n\tdisplayAlertIfDirty = (e) => {\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload\r\n\t\tif(size(this.dirtyFields) > 0) {\r\n\t\t\t// Cancel the event\r\n\t\t\te.preventDefault(); // If you prevent default behavior in Mozilla Firefox prompt will always be shown\r\n\t\t\t// Chrome requires returnValue to be set\r\n\t\t\te.returnValue = \"\";\r\n\t\t}\r\n\t};\r\n\r\n\thandleSave(shouldHoldOpen) {\r\n\t\tthis.doNotClose = shouldHoldOpen;\r\n\r\n\t\tlet updates = this.getFormValues();\r\n\r\n\t\tif(updates === null) {\r\n\t\t\tthis.doNotClose = false;\r\n\t\t\tthrow new Error(\"save error\");\r\n\t\t}\r\n\r\n\t\tconst results = this.detailHelper.explodePivotedRowsAndAssignLinkKeys(updates, this.resolve.form.detailFields, this.repeatToKeyMap);\r\n\t\tthis.repeatToKeyMap = results.repeatToLinkKeyMap;\r\n\t\tthis.keyToIdMap = this.keyToIdMap || {};\r\n\r\n\t\tupdates = results.updates;\r\n\r\n\t\tconst detailsByKey = updates.length > 0 ?\r\n\t\t\tgroupBy(updates, u => u.DetailLinkKey) :\r\n\t\t\t{ [this.repeatToKeyMap[-1]]: [] };\r\n\r\n\t\tconst saveDetails = {};\r\n\t\tforEach(detailsByKey, (d, key) => {\r\n\t\t\tconst newDetail = {\r\n\t\t\t\tdetailId: this.resolve.detailId || this.keyToIdMap[key] || this.auth.uuid(),\r\n\t\t\t\tvalues: keyBy(d, detailVal => detailVal.FieldId),\r\n\t\t\t\tisDeleted: false,\r\n\t\t\t\tisNewDetail: !this.resolve.detailId || isNaN(this.resolve.detailId)\r\n\t\t\t};\r\n\r\n\t\t\tsaveDetails[newDetail.detailId] = newDetail;\r\n\t\t\tthis.keyToIdMap[key] = newDetail.detailId;\r\n\t\t});\r\n\r\n\t\tconst returnPromise = this.resolve.onSave(saveDetails);\r\n\r\n\t\tif(!this.doNotClose) {\r\n\t\t\treturn returnPromise.then((allResults) => {\r\n\t\t\t\tthis.checkBlockSave(allResults)\r\n\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\tthis.validationService.commitValidations();\r\n\t\t\t\t\t\tthis.modalInstance.close(updates);\r\n\t\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.doNotClose = false;\r\n\r\n\t\t\treturn returnPromise.then((allResults) => {\r\n\t\t\t\tthis.checkBlockSave(allResults)\r\n\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\tthis.repeatToKeyMap = {};\r\n\t\t\t\t\t\tthis.keyToIdMap = {};\r\n\t\t\t\t\t\tthis.detailId = 0;\r\n\r\n\t\t\t\t\t\tthis.validationService.commitValidations();\r\n\t\t\t\t\t\tthis.handleDisplayValidations();\r\n\r\n\t\t\t\t\t\tthis.resolve.values = undefined;\r\n\t\t\t\t\t\tthis.validationService.loadRulesForDetailModal();\r\n\t\t\t\t\t\tthis.resolve.initializeFields(this.resolve.form.detailFields);\r\n\t\t\t\t\t\tthis.eventBus.trigger(EVENT_PROCESS_UI_RULES, {});\r\n\r\n\t\t\t\t\t\tconst lockedFieldIds = this.resolve.form.detailFields\r\n\t\t\t\t\t\t\t.filter(f => f.isLocked === true && f.Pivot === undefined)\r\n\t\t\t\t\t\t\t.map(f => f.Id);\r\n\t\t\t\t\t\tconst lockedValues = updates.filter(v => lockedFieldIds.indexOf(v.FieldId) > -1);\r\n\t\t\t\t\t\tconst uniqueLockedValues = uniqBy(lockedValues, v => v.FieldId);\r\n\r\n\t\t\t\t\t\tthis.resolve.triggerFieldFilters(uniqueLockedValues);\r\n\r\n\t\t\t\t\t\tthis.allDetailValues = this.allDetailValues.concat([...updates]);\r\n\t\t\t\t\t\tthis.filterExistingDetailItems(this.uniqueFieldId);\r\n\t\t\t\t\t\tthis.$timeout(() => this.$scope.$apply());\r\n\t\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBlockSave(allResults) {\r\n\t\treturn new Promise((resolve) => {\r\n\t\t\tconst hasBlockSave = some(allResults, r => r.blockSave === true);\r\n\r\n\t\t\tif(!hasBlockSave) {\r\n\t\t\t\tresolve();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconst blockSaveRules = [];\r\n\r\n\t\t\t\tforEach(allResults, r => {\r\n\t\t\t\t\tthis.validationService.updateTriggeredRules(r.triggeredRules, [REPORT_SCOPES.detail, REPORT_SCOPES.details], r.detailId);\r\n\t\t\t\t\tforEach(r.triggeredRules, tr => {\r\n\t\t\t\t\t\tconst isBlockSaveRule = some(tr.Triggers, t => t.Operator.Code === TRIGGER_OPERATOR_CODES.blockSave);\r\n\t\t\t\t\t\tif(isBlockSaveRule) {\r\n\t\t\t\t\t\t\tblockSaveRules.push(tr);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\tthis.handleDisplayValidations(true);\r\n\t\t\t\tthis.$timeout(() => this.$scope.$apply());\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfilterExistingDetailItems(uniqueFieldId) {\r\n\t\tif(!!uniqueFieldId) {\r\n\t\t\tconst currentDetailItems = this.allDetailValues.filter(val => val.FieldId === uniqueFieldId && val.IsDeleted !== true);\r\n\t\t\tconst itemIdsToRemove = currentDetailItems.map(val => val.DataId);\r\n\r\n\t\t\tthis.$scope.$$postDigest(() => {\r\n\t\t\t\tthis.eventBus.trigger(EVENT_REMOVE_OPTIONS(uniqueFieldId), {\r\n\t\t\t\t\titems: itemIdsToRemove\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfindSingleFieldUnique(rules) {\r\n\t\tif(!rules || rules.length === 0) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst uniqueDetailRule = find(rules, rule => {\r\n\t\t\treturn rule.Engine && rule.Engine.Code === \"UNIQUE\" && ((rule.Scope && rule.Scope.Code === REPORT_SCOPES.details) || rule.Scope === undefined);\r\n\t\t});\r\n\r\n\t\tif(!!uniqueDetailRule) {\r\n\t\t\tif(uniqueDetailRule.Conditions.length === 1) {\r\n\t\t\t\tconst uniqueFieldId = uniqueDetailRule.Conditions[0].Field.Id;\r\n\t\t\t\treturn uniqueFieldId;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst childrenRules = rules.filter((rule) => {\r\n\t\t\treturn rule.Scope && rule.Scope.Code === REPORT_SCOPES.details && !!rule.Children;\r\n\t\t});\r\n\r\n\t\tfor(let i = 0; i < childrenRules.length; i++) {\r\n\t\t\tconst uniqueChild = this.findSingleFieldUnique(childrenRules[i].Children);\r\n\t\t\tif(!!uniqueChild) {\r\n\t\t\t\treturn uniqueChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tupdateFieldErrors() {\r\n\t\tthis.resolve.form.detailFields.map((field) => {\r\n\t\t\tfield.hasValidationWarning = false;\r\n\t\t\tfield.hasValidationError = false;\r\n\t\t\tforEach(this.validations, (type) => {\r\n\t\t\t\tforEach(type.rules, (rule) => {\r\n\t\t\t\t\tconst ruleHasNoDetailId = rule.DetailId === 0 || rule.DetailId === undefined || isNaN(rule.DetailId);\r\n\t\t\t\t\tconst resolveHasNoValues = this.resolve.values === undefined || this.resolve.values === null;\r\n\t\t\t\t\tconst ruleScopeIsReportDetails = rule.Scope.Code === REPORT_SCOPES.details;\r\n\t\t\t\t\tconst ruleDetailIdEqualsResolveDetailId = rule.DetailId === (this.resolve.values && this.resolve.detailId);\r\n\r\n\t\t\t\t\tconst shouldSetValidation = (ruleHasNoDetailId && resolveHasNoValues)\r\n\t\t\t\t\t\t|| (ruleHasNoDetailId && ruleScopeIsReportDetails)\r\n\t\t\t\t\t\t|| ruleDetailIdEqualsResolveDetailId;\r\n\r\n\t\t\t\t\tlet shouldCheckForWarningCode = shouldSetValidation && rule.appliedFieldIds.indexOf(field.Id) > -1 && !field.hasValidationError;\r\n\r\n\t\t\t\t\tconst hasHighlightTrigger = some(rule.Triggers, t => t.Operator.Code === \"HIGHLIGHT\");\r\n\r\n\t\t\t\t\tif(hasHighlightTrigger) {\r\n\t\t\t\t\t\tconst highlightTriggers = rule.Triggers.filter(t => t.Operator.Code === \"HIGHLIGHT\");\r\n\t\t\t\t\t\tshouldCheckForWarningCode = some(highlightTriggers, t => t.Field.Id === field.Id);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(shouldCheckForWarningCode) {\r\n\t\t\t\t\t\tfield.hasValidationError = type.code !== \"WARNING\";\r\n\t\t\t\t\t\tfield.hasValidationWarning = type.code === \"WARNING\";\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tgetSaveVerb() {\r\n\t\treturn this.resolve.values ? \"Done\" : \"Add\";\r\n\t}\r\n\r\n\tgetButtonWidth() {\r\n\t\treturn (this.resolve.values) ? \"col-sm-6\" : \"col-sm-4\";\r\n\t}\r\n\r\n\thandleDisplayValidations(blockSaveOnly = false) {\r\n\t\tconst allValidations = [...this.validationService.pendingValidations];\r\n\r\n\t\tconst detailValidations = allValidations\r\n\t\t\t.filter((type) => (type.code === TRIGGER_OPERATOR_CODES.blockSave) || blockSaveOnly === false)\r\n\t\t\t.map((type) => {\r\n\t\t\t\tconst newType = { ...type };\r\n\r\n\t\t\t\tnewType.rules = type.rules.filter(rule => {\r\n\t\t\t\t\treturn (rule.DetailId === this.detailId)\r\n\t\t\t\t\t\t|| ((rule.DetailId === 0 || rule.DetailId === undefined || isNaN(rule.DetailId)) && this.resolve.values === undefined)\r\n\t\t\t\t\t\t|| ((rule.DetailId === 0 || rule.DetailId === undefined || isNaN(rule.DetailId)) && this.resolve.values === null)\r\n\t\t\t\t\t\t|| ((rule.DetailId === 0 || rule.DetailId === undefined || isNaN(rule.DetailId)) && rule.Scope.Code === \"DETAILS\");\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn newType;\r\n\t\t\t});\r\n\r\n\t\tthis.validations = detailValidations;\r\n\r\n\t\tthis.updateFieldErrors();\r\n\t}\r\n\r\n\thandleCancel() {\r\n\t\tif(!!this.keyToIdMap && size(this.keyToIdMap) > 0) {\r\n\t\t\tforEach(this.keyToIdMap, id => {\r\n\t\t\t\tthis.validationService.updateTriggeredRules([], [REPORT_SCOPES.detail], id);\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis.validationService.clearPendingValidations();\r\n\r\n\t\tthis.modalInstance.dismiss(\"instance dismiss\");\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\twindow.removeEventListener(\"beforeunload\", this.displayAlertIfDirty);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-details-modal\", [])\r\n\t.component(\"reportDetailsModal\", {\r\n\t\tcontroller: ReportDetailsModalController,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t Details \\r\\n
\\r\\n\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t Cancel \\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t {{$ctrl.getSaveVerb()}} \\r\\n\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\t {{$ctrl.getSaveVerb()}} & New \\r\\n\\t\\t
\\r\\n\\t
\\r\\n\";","import template from \"./report-actions.html\";\r\nimport \"./report-actions.less\";\r\nimport {\r\n\tACTION_EXPAND_DETAILS, \r\n\tACTION_COLLAPSE_DETAILS \r\n} from \"constants.js\";\r\n\r\nfunction controller(\r\n\t$logger,\r\n\tappState,\r\n\t$uibModal,\r\n\teventBus,\r\n\t$timeout\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handlePrint = handlePrint;\r\n\tctrl.canBeDeleted = canBeDeleted;\r\n\tctrl.canBeWithdrawn = canBeWithdrawn;\r\n\tctrl.canBeRestored = canBeRestored;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.permissions = appState.permissions;\r\n\t\tcheckAccesses();\r\n\t};\r\n\r\n\tctrl.$onChanges = () => {\r\n\t\tctrl.permissions = appState.permissions;\r\n\t\tcheckAccesses();\r\n\t};\r\n\r\n\tctrl.withdraw = () => {\r\n\t\t$logger.event($logger.buildReportEvent(\"withdraw\")(\"requested\"), { \r\n\t\t\tvia: \"report-actions\" \r\n\t\t});\r\n\t\tctrl.handleWithdraw();\r\n\t};\r\n\r\n\tctrl.delete = () => {\r\n\t\t$logger.event($logger.buildReportEvent(\"delete\")(\"requested\"), { \r\n\t\t\tvia: \"report-actions\" \r\n\t\t});\r\n\t\tctrl.handleDelete();\r\n\t};\r\n\r\n\tctrl.restore = () => {\r\n\t\t$logger.event($logger.buildReportEvent(\"restore\")(\"requested\"), { \r\n\t\t\tvia: \"report-actions\" \r\n\t\t});\r\n\t\tctrl.handleRestore();\r\n\t};\r\n\r\n\tfunction checkAccesses() {\r\n\t\tctrl.currentHistory = ctrl.orderedHistory[0];\r\n\t\tctrl.canWithdraw = false;\r\n\t\tctrl.canDelete = false;\r\n\t\tctrl.canRestore = false;\r\n\t\tctrl.showExportIcon = ctrl.report.Exports !== undefined\r\n\t\t\t&& ctrl.report.Exports.length > 0\r\n\t\t\t&& ctrl.permissions.Reporting.Actions.CanViewExports;\r\n\r\n\t\tif(!ctrl.permissions.Reporting.IsDisabled) {\r\n\t\t\tcanBeWithdrawn();\r\n\t\t\tcanBeDeleted();\r\n\t\t\tcanBeRestored();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction handlePrint() {\r\n\t\teventBus.trigger(ACTION_EXPAND_DETAILS);\r\n\t\t$timeout(() => {\r\n\t\t\twindow.print();\r\n\t\t\t$logger.event($logger.buildReportEvent(\"print\")(\"executed\"));\r\n\t\t\teventBus.trigger(ACTION_COLLAPSE_DETAILS);\r\n\t\t});\r\n\t}\r\n\r\n\tfunction canBeWithdrawn() {\r\n\t\tctrl.canWithdraw = (\r\n\t\t\tctrl.permissions.Reporting.Actions.CanWithdraw \r\n\t\t\t\t&& ctrl.currentHistory.State.Code === \"SUBMITTED\"\r\n\t\t\t\t&& ctrl.currentHistory.State.Code !== \"DELETED\"\r\n\t\t) || (\r\n\t\t\tctrl.currentHistory.State.Code === \"SUBMITTING\" \r\n\t\t\t\t&& (appState.operatingUserRole === \"AGENT\" || appState.operatingUserRole === \"SYSADMIN\")\r\n\t\t);\r\n\r\n\t\treturn ctrl.canWithdraw;\r\n\t}\r\n\r\n\tfunction canBeDeleted() {\r\n\t\tctrl.canDelete = ctrl.permissions.Reporting.Actions.CanDelete\r\n\t\t\t&& ctrl.currentHistory.State.Code !== \"SUBMITTED\"\r\n\t\t\t&& ctrl.currentHistory.State.Code !== \"DELETED\";\r\n\r\n\t\treturn ctrl.canDelete;\r\n\t}\r\n\r\n\tfunction canBeRestored() {\r\n\t\tctrl.canRestore = ctrl.permissions.Reporting.Actions.CanRestore\r\n\t\t\t&& ctrl.currentHistory.State.Code !== \"SUBMITTED\"\r\n\t\t\t&& ctrl.currentHistory.State.Code === \"DELETED\";\r\n\r\n\t\treturn ctrl.canRestore;\r\n\t}\r\n\r\n\tctrl.handleViewExport = () => {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"export-information\",\r\n\t\t\tsize: \"xlg\",\r\n\t\t\tresolve: {\r\n\t\t\t\texports: () => ctrl.report?.Exports\r\n\t\t\t},\r\n\t\t\tgetUsers: () => undefined\r\n\t\t}).result.then(() => {\r\n\r\n\t\t});\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-actions\", [])\r\n\t.component(\"reportActions\", {\r\n\t\ttemplate,\r\n\t\ttransclude: true,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\treport: \"<\",\r\n\t\t\thandleDelete: \"<\",\r\n\t\t\thandleWithdraw: \"<\",\r\n\t\t\thandleRestore: \"<\", \r\n\t\t\torderedHistory: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t
  • \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t
  • \\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n
\";","import swal from \"sweetalert2\";\r\n\r\nexport const confirmAction = async(verbiage, action) => {\r\n\ttry {\r\n\t\tconst result = await swal.fire({\r\n\t\t\ttitle: \"Confirm Action\",\r\n\t\t\thtml: verbiage,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\",\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Yes\"\r\n\t\t});\r\n\r\n\t\tif(result.value === true) {\r\n\t\t\treturn action();\r\n\t\t}\r\n\r\n\t\treturn Promise.resolve(false);\r\n\t}\r\n\tcatch(error) {\t\t\r\n\t\treturn Promise.resolve(false);\r\n\t}\r\n};","import template from \"./inventory-actions.html\";\r\nimport \"./inventory-actions.less\";\r\nimport { confirmAction } from \"./confirmActionPrompt\";\r\n\r\nimport {\r\n\tFORM_ENTITY_INVENTORY_ATTEST,\r\n\tFORM_ENTITY_INVENTORY_SET,\r\n\tFORM_ENTITY_INVENTORY_RESET\r\n} from \"routes\";\r\nimport {\r\n\tglobs, \r\n\tINVENTORY_OPERATIONS\r\n} from \"../../services/globs\";\r\nimport {\r\n\tAction, \r\n\tAny \r\n} from \"../../services/security/actionScopes\";\r\n\r\nfunction controller(\r\n\t$logger,\r\n\t$uibModal, \r\n\tappState,\r\n\tapi,\r\n\tloadingService,\r\n\ttoastr\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.formId = appState.forms.selected.Id;\r\n\r\n\t\tctrl.canAttest = globs\r\n\t\t\t.entityTypes.byType(ctrl.entity.Type.Code)\r\n\t\t\t.inventory.byCode(ctrl.inventoryItem.Item.Type.Code)\r\n\t\t\t.operations.byOperation(INVENTORY_OPERATIONS.attestation)\r\n\t\t\t.create;\r\n\r\n\t\tctrl.canSet = globs\r\n\t\t\t.entityTypes.byType(ctrl.entity.Type.Code)\r\n\t\t\t.inventory.byCode(ctrl.inventoryItem.Item.Type.Code)\r\n\t\t\t.operations.byOperation(INVENTORY_OPERATIONS.set)\r\n\t\t\t.create;\r\n\r\n\t\tctrl.canReset = globs\r\n\t\t\t.entityTypes.byType(ctrl.entity.Type.Code)\r\n\t\t\t.inventory.byCode(ctrl.inventoryItem.Item.Type.Code)\r\n\t\t\t.operations.byOperation(INVENTORY_OPERATIONS.reset)\r\n\t\t\t.create;\r\n\r\n\t\tconst canAttestAction = new Action(ctrl.canAttest);\r\n\t\tconst canSetAction = new Action(ctrl.canSet);\r\n\t\tconst canResetAction = new Action(ctrl.canReset);\r\n\r\n\t\tctrl.hasAnyInventoryActionPermission = new Any([canAttestAction, canSetAction, canResetAction]);\r\n\t};\r\n\r\n\tctrl.attest = () => {\r\n\t\topenQuantityModal(\"Attest Quantity\", FORM_ENTITY_INVENTORY_ATTEST(ctrl.formId, ctrl.entity.Id, ctrl.inventoryItem.Item.Id));\r\n\t};\r\n\r\n\tctrl.set = () => {\r\n\t\topenQuantityModal(\"Set Quantity\", FORM_ENTITY_INVENTORY_SET(ctrl.formId, ctrl.entity.Id, ctrl.inventoryItem.Item.Id))\r\n\t\t\t.then(newValue => { ctrl.inventoryItem.Quantity = newValue; });\r\n\t};\r\n\r\n\tctrl.reset = () => {\r\n\t\tconfirmAction(\r\n\t\t\t\"You are about to reset your inventory to zero, are you sure?\", \r\n\t\t\t() => {\r\n\t\t\t\tconst apiAction = api.post(FORM_ENTITY_INVENTORY_RESET(ctrl.formId, ctrl.entity.Id, ctrl.inventoryItem.Item.Id), {})\r\n\t\t\t\t\t.then(response => {\r\n\t\t\t\t\t\tctrl.inventoryItem.Quantity = response.Value;\r\n\t\t\t\t\t\ttoastr.success(\"Inventory quantity has been successfully reset\");\r\n\t\t\t\t\t});\r\n\t\t\t\treturn loadingService.watch(apiAction);\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\tasync function openQuantityModal(title, uri) {\r\n\t\tconst instance = $uibModal.open({\r\n\t\t\tcomponent: \"quantity-modal\",\r\n\t\t\tsize: \"sm\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\ttitle: () => title,\r\n\t\t\t\titem: () => ctrl.inventoryItem\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst updated = await instance.result;\r\n\r\n\t\tconst payload = {\r\n\t\t\tQuantity: updated.quantity\r\n\t\t};\r\n\r\n\t\treturn await confirmAction(\r\n\t\t\t`You are about to ${title.toLowerCase()} of ${updated.quantity}, are you sure?`, \r\n\t\t\t() => {\r\n\t\t\t\tconst apiAction = api.post(uri, payload)\r\n\t\t\t\t\t.then(response => {\r\n\t\t\t\t\t\ttoastr.success(\"Inventory has been successfully updated.\");\r\n\r\n\t\t\t\t\t\treturn response.Value;\r\n\t\t\t\t\t});\r\n\t\t\t\treturn loadingService.watch(apiAction);\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.inventory-actions\", [])\r\n\t.component(\"inventoryActions\", {\r\n\t\ttemplate,\r\n\t\ttransclude: true,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\tentity: \"<\",\r\n\t\t\tinventoryItem: \"=\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Attest\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Set\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Reset\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\r\\n\";","import template from \"./quantity-modal.html\";\r\nimport \"./quantity-modal.less\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\n\r\nexport class Controller {\r\n\tconstructor(appState, eventBus, $scope, toastr) {\r\n\t\tthis.appState = appState;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$toastr = toastr;\r\n\r\n\t\tthis.quantity = this.resolve.item.Quantity;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.eventBus.register(EVENT_LOGOUT, () => { this.handleClose(); }, this.$scope);\r\n\t}\r\n\r\n\tvalidate(quantity) {\r\n\t\ttry {\r\n\t\t\tif(quantity === undefined || quantity === null) {\r\n\t\t\t\tthis.$toastr.error(\"Quantity is required, please enter a value.\");\t\t\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tif(parseFloat(quantity) < 0) {\r\n\t\t\t\tthis.$toastr.error(\"Quantity cannot be negative, please enter a positive value or zero.\");\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(err) {\r\n\t\t\tthis.$toastr.error(\"Invalid value, please correct errors\");\r\n\t\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tsave() {\r\n\t\tconst isValid = this.validate(this.quantity);\r\n\r\n\t\tif(isValid) {\r\n\t\t\tthis.modalInstance.close({ quantity: this.quantity });\r\n\t\t}\r\n\t}\r\n\r\n\thandleClose() {\r\n\t\tthis.modalInstance.dismiss();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.quantity-modal\", [])\r\n\t.component(\"quantityModal\", {\r\n\t\tcontroller: Controller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t Input Quantity \\r\\n
\\r\\n\\r\\n\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tRequired\\r\\n\\t\\t\\t\\t\\tValue must be greater than 0\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\r\\n\\r\\n
\\r\\n\\tCancel\\r\\n\\tSave\\r\\n
\";","function defaultResolve(fieldSettings, values, repeatId, setFieldDirty, pivotRow, pivotColumn) {\r\n\treturn {\r\n\t\tfield: fieldSettings,\r\n\t\tvalues,\r\n\t\trepeatId,\r\n\t\tpivotRow,\r\n\t\tpivotColumn,\r\n\t\tsetFieldDirty\r\n\t};\r\n}\r\n\r\nconst fieldMap = {\r\n\tDate: {\r\n\t\tcomponent: \"date\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tDateTime: {\r\n\t\tcomponent: \"date-time\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tYearMonth: {\r\n\t\tcomponent: \"year-month\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tNumber: {\r\n\t\tcomponent: \"number\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tSelection: {\r\n\t\tcomponent: \"simple-selection\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tPreSelect: {\r\n\t\tcomponent: \"pre-select\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tEntitySelector: {\r\n\t\tcomponent: \"selection\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tEntityContactSelector: {\r\n\t\tcomponent: \"entity-contact-selector\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tTags: {\r\n\t\tcomponent: \"multi-select\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tTextArea: {\r\n\t\tcomponent: \"text-area\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tBoolean: {\r\n\t\tcomponent: \"bool\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tCheckbox: {\r\n\t\tcomponent: \"checkbox\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tText: {\r\n\t\tcomponent: \"text\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tLocation: {\r\n\t\tcomponent: \"degree-minute\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tCoordinate: {\r\n\t\tcomponent: \"coordinate\",\r\n\t\tprops: {},\r\n\t\tresolve: defaultResolve\r\n\t},\r\n\tdefault: {\r\n\t\tcomponent: \"text\",\r\n\t\tprops: {},\r\n\t\tresolve(fieldSettings, values) {\r\n\t\t\treturn defaultResolve(fieldSettings, values);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nexport default fieldMap;\r\n","import { find } from \"lodash\";\r\nimport template from \"./bool.html\";\r\nimport cbTemplate from \"./checkbox.html\";\r\nimport {\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_UNCLEAR_VALUE,\r\n\tEVENT_SET_FORM_PRISTINE\r\n} from \"constants.js\";\r\nimport \"./bool.less\";\r\n\r\nexport class Controller {\r\n\r\n\tselection = {};\r\n\r\n\tconstructor($scope, $logger, eventBus, featureHelper, appState) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.featureHelper = featureHelper;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.appState = appState;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\r\n\t\tthis.initValue();\r\n\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(this.cleared === undefined && this.value !== undefined) {\r\n\t\t\t\tthis.cleared = this.value;\r\n\t\t\t}\r\n\t\t\tthis.value = undefined;\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_UNCLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(this.cleared !== undefined) {\r\n\t\t\t\tthis.value = this.cleared;\r\n\t\t\t\tthis.cleared = undefined;\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\tinitValue() {\r\n\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\t\tif(this.appState.isNewReport && this.initialValue === undefined) {\r\n\t\t\tconst hasDefaultValue = this.field.DefaultValue !== undefined;\r\n\r\n\t\t\tif(hasDefaultValue) {\r\n\t\t\t\tconst defaultValue = this.field.DefaultValue.toLowerCase() === \"true\" ? true : false;\r\n\t\t\t\tthis.initialValue = {\r\n\t\t\t\t\tFieldId: this.field.Id, \r\n\t\t\t\t\tBoolean: defaultValue\r\n\t\t\t\t};\r\n\t\t\t\tthis.setValue(defaultValue);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.setValue();\r\n\t\t}\r\n\t}\r\n\r\n\tgetCurrentValue(isApiCall = false) {\r\n\t\tconst result = this.buildResult();\r\n\r\n\t\tif(result && !isApiCall && this.field.IsNotReported !== true && this.field.IsHidden !== true) {\r\n\t\t\tresult.isDirty = this.value !== (this.initialValue && this.initialValue.Boolean);\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\thandleValueChanged() {\r\n\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id), {\r\n\t\t\tfield: this.field,\r\n\t\t\tvalue: this.value\r\n\t\t});\r\n\r\n\t\tconst isDirty = this.value !== (this.initialValue && this.initialValue.Boolean);\r\n\t\tthis.setFieldDirty(this.field.Id, isDirty);\r\n\t}\r\n\r\n\trevertValue() {\r\n\t\tthis.value = this.initialValue && this.initialValue.Boolean;\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValue = this.buildResult();\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\treturn this.value === null || this.value === undefined ? null : {\r\n\t\t\tFieldId: this.field.Id,\r\n\t\t\tBoolean: this.value\r\n\t\t};\r\n\t}\r\n\r\n\tsetValue(val) {\r\n\t\tif(val !== undefined) {\r\n\t\t\tthis.value = val;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst thisValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tif(thisValue) {\r\n\t\t\tthis.value = thisValue.Boolean;\r\n\t\t}\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n}\r\n\r\nconst boolField = angular\r\n\t.module(\"vesl.components.report-form.bool\", [])\r\n\t.component(\"bool\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n\r\nconst checkboxField = angular\r\n\t.module(\"vesl.components.report-form.checkbox\", [])\r\n\t.component(\"checkbox\", {\r\n\t\ttemplate: cbTemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n\r\nexport {\r\n\tboolField, checkboxField\r\n};\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t{{$ctrl.field.YesLabel || 'Yes'}}\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t{{$ctrl.field.NoLabel || 'No'}}\\r\\n\\t\\t\\r\\n\\t
\\r\\n
\";","export default \"
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t
\\r\\n
\";","import moment from \"moment-timezone\";\r\nimport \"./date-time.less\";\r\nimport template from \"./date-time.html\";\r\nimport { find } from \"lodash\";\r\nimport {\r\n\tEVENT_FILTER_PRIMARYDATE,\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_UNCLEAR_VALUE,\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_SET_DEFAULT_VALUE,\r\n\tEVENT_VALUE_CHANGED,\r\n\tTIME_DISPLAY_OPTIONS,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_PAGE_LOADED,\r\n\tEVENT_SET_FORM_PRISTINE\r\n} from \"constants.js\";\r\nimport { globs } from \"../../../../services/globs\";\r\n\r\nexport class Controller {\r\n\tselection = {};\r\n\r\n\tconstructor($scope, eventBus, $logger, $timeout, $userProfile, securityService, initializationService, appState) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.opened = false;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.securityService = securityService;\r\n\t\tthis.initializationService = initializationService;\r\n\t\tthis.appState = appState;\r\n\r\n\t\tconst thisUserProfile = $userProfile.getUserProfile();\r\n\r\n\t\tif(securityService.hasApplicablePermission(globs.reports.self)) {\r\n\t\t\tconst canEditAction = securityService.isActionAllowed(globs.reports.byId(\"*\").fields.byCode(this.field.Key.Code).edit);\r\n\t\t\tthis.field.isReadonly = !canEditAction || this.field.isReadonly;\r\n\t\t}\r\n\r\n\t\tthis.isTwelveHour = thisUserProfile.timeDisplay === TIME_DISPLAY_OPTIONS.TWELVE_HOUR;\r\n\t\tthis.format = this.isTwelveHour ? \"MM/dd/yy hh:mm a\" : \"MM/dd/yy HH:mm\";\r\n\t\tthis.externalSet = false;\r\n\t\tthis.dateOptions = {\r\n\t\t\tdateDisabled: false,\r\n\t\t\tformatYear: \"yy\",\r\n\t\t\tstartingDay: 0,\r\n\t\t\tminDate: new Date(12 * 60 * 60 * 1000)\r\n\t\t};\r\n\t\tthis.modelOptions = {};\r\n\r\n\t\tthis.altInputFormats = this.isTwelveHour ?\r\n\t\t\t[\r\n\t\t\t\t\"M!-d!-yyyy h:mma\", \"M!-d!-yy h:mm a\", \"M!-d!-yy h:mma\", \"M!-d!-yyyy h:mm a\",\r\n\t\t\t\t\"M!/d!/yyyy h:mma\", \"M!/d!/yy h:mm a\", \"M!/d!/yy h:mma\", \"M!/d!/yyyy h:mm a\",\r\n\t\t\t\t\"M!.d!.yyyy h:mma\", \"M!.d!.yy h:mm a\", \"M!.d!.yy h:mma\", \"M!.d!.yyyy h:mm a\",\r\n\t\t\t\t\"shortDate\"\r\n\t\t\t] : [\r\n\t\t\t\t\"M!-d!-yyyy H:mm\", \"M!-d!-yy H:mm\", \"M!-d!-yy HH:mm\", \"M!-d!-yyyy HH:mm\",\r\n\t\t\t\t\"M!/d!/yyyy H:mm\", \"M!/d!/yy H:mm\", \"M!/d!/yy HH:mm\", \"M!/d!/yyyy HH:mm\",\r\n\t\t\t\t\"M!.d!.yyyy H:mm\", \"M!.d!.yy H:mm\", \"M!.d!.yy HH:mm\", \"M!.d!.yyyy HH:mm\",\r\n\t\t\t\t\"shortDate\"\r\n\t\t\t];\r\n\r\n\t\tconst monthNumber = moment().format(\"MM\");\r\n\t\tconst year = moment().format(\"YY\");\r\n\r\n\t\tthis.placeholder = this.isTwelveHour ? `Ex. ${monthNumber}/01/${year} 01:00 PM` : `Ex. ${monthNumber}/01/${year} 13:00`;\r\n\r\n\t\tthis.maskOptions = {\r\n\t\t\tmaskDefinitions: {\r\n\t\t\t\t\"9\": /\\d/,\r\n\t\t\t\t\"A\": /[a-zA-Z]/,\r\n\t\t\t\t\"*\": /[a-zA-Z0-9]/,\r\n\t\t\t\t\"D\": /[AP]/,\r\n\t\t\t\t// eslint-disable-next-line no-useless-escape\r\n\t\t\t\t\"S\": /[\\d\\/\\.-:]/,\r\n\t\t\t\t\"M\": /[0-5]/\r\n\t\t\t},\r\n\t\t\tclearOnBlur: false,\r\n\t\t\tclearOnBlurPlaceholder: false\r\n\t\t};\r\n\r\n\t\tthis.timeMask = this.isTwelveHour ? \"9S/9S/99 9S:99 D\\\\M\" : \"9S/9S/99 9S:99\";\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\r\n\t\tif(this.field.MinValue !== undefined) {\r\n\t\t\tthis.dateOptions.minDate = moment()\r\n\t\t\t\t.add(this.field.MinValue, \"days\")\r\n\t\t\t\t.toDate();\r\n\t\t}\r\n\r\n\t\tif(this.field.MaxValue !== undefined) {\r\n\t\t\tthis.dateOptions.maxDate = moment()\r\n\t\t\t\t.add(this.field.MaxValue, \"days\")\r\n\t\t\t\t.toDate();\r\n\t\t}\r\n\r\n\t\tconst ctrl = this;\r\n\t\tthis._scope.$watch(\r\n\t\t\t() => ctrl.selection?.date,\r\n\t\t\t(next, prev) => {\r\n\t\t\t\tif(next && (prev?.getTime() !== next.getTime())) {\r\n\t\t\t\t\tthis.updateFieldDirty();\r\n\t\t\t\t\tthis.handleChange();\r\n\t\t\t\t\tif(!this.suppressNextDateWatch) {\r\n\t\t\t\t\t\tthis.externalSet = false;\r\n\t\t\t\t\t\tthis.opened = false;\r\n\t\t\t\t\t\tctrl.showTimePicker = true;\r\n\r\n\t\t\t\t\t\tctrl.$timeout(() => {\r\n\t\t\t\t\t\t\tthis.timepickerDate = next;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.suppressNextDateWatch = false;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ttrue);\r\n\r\n\t\tthis._scope.$watch(\r\n\t\t\t() => ctrl.timepickerDate,\r\n\t\t\t(next) => {\r\n\t\t\t\tif(!!next && this.selection.date) {\r\n\t\t\t\t\tif(next.getTime() !== this.selection.date.getTime()) {\r\n\t\t\t\t\t\tctrl.$timeout(() => {\r\n\t\t\t\t\t\t\tthis.suppressNextDateWatch = true;\r\n\t\t\t\t\t\t\tthis.selection.date = next;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\tthis._eventBus.register(EVENT_PAGE_LOADED, () => {\r\n\t\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\t\t\tif(!!this.initialValue) {\r\n\t\t\t\tconst setInitialValue = () => {\r\n\t\t\t\t\tconst localShiftedMoment = moment(this.initialValue.Date, \"YYYY-MM-DDThh:mm:ss\");\r\n\t\t\t\t\tthis.initialValue.Date = moment(localShiftedMoment.toDate()).tz(this.field.timezone, true)\r\n\t\t\t\t\t\t.format(\"YYYY-MM-DDTHH:mm:00Z\");\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif((this.field.needsTimezone === true) && (this.field.timezone === undefined)) {\r\n\t\t\t\t\tconst unregisterTz = this._scope.$watch(() => this.field.timezone, (next) => {\r\n\t\t\t\t\t\tif(next !== undefined) {\r\n\t\t\t\t\t\t\tsetInitialValue();\r\n\t\t\t\t\t\t\tunregisterTz();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tsetInitialValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!this.cleared && (!!this.selection?.date)) {\r\n\t\t\t\tthis.cleared = {\r\n\t\t\t\t\tselection: {\r\n\t\t\t\t\t\tdate: this.selection.date\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttimepickerDate: this.timepickerDate\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tthis.selection.date = null;\r\n\t\t\tthis.timepickerDate = null;\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_UNCLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!!this.cleared) {\r\n\t\t\t\tthis.selection = this.cleared.selection;\r\n\t\t\t\tthis.timepickerDate = this.cleared.timepickerDate;\r\n\t\t\t\tthis.cleared = undefined;\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_VALUE(this.field.Id), (e, params) => {\r\n\t\t\tconst currentMoment = moment(this.selection?.date);\r\n\t\t\tconst paramsMoment = moment(params?.value);\r\n\r\n\t\t\tconst isWithinAnHour = \r\n\t\t\t\tcurrentMoment.isValid() && \r\n\t\t\t\tparamsMoment.isValid() && \r\n\t\t\t\tMath.abs(currentMoment.diff(paramsMoment, \"hours\", true)) <= 1;\r\n\r\n\t\t\tif(!this.selection.date || isWithinAnHour) {\r\n\t\t\t\tthis.externalSet = true;\r\n\t\t\t\tthis.selection = { date: params.value };\r\n\t\t\t\tthis.timepickerDate = this.selection.date;\r\n\r\n\t\t\t\tthis.$timeout(() => this._scope.$apply());\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_DEFAULT_VALUE(this.field.Id), () => {\r\n\t\t\tthis.externalSet = true;\r\n\t\t\tthis.selection = { date: new Date() };\r\n\t\t\tthis.timepickerDate = this.selection.date;\r\n\r\n\t\t\tthis.showTimePicker = false;\r\n\t\t\tthis.suppressNextDateWatch = true;\r\n\r\n\t\t\tthis.$timeout(() => this._scope.$apply());\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis.setValue();\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\thandleClickOutside() {\r\n\t\tthis.showTimePicker = false;\r\n\t}\r\n\r\n\topenTimepicker() {\r\n\t\tif(this.selection && !this.selection.date) {\r\n\t\t\tconst initializedDate = new Date();\r\n\t\t\tinitializedDate.setHours(0);\r\n\t\t\tinitializedDate.setMinutes(0);\r\n\t\t\tinitializedDate.setSeconds(0);\r\n\t\t\tinitializedDate.setMilliseconds(0);\r\n\t\t\tthis.selection.date = initializedDate;\r\n\t\t}\r\n\r\n\t\tthis.timepickerDate = this.selection.date;\r\n\r\n\t\tthis.showTimePicker = true;\r\n\t}\r\n\r\n\tgetCurrentValue(isApiCall = false) {\r\n\t\tlet result = this.buildResult();\r\n\r\n\t\tif(!isApiCall && this.field.IsNotReported !== true && this.field.IsHidden !== true) {\r\n\t\t\tif(!result) {\r\n\t\t\t\tresult = { FieldId: this.field.Id };\r\n\t\t\t\tresult.hasResultForRuleRun = false;\r\n\t\t\t}\r\n\r\n\t\t\tresult.isDirty = (result.Date && moment(result.Date).format()) != (this.initialValue && moment(this.initialValue.Date).format());\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\trevertValue() {\r\n\t\tif(this.initialValue) {\r\n\t\t\tconst localShiftedMoment = this.initialValue && moment(this.initialValue.Date, \"YYYY-MM-DDThh:mm:ss\");\r\n\r\n\t\t\tconst date = localShiftedMoment.toDate(); //this value is now clean for the field\r\n\r\n\t\t\tthis.selection.date = date;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.selection.date = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\tlet timezone = this.field.timezone;\r\n\t\tif(!timezone) {\r\n\t\t\ttimezone = this.appState.forms.selected.TimeZone.Code;\r\n\t\t}\r\n\r\n\t\tconst outgoingDate = moment(this.selection.date).tz(timezone, true);\r\n\r\n\t\treturn this.selection.date\r\n\t\t\t? {\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\tDate: outgoingDate.format(\"YYYY-MM-DDTHH:mm:00Z\")\r\n\t\t\t} : undefined;\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValue = this.buildResult();\r\n\t}\r\n\r\n\thandleChange() {\r\n\t\tthis.initializationService.runWhenPageLoaded(() => {\r\n\t\t\tif(this.selection.date && !this.field.isReadonly && !this.field.isDisabled) {\r\n\t\t\t\tif(this.field.IsPrimary) {\r\n\t\t\t\t\tthis._eventBus.trigger(EVENT_FILTER_PRIMARYDATE, {\r\n\t\t\t\t\t\tdate: this.selection.date\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id), {\r\n\t\t\t\tfield: this.field,\r\n\t\t\t\tvalue: this.selection.date\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tupdateFieldDirty() {\r\n\t\tlet outgoingDate = moment(this.selection.date);\r\n\r\n\t\tif(this.field.timezone) {\r\n\t\t\toutgoingDate = outgoingDate.tz(this.field.timezone, true);\r\n\t\t}\r\n\t\tconst outgoingDateStr = outgoingDate.format(\"YYYY-MM-DDTHH:mm:00Z\");\r\n\r\n\t\tconst isDirty = (outgoingDateStr && moment(outgoingDateStr).format()) != (this.initialValue && moment(this.initialValue.Date).format());\r\n\r\n\t\tthis.setFieldDirty(this.field.Id, isDirty);\r\n\t}\r\n\r\n\tsetValue() {\r\n\t\tthis.value = find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tif(this.value) {\r\n\t\t\tconst localShiftedMoment = moment(this.value.Date, \"YYYY-MM-DDThh:mm:ss\");\r\n\r\n\t\t\tthis.selection.date = localShiftedMoment.toDate();\r\n\r\n\t\t\tthis.handleChange();\r\n\t\t\tthis.timepickerDate = this.selection.date;\r\n\t\t}\r\n\t}\r\n\r\n\topen() {\r\n\t\tthis.opened = true;\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.date-time\", [])\r\n\t.component(\"dateTime\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t

--empty--

\\r\\n\\t\\r\\n\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\";","import moment from \"moment-timezone\";\r\nimport template from \"./date.html\";\r\nimport \"./date.less\";\r\nimport {\r\n\tdebounce,\r\n\tfind\r\n} from \"lodash\";\r\nimport {\r\n\tEVENT_FILTER_PRIMARYDATE,\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_UNCLEAR_VALUE,\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_SET_DEFAULT_VALUE,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_PAGE_LOADED,\r\n\tEVENT_SET_FORM_PRISTINE\r\n} from \"constants.js\";\r\n\r\n// date\r\nexport class Controller {\r\n\tselection = {};\r\n\r\n\tconstructor($scope, eventBus, $timeout, $logger) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$logger = $logger;\r\n\r\n\t\tthis.opened = false;\r\n\t\tthis.format = \"MM/dd/yy\";\r\n\t\tthis.dateOptions = {\r\n\t\t\tformatYear: \"yy\",\r\n\t\t\tstartingDay: 0,\r\n\t\t\tminDate: new Date(12 * 60 * 60 * 1000)\r\n\t\t};\r\n\t\tthis.modelOptions = {};\r\n\r\n\t\tthis.altInputFormats = [\r\n\t\t\t\"d!-M!-yyyy\", \"d!-M!-yy\",\r\n\t\t\t\"d!/M!/yyyy\", \"d!/M!/yy\",\r\n\t\t\t\"d!.M!.yyyy\", \"d!.M!.yy\",\r\n\t\t\t\"shortDate\"\r\n\t\t];\r\n\r\n\t\tthis.maskOptions = {\r\n\t\t\tmaskDefinitions: {\r\n\t\t\t\t\"9\": /\\d/,\r\n\t\t\t\t\"A\": /[a-zA-Z]/,\r\n\t\t\t\t\"*\": /[a-zA-Z0-9]/,\r\n\t\t\t\t\"D\": /[AP]/,\r\n\t\t\t\t// eslint-disable-next-line no-useless-escape\r\n\t\t\t\t\"S\": /[\\d\\/\\.-:]/,\r\n\t\t\t\t\"M\": /[0-5]/\r\n\t\t\t},\r\n\t\t\tclearOnBlur: false,\r\n\t\t\tclearOnBlurPlaceholder: false\r\n\t\t};\r\n\t\tconst monthNumber = moment().format(\"MM\");\r\n\t\tconst year = moment().format(\"YY\");\r\n\r\n\t\tthis.placeholder = `Ex. ${monthNumber}/01/${year}`;\r\n\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\r\n\t\tif(this.field.MinValue !== undefined) {\r\n\t\t\tthis.dateOptions.minDate = moment()\r\n\t\t\t\t.add(this.field.MinValue, \"days\")\r\n\t\t\t\t.toDate();\r\n\t\t}\r\n\r\n\t\tif(this.field.MaxValue !== undefined) {\r\n\t\t\tthis.dateOptions.maxDate = moment()\r\n\t\t\t\t.add(this.field.MaxValue, \"days\")\r\n\t\t\t\t.toDate();\r\n\t\t}\r\n\r\n\t\tthis.setValue();\r\n\r\n\t\tconst ctrl = this;\r\n\t\tthis._scope.$watch(() => ctrl.selection.date, debounce((next, prev) => {\r\n\t\t\tif(next && (prev?.getTime() !== next.getTime())) {\r\n\t\t\t\tctrl.handleChange();\r\n\t\t\t}\r\n\t\t}, 400, {\r\n\t\t\t\"leading\": false,\r\n\t\t\t\"trailing\": true\r\n\t\t}), true);\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!this.cleared && (!!this.selection?.date)) {\r\n\t\t\t\tthis.cleared = {\r\n\t\t\t\t\tselection: {\r\n\t\t\t\t\t\tdate: this.selection.date\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tthis.selection.date = null;\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_UNCLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!!this.cleared) {\r\n\t\t\t\tthis.selection = this.cleared.selection;\r\n\t\t\t\tthis.cleared = undefined;\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_VALUE(this.field.Id), (e, params) => {\r\n\t\t\tif(!this.selection.date) {\r\n\t\t\t\tthis.externalSet = true;\r\n\t\t\t\tthis.selection.date = params.value;\r\n\r\n\t\t\t\tthis.$timeout(() => this._scope.$apply());\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_DEFAULT_VALUE(this.field.Id), () => {\r\n\t\t\tthis.externalSet = true;\r\n\t\t\tthis.selection = { date: new Date() };\r\n\r\n\t\t\tthis.$timeout(() => this._scope.$apply());\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_PAGE_LOADED, () => {\r\n\t\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\t\t\tif(!!this.initialValue) {\r\n\t\t\t\tconst localShiftedMoment = moment(this.initialValue.Date, \"YYYY-MM-DDThh:mm:ss\");\r\n\t\t\t\tthis.initialValue.Date = moment(localShiftedMoment.toDate()).tz(this.field.timezone, true)\r\n\t\t\t\t\t.format(\"YYYY-MM-DDTHH:mm:00Z\");\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\tgetCurrentValue(isApiCall = false) {\r\n\t\tlet result = this.buildResult();\r\n\r\n\t\tif(!isApiCall && this.field.IsNotReported !== true && this.field.IsHidden !== true) {\r\n\t\t\tif(!result) {\r\n\t\t\t\tresult = { FieldId: this.field.Id };\r\n\t\t\t\tresult.hasResultForRuleRun = false;\r\n\t\t\t}\r\n\t\t\tresult.isDirty = (result.Date && moment(result.Date).format()) != (this.initialValue && moment(this.initialValue.Date).format());\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\trevertValue() {\r\n\t\tif(this.initialValue) {\r\n\t\t\tconst localShiftedMoment = this.initialValue && moment(this.initialValue.Date, \"YYYY-MM-DDThh:mm:ss\");\r\n\r\n\t\t\tconst date = localShiftedMoment.toDate(); //this value is now clean for the field\r\n\r\n\t\t\tthis.selection.date = date;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.selection.date = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValue = this.buildResult();\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\tif(!this.field.timezone) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst outgoingDate = moment(this.selection.date).tz(this.field.timezone, true);\r\n\r\n\t\treturn this.selection.date\r\n\t\t\t? {\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\tDate: outgoingDate.format()\r\n\t\t\t} : undefined;\r\n\t}\r\n\r\n\tsetValue() {\r\n\t\tthis.value = find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tif(this.value) {\r\n\t\t\t// This is incoming data path from VESL server/API\r\n\t\t\tconst localShiftedMoment = moment(this.value.Date, \"YYYY-MM-DDThh:mm:ss\");\r\n\r\n\t\t\tconst date = localShiftedMoment.toDate(); //this value is now clean for the field\r\n\r\n\t\t\tthis.selection.date = date;\r\n\t\t}\r\n\t}\r\n\r\n\thandleChange() {\r\n\t\tif(this.selection.date && !this.field.isReadonly && !this.field.isDisabled) {\r\n\t\t\tif(this.field.IsPrimary) {\r\n\t\t\t\tthis._eventBus.trigger(EVENT_FILTER_PRIMARYDATE, {\r\n\t\t\t\t\tdate: this.selection.date\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id), {\r\n\t\t\t\tfield: this.field,\r\n\t\t\t\tvalue: this.selection.date\r\n\t\t\t});\r\n\r\n\t\t\tconst currentResult = this.getCurrentValue();\r\n\t\t\tthis.setFieldDirty(this.field.Id, currentResult[0].isDirty);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle($event) {\r\n\t\t$event.preventDefault();\r\n\t\t$event.stopPropagation();\r\n\t\tthis.opened = !this.opened;\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.date\", [])\r\n\t.component(\"date\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t

--empty--

\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\";","/* eslint-disable no-useless-escape */\r\nimport {\r\n\tfind,\r\n\tfilter,\r\n\tsome\r\n} from \"lodash\";\r\nimport template from \"./number.html\";\r\nimport \"./number.less\";\r\n\r\nimport {\r\n\tFEATURE_TYPES,\r\n\tEVENT_FILTER_CURRENT_OPTIONS,\r\n\tEVENT_FILTER_ALL_OPTIONS,\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_UNCLEAR_VALUE,\r\n\tEVENT_FIELD_DISABLE,\r\n\tEVENT_FIELD_ENABLE,\r\n\tEVENT_SET_FEATURE_DATA,\r\n\tEVENT_CLEAR_ROW,\r\n\tEVENT_HOTKEY_LOCK,\r\n\tEVENT_HANDLE_SUCCESSOR_LOCK,\r\n\tEVENT_DISABLE_SUCCESSOR_LOCK,\r\n\tEVENT_ENABLE_SUCCESSOR_LOCK,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_SET_FORM_PRISTINE\r\n} from \"constants.js\";\r\n\r\nexport class Controller {\r\n\tselection = {};\r\n\tlookups = [];\r\n\r\n\tconstructor($scope, eventBus, featureHelper, toastr, config, $timeout, $logger) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.featureHelper = featureHelper;\r\n\t\tthis._toastr = toastr;\r\n\t\tthis.config = config;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$logger = $logger;\r\n\r\n\t\tthis.isNumber = /^(\\-)?(\\d*(\\.|\\.\\d+)?)?$/;\r\n\t\tthis.trailingComma = /^[1-9]\\d*(\\.\\d+)?$/;\r\n\t\tthis.incrementingStep = 1;\r\n\t\tthis.digitCount = 0;\r\n\r\n\t\tthis.MAX_FIELD_VALUE = 999999;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tconst ctrl = this;\r\n\t\tthis.isFocused = false;\r\n\t\tthis.field.rangeErrorRepeatIds = this.field.rangeErrorRepeatIds || {};\r\n\t\tdelete this.field.rangeErrorRepeatIds[this.repeatId];\r\n\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\r\n\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\t\tthis.options = this.field.Data;\r\n\t\tthis.setValue();\r\n\t\tthis.setFeatures();\r\n\r\n\t\tif(this.field.IncrementingStep) {\r\n\t\t\tthis.incrementingStep = this.field.IncrementingStep;\r\n\t\t\tconst decimalSplit = `${this.field.IncrementingStep}`.split(\".\");\r\n\t\t\tthis.digitCount = decimalSplit[1] ? decimalSplit[1].length : 0;\r\n\t\t}\r\n\r\n\t\tconst filterOptions = (e, params) => {\r\n\t\t\tctrl.field.isDisabled = false;\r\n\t\t\tctrl.field.placeHolder = null;\r\n\r\n\t\t\tif(params.clear) {\r\n\t\t\t\tthis.selection = {};\r\n\t\t\t}\r\n\r\n\t\t\tctrl.setOptions(params.ids);\r\n\t\t\tif(params.readonly) {\r\n\t\t\t\tthis.disableField();\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif((this.selection && this.selection.unit) || params.clear) {\r\n\t\t\t\tthis.setUnitSelection(this.selection.unit);\r\n\t\t\t}\r\n\r\n\t\t\tctrl.$timeout(() => {\r\n\t\t\t\tthis._scope.$apply();\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tthis._eventBus.register(EVENT_FILTER_CURRENT_OPTIONS(this.field.Id, this.repeatId), filterOptions, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_FILTER_ALL_OPTIONS(this.field.Id, this.repeatId), filterOptions, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_VALUE(this.field.Id), (e, params) => ctrl.setValue(params.value), this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_HOTKEY_LOCK, () => ctrl.isFocused && ctrl.field.IsLockable && (ctrl.field.isLocked = !ctrl.field.isLocked), this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_HANDLE_SUCCESSOR_LOCK(this.field.Id), (e, params) => {\r\n\t\t\tthis.field.isFieldLockable = params.enable && this.field.IsLockable;\r\n\t\t\tif(this.field.isFieldLockable !== true) {\r\n\t\t\t\tthis.field.isLocked = false;\r\n\t\t\t\tthis._eventBus.trigger(EVENT_DISABLE_SUCCESSOR_LOCK(this.field.Id));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis._eventBus.trigger(EVENT_ENABLE_SUCCESSOR_LOCK(this.field.Id));\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id, this.repeatId), () => {\r\n\t\t\tif(!this.cleared && !!this.selection?.number) {\r\n\t\t\t\tthis.cleared = {\r\n\t\t\t\t\tselection: { ...this.selection }\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tthis.selection.number = undefined;\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_UNCLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!!this.cleared) {\r\n\t\t\t\tthis.selection = this.cleared.selection;\r\n\r\n\t\t\t\tthis.cleared = undefined;\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_ROW(this.repeatId), () => {\r\n\t\t\tthis.selection.number = undefined;\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_FIELD_DISABLE(this.field.Id), () => this.disableField(), this._scope);\r\n\t\tthis._eventBus.register(EVENT_FIELD_ENABLE(this.field.Id), () => this.enableField(), this._scope);\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n\r\n\trevertValue() {\r\n\t\tthis.selection.number = this.initialValue && this.initialValue.Number;\r\n\t\tthis.selection.unit = this.initialValue && find(this.options, o => o.Id === this.initialValue.DataId);\r\n\t\tif(this.selection.unit === undefined) {\r\n\t\t\tthis.setDefaultUnit();\r\n\t\t}\r\n\t}\r\n\r\n\tsetOptions(ids) {\r\n\t\tthis.options = ids ?\r\n\t\t\tfilter(this.field.Data, (d) => some(ids, (i) => d.Id === i)) :\r\n\t\t\tthis.field.Data;\r\n\r\n\t\tif(this.selection.unit?.Id && !some(this.options, (o) => o.Id === this.selection.unit.Id)) {\r\n\t\t\tthis.selection.unit = undefined;\r\n\t\t}\r\n\r\n\t\tthis.setDefaultUnit();\r\n\t}\r\n\r\n\tdisableField() {\r\n\t\tthis.field.isDisabled = true;\r\n\t\tthis.lookups.forEach(l => l.disabled = true);\r\n\t}\r\n\r\n\tenableField() {\r\n\t\tthis.field.isDisabled = false;\r\n\t\tthis.field.placeHolder = null;\r\n\t\tthis.lookups.forEach(l => l.disabled = false);\r\n\t}\r\n\r\n\tgetCurrentValue(isApiCall) {\r\n\t\tif((!!this.selection.number && !isNaN(this.selection.number)) && !this.selection.unit && isApiCall) {\r\n\t\t\tthis._toastr.error(`Please select a Unit for ${this.field.Name}.`);\r\n\t\t\tthrow new Error(`Unit not found for ${this.field.Name}`);\r\n\t\t}\r\n\r\n\t\tlet result = this.buildResult();\r\n\t\tif(result && result.Number && ((result.Number > this.MAX_FIELD_VALUE) || result.Number < (-1 * this.MAX_FIELD_VALUE))) {\r\n\t\t\tif(this.field.rangeErrorRepeatIds[this.repeatId] !== true) {\r\n\t\t\t\tthis._toastr.error(`Number field cannot accept a number greater than ${this.MAX_FIELD_VALUE} or less than -${this.MAX_FIELD_VALUE}`);\r\n\r\n\t\t\t\tthis.selection.number = undefined;\r\n\t\t\t\tthis.field.rangeErrorRepeatIds[this.repeatId] = true;\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tdelete this.field.rangeErrorRepeatIds[this.repeatId];\r\n\t\t\t\t}, 5000);\r\n\t\t\t}\r\n\r\n\t\t\tthrow new Error(`Number field out of range for ${this.field.Name}`);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdelete this.field.rangeErrorRepeatIds[this.repeatId];\r\n\t\t}\r\n\r\n\t\tif(!isApiCall) {\r\n\t\t\tif(result?.DataId === undefined) {\r\n\t\t\t\tresult = { \r\n\t\t\t\t\t...(result ?? {}),\r\n\t\t\t\t\tFieldId: this.field.Id \r\n\t\t\t\t};\r\n\t\t\t\tresult.hasResultForRuleRun = false;\r\n\t\t\t\tif(this.selection.unit) {\r\n\t\t\t\t\tresult.DataId = this.selection.unit.Id;\r\n\t\t\t\t\tresult.hasResultForRuleRun = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tresult.factor = (this.selection.unit?.Factor) || 1;\r\n\t\t\tresult.isDirty = this.isDirty(result);\r\n\t\t}\r\n\r\n\t\treturn result && !this.field.hasRangeError ? [result] : [];\r\n\t}\r\n\r\n\tisDirty(result) {\r\n\t\treturn this.field.IsNotReported !== true\r\n\t\t\t&& this.field.IsHidden !== true\r\n\t\t\t&& (((result && result.Number) != (this.initialValue && this.initialValue.Number)\r\n\t\t\t\t|| ((result && result.DataId) != (this.initialValue && this.initialValue.DataId))));\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\tlet result = this.selection.number !== null\r\n\t\t\t&& this.selection.number !== undefined\r\n\t\t\t&& this.selection.number !== \"\"\r\n\t\t\t&& !isNaN(this.selection.number)\r\n\t\t\t&& this.selection.unit?.Id ?\r\n\t\t\t{\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\tNumber: parseFloat(this.selection.number),\r\n\t\t\t\tDataId: this.selection.unit.Id, \r\n\t\t\t\thasFullResult: true\r\n\t\t\t} :\r\n\t\t\tundefined;\r\n\r\n\t\tif(this.repeatId) {\r\n\t\t\tresult = {\r\n\t\t\t\t...(result ?? {}),\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\trepeatId: this.repeatId,\r\n\t\t\t\thasFullResult: !!result?.hasFullResult\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\tsetFeatures() {\r\n\t\tconst mapFeature = find(this.field.features, { Type: FEATURE_TYPES.mapPoint });\r\n\r\n\t\tif(mapFeature) {\r\n\t\t\tthis.lookups.push({\r\n\t\t\t\tname: mapFeature.Type,\r\n\t\t\t\tfieldId: this.field.Id,\r\n\t\t\t\tdisabled: this.field.isReadonly || this.field.isDisabled\r\n\t\t\t});\r\n\r\n\t\t\tthis._eventBus.register(EVENT_SET_FEATURE_DATA(mapFeature.Type), (event, params) => {\r\n\t\t\t\tconst lookup = find(this.lookups, l => l.name === mapFeature.Type);\r\n\t\t\t\tlookup.data = params.geoJsons;\r\n\t\t\t\tlookup.fields = params.locationFields;\r\n\t\t\t}, this._scope);\r\n\t\t}\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValue = this.field.IsDetail ? undefined : this.buildResult();\r\n\t}\r\n\r\n\tsetUnitSelection(unit) {\r\n\t\tthis.selection.unit = unit;\r\n\t\tthis.field.focus = true;\r\n\r\n\t\tconst isDirtyUnit = (this.initialValue && this.initialValue.DataId) !== unit?.Id;\r\n\t\tthis.setFieldDirty(this.field.Id, isDirtyUnit);\r\n\r\n\t\tconst params = {\r\n\t\t\tfield: this.field,\r\n\t\t\tvalue: this.selection.unit\r\n\t\t};\r\n\r\n\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id), params);\r\n\t}\r\n\r\n\tsetValue(value) {\r\n\t\tthis.value = value ? value : find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tif(this.value) {\r\n\t\t\tthis.selection = {\r\n\t\t\t\tnumber: parseFloat(parseFloat(this.value.Number).toFixed(this.field.RoundingPoint)),\r\n\t\t\t\tunit: find(this.field.Data, d => d.Id === this.value.DataId)\r\n\t\t\t};\r\n\t\t} \r\n\t\tthis.setDefaultUnit();\r\n\t}\r\n\r\n\tsetDefaultUnit() {\r\n\t\tif(this.selection.unit !== undefined) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(this.options.length === 1) {\r\n\t\t\tthis.selection.unit = this.options[0];\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.selection.unit = find(this.options, (d) => d.IsDefault);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.number\", [])\r\n\t.component(\"number\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\trepeatId: \"<\",\r\n\t\t\tpivotRow: \"=\",\r\n\t\t\tpivotColumn: \"=\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t 1 || $ctrl.field.Data[0].Code !== '#'\\\"\\r\\n\\t>\\r\\n\\t\\t\\r\\n\\t\\t\\t{{$ctrl.selection.unit.Abbreviation || $ctrl.selection.unit.Name}}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t{{$ctrl.selection.unit.Abbreviation || $ctrl.selection.unit.Name || 'Unit'}}\\r\\n\\t\\t\\t\\t 1 && 'zmdi-chevron-down'\\r\\n\\t\\t\\t\\t\\t]\\\">\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t {{unit.Name || unit.Code}} \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t Increment or decrement using keyboard arrows. \\r\\n\";","import swal from \"sweetalert2\";\r\n\r\nexport async function confirmUnsavedChangesWillBeLost() {\r\n\ttry {\r\n\t\tconst result = await swal.fire({\r\n\t\t\ttitle: \"Changes will be lost on deletion\",\r\n\t\t\thtml: \"Your changes will be lost. Are you sure you wish to proceed?\",\r\n\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\",\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Confirm\"\r\n\t\t});\r\n\r\n\t\treturn !result.dismiss;\r\n\t}catch(error) {\t\t\r\n\t\treturn false;\r\n\t}\r\n}","import swal from \"sweetalert2\";\r\n\r\nexport async function confirmWithdrawReport(nomenclature) {\r\n\ttry {\r\n\t\tconst result = await swal.fire({\r\n\t\t\ttitle: `Withdraw ${nomenclature.PositiveReport}`,\r\n\t\t\thtml: `Are you sure you want to withdraw this ${nomenclature.PositiveReport}?`,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\",\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Yes\"\r\n\t\t});\r\n\r\n\t\treturn !result.dismiss;\r\n\t}catch(error) {\t\t\r\n\t\treturn false;\r\n\t}\r\n}","import swal from \"sweetalert2\";\r\nimport { pluralize } from \"humanize-plus\";\r\n\r\nexport async function confirmDirtySubmission(dirtyFields, numDirtyDetails) {\r\n\ttry {\r\n\t\tconst result = await swal.fire({\r\n\t\t\ttitle: \"Unsaved Values\",\r\n\t\t\thtml: `The following changes have been detected:\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t${dirtyFields.map(field => { return `
  • ${field.Name}
  • `; }).join(\"\")}\r\n\t\t\t\t\t\t${numDirtyDetails > 0 ? `
  • ${dirtyFields.length > 0 ? \"and \" : \"\"}${numDirtyDetails} ${pluralize(numDirtyDetails, \"detail\")}
  • ` : \"\"}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\tWould you like to save and submit?`,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\",\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Save and Submit\"\r\n\t\t});\r\n\t\treturn !result.dismiss;\r\n\t}\r\n\tcatch(err) {\r\n\t\treturn false;\r\n\t}\r\n}","import swal from \"sweetalert2\";\r\nimport { pluralize } from \"humanize-plus\";\r\n\r\nexport async function confirmRuleWarningsOnReport(validation) {\r\n\ttry {\r\n\t\tconst result = await swal.fire({\r\n\t\t\ttitle: `${validation.rules.length} ${pluralize(validation.rules.length, \"Warning\")}`,\r\n\t\t\tinput: \"checkbox\",\r\n\t\t\tinputValue: false, // this is the initialized value\r\n\t\t\tinputValidator: (result) => {\r\n\t\t\t\treturn !result && \"You need to confirm that the entered values are valid.\";\r\n\t\t\t},\r\n\t\t\tinputPlaceholder: \"I confirm these values are valid\",\r\n\t\t\thtml: `The following must be confirmed before proceeding.\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t${validation.rules.map(r => `
  • ${r.Title}
  • `)}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\tAre you sure this is correct?`,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\",\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Submit\"\r\n\t\t});\r\n\r\n\t\treturn !result.dismiss;\r\n\t}catch(err) {\r\n\t\treturn false;\r\n\t}\r\n}","import swal from \"sweetalert2\";\r\n\r\n/**\r\n * \r\n * @param currentTimezoneCode - timezone code of report\r\n * @param newTimezoneCode - new timezone code of selected entity\r\n * @param fieldTitle - name of primary entity field\r\n */\r\n\r\nexport async function notifyTimezoneDiscrepancy(currentTimezoneCode, newTimezoneCode, fieldTitle) {\r\n\ttry {\r\n\t\tawait swal.fire({\r\n\t\t\ttitle: \"Report timezone will be overridden on save.\",\r\n\t\t\thtml:\r\n\t\t\t\t`This report's timezone is currently ${currentTimezoneCode}.

\r\n\t\t\t\tSaving the report with the currently selected ${fieldTitle}\r\n\t\t\t\twill update the report's timezone to ${newTimezoneCode}`,\r\n\t\t\tallowOutsideClick: false,\r\n\t\t\tallowEscapeKey: false,\r\n\t\t\tallowEnterKey: false,\r\n\t\t\tshowConfirmButton: true,\r\n\t\t\ttype: \"warning\"\r\n\t\t});\r\n\t}catch(err) {\r\n\t\treturn false;\r\n\t}\r\n}","import swal from \"sweetalert2\";\r\n\r\n/**\r\n * \r\n * @param currentTimezoneCode - timezone code of report\r\n * @param newTimezoneCode - new timezone code of selected entity\r\n */\r\n\r\nexport async function notifyFormTimezoneError(currentTimezoneCode, newTimezoneCode) {\r\n\ttry {\r\n\t\tawait swal.fire({\r\n\t\t\ttitle: \"Unexpected report timezone\",\r\n\t\t\thtml:\r\n\t\t\t\t`This report's timezone is currently ${currentTimezoneCode}, while the \r\n\t\t\t\tform's timezone is ${newTimezoneCode}.

\r\n\t\t\t\tThe system is unable to resolve this discrepancy.`,\r\n\t\t\tallowOutsideClick: false,\r\n\t\t\tallowEscapeKey: false,\r\n\t\t\tallowEnterKey: false,\r\n\t\t\tshowConfirmButton: true,\r\n\t\t\ttype: \"error\"\r\n\t\t});\r\n\t}\r\n\tcatch(err) {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nexport async function notifyUserTimezoneError() {\r\n\ttry {\r\n\t\tawait swal.fire({\r\n\t\t\ttitle: \"Unexpected form time mode\",\r\n\t\t\thtml:\r\n\t\t\t\t\"This form uses a 'ByUser' time mode, which is not currently supported\",\r\n\t\t\tallowOutsideClick: false,\r\n\t\t\tallowEscapeKey: false,\r\n\t\t\tallowEnterKey: false,\r\n\t\t\tshowConfirmButton: true,\r\n\t\t\ttype: \"error\"\r\n\t\t});\r\n\t}\r\n\tcatch(err) {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\n/**\r\n * \r\n * @param fieldName - name of entity field\r\n */\r\nexport async function notifyMultipleEntityTimezoneError(fieldName) {\r\n\ttry {\r\n\t\tawait swal.fire({\r\n\t\t\ttitle: \"Multiple timezones detected\",\r\n\t\t\thtml:\r\n\t\t\t\t`The selected ${fieldName} is associated with multiple timezones. Please correct before proceeding`,\r\n\t\t\tallowOutsideClick: false,\r\n\t\t\tallowEscapeKey: false,\r\n\t\t\tallowEnterKey: false,\r\n\t\t\tshowConfirmButton: true,\r\n\t\t\ttype: \"error\"\r\n\t\t});\r\n\t}\r\n\tcatch(err) {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\n/**\r\n * \r\n * @param fieldName - name of entity field\r\n */\r\nexport async function notifyNoEntityTimezoneError(fieldName) {\r\n\ttry {\r\n\t\tawait swal.fire({\r\n\t\t\ttitle: \"No timezones detected\",\r\n\t\t\thtml:\r\n\t\t\t\t`The selected ${fieldName} is not associated with any timezones. Please correct before proceeding`,\r\n\t\t\tallowOutsideClick: false,\r\n\t\t\tallowEscapeKey: false,\r\n\t\t\tallowEnterKey: false,\r\n\t\t\tshowConfirmButton: true,\r\n\t\t\ttype: \"error\"\r\n\t\t});\r\n\t}\r\n\tcatch(err) {\r\n\t\treturn false;\r\n\t}\r\n}","import swal from \"sweetalert2\";\r\n\r\nexport async function alertDeactivatedSelection(name) {\r\n\ttry {\r\n\t\tawait swal.fire({\r\n\t\t\ttitle: \"Deactivated Value\",\r\n\t\t\thtml: `Uh-oh. It looks like ${name || \"the item you selected\"} is deactivated. Please select a different option if available.`,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\"\r\n\t\t});\r\n\t}catch(err) {\r\n\t\treturn false;\r\n\t}\r\n}","import swal from \"sweetalert2\";\r\n\r\nexport async function showNotConnectedOnRefreshError() {\r\n\treturn swal.fire({\r\n\t\ttitle: \"Error!\",\r\n\t\thtml:\r\n\t\t\t`The current configuration is out of date and must be reloaded but the device is not connected to the internet.\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\tPlease reconnect to the internet, click the refresh button, and try again.`,\r\n\t\ttype: \"error\",\r\n\t\tallowOutsideClick: false,\r\n\t\tallowEscapeKey: false,\r\n\t\tallowEnterKey: false,\r\n\t\tconfirmButtonText: \"Refresh\"\r\n\t})\r\n\t\t.then(res => {\r\n\t\t\tif(!!res) {\r\n\t\t\t\tlocation.reload();\r\n\t\t\t}\r\n\t\t});\r\n}","const fieldHelpers = {\r\n\tMap: {\r\n\t\tname: \"Map\",\r\n\t\tcomponent: \"area-selector\",\r\n\t\tprops: {\r\n\t\t\tonSelect: \"onSelect({selection})\"\r\n\t\t},\r\n\t\tresolve: lookup => ({\r\n\t\t\tlookup\r\n\t\t})\r\n\t},\r\n\tMapPoint: {\r\n\t\tname: \"MapPoint\",\r\n\t\tcomponent: \"location-selector\",\r\n\t\tprops: {\r\n\t\t\tonSelect: \"onSelect({selection})\"\r\n\t\t},\r\n\t\tresolve: lookup => ({\r\n\t\t\tlookup\r\n\t\t})\r\n\t},\r\n\tMapWithoutBoundary: {\r\n\t\tname: \"MapWithoutBoundary\",\r\n\t\tcomponent: \"location-selector\",\r\n\t\tprops: {\r\n\t\t\tonSelect: \"onSelect({selection})\"\r\n\t\t},\r\n\t\tresolve: lookup => ({\r\n\t\t\tlookup\r\n\t\t})\r\n\t},\r\n\tNotAvailable: {\r\n\t\tname: \"NotAvailable\",\r\n\t\tcomponent: \"not-available\",\r\n\t\tprops: {\r\n\t\t\tonSelect: \"onSelect({selection})\"\r\n\t\t},\r\n\t\tresolve: lookup => ({\r\n\t\t\tlookup\r\n\t\t})\r\n\t},\r\n\tAdvancedSearch: {\r\n\t\tname: \"AdvancedSearch\",\r\n\t\tcomponent: \"advanced-search\",\r\n\t\tprops: {\r\n\t\t\tonSelect: \"onSelect({selection})\"\r\n\t\t},\r\n\t\tresolve: lookup => ({\r\n\t\t\tlookup\r\n\t\t})\r\n\t},\r\n\tCustomInput: {\r\n\t\tname: \"CustomInput\",\r\n\t\tcomponent: \"custom-input\",\r\n\t\tprops: {\r\n\t\t\tonSelect: \"onSelect({selection})\"\r\n\t\t},\r\n\t\tresolve: lookup => ({\r\n\t\t\tlookup\r\n\t\t})\r\n\t}\r\n\r\n};\r\n\r\nexport default fieldHelpers;\r\n","import {\r\n\tFIELD_TYPES,\r\n\tFIELD_TEMPLATES,\r\n\tRELATIONSHIP_TYPES,\r\n\tIDENTIFIER_TYPES\r\n} from \"constants.js\";\r\nimport {\r\n\tforEach,\r\n\tfind,\r\n\tfilter,\r\n\tfindIndex,\r\n\thas,\r\n\tuniqWith,\r\n\tkeyBy,\r\n\ttoArray,\r\n\tmap, \r\n\tuniq,\r\n\tuniqBy\r\n} from \"lodash\";\r\n\r\nexport const UNIQUE_TIMEZONE_ERRORS = {\r\n\tMULTIPLE: \"Multiple\",\r\n\tZERO: \"Zero\"\r\n};\r\n\r\nclass EntityManager {\r\n\tconstructor($userProfile, $logger) {\r\n\t\tthis.$userProfile = $userProfile;\r\n\t\tthis.$logger = $logger;\r\n\r\n\t\tthis.reset();\r\n\t}\r\n\r\n\treset() {\r\n\t\tthis.allEntities = {};\r\n\t\tthis.entityIdToFieldIdMap = {};\r\n\t\tthis.allEntityConfigs = {};\r\n\t\tthis.userScopedEntities = {};\r\n\t\tthis.userScopedEntityTypes = [];\r\n\t\tthis.primaryFieldEntities = null;\r\n\t\tthis.selectedEntity = null;\r\n\t\tthis.allPrimaries = false;\r\n\t\tthis.primaryFieldId = undefined;\r\n\t\tthis.primaryEntityQueryConfiguration = undefined;\r\n\t\tthis.primaryFieldLabel = \"\";\r\n\t}\r\n\r\n\tisEntitySelf(entity) {\r\n\t\treturn !!entity.isSelf;\r\n\t}\r\n\r\n\tfindFriendlyByPrimaryId = (fieldOptions, entityId) => {\r\n\t\tconst found = fieldOptions.find(d => d.Id === entityId);\r\n\t\tif(found !== undefined) {\r\n\t\t\treturn found;\r\n\t\t}\r\n\r\n\t\tfor(const friendly of fieldOptions) {\r\n\t\t\tif(friendly.Entities !== undefined && friendly.Entities.length > 0) {\r\n\t\t\t\tconst primaries = friendly.Entities.map(e => e.Entity);\r\n\t\t\t\tconst foundPrimary = this.findFriendlyByPrimaryId(primaries, entityId);\r\n\r\n\t\t\t\tif(foundPrimary !== undefined) {\r\n\t\t\t\t\treturn friendly;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tselectEntity(entityId) {\r\n\t\tthis.allPrimaries = false;\r\n\r\n\t\tthis.selectedEntity = this.primaryFieldEntities[entityId];\r\n\t\tif(this.selectedEntity && this.selectedEntity.isFriendly && !this.selectedEntity.isSelf) {\r\n\t\t\tthis.allPrimaries = true;\r\n\r\n\t\t\tif(this.selectedEntity.Entities.length === 1) {\r\n\t\t\t\tthis.selectedEntity = this.primaryFieldEntities[this.selectedEntity.Entities[0].Entity.Id];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst thisUser = this.$userProfile.getUserProfile();\r\n\t\tthisUser.selectedEntityId = entityId;\r\n\t\tthis.$userProfile.setUserProfile(thisUser);\r\n\t}\r\n\r\n\tisAllPrimaries() {\r\n\t\treturn this.isAllPrimaries;\r\n\t}\r\n\r\n\tgetFriendlyForPrimaryId(id) {\r\n\t\tconst primary = this.primaryFieldEntities[id];\r\n\t\tif(primary.isSelf) {\r\n\t\t\treturn primary;\r\n\t\t}\r\n\t\t\r\n\t\tconst friendlyId = find(primary.friendlyIds, e => has(this.primaryFieldEntities, e));\r\n\r\n\t\treturn this.primaryFieldEntities[friendlyId];\r\n\t}\r\n\r\n\tgetSelectedEntity() {\r\n\t\tif(!this.selectedEntity) {\r\n\t\t\tconst thisUser = this.$userProfile.getUserProfile();\r\n\r\n\t\t\tconst selectedEntityId = thisUser && thisUser.selectedEntityId;\r\n\r\n\t\t\tif(selectedEntityId) {\r\n\t\t\t\tthis.selectEntity(selectedEntityId);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.selectedEntity) {\r\n\t\t\tlet friendlyId = this.selectedEntity.Id;\r\n\r\n\t\t\tif(this.selectedEntity.isPrimary) {\r\n\t\t\t\tfriendlyId = find(this.selectedEntity.friendlyIds, e => has(this.primaryFieldEntities, e));\r\n\t\t\t}\r\n\r\n\t\t\tconst returnEntity = {\r\n\t\t\t\tprimary: this.selectedEntity.isFriendly ? {} : this.selectedEntity,\r\n\t\t\t\tfriendly: this.primaryFieldEntities[friendlyId]\r\n\t\t\t};\r\n\r\n\t\t\treturn returnEntity;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tprimary: null,\r\n\t\t\tfriendly: null\r\n\t\t};\r\n\t}\r\n\r\n\tgetEntity(fieldId, entityId) {\r\n\t\tif(this.allEntities[fieldId]) {\r\n\t\t\treturn this.allEntities[fieldId][entityId];\r\n\t\t}\r\n\t\telse if(fieldId.toString().includes(\"-\")) {\r\n\t\t\tconst idBreakIndex = fieldId.indexOf(\"-\");\r\n\t\t\tconst trueFieldId = parseInt(fieldId.substring(0, idBreakIndex));\r\n\r\n\t\t\treturn this.allEntities[trueFieldId][entityId];\r\n\t\t}\r\n\t}\r\n\r\n\tgetEntityPairs(fieldId, entityId) {\r\n\t\tconst entity = this.getEntity(fieldId, entityId);\r\n\t\tif(entity.isSelf) {\r\n\t\t\treturn [{\r\n\t\t\t\tfriendly: entity, \r\n\t\t\t\tprimary: entity\r\n\t\t\t}];\r\n\t\t}\r\n\t\telse if(entity.isFriendly) {\r\n\t\t\treturn entity.Entities.map(e => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tfriendly: entity, \r\n\t\t\t\t\tprimary: e.Entity\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tconst friendliesWithThisPrimary = entity.friendlyIds.map(fId => {\r\n\t\t\tconst friendly = this.getEntity(fieldId, fId);\r\n\t\t\t\r\n\t\t\treturn {\r\n\t\t\t\tfriendly,\r\n\t\t\t\tprimary: entity\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\treturn friendliesWithThisPrimary;\r\n\t}\r\n\r\n\tgetUniqueTimezoneForEntity(fieldId, entityId) {\r\n\t\tconst all = this.getEntityPairs(fieldId, entityId);\r\n\r\n\t\tconst allAssociated = all.reduce((acc, next) => {\r\n\t\t\tconst bothEntities = Object.values(next);\r\n\t\t\tacc.push(...bothEntities);\r\n\r\n\t\t\treturn acc;\r\n\t\t}, []);\r\n\r\n\t\tconst allTimezones = allAssociated\r\n\t\t\t.map(e => e.TimeZone?.Code)\r\n\t\t\t.filter(c => c !== undefined);\r\n\r\n\t\tconst uniqueTimezones = uniq(allTimezones);\r\n\t\tif(uniqueTimezones.length > 1) {\r\n\t\t\treturn UNIQUE_TIMEZONE_ERRORS.MULTIPLE;\r\n\t\t}\r\n\t\telse if(uniqueTimezones.length < 1) {\r\n\t\t\treturn UNIQUE_TIMEZONE_ERRORS.ZERO;\r\n\t\t}\r\n\r\n\t\treturn uniqueTimezones[0];\r\n\t}\r\n\r\n\tgetEntitiesForAllFields(entityId) {\r\n\t\tconst allFieldEntities = [];\r\n\t\tforEach(this.allEntities, (fieldEntities) => {\r\n\t\t\tif(fieldEntities[entityId]) {\r\n\t\t\t\tallFieldEntities.push(fieldEntities[entityId]);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn allFieldEntities;\r\n\t}\r\n\r\n\tgetSeason(seasonCode) {\r\n\t\treturn this.seasons && this.seasons[seasonCode];\r\n\t}\r\n\r\n\tgetClassification(classificationCode) {\r\n\t\treturn this.classifications && this.classifications[classificationCode];\r\n\t}\r\n\r\n\tgetClassificationById(classificationId) {\r\n\t\treturn this.classifications && find(this.classifications, c => c.Id === classificationId);\r\n\t}\r\n\r\n\tgetPrimaryFieldEntities() {\r\n\t\treturn filter(this.primaryFieldEntities, (entity) => entity.isFriendly);\r\n\t}\r\n\r\n\tgetEntityQueryConfigurations() {\r\n\t\tconst uniqueTypes = uniqWith(\r\n\t\t\tmap(this.allEntityConfigs, c => [c.Primary, c.Friendly])\r\n\t\t\t\t.reduce((a, b) => a.concat(b), []),\r\n\t\t\t(a, b) => a.Type.Code === b.Type.Code);\r\n\r\n\t\tconst formTypeConfigs = keyBy(uniqueTypes, c => c.Type.Code);\r\n\t\treturn formTypeConfigs;\r\n\t}\r\n\r\n\tupdateEntity(newEntity) {\r\n\t\tconst fieldIds = this.entityIdToFieldIdMap[newEntity.Id];\r\n\r\n\t\tforEach(fieldIds, (id) => {\r\n\t\t\tconst currentEntity = this.getEntity(id, newEntity.Id);\r\n\r\n\t\t\tconst updatedEntity = {\r\n\t\t\t\t...currentEntity,\r\n\t\t\t\t...newEntity\r\n\t\t\t};\r\n\r\n\t\t\tthis.allEntities[id][newEntity.Id] = updatedEntity;\r\n\t\t});\r\n\t}\r\n\r\n\tloadEntityFieldData(form) {\r\n\t\tthis.form = form;\r\n\r\n\t\tthis.loadSeasons();\r\n\t\tthis.loadClassifications();\r\n\r\n\t\tconst entityFields = form.Fields.filter((f) => f.Type.Code === FIELD_TYPES.entity || f.Type.Code === FIELD_TYPES.entityContact);\r\n\r\n\t\tconst userScopedEntityTypes = [];\r\n\t\tforEach(entityFields, (field) => {\r\n\t\t\tthis.allEntities[field.Id] = this.loadEntityField(field);\r\n\r\n\t\t\tforEach(this.allEntities[field.Id], e => {\r\n\t\t\t\tif(this.entityIdToFieldIdMap[e.Id] === undefined) {\r\n\t\t\t\t\tthis.entityIdToFieldIdMap[e.Id] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.entityIdToFieldIdMap[e.Id].push(field.Id);\r\n\t\t\t});\r\n\r\n\t\t\tif(field.IsPrimary) {\r\n\t\t\t\tthis.primaryFieldId = field.Id;\r\n\t\t\t\tthis.primaryFieldEntities = this.allEntities[field.Id];\r\n\t\t\t\tthis.primaryEntityQueryConfiguration = field.EntityQueryConfiguration;\r\n\t\t\t\tthis.primaryFieldLabel = field.Name;\r\n\t\t\t}\r\n\r\n\t\t\tconst eqc = field.EntityQueryConfiguration;\r\n\r\n\t\t\tif(eqc.IsUserScoped) {\r\n\t\t\t\tconst entityArray = toArray(this.allEntities[field.Id]);\r\n\t\t\t\tthis.userScopedEntities[eqc.Friendly.Type.Code] = this.userScopedEntities[eqc.Friendly.Type.Code] ?? {};\r\n\t\t\t\tthis.userScopedEntities[eqc.Friendly.Type.Code][eqc.Primary.Type.Code] = \r\n\t\t\t\t\tthis.userScopedEntities[eqc.Friendly.Type.Code][eqc.Primary.Type.Code] ?? {};\r\n\t\t\t\tthis.userScopedEntities[eqc.Friendly.Type.Code][eqc.Primary.Type.Code][eqc.RelationshipType.Code] = \r\n\t\t\t\t\t(this.userScopedEntities[eqc.Friendly.Type.Code][eqc.Primary.Type.Code][eqc.RelationshipType.Code] ?? []).concat(entityArray);\r\n\t\t\t\t\r\n\t\t\t\tthis.userScopedEntities[eqc.Friendly.Type.Code][eqc.Primary.Type.Code][eqc.RelationshipType.Code] = \r\n\t\t\t\t\tuniqWith(this.userScopedEntities[eqc.Friendly.Type.Code][eqc.Primary.Type.Code][eqc.RelationshipType.Code], \r\n\t\t\t\t\t\t(next, prev) => next.Id === prev.Id\r\n\t\t\t\t\t);\r\n\t\t\t\tuserScopedEntityTypes.push(...this.userScopedEntities[eqc.Friendly.Type.Code][eqc.Primary.Type.Code][eqc.RelationshipType.Code].map(e => e.Type));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst uniqueEntityTypes = uniqBy(userScopedEntityTypes, t => t.Code);\r\n\t\tthis.userScopedEntityTypes = keyBy(uniqueEntityTypes, t => t.Code);\r\n\t}\r\n\r\n\tloadSeasons = () => {\r\n\t\tif(!!this.form.Seasons) {\r\n\t\t\tthis.seasons = {};\r\n\t\t\tthis.form.Seasons.map(season => {\r\n\t\t\t\tthis.seasons[season.Code] = season;\r\n\t\t\t\treturn;\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tloadClassifications = () => {\r\n\t\tif(!!this.form.Agency.Classifications) {\r\n\t\t\tthis.classifications = {};\r\n\t\t\tthis.form.Agency.Classifications.map(classification => {\r\n\t\t\t\tthis.classifications[classification.Code] = classification;\r\n\t\t\t\treturn;\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tloadEntityField(field) {\r\n\t\tif((field?.Type?.Code === FIELD_TYPES.entity || field?.Type?.Code === FIELD_TYPES.entityContact)\r\n\t\t\t&& (field.EntityQueryConfiguration && field.EntityQueryConfiguration.RelationshipType && field.EntityQueryConfiguration.RelationshipType.Code === RELATIONSHIP_TYPES.Self)) {\r\n\r\n\t\t\tif(field.Template && field.Template === FIELD_TEMPLATES.EntitySelector) {\r\n\t\t\t\tfield.Template = FIELD_TEMPLATES.Selection;\r\n\t\t\t}\r\n\t\t\tfield.isSelf = true;\r\n\t\t}\r\n\r\n\t\tconst fieldEntities = this.loadEntityListData(field.Data, field.isSelf);\r\n\r\n\t\tforEach(fieldEntities, (entity) => {\r\n\t\t\tif(entity.isPrimary) {\r\n\t\t\t\tentity.Type = field.EntityQueryConfiguration.Primary.Type;\r\n\t\t\t}\r\n\t\t\telse if(entity.isFriendly) {\r\n\t\t\t\tentity.Type = field.EntityQueryConfiguration.Friendly.Type;\r\n\r\n\t\t\t\tforEach(entity.Entities, (primary) => {\r\n\t\t\t\t\tprimary.Type = field.EntityQueryConfiguration.RelationshipType;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tforEach(field.Data, (entity, $index) => {\r\n\t\t\tfield.Data[$index] = fieldEntities[entity.Id];\r\n\t\t});\r\n\r\n\t\tthis.allEntityConfigs[field.Id] = this.loadConfiguration(field.EntityQueryConfiguration);\r\n\t\treturn fieldEntities;\r\n\t}\r\n\r\n\tloadEntityListData(entities, isSelf = false) {\r\n\t\tif(!entities || !entities.length) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tconst fieldEntities = {};\r\n\r\n\t\tforEach(entities, (entity) => {\r\n\t\t\tlet newEntity = null;\r\n\r\n\t\t\tif(entity.Entity === undefined && entity.Id === undefined) {\r\n\t\t\t\tnewEntity = undefined;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\telse if(entity.Entity) {\r\n\t\t\t\tnewEntity = entity.Entity;\r\n\t\t\t\tnewEntity.isPrimary = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnewEntity = entity;\r\n\t\t\t\tnewEntity.isFriendly = true;\r\n\r\n\t\t\t\tif(isSelf === true) {\r\n\t\t\t\t\tnewEntity.isSelf = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst subEntities = this.loadEntityListData(newEntity.Entities);\r\n\r\n\t\t\tforEach(subEntities, (sub) => {\r\n\t\t\t\tif(fieldEntities[sub.Id]) {\r\n\t\t\t\t\tfieldEntities[sub.Id].friendlyIds.push(newEntity.Id);\r\n\t\t\t\t\tconst entityIndex = findIndex(newEntity.Entities, (entity) => entity.Entity.Id === sub.Id);\r\n\t\t\t\t\tnewEntity.Entities[entityIndex].Entity = fieldEntities[sub.Id];\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tsub.friendlyIds = [newEntity.Id];\r\n\t\t\t\t\tfieldEntities[sub.Id] = sub;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.loadClassificationsIntoEntity(newEntity);\r\n\t\t\tthis.loadIdentifiersIntoEntity(newEntity);\r\n\r\n\t\t\tif(newEntity.Name === undefined) {\r\n\t\t\t\tnewEntity.Name = newEntity.Code;\r\n\t\t\t}\r\n\r\n\t\t\tif(!newEntity.Id) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tfieldEntities[newEntity.Id] = newEntity;\r\n\t\t});\r\n\r\n\t\treturn fieldEntities;\r\n\t}\r\n\r\n\tloadClassificationsIntoEntity(entity) {\r\n\t\tif(!entity) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!!entity.Classifications) {\r\n\t\t\tforEach(entity.Classifications, (classification, $index) => {\r\n\t\t\t\tentity.Classifications[$index] = this.classifications[classification.Code];\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(!!entity.Classification) {\r\n\t\t\tentity.Classification = this.classifications[entity.Classification.Code];\r\n\t\t}\r\n\t}\r\n\r\n\tloadIdentifiersIntoEntity(entity) {\r\n\t\tif(!entity) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!!entity.Identifiers) {\r\n\t\t\tforEach(entity.Identifiers, (identifier, $index) => {\r\n\t\t\t\t// entity.Identifiers[$index].Type.Code = identifier.Type.Code;\r\n\t\t\t\tif(!!IDENTIFIER_TYPES[identifier.Type.Code]) {\r\n\t\t\t\t\tentity.Identifiers[$index].Type.Name = IDENTIFIER_TYPES[identifier.Type.Code].name;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tentity.Identifiers[$index].Type.Name = \"NO NAME DEFINED\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tloadConfiguration(config) {\r\n\t\tif(config.Friendly) {\r\n\t\t\tif(config.Friendly.IncludeClassifications) {\r\n\t\t\t\tconfig.Friendly.IncludeClassifications = config.Friendly.IncludeClassifications.map((c) => {\r\n\t\t\t\t\treturn this.classifications[c];\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(config.Friendly.IncludeIdentifiers) {\r\n\t\t\t\tconfig.Friendly.IncludeIdentifiers = config.Friendly.IncludeIdentifiers.map((i) => {\r\n\t\t\t\t\treturn IDENTIFIER_TYPES[i];\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(config.Primary) {\r\n\t\t\tif(config.Primary.IncludeClassifications) {\r\n\t\t\t\tconfig.Primary.IncludeClassifications = config.Primary.IncludeClassifications.map((c) => {\r\n\t\t\t\t\treturn this.classifications[c];\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(config.Primary.IncludeIdentifiers) {\r\n\t\t\t\tconfig.Primary.IncludeIdentifiers = config.Primary.IncludeIdentifiers.map((i) => {\r\n\t\t\t\t\treturn IDENTIFIER_TYPES[i];\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.entity-manager-service\", [])\r\n\t.service(\"entityManager\", EntityManager).name;\r\n","import moment from \"moment\";\r\nimport {\r\n\tfind,\r\n\tfilter,\r\n\tsome,\r\n\tisEqual\r\n} from \"lodash\";\r\nimport template from \"./selection.html\";\r\nimport \"./selection.less\";\r\nimport swal from \"sweetalert2\";\r\nimport { alertDeactivatedSelection } from \"../../../../screens/edit-report/prompts\";\r\nimport {\r\n\tEVENT_FILTER_PRIMARYDATE,\r\n\tEVENT_REPORT_SAVED,\r\n\tEVENT_FILTER_CURRENT_OPTIONS,\r\n\tEVENT_FILTER_ALL_OPTIONS,\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_REPORT_LOCKED,\r\n\tEVENT_REPORT_UNLOCKED,\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_TIMEZONE_SET,\r\n\tEVENT_HOTKEY_LOCK,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_HANDLE_SUCCESSOR_LOCK,\r\n\tEVENT_ENABLE_SUCCESSOR_LOCK,\r\n\tEVENT_DISABLE_SUCCESSOR_LOCK,\r\n\tEVENT_SET_FORM_PRISTINE\r\n} from \"constants.js\";\r\nimport fieldHelpers from \"../../../field-helpers/lookup.config\";\r\nimport { IS_NOT_AVAILABLE_OPTIONS } from \"../../../../constants\";\r\nimport { UNIQUE_TIMEZONE_ERRORS } from \"../../../../services/entity-manager\";\r\nimport {\r\n\tnotifyMultipleEntityTimezoneError,\r\n\tnotifyNoEntityTimezoneError\r\n} from \"../../../../screens/edit-report/prompts\";\r\nimport { getSeasonsByEffectiveRanges } from \"../../../../utils/getSeasonsByEffectiveRanges\";\r\nimport { FORM_USER_FAVORITES } from \"routes\";\r\n\r\n// selection\r\nexport class Controller {\r\n\toptions = [];\r\n\tlookups = [];\r\n\tselection = { primary: {}, friendly: {} };\r\n\r\n\tconstructor(\r\n\t\t$scope, \r\n\t\teventBus, \r\n\t\tfeatureCallbacks, \r\n\t\ttoastr, \r\n\t\t$timeout, \r\n\t\t$logger, \r\n\t\tappState, \r\n\t\tfeatureHelper, \r\n\t\tentityManager, \r\n\t\tapi, \r\n\t\t$userProfile, \r\n\t\tloadingService\r\n\t) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.featureCallbacks = featureCallbacks;\r\n\t\tthis._toastr = toastr;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.appState = appState;\r\n\t\tthis.featureHelper = featureHelper;\r\n\t\tthis.entityManager = entityManager;\r\n\t\tthis.api = api;\r\n\t\tthis.$userProfile = $userProfile;\r\n\t\tthis.loadingService = loadingService;\r\n\t\tthis.runOnReady = [];\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.isFocused = false;\r\n\r\n\t\tthis.textFieldId = `textInput-${this.field.Id}`;\r\n\t\tthis.selectFieldId = `select-${this.field.Id}`;\r\n\r\n\t\tif(!this.subFieldCtrl) {\r\n\t\t\tthis._unregister = this.reportFormCtrl && this.reportFormCtrl.registerFieldController(this);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis._unregister = this.subFieldCtrl(this);\r\n\t\t}\r\n\r\n\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\t\tif(this.initialValue) {\r\n\t\t\tthis.initialValue.IsNotAvailable = !!this.initialValue.IsNotAvailable;\r\n\t\t\tthis.isNotAvailable = this.initialValue.IsNotAvailable;\r\n\t\t}\r\n\t\tthis.loadFieldData();\r\n\r\n\t\tthis.setAdvancedSearch();\r\n\r\n\t\tthis.registerForEvents();\r\n\r\n\t\tif(this.field.hasEffectiveRanges) {\r\n\t\t\tthis.registerPrimaryDateFilter();\r\n\t\t}\r\n\t}\r\n\r\n\tisItemFavorited = (item) => {\r\n\t\tif(item.IsFavorite) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(item.Entities?.length) {\r\n\t\t\treturn item.Entities.some(e => this.isItemFavorited(e.Entity));\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n\r\n\tloadFieldData = () => {\r\n\t\tif(this.field.IsFavoriteEnabled) {\r\n\t\t\tthis.field.options = this.field.Data.filter(this.isItemFavorited);\r\n\t\t\tconst initialValueInOptions = this.entityManager.findFriendlyByPrimaryId(this.field.options, this.initialValue?.DataId ?? this.initialValue?.EntityId);\r\n\t\t\tif(this.initialValue && initialValueInOptions === undefined && this.initialValue.String === undefined && !this.initialValue.IsNotAvailable) {\r\n\t\t\t\tconst initialDataItem = this.entityManager.findFriendlyByPrimaryId(this.field.Data, this.initialValue?.DataId ?? this.initialValue?.EntityId);\r\n\t\t\t\tif(initialDataItem === undefined) {\r\n\t\t\t\t\tthis.$logger.error(\"initial value is defined but not found in field data\", { value: this.initialValue });\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.field.options.push(initialDataItem);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.field.options = this.field.Data || [];\r\n\t\t}\r\n\r\n\t\tthis.field.options.forEach(o => o.IsRecent = (o.IsRecent || this.hasDescendentRecent(o.Entities)));\r\n\r\n\t\treturn this.field.options;\r\n\t};\r\n\r\n\tsetupCustomEntryFeature() {\r\n\t\tif(this.field.IsCustomEntryEnabled) {\r\n\t\t\tconst feature = this.featureHelper.getCustomInputFeature(this.field, this.isCustomInput, (selection) => this.setCustomInput(selection));\r\n\t\t\tthis.lookups.unshift(feature);\r\n\t\t}\r\n\t}\r\n\r\n\tsetupNotAvailableFeature(valueSet) {\r\n\t\tif(!this.isNotAvailableFeatureEnabled\r\n\t\t\t&& this.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.always)\r\n\t\t) {\r\n\t\t\tconst feature = this.featureHelper.getNotAvailableFeature(this.field, this.isNotAvailable || valueSet, (selection) => this.setNotAvailable(selection));\r\n\t\t\tthis.lookups.push(feature);\r\n\t\t\tthis.isNotAvailableFeatureEnabled = true;\r\n\t\t}\r\n\t}\r\n\r\n\tregisterForEvents() {\r\n\t\tthis._eventBus.register(EVENT_REPORT_SAVED, () => {\r\n\t\t\tif(this.field.IsRecentlyUsedEnabled) {\r\n\t\t\t\tthis.selectBox.setChoices();\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_FILTER_CURRENT_OPTIONS(this.field.Id), (e, params) => {\r\n\t\t\tif(this.field.isDisabled || (!params.readonly && this.isNotAvailable !== true)) {\r\n\t\t\t\tthis.field.isDisabled = false;\r\n\t\t\t\tthis.enableField();\r\n\t\t\t}\r\n\r\n\t\t\tthis.setOptions(params);\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_FILTER_ALL_OPTIONS(this.field.Id), (e, params) => {\r\n\t\t\tif(this.field.isDisabled) {\r\n\t\t\t\tthis.field.isDisabled = false;\r\n\t\t\t\tthis.enableField();\r\n\t\t\t}\r\n\r\n\t\t\tthis.setOptions(params);\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_VALUE(this.field.Id), (e, params) => {\r\n\t\t\tthis.setValue(params.value);\r\n\t\t\tthis.clearSelected();\r\n\r\n\t\t\tif(this.selection.primary) {\r\n\t\t\t\tthis.selectBox.setValue(this.selection.primary, this.selection.friendly);\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(this.field.isDisabled) {\r\n\t\t\t\tthis.field.isDisabled = true;\r\n\t\t\t\tthis.disableField();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.selection.isInitializedValue !== true) {\r\n\t\t\t\tthis.clearSelected();\r\n\t\t\t\tthis.setCurrentValue();\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REPORT_LOCKED, () => {\r\n\t\t\tthis.field.isReadonly = true;\r\n\t\t\tthis.disableField();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REPORT_UNLOCKED, () => {\r\n\t\t\tthis.enableField();\r\n\r\n\t\t\tif(this.isNotAvailable || this.isCustomInput) {\r\n\t\t\t\tthis.isNotAvailable && this.disableHelpers(fieldHelpers.NotAvailable.name);\r\n\t\t\t\tthis.isCustomInput && this.disableHelpers(fieldHelpers.CustomInput.name);\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_HOTKEY_LOCK, () => this.isFocused && this.field.IsLockable && (this.field.isLocked = !this.field.isLocked), this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_HANDLE_SUCCESSOR_LOCK(this.field.Id), (e, params) => {\r\n\t\t\tthis.field.isFieldLocakble = params.enable && this.field.IsLockable;\r\n\t\t\tif(this.field.isFieldLocakble !== true) {\r\n\t\t\t\tthis.field.isLocked = false;\r\n\t\t\t\tthis._eventBus.trigger(EVENT_DISABLE_SUCCESSOR_LOCK(this.field.Id));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis._eventBus.trigger(EVENT_ENABLE_SUCCESSOR_LOCK(this.field.Id));\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister && this._unregister();\r\n\t}\r\n\r\n\tenableField() {\r\n\t\tif(!this.field.isReadonly && !this.field.isDisabled && !this.isNotAvailable) {\r\n\t\t\tthis.selectBox.enable();\r\n\t\t\tthis.field.placeHolder = null;\r\n\t\t\tthis.enableHelpers();\r\n\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tthis._scope.$apply();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tdisableField() {\r\n\t\tif(this.field.isReadonly || this.field.isDisabled) {\r\n\t\t\tthis.selectBox.disable();\r\n\t\t\tthis.disableHelpers();\r\n\t\t}\r\n\t}\r\n\r\n\tdisableHelpers(exceptedName) {\r\n\t\tthis.enableHelpers();\r\n\t\tthis.lookups.forEach(l => {\r\n\t\t\tif(!exceptedName || l.name !== exceptedName) {\r\n\t\t\t\tl.disabled = true;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tenableHelpers() {\r\n\t\tthis.lookups.forEach(l => l.disabled = false);\r\n\t}\r\n\r\n\tregisterPrimaryDateFilter() {\r\n\t\tthis._eventBus.register(EVENT_FILTER_PRIMARYDATE, (e, params) => {\r\n\t\t\tthis.field.primaryDate = { date: params.date }; // date: { date: string | Date } \r\n\t\t\tif(!this.isCustomInput) {\r\n\t\t\t\tif(this.isReady) {\r\n\t\t\t\t\tthis.filterDataOnPrimaryDate(params.date, params.autoSelect);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.runOnReady.push(() => this.filterDataOnPrimaryDate(params.date, params.autoSelect));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\t}\r\n\r\n\tfilterDataOnPrimaryDate = (date, autoSelect, forceSelection) => {\r\n\t\tif(date) {\r\n\t\t\tthis.primaryDate = date;\r\n\t\t}\r\n\r\n\t\tconst selection = forceSelection ?? this.selection;\r\n\t\tif(!selection?.primary?.Id && forceSelection === undefined) {\r\n\t\t\tthis.setValue(undefined, true);\r\n\t\t}\r\n\r\n\t\tthis.featureCallbacks.nestedEntityDateFilter(selection.primary, this.primaryDate);\r\n\r\n\t\tthis.field.placeHolder = null;\r\n\r\n\t\tif(!this.initialValue?.EntityId) {\r\n\t\t\tthis.field.isDisabled = false;\r\n\t\t\tthis.enableField();\r\n\t\t}\r\n\r\n\t\tif(selection.primary.Id && selection.primary.valid !== true) {\r\n\t\t\tif(autoSelect === false) {\r\n\t\t\t\tthis._toastr.warning(\r\n\t\t\t\t\t`The currently selected ${this.field.EntityQueryConfiguration.Primary.Type.Name} is invalid for the selected date. Please select a new ${this.field.Name}.`, \r\n\t\t\t\t\t\"Warning\"\r\n\t\t\t\t);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tthis.featureCallbacks.nestedEntityDateFilter(selection.friendly, date?.date);\r\n\t\t\tconst validLicenses = selection.friendly.Entities.filter(e => e.Entity.valid);\r\n\t\t\tif(validLicenses.length !== 1) {\r\n\t\t\t\tthis.clearSelected();\r\n\t\t\t\tthis.setCurrentValue();\r\n\r\n\t\t\t\tthis._toastr.warning(`Unable to automatically select a ${this.field.EntityQueryConfiguration.Primary.Type.Name} for the selected date. Please select a ${this.field.Name}.`, \"Warning\");\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearSelected();\r\n\t\t\tthis.setCurrentValue(validLicenses[0].Entity, this.selection.friendly);\r\n\r\n\t\t\tthis._toastr.warning(`Selected ${this.field.EntityQueryConfiguration.Primary.Type.Name} was invalid for the selected date.\r\n\t\t\t\tSelected ${this.field.EntityQueryConfiguration.Primary.Type.Name} has been updated for the currently selected date.`, \"Warning\");\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\thasDescendentRecent = (primaries) => {\r\n\t\tconst areChildren = primaries?.some(p => p.Entity !== undefined);\r\n\t\tif(!areChildren) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst entities = primaries.map(p => p.Entity);\r\n\r\n\t\tentities.forEach(p => p.IsRecent = (p.IsRecent || this.hasDescendentRecent(p.Entities)));\r\n\t\t\r\n\t\treturn entities.some(p => p.IsRecent);\r\n\t};\r\n\r\n\tsetOptions(params) {\r\n\t\tthis.field.options = params?.ids ?\r\n\t\t\tfilter(this.field.Data, (d) => some(params.ids, (i) => d.Id === i || d.Entities?.some(e => e.Entity.Id === i))) :\r\n\t\t\tthis.loadFieldData();\r\n\r\n\t\tif(!this.isCustomInput && this.selection.primary && !some(this.field.options, (o) => o.Id === this.selection.primary.Id || o.Id === this.selection.friendly.Id)) {\r\n\t\t\tthis.clearSelected();\r\n\t\t\tthis.setCurrentValue();\r\n\t\t}\r\n\r\n\t\tthis.selectBox.setChoices(this.field.options);\r\n\t}\r\n\r\n\tclearSelected() {\r\n\t\tif(!this.isCustomInput && this.selectBox) {\r\n\t\t\tthis.selectBox.clearSelected();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.value = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tsetAdvancedSearch() {\r\n\t\tif(!this.field.isSelf) {\r\n\t\t\tthis.lookups.push({\r\n\t\t\t\tname: fieldHelpers.AdvancedSearch.name,\r\n\t\t\t\tfieldId: this.field.rootFieldId ?? this.field.Id,\r\n\t\t\t\thideCode: this.field.IsCodeHidden,\r\n\t\t\t\tdisabled: this.field.isDisabled || this.field.isReadonly,\r\n\t\t\t\toptions: {\r\n\t\t\t\t\tisFavoriteEnabled: this.field.IsFavoriteEnabled,\r\n\t\t\t\t\tmatchSpecificity: this.field.MatchSpecificity\r\n\t\t\t\t},\r\n\t\t\t\taction: this.handleAdvancedSearchAction\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\thandleAdvancedSearchAction = async(selection) => {\r\n\t\tif(selection === undefined) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(this.field.IsFavoriteEnabled) {\r\n\t\t\t// set favorite on api here. Currently we favorite the friendly entity.\r\n\t\t\tconst targetType = this.field.EntityQueryConfiguration.Friendly.Type.Code;\r\n\t\t\tconst relationshipType = \"SELF\";\r\n\t\t\tconst setFavorite = this.api.post(FORM_USER_FAVORITES(\r\n\t\t\t\tthis.appState.forms.selected.Id,\r\n\t\t\t\tthis.$userProfile.getUser().databaseId,\r\n\t\t\t\tselection.Id,\r\n\t\t\t\ttargetType,\r\n\t\t\t\trelationshipType\r\n\t\t\t));\r\n\t\t\tawait this.loadingService.watch(setFavorite);\r\n\r\n\t\t\tconst thisDataItem = this.field.Data.find(d => d.Id === selection.Id);\r\n\t\t\tthisDataItem.IsFavorite = true;\r\n\r\n\t\t\tthis.entityManager.updateEntity(thisDataItem);\r\n\t\t\tconst thisField = this.appState.forms.selected.Fields.find(f => f.Id === this.field.Id);\r\n\t\t\tconst thisItemIndex = thisField.Data.findIndex(d => d.Id === thisDataItem.Id);\r\n\t\t\tthisField.Data[thisItemIndex] = thisDataItem;\r\n\r\n\t\t\tthis.setOptions();\r\n\t\t}\r\n\r\n\t\tthis.selectBox.setDisplay(selection.Id);\r\n\t\tthis.selectBox.checkForPrimary();\r\n\t}\r\n\r\n\tisDirty(result) {\r\n\t\tconst dirty = this.field.IsNotReported !== true\r\n\t\t\t&& this.field.IsHidden !== true\r\n\t\t\t&& !this.field.isReadonly \r\n\t\t\t&& (!this.field.isDisabled || this.isNotAvailable)\r\n\t\t\t&& (((result && result.EntityId) !== (this.initialValue && this.initialValue.EntityId))\r\n\t\t\t\t|| (this.isCustomInput && this.initialValue && this.initialValue.String !== result.String)\r\n\t\t\t\t|| (this.isNotAvailable && this.initialValue && this.initialValue.IsNotAvailable !== result.IsNotAvailable)\r\n\t\t\t);\r\n\r\n\t\treturn dirty;\r\n\t}\r\n\r\n\tgetCurrentValue = (isApiCall = false) => {\r\n\t\tlet result = this.buildResult();\r\n\r\n\t\tif(!isApiCall) {\r\n\t\t\tif(!result) {\r\n\t\t\t\tresult = { FieldId: this.field.Id };\r\n\t\t\t\tresult.hasResultForRuleRun = false;\r\n\t\t\t}\r\n\t\t\tresult.isDirty = this.isDirty(result);\r\n\r\n\t\t\tconst getClassifications = (friendly, primary) => {\r\n\t\t\t\tconst classifications = [\r\n\t\t\t\t\t...(friendly && friendly.Classifications ? friendly.Classifications : []),\r\n\t\t\t\t\t...(friendly && friendly.Classification ? [friendly.Classification] : []),\r\n\t\t\t\t\t...(primary && primary.Classifications ? primary.Classifications : []),\r\n\t\t\t\t\t...(primary && primary.Classification ? [primary.Classification] : [])\r\n\t\t\t\t];\r\n\r\n\t\t\t\treturn classifications;\r\n\t\t\t};\r\n\r\n\t\t\tconst getSeasons = (entity) => {\r\n\t\t\t\tif(entity.Effective) {\r\n\t\t\t\t\treturn getSeasonsByEffectiveRanges(entity.Effective, this.appState.forms.selected.Seasons);\r\n\t\t\t\t}\r\n\t\t\t\treturn this.appState.forms.selected.Seasons;\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.isCustomInput && !this.isNotAvailable) {\r\n\t\t\t\tif(this.selection.primary.Id) {\r\n\t\t\t\t\tresult.Classifications = getClassifications(this.selection.friendly, this.selection.primary);\r\n\t\t\t\t\tresult._code = this.selection.primary.Code;\r\n\t\t\t\t\tresult.Identifiers = (this.selection.friendly.Identifiers || []).concat(this.selection.primary.Identifiers || []);\r\n\t\t\t\t\tresult.Seasons = getSeasons(this.selection.primary);\r\n\t\t\t\t}\r\n\t\t\t\telse if(this.selection.friendly.Id) {\r\n\t\t\t\t\tresult.Classifications = getClassifications(this.selection.friendly);\r\n\t\t\t\t\tresult._code = this.selection.friendly.Code;\r\n\t\t\t\t\tresult.Identifiers = (this.selection.friendly.Identifiers || []);\r\n\t\t\t\t\tresult.Seasons = getSeasons(this.selection.friendly);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\trevertValue() {\r\n\t\tthis.setValue(this.initialValue);\r\n\t\tthis.selectBox.refresh();\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\tif(this.isCustomInput === true && !!this.value) {\r\n\t\t\treturn {\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\tString: this.value\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if(this.isNotAvailable === true) {\r\n\t\t\treturn {\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\tIsNotAvailable: true\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn this.selection?.friendly?.Id || this.selection?.primary?.Id\r\n\t\t\t? {\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\tEntityId: this.selection.primary?.Id || this.selection.friendly.Id\r\n\t\t\t} : undefined;\r\n\t}\r\n\r\n\tsetPristine = () => {\r\n\t\tthis.initialValue = this.buildResult();\r\n\t}\r\n\r\n\tsetCurrentValue(primary, friendly, isInitializedValue) {\r\n\t\tconst newSelection = {\r\n\t\t\tprimary: primary || {},\r\n\t\t\tfriendly: friendly || {}\r\n\t\t};\r\n\r\n\t\tif(isInitializedValue) {\r\n\t\t\tnewSelection.isInitializedValue = true;\r\n\t\t}\r\n\r\n\t\tif(isEqual(this.selection, newSelection))\r\n\t\t\treturn;\r\n\r\n\t\tthis.selection = newSelection;\r\n\r\n\t\tthis.selectBox.setValue(this.selection.primary, this.selection.friendly, true);\r\n\r\n\t\tthis.handleValueChanged();\r\n\t}\r\n\t/**\r\n\t * \r\n\t * @param deactivatedDate {(string)}\r\n\t * @returns\r\n\t */\r\n\r\n\tisDeactivated = (deactivatedDate) => {\r\n\t\treturn !!deactivatedDate && moment(deactivatedDate).isBefore(moment());\r\n\t}\r\n\r\n\tsetSelectBox = (selectBox) => {\r\n\t\tthis.selectBox = selectBox;\r\n\r\n\t\tif(this.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.always)) {\r\n\t\t\tthis.setNotAvailable(this.isNotAvailable, true);\r\n\t\t}\r\n\r\n\t\tthis.setValue();\r\n\r\n\t\tif(!this.field.hasEffectiveRanges && this.field.options.length === 1) {\r\n\t\t\tthis.setDefaultEntity();\r\n\t\t}\r\n\r\n\t\tthis.setupCustomEntryFeature();\r\n\t\tthis.setupNotAvailableFeature();\r\n\t\t\r\n\t\tif(this.isCustomInput) {\r\n\t\t\tthis.disableHelpers(fieldHelpers.CustomInput.name);\r\n\t\t}\r\n\t\telse if(this.isNotAvailable) {\r\n\t\t\tthis.disableHelpers(fieldHelpers.NotAvailable.name);\r\n\t\t}\r\n\t\telse if(this.field.isDisabled || this.field.isReadonly) {\r\n\t\t\tthis.disableHelpers();\r\n\t\t}\r\n\t\t\r\n\t\tthis.isReady = true;\t\r\n\t\tthis.runOnReady.forEach(func => func());\r\n\t\tthis.runOnReady = [];\r\n\t};\r\n\r\n\tsetNotAvailable(selection, initializing = false) {\r\n\t\tif(selection !== undefined && selection === this.isNotAvailable) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.selection) {\r\n\t\t\tthis.selection = {};\r\n\t\t}\r\n\r\n\t\tthis.isNotAvailable = selection;\r\n\r\n\t\tif(this.isNotAvailable) {\r\n\t\t\tthis.clearSelected();\r\n\t\t\tthis.selection = null;\r\n\t\t\tthis.value = null;\r\n\t\t\tif(!this.isCustomInput) {\r\n\t\t\t\tthis.box && this.box.disable();\r\n\t\t\t}\r\n\t\t\tthis.field.isDisabled = true;\r\n\t\t\t!initializing && this.disableHelpers(fieldHelpers.NotAvailable.name);\r\n\t\t} \r\n\t\telse if(!this.field.isReadonly) {\r\n\t\t\tif(!this.isCustomInput) {\r\n\t\t\t\tthis.box && this.box.enable();\r\n\t\t\t\t!initializing && this.enableHelpers();\r\n\t\t\t}\r\n\t\t\tthis.field.isDisabled = false;\r\n\t\t}\r\n\t}\r\n\r\n\tsetValue(value, skipRangeCheck) {\r\n\t\tthis.value = value ? value : find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tlet friendly, primary, isDefaultValue;\r\n\r\n\t\tif(this.field.options.length === 1\r\n\t\t\t&& !!this.field.options[0].Entities\r\n\t\t\t&& this.field.options[0].Entities.length === 1\r\n\t\t\t&& (!this.field.options[0].Entities[0].Entity\r\n\t\t\t\t|| !this.field.options[0].Entities[0].Entity.Effective\r\n\t\t\t\t|| skipRangeCheck === true)\r\n\t\t) {\r\n\r\n\t\t\tfriendly = this.field.options[0];\r\n\t\t\tprimary = {};\r\n\t\t\tif(!this.field.isSelf) {\r\n\t\t\t\tprimary = friendly.Entities[0].Entity;\r\n\t\t\t\tisDefaultValue = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.value) {\r\n\t\t\tif(!!this.value.String && this.field.IsCustomEntryEnabled) {\r\n\t\t\t\tthis.value = this.value.String;\r\n\t\t\t\tthis.isCustomInput = true;\r\n\t\t\t\tthis.updateCustomInputState(true);\r\n\t\t\t\tthis.setCurrentValue({}, {});\r\n\t\t\t\tthis.selectBox.clearSelected();\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\telse if(this.field.isSelf) {\r\n\t\t\t\tfriendly = find(this.field.options, (o) => {\r\n\t\t\t\t\treturn o.Id == this.value.EntityId;\r\n\t\t\t\t}) || {};\r\n\r\n\t\t\t\tprimary = {};\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfriendly = find(this.field.options, (o) => {\r\n\t\t\t\t\treturn find(o.Entities, (e) => {\r\n\t\t\t\t\t\treturn e.Entity.Id == this.value.EntityId;\r\n\t\t\t\t\t});\r\n\t\t\t\t}) || {};\r\n\r\n\t\t\t\tprimary = (find(friendly.Entities, (e) => {\r\n\t\t\t\t\treturn e.Entity.Id == this.value.EntityId;\r\n\t\t\t\t}) || {}).Entity || {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!friendly || this.isNotAvailable) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.setCurrentValue(primary, friendly, isDefaultValue);\r\n\t}\r\n\r\n\tsetDefaultEntity(date) {\r\n\t\tif(this.field.Data.length === 1) {\r\n\t\t\tconst friendly = this.field.Data[0];\r\n\r\n\t\t\tlet validEntities;\r\n\t\t\tif(!!date) {\r\n\t\t\t\tthis.featureCallbacks.nestedEntityDateFilter(friendly, date.date);\r\n\t\t\t\tvalidEntities = filter(friendly.Entities, (d) => d.Entity.valid);\r\n\t\t\t} else {\r\n\t\t\t\tvalidEntities = friendly.Entities;\r\n\t\t\t}\r\n\r\n\t\t\tif(validEntities && validEntities.length === 1) {\r\n\t\t\t\tif(this.selection.primary) {\r\n\t\t\t\t\tthis.clearSelected();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst primary = validEntities[0].Entity || {};\r\n\t\t\t\tthis.selectBox.setValue(primary, friendly, true);\r\n\t\t\t\tthis.setPrimarySwitcherButton(validEntities);\r\n\t\t\t\tthis.selectionChanged({ primary, friendly }, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandleLookupSelection(lookup) {\r\n\t\tlookup.action(lookup.selection);\r\n\t}\r\n\r\n\tselectionChanged(selection, isInitializedValue) {\r\n\t\tif(selection) {\r\n\t\t\tif(this.isDeactivated(selection.primary.DeactivatedAt) || this.isDeactivated(selection.friendly.DeactivatedAt)) {\r\n\t\t\t\talertDeactivatedSelection(selection.friendly.Name || selection.primary.Type.Name || \"\");\r\n\t\t\t\tthis.setCurrentValue({}, {});\r\n\t\t\t\tthis.clearSelected();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst wasUpdated = this.filterDataOnPrimaryDate(undefined, true, selection);\r\n\r\n\t\t\tif(!wasUpdated) {\r\n\t\t\t\tthis.setCurrentValue(selection.primary, selection.friendly, isInitializedValue);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.setCurrentValue({}, {});\r\n\t\t\tthis.clearSelected();\r\n\t\t}\r\n\t}\r\n\r\n\tsetCustomInput(featureActive) {\r\n\t\tif(!featureActive) {\r\n\t\t\tthis.selection = {};\r\n\t\t}\r\n\r\n\t\tif(featureActive) {\r\n\t\t\tthis.showCustomInputWarning();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.isCustomInput = false;\r\n\t\t\tthis.enableHelpers();\r\n\t\t}\r\n\t}\r\n\r\n\tasync showCustomInputWarning() {\r\n\t\tconst self = this;\r\n\t\tconst userAction = await swal.fire({\r\n\t\t\ttitle: \"Warning!\",\r\n\t\t\thtml:\r\n\t\t\t\t`You are attempting to enable Custom Input mode for a selection field.\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\tPlease note that any text entered in this field will not associate to any items in the list, even if the text matches exactly.\r\n\t\t\t\t\tThis mode is only intended for situations in which the correct value is not present in the list.\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\tAre you sure you want to do that?`,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\",\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Yes, do it!\",\r\n\t\t\tfocusCancel: true,\r\n\t\t\treverseButtons: true\r\n\t\t})\r\n\t\t\t.catch(err => this.$logger.error(err));\r\n\r\n\t\tif(userAction.dismiss) {\r\n\t\t\tthis.updateCustomInputState(false);\r\n\t\t\tthis.isCustomInput = false;\r\n\r\n\t\t\tthis.$timeout(function() {\r\n\t\t\t\twindow.document.getElementById(self.selectFieldId).focus();\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.clearSelected();\r\n\t\t\tthis.isCustomInput = true;\r\n\t\t\tthis.selection = null;\r\n\t\t\tthis.value = null;\r\n\t\t\tthis.disableHelpers(fieldHelpers.CustomInput.name);\r\n\t\r\n\t\t\tthis.$timeout(function() {\r\n\t\t\t\tconst txt = window.document.getElementById(self.textFieldId);\r\n\t\t\t\t\r\n\t\t\t\ttxt.focus();\r\n\t\t\t\ttxt.select();\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis._scope.$apply();\r\n\t}\r\n\r\n\tupdateCustomInputState(newState) {\r\n\t\tconst inputLookup = find(this.lookups, (lookup) => lookup.name === fieldHelpers.CustomInput.name);\r\n\t\tif(inputLookup) {\r\n\t\t\tinputLookup.selection = newState;\r\n\t\t}\r\n\t}\r\n\r\n\thandleValueChanged() {\r\n\t\tconst ctrl = this;\r\n\r\n\t\tconst found = find(this.field.options, { Id: (this.selection.friendly || {}).Id });\r\n\r\n\t\tif(this.selection.primary && this.selection.primary.Id) {\r\n\t\t\tthis.setPrimarySwitcherButton(found.Entities.filter((entity) => entity.Entity.valid));\r\n\t\t}\r\n\t\telse if(!(this.selection.primary || {}).Id && !(this.selection.friendly || {}).Id) {\r\n\t\t\tthis.setPrimarySwitcherButton(null);\r\n\t\t}\r\n\r\n\t\tif(!!this.isReady) {\r\n\t\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(ctrl.field.Id), {\r\n\t\t\t\tfield: ctrl.field,\r\n\t\t\t\tvalue: found,\r\n\t\t\t\tprimary: ctrl.selection.primary\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.runOnReady.push(() => this._eventBus.trigger(EVENT_VALUE_CHANGED(ctrl.field.Id), {\r\n\t\t\t\tfield: ctrl.field,\r\n\t\t\t\tvalue: found,\r\n\t\t\t\tprimary: ctrl.selection.primary\r\n\t\t\t}));\r\n\t\t}\r\n\r\n\t\tif(this.field.setEntityTimezone === true && (this.selection.primary?.Id || this.selection.friendly?.Id)) {\r\n\t\t\tconst timezoneCode = this.entityManager.getUniqueTimezoneForEntity(this.field.Id, this.selection.primary?.Id ?? this.selection.friendly?.Id);\r\n\t\t\tif(timezoneCode === UNIQUE_TIMEZONE_ERRORS.MULTIPLE) {\r\n\t\t\t\tnotifyMultipleEntityTimezoneError(this.field.Name);\r\n\t\t\t\tthrow new Error(\"Selected entity has multiple available timezones in ByEntity configuration\");\r\n\t\t\t}\r\n\t\t\telse if(timezoneCode === UNIQUE_TIMEZONE_ERRORS.ZERO) {\r\n\t\t\t\tnotifyNoEntityTimezoneError(this.field.Name);\r\n\t\t\t\tthrow new Error(\"Selected entity has no available timezones in ByEntity configuration\");\r\n\t\t\t} \r\n\r\n\t\t\tthis._eventBus.trigger(EVENT_TIMEZONE_SET(ctrl.field.Id), { value: timezoneCode });\r\n\t\t}\r\n\r\n\t\tconst result = this.buildResult();\r\n\t\tconst isDirty = this.isDirty(result);\r\n\r\n\t\tthis.setFieldDirty(this.field.Id, isDirty);\r\n\t}\r\n\r\n\tsetPrimarySwitcherButton(entities) {\r\n\t\tthis.showPrimarySwitcher = entities && entities.length > 1 && !this.isCustomInput;\r\n\t}\r\n\r\n\tswitchPrimary() {\r\n\t\tthis.selectBox.switchPrimary();\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.selection\", [])\r\n\t.component(\"selection\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tpivotRow: \"=\",\r\n\t\t\tpivotColumn: \"=\",\r\n\t\t\tsubFieldCtrl: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: { reportFormCtrl: \"?^reportForm\" }\r\n\t}).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t--empty--\\r\\n\\t\\t

\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\";","import moment from \"moment\";\r\nimport {\r\n\tfind,\r\n\tfindIndex,\r\n\tfilter,\r\n\tsome,\r\n\tforEach,\r\n\tintersectionWith\r\n} from \"lodash\";\r\nimport template from \"./simple-selection.html\";\r\nimport \"./simple-selection.less\";\r\nimport {\r\n\tEVENT_REPORT_SAVED,\r\n\tEVENT_FIELD_DISABLE,\r\n\tEVENT_FILTER_CURRENT_OPTIONS,\r\n\tEVENT_FILTER_ALL_OPTIONS,\r\n\tEVENT_REMOVE_OPTIONS,\r\n\tEVENT_LOAD_OPTIONS,\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_REPORT_LOCKED,\r\n\tEVENT_REPORT_UNLOCKED,\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_UNCLEAR_VALUE,\r\n\tEVENT_HOTKEY_LOCK,\r\n\tEVENT_HANDLE_SUCCESSOR_LOCK,\r\n\tEVENT_ENABLE_SUCCESSOR_LOCK,\r\n\tEVENT_DISABLE_SUCCESSOR_LOCK,\r\n\tFEATURE_TYPES,\r\n\tPIVOT_TYPES,\r\n\tEVENT_EXPAND_MULTI_ENTRY_LIST,\r\n\tEVENT_TIMEZONE_SET,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_SET_FORM_PRISTINE,\r\n\tEVENT_FILTER_PRIMARYDATE\r\n} from \"constants.js\";\r\nimport swal from \"sweetalert2\";\r\nimport { FORM_USER_FAVORITES } from \"routes\";\r\n\r\nimport {\r\n\tENGINE_EVALUATIONS,\r\n\tENGINE_TYPES\r\n} from \"../../../../screens/rule-provider/constants\";\r\nimport fieldHelpers from \"../../../field-helpers/lookup.config\";\r\nimport { IS_NOT_AVAILABLE_OPTIONS } from \"../../../../constants\";\r\nimport {\r\n\talertDeactivatedSelection,\r\n\tnotifyMultipleEntityTimezoneError,\r\n\tnotifyNoEntityTimezoneError \r\n} from \"../../../../screens/edit-report/prompts\";\r\nimport { UNIQUE_TIMEZONE_ERRORS } from \"../../../../services/entity-manager\";\r\nexport class Controller {\r\n\toptions = [];\r\n\tlookups = [];\r\n\tuiHelpers = null;\r\n\r\n\tconstructor(\r\n\t\t$scope, \r\n\t\teventBus, \r\n\t\tuiHelpers, \r\n\t\tfeatureHelper, \r\n\t\t$timeout, \r\n\t\tentityManager, \r\n\t\t$window, \r\n\t\t$element, \r\n\t\t$logger, \r\n\t\tappState, \r\n\t\tfeatureCallbacks, \r\n\t\ttoastr, \r\n\t\tapi, \r\n\t\t$userProfile, \r\n\t\tloadingService\r\n\t) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.uiHelpers = uiHelpers;\r\n\t\tthis.featureHelper = featureHelper;\r\n\t\tthis.filteredData = {};\r\n\t\tthis.entityManager = entityManager;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$element = $element;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.appState = appState;\r\n\t\tthis.featureCallbacks = featureCallbacks;\r\n\t\tthis._toastr = toastr;\r\n\t\tthis.api = api;\r\n\t\tthis.$userProfile = $userProfile;\r\n\t\tthis.loadingService = loadingService;\r\n\t\tthis.runOnReady = [];\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.cleared = undefined;\r\n\r\n\t\tthis.textFieldId = `textInput-${this.field.Id}`;\r\n\t\tthis.selectFieldId = `select-${this.field.Id}`;\r\n\r\n\t\tthis.field.showExpand = false;\r\n\t\tthis.isFocused = false;\r\n\t\tthis.setOptionIdType();\r\n\r\n\t\tthis.registerEvents();\r\n\r\n\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\t\tthis.initialValue && (this.initialValue.IsNotAvailable = !!this.initialValue.IsNotAvailable); //coerce isnotavailable to false if it doesn't exist\r\n\r\n\t\tif(this.isThisValueInNewForm() || this.initialValue) {\r\n\t\t\tthis.setValue();\r\n\t\t}\r\n\t\tif(this.isThisValueInNewForm()) {\r\n\t\t\tthis.setPristine();\r\n\t\t}\r\n\r\n\t\tthis.loadFieldData();\r\n\r\n\t\tthis.initialValueSet = true;\r\n\t\tthis.setFeatures();\r\n\r\n\t\tthis.hasHelperButtons = !!this.lookups.length;\r\n\r\n\t\tthis._scope.$watch(\r\n\t\t\t() => this.field.filters,\r\n\t\t\t(next) => {\r\n\t\t\t\tconst self = this;\r\n\t\t\t\tif(next && Object.getOwnPropertyNames(next).length > 0) {\r\n\t\t\t\t\tObject.keys(next).map((key) => {\r\n\t\t\t\t\t\tif(Object.prototype.hasOwnProperty.call(next, key)) {\r\n\t\t\t\t\t\t\tself.updateFilteredData(key, next[key] && next[key][0]._code);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.filterOptions();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\tif(this.field.Pivot && this.field.Pivot !== PIVOT_TYPES.Repeat) {\r\n\t\t\tconst self = this;\r\n\t\t\tthis._scope.$watch(\r\n\t\t\t\t() => (self.options.length > 1) && !self.field.isDisabled && !self.field.isReadonly && (self.$window.innerWidth > 992),\r\n\t\t\t\t(next) => {\r\n\t\t\t\t\tlet show = next;\r\n\r\n\t\t\t\t\tif(self.field.Pivot === PIVOT_TYPES.RecentlyUsed) {\r\n\t\t\t\t\t\tconst hasSomeRecents = some(self.options, o => o.IsRecent === true);\r\n\t\t\t\t\t\tshow = show && hasSomeRecents;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.field.showExpand = show;\r\n\t\t\t\t\tself.hasHelperButtons = !!self.lookups.length || (self.field.showExpand && self.field.allowPivot);\r\n\t\t\t\t},\r\n\t\t\t\ttrue\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tisItemFavorited = (item) => {\r\n\t\tif(item.IsFavorite) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(item.Entities?.length) {\r\n\t\t\treturn item.Entities.some(e => this.isItemFavorited(e.Entity));\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n\r\n\tloadFieldData = () => {\r\n\t\tif(this.field.IsFavoriteEnabled) {\r\n\t\t\tthis.options = this.field.Data.filter(this.isItemFavorited);\r\n\t\t\tconst hasInitialValue = this.options.some(o => o.Id === this.initialValue?.DataId || o.Id === this.initialValue?.EntityId);\r\n\t\t\tif(this.initialValue && !hasInitialValue && this.initialValue.String === undefined && !this.initialValue.IsNotAvailable) {\r\n\t\t\t\tconst initialDataItem = this.field.Data.find(d => d.Id === this.initialValue?.DataId || d.Id === this.initialValue?.EntityId);\r\n\t\t\t\tthis.options.push(initialDataItem);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.options = this.field.Data || [];\r\n\t\t}\r\n\r\n\t\treturn this.options;\r\n\t};\r\n\r\n\tisSelectionValid = (selection) => selection?.Id !== undefined && selection?.Id !== null;\r\n\r\n\tisThisValueInNewForm = () => {\r\n\t\tif(this.field.IsDetail) {\r\n\t\t\treturn this.values === undefined;\r\n\t\t}\r\n\t\t\r\n\t\treturn !!this.appState.isNewReport;\r\n\t};\r\n\r\n\tregisterEvents() {\r\n\t\tconst ctrl = this;\r\n\t\tif(!this.subFieldCtrl) {\r\n\t\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis._unregister = this.subFieldCtrl(this);\r\n\t\t}\r\n\r\n\t\tthis._eventBus.register(EVENT_REPORT_SAVED, () => {\r\n\t\t\tif(this.field.IsRecentlyUsedEnabled) {\r\n\t\t\t\tthis.box.setChoices();\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_FILTER_CURRENT_OPTIONS(this.field.Id), (e, params) => {\r\n\t\t\tif(!params.readonly && this.isNotAvailable !== true) {\r\n\t\t\t\tthis.field.isDisabled = false;\r\n\t\t\t\tthis.enableField();\r\n\t\t\t}\r\n\t\t\tthis.setOptions(params);\r\n\t\t\tif(params.readonly) {\r\n\t\t\t\tthis.field.isDisabled = true;\r\n\t\t\t\tthis.disableField();\r\n\t\t\t\tthis.triggerValueChanged(null);\r\n\t\t\t}\r\n\t\t\telse if(((this.isSelectionValid(ctrl.selection) || this.isNotAvailable === true) && params.forceTrigger) || params.clear) {\r\n\t\t\t\tthis.triggerValueChanged(ctrl.selection);\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_FILTER_ALL_OPTIONS(this.field.Id), (e, params) => {\r\n\t\t\tthis.field.isDisabled = false;\r\n\t\t\tthis.enableField();\r\n\r\n\t\t\tthis.setOptions(params);\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_HOTKEY_LOCK, () => {\r\n\t\t\treturn ctrl.isFocused && ctrl.field.IsLockable && (ctrl.field.isLocked = !ctrl.field.isLocked);\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_HANDLE_SUCCESSOR_LOCK(this.field.Id), (e, params) => {\r\n\t\t\tthis.field.isFieldLockable = params.enable && this.field.IsLockable;\r\n\t\t\tif(this.field.isFieldLockable !== true) {\r\n\t\t\t\tthis.field.isLocked = false;\r\n\t\t\t\tthis._eventBus.trigger(EVENT_DISABLE_SUCCESSOR_LOCK(this.field.Id));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.triggerLockUpdate();\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REMOVE_OPTIONS(this.field.Id), (e, params) => {\r\n\t\t\tthis.removeOptions(params.items);\r\n\t\t\tthis._scope.$apply();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_LOAD_OPTIONS(this.field.Id), (e, params) => {\r\n\t\t\tconst dataItems = params?.data || [];\r\n\t\t\tif(!this.isSelectionValid(this.selection)) {\r\n\t\t\t\tthis.field.isDisabled = false;\r\n\t\t\t\tthis.enableField();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconst newOptionIds = (Array.isArray(dataItems) && dataItems.map((item) => item.Id)) || null;\r\n\t\t\t\tif(!newOptionIds || newOptionIds.indexOf(this.selection.Id) < 0) {\r\n\t\t\t\t\tthis.clearSelected();\r\n\t\t\t\t\tthis.selection = {};\r\n\t\t\t\t\tthis.isNotAvailable = false;\r\n\t\t\t\t\tthis.value = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.field.Data = dataItems;\r\n\t\t\tthis.setChoices(dataItems);\r\n\t\t\tconst activeParams = dataItems.filter(param => param.IsActive !== false);\r\n\t\t\tif(activeParams.length === 1 && !params.suppressAutoselect) {\r\n\t\t\t\tthis.value = activeParams[0].Id;\r\n\t\t\t\tthis.setChoice(activeParams[0]);\r\n\t\t\t}\r\n\t\t\telse if(dataItems.length > 1) {\r\n\t\t\t\tconst selection = find(dataItems, (param) => param.Id === this.value);\r\n\t\t\t\tthis.setChoice(selection);\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_VALUE(this.field.Id), (_, params) => {\r\n\t\t\tthis.setValue(params.value);\r\n\t\t\tif(this.isSelectionValid(this.selection)) {\r\n\t\t\t\tthis.field.isDisabled = false;\r\n\t\t\t\tthis.enableField();\r\n\t\t\t\tthis.setChoice(this.selection);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.clearSelected();\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), (_, params) => {\r\n\t\t\tif(!this.cleared && (this.value !== undefined || !!this.isSelectionValid(this.selection) || !!this.isNotAvailable || !!this.isCustomInput)) {\r\n\t\t\t\tthis.cleared = {\r\n\t\t\t\t\tvalue: this.value,\r\n\t\t\t\t\tselection: this.selection,\r\n\t\t\t\t\tisNotAvailable: this.isNotAvailable,\r\n\t\t\t\t\tisCustomInput: this.isCustomInput\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.clearSelected();\r\n\t\t\t\tthis.selection = {};\r\n\t\t\t\tif(this.isCustomInput && !this.field.isLocked) {\r\n\t\t\t\t\tthis.setCustomInput(false);\r\n\t\t\t\t\tconst customHelper = find(this.lookups, l => l.name === fieldHelpers.CustomInput.name);\r\n\t\t\t\t\tcustomHelper && (customHelper.selection = false);\r\n\t\t\t\t}\r\n\t\t\t\tthis.isNotAvailable = false;\r\n\t\t\t\tthis.value = null;\r\n\r\n\t\t\t\tthis.updateFieldDirty();\r\n\r\n\t\t\t\tif(params.isInitializing && (!!this.appState.isNewReport || this.initialValue)) {\r\n\t\t\t\t\tthis.setValue();\r\n\t\t\t\t\tthis.setChoice(this.selection);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_UNCLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!!this.cleared) {\r\n\t\t\t\tthis.selection = this.cleared.selection;\r\n\r\n\t\t\t\tif(this.cleared.isCustomInput && !this.field.isLocked) {\r\n\t\t\t\t\tthis.isCustomInput = this.cleared.isCustomInput;\r\n\t\t\t\t\tconst customHelper = find(this.lookups, l => l.name === fieldHelpers.CustomInput.name);\r\n\t\t\t\t\tcustomHelper && (customHelper.selection = this.cleared.isCustomInput);\r\n\t\t\t\t}\r\n\t\t\t\tthis.isNotAvailable = this.cleared.isNotAvailable;\r\n\t\t\t\tthis.value = this.cleared.value;\r\n\t\t\t\tthis.setChoice(this.selection, true);\r\n\r\n\t\t\t\tthis.cleared = undefined;\r\n\r\n\t\t\t\tthis.updateFieldDirty();\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_FIELD_DISABLE(this.field.Id), () => {\r\n\t\t\tthis.field.isDisabled = true;\r\n\t\t\tthis.disableField();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REPORT_LOCKED, () => {\r\n\t\t\tthis.field.isReadonly = true;\r\n\t\t\tthis.disableField();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REPORT_UNLOCKED, () => {\r\n\t\t\tthis.enableField();\r\n\r\n\t\t\tif(this.isNotAvailable || this.isCustomInput) {\r\n\t\t\t\tthis.isNotAvailable && this.disableHelpers(fieldHelpers.NotAvailable.name);\r\n\t\t\t\tthis.isCustomInput && this.disableHelpers(fieldHelpers.CustomInput.name);\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\r\n\t\tif(this.field.EntityQueryConfiguration?.Friendly?.IncludeEffectiveRanges ?? this.field.EntityQueryConfiguration?.Primary?.IncludeEffectiveRanges) {\r\n\t\t\tthis._eventBus.register(EVENT_FILTER_PRIMARYDATE, (e, params) => {\r\n\t\t\t\tthis.field.primaryDate = { date: params.date }; // date: { date: string | Date } \r\n\r\n\t\t\t\tif(this.isReady) {\r\n\t\t\t\t\tthis.filterDataOnPrimaryDate(params.date, params.autoSelect);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.runOnReady.push(() => this.filterDataOnPrimaryDate(params.date, params.autoSelect));\r\n\t\t\t\t}\r\n\t\t\t}, this._scope);\r\n\t\t}\r\n\t}\r\n\r\n\ttriggerLockUpdate() {\r\n\t\tconst event = this.field.isLocked ? EVENT_ENABLE_SUCCESSOR_LOCK(this.field.Id) : EVENT_DISABLE_SUCCESSOR_LOCK(this.field.Id);\r\n\t\tthis._eventBus.trigger(event);\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister && this._unregister();\r\n\t}\r\n\r\n\tenableField() {\r\n\t\tif(!this.field.isDisabled && !this.field.isReadonly && !this.isNotAvailable) {\r\n\t\t\tthis.field.placeHolder = null;\r\n\t\t\tthis.box && this.box.enable();\r\n\t\t\tthis.enableHelpers();\r\n\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tthis._scope.$apply();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tdisableField() {\r\n\t\tif(this.field.isDisabled || this.field.isReadonly) {\r\n\t\t\tthis.box.disable();\r\n\t\t\tthis.disableHelpers();\r\n\t\t}\r\n\t}\r\n\r\n\tsetDisplay(id) {\r\n\t\tconst item = find(this.options, { Id: parseInt(id) });\r\n\r\n\t\tif(!item) {\r\n\t\t\tthrow new Error(`Selected ${this.field.Name} not found as an option.`);\r\n\t\t}\r\n\r\n\t\tthis.hasSecondRowDirective = !!this.field.RenderingDirectives?.Display?.Selected?.[2];\r\n\t\tconst selectedItemDirectives = {\r\n\t\t\t\"hidden-print\": this.field.RenderingDirectives?.Display?.Selected,\r\n\t\t\t\"not-printing-hidden\": this.field.RenderingDirectives?.Print ?? this.field.RenderingDirectives?.Display?.Selected\r\n\t\t};\r\n\r\n\t\tconst entityDisplay = this.uiHelpers.getEntityDisplay(item, undefined, true, true, selectedItemDirectives);\r\n\r\n\t\treturn entityDisplay;\r\n\t}\r\n\r\n\tsetBox(box) {\r\n\t\tthis.box = box;\r\n\r\n\t\tif(this.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.always)) {\r\n\t\t\tthis.setNotAvailable(this.isNotAvailable, true);\r\n\t\t}\r\n\r\n\t\tthis.setOptions();\r\n\r\n\t\tif(this.isSelectionValid(this.selection)) {\r\n\t\t\tthis.setChoice(this.selection);\r\n\t\t}\r\n\r\n\t\tif(this.shouldFilterPrimaryOnStart !== undefined) {\r\n\t\t\tthis.filterDataOnPrimaryDate(this.shouldFilterPrimaryOnStart.date, this.shouldFilterPrimaryOnStart.autoSelect);\r\n\t\t\tthis.shouldFilterPrimaryOnStart = undefined;\r\n\t\t}\r\n\r\n\t\tthis.isReady = true;\r\n\t\tthis.runOnReady.forEach(func => func());\r\n\t\tthis.runOnReady = [];\r\n\t}\r\n\r\n\tsetOptions(params) {\r\n\t\tif((params || {}).clear) {\r\n\t\t\tthis.options = [];\r\n\t\t\tthis.filterEnableNA = false;\r\n\t\t}\r\n\t\telse if(params?.ids) {\r\n\t\t\tthis.options = filter(this.field.Data, (d) => some(params.ids, (i) => d.Id === i));\r\n\t\t\tthis.filterEnableNA = some(params.ids, o => o === \"$[NA]$\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.loadFieldData();\r\n\t\t\tthis.filterEnableNA = this.isNotAvailable;\r\n\t\t}\r\n\r\n\t\tthis.postOptionsChange((params || {}).isFromInitialValue);\r\n\t}\r\n\r\n\tremoveOptions(opts) {\r\n\t\tif(opts && opts.length && opts.length > 0) {\r\n\t\t\tthis.options = this.options.filter(o => opts.indexOf(o.Id) < 0 || (this.selection && o.Id === this.selection.Id));\r\n\t\t\tthis.postOptionsChange();\r\n\t\t}\r\n\t}\r\n\r\n\tupdateFilteredData(type, value) {\r\n\t\tif(value) {\r\n\t\t\tconst compareTo = {};\r\n\t\t\tcompareTo.value = parseInt(value);\r\n\r\n\t\t\tconst filteredData = filter(this.field.Data, (d) => {\r\n\t\t\t\treturn ENGINE_EVALUATIONS[ENGINE_TYPES.COMPARE.function][type]([parseInt(d.Code)], compareTo);\r\n\t\t\t});\r\n\r\n\t\t\tthis.filteredData[type] = filteredData;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.filteredData[type] = this.field.Data;\r\n\t\t}\r\n\t}\r\n\r\n\tfilterOptions() {\r\n\t\tconst filteredDataArray = [];\r\n\t\tObject.keys(this.filteredData).map((key) => {\r\n\t\t\tif(Object.prototype.hasOwnProperty.call(this.filteredData, key)) {\r\n\t\t\t\tfilteredDataArray.push(this.filteredData[key]);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tfilteredDataArray.push((optionOne, optionTwo) => {\r\n\t\t\treturn optionOne.Code === optionTwo.Code;\r\n\t\t});\r\n\r\n\t\tthis.options = intersectionWith.apply(null, filteredDataArray);\r\n\r\n\t\tthis.postOptionsChange();\r\n\t}\r\n\r\n\tpostOptionsChange(initializing) {\r\n\t\tif(this.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.supported)) {\r\n\t\t\tif(this.filterEnableNA !== true) {\r\n\t\t\t\tthis.forcedNA = false;\r\n\t\t\t\tthis.removeIsNotAvailableFeature();\r\n\t\t\t\tif(this.options && this.options.length > 0 && !this.field.isReadonly) {\r\n\t\t\t\t\tthis.box && this.box.enable();\r\n\t\t\t\t\tthis.enableHelpers();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(this.options === undefined || this.options.length === 0) {\r\n\t\t\t\tthis.forcedNA = true;\r\n\t\t\t\tthis.setupIsNotAvailableFeature(true, true);\r\n\r\n\t\t\t\tthis.setNotAvailable(true, true);\r\n\t\t\t\tthis.updateNotAvailableState(true);\r\n\t\t\t\tthis.disableHelpers();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(this.forcedNA) {\r\n\t\t\t\t\tthis.isNotAvailable = false;\r\n\t\t\t\t}\r\n\t\t\t\tthis.setupIsNotAvailableFeature(true, false);\r\n\t\t\t\tconst retainValue = this.isNotAvailableFeatureEnabled || initializing;\r\n\t\t\t\t!this.field.isReadonly && this.enableHelpers();\r\n\r\n\t\t\t\tthis.setNotAvailable(this.isNotAvailable && !!retainValue, true);\r\n\t\t\t\tthis.updateNotAvailableState(this.isNotAvailable && !!retainValue);\r\n\t\t\t\tthis.forcedNA = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(this.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.never)) {\r\n\t\t\tthis.isNotAvailable = false;\r\n\t\t\tthis.setNotAvailable(false);\r\n\t\t\tthis.removeIsNotAvailableFeature();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.setNotAvailable(this.isNotAvailable);\r\n\t\t\tthis.updateNotAvailableState(this.isNotAvailable);\r\n\t\t}\r\n\r\n\t\tif(!this.isCustomInput && this.isSelectionValid(this.selection) && !some(this.options, (o) => o.Id === this.selection.Id)) {\r\n\t\t\tthis.clearSelected();\r\n\t\t\tthis.selection = {};\r\n\r\n\t\t\tthis.value = undefined;\r\n\t\t\tthis.handleValueChanged();\r\n\t\t}\r\n\r\n\t\tthis.setChoices();\r\n\r\n\t\tif(\r\n\t\t\t(this.options || []).length === 1 \r\n\t\t\t&& this.isNotAvailable !== true \r\n\t\t\t&& this.isCustomInput !== true\r\n\t\t\t&& this.field.visible !== false\r\n\t\t) {\r\n\t\t\tconst newSelection = this.options[0];\r\n\t\t\tif(newSelection?.Id !== this.selection?.Id) {\r\n\t\t\t\tthis.selection = newSelection;\r\n\t\t\t\tthis.filterEnableNA && this.setNotAvailable(false);\r\n\t\t\t\tthis.filterEnableNA && this.updateNotAvailableState(false);\r\n\r\n\t\t\t\tthis.value = this.selection.Id;\r\n\t\t\t\tthis.setChoice(this.selection);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearSelected() {\r\n\t\tif(!this.isCustomInput && this.box) {\r\n\t\t\tconst values = this.box.getValue(true);\r\n\t\t\tthis.box.removeItemsByValue(values);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.value = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tsetChoice(choice, silent = false) {\r\n\t\tif(this.isSelectionValid(choice)) {\r\n\t\t\tif(choice.IsActive === false) {\r\n\t\t\t\tconst deletedChoice = this.uiHelpers.setDisplay(\r\n\t\t\t\t\t[choice], \r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\trecentlyUsedEnabled: this.field.IsRecentlyUsedEnabled, \r\n\t\t\t\t\t\thideCode: this.field.IsCodeHidden \r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t\tconst currentValue = this.box.getValue(true);\r\n\t\t\t\tif(deletedChoice[0].value != currentValue) {\r\n\t\t\t\t\tthis.box && this.box.setChoices(deletedChoice, \"value\", \"label\", false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.box && this.box.setValueByChoice(choice.Id.toString());\r\n\t\t}\r\n\t\tif(!silent) {\r\n\t\t\tthis.handleValueChanged();\r\n\t\t}\r\n\t}\r\n\r\n\tsetChoices(data) {\r\n\t\tif(data) {\r\n\t\t\tthis.options = data;\r\n\t\t}\r\n\r\n\t\tif(!this.options || !Array.isArray(this.options)) {\r\n\t\t\tthis.box.clearStore();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst activeOptions = this.options.filter((option) => option.IsActive || option.IsActive === undefined);\r\n\r\n\t\tconst listRenderingDirectives = this.field.RenderingDirectives?.Display?.List;\r\n\t\tconst selectionChoices = this.uiHelpers.setDisplay(\r\n\t\t\tactiveOptions, \r\n\t\t\t{ \r\n\t\t\t\trecentlyUsedEnabled: this.field.IsRecentlyUsedEnabled, \r\n\t\t\t\thideCode: this.field.IsCodeHidden \r\n\t\t\t}, \r\n\t\t\tlistRenderingDirectives\r\n\t\t);\r\n\r\n\t\tif(this.field.Pivot === PIVOT_TYPES.RecentlyUsed) {\r\n\t\t\tconst recentOptions = this.options.filter(o => o.IsRecent === true);\r\n\r\n\t\t\tthis.field.showExpand = this.field.showExpand && recentOptions.length > 1;\r\n\t\t}\r\n\t\tthis.hasHelperButtons = !!this.lookups.length || (this.field.showExpand && this.field.allowPivot);\r\n\r\n\t\tif(this.box) {\r\n\t\t\tthis.box.setChoices(selectionChoices, \"value\", \"label\", true);\r\n\t\t}\r\n\t}\r\n\r\n\tsetNotAvailable(selection, initializing = false) {\r\n\t\tif(selection !== undefined && selection === this.isNotAvailable) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst lastVal = this.isNotAvailable;\r\n\t\tif(!this.selection) {\r\n\t\t\tthis.selection = {};\r\n\t\t}\r\n\r\n\t\tthis.isNotAvailable = selection;\r\n\r\n\t\tif(this.isNotAvailable) {\r\n\t\t\tthis.clearSelected();\r\n\t\t\tthis.selection = null;\r\n\t\t\tthis.value = null;\r\n\t\t\tif(!this.isCustomInput) {\r\n\t\t\t\tthis.box && this.box.disable();\r\n\t\t\t}\r\n\t\t\tthis.field.isDisabled = true;\r\n\t\t\t!initializing && this.disableHelpers(fieldHelpers.NotAvailable.name);\r\n\t\t} \r\n\t\telse if(!this.field.isReadonly) {\r\n\t\t\tif(!this.isCustomInput) {\r\n\t\t\t\tthis.box && this.box.enable();\r\n\t\t\t\t!initializing && this.enableHelpers();\r\n\t\t\t}\r\n\t\t\tthis.field.isDisabled = false;\r\n\t\t}\r\n\r\n\t\tif((this.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.always) || this.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.supported))\r\n\t\t\t&& lastVal !== this.isNotAvailable) {\r\n\t\t\tthis.triggerValueChanged(selection === true ? [\"$[NA]$\"] : {});\r\n\t\t}\r\n\t}\r\n\r\n\tdisableHelpers(exceptedName) {\r\n\t\tthis.enableHelpers();\r\n\t\tthis.lookups.forEach(l => {\r\n\t\t\tif(this.reportFormCtrl.readonly || !exceptedName || l.name !== exceptedName) {\r\n\t\t\t\tl.disabled = true;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tenableHelpers() {\r\n\t\tthis.lookups.forEach(l => l.disabled = false);\r\n\t}\r\n\r\n\tsetCustomInput(featureActive) {\r\n\t\tif(featureActive) {\r\n\t\t\tthis.showCustomInputWarning();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.selection = {};\r\n\t\tthis.isCustomInput = false;\r\n\t\tthis.enableHelpers();\r\n\t\tif((this.options || []).length === 1) {\r\n\t\t\tthis.selection = this.options[0];\r\n\t\t\tthis.value = this.selection.Id;\r\n\t\t\tthis.setChoice(this.selection);\r\n\t\t} \r\n\t}\r\n\r\n\tasync showCustomInputWarning() {\r\n\t\tconst self = this;\r\n\t\tconst userAction = await swal.fire({\r\n\t\t\ttitle: \"Warning!\",\r\n\t\t\thtml:\r\n\t\t\t\t`You are attempting to enable Custom Input mode for a selection field.\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\tPlease note that any text entered in this field will not associate to any items in the list, even if the text matches exactly.\r\n\t\t\t\t\tThis mode is only intended for situations in which the correct value is not present in the list.\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\tAre you sure you want to do that?`,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\",\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Yes, do it!\",\r\n\t\t\tfocusCancel: true,\r\n\t\t\treverseButtons: true\r\n\t\t})\r\n\t\t\t.catch(err => this.$logger.error(err));\r\n\r\n\t\tif(userAction.dismiss) {\r\n\t\t\tthis.updateCustomInputState(false);\r\n\t\t\tthis.isCustomInput = false;\r\n\r\n\t\t\tthis.$timeout(function() {\r\n\t\t\t\twindow.document.getElementById(self.selectFieldId).focus();\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.clearSelected();\r\n\t\t\tthis.isCustomInput = true;\r\n\t\t\tthis.selection = null;\r\n\t\t\tthis.value = null;\r\n\t\t\tthis.disableHelpers(fieldHelpers.CustomInput.name);\r\n\r\n\t\t\tthis.$timeout(function() {\r\n\t\t\t\tconst txt = window.document.getElementById(self.textFieldId);\r\n\r\n\t\t\t\ttxt.focus();\r\n\t\t\t\ttxt.select();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis._scope.$apply();\r\n\t}\r\n\r\n\tupdateCustomInputState(newState) {\r\n\t\tconst inputLookup = find(this.lookups, (lookup) => lookup.name === fieldHelpers.CustomInput.name);\r\n\t\tinputLookup.selection = newState;\r\n\t}\r\n\r\n\tupdateNotAvailableState(newState) {\r\n\t\tconst inputLookup = find(this.lookups, (lookup) => lookup.name === fieldHelpers.NotAvailable.name);\r\n\t\tif(inputLookup) {\r\n\t\t\tinputLookup.selection = newState;\r\n\t\t}\r\n\t}\r\n\r\n\tsetFeatures() {\r\n\t\tthis.setupCustomEntryFeature();\r\n\t\tthis.setupIsNotAvailableFeature();\r\n\t\tthis.setupMapFeature();\r\n\t\tthis.setupAdvancedSearchFeature();\r\n\r\n\t\tif(this.isNotAvailable) {\r\n\t\t\tthis.disableHelpers(fieldHelpers.NotAvailable.name);\r\n\t\t}\r\n\t\telse if(this.isCustomInput) {\r\n\t\t\tthis.disableHelpers(fieldHelpers.CustomInput.name);\r\n\t\t}\r\n\t\telse if(this.field.isDisabled || this.field.isReadonly) {\r\n\t\t\tthis.disableHelpers();\r\n\t\t}\r\n\t}\r\n\r\n\tsetupCustomEntryFeature() {\r\n\t\tif(this.field.IsCustomEntryEnabled) {\r\n\t\t\tconst feature = this.featureHelper.getCustomInputFeature(this.field, this.isCustomInput, (selection) => this.setCustomInput(selection));\r\n\t\t\tthis.lookups.push(feature);\r\n\t\t}\r\n\t}\r\n\r\n\tsetupIsNotAvailableFeature(turnOnFeature, valueSet) {\r\n\t\tif(!this.isNotAvailableFeatureEnabled\r\n\t\t\t&& (\r\n\t\t\t\tthis.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.always)\r\n\t\t\t\t|| (\r\n\t\t\t\t\tthis.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.supported)\r\n\t\t\t\t\t&& turnOnFeature\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t) {\r\n\t\t\tconst feature = this.featureHelper.getNotAvailableFeature(this.field, this.isNotAvailable || valueSet, (selection) => this.setNotAvailable(selection));\r\n\t\t\tthis.lookups.push(feature);\r\n\t\t\tthis.isNotAvailableFeatureEnabled = true;\r\n\t\t}\r\n\t}\r\n\r\n\tremoveIsNotAvailableFeature() {\r\n\t\tif(!!this.isNotAvailableFeatureEnabled) {\r\n\t\t\tconst isNotAvailableFeatureIndex = findIndex(this.lookups, l => l.name === fieldHelpers.NotAvailable.name);\r\n\t\t\tthis.lookups.splice(isNotAvailableFeatureIndex, 1);\r\n\t\t\tthis.isNotAvailableFeatureEnabled = false;\r\n\t\t}\r\n\t\tthis.isNotAvailable = false;\r\n\t}\r\n\r\n\tsetupMapFeature() {\r\n\t\tconst mapFeature = find(this.field.features, { type: FEATURE_TYPES.map });\r\n\t\tif(mapFeature) {\r\n\t\t\tthis.lookups.push({\r\n\t\t\t\tname: mapFeature.type,\r\n\t\t\t\tfieldId: this.field.Id,\r\n\t\t\t\tdisabled: this.field.isReadonly || this.field.isDisabled,\r\n\t\t\t\tdata: mapFeature.data\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tsetupAdvancedSearchFeature() {\r\n\t\tif(this.field.AdvancedSearchEnabled) {\r\n\t\t\tthis.lookups.push({\r\n\t\t\t\tname: fieldHelpers.AdvancedSearch.name,\r\n\t\t\t\tfieldId: this.field.Id,\r\n\t\t\t\thideCode: !!this.field.IsCodeHidden,\r\n\t\t\t\tdisabled: this.field.isDisabled || this.field.isReadonly,\r\n\t\t\t\taction: this.handleAdvancedSearchAction,\r\n\t\t\t\toptions: {\r\n\t\t\t\t\tisFavoriteEnabled: this.field.IsFavoriteEnabled,\r\n\t\t\t\t\tmatchSpecificity: this.field.MatchSpecificity\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\thandleAdvancedSearchAction = async(selection) => {\r\n\t\tif(selection === undefined) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(this.field.IsFavoriteEnabled) {\r\n\t\t\t// set favorite on api here. Currently we favorite the friendly entity.\r\n\t\t\tconst targetType = this.field.EntityQueryConfiguration.Friendly.Type.Code;\r\n\t\t\tconst relationshipType = \"SELF\";\r\n\t\t\tconst setFavorite = this.api.post(FORM_USER_FAVORITES(\r\n\t\t\t\tthis.appState.forms.selected.Id,\r\n\t\t\t\tthis.$userProfile.getUser().databaseId,\r\n\t\t\t\tselection.Id,\r\n\t\t\t\ttargetType,\r\n\t\t\t\trelationshipType\r\n\t\t\t));\r\n\t\t\tawait this.loadingService.watch(setFavorite);\r\n\r\n\t\t\tconst thisDataItem = this.field.Data.find(d => d.Id === selection.Id);\r\n\t\t\tthisDataItem.IsFavorite = true;\r\n\r\n\t\t\tthis.entityManager.updateEntity(thisDataItem);\r\n\t\t\tconst thisField = this.appState.forms.selected.Fields.find(f => f.Id === this.field.Id);\r\n\t\t\tconst thisItemIndex = thisField.Data.findIndex(d => d.Id === thisDataItem.Id);\r\n\t\t\tthisField.Data[thisItemIndex] = thisDataItem;\r\n\r\n\t\t\tthis.setOptions();\r\n\t\t}\r\n\r\n\t\tthis.setValue(selection);\r\n\t\tthis.box.setValueByChoice(selection.Id.toString());\r\n\t}\r\n\r\n\tisDirty(result) {\r\n\t\treturn this.field.IsNotReported !== true && this.field.IsHidden !== true\r\n\t\t\t&& ((result && result[this.optionIdType]) !== (this.initialValue && this.initialValue[this.optionIdType])\r\n\t\t\t\t|| (result && result.IsNotAvailable) !== (this.initialValue && this.initialValue.IsNotAvailable));\r\n\t}\r\n\r\n\tgetCurrentValue(isApiCall = false) {\r\n\t\tlet result = this.buildResult();\r\n\r\n\t\tif(!isApiCall) {\r\n\t\t\tif(!result) {\r\n\t\t\t\tresult = { FieldId: this.field.Id };\r\n\t\t\t\tresult.hasResultForRuleRun = false;\r\n\t\t\t}\r\n\r\n\t\t\tresult.isDirty = this.isDirty(result);\r\n\r\n\t\t\tif(this.isSelectionValid(this.selection)) {\r\n\t\t\t\tif(this.selection.Classifications) {\r\n\t\t\t\t\tconst hasUnhydratedClassifications = some(this.selection.Classifications, (c) => (c.Id !== undefined && c.Code === undefined));\r\n\r\n\t\t\t\t\tif(hasUnhydratedClassifications) {\r\n\t\t\t\t\t\tforEach(this.selection.Classifications, (c, $index) => {\r\n\t\t\t\t\t\t\tthis.selection.Classifications[$index] = this.entityManager.getClassification(c.Code);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresult.Classifications = this.selection.Classifications ?? [];\r\n\t\t\t\tresult.Identifiers = this.selection.Identifiers ?? [];\r\n\t\t\t\tresult._code = this.selection.Code;\r\n\t\t\t\tresult.Order = this.selection.Order;\r\n\t\t\t\tresult.DeactivatedAt = this.selection.DeactivatedAt;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\trevertValue() {\r\n\t\tif(this.box && this.initialValue) {\r\n\t\t\tthis.setValue(this.initialValue);\r\n\t\t\tthis.box && this.value !== undefined && this.box.setValueByChoice(this.value.toString());\r\n\t\t}\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\tlet result;\r\n\t\tif(\r\n\t\t\tthis.isSelectionValid(this.selection) \r\n\t\t\t|| (this.isNotAvailable === true) \r\n\t\t\t|| (this.isCustomInput === true && !!this.value)\r\n\t\t) {\r\n\t\t\tresult = {\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\tIsNotAvailable: !!this.isNotAvailable\r\n\t\t\t};\r\n\t\t\tif(this.isNotAvailable !== true) {\r\n\t\t\t\tif(this.isCustomInput === true) {\r\n\t\t\t\t\tresult.String = this.value;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tresult[this.optionIdType] = this.selection.Id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValue = this.buildResult();\r\n\t}\r\n\r\n\tsetValue(val) {\r\n\t\tconst value = val ? val :\r\n\t\t\tfind(this.values, v => v.FieldId === this.field.Id) || find(this.field.Data, (item) => item.IsDefault && item.DeactivatedAt === undefined);\r\n\r\n\t\tif(!value) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!!value.String && this.field.IsCustomEntryEnabled) {\r\n\t\t\tthis.value = value.String;\r\n\t\t\tthis.isCustomInput = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.value = value[this.optionIdType] ?? value.Id;\r\n\t\t}\r\n\t\tthis.isNotAvailable = value.IsNotAvailable;\r\n\r\n\t\tif(this.value !== undefined) {\r\n\t\t\tthis.handleValueChanged();\r\n\t\t}\r\n\t}\r\n\r\n\thandleLookupSelection(lookup) {\r\n\t\tif(lookup.action) {\r\n\t\t\tlookup.action(lookup.selection);\r\n\t\t}\r\n\t}\r\n\r\n\tisDeactivated(date) {\r\n\t\treturn date && moment(date).isBefore(moment());\r\n\t}\r\n\r\n\thandleValueChanged(modelVal) {\r\n\t\tif(modelVal !== null && modelVal !== undefined) {\r\n\t\t\tthis.value = modelVal;\r\n\t\t\tthis.initialValueSet = false;\r\n\r\n\t\t\tif(modelVal.trim() === \"\") {\r\n\t\t\t\tthis.value = undefined;\r\n\t\t\t\tthis.selection = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst compareValue = this.lastValue ? this.lastValue : this.initialValue && this.initialValue[this.optionIdType];\r\n\r\n\t\tconst future = this.options.find(o => o.Id?.toString() === modelVal);\r\n\t\tif(this.isDeactivated(future?.DeactivatedAt) && future?.Id?.toString() !== compareValue?.toString()) {\r\n\t\t\talertDeactivatedSelection(future.Name || future.Code);\r\n\t\t\tthis.clearSelected();\r\n\t\t\tthis.selection = {};\r\n\t\t\tthis.isNotAvailable = false;\r\n\t\t\tthis.value = null;\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(this.field.warnBeforeChangeTrigger && ((this.value !== undefined && this.value.toString()) != (compareValue && compareValue.toString()))) {\r\n\t\t\tthis.reportFormCtrl.showTriggerWarning(this.field).then(result => {\r\n\t\t\t\tif(result) {\r\n\t\t\t\t\tthis.updateValue();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.value = this.lastValue;\r\n\t\t\t\t\tthis.box && this.value !== undefined && this.box.setValueByChoice(this.value.toString());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.updateValue();\r\n\t}\r\n\r\n\tupdateValue() {\r\n\t\tconst ctrl = this;\r\n\r\n\t\tthis.lastValue = this.value;\r\n\r\n\t\tthis.selection = find(this.options, (o) => o.Id === parseInt(this.value));\r\n\t\tif(this.field.EntityQueryConfiguration !== undefined) {\r\n\t\t\tthis.filterDataOnPrimaryDate();\r\n\t\t}\r\n\r\n\t\tif(this.isSelectionValid(this.selection)) {\r\n\t\t\tthis.field.isDisabled = false;\r\n\t\t\tthis.enableField();\r\n\t\t\tif(this.field.setEntityTimezone === true && this.selection.Id) {\r\n\t\t\t\tconst timezoneCode = this.entityManager.getUniqueTimezoneForEntity(this.field.Id, this.selection.Id);\r\n\t\t\t\tif(timezoneCode === UNIQUE_TIMEZONE_ERRORS.MULTIPLE) {\r\n\t\t\t\t\tnotifyMultipleEntityTimezoneError(this.field.Name);\r\n\t\t\t\t\tthrow new Error(\"Selected entity has multiple available timezones in ByEntity configuration\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(timezoneCode === UNIQUE_TIMEZONE_ERRORS.ZERO) {\r\n\t\t\t\t\tnotifyNoEntityTimezoneError(this.field.Name);\r\n\t\t\t\t\tthis.clearSelected();\r\n\t\t\t\t\tthrow new Error(\"Selected entity has no available timezones in ByEntity configuration\");\r\n\t\t\t\t} \r\n\t\t\t\tthis._eventBus.trigger(EVENT_TIMEZONE_SET(ctrl.field.Id), { value: this.selection.TimeZone.Code });\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!this.selection && (this.value !== undefined)) {\r\n\t\t\tthis.selection = { Id: this.value };\r\n\t\t}\r\n\r\n\t\tthis.cleared = undefined;\r\n\t\tif(!!this.isReady) {\r\n\t\t\tthis.triggerValueChanged(ctrl.selection);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.runOnReady.push(() => this.triggerValueChanged(ctrl.selection));\r\n\t\t}\r\n\t}\r\n\r\n\ttriggerValueChanged(value) {\r\n\t\tconst params = {\r\n\t\t\tfield: this.field,\r\n\t\t\tvalue: value !== undefined ? value \r\n\t\t\t\t: this.isNotAvailable !== undefined ? { Id: \"$[NA]$\" }\r\n\t\t\t\t: undefined\r\n\t\t};\r\n\r\n\t\tif(this.initialValueSet) {\r\n\t\t\tparams.initialValue = true;\r\n\t\t}\r\n\r\n\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id), params);\r\n\r\n\t\tthis.updateFieldDirty();\r\n\t}\r\n\r\n\tupdateFieldDirty() {\r\n\t\tconst result = this.buildResult();\r\n\t\tconst isDirty = this.isDirty(result);\r\n\r\n\t\tthis.setFieldDirty(this.field.Id, isDirty);\r\n\t}\r\n\r\n\tsetOptionIdType() {\r\n\t\tswitch(this.field.Type.Code) {\r\n\t\t\tcase \"ENTITYCONTACT\":\r\n\t\t\tcase \"ENTITY\":\r\n\t\t\t\tthis.optionIdType = \"EntityId\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault: //AREA, PORT, REEF, SPECIES,\r\n\t\t\t\tthis.optionIdType = \"DataId\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n\r\n\texpandPivot() {\r\n\t\tconst sectionId = (!!this.field.Section && this.field.Section.Id) || 0;\r\n\t\tthis._eventBus.trigger(EVENT_EXPAND_MULTI_ENTRY_LIST, { sectionId: sectionId });\r\n\t}\r\n\r\n\tfilterDataOnPrimaryDate = (date, autoSelect) => {\r\n\t\tif(date) {\r\n\t\t\tthis.primaryDate = date;\r\n\t\t}\r\n\r\n\t\tif(!this.isSelectionValid(this.selection)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tthis.featureCallbacks.nestedEntityDateFilter(this.selection, this.primaryDate);\r\n\r\n\t\tthis.field.placeHolder = null;\r\n\r\n\t\tif(!this.initialValue?.EntityId) {\r\n\t\t\tthis.field.isDisabled = false;\r\n\t\t\tthis.enableField();\r\n\t\t}\r\n\r\n\t\tif(this.selection.valid === false) {\r\n\t\t\tif(autoSelect === false) {\r\n\t\t\t\tthis._toastr.warning(\r\n\t\t\t\t\t`The currently selected ${this.field.EntityQueryConfiguration.Primary.Type.Name} is invalid for the selected date. \r\n\t\t\t\t\tPlease select a new ${this.field.Name}.`, \r\n\t\t\t\t\t\"Warning\"\r\n\t\t\t\t);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tthis.clearSelected();\r\n\t\t\tthis.selection = {};\r\n\t\t\tthis.value = undefined;\r\n\r\n\t\t\tthis._toastr.warning(`Selected ${this.field.EntityQueryConfiguration.Primary.Type.Name} was invalid for the selected date.\r\n\t\t\t\tSelected ${this.field.EntityQueryConfiguration.Primary.Type.Name} has been cleared.`, \"Warning\");\r\n\r\n\t\t\tthis.triggerValueChanged(this.value);\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.simple-selection\", [])\r\n\t.component(\"simpleSelection\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tpivotRow: \"=\",\r\n\t\t\tpivotColumn: \"=\",\r\n\t\t\tsubFieldCtrl: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: { reportFormCtrl: \"^reportForm\" }\r\n\t}).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t 22}}\\\"\\r\\n\\t\\t\\tselect-id=\\\"$ctrl.selectFieldId\\\"\\r\\n\\t\\t\\tlabel=\\\"$ctrl.field.Name\\\"\\r\\n\\t\\t\\tset-box=\\\"$ctrl.setBox(box)\\\"\\r\\n\\t\\t\\tsearch=\\\"true\\\"\\r\\n\\t\\t\\tis-readonly=\\\"$ctrl.field.isReadonly || $ctrl.field.isDisabled\\\"\\r\\n\\t\\t\\tset-display=\\\"$ctrl.setDisplay(value)\\\"\\r\\n\\t\\t\\thandle-value-changed=\\\"$ctrl.handleValueChanged(value)\\\"\\r\\n\\t\\t\\tselect-model=\\\"$ctrl.value\\\"\\r\\n\\t\\t\\tfocus-if=\\\"($ctrl.field.focus && $ctrl.pivotRow === undefined) || ($ctrl.pivotRow === 0 && $ctrl.pivotColumn === 0)\\\"\\r\\n\\t\\t\\tis-focused=\\\"$ctrl.isFocused\\\"\\r\\n\\t\\t\\tng-class=\\\"{'tiered-select': $ctrl.hasSecondRowDirective}\\\"\\r\\n\\t\\t>\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t--Not Available--

\\r\\n\\t\\t--empty--

\\r\\n\\t\\r\\n\\t \\r\\n\";","import template from \"./pre-select.html\";\r\nimport {\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_CLEAR_ROW\r\n} from \"constants.js\";\r\n\r\n// selection\r\nexport class Controller {\r\n\tlookups = [];\r\n\tuiHelpers = null;\r\n\r\n\tconstructor($scope, eventBus, uiHelpers, featureHelper, $timeout) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.uiHelpers = uiHelpers;\r\n\t\tthis.featureHelper = featureHelper;\r\n\t\tthis.filteredData = {};\r\n\t\tthis.$timeout = $timeout;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.setOptionIdType();\r\n\t\tthis.registerEvents();\r\n\t\tthis.preSelectValue();\r\n\t}\r\n\r\n\tsetOptionIdType() {\r\n\t\tswitch(this.field.Type.Code) {\r\n\t\t\tcase \"ENTITYCONTACT\":\r\n\t\t\tcase \"ENTITY\":\r\n\t\t\t\tthis.optionIdType = \"EntityId\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault: //AREA, PORT, REEF, SPECIES,\r\n\t\t\t\tthis.optionIdType = \"DataId\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tregisterEvents() {\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister && this._unregister();\r\n\t}\r\n\r\n\tpreSelectValue() {\r\n\t\tconst value = this.field.dataDictionary[this.repeatId];\r\n\r\n\t\tif(!value) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.preselectedValue = value;\r\n\t\tthis.value = value.Id;\r\n\r\n\t\tif(this.value) {\r\n\t\t\tthis.handleValueChanged();\r\n\t\t}\r\n\t}\r\n\r\n\thandleValueChanged() {\r\n\t\tthis.selection = this.field.dataDictionary[this.repeatId];\r\n\r\n\t\tif(!this.selection && !!this.value) {\r\n\t\t\tthis.selection = { Id: this.value };\r\n\t\t}\r\n\r\n\t\tthis._scope.$$postDigest(() => {\r\n\t\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id, this.repeatId), {\r\n\t\t\t\tfield: this.field,\r\n\t\t\t\tvalue: this.selection\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tgetCurrentValue(isApiCall = false) {\r\n\t\tlet result = this.buildResult();\r\n\r\n\t\tif(!isApiCall) {\r\n\t\t\tif(!result) {\r\n\t\t\t\tresult = { FieldId: this.field.Id };\r\n\t\t\t\tresult.hasResultForRuleRun = false;\r\n\t\t\t}\r\n\r\n\t\t\tresult.isDirty = false;\r\n\r\n\t\t\tif(this.selection) {\r\n\t\t\t\tresult.Classifications = this.selection.Classifications;\r\n\t\t\t\tresult._code = this.selection.Code;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\tlet result;\r\n\t\tif(this.selection && this.selection.Id) {\r\n\t\t\tresult = {\r\n\t\t\t\tFieldId: this.field.Id\r\n\t\t\t};\r\n\t\t\tresult[this.optionIdType] = this.selection.Id;\r\n\r\n\t\t\tif(this.repeatId) {\r\n\t\t\t\tresult.repeatId = this.repeatId;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tsetPristine() { }\r\n\r\n\tclearRow() {\r\n\t\tthis._eventBus.trigger(EVENT_CLEAR_ROW(this.repeatId));\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.pre-select\", [])\r\n\t.component(\"preSelect\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\trepeatId: \"<\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t\\r\\n
\";","import {\r\n\tfind,\r\n\tfindIndex,\r\n\tflatten,\r\n\tfilter\r\n} from \"lodash\";\r\nimport template from \"./entity-contact-selector.html\";\r\nimport \"./entity-contact-selector.less\";\r\nimport {\r\n\tEVENT_LOAD_OPTIONS,\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_PAGE_LOADED,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_SET_FORM_PRISTINE,\r\n\tEVENT_TIMEZONE_SET\r\n} from \"constants.js\";\r\n\r\nimport { findEntityRecursively } from \"../../../../utils/entities/findEntityRecursively\";\r\n\r\n// entity-contact-selector\r\nexport class Controller {\r\n\toptions = [];\r\n\tlookups = [];\r\n\tuiHelpers = null;\r\n\tfieldControllers = [];\r\n\r\n\tconstructor($scope, eventBus, uiHelpers, featureHelper, $logger, $timeout) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.uiHelpers = uiHelpers;\r\n\t\tthis.featureHelper = featureHelper;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.$timeout = $timeout;\r\n\r\n\t\tthis.fieldControllers = [];\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.initialized = false;\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\r\n\t\tthis.contactField = {\r\n\t\t\t...this.field,\r\n\t\t\tplaceHolder: \"Please select a captain\",\r\n\t\t\tisDisabled: true,\r\n\t\t\tId: `${this.field.Id}-secondary`,\r\n\t\t\trootFieldId: this.field.Id,\r\n\t\t\tData: [],\r\n\t\t\tsetEntityTimezone: false\r\n\t\t};\r\n\r\n\t\tthis.entityField = {\r\n\t\t\t...this.field,\r\n\t\t\tId: `${this.field.Id}-primary`, \r\n\t\t\trootFieldId: this.field.Id\r\n\t\t};\r\n\r\n\t\tthis._eventBus.register(EVENT_VALUE_CHANGED(this.entityField.Id), (e, params) => {\r\n\t\t\tif(!params.noSelfChange) {\r\n\t\t\t\tthis.fullEntity = params.value;\r\n\t\t\t\tthis.handleChange(params);\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_VALUE_CHANGED(this.contactField.Id), () => {\r\n\t\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id), {\r\n\t\t\t\tfield: this.field,\r\n\t\t\t\tvalue: this.buildResult(),\r\n\t\t\t\tnoSelfChange: true,\r\n\t\t\t\tforce: true,\r\n\t\t\t\tfullEntity: this.fullEntity\r\n\t\t\t});\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_TIMEZONE_SET(this.entityField.Id), (e, params) => {\r\n\t\t\tthis._eventBus.trigger(EVENT_TIMEZONE_SET(this.field.Id), params);\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tthis.handleChange();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_PAGE_LOADED, () => {\r\n\t\t\tif(this.forceInitValueChangeTrigger) {\r\n\t\t\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id), {\r\n\t\t\t\t\tfield: this.field,\r\n\t\t\t\t\tvalue: this.buildResult(),\r\n\t\t\t\t\tnoSelfChange: true,\r\n\t\t\t\t\tforce: true,\r\n\t\t\t\t\tfullEntity: this.fullEntity\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tif(!this.initialValue && this.entityField?.Data.length === 1) {\r\n\t\t\tconst autoVessel = this.entityField.Data[0]; \r\n\t\t\tconst autoVesselContacts = autoVessel.Contacts?.filter(c => c.IsActive);\r\n\t\t\t\r\n\t\t\tif(autoVessel.Entities === undefined || autoVessel.Entities.length < 2) {\r\n\t\t\t\tthis.initialValue = { \r\n\t\t\t\t\tFieldId: this.field.Id, \r\n\t\t\t\t\tEntityId: !autoVessel.Entities?.length ? autoVessel.Id : autoVessel.Entities[0].Entity.Id,\r\n\t\t\t\t\tContactId: autoVesselContacts.length === 1 \r\n\t\t\t\t\t\t? autoVesselContacts[0].Id \r\n\t\t\t\t\t\t: undefined\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(this.initialValue.ContactId) {\r\n\t\t\t\t\tthis.forceInitValueChangeTrigger = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.values && this.initialValue) {\r\n\t\t\tthis.contactValues = [{\r\n\t\t\t\tFieldId: this.contactField.Id,\r\n\t\t\t\tEntityId: this.initialValue?.ContactId\r\n\t\t\t}];\r\n\r\n\t\t\tthis.entityValues = [{\r\n\t\t\t\tFieldId: this.entityField.Id,\r\n\t\t\t\tEntityId: this.initialValue?.EntityId\r\n\t\t\t}];\r\n\r\n\t\t\tthis.contactField.isReadonly = this.field.isReadonly;\r\n\t\t\tthis.entityField.isReadonly = this.field.isReadonly;\r\n\t\t\tthis.contactField.placeHolder = null;\r\n\t\t\tthis.contactField.Data = [];\r\n\r\n\t\t\tif(this.initialValue?.EntityId) {\r\n\t\t\t\tconst match = findEntityRecursively(this.field.Data, this.initialValue.EntityId);\r\n\t\t\t\t\r\n\t\t\t\tif(match) {\r\n\t\t\t\t\tfor(let depth = match.depth; depth >= 0; depth--) {\r\n\t\t\t\t\t\tconst fullEntity = match[depth];\r\n\r\n\t\t\t\t\t\tif(fullEntity.Contacts?.length) {\r\n\t\t\t\t\t\t\tthis.contactField.Data = fullEntity.Contacts;\r\n\r\n\t\t\t\t\t\t\tthis.fullEntity = fullEntity;\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._scope.$watch(\r\n\t\t\t() => { return this.field.isDisabled; },\r\n\t\t\t(next, prev) => {\r\n\t\t\t\tif(next !== prev) {\r\n\t\t\t\t\tthis.contactField.isDisabled = !!(next && this.values);\r\n\t\t\t\t\tthis.entityField.isDisabled = !!next;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tthis._scope.$watch(\r\n\t\t\t() => { return this.field.isReadonly; },\r\n\t\t\t(next, prev) => {\r\n\t\t\t\tif(next !== prev) {\r\n\t\t\t\t\tthis.contactField.isReadonly = !!(next && this.values);\r\n\t\t\t\t\tthis.entityField.isReadonly = !!next;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tthis._scope.$watch(\r\n\t\t\t() => { return this.field.hasValidationError; },\r\n\t\t\t(next, prev) => {\r\n\t\t\t\tif(next !== prev) {\r\n\t\t\t\t\tthis.contactField.hasValidationError = !!(next);\r\n\t\t\t\t\tthis.entityField.hasValidationError = !!(next);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tthis._scope.$watch(\r\n\t\t\t() => { return this.field.hasValidationWarning; },\r\n\t\t\t(next, prev) => {\r\n\t\t\t\tif(next !== prev) {\r\n\t\t\t\t\tthis.contactField.hasValidationWarning = !!(next);\r\n\t\t\t\t\tthis.entityField.hasValidationWarning = !!(next);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n\r\n\thandleChange(selected) {\r\n\t\tif(selected && selected.value) {\r\n\t\t\tthis.contactField.Data = selected.value.Contacts || [];\r\n\r\n\t\t\tif(!selected.field.isDisabled && !selected.field.isReadonly) {\r\n\t\t\t\tthis.contactField.isDisabled = false;\r\n\t\t\t}\r\n\r\n\r\n\t\t\tlet contactId;\r\n\t\t\t//if this field has report values, and it's not initialized\r\n\t\t\tif(!!this.values && !this.initialized) {\r\n\t\t\t\t//then get the contact id from the reports incoming contact id}\r\n\t\t\t\tcontactId = find(this.values, (value) => value.FieldId === this.field.Id)?.ContactId;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconst activeContacts = filter(selected?.value?.Contacts, contact => !!contact.IsActive);\r\n\t\t\t\tif(activeContacts?.length === 1)\r\n\t\t\t\t\tcontactId = activeContacts[0].Id;\r\n\t\t\t}\r\n\r\n\t\t\tthis._eventBus.trigger(EVENT_LOAD_OPTIONS(this.contactField.Id), {\r\n\t\t\t\tdata: this.contactField.Data,\r\n\t\t\t\tsuppressAutoselect: !!this.initialValue && !this.initialValue.ContactId || \r\n\t\t\t\t\t(contactId && !find(this.contactField.Data, contact => contact.Id === contactId))\r\n\t\t\t});\r\n\r\n\t\t\t// the check is to make sure that the captain wasn't deleted\r\n\t\t\tif(contactId && find(selected.value.Contacts, contact => contact.Id === contactId)) {\r\n\t\t\t\tthis._eventBus.trigger(EVENT_SET_VALUE(this.contactField.Id), { value: { Id: contactId } });\r\n\t\t\t}\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.contactField.isDisabled = true;\r\n\t\t\tthis._eventBus.trigger(EVENT_CLEAR_VALUE(this.contactField.Id));\r\n\t\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id), {\r\n\t\t\t\tfield: this.field,\r\n\t\t\t\tvalue: this.buildResult(),\r\n\t\t\t\tnoSelfChange: true,\r\n\t\t\t\tforce: true\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tconst currentResult = this.getCurrentValue();\r\n\t\tthis.setFieldDirty(this.field.Id, currentResult[0].isDirty);\r\n\t}\r\n\r\n\trevertValue() {\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValue = this.getCurrentValue(false)[0];\r\n\t}\r\n\r\n\tgetCurrentValue = (isApiCall) => {\r\n\t\tconst fullResult = this.buildResult(isApiCall);\r\n\t\tlet result = undefined;\r\n\r\n\t\tif(fullResult !== undefined && fullResult.Entity !== undefined && fullResult.Contact !== undefined) {\r\n\t\t\tresult = {\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\tEntityId: fullResult.Entity?.EntityId,\r\n\t\t\t\tContactId: fullResult.Contact?.EntityId\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tif(!isApiCall && this.field.IsNotReported !== true && this.field.IsHidden !== true) {\r\n\t\t\tif(!result) {\r\n\t\t\t\tresult = { FieldId: this.field.Id };\r\n\t\t\t\tresult.hasResultForRuleRun = false;\r\n\t\t\t}\r\n\r\n\t\t\tresult.Classifications = fullResult?.Entity.Classifications;\r\n\t\t\tresult.Identifiers = fullResult?.Entity.Identifiers;\r\n\t\t\tresult._code = fullResult?.Entity._code;\r\n\r\n\t\t\tresult.isDirty = (result.EntityId != (this.initialValue && this.initialValue.EntityId)\r\n\t\t\t\t|| result.ContactId != (this.initialValue && this.initialValue.ContactId));\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\tbuildResult(isApiCall) {\r\n\t\tconst vals = flatten(this.fieldControllers.map((x) => {\r\n\t\t\tconst val = x.getCurrentValue(isApiCall);\r\n\t\t\treturn val;\r\n\t\t}));\r\n\r\n\t\tconst contactVal = find(vals, (field) => { return field.FieldId === this.contactField.Id; });\r\n\t\tconst entityVal = find(vals, (field) => { return field.FieldId === this.entityField.Id; });\r\n\r\n\t\tconst result = entityVal || contactVal ? {\r\n\t\t\tFieldId: this.field.Id,\r\n\t\t\tEntity: entityVal,\r\n\t\t\tContact: contactVal\r\n\t\t} : undefined;\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\tdirtyInterceptor = (fieldId, isDirty) => {\r\n\t\tthis.setFieldDirty(this.field.Id, isDirty);\r\n\t}\r\n\r\n\tregisterFieldController = (fieldController) => {\r\n\t\tthis.fieldControllers.push(fieldController);\r\n\t\treturn function unregister() {\r\n\t\t\tconst idx = findIndex(this.fieldControllers, x => x === fieldController);\r\n\t\t\tif(idx !== -1) {\r\n\t\t\t\tthis.fieldControllers.splice(idx, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.entity-contact-selector\", [])\r\n\t.component(\"entityContactSelector\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n
\\r\\n\";","import {\r\n\tfind,\r\n\tfilter,\r\n\tsome,\r\n\txorWith\r\n} from \"lodash\";\r\nimport template from \"./multi-select.html\";\r\nimport \"./multi-select.less\";\r\nimport {\r\n\tEVENT_REPORT_LOCKED,\r\n\tEVENT_FILTER_CURRENT_OPTIONS,\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_CLEAR_VALUE,\r\n\tFEATURE_TYPES,\r\n\tEVENT_SET_FEATURE_DATA,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_SET_FORM_PRISTINE\r\n} from \"constants.js\";\r\n\r\n// multiSelect\r\nexport class Controller {\r\n\toptions = [];\r\n\tselections = [];\r\n\r\n\tconstructor(uiHelpers, eventBus, $scope, $logger) {\r\n\t\tthis.uiHelpers = uiHelpers;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis._scope = $scope;\r\n\t\tthis.search = true;\r\n\t\tthis.$logger = $logger;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tconst ctrl = this;\r\n\t\tthis.setFeatures();\r\n\r\n\t\tthis._eventBus.register(EVENT_REPORT_LOCKED, () => this.box.disable(), this._scope);\r\n\t\tthis._eventBus.register(EVENT_FILTER_CURRENT_OPTIONS(this.field.Id), (e, params) => this.setOptions(params.ids), this._scope);\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis.options = [...this.field.Data];\r\n\r\n\t\tthis.initialValues = filter(this.values, v => v.FieldId === this.field.Id);\r\n\t\tthis.setValue();\r\n\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\r\n\r\n\t\tif(this.selections.length) {\r\n\t\t\tconst val = filter(this.field.Data, d => some(ctrl.selections.map(s => s.Id), (v) => d.Id == v));\r\n\t\t\tval.map(v => ctrl.options.push(v));\r\n\t\t}\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(this.field.isReadonly)\r\n\t\t\t\tthis.box.disable();\r\n\r\n\t\t\tthis.selections = [];\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\tsetFeatures() {\r\n\t\tconst mapPointFeature = find(this.field.features, { Type: FEATURE_TYPES.mapPoint });\r\n\r\n\t\tif(mapPointFeature) {\r\n\t\t\tthis._eventBus.register(EVENT_SET_FEATURE_DATA(mapPointFeature.Type), (e, params) => {\r\n\t\t\t\tthis.selections = filter(this.field.Data, o => some(params.areaIds, v => o.Id === v));\r\n\t\t\t}, this._scope);\r\n\t\t}\r\n\t}\r\n\r\n\tgetCurrentValue(isApiCall) {\r\n\t\tconst result = this.buildResult();\r\n\r\n\t\tif(!isApiCall && this.field.IsNotReported !== true && this.field.IsHidden !== true) {\r\n\t\t\tconst unmatched = xorWith(result, this.initialValues, (a, b) => {\r\n\t\t\t\treturn a.FieldId === b.FieldId && a.DataId === b.DataId;\r\n\t\t\t});\r\n\r\n\t\t\tif(unmatched.length > 0) {\r\n\t\t\t\tresult.forEach(r => r.isDirty = true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\trevertValue() {\r\n\t\tthis.setChoices();\r\n\t\tthis.value = this.initialValues.map(v => v.DataId.toString());\r\n\t\tthis.handleValueChanged();\r\n\t\tthis.setChoice();\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValues = this.buildResult();\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\treturn this.selections.length\r\n\t\t\t? this.selections.map(x => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\t\tDataId: x.Id\r\n\t\t\t\t};\r\n\t\t\t})\r\n\t\t\t: [];\r\n\t}\r\n\r\n\tsetValue() {\r\n\t\tconst values = filter(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tif(values.length) {\r\n\t\t\tthis.selections = filter(this.field.Data, d => some(values, v => d.Id === v.DataId));\r\n\t\t}\r\n\t}\r\n\r\n\tsetSelectBox(box) {\r\n\t\tthis.box = box;\r\n\t\tthis.setChoices();\r\n\t\tthis.setChoice();\r\n\r\n\t\tif(this.selections) {\r\n\t\t\tthis.handleValueChanged();\r\n\t\t}\r\n\t}\r\n\r\n\tsetChoices(data) {\r\n\t\tthis.options = data || this.field.Data;\r\n\r\n\t\tif(!this.box)\r\n\t\t\treturn;\r\n\r\n\t\tconst selectionChoices = this.uiHelpers.setDisplay(\r\n\t\t\tthis.options, \r\n\t\t\t{ \r\n\t\t\t\trecentlyUsedEnabled: this.groupRecents \r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tthis.box.setChoices(selectionChoices, \"value\", \"label\", true);\r\n\t}\r\n\r\n\tsetChoice() {\r\n\t\tif(this.selections.length) {\r\n\t\t\tthis.box.setValueByChoice(this.selections.map(v => v.Id.toString()));\r\n\t\t}\r\n\t}\r\n\r\n\tsetDisplay(id) {\r\n\t\tconst item = find(this.field.Data, { Id: parseInt(id) });\r\n\r\n\t\tif(!item)\r\n\t\t\tthrow new Error(\"Selected item not found.\");\r\n\r\n\t\treturn item.Name;\r\n\t}\r\n\r\n\tsetOptions(ids) {\r\n\t\tthis.options = filter(this.field.Data, (d) => some(ids, (i) => d.Id === i));\r\n\r\n\t\tif(!(ids || []).length && !(this.selections || []).length)\r\n\t\t\tthis.options = this.field.Data;\r\n\r\n\t\tthis.setChoices(this.options);\r\n\t}\r\n\r\n\thandleValueChanged() {\r\n\t\tif(this.value) {\r\n\t\t\tthis.selections = filter(this.field.Data, o => some(this.value, v => o.Id === parseInt(v)));\r\n\t\t}\r\n\r\n\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id), {\r\n\t\t\tfield: this.field,\r\n\t\t\tvalue: this.selections.map(s => s.Id)\r\n\t\t});\r\n\r\n\t\tconst currentVal = this.getCurrentValue();\r\n\t\tconst isDirty = some(currentVal, v => v.isDirty);\r\n\r\n\t\tthis.setFieldDirty(this.field.Id, isDirty);\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n\r\n\tgetItemNames() {\r\n\t\tconst names = this.selections.map(item => item.Name);\r\n\t\treturn names.join(\", \");\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.multi-select\", [])\r\n\t.component(\"multiSelect\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n\\r\\n\\r\\n\\t

--empty--

\\r\\n\\r\\n
\\r\\n\\t

{{ $ctrl.getItemNames() }}

\\r\\n
\";","import template from \"./text.html\";\r\nimport \"./text.less\";\r\n\r\nimport {\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_UNCLEAR_VALUE,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_REPORT_LOCKED,\r\n\tEVENT_REPORT_UNLOCKED,\r\n\tEVENT_SET_FORM_PRISTINE\r\n} from \"constants.js\";\r\nimport {\r\n\tfind,\r\n\tsome\r\n} from \"lodash\";\r\nimport fieldHelpers from \"../../../field-helpers/lookup.config\";\r\nimport { IS_NOT_AVAILABLE_OPTIONS } from \"../../../../constants\";\r\n\r\nexport class Controller {\r\n\tlookups = [];\r\n\r\n\tconstructor($scope, eventBus, featureHelper, $logger, uiHelpers, $timeout) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.featureHelper = featureHelper;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.uiHelpers = uiHelpers;\r\n\t\tthis.$timeout = $timeout;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\r\n\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\t\tthis.initialValue && (this.initialValue.IsNotAvailable = !!this.initialValue.IsNotAvailable); //coerce isnotavailable to false if it doesn't exist\r\n\r\n\t\tthis.setValue();\r\n\t\tthis.setFeatures();\r\n\r\n\t\tthis.hasHelperButtons = !!this.lookups.length;\r\n\r\n\t\tif(this.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.always)) {\r\n\t\t\tthis.setNotAvailable(this.isNotAvailable);\r\n\t\t}\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!this.cleared && !!this.value) {\r\n\t\t\t\tthis.cleared = {\r\n\t\t\t\t\tvalue: this.value\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.value = undefined;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.always)) {\r\n\t\t\t\tthis.isNotAvailable = false;\r\n\t\t\t\tthis.setNotAvailable(this.isNotAvailable);\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_UNCLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!!this.cleared) {\r\n\t\t\t\tthis.value = this.cleared.value;\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REPORT_LOCKED, () => {\r\n\t\t\tthis.field.isReadonly = true;\r\n\t\t\tthis.disableField();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REPORT_UNLOCKED, () => {\r\n\t\t\tthis.field.isReadonly = false;\r\n\t\t\tthis.enableField();\r\n\r\n\t\t\tif(this.isNotAvailable || this.isCustomInput) {\r\n\t\t\t\tthis.isNotAvailable && this.disableHelpers(fieldHelpers.NotAvailable.name);\r\n\t\t\t\tthis.isCustomInput && this.disableHelpers(fieldHelpers.CustomInput.name);\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\tgetCurrentValue(isApiCall) {\r\n\t\tlet result = this.buildResult();\r\n\r\n\t\tif(!isApiCall && this.field.IsNotReported !== true && this.field.IsHidden !== true) {\r\n\t\t\tif(result === undefined) {\r\n\t\t\t\tresult = {\r\n\t\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\t\tIsNotAvailable: !!this.isNotAvailable,\r\n\t\t\t\t\thasResultForRuleRun: !!this.isNotAvailable\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tresult.isDirty = this.value !== (this.initialValue?.String) ||\r\n\t\t\t\tthis.initialValue?.isNotAvailable !== result.isNotAvailable ||\r\n\t\t\t\tresult.DataId !== this.initialValue?.DataId;\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\tcheckForDirty() {\r\n\t\tconst isDirty = this.value !== (this.initialValue && this.initialValue.String);\r\n\t\tthis.setFieldDirty(this.field.Id, isDirty);\r\n\t}\r\n\r\n\thandleInput() {\r\n\t\tconst content = this.value;\r\n\t\tif((/^[ -~]*$/.test(content))) { //regex matches all ASCII characters except for backspace\r\n\t\t} else {\r\n\t\t\tthis.value = content.replace(/[^ -~]/g, \"\"); //regex replaces characters that are not ASCII - backspace with an empty string\r\n\t\t}\r\n\t}\r\n\r\n\trevertValue() {\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValue = this.field.IsDetail ? undefined : this.buildResult();\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\tif(!!this.isNotAvailable || this.value) {\r\n\t\t\treturn {\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\tIsNotAvailable: !!this.isNotAvailable,\r\n\t\t\t\tDataId: !!this.isNotAvailable ? this.selection?.Id : undefined,\r\n\t\t\t\tString: !!this.isNotAvailable ? undefined : this.value\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn undefined;\r\n\t}\r\n\r\n\tsetValue(val) {\r\n\t\tif(val) {\r\n\t\t\tthis.value = val;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst value = find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tif(value) {\r\n\t\t\tthis.value = value.String;\r\n\t\t\tthis.selectValue = value.DataId;\r\n\t\t\tthis.isNotAvailable = value.IsNotAvailable;\r\n\t\t}\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n\r\n\tsetFeatures() {\r\n\t\tthis.setupIsNotAvailableFeature();\r\n\r\n\t\tif(this.field.isDisabled || this.field.isReadonly) {\r\n\t\t\tthis.disableHelpers();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.isNotAvailable && this.disableHelpers(fieldHelpers.NotAvailable.name);\r\n\t\t}\r\n\t}\r\n\r\n\tsetupIsNotAvailableFeature() {\r\n\t\tthis.showNotAvailableSelections = false;\r\n\t\tif(this.featureHelper.checkNotAvailable(this.field, IS_NOT_AVAILABLE_OPTIONS.always)) {\r\n\t\t\tconst feature = this.featureHelper.getNotAvailableFeature(this.field, this.isNotAvailable, (selection) => this.setNotAvailable(selection));\r\n\t\t\tthis.lookups.push(feature);\r\n\r\n\t\t\tthis.options = this.field.Data;\r\n\t\t}\r\n\t}\r\n\r\n\tsetBox(box) {\r\n\t\tthis.box = box;\r\n\r\n\t\tthis.setOptions();\r\n\r\n\t\tif(this.selection) {\r\n\t\t\tthis.box.setValueByChoice(this.selection.Id.toString());\r\n\t\t}\r\n\t}\r\n\r\n\tsetOptions() {\r\n\t\tif(this.selection && !some(this.options, (o) => o.Id === this.selection.Id)) {\r\n\t\t\tif(this.box) {\r\n\t\t\t\tconst values = this.box.getValue(true);\r\n\t\t\t\tthis.box.removeItemsByValue(values);\r\n\t\t\t}\r\n\r\n\t\t\tthis.selection = {};\r\n\r\n\t\t\tthis.value = undefined;\r\n\t\t\tthis.handleValueChanged();\r\n\t\t}\r\n\r\n\t\tthis.setChoices();\r\n\r\n\t\tif((this.options || []).length === 1) {\r\n\t\t\tthis.selection = this.options[0];\r\n\r\n\t\t\tthis.value = this.selection.Id;\r\n\t\t\tthis.setChoice(this.selection);\r\n\t\t}\r\n\t}\r\n\r\n\tsetChoices(data) {\r\n\t\tif(data) {\r\n\t\t\tthis.options = data;\r\n\t\t}\r\n\r\n\t\tif(!this.options || !Array.isArray(this.options)) {\r\n\t\t\tthis.box.clearStore();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst activeOptions = this.options.filter((option) => option.IsActive || option.IsActive === undefined);\r\n\r\n\t\tconst selectionChoices = this.uiHelpers.setDisplay(\r\n\t\t\tactiveOptions, \r\n\t\t\t{ \r\n\t\t\t\trecentlyUsedEnabled: this.field.IsRecentlyUsedEnabled, \r\n\t\t\t\thideCode: this.field.IsCodeHidden \r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tif(this.box) {\r\n\t\t\tthis.box.setChoices(selectionChoices, \"value\", \"label\", true);\r\n\t\t}\r\n\t}\r\n\r\n\tdisableHelpers(exceptedName) {\r\n\t\tthis.enableHelpers();\r\n\t\tthis.lookups.forEach(l => {\r\n\t\t\tif(!exceptedName || l.name !== exceptedName) {\r\n\t\t\t\tl.disabled = true;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tenableHelpers() {\r\n\t\tthis.lookups.forEach(l => l.disabled = false);\r\n\t}\r\n\r\n\tsetNotAvailable(isActive) {\r\n\t\tthis.isNotAvailable = isActive;\r\n\t\tthis.showNotAvailableSelections = false;\r\n\t\tthis.updateCustomInputState(this.isNotAvailable);\r\n\r\n\t\tif(this.isNotAvailable) {\r\n\t\t\tthis.value = \"\";\r\n\t\t\tthis.field.isDisabled = !(this.field.Data && this.field.Data.length > 0);\r\n\t\t\tthis.disableHelpers(fieldHelpers.NotAvailable.name);\r\n\t\t\tif(this.field.Data && this.field.Data.length > 0) {\r\n\t\t\t\tthis.showNotAvailableSelections = true;\r\n\t\t\t\tthis.updateSelectValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(!this.field.isReadonly) {\r\n\t\t\tthis.field.isDisabled = false;\r\n\t\t\tthis.enableHelpers();\r\n\t\t\tthis.selection = null;\r\n\t\t\tthis.selectValue = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\tupdateCustomInputState(newState) {\r\n\t\tconst inputLookup = find(this.lookups, (lookup) => lookup.name === fieldHelpers.NotAvailable.name);\r\n\t\tinputLookup.selection = newState;\r\n\t}\r\n\r\n\thandleLookupSelection(lookup) {\r\n\t\tif(lookup.action) {\r\n\t\t\tlookup.action(lookup.selection);\r\n\t\t}\r\n\t}\r\n\r\n\thandleValueChanged(modelVal) {\r\n\t\tthis.selectValue = modelVal;\r\n\t\tthis.updateSelectValue();\r\n\r\n\t\tthis.checkForDirty();\r\n\t}\r\n\r\n\tupdateSelectValue() {\r\n\t\tif(this.selectValue !== undefined) {\r\n\t\t\tthis.selection = find(this.options, (o) => o.Id === parseInt(this.selectValue));\r\n\r\n\t\t\tif(this.selection) {\r\n\t\t\t\tthis.field.isDisabled = false;\r\n\t\t\t\tthis.enableField();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.selection && this.selectValue !== \"\") {\r\n\t\t\t\tthis.selection = { Id: this.selectValue };\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tenableField() {\r\n\t\tif(!this.field.isDisabled && !this.field.isReadonly) {\r\n\t\t\t// checks if it is a select box, OR\r\n\t\t\t// if it is a text field that is available.\r\n\t\t\tif(this.options || this.isNotAvailable) {\r\n\t\t\t\tthis.field.placeHolder = null;\r\n\t\t\t\tthis.box && this.box.enable();\r\n\t\t\t\tthis.enableHelpers();\r\n\r\n\t\t\t\tthis.$timeout(() => {\r\n\t\t\t\t\tthis._scope.$apply();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdisableField() {\r\n\t\tif(this.field.isDisabled || this.field.isReadonly) {\r\n\t\t\tthis.box && this.box.disable();\r\n\t\t\tthis.disableHelpers();\r\n\t\t}\r\n\t}\r\n\r\n\tsetDisplay(id) {\r\n\t\tconst item = find(this.options, { Id: parseInt(id) });\r\n\r\n\t\tif(!item)\r\n\t\t\tthrow new Error(`Selected ${this.field.Name} not found as an option.`);\r\n\r\n\t\treturn item.Name || item.Code;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.text\", [])\r\n\t.component(\"text\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tpivotColumn: \"=\",\r\n\t\t\tpivotRow: \"=\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n\\r\\n\\t

--empty--

\\r\\n\";","import template from \"./textarea.html\";\r\nimport {\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_PAGE_LOADED,\r\n\tEVENT_SET_FORM_PRISTINE\r\n} from \"constants.js\";\r\nimport { find } from \"lodash\";\r\nimport \"./textarea.less\";\r\n\r\n// text\r\nexport class Controller {\r\n\tconstructor($scope, eventBus) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\r\n\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\t\tthis.setValue();\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tthis.value = null;\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_PAGE_LOADED, () => {\r\n\t\t\tthis.autoExpand(document.getElementById(\"REPORT.FEEDBACK\"));\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\r\n\t\tdocument.addEventListener(\"input\", event => {\r\n\t\t\tif(event.target.tagName.toLowerCase() !== \"textarea\") {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tthis.autoExpand(event.target);\r\n\t\t}, false);\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\tgetCurrentValue(isApiCall) {\r\n\t\tconst result = this.buildResult();\r\n\r\n\t\tif(result && !isApiCall && this.field.IsNotReported !== true && this.field.IsHidden !== true) {\r\n\t\t\tresult.IsDirty = this.value !== (this.initialValue && this.initialValue.String);\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\trevertValue() {\r\n\t}\r\n\r\n\tcheckForDirty() {\r\n\t\tconst isDirty = this.value !== (this.initialValue && this.initialValue.String);\r\n\t\tthis.setFieldDirty(this.field.Id, isDirty);\r\n\t}\r\n\r\n\thandleInput() {\r\n\t\tconst content = this.value;\r\n\t\tif((/^[ -~]*$/.test(content))) { //regex matches all ASCII characters except for backspace\r\n\t\t} else {\r\n\t\t\tthis.value = content.replace(/[^ -~]/g, \"\"); //regex replaces characters that are not ASCII - backspace with an empty string\r\n\t\t}\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValue = this.field.IsDetail ? undefined : this.buildResult();\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\treturn this.value ? {\r\n\t\t\tFieldId: this.field.Id,\r\n\t\t\tString: this.value\r\n\t\t} : undefined;\r\n\t}\r\n\r\n\tsetValue(val) {\r\n\t\tif(val) {\r\n\t\t\tthis.value = val;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst value = find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tif(value) {\r\n\t\t\tthis.value = value.String;\r\n\t\t}\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n\r\n\tautoExpand(field) {\r\n\t\tfield.style.height = \"inherit\";\r\n\r\n\t\tconst computed = window.getComputedStyle(field);\r\n\r\n\t\tconst height = parseInt(computed.getPropertyValue(\"border-top-width\"), 10)\r\n\t\t\t+ parseInt(computed.getPropertyValue(\"padding-top\"), 10)\r\n\t\t\t+ field.scrollHeight\r\n\t\t\t+ parseInt(computed.getPropertyValue(\"padding-bottom\"), 10)\r\n\t\t\t+ parseInt(computed.getPropertyValue(\"border-bottom-width\"), 10);\r\n\r\n\t\tfield.style.height = height + \"px\";\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.text-area\", [])\r\n\t.component(\"textArea\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\r\\n\\r\\n\\t{{$ctrl.value.length || 0}} of {{$ctrl.field.MaxValue}} characters used\\r\\n\\r\\n\\r\\n\\t

--empty--

\\r\\n\\r\\n\";","import {\r\n\tfind,\r\n\tfindIndex\r\n} from \"lodash\";\r\nimport template from \"./degree-minute.html\";\r\nimport {\r\n\tEVENT_FIELD_DISABLE,\r\n\tEVENT_FIELD_ENABLE,\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_UNCLEAR_VALUE,\r\n\tEVENT_SET_FEATURE_DATA,\r\n\tFEATURE_TYPES,\r\n\tEVENT_SEND_VALUE,\r\n\tEVENT_GET_VALUE,\r\n\tEVENT_REPORT_LOCKED,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_SET_FORM_PRISTINE\r\n} from \"constants.js\";\r\nimport {\r\n\tdegreesToDms,\r\n\tdmsToDegrees\r\n} from \"../../../../services/geo-service\";\r\n\r\nexport class Controller {\r\n\tcurrentValue = { unit: {} };\r\n\tfieldControllers = [];\r\n\tlookups = [];\r\n\r\n\tconstructor($scope, $logger, eventBus, featureHelper) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis._eventBus = eventBus;\r\n\t\t// eslint-disable-next-line no-useless-escape\r\n\t\tthis.isNumber = /^(\\-)?(\\d*(\\.|\\.\\d+)?)?$/;\r\n\t\tthis.featureHelper = featureHelper;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\r\n\t\tthis.field.options = this.field.Data;\r\n\t\tthis.currentValue.unit = find(this.field.options, (unit) => unit.Code === \"°\");\r\n\r\n\t\tthis.setValue();\r\n\t\tthis.setFeatures();\r\n\r\n\t\tthis.setPristine();\r\n\r\n\t\tconst self = this;\r\n\t\tthis._eventBus.register(EVENT_SET_VALUE(this.field.Id), (e, params) => self.setValue(params.value, true), this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!self.cleared && (!!self.currentValue?.degrees)) {\r\n\t\t\t\tself.cleared = { ...self.currentValue };\r\n\t\t\t}\r\n\t\t\tself.currentValue = {\r\n\t\t\t\t...self.currentValue,\r\n\t\t\t\tdegrees: null,\r\n\t\t\t\tminutes: null,\r\n\t\t\t\troundedMinutes: null\r\n\t\t\t};\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_UNCLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!!self.cleared) {\r\n\t\t\t\tself.currentValue = this.cleared;\r\n\t\t\t\tself.cleared = undefined;\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_GET_VALUE(this.field.Id), (_, params) => {\r\n\t\t\tthis._eventBus.trigger(EVENT_SEND_VALUE(params.id), {\r\n\t\t\t\tkey: this.field.Key.Code,\r\n\t\t\t\tvalue: this.getCurrentValue()\r\n\t\t\t});\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_FIELD_DISABLE(this.field.Id), () => self.disableField(), this._scope);\r\n\t\tthis._eventBus.register(EVENT_FIELD_ENABLE(this.field.Id), () => self.enableField(), this._scope);\r\n\t\tthis._eventBus.register(EVENT_REPORT_LOCKED, () => self.field.isReadonly = true, this._scope);\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\r\n\t\tconst mapFeature = find(this.field.features, { Type: FEATURE_TYPES.mapPoint });\r\n\t\tif(!!this.initialValue || (mapFeature && mapFeature.geoJsons !== undefined)) {\r\n\t\t\tthis.lookups.forEach(l => l.disabled = false);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.lookups.forEach(l => l.disabled = true);\r\n\t\t}\r\n\r\n\t\tthis._scope.$watch(\r\n\t\t\t() => self.currentValue.isNegative,\r\n\t\t\t() => self.setCompassDirection()\r\n\t\t);\r\n\t}\r\n\r\n\tenableField() {\r\n\t\tthis.field.isDisabled = false;\r\n\t\tthis.field.placeHolder = null;\r\n\t\tthis.lookups.forEach(l => l.disabled = false);\r\n\t}\r\n\r\n\tdisableField() {\r\n\t\tthis.field.isDisabled = true;\r\n\t\tif(!!this.currentValue) {\r\n\t\t\tthis.lookups.forEach(l => l.disabled = false);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.lookups.forEach(l => l.disabled = true);\r\n\t\t}\r\n\t}\r\n\r\n\ttriggerDirtyEvent() {\r\n\t\tconst val = this.buildResult();\r\n\t\tconst isDirty = this.isDirty(val && val.Number);\r\n\r\n\t\tthis.setFieldDirty(this.field.Id, isDirty);\r\n\t}\r\n\r\n\tonNumberChanged(newValue, oldValue, propName) {\r\n\t\tif(newValue === \"\") {\r\n\t\t\tthis.currentValue[propName] = \"\";\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\treturn newValue.match(this.isNumber) ? newValue : oldValue;\r\n\t}\r\n\r\n\thandleKeyUp(event) {\r\n\t\tconst regex = /[0-9.-\\\\t]/;\r\n\t\tconst isValid = regex.test(event.key);\r\n\r\n\t\tif(!isValid) {\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t}\r\n\r\n\thandleBlur() {\r\n\t\tthis.forcePositive();\r\n\r\n\t\tconst fullMinutes = this.currentValue.roundedMinutes;\r\n\r\n\t\tthis.currentValue.minutes = Math.round(fullMinutes);\r\n\t\tthis.currentValue.roundedMinutes = this.currentValue.minutes;\r\n\t}\r\n\r\n\tsetCompassDirection() {\r\n\t\tif(this.field.Key.Code === \"TRIP.AREAS.LATITUDE.SINGLE\") {\r\n\t\t\tthis.compassLetter = this.currentValue.isNegative ? \"S\" : \"N\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.compassLetter = this.currentValue.isNegative ? \"W\" : \"E\";\r\n\t\t}\r\n\r\n\t\tthis.triggerDirtyEvent();\r\n\t}\r\n\r\n\tswapCompass() {\r\n\t\tthis.currentValue.isNegative = !this.currentValue.isNegative;\r\n\t\tthis.setCompassDirection();\r\n\t}\r\n\r\n\tgetCurrentValue = (isApiCall) => {\r\n\t\tlet result = this.buildResult();\r\n\r\n\t\tif(!isApiCall) {\r\n\t\t\tif(!result) {\r\n\t\t\t\tresult = { FieldId: this.field.Id };\r\n\t\t\t\tresult.hasResultForRuleRun = false;\r\n\t\t\t}\r\n\t\t\tresult.factor = 1;\r\n\t\t\tresult.isDirty = this.isDirty(result.Number);\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\tisDirty(result) {\r\n\t\treturn this.field.IsNotReported !== true\r\n\t\t\t&& this.field.IsHidden !== true\r\n\t\t\t&& (result != (this.initialValue && this.initialValue.Number));\r\n\t}\r\n\r\n\trevertValue() {\r\n\t\tconst dms = degreesToDms(this.initialValue.Number);\r\n\r\n\t\tthis.currentValue.degrees = dms.degrees;\r\n\t\tthis.currentValue.minutes = this.currentValue.roundedMinutes = dms.minutes;\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tconst newInitial = this.field.IsDetail ? undefined : this.buildResult();\r\n\t\tthis.initialValue = newInitial;\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\tlet result = undefined;\r\n\t\tif(this.currentValue.unit && this.currentValue.unit.Id) {\r\n\t\t\tconst fullDegrees = dmsToDegrees(this.currentValue);\r\n\r\n\t\t\tif(fullDegrees) {\r\n\t\t\t\tresult = {\r\n\t\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\t\tNumber: fullDegrees,\r\n\t\t\t\t\tDataId: this.currentValue.unit.Id\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tsetValue(value, fromEvent = false) {\r\n\t\tthis.value = value ? value : find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tif(this.value) {\r\n\t\t\tthis.currentValue = degreesToDms(this.value.Number, fromEvent);\r\n\t\t\tthis.currentValue.unit = find(this.field.options, (unit) => unit.Code === \"°\");\r\n\r\n\t\t\tif(!this.currentValue.unit && this.field.Data.length === 1) {\r\n\t\t\t\tthis.currentValue.unit = this.field.Data[0];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthis.currentValue.unit = find(this.field.options, (unit) => unit.Code === \"°\");\r\n\t\t\tif(this.field.Key.Code === \"TRIP.AREAS.LONGITUDE.SINGLE\")\r\n\t\t\t\tthis.currentValue.isNegative = true;\r\n\t\t}\r\n\r\n\t\tif(this.currentValue.unit === undefined) {\r\n\t\t\tthis.field.isReadonly = true;\r\n\t\t\tthis.$logger.warn(\"Degree minute field unit not found!\");\r\n\t\t}\r\n\r\n\t\tthis.setCompassDirection();\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\tregisterFieldController = (fieldController) => {\r\n\t\tthis.fieldControllers.push(fieldController);\r\n\t\treturn function unregister() {\r\n\t\t\tconst idx = findIndex(this.fieldControllers, x => x === fieldController);\r\n\t\t\tif(idx !== -1) {\r\n\t\t\t\tthis.fieldControllers.splice(idx, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tsetFeatures() {\r\n\t\tconst mapFeature = find(this.field.features, { Type: FEATURE_TYPES.mapPoint });\r\n\r\n\t\tif(mapFeature) {\r\n\t\t\tthis.lookups.push({\r\n\t\t\t\tname: mapFeature.Type,\r\n\t\t\t\tbuoys: mapFeature.buoys,\r\n\t\t\t\tfieldId: this.field.Id,\r\n\t\t\t\tdisabled: false,\r\n\t\t\t\tdata: mapFeature.geoJsons,\r\n\t\t\t\tvalueFields: mapFeature.locationFields,\r\n\t\t\t\tfields: !!mapFeature.geoJsons && mapFeature.locationFields,\r\n\t\t\t\tisUpdatable: () => !this.field.isReadonly && !this.field.isDisabled,\r\n\t\t\t\tdegreeMapper: (rawDegrees, isMapRequest) => degreesToDms(rawDegrees, isMapRequest)\r\n\t\t\t});\r\n\r\n\t\t\tthis._eventBus.register(EVENT_SET_FEATURE_DATA(mapFeature.Type), (e, params) => {\r\n\t\t\t\tconst lookup = find(this.lookups, l => l.name === mapFeature.Type);\r\n\t\t\t\tlookup.data = params.geoJsons;\r\n\t\t\t\tlookup.fields = params.locationFields;\r\n\t\t\t}, this._scope);\r\n\t\t}\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n\r\n\tgetCoordinates() {\r\n\t\treturn `${this.currentValue.degrees}° ${this.currentValue.minutes}'`;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.degree-minute\", [])\r\n\t.component(\"degreeMinute\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n\";","import {\r\n\tfind,\r\n\tfindIndex\r\n} from \"lodash\";\r\nimport template from \"./dms.html\";\r\nimport \"./dms.less\";\r\n\r\nimport {\r\n\tEVENT_FIELD_DISABLE,\r\n\tEVENT_FIELD_ENABLE,\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_CLEAR_VALUE,\r\n\tFEATURE_TYPES,\r\n\tEVENT_REPORT_LOCKED,\r\n\tEVENT_REVERT_VALUES\r\n} from \"constants.js\";\r\nimport {\r\n\tdegreesToDms,\r\n\tdmsToDegrees\r\n} from \"../../../../../services/geo-service\";\r\n\r\nexport class Controller {\r\n\tcurrentValue = { unit: {} };\r\n\tfieldControllers = [];\r\n\tlookups = [];\r\n\r\n\tconstructor($scope, $logger, eventBus, featureHelper) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis._eventBus = eventBus;\r\n\t\t// eslint-disable-next-line no-useless-escape\r\n\t\tthis.isNumber = /^(\\-)?(\\d*(\\.|\\.\\d+)?)?$/;\r\n\t\tthis.featureHelper = featureHelper;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tthis.setValue();\r\n\t\tthis.setFeatures();\r\n\r\n\t\tconst self = this;\r\n\t\tthis._eventBus.register(EVENT_SET_VALUE(this.field.Id), (e, params) => self.setValue(params.value, true), this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tself.currentValue.dmsDegrees = null;\r\n\t\t\tself.currentValue.dmsMinutes = null;\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_FIELD_DISABLE(this.field.Id), () => self.disableField(), this._scope);\r\n\t\tthis._eventBus.register(EVENT_FIELD_ENABLE(this.field.Id), () => self.enableField(), this._scope);\r\n\t\tthis._eventBus.register(EVENT_REPORT_LOCKED, () => self.field.isReadonly = true, this._scope);\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._scope.$watch(\r\n\t\t\t() => self.currentValue.longitude.isNegative,\r\n\t\t\t() => self.setCompassDirection()\r\n\t\t);\r\n\r\n\t\tthis._scope.$watch(\r\n\t\t\t() => self.currentValue.latitude.isNegative,\r\n\t\t\t() => self.setCompassDirection()\r\n\t\t);\r\n\t}\r\n\r\n\tenableField() {\r\n\t\tthis.field.isDisabled = false;\r\n\t\tthis.field.placeHolder = null;\r\n\t\tthis.lookups.forEach(l => l.disabled = false);\r\n\t}\r\n\r\n\tdisableField() {\r\n\t\tthis.field.isDisabled = true;\r\n\t\tif(!!this.currentValue) {\r\n\t\t\tthis.lookups.forEach(l => l.disabled = false);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.lookups.forEach(l => l.disabled = true);\r\n\t\t}\r\n\t}\r\n\r\n\tsetCompassDirection() {\r\n\t\tthis.latCompassLetter = this.currentValue.latitude.isNegative ? \"S\" : \"N\";\r\n\t\tthis.lonCompassLetter = this.currentValue.longitude.isNegative ? \"W\" : \"E\";\r\n\t}\r\n\r\n\tswapLatCompass() {\r\n\t\tthis.currentValue.latitude.isNegative = !this.currentValue.latitude.isNegative;\r\n\t\tthis.setCompassDirection();\r\n\t}\r\n\r\n\tswapLonCompass() {\r\n\t\tthis.currentValue.longitude.isNegative = !this.currentValue.longitude.isNegative;\r\n\t\tthis.setCompassDirection();\r\n\t}\r\n\r\n\tgetCurrentValue = (isApiCall) => {\r\n\t\tlet result = this.buildResult();\r\n\r\n\t\tif(!isApiCall) {\r\n\t\t\tif(!result) {\r\n\t\t\t\tresult = { FieldId: this.field.Id };\r\n\t\t\t\tresult.hasResultForRuleRun = false;\r\n\t\t\t}\r\n\t\t\tresult.factor = 1;\r\n\t\t\tresult.isDirty = this.field.IsNotReported !== true\r\n\t\t\t\t&& this.field.IsHidden !== true\r\n\t\t\t\t&& (result && result.Latitude != (this.initialValue && this.initialValue.Latitude))\r\n\t\t\t\t&& (result && result.Longitude != (this.initialValue && this.initialValue.Longitude));\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\trevertValue() {\r\n\t\tconst lonDms = degreesToDms(this.initialValue.Longitude);\r\n\t\tconst latDms = degreesToDms(this.initialValue.Latitude);\r\n\r\n\t\tthis.currentValue.latitude.degrees = latDms.degrees;\r\n\t\tthis.currentValue.latitude.minutes = this.currentValue.roundedMinutes = latDms.minutes;\r\n\r\n\t\tthis.currentValue.longitude.degrees = lonDms.degrees;\r\n\t\tthis.currentValue.longitude.minutes = this.currentValue.roundedMinutes = lonDms.minutes;\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValue = this.field.IsDetail ? undefined : this.buildResult();\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\tlet result = undefined;\r\n\t\tconst latDegrees = dmsToDegrees(this.currentValue.latitude);\r\n\t\tconst lonDegrees = dmsToDegrees(this.currentValue.longitude);\r\n\t\tif(latDegrees && lonDegrees) {\r\n\t\t\tresult = {\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\tLatitude: latDegrees,\r\n\t\t\t\tLongitude: lonDegrees\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tsetValue(value, fromEvent = false) {\r\n\t\tthis.value = value ? value : find(this.values, v => v.FieldId === this.field.Id);\r\n\t\tthis.currentValue = {\r\n\t\t\tlatitude: {},\r\n\t\t\tlongitude: {}\r\n\t\t};\r\n\r\n\t\tif(this.value) {\r\n\t\t\tthis.currentValue.latitude = degreesToDms(this.value.Latitude, fromEvent);\r\n\t\t\tthis.currentValue.longitude = degreesToDms(this.value.Longitude, fromEvent);\r\n\t\t} else {\r\n\t\t\tthis.currentValue.longitude.isNegative = true;\r\n\t\t}\r\n\r\n\t\tthis.setCompassDirection();\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\tregisterFieldController = (fieldController) => {\r\n\t\tthis.fieldControllers.push(fieldController);\r\n\t\treturn function unregister() {\r\n\t\t\tconst idx = findIndex(this.fieldControllers, x => x === fieldController);\r\n\t\t\tif(idx !== -1) {\r\n\t\t\t\tthis.fieldControllers.splice(idx, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tsetFeatures() {\r\n\t\tthis.lookups.push({\r\n\t\t\tname: FEATURE_TYPES.boundlessMapPoint,\r\n\t\t\tfieldId: this.field.Id,\r\n\t\t\tdisabled: false,\r\n\t\t\tdefaultPosition: (\r\n\t\t\t\tthis.field.Center && this.field.Zoom ? {\r\n\t\t\t\t\tcenter: this.field.Center.split(\",\").map(v => parseFloat(v)),\r\n\t\t\t\t\tzoom: parseFloat(this.field.Zoom)\r\n\t\t\t\t} : undefined\r\n\t\t\t),\r\n\t\t\tmode: \"DEGREES_MINUTES_SECONDS\",\r\n\t\t\tgetCurrentValue: () => this.buildResult(),\r\n\t\t\tisUpdatable: () => !this.field.isReadonly && !this.field.isDisabled,\r\n\t\t\tdegreeMapper: (rawDegrees, isMapRequest) => degreesToDms(rawDegrees, isMapRequest),\r\n\t\t\taction: (selection) => {\r\n\t\t\t\tthis.setValue({\r\n\t\t\t\t\tLatitude: selection.lat,\r\n\t\t\t\t\tLongitude: selection.lng\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetCoordinates() {\r\n\t\treturn `${this.currentValue.latitude.degrees}°${this.latCompassLetter} ${this.currentValue.latitude.minutes}',\r\n\t\t\t${this.currentValue.longitude.degrees}°${this.lonCompassLetter} ${this.currentValue.longitude.minutes}'`;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.coordinate.dms\", [])\r\n\t.component(\"dms\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n\";","import { repeat } from \"./polyfills.js\";\r\n\r\nexport const roundToNearestIncrement = (num, field) => {\r\n\tlet evalValue = num;\r\n\tif(num < 0) {\r\n\t\tevalValue = num * -1;\r\n\t}\r\n\r\n\tif(evalValue === null) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tlet step = field.IncrementingStep || 1;\r\n\r\n\tif(field.RoundingPoint) {\r\n\t\tstep = Number(`0.${repeat(\"0\", field.RoundingPoint - 1)}1`);\r\n\t}\r\n\r\n\tconst deltaFromLow = roundToFourDigits(evalValue % step);\r\n\tconst low = roundToFourDigits(evalValue - deltaFromLow);\r\n\tconst high = roundToFourDigits(low + step);\r\n\r\n\tconst lowDelta = roundToFourDigits(evalValue - low);\r\n\tconst highDelta = roundToFourDigits(high - evalValue);\r\n\r\n\tlet retVal = lowDelta >= highDelta ? high : low;\r\n\tif(num < 0) {\r\n\t\tretVal *= -1;\r\n\t}\r\n\r\n\tif(!field.IsZeroPadded) {\r\n\t\treturn retVal;\r\n\t}\r\n\r\n\treturn retVal.toFixed(field.RoundingPoint);\r\n\r\n\tfunction roundToFourDigits(dec) {\r\n\t\tif(dec.toString().indexOf(\"e\") > -1) {\r\n\t\t\treturn Number(Math.round(dec) + \"e-4\");\r\n\t\t}\r\n\t\treturn Number(Math.round(dec + \"e4\") + \"e-4\");\r\n\t}\r\n};\r\n\r\n// this is for when a user has input a value in a number field, and navigates away from it\r\nexport const isValidCompleteNumber = (num) => isValidPartialNumber(num) && !isNaN(num);\r\n// this is for when a user is in the process of inputting a number\r\nexport const isValidPartialNumber = (num) => /^-?(?:[0-9]{0,12})(\\.[0-9]{0,12})?$/.test(num);\r\n\r\n\r\nexport const roundToRoundingPoint = (val, field) => {\r\n\tconst places = field.RoundingPoint;\r\n\t\r\n\tif(places === undefined)\r\n\t\treturn val;\r\n\r\n\t// don't mutate if already less precise\r\n\tif(getPrecision(val) < places)\r\n\t\treturn val;\r\n\r\n\treturn +val.toFixed(places);\r\n};\r\n\r\nexport function getPrecision(num) {\r\n\tnum = parseFloat(num); \r\n\tif(isNaN(num))\r\n\t\treturn num;\r\n\t\r\n\tif(!isFinite(num))\r\n\t\treturn 0;\r\n\r\n\tlet e = 1, p = 0;\r\n\r\n\twhile(Math.round(num * e) / e !== num) {\r\n\t\te *= 10;\r\n\t\tp++;\r\n\t}\r\n\r\n\treturn p;\r\n}\r\n\r\n\r\n\r\n","import {\r\n\tfind,\r\n\tfindIndex\r\n} from \"lodash\";\r\nimport template from \"./decimal-degrees.html\";\r\nimport \"./decimal-degrees.less\";\r\n\r\nimport {\r\n\tEVENT_FIELD_DISABLE,\r\n\tEVENT_FIELD_ENABLE,\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_UNCLEAR_VALUE,\r\n\tFEATURE_TYPES,\r\n\tEVENT_REPORT_LOCKED,\r\n\tEVENT_REVERT_VALUES\r\n} from \"constants.js\";\r\n\r\nimport { roundToRoundingPoint } from \"services/math-service.js\";\r\n\r\nexport class Controller {\r\n\tcurrentValue = { unit: {} };\r\n\tfieldControllers = [];\r\n\tlookups = [];\r\n\r\n\tconstructor($scope, $logger, eventBus, featureHelper) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.featureHelper = featureHelper;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tthis.setValue();\r\n\t\tthis.setFeatures();\r\n\r\n\t\tconst self = this;\r\n\t\tthis._eventBus.register(EVENT_SET_VALUE(this.field.Id), (e, params) => self.setValue(params.value, true), this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!self.cleared && (!!self.currentValue?.latitude || !!self.currentValue?.longitude)) {\r\n\t\t\t\tself.cleared = {\r\n\t\t\t\t\tcurrentValue: {\r\n\t\t\t\t\t\tlatitude: {\r\n\t\t\t\t\t\t\tnumber: self.currentValue.latitude.number\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tlongitude: {\r\n\t\t\t\t\t\t\tnumber: self.currentValue.longitude.number\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tself.currentValue.latitude.number = undefined;\r\n\t\t\tself.currentValue.longitude.number = undefined;\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_UNCLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!!this.cleared) {\r\n\t\t\t\tself.currentValue = self.cleared.currentValue;\r\n\t\t\t\tself.cleared = undefined;\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_FIELD_DISABLE(this.field.Id), () => self.disableField(), this._scope);\r\n\t\tthis._eventBus.register(EVENT_FIELD_ENABLE(this.field.Id), () => self.enableField(), this._scope);\r\n\t\tthis._eventBus.register(EVENT_REPORT_LOCKED, () => self.field.isReadonly = true, this._scope);\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\t}\r\n\r\n\tenableField() {\r\n\t\tthis.field.isDisabled = false;\r\n\t\tthis.field.placeHolder = null;\r\n\t\tthis.lookups.forEach(l => l.disabled = false);\r\n\t}\r\n\r\n\tdisableField() {\r\n\t\tthis.field.isDisabled = true;\r\n\t\tif(!!this.currentValue) {\r\n\t\t\tthis.lookups.forEach(l => l.disabled = false);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.lookups.forEach(l => l.disabled = true);\r\n\t\t}\r\n\t}\r\n\r\n\tgetCurrentValue = (isApiCall) => {\r\n\t\tlet result = this.buildResult();\r\n\r\n\t\tif(!isApiCall) {\r\n\t\t\tif(!result) {\r\n\t\t\t\tresult = { FieldId: this.field.Id };\r\n\t\t\t\tresult.hasResultForRuleRun = false;\r\n\t\t\t}\r\n\t\t\tresult.factor = 1;\r\n\t\t\tresult.isDirty = this.field.IsNotReported !== true\r\n\t\t\t\t&& this.field.IsHidden !== true\r\n\t\t\t\t&& (result && result.Latitude != (this.initialValue && this.initialValue.Latitude))\r\n\t\t\t\t&& (result && result.Longitude != (this.initialValue && this.initialValue.Longitude));\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\trevertValue() {\r\n\t\tconst lonDeg = this.initialValue?.Longitude;\r\n\t\tconst latDeg = this.initialValue?.Latitude;\r\n\r\n\t\tthis.currentValue.latitude.number = latDeg;\r\n\r\n\t\tthis.currentValue.longitude.number = lonDeg;\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValue = this.field.IsDetail ? undefined : this.buildResult();\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\tlet result = undefined;\r\n\t\tconst latDegrees = this.currentValue.latitude.number;\r\n\t\tconst lonDegrees = this.currentValue.longitude.number;\r\n\t\tif(latDegrees && lonDegrees) {\r\n\t\t\tresult = {\r\n\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\tLatitude: latDegrees,\r\n\t\t\t\tLongitude: lonDegrees\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tsetValue(value) {\r\n\t\tthis.value = value ? value : find(this.values, v => v.FieldId === this.field.Id);\r\n\t\tthis.currentValue = {\r\n\t\t\tlatitude: {\r\n\t\t\t\tnumber: undefined\r\n\t\t\t},\r\n\t\t\tlongitude: {\r\n\t\t\t\tnumber: undefined\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif(this.value) {\r\n\t\t\tthis.currentValue.latitude.number = roundToRoundingPoint(this.value.Latitude, this.field);\r\n\t\t\tthis.currentValue.longitude.number = roundToRoundingPoint(this.value.Longitude, this.field);\r\n\t\t}\r\n\r\n\t\tconst isDirtyLat = (this.value && this.value.Latitude) !== (this.initialValue && this.initialValue.Latitude);\r\n\t\tconst isDirtyLon = (this.value && this.value.Longitude) !== (this.initialValue && this.initialValue.Longitude);\r\n\r\n\t\tthis.setFieldDirty(this.field.Id, isDirtyLat || isDirtyLon);\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\tregisterFieldController = (fieldController) => {\r\n\t\tthis.fieldControllers.push(fieldController);\r\n\t\treturn function unregister() {\r\n\t\t\tconst idx = findIndex(this.fieldControllers, x => x === fieldController);\r\n\t\t\tif(idx !== -1) {\r\n\t\t\t\tthis.fieldControllers.splice(idx, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tsetFeatures() {\r\n\t\tthis.lookups.push({\r\n\t\t\tname: FEATURE_TYPES.boundlessMapPoint,\r\n\t\t\troundingPoint: this.field.RoundingPoint,\r\n\t\t\tfieldId: this.field.Id,\r\n\t\t\tdisabled: false,\r\n\t\t\tdefaultPosition: (\r\n\t\t\t\tthis.field.Center && this.field.Zoom ? {\r\n\t\t\t\t\tcenter: this.field.Center.split(\",\").map(v => parseFloat(v)),\r\n\t\t\t\t\tzoom: parseFloat(this.field.Zoom)\r\n\t\t\t\t} : undefined\r\n\t\t\t),\r\n\t\t\tmode: \"DECIMAL_DEGREES\",\r\n\t\t\tgetCurrentValue: () => this.buildResult(),\r\n\t\t\tisUpdatable: () => !this.field.isReadonly && !this.field.isDisabled,\r\n\t\t\tdegreeMapper: (rawDegrees) => {\r\n\t\t\t\treturn roundToRoundingPoint(rawDegrees, this.field);\r\n\t\t\t},\r\n\t\t\taction: (selection) => {\r\n\t\t\t\tthis.setValue({\r\n\t\t\t\t\tLatitude: roundToRoundingPoint(selection.lat, this.field),\r\n\t\t\t\t\tLongitude: roundToRoundingPoint(selection.lng, this.field)\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetCoordinates() {\r\n\t\treturn `${this.currentValue.latitude.number}, ${this.currentValue.longitude.number}`;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.coordinate.decimal-degrees\", [])\r\n\t.component(\"decimalDegrees\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n\";","import template from \"./coordinate.html\";\r\nimport \"./coordinate.less\";\r\n\r\nimport dms from \"./modes/dms.js\";\r\nimport deg from \"./modes/decimal-degrees.js\";\r\n\r\nexport class Controller {\r\n\t$onInit() {\r\n\t\t// this.mode = \"DEGREES_MINUTES_SECONDS\";\r\n\t\tthis.mode = \"DECIMAL_DEGREES\";\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.coordinate\", [dms, deg])\r\n\t.component(\"coordinate\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\r\\n\";","import moment from \"moment-timezone\";\r\nimport template from \"./year-month.html\";\r\nimport \"./year-month.less\";\r\nimport {\r\n\tfind, \r\n\torderBy \r\n} from \"lodash\";\r\nimport {\r\n\tEVENT_FILTER_PRIMARYDATE,\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_UNCLEAR_VALUE,\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_PAGE_LOADED,\r\n\tEVENT_SET_FORM_PRISTINE\r\n} from \"constants.js\";\r\n\r\nconst months = [\r\n\t\"January\",\r\n\t\"February\",\r\n\t\"March\",\r\n\t\"April\",\r\n\t\"May\",\r\n\t\"June\",\r\n\t\"July\",\r\n\t\"August\",\r\n\t\"September\",\r\n\t\"October\",\r\n\t\"November\",\r\n\t\"December\"\r\n];\r\n\r\nexport class Controller {\r\n\tselection = {};\r\n\r\n\tconstructor($scope, eventBus, $timeout, $logger, appState, uiHelpers) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.appState = appState;\r\n\t\tthis.uiHelpers = uiHelpers;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tconst form = this.appState.forms.selected;\r\n\r\n\t\tthis.availableYears = [];\r\n\t\tlet earliestYear = orderBy(\r\n\t\t\tform.Seasons.map((season) => {\r\n\t\t\t\treturn moment(season.BeginInclusive).year();\r\n\t\t\t}),\r\n\t\t\t(year) => year,\r\n\t\t\t[\"asc\"]\r\n\t\t)[0];\r\n\t\tconst currentYear = moment().year();\r\n\r\n\t\twhile(earliestYear <= currentYear) {\r\n\t\t\tthis.availableYears.push(earliestYear);\r\n\t\t\tearliestYear++;\r\n\t\t}\r\n\r\n\t\tthis.availableYears = orderBy(this.availableYears, (year) => year, [\"desc\"]);\r\n\t\tthis.allOptions = {\r\n\t\t\tmonths: months.map((c, index) => ({ Name: c, Code: c, Order: index })),\r\n\t\t\tyears: this.availableYears.map((c, index) => ({ Name: c.toString(), Code: c.toString(), Order: index }))\r\n\t\t};\r\n\r\n\t\tthis._unregister = this.reportFormCtrl.registerFieldController(this);\r\n\r\n\t\tthis.setValue();\r\n\r\n\t\tthis.monthLabel = `${this.field.Name}-month`;\r\n\t\tthis.yearLabel = `${this.field.Name}-year`;\r\n\t\tthis.monthFieldId = `${this.field.Id}-month`;\r\n\t\tthis.yearFieldId = `${this.field.Id}-year`;\r\n\r\n\t\tthis._eventBus.register(EVENT_CLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!this.cleared && (!!this.selectedMonth)) {\r\n\t\t\t\tthis.cleared = {\r\n\t\t\t\t\tselectedMonth: {\r\n\t\t\t\t\t\tmonth: this.month,\r\n\t\t\t\t\t\tyear: this.year\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tthis.selectedMonth = null;\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_UNCLEAR_VALUE(this.field.Id), () => {\r\n\t\t\tif(!!this.cleared) {\r\n\t\t\t\tthis.selectedMonth = this.cleared.selectedMonth;\r\n\t\t\t\tthis.cleared = undefined;\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_VALUE(this.field.Id), (e, params) => {\r\n\t\t\tif(!this.selectedMonth) {\r\n\t\t\t\tthis.externalSet = true;\r\n\t\t\t\tthis.selectedMonth = {\r\n\t\t\t\t\tmonth: moment(params.value).month(),\r\n\t\t\t\t\tyear: moment(params.value).year()\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.$timeout(() => this._scope.$apply());\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_REVERT_VALUES, () => {\r\n\t\t\tthis.revertValue();\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_PAGE_LOADED, () => {\r\n\t\t\tthis.initialValue = find(this.values, v => v.FieldId === this.field.Id);\r\n\t\t\tif(!!this.initialValue) {\r\n\t\t\t\tconst localShiftedMoment = moment(this.initialValue.Date, \"YYYY-MM-DDThh:mm:ss\");\r\n\t\t\t\tthis.initialValue.Date = moment(localShiftedMoment.toDate()).tz(this.field.timezone, true)\r\n\t\t\t\t\t.format(\"YYYY-MM-DDTHH:mm:00Z\");\r\n\t\t\t}\r\n\t\t}, this._scope);\r\n\r\n\t\tthis._eventBus.register(EVENT_SET_FORM_PRISTINE, () => {\r\n\t\t\tthis.setPristine();\r\n\t\t}, this._scope);\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tthis._unregister();\r\n\t}\r\n\r\n\tgetCurrentValue(isApiCall = false) {\r\n\t\tlet result = this.buildResult();\r\n\r\n\t\tif(!isApiCall && this.field.IsNotReported !== true && this.field.IsHidden !== true) {\r\n\t\t\tif(!result) {\r\n\t\t\t\tresult = { FieldId: this.field.Id };\r\n\t\t\t\tresult.hasResultForRuleRun = false;\r\n\t\t\t}\r\n\t\t\tresult.isDirty = (result.Date && moment(result.Date).format()) != (this.initialValue && moment(this.initialValue.Date).format());\r\n\t\t}\r\n\r\n\t\treturn result ? [result] : [];\r\n\t}\r\n\r\n\tconvertJsDateToYearMonth(date) {\r\n\t\tif(!date) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tmonth: this.allOptions.months[moment(date).month()].Code,\r\n\t\t\tyear: moment(date)\r\n\t\t\t\t.year()\r\n\t\t\t\t.toString()\r\n\t\t};\r\n\t}\r\n\r\n\trevertValue() {\r\n\t\tif(this.initialValue) {\r\n\t\t\tconst localShiftedMoment = this.initialValue && moment(this.initialValue.Date, \"YYYY-MM-DDThh:mm:ss\");\r\n\r\n\t\t\tconst date = localShiftedMoment.toDate(); //this value is now clean for the field\r\n\r\n\t\t\tthis.selectedMonth = this.convertJsDateToYearMonth(date);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.selectedMonth = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPristine() {\r\n\t\tthis.initialValue = this.buildResult();\r\n\t}\r\n\r\n\tgetJsDate = () => {\r\n\t\tif(!this.field.timezone) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tif(this.selectedMonth === undefined) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst outgoingDate = moment.utc()\r\n\t\t\t.year(this.selectedMonth.year)\r\n\t\t\t.month(this.selectedMonth.month)\r\n\t\t\t.date(1)\r\n\t\t\t.hours(0)\r\n\t\t\t.minutes(0)\r\n\t\t\t.seconds(0)\r\n\t\t\t.milliseconds(0)\r\n\t\t\t.tz(this.field.timezone, true);\r\n\r\n\t\treturn outgoingDate;\r\n\t}\r\n\r\n\tbuildResult() {\r\n\t\tif(!this.field.timezone) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.selectedMonth !== undefined) {\r\n\t\t\tconst outgoingDate = this.getJsDate();\r\n\r\n\t\t\tif(outgoingDate !== null) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tFieldId: this.field.Id,\r\n\t\t\t\t\tDate: outgoingDate.format()\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn undefined;\r\n\t}\r\n\r\n\tsetValue() {\r\n\t\tthis.value = find(this.values, v => v.FieldId === this.field.Id);\r\n\r\n\t\tif(this.value) {\r\n\t\t\t// This is incoming data path from VESL server/API\r\n\t\t\tconst localShiftedMoment = moment(this.value.Date, \"YYYY-MM-DDThh:mm:ss\");\r\n\r\n\t\t\tconst date = localShiftedMoment.toDate(); //this value is now clean for the field\r\n\r\n\t\t\tthis.selectedMonth = this.convertJsDateToYearMonth(date);\r\n\t\t}\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n\r\n\tsetMonthDisplay(id) {\r\n\t\tconst item = this.allOptions.months.find(o => o.Code === id);\r\n\r\n\t\tif(!item) {\r\n\t\t\tthrow new Error(`Selected ${this.field.Name} not found as a month option.`);\r\n\t\t}\r\n\r\n\t\tconst entityDisplay = this.uiHelpers.getEntityDisplay(item, undefined, true, true);\r\n\r\n\t\treturn entityDisplay;\r\n\t}\r\n\r\n\tsetYearDisplay(id) {\r\n\t\tconst item = this.allOptions.years.find(o => o.Code === id);\r\n\r\n\t\tif(!item) {\r\n\t\t\tthrow new Error(`Selected ${this.field.Name} not found as a year option.`);\r\n\t\t}\r\n\r\n\t\tconst entityDisplay = this.uiHelpers.getEntityDisplay(item, undefined, true, true);\r\n\r\n\t\treturn entityDisplay;\r\n\t}\r\n\r\n\thandleMonthChanged(modelVal) {\r\n\t\tif(modelVal !== null && modelVal !== undefined) {\r\n\t\t\tthis.selectedMonth = {\r\n\t\t\t\t...this.selectedMonth ?? {},\r\n\t\t\t\tmonth: modelVal\r\n\t\t\t};\r\n\t\t\tthis.initialValueSet = false;\r\n\t\t}\r\n\r\n\t\tthis.cleared = undefined;\r\n\t\tif(!!this.isMonthReady && this.selectedMonth?.year) {\r\n\t\t\tthis.triggerValueChanged(this.getJsDate());\r\n\t\t}\r\n\t}\r\n\r\n\thandleYearChanged(modelVal) {\r\n\t\tif(modelVal !== null && modelVal !== undefined) {\r\n\t\t\tthis.selectedMonth = {\r\n\t\t\t\t...this.selectedMonth ?? {},\r\n\t\t\t\tyear: modelVal\r\n\t\t\t};\r\n\t\t\tthis.initialValueSet = false;\r\n\t\t}\r\n\r\n\t\tthis.cleared = undefined;\r\n\t\tif(!!this.isYearReady && this.selectedMonth?.month) {\r\n\t\t\tthis.triggerValueChanged(this.getJsDate());\r\n\t\t}\r\n\t}\r\n\r\n\ttriggerValueChanged(value) {\r\n\t\tconst params = {\r\n\t\t\tfield: this.field,\r\n\t\t\tvalue\r\n\t\t};\r\n\r\n\t\tif(this.initialValueSet) {\r\n\t\t\tparams.initialValue = true;\r\n\t\t}\r\n\r\n\t\tif(this.field.IsPrimary) {\r\n\t\t\tthis._eventBus.trigger(EVENT_FILTER_PRIMARYDATE, {\r\n\t\t\t\tdate: value\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id), params);\r\n\r\n\t\tthis.updateFieldDirty();\r\n\t}\r\n\r\n\tupdateFieldDirty() {\r\n\t\tconst result = this.getCurrentValue();\r\n\r\n\t\tthis.setFieldDirty(this.field.Id, result[0].isDirty);\r\n\t}\r\n\r\n\tsetMonthBox(box) {\r\n\t\tthis.monthBox = box;\r\n\t\tconst months = this.allOptions.months;\r\n\t\tconst monthChoices = this.uiHelpers.setDisplay(\r\n\t\t\tmonths, \r\n\t\t\t{ \r\n\t\t\t\trecentlyUsedEnabled: false, \r\n\t\t\t\thideCode: true \r\n\t\t\t}\r\n\t\t);\r\n\t\tthis.monthBox.setChoices(monthChoices, \"value\", \"label\");\r\n\r\n\t\tif(this.selectedMonth?.month) {\r\n\t\t\tthis.monthBox.setValueByChoice(this.selectedMonth?.month);\r\n\t\t}\r\n\r\n\t\tthis.isMonthReady = true;\r\n\t}\r\n\r\n\tsetYearBox(box) {\r\n\t\tthis.yearBox = box;\r\n\t\tconst years = this.allOptions.years;\r\n\t\tconst yearChoices = this.uiHelpers.setDisplay(\r\n\t\t\tyears, \r\n\t\t\t{ \r\n\t\t\t\trecentlyUsedEnabled: false, \r\n\t\t\t\thideCode: true \r\n\t\t\t}\r\n\t\t);\r\n\t\tthis.yearBox.setChoices(yearChoices, \"value\", \"label\");\r\n\r\n\t\tif(this.selectedMonth?.year) {\r\n\t\t\tthis.yearBox.setValueByChoice(this.selectedMonth?.year);\r\n\t\t}\r\n\r\n\t\tthis.isYearReady = true;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.year-month\", [])\r\n\t.component(\"yearMonth\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t},\r\n\t\trequire: {\r\n\t\t\treportFormCtrl: \"^reportForm\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t\\r\\n\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\t

--empty--

\\r\\n\\t
\\r\\n\";","import template from \"./degree-minute-field.html\";\r\nimport \"./degree-minute-field.less\";\r\n\r\nexport class Controller {\r\n\tconstructor($scope, $logger, eventBus, featureHelper) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis._eventBus = eventBus;\r\n\t\t// eslint-disable-next-line no-useless-escape\r\n\t\tthis.isNumber = /^(\\-)?(\\d*(\\.|\\.\\d+)?)?$/;\r\n\t\tthis.featureHelper = featureHelper;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.field.options = this.field.Data;\r\n\t\tthis.initialMinutes = this.fieldValue.roundedMinutes;\r\n\t\tthis.initialDegrees = this.fieldValue.degrees;\r\n\t}\r\n\r\n\thandleMinutesChanged(newValue, oldValue) {\r\n\t\tthis.fieldValue.roundedMinutes = this.onNumberChanged(newValue, oldValue, \"roundedMinutes\");\r\n\r\n\t\tif(this.fieldValue.roundedMinutes > 59) {\r\n\t\t\tthis.fieldValue.roundedMinutes = 59;\r\n\t\t} else if(this.fieldValue.roundedMinutes < 0) {\r\n\t\t\tthis.fieldValue.roundedMinutes = 0;\r\n\t\t}\r\n\r\n\t\tthis.checkDirty();\r\n\t}\r\n\r\n\tgetCoordinates() {\r\n\t\treturn `${this.fieldValue.degrees}° ${this.fieldValue.minutes}'`;\r\n\t}\r\n\r\n\thandleDegreesChanged(newValue, oldValue) {\r\n\t\tthis.fieldValue.degrees = this.onNumberChanged(newValue, oldValue, \"degrees\");\r\n\r\n\t\tif(this.field.Key.Code === \"TRIP.AREAS.LATITUDE.SINGLE\") {\r\n\t\t\tif(this.fieldValue.degrees > 90) {\r\n\t\t\t\tthis.fieldValue.degrees = 90;\r\n\t\t\t} else if(this.fieldValue.degrees < -90) {\r\n\t\t\t\tthis.fieldValue.degrees = -90;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif(this.fieldValue.degrees > 180) {\r\n\t\t\t\tthis.fieldValue.degrees = 180;\r\n\t\t\t} else if(this.fieldValue.degrees < -180) {\r\n\t\t\t\tthis.fieldValue.degrees = -180;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.checkDirty();\r\n\t}\r\n\r\n\tonNumberChanged(newValue, oldValue, propName) {\r\n\t\tif(newValue === \"\") {\r\n\t\t\tthis.fieldValue[propName] = \"\";\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\treturn newValue.match(this.isNumber) ? newValue : oldValue;\r\n\t}\r\n\r\n\tcheckDirty() {\r\n\t\tconst isMinutesDirty = this.initialMinutes !== parseInt(this.fieldValue.roundedMinutes);\r\n\t\tconst isDegreesDirty = this.initialDegrees !== parseInt(this.fieldValue.degrees);\r\n\r\n\t\tthis.setFieldDirty(this.field.Id, isMinutesDirty || isDegreesDirty);\r\n\t}\r\n\r\n\thandleKeyUp(event) {\r\n\t\tconst regex = /[0-9.-\\\\t]/;\r\n\t\tconst isValid = regex.test(event.key);\r\n\r\n\t\tif(!isValid) {\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t}\r\n\r\n\thandleBlur() {\r\n\t\tthis.forcePositive();\r\n\r\n\t\tconst fullMinutes = this.fieldValue.roundedMinutes;\r\n\r\n\t\tthis.fieldValue.minutes = Math.round(fullMinutes);\r\n\t\tthis.fieldValue.roundedMinutes = this.fieldValue.minutes;\r\n\t}\r\n\r\n\tforcePositive() {\r\n\t\tif(this.fieldValue.degrees < 0) {\r\n\t\t\tthis.fieldValue.isNegative = !this.fieldValue.isNegative;\r\n\t\t\t// this.setCompassDirection();\r\n\t\t}\r\n\t\tthis.fieldValue.degrees = Math.abs(this.fieldValue.degrees);\r\n\t\tthis.fieldValue.minutes = Math.abs(this.fieldValue.minutes);\r\n\t\tthis.fieldValue.roundedMinutes = Math.abs(this.fieldValue.roundedMinutes);\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\treturn this.field.hasValidationError ? \"validation-error\"\r\n\t\t\t: this.field.hasValidationWarning ? \"validation-warning\" : \"\";\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.degree-minute-field\", [])\r\n\t.component(\"degreeMinuteField\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tfieldValue: \"=\",\r\n\t\t\tcompassLetter: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t{{$ctrl.getCoordinates()}}\\r\\n\\t\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t

--empty--

\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t °{{$ctrl.compassLetter}} \\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\r\\n
\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t

--empty--

\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t ' \\r\\n\\t\\t
\\r\\n\\t
\\r\\n\";","/* eslint-disable no-useless-escape */\r\nimport {\r\n\tdebounce, \r\n\tfind \r\n} from \"lodash\";\r\nimport template from \"./number-field.html\";\r\nimport \"./number-field.less\";\r\n\r\nimport {\r\n\tEVENT_SET_FORM_DIRTY, \r\n\tEVENT_VALUE_CHANGED \r\n} from \"constants.js\";\r\nimport {\r\n\troundToNearestIncrement, \r\n\troundToRoundingPoint,\r\n\tisValidCompleteNumber,\r\n\tisValidPartialNumber\r\n} from \"services/math-service.js\";\r\n\r\nexport class Controller {\r\n\tlookups = [];\r\n\r\n\tconstructor(eventBus, $logger) {\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.$logger = $logger;\r\n\r\n\t\tthis.trailingComma = /^[1-9]\\d*(\\.\\d+)?$/;\r\n\t\tthis.incrementingStep = 1;\r\n\t\tthis.digitCount = 0;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.initialFieldValue = this.fieldValue?.number?.toString();\r\n\r\n\t\tif(this.field.IncrementingStep) {\r\n\t\t\tthis.incrementingStep = this.field.IncrementingStep;\r\n\t\t\tconst decimalSplit = `${this.field.IncrementingStep}`.split(\".\");\r\n\t\t\tthis.digitCount = decimalSplit[1] ? decimalSplit[1].length : 0;\r\n\t\t}\r\n\t}\r\n\r\n\tonFocus() {\r\n\t\tthis.lastSetValue = this.fieldValue?.number;\r\n\t}\r\n\r\n\tincrement() {\r\n\t\tthis._eventBus.trigger(EVENT_SET_FORM_DIRTY);\r\n\r\n\t\tconst factor = this.fieldValue.unit && this.fieldValue.unit.Factor || 1;\r\n\t\tif(this.fieldValue.number >= Math.floor(this.field.MaxValue / factor)) {\r\n\t\t\tthis.fieldValue.number = Math.floor(this.field.MaxValue / factor).toString();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.fieldValue.number) {\r\n\t\t\tthis.fieldValue.number = (1 * this.incrementingStep).toString();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst number = (parseFloat(this.fieldValue.number) + (1 * this.incrementingStep));\r\n\t\tthis.fieldValue.number = number.toFixed(this.digitCount);\r\n\r\n\t\tthis.checkDirty();\r\n\t}\r\n\r\n\tdecrement() {\r\n\t\tthis._eventBus.trigger(EVENT_SET_FORM_DIRTY);\r\n\r\n\t\tconst factor = this.fieldValue.unit && this.fieldValue.unit.Factor || 1;\r\n\t\tif(this.fieldValue.number <= Math.ceil(this.field.MinValue / factor)) {\r\n\t\t\tthis.fieldValue.number = Math.ceil(this.field.MinValue / factor).toString();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.fieldValue.number) {\r\n\t\t\tthis.fieldValue.number = (this.field.MinValue === 0 ? 0 : -1 * this.incrementingStep).toString();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst number = parseFloat(this.fieldValue.number) - (1 * this.incrementingStep);\r\n\t\tthis.fieldValue.number = number.toFixed(this.digitCount);\r\n\r\n\t\tthis.checkDirty();\r\n\t}\r\n\r\n\thandleKeyUp(event) {\r\n\t\tconst regex = /[0-9.-\\\\t]/;\r\n\t\tconst isValid = regex.test(event.key);\r\n\r\n\t\tif(!isValid) {\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t}\r\n\r\n\thandleBlur() {\r\n\t\tif(!isValidCompleteNumber(this.fieldValue.number)) {\r\n\t\t\tthis.fieldValue.number = \"\";\r\n\t\t}\r\n\r\n\t\tif(this.fieldValue.number) {\r\n\t\t\tif(!!this.roundToField) {\r\n\t\t\t\tthis.fieldValue.number = roundToRoundingPoint(this.fieldValue.number, this.field).toString();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.fieldValue.number = roundToNearestIncrement(this.fieldValue.number, this.field).toString();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.checkDirty();\r\n\t}\r\n\r\n\thandleNumberUpdate = debounce((next, prev) => {\r\n\t\tif(next && (next !== prev)) {\r\n\t\t\tthis.triggerNumberValueChange(next);\r\n\t\t}\r\n\t}, 750, {\r\n\t\t\"leading\": true,\r\n\t\t\"trailing\": true\r\n\t});\r\n\r\n\tonNumberChanged(newValue, oldValue) {\r\n\t\tthis.fieldValue.number = (isValidPartialNumber(newValue) ? newValue : oldValue);\r\n\r\n\t\tthis.handleNumberUpdate(this.fieldValue.number, oldValue);\r\n\r\n\t\tthis.checkDirty(true);\r\n\t}\r\n\r\n\tgetValidationStyling() {\r\n\t\tif(this.field.hasValidationError || this.hasRepeatError) {\r\n\t\t\tif(this.repeatId) {\r\n\t\t\t\tlet isThisField = find(this.field.validationErrorRepeatIds, (id) => id === this.repeatId);\r\n\t\t\t\tisThisField = isThisField || this.hasRepeatError === true;\r\n\t\t\t\treturn isThisField && \"validation-error\";\r\n\t\t\t}\r\n\t\t\treturn \"validation-error\";\r\n\t\t}\r\n\t\telse if(this.field.hasValidationWarning) {\r\n\t\t\tif(this.repeatId) {\r\n\t\t\t\tconst isThisField = find(this.field.validationWarningRepeatIds, (id) => id === this.repeatId);\r\n\t\t\t\treturn isThisField && \"validation-warning\";\r\n\t\t\t}\r\n\t\t\treturn \"validation-warning\";\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tcheckDirty(skipUpdateTrigger = false) {\r\n\t\tconst isDirty = (this.fieldValue && this.fieldValue.number) !== this.initialFieldValue;\r\n\t\tthis.setFieldDirty(this.field.Id, isDirty);\r\n\r\n\t\tif(skipUpdateTrigger === false) {\r\n\t\t\tthis.triggerNumberValueChange();\r\n\t\t}\r\n\t}\r\n\r\n\ttriggerNumberValueChange = (value) => {\r\n\t\tconst newValue = value ?? this.fieldValue?.number;\r\n\r\n\t\tif(newValue !== this.lastSetValue) {\r\n\t\t\tconst params = {\r\n\t\t\t\tfield: this.field\r\n\t\t\t};\r\n\t\r\n\t\t\tthis._eventBus.trigger(EVENT_VALUE_CHANGED(this.field.Id), params);\r\n\r\n\t\t\tthis.lastSetValue = newValue;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form.number-field\", [])\r\n\t.component(\"numberField\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tfieldValue: \"=\",\r\n\t\t\thasRepeatError: \"<\",\r\n\t\t\tpivotRow: \"=\",\r\n\t\t\trepeatId: \"<\",\r\n\t\t\tpivotColumn: \"=\",\r\n\t\t\troundToField: \"<\",\r\n\t\t\thideArrows: \"<\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t}\r\n\t}).name;\r\n","import componentMap from \"./report-field.config.js\";\r\n\r\nimport {\r\n\tboolField,\r\n\tcheckboxField\r\n} from \"./field-types/boolAndCheckbox/boolAndCheckbox.js\";\r\nimport dateTime from \"./field-types/date-time/date-time.js\";\r\nimport date from \"./field-types/date/date.js\";\r\nimport number from \"./field-types/number/number.js\";\r\nimport selection from \"./field-types/selection/selection.js\";\r\nimport simpleSelection from \"./field-types/simple-selection/simple-selection.js\";\r\nimport preSelect from \"./field-types/pre-select/pre-select.js\";\r\nimport entityContactSelector from \"./field-types/entity-contact-selector/entity-contact-selector.js\";\r\nimport multiSelect from \"./field-types/multi-select/multi-select.js\";\r\nimport text from \"./field-types/text/text.js\";\r\nimport textarea from \"./field-types/text-area/textarea.js\";\r\nimport degreeMinute from \"./field-types/degree-minute/degree-minute.js\";\r\nimport coordinate from \"./field-types/coordinate/coordinate.js\";\r\nimport yearMonth from \"./field-types/year-month/year-month.js\";\r\n\r\nimport degreeMinuteField from \"./field-sub-components/degree-minute-field/degree-minute-field.js\";\r\nimport numberField from \"./field-sub-components/number-field/number-field.js\";\r\n\r\n// report-form-field\r\nfunction controller(\r\n\t$scope,\r\n\t$element,\r\n\t$logger,\r\n\tdynamicComponent\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$postLink = postLink;\r\n\r\n\tfunction postLink() {\r\n\t\tcompile();\r\n\t}\r\n\r\n\tfunction compile() {\r\n\t\tconst fieldSettings = componentMap[ctrl.field.Template] || componentMap[\"default\"];\r\n\t\tif(fieldSettings === componentMap[\"default\"]) {\r\n\t\t\t$logger.error(\"Unable to find template for field\", { field: ctrl.field.Name, template: ctrl.field.Template });\r\n\t\t}\r\n\r\n\t\tconst locals = {\r\n\t\t\tfieldSettings: ctrl.field,\r\n\t\t\tvalues: ctrl.values,\r\n\t\t\trepeatId: ctrl.repeatId,\r\n\t\t\tpivotRow: ctrl.pivotRow,\r\n\t\t\tpivotColumn: ctrl.pivotColumn,\r\n\t\t\tsetFieldDirty: ctrl.setFieldDirty\r\n\t\t};\r\n\t\tconst context = ctrl.field;\r\n\r\n\t\tdynamicComponent.compile(\r\n\t\t\tfieldSettings,\r\n\t\t\tlocals,\r\n\t\t\t$scope.$new(),\r\n\t\t\t$element,\r\n\t\t\tcontext\r\n\t\t);\r\n\t}\r\n}\r\n\r\nconst deps = [\r\n\tboolField,\r\n\tcheckboxField,\r\n\tdate,\r\n\tdateTime,\r\n\tnumber,\r\n\tselection,\r\n\tentityContactSelector,\r\n\tsimpleSelection,\r\n\tmultiSelect,\r\n\ttext,\r\n\tdegreeMinute,\r\n\tpreSelect,\r\n\ttextarea,\r\n\tdegreeMinuteField,\r\n\tcoordinate,\r\n\tnumberField,\r\n\tyearMonth\r\n];\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form-field\", deps)\r\n\t.component(\"reportFormField\", {\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\tfield: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\trepeatId: \"<\",\r\n\t\t\tpivotRow: \"=\",\r\n\t\t\tpivotColumn: \"=\",\r\n\t\t\tsetFieldDirty: \"=\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\r\\n\\t

--empty--

\\r\\n\\r\\n\\r\\n\\t
\\r\\n\\t\\t▴\\r\\n\\t\\t▾\\r\\n\\t
\\r\\n\";","import {\r\n\tflatten,\r\n\torderBy,\r\n\tfindIndex,\r\n\tfilter,\r\n\tmap,\r\n\tuniqBy,\r\n\tkeyBy,\r\n\tfind,\r\n\tforEach,\r\n\tsome\r\n} from \"lodash\";\r\nimport template from \"./report-form.html\";\r\nimport field from \"./report-field\";\r\nimport \"./report-form.less\";\r\nimport {\r\n\tEVENT_FILTER_CURRENT_OPTIONS,\r\n\tEVENT_REMOVE_OPTIONS,\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_CLEAR_VALUE,\r\n\tPIVOT_TYPES,\r\n\tEVENT_CLEAR_ROW,\r\n\tEVENT_EXPAND_MULTI_ENTRY_LIST,\r\n\tEVENT_SECTION_FIELD_VISIBILTY_CHANGE,\r\n\tEVENT_ENABLE_SUCCESSOR_LOCK,\r\n\tEVENT_DISABLE_SUCCESSOR_LOCK,\r\n\tEVENT_FILTER_BY_DETAILS\r\n} from \"constants.js\";\r\nimport swal from \"sweetalert2\";\r\n\r\nexport function controller($scope, $logger, eventBus) {\r\n\tconst ctrl = this;\r\n\tconst fieldControllers = [];\r\n\r\n\tctrl.pivotTypes = PIVOT_TYPES;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.registerFieldController = registerFieldController;\r\n\tctrl.isPivotExpanded = false;\r\n\tctrl.expandPivot = expandPivot;\r\n\tctrl.disableMultiEntryCollapse = disableMultiEntryCollapse;\r\n\tctrl.showTriggerWarning = showTriggerWarning;\r\n\tctrl.clearPivoted = clearPivoted;\r\n\tctrl.showLocks = ctrl.showLocks === undefined ? true : ctrl.showLocks;\r\n\tctrl.getValues = getFieldValues;\r\n\r\n\tctrl.dirtyFields = {};\r\n\r\n\tctrl.hideTooltipFieldTypes = {\r\n\t\tCheckbox: true\r\n\t};\r\n\r\n\t(ctrl.scope || {}).getForm = () => $scope[ctrl.formIdentifier];\r\n\r\n\tfunction onInit() {\r\n\t\tif(ctrl.registerValueProvider) {\r\n\t\t\tctrl.registerValueProvider({ getValues: getFieldValues });\r\n\t\t}\r\n\r\n\t\t// IsNotReported: field is hidden and value is saved to api\r\n\t\t// IsHidden: field is hidden but value is saved to api\r\n\t\tfilter(ctrl.fields, f => f.IsNotReported === true || f.IsHidden === true).map(field => (field.visible = false));\r\n\t\tctrl.staticFields = ctrl.fields.filter(field => !field.Pivot);\r\n\r\n\t\tctrl.sections = [];\r\n\r\n\t\tconst staticSectionedFields = filter(ctrl.staticFields, f => !!f.Section);\r\n\t\tconst staticUnsectionedFields = filter(ctrl.staticFields, f => !f.Section);\r\n\r\n\t\tconst noSection = {\r\n\t\t\tid: 0,\r\n\t\t\tfields: staticUnsectionedFields,\r\n\t\t\tpivotedFields: [],\r\n\t\t\tisVisible: staticUnsectionedFields.length > 0\r\n\t\t};\r\n\r\n\t\tif(ctrl.staticFields.length > 0 && staticSectionedFields.length > 0) {\r\n\t\t\tctrl.sections = orderBy(\r\n\t\t\t\tmap(\r\n\t\t\t\t\tuniqBy(staticSectionedFields, d => d.Section.Id),\r\n\t\t\t\t\tfunction(item) {\r\n\t\t\t\t\t\tconst thisSection = {\r\n\t\t\t\t\t\t\tid: item.Section.Id,\r\n\t\t\t\t\t\t\tname: item.Section.Name,\r\n\t\t\t\t\t\t\torder: item.Section.Order,\r\n\t\t\t\t\t\t\tfields: filter(staticSectionedFields, f => f.Section.Id === item.Section.Id),\r\n\t\t\t\t\t\t\tpivotedFields: []\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\tthisSection.isVisible = thisSection.fields.length > 0 && some(thisSection.fields, f => f.visible !== false);\r\n\r\n\t\t\t\t\t\teventBus.register(\r\n\t\t\t\t\t\t\tEVENT_SECTION_FIELD_VISIBILTY_CHANGE(thisSection.id),\r\n\t\t\t\t\t\t\t() => {\r\n\t\t\t\t\t\t\t\tthisSection.isVisible = thisSection.fields.length > 0 && some(thisSection.fields, f => f.visible !== false);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t$scope\r\n\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\treturn thisSection;\r\n\t\t\t\t\t}\r\n\t\t\t\t),\r\n\t\t\t\t[\"order\"]\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tctrl.sections.push(noSection);\r\n\r\n\t\tgatherPivotFields();\r\n\r\n\t\tctrl.primaryPivotType && eventBus.register(EVENT_EXPAND_MULTI_ENTRY_LIST, (e, params) => expandPivot(true, params.sectionId), $scope);\r\n\t}\r\n\r\n\tctrl.toggleFieldLock = (field) => {\r\n\t\tfield.isLocked = !field.isLocked;\r\n\r\n\t\tconst event = field.isLocked ? EVENT_ENABLE_SUCCESSOR_LOCK(field.Id, undefined) : EVENT_DISABLE_SUCCESSOR_LOCK(field.Id, undefined);\r\n\t\teventBus.trigger(event);\r\n\t};\r\n\r\n\tctrl.setFieldDirty = (fieldId, isDirty) => {\r\n\t\tconst dirtyFields = {\r\n\t\t\t...ctrl.dirtyFields\r\n\t\t};\r\n\r\n\t\tif(isDirty) {\r\n\t\t\tdirtyFields[fieldId] = true;\r\n\t\t}\r\n\t\telse if(!!dirtyFields[fieldId]) {\r\n\t\t\tdelete dirtyFields[fieldId];\r\n\t\t}\r\n\r\n\t\tctrl.dirtyFields = dirtyFields;\r\n\t};\r\n\r\n\tfunction gatherPivotFields() {\r\n\t\tlet hasPivotValue = false;\r\n\r\n\t\tctrl.pivotFields = ctrl.fields\r\n\t\t\t.filter(field => !!field.Pivot)\r\n\t\t\t.reduce((acc, curr) => {\r\n\t\t\t\tlet sectionId = 0;\r\n\t\t\t\tif(curr.Section) {\r\n\t\t\t\t\tif(!ctrl.sections.some(s => s.id === curr.Section.Id)) {\r\n\t\t\t\t\t\tconst thisSection = {\r\n\t\t\t\t\t\t\tid: curr.Section.Id,\r\n\t\t\t\t\t\t\tname: curr.Section.Name,\r\n\t\t\t\t\t\t\torder: curr.Section.Order,\r\n\t\t\t\t\t\t\tisVisible: true,\r\n\t\t\t\t\t\t\tfields: [],\r\n\t\t\t\t\t\t\tpivotedFields: [curr]\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\tctrl.sections.push(thisSection);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tconst thisSection = ctrl.sections.find(s => s.id === curr.Section.Id);\r\n\t\t\t\t\t\tthisSection.pivotedFields.push(curr);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsectionId = curr.Section.Id;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!acc) {\r\n\t\t\t\t\tacc = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!acc[sectionId]) {\r\n\t\t\t\t\tacc[sectionId] = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!acc[sectionId][curr.Pivot]) {\r\n\t\t\t\t\tacc[sectionId][curr.Pivot] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst thisFieldValue = find(ctrl.values, val => val.FieldId === curr.Id);\r\n\r\n\t\t\t\thasPivotValue = hasPivotValue || !!thisFieldValue;\r\n\r\n\t\t\t\tif(curr.Pivot === ctrl.pivotTypes.Repeat) {\r\n\t\t\t\t\tacc[sectionId][curr.Pivot].push(curr);\r\n\t\t\t\t\treturn acc;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tctrl.primaryPivotType = curr.Pivot;\r\n\t\t\t\tacc[sectionId][curr.Pivot] = curr;\r\n\r\n\t\t\t\treturn acc;\r\n\t\t\t}, {});\r\n\r\n\t\tctrl.allowPivot = !hasPivotValue;\r\n\t\tctrl.primaryPivotIds = {};\r\n\r\n\t\tforEach(ctrl.sections, sec => {\r\n\t\t\tif(ctrl.pivotFields[sec.id]) {\r\n\t\t\t\tctrl.primaryPivotType && setupVaryByField(ctrl.pivotFields[sec.id][ctrl.primaryPivotType], sec.id);\r\n\t\t\t\tctrl.primaryPivotType && (ctrl.primaryPivotIds[sec.id] = [undefined]);\r\n\t\t\t\tctrl.primaryPivotType && (ctrl.pivotFields[sec.id][ctrl.primaryPivotType].Template = \"Selection\");\r\n\t\t\t\tctrl.primaryPivotType && (ctrl.pivotFields[sec.id][ctrl.primaryPivotType].allowPivot = ctrl.allowPivot);\r\n\r\n\t\t\t\tctrl.primaryPivotType &&\r\n\t\t\t\t\teventBus.register(\r\n\t\t\t\t\t\tEVENT_CLEAR_VALUE(ctrl.pivotFields[sec.id][ctrl.primaryPivotType].Id),\r\n\t\t\t\t\t\t() => {\r\n\t\t\t\t\t\t\tif(ctrl.isPivotExpanded) {\r\n\t\t\t\t\t\t\t\tclearPivoted(sec.id);\r\n\t\t\t\t\t\t\t\texpandPivot(false, sec.id);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t$scope\r\n\t\t\t\t\t);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction setupVaryByField(pivotField, sectionId) {\r\n\t\tconfigureTriggerWarnings(pivotField);\r\n\r\n\t\tif(!ctrl.primaryPivotOptionIds) {\r\n\t\t\tctrl.primaryPivotOptionIds = {};\r\n\t\t}\r\n\r\n\t\tif(ctrl.primaryPivotType === ctrl.pivotTypes.RecentlyUsed) {\r\n\t\t\tconst recentItems = pivotField.Data.filter(item => item.IsRecent);\r\n\t\t\tctrl.primaryPivotOptionIds[sectionId] = recentItems.map(data => data.Id);\r\n\t\t} else {\r\n\t\t\tctrl.primaryPivotOptionIds[sectionId] = pivotField.Data.map(data => data.Id);\r\n\t\t}\r\n\r\n\t\tpivotField.dataDictionary = keyBy(pivotField.Data, item => item.Id);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_FILTER_CURRENT_OPTIONS(pivotField.Id),\r\n\t\t\t(e, params) => {\r\n\t\t\t\tif(params.ids) {\r\n\t\t\t\t\tconst fullPivotOptions = params.ids.map(id => pivotField.dataDictionary[id]);\r\n\t\t\t\t\tconst orderedPivotOptions = orderBy(fullPivotOptions, [\"Order\"]);\r\n\t\t\t\t\tctrl.primaryPivotOptionIds[sectionId] = orderedPivotOptions.map(o => o.Id);\r\n\r\n\t\t\t\t\tif(ctrl.isPivotExpanded) {\r\n\t\t\t\t\t\tif(ctrl.primaryPivotOptionIds[sectionId] && ctrl.primaryPivotOptionIds[sectionId].length < 2) {\r\n\t\t\t\t\t\t\texpandPivot(false, sectionId);\r\n\t\t\t\t\t\t\t$scope.$$postDigest(() => {\r\n\t\t\t\t\t\t\t\teventBus.trigger(EVENT_FILTER_CURRENT_OPTIONS(pivotField.Id), { ids: params.ids });\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\thandleExpandedPivot(sectionId);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_REMOVE_OPTIONS(pivotField.Id),\r\n\t\t\t(e, params) => {\r\n\t\t\t\tctrl.primaryPivotOptionIds[sectionId] = ctrl.primaryPivotOptionIds[sectionId].filter(optionId => params.items.indexOf(optionId) < 0);\r\n\r\n\t\t\t\tif(ctrl.isPivotExpanded) {\r\n\t\t\t\t\tif(ctrl.primaryPivotOptionIds[sectionId] && ctrl.primaryPivotOptionIds[sectionId].length < 2) {\r\n\t\t\t\t\t\texpandPivot(false, sectionId);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\thandleExpandedPivot(sectionId);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\t}\r\n\r\n\tfunction configureTriggerWarnings(baseField) {\r\n\t\tif(baseField.triggerFieldId) {\r\n\t\t\tconst triggerField = find(ctrl.fields, field => field.Id == baseField.triggerFieldId);\r\n\r\n\t\t\tif(triggerField) {\r\n\t\t\t\ttriggerField.warnBeforeChangeTrigger = true;\r\n\t\t\t\tconfigureTriggerWarnings(triggerField);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tasync function showTriggerWarning(field) {\r\n\t\tif(!ctrl.isPivotExpanded || !ctrl.disableMultiEntryButton)\r\n\t\t\treturn true;\r\n\r\n\t\tconst userAction = await swal({\r\n\t\t\ttitle: \"Warning!\",\r\n\t\t\thtml: `Changing the value of the ${field.Name} field will clear ALL currently entered multi-entry values from the form.\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\tAre you sure you want to do that?`,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\",\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Yes, do it!\"\r\n\t\t})\r\n\t\t\t.catch(err => $logger.error(err));\r\n\r\n\t\tif(userAction.dismiss) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst sectionId = (!!field.Section && field.Section.Id) || 0;\r\n\t\tconst repeatFields = ctrl.pivotFields[sectionId][ctrl.pivotTypes.Repeat];\r\n\t\tforEach(ctrl.primaryPivotOptionIds, optionId => {\r\n\t\t\tforEach(repeatFields, field => {\r\n\t\t\t\teventBus.trigger(EVENT_CLEAR_VALUE(field.Id, optionId));\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tctrl.disableMultiEntryButton = false;\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\tfunction handleExpandedPivot(sectionId) {\r\n\t\tctrl.primaryPivotIds[sectionId] = ctrl.primaryPivotOptionIds[sectionId];\r\n\t\tctrl.pivotFields[sectionId][ctrl.primaryPivotType].Template = \"PreSelect\";\r\n\r\n\t\tconst triggerFieldId = ctrl.pivotFields[sectionId][ctrl.primaryPivotType].Id;\r\n\r\n\t\t$scope.$$postDigest(() => {\r\n\t\t\tconst triggeringControllers = fieldControllers.filter(c => c.field.Id === triggerFieldId);\r\n\t\t\tforEach(triggeringControllers, c => c.handleValueChanged());\r\n\t\t});\r\n\t}\r\n\r\n\tfunction expandPivot(open, sectionId) {\r\n\t\tctrl.isPivotExpanded = open !== undefined ? open : !ctrl.isPivotExpanded;\r\n\r\n\t\tif(ctrl.isPivotExpanded) {\r\n\t\t\thandleExpandedPivot(sectionId);\r\n\t\t} else {\r\n\t\t\tconst triggerFieldId = ctrl.pivotFields[sectionId][ctrl.primaryPivotType].Id;\r\n\r\n\t\t\tctrl.primaryPivotIds[sectionId] = [undefined];\r\n\t\t\tctrl.pivotFields[sectionId][ctrl.primaryPivotType].Template = \"Selection\";\r\n\r\n\t\t\t$scope.$$postDigest(() => {\r\n\t\t\t\teventBus.trigger(EVENT_VALUE_CHANGED(triggerFieldId), {\r\n\t\t\t\t\tfield: { Id: triggerFieldId },\r\n\t\t\t\t\tvalue: undefined,\r\n\t\t\t\t\trefilterThis: true\r\n\t\t\t\t});\r\n\t\t\t\teventBus.trigger(EVENT_FILTER_BY_DETAILS(triggerFieldId));\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfunction clearPivoted(sectionId) {\r\n\t\tforEach(ctrl.primaryPivotIds[sectionId], id => {\r\n\t\t\teventBus.trigger(EVENT_CLEAR_ROW(id));\r\n\t\t});\r\n\r\n\t\tctrl.disableMultiEntryButton = false;\r\n\t}\r\n\r\n\tfunction disableMultiEntryCollapse() {\r\n\t\tctrl.disableMultiEntryButton = true;\r\n\t}\r\n\r\n\tfunction getFieldValues(api = false) {\r\n\t\tconst results = fieldControllers\r\n\t\t\t.filter(fc => fc.field.visible !== false || fc.field.IsHidden)\r\n\t\t\t.map(x => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst val = x.getCurrentValue(api);\r\n\t\t\t\t\tforEach(val, v => {\r\n\t\t\t\t\t\tif(v.IsNotAvailable === false) {\r\n\t\t\t\t\t\t\tdelete v.IsNotAvailable;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(ctrl.detailId !== undefined) {\r\n\t\t\t\t\t\t\tv.DetailId = ctrl.detailId;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\treturn val;\r\n\t\t\t\t}\r\n\t\t\t\tcatch(err) {\r\n\t\t\t\t\t$logger.exception(err, \"Error getting field values\", { fieldController: x });\r\n\t\t\t\t\r\n\t\t\t\t\treturn \"error\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\tlet flattened;\r\n\r\n\t\tif(some(results, r => r === \"error\")) {\r\n\t\t\tflattened = null;\r\n\t\t} else {\r\n\t\t\tflattened = flatten(results);\r\n\t\t}\r\n\t\treturn flattened;\r\n\t}\r\n\r\n\tfunction registerFieldController(fieldController) {\r\n\t\tfieldControllers.push(fieldController);\r\n\t\treturn function unregister() {\r\n\t\t\tconst idx = findIndex(fieldControllers, x => x === fieldController);\r\n\t\t\tif(idx !== -1) {\r\n\t\t\t\tfieldControllers.splice(idx, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n}\r\n\r\nconst deps = [field];\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-form\", deps)\r\n\t.component(\"reportForm\", {\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\ttransclude: true,\r\n\t\tbindings: {\r\n\t\t\tfields: \"<\",\r\n\t\t\tvalues: \"<\",\r\n\t\t\tdetailId: \"<\",\r\n\t\t\tfeatures: \"<\",\r\n\t\t\tregisterValueProvider: \"&\",\r\n\t\t\tgetValues: \"=\",\r\n\t\t\tscope: \"<\",\r\n\t\t\treadonly: \"<\",\r\n\t\t\tname: \"<\",\r\n\t\t\tformIdentifier: \"@\",\r\n\t\t\tshowLocks: \"<\",\r\n\t\t\tdirtyFields: \"=\"\r\n\t\t}\r\n\t}).name;\r\n","export default \" 0\\\"\\r\\n\\tng-repeat=\\\"section in $ctrl.sections\\\"\\r\\n>\\r\\n\\t
\\r\\n\\t\\t\\r\\n\\t\\t\\t {{::section.name}} \\r\\n\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t 1\\r\\n\\t\\t\\t\\t\\t&& $ctrl.allowPivot\\r\\n\\t\\t\\t\\t\\t&& $ctrl.isPivotExpanded\\\"\\r\\n\\t\\t\\t>\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t Collapse Multi-Entry \\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t Clear All \\r\\n\\t\\t\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t
\\r\\n\\r\\n\";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport moment from \"moment\";\r\n\r\nimport { hasHadState } from \"../../utils\";\r\nimport { REPORT_STATES } from \"../../constants\";\r\n\r\nfunction controller(appState, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onChanges = onChanges;\r\n\tctrl.getFormattedTime = getFormattedTime;\r\n\tctrl.hasBeenSubmitted = (report) => hasHadState(REPORT_STATES.submitted.code, report);\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.canAmend = appState.permissions.Reporting.Actions.CanAmend;\r\n\t\tctrl.status = getReportStatus();\r\n\t};\r\n\r\n\tfunction onChanges() {\r\n\t\tctrl.status = getReportStatus();\r\n\t}\r\n\r\n\tfunction getReportStatus() {\r\n\t\tctrl.reverseSortedHistory = (ctrl.report.History ?? []).sort((a, b) => moment(a.Occurred).isBefore(b.Occurred) ? 1 : -1);\r\n\r\n\t\tif(ctrl.reverseSortedHistory.length === 0) {\r\n\t\t\treturn {\r\n\t\t\t\ttext: \"Pending\",\r\n\t\t\t\tstyle: \"warning\",\r\n\t\t\t\ticon: undefined\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if(ctrl.report.Submitted !== undefined) { // possibly old reports with submitted date but no submitted history record?\r\n\t\t\treturn {\r\n\t\t\t\ttext: \"Submitted\",\r\n\t\t\t\tstyle: \"success\",\r\n\t\t\t\ticon: \"zmdi-check\"\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tswitch(ctrl.reverseSortedHistory[0].State.Code) {\r\n\t\t\tcase \"SUBMITTED\":\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttext: \"Submitted\",\r\n\t\t\t\t\tstyle: \"success\",\r\n\t\t\t\t\ticon: \"zmdi-check\"\r\n\t\t\t\t};\r\n\r\n\t\t\tcase \"DECLARED\":\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttext: \"Declared\",\r\n\t\t\t\t\tstyle: \"warning\",\r\n\t\t\t\t\ticon: undefined\r\n\t\t\t\t};\r\n\r\n\t\t\tcase \"SUBMITTING\":\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttext: \"Submitting\", \r\n\t\t\t\t\tstyle: \"submitting\",\r\n\t\t\t\t\ticon: undefined\r\n\t\t\t\t};\r\n\r\n\t\t\tcase \"PENDING\":\r\n\t\t\t\tif(ctrl.report.Date === undefined) {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttext: \"Declared\",\r\n\t\t\t\t\t\tstyle: \"warning\",\r\n\t\t\t\t\t\ticon: undefined\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\telse if(!ctrl.canAmend && hasHadState(REPORT_STATES.submitted.code, ctrl.report)) {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttext: \"Under Review\",\r\n\t\t\t\t\t\tstyle: \"review\",\r\n\t\t\t\t\t\ticon: undefined\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttext: \"Pending\",\r\n\t\t\t\t\tstyle: \"warning\",\r\n\t\t\t\t\ticon: undefined\r\n\t\t\t\t};\r\n\r\n\t\t\tcase \"DELETED\":\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttext: \"Deleted\",\r\n\t\t\t\t\tstyle: \"info\",\r\n\t\t\t\t\ticon: \"zmdi-delete\"\r\n\t\t\t\t};\r\n\r\n\t\t\tdefault:\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttext: \"Pending\",\r\n\t\t\t\t\tstyle: \"warning\",\r\n\t\t\t\t\ticon: undefined\r\n\t\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getFormattedTime() {\r\n\t\treturn moment(ctrl.report.LastModified).local()\r\n\t\t\t.fromNow();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-status\", [])\r\n\t.component(\"reportStatus\", {\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\treport: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t
    \\r\\n\\t\\t
  • \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t{{$ctrl.status.text}}\\r\\n\\t\\t
  • \\r\\n\\t
\\r\\n
\";","export const FILTER_OPERATORS = {\r\n\tin: { \r\n\t\tcode: \"In\" as const,\r\n\t\tdisplay: \"In\" as const\r\n\t},\r\n\tequals: { \r\n\t\tcode: \"Equals\" as const,\r\n\t\tdisplay: \"=\" as const\r\n\t},\r\n\tgreaterThan: { \r\n\t\tcode: \"GreaterThan\" as const,\r\n\t\tdisplay: \">\" as const\r\n\t},\r\n\tgreaterThanOrEqualTo: { \r\n\t\tcode: \"GreaterThanOrEqualTo\" as const ,\r\n\t\tdisplay: \">=\" as const\r\n\t},\r\n\tlessThan: { \r\n\t\tcode: \"LessThan\" as const,\r\n\t\tdisplay: \"<\" as const\r\n\t},\r\n\tlessThanOrEqualTo: { \r\n\t\tcode: \"LessThanOrEqualTo\" as const ,\r\n\t\tdisplay: \"<=\" as const\r\n\t}\r\n};\r\n\r\nexport const SORT_DIRECTIONS = {\r\n\tascending: {\r\n\t\tcode: \"Ascending\",\r\n\t\tdisplay: \"Ascending\"\r\n\t},\r\n\tdescending: {\r\n\t\tcode: \"Descending\",\r\n\t\tdisplay: \"Descending\"\r\n\t}\r\n};\r\n\r\nexport const CURSOR_DIRECTIONS = {\r\n\tforward: {\r\n\t\tcode: \"Forward\",\r\n\t\tdisplay: \"Forward\"\r\n\t},\r\n\tbackward: {\r\n\t\tcode: \"Backward\",\r\n\t\tdisplay: \"Backward\"\r\n\t}\r\n};\r\n\r\nexport const EXPORT_STATUSES = {\r\n\tcommitted: \"COMMITTED\",\r\n\tsuppressed: \"SUPPRESSED\",\r\n\terrored: \"ERRORED\",\r\n\tpending: \"PENDING\"\r\n};","import { EXPORT_STATUSES } from \"../../screens/exports/constants\";\r\nimport template from \"./index.html\";\r\nimport \"./index.less\";\r\n\r\nfunction controller(appState, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onChanges = onChanges;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.canAmend = appState.permissions.Reporting.Actions.CanAmend;\r\n\t\tctrl.status = getStatus();\r\n\t};\r\n\r\n\tfunction onChanges() {\r\n\t\tctrl.status = getStatus();\r\n\t}\r\n\r\n\tfunction getStatus() {\r\n\t\tconst externalStatus = loadExternalStatus();\r\n\t\tif(externalStatus !== undefined) {\r\n\t\t\treturn externalStatus;\r\n\t\t}\r\n\r\n\t\tconst exportLog = ctrl.exportLog;\r\n\r\n\t\tif(!exportLog.Errored && !exportLog.Pending && !exportLog.Committed && !exportLog.Suppressed) {\r\n\t\t\treturn {\r\n\t\t\t\ttext: \"Pending\",\r\n\t\t\t\tstyle: \"warning\",\r\n\t\t\t\ticon: undefined\r\n\t\t\t};\r\n\t\t}\r\n\t\tif(exportLog.Errored !== undefined && exportLog.Errored > 0) {\r\n\t\t\treturn {\r\n\t\t\t\ttext: \"Errored\",\r\n\t\t\t\tstyle: \"danger\",\r\n\t\t\t\ticon: \"zmdi-alert-octagon\"\r\n\t\t\t};\r\n\t\t}\r\n\t\tif(exportLog.Pending !== undefined && exportLog.Pending > 0) {\r\n\t\t\treturn {\r\n\t\t\t\ttext: \"Pending\",\r\n\t\t\t\tstyle: \"warning\",\r\n\t\t\t\ticon: undefined\r\n\t\t\t};\r\n\t\t}\r\n\t\tif((exportLog?.Committed ?? 0) + (exportLog?.Suppressed ?? 0) > 0) {\r\n\t\t\treturn {\r\n\t\t\t\ttext: \"Completed\",\r\n\t\t\t\tstyle: \"success\",\r\n\t\t\t\ticon: \"zmdi-check\"\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn {\r\n\t\t\ttext: \"Unknown\",\r\n\t\t\tstyle: \"info\",\r\n\t\t\ticon: \"zmdi-delete\"\r\n\t\t};\r\n\t}\r\n\r\n\tfunction loadExternalStatus() {\r\n\t\tif(ctrl.externalStatus === undefined) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\tswitch(ctrl.externalStatus) {\r\n\t\t\tcase EXPORT_STATUSES.pending:\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttext: \"Pending\",\r\n\t\t\t\t\tstyle: \"warning\",\r\n\t\t\t\t\ticon: undefined\r\n\t\t\t\t};\r\n\t\t\t\r\n\t\t\tcase EXPORT_STATUSES.suppressed:\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttext: \"Suppressed\",\r\n\t\t\t\t\tstyle: \"info\",\r\n\t\t\t\t\ticon: \"zmdi-delete\"\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\tcase EXPORT_STATUSES.errored:\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttext: \"Errored\",\r\n\t\t\t\t\tstyle: \"danger\",\r\n\t\t\t\t\ticon: \"zmdi-alert-octagon\"\r\n\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\tcase EXPORT_STATUSES.committed:\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttext: \"Completed\",\r\n\t\t\t\t\tstyle: \"success\",\r\n\t\t\t\t\ticon: \"zmdi-check\"\r\n\t\t\t\t};\r\n\t\t\t\t\t\t\r\n\t\t\tdefault: \r\n\t\t\t\treturn {\r\n\t\t\t\t\ttext: \"Unknown\",\r\n\t\t\t\t\tstyle: \"info\",\r\n\t\t\t\t\ticon: \"zmdi-delete\"\r\n\t\t\t\t};\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.export-status\", [])\r\n\t.component(\"exportStatus\", {\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\texportLog: \"<\",\r\n\t\t\texternalStatus: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
\\r\\n\\t
    \\r\\n\\t\\t
  • \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t{{$ctrl.status.text}}\\r\\n\\t\\t
  • \\r\\n\\t
\\r\\n
\";","import \"./index.less\";\r\nimport template from \"./index.html\";\r\n\r\n/*\r\ntype PaginatorOptions {\r\n\tcurrentPage: number;\r\n\titemsPerPage: number;\r\n\ttotalItems: number;\r\n}\r\n*/\r\n\r\nfunction controller($scope, $state, $logger) {\r\n\tconst ctrl = this;\r\n\tctrl.scope = $scope;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.pageSizes = ctrl.pageSizes || [\"10\", \"25\", \"50\", \"75\"];\r\n\r\n\t\tctrl.options = ctrl.options || {};\r\n\t\tctrl.options.currentPage = ctrl.options?.currentPage || 1;\r\n\t\tctrl.options.itemsPerPage =\r\n\t\t\tctrl.options?.itemsPerPage\r\n\t\t\t?? (ctrl.pageSizes.indexOf(ctrl.defaultPageSize) > -1 ? ctrl.defaultPageSize : null)\r\n\t\t\t?? ctrl.pageSizes[0];\r\n\t\tctrl.options.totalItems = ctrl.options?.totalItems || 0;\r\n\r\n\t\t$scope.$watch(() => ctrl.options.totalItems, resetPage, true);\r\n\t\t$scope.$watch(() => ctrl.options.currentPage, (next, prev) => filterNonChange(next, prev, false), true);\r\n\t\t$scope.$watch(\r\n\t\t\t() => ctrl.options.itemsPerPage,\r\n\t\t\t(next, prev) => {\r\n\t\t\t\tfilterNonChange(next, prev, false);\r\n\t\t\t\tctrl.updateUserPreference && ctrl.updateUserPreference(ctrl.options.itemsPerPage);\r\n\t\t\t}, true);\r\n\t\t$scope.$watch(() => ctrl.options.totalItems, (next, prev) => filterNonChange(next, prev, true), true);\r\n\t};\r\n\r\n\tfunction resetPage(nextTotalItems, prevTotalItems) {\r\n\t\tif(nextTotalItems !== undefined\r\n\t\t\t&& nextTotalItems != prevTotalItems\r\n\t\t\t&& (nextTotalItems === 0 || nextTotalItems < getCurrentOffset())) {\r\n\t\t\tctrl.options.currentPage = 1;\r\n\t\t\tctrl.options.totalItems = nextTotalItems ?? 0;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getCurrentOffset() {\r\n\t\treturn (ctrl.options.itemsPerPage * (ctrl.options.currentPage - 1));\r\n\t}\r\n\r\n\tfunction getCurrentMaxPage() {\r\n\t\treturn parseInt((ctrl.options.totalItems + parseInt(ctrl.options.itemsPerPage) - 1) / parseInt(ctrl.options.itemsPerPage));\r\n\t}\r\n\r\n\tfunction filterNonChange(next, prev, suppressCallback = false) {\r\n\t\tif(next !== prev) {\r\n\t\t\tconst offset = getCurrentOffset();\r\n\t\t\tif(ctrl.options.totalItems < offset) {\r\n\t\t\t\tconst maxPage = getCurrentMaxPage();\r\n\t\t\t\tctrl.options.currentPage = maxPage;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tupdateRoute();\r\n\t\t\t}\r\n\r\n\t\t\t!suppressCallback && ctrl.updatePage && ctrl.updatePage();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateRoute() {\r\n\t\twindow.scroll({ top: 0 });\r\n\r\n\t\t$state.go($state.$current.name, {\r\n\t\t\tpage: ctrl.options.currentPage,\r\n\t\t\titemsPerPage: ctrl.options.itemsPerPage\r\n\t\t}, { location: \"replace\" });\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.pagination\", [])\r\n\t.component(\"pagination\", {\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\toptions: \"=\",\r\n\t\t\tpageSizes: \"<\",\r\n\t\t\tdefaultPageSize: \"<\",\r\n\t\t\tupdateUserPreference: \"=\",\r\n\t\t\tupdatePage: \"=\",\r\n\t\t\tid: \"@\"\r\n\t\t}\r\n\t}).name;\r\n","export default \" 10\\\"\\r\\n>\\r\\n\\t\\r\\n\\t\\t ($ctrl.options.itemsPerPage * 3)\\\"\\r\\n\\t\\t\\tng-model=\\\"$ctrl.options.currentPage\\\"\\r\\n\\t\\t\\ttotal-items=\\\"$ctrl.options.totalItems\\\"\\r\\n\\t\\t\\titems-per-page=\\\"$ctrl.options.itemsPerPage\\\"\\r\\n\\t\\t\\tmax-size=\\\"10\\\"\\r\\n\\t\\t>\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t{{size}}\\r\\n\\t\\t\\r\\n\\t\\r\\n\\r\\n 10\\\"\\r\\n>\\r\\n\\tItems per page\\r\\n\";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport { some } from \"lodash\";\r\nimport { SECURITY_ROLES } from \"constants.js\";\r\n\r\nexport function controller($logger, $uibModal, openIdService, $userProfile) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.signOut = signOut;\r\n\tctrl.openChangePasswordModal = openChangePasswordModal;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.openVersionInfo = openVersionInfo;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.isCollapsed = true;\r\n\r\n\t\tctrl.user = $userProfile.getUser();\r\n\t}\r\n\r\n\tfunction openChangePasswordModal() {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"change-password-modal\",\r\n\t\t\tsize: \"slim\"\r\n\t\t});\r\n\t}\r\n\r\n\tfunction signOut() {\r\n\t\topenIdService.getUserManager().signoutRedirect();\r\n\t}\r\n\r\n\tfunction openVersionInfo() {\r\n\t\tconst userProfile = $userProfile.getUserProfile();\r\n\r\n\t\tconst isSysAdmin = !!userProfile && !!userProfile.user && !!userProfile.user.user\r\n\t\t\t&& some(userProfile.user.user.roles, r => r === SECURITY_ROLES.SYSADMIN.name);\r\n\r\n\t\tisSysAdmin && showBuildInformation();\r\n\t}\r\n\r\n\tfunction showBuildInformation() {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"buildInformationModal\",\r\n\t\t\tsize: \"lg\"\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.user-profile\", [])\r\n\t.component(\"userProfile\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","export default \"
\\r\\n\\t\\r\\n\\t\\t
\\r\\n\\t\\t\\t\\r\\n\\t\\t
\\r\\n\\t\\t
\\r\\n\\t\\t\\t
{{$ctrl.user.name}}
\\r\\n\\t\\t\\t
{{$ctrl.user.username}}
\\r\\n\\t\\t
\\r\\n\\t
\\r\\n\\t\\r\\n\\t\\tChange Password\\r\\n\\t\\r\\n\\tSign Out\\r\\n\";","import template from \"./user-entities.html\";\r\nimport \"./user-entities.less\";\r\nimport {\r\n\tdifferenceWith,\r\n\tintersectionWith,\r\n\tforEach,\r\n\tremove,\r\n\tsome\r\n} from \"lodash\";\r\nimport cloneDeep from \"clone-deep\";\r\nimport {\r\n\tUSER_REVOKE_ENTITY,\r\n\tFORM_USERS_ENTITIES,\r\n\tUSER_PERMIT_ENTITY\r\n} from \"routes.js\";\r\nimport { ENTITY_TYPES } from \"constants.js\";\r\nimport { pluralize } from \"humanize-plus\";\r\nimport swal from \"sweetalert2\";\r\nimport {\r\n\tENTITY_TRANSLATION_KEYS, \r\n\tI18NextContext \r\n} from \"../../../services/i18nService\";\r\n\r\nexport function controller(\r\n\t$scope,\r\n\t$uibModal,\r\n\t$timeout,\r\n\t$logger,\r\n\tappState,\r\n\tapi,\r\n\ttoastr,\r\n\tentityManager,\r\n\tloadingService\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\tctrl.entityQueryConfigurations = [];\r\n\r\n\tctrl.loadEntities = loadEntities;\r\n\tctrl.removeEntity = removeEntity;\r\n\tctrl.addEntity = addEntity;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.entityPermissions = cloneDeep(appState.permissions.Administration.Entity);\r\n\r\n\t\tconst groups = {};\r\n\t\tfor(const fieldId in entityManager.allEntityConfigs)\r\n\t\t{\r\n\t\t\tconst eqc = entityManager.allEntityConfigs[fieldId];\r\n\t\t\t\r\n\t\t\tif(!eqc.IsUserScoped)\r\n\t\t\t\tcontinue;\r\n\t\t\t\r\n\t\t\tconst key = `${eqc.Primary.Type.Code}.${eqc.Friendly.Type.Code}.${eqc.RelationshipType.Code}`;\r\n\t\t\tgroups[key] = (groups[key] ?? { names: [], query: eqc });\r\n\t\t\tgroups[key].names.push(I18NextContext.Instance.i18n.t(`types.${eqc.Friendly.Type.Code}.Name`));\r\n\t\t}\r\n\r\n\t\tctrl.entityQueryConfigurations = Object.values(groups);\r\n\r\n\t\tloadEntities();\r\n\t}\r\n\r\n\tctrl.setSelector = function(selector) {\r\n\t\tctrl.selector = selector;\r\n\t};\r\n\r\n\tfunction loadEntities() {\r\n\t\tconst assignedPromise = api.get(FORM_USERS_ENTITIES(ctrl.form.Id, ctrl.user.Id))\r\n\t\t\t.then(friendlyEntities => {\r\n\t\t\t\tconst assignedEntities = friendlyEntities.filter(e => e.Association.Code === \"PERMISSION\");\r\n\r\n\t\t\t\tconst formEntities = assignedEntities.map((l) => {\r\n\t\t\t\t\tl.Entity.RelationshipType = l.RelationshipType.Code;\r\n\t\t\t\t\tl.Entity.Type = entityManager.userScopedEntityTypes[l.Entity.Type.Code];\r\n\t\t\t\t\tl.Entity.targetType = ENTITY_TYPES[l.Type.Code]?.PluralName ?? pluralize(2, l.Type.Name ?? l.Type.Code);\r\n\t\t\t\t\tl.Entity.targetTypeCode = l.Type.Code;\r\n\r\n\t\t\t\t\tif(l.Entity.RelationshipType === \"SELF\") {\r\n\t\t\t\t\t\tconst formEntity = entityManager.getEntitiesForAllFields(l.Entity.Id);\r\n\t\t\t\t\t\tif(formEntity && formEntity.length) {\r\n\t\t\t\t\t\t\tconst thisPrimary = formEntity[0];\r\n\t\t\t\t\t\t\tconst thisFriendly = !!thisPrimary.friendlyIds && [...entityManager.getEntitiesForAllFields(thisPrimary.friendlyIds[0])];\r\n\r\n\t\t\t\t\t\t\tif(thisFriendly && thisFriendly.length > 0) {\r\n\t\t\t\t\t\t\t\tl.Entity.friendly = thisFriendly[0];\r\n\t\t\t\t\t\t\t\tl.Entity.friendly.display = !!l.Entity.friendly.Name ? `from ${l.Entity.friendly.Name} (${l.Entity.friendly.Code})` : `from ${l.Entity.friendly.Code}`;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn l.Entity;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tctrl.hasKeys = some(formEntities, e => !!e.ExternalKey);\r\n\t\t\t\tctrl.hasClassifications = some(formEntities, (e) => !!e.Classification);\r\n\t\t\t\tctrl.entities = formEntities;\r\n\t\t\t})\r\n\t\t\t.catch((err) => {\r\n\t\t\t\t$logger.exception(err, \"Exception in retrieving/loading user entities\", { formId: ctrl.form.Id, userId: ctrl.user.Id });\r\n\t\t\t\ttoastr.error(\"There was an error retrieving/loading user entities\");\r\n\t\t\t\tctrl.entities = [];\r\n\t\t\t});\r\n\r\n\t\tloadingService.watch(assignedPromise, \"Loading...\")\r\n\t\t\t.then(() => {\r\n\t\t\t\tctrl.hasClassifications = some(ctrl.entities, (e) => !!e.Classification);\r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction addEntity(entityQueryConfiguration) {\r\n\t\tconst fakeLookup = {\r\n\t\t\tentityTypes: [entityQueryConfiguration],\r\n\t\t\thideCode: false, \r\n\t\t\tentityQueryConfiguration\r\n\t\t};\r\n\r\n\t\t$uibModal\r\n\t\t\t.open({\r\n\t\t\t\tcomponent: \"advancedSearchModal\",\r\n\t\t\t\tsize: \"lg\",\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tlookup: fakeLookup\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.result.then((selection) => {\r\n\t\t\t\thandleEntitySelection(selection, entityQueryConfiguration);\r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction handleEntitySelection(entity, entityConfig) {\r\n\t\tif(entityConfig.Friendly.Type.Code === entity.Type.Code) {\r\n\t\t\tlet getSelections = () => new Promise((res) => res([entity]));\r\n\r\n\t\t\tif(entityConfig.RelationshipType.Code !== \"SELF\") {\r\n\t\t\t\tgetSelections = () =>\r\n\t\t\t\t\t$uibModal.open({\r\n\t\t\t\t\t\tcomponent: \"userFriendlyAssociation\",\r\n\t\t\t\t\t\tsize: \"lg\",\r\n\t\t\t\t\t\tresolve: {\r\n\t\t\t\t\t\t\tentity, \r\n\t\t\t\t\t\t\tentityConfig\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}).result;\r\n\t\t\t}\r\n\r\n\t\t\tgetSelections()\r\n\t\t\t\t.then((selections = []) => {\r\n\t\t\t\t\tif(!selections.length) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst duplicateAssociations = intersectionWith(ctrl.entities, selections, (val1, val2) => {\r\n\t\t\t\t\t\treturn val1.Id === val2.Id && val1.RelationshipType === entityConfig.RelationshipType.Code;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(duplicateAssociations.length > 0) {\r\n\t\t\t\t\t\tshowDuplicateAssociationWarning(duplicateAssociations);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst newAssociations = differenceWith(selections, ctrl.entities, (val1, val2) => {\r\n\t\t\t\t\t\treturn val1.Id === val2.Id && val2.RelationshipType === entityConfig.RelationshipType.Code;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tforEach(newAssociations, selection => {\r\n\t\t\t\t\t\thandleEntityAssociation(selection, entityConfig)\r\n\t\t\t\t\t\t\t.then(entity => {\r\n\t\t\t\t\t\t\t\tassignConfigTypesToEntity(entity, entityConfig);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t})\r\n\t\t\t\t.catch((err) => {\r\n\t\t\t\t\t$logger.exception(\"Failure to get selections for entities\", err);\r\n\t\t\t\t\ttoastr.error(\"There was an error getting entity selections\");\r\n\t\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\thandleEntityAssociation(entity, entityConfig).then(entity => {\r\n\t\t\t\tassignConfigTypesToEntity(entity, entityConfig);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfunction assignConfigTypesToEntity(entity, entityConfig) {\r\n\t\tif(entity.RelationshipType === undefined) {\r\n\t\t\tentity.RelationshipType = entityConfig.RelationshipType.Code;\r\n\t\t}\r\n\t\tif(entity.targetType === undefined) {\r\n\t\t\tentity.targetType = pluralize(2, entityConfig.Primary.Type.Name);\r\n\t\t}\r\n\t\tif(entity.targetTypeCode === undefined) {\r\n\t\t\tentity.targetTypeCode = entityConfig.Primary.Type.Code;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction showDuplicateAssociationWarning(assns) {\r\n\t\tconst assnsHtml = assns\r\n\t\t\t.map((entity) => {\r\n\t\t\t\treturn `
  • ${entity.Name}
  • `;\r\n\t\t\t})\r\n\t\t\t.join(\"\");\r\n\r\n\t\tswal.fire({\r\n\t\t\ttitle: \"Duplicate Associations\",\r\n\t\t\thtml:\r\n\t\t\t\t`You are attempting to make associations to entities which already exist for this user:\r\n\t\t\t
    \r\n\t\t\t
    \r\n\t\t\t
      \r\n\t\t\t${assnsHtml}\r\n\t\t\t
    \r\n\t\t\t
    \r\n\t\t\tThese associations will be ignored.`,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\",\r\n\t\t\tshowCancelButton: false\r\n\t\t});\r\n\t}\r\n\r\n\tfunction handleEntityAssociation(entity, config) {\r\n\t\tconst targetType = config.Primary.Type.Code;\r\n\t\tconst relationshipType = targetType === entity.Type.Code ? \"SELF\" : config.RelationshipType.Code;\r\n\r\n\t\tconst route = USER_PERMIT_ENTITY(entityManager.form.Id, ctrl.user.Id, entity.Id, relationshipType, targetType);\r\n\r\n\t\tconst promise = api.post(route).then(() => {\r\n\t\t\ttoastr.success(`${entity.Name || entity.Code} added.`);\r\n\r\n\t\t\tctrl.entities.push(entity);\r\n\r\n\t\t\tif(!!entity.Classification) {\r\n\t\t\t\tctrl.hasClassifications = true;\r\n\t\t\t}\r\n\t\t\t$timeout(() => {\r\n\t\t\t\t$scope.$apply();\r\n\t\t\t});\r\n\r\n\t\t\treturn entity;\r\n\t\t});\r\n\r\n\t\tctrl.promiseTracker.addPromise(promise);\r\n\t\treturn loadingService.watch(promise, \"Loading...\");\r\n\t}\r\n\r\n\tfunction removeEntity(entity) {\r\n\t\tconst targetType = entity.targetTypeCode;\r\n\t\tconst relationshipType = entity.RelationshipType;\r\n\r\n\t\tconst route = USER_REVOKE_ENTITY(ctrl.form.Id, ctrl.user.Id, entity.Id, relationshipType, targetType);\r\n\t\tconst promise = api.put(route).then(() => {\r\n\t\t\ttoastr.success(`${entity.Code} removed.`);\r\n\r\n\t\t\tremove(ctrl.entities, possibleRemove => possibleRemove.Id === entity.Id && possibleRemove.RelationshipType === relationshipType);\r\n\r\n\t\t\t$timeout(() => {\r\n\t\t\t\t$scope.$apply();\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tloadingService.watch(promise, \"Loading...\");\r\n\t}\r\n\r\n\tctrl.viewEntity = (entity) => {\r\n\t\tconst appEntity = entityManager.getEntitiesForAllFields(entity.Id);\r\n\r\n\t\tif(appEntity.length === 0) {\r\n\t\t\ttoastr.error(\"The selected entity is not assigned to this form.\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$uibModal\r\n\t\t\t\t.open({\r\n\t\t\t\t\tcomponent: \"entity-modal\",\r\n\t\t\t\t\tsize: \"lg\",\r\n\t\t\t\t\tresolve: {\r\n\t\t\t\t\t\tentity: () => appEntity[0],\r\n\t\t\t\t\t\ttypeConfig: () => ctrl.form.Agency.Types.find(t => t.Code == entity.Type.Code),//configs[entity.Type.Code],\r\n\t\t\t\t\t\tpermissions: () => ctrl.entityPermissions,\r\n\t\t\t\t\t\tselectedType: () => entity.Type.Code\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.result.then(() => { });\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.components.user-entities\", []).component(\"userEntities\", {\r\n\tcontroller,\r\n\ttemplate,\r\n\tbindings: {\r\n\t\tuser: \"<\"\r\n\t}\r\n}).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t External Key \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t {{entity.Type.Name || entity.Type.Code}} \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t
    Entity Type Entity Entity Classification Included Entities
    No Entities associated to this user
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{entity.Name}}\\r\\n\\t\\t\\t\\t\\t{{entity.Code}}\\r\\n\\t\\t\\t\\t\\t{{entity.Name}}\\r\\n\\t\\t\\t\\t {{entity.Classification.Name || entity.Classification.Code}} {{entity.ExternalKey || '--'}} \\r\\n\\t\\t\\t\\t\\t{{!!entity.friendly ? entity.friendly.display : \\\"--\\\"}}\\r\\n\\t\\t\\t\\t\\t{{entity.targetType}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\tAdd {{eqc.names.join('/')}}\\r\\n\\t\\t\\r\\n\\t
    \\r\\n\";","import template from \"./user-form.html\";\r\nimport \"./user-form.less\";\r\nimport {\r\n\ttrim,\r\n\tkeyBy\r\n} from \"lodash\";\r\nimport {\r\n\tNAME_SUFFIX_LIST, \r\n\tSECURITY_ROLES \r\n} from \"../../../constants\";\r\nimport {\r\n\tFORM_USERS,\r\n\tFORM_USER_ROLES\r\n} from \"../../../routes\";\r\n\r\n//user-form\r\nexport function controller(\r\n\tapi,\r\n\ttoastr,\r\n\tloadingService,\r\n\tconfig,\r\n\tappState,\r\n\t$logger, \r\n\t$userProfile\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.readonly = appState.permissions.Administration.IsDisabled || appState.permissions.Administration.User.IsDisabled || !appState.permissions.Administration.User.Actions.CanEdit;\r\n\r\n\tctrl.saveUser = saveUser;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.invalidSuffix = null;\r\n\tctrl.securityRoles = [];\r\n\tctrl.userRole = null;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.suffixOptions = [{\r\n\t\t\tkey: \"\",\r\n\t\t\tdisplay: \"\"\r\n\t\t}].concat(NAME_SUFFIX_LIST.filter((s) => s.show === true));\r\n\t\tctrl.suffixMap = keyBy(NAME_SUFFIX_LIST, (s) => s.key);\r\n\r\n\t\tconst thisUserProfile = $userProfile.getUserProfile();\r\n\t\tconst thisUserRoleCode = thisUserProfile.user?.user?.roles?.[0] ?? \"USER\";\r\n\t\tconst thisUserRole = SECURITY_ROLES[thisUserRoleCode];\r\n\t\t\r\n\t\tctrl.securityRoles = Object.values(SECURITY_ROLES).filter(r => r.level >= thisUserRole.level);\r\n\r\n\t\tif(ctrl.user && ctrl.user.Contact && ctrl.user.Contact.Suffix) {\r\n\t\t\tif(!ctrl.suffixMap[ctrl.user.Contact.Suffix]) {\r\n\t\t\t\tctrl.invalidSuffix = ctrl.user.Contact.Suffix;\r\n\t\t\t\t// ctrl.user.Contact.Suffix = \"\";\r\n\t\t\t} else {\r\n\t\t\t\tctrl.user.Contact.Suffix = ctrl.suffixMap[ctrl.user.Contact.Suffix].display;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tctrl.user = ctrl.user || {};\r\n\t\t\tctrl.user.Contact = ctrl.user.Contact || {};\r\n\t\t\tctrl.user.Contact.Suffix = ctrl.user.Contact.Suffix || \"\";\r\n\t\t}\r\n\r\n\t\tloadUserDetails();\r\n\t}\r\n\r\n\tfunction saveUser() {\r\n\t\tconst params = {\r\n\t\t\tId: ctrl.user.Id,\r\n\t\t\tClientId: config.clientId,\r\n\t\t\tUserName: trim(ctrl.user.UserName || ctrl.user.Username),\r\n\t\t\tContact: {\r\n\t\t\t\tFirstName: trim(ctrl.user.Contact.FirstName),\r\n\t\t\t\tMiddleName: trim(ctrl.user.Contact.MiddleName),\r\n\t\t\t\tLastName: trim(ctrl.user.Contact.LastName),\r\n\t\t\t\tSuffix: trim(ctrl.user.Contact.Suffix)\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif(ctrl.user.Id) {\r\n\t\t\tupdateUser(params);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tcreateUser(params);\r\n\t}\r\n\r\n\tfunction loadUserDetails() {\r\n\t\tif(ctrl.user.Id !== undefined) {\r\n\t\t\tconst promise = api.get(FORM_USER_ROLES(appState.forms.selected.Id, ctrl.user.Id))\r\n\t\t\t\t.then(response => {\r\n\t\t\t\t\tconst currentRole = response[0];\r\n\t\t\t\t\r\n\t\t\t\t\tconst securityRoleCode = appState.forms.selected.Security?.Roles?.find(r => r.Code === currentRole?.Code)?.Name ?? \"USER\";\r\n\t\t\t\t\tctrl.userRole = SECURITY_ROLES[securityRoleCode];\r\n\t\t\t\t});\r\n\r\n\t\t\tloadingService.watch(promise);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction createUser(user) {\r\n\t\tlet apiRole = appState.forms.selected.Security?.Roles?.find(r => r.Code === \"USER\" || r.Name === \"USER\");\r\n\t\t\r\n\t\tif(ctrl.userRole?.name !== undefined && ctrl.userRole?.name.trim() !== \"\") {\r\n\t\t\tapiRole = appState.forms.selected.Security?.Roles?.find(r => r.Code === ctrl.userRole.name || r.Name === ctrl.userRole.name);\r\n\t\t}\r\n\t\tuser.Role = { Code: apiRole.Code, Name: \"\" };\r\n\r\n\t\tconst promise = api.post(FORM_USERS(appState.forms.selected.Id), user)\r\n\t\t\t.then(response => {\r\n\t\t\t\ttoastr.success(\r\n\t\t\t\t\t\"The user's account has been associated to your form. If the user is new to VESL a notification is on it's way.\",\r\n\t\t\t\t\t\"User Account Associated\"\r\n\t\t\t\t);\r\n\r\n\t\t\t\tctrl.setUser({\r\n\t\t\t\t\tuser: response\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\tloadingService.watch(promise, \"Loading...\");\r\n\t}\r\n\r\n\tfunction updateUser(user) {\r\n\t\tconst userUpdate = api.put(\"api/users\", user);\r\n\r\n\t\tconst apiRole = appState.forms.selected.Security?.Roles?.find(r => r.Code === ctrl.userRole.name || r.Name === ctrl.userRole.name);\r\n\t\tconst roleUpdate = api.put(FORM_USER_ROLES(appState.forms.selected.Id, ctrl.user.Id), [{ Code: apiRole.Code, Name: \"\" }]);\r\n\r\n\t\tconst fullUpdate = Promise.all([userUpdate, roleUpdate]).then(() => \r\n\t\t\ttoastr.success(\"User updated successfully. Note that any user role updates may take 10 minutes to update.\")\r\n\t\t);\r\n\r\n\t\tloadingService.watch(fullUpdate, \"Loading...\");\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.user-form\", [\"ngMessages\"])\r\n\t.component(\"userForm\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tuser: \"<\",\r\n\t\t\treload: \"&\",\r\n\t\t\tsetUser: \"&\",\r\n\t\t\tpermissions: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tRequired\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tRequired\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t{{$ctrl.invalidSuffix}}\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tRequired\\r\\n\\t\\t\\t\\tInvalid Email Address\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\r\\n\\t\\r\\n\\t\\tSave User\\r\\n\\t\\r\\n\\r\\n\";","import template from \"./user-modal.html\";\r\nimport \"./user-modal.less\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\nimport { some } from \"lodash\";\r\nimport { FORMS_REQUEST } from \"../../../routes\";\r\n\r\n//user-modal\r\nexport function controller(\r\n\teventBus,\r\n\t$scope,\r\n\tappState,\r\n\tapi\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = handleClose;\r\n\tctrl.reload = reload;\r\n\tctrl.setUser = setUser;\r\n\r\n\tctrl.unprocessedRequests = [];\r\n\r\n\tctrl.tabs = [\r\n\t\t{ name: \"Profile\" }\r\n\t];\r\n\tctrl.selectedTab = ctrl.tabs[0];\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.user = ctrl.resolve.user;\r\n\t\tctrl.permissions = appState.permissions.Administration.User;\r\n\t\tctrl.form = appState.forms.selected;\r\n\r\n\t\tif(ctrl.user) {\r\n\t\t\tctrl.user.UserName = ctrl.user.UserName || ctrl.user.Username; // hack until API picks a standard\r\n\t\t\tif(!ctrl.permissions.IsDisabled && ctrl.permissions.Actions.CanPermit) {\r\n\t\t\t\tctrl.tabs.push({ name: \"Entity Assignment\" });\r\n\t\t\t}\r\n\r\n\t\t\tapi.get(FORMS_REQUEST(ctrl.form.Id, ctrl.user.Id))\r\n\t\t\t\t.then(requests => {\r\n\t\t\t\t\tconst unprocessedRequests = requests.filter(r => r.IsProcessed !== true);\r\n\t\t\t\t\tctrl.unprocessedRequests = unprocessedRequests;\r\n\r\n\t\t\t\t\tif(unprocessedRequests.length > 0) {\r\n\t\t\t\t\t\tctrl.tabs.push({ name: \"Requests\" });\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\r\n\t\teventBus.register(EVENT_LOGOUT, () => { handleClose(); }, $scope);\r\n\t}\r\n\r\n\tfunction reload() {\r\n\t\t!!ctrl.getUsers && ctrl.getUsers();\r\n\t}\r\n\r\n\tfunction setUser(obj) {\r\n\t\tif(obj.user.Username) {\r\n\t\t\tobj.user.UserName = obj.user.Username; // hack until API picks a standard\r\n\t\t}\r\n\t\tctrl.user = obj.user;\r\n\r\n\t\tif(!some(ctrl.tabs, (tab) => tab.name === \"Entity Assignment\")) {\r\n\t\t\tctrl.tabs.push({ name: \"Entity Assignment\" });\r\n\t\t}\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\treload();\r\n\t\tctrl.modalInstance.close();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.user-modal\", [])\r\n\t.component(\"userModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\",\r\n\t\t\tgetUsers: \"&\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t {{$ctrl.user.Id ? ('Edit ' + $ctrl.user.Contact.FirstName) : 'New User'}} \\r\\n
    \\r\\n
    \\r\\n\\t
    \\r\\n\\t\\t
      \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t{{tab.name}}\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\tClose\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\";","import template from \"./user-requests.html\";\r\nimport \"./user-requests.less\";\r\n\r\nimport { NOMENCLATURE } from \"../../../constants\";\r\nimport { FORMS_PROCESS_REQUEST } from \"../../../routes\";\r\nimport {\r\n\tforEach,\r\n\tremove\r\n} from \"lodash\";\r\nimport moment from \"moment-timezone\";\r\n\r\nexport function controller(\r\n\tappState,\r\n\tloadingService,\r\n\tapi,\r\n\ttoastr\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.entityNomenclature = ctrl.form.nomenclature[NOMENCLATURE.PrimaryEntity];\r\n\r\n\t\tforEach(ctrl.openRequests, r => {\r\n\t\t\tr.dobString = !!r.DateOfBirth ? moment(r.DateOfBirth).format(\"MM-DD-YYYY\") : undefined;\r\n\t\t});\r\n\t};\r\n\r\n\tctrl.process = async(request) => {\r\n\t\tconst payload = {\r\n\t\t\t...request,\r\n\t\t\tIsProcessed: true\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tawait loadingService.watch(api.put(FORMS_PROCESS_REQUEST(ctrl.form.Id, ctrl.user.Id, payload.Id), payload));\r\n\r\n\r\n\t\t\ttoastr.success(\"User form request has been marked as processed.\");\r\n\r\n\t\t\trequest.IsProcessed = true;\r\n\t\t\t\r\n\t\t\tremove(ctrl.openRequests, r => r.Id === payload.Id);\r\n\t\t}catch(error) {\r\n\t\t\ttoastr.error(\"There was an error processing your request\");\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.components.user-requests\", [])\r\n\t.component(\"userRequests\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tuser: \"<\",\r\n\t\t\topenRequests: \"=\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t
    {{$ctrl.entityNomenclature}} Date of Birth Phone Number
    \\r\\n\\t\\t\\t\\t\\t MARK PROCESSED \\r\\n\\t\\t\\t\\t {{request.Entity}} {{request.dobString || '--'}} {{request.PhoneNumber || '--'}}
    \\r\\n
    \";","import template from \"./user-entity-association.html\";\r\nimport \"./user-entity-association.less\";\r\nimport { EVENT_LOGOUT } from \"../../../../constants\";\r\nimport { FORM_ENTITY_DETAILS } from \"routes.js\";\r\nimport { pluralize } from \"humanize-plus\";\r\n\r\n//user-modal\r\nexport function controller(eventBus, $scope, appState, api, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.handleCancel = handleCancel;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = handleClose;\r\n\tctrl.addAllLicenses = \"true\";\r\n\tctrl.handleDeselectDetails = handleDeselectDetails;\r\n\tctrl.primaryPluralNomenclature = pluralize(2, ctrl.resolve.entityConfig.Primary?.Type?.Name).toLowerCase();\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.friendlyEntity = ctrl.resolve.entity;\r\n\t\teventBus.register(\r\n\t\t\tEVENT_LOGOUT,\r\n\t\t\t() => {\r\n\t\t\t\thandleCancel();\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\r\n\t\tloadEntityDetails();\r\n\t}\r\n\r\n\tfunction loadEntityDetails() {\r\n\t\tconst route = FORM_ENTITY_DETAILS(appState.forms.selected.Id, ctrl.resolve.entity.Id);\r\n\r\n\t\tapi.get(route).then((entityDetail) => {\r\n\t\t\tctrl.entityDetail = entityDetail.filter((d) => \r\n\t\t\t\td.Entity.Type.Code === ctrl.resolve.entityConfig.Primary?.Type.Code && d.Type.Code === ctrl.resolve.entityConfig.RelationshipType.Code\r\n\t\t\t);\r\n\t\t\tctrl.entityDetail.map((e) => (e.isSelected = true));\r\n\t\t});\r\n\t}\r\n\r\n\tfunction handleDeselectDetails() {\r\n\t\tctrl.entityDetail = ctrl.entityDetail.map((entity) => ({ ...entity, isSelected: false }));\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tif(ctrl.addAllLicenses === \"true\") {\r\n\t\t\tctrl.modalInstance.close([ctrl.resolve.entity]);\r\n\t\t} else {\r\n\t\t\tconst licensesToAdd = ctrl.entityDetail.filter((e) => e.isSelected === true).map((e) => e.Entity);\r\n\t\t\tctrl.modalInstance.close(licensesToAdd);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction handleCancel() {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.user-friendly-association\", []).component(\"userFriendlyAssociation\", {\r\n\tcontroller,\r\n\ttemplate,\r\n\tbindings: {\r\n\t\tclose: \"&\",\r\n\t\tdismiss: \"&\",\r\n\t\tmodalInstance: \"<\",\r\n\t\tresolve: \"<\"\r\n\t}\r\n}).name;\r\n","export default \"
    \\r\\n\\t Entity Add \\r\\n
    \\r\\n\\r\\n\\t

    Adding this entity will associate this user with all current and future {{$ctrl.primaryPluralNomenclature}} that are associated with the entity.

    \\r\\n\\t
    \\r\\n\\t\\tDo you want to add all {{$ctrl.primaryPluralNomenclature}}?\\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\r\\n\\r\\n
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\tCancel\\r\\n\\t\\t\\tAssociate\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n
    \";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport marked from \"marked\";\r\nimport { globs } from \"../../services/globs\";\r\n\r\nexport function controller(\r\n\tappState,\r\n\tconfig,\r\n\t$uibModal,\r\n\t$sce,\r\n\thotkeys,\r\n\t$userProfile\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl._uibModal = $uibModal;\r\n\tctrl.onPrivacyClick = onPrivacyClick;\r\n\tctrl.onSupportAndFeedbackClick = onSupportAndFeedbackClick;\r\n\tctrl.onTermsClick = onTermsClick;\r\n\tctrl.hotkeys = hotkeys;\r\n\tctrl.userProfile = $userProfile.getUserProfile();\r\n\r\n\tctrl.canViewVeslFeedback = globs.feedback.vesl.read;\r\n\tctrl.canViewAgencyFeedback = globs.feedback.agency.read;\r\n\tctrl.canViewAgencyPhoneNumber = globs.feedback.agency.phoneNumber.read;\r\n\tctrl.canViewAgencyEmail = globs.feedback.agency.email.read;\r\n\tctrl.canViewAgencyMarkdown = globs.feedback.agency.markdown.read;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.support = config.support;\r\n\r\n\t\tif(!!ctrl.form?.nomenclature?.SupportMarkdown) {\r\n\t\t\tctrl.supportInfo = $sce.trustAsHtml(marked(ctrl.form?.nomenclature?.SupportMarkdown));\r\n\t\t}\r\n\t}\r\n\r\n\tfunction onPrivacyClick() {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"privacy-policy\",\r\n\t\t\tsize: \"lg\"\r\n\t\t});\r\n\t}\r\n\r\n\tfunction onSupportAndFeedbackClick() {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"support-feedback\"\r\n\t\t});\r\n\t}\r\n\tfunction onTermsClick() {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"terms\",\r\n\t\t\tsize: \"lg\"\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.support-info\", [])\r\n\t.component(\"supportInfo\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t
    \\r\\n\\t\\r\\n\\t\\t
    {{!!$ctrl.form.Agency.Name ? $ctrl.form.Agency.Name : 'VESL Support'}}
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t {{$ctrl.form.nomenclature.SupportNumber}} \\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t {{$ctrl.form.nomenclature.SupportEmail}} \\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\tVESL Support and Feedback\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\tView Keyboard Shortcuts\\r\\n\\t
    \\r\\n\\t
    \\r\\n\\t\\t Terms of Use \\r\\n\\t\\t Privacy Policy \\r\\n\\t
    \\r\\n\";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\n\r\nexport function controller(\r\n\t$logger, \r\n\tnoticeService,\r\n\tloadingService\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.hasUnreadNotices = noticeService.hasUnreadNotices;\r\n\t}\r\n\r\n\tctrl.getSeverityIcon = (notice) => {\r\n\t\tswitch(notice.Severity.Code) {\r\n\t\t\tcase \"INFO\":\r\n\t\t\t\treturn \"zmdi-info notice-info\";\r\n\t\t\t\t\r\n\t\t\tcase \"WARNING\":\r\n\t\t\t\treturn \"zmdi-alert-triangle notice-warning\";\r\n\t\t\t\t\t\r\n\t\t\tcase \"CRITICAL\":\r\n\t\t\t\treturn \"zmdi-alert-octagon notice-critical\";\r\n\t\t\t\t\t\t\r\n\t\t\tdefault: \r\n\t\t\t\treturn \"\";\r\n\t\t}\r\n\t};\r\n\t\r\n\tctrl.markRead = (noticeId) => {\r\n\t\tconst thisNotice = ctrl.notices.find(n => n.Id === noticeId);\r\n\t\tif(thisNotice.Read !== undefined) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst reading = noticeService.readNotice(noticeId)\r\n\t\t\t.then(() => {\r\n\t\t\t\tctrl.notices = noticeService.notices;\r\n\t\t\t\tctrl.hasUnreadNotices = noticeService.hasUnreadNotices;\r\n\t\t\t});\r\n\r\n\t\tloadingService.watch(reading);\r\n\t};\r\n\r\n\tctrl.markAllRead = () => {\r\n\t\tif(!ctrl.notices.some(n => n.Read === undefined)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst readingNotices = noticeService.readAllNotices().then(() => {\r\n\t\t\tctrl.notices = noticeService.notices;\r\n\t\t\tctrl.hasUnreadNotices = noticeService.hasUnreadNotices;\r\n\t\t});\r\n\r\n\t\tloadingService.watch(readingNotices);\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.notices-flyout\", [])\r\n\t.component(\"noticesFlyout\", {\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\tnotices: \"=\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t
    \\r\\n\\t\\t

    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\tNotifications\\r\\n\\t\\t\\tMark All Read \\r\\n\\t\\t

    \\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t

    No Notifications

    \\r\\n\\t\\t
    \\r\\n\\t\\t 0\\\"\\r\\n\\t\\t\\tng-click=\\\"$ctrl.markRead(notice.Id)\\\"\\r\\n\\t\\t>\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t{{notice.Title}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t

    \\r\\n\\t\\t\\t

    {{notice.Content}}

    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\";","import { SEVERITY_LEVELS } from \"../../../constants\";\r\nimport template from \"./index.html\";\r\nimport \"./index.less\";\r\n\r\nexport function controller(\r\n\t$logger, \r\n\t$scope,\r\n\tnoticeService,\r\n\tloadingService\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\r\n\tfunction onInit() {\r\n\t\trefreshDataFromService();\r\n\r\n\t\t$scope.$watch(() => noticeService.notices, (next, prev) => {\r\n\t\t\tif(next !== prev) {\r\n\t\t\t\trefreshDataFromService(next);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tctrl.markRead = (noticeId) => {\r\n\t\tconst reading = noticeService.readNotice(noticeId)\r\n\t\t\t.then(() => {\r\n\t\t\t\trefreshDataFromService();\r\n\t\t\t});\r\n\r\n\t\tloadingService.watch(reading);\r\n\t};\r\n\r\n\tfunction refreshDataFromService(notices) {\r\n\t\tctrl.hasUnreadNotices = noticeService.hasUnreadNotices;\r\n\t\tnotices = notices ?? noticeService.notices;\r\n\r\n\t\tctrl.notices = [...notices]\r\n\t\t\t.filter(n => noticeService.isNoticeValid(n))\r\n\t\t\t.filter(n => noticeService.showNoticeUnread(n))\r\n\t\t\t.sort((a, b) => {\r\n\t\t\t\tconst aOrder = SEVERITY_LEVELS[a.Severity.Code]?.order ?? SEVERITY_LEVELS[\"UNKNOWN\"].order;\r\n\t\t\t\tconst bOrder = SEVERITY_LEVELS[b.Severity.Code]?.order ?? SEVERITY_LEVELS[\"UNKNOWN\"].order;\r\n\r\n\t\t\t\treturn aOrder - bOrder;\r\n\t\t\t})\r\n\t\t\t.map(n => ({\r\n\t\t\t\tnotice: n,\r\n\t\t\t\tseverityDetails: SEVERITY_LEVELS[n.Severity.Code] ?? SEVERITY_LEVELS[\"UNKNOWN\"]\r\n\t\t\t}));\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.notice-banner\", [])\r\n\t.component(\"noticeBanner\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","export default \"\\r\\n\\t

    \\r\\n\\t\\t\\r\\n\\t\\t{{notice.notice.Title}} - {{notice.notice.Content}}\\r\\n\\t\\t\\r\\n\\t

    \\r\\n\";","import \"./tiered-select.less\";\r\nimport template from \"./tiered-select.html\";\r\nimport {\r\n\tfilter,\r\n\tfind\r\n} from \"lodash\";\r\nimport {\r\n\tEVENT_FILTER_PRIMARYDATE,\r\n\tEVENT_REQUEST_REPORTING_ENTITY\r\n} from \"constants.js\";\r\n\r\nexport class Controller {\r\n\tconstructor(uiHelpers, $uibModal, $scope, eventBus, toastr, loadingService, featureCallbacks, entityManager, $logger) {\r\n\t\tthis.uiHelpers = uiHelpers;\r\n\t\tthis._uibModal = $uibModal;\r\n\t\tthis._scope = $scope;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis._toastr = toastr;\r\n\t\tthis.loadingService = loadingService;\r\n\t\tthis.featureCallbacks = featureCallbacks;\r\n\t\tthis.entityManager = entityManager;\r\n\t\tthis.logger = $logger;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tconst ctrl = this;\r\n\r\n\t\tthis.blur = this.onBlur;\r\n\r\n\t\tctrl.friendly = ctrl.friendly || {};\r\n\t\tctrl.primary = ctrl.primary || {};\r\n\r\n\t\tif(this.isTiered) {\r\n\t\t\tthis._eventBus.register(EVENT_FILTER_PRIMARYDATE, (e, date) => {\r\n\t\t\t\tthis.filterDate = date.date; \r\n\t\t\t}, this._scope);\r\n\t\t}\r\n\t}\r\n\r\n\tsetBox(box) {\r\n\t\tconst ctrl = this;\r\n\r\n\t\tctrl.box = box;\r\n\t\tctrl.setChoices();\r\n\r\n\t\tctrl.configureSelectbox();\r\n\r\n\t\tif(ctrl.friendly.Id) {\r\n\t\t\tctrl.setChoice(ctrl.friendly.Id);\r\n\t\t}\r\n\t}\r\n\r\n\tconfigureSelectbox() {\r\n\t\tconst ctrl = this;\r\n\r\n\t\tconst selectBox = {\r\n\t\t\tsetChoices: function(data) {\r\n\t\t\t\tctrl.setChoices(data);\r\n\t\t\t},\r\n\t\t\tsetValue: function(primary, friendly, setChoice) {\r\n\t\t\t\tif(setChoice === undefined)\r\n\t\t\t\t\tsetChoice = true;\r\n\r\n\t\t\t\tctrl.primary = primary;\r\n\t\t\t\tctrl.friendly = friendly;\r\n\t\t\t\tconst id = friendly ? friendly.Id : primary.Id;\r\n\t\t\t\tctrl.value = id;\r\n\r\n\t\t\t\tif(setChoice) {\r\n\t\t\t\t\tctrl.setChoice(id);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\trestore: (data) => {\r\n\t\t\t\tthis.box.clearStore();\r\n\t\t\t\tthis.setChoices(data);\r\n\t\t\t},\r\n\t\t\tclearSelected: () => ctrl.clearSelected(),\r\n\t\t\treset: () => ctrl.reset(),\r\n\t\t\tenable: () => this.box.enable(),\r\n\t\t\tdisable: () => this.box.disable(),\r\n\t\t\trefresh: () => this.handleChange(),\r\n\t\t\tcheckForPrimary: () => this.checkForPrimary(),\r\n\t\t\tsetDisplay: (id) => this.setDisplay(id),\r\n\t\t\tswitchPrimary: () => this.checkForPrimary(true)\r\n\t\t};\r\n\r\n\t\tthis.callbacks({\r\n\t\t\tselectBox\r\n\t\t});\r\n\t}\r\n\r\n\tsetChoices(data) {\r\n\t\tif(data) {\r\n\t\t\tthis.options = data;\r\n\t\t}\r\n\t\tconst selectionChoices = this.uiHelpers.setDisplay(\r\n\t\t\tthis.options, \r\n\t\t\t{ \r\n\t\t\t\trecentlyUsedEnabled: this.groupRecents, \r\n\t\t\t\thideCode: this.hideCode \r\n\t\t\t},\r\n\t\t\tthis.renderingOptions?.Display?.List\r\n\t\t);\r\n\r\n\t\tthis.box.setChoices(selectionChoices, \"value\", \"label\", true);\r\n\t}\r\n\r\n\tsetChoice(id) {\r\n\t\tthis.box.setValueByChoice(id && id.toString());\r\n\t}\r\n\r\n\thandleChange() {\r\n\t\tif(!this.value) {\r\n\t\t\tthis.reset();\r\n\t\t} else {\r\n\t\t\tthis.checkForPrimary();\r\n\t\t}\r\n\t}\r\n\r\n\tcheckForPrimary(switchPrimary = false) {\r\n\t\tconst isEntitySelf = this.entityQueryConfiguration !== undefined \r\n\t\t\t? this.entityQueryConfiguration?.RelationshipType?.Code === \"SELF\"\r\n\t\t\t: this.entityManager.isEntitySelf(this.friendly);\r\n\t\tif(!isEntitySelf && this.friendly.Id && (!this.primary.Id || switchPrimary)) {\r\n\t\t\tconst validEntities = filter(this.friendly.Entities, (e) => (e.Entity && (e.Entity.valid === undefined || e.Entity.valid)));\r\n\r\n\t\t\tif(validEntities.length === 0) {\r\n\t\t\t\tthis._toastr.error(`${this.friendly.Name || this.friendly.Code} does not have a valid license for the selected date.`);\r\n\t\t\t\tthis.setPrimary();\r\n\t\t\t\treturn;\r\n\t\t\t} else if(validEntities.length === 1) {\r\n\t\t\t\tthis.primary = validEntities[0].Entity;\r\n\t\t\t\tthis.setPrimary();\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tthis.shouldRequestPrimaryUpdate ? this._eventBus.trigger(EVENT_REQUEST_REPORTING_ENTITY, {\r\n\t\t\t\t\tfriendly: this.friendly\r\n\t\t\t\t}) : this.activateModal(this.friendly);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.triggerParentChange();\r\n\t}\r\n\r\n\ttriggerParentChange() {\r\n\t\tconst selection = this.single ? {\r\n\t\t\tprimary: this.primary,\r\n\t\t\tfriendly: this.friendly\r\n\t\t} :\r\n\t\t\tthis.box.getValue(true);\r\n\r\n\t\tthis.onSelect({\r\n\t\t\tselection\r\n\t\t});\r\n\t}\r\n\r\n\tsetPrimary() {\r\n\t\tthis.clearSelected();\r\n\t\tif(this.primary.Id) {\r\n\t\t\tthis.setChoice(this.friendly.Id || this.primary.Id);\r\n\t\t} else {\r\n\t\t\tthis.friendly = {};\r\n\t\t\tthis.value = {};\r\n\t\t}\r\n\t\tthis.triggerParentChange();\r\n\t}\r\n\r\n\treset() {\r\n\t\tthis.primary = {};\r\n\t\tthis.friendly = {};\r\n\t\tthis.value = {};\r\n\t\tthis.onSelect({});\r\n\t}\r\n\r\n\tclearSelected() {\r\n\t\tconst values = this.box.getValue(true);\r\n\t\tthis.box.removeItemsByValue(values);\r\n\t}\r\n\r\n\tsetDisplay(id) {\r\n\t\tid = parseInt(id);\r\n\r\n\t\tif((this.friendly || {}).Id != id || !(this.primary || {}).Id) {\r\n\t\t\tconst item = find(this.options, {\r\n\t\t\t\tId: id\r\n\t\t\t});\r\n\r\n\t\t\tthis.primary = {};\r\n\t\t\tthis.friendly = item;\r\n\t\t\tthis.featureCallbacks.nestedEntityDateFilter(this.friendly, this.filterDate);\r\n\t\t}\r\n\r\n\t\tconst selectedItemDirectives = {\r\n\t\t\t\"hidden-print\": this.renderingOptions?.Display?.Selected,\r\n\t\t\t\"not-printing-hidden\": this.renderingOptions?.Print ?? this.renderingOptions?.Display?.Selected\r\n\t\t};\r\n\r\n\t\treturn this.uiHelpers.getEntityDisplay(this.friendly, this.primary, this.hideCode, this.hidePrimary, selectedItemDirectives);\r\n\t}\r\n\r\n\tactivateModal() {\r\n\t\tthis._uibModal\r\n\t\t\t.open({\r\n\t\t\t\tcomponent: \"primarySelector\",\r\n\t\t\t\tsize: \"lg\",\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tentity: () => this.friendly, \r\n\t\t\t\t\tprimaryDate: () => this.filterDate\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.result\r\n\t\t\t.then(selection => {\r\n\t\t\t\tthis.primary = selection;\r\n\t\t\t}).finally(() => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setPrimary();\r\n\t\t\t\t\tthis.box.containerOuter.focus();\r\n\t\t\t\t}\r\n\t\t\t\tcatch(err) {\r\n\t\t\t\t\tthis.logger.warn(\"err\", err);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.tiered-select\", [])\r\n\t.component(\"tieredSelect\", {\r\n\t\ttemplate: template,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tid: \"@\",\r\n\t\t\tlabel: \"<\",\r\n\t\t\tgroupRecents: \"<\",\r\n\t\t\tsingle: \"<\",\r\n\t\t\tsearch: \"<\",\r\n\t\t\toptions: \"<\",\r\n\t\t\tonSelect: \"&\",\r\n\t\t\tcallbacks: \"&\",\r\n\t\t\tisTiered: \"<\",\r\n\t\t\tisReadonly: \"<\",\r\n\t\t\tdefaultValue: \"<\",\r\n\t\t\thideCode: \"<\",\r\n\t\t\thidePrimary: \"<\",\r\n\t\t\tonBlur: \"&\",\r\n\t\t\tonFocus: \"&\",\r\n\t\t\tshouldRequestPrimaryUpdate: \"<\",\r\n\t\t\trenderingOptions: \"<\", \r\n\t\t\tentityQueryConfiguration: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\";","import template from \"./validation-callout.html\";\r\nimport \"./validation-callout.less\";\r\nimport {\r\n\tfilter,\r\n\tsize,\r\n\tsome,\r\n\torderBy,\r\n\tcompact,\r\n\tuniqBy,\r\n\tgroupBy\r\n} from \"lodash\";\r\nimport { REPORT_SCOPES } from \"../../constants\";\r\n\r\nexport function controller($logger) {\r\n\tconst ctrl = this;\r\n\tconst limitTo = 3;\r\n\r\n\tctrl.$onChanges = onChanges;\r\n\tctrl.ruleTitles = {};\r\n\r\n\tfunction onChanges() {\r\n\t\tif(!ctrl.validations)\r\n\t\t\treturn;\r\n\r\n\t\tconst types = ctrl.validations.map(o => {\r\n\t\t\tlet rules = [...filter(o.rules, (r) => some(ctrl.scopes, (s => r.validationScope.Code === s)))];\r\n\r\n\t\t\tlet validationQty = 0;\r\n\t\t\tlet detailValidationQty = 0;\r\n\r\n\t\t\tif(ctrl.scopes.indexOf(REPORT_SCOPES.detail) < 0) {\r\n\t\t\t\tconst detailValidations = o.rules.filter((err) => err.validationScope.Code === REPORT_SCOPES.detail && err.DetailId !== undefined);\r\n\t\t\t\tdetailValidationQty = uniqBy(detailValidations, e => e.DetailId).length;\r\n\r\n\t\t\t\tif(detailValidationQty === 0) {\r\n\t\t\t\t\tdetailValidationQty = undefined;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvalidationQty = rules.length;\r\n\r\n\t\t\tconst groupedValidations = groupBy(rules, rule => rule.Id);\r\n\t\t\trules = uniqBy(rules, rule => rule.Id);\r\n\r\n\t\t\tctrl.ruleTitles = rules.reduce((acc, rule) => {\r\n\t\t\t\tacc[rule.Id] = rule.Title;\r\n\t\t\t\tif(!groupedValidations[rule.Id].length > 1)\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\tif(rule.validationScope?.Code === REPORT_SCOPES.report || rule.validationScope?.Code === REPORT_SCOPES.metadata) {\r\n\t\t\t\t\tvalidationQty = validationQty - groupedValidations[rule.Id].length + 1;\r\n\t\t\t\t}\r\n\t\t\t\telse if(rule.validationScope?.Code !== REPORT_SCOPES.detail) {\r\n\t\t\t\t\tif(!rule.Engine?.IsAggregate)\r\n\t\t\t\t\t\tacc[rule.Id] = `(${groupedValidations[rule.Id].length} ${size(groupedValidations) === 1 ? \"detail\" : \"details\"}) ${rule.Title}`;\r\n\t\t\t\t}\r\n\t\t\t\treturn acc;\r\n\t\t\t}, { ...ctrl.ruleTitles });\r\n\r\n\t\t\tif(validationQty > 0 || detailValidationQty > 0) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...o,\r\n\t\t\t\t\trules: rules,\r\n\t\t\t\t\tmessage: validationQty > 0 ? o.message(validationQty) : \"\",\r\n\t\t\t\t\tmessageSubmitted: validationQty > 0 && o.messageSubmitted ? o.messageSubmitted(validationQty) : \"\",\r\n\t\t\t\t\tdetailMessage: detailValidationQty > 0 ? o.detailMessage(detailValidationQty) : \"\",\r\n\t\t\t\t\tdetailMessageSubmitted: detailValidationQty > 0 && o.detailMessageSubmitted ? o.detailMessageSubmitted(detailValidationQty) : \"\",\r\n\t\t\t\t\tshowAll: rules.length <= limitTo,\r\n\t\t\t\t\tlimit: rules.length > limitTo ? limitTo : undefined\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tctrl.types = orderBy(compact(types), [\"critical\"], [\"asc\"]);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.validation-callout\", [])\r\n\t.component(\"validationCallout\", {\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\tvalidations: \"<\",\r\n\t\t\tscopes: \"=\",\r\n\t\t\tisSubmitted: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t{{!!$ctrl.isSubmitted ? type.detailMessageSubmitted : type.detailMessage}}\\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t{{!!$ctrl.isSubmitted ? type.messageSubmitted : type.message}}\\r\\n\\t\\t
      \\r\\n\\t\\t\\t
    • {{$ctrl.ruleTitles[rule.Id]}}
    • \\r\\n\\t\\t
    \\r\\n\\t\\t{{type.rules.length - type.limit}} more \\r\\n\\t\\tHide \\r\\n\\t\\t\\r\\n\\t
    \\r\\n\";","import moment from \"moment-timezone\";\r\nimport { pluralize } from \"humanize-plus\";\r\nimport { NEW_REPORT } from \"routes.js\";\r\n\r\nconst template = `\r\n\t\r\n\t\r\n\t{{$ctrl.message}}\r\n`;\r\n\r\n// compliance-period-message\r\nfunction controller($state, appState, $sce) {\r\n\tconst ctrl = this;\r\n\tctrl.permissions = appState.permissions;\r\n\r\n\tctrl.$onChanges = onChanges;\r\n\r\n\tctrl.getComplianceMessage = getComplianceMessage;\r\n\tctrl.goToReportDetails = goToReportDetails;\r\n\tctrl.showLink = showLink;\r\n\r\n\tfunction onChanges() {\r\n\t\tctrl.message = getComplianceMessage();\r\n\t}\r\n\r\n\tfunction showLink() {\r\n\t\treturn ctrl.status.Pending > 0 || ctrl.status.Submitted > 0 || (!ctrl.status.Negative && ctrl.status.hasBegun);\r\n\t}\r\n\r\n\tfunction getComplianceMessage() {\r\n\t\tconst {\r\n\t\t\tPending, Submitted, Negative \r\n\t\t} = ctrl.status;\r\n\r\n\t\tif(Pending === 0 && Submitted === 0 && !Negative && ctrl.permissions.Reporting.Actions.CanCreate === true) {\r\n\t\t\tif(ctrl.status.hasBegun) {\r\n\t\t\t\tconst label = `Create first ${appState.forms.selected.nomenclature.PositiveReport}`;\r\n\t\t\t\treturn $sce.trustAsHtml(label);\r\n\t\t\t}\r\n\t\t\treturn \"--\";\r\n\t\t}\r\n\r\n\t\tconst messages = [];\r\n\r\n\t\tif(Pending > 0) {\r\n\t\t\tconst label = pluralize(Pending, `${appState.forms.selected.nomenclature.PositiveReport}`);\r\n\r\n\t\t\tmessages.push(`${Pending} Pending ${label}`);\r\n\t\t}\r\n\r\n\t\tif(Submitted > 0) {\r\n\t\t\tconst label = pluralize(Submitted, `${appState.forms.selected.nomenclature.PositiveReport}`);\r\n\r\n\t\t\tmessages.push(`${Submitted} Submitted ${label}`);\r\n\t\t}\r\n\r\n\t\tif(Negative) {\r\n\t\t\tconst label = `${appState.forms.selected.nomenclature.NegativeReport} Filed`;\r\n\r\n\t\t\tmessages.push(label);\r\n\t\t}\r\n\r\n\t\treturn $sce.trustAsHtml(messages.join(\"
    \"));\r\n\t}\r\n\r\n\tfunction goToReportDetails() {\r\n\t\tif(ctrl.status.Pending > 0 || ctrl.status.Submitted > 0) {\r\n\t\t\tctrl.timeZoneCode = ctrl.timeZoneCode || appState.forms.selected.TimeZone.Code;\r\n\r\n\t\t\tconst range = {\r\n\t\t\t\tbegin: moment.tz(ctrl.status.Period.BeginInclusive, ctrl.timeZoneCode).format(),\r\n\t\t\t\tend: moment\r\n\t\t\t\t\t.tz(ctrl.status.Period.EndExclusive, ctrl.timeZoneCode)\r\n\t\t\t\t\t.subtract(1, \"seconds\")\r\n\t\t\t\t\t.format()\r\n\t\t\t};\r\n\r\n\t\t\t$state.transitionTo(\"authenticated.report-list\", { start: range.begin, end: range.end, entityIds: [ctrl.entityId] });\r\n\t\t} else {\r\n\t\t\t$state.transitionTo(NEW_REPORT);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.compliance-period-message\", []).component(\"compliancePeriodMessage\", {\r\n\ttemplate,\r\n\tcontroller,\r\n\tbindings: {\r\n\t\tstatus: \"<\",\r\n\t\ttimeZoneCode: \"<\",\r\n\t\tentityId: \"<\"\r\n\t}\r\n}).name;\r\n","/* eslint-disable no-undef */\r\nimport template from \"./modal.html\";\r\nimport {\r\n\tfind,\r\n\tcompact,\r\n\tdebounce\r\n} from \"lodash\";\r\nimport polygonCenter from \"geojson-polygon-center\";\r\nimport {\r\n\tFIELD_KEYS,\r\n\tEVENT_LOGOUT\r\n} from \"constants.js\";\r\nimport { oxford } from \"humanize-plus\";\r\nimport { UNITS } from \"../../../constants\";\r\nconst settings = {\r\n\tpixelOffset: {\r\n\t\twidth: 0,\r\n\t\theight: -45\r\n\t}\r\n};\r\n\r\nexport class Controller {\r\n\tlookup = null;\r\n\tmapInstance = null;\r\n\tcurrentWindowPosition = null;\r\n\tinfoWindow = new window.google.maps.InfoWindow(settings);\r\n\tmarker = new google.maps.Marker();\r\n\r\n\tselected = {\r\n\t\tinfoWindow: new window.google.maps.InfoWindow(settings),\r\n\t\tfeature: null,\r\n\t\tmarker: new google.maps.Marker()\r\n\t};\r\n\r\n\tconstructor($scope, mapHelpers, $base64, toastr, eventBus) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._mapHelpers = mapHelpers;\r\n\t\tthis._base64 = $base64;\r\n\t\tthis._toastr = toastr;\r\n\t\tthis.eventBus = eventBus;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.lastEnteredArea = null;\r\n\t\tthis.debouncedLoadElevation = debounce(this.loadElevation, 60);\r\n\r\n\t\tthis.lookup = this.resolve.lookup;\r\n\t\tthis.title = oxford(this.lookup.data.map(d => d.Name));\r\n\t\tthis.initializeMap();\r\n\t\tthis.setMapLayers();\r\n\r\n\t\tthis.eventBus.register(EVENT_LOGOUT, () => { this.handleSelection(); }, this._scope);\r\n\t}\r\n\r\n\thandleSelection() {\r\n\t\tconst location = find(this.lookup.data, f => f.Key.Code === FIELD_KEYS.location && !f.value);\r\n\r\n\t\tif(location) {\r\n\t\t\tthis._toastr.error(`Please select a ${location.Name} before hitting Done.`);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst values = compact(this.lookup.data.map(f => f.value));\r\n\r\n\t\tthis.modalInstance.close(values);\r\n\t}\r\n\r\n\tsetHoverStyle(event) {\r\n\t\tthis.revertStyle();\r\n\t\tthis.layer.overrideStyle(event.feature, {\r\n\t\t\tfillOpacity: 0.8\r\n\t\t});\r\n\t}\r\n\r\n\trevertStyle() {\r\n\t\tthis.layer.revertStyle();\r\n\r\n\t\tif(this.selected.feature)\r\n\t\t\tthis.layer.overrideStyle(this.selected.feature, {\r\n\t\t\t\tfillOpacity: 0.8\r\n\t\t\t});\r\n\t}\r\n\r\n\tloadElevation(point, name) {\r\n\t\treturn this._mapHelpers.elevationLoader.load(point).then(result => {\r\n\t\t\tconst elevation = result;\r\n\t\t\tconst content = `\r\n

    ${name}

    \r\n\t\t\t \t \r\n\t\t\t\t\t${elevation?.isAboveSeaLevel ? \"Elevation\": \"Depth\"}: \r\n\t\t\t\t\t${Math.round(elevation.meters)} ${UNITS.meter.abbreviation}\r\n\t\t\t\t\t(${Math.round(elevation.feet)} ${UNITS.feet.abbreviation}.)\r\n\t\t\t\t\r\n\t\t\t`;\r\n\r\n\t\t\tif(this.currentWindowPosition == JSON.stringify(point)) {\r\n\t\t\t\tthis.showInfoWindow(content, point);\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\tgetEvents() {\r\n\t\tconst ctrl = this;\r\n\t\tconst types = {\r\n\t\t\tPolygon: (geometry) => {\r\n\t\t\t\tconst center = polygonCenter(geometry);\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlng: center.coordinates[0],\r\n\t\t\t\t\tlat: center.coordinates[1]\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tPoint: (geometry) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlng: geometry.coordinates[0],\r\n\t\t\t\t\tlat: geometry.coordinates[1]\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn {\r\n\t\t\tmouseover(event) {\r\n\t\t\t\tconst name = event.feature.getProperty(\"name\");\r\n\t\t\t\tconst feature = event.feature.getProperty(\"feature\");\r\n\t\t\t\tconst point = types[feature.geometry.type](feature.geometry);\r\n\r\n\t\t\t\tif(feature.geometry.type === \"Polygon\") {\r\n\t\t\t\t\tthis.lastEnteredArea = event.feature;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst content = `\r\n\t\t\t\t\t

    ${name}

    \r\n\t\t\t\t\tDepth: Loading...\r\n\t\t\t\t`;\r\n\t\t\t\tctrl.showInfoWindow(content, point);\r\n\r\n\t\t\t\tctrl.setHoverStyle(event);\r\n\t\t\t\tctrl.debouncedLoadElevation(point, name);\r\n\t\t\t},\r\n\t\t\tmouseout() {\r\n\t\t\t\tctrl.revertStyle();\r\n\t\t\t\tctrl.currentWindowPosition = null;\r\n\t\t\t\tctrl.infoWindow.close();\r\n\t\t\t},\r\n\t\t\tasync click(event) {\r\n\t\t\t\tconst name = event.feature.getProperty(\"name\");\r\n\t\t\t\tconst feature = event.feature.getProperty(\"feature\");\r\n\t\t\t\tconst point = types[feature.geometry.type](feature.geometry);\r\n\r\n\t\t\t\tif(feature.geometry.type === \"Polygon\") {\r\n\t\t\t\t\tthis.lastEnteredArea = event.feature;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// this purposefully does not use the debounced version, to avoid skipping the call\r\n\t\t\t\tconst elevation = await ctrl.loadElevation(point, name);\r\n\r\n\t\t\t\tconst content = `

    ${name}

    \r\n\t\t\t \t \r\n\t\t\t\t\t${elevation.isAboveSeaLevel > 0? \"Elevation\": \"Depth\"}: \r\n\t\t\t\t\t${Math.round(elevation.meters)} ${UNITS.meter.abbreviation}\r\n\t\t\t\t\t(${Math.round(elevation.feet)} ${UNITS.feet.abbreviation}.)\r\n\t\t\t\t`;\r\n\r\n\t\t\t\tctrl.selected.feature = event.feature;\r\n\r\n\t\t\t\tctrl.selected.infoWindow.setContent(content);\r\n\t\t\t\tctrl.selected.infoWindow.setPosition(point);\r\n\t\t\t\tctrl.selected.infoWindow.open(ctrl.mapInstance);\r\n\r\n\t\t\t\tctrl.marker.setPosition(point);\r\n\t\t\t\tctrl.marker.setMap(ctrl.mapInstance);\r\n\r\n\t\t\t\tsetFieldValueForFeature(event.feature);\r\n\r\n\t\t\t\tif(event.feature.getProperty(\"feature\").geometry.type === \"Point\" && !!this.lastEnteredArea) {\r\n\t\t\t\t\tsetFieldValueForFeature(this.lastEnteredArea);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tctrl._scope.$evalAsync();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction setFieldValueForFeature(feature) {\r\n\t\t\tconst fieldId = feature.getProperty(\"fieldId\");\r\n\t\t\tconst id = feature.getProperty(\"id\");\r\n\t\t\tconst name = feature.getProperty(\"name\");\r\n\r\n\t\t\tconst field = find(ctrl.lookup.data, (f) => f.Id === fieldId);\r\n\r\n\t\t\tfield.value = {\r\n\t\t\t\tId: id,\r\n\t\t\t\tName: name,\r\n\t\t\t\tfieldId: fieldId\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\tshowInfoWindow(content, coordinates) {\r\n\t\tthis.currentWindowPosition = JSON.stringify(coordinates);\r\n\t\tthis.infoWindow.setContent(content);\r\n\r\n\t\tthis.infoWindow.setPosition(new window.google.maps.LatLng(coordinates));\r\n\r\n\t\tthis.infoWindow.open(this.mapInstance);\r\n\t}\r\n\r\n\tinitializeMap() {\r\n\t\tconst ctrl = this;\r\n\t\tconst map = new google.maps.Map(document.getElementById(\"map\"), {\r\n\t\t\tgestureHandling: \"greedy\",\r\n\t\t\tstreetViewControl: false\r\n\t\t});\r\n\r\n\t\tmap.setMapTypeId(window.google.maps.MapTypeId.HYBRID);\r\n\t\twindow.google.maps.event.trigger(map, \"resize\");\r\n\r\n\t\tsetTimeout(function() {\r\n\t\t\tgoogle.maps.event.trigger(map, \"resize\");\r\n\r\n\t\t\tconst bounds = new google.maps.LatLngBounds();\r\n\t\t\tctrl.layer.forEach(function(feature) {\r\n\t\t\t\tfeature.getGeometry().forEachLatLng(function(latlng) {\r\n\t\t\t\t\tbounds.extend(latlng);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tctrl.mapInstance.fitBounds(bounds);\r\n\r\n\t\t\tconst zoom = ctrl.mapInstance.getZoom();\r\n\t\t\tctrl.mapInstance.setZoom(zoom + 1);\r\n\r\n\t\t}, 600);\r\n\r\n\t\tthis.mapInstance = map;\r\n\t}\r\n\r\n\tclearSelected(fieldId) {\r\n\t\tconst f = find(this.lookup.data, d => d.Id === fieldId);\r\n\r\n\t\tif(f.Key.Code === FIELD_KEYS.location) {\r\n\t\t\tthis.selected.infoWindow.close();\r\n\t\t\tthis.selected.feature = null;\r\n\t\t\tthis.revertStyle();\r\n\t\t}\r\n\r\n\t\tf.value = null;\r\n\t\tthis._scope.$evalAsync();\r\n\t}\r\n\r\n\tsetMapLayers() {\r\n\t\tthis.layer = new google.maps.Data();\r\n\r\n\t\tthis.lookup.data.forEach((f) => {\r\n\t\t\tf.value = null;\r\n\t\t\tthis.addToLayer(f);\r\n\t\t});\r\n\r\n\t\tthis.layer.setStyle((param) => {\r\n\t\t\tconst feature = param.getProperty(\"feature\");\r\n\r\n\t\t\treturn {\r\n\t\t\t\tstrokeColor: \"#9cbcd8\",\r\n\t\t\t\tstrokeOpacity: 0.8,\r\n\t\t\t\tstrokeWeight: 1,\r\n\t\t\t\tfillColor: \"#9cbcd8\",\r\n\t\t\t\tfillOpacity: 0.0,\r\n\t\t\t\toptimized: false,\r\n\t\t\t\ticon: feature.geometry.type == \"Point\"\r\n\t\t\t\t\t? {\r\n\t\t\t\t\t\turl: \"./images/reef.svg\",\r\n\t\t\t\t\t\tscaledSize: new google.maps.Size(16, 16)\r\n\t\t\t\t\t}\r\n\t\t\t\t\t: \"\"\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tthis.layer.setMap(this.mapInstance);\r\n\r\n\t\tconst events = this.getEvents();\r\n\r\n\t\tevents.mouseover && this.layer.addListener(\"mouseover\", events.mouseover);\r\n\t\tevents.mouseout && this.layer.addListener(\"mouseout\", events.mouseout);\r\n\t\tevents.click && this.layer.addListener(\"click\", events.click);\r\n\t}\r\n\r\n\textractGeoJson(item, fieldId) {\r\n\t\tconst geoJson = JSON.parse(this._base64.decode(item.Shape.GeoJson));\r\n\r\n\t\tgeoJson.features.map(f => {\r\n\t\t\treturn f.properties = {\r\n\t\t\t\t...f.properties,\r\n\t\t\t\tid: item.Id,\r\n\t\t\t\tfieldId: fieldId,\r\n\t\t\t\tname: item.Name || item.Code,\r\n\t\t\t\tfeature: f\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\treturn geoJson;\r\n\t}\r\n\r\n\taddToLayer(field) {\r\n\t\tlet featureCollection = null;\r\n\r\n\t\tfield.Data.forEach(d => {\r\n\t\t\tif(d.Shape.GeoJson) {\r\n\t\t\t\tconst geoJson = this.extractGeoJson(d, field.Id);\r\n\r\n\t\t\t\tif(featureCollection === null) {\r\n\t\t\t\t\tfeatureCollection = geoJson;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tgeoJson.features.forEach(f => featureCollection.features.push(f));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.layer.addGeoJson(featureCollection);\r\n\t}\r\n\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.field-helpers.map-modal\", [])\r\n\t.component(\"mapModal\", {\r\n\t\tcontroller: Controller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t

    {{$ctrl.title}} Selector

    \\r\\n
    \\r\\n\\r\\n\\t
    After selecting a Location and/or Reef, please click Done.
    \\r\\n\\t
      \\r\\n\\t\\t
    • \\r\\n\\t\\t\\t{{data.Name}}: {{(data.value || {}).Name || '--'}}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
    • \\r\\n\\t
    \\r\\n\\t
    \\r\\n\\r\\n
    \\r\\n\\tCancel\\r\\n\\tDone\\r\\n
    \";","import modal from \"./modal\";\r\nimport \"./index.less\";\r\nimport { EVENT_SET_VALUE } from \"constants.js\";\r\nimport { find } from \"lodash\";\r\n\r\nexport class Controller {\r\n\tconstructor($uibModal, eventBus) {\r\n\t\tthis._uibModal = $uibModal;\r\n\t\tthis._eventBus = eventBus;\r\n\t}\r\n\r\n\tactivateModal() {\r\n\t\tthis._uibModal\r\n\t\t\t.open({\r\n\t\t\t\tcomponent: \"mapModal\",\r\n\t\t\t\tsize: \"lg\",\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tlookup: () => this.lookup\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.result.then(selection => {\r\n\t\t\t\tthis.lookup.data.forEach(field => {\r\n\t\t\t\t\tconst value = find(selection, s => s.fieldId === field.Id);\r\n \r\n\t\t\t\t\tif((value || {}).Id)\r\n\t\t\t\t\t\tthis._eventBus.trigger(EVENT_SET_VALUE(field.Id), { value });\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t}\r\n}\r\n\r\nconst deps = [modal];\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.field-helpers.area-selector\", deps)\r\n\t.component(\"areaSelector\", {\r\n\t\ttemplate: `\r\n \r\n `,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tlookup: \"<\",\r\n\t\t\tonSelect: \"&\"\r\n\t\t}\r\n\t}).name;\r\n","import \"./custom-popup.less\";\r\n\r\nexport class CustomPopup {\r\n\t/**\r\n\t * @position latlng object\r\n\t * @content reference to div to make custom popup in\r\n\t */\r\n\r\n\tconstructor(content) {\r\n\t\tthis.content = content;\r\n\t\tthis.content.classList.add(\"popup-bubble\");\r\n\t\t// This zero-height div is positioned at the bottom of the bubble.\r\n\t\tconst bubbleAnchor = document.createElement(\"div\");\r\n\t\tbubbleAnchor.classList.add(\"popup-bubble-anchor\");\r\n\t\tbubbleAnchor.appendChild(content);\r\n\t\t// This zero-height div is positioned at the bottom of the tip.\r\n\t\tthis.containerDiv = document.createElement(\"div\");\r\n\t\tthis.containerDiv.classList.add(\"popup-container\");\r\n\t\tthis.containerDiv.appendChild(bubbleAnchor);\r\n\t}\r\n\r\n\tsetPosition(pos) {\r\n\t\tthis.position = pos;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/** Called when the popup is added to the map. */\r\n\tonAdd() {\r\n\t\tthis.getPanes().floatPane.appendChild(this.containerDiv);\r\n\t}\r\n\r\n\t/** Called when the popup is removed from the map. */\r\n\tonRemove() {\r\n\t\tif(this.containerDiv.parentElement) {\r\n\t\t\tthis.containerDiv.parentElement.removeChild(this.containerDiv);\r\n\t\t}\r\n\t}\r\n\r\n\t/** Called each frame when the popup needs to draw itself. */\r\n\tdraw() {\r\n\t\tif(!this.position) {\r\n\t\t\tthis.containerDiv.style.display = \"none\";\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst divPosition = this.getProjection()?.fromLatLngToDivPixel(\r\n\t\t\tthis.position\r\n\t\t);\r\n\t\tif(divPosition) {\r\n\t\t// Hide the popup when it is far out of view.\r\n\t\t\tconst display =\r\n\t\t\tMath.abs(divPosition.x) < 4000 && Math.abs(divPosition.y) < 4000 ?\r\n\t\t\t\t\"block\" :\r\n\t\t\t\t\"none\";\r\n\r\n\t\t\tif(display === \"block\") {\r\n\t\t\t\tthis.containerDiv.style.left = divPosition.x + \"px\";\r\n\t\t\t\tthis.containerDiv.style.top = divPosition.y + \"px\";\r\n\t\t\t}\r\n\r\n\t\t\tif(this.containerDiv.style.display !== display) {\r\n\t\t\t\tthis.containerDiv.style.display = display;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * \r\n\t * @html content that is put in popup \r\n\t */\r\n\tsetText(html) {\r\n\t\tthis.content.innerHTML = html;\r\n\t}\r\n\r\n\t/**\r\n\t * deletes the content of the popup\r\n\t */\r\n\tclearText() {\r\n\t\twhile(this.content.firstChild) this.content.removeChild(this.content.firstChild);\r\n\t}\r\n}\r\n","/* eslint-disable no-undef */\r\nimport {\r\n\tdebounce,\r\n\tround,\r\n\tthrottle\r\n} from \"lodash\";\r\nimport template from \"./modal.html\";\r\nimport {\r\n\tevery,\r\n\tvalues\r\n} from \"lodash\";\r\nimport {\r\n\tFIELD_KEYS,\r\n\tEVENT_LOGOUT\r\n} from \"constants.js\";\r\n\r\nimport { CustomPopup } from \"./CustomPopup\";\r\nimport { UNITS } from \"../../../constants\";\r\n\r\nconst settings = {\r\n\tpixelOffset: { width: 0, height: -45 },\r\n\tselectedZoom: 5\r\n};\r\n\r\nconst DEFAULT_RANGE_NORTH = 51;\r\nconst DEFAULT_RANGE_EAST = -63;\r\nconst DEFAULT_RANGE_SOUTH = 24;\r\nconst DEFAULT_RANGE_WEST = -128;\r\n\r\nconst defaultUSABounds = {\r\n\tnorth: DEFAULT_RANGE_NORTH,\r\n\tsouth: DEFAULT_RANGE_SOUTH,\r\n\teast: DEFAULT_RANGE_EAST,\r\n\twest: DEFAULT_RANGE_WEST\r\n};\r\n\r\nexport class Controller {\r\n\tlookup = null;\r\n\tmapInstance = null;\r\n\tinfoWindow = new window.google.maps.InfoWindow(settings);\r\n\tmarker = new google.maps.Marker();\r\n\r\n\tselected = {\r\n\t\tmarker: new google.maps.Marker(),\r\n\t\tinfoWindow: new window.google.maps.InfoWindow(settings),\r\n\t\tposition: null\r\n\t};\r\n\r\n\tconstructor($scope, mapHelpers, $base64, eventBus, $logger) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._mapHelpers = mapHelpers;\r\n\t\tthis._base64 = $base64;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.$logger = $logger;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.lookup = this.resolve.lookup;\r\n\t\tthis.updatable = this.resolve.lookup.isUpdatable();\r\n\t\tthis.debouncedLoadElevation = debounce(this.loadElevation, 60);\r\n\t\tthis.elevation = undefined;\r\n\r\n\t\tthis.initializeMap();\r\n\t\tthis.setMapLayer();\r\n\r\n\t\tconst locationVals = values(this.resolve.location);\r\n\t\tconst hasLocation = locationVals.length > 0 && every(locationVals);\r\n\r\n\t\tif(hasLocation && typeof locationVals[0] === \"number\" && typeof locationVals[1] === \"number\") {\r\n\t\t\ttry {\r\n\t\t\t\tconst latLng = new window.google.maps.LatLng({ lat: locationVals[0], lng: locationVals[1] });\r\n\t\t\t\tthis.selected.position = latLng.lat() && latLng.lng() ? {\r\n\t\t\t\t\tlat: latLng.lat(),\r\n\t\t\t\t\tlng: latLng.lng()\r\n\t\t\t\t} : undefined;\r\n\t\t\t}catch(err) {\r\n\t\t\t\tthis.$logger.warn(`Google likely could not construct a valid latLng object given the input of ${locationVals[0]}, ${locationVals[1]}`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.selected.position) {\r\n\t\t\tthis.debouncedLoadElevation(this.selected.position);\r\n\t\t\tconst content = this.calloutHtml(this.selected.position);\r\n\r\n\t\t\tthis.showInfoWindow(content, this.selected.position);\r\n\t\t\tthis.setStationaryMarker(this);\r\n\t\t}\r\n\r\n\t\tthis.eventBus.register(EVENT_LOGOUT, () => { this.done(); }, this._scope);\r\n\r\n\t\t// update the info window whenever the elevation value changes.\r\n\t\tthis._scope.$watch(this.elevation, (newVal) => {\r\n\t\t\tnewVal && this.updateInfoWindow(this.infoWindow, newVal);\r\n\t\t});\r\n\t}\r\n\r\n\tdone() {\r\n\t\tthis.modalInstance.close(this.selected.position);\r\n\t}\r\n\r\n\tloadElevation(point) {\r\n\t\tthis._mapHelpers.elevationLoader.load(point).then(result => {\r\n\t\t\tthis.elevation = {\r\n\t\t\t\t...result,\r\n\t\t\t\tposition: point\r\n\t\t\t};\r\n\r\n\t\t\tthis.updateInfoWindow(this.infoWindow, this.elevation);\r\n\r\n\t\t\tif(this.selected.position)\r\n\t\t\t\tthis.updateInfoWindow(this.selected.infoWindow, this.elevation);\r\n\t\t});\r\n\t}\r\n\r\n\tupdateInfoWindow(infoWindow, elevation) {\r\n\t\tconst currentPosition = this.getCoordinates(infoWindow.position);\r\n\t\tif(JSON.stringify(currentPosition) == JSON.stringify(elevation.position)) {\r\n\t\t\tconst content = this.calloutHtml(elevation.position, elevation);\r\n\r\n\t\t\tinfoWindow.setContent(content);\r\n\t\t}\r\n\t}\r\n\r\n\tgetCoordinates(latLng) {\r\n\t\treturn {\r\n\t\t\tlat: latLng.lat(),\r\n\t\t\tlng: latLng.lng()\r\n\t\t};\r\n\t}\r\n\r\n\tgetEvents() {\r\n\t\tconst ctrl = this;\r\n\t\tconst throttledUpdateInfoBox = throttle(updateInfoBoxPosition, parseInt(1000.0 / 60.0));\r\n\r\n\t\treturn {\r\n\t\t\t// show on hover, but without marker\r\n\t\t\tmousemove(event) {\r\n\t\t\t\tif(ctrl.updatable) {\r\n\t\t\t\t\tthrottledUpdateInfoBox(ctrl, event, false);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmouseout() {\r\n\t\t\t\tctrl.marker.setMap(null);\r\n\t\t\t\tctrl.infoWindow.close();\r\n\t\t\t},\r\n\t\t\tclick(event) {\r\n\t\t\t\tif(ctrl.updatable) {\r\n\t\t\t\t\tctrl.elevation = undefined;\r\n\t\t\t\t\tctrl.selected.position = ctrl.getCoordinates(event.latLng);\r\n\t\t\t\t\tupdateInfoBoxPosition(ctrl, event);\r\n\r\n\t\t\t\t\tctrl.setStationaryMarker(ctrl);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction updateInfoBoxPosition(ctrl, event, showFullInfo = true) {\r\n\t\t\tconst point = ctrl.getCoordinates(event.latLng);\r\n\r\n\t\t\tif(showFullInfo) {\r\n\t\t\t\tconst content = ctrl.calloutHtml(point, ctrl.elevation, showFullInfo);\r\n\t\t\t\tctrl.debouncedLoadElevation(point);\r\n\t\t\t\tctrl.showInfoWindow(content, point);\r\n\t\t\t\tctrl.marker.setPosition(new window.google.maps.LatLng(point));\r\n\t\t\t\tctrl.marker.setMap(ctrl.mapInstance);\r\n\t\t\t}\r\n\t\t\tif(!showFullInfo) {\r\n\t\t\t\tconst content = ctrl.hoverHtml(point);\r\n\t\t\t\tctrl.popup.setPosition(event.latLng);\r\n\t\t\t\tctrl.popup.setText(content);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetStationaryMarker(ctrl) {\r\n\t\tctrl.selected.infoWindow.setContent(ctrl.infoWindow.content);\r\n\t\tctrl.selected.infoWindow.setPosition(new window.google.maps.LatLng(ctrl.selected.position));\r\n\t\tctrl.selected.infoWindow.open(ctrl.mapInstance);\r\n\r\n\t\tctrl.selected.marker.setPosition(new window.google.maps.LatLng(ctrl.selected.position));\r\n\t\tctrl.selected.marker.setMap(ctrl.mapInstance);\r\n\t}\r\n\r\n\tshowInfoWindow(content, coordinates) {\r\n\t\tthis.infoWindow.setContent(content);\r\n\r\n\t\tthis.infoWindow.setPosition(new window.google.maps.LatLng(coordinates));\r\n\r\n\t\tthis.infoWindow.open(this.mapInstance);\r\n\t}\r\n\r\n\tinitializeMap() {\r\n\t\tconst ctrl = this;\r\n\t\tthis.mapInstance = new google.maps.Map(document.getElementById(\"map\"), {\r\n\t\t\tgestureHandling: \"greedy\",\r\n\t\t\tstreetViewControl: false\r\n\t\t});\r\n\r\n\t\tthis.mapInstance.setMapTypeId(window.google.maps.MapTypeId.HYBRID);\r\n\t\twindow.google.maps.event.trigger(this.mapInstance, \"resize\");\r\n\r\n\t\tCustomPopup.prototype.__proto__ = window.google.maps.OverlayView.prototype;\r\n\t\tthis.popup = new CustomPopup(\r\n\t\t\tdocument.getElementById(\"custom-popup\")\r\n\t\t);\r\n\t\tthis.popup.setMap(ctrl.mapInstance);\r\n\r\n\t\tsetTimeout(function() {\r\n\t\t\tgoogle.maps.event.trigger(ctrl.mapInstance, \"resize\");\r\n\t\t\tlet zoom = ctrl.mapInstance.getZoom() || settings.selectedZoom;\r\n\r\n\t\t\t// setup default map bounds given feature data or US\r\n\t\t\tif(ctrl.lookup.data) {\r\n\t\t\t\tconst bounds = new google.maps.LatLngBounds();\r\n\t\t\t\tctrl.layer.forEach(function(feature) {\r\n\t\t\t\t\tfeature.getGeometry().forEachLatLng(function(latlng) {\r\n\t\t\t\t\t\tbounds.extend(latlng);\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\tctrl.mapInstance.fitBounds(bounds);\r\n\r\n\t\t\t\tzoom = ctrl.mapInstance.getZoom() || settings.selectedZoom;\r\n\t\t\t\tctrl.mapInstance.setZoom(zoom + 0.5);\r\n\t\t\t} \r\n\r\n\t\t\t//if there is a position, then zoom to it. Else, try and use the default position\r\n\t\t\tif(ctrl.selected.position) {\r\n\t\t\t\tctrl.mapInstance.setCenter({\r\n\t\t\t\t\tlat: ctrl.selected.position.lat,\r\n\t\t\t\t\tlng: ctrl.selected.position.lng\r\n\t\t\t\t});\r\n\t\t\t\tctrl.mapInstance.setZoom(zoom);\r\n\t\t\t}\r\n\t\t\telse if(!!ctrl.resolve.defaultPosition) {\r\n\t\t\t\tctrl.mapInstance.setCenter({\r\n\t\t\t\t\tlat: ctrl.resolve.defaultPosition.center[FIELD_KEYS.latitude],\r\n\t\t\t\t\tlng: ctrl.resolve.defaultPosition.center[FIELD_KEYS.longitude]\r\n\t\t\t\t});\r\n\t\t\t\tctrl.mapInstance.setZoom(ctrl.resolve.defaultPosition.zoom || settings.selectedZoom);\r\n\t\t\t}\r\n\t\t\telse if(!ctrl.lookup.data) {\r\n\t\t\t\tctrl.mapInstance.fitBounds(defaultUSABounds);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif(ctrl.lookup.buoys) {\r\n\t\t\t\tctrl.setBuoyLayer();\r\n\t\t\t}\r\n\t\t}, 600);\r\n\t}\r\n\r\n\tsetBuoyLayer() {\r\n\t\tconst layer = new google.maps.Data();\r\n\t\tconst ctrl = this;\r\n\r\n\t\tlayer.addGeoJson(this.lookup.buoys);\r\n\t\tlayer.setStyle(() => {\r\n\t\t\treturn { icon: \"./images/reef.svg\" };\r\n\t\t});\r\n\t\tlayer.setMap(this.mapInstance);\r\n\r\n\t\tlayer.addListener(\"mouseover\", (event) => {\r\n\t\t\tconst name = event.feature.getProperty(\"NAME\") || \"N/A\";\r\n\r\n\t\t\tconst point = ctrl.getCoordinates(event.latLng);\r\n\r\n\t\t\tconst content = `

    ${name}

    `;\r\n\t\t\tctrl.showInfoWindow(content, point);\r\n\t\t});\r\n\t}\r\n\r\n\tsetMapLayer() {\r\n\t\tconst ctrl = this;\r\n\t\tthis.layer = this.mapInstance;\r\n\r\n\t\tif(ctrl.lookup.data) {\r\n\t\t\tthis.layer = new google.maps.Data();\r\n\t\t\tthis.lookup.data.forEach(g => ctrl.layer.addGeoJson(g));\r\n\t\t\tthis.layer.setStyle((param) => param.getProperty(\"style\"));\r\n\t\t\tthis.layer.setMap(this.mapInstance);\r\n\t\t}\r\n\r\n\t\tconst events = this.getEvents();\r\n\t\tevents.mousemove && this.layer.addListener(\"mousemove\", events.mousemove);\r\n\t\tevents.mouseout && this.layer.addListener(\"mouseout\", events.mouseout);\r\n\t\tevents.click && this.marker.addListener(\"click\", events.click);\r\n\t\tevents.click && this.layer.addListener(\"click\", events.click);\r\n\t}\r\n\r\n\tcalloutHtml(point, elevation, showFullInfo = true) {\r\n\t\tconst depthDisplay = showFullInfo && elevation?.meters ?\r\n\t\t\t`\r\n\t\t\t` \r\n\t\t\t: \"\";\r\n\r\n\t\tif(this.resolve.lookup.mode === \"DECIMAL_DEGREES\") {\r\n\t\t\tconst latDMS = this.resolve.lookup.degreeMapper(point.lat);\r\n\t\t\tconst lngDMS = this.resolve.lookup.degreeMapper(point.lng);\r\n\t\t\tconst roundingPoint = this.resolve.lookup.roundingPoint || 6; // 6 is the max decimal count stored, so is the default here\r\n\r\n\t\t\treturn `\r\n\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t\t\t${round(latDMS, roundingPoint)}°\r\n\t\t\t\t\t${round(lngDMS, roundingPoint)}°\r\n\t\t\t\t
    \r\n\t\t\t\t${depthDisplay}\r\n\t\t\t
    `;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tconst latDMS = this.resolve.lookup.degreeMapper(point.lat, true);\r\n\t\t\tconst lngDMS = this.resolve.lookup.degreeMapper(point.lng, true);\r\n\r\n\t\t\treturn `\r\n\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t\t\t${latDMS.degrees}°${latDMS.roundedMinutes}'${latDMS.isNegative ? \"S\" : \"N\"}\r\n\t\t\t\t\t${lngDMS.degrees}°${lngDMS.roundedMinutes}'${lngDMS.isNegative ? \"W\" : \"E\"}\r\n\t\t\t\t
    \r\n\t\t\t\t${depthDisplay}\r\n\t\t\t
    \r\n\t\t`;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t *\r\n\t * @point latlng object\r\n\t * @returns html for the custom hover popup\r\n\t */\r\n\r\n\thoverHtml(point) {\r\n\t\tconst roundingPoint = this.resolve.lookup.roundingPoint || 6;\r\n\r\n\t\tif(this.resolve.lookup.mode === \"DECIMAL_DEGREES\") {\r\n\t\t\tconst latDMS = this.resolve.lookup.degreeMapper(point.lat);\r\n\t\t\tconst lngDMS = this.resolve.lookup.degreeMapper(point.lng);\r\n\r\n\t\t\treturn `\r\n\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t${round(latDMS, roundingPoint)}°\r\n\t\t\t\t\t\t${round(lngDMS, roundingPoint)}°\r\n\t\t\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t`;\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\tconst latDMS = this.resolve.lookup.degreeMapper(point.lat, true);\r\n\t\t\tconst lngDMS = this.resolve.lookup.degreeMapper(point.lng, true);\r\n\r\n\t\t\treturn `\r\n\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t${round(latDMS.degrees)}°${latDMS.roundedMinutes}'${latDMS.isNegative ? \"S\" : \"N\"}\r\n\t\t\t\t\t\t${round(lngDMS.degrees)}°${lngDMS.roundedMinutes}'${lngDMS.isNegative ? \"W\" : \"E\"}\r\n\t\t\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t`;\r\n\t\t}\r\n\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.field-helpers.location-modal\", [])\r\n\t.component(\"locationModal\", {\r\n\t\tcontroller: Controller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t

    Location Selector

    \\r\\n
    \\r\\n\\r\\n\\t
    \\r\\n\\t
    \\r\\n\\r\\n
    \\r\\n\\tCancel\\r\\n\\tDone\\r\\n
    \";","import modal from \"./modal\";\r\nimport {\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_SEND_VALUE,\r\n\tEVENT_GET_VALUE,\r\n\tFIELD_KEYS\r\n} from \"constants.js\";\r\nimport {\r\n\tfind,\r\n\tforEach\r\n} from \"lodash\";\r\nimport \"./index.less\";\r\nimport { degreesToDms } from \"../../../services/geo-service\";\r\n\r\nexport class Controller {\r\n\tconstructor($uibModal, eventBus, auth, $scope, $logger) {\r\n\t\tthis._uibModal = $uibModal;\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis._scope = $scope;\r\n\t\tthis.$logger = $logger;\r\n\r\n\t\tthis.lookupId = auth.uuid();\r\n\t\tthis.location = {};\r\n\t}\r\n\r\n\tgetFieldValues() {\r\n\t\tconst locationPromises = [];\r\n\r\n\t\tforEach(this.lookup.valueFields, (field) => {\r\n\t\t\tconst fieldPromise = new Promise((resolve) => {\r\n\t\t\t\tconst registration = this._eventBus.register(EVENT_SEND_VALUE(this.lookupId), (e, params) => {\r\n\t\t\t\t\tlet locationValue = (params.value.length > 0 && params.value[0].Number) || null;\r\n\r\n\t\t\t\t\tif(locationValue) {\r\n\t\t\t\t\t\tconst {\r\n\t\t\t\t\t\t\tdegrees,\r\n\t\t\t\t\t\t\tminutes,\r\n\t\t\t\t\t\t\tisNegative\r\n\t\t\t\t\t\t} = degreesToDms(locationValue, false);\r\n\t\t\t\t\t\tlocationValue = (degrees + minutes / 60) * (isNegative ? -1 : 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._eventBus.unregister(registration);\r\n\t\t\t\t\tresolve({ key: params.key, value: locationValue });\r\n\t\t\t\t}, this._scope);\r\n\r\n\t\t\t\tthis._eventBus.trigger(EVENT_GET_VALUE(field.fieldId), { id: this.lookupId });\r\n\t\t\t});\r\n\r\n\t\t\tlocationPromises.push(fieldPromise);\r\n\t\t});\r\n\r\n\t\treturn Promise.all(locationPromises);\r\n\t}\r\n\r\n\tsetField(fieldKey, value) {\r\n\t\tconst field = find(this.lookup.fields, (f) => f.Key.Code == fieldKey);\r\n\r\n\t\tthis._eventBus.trigger(EVENT_SET_VALUE(field.Id), { value: { Number: value } });\r\n\t}\r\n\r\n\tactivateModal() {\r\n\t\tif(this.lookup.getCurrentValue) {\r\n\t\t\tthis.activateCoupledModal();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.activateUncoupledModal();\r\n\t\t}\r\n\t}\r\n\r\n\tactivateCoupledModal() {\r\n\t\tconst fieldValue = this.lookup.getCurrentValue();\r\n\r\n\t\tthis.showTooltip = false;\r\n\t\tthis._uibModal\r\n\t\t\t.open({\r\n\t\t\t\tcomponent: \"locationModal\",\r\n\t\t\t\tsize: \"md\",\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tlookup: () => this.lookup,\r\n\t\t\t\t\tlocation: () => (!!fieldValue ? {\r\n\t\t\t\t\t\t[FIELD_KEYS.latitude]: fieldValue.Latitude,\r\n\t\t\t\t\t\t[FIELD_KEYS.longitude]: fieldValue.Longitude\r\n\t\t\t\t\t} : undefined),\r\n\t\t\t\t\tdefaultPosition: () => (\r\n\t\t\t\t\t\t!!this.lookup.defaultPosition && this.lookup.defaultPosition.center && this.lookup.defaultPosition.zoom ? {\r\n\t\t\t\t\t\t\tcenter: {\r\n\t\t\t\t\t\t\t\t[FIELD_KEYS.latitude]: this.lookup.defaultPosition.center[0],\r\n\t\t\t\t\t\t\t\t[FIELD_KEYS.longitude]: this.lookup.defaultPosition.center[1]\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tzoom: this.lookup.defaultPosition.zoom\r\n\t\t\t\t\t\t} : undefined\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.result.then(selection => {\r\n\t\t\t\tif(selection.lat && selection.lng) {\r\n\t\t\t\t\tthis.lookup.action(selection);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\r\n\tactivateUncoupledModal() {\r\n\t\tthis.getFieldValues().then((values) => {\r\n\t\t\tconst valuesObj = {};\r\n\t\t\tforEach(values, (value) => {\r\n\t\t\t\tvaluesObj[value.key] = value.value;\r\n\t\t\t});\r\n\r\n\t\t\tthis.showTooltip = false;\r\n\t\t\tthis._uibModal\r\n\t\t\t\t.open({\r\n\t\t\t\t\tcomponent: \"locationModal\",\r\n\t\t\t\t\tsize: \"md\",\r\n\t\t\t\t\tresolve: {\r\n\t\t\t\t\t\tlookup: () => this.lookup,\r\n\t\t\t\t\t\tlocation: () => valuesObj\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.result.then(selection => {\r\n\t\t\t\t\tif(selection?.lat && selection?.lng) {\r\n\t\t\t\t\t\tthis.setField(FIELD_KEYS.latitude, selection.lat);\r\n\t\t\t\t\t\tthis.setField(FIELD_KEYS.longitude, selection.lng);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t});\r\n\t}\r\n}\r\n\r\nconst deps = [modal];\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.field-helpers.location-selector\", deps)\r\n\t.component(\"locationSelector\", {\r\n\t\ttemplate: `\r\n \r\n `,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tlookup: \"<\",\r\n\t\t\tonSelect: \"&\"\r\n\t\t}\r\n\t}).name;\r\n","import \"./index.less\";\r\n\r\nexport class Controller {\r\n\tconstructor() {\r\n\t\tthis.lookup.selection = false;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.lookup.selection = this.lookup.state;\r\n\t}\r\n\r\n\tsetNotAvailable() {\r\n\t\tthis.lookup.selection = !this.lookup.selection;\r\n\t\tthis.onSelect({\r\n\t\t\tlookup: this.lookup\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.field-helpers.not-available\", [])\r\n\t.component(\"notAvailable\", {\r\n\t\ttemplate: `\r\n \r\n `,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tlookup: \"<\",\r\n\t\t\tonSelect: \"&\"\r\n\t\t}\r\n\t}).name;\r\n","import template from \"./modal.html\";\r\nimport {\r\n\tfilter,\r\n\tflatMap\r\n} from \"lodash\";\r\nimport fuse from \"fuse.js\";\r\nimport {\r\n\tEVENT_LOGOUT,\r\n\tFUSE_DEFAULTS\r\n} from \"constants.js\";\r\nimport { ENTITY_TRANSLATION_KEYS } from \"../../../services/i18nService\";\r\n\r\nexport class Controller {\r\n\tlookup = null;\r\n\ttable = null;\r\n\tidentifierColumn = null;\r\n\tfuse = null;\r\n\r\n\tconstructor($scope, eventBus, $sce, entityManager, api, $logger) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.entityManager = entityManager;\r\n\t\tthis.api = api;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\r\n\t\tthis.table = {\r\n\t\t\tdata: [],\r\n\t\t\tactions: {},\r\n\t\t\tsort: {\r\n\t\t\t\tpredicate: \"Name\",\r\n\t\t\t\tdirection: \"asc\"\r\n\t\t\t},\r\n\t\t\tfilter: (onlyMatchExact) => this.filter(onlyMatchExact),\r\n\t\t\treset: () => this.reset(),\r\n\t\t\tfilterBy: null\r\n\t\t};\r\n\r\n\t\tthis.paginatorOptions = {};\r\n\r\n\t\tthis.hasLicenses = false;\r\n\r\n\t\tthis.fuse = new fuse([], {\r\n\t\t\t...FUSE_DEFAULTS,\r\n\t\t\tkeys: [\r\n\t\t\t\t\"fuzzySearchTerm\"\r\n\t\t\t]\r\n\t\t});\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.lookup = this.resolve.lookup;\r\n\t\tthis.entityQueryConfiguration = this.lookup.entityQueryConfiguration;\r\n\t\tthis.$logger.debug(\"lookup\", this.lookup);\r\n\r\n\t\tthis.getClientDataFromField();\r\n\t\tthis.loadClientDataIntoTable();\r\n\r\n\t\tthis.entityTypes = this.lookup.entityTypes || [];\r\n\t\tthis.showAdvancedSearch = !this.lookup.fieldId;\r\n\r\n\t\tif(this.lookup.fieldId) {\r\n\t\t\tthis.entityQueryConfiguration = this.entityManager.allEntityConfigs[this.lookup.fieldId];\r\n\t\t\tthis.entityTypes.push(this.entityManager.allEntityConfigs[this.lookup.fieldId].Friendly);\r\n\r\n\t\t\tif(this.entityManager.allEntityConfigs[this.lookup.fieldId].RelationshipType.Code !== \"SELF\") {\r\n\t\t\t\tthis.entityTypes.push(this.entityManager.allEntityConfigs[this.lookup.fieldId].Primary);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.selectedEntityType = this.entityTypes[0];\r\n\r\n\t\tthis.eventBus.register(EVENT_LOGOUT, () => { this.handleSelection(); }, this._scope);\r\n\t}\r\n\r\n\tgetClientDataFromField() {\r\n\t\tthis.clientData = this.lookup.fieldId && [...filter(this.entityManager.allEntities[this.lookup.fieldId], e => e.isFriendly)];\r\n\t\tif(!this.clientData && this.entityQueryConfiguration?.RelationshipType?.Code) {\r\n\t\t\tconst eqc = this.entityQueryConfiguration;\r\n\t\t\tthis.clientData = [...this.entityManager.userScopedEntities[eqc.Friendly.Type.Code][eqc.Primary.Type.Code][eqc.RelationshipType.Code].filter(e => e.isFriendly)];\r\n\t\t}\r\n\t}\r\n\r\n\tapplyfuzzySearchTermProperties = (item) => {\r\n\t\tconst exactMatchTerms = [];\r\n\r\n\t\tif(item.Name) {\r\n\t\t\texactMatchTerms.push(item.Name);\r\n\t\t}\r\n\t\tif(!this.lookup.hideCode && item.Code) {\r\n\t\t\texactMatchTerms.push(item.Code);\r\n\t\t}\r\n\r\n\t\tconst primaryIdentifiers = flatMap(item.Entities, (e) => {\r\n\t\t\tconst entityIdentifiers = (e.Entity && filter(e.Entity.Identifiers, (i) => i.Type.Code !== \"TOKEN\")) || [];\r\n\t\t\treturn entityIdentifiers;\r\n\t\t}) || [];\r\n\t\tconst friendlyIdentifiers = item.Identifiers || [];\r\n\r\n\t\tconst identifiers = (friendlyIdentifiers).concat(primaryIdentifiers);\r\n\r\n\t\tif(identifiers?.length) {\r\n\t\t\tidentifiers.forEach(id => {\r\n\t\t\t\texactMatchTerms.push(id.Value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(item.Entities && !this.entityManager.isEntitySelf(item)) {\r\n\t\t\titem.Entities.forEach(e => {\r\n\t\t\t\tif(e.Entity.Name) {\r\n\t\t\t\t\texactMatchTerms.push(e.Entity.Name);\r\n\t\t\t\t}\r\n\t\t\t\texactMatchTerms.push(e.Entity.Code);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tconst fuzzySearchTerm = exactMatchTerms.join(\" \");\r\n\r\n\t\treturn {\r\n\t\t\t...item,\r\n\t\t\tfuzzySearchTerm,\r\n\t\t\texactMatchTerms\r\n\t\t};\r\n\t};\r\n\r\n\tloadClientDataIntoTable() {\r\n\t\tthis.table.data = this.clientData.map((source) => {\r\n\t\t\tconst primaryIdentifiers = flatMap(source.Entities, (e) => {\r\n\t\t\t\tconst entityIdentifiers = (e.Entity && filter(e.Entity.Identifiers, (i) => i.Type.Code !== \"TOKEN\")) || [];\r\n\t\t\t\treturn entityIdentifiers;\r\n\t\t\t}) || [];\r\n\t\t\tconst friendlyIdentifiers = source.Identifiers || [];\r\n\r\n\t\t\tconst identifiers = (friendlyIdentifiers).concat(primaryIdentifiers);\r\n\r\n\t\t\tconst item = this.applyfuzzySearchTermProperties(source);\r\n\r\n\t\t\tif(identifiers.length) {\r\n\t\t\t\tthis.identifierColumn = true;\r\n\r\n\t\t\t\tconst extraData = identifiers.map(id => {\r\n\t\t\t\t\treturn `${id.Type.Name}: ${id.Value}`;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tconst dataBlock = `
    \r\n\t\t\t\t\t${extraData.join(\"\")}\r\n\t\t\t\t
    `;\r\n\r\n\t\t\t\titem.identifierDisplay = this.$sce.trustAsHtml(dataBlock);\r\n\t\t\t}\r\n\r\n\t\t\tif(item.Entities && !this.entityManager.isEntitySelf(item)) {\r\n\t\t\t\tthis.hasLicenses = true;\r\n\t\t\t\tconst codes = [];\r\n\t\t\t\titem.Entities.forEach(e => {\r\n\t\t\t\t\tif(e.Entity.Code) {\r\n\t\t\t\t\t\tcodes.push(e.Entity.Code);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\titem.entityDisplay = codes.join(\", \");\r\n\t\t\t}\r\n\r\n\t\t\treturn item;\r\n\t\t});\r\n\r\n\t\tthis.fuse.list = [ ...this.table.data ];\r\n\r\n\t\tif(this.lookup.options.isFavoriteEnabled) {\r\n\t\t\tthis.table.data = this.table.data.filter(d => d.IsFavorite);\r\n\t\t}\r\n\r\n\t\tthis.paginatorOptions = {\r\n\t\t\t...this.paginatorOptions, \r\n\t\t\ttotalItems: this.table.data.length\r\n\t\t};\r\n\t}\r\n\r\n\tfilter(onlyMatchExact = false) {\r\n\t\tlet results = [];\r\n\t\tif(this.table.filterBy) {\r\n\t\t\tif(onlyMatchExact === true) {\r\n\t\t\t\tconst matches = this.fuse.list.filter(i => i.exactMatchTerms.some(t => t.toUpperCase() === this.table.filterBy.toUpperCase()));\r\n\t\t\t\tresults = matches;\r\n\t\t\t\tthis.$logger.debug(\"match\", matches);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet match = this.fuse.search(`=${this.table.filterBy}`); \r\n\t\t\t\tif(match === undefined || match.length === 0) {\r\n\t\t\t\t\tmatch = this.fuse.search(this.table.filterBy);\r\n\t\t\t\t}\r\n\t\t\t\tresults = match.map(i => i.item);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.data = results;\r\n\t\tthis.paginatorOptions = {\r\n\t\t\t...this.paginatorOptions, \r\n\t\t\ttotalItems: this.table.data.length\r\n\t\t};\r\n\t}\r\n\r\n\r\n\t// **** FUTURE LAZY ENTITIES ****\r\n\t// searchOnline() {\r\n\t// \tlet entityType = this.selectedEntityType.Type.Code;\r\n\t// \tlet queryOptions = {type: entityType, find: this.table.filterBy};\r\n\r\n\t// \tif(this.selectedIdentitiferType){\r\n\t// \t\tqueryOptions.identifierType = this.selectedIdentitiferType.code;\r\n\t// \t\tqueryOptions.identifierValue = this.table.filterBy;\r\n\t// \t}\r\n\r\n\t// \tif(this.selectedClassification){\r\n\t// \t\tqueryOptions.classification = this.selectedClassification.Code;\r\n\t// \t}\r\n\r\n\t// \tlet url = FORM_ENTITIES(this.entityManager.form.Id, queryOptions);\r\n\r\n\t// \tthis.api.get(url).then(formEntities => {\r\n\t// \t\tthis.table.data = formEntities.Results;\r\n\t// \t});\r\n\t// }\r\n\r\n\t// clearIdentifierSearch() {\r\n\t// \tthis.selectedIdentitiferType = null;\r\n\t// }\r\n\r\n\t// clearClassificationSearch() {\r\n\t// \tthis.selectedClassification = null;\r\n\t// }\r\n\t// *************************************\r\n\r\n\treset() {\r\n\t\tthis.table.filterBy = null;\r\n\t\tthis.table.filter();\r\n\t}\r\n\r\n\thandleSelection(result) {\r\n\t\tthis.modalInstance.close(result);\r\n\t}\r\n\t\r\n\thandleSelectionKeyUp(event, result) {\r\n\t\tif((event.keyCode == 13) || (event.keyCode == 32)) {\r\n\t\t\tthis.modalInstance.close(result);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.field-helpers.advanced-search-modal\", [])\r\n\t.component(\"advancedSearchModal\", {\r\n\t\tcontroller: Controller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\tSearch\\r\\n\\t\\r\\n
    \\r\\n\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t
    \\r\\n\\t
    \\r\\n\\t 0 ? 'overflow-auto' : ''\\\"\\r\\n\\t\\tgrid-data\\r\\n\\t\\tgrid-options=\\\"$ctrl.table\\\"\\r\\n\\t\\tgrid-actions=\\\"$ctrl.table.actions\\\"\\r\\n\\t>\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t {{$ctrl.entityQueryConfiguration.Friendly.Type.Name}} \\r\\n\\t\\t\\t\\t\\t Code \\r\\n\\t\\t\\t\\t\\t Identifiers \\r\\n\\t\\t\\t\\t\\t {{$ctrl.entityQueryConfiguration.Primary.Type.Name}} \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t 0\\\">\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t {{item.Name}} \\r\\n\\t\\t\\t\\t\\t {{item.Code}} \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t {{item.entityDisplay}} \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t No records found. \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\r\\n
    \\r\\n\\tCancel\\r\\n
    \";","import modal from \"./modal\";\r\nimport \"./index.less\";\r\n\r\nexport class Controller {\r\n\tconstructor($uibModal) {\r\n\t\tthis._uibModal = $uibModal;\r\n\t}\r\n\r\n\tactivateModal() {\r\n\t\tthis._uibModal\r\n\t\t\t.open({\r\n\t\t\t\tcomponent: \"advancedSearchModal\",\r\n\t\t\t\tsize: \"lg\",\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tlookup: () => this.lookup\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.result.then(selection => {\r\n\t\t\t\tthis.lookup.selection = selection;\r\n\t\t\t\tthis.onSelect({\r\n\t\t\t\t\tlookup: this.lookup\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t}\r\n}\r\n\r\nconst deps = [modal];\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.field-helpers.advanced-search\", deps)\r\n\t.component(\"advancedSearch\", {\r\n\t\ttemplate: `\r\n \r\n `,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tlookup: \"<\",\r\n\t\t\tonSelect: \"&\"\r\n\t\t}\r\n\t}).name;\r\n","import \"./index.less\";\r\n\r\nexport class Controller {\r\n\tconstructor() {\r\n\t\tthis.lookup.selection = false;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.lookup.selection = this.lookup.state;\r\n\t}\r\n\r\n\tenableCustomInput() {\r\n\t\tthis.lookup.selection = !this.lookup.selection;\r\n\t\tthis.onSelect({\r\n\t\t\tlookup: this.lookup\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.field-helpers.custom-input\", [])\r\n\t.component(\"customInput\", {\r\n\t\ttemplate: `\r\n\t\t\t\r\n \t`,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tlookup: \"<\",\r\n\t\t\tonSelect: \"&\"\r\n\t\t}\r\n\t}).name;\r\n","import componentMap from \"./lookup.config.js\";\r\nimport areaSelector from \"./area-selector/index.js\";\r\nimport locationSelector from \"./location-selector/index.js\";\r\nimport notAvailable from \"./not-available/index.js\";\r\nimport advancedSearch from \"./advanced-search/index.js\";\r\nimport customInput from \"./custom-input/index.js\";\r\n\r\nexport class Controller {\r\n\tconstructor($scope, $element, dynamicComponent) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis._element = $element;\r\n\t\tthis._dynamicComponent = dynamicComponent;\r\n\t}\r\n\r\n\t$postLink() {\r\n\t\tthis._element.addClass(\"input-group-btn\");\r\n\t\tthis.compile();\r\n\t}\r\n\r\n\tcompile() {\r\n\t\tconst lookupSettings = componentMap[this.lookup.name];\r\n\t\tconst locals = {\r\n\t\t\tlookup: this.lookup\r\n\t\t};\r\n\r\n\t\tconst scope = this._scope.$new();\r\n\t\tscope.onSelect = this.onSelect;\r\n\r\n\t\tconst context = {};\r\n\r\n\t\tthis._dynamicComponent.compile(\r\n\t\t\tlookupSettings,\r\n\t\t\tlocals,\r\n\t\t\tscope,\r\n\t\t\tthis._element,\r\n\t\t\tcontext\r\n\t\t);\r\n\t}\r\n}\r\n\r\nconst deps = [areaSelector, notAvailable, advancedSearch, locationSelector, customInput];\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.lookups.selection-lookup\", deps)\r\n\t.component(\"selectionLookup\", {\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tlookup: \"<\",\r\n\t\t\tonSelect: \"&\"\r\n\t\t}\r\n\t}).name;\r\n","import {\r\n\tsome,\r\n\tmap,\r\n\tflatten\r\n} from \"lodash\";\r\n\r\nfunction controller($element, $transclude, $userProfile) {\r\n\tthis.$postLink = postLink;\r\n\r\n\tfunction postLink() {\r\n\t\tconst user = $userProfile.getUser();\r\n\t\tconst roles = user.roles || [];\r\n\r\n\t\tconst hasRole = some(\r\n\t\t\tflatten(map(roles, role => this.roles.indexOf(role) !== -1)),\r\n\t\t\tBoolean\r\n\t\t);\r\n\r\n\t\tif(hasRole) {\r\n\t\t\t$element.append($transclude());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.require-role\", [])\r\n\t.component(\"requireRole\", {\r\n\t\ttransclude: true,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\troles: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","import template from \"./date-range-selector.html\";\r\nimport moment from \"moment\";\r\nimport {\r\n\torderBy,\r\n\tfind,\r\n\tsome\r\n} from \"lodash\";\r\nimport { FEATURE_TYPES } from \"../../constants\";\r\n\r\n// date-range-selector\r\nexport class Controller {\r\n\tconstructor($scope, $stateParams, $logger) {\r\n\t\tthis.$stateParams = $stateParams;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.format = \"shortDate\";\r\n\t\tthis.altInputFormats = [\"d!-M!-yyyy\", \"d!/M!/yyyy\", \"d!-M!-yy\", \"d!/M!/yy\", \"d!.M!.yyyy\", \"d!.M!.yy\", \"shortDate\"];\r\n\t\tthis.dateOptions = {\r\n\t\t\tformatYear: \"yy\",\r\n\t\t\tstartingDay: 0,\r\n\t\t\tminDate: new Date(12 * 60 * 60 * 1000)\r\n\t\t};\r\n\t\tthis.startPopupOpen = false;\r\n\t\tthis.endPopupOpen = false;\r\n\r\n\t\tthis.allMonths = [\r\n\t\t\t\"January\",\r\n\t\t\t\"February\",\r\n\t\t\t\"March\",\r\n\t\t\t\"April\",\r\n\t\t\t\"May\",\r\n\t\t\t\"June\",\r\n\t\t\t\"July\",\r\n\t\t\t\"August\",\r\n\t\t\t\"September\",\r\n\t\t\t\"October\",\r\n\t\t\t\"November\",\r\n\t\t\t\"December\"\r\n\t\t];\r\n\r\n\t\tthis.rangeData = {\r\n\t\t\tLMonth: {\r\n\t\t\t\tdisplay: \"Last 30 days\",\r\n\t\t\t\tstartDate: moment().subtract(30, \"days\"),\r\n\t\t\t\tendDate: moment()\r\n\t\t\t},\r\n\t\t\tCurWeek: {\r\n\t\t\t\tdisplay: \"This Week\",\r\n\t\t\t\trange: \"week\"\r\n\t\t\t},\r\n\t\t\tCurMonth: {\r\n\t\t\t\tdisplay: \"This Month\",\r\n\t\t\t\trange: \"month\"\r\n\t\t\t},\r\n\t\t\tCurYear: {\r\n\t\t\t\tdisplay: \"This Year\",\r\n\t\t\t\trange: \"year\"\r\n\t\t\t},\r\n\t\t\tLYear: {\r\n\t\t\t\tdisplay: \"Last 12 months\",\r\n\t\t\t\tstartDate: moment().subtract(1, \"years\"),\r\n\t\t\t\tendDate: moment()\r\n\t\t\t},\r\n\t\t\tYearMonth: {\r\n\t\t\t\tdisplay: \"Year + Month\"\r\n\t\t\t},\r\n\t\t\tCustom: {\r\n\t\t\t\tdisplay: \"Custom\"\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.availableYears = [];\r\n\t\tlet earliestYear = orderBy(\r\n\t\t\tthis.form.Seasons.map((season) => {\r\n\t\t\t\treturn moment(season.BeginInclusive).year();\r\n\t\t\t}),\r\n\t\t\t(year) => year,\r\n\t\t\t[\"asc\"]\r\n\t\t)[0];\r\n\t\tconst currentYear = moment().year();\r\n\r\n\t\twhile(earliestYear <= currentYear) {\r\n\t\t\tthis.availableYears.push(earliestYear);\r\n\t\t\tearliestYear++;\r\n\t\t}\r\n\r\n\t\tthis.availableYears = orderBy(this.availableYears, (year) => year, [\"desc\"]);\r\n\r\n\t\tthis.selectedYear = this.startModel ? moment(this.startModel).year() : this.availableYears[0];\r\n\t\tthis.selectedMonth = this.allMonths[moment(this.startModel).month()];\r\n\r\n\t\tthis.rangeOptions = Object.keys(this.rangeData).map((optionKey) => {\r\n\t\t\tif(Object.prototype.hasOwnProperty.call(this.rangeData, optionKey)) {\r\n\t\t\t\tlet start, end;\r\n\t\t\t\tconst thisRange = this.rangeData[optionKey];\r\n\r\n\t\t\t\tif(thisRange.range) {\r\n\t\t\t\t\tstart = moment().startOf(thisRange.range);\r\n\t\t\t\t\tend = moment().endOf(thisRange.range);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst thisOption = {\r\n\t\t\t\t\t...thisRange,\r\n\t\t\t\t\tkey: optionKey,\r\n\t\t\t\t\tstartDate: start || thisRange.startDate || null,\r\n\t\t\t\t\tendDate: end || thisRange.endDate || null\r\n\t\t\t\t};\r\n\t\t\t\treturn thisOption;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst matchingOptions = this.rangeOptions.filter((option) => {\r\n\t\t\treturn moment(option.startDate).isSame(this.startModel, \"day\") && moment(option.endDate).isSame(this.endModel, \"day\");\r\n\t\t});\r\n\r\n\t\tlet matchingOption = matchingOptions[0];\r\n\r\n\t\tif(!matchingOption) {\r\n\t\t\tconst startModelYear = moment(this.startModel).year();\r\n\t\t\tconst endModelYear = moment(this.endModel).year();\r\n\t\t\tconst startModelMonth = moment(this.startModel).month();\r\n\t\t\tconst endModelMonth = moment(this.endModel).month();\r\n\r\n\t\t\tif(startModelYear === endModelYear && startModelMonth === endModelMonth && moment(this.startModel).date() === 1\r\n\t\t\t\t&& moment(this.endModel).date() === moment(this.endModel).endOf(\"month\")\r\n\t\t\t\t\t.date()) {\r\n\t\t\t\tmatchingOption = find(this.rangeOptions, (option) => option.key === \"YearMonth\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst overrideMatch = some(this.form.Features, (feature) => feature.Type == FEATURE_TYPES.dateRangeDefaultYearMonth);\r\n\r\n\t\tif(overrideMatch) {\r\n\t\t\tmatchingOption = find(this.rangeOptions, (option) => option.key === \"YearMonth\");\r\n\t\t}\r\n\r\n\t\tconst paramMatch = this.rangeOptions.filter((option) => {\r\n\t\t\treturn moment(option.startDate).isSame(moment(this.$stateParams.start), \"day\") && moment(option.endDate).isSame(moment(this.$stateParams.end), \"day\");\r\n\t\t});\r\n\r\n\t\tthis.currentRangeOption = paramMatch && paramMatch[0] || matchingOption || this.rangeOptions[this.rangeOptions.length - 1];\r\n\t}\r\n\r\n\tonDateUpdate() {\r\n\t\tif(moment(this.startModel) > moment(this.endModel)) {\r\n\t\t\tthis.endModel = moment(this.startModel).toDate();\r\n\t\t}\r\n\t\tthis.onDateChange(this.startModel, this.endModel);\r\n\t}\r\n\r\n\tonSelectorChange() {\r\n\t\tif(this.currentRangeOption.key === \"YearMonth\") {\r\n\t\t\tthis.startModel = moment().year(this.selectedYear)\r\n\t\t\t\t.month(this.selectedMonth)\r\n\t\t\t\t.date(1)\r\n\t\t\t\t.toDate();\r\n\t\t\tthis.endModel = moment().year(this.selectedYear)\r\n\t\t\t\t.month(this.selectedMonth)\r\n\t\t\t\t.date(1)\r\n\t\t\t\t.endOf(\"month\")\r\n\t\t\t\t.toDate();\r\n\t\t\tthis.onDateUpdate();\r\n\t\t}\r\n\t\telse if(this.currentRangeOption.key !== \"Custom\") {\r\n\t\t\tthis.startModel = this.currentRangeOption.startDate.toDate();\r\n\t\t\tthis.endModel = this.currentRangeOption.endDate.toDate();\r\n\t\t\tthis.onDateUpdate();\r\n\t\t}\r\n\t}\r\n}\r\nexport default angular\r\n\t.module(\"vesl.components.date-range-selector\", [])\r\n\t.component(\"dateRangeSelector\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tonDateChange: \"<\",\r\n\t\t\tstartModel: \"=\",\r\n\t\t\tendModel: \"=\",\r\n\t\t\tnomenclature: \"<\",\r\n\t\t\tform: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
    \\r\\n
    \\r\\n\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
    \\r\\n\\r\\n\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
    \\r\\n\\r\\n\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\r\\n\\r\\n\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\r\\n\";","import { FORM_EXPORT_CONFIGS } from \"../../routes\";\r\nimport { globs } from \"../../services/globs\";\r\nimport template from \"./export-configuration-selector.html\";\r\nimport \"./export-configuration-selector.less\";\r\n\r\n// export-configuration-selector\r\nexport class Controller {\r\n\tconstructor($logger, securityService, api, appState, loadingService) {\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.securityService = securityService;\r\n\t\tthis.api = api;\r\n\t\tthis.appState = appState;\r\n\t\tthis.loadingService = loadingService;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tif(!this.configurations?.length) {\r\n\t\t\tthis.loadConfigurations();\r\n\t\t}\r\n\t}\r\n\r\n\tloadConfigurations = async() => {\r\n\t\tconst configCall = this.api.get(FORM_EXPORT_CONFIGS(this.appState.forms.selected.Id));\r\n\r\n\t\tconst configs = await this.loadingService.watch(configCall);\r\n\r\n\t\tconst allowedConfigs = configs.filter(c => this.securityService.isActionAllowed(globs.exports(c.Code).read));\r\n\r\n\t\tconst toDisplay = (label) => label[0].toUpperCase() + label.slice(1);\r\n\r\n\t\tthis.configurations = allowedConfigs.map(c => ({ \r\n\t\t\t...c,\r\n\t\t\tdisplay: toDisplay(c.Name ?? c.Code)\r\n\t\t}));\r\n\r\n\t\tthis.selectedConfiguration = this.configurations[0];\r\n\r\n\t\tthis.onSelectionChanged(this.selectedConfiguration);\r\n\t};\r\n}\r\nexport default angular\r\n\t.module(\"vesl.components.export-configuration-selector\", [])\r\n\t.component(\"exportConfigurationSelector\", {\r\n\t\ttemplate,\r\n\t\tcontroller: Controller,\r\n\t\tbindings: {\r\n\t\t\tonSelectionChanged: \"<\",\r\n\t\t\tconfigurations: \"=\"\r\n\t\t}\r\n\t}).name;\r\n","export default \" 0\\\"\\r\\n>\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
    \\r\\n\";","import template from \"./template.html\";\r\nimport \"./style.less\";\r\nimport {\r\n\tTIME_DISPLAY_OPTIONS, \r\n\tEVENT_TIMEZONE_SET, \r\n\tPROXY_FIELDS\r\n} from \"constants.js\";\r\nimport moment from \"moment-timezone\";\r\n\r\nclass DateTimeController {\r\n\tconstructor($scope, appState, $logger, $userProfile, $timeout, eventBus) {\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.form = appState.forms.selected;\r\n\t\tthis.logger = $logger;\r\n\t\tthis.appState = appState;\r\n\t\tthis.$userProfile = $userProfile;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.eventBus = eventBus;\r\n\r\n\t\tthis.dateOptions = {\r\n\t\t\tformatYear: \"yyyy\",\r\n\t\t\tstartingDay: 0,\r\n\t\t\tminDate: new Date(\"1910-01-01\")\r\n\t\t};\r\n\t\tthis.popupOpen = false;\r\n\t\t\r\n\t\tthis.isTimepickerShown = false;\r\n\t\tthis.isDatepickerShown = false;\r\n\t\tthis.suppressNextDateWatch = false;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tconst thisUserProfile = this.$userProfile.getUserProfile();\r\n\t\tconst ctrl = this;\r\n\r\n\t\tthis.format = \"MM/dd/yy\";\r\n\t\tthis.placeholder = \"Ex. 01/01/2000\";\r\n\t\tthis.altInputFormats = [\r\n\t\t\t\"d!-M!-yyyy\", \"d!-M!-yy\",\r\n\t\t\t\"d!/M!/yyyy\", \"d!/M!/yy\",\r\n\t\t\t\"d!.M!.yyyy\", \"d!.M!.yy\",\r\n\t\t\t\"shortDate\"\r\n\t\t];\r\n\t\tthis.modelOptions = {};\r\n\r\n\t\tif(this.timeZoneMode === \"local\") {\r\n\t\t\tthis.timezoneCode = undefined;\r\n\t\t}\r\n\t\telse if(this.form.TimeMode?.Code === \"BYFORM\" || this.timeZoneMode === \"BYFORM\") {\r\n\t\t\tthis.timezoneCode = this.form.TimeZone?.Code;\t\t\t\r\n\t\t}\r\n\t\telse if(this.form.TimeMode?.Code === \"BYENTITY\" || this.timeZoneMode === \"BYENTITY\") {\r\n\t\t\tthis.eventBus.register(\r\n\t\t\t\tEVENT_TIMEZONE_SET(PROXY_FIELDS.DATETIME),\r\n\t\t\t\t(e, params) => {\r\n\t\t\t\t\tthis.timezoneCode = params.value;\r\n\t\t\t\t},\r\n\t\t\t\tthis.$scope\r\n\t\t\t);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.isDateOnly) {\r\n\t\t\tthis.isTwelveHour = thisUserProfile.timeDisplay === TIME_DISPLAY_OPTIONS.TWELVE_HOUR;\r\n\t\t\tthis.format = this.isTwelveHour ? \"MM/dd/yy hh:mm a\" : \"MM/dd/yy HH:mm\";\r\n\t\t\tthis.placeholder = this.isTwelveHour ? \"Ex. 01/01/2000 01:00 PM\" : \"Ex. 01/01/2000 13:00\";\r\n\t\t\tthis.altInputFormats = this.isTwelveHour ?\r\n\t\t\t[\r\n\t\t\t\t\"M!-d!-yyyy h:mma\", \"M!-d!-yy h:mm a\", \"M!-d!-yy h:mma\", \"M!-d!-yyyy h:mm a\",\r\n\t\t\t\t\"M!/d!/yyyy h:mma\", \"M!/d!/yy h:mm a\", \"M!/d!/yy h:mma\", \"M!/d!/yyyy h:mm a\",\r\n\t\t\t\t\"M!.d!.yyyy h:mma\", \"M!.d!.yy h:mm a\", \"M!.d!.yy h:mma\", \"M!.d!.yyyy h:mm a\",\r\n\t\t\t\t\"shortDate\"\r\n\t\t\t] : [\r\n\t\t\t\t\"M!-d!-yyyy H:mm\", \"M!-d!-yy H:mm\", \"M!-d!-yy HH:mm\", \"M!-d!-yyyy HH:mm\",\r\n\t\t\t\t\"M!/d!/yyyy H:mm\", \"M!/d!/yy H:mm\", \"M!/d!/yy HH:mm\", \"M!/d!/yyyy HH:mm\",\r\n\t\t\t\t\"M!.d!.yyyy H:mm\", \"M!.d!.yy H:mm\", \"M!.d!.yy HH:mm\", \"M!.d!.yyyy HH:mm\",\r\n\t\t\t\t\"shortDate\"\r\n\t\t\t]; \r\n\r\n\t\t\tthis.$scope.$watch(\r\n\t\t\t\t() => ctrl.timepickerDate,\r\n\t\t\t\t(next) => {\r\n\t\t\t\t\tif(!!next) {\r\n\t\t\t\t\t\tthis.$timeout(() => {\r\n\t\t\t\t\t\t\tctrl.suppressNextDateWatch = true;\r\n\t\t\t\t\t\t\tctrl.modelValue = next;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\ttrue\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif(ctrl.ngModel !== undefined) {\r\n\t\t\tlet modelMoment = moment(ctrl.ngModel);\r\n\t\t\tif(this.timezoneCode !== undefined) {\r\n\t\t\t\tmodelMoment = moment(ctrl.ngModel, \"YYYY-MM-DDThh:mm:ss\")\r\n\t\t\t\t\t.tz(this.timezoneCode);\r\n\t\t\t}\r\n\t\t\tctrl.modelValue = modelMoment.toDate();\r\n\t\t}\r\n\t\tthis.$scope.$watch(\r\n\t\t\t() => ctrl.modelValue,\r\n\t\t\t(next) => {\r\n\t\t\t\tif(!!next) {\r\n\t\t\t\t\tthis.$timeout(() => {\r\n\t\t\t\t\t\tlet nextMoment = moment(next);\r\n\t\t\t\t\t\tif(ctrl.valueTime?.toLowerCase() === \"end\") {\r\n\t\t\t\t\t\t\tnextMoment = nextMoment.add(1, \"day\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(ctrl.valueTime?.toLowerCase() === \"middle\") {\r\n\t\t\t\t\t\t\tnextMoment = nextMoment.add(12, \"hours\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(this.timezoneCode !== undefined) {\r\n\t\t\t\t\t\t\tnextMoment = nextMoment.tz(this.timezoneCode, true);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.ngModelCtrl.$setViewValue(nextMoment.format(\"YYYY-MM-DDTHH:mm:00Z\"));\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\t}\r\n\r\n\thandleClickOutside = () => {\r\n\t\tthis.isTimepickerShown = false;\r\n\t\tthis.timepickerDate = null;\r\n\t};\r\n\r\n\topenDatepicker = () => {\r\n\t\tthis.isDatepickerShown = !this.isDatepickerShown;\r\n\t};\r\n\r\n\topenTimepicker = () => {\r\n\t\tif(!this.modelValue) {\r\n\t\t\tconst initializedDate = new Date();\r\n\t\t\tinitializedDate.setHours(0);\r\n\t\t\tinitializedDate.setMinutes(0);\r\n\t\t\tinitializedDate.setSeconds(0);\r\n\t\t\tinitializedDate.setMilliseconds(0);\r\n\t\t\tthis.modelValue = initializedDate;\r\n\t\t}\r\n\r\n\t\tthis.timepickerDate = this.modelValue;\r\n\r\n\t\tthis.isTimepickerShown = true;\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.datetimepicker\", [])\r\n\t.component(\"dateTimePicker\", {\r\n\t\tcontroller: DateTimeController,\r\n\t\ttemplate,\r\n\t\trequire: { ngModelCtrl: \"^ngModel\" },\r\n\t\tbindings: {\r\n\t\t\tschema: \"<\",\r\n\t\t\tngModel: \"<\",\r\n\t\t\tisDateOnly: \"<\",\r\n\t\t\tvalueTime: \"<\",\r\n\t\t\ttimeZoneMode: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n
    \";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport { REPORT_STATES } from \"constants.js\";\r\nimport moment from \"moment\";\r\nimport { hasHadState } from \"../../utils\";\r\n\r\nfunction controller(appState, $userProfile, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleToggleIsExpanded = handleToggleIsExpanded;\r\n\tctrl.canBeDeleted = canBeDeleted;\r\n\tctrl.canBeWithdrawn = canBeWithdrawn;\r\n\tctrl.hasBeenSubmitted = (report) => hasHadState(REPORT_STATES.submitted.code, report);\r\n\tctrl.reportStates = REPORT_STATES;\r\n\tctrl.canBeRestored = canBeRestored;\r\n\tctrl.getFormattedTime = getFormattedTime;\r\n\tctrl.getFullDate = getFullDate;\r\n\tctrl.userProfile = $userProfile;\r\n\tctrl.getLastSubmittedDate = getLastSubmittedDate;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.permissions = appState.permissions;\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.canAmend = appState.permissions.Reporting.Actions.CanAmend;\r\n\r\n\t\tctrl.canWithdraw = false;\r\n\t\tctrl.canDelete = false;\r\n\t\tctrl.canRestore = false;\r\n\t\tctrl.isExpanded = false;\r\n\r\n\t\tif(!ctrl.permissions.Reporting.IsDisabled) {\r\n\t\t\tcanBeWithdrawn();\r\n\t\t\tcanBeDeleted();\r\n\t\t\tcanBeRestored();\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.withdraw = () => {\r\n\t\t$logger.event($logger.buildReportEvent(\"withdraw\")(\"requested\"), { \r\n\t\t\tvia: \"action-info-block\" \r\n\t\t});\r\n\t\tctrl.handleWithdraw();\r\n\t};\r\n\r\n\tctrl.delete = () => {\r\n\t\t$logger.event($logger.buildReportEvent(\"delete\")(\"requested\"), { \r\n\t\t\tvia: \"action-info-block\" \r\n\t\t});\r\n\t\tctrl.handleDelete();\r\n\t};\r\n\r\n\tctrl.restore = () => {\r\n\t\t$logger.event($logger.buildReportEvent(\"restore\")(\"requested\"), { \r\n\t\t\tvia: \"action-info-block\" \r\n\t\t});\r\n\t\tctrl.handleRestore();\r\n\t};\r\n\r\n\tfunction canBeDeleted() {\r\n\t\tctrl.canDelete = ctrl.permissions.Reporting.Actions.CanDelete && !ctrl.report.Submitted && !ctrl.report.IsDeleted;\r\n\r\n\t\treturn ctrl.canDelete;\r\n\t}\r\n\r\n\tfunction canBeWithdrawn() {\r\n\t\tctrl.canWithdraw = ctrl.permissions.Reporting.Actions.CanWithdraw && ctrl.report.Submitted && !ctrl.report.IsDeleted;\r\n\r\n\t\treturn ctrl.canWithdraw;\r\n\t}\r\n\r\n\tfunction handleToggleIsExpanded() {\r\n\t\tctrl.isExpanded = !ctrl.isExpanded;\r\n\t}\r\n\r\n\tfunction canBeRestored() {\r\n\t\tctrl.canRestore = ctrl.permissions.Reporting.Actions.CanRestore && !ctrl.report.Submitted && ctrl.report.IsDeleted;\r\n\r\n\t\treturn ctrl.canRestore;\r\n\t}\r\n\r\n\tfunction getFormattedTime(timeToModify) {\r\n\t\treturn moment(ctrl.report[timeToModify])\r\n\t\t\t.local()\r\n\t\t\t.fromNow();\r\n\t}\r\n\r\n\tfunction getLastSubmittedDate() {\r\n\t\tconst historyCopy = [...(ctrl.report.History ?? [])]\r\n\t\t\t.sort((a, b) => moment(a.Occurred).isBefore(b.Occurred) ? 1 : -1);\r\n\r\n\t\tconst lastEntry = historyCopy.find(i => i.State.Code === REPORT_STATES.submitted.code);\r\n\t\tif(lastEntry && lastEntry.Occurred) {\r\n\t\t\treturn formatDate(lastEntry.Occurred);\r\n\t\t} else {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getFullDate(time) {\r\n\t\tif(!!ctrl.report[time]) {\r\n\t\t\treturn formatDate(ctrl.report[time]);\r\n\t\t}\r\n\t\treturn \"--\";\r\n\t}\r\n\r\n\tfunction formatDate(date) {\r\n\t\treturn moment(date)\r\n\t\t\t.local()\r\n\t\t\t.format(`dddd, MMMM Do YYYY, ${ctrl.userProfile.getUserProfile().timeDisplay === \"24h\" ? \"HH\" : \"hh\"}:mm a`)\r\n\t\t\t.toString();\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.action-info-block\", []).component(\"actionInfoBlock\", {\r\n\ttemplate,\r\n\tcontroller,\r\n\tbindings: {\r\n\t\treport: \"<\",\r\n\t\thandleDelete: \"<\",\r\n\t\thandleWithdraw: \"<\",\r\n\t\thandleRestore: \"<\"\r\n\t}\r\n}).name;\r\n","export default \"
    \\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t
    \\r\\n
    \\r\\n\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tLast Modified: {{$ctrl.getFullDate('LastModified')}}\\r\\n\\t\\t\\t

    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tCreated: {{$ctrl.getFullDate('Created')}}\\r\\n\\t\\t\\t

    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tLast Submitted: {{$ctrl.getLastSubmittedDate()}}\\r\\n\\t\\t\\t

    \\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tEdit Report\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tRestore Report\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tDelete Report\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\r\\n\\r\\n\\t\\r\\n\\t\\r\\n\";","import template from \"./index.html\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\n\r\n//terms\r\nexport function controller($scope, eventBus) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = handleClose;\r\n\r\n\tfunction onInit() {\r\n\t\teventBus.register(EVENT_LOGOUT, () => { handleClose(); }, $scope);\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.close();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.terms\", [])\r\n\t.component(\"terms\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n
    \\r\\n\\t\\r\\n\\t\\tWebsite Terms & Conditions of Use\\r\\n\\t\\r\\n
    \\r\\n\\r\\n\\t

    \\r\\n\\t\\t1. Terms\\r\\n\\t

    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tBy accessing this web site, you are agreeing to be bound by these web site Terms and Conditions of Use, all applicable laws and regulations,\\r\\n\\t\\tand agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from\\r\\n\\t\\tusing or accessing this site. The materials contained in this web site are protected by applicable copyright and trade mark law.\\r\\n\\t

    \\r\\n\\r\\n\\t

    \\r\\n\\t\\t2. Use License\\r\\n\\t

    \\r\\n\\r\\n\\t
      \\r\\n\\t\\t
    1. \\r\\n\\t\\t\\tUse of the services in this website do not constitute ownership of any intellectual property nor to the content that you access. You may not use content from\\r\\n\\t\\t\\tthis service without written permission from its owner or are otherwise permitted by law. You are not granted the right to any branding or logos used in this\\r\\n\\t\\t\\tservice. Do not remove, obscure, or alter any legal notices displayed herein. Do not interfere with the services provided or access them using a method other than\\r\\n\\t\\t\\tthe interfaces and instructions provided by Bluefin Data. You may use our Services only as permitted by law, including applicable export and re-export\\r\\n\\t\\t\\tcontrol laws and regulations.\\r\\n\\r\\n\\t\\t\\tIn connection with use of this service, we may send you service announcements, administrative messages, and other information.\\r\\n\\t\\t
    2. \\r\\n\\t\\t
    3. \\r\\n\\t\\t\\tThis license shall automatically terminate if you violate any of these restrictions and may be terminated by Bluefin Data at any time. Upon terminating your\\r\\n\\t\\t\\tviewing of these materials or upon the termination of this license, you must destroy any downloaded materials in your possession whether in electronic or\\r\\n\\t\\t\\tprinted format.\\r\\n\\t\\t
    4. \\r\\n\\t\\t
    5. \\r\\n\\t\\t\\tOur Service allows you to upload, complete, send or receive content. You retain ownership of any intellectual property rights that you hold in that content.\\r\\n\\r\\n\\t\\t\\tWhen you upload, complete, send or receive content to or through our Service, you give Bluefin Data a worldwide license to use, host, store, reproduce, aggregate\\r\\n\\t\\t\\tcreate derivative works, and communicate such content. The rights you grant in this license are for the limited purpose of operating and improving our Service,\\r\\n\\t\\t\\tand to develop new ones. This license continues even if you stop using our Service.\\r\\n\\t\\t
    6. \\r\\n\\t\\t
    7. \\r\\n\\t\\t\\tWhen a Service requires or includes downloadable software, this software may update automatically on your device once a new version or feature is available.\\r\\n\\r\\n\\t\\t\\tBluefin Data gives you a personal, worldwide, royalty-free, non-assignable and non-exclusive license to use the software provided to you by Bluefin Data as\\r\\n\\t\\t\\tpart of the Service. This license is for the sole purpose of enabling you to use and enjoy the benefit of the Service as provided by Bluefin Data, in the\\r\\n\\t\\t\\tmanner permitted by these terms. You may not copy, modify, distribute, sell, or lease any part of our Services or included software, nor may you reverse\\r\\n\\t\\t\\tengineer or attempt to extract the source code of that software, unless laws prohibit those restrictions or you have our written permission.\\r\\n\\t\\t
    8. \\r\\n\\t
    \\r\\n\\r\\n\\t

    \\r\\n\\t\\t3. Disclaimer\\r\\n\\t

    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tOTHER THAN AS EXPRESSLY SET OUT IN THESE TERMS OR ADDITIONAL TERMS, NEITHER BLUEFIN DATA NOR ITS SUPPLIERS OR DISTRIBUTORS MAKE ANY SPECIFIC PROMISES\\r\\n\\t\\tABOUT THE SERVICES. WE MAKE NO COMMITMENTS ABOUT THE CONTENT WITHIN THE SERVICES, THE SPECIFIC FUNCTIONS OF THE SERVICES, OR THEIR RELIABILITY,\\r\\n\\t\\tAVAILABILITY, OR ABILITY TO MEET YOUR NEEDS. SERVICES ARE PROVIDED “AS IS”.\\r\\n\\r\\n\\t\\tTO THE EXTENT PERMITTED BY LAW, WE EXCLUDE ALL WARRANTIES.\\r\\n\\t

    \\r\\n\\r\\n\\t

    \\r\\n\\t\\t4. Limitations\\r\\n\\t

    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tIn no event shall Bluefin Data or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business\\r\\n\\t\\tinterruption,) arising out of the use or inability to use the materials on Bluefin Data's Internet site, even if Bluefin Data or a Bluefin Data authorized\\r\\n\\t\\trepresentative has been notified orally or in writing of the possibility of such damage.\\r\\n\\t

    \\r\\n\\r\\n\\t

    \\r\\n\\t\\t5. Links\\r\\n\\t

    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tBluefin Data has not reviewed all of the sites linked to its Internet web site and is not responsible for the contents of any such linked site. The inclusion of any link\\r\\n\\t\\tdoes not imply endorsement by Bluefin Data of the site. Use of any such linked web site is at the user's own risk.\\r\\n\\t

    \\r\\n\\r\\n\\t

    \\r\\n\\t\\t6. Site Terms of Use Modifications\\r\\n\\t

    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tBluefin Data may revise these terms of use for its web site at any time without notice. By using this web site, you are agreeing to be bound by the then\\r\\n\\t\\tcurrent version of these Terms and Conditions of Use.\\r\\n\\t

    \\r\\n\\r\\n\\t

    \\r\\n\\t\\t7. Governing Law\\r\\n\\t

    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tAny claim relating to Bluefin Data's web site shall be governed by the laws of the State of Louisiana without regard to its conflict of law provisions.\\r\\n\\t

    \\r\\n\\r\\n
    \\r\\n\\tClose\\r\\n
    \\r\\n\\r\\n\";","import template from \"./accessibility-modal.html\";\r\nimport \"./accessibility-modal.less\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\n\r\nexport class Controller {\r\n\tconstructor(appState, eventBus, $scope, $userProfile, hotkeys) {\r\n\t\tthis.appState = appState;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$userProfile = $userProfile;\r\n\t\tthis.hotkeys = hotkeys;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.userProfile = this.$userProfile.getUserProfile();\r\n\t\tthis.shortcutsEnabled = this.userProfile.shortcutsEnabled;\r\n\t\tthis.eventBus.register(EVENT_LOGOUT, () => {\r\n\t\t\tthis.handleClose();\r\n\t\t}, this.$scope);\r\n\t}\r\n\r\n\thandleClose() {\r\n\t\tthis.modalInstance.dismiss();\r\n\t}\r\n\r\n\thandleShortcutsToggle() {\r\n\t\tthis.userProfile.shortcutsEnabled = this.shortcutsEnabled;\r\n\t\tthis.$userProfile.setUserProfile(this.userProfile);\r\n\r\n\t\tif(this.userProfile.shortcutsEnabled) {\r\n\t\t\tthis.hotkeys.unpause();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.hotkeys.pause();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.accessibility-modal\", [])\r\n\t.component(\"accessibilityModal\", {\r\n\t\tcontroller: Controller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t Accessibility Settings \\r\\n
    \\r\\n\\r\\n\\t
    \\r\\n\\t\\tKeyboard Shortcuts\\r\\n\\t\\t
    \\r\\n\\t\\t\\t   \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\r\\n
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\tClose\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n
    \";","import template from \"./settings-modal.html\";\r\nimport \"./settings-modal.less\";\r\nimport {\r\n\tTIME_DISPLAY_OPTIONS,\r\n\tEVENT_LOGOUT\r\n} from \"../../../constants\";\r\n\r\nexport class Controller {\r\n\tconstructor(appState, eventBus, $scope, $userProfile) {\r\n\t\tthis.appState = appState;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$userProfile = $userProfile;\r\n\r\n\t\tthis.timeDisplayOptions = TIME_DISPLAY_OPTIONS;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.userProfile = this.$userProfile.getUserProfile();\r\n\r\n\t\tthis.timeDisplay = this.userProfile.timeDisplay;\r\n\r\n\t\tthis.eventBus.register(EVENT_LOGOUT, () => { this.handleClose(); }, this.$scope);\r\n\t}\r\n\r\n\thandleClose() {\r\n\t\tthis.modalInstance.dismiss();\r\n\t}\r\n\r\n\thandleTimeDisplayChange() {\r\n\t\tthis.userProfile.timeDisplay = this.timeDisplay;\r\n\t\tthis.$userProfile.setUserProfile(this.userProfile);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.settings-modal\", [])\r\n\t.component(\"settingsModal\", {\r\n\t\tcontroller: Controller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t Settings \\r\\n
    \\r\\n\\r\\n\\t
    \\r\\n\\t\\tTime display\\r\\n\\t\\t
    \\r\\n\\t\\t\\t   \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\r\\n
    \\r\\n\\tClose\\r\\n
    \";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\nimport { globs } from \"../../../services/globs\";\r\n\r\n//supportFeedback\r\nexport function controller(\r\n\tconfig, \r\n\t$uibModal,\r\n\tapi, \r\n\tappState,\r\n\tloadingService,\r\n\ttoastr, \r\n\t$scope, \r\n\teventBus\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.onRemoteSupportClick = onRemoteSupportClick;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = handleClose;\r\n\tctrl.sendMessage = sendMessage;\r\n\r\n\tctrl.canViewVeslPhoneNumber = globs.feedback.vesl.phoneNumber.read;\r\n\tctrl.canViewVeslEmail = globs.feedback.vesl.email.read;\r\n\tctrl.canViewRemoteSupport = globs.feedback.remoteSupport.read;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.support = config.support;\r\n\t\tctrl.permissions = appState.permissions;\r\n\r\n\t\teventBus.register(EVENT_LOGOUT, () => { handleClose(); }, $scope);\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.close();\r\n\t}\r\n\r\n\tfunction onRemoteSupportClick() {\r\n\t\tctrl.modalInstance.close();\r\n\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"remote-support\"\r\n\t\t});\r\n\t}\r\n\r\n\tfunction sendMessage() {\r\n\t\tconst params = {\r\n\t\t\tMessage: ctrl.message\r\n\t\t};\r\n\r\n\t\tconst promise = api.post(\"api/feedback\", params).then(() => {\r\n\t\t\ttoastr.success(\"Your message has been sent successfully! We'll be getting back with you soon.\");\r\n\r\n\t\t\tctrl.modalInstance.close();\r\n\t\t});\r\n\r\n\t\tloadingService.watch(promise, \"Sending Feedback...\");\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.support-feedback\", [])\r\n\t.component(\"supportFeedback\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tshowClose: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n
    \\r\\n\\t\\r\\n\\t\\tVESL Support\\r\\n\\t\\r\\n
    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tThink you've found a bug? Have some feedback for how we can make things easier for you to report? We have several\\r\\n\\t\\tways to contact us!\\r\\n\\t

    \\r\\n\\t

    \\r\\n\\t\\tWe typically respond to messages within 4-8 hours during the business week, but times may vary.\\r\\n\\t

    \\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\tCall: \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{$ctrl.support.phone.display}}\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\tEmail us using the box below! \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\tSend\\r\\n\\t\\t\\r\\n\\t\\r\\n\\r\\n\\r\\n\\t\\r\\n\\t\\tRemote Support\\r\\n\\t\\r\\n\\t\\r\\n\\t\\tClose\\r\\n\\t\\r\\n\";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\n\r\n//remoteSupport\r\nexport function controller(config, $uibModal, $scope, eventBus) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.onSupportClick = onSupportClick;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = handleClose;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.support = config.support;\r\n\t\teventBus.register(EVENT_LOGOUT, () => { handleClose(); }, $scope);\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.close();\r\n\t}\r\n\r\n\tfunction onSupportClick() {\r\n\t\tctrl.modalInstance.close();\r\n\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"support-feedback\"\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.remote-support\", [])\r\n\t.component(\"remoteSupport\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tshowClose: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\tVESL Remote Support\\r\\n\\t\\r\\n
    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tThe VESL team uses an industry trusted solution to be able to provide support to our customers by remotely connecting to and viewing your computer.\\r\\n\\t

    \\r\\n\\t

    \\r\\n\\t\\tIf you need help - please use the Help Area to contact your agency, or contact VESL Support. In assisting with your issue, we may ask to remotely connect to your PC.\\r\\n\\t

    \\r\\n\\t

    \\r\\n\\t\\tOnly click the link below if instructed to by a VESL Representative!\\r\\n\\t

    \\r\\n\\r\\n\\t\\r\\n\\t\\tAllow Remote Support Connection\\r\\n\\t\\r\\n\\r\\n\\r\\n\\tBack\\r\\n\\tClose\\r\\n\";","import template from \"./index.html\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\n\r\n//terms\r\nexport function controller($scope, eventBus) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = handleClose;\r\n\r\n\tfunction onInit() {\r\n\t\teventBus.register(EVENT_LOGOUT, () => { handleClose(); }, $scope);\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.close();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.privacy-policy\", [])\r\n\t.component(\"privacyPolicy\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tshowClose: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n
    \\r\\n\\t\\r\\n\\t\\tPrivacy Policy\\r\\n\\t\\r\\n
    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tYour privacy is very important to us. Accordingly, we have developed this Policy in order for you to understand how\\r\\n\\t\\twe collect, use, communicate and\\r\\n\\t\\tdisclose and make use of personal information. The following outlines our privacy policy.\\r\\n\\t

    \\r\\n\\r\\n\\t
      \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tBefore or at the time of collecting personal information, we will identify the purposes for which information is\\r\\n\\t\\t\\tbeing collected.\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tWe will collect and use personal information solely with the objective of fulfilling those purposes specified by us\\r\\n\\t\\t\\tand for other compatible purposes,\\r\\n\\t\\t\\tunless we obtain the consent of the individual concerned or as required by law.\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tWe will only retain personal information as long as necessary for the fulfillment of those purposes.\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tWe will collect personal information by lawful and fair means and, where appropriate, with the knowledge or consent\\r\\n\\t\\t\\tof the individual concerned.\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tPersonal data should be relevant to the purposes for which it is to be used, and, to the extent necessary for those\\r\\n\\t\\t\\tpurposes, should be accurate,\\r\\n\\t\\t\\tcomplete, and up-to-date.\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tWe will protect personal information by reasonable security safeguards against loss or theft, as well as\\r\\n\\t\\t\\tunauthorized access,\\r\\n\\t\\t\\tdisclosure, copying, use or modification.\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tWe will make readily available to customers information about our policies and practices relating to the management\\r\\n\\t\\t\\tof personal information.\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tData entered and reported will be personalized only as required by applicable law and relevant government agency\\r\\n\\t\\t\\trequirements. Further presentations of data\\r\\n\\t\\t\\twill be anonymized aggregations where available and applicable.\\r\\n\\t\\t
    • \\r\\n\\t
    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tWe are committed to conducting our business in accordance with these principles in order to ensure that the\\r\\n\\t\\tconfidentiality of personal information is protected and maintained.\\r\\n\\t

    \\r\\n\\r\\n\\r\\n\\tClose\\r\\n\\r\\n\\r\\n\";","import template from \"./index.html\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\n\r\n//terms\r\nexport function controller($scope, eventBus) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = handleClose;\r\n\r\n\tfunction onInit() {\r\n\t\teventBus.register(EVENT_LOGOUT, () => { handleClose(); }, $scope);\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.close();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.account-deletion\", [])\r\n\t.component(\"accountDeletion\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n
    \\r\\n\\t\\r\\n\\t\\tVESL Account Deletion\\r\\n\\t\\r\\n
    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tUsers may delete their profile information through the mobile app or by emailing support@vesldata.com.\\r\\n\\t\\tDeleting an account in VESL will remove all user profile data and the user's login credentials will no longer function for logging into VESL.\\r\\n\\t

    \\r\\n\\t

    \\r\\n\\t\\tIn order to delete your account through the VESL mobile app, follow the instructions below:\\r\\n\\t

    \\r\\n\\r\\n\\t
      \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tLog into your VESL account through the VESL mobile app.\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tTap your initials in the top right corner of the dashboard screen, taking you to the user profile screen\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tOn the user profile screen, tap the red \\\"DELETE ACCOUNT\\\" button.\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tRead the confirmation screen to ensure that you are certain about what will be deleted.\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tIf you agree, tap \\\"YES, DELETE IT\\\". Tapping \\\"NO, I WANT TO KEEP MY ACCOUNT ACTIVE\\\" will abort the deletion process and all of your data will remain unchanged.\\r\\n\\t\\t
    • \\r\\n\\t\\t
    • \\r\\n\\t\\t\\tYour account will be deleted and you will be signed out.\\r\\n\\t\\t
    • \\r\\n\\t
    \\r\\n\\r\\n\\t

    \\r\\n\\t\\tPlease note that any fishery data collected by the VESL app that is used for governmental regulatory reporting will be disassociated from your account, but the data itself\\r\\n\\t\\twill be retained.\\r\\n\\t

    \\r\\n\";","import moment from \"moment\";\r\nimport { effectiveRangeStatus } from \".\";\r\n\r\n/**\r\n * Assess whether an entity is either in range, or in a state of grace\r\n * @param entity\r\n * @param asOfDate\r\n * @returns status\r\n */\r\n\r\nexport const entityEffectiveStatus = (\r\n\tentity,\r\n\tasOfDate\r\n) => {\r\n\tif(!entity || !asOfDate) //not enough information to run the check\r\n\t\treturn { isValid: false, isInGrace: false, isEither: false };\r\n\r\n\tif(!entity.Effective?.length)\r\n\t\treturn { isValid: true, isInGrace: false, isEither: true };\r\n\r\n\tconst asOf = moment(asOfDate);\r\n\r\n\tlet isInGrace = false;\r\n\r\n\tfor(const range of entity.Effective) {\r\n\t\tconst status = effectiveRangeStatus(range, asOf);\r\n\t\tif(status.isValid)\r\n\t\t\treturn status;\r\n\t\r\n\t\tisInGrace = isInGrace || status.isInGrace;\r\n\t}\r\n\r\n\treturn { isValid: false, isInGrace, isEither: isInGrace };\r\n};\r\n\r\n\r\n","import moment from \"moment\";\r\n\r\nexport const comparePeriodStartDateAscending = (a, b) => moment(a.Start).isAfter(moment(b.Start) ? -1 : 1);","import template from \"./primary-selector.html\";\r\nimport \"./primary-selector.less\";\r\nimport {\r\n\tsome,\r\n\tuniqWith\r\n} from \"lodash\";\r\nimport {\r\n\tENTITY_TYPES,\r\n\tEVENT_LOGOUT\r\n} from \"constants.js\";\r\nimport moment from \"moment\";\r\nimport {\r\n\tcomparePeriodStartDateAscending, \r\n\tentityEffectiveStatus \r\n} from \"../../../utils/effectiveRanges\";\r\n\r\nexport class Controller {\r\n\tentity = null;\r\n\ttitle = null;\r\n\r\n\tconstructor($scope, eventBus, appState, $logger) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.form = appState.forms.selected;\r\n\t\tthis.logger = $logger;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.isShown = [];\r\n\t\tthis.btnIsExpanded = null;\r\n\t\tconst hasEffectiveRanges = some(this.resolve.entity.Entities, e => e.Entity.Effective?.length);\r\n\r\n\t\tif(hasEffectiveRanges) {\r\n\t\t\tconst entitiesWithMostRecentStartRangeMoment = this.resolve.entity.Entities.map(e => {\r\n\t\t\t\tif(e.Entity.Effective === undefined) {\r\n\t\t\t\t\tthis.logger.warn(\"Entity is missing effective ranges\", { entity: e.Entity });\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\t...e, \r\n\t\t\t\t\t\tEntity: {\r\n\t\t\t\t\t\t\t...e.Entity,\r\n\t\t\t\t\t\t\tmostRecentRangeStartMoment: moment.unix(0)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst sortedRanges = [...e.Entity.Effective].sort(comparePeriodStartDateAscending);\r\n\r\n\t\t\t\tconst newEntity = {\r\n\t\t\t\t\t...e, \r\n\t\t\t\t\tEntity: {\r\n\t\t\t\t\t\t...e.Entity,\r\n\t\t\t\t\t\tmostRecentRangeStartMoment: moment(sortedRanges[0])\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\treturn newEntity;\r\n\t\t\t});\r\n\r\n\t\t\tconst orderedEntities = entitiesWithMostRecentStartRangeMoment.sort((eOne, eTwo) => \r\n\t\t\t\teOne.Entity.mostRecentRangeStartMoment.isBefore(eTwo.Entity.mostRecentRangeStartMoment) ? -1 : 1\r\n\t\t\t);\r\n\r\n\t\t\tthis.entity = {\r\n\t\t\t\t...this.resolve.entity,\r\n\t\t\t\tEntities: orderedEntities.filter(item => item.Entity.valid === undefined || item.Entity.valid),\r\n\t\t\t\tOutOfSeasonLicenses: orderedEntities.filter(item => item.Entity.valid !== undefined && !item.Entity.valid)\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tthis.entity = this.resolve.entity;\r\n\t\t}\r\n\r\n\t\tthis.entity.Entities.map(e => {\r\n\t\t\te.icon = ENTITY_TYPES[e.Entity.Type?.Code]?.Icon ?? ENTITY_TYPES[\"DEFAULT\"]?.Icon;\r\n\t\t\te.Entity.Identifiers = e.Entity.Identifiers && e.Entity.Identifiers.filter(id => id.Type.Code !== \"TOKEN\");\r\n\r\n\t\t\tlet allClassifications = e.Entity.Classifications || [];\r\n\t\t\tif(!!e.Entity.Classification) {\r\n\t\t\t\tallClassifications = allClassifications.concat(e.Entity.Classification);\r\n\t\t\t\tallClassifications = uniqWith(allClassifications, (a, b) => a.Id === b.Id);\r\n\t\t\t}\r\n\r\n\t\t\tif(allClassifications.length > 0) {\r\n\t\t\t\te.Entity.allClassifications = allClassifications;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.isShown = (() => {\r\n\t\t\tconst shown = [];\r\n\t\t\tthis.entity.Entities.forEach(entity => {\r\n\t\t\t\tconst identifiersCount = entity.Entity.Identifiers && entity.Entity.Identifiers.length;\r\n\t\t\t\tif(identifiersCount === 1) {\r\n\t\t\t\t\tshown.push(entity.Entity.Id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\treturn shown;\r\n\t\t})();\r\n\r\n\t\tthis.eventBus.register(\r\n\t\t\tEVENT_LOGOUT,\r\n\t\t\t() => {\r\n\t\t\t\tthis.handleSelection();\r\n\t\t\t},\r\n\t\t\tthis._scope\r\n\t\t);\r\n\t}\r\n\r\n\thandleClick(result) {\r\n\t\tif(result.Entity.valid !== false) {\r\n\t\t\tthis.modalInstance.close(result.Entity);\r\n\t\t}\r\n\t}\r\n\r\n\thandleSelection(event, result) {\r\n\t\tif(document.activeElement.tagName !== \"BUTTON\") {\r\n\t\t\tif(event.keyCode === 13 || event.keyCode === 32) {\r\n\t\t\t\tevent.stopImmediatePropagation();\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\tthis.modalInstance.close(result.Entity);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetCount(count, name) {\r\n\t\tif(count === 0 || count === undefined) {\r\n\t\t\treturn false;\r\n\t\t} else if(count > 1) {\r\n\t\t\treturn `${count} ${name}s`;\r\n\t\t} else if(count === 1) {\r\n\t\t\treturn `${count} ${name}`;\r\n\t\t}\r\n\t}\r\n\r\n\tgetDate(entity) {\r\n\t\tif(!entity.Effective) {\r\n\t\t\treturn false;\r\n\t\t} \r\n\r\n\t\tif(this.resolve.primaryDate) {\r\n\t\t\tconst primaryMoment = moment(this.resolve.primaryDate);\r\n\t\t\tconst statusForPrimaryDate = entityEffectiveStatus(this.resolve.entity, this.resolve.primaryDate);\r\n\r\n\t\t\treturn statusForPrimaryDate.isValid \r\n\t\t\t\t? `Active for ${primaryMoment.format(\"YYYY-MM-DD\")}`\r\n\t\t\t\t: statusForPrimaryDate.isInGrace\r\n\t\t\t\t\t? `In Grace period for ${primaryMoment.format(\"YYYY-MM-DD\")}`\r\n\t\t\t\t\t: `Inactive for ${primaryMoment.format(\"YYYY-MM-DD\")}`;\r\n\t\t}\r\n\r\n\t\tconst dates = entity.Effective?.map(range => `${moment(range.Start).format(\"YYYY-MM-DD\")} - ${range.End ? moment(range.End).format(\"YYYY-MM-DD\") : \"\"}`);\r\n\t\tconst separated = dates.join(\", \");\r\n\r\n\t\treturn separated;\r\n\t}\r\n\r\n\tgetMomentFormat(unformatted) {\r\n\t\treturn moment(unformatted).format(\"L\");\r\n\t}\r\n\r\n\ttoggleButton(id, event) {\r\n\t\tevent.preventDefault();\r\n\t\tevent.stopPropagation();\r\n\r\n\t\tif(this.btnIsExpanded === id) {\r\n\t\t\tthis.btnIsExpanded = null;\r\n\t\t} else {\r\n\t\t\tthis.btnIsExpanded = id;\r\n\t\t}\r\n\t\tif(this.isShown.includes(id)) {\r\n\t\t\tthis.isShown = this.isShown.filter(i => i !== id);\r\n\t\t} else {\r\n\t\t\tthis.isShown.push(id);\r\n\t\t}\r\n\t}\r\n\ttoggleButtonKeyUp(id, event) {\r\n\t\tif(event.key == 13 || event.keyCode == 32) {\r\n\t\t\tevent.stopImmediatePropagation(); //stops button from rapidly and repeatedly toggling\r\n\t\t\tthis.toggleButton(id, event);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.primary-selector\", []).component(\"primarySelector\", {\r\n\tcontroller: Controller,\r\n\ttemplate,\r\n\tbindings: {\r\n\t\tclose: \"&\",\r\n\t\tdismiss: \"&\",\r\n\t\tmodalInstance: \"<\",\r\n\t\tresolve: \"<\"\r\n\t}\r\n}).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\tPlease select a {{$ctrl.entity.Entities[0].Entity.Type.Name}} of {{$ctrl.entity.Name}}\\r\\n\\t\\r\\n
    \\r\\n\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{{ item.Entity.Name }}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{{ item.Entity.Code }}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    {{ item.Entity.Classification.Name }}
    \\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{{ $ctrl.getDate(item.Entity) }} \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t 0\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tclass=\\\"icon-text-cont row\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{{ $ctrl.getCount(item.Entity.Classifications.length, 'classification') }}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{{ $ctrl.getCount(item.Entity.Identifiers.length, 'identifier') }}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t({{ item.Entity.allClassifications[$index].Code }})\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t{{ item.Entity.allClassifications[$index].Name }}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t{{ item.Entity.Identifiers[$index].Type.Name}}:\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t{{ item.Entity.Identifiers[$index].Value}}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t{{ $ctrl.getMomentFormat(item.Entity.Effective[$index].Start) }} -\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t{{ $ctrl.getMomentFormat(item.Entity.Effective[$index].End) }}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t{{ item.Entity.Effective[$index].Scope !== undefined ? \\\"(\\\" + item.Entity.Effective[$index].Scope + \\\")\\\" : \\\"\\\" }}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tIs in grace period\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t 0\\\"\\r\\n\\t>\\r\\n\\t\\t
    \\r\\n\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\tOut of season licenses: \\r\\n\\t\\t\\t\\t{{item.Entity.Name || item.Entity.Code}},\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t

    \\r\\n\\t\\t
    \\r\\n\\t\\r\\n\\r\\n\\r\\n
    \\r\\n\\tClose\\r\\n
    \";","import template from \"./index.html\";\r\nimport moment from \"moment\";\r\n\r\nexport function controller(\r\n\tconfig\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = handleClose;\r\n\tctrl.config = config;\r\n\r\n\tfunction onInit() {\r\n\t\t// eslint-disable-next-line no-undef\r\n\t\tconst localBuildDate = moment(moment.utc(BUILD_DATE).toDate());\r\n\r\n\t\tctrl.buildDate = localBuildDate.format(\"MMMM Do YYYY, h:mm:ss a\");\r\n\t\tctrl.timeSinceBuildDate = localBuildDate.fromNow();\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.close();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.build-information-modal\", [])\r\n\t.component(\"buildInformationModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\tBuild Information\\r\\n\\t\\r\\n
    \\r\\n\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
      \\r\\n\\t\\t\\t\\t
    • Build: {{$ctrl.config.build}}
    • \\r\\n\\t\\t\\t\\t
    • Last Build Date: {{$ctrl.buildDate}}
    • \\r\\n\\t\\t\\t\\t
    • Time Since Last Build Update: {{$ctrl.timeSinceBuildDate}}
    • \\r\\n\\t\\t\\t\\t
    • API Url: {{$ctrl.config.apiUrl}}
    • \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\r\\n
    \\r\\n\\tClose\\r\\n
    \";","import template from \"./card-swipe-modal.html\";\r\nimport \"./card-swipe-modal.less\";\r\nimport { find } from \"lodash\";\r\nimport { EVENT_VALUE_CHANGED } from \"constants.js\";\r\nimport moment from \"moment\";\r\nimport { nestedEntityEffectiveRangeStatus } from \"../../../utils/effectiveRanges\";\r\n\r\nexport class Controller {\r\n\tconstructor($scope, eventBus, hotkeys, $timeout, $userProfile) {\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.hotkeys = hotkeys;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.userProfile = $userProfile.getUserProfile();\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.clearData();\r\n\t\tthis.dealerField = { ...find(this.resolve.formConfig.Fields, (field) => field.Key.Code === \"REPORT.ENTITIES.DEALERS.LICENSES.SINGLE\") };\r\n\t\tthis.dealerField.isTiered = this.dealerField.EntityQueryConfiguration\r\n\t\t\t&& this.dealerField.EntityQueryConfiguration.Friendly.Type.Code != this.dealerField.EntityQueryConfiguration.Primary.Type.Code;\r\n\t\tthis.enableCardReader = false;\r\n\r\n\t\tthis.dealerField.Data = this.filterEntitiesByEffective();\r\n\r\n\t\tthis.modalInstance.closed.then(() => {\r\n\t\t\tif(this.userProfile.shortcutsEnabled) {\r\n\t\t\t\tthis.hotkeys.unpause();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.modalInstance.opened.then(() => {\r\n\t\t\tthis.hotkeys.pause();\r\n\t\t});\r\n\r\n\t\tthis.eventBus.register(EVENT_VALUE_CHANGED(this.dealerField.Id), (e, params) => {\r\n\t\t\tthis.onDealerValueChange(params);\r\n\t\t}, this.$scope);\r\n\t}\r\n\r\n\tonDealerValueChange = (params) => {\r\n\t\tif(params.value) {\r\n\t\t\tthis.enableCardReader = true;\r\n\t\t\tthis.selectedDealer = params.primary;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.enableCardReader = false;\r\n\t\t\tthis.selectedDealer = null;\r\n\t\t}\r\n\r\n\t\tthis.$timeout(function() {\r\n\t\t\tconst sel = window.document.getElementById(\"card-data-input\");\r\n\r\n\t\t\tsel && sel.focus();\r\n\t\t});\r\n\t}\r\n\r\n\tfilterEntitiesByEffective() {\r\n\t\tconst now = moment();\r\n\r\n\t\tconst candidates = this.dealerField.Data.reduce((entities, entity) => {\r\n\t\t\tconst status = nestedEntityEffectiveRangeStatus(entity, now);\r\n\t\t\tif(status.isValid || status.children?.hasValid) {\r\n\t\t\t\tentities.valid.push(entity);\r\n\t\t\t} \r\n\t\t\telse if(status.isInGrace || status.children?.hasGrace) {\r\n\t\t\t\tentities.grace.push(entity);\r\n\t\t\t}\r\n\r\n\t\t\treturn entities;\r\n\t\t}, {\r\n\t\t\tvalid: [],\r\n\t\t\tgrace: []\r\n\t\t});\r\n\r\n\t\treturn candidates.valid.length ? candidates.valid : candidates.grace;\r\n\t}\r\n\r\n\thandleClose() {\r\n\t\tthis.modalInstance.dismiss();\r\n\t}\r\n\r\n\tsaveAndClose(report) {\r\n\t\tthis.modalInstance.close(report);\r\n\t}\r\n\r\n\temptySetFieldDirty = () => {}\r\n\r\n\tcreateTicket() {\r\n\t\tconst reportResponse = [\r\n\t\t\t{\r\n\t\t\t\tfieldId: this.dealerField.Id,\r\n\t\t\t\tvalue: this.selectedDealer.Id\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tfieldId: this.fishermanField.Id,\r\n\t\t\t\tvalue: this.reportInfo.fishermanLicense.Entity.Id,\r\n\t\t\t\tisDetail: true\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\tif(this.reportInfo.vessel) {\r\n\t\t\treportResponse.push({\r\n\t\t\t\tfieldId: this.vesselField.Id,\r\n\t\t\t\tvalue: this.reportInfo.vessel.Id\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.saveAndClose(reportResponse);\r\n\t}\r\n\r\n\tclearData() {\r\n\t\tthis.cardData = \"\";\r\n\t\tthis.reportInfo = null;\r\n\t\tthis.enableCardReader = false;\r\n\t\tthis.selectedDealer = null;\r\n\t}\r\n\r\n\tcardDataChange() {\r\n\t\tif(this.cardData) {\r\n\t\t\tthis.findUnbrokenCardData();\r\n\r\n\t\t\tif(this.cardData) {\r\n\t\t\t\tconst cardInfo = this.ExtractDataFromTrack(this.cardData);\r\n\r\n\t\t\t\tthis.reportInfo = this.GetFormDataFromTrackData(cardInfo);\r\n\r\n\t\t\t\tthis.cardData = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfindUnbrokenCardData() {\r\n\t\tconst beginIndex = this.cardData.lastIndexOf(\"%\");\r\n\t\tconst endIndex = this.cardData.indexOf(\"?\", beginIndex);\r\n\r\n\t\tthis.cardData = this.cardData && this.cardData.substring(beginIndex, endIndex + 1);\r\n\t}\r\n\r\n\tExtractDataFromTrack(track) {\r\n\t\tlet searchEndIndex = -1;\r\n\t\tconst cardData = [];\r\n\r\n\t\ttrack = track.substring(0, track.length - 1);\r\n\r\n\t\tdo {\r\n\t\t\tconst searchStartIndex = track.indexOf(\"*\", searchEndIndex);\r\n\t\t\tsearchEndIndex = track.indexOf(\"*\", searchStartIndex + 1);\r\n\r\n\t\t\tconst thisDataString = track.substring(searchStartIndex + 1, searchEndIndex > -1 ? searchEndIndex : undefined);\r\n\r\n\t\t\tcardData.push(thisDataString);\r\n\t\t} while(searchEndIndex > -1);\r\n\r\n\t\tconst licenseCardData = this.extractSubdataFromCardField(cardData[0]);\r\n\r\n\t\tconst yearCode = cardData[1];\r\n\t\tconst vesselCode = cardData[2].substring(1); //ignore S at beginning of code\r\n\r\n\t\treturn {\r\n\t\t\t...licenseCardData,\r\n\t\t\tyearCode,\r\n\t\t\tvesselCode\r\n\t\t};\r\n\t}\r\n\r\n\textractSubdataFromCardField(data) {\r\n\t\tconst cardsIssued = parseInt(data.substring(0, 2));\r\n\t\tconst agencyCode = data.substring(2, 4);\r\n\t\tconst licenseNumber = data.substring(4);\r\n\r\n\t\treturn {\r\n\t\t\tcardsIssued, agencyCode, licenseNumber\r\n\t\t};\r\n\t}\r\n\r\n\tGetFormDataFromTrackData(trackData) {\r\n\t\tconst formConfig = this.resolve.formConfig;\r\n\r\n\t\tthis.vesselField = find(formConfig.Fields, (field) => field.Key.Code === \"REPORT.ENTITIES.VESSEL.SINGLE\");\r\n\t\tthis.fishermanField = find(formConfig.Fields, (field) => field.Key.Code === \"REPORT.ENTITIES.FISHERMEN.LICENSES.SINGLE\");\r\n\r\n\t\tlet thisVesselLicense = null;\r\n\t\tconst thisVessel = find(this.vesselField.Data, (data) => {\r\n\t\t\tif(data.isSelf || (data.Entities && data.Entities.length === 1 && data.Entities[0].Type.Code === \"SELF\")) {\r\n\t\t\t\treturn data.Code === trackData.vesselCode;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthisVesselLicense = find(data.Entities, (entity) => entity.Entity.Code === trackData.vesselCode);\r\n\t\t\t\treturn thisVesselLicense !== null;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlet thisFishermanLicense = null;\r\n\t\tconst thisFisherman = find(this.fishermanField.Data, (data) => {\r\n\t\t\tif(data.isSelf || (data.Entities && data.Entities.length === 1 && data.Entities[0].Type.Code === \"SELF\")) {\r\n\t\t\t\treturn data.Code === trackData.licenseNumber;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthisFishermanLicense = find(data.Entities, (entity) => entity.Entity.Code === trackData.licenseNumber);\r\n\t\t\t\treturn thisFishermanLicense !== null && thisFishermanLicense !== undefined;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn { vessel: thisVessel, fisherman: thisFisherman, vesselLicense: thisVesselLicense, fishermanLicense: thisFishermanLicense };\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.card-swipe-modal\", []) //\"cfp.hotkeys\"\r\n\t.component(\"cardSwipeModal\", {\r\n\t\tcontroller: Controller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","import { entityEffectiveStatus } from \"./entityEffectiveStatus\";\r\n\r\nexport const nestedEntityEffectiveRangeStatus = (entity, asOf) => {\r\n\tconst status = entityEffectiveStatus(entity, asOf);\r\n\tif(status.isEither) {\r\n\t\treturn status;\r\n\t}\r\n\r\n\tif(!entity.Entities)\r\n\t\treturn { isValid: false, isInGrace: false, isEither: false };\r\n\r\n\tconst childStatus = entity.Entities.reduce((agg, child) => {\r\n\t\tconst childStatus = nestedEntityEffectiveRangeStatus(child.Entity, asOf);\r\n\t\tif(!childStatus.isEither)\r\n\t\t\treturn agg;\r\n\r\n\t\treturn ({\r\n\t\t\thasValid: agg.hasValid || childStatus.isValid,\r\n\t\t\thasGrace: agg.hasGrace || childStatus.isInGrace,\r\n\t\t\thasEither: agg.hasEither || childStatus.isValid || childStatus.isInGrace\r\n\t\t});\r\n\t}, {\r\n\t\thasValid: false,\r\n\t\thasGrace: false, \r\n\t\thasEither: false\r\n\t});\r\n\r\n\treturn { isValid: false, isInGrace: false, isEither: false, children: childStatus };\r\n};","export default \"
    \\r\\n\\t Swipe a Card \\r\\n
    \\r\\n\\r\\n\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t

    Dealer License:

    \\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\r\\n\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t

    Dealer License: {{$ctrl.selectedDealer.Name || $ctrl.selectedDealer.Code}}

    \\r\\n\\t\\t
    \\r\\n\\t\\r\\n\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t Invalid card data format \\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t

    Fisherman license not found.

    \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t

    Fisherman: {{$ctrl.reportInfo.fisherman.Name || $ctrl.reportInfo.fisherman.Code}}

    \\r\\n\\t\\t\\t

    Fisherman License: {{$ctrl.reportInfo.fishermanLicense.Entity.Code}}

    \\r\\n\\t\\t\\t

    Vessel: {{$ctrl.reportInfo.vessel.Name}}

    \\r\\n\\t\\t\\t

    Vessel License: {{$ctrl.reportInfo.vessel.Code}}

    \\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\tCancel\\r\\n\\t\\tCreate Ticket\\r\\n\\t\\tClear Data\\r\\n\\t
    \\r\\n\";","import dateTimeWrapper from \"./templates/datetime/wrapper.html\";\r\nimport dateOnlyWrapper from \"./templates/datetime/dateOnlyWrapper.html\";\r\nimport {\r\n\tdateTimeAddOn, \r\n\tdateOnlyAddOn \r\n} from \"./templates/datetime/datetime-add-on.js\";\r\n\r\nexport default angular.module(\"vesl.components.proxy-modal.addons.datetime\", [\r\n\t\"schemaForm\"\r\n])\r\n\t.run([\"$templateCache\", function($templateCache) { \r\n\t\t$templateCache.put(\"./templates/datetime/wrapper.html\", dateTimeWrapper); \r\n\t\t$templateCache.put(\"./templates/datetime/dateOnlyWrapper.html\", dateOnlyWrapper); \r\n\t}])\r\n\t.config(dateTimeAddOn)\r\n\t.config(dateOnlyAddOn)\r\n\t.name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\r\\n
    \";","export default \"
    \\r\\n\\t\\r\\n\\t\\r\\n
    \";","export function dateTimeAddOn(schemaFormDecoratorsProvider, sfBuilderProvider, schemaFormProvider) {\r\n\tconst dateTimeField = function(name, schema) {\r\n\t\tif(schema.type === \"datetime\" && schema.format === \"datetime\") {\r\n\t\t\treturn {\r\n\t\t\t\tkey: name,\r\n\t\t\t\ttype: \"datetime\",\r\n\t\t\t\ttemplate: \"./wrapper.html\",\r\n\t\t\t\tschema: schema,\r\n\t\t\t\ttitle: schema.title,\r\n\t\t\t\tdescription: schema.description,\r\n\t\t\t\treadonly: schema.readonly,\r\n\t\t\t\trequired: schema.required\r\n\t\t\t};\r\n\t\t}\r\n\t};\r\n\r\n\tschemaFormProvider.defaults.datetime = [dateTimeField];\r\n\r\n\tschemaFormDecoratorsProvider.defineAddOn(\r\n\t\t\"bootstrapDecorator\", \t// Name of the decorator you want to add to.\r\n\t\t\"datetime\", \t\t// Form type that should render this add-on\r\n\t\t\"./templates/datetime/wrapper.html\", \t\t// Template name in $templateCache\r\n\t\tsfBuilderProvider.stdBuilders \t// List of builder functions to apply.\r\n\t);\r\n}\r\n\r\nexport function dateOnlyAddOn(schemaFormDecoratorsProvider, sfBuilderProvider, schemaFormProvider) {\r\n\tconst dateField = function(name, schema) {\r\n\t\tif(schema.type === \"date\" && schema.format === \"date\") {\r\n\t\t\treturn {\r\n\t\t\t\tkey: name,\r\n\t\t\t\ttype: \"date\",\r\n\t\t\t\ttemplate: \"./dateOnlyWrapper.html\",\r\n\t\t\t\tschema: schema,\r\n\t\t\t\ttitle: schema.title,\r\n\t\t\t\tdescription: schema.description,\r\n\t\t\t\treadonly: schema.readonly,\r\n\t\t\t\trequired: schema.required\r\n\t\t\t};\r\n\t\t}\r\n\t};\r\n\r\n\tschemaFormProvider.defaults.date = [dateField];\r\n\r\n\tschemaFormDecoratorsProvider.defineAddOn(\r\n\t\t\"bootstrapDecorator\", \t// Name of the decorator you want to add to.\r\n\t\t\"date\", \t\t// Form type that should render this add-on\r\n\t\t\"./templates/datetime/dateOnlyWrapper.html\", \t\t// Template name in $templateCache\r\n\t\tsfBuilderProvider.stdBuilders \t// List of builder functions to apply.\r\n\t);\r\n}","import * as angular from \"angular\";\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.proxy-modal.addons.base64FileUpload.controller\", [])\r\n\t.directive(\"base64FileUpload\", [\r\n\t\t\"base64FileUploadConfig\",\r\n\t\t\"$timeout\",\r\n\t\tfunction(base64FileUploadConfig, $timeout, $logger) {\r\n\t\t\treturn {\r\n\t\t\t\trestrict: \"A\",\r\n\t\t\t\trequire: \"ngModel\",\r\n\t\t\t\tscope: true,\r\n\t\t\t\tlink: function(scope, element, attrs, ngModel) {\r\n\t\t\t\t\tscope.ngModel = ngModel;\r\n\t\t\t\t\tscope.dropAreaHover = false;\r\n\t\t\t\t\tscope.file = undefined;\r\n\t\t\t\t\tscope.fileError = false;\r\n\t\t\t\t\tscope.dropText = base64FileUploadConfig.dropText || \"Click here or drop files to upload\";\r\n\r\n\t\t\t\t\tconst validateFile = function(file) {\r\n\t\t\t\t\t\tlet valid = true;\r\n\t\t\t\t\t\tconst schema = scope.$eval(attrs.base64FileUpload).schema;\r\n\r\n\t\t\t\t\t\tif(file.size > parseInt(schema.maxSize, 10)) {\r\n\t\t\t\t\t\t\tvalid = false;\r\n\t\t\t\t\t\t\tngModel.$setValidity(\"base64FileUploadSize\", false);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tngModel.$setValidity(\"base64FileUploadSize\", true);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tscope.$apply();\r\n\r\n\t\t\t\t\t\treturn valid;\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tconst getFile = function(file) {\r\n\t\t\t\t\t\tif(!file) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(!validateFile(file)) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst reader = new FileReader();\r\n\r\n\t\t\t\t\t\tscope.file = file;\r\n\t\t\t\t\t\tscope.file.ext = file.name.split(\".\").slice(-1)[0];\r\n\t\t\t\t\t\tscope.file.src = URL.createObjectURL(file);\r\n\t\t\t\t\t\tscope.hasFile = true;\r\n\t\t\t\t\t\t// just a simple conversion to human readable size.\r\n\t\t\t\t\t\t// For now not bothering with large sizes.\r\n\t\t\t\t\t\tlet fileSize = file.size / 1024;\r\n\t\t\t\t\t\tlet unit = \"kB\";\r\n\t\t\t\t\t\tif(fileSize > 1024) {\r\n\t\t\t\t\t\t\tfileSize = fileSize / 1024;\r\n\t\t\t\t\t\t\tunit = \"MB\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tscope.file.humanSize = fileSize.toFixed(1) + \" \" + unit;\r\n\r\n\t\t\t\t\t\treader.onloadstart = function() {\r\n\t\t\t\t\t\t\t$timeout(function() {\r\n\t\t\t\t\t\t\t\tscope.loadingFile = true;\r\n\t\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\treader.onload = function(e) {\r\n\t\t\t\t\t\t\t$timeout(function() {\r\n\t\t\t\t\t\t\t\tscope.loadingFile = false;\r\n\t\t\t\t\t\t\t}, 0);\r\n \r\n\t\t\t\t\t\t\tconst prefix = \"file:\" + file.name + \";\";\r\n\t\t\t\t\t\t\tngModel.$setViewValue(prefix + e.target.result);\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\treader.readAsDataURL(file);\r\n\t\t\t\t\t\tscope.$apply();\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tscope.isImage = function(file) {\r\n\t\t\t\t\t\tif(!file) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn file.type.indexOf(\"image\") > -1;\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tscope.removeFile = function(e) {\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tscope.file = undefined;\r\n\t\t\t\t\t\tscope.hasFile = false;\r\n\t\t\t\t\t\tngModel.$setViewValue(undefined);\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\telement.find(\"input\").bind(\"change\", function(e) {\r\n\t\t\t\t\t\tgetFile(e.target.files[0]);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tconst dropArea = document.querySelector(\"#base-64-file-drop-button\");\r\n\t\t\t\t\tconst inputField = document.querySelector(\"#base-64-file-input-area\");\r\n\r\n\t\t\t\t\tconst clickArea = function(e) {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tinputField.click();\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tconst dragOver = function(e) {\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t$timeout(function() {\r\n\t\t\t\t\t\t\tscope.dropAreaHover = true;\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tconst dragLeave = function(e) {\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t$timeout(function() {\r\n\t\t\t\t\t\t\tscope.dropAreaHover = false;\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tconst drop = function(e) {\r\n\t\t\t\t\t\tdragLeave(e);\r\n\t\t\t\t\t\tgetFile(e.dataTransfer.files[0]);\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tdropArea.addEventListener(\"click\", clickArea, false);\r\n\t\t\t\t\tdropArea.addEventListener(\"touchstart\", clickArea, false);\r\n\t\t\t\t\tdropArea.addEventListener(\"dragenter\", dragOver, false);\r\n\t\t\t\t\tdropArea.addEventListener(\"dragleave\", dragLeave, false);\r\n\t\t\t\t\tdropArea.addEventListener(\"dragover\", dragOver, false);\r\n\t\t\t\t\tdropArea.addEventListener(\"drop\", drop, false);\r\n\r\n\t\t\t\t\tscope.$on(\"$destroy\", function() {\r\n\t\t\t\t\t\tdropArea.removeEventListener(\"click\", clickArea, false);\r\n\t\t\t\t\t\tdropArea.removeEventListener(\"touchstart\", clickArea, false);\r\n\t\t\t\t\t\tdropArea.removeEventListener(\"dragenter\", dragOver, false);\r\n\t\t\t\t\t\tdropArea.removeEventListener(\"dragleave\", dragLeave, false);\r\n\t\t\t\t\t\tdropArea.removeEventListener(\"dragover\", dragOver, false);\r\n\t\t\t\t\t\tdropArea.removeEventListener(\"drop\", drop, false);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t}\r\n\t])\r\n\t.name;\r\n","function base64FileUploadConfig() {\r\n\tthis.setDropText = function(text) {\r\n\t\tthis.dropText = text;\r\n\t};\r\n\r\n\tthis.$get = function() {\r\n\t\treturn this;\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.proxy-modal.addons.base64FileUpload.provider\", [])\r\n\t.provider(\"base64FileUploadConfig\", base64FileUploadConfig)\r\n\t.name;","import template from \"./templates/base-64-upload/template.html\";\r\nimport { base64Config } from \"./templates/base-64-upload/base-64-config\";\r\nimport base64Controller from \"./templates/base-64-upload/controller\";\r\nimport base64Provider from \"./templates/base-64-upload/provider\";\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.proxy-modal.addons.base64FileUpload\", [\r\n\t\t\"schemaForm\",\r\n\t\tbase64Controller,\r\n\t\tbase64Provider\r\n\t])\r\n\t.run([\"$templateCache\", function($templateCache) { \r\n\t\t$templateCache.put(\"./templates/base-64-upload/template.html\", template); \r\n\t}])\r\n\t.config(base64Config)\r\n\t.name;\r\n","export default \"\\r\\n\\t{{form.title}}\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{file.ext}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    {{file.name}}
    \\r\\n\\t\\t\\t\\t
    {{file.humanSize}}
    \\r\\n\\t\\t\\t\\t✕\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t{{form.placeholder || dropText}}\\r\\n\\t\\t\\r\\n\\t\\r\\n\\r\\n\\t\\r\\n\";","export function base64Config(schemaFormProvider, schemaFormDecoratorsProvider, sfBuilderProvider, sfPathProvider) {\r\n\tconst base64file = function(name, schema, options) {\r\n\t\tif(schema.type === \"string\" && schema.format === \"base64\") {\r\n\t\t\tconst f = schemaFormProvider.stdFormObj(name, schema, options);\r\n\t\t\tf.key = options.path;\r\n\t\t\tf.type = \"base64file\";\r\n\t\t\toptions.lookup[sfPathProvider.stringify(options.path)] = f;\r\n\r\n\t\t\treturn f;\r\n\t\t}\r\n\t};\r\n\r\n\tschemaFormProvider.defaults.string.unshift(base64file);\r\n\r\n\tschemaFormDecoratorsProvider.defineAddOn(\r\n\t\t\"bootstrapDecorator\", // Name of the decorator you want to add to.\r\n\t\t\"base64file\", // Form type that should render this add-on\r\n\t\t\"./templates/base-64-upload/template.html\", // Template name in $templateCache\r\n\t\tsfBuilderProvider.stdBuilders // List of builder functions to apply\r\n\t);\r\n}","import wrapper from \"./wrapper.html\";\r\nimport \"./style.less\";\r\nimport { FORM_ENTITIES } from \"../../../../../../routes\";\r\nimport {\r\n\tEVENT_LOAD_OPTIONS,\r\n\tEVENT_TIMEZONE_SET, \r\n\tPROXY_FIELDS \r\n} from \"../../../../../../constants\";\r\nimport { uuid } from \"../../../../../../utils\";\r\n\r\nclass EntityController {\r\n\tconstructor($scope, eventBus, appState, $logger, loadingService, api) {\r\n\t\tthis._scope = $scope;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.form = appState.forms.selected;\r\n\t\tthis.logger = $logger;\r\n\t\tthis.loadingService = loadingService;\r\n\t\tthis.api = api;\r\n\t\tthis.appState = appState;\r\n\t\tthis.entitySelectorFieldId = uuid();\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.form = this.appState.forms.selected;\r\n\r\n\t\tthis.loadEntities();\r\n\t}\r\n\r\n\tloadEntities = () => {\r\n\t\tconst params = [this.schema.configuration];\r\n\t\tconst promise = this.api\r\n\t\t\t.post(FORM_ENTITIES(this.form.Id), params)\r\n\t\t\t.then((entities) => {\r\n\t\t\t\tthis.associatedEntities = entities[0].Entities;\r\n\t\t\t\tthis.eventBus.trigger(EVENT_LOAD_OPTIONS(this.entitySelectorFieldId), { entities: this.associatedEntities });\r\n\t\t\t})\r\n\t\t\t.catch(() => {\r\n\t\t\t\tthis.associatedEntities = [];\r\n\t\t\t\tthis.eventBus.trigger(EVENT_LOAD_OPTIONS(this.entitySelectorFieldId), { entities: [] });\r\n\t\t\t});\r\n\r\n\t\tthis.loadingService.watch(promise);\r\n\t}\r\n\r\n\tonChanged = (item) => {\r\n\t\tif(item === undefined) {\r\n\t\t\tthis.ngModelCtrl.$setViewValue(undefined);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst subjectEntity = this.schema.configuration.RelationshipType.Code === \"SELF\" ? item.friendly : item.primary;\r\n\t\tconst modelValue = subjectEntity[this.schema.modelProperty];\r\n\r\n\t\tif(this.form.TimeMode?.Code === \"BYENTITY\" && subjectEntity.TimeZone !== undefined) {\r\n\t\t\tthis.eventBus.trigger(\r\n\t\t\t\tEVENT_TIMEZONE_SET(PROXY_FIELDS.DATETIME),\r\n\t\t\t\t{ value: subjectEntity.TimeZone.Code }\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tthis.ngModelCtrl.$setViewValue(modelValue);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.proxy-modal.addons.entity.controller\", [])\r\n\t.component(\"entityAddOn\", {\r\n\t\tcontroller: EntityController,\r\n\t\ttemplate: wrapper,\r\n\t\trequire: { ngModelCtrl: \"^ngModel\" },\r\n\t\tbindings: {\r\n\t\t\tschema: \"<\",\r\n\t\t\tngModel: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\";","import template from \"./templates/entity/template.html\";\r\nimport { entityAddOn } from \"./templates/entity/entity-add-on.js\";\r\nimport entityController from \"./templates/entity/controller.js\";\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.proxy-modal.addons.entity\", [\r\n\t\t\"schemaForm\",\r\n\t\tentityController\r\n\t])\r\n\t.run([\"$templateCache\", function($templateCache) { $templateCache.put(\"./templates/entity/template.html\", template); }])\r\n\t.config(entityAddOn)\r\n\t.name;\r\n","export default \"
    \\r\\n\\t\\r\\n
    \";","export function entityAddOn(schemaFormDecoratorsProvider, sfBuilderProvider, schemaFormProvider) {\r\n\tconst entityPicker = function(name, schema) {\r\n\t\tif(schema.type === \"entity\" && schema.format === \"entity\") {\r\n\t\t\treturn {\r\n\t\t\t\tkey: name,\r\n\t\t\t\ttype: \"entity\",\r\n\t\t\t\ttemplate: \"./template.html\",\r\n\t\t\t\tschema: schema,\r\n\t\t\t\ttitle: schema.title,\r\n\t\t\t\tdescription: schema.description,\r\n\t\t\t\treadonly: schema.readonly,\r\n\t\t\t\trequired: schema.required\r\n\t\t\t};\r\n\t\t}\r\n\t};\r\n\r\n\tschemaFormProvider.defaults.entity = [entityPicker];\r\n\r\n\tschemaFormDecoratorsProvider.defineAddOn(\r\n\t\t\"bootstrapDecorator\", \t// Name of the decorator you want to add to.\r\n\t\t\"entity\", \t\t// Form type that should render this add-on\r\n\t\t\"./templates/entity/template.html\", \t\t// Template name in $templateCache\r\n\t\tsfBuilderProvider.stdBuilders \t// List of builder functions to apply.\r\n\t);\r\n}","import template from \"./proxy-modal.html\";\r\nimport \"./proxy-modal.less\";\r\nimport \"angular-json-tree/dist/angular-json-tree.css\";\r\n\r\nimport {\r\n\tFORM_PROXY_EXECUTE,\r\n\tFORM_PROXY_DETAILS\r\n} from \"routes\";\r\nimport * as templates from \"./add-ons\";\r\nimport marked from \"marked\";\r\n\r\n// angular-schama-form package\r\n// schemaform.io\r\nexport class Controller {\r\n\tconstructor(appState, eventBus, $scope, api, loadingService, toastr, $logger, $window, $sce) {\r\n\r\n\t\tthis.appState = appState;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$window = $window;\r\n\t\tthis.api = api;\r\n\t\tthis.toastr = toastr;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.loadingService = loadingService;\r\n\t\tthis.promiseTracker = loadingService.getTracker();\r\n\t\tthis.$sce = $sce;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.getProxyInfo();\r\n\r\n\t\tconst description = this.resolve.proxy.Description;\r\n\t\tthis.title = this.resolve.title;\r\n\t\tthis.description = description !== undefined ? this.$sce.trustAsHtml(marked(description)) : \"\";\r\n\t\tthis.model = {};\r\n\t\tthis.content = null;\r\n\t\tthis.displayAction = null;\r\n\t\tthis.proxySuccess = false;\r\n\t\tthis.hasRun = false;\r\n\t}\r\n\r\n\tgetProxyInfo() {\r\n\t\tconst url = FORM_PROXY_DETAILS(this.appState.forms.selected.Id, this.resolve.proxy.Id);\r\n\r\n\t\tconst promise = this.api.get(url).then(response => {\r\n\t\t\tthis.proxySuccess = !!response.Code;\r\n\t\t\tthis.title = response.Name;\r\n\t\t\tthis.currentProxy = response;\r\n\t\t\tthis.schema = response.Schema;\r\n\t\t\tthis.form = response.Form;\r\n\t\t});\r\n\t\tthis.loadingService.watch(promise);\r\n\t}\r\n\r\n\tgetProxyByCode() { }\r\n\r\n\thandleCancel() {\r\n\t\tthis.modalInstance.dismiss();\r\n\t}\r\n\r\n\thandleRun() {\r\n\t\tthis.response = null;\r\n\t\tthis.displayAction = null;\r\n\t\tthis.content = null;\r\n\t\tthis.hasRun = false;\r\n\r\n\t\tif(!this.validateModel()) {\r\n\t\t\tthis.toastr.error(\"Inputs are invalid\");\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst url = FORM_PROXY_EXECUTE(this.appState.forms.selected.Id, this.currentProxy, this.model);\r\n\t\tconst verb = this.currentProxy.Method.toLowerCase();\r\n\t\tconst payload = verb === \"post\" ? this.model : undefined;\r\n\r\n\t\tconst promise = this.api[verb](url, payload)\r\n\t\t\t.then(response => {\r\n\t\t\t\tthis.response = response;\r\n\t\t\t\tthis.displayAction = this.response.Body.Action;\r\n\t\t\t\tthis.content = this.response.Body.Content;\r\n\t\t\t\tthis.runAction(this.displayAction, this.response.Body.MediaType, this.response.Body.Name);\r\n\t\t\t\tthis.hasRun = true;\r\n\t\t\t\tthis.showLoader = false;\r\n\t\t\t})\r\n\t\t\t.catch(() => {\r\n\t\t\t\tthis.toastr.error(\"Proxy call failed\");\r\n\t\t\t\tthis.showLoader = false;\r\n\t\t\t});\r\n\r\n\t\tthis.loadingService.watch(promise);\r\n\t}\r\n\r\n\trunAction = (action, mediaType, filename) => {\r\n\t\t// no action is listed for IFRAME, because it is handled it HTML\r\n\t\tif(action === \"WINDOW\") {\r\n\t\t\tconst popup = this.$window.open(\"\", filename);\r\n\t\t\tif(popup === null || popup === undefined) {\r\n\t\t\t\tthis.toastr.warning(\"VESL was unable to open a new window. Please make sure that pop-up windows are enabled for this site.\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tpopup.document.open();\r\n\t\t\tpopup.document.write(this.content);\r\n\t\t\tpopup.document.close();\r\n\t\t} \r\n\t\telse if(action === \"DOWNLOAD\") {\r\n\t\t\tthis.downloadData(filename, mediaType);\r\n\t\t}\r\n\t\telse if(action === \"JSON\") {\r\n\t\t\tthis.content = JSON.parse(this.content);\r\n\t\t}\r\n\t};\r\n\r\n\tdownloadData(filename, filetype) {\r\n\t\tconst blob = this.b64toBlob(this.content, filetype);\r\n\t\tif(window.navigator.msSaveOrOpenBlob) {\r\n\t\t\twindow.navigator.msSaveBlob(blob, filename);\r\n\t\t} \r\n\t\telse {\r\n\t\t\tconst elem = window.document.createElement(\"a\");\r\n\t\t\telem.href = window.URL.createObjectURL(blob);\r\n\t\t\tthis.$logger.debug(elem);\r\n\t\t\telem.download = filename;\r\n\t\t\tdocument.body.appendChild(elem);\r\n\t\t\telem.click();\r\n\t\t\tdocument.body.removeChild(elem);\r\n\t\t}\r\n\t}\r\n\r\n\t//shamelessly stolen from a brilliant individual = https://stackoverflow.com/a/16245768/1034193\r\n\tb64toBlob(b64Data, contentType) {\r\n\t\tconst sliceSize = 512;\r\n\t\tconst byteCharacters = atob(b64Data);\r\n\t\tconst byteArrays = [];\r\n\r\n\t\tfor(let offset = 0; offset < byteCharacters.length; offset += sliceSize) {\r\n\t\t\tconst slice = byteCharacters.slice(offset, offset + sliceSize);\r\n\r\n\t\t\tconst byteNumbers = new Array(slice.length);\r\n\t\t\tfor(let i = 0; i < slice.length; i++) {\r\n\t\t\t\tbyteNumbers[i] = slice.charCodeAt(i);\r\n\t\t\t}\r\n\r\n\t\t\tconst byteArray = new Uint8Array(byteNumbers);\r\n\t\t\tbyteArrays.push(byteArray);\r\n\t\t}\r\n\r\n\t\tconst blob = new Blob(byteArrays, { type: contentType });\r\n\t\treturn blob;\r\n\t}\r\n\r\n\tvalidateModel() {\r\n\t\tif(this.schema && this.schema.properties) {\r\n\t\t\tfor(const [key]of Object.entries(this.schema.properties)) {\r\n\t\t\t\tif(this.schema.required.indexOf(key) === -1) {\r\n\t\t\t\t\tcontinue;\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.model[key] === undefined || this.model[key] === null) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n}\r\n\r\nexport default angular.module(\"vesl.components.proxy-modal\", [...Object.values(templates)]).component(\"proxyModal\", {\r\n\tcontroller: Controller,\r\n\ttemplate,\r\n\tbindings: {\r\n\t\tclose: \"&\",\r\n\t\tdismiss: \"&\",\r\n\t\tmodalInstance: \"<\",\r\n\t\tresolve: \"<\"\r\n\t}\r\n}).name;\r\n","export default \"
    \\r\\n\\t

    {{$ctrl.title === undefined ? $ctrl.resolve.title : $ctrl.title}}

    \\r\\n
    \\r\\n
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t

    {{$ctrl.title}} does not require inputs. Please click \\\"Run\\\" to execute

    \\r\\n\\t\\t\\t

    Loading Failed

    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\tRun\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\r\\n
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\tCancel\\r\\n\\t\\t\\tClose\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n
    \";","import template from \"./negative-report-modal.html\";\r\nimport \"./negative-report-modal.less\";\r\nimport {\r\n\tforEach,\r\n\tfill,\r\n\tfind,\r\n\tfindIndex\r\n} from \"lodash\";\r\nimport moment from \"moment\";\r\nimport { VALIDATION_OPERATORS } from \"../../../screens/rule-provider/constants.js\";\r\n\r\nclass NegativeReportModalController {\r\n\tconstructor($scope, eventBus, $logger, api, loadingService) {\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.api = api;\r\n\t\tthis.loadingService = loadingService;\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tlet i = 0;\r\n\t\tforEach(this.resolve.periods, p => {\r\n\t\t\tconst periodYear = moment(p.Period.EndExclusive)\r\n\t\t\t\t.year();\r\n\r\n\t\t\tp.Period.beginDropdownDisplay = `${p.Period.Name} 01, ${periodYear}`;\r\n\r\n\t\t\tconst periodEndDay = moment(p.Period.EndExclusive)\r\n\t\t\t\t.endOf(\"month\")\r\n\t\t\t\t.date();\r\n\t\t\tp.Period.endDropdownDisplay = `${p.Period.Name} ${periodEndDay}, ${periodYear}`;\r\n\t\t\tp.Period.sortIndex = i++;\r\n\t\t});\r\n\r\n\t\tthis.beginPeriod = this.resolve.periods[this.resolve.startPeriodIndex].Period;\r\n\t\tthis.endPeriod = this.resolve.periods[this.resolve.startPeriodIndex].Period;\r\n\t\tthis.beginPeriods = this.resolve.periods.filter((p, index) => index <= this.resolve.startPeriodIndex);\r\n\t\tthis.endPeriods = this.resolve.periods.filter((p, index) => index >= this.resolve.startPeriodIndex);\r\n\t}\r\n\r\n\thandleSave() {\r\n\t\tconst updates = this.getFormValues(true);\r\n\r\n\t\tif(updates === null) {\r\n\t\t\tthrow new Error(\"save error\");\r\n\t\t}\r\n\t\telse if(updates.length < this.resolve.fields.length) {\r\n\t\t\tthis.showValidationErrors(this.resolve.fields.length - updates.length);\r\n\t\t\treturn Promise.reject(\"Negative fields were not all filled in.\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tconst customReasonVal = find(updates, u => u.String !== undefined);\r\n\r\n\t\t\tif(!!customReasonVal && (customReasonVal.String === \"\" || customReasonVal.String === null)) {\r\n\t\t\t\tthis.showValidationErrors(1);\r\n\t\t\t\treturn Promise.reject(\"Custom negative reason selected but not filled out.\");\r\n\t\t\t}\r\n\r\n\t\t\t// do api call here\r\n\t\t\tconst periods = this.resolve.periods\r\n\t\t\t\t.filter((p) => {\r\n\t\t\t\t\treturn p.Period.sortIndex >= this.beginPeriod.sortIndex && p.Period.sortIndex <= this.endPeriod.sortIndex;\r\n\t\t\t\t})\r\n\t\t\t\t.map(p => ({ Id: p.Period.Id }));\r\n\r\n\t\t\tconst negative = {\r\n\t\t\t\tEntityId: this.resolve.entityId,\r\n\t\t\t\tFormId: this.resolve.form.Id,\r\n\t\t\t\tPeriods: periods,\r\n\t\t\t\tFields: updates\r\n\t\t\t};\r\n\r\n\t\t\tconst apiCall = this.api\r\n\t\t\t\t.post(`api/forms/${this.resolve.form.Id}/reports/negative`, negative)\r\n\t\t\t\t.then(response => {\r\n\t\t\t\t\treturn this.modalInstance.close(response);\r\n\t\t\t\t});\r\n\r\n\t\t\treturn this.loadingService.watch(apiCall);\r\n\t\t}\r\n\t}\r\n\r\n\tonBeginUpdate() {\r\n\t\tconst index = findIndex(this.resolve.periods, p => p.Period.Id === this.beginPeriod.Id);\r\n\t\tthis.endPeriods = this.resolve.periods.filter((p, i) => i >= index);\r\n\t}\r\n\r\n\tonEndUpdate() {\r\n\t\tconst index = findIndex(this.resolve.periods, p => p.Period.Id === this.endPeriod.Id);\r\n\t\tthis.beginPeriods = this.resolve.periods.filter((p, i) => i <= index);\r\n\t}\r\n\r\n\thandleCancel() {\r\n\t\tthis.modalInstance.dismiss(\"instance dismiss\");\r\n\t}\r\n\r\n\tshowValidationErrors(numErrors) {\r\n\t\tconst errors = [...VALIDATION_OPERATORS];\r\n\r\n\t\tforEach(errors, e => {\r\n\t\t\tif(e.code === \"BLOCKSAVE\") {\r\n\t\t\t\te.rules = fill(Array(numErrors),\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvalidationScope: { \"Code\": \"NEGATIVE\" },\r\n\t\t\t\t\t\tScope: { \"Code\": \"NEGATIVE\" },\r\n\t\t\t\t\t\tId: 0,\r\n\t\t\t\t\t\tTitle: \"All fields are required\"\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.validations = errors;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.negative-report-modal\", [])\r\n\t.component(\"negativeReportModal\", {\r\n\t\tcontroller: NegativeReportModalController,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\tFile Negatives\\r\\n\\t\\r\\n
    \\r\\n\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\t\\r\\n\\t\\r\\n\\r\\n
    \\r\\n\\tCancel\\r\\n\\tFile Negative\\r\\n
    \\r\\n\";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\n\r\n//terms\r\nexport function controller() {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\r\n\tfunction onInit() {\r\n\t}\r\n}\r\n\r\nexport const singleExportDetail = angular\r\n\t.module(\"vesl.components.single-export-detail\", [])\r\n\t.component(\"singleExportDetail\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\texport: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\tExport {{$ctrl.export.Id}} at {{$ctrl.export.Log.Created | date: 'MM-dd-yyyy HH:mm'}}\\r\\n
    \\r\\n
    \\r\\n\\t 0\\\"\\r\\n\\t>\\r\\n\\t\\t
  • \\r\\n\\t\\t\\t{{error.Error}}\\r\\n\\t\\t
  • \\r\\n\\t\\r\\n
    \";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\nimport { groupBy } from \"lodash\";\r\nimport moment from \"moment\";\r\n\r\n//terms\r\nfunction controller($scope, eventBus, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.handleClose = handleClose;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = handleClose;\r\n\tctrl.showMore = {};\r\n\r\n\tfunction onInit() {\r\n\t\teventBus.register(EVENT_LOGOUT, () => { handleClose(); }, $scope);\r\n\r\n\t\tctrl.exportsByConfiguration = groupBy(ctrl.resolve.exports, e => (e.Log.Configuration.Name ?? e.Log.Configuration.Code));\r\n\t\tObject.values(ctrl.exportsByConfiguration)\r\n\t\t\t.forEach(exports => {\r\n\t\t\t\texports.forEach(e => {\r\n\t\t\t\t\tconst result = e.IsCommitted === true \r\n\t\t\t\t\t\t? { statusClass: \"zmdi-check-square bfd-dark-green\", statusText: \"Committed\" }\r\n\t\t\t\t\t\t: e.IsCommitted === false || e.IsSuppressed === true\r\n\t\t\t\t\t\t\t? { statusClass: \"zmdi-alert-triangle text-danger\", statusText: \"Error\" }\r\n\t\t\t\t\t\t\t: { statusClass: \"zmdi-info bfd-caution\", statusText: \"Pending\" };\r\n\r\n\t\t\t\t\te.statusClass = result.statusClass;\r\n\t\t\t\t\te.statusText = result.statusText;\r\n\t\t\t\t});\r\n\t\t\t\t(exports ?? []).sort((a, b) => moment(a.Log.Created).isAfter(moment(b.Log.Created)) ? -1 : 1); \r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction handleClose() {\r\n\t\tctrl.modalInstance.close();\r\n\t}\r\n}\r\n\r\nexport { singleExportDetail } from \"./single-export-detail\";\r\nexport const exportInformationModal = angular\r\n\t.module(\"vesl.components.export-information\", [])\r\n\t.component(\"exportInformation\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t

    \\r\\n\\t\\tReport Export Information\\r\\n\\t

    \\r\\n
    \\r\\n\\r\\n\\t

    Export Summary

    \\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t
    \\r\\n\\t\\t\\t\\t\\tConfiguration\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tDate\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tStatus\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tErrors\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t{{export[0].Log.Configuration.Code}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{export[0].Log.Created | date: 'MM-dd-yyyy HH:mm' : 'UTC'}} UTC\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t {{export[0].statusText}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{export[0].Errors !== undefined ? export[0].Errors.length : '--'}}\\r\\n\\t\\t\\t\\t
    \\r\\n\\t

    Export Details

    \\r\\n\\t\\r\\n\\t\\t

    {{config[0].Log.Configuration.Name || config[0].Log.Configuration.Code}} Details

    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tShow more {{config[0].Log.Configuration.Name || config[0].Log.Configuration.Code}} exports \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t 0\\\"\\r\\n\\t\\t\\t\\t\\texport=\\\"exportConfig\\\"\\r\\n\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tHide \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t

    Legend

    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t Success\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t Pending\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t Error\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\r\\n
    \\r\\n\\tClose\\r\\n
    \";","import entities from \"./entities/index.js\";\r\nimport environmentNotifier from \"./environment-notifier/index.js\";\r\nimport changePasswordModal from \"./change-password-modal/change-password-modal.js\";\r\nimport choicesSelect from \"./choices-select/choices-select\";\r\nimport effectiveRangeActions from \"./effective-range-actions/effective-range-actions.js\";\r\nimport formSelector from \"./form-selector/form-selector.js\";\r\nimport formSelectorModal from \"./form-selector/form-selector-modal/form-selector-modal.js\";\r\nimport loadingTracker from \"./loading-tracker/index.js\";\r\nimport ieOverlay from \"./ie-overlay/ie-overlay.js\";\r\nimport messageNotifications from \"./message-notifications/message-notifications\";\r\nimport messageNotification from \"./message-notification/message-notification\";\r\nimport messageListItem from \"./message-list-item/message-list-item\";\r\nimport messageBubble from \"./message-bubble/message-bubble\";\r\nimport reportingEntitySelector from \"./reporting-entity-selector/reporting-entity-selector.js\";\r\nimport reportDetails from \"./report-details/report-details.js\";\r\nimport reportDetailsModal from \"./report-details/report-details-modal/report-details-modal.js\";\r\nimport reportActions from \"./report-actions/report-actions.js\";\r\nimport inventoryActions from \"./inventory-actions/inventory-actions.js\";\r\nimport inventoryQuantityModal from \"./inventory-actions/quantity-modal/quantity-modal.js\";\r\nimport reportForm from \"./report-form/report-form.js\";\r\nimport reportStatus from \"./report-status/index.js\";\r\nimport exportStatus from \"./export-status/index.js\";\r\nimport pagination from \"./pagination/index.js\";\r\nimport userProfile from \"./user/user-profile/index.js\";\r\nimport userEntities from \"./user/user-entities/user-entities.js\";\r\nimport userForm from \"./user/user-form/user-form.js\";\r\nimport userModal from \"./user/user-modal/user-modal.js\";\r\nimport userRequests from \"./user/user-requests/user-requests.js\";\r\nimport userEntityAssociation from \"./user/user-entities/user-entity-association/user-entity-association.js\";\r\nimport supportInfo from \"./support-info/index.js\";\r\nimport {\r\n\tnoticesFlyout, \r\n\tnoticeBanner \r\n} from \"./notices\";\r\nimport tieredSelect from \"./tiered-select/tiered-select.js\";\r\nimport validationCallout from \"./validation-callout/validation-callout.js\";\r\nimport compliancePeriodMessage from \"./compliance-period-message.js\";\r\nimport helpers from \"./field-helpers/selection-lookup.js\";\r\nimport requireRole from \"./require-role.js\";\r\nimport dateRangeSelector from \"./date-range-selector/date-range-selector.js\";\r\nimport exportConfigurationSelector from \"./export-configuration-selector/export-configuration-selector.js\";\r\nimport dateTimePicker from \"./date-time-picker/date-time-picker.js\";\r\nimport actionInfoBlock from \"./action-info-block\";\r\n\r\nimport terms from \"./modals/terms-modal/index.js\";\r\nimport accessibilityModal from \"./modals/accessibility-modal/accessibility-modal.js\";\r\nimport settingsModal from \"./modals/settings-modal/settings-modal.js\";\r\nimport supportFeedback from \"./modals/support-feedback-modal/index.js\";\r\nimport remoteSupport from \"./modals/remote-support-modal/index.js\";\r\nimport privacy from \"./modals/privacy-policy-modal/index.js\";\r\nimport deletion from \"./modals/account-deletion-modal/index.js\";\r\nimport primarySelector from \"./modals/primary-selector-modal/primary-selector.js\";\r\nimport buildInformationModal from \"./modals/build-information-modal/index.js\";\r\nimport cardSwipeModal from \"./modals/card-swipe-modal/card-swipe-modal.js\";\r\nimport proxyModal from \"./modals/proxy-modal/proxy-modal.js\";\r\nimport negativeReportModal from \"./modals/negative-report-modal/negative-report-modal.js\";\r\nimport * as exportInformationModals from \"./modals/export-information-modal\";\r\nimport formAcceptanceModal from \"./modals/form-acceptance-modal\";\r\n\r\nconst deps = [\r\n\tactionInfoBlock,\r\n\taccessibilityModal,\r\n\tbuildInformationModal,\r\n\tchangePasswordModal,\r\n\tchoicesSelect,\r\n\tcompliancePeriodMessage,\r\n\tdateRangeSelector,\r\n\tdateTimePicker,\r\n\tentities,\r\n\tenvironmentNotifier,\r\n\tformSelector,\r\n\tformSelectorModal,\r\n\thelpers,\r\n\tieOverlay,\r\n\tloadingTracker,\r\n\tmessageNotifications,\r\n\tmessageNotification,\r\n\tmessageListItem,\r\n\tmessageBubble,\r\n\tpagination,\r\n\tprimarySelector,\r\n\tprivacy,\r\n\tremoteSupport,\r\n\treportActions,\r\n\treportDetails,\r\n\treportDetailsModal,\r\n\treportForm,\r\n\treportingEntitySelector,\r\n\treportStatus,\r\n\trequireRole,\r\n\tsupportFeedback,\r\n\tsupportInfo,\r\n\tterms,\r\n\ttieredSelect,\r\n\tuserProfile,\r\n\tuserEntities,\r\n\tuserForm,\r\n\tuserModal,\r\n\tuserRequests,\r\n\tuserEntityAssociation,\r\n\tvalidationCallout,\r\n\tsettingsModal,\r\n\tcardSwipeModal,\r\n\tproxyModal,\r\n\tnegativeReportModal,\r\n\tformAcceptanceModal,\r\n\tnoticesFlyout,\r\n\tnoticeBanner,\r\n\tdeletion,\r\n\texportStatus,\r\n\tinventoryActions,\r\n\tinventoryQuantityModal,\r\n\texportConfigurationSelector,\r\n\teffectiveRangeActions,\r\n\t...Object.values(exportInformationModals)\r\n];\r\n\r\nexport default angular.module(\"vesl.components\", deps).name;\r\n","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\nimport marked from \"marked\";\r\n\r\nexport function controller($scope, eventBus, $logger, $sce) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = this.accept;\r\n\r\n\tfunction onInit() {\r\n\t\teventBus.register(EVENT_LOGOUT, () => { this.accept(); }, $scope);\r\n\r\n\t\tctrl.formAcceptance = $sce.trustAsHtml(marked(ctrl.resolve?.nomenclature?.FormUseAcceptance));\r\n\t}\r\n\r\n\tctrl.decline = () => {\r\n\t\tctrl.modalInstance.dismiss();\r\n\t};\r\n\r\n\tctrl.accept = (shouldPersistAcceptance = false) => {\r\n\t\tctrl.modalInstance.close(shouldPersistAcceptance);\r\n\t};\r\n\r\n\tctrl.acceptAlways = () => {\r\n\t\tctrl.accept(true);\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.form-acceptance-modal\", [])\r\n\t.component(\"formAcceptanceModal\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\tForm Use Acceptance\\r\\n\\t\\r\\n
    \\r\\n\\r\\n\\t\\r\\n\\r\\n
    \\r\\n\\tDecline\\r\\n\\tAccept\\r\\n\\tAccept Always\\r\\n
    \";","export default angular.module(\"vesl.filters.capitalize\", [])\r\n\t.filter(\"capitalize\", function() {\r\n\t\treturn function(code) {\r\n\t\t\tif(!code) {\r\n\t\t\t\treturn code; \r\n\t\t\t}\r\n \r\n\t\t\t// Capitalize the first character and lowercase the rest\r\n\t\t\treturn code.charAt(0).toUpperCase() + code.slice(1).toLowerCase();\r\n\t\t};\r\n\t})\r\n\t.name;","import moment from \"moment\";\r\nimport { pluralize } from \"humanize-plus\";\r\n\r\nconst localTimeFilter = () => utcDateString => moment(new Date(utcDateString)).format(\"MM-DD-YYYY h:mm a\");\r\n\r\nconst fromNowFilter = () => utcDateString => {\r\n\tif(utcDateString) {\r\n\t\treturn moment(new Date(utcDateString)).fromNow();\r\n\t}\r\n\r\n\treturn \"Never\";\r\n};\r\n\r\nfunction moreIndicatorFilter($filter) {\r\n\treturn (collection, limit) => {\r\n\t\tconst modified = collection.map(x => {\r\n\t\t\tif(collection.length >= limit) {\r\n\t\t\t\tx._more = collection.length - limit;\r\n\t\t\t} else {\r\n\t\t\t\tx._more = 0;\r\n\t\t\t}\r\n\t\t\treturn x;\r\n\t\t});\r\n\t\treturn $filter(\"limitTo\")(modified, limit);\r\n\t};\r\n}\r\n\r\nfunction pluralizeFilter() {\r\n\treturn (display, count, includeCount) => {\r\n\r\n\t\tconst value = pluralize(count, display);\r\n \r\n\t\tif(includeCount)\r\n\t\t\treturn `${count} ${value}`;\r\n\r\n\t\treturn value;\r\n\t};\r\n}\r\n\r\nexport function fullNameFilter() {\r\n\treturn (contact) => {\r\n\r\n\t\tlet name = contact.FirstName;\r\n\r\n\t\tif(contact.MiddleName)\r\n\t\t\tname += ` ${contact.MiddleName}`;\r\n\r\n\t\tif(contact.LastName)\r\n\t\t\tname += ` ${contact.LastName}`;\r\n\r\n\t\tif(contact.Suffix)\r\n\t\t\tname += ` ${contact.Suffix}`;\r\n\r\n\t\treturn name;\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.filters.legacy\", [])\r\n\t.filter(\"moreIndicator\", moreIndicatorFilter) // I don't think this is in use\r\n\t.filter(\"localTime\", localTimeFilter) // I don't think this is in use\r\n\t.filter(\"pluralize\", pluralizeFilter) // I don't think this is in use\r\n\t.filter(\"fromNow\", fromNowFilter)\r\n\t.filter(\"fullName\", fullNameFilter).name;","function formatChargeFilter() {\r\n\treturn function(fee) {\r\n\t\tif(!fee || fee.Value === undefined) {\r\n\t\t\treturn fee; \r\n\t\t}\r\n\r\n\t\tif(fee.Type.Code === \"PERCENT\") {\r\n\t\t\treturn `${fee.Value}%`;\r\n\t\t} \r\n\t\telse if(fee.Type.Code === \"FLAT\") {\r\n\t\t\treturn `$${fee.Value}`; \r\n\t\t}\r\n\t\treturn fee.Value;\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.filters.formatCharge\", [])\r\n\t.filter(\"formatCharge\", formatChargeFilter)\r\n\t.name;","function formatE164Phone() {\r\n\treturn function(input) {\r\n\t\tif(!input) {\r\n\t\t\treturn input; \r\n\t\t}\r\n \r\n\t\tconst cleaned = input.substring(3);\r\n\r\n\t\treturn `(${cleaned.substring(0, 3)}) ${cleaned.substring(3, 6)}-${cleaned.substring(6)}`;\r\n\t};\r\n}\r\n\r\nfunction parseIntoE164Phone() {\r\n\treturn {\r\n\t\trestrict: \"A\",\r\n\t\trequire: \"ngModel\",\r\n\t\tlink: function(scope, element, attrs, ngModel) {\r\n\t\t\tngModel.$parsers.push(function(value) {\r\n\t\t\t\tif(!value) {\r\n\t\t\t\t\treturn value; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst cleaned = value.replace(/\\D/g, \"\");\r\n\t\t\t\tif(cleaned.length === 10) {\r\n\t\t\t\t\treturn \"+1 \" + cleaned;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn value;\r\n\t\t\t});\r\n\r\n\t\t\tngModel.$formatters.push(function(value) {\r\n\t\t\t\tif(!value) {\r\n\t\t\t\t\treturn value; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst cleaned = value.substring(3);\r\n\t\t\t\t\r\n\t\t\t\treturn `(${cleaned.substring(0, 3)}) ${cleaned.substring(3, 6)}-${cleaned.substring(6)}`;\r\n\t\t\t});\r\n\t\t}\t\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.filters.formatE164Phone\", [])\r\n\t.filter(\"formatE164Phone\", formatE164Phone)\r\n\t.directive(\"phoneNumber\", parseIntoE164Phone)\r\n\t.name;","import capitalize from \"./capitalize\";\r\nimport filters from \"./filters\";\r\nimport formatCharge from \"./formatCharge\";\r\nimport phoneFormatter from \"./formatE164Phone\";\r\n\r\nconst deps = [\r\n\tfilters,\r\n\tphoneFormatter,\r\n\tformatCharge,\r\n\tcapitalize\r\n];\r\n\r\nexport default angular.module(\"vesl.filters\", deps).name;","import \"./index.less\";\r\nimport template from \"./index.html\";\r\n\r\nfunction controller() {}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.public.privacy\", [])\r\n\t.component(\"privacy\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n
    \";","import \"./index.less\";\r\nimport template from \"./index.html\";\r\n\r\nfunction controller() {}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.public.deletion\", [])\r\n\t.component(\"deletion\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n
    \";","export default \"
    \\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t

    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n
    \";","import \"./index.less\";\r\nimport template from \"./index.html\";\r\n\r\nfunction controller(\r\n\t$state,\r\n\topenIdService\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tconst mgr = openIdService.oidcProvider;\r\n\t\tconst fromRoute = openIdService.getFromRoute();\r\n\r\n\t\tmgr.signinRedirectCallback().then(() => {\r\n\t\t\tif(fromRoute) {\r\n\t\t\t\t$state.transitionTo(fromRoute.name, fromRoute.params, { location: \"replace\", reload: \"authenticated.dashboard\" });\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$state.transitionTo(\"authenticated.dashboard\", {}, { location: \"replace\", reload: \"authenticated.dashboard\" });\r\n\t\t\t}\r\n\t\t}, () => {\r\n\t\t\t$state.transitionTo(\"authenticated.dashboard\", {}, { location: \"replace\", reload: \"authenticated.dashboard\" });\r\n\t\t});\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.public.oauth-login\", [])\r\n\t.component(\"oauthLogin\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","import \"./index.less\";\r\nimport template from \"./index.html\";\r\n\r\nfunction controller(\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = () => {\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.public.oauth-splash\", [])\r\n\t.component(\"oauthSplash\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","import \"./index.less\";\r\nimport template from \"./index.html\";\r\n\r\nfunction controller(\r\n\t$logger, \r\n\t$userProfile, \r\n\tappState, \r\n\t$stateParams, \r\n\topenIdService, \r\n\t$uibModal,\r\n\t$window\r\n) {\r\n\tconst ctrl = this;\r\n\tctrl.appState = appState;\r\n\tctrl.openModal = openModal;\r\n\tctrl.signOut = signOut;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tconst user = $userProfile.getUserProfile();\r\n\t\t$logger.error(\"route failed\", {\r\n\t\t\tuser,\r\n\t\t\tformId: (appState.forms.selected || {}).Id,\r\n\t\t\terrorMessage: $stateParams.errorMsg\r\n\t\t});\r\n\r\n\t\tif(typeof $stateParams.errorMsg === \"string\" || $stateParams.errorMsg instanceof String) {\r\n\t\t\tctrl.errorMsg = $stateParams.errorMsg;\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.reload = () => {\r\n\t\t$window.location.reload();\r\n\t};\r\n\r\n\tfunction openModal() {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"form-selector-modal\",\r\n\t\t\tsize: \"md\"\r\n\t\t});\r\n\t}\r\n\r\n\tfunction signOut() {\r\n\t\topenIdService.getUserManager().signoutRedirect();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.public.failedRoute\", [])\r\n\t.component(\"failedRoute\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","import privacy from \"./privacy/index.js\";\r\nimport deletion from \"./account-deletion/index.js\";\r\nimport oauthRedirect from \"./oauth-login/redirect\";\r\nimport oauthSplash from \"./oauth-login/splash\";\r\nimport oops from \"./failed-route/index.js\";\r\n\r\nconst deps = [\r\n\tprivacy,\r\n\toauthRedirect,\r\n\toauthSplash,\r\n\toops, \r\n\tdeletion\r\n];\r\n\r\nexport default angular.module(\"vesl.screens.public\", deps).name;\r\n","export default \"
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t

    Oops! Something went wrong.

    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t

    {{$ctrl.errorMsg}}

    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t Retry? \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t 1\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\ttype=\\\"button\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\tclass=\\\"btn btn-default btn-sm\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\ton-trigger=\\\"$ctrl.openModal()\\\"\\r\\n\\t\\t\\t\\t\\t\\t> Switch forms \\r\\n\\t\\t\\t\\t\\t\\tSign out\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\";","import moment from \"moment\";\r\nimport { pluralize } from \"humanize-plus\";\r\nimport cloneDeep from \"clone-deep\";\r\n\r\nimport {\r\n\tEVENT_NEW_REPORTING_ENTITY,\r\n\tFEATURE_TYPES,\r\n\tCLASSIFICATION_TYPES,\r\n\tIDENTIFIER_TYPES\r\n} from \"constants.js\";\r\nimport \"./compliance.less\";\r\nimport template from \"./compliance.html\";\r\nimport {\r\n\tsortBy,\r\n\tslice,\r\n\tfind,\r\n\tfindIndex,\r\n\tfilter,\r\n\tforEach,\r\n\tsome,\r\n\tsize,\r\n\treduce,\r\n\tuniqWith,\r\n\tkeyBy\r\n} from \"lodash\";\r\nimport vis from \"vis\";\r\nimport \"vis/dist/vis-timeline-graph2d.min.css\";\r\nimport { NEW_REPORT } from \"routes\";\r\nimport { getSeasonsByEffectiveRanges } from \"../../utils/getSeasonsByEffectiveRanges\";\r\nimport { isPeriodInEffectiveRanges } from \"../../utils/effectiveRanges\";\r\n\r\nconst periodNameMapper = {\r\n\t\"January\": \"Jan\",\r\n\t\"February\": \"Feb\",\r\n\t\"March\": \"Mar\",\r\n\t\"April\": \"Apr\",\r\n\t\"June\": \"June\",\r\n\t\"July\": \"July\",\r\n\t\"August\": \"Aug\",\r\n\t\"September\": \"Sept\",\r\n\t\"October\": \"Oct\",\r\n\t\"November\": \"Nov\",\r\n\t\"December\": \"Dec\"\r\n};\r\n\r\n// compliance\r\nfunction controller(\r\n\t$scope,\r\n\t$timeout,\r\n\t$uibModal,\r\n\t$logger,\r\n\tappState,\r\n\tapi,\r\n\teventBus,\r\n\tloadingService,\r\n\treportHelper,\r\n\ttoastr,\r\n\tentityManager,\r\n\ttimezoneService,\r\n\t$featureFlags\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tconst complianceClasses = {\r\n\t\tcaution: \"caution\",\r\n\t\tcompliant: \"compliant\",\r\n\t\tdanger: \"danger\",\r\n\t\topen: \"open\",\r\n\t\tnotStarted: \"not-started\",\r\n\t\tnotOpened: \"not-opened\",\r\n\t\topenNotStartedNoneSubmitted: \"open-not-started-none-submitted\"\r\n\t};\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.fileNegative = fileNegative;\r\n\tctrl.deleteNegative = deleteNegative;\r\n\tctrl.getFormattedOpenDate = getFormattedOpenDate;\r\n\tctrl.getEmptyTableString = getEmptyTableString;\r\n\tctrl.getComplianceIcon = getComplianceIcon;\r\n\tctrl.getComplianceColor = getComplianceColor;\r\n\tctrl.setSelectedReportingIndex = setSelectedReportingIndex;\r\n\tctrl.updateSeason = updateSeason;\r\n\tctrl.tlSkipBack = tlSkipBack;\r\n\tctrl.tlSkipNext = tlSkipNext;\r\n\tctrl.tlZoomIn = tlZoomIn;\r\n\tctrl.tlZoomOut = tlZoomOut;\r\n\r\n\tctrl.tableWidthCss = \"col-sm-9\";\r\n\tctrl.isAlertSummaryExpanded = window.innerWidth > 768;\r\n\tctrl.timelineRange = undefined;\r\n\tctrl.cachedReports = [];\r\n\tctrl.alertSummaries = [];\r\n\tctrl.showAllAlerts = false;\r\n\tctrl.alertSummaryShowCount = 5;\r\n\tctrl.orderedTableIds = [];\r\n\tctrl.currentSeason = null;\r\n\tctrl.selectedSeason = null;\r\n\tctrl.seasons = []; // this is used in season dropdown mode only\r\n\r\n\tctrl.NEW_REPORT = NEW_REPORT;\r\n\tctrl.featureFlagCompliance = $featureFlags.getFeature($featureFlags.FEATURES.ComplianceTimeline);\r\n\r\n\r\n\tctrl.complianceIcons = {\r\n\t\tcompliant: {\r\n\t\t\ticon: \"zmdi-assignment-check\",\r\n\t\t\tlabel: \"Period is compliant\"\r\n\t\t},\r\n\t\tpastDeadline: {\r\n\t\t\ticon: \"zmdi-assignment-alert\",\r\n\t\t\tlabel: \"Period is out of compliance and past the deadline\"\r\n\t\t},\r\n\t\tended: {\r\n\t\t\ticon: \"zmdi-assignment-alert\",\r\n\t\t\tlabel: \"Period is out of compliance but not past deadline\"\r\n\t\t},\r\n\t\tnotOpened: {\r\n\t\t\ticon: \"zmdi-block\",\r\n\t\t\tlabel: \"Not opened\"\r\n\t\t},\r\n\t\topen: {\r\n\t\t\ticon: \"zmdi-forward\",\r\n\t\t\tlabel: \"Period is open for filing\"\r\n\t\t},\r\n\t\topenNotCurrent: {\r\n\t\t\ticon: \"zmdi-circle-o\",\r\n\t\t\tlabel: \"Open, not current\"\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.complianceStatusColors = {\r\n\t\tcompliant: \"bfd-green\",\r\n\t\tperiodNotOpen: \"bfd-dark-grey\",\r\n\t\tperiodNotStarted: \"bfd-grey\",\r\n\t\tpastDeadline: \"text-danger\",\r\n\t\tperiodEndedWithNoReports: \"bfd-caution\",\r\n\t\tcurrentPeriodWithNoReports: \"bfd-light-blue\"\r\n\t};\r\n\r\n\tconst defaultComplianceTable = {\r\n\t\tseasons: [],\r\n\t\tdata: [],\r\n\t\tactions: {},\r\n\t\tsort: {\r\n\t\t\tpredicate: \"Period.BeginInclusive\",\r\n\t\t\tdirection: \"asc\"\r\n\t\t},\r\n\t\tgrid: {\r\n\t\t\tpaginationOptions:\r\n\t\t\t{\r\n\t\t\t\titemsPerPage: \"13\",\r\n\t\t\t\tcurrentPage: 1\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.paginationOptions = { itemsPerPage: \"13\", currentPage: 1 };\r\n\tctrl.complianceTables = {};\r\n\tctrl.pageSizes = [\r\n\t\t8, 12, 13, 26, 30, 52\r\n\t];\r\n\tctrl.selectedReportIndex = \"\";\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.showTimeline = (ctrl.form.Features.filter(feature => feature.Type === FEATURE_TYPES.advancedCompliance)\r\n\t\t\t.length > 0)\r\n\t\t\t&& ctrl.featureFlagCompliance;\r\n\t\tctrl.seasons = appState.forms.selected.Seasons;\r\n\t\tctrl.permissions = appState.permissions;\r\n\r\n\t\tctrl.negativeFields = ctrl.form.Fields.filter(f => !!f.IsNegative);\r\n\r\n\t\teventBus.register(EVENT_NEW_REPORTING_ENTITY, () => {\r\n\t\t\tconst newEntity = entityManager.getSelectedEntity();\r\n\t\t\tconst promise = updateReportingEntitySelector(cloneDeep(newEntity.friendly));\r\n\t\t\tloadingService.watch(promise);\r\n\t\t}, $scope);\r\n\r\n\t\t// this is used instead of checking ctrl.isMobile, since that isn't reliably initialized at this point\r\n\t\tctrl.legendIsExpanded = window.innerWidth > 768;\r\n\t}\r\n\r\n\tfunction configureVis() {\r\n\t\tconst groups = [];\r\n\t\tlet data = [];\r\n\r\n\t\tconst visibleSeasons = ctrl.cachedReports\r\n\t\t\t.filter(\r\n\t\t\t\tx =>\r\n\t\t\t\t\tctrl.timelineRange.end.isSameOrAfter(\r\n\t\t\t\t\t\tx.beginInclusive\r\n\t\t\t\t\t) ||\r\n\t\t\t\t\tctrl.timelineRange.start.isBefore(x.endExclusive)\r\n\t\t\t)\r\n\t\t\t.map(x => x.seasonId);\r\n\r\n\t\tfilter(ctrl.complianceTables,\r\n\t\t\ttable =>\r\n\t\t\t\tvisibleSeasons.some(visibleSeasonId =>\r\n\t\t\t\t\ttable.seasons.some(\r\n\t\t\t\t\t\tseasonId => seasonId === visibleSeasonId\r\n\t\t\t\t\t))\r\n\t\t).forEach(table => {\r\n\t\t\tconst group = { id: table.id, content: `${table.name}` };\r\n\t\t\tgroups.push(group);\r\n\r\n\t\t\tconst results = table.data.map(x => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tid: x.entityPeriodIndex,\r\n\t\t\t\t\tcontent: periodNameMapper[x.Period.Name] || x.Period.Name,\r\n\t\t\t\t\tstart: x.Period.BeginInclusive,\r\n\t\t\t\t\tend: x.Period.EndExclusive,\r\n\t\t\t\t\tgroup: group.id,\r\n\t\t\t\t\tclassName: getComplianceClassName(x)\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tdata = [\r\n\t\t\t\t...data,\r\n\t\t\t\t...results\r\n\t\t\t];\r\n\t\t});\r\n\r\n\t\tif(size(ctrl.complianceTables) > 0) {\r\n\t\t\tctrl.complianceTables[ctrl.orderedTableIds[0]].isExpanded = true;\r\n\t\t}\r\n\t\tconst items = new vis.DataSet(data);\r\n\r\n\t\tif(!ctrl.timeline) {\r\n\t\t\tinitializeTimeline(ctrl, items, groups);\r\n\t\t} else {\r\n\t\t\tctrl.timeline.setGroups(groups);\r\n\t\t\tctrl.timeline.setItems(items);\r\n\t\t\t$timeout(() => {\r\n\t\t\t\t$scope.$apply();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfunction deleteNegative(item, entityId) {\r\n\t\tconst promise = reportHelper.delete(ctrl.form.Id, item.Negative)\r\n\t\t\t.then(() => {\r\n\t\t\t\tconst thisTable = ctrl.complianceTables[entityId];\r\n\r\n\t\t\t\tfor(let i = 0; i < thisTable.data.length; i++) {\r\n\t\t\t\t\tconst dataItem = { ...thisTable.data[i] };\r\n\t\t\t\t\tif(dataItem.Period.Id === item.Period.Id) {\r\n\t\t\t\t\t\tdataItem.Compliant = item.Submitted > 0;\r\n\t\t\t\t\t\tdataItem.Negative = null;\r\n\t\t\t\t\t\tthisTable.data[i] = dataItem;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tupdateTableDataRangeToTimeline();\r\n\r\n\t\t\t\tupdateAlertSummaries();\r\n\t\t\t\tctrl.showTimeline && configureVis();\r\n\t\t\t});\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction fileNegative(item, entityId) {\r\n\t\tif(item.Pending > 0) {\r\n\t\t\ttoastr.error(`A conflicting ${ctrl.form.nomenclature.PositiveReport} has been found. Unable to file a ${ctrl.form.nomenclature.NegativeReport} unless\r\n\t\t\t\t\t\t\tthis ${ctrl.form.nomenclature.PositiveReport} is deleted.`);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst selectedEntity = find(ctrl.licenses, l => l.key === entityId);\r\n\r\n\t\tconst isSelectedEntityHMS = !!selectedEntity && selectedEntity.classifications\r\n\t\t\t&& some(selectedEntity.classifications, c => c.Code === CLASSIFICATION_TYPES.TUNA\r\n\t\t\t\t|| c.Code === CLASSIFICATION_TYPES.SWORDFISH\r\n\t\t\t\t|| c.Code === CLASSIFICATION_TYPES.SHARK);\r\n\r\n\t\tif(ctrl.negativeFields.length > 0 && !!selectedEntity && isSelectedEntityHMS) {\r\n\t\t\tconst clickedTable = this.complianceTables[entityId];\r\n\t\t\tconst thisPeriodIndex = findIndex(clickedTable.data, d => d.Period.Id === item.Period.Id);\r\n\t\t\tconst consecutivePeriods = findConsecutivePeriods(clickedTable.data, thisPeriodIndex, (item) => {\r\n\t\t\t\treturn !item.Compliant && !item.Negative && item.Pending === 0 && item.hasOpened && !item.hasClosed;\r\n\t\t\t});\r\n\r\n\t\t\tconst firstIndexOffset = findIndex(clickedTable.data, p => p.Period.Id === consecutivePeriods[0].Period.Id);\r\n\t\t\tconst modal = fileNegativeModal(entityId, thisPeriodIndex - firstIndexOffset, consecutivePeriods);\r\n\t\t\tmodal.then(apiResponse => {\r\n\t\t\t\tconst thisTable = clickedTable;\r\n\t\t\t\tconst negatives = apiResponse;\r\n\r\n\t\t\t\tfor(let i = 0; i < thisTable.data.length; i++) {\r\n\t\t\t\t\tconst dataItem = { ...thisTable.data[i] };\r\n\t\t\t\t\tconst newNegative = find(negatives, n => n.Periods[0].Id === dataItem.Period.Id);\r\n\r\n\t\t\t\t\tif(!!newNegative) {\r\n\t\t\t\t\t\tdataItem.Compliant = true;\r\n\t\t\t\t\t\tdataItem.Negative = newNegative;\r\n\t\t\t\t\t\tthisTable.data[i] = dataItem;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tupdateTableDataRangeToTimeline();\r\n\r\n\t\t\t\tupdateAlertSummaries();\r\n\t\t\t\tctrl.showTimeline && configureVis();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\tconst negative = {\r\n\t\t\t\tEntityId: entityId,\r\n\t\t\t\tFormId: ctrl.form.Id,\r\n\t\t\t\tPeriods: [{ Id: item.Period.Id }]\r\n\t\t\t};\r\n\r\n\t\t\tconst promise = api\r\n\t\t\t\t.post(`api/forms/${ctrl.form.Id}/reports/negative`, negative)\r\n\t\t\t\t.then(response => {\r\n\t\t\t\t\tconst thisTable = ctrl.complianceTables[entityId];\r\n\t\t\t\t\tconst negative = { Id: response[0].Id };\r\n\r\n\t\t\t\t\tfor(let i = 0; i < thisTable.data.length; i++) {\r\n\t\t\t\t\t\tconst dataItem = { ...thisTable.data[i] };\r\n\t\t\t\t\t\tif(dataItem.Period.Id === item.Period.Id) {\r\n\t\t\t\t\t\t\tdataItem.Compliant = true;\r\n\t\t\t\t\t\t\tdataItem.Negative = negative;\r\n\t\t\t\t\t\t\tthisTable.data[i] = dataItem;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tupdateTableDataRangeToTimeline();\r\n\r\n\t\t\t\t\tupdateAlertSummaries();\r\n\t\t\t\t\tctrl.showTimeline && configureVis();\r\n\t\t\t\t});\r\n\r\n\t\t\tloadingService.watch(promise);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction findConsecutivePeriods(data, startingIndex, filterCallback) {\r\n\t\tconst consecutiveData = [];\r\n\t\tfor(let i = startingIndex; i >= 0; i--) {\r\n\t\t\tconst isItemValid = filterCallback(data[i]);\r\n\t\t\tif(isItemValid) {\r\n\t\t\t\tconsecutiveData.unshift(data[i]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(let i = startingIndex + 1; i < data.length; i++) {\r\n\t\t\tconst isItemValid = filterCallback(data[i]);\r\n\t\t\tif(isItemValid) {\r\n\t\t\t\tconsecutiveData.push(data[i]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn consecutiveData;\r\n\t}\r\n\r\n\tfunction fileNegativeModal(entityId, initialIndex, multiplePeriods) {\r\n\t\tconst instance = $uibModal.open({\r\n\t\t\tcomponent: \"negative-report-modal\",\r\n\t\t\tsize: \"m\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\tform: () => ctrl.form,\r\n\t\t\t\tfields: () => ctrl.negativeFields,\r\n\t\t\t\tnomenclature: () => ctrl.form.nomenclature,\r\n\t\t\t\tperiods: () => multiplePeriods,\r\n\t\t\t\tstartPeriodIndex: () => initialIndex,\r\n\t\t\t\tentityId: () => entityId\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn instance.result;\r\n\t}\r\n\r\n\tfunction focusSelectedItem(item) {\r\n\t\treturn new Promise((resolve) => {\r\n\t\t\tctrl.timeline.moveTo(ctrl.timeline.itemsData._data[item].start, {}, () => {\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tctrl.timeline.setSelection([item]);\r\n\t\t\t\t\tresolve();\r\n\t\t\t\t}, 50);\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tfunction getComplianceClassName(item) {\r\n\t\treturn item.Compliant ? complianceClasses.compliant\r\n\t\t\t: item.hasOpened === false ? complianceClasses.notOpened\r\n\t\t\t: item.hasBegun === false && item.hasOpened ? complianceClasses.openNotStartedNoneSubmitted\r\n\t\t\t: item.hasBegun === false ? complianceClasses.notStarted\r\n\t\t\t: item.hasEnded === false ? complianceClasses.open \r\n\t\t\t: item.isPastDeadline === false ? complianceClasses.caution\r\n\t\t\t: complianceClasses.danger;\r\n\t}\r\n\r\n\tfunction getComplianceColor(item) {\r\n\t\treturn item.Compliant ? ctrl.complianceStatusColors.compliant\r\n\t\t\t: item.hasOpened === false ? ctrl.complianceStatusColors.periodNotOpen\r\n\t\t\t: item.hasBegun === false && item.hasOpened ? ctrl.complianceStatusColors.periodNotStarted\r\n\t\t\t: item.hasBegun === false ? ctrl.complianceStatusColors.periodNotStarted\r\n\t\t\t: item.hasEnded === false ? ctrl.complianceStatusColors.currentPeriodWithNoReports\r\n\t\t\t: item.isPastDeadline === false ? ctrl.complianceStatusColors.periodEndedWithNoReports\r\n\t\t\t: ctrl.complianceStatusColors.pastDeadline;\r\n\t}\r\n\r\n\tfunction getComplianceIcon(item, iconProp = \"icon\") {\r\n\t\treturn item.Compliant ? ctrl.complianceIcons.compliant[iconProp]\r\n\t\t: item.hasOpened === false ? ctrl.complianceIcons.notOpened[iconProp]\r\n\t\t: item.hasBegun === false && item.hasOpened ? ctrl.complianceIcons.openNotCurrent[iconProp]\r\n\t\t: item.hasBegun === false ? ctrl.complianceIcons.openNotCurrent[iconProp]\r\n\t\t: item.hasEnded === false ? ctrl.complianceIcons.open[iconProp]\r\n\t\t: item.isPastDeadline === false ? ctrl.complianceIcons.ended[iconProp]\r\n\t\t: ctrl.complianceIcons.pastDeadline[iconProp];\r\n\t}\r\n\r\n\tfunction getEmptyTableString() {\r\n\t\tconst primaryEntityFirstChar = ctrl.form.nomenclature.PrimaryEntity.substring(0, 1).toLowerCase();\r\n\t\tlet article = \"a\";\r\n\r\n\t\tif([\"a\", \"e\", \"i\", \"o\", \"u\"].indexOf(primaryEntityFirstChar) > -1) {\r\n\t\t\tarticle = \"an\";\r\n\t\t}\r\n\r\n\r\n\t\treturn `Please select ${article} ${ctrl.form.nomenclature.PrimaryEntity}`;\r\n\t}\r\n\r\n\tfunction getFormattedOpenDate(item) {\r\n\t\treturn moment(item.Period.OpensInclusive).local()\r\n\t\t\t.format(\"MM.DD.YYYY, hh:mm A\");\r\n\t}\r\n\r\n\tfunction setTimelineZoom(ctrl) {\r\n\t\tif(!(ctrl?.timeline?.itemsData))\r\n\t\t\treturn;\r\n\t\t\r\n\t\tconst data = ctrl.timeline.itemsData.get() ?? [];\r\n\r\n\t\tconst momentify = (period) => ({ \r\n\t\t\tstart: moment(period.start), \r\n\t\t\tend: moment(period.end) \r\n\t\t});\r\n\r\n\t\t//from a point, build a range with begin/end = +/-quantity*'scale' \r\n\t\tconst rangify = (at, quantity, scale) => ({ \r\n\t\t\tstart: at.clone().subtract(quantity, scale), \r\n\t\t\tend: at.clone().add(quantity, scale) \r\n\t\t});\r\n\r\n\t\t//determine the duration between two moments in a range\r\n\t\tconst durationOfRange = ({ start, end }) => ({ \r\n\t\t\tduration: end.clone()\r\n\t\t\t\t.subtract(start)\r\n\t\t\t\t.valueOf() \r\n\t\t});\r\n\t\t\t\r\n\t\tconst dataAtMoment = (at) => data?.filter(period => at.isBetween(moment(period.start), moment(period.end))) ?? [];\r\n\t\tconst dataInRange = ({ start, end }) => data?.filter(period => start.isSameOrBefore(moment(period.end)) && moment(period.start).isSameOrBefore(end)) ?? [];\r\n\t\t\r\n\t\tconst now = moment();\r\n\t\tconst minimumRange = rangify(now, 4, \"days\");\r\n\t\tconst fallbackRange = rangify(now, 6, \"months\");\r\n\r\n\t\t//find relevant data to base time window on\r\n\t\tlet inRangeData = dataAtMoment(now);\r\n\t\tif(!inRangeData.length) {\r\n\t\t\tfor(const scale of [\"days\", \"weeks\", \"months\", \"years\"]) {\r\n\t\t\t\tinRangeData = dataInRange(rangify(now, 3, scale));\r\n\t\t\t\tif(inRangeData.length)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//find the smallest window size for that data, or 6 months as default\r\n\t\tlet dataWindowSize = inRangeData.reduce((agg, period) => { \r\n\t\t\tconst { duration } = durationOfRange(momentify(period));\r\n\t\t\t\r\n\t\t\treturn duration > agg ? agg : duration;\r\n\t\t}, durationOfRange(fallbackRange).duration);\r\n\r\n\t\t//but not too small\r\n\t\tdataWindowSize = Math.max(durationOfRange(minimumRange).duration, dataWindowSize);\r\n\t\t\r\n\t\t//create a default window\r\n\t\t//data may not fit, if we had to find via scaling, came across days as smallest\r\n\t\t//scope to days, but days aren't close to current\r\n\t\tlet newWindow = rangify(now, dataWindowSize*3, \"milliseconds\");\r\n\t\tlet growth = 0;\r\n\t\twhile(!dataInRange(newWindow).length && ++growth < 20) {\r\n\t\t\tnewWindow = rangify(now, dataWindowSize * 3 * Math.pow(1.5, growth), \"milliseconds\");\r\n\t\t}\r\n\t\t1;\r\n\t\t\r\n\t\tctrl.timeline.setWindow(newWindow.start, newWindow.end);\r\n\t}\r\n\r\n\tfunction initializeTimeline(ctrl, items, groups) {\r\n\t\tif(!ctrl.container) {\r\n\t\t\tctrl.container = document.getElementById(\"complianceTimeline\");\r\n\t\t}\r\n\r\n\t\tctrl.timeline = new vis.Timeline(ctrl.container, items, groups, {\r\n\t\t\tstack: false,\r\n\t\t\tzoomMax: 96410000000,\t//~3 years\r\n\t\t\tzoomMin: 186400000,\t\t//~2 days\r\n\t\t\tmargin: {\r\n\t\t\t\titem: 10,\r\n\t\t\t\taxis: 5\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tctrl.timeline.on(\"click\", onTimelineItemClick);\r\n\t\tctrl.timeline.on(\"rangechanged\", onTimelineRangeChanged);\r\n\r\n\t\tupdateTableDataRangeToTimeline();\r\n\t}\r\n\r\n\tfunction loadComplianceReportForPrimary(primaryEntity) {\r\n\t\tconst entitySeasons = primaryEntity.rangeSeasons ?? ctrl.seasons;\r\n\t\tlet selectedSeasons = [];\r\n\r\n\t\tconst currentDate = moment();\r\n\r\n\t\tctrl.currentSeason = ctrl.seasons.filter((item) => currentDate.isSameOrAfter(item.BeginInclusive) && currentDate.isBefore(item.EndExclusive))[0];\r\n\r\n\t\tif(!ctrl.currentSeason) {\r\n\t\t\tctrl.currentSeason = entitySeasons[entitySeasons.length - 1];\r\n\t\t}\r\n\r\n\t\tif(!ctrl.selectedSeason) {\r\n\t\t\tctrl.selectedSeason = ctrl.currentSeason;\r\n\t\t\tctrl.lastSelectedSeasonId = ctrl.selectedSeason.Id;\r\n\t\t}\r\n\r\n\t\tif(ctrl.showTimeline) {\r\n\t\t\tselectedSeasons = entitySeasons\r\n\t\t\t\t.filter(season => {\r\n\t\t\t\t\tif(!ctrl.timelineRange) {\r\n\t\t\t\t\t\tctrl.timelineRange = {\r\n\t\t\t\t\t\t\tstart: ctrl.currentSeason ? moment(ctrl.currentSeason.BeginInclusive) : moment(season.BeginInclusive),\r\n\t\t\t\t\t\t\tend: ctrl.currentSeason ? moment(ctrl.currentSeason.EndExclusive) : moment(season.EndExclusive)\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst seasonIsBeforeFrame = moment(season.EndExclusive).isBefore(ctrl.timelineRange.start);\r\n\t\t\t\t\tconst seasonIsAfterFrame = moment(season.BeginInclusive).isAfter(ctrl.timelineRange.end);\r\n\r\n\t\t\t\t\treturn !seasonIsAfterFrame && !seasonIsBeforeFrame;\r\n\t\t\t\t})\r\n\t\t\t\t.sort((a, b) => {\r\n\t\t\t\t\tif(moment(a.EndExclusive).isSame(b.EndExclusive)) {\r\n\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t} else if(moment(a.EndExclusive).isAfter(b.EndExclusive)) {\r\n\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\tif(!selectedSeasons.length) {\r\n\t\t\t\tselectedSeasons = [ctrl.currentSeason];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tselectedSeasons = [ctrl.selectedSeason];\r\n\t\t}\r\n\r\n\t\tconst seasonPromises = [];\r\n\r\n\t\tselectedSeasons.forEach(season => {\r\n\t\t\tconst entityHasSeason = entitySeasons.map(s => s.Id).indexOf(season.Id) > -1;\r\n\r\n\t\t\tif(entityHasSeason) {\r\n\t\t\t\tconst promise = getComplianceSeasonForEntity(season, primaryEntity);\r\n\r\n\t\t\t\tseasonPromises.push(promise);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn Promise.all(seasonPromises);\r\n\t}\r\n\r\n\tfunction getComplianceSeasonForEntity(season, entity) {\r\n\t\tif(ctrl.showTimeline) {\r\n\t\t\tif(ctrl.cachedReports.some(x => x.entityName === entity.Name && x.seasonId === season.Id)) {\r\n\t\t\t\treturn Promise.resolve();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tctrl.cachedReports = [];\r\n\t\t}\r\n\r\n\t\tctrl.cachedReports.push({\r\n\t\t\tkey: `${entity.Name}~${season.Id}`,\r\n\t\t\tentityName: entity.Name,\r\n\t\t\tbeginInclusive: season.BeginInclusive,\r\n\t\t\tendExclusive: season.EndExclusive,\r\n\t\t\tseasonId: season.Id\r\n\t\t});\r\n\t\t\r\n\t\tconst url = `api/forms/${ctrl.form.Id}/entities/${entity.Id}/compliance/seasons/${season.Id}`;\r\n\r\n\t\tconst promise = api.get(url).then(unsorted => {\r\n\t\t\tconst filtered = unsorted.filter(r => \r\n\t\t\t\tentity.Effective?.length ? isPeriodInEffectiveRanges(r.Period, entity.Effective, season.Scope, ctrl.useFederalScopeOverride) : true\r\n\t\t\t);\r\n\t\t\tconst resp = sortBy(filtered, r => moment(r.Period.BeginInclusive).unix());\r\n\t\t\t\t\r\n\t\t\tconst now = moment();\r\n\r\n\t\t\tconst unfilteredTableData = resp.map((report) => {\r\n\t\t\t\tconst beginMoment = moment(report.Period.BeginInclusive);\r\n\t\t\t\tconst endMoment = moment(report.Period.EndExclusive);\r\n\r\n\t\t\t\tconst period = find(season.Periods, p => p.Id == report.Period.Id);\r\n\r\n\t\t\t\tif(period === undefined) {\r\n\t\t\t\t\t$logger.warn(\"Compliance Period not found in season\", { season, report, ranges: entity.Effective, unsorted, resp, entity });\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...report,\r\n\t\t\t\t\tentityPeriodIndex: `${entity.Id}~${report.Period.Id}`,\r\n\t\t\t\t\tCompliant: (report.Submitted > 0 || !!report.Negative),\r\n\t\t\t\t\thasOpened: report.Period.OpensInclusive ? now.isSameOrAfter(moment(report.Period.OpensInclusive)) : null,\r\n\t\t\t\t\thasClosed: report.Period.ClosesExclusive ? now.isAfter(moment(report.Period.ClosesExclusive)) : null,\r\n\t\t\t\t\thasEnded: report.Period.EndExclusive ? now.isAfter(endMoment) : null,\r\n\t\t\t\t\tisPastDeadline: report.Period.Deadline ? now.isAfter(moment(report.Period.Deadline)) : null,\r\n\t\t\t\t\thasBegun: report.Period.BeginInclusive ? now.isSameOrAfter(beginMoment) : null,\r\n\t\t\t\t\tseasonCode: season.Code,\r\n\t\t\t\t\tseasonName: season.Name,\r\n\t\t\t\t\tisObscured: period.isObscured,\r\n\t\t\t\t\tseasonRangeLabel:\r\n\t\t\t\t\t\t// eslint-disable-next-line newline-per-chained-call\r\n\t\t\t\t\t\t`${moment.parseZone(report.Period.BeginInclusive).format(\"MM/DD/YYYY\")} - ${moment.parseZone(report.Period.EndExclusive).subtract(1, \"days\")\r\n\t\t\t\t\t\t\t.format(\"MM/DD/YYYY\")}`\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst tableData = unfilteredTableData.filter((compliancePeriod) => compliancePeriod.hasOpened !== false && !compliancePeriod.isObscured);\r\n\t\t\tconst matchingTable = ctrl.complianceTables[entity.Id];\r\n\r\n\t\t\tif(matchingTable) {\r\n\t\t\t\tmatchingTable.seasons.push(season.Id);\r\n\t\t\t\tmatchingTable.data.push(...tableData);\r\n\t\t\t\tmatchingTable.data.sort(sortTableData);\r\n\t\t\t\tmatchingTable.grid.paginationOptions.totalItems = matchingTable.data.length;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconst now = moment();\r\n\t\t\t\tconst currentPeriodIndex = findIndex(season.Periods, period => {\r\n\t\t\t\t\treturn now.isSameOrAfter(moment(period.BeginInclusive)) && now.isBefore(moment(period.EndExclusive));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tconst currentPeriodPage = currentPeriodIndex !== undefined && (Math.floor(currentPeriodIndex / defaultComplianceTable.grid.paginationOptions.itemsPerPage) + 1);\r\n\r\n\t\t\t\tconst newTable = {\r\n\t\t\t\t\t...defaultComplianceTable,\r\n\t\t\t\t\tseasons: [season.Id],\r\n\t\t\t\t\tname: entity.Name,\r\n\t\t\t\t\tid: entity.Id,\r\n\t\t\t\t\tdata: tableData,\r\n\t\t\t\t\tdisplayData: [],\r\n\t\t\t\t\ttimeRangedTableData: [],\r\n\t\t\t\t\tisExpanded: tableData.length > 0,\r\n\t\t\t\t\tgrid: {\r\n\t\t\t\t\t\tpaginationOptions: {\r\n\t\t\t\t\t\t\t...defaultComplianceTable.grid.paginationOptions,\r\n\t\t\t\t\t\t\tcurrentPage: currentPeriodPage || 1,\r\n\t\t\t\t\t\t\ttotalItems: tableData.length\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tctrl.complianceTables[entity.Id] = newTable;\r\n\t\t\t\t$logger.snapshot(\"table\", newTable);\r\n\t\t\t}\r\n\r\n\t\t\tpageComplianceTable(entity.Id);\r\n\t\t});\r\n\t\tloadingService.watch(promise);\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tconst sortTableData = (a, b) => {\r\n\t\tif(a.seasonCode < b.seasonCode) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse if(a.seasonCode > b.seasonCode) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tconst aMoment = moment(a.Period.BeginInclusive);\r\n\t\t\tconst bMoment = moment(b.Period.BeginInclusive);\r\n\r\n\t\t\tif(aMoment.isBefore(bMoment)) {\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t\telse if(aMoment.isAfter(bMoment)) {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 0;\r\n\t};\r\n\r\n\tfunction onTimelineItemClick(props) {\r\n\t\tif(props.what === \"item\") {\r\n\t\t\tsetSelectedReportingIndex(props);\r\n\r\n\t\t\t$timeout(() => {\r\n\t\t\t\t$scope.$apply();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfunction onTimelineRangeChanged(props) {\r\n\t\tctrl.timelineRange = {\r\n\t\t\tstart: moment(props.start),\r\n\t\t\tend: moment(props.end)\r\n\t\t};\r\n\t\t\r\n\t\trenderComplianceReports({ selectedEntity: ctrl.selectedEntity }).then(() => updateTableDataRangeToTimeline());\r\n\r\n\t\t$timeout(() => {\r\n\t\t\t$scope.$apply();\r\n\t\t});\r\n\t}\r\n\r\n\tfunction updateTableDataRangeToTimeline() {\r\n\t\tforEach(ctrl.complianceTables, table => {\r\n\t\t\tlet timeRangedTableData = table.data;\r\n\t\t\tif(ctrl.showTimeline) {\r\n\t\t\t\ttimeRangedTableData = table.data.filter((period) =>\r\n\t\t\t\t\tmoment(period.Period.EndExclusive).isSameOrAfter(moment(ctrl.timeline.range.start))\r\n\t\t\t\t\t&& moment(period.Period.BeginInclusive).isSameOrBefore(moment(ctrl.timeline.range.end)));\r\n\t\t\t}\r\n\r\n\t\t\ttable.timeRangedTableData = timeRangedTableData;\r\n\t\t\ttable.grid.paginationOptions.totalItems = table.timeRangedTableData.length;\r\n\r\n\t\t\ttable.hideTable = false;\r\n\t\t\tif(table.timeRangedTableData.length === 0) {\r\n\t\t\t\ttable.hideTable = true;\r\n\t\t\t}\r\n\t\t\tpageComplianceTable(table.id);\r\n\t\t});\r\n\t}\r\n\r\n\tfunction pageComplianceTable(tableId) {\r\n\t\tconst table = find(ctrl.complianceTables, t => t.id === tableId);\r\n\r\n\t\tif(table.grid.paginationOptions.currentPage == 0) {\r\n\t\t\ttable.grid.paginationOptions.currentPage = 1;\r\n\t\t}\r\n\r\n\t\tconst totalItems = table.grid.paginationOptions.totalItems;\r\n\t\tconst itemsPerPage = parseInt(table.grid.paginationOptions.itemsPerPage);\r\n\t\tconst lastPage = parseInt((totalItems + itemsPerPage - 1) / itemsPerPage) || 1;\r\n\t\tif(table.grid.paginationOptions.currentPage > lastPage) {\r\n\t\t\ttable.grid.paginationOptions.currentPage = lastPage;\r\n\t\t}\r\n\r\n\t\tconst pagination = table.grid.paginationOptions;\r\n\r\n\t\tconst startIndex = (pagination.currentPage - 1) * itemsPerPage;\r\n\t\tlet endIndex = startIndex + itemsPerPage;\r\n\t\tif(endIndex > table.timeRangedTableData.length) {\r\n\t\t\tendIndex = table.timeRangedTableData.length;\r\n\t\t}\r\n\r\n\t\ttable.displayData = slice(table.timeRangedTableData, startIndex, endIndex);\r\n\t}\r\n\r\n\tfunction renderComplianceReports(selection) {\r\n\t\tlet useFriendlyEntity = !!selection.selectedEntity;\r\n\t\t\r\n\t\tif(selection.selectedEntity) {\r\n\t\t\tctrl.selectedEntity = selection.selectedEntity;\r\n\t\t} else {\r\n\t\t\tctrl.selectedEntity = cloneDeep(entityManager.getSelectedEntity());\r\n\t\t\tuseFriendlyEntity = !!ctrl.selectedEntity.friendly;\r\n\t\t}\r\n\r\n\t\tif(ctrl.selectedEntity.friendly || ctrl.selectedEntity.primary) {\r\n\t\t\tctrl.configuredTimezone = timezoneService.getConfiguredTimezoneCode(ctrl.selectedEntity);\r\n\t\t\tconst entity = (useFriendlyEntity || entityManager.isEntitySelf(ctrl.selectedEntity.friendly))\r\n\t\t\t\t? ctrl.selectedEntity.friendly\r\n\t\t\t\t: ctrl.selectedEntity.primary;\r\n\r\n\t\t\tif(!entity || !entity.Id) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\treturn updateComplianceTables(entity).then(() => {\r\n\t\t\t\tctrl.showTimeline && configureVis();\r\n\t\t\t\tupdateTableDataRangeToTimeline();\r\n\t\t\t\tupdateAlertSummaries();\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tctrl.showTimeline && configureVis();\r\n\t\t\tupdateTableDataRangeToTimeline();\r\n\t\t\tupdateAlertSummaries();\r\n\t\t\treturn new Promise(resolve => resolve());\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setSelectedReportingIndex(reportInformation, setSelection) {\r\n\t\tif(setSelection && ctrl.showTimeline) {\r\n\t\t\tfocusSelectedItem(reportInformation.item).then(() => {\r\n\t\t\t\tupdateTableDataRangeToTimeline();\r\n\t\t\t\tsetTableItem();\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tsetTableItem();\r\n\t\t}\r\n\r\n\t\tfunction setTableItem() {\r\n\t\t\tctrl.selectedReportIndex = reportInformation.item;\r\n\r\n\t\t\tforEach(ctrl.complianceTables, table => {\r\n\t\t\t\tconst selectedItemIndex = sortBy(table.timeRangedTableData, x => Number(x.entityPeriodIndex.split(\"~\")[1]))\r\n\t\t\t\t\t.findIndex(x => x.entityPeriodIndex == reportInformation.item);\r\n\r\n\t\t\t\tconst selectedItemPage = Math.floor(selectedItemIndex / table.grid.paginationOptions.itemsPerPage) + 1;\r\n\t\t\t\ttable.grid.paginationOptions.currentPage = selectedItemPage;\r\n\t\t\t\tpageComplianceTable(table.id);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateComplianceTables(entity) {\r\n\t\tconst promises = [];\r\n\r\n\t\tloadSeasonsForEntity(ctrl.selectedEntity.friendly);\r\n\r\n\t\tif(ctrl.selectedEntity.friendly && ctrl.selectedEntity.friendly.Entities) {\r\n\t\t\tctrl.selectedEntity.friendly.Entities.forEach(entity => {\r\n\t\t\t\tpromises.push(loadComplianceReportForPrimary(entity.Entity));\r\n\t\t\t});\r\n\t\t} \r\n\t\telse if(entity) {\r\n\t\t\tpromises.push(loadComplianceReportForPrimary(entity));\r\n\t\t}\r\n\r\n\t\treturn Promise.all(promises).then(() => {\r\n\t\t\tctrl.orderedTables = sortBy(ctrl.complianceTables, t => t.id);\r\n\t\t\tctrl.orderedTableIds = ctrl.orderedTables.map(t => t.id);\r\n\r\n\t\t\tctrl.hasWarningIcon = some(ctrl.complianceTables, table =>\r\n\t\t\t\ttable.data.some(item => item.isPastDeadline === false)\r\n\t\t\t);\r\n\t\t\tctrl.hasOpenIcon = some(ctrl.complianceTables, table =>\r\n\t\t\t\ttable.data.some(item => item.hasOpened)\r\n\t\t\t);\r\n\t\t});\r\n\t}\r\n\r\n\tfunction loadSeasonsForEntity(friendlyEntity) {\r\n\t\tconst hasPrimaryEntityRanges = some(friendlyEntity.Entities ?? [], entity => !!entity.Entity.Effective?.length);\r\n\t\tconst hasFriendlyEntityRanges = !!friendlyEntity.Effective?.length;\r\n\r\n\t\tlet allSeasons = [];\r\n\r\n\t\tif(!hasPrimaryEntityRanges && !hasFriendlyEntityRanges) {\r\n\t\t\tallSeasons = appState.forms.selected.Seasons;\r\n\t\t}\r\n\t\telse if(hasPrimaryEntityRanges) {\r\n\t\t\tforEach(friendlyEntity.Entities, primary => {\r\n\t\t\t\tloadPrimaryEffectiveRanges(primary.Entity);\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tloadPrimaryEffectiveRanges(friendlyEntity);\r\n\t\t}\r\n\r\n\t\tctrl.seasons = uniqWith(allSeasons, (a, b) => a.Id === b.Id)\r\n\t\t\t.sort((a, b) => {\r\n\t\t\t\tif(moment(a.BeginInclusive).isBefore(moment(b.BeginInclusive))) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t}\r\n\t\t\t\telse if(moment(a.BeginInclusive).isAfter(moment(b.BeginInclusive))) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t\treturn 0;\r\n\t\t\t});\r\n\r\n\t\tif(!hasPrimaryEntityRanges) { \r\n\t\t\tif(ctrl.hasFedIdentifier) {\r\n\t\t\t\tctrl.seasons = ctrl.seasons.filter(s => s.Scope === \"FED\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tctrl.seasons = ctrl.seasons.filter(s => s.Scope !== \"FED\");\r\n\t\t\t} \r\n\t\t}\r\n\t\t\r\n\t\tforEach(ctrl.seasons, s => {\r\n\t\t\tconst start = moment.parseZone(s.BeginInclusive)\r\n\t\t\t\t.format(\"MM/DD/YYYY\");\r\n\t\t\tconst end = moment.parseZone(s.EndExclusive)\r\n\t\t\t\t.subtract(1, \"day\")\r\n\t\t\t\t.format(\"MM/DD/YYYY\");\r\n\t\t\ts.displayText = `${s.Name} ${ctrl.form.nomenclature.Season || \"Season\"} (${start} - ${end})`;\r\n\t\t});\r\n\t\t\r\n\t\tfunction loadPrimaryEffectiveRanges(primary) {\r\n\t\t\tif(!!primary.Effective) {\r\n\t\t\t\tconst primaryRangeSeasons = getSeasonsByEffectiveRanges(primary.Effective, appState.forms.selected.Seasons, ctrl.useFederalScopeOverride);\r\n\r\n\t\t\t\tconst uniquePrimaryRangeSeasons = uniqWith(primaryRangeSeasons, (a, b) => a.Id === b.Id);\r\n\t\t\t\tallSeasons.push(...uniquePrimaryRangeSeasons);\r\n\t\t\t\tprimary.rangeSeasons = uniquePrimaryRangeSeasons;\r\n\r\n\t\t\t\tprimary.rangeSeasons = analyzeSeasonsPeriodsForOverlap(primary.rangeSeasons);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction analyzeSeasonsPeriodsForOverlap(seasons) {\r\n\t\tconst periods = seasons.flatMap(season => season.Periods);\r\n\t\tconst periodOverlapCandidates = periods.map((period) => ({\r\n\t\t\tperiod: period,\r\n\t\t\toverlapsWith: detectOverlappingPeriodsOfGreaterSpecificity(periods, period).sort((periodA, periodB) => periodA.beginInclusiveMoment.unix() - periodB.beginInclusiveMoment.unix())\r\n\t\t}));\r\n\r\n\t\tconst results = periodOverlapCandidates.map(check => ({\r\n\t\t\tId: check.period.Id,\r\n\t\t\tisObscured: isObscuredPeriod(check.period, check.overlapsWith)\r\n\t\t}));\r\n\r\n\t\tconst keyedResults = keyBy(results, result => result.Id);\r\n\r\n\t\tperiods.forEach(period => {\r\n\t\t\tperiod.isObscured = keyedResults[period.Id].isObscured;\r\n\t\t});\r\n\r\n\t\treturn seasons;\r\n\t}\r\n\r\n\r\n\tfunction isObscuredPeriod(period, candidates) {\r\n\t\tif(!candidates.length) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t//the earliest candidate begins AFTER this moment starts\r\n\t\tif(!candidates[0].beginInclusiveMoment.isSameOrBefore(period.beginInclusiveMoment))\r\n\t\t\treturn false;\r\n\t\t\r\n\t\t//the latest candidate ends BEFORE this moment ends\r\n\t\tif(candidates[candidates.length - 1].endExclusiveMoment.isBefore(period.endExclusiveMoment))\r\n\t\t\treturn false;\r\n\r\n\t\t//else the insanity\r\n\t\t//month:_____|xxxxxxxxxxxxxxxxxxxx|_______\r\n\t\t//week:___|xxxxx|xxxxx|xxxxx|xxxxx|xxxxx|_\r\n\t\t//month gets \"obscured\", if it is completely covered by other parts. SOO\r\n\r\n\t\t//A: (take month) : __________|xxxxxxxxxxxxxxxx|_______\r\n\t\t//B: (minus week) : ___|xxxxx|xxxxx|xxxxx|xxxxx|xxxxx|_\r\n\t\t//and then repeat for each \"candidate\" and see if there's anything left over\r\n\r\n\t\tlet periodsUnobscuredRange = period.openRange;\r\n\t\tfor(const candidate of candidates) {\r\n\t\t\t//the earliest candidate begins AFTER this moment starts\r\n\t\t\tif(!candidate.beginInclusiveMoment.isSameOrBefore(periodsUnobscuredRange.start))\r\n\t\t\t\treturn false;\r\n\r\n\t\t\tif(candidate.endExclusiveMoment.isBefore(periodsUnobscuredRange.start))\r\n\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\tconst diff = periodsUnobscuredRange.subtract(candidate.openRange);\r\n\t\t\tif(diff.length === 0)\r\n\t\t\t\treturn true;\r\n\t\t\tif(diff.length > 1)\r\n\t\t\t\tthrow new Error(\"This shouldn't occur since the candidate is supposed to begin BEFORE this time, but for some reason you got a fragment so have fun debugging that\");\r\n\t\t\tperiodsUnobscuredRange = diff[0];\r\n\t\t}\r\n\r\n\t\treturn periodsUnobscuredRange[0] === null;\r\n\t}\r\n\r\n\tfunction detectOverlappingPeriodsOfGreaterSpecificity(periods, againstPeriod) {\r\n\t\tconst candidates = [];\r\n\t\tfor(const period of periods) {\r\n\t\t\tif(period.Id === againstPeriod.Id)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif(period.openRange.duration(\"minutes\") > againstPeriod.openRange.duration(\"minutes\"))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif(againstPeriod.openRange.overlaps(period.openRange, { adjacent: true })) {\r\n\t\t\t\tcandidates.push(period);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn candidates;\r\n\t}\r\n\r\n\tfunction updateAlertSummaries() {\r\n\t\t//show reports that are past deadline or have passed period end with no reports filed\r\n\t\tctrl.alertSummaries = reduce(ctrl.complianceTables, (acc, curr) => {\r\n\t\t\tif(curr.timeRangedTableData.some(x => getComplianceClassName(x) === complianceClasses.caution)) {\r\n\t\t\t\tacc =\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t...acc,\r\n\t\t\t\t\t\t...curr.timeRangedTableData\r\n\t\t\t\t\t\t\t.filter(x => getComplianceClassName(x) === complianceClasses.caution)\r\n\t\t\t\t\t\t\t.filter(x => x.hasClosed !== true)\r\n\t\t\t\t\t\t\t.map(x => ({\r\n\t\t\t\t\t\t\t\tstatusColor: ctrl.complianceStatusColors.periodEndedWithNoReports,\r\n\t\t\t\t\t\t\t\tstatusIcon: ctrl.complianceIcons.ended.icon,\r\n\t\t\t\t\t\t\t\tstatusLabel: ctrl.complianceIcons.ended.label,\r\n\t\t\t\t\t\t\t\treportName: curr.name,\r\n\t\t\t\t\t\t\t\tgroup: curr.name,\r\n\t\t\t\t\t\t\t\titem: `${curr.id}~${x.Period.Id}`,\r\n\t\t\t\t\t\t\t\tmessage: `${x.Period.Name}: Near End of Period, No Completed ${pluralize(true, ctrl.form.nomenclature.PositiveReport)}`\r\n\t\t\t\t\t\t\t}))\r\n\t\t\t\t\t];\r\n\t\t\t}\r\n\r\n\t\t\tif(curr.timeRangedTableData.some(x => getComplianceClassName(x) === complianceClasses.danger)) {\r\n\t\t\t\tacc =\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t...acc,\r\n\t\t\t\t\t\t...curr.timeRangedTableData\r\n\t\t\t\t\t\t\t.filter(x => getComplianceClassName(x) === complianceClasses.danger)\r\n\t\t\t\t\t\t\t.filter(x => x.hasClosed !== true)\r\n\t\t\t\t\t\t\t.map(x => {\r\n\t\t\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t\t\tstatusColor: ctrl.complianceStatusColors.pastDeadline,\r\n\t\t\t\t\t\t\t\t\tstatusIcon: ctrl.complianceIcons.pastDeadline.icon,\r\n\t\t\t\t\t\t\t\t\tstatusLabel: ctrl.complianceIcons.pastDeadline.label,\r\n\t\t\t\t\t\t\t\t\treportName: curr.name,\r\n\t\t\t\t\t\t\t\t\tgroup: curr.name,\r\n\t\t\t\t\t\t\t\t\titem: `${curr.id}~${x.Period.Id}`,\r\n\t\t\t\t\t\t\t\t\tmessage: `${x.Period.Name}: Past Deadline, No Submitted ${pluralize(true, ctrl.form.nomenclature.PositiveReport)}`\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t];\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t}, []);\r\n\r\n\t\tctrl.hasAlerts = ctrl.alertSummaries.length > 0;\r\n\t\tctrl.isAlertSummaryExpanded = ctrl.hasAlerts && !ctrl.isMobile;\r\n\t}\r\n\r\n\tfunction updateReportingEntitySelector(friendly) {\r\n\t\tctrl.primaryReportingEntity = friendly || {};\r\n\t\tctrl.hasFedIdentifier = false;\r\n\t\tctrl.useFederalScopeOverride = false;\r\n\r\n\t\tif(friendly.Identifiers && some(friendly.Identifiers, i => IDENTIFIER_TYPES[i.Type.Code].isFederal)) {\r\n\t\t\tctrl.hasFedIdentifier = true;\r\n\t\t}\r\n\t\tconst areAnyPrimaryEffectiveRangesScoped = (friendly.Entities ?? []).some(e => (e.Entity.Effective ?? []).some(r => r.Scope !== undefined));\r\n\t\tconst areAnyFriendlyEffectiveRangesScoped = (friendly.Effective ?? []).some(r => r.Scope !== undefined);\r\n\r\n\t\tif(ctrl.hasFedIdentifier && !areAnyFriendlyEffectiveRangesScoped && !areAnyPrimaryEffectiveRangesScoped) {\r\n\t\t\tctrl.useFederalScopeOverride = true;\r\n\t\t}\r\n\r\n\t\tconst validEntities = ctrl.primaryReportingEntity.Entities;\r\n\r\n\t\tconst formSeasonIds = ctrl.form.Seasons.map(y => y.Id);\r\n\t\tctrl.selectedSeason = null;\r\n\r\n\t\tconst entityMapper = (primary, friendly) => {\r\n\t\t\tconst seasonIds = primary.Effective?.length\r\n\t\t\t? getSeasonsByEffectiveRanges(primary.Effective, ctrl.form.Seasons, ctrl.useFederalScopeOverride)\r\n\t\t\t\t.map(y => y.Id)\r\n\t\t\t: formSeasonIds;\r\n\r\n\t\t\treturn {\r\n\t\t\t\tkey: primary.Id,\r\n\t\t\t\tdisplay: primary.Code,\r\n\t\t\t\tseasonIds,\r\n\t\t\t\tprimaryClassification: primary.Classification,\r\n\t\t\t\tclassifications: ((primary.Classification && [primary.Classification]) ?? [])\r\n\t\t\t\t\t.concat((friendly?.Classification && [friendly.Classification]) ?? [])\r\n\t\t\t\t\t.concat(primary.Classifications ?? [])\r\n\t\t\t\t\t.concat(friendly?.Classifications ?? []),\r\n\t\t\t\tidentifiers: (primary.Identifiers ?? []).concat(friendly?.Identifiers ?? [])\r\n\t\t\t};\r\n\t\t};\r\n\r\n\t\tif(!!validEntities) {\r\n\t\t\tctrl.licenses = validEntities.map(x => entityMapper(x.Entity, friendly));\r\n\t\t}\r\n\t\telse {\r\n\t\t\tctrl.licenses = [entityMapper(ctrl.primaryReportingEntity)];\r\n\t\t}\r\n\r\n\t\tctrl.cachedReports = [];\r\n\t\tctrl.complianceTables = {};\r\n\r\n\t\tconst selected = !!friendly ? { friendly: { ...ctrl.primaryReportingEntity } } : null;\r\n\r\n\t\treturn renderComplianceReports({ selectedEntity: selected })\r\n\t\t\t.then(() => {\r\n\t\t\t\tconst now = moment();\r\n\t\t\t\tlet selectedEntityIds = [selected.friendly.Id];\r\n\t\t\t\tif(selected.friendly.Entities) {\r\n\t\t\t\t\tselectedEntityIds = selected.friendly.Entities.map(e => e.Entity.Id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tforEach(selectedEntityIds, selectedEntityId => {\r\n\t\t\t\t\tconst thisTable = ctrl.complianceTables[selectedEntityId];\r\n\r\n\t\t\t\t\tif(!!thisTable) {\r\n\t\t\t\t\t\tconst currentPeriodIndex = findIndex(thisTable.data, period => {\r\n\t\t\t\t\t\t\tconst isThis = now.isSameOrAfter(moment(period.Period.BeginInclusive)) && now.isBefore(moment(period.Period.EndExclusive));\r\n\r\n\t\t\t\t\t\t\treturn isThis;\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tconst currentPeriodPage = currentPeriodIndex !== undefined && (Math.floor(currentPeriodIndex / thisTable.grid.paginationOptions.itemsPerPage) + 1);\r\n\r\n\t\t\t\t\t\tthisTable.grid.paginationOptions.currentPage = currentPeriodPage || 1;\r\n\t\t\t\t\t\tthisTable.grid.paginationOptions.totalItems = thisTable.data.length;\r\n\r\n\t\t\t\t\t\t$scope.$watch(() => {\r\n\t\t\t\t\t\t\tif(ctrl.complianceTables[selectedEntityId]) {\r\n\t\t\t\t\t\t\t\treturn ctrl.complianceTables[selectedEntityId].grid.paginationOptions.itemsPerPage;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}, (next) => {\r\n\t\t\t\t\t\t\tif(next !== null) {\r\n\t\t\t\t\t\t\t\tif(ctrl.pageSet === undefined) {\r\n\t\t\t\t\t\t\t\t\tconst watchCurrentPeriodIndex = findIndex(ctrl.complianceTables[selectedEntityId].data, period => {\r\n\t\t\t\t\t\t\t\t\t\tconst isThis = now.isSameOrAfter(moment(period.Period.BeginInclusive)) && now.isBefore(moment(period.Period.EndExclusive));\r\n\r\n\t\t\t\t\t\t\t\t\t\treturn isThis;\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\tconst currentPeriodPage = watchCurrentPeriodIndex !== undefined &&\r\n\t\t\t\t\t\t\t\t\t\t(Math.floor(watchCurrentPeriodIndex / defaultComplianceTable.grid.paginationOptions.itemsPerPage) + 1);\r\n\t\t\t\t\t\t\t\t\tctrl.complianceTables[selectedEntityId].grid.paginationOptions.currentPage = currentPeriodPage || 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tpageComplianceTable(selectedEntityId);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t$scope.$watch(() => {\r\n\t\t\t\t\t\t\tif(ctrl.complianceTables[selectedEntityId]) {\r\n\t\t\t\t\t\t\t\treturn ctrl.complianceTables[selectedEntityId].grid.paginationOptions.currentPage;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}, (next) => {\r\n\t\t\t\t\t\t\tif(next !== null) {\r\n\t\t\t\t\t\t\t\tctrl.pageSet = next;\r\n\t\t\t\t\t\t\t\tpageComplianceTable(selectedEntityId);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tpageComplianceTable(selectedEntityId);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tupdateTableDataRangeToTimeline();\r\n\t\t\t})\r\n\t\t\t.then(() => {\r\n\t\t\t\t$timeout(() => setTimelineZoom(ctrl));\r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction updateSeason() {\r\n\t\tif(ctrl.selectedSeason.Id === ctrl.lastSelectedSeasonId) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctrl.lastSelectedSeasonId = ctrl.selectedSeason.Id;\r\n\r\n\t\tif(!ctrl.showTimeline) {\r\n\t\t\tctrl.complianceTables = {};\r\n\t\t}\r\n\r\n\t\trenderComplianceReports({ selectedEntity: ctrl.selectedEntity }).then(() => {\r\n\t\t\tctrl.orderedTableIds = ctrl.orderedTables\r\n\t\t\t\t.map(t => t.id);\r\n\r\n\t\t\tupdateTableDataRangeToTimeline();\r\n\t\t\tpageComplianceTable(ctrl.orderedTableIds[0]);\r\n\t\t});\r\n\t}\r\n\r\n\tfunction tlSkipBack() {\r\n\t\tconst {\r\n\t\t\trange,\r\n\t\t\tstart\r\n\t\t} = getTimelineRange();\r\n\r\n\t\tconst newWindow = {\r\n\t\t\tend: start.toDate(),\r\n\t\t\tstart: start.subtract(range, \"days\").toDate()\r\n\t\t};\r\n\r\n\t\tctrl.timeline.setWindow(newWindow);\r\n\t}\r\n\r\n\tfunction tlSkipNext() {\r\n\t\tconst {\r\n\t\t\trange,\r\n\t\t\tend\r\n\t\t} = getTimelineRange();\r\n\r\n\t\tconst newWindow = {\r\n\t\t\tstart: end.toDate(),\r\n\t\t\tend: end.add(range, \"days\").toDate()\r\n\t\t};\r\n\r\n\t\tctrl.timeline.setWindow(newWindow);\r\n\t}\r\n\r\n\tfunction tlZoomIn() {\r\n\t\tconst {\r\n\t\t\trange,\r\n\t\t\tend,\r\n\t\t\tstart\r\n\t\t} = getTimelineRange();\r\n\r\n\t\tconst newRange = range * 0.333;\r\n\t\tconst rangeDiff = range - newRange;\r\n\r\n\t\tconst newWindow = {\r\n\t\t\tend: end.subtract((rangeDiff / 2), \"days\").toDate(),\r\n\t\t\tstart: start.add((rangeDiff / 2), \"days\").toDate()\r\n\t\t};\r\n\r\n\t\tctrl.timeline.setWindow(newWindow);\r\n\t}\r\n\r\n\tfunction tlZoomOut() {\r\n\t\tconst {\r\n\t\t\trange,\r\n\t\t\tend,\r\n\t\t\tstart\r\n\t\t} = getTimelineRange();\r\n\r\n\t\tconst newRange = range * 1.5;\r\n\t\tconst rangeDiff = newRange - range;\r\n\r\n\t\tconst newWindow = {\r\n\t\t\tend: end.add((rangeDiff / 2), \"days\").toDate(),\r\n\t\t\tstart: start.subtract((rangeDiff / 2), \"days\").toDate()\r\n\t\t};\r\n\r\n\t\tctrl.timeline.setWindow(newWindow);\r\n\t}\r\n\r\n\tfunction getTimelineRange() {\r\n\t\tconst timeWindow = ctrl.timeline.getWindow();\r\n\r\n\t\tconst start = moment(timeWindow.start);\r\n\t\tconst end = moment(timeWindow.end);\r\n\t\tconst range = end.diff(start, \"days\");\r\n\r\n\t\treturn { range, end, start };\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.compliance\", [])\r\n\t.component(\"complianceReport\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","export default \"\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t

    FILTERS{{$ctrl.isCollapsed ? ' & ACTIONS' : ''}}

    \\r\\n\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tLEGEND\\r\\n\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t Period is out of compliance{{$ctrl.hasWarningIcon ? ' and past deadline' : ''}}\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Reporting period is over, but not past the deadline\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t Current filing period\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Period is open for filing\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Period has not begun\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t Period is compliant\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t

    SELECT A {{ $ctrl.form.nomenclature.PrimaryEntity.toUpperCase() }} TO VIEW DETAILS

    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t

    COMPLIANCE SUMMARY

    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\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t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    $ctrl.alertSummaryShowCount\\\">\\r\\n\\t\\t\\t\\t\\t\\t{{$ctrl.alertSummaries.length - $ctrl.alertSummaryShowCount}} more \\r\\n\\t\\t\\t\\t\\t\\tHide \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    No Alerts found
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t 0, 'expanded': $ctrl.complianceTables[complianceTableId].isExpanded}\\\"\\r\\n\\t\\t\\t>\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t {{$ctrl.complianceTables[complianceTableId].name}}\\r\\n\\t\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t 0\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t  {{item.seasonName}} - {{item.Period.Name}}
    {{item.seasonRangeLabel}}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t 1) ? 's.' : '.')}}\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttooltip-enable=\\\"item.Pending > 0 && !item.Compliant && !item.Negative\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\talign=\\\"right\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t 0\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t File {{$ctrl.form.nomenclature.NegativeReport}} \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t Undo {{$ctrl.form.nomenclature.NegativeReport}} \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t Cannot file until {{$ctrl.getFormattedOpenDate(item)}}
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tFiling window has closed \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t {{$ctrl.getEmptyTableString()}} \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t No {{$ctrl.form.nomenclature.PositiveReport}}s found \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\";","import moment from \"moment\";\r\n\r\n/**\r\n * \r\n * @param {*} period \r\n * @param {*} effectiveRanges \r\n * @param {*} seasonScope \r\n */\r\nexport function isPeriodInEffectiveRanges(period, effectiveRanges, seasonScope, useFederalScopeOverride) {\r\n\tif(!effectiveRanges?.length) {\r\n\t\treturn false;\r\n\t}\r\n\tfor(const range of effectiveRanges) {\r\n\t\tif(\r\n\t\t\tmoment(range.Start).isSameOrAfter(period.EndExclusive)\r\n\t\t\t|| (range.End !== undefined && moment(range.End).isSameOrBefore(period.BeginInclusive))\r\n\t\t\t|| seasonScope !== (useFederalScopeOverride ? \"FED\" : range.Scope)\r\n\t\t) {\r\n\t\t\tcontinue;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}","import \"./index.less\";\r\nimport template from \"./index.html\";\r\nimport { FEATURE_TYPES } from \"constants.js\";\r\nimport { NEW_REPORT } from \"routes.js\";\r\nimport { globs } from \"../../services/globs\";\r\n\r\nfunction controller(appState, cardSwipeService) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.initCardSwipe = initCardSwipe;\r\n\r\n\tctrl.NEW_REPORT = NEW_REPORT;\r\n\tctrl.canReadCompliance = globs.reporting.compliance.read;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.permissions = appState.permissions;\r\n\t\tctrl.form = appState.forms.selected;\r\n\r\n\t\tctrl.canCardSwipe = ctrl.form.Features && ctrl.form.Features.filter(f => f.Type === FEATURE_TYPES.webCardSwipe).length > 0;\r\n\t}\r\n\r\n\tfunction initCardSwipe() {\r\n\t\tcardSwipeService.initializeCardSwipe();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.dashboard\", [])\r\n\t.component(\"dashboard\", { template, controller }).name;\r\n","export default \"

    \\r\\n\\tImportant: Your account is not associated with a form. Please contact the agency you are trying to report for or contact support. \\r\\n

    \\r\\n\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\tReporting Status\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\tCreate {{$ctrl.form.nomenclature.PositiveReport}}\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\tCreate {{$ctrl.form.nomenclature.NegativeReport}}\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\tFind {{$ctrl.form.nomenclature.PositiveReport}}\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\tCreate {{$ctrl.form.nomenclature.PositiveReport}} with Card\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\";","import invalidDateOfBirth from \"./invalid-dateofbirth.html\";\r\nimport invalidPhoneNumber from \"./invalid-phone-number.html\";\r\nimport submittedRequest from \"./submitted-request.html\";\r\n\r\nexport default {\r\n\tinvalid: {\r\n\t\tphoneNumber: invalidPhoneNumber,\r\n\t\tdateOfBirth: invalidDateOfBirth\r\n\t},\r\n\tsubmitted: submittedRequest\r\n};","export default \"Phone number is in an unrecognized format. Try one of:
    \\r\\n
    (111) 222-3333
    \\r\\n
    111-222-3333
    \\r\\n
    1112223333\";","export default \"Birthdate is in an unrecognized format. Please try:
    \\r\\n
    mm/dd/yyyy\";","export default \"Your request has been submitted.
    \\r\\n
    It may take several business days for the agency to process your request.
    \\r\\n
    We will email you when your access is granted. You may also log back in from time to time to see if your access has been granted.
    \\r\\n
    If you have multiple requests to make, please submit the form for each individual request.\";","import swal from \"sweetalert2\";\r\n\r\nimport \"./index.less\";\r\nimport template from \"./index.html\";\r\nimport messages from \"./prompts\";\r\nimport { isStringNullishOrEmpty } from \"../../services/string-service\";\r\n\r\nimport {\r\n\tfind,\r\n\tuniqBy\r\n} from \"lodash\";\r\nimport moment from \"moment\";\r\n\r\nimport { FORMS_REQUESTABLE } from \"routes\";\r\nimport {\r\n\tFORMS_PENDING_REQUESTS,\r\n\tFORMS_REQUEST\r\n} from \"../../routes\";\r\nimport {\r\n\tNOMENCLATURE, \r\n\tTIME_ZONES \r\n} from \"../../constants\";\r\n\r\nfunction controller(\r\n\tapi,\r\n\t$logger,\r\n\tuiHelpers,\r\n\t$userProfile,\r\n\tloadingService,\r\n\t$state\r\n) {\r\n\tconst ctrl = this;\r\n\tconst noTimezoneFormCodes = [\r\n\t\t\"ME_DMR_HARVESTER_REPORT\",\r\n\t\t\"SC_SCDNR_CHARTER_VESSEL\"\r\n\t];\r\n\r\n\tctrl.format = \"MM/dd/yyyy\";\r\n\tctrl.dateOptions = {\r\n\t\tformatYear: \"yyyy\",\r\n\t\tstartingDay: 0,\r\n\t\tminDate: new Date(\"1910-01-01\"),\r\n\t\tdatepickerMode: \"year\"\r\n\t};\r\n\tctrl.forms = [];\r\n\tctrl.agencies = [];\r\n\tctrl.selectedAgency = undefined;\r\n\tctrl.selectedForm = undefined;\r\n\tctrl.selectedTimeZone = undefined;\r\n\tctrl.entityDescriptor = \"\";\r\n\tctrl.collectTimeZone = false;\r\n\tctrl.requestableForms = [];\r\n\tctrl.pendingRequests = [];\r\n\tctrl.popupOpen = false;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tloadingService.watch(api.get(FORMS_REQUESTABLE))\r\n\t\t\t.then(forms => {\r\n\t\t\t\tctrl.requestableForms = forms;\r\n\t\t\t\tctrl.agencies = uniqBy(forms.map(f => f.Agency), a => a.Id);\r\n\t\t\t\tif($state.params.form) {\r\n\t\t\t\t\tctrl.selectedForm = forms.find(f => f.Code === $state.params.form);\r\n\t\t\t\t\tctrl.selectedAgency = ctrl.agencies.find(a => a.Code === ctrl.selectedForm.Agency.Code);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetAgencyOptions();\r\n\t\t\t});\r\n\t};\r\n\r\n\tctrl.setAgencyBox = (box) => {\r\n\t\tctrl.agencyBox = box;\r\n\r\n\t\tsetAgencyOptions();\r\n\t};\r\n\r\n\tctrl.setFormBox = (box) => {\r\n\t\tctrl.formBox = box;\r\n\t};\r\n\r\n\tctrl.setTimeZoneBox = box => {\r\n\t\tctrl.timeZoneBox = box;\r\n\t\tctrl.timeZoneBox.setChoices(TIME_ZONES, \"ianaCode\", \"name\", true);\r\n\t\t\r\n\t\tconst userTimeZoneGuess = moment.tz.guess();\r\n\t\tconst matches = TIME_ZONES.filter(sc => sc.ianaCode == userTimeZoneGuess);\r\n\t\tif(matches.length) {\r\n\t\t\tctrl.timeZoneBox.setValueByChoice(matches[0].ianaCode);\r\n\t\t\tctrl.selectedTimeZone = matches[0];\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.setDisplay = (id, fieldVariable) => {\r\n\t\tconst item = find(ctrl[fieldVariable], { Id: parseInt(id) || id });\r\n\r\n\t\tif(!item) {\r\n\t\t\t$logger.warn(`Selected ${fieldVariable} not found as an option.`);\r\n\t\t}\r\n\r\n\t\treturn item.Name || item.Code;\r\n\t};\r\n\r\n\tctrl.handleAgencyValueChanged = (modelVal) => {\r\n\t\tconst modelValInt = parseInt(modelVal);\r\n\t\tconst selectedAgency = find(ctrl.agencies, a => a.Id === modelValInt);\r\n\t\tctrl.selectedAgency = selectedAgency;\r\n\r\n\t\tconst agencyForms = ctrl.selectedAgency && ctrl.requestableForms.filter(f => f.Agency.Id === ctrl.selectedAgency.Id);\r\n\t\tctrl.forms = agencyForms || [];\r\n\r\n\t\tsetFormOptions();\r\n\t};\r\n\r\n\tctrl.isCheckedCode = (code) => {\r\n\t\treturn ctrl.checkboxes?.some(function(c) {\r\n\t\t\treturn c.code === code && c.value === true;\r\n\t\t});\r\n\t};\r\n\r\n\tctrl.handleFormValueChanged = async(modelVal) => {\r\n\t\tconst modelValInt = parseInt(modelVal);\r\n\t\tconst selectedForm = find(ctrl.forms, a => a.Id === modelValInt);\r\n\t\tctrl.selectedForm = selectedForm;\r\n\t\tctrl.collectTimeZone = noTimezoneFormCodes.indexOf(ctrl.selectedForm?.Code) === -1;\r\n\r\n\t\tctrl.entityNomenclature = find(ctrl.selectedForm?.Nomenclature, n => n.Code === \"FORM.PRIMARY.ENTITY\")?.Text || \"Entity\";\r\n\t\tctrl.entityDescriptor = \"Reg/CG #\";\r\n\t\tctrl.entityLabel = \"Label\";\r\n\t\tctrl.checkboxes = [];\r\n\r\n\t\tswitch(ctrl.selectedForm?.Code) {\r\n\t\t\tcase \"ME_DMR_HARVESTER_REPORT\":\r\n\t\t\t\tctrl.entityDescriptor = \"Landings Number\"; \r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"/ww/bfd/private-angler\":\r\n\t\t\t\tctrl.checkboxes.push(\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\tlabel: \"The Billfish Foundation Tagging Program\",\r\n\t\t\t\t\t\tcode: \"TBF\",\r\n\t\t\t\t\t\tvalue: true \r\n\t\t\t\t\t}, \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlabel: \"Atlantic HMS Recreational Reporting Requirements\",\r\n\t\t\t\t\t\tcode: \"HMS\",\r\n\t\t\t\t\t\tvalue: true,\r\n\t\t\t\t\t\trequiredField: \"hmsPermitNumber\",\r\n\t\t\t\t\t\trequiredFieldDataCode: \"HMS:VESSEL:PERMIT\"\r\n\t\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"SERO_FORHIRE\":\r\n\t\t\t\tctrl.checkboxes.push(\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\tlabel: \"The Billfish Foundation Tagging Program\",\r\n\t\t\t\t\t\tcode: \"TBF\",\r\n\t\t\t\t\t\tvalue: false \r\n\t\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tconst user = $userProfile.getUser();\r\n\t\tctrl.agencyPhone = ctrl.selectedForm.Nomenclature?.find(n => n.Code === NOMENCLATURE.SupportNumber)?.Text;\r\n\r\n\t\tawait loadCurrentRequests(api, user);\r\n\t};\r\n\r\n\tctrl.handleTimeZoneValueChanged = (modelVal) => {\r\n\t\tctrl.selectedTimeZone = find(TIME_ZONES, tz => tz.ianaCode === modelVal);\r\n\t};\r\n\r\n\tctrl.validate = (submitting) => {\r\n\t\tconst anyMissing = [\r\n\t\t\tctrl.entityName, \r\n\t\t\tctrl.entityCode, \r\n\t\t\tctrl.phoneNumber, \r\n\t\t\tctrl.birthDate\r\n\t\t].some(value => !(value?.toString()?.trim()));\r\n\r\n\t\tif(anyMissing) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst requiredOptional = ctrl.checkboxes.filter(c => c.requiredField && c.value === true);\r\n\t\tconst isMissingRequiredOptional = requiredOptional.some(v => isStringNullishOrEmpty(ctrl[v.requiredField]));\r\n\r\n\t\tif(isMissingRequiredOptional) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(ctrl.entityCode === undefined) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tctrl.phoneInvalid = false;\r\n\t\tconst phoneRegex = /^[\\\\+]?[(]?[0-9]{3}[)]?[-\\s\\\\.]?[0-9]{3}[-\\s\\\\.]?[0-9]{4,6}$/;\r\n\t\tif(submitting && !phoneRegex.test(ctrl.phoneNumber)) {\r\n\t\t\tctrl.promptValidationError(\"Invalid Phone Number\", messages.invalid.phoneNumber);\r\n\t\t\tctrl.phoneInvalid = submitting && true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tctrl.birthdateInvalid = false;\r\n\t\t// eslint-disable-next-line max-len\r\n\t\tconst dateRegex = /(?:(?:31(\\/|-|\\.)(?:0?[13578]|1[02]))\\1|(?:(?:29|30)(\\/|-|\\.)(?:0?[13-9]|1[0-2])\\2))(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$|^(?:29(\\/|-|\\.)0?2\\3(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\\d|2[0-8])(\\/|-|\\.)(?:(?:0?[1-9])|(?:1[0-2]))\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})/;\r\n\t\tconst birthdayMoment = moment(ctrl.birthDate);\r\n\t\tif(submitting && (!birthdayMoment.isValid() || (!(ctrl.birthDate instanceof Date) && !dateRegex.test(ctrl.birthDate)))) {\r\n\t\t\tctrl.promptValidationError(\"Unrecognized Birthdate\", messages.invalid.dateOfBirth);\r\n\t\t\t\r\n\t\t\tctrl.birthdateInvalid = submitting && true;\r\n\t\t\treturn false; \r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t};\r\n\r\n\tctrl.promptValidationError = (title, message) => {\r\n\t\tswal.fire({\r\n\t\t\ttitle: title,\r\n\t\t\thtml: message,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"warning\",\r\n\t\t\tshowCancelButton: false,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Okay\"\r\n\t\t});\r\n\t};\r\n\r\n\tctrl.makeRequest = async() => {\r\n\t\tconst isValid = ctrl.validate(true);\r\n\t\tif(isValid === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst checkboxVals = ctrl.checkboxes\r\n\t\t\t.filter(c => c.value === true)\r\n\t\t\t.map(c => c.code)\r\n\t\t\t.join(\",\");\r\n\r\n\t\tconst optionalValues = ctrl.checkboxes\r\n\t\t\t.filter(c => c.requiredField && c.value === true && ctrl[c.requiredField] !== undefined)\r\n\t\t\t.map(f => `(${f.requiredFieldDataCode}:${ctrl[f.requiredField]})`)\r\n\t\t\t.join(\",\");\r\n\r\n\t\tconst identifiersString = optionalValues !== \"\" ? `;[Identifiers:${optionalValues}]` : \"\";\r\n\r\n\t\tconst request = {\r\n\t\t\tEntity: `${ctrl.entityName} (${ctrl.entityCode}) [${ctrl.selectedTimeZone.ianaCode}];[Classifications:${checkboxVals}]${identifiersString}`,\r\n\t\t\tPhoneNumber: ctrl.phoneNumber,\r\n\t\t\tDateOfBirth: moment(ctrl.birthDate).isValid() ? moment(ctrl.birthDate).format() : undefined\r\n\t\t};\r\n\t\tconst user = $userProfile.getUser();\r\n\t\tawait loadingService.watch(api.post(FORMS_REQUEST(ctrl.selectedForm.Id, user.databaseId), request));\r\n\t\t\t\r\n\t\tclearModel();\r\n\t\tlet message = messages.submitted;\r\n\r\n\t\tif(ctrl.agencyPhone !== undefined && ctrl.agencyPhone.length > 0) {\r\n\t\t\tmessage = `${message}

    Please call ${ctrl.agencyPhone} for request status updates.`;\r\n\t\t}\r\n\t\tswal.fire({\r\n\t\t\ttitle: \"Request Submitted\",\r\n\t\t\thtml: message,\r\n\t\t\tshowCloseButton: true,\r\n\t\t\ttype: \"success\",\r\n\t\t\tshowCancelButton: false,\r\n\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\tconfirmButtonText: \"Okay\"\r\n\t\t});\r\n\t\t\r\n\t\tawait loadCurrentRequests(api, user);\r\n\t};\r\n\r\n\tctrl.openDatepicker = () => {\r\n\t\tctrl.popupOpen = !ctrl.popupOpen;\r\n\t};\r\n\r\n\tfunction setAgencyOptions() {\r\n\t\tconst selectionChoices = uiHelpers.setDisplay(\r\n\t\t\tctrl.agencies, \r\n\t\t\t{ \r\n\t\t\t\trecentlyUsedEnabled: false, \r\n\t\t\t\thideCode: true \r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tif(ctrl.agencyBox) {\r\n\t\t\tctrl.agencyBox.setChoices(selectionChoices, \"value\", \"label\", true);\r\n\t\t\tif(ctrl.selectedAgency !== undefined) {\r\n\t\t\t\tctrl.agencyBox.setValueByChoice(ctrl.selectedAgency.Id.toString());\r\n\t\t\t\tctrl.handleAgencyValueChanged(ctrl.selectedAgency.Id.toString());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setFormOptions() {\r\n\t\tif(!ctrl.formBox)\r\n\t\t\treturn;\r\n\r\n\t\tctrl.selectedForm = undefined;\r\n\t\tctrl.entityName = undefined;\r\n\t\tctrl.entityCode = undefined;\r\n\t\tctrl.phoneNumber = undefined;\r\n\t\tctrl.birthDate = undefined;\r\n\t\tctrl.hmsPermitNumber = undefined;\r\n\t\tctrl.formBox.clearStore();\r\n\r\n\t\tif(ctrl.forms.length === 0)\r\n\t\t\treturn;\r\n\r\n\t\tconst selectionChoices = uiHelpers.setDisplay(\r\n\t\t\tctrl.forms, \r\n\t\t\t{ \r\n\t\t\t\trecentlyUsedEnabled: false, \r\n\t\t\t\thideCode: true \r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tctrl.formBox.setChoices(selectionChoices, \"value\", \"label\", true);\r\n\t\t\r\n\t\t// autoselection needs to be done manually here, since the component loads with no active choices\r\n\t\tif(selectionChoices.length === 1) {\r\n\t\t\tctrl.formBox.setValueByChoice(selectionChoices[0].value);\r\n\t\t\tctrl.handleFormValueChanged(selectionChoices[0].value);\r\n\t\t}\r\n\t\telse if(ctrl.selectedForm !== undefined) {\r\n\t\t\tctrl.formBox.setValueByChoice(ctrl.selectedForm.Id.toString());\r\n\t\t\tctrl.handleFormValueChanged(ctrl.selectedForm.Id.toString());\r\n\t\t}\r\n\t}\r\n\r\n\tfunction clearModel() {\r\n\t\tctrl.entityName = undefined;\r\n\t\tctrl.entityCode = undefined;\r\n\t\tctrl.phoneNumber = undefined;\r\n\t\tctrl.birthDate = undefined;\r\n\t}\r\n\r\n\tasync function loadCurrentRequests(api, user) {\r\n\t\tif(ctrl.selectedForm?.Id) {\r\n\t\t\tconst userRequests = await loadingService.watch(api.get(FORMS_PENDING_REQUESTS(ctrl.selectedForm.Id, user.databaseId)));\r\n\r\n\t\t\tctrl.pendingRequests = userRequests?.filter(request => !request.IsProcessed);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.welcome\", [])\r\n\t.component(\"welcome\", { template, controller }).name;\r\n","export default \"
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    Welcome to
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t
    Let's get started by telling us who you report to.
    \\r\\n\\t\\t\\t
    Please submit the information below to request access to the correct form.
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n
    \\r\\n
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t 0\\\"\\r\\n\\t\\t\\t>\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t 0\\\"\\r\\n\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\tPending Requests\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t {{item.Entity}}\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\tPlease contact {{$ctrl.selectedForm.Agency.Name}} at {{$ctrl.agencyPhone}} if you have questions about your pending request.\\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t{{$ctrl.entityNomenclature}}\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\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t Submit \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\";","import {\r\n\tcompact,\r\n\tdebounce,\r\n\tevery,\r\n\tfilter,\r\n\tfind,\r\n\tflatten,\r\n\tflatMapDeep,\r\n\tforEach,\r\n\tgroupBy,\r\n\tkeyBy,\r\n\tmap,\r\n\tminBy,\r\n\torderBy,\r\n\treduce,\r\n\tsize,\r\n\tsome,\r\n\tstartsWith,\r\n\tuniq,\r\n\tvalues,\r\n\tcloneDeep\r\n} from \"lodash\";\r\nimport \"./edit-report.less\";\r\nimport template from \"./edit-report.html\";\r\nimport {\r\n\tFORM_REPORT_PREVIOUS,\r\n\tFORM_REPORT_NEXT,\r\n\tEDIT_REPORT,\r\n\tNEW_REPORT\r\n} from \"routes.js\";\r\nimport {\r\n\tEVENT_REPORT_LOCKED,\r\n\tEVENT_FILTER_CURRENT_OPTIONS,\r\n\tEVENT_PAGE_LOADED,\r\n\tEVENT_REPORT_STATUS_CHANGE,\r\n\tEVENT_REVERT_VALUES,\r\n\tEVENT_FILTER_PRIMARYDATE,\r\n\tEVENT_PROCESS_UI_RULES,\r\n\tEVENT_PROCESS_FILTER_RULES,\r\n\tEVENT_PROCESS_RULES_SETTLED,\r\n\tEVENT_PROCESS_VALIDATIONS,\r\n\tEVENT_SET_VALUE,\r\n\tEVENT_SET_DEFAULT_VALUE,\r\n\tEVENT_CLEAR_VALUE,\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_HOTKEY_LOCK,\r\n\tEVENT_TIMEZONE_SET,\r\n\tEVENT_REPORT_SAVED,\r\n\tEVENT_ENABLE_SUCCESSOR_LOCK,\r\n\tEVENT_DISABLE_SUCCESSOR_LOCK,\r\n\tEVENT_HANDLE_SUCCESSOR_LOCK,\r\n\tREPORT_SCOPES,\r\n\tFEATURE_TYPES,\r\n\tFIELD_TEMPLATES,\r\n\tPIVOT_TYPES,\r\n\tFORM_TIMEZONE_TYPES,\r\n\tTIME_ZONES,\r\n\tREAD_ONLY_MODES,\r\n\tEVENT_REPORT_UNLOCKED,\r\n\tEVENT_DETAIL_DIRTY,\r\n\tEVENT_DETAIL_TOGGLE,\r\n\tEVENT_DETAILS_SUPPRESSION_TOGGLED,\r\n\tEVENT_SET_FORM_PRISTINE,\r\n\tREPORT_STATES\r\n} from \"constants.js\";\r\nimport {\r\n\tCONDITION_EVALUATIONS,\r\n\tENGINE_EVALUATIONS,\r\n\tRULE_OPERATORS,\r\n\tTRIGGER_TYPES,\r\n\tUI_OPERATOR_TYPES,\r\n\tTRIGGER_OPERATOR_CODES\r\n} from \"screens/rule-provider/constants.js\";\r\nimport moment from \"moment\";\r\nimport hotkeyConfigs from \"../../services/hotkeyConfig\";\r\nimport { hasHadState } from \"../../utils\";\r\nimport {\r\n\tconfirmUnsavedChangesWillBeLost, \r\n\tconfirmWithdrawReport, \r\n\tconfirmDirtySubmission, \r\n\tconfirmRuleWarningsOnReport, \r\n\tnotifyTimezoneDiscrepancy,\r\n\tnotifyUserTimezoneError, \r\n\tnotifyFormTimezoneError,\r\n\tnotifyMultipleEntityTimezoneError,\r\n\tnotifyNoEntityTimezoneError, \r\n\tshowNotConnectedOnRefreshError,\r\n\tshowForceRefresh\r\n} from \"./prompts\";\r\nimport { UNIQUE_TIMEZONE_ERRORS } from \"../../services/entity-manager\";\r\nimport { globs } from \"../../services/globs\";\r\n\r\nimport { v4 as uuid } from \"uuid\";\r\n\r\nconst headerValuesKey = \"header\";\r\nconst detailValuesKey = \"details\";\r\n\r\nexport function controller(\r\n\t$state,\r\n\t$uibModal,\r\n\t$logger,\r\n\t$featureFlags,\r\n\t$scope,\r\n\t$transitions,\r\n\t$timeout,\r\n\tappState,\r\n\tapi,\r\n\tdetailHelper,\r\n\tloadingService,\r\n\ttoastr,\r\n\thotkeys,\r\n\teventBus,\r\n\treportHelper,\r\n\tfeatureHelper,\r\n\tvalidationServiceFactory,\r\n\tfilterService,\r\n\truleService, \r\n\tentityManager\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.detailValuesKey = detailValuesKey;\r\n\tctrl.errors = [];\r\n\tctrl.reportScopes = REPORT_SCOPES;\r\n\tctrl.permissions = appState.permissions.Reporting;\r\n\tctrl._unsubscribe = () => {};\r\n\tctrl.isProcessingRules = false;\r\n\r\n\tctrl.scope = $scope;\r\n\tctrl.$onInit = onInit;\r\n\tctrl.$onDestroy = onDestroy;\r\n\tctrl.handleDelete = handleDelete;\r\n\tctrl.handleWithdraw = handleWithdraw;\r\n\tctrl.handleRestore = handleRestore;\r\n\tctrl.handleDetailSave = debounce(handleDetailSave, 500, { leading: true });\r\n\tctrl.handleDetailSelected = handleDetailSelected;\r\n\tctrl.saveReport = debounce(saveReport, 500, { leading: true });\r\n\tctrl.handleSubmit = debounce(handleSubmit, 500, { leading: true });\r\n\tctrl.setCallbacks = setCallbacks;\r\n\tctrl.processRules = processRules;\r\n\tctrl.runDetailsRules = runDetailsRules;\r\n\tctrl.nextReport = debounce(nextReport, 500, { leading: true });\r\n\tctrl.createReport = debounce(createReport, 500, { leading: true });\r\n\tctrl.prevReport = debounce(prevReport, 500, { leading: true });\r\n\tctrl.editDetail = editDetail;\r\n\tctrl.triggerFilters = triggerFilters;\r\n\tctrl.validationScopes = [];\r\n\tctrl.eventBus = eventBus;\r\n\tctrl.suppressDetails = false;\r\n\tctrl.showAddDetail = true;\r\n\tctrl.fakeDetailValidation = {};\r\n\tctrl.detailModalIsOpen = false;\r\n\tctrl.showActionInfoBlock = $featureFlags.getFeature($featureFlags.FEATURES.ActionInfoBlock);\r\n\r\n\tctrl.canCopyToNew = globs.reporting.types(\"POSITIVE\").states(\"DELETED\").copy;\r\n\r\n\tconst submitEventBuilder = $logger.buildReportEvent(\"submit\");\r\n\tconst unsavedChangesEvent = $logger.buildReportEvent(\"browserNavigateAway\")(\"requested\");\r\n\tconst reportSaveEventBuilder = $logger.buildReportEvent(\"save\");\r\n\t\r\n\tctrl.alertUserIfDirty = e => {\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload\r\n\t\tif(ctrl.isReportDirty) {\r\n\t\t\t// Cancel the event\r\n\t\t\te.preventDefault(); // If you prevent default behavior in Mozilla Firefox prompt will always be shown\r\n\t\t\t// Chrome requires returnValue to be set\r\n\t\t\te.returnValue = \"\";\r\n\r\n\t\t\t$logger.event(unsavedChangesEvent, { report: ctrl.reportMetadata });\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.NEW_REPORT = NEW_REPORT;\r\n\tctrl.loaded = false;\r\n\r\n\tangular.element(document).ready(function() {\r\n\t\tctrl.loaded = true;\r\n\t\teventBus.trigger(EVENT_PAGE_LOADED);\r\n\t});\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.dirtyDetailTracking = {};\r\n\t\tctrl.isReportDirty = false;\r\n\t\tctrl.dirtyHeaderFields = {};\r\n\r\n\t\tctrl._unsubscribe = ctrl.ruleProvider.subscribe(() => {\r\n\t\t\tconst { errors } = ctrl.ruleProvider;\r\n\t\t\tctrl.errors = errors;\r\n\t\t});\r\n\r\n\t\tconst asyncInit = async() => {\r\n\t\t\tlet didFormReload = false;\r\n\t\t\tif(\r\n\t\t\t\t!ctrl.report \r\n\t\t\t\t&& (\r\n\t\t\t\t\t(!!appState.staleTimeoutAt && appState.staleTimeoutAt <= new Date())\r\n\t\t\t\t\t|| (!!appState.invalidTimeoutPadded && appState.invalidTimeoutPadded <= new Date())\r\n\t\t\t\t)\r\n\t\t\t) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tawait appState.reloadForm();\r\n\t\t\t\t\tdidFormReload = true;\r\n\t\t\t\t}\r\n\t\t\t\tcatch(err) {\r\n\t\t\t\t\t$logger.exception(err, \"form reload failed\");\r\n\t\t\t\t\treturn showNotConnectedOnRefreshError();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\tlet form = {};\r\n\t\t\ttry {\r\n\t\t\t\tform = cloneDeep(appState.forms.selected);\r\n\t\t\t}\r\n\t\t\tcatch(err) {\r\n\t\t\t\t$logger.exception(err, \"An error occurred while attempting to set the form\", { selected: appState.forms.selected });\r\n\t\t\t}\r\n\t\r\n\t\t\tinitLocks(form.Fields);\r\n\t\r\n\t\t\tctrl.form = {\r\n\t\t\t\t...form,\r\n\t\t\t\treportFields: form.Fields.filter(x => !x.IsDetail && !x.IsNegative),\r\n\t\t\t\tdetailFields: form.Fields.filter(x => x.IsDetail && !x.IsNegative),\r\n\t\t\t\tstaticDetailFields: form.Fields.filter(x => x.IsDetail && !x.Pivot),\r\n\t\t\t\tpivotedDetailFields: form.Fields.filter(x => x.IsDetail && !!x.Pivot)\r\n\t\t\t};\r\n\t\r\n\t\t\tsetReportMetadata();\r\n\t\r\n\t\t\tif(!ctrl.reportMetadata.isNew) {\r\n\t\t\t\t$state.current.title = `Edit ${ctrl.form.nomenclature.PositiveReport} #${ctrl.reportMetadata.report.Number}`;\r\n\t\t\t}\r\n\t\r\n\t\t\tctrl.footerNomenclature = ctrl.form.nomenclature.ReportFooter;\r\n\t\t\tappState.isNewReport = ctrl.reportMetadata.isNew;\r\n\t\r\n\t\t\tctrl.validationService = validationServiceFactory.getNewValidationService();\r\n\t\r\n\t\t\tctrl.validationService.init(ctrl.form.Rules, ctrl.form.Fields);\r\n\t\r\n\t\t\tinitializeFeatures(ctrl.form);\r\n\t\t\tsetFieldOptions(ctrl.form.Fields);\r\n\t\t\tsetupTimezoneOverride(ctrl.form.Fields);\r\n\t\r\n\t\t\tsetHotKeys();\r\n\t\t\tinitializeRules();\r\n\t\r\n\t\t\tregisterEvents();\r\n\r\n\t\t\tif(didFormReload && ctrl.loaded) {\r\n\t\t\t\t$timeout(() => eventBus.trigger(EVENT_PAGE_LOADED)); \r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tasyncInit();\r\n\t}\r\n\r\n\tfunction setReportMetadata(newReport) {\r\n\t\tnewReport = newReport || ctrl.report;\r\n\t\tconst reverseSortedHistory = (newReport?.History ?? [])\r\n\t\t\t.sort((a, b) => moment(a.Occurred).isBefore(b.Occurred) ? 1 : -1);\r\n\r\n\t\tctrl.reportMetadata = {\r\n\t\t\tinitial: JSON.stringify(newReport),\r\n\t\t\treport: {\r\n\t\t\t\t...newReport\r\n\t\t\t},\r\n\t\t\tvalidations: [],\r\n\t\t\thasErrors: false,\r\n\t\t\thasWarnings: false,\r\n\t\t\tisNew: !newReport || newReport.Id === undefined, \r\n\t\t\treverseSortedHistory\r\n\t\t};\r\n\r\n\t\tctrl.currentHistory = ctrl.reportMetadata.reverseSortedHistory?.[0];\r\n\r\n\t\tlet reportStateCopy = undefined;\r\n\r\n\t\tif(!!newReport) {\r\n\t\t\treportStateCopy = {\r\n\t\t\t\t...newReport\r\n\t\t\t};\r\n\t\t\tdelete reportStateCopy.Fields;\r\n\t\t}\r\n\t\truleService.setReportState(reportStateCopy);\r\n\r\n\t\tctrl.reportRules = !!ctrl.reportMetadata.report.Id ? [...(ctrl.reportMetadata.report.Rules ?? [])] : [];\r\n\t\tctrl.reportValues = groupReportValues();\r\n\t\tctrl.primaryEntityName = setPrimaryEntityName();\r\n\t}\r\n\r\n\tfunction setPrimaryEntityName(reportValues) {\r\n\t\treportValues = reportValues ?? ctrl.reportMetadata.report.Fields ?? [];\r\n\r\n\t\tconst primaryEntityFieldConfig = ctrl.form.Fields.find(f => f.IsPrimary === true && f.Type.IsEntity === true);\r\n\t\tconst primaryEntityValue = reportValues.find(v => v.FieldId === primaryEntityFieldConfig.Id);\r\n\t\tif(primaryEntityValue?.EntityId === undefined) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t\tconst primaryEntity = entityManager.findFriendlyByPrimaryId(primaryEntityFieldConfig.Data, primaryEntityValue.EntityId);\r\n\r\n\t\treturn primaryEntity.Name;\r\n\t}\r\n\r\n\tfunction groupReportValues(values) {\r\n\t\tconst report = values === undefined ? ctrl.reportMetadata.report : { ...ctrl.reportMetadata.report, Fields: values };\r\n\t\tconst reportValues = {\r\n\t\t\t[headerValuesKey]: [],\r\n\t\t\t[detailValuesKey]: {}\r\n\t\t};\r\n\r\n\t\tif(report?.Fields !== undefined) {\r\n\t\t\tconst isReportCopy = ctrl.report !== undefined && ctrl.report.Id === undefined;\r\n\t\t\tconst reportDetailValues = report.Fields.filter(v => v.DetailId !== undefined);\r\n\t\t\treportValues[headerValuesKey] = report.Fields.filter(v => v.DetailId === undefined);\r\n\r\n\t\t\tif(isReportCopy) {\r\n\t\t\t\treportValues[headerValuesKey].forEach(v => ctrl.dirtyHeaderFields[v.FieldId] = true);\r\n\t\t\t}\r\n\r\n\t\t\tconst detailsById = groupBy(reportDetailValues, v => v.DetailId);\r\n\t\t\tconst detailValues = {};\r\n\r\n\t\t\tforEach(detailsById, (vals, detailIdKey) => {\r\n\t\t\t\tconst detailId = parseInt(detailIdKey);\r\n\r\n\t\t\t\tif(isReportCopy) {\r\n\t\t\t\t\tctrl.dirtyDetailTracking[detailId] = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdetailValues[detailId] = {\r\n\t\t\t\t\tdetailId,\r\n\t\t\t\t\tvalues: keyBy(vals, v => v.FieldId),\r\n\t\t\t\t\tisDeleted: some(vals, v => v.IsDeleted),\r\n\t\t\t\t\tisNewDetail: isReportCopy\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\treportValues[detailValuesKey] = detailValues;\r\n\t\t}\r\n\r\n\t\treturn reportValues;\r\n\t}\r\n\r\n\tfunction registerEvents() {\r\n\t\tconst buildReportOpenedEvent = $logger.buildReportEvent(\"open\");\r\n\t\tconst primaryEntityFieldConfig = ctrl.form.Fields.find(f => f.IsPrimary === true && f.Type.IsEntity === true);\r\n\r\n\t\teventBus.register(EVENT_VALUE_CHANGED(primaryEntityFieldConfig.Id), (_, { value }) => {\r\n\t\t\tconst fieldValue = {\r\n\t\t\t\tFieldId: primaryEntityFieldConfig.Id,\r\n\t\t\t\tEntityId: value?.Id\r\n\t\t\t};\r\n\r\n\t\t\tctrl.primaryEntityName = setPrimaryEntityName([fieldValue]);\r\n\t\t});\r\n\r\n\t\teventBus.register(EVENT_REPORT_STATUS_CHANGE, (_, report) => updateRuleMetadata(report), ctrl.scope);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_PAGE_LOADED,\r\n\t\t\t() => {\r\n\t\t\t\tif(!ctrl.reportMetadata.isNew) {\r\n\t\t\t\t\tconst headerFields = ctrl.form.Fields.filter(f => f.IsDetail !== true);\r\n\t\t\t\t\ttriggerFilters(headerFields);\r\n\t\t\t\t\ttriggerAreaFilters();\r\n\r\n\t\t\t\t\tif(ctrl.currentHistory?.State.Code !== \"SUBMITTED\") {\r\n\t\t\t\t\t\ttriggerPrimaryDateFilter(undefined, false);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst uiValidations = ctrl.suppressErrors ? [] : ctrl.reportRules;\r\n\r\n\t\t\t\t\tctrl.validationService.updateApiValidations(uiValidations);\r\n\t\t\t\t\tctrl.validationService.commitValidations();\r\n\t\t\t\t\tsetReportState();\r\n\r\n\t\t\t\t\tctrl.pageIsLoaded = true;\r\n\t\t\t\t\teventBus.trigger(EVENT_PROCESS_UI_RULES, {});\r\n\t\t\t\t\tdisableLockOnDataFields();\r\n\r\n\t\t\t\t\t$logger.event(buildReportOpenedEvent(\"edited\"), { report: ctrl.reportMetadata });\r\n\t\t\t\t} else {\r\n\t\t\t\t\tctrl.pageIsLoaded = true;\r\n\t\t\t\t\ttriggerDefaultFieldValues();\r\n\t\t\t\t\teventBus.trigger(EVENT_PROCESS_UI_RULES, {});\r\n\r\n\t\t\t\t\tconst scopes = [REPORT_SCOPES.report];\r\n\r\n\t\t\t\t\tconst values = ctrl.ruleProvider.getValuesByType(scopes);\r\n\t\t\t\t\ttriggerFilters(undefined, values[REPORT_SCOPES.report]);\r\n\t\t\t\t\t$logger.event(buildReportOpenedEvent(\"started\"));\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tctrl.scope\r\n\t\t);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_REPORT_UNLOCKED,\r\n\t\t\t() => {\r\n\t\t\t\tsetReportReadonlyStatus();\r\n\r\n\t\t\t\tif(!ctrl.form.readonly) {\r\n\t\t\t\t\tsetFieldOptions(ctrl.form.Fields);\r\n\t\t\t\t\tdisableLockOnDataFields();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tctrl.scope\r\n\t\t);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_REPORT_LOCKED,\r\n\t\t\t() => {\r\n\t\t\t\teventBus.trigger(EVENT_SET_FORM_PRISTINE);\r\n\t\t\t},\r\n\t\t\tctrl.scope\r\n\t\t);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_DETAILS_SUPPRESSION_TOGGLED,\r\n\t\t\t(e, params) => {\r\n\t\t\t\tsetDetailsSuppressed(params.suppressed);\r\n\t\t\t},\r\n\t\t\tctrl.scope\r\n\t\t);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_DETAIL_DIRTY,\r\n\t\t\t(e, params) => {\r\n\t\t\t\tctrl.dirtyDetailTracking[params.detailId] = true;\r\n\t\t\t\tupdateReportDirty();\r\n\t\t\t},\r\n\t\t\tctrl.scope\r\n\t\t);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_DETAIL_TOGGLE,\r\n\t\t\t(e, params) => {\r\n\t\t\t\tif(ctrl.dirtyDetailTracking[params.detailId]) {\r\n\t\t\t\t\tdelete ctrl.dirtyDetailTracking[params.detailId];\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tctrl.dirtyDetailTracking[params.detailId] = true;\r\n\t\t\t\t}\r\n\t\t\t\tupdateReportDirty();\r\n\t\t\t\tdisableLockOnDataFields();\r\n\t\t\t\trunDetailsRules(undefined, params.detailId).then(triggeredRules => {\r\n\t\t\t\t\tctrl.validationService.updateTriggeredRules(triggeredRules, [ctrl.reportScopes.details, ctrl.reportScopes.detail, ctrl.reportScopes.reportAndDetails], params.detailId);\r\n\t\t\t\t\tctrl.validationService.commitValidations();\r\n\t\t\t\t\tsetReportState();\r\n\r\n\t\t\t\t\teventBus.trigger(EVENT_PROCESS_UI_RULES, {});\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\tctrl.scope\r\n\t\t);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_SET_FORM_PRISTINE,\r\n\t\t\t() => {\r\n\t\t\t\tctrl.dirtyDetailTracking = {};\r\n\t\t\t\tctrl.dirtyHeaderFields = {};\r\n\r\n\t\t\t\tupdateReportDirty();\r\n\t\t\t},\r\n\t\t\tctrl.scope\r\n\t\t);\r\n\r\n\t\twindow.addEventListener(\"beforeunload\", ctrl.alertUserIfDirty);\r\n\r\n\t\t$scope.$watch(\r\n\t\t\t() => ctrl.dirtyHeaderFields,\r\n\t\t\t() => {\r\n\t\t\t\tupdateReportDirty();\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tlistenForExit();\r\n\t}\r\n\r\n\tctrl.enableAddDetail = enable => {\r\n\t\tctrl.showAddDetail = enable;\r\n\t};\r\n\r\n\tfunction initLocks(fields) {\r\n\t\tforEach(fields, f => f.isFieldLockable = f.IsLockable);\r\n\t}\r\n\r\n\tfunction triggerDefaultFieldValues() {\r\n\t\tconst defaultValueFields = ctrl.form.Fields.filter(f => f.IsFieldDefaultEnabled === true);\r\n\t\tdefaultValueFields.forEach(f => {\r\n\t\t\teventBus.trigger(EVENT_SET_DEFAULT_VALUE(f.Id));\r\n\t\t});\r\n\t}\r\n\r\n\tfunction listenForExit() {\r\n\t\tctrl.deregisterTransitionHook = $transitions.onExit(\r\n\t\t\t{\r\n\t\t\t\tfrom: state => {\r\n\t\t\t\t\treturn state.name === NEW_REPORT || state.name === EDIT_REPORT;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t(transition, state) => {\r\n\t\t\t\tif(state.abstract !== true) {\r\n\t\t\t\t\tif(ctrl.isReportDirty && ctrl.currentHistory?.State.Code !== \"DELETED\") {\r\n\t\t\t\t\t\t$logger.event(unsavedChangesEvent, { report: ctrl.reportMetadata });\r\n\r\n\t\t\t\t\t\tif(!confirm(\"You have unsaved changes. Are you sure you want to leave this page?\")) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n\r\n\tfunction updateReportDirty() {\r\n\t\tctrl.isReportDirty = size(ctrl.dirtyHeaderFields) > 0 || size(ctrl.dirtyDetailTracking) > 0;\r\n\t\tif(ctrl.reportMetadata.isNew) {\r\n\t\t\t$state.current.title = `New ${ctrl.form.nomenclature.PositiveReport}`;\r\n\t\t}\r\n\t\telse if(ctrl.isReportDirty) {\r\n\t\t\t$state.current.title = `*Edit ${ctrl.form.nomenclature.PositiveReport} #${ctrl.reportMetadata.report.Number}`;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$state.current.title = `Edit ${ctrl.form.nomenclature.PositiveReport} #${ctrl.reportMetadata.report.Number}`;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setModifiedDates(show = false) {\r\n\t\tif(show) {\r\n\t\t\tctrl.suppressErrors = false;\r\n\t\t} else {\r\n\t\t\tctrl.suppressErrors = !!ctrl.reportMetadata.report.Created\r\n\t\t\t\t&& !!ctrl.reportMetadata.report.LastModified\r\n\t\t\t\t&& moment(ctrl.reportMetadata.report.Created).isSame(moment(ctrl.reportMetadata.report.LastModified), \"second\");\r\n\t\t}\r\n\r\n\t\tctrl.modifiedDates = { Created: ctrl.reportMetadata.report.Created, LastModified: ctrl.reportMetadata.report.LastModified };\r\n\t}\r\n\r\n\tfunction disableLockOnDataFields() {\r\n\t\tconst undeletedDetailsNested = filter(ctrl.reportValues[detailValuesKey], (val) => !val.isDeleted)\r\n\t\t\t.map(detail => map(detail.values));\r\n\r\n\t\tconst undeletedDetails = reduce(undeletedDetailsNested, (acc, curr) => {\r\n\t\t\treturn acc.concat(curr);\r\n\t\t}, []);\r\n\r\n\t\tconst lockOnDetailDataFields = ctrl.form.reportFields.filter(f => f.lockOnDetailData);\r\n\t\tforEach(lockOnDetailDataFields, f => {\r\n\t\t\tif(undeletedDetails && undeletedDetails.length > 0) {\r\n\t\t\t\tf.isReadonly = true;\r\n\t\t\t} else {\r\n\t\t\t\tf.isReadonly = ctrl.form.readonly;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction setReportReadonlyStatus() {\r\n\t\t//isReadonly -> field cannot be edited in form\r\n\t\t//isDisabled -> field needs something else to happen on the form before it can be modified\r\n\r\n\t\tctrl.form.readonly =\r\n\t\t\tctrl.currentHistory?.State.Code === \"DELETED\" ||\r\n\t\t\tctrl.currentHistory?.State.Code === \"SUBMITTED\" ||\r\n\t\t\tctrl.permissions.IsDisabled ||\r\n\t\t\t!ctrl.permissions.Actions.CanEdit ||\r\n\t\t\t(!ctrl.permissions.Actions.CanAmend && hasHadState(REPORT_STATES.submitted.code, ctrl.reportMetadata.report));\r\n\t}\r\n\r\n\tfunction setDetailsSuppressed(isSuppressed) {\r\n\t\tctrl.suppressDetails = isSuppressed;\r\n\t}\r\n\r\n\tfunction setupTimezoneOverride(fields) {\r\n\t\tconst dateFields = fields.filter(f => \r\n\t\t\tf.Template === FIELD_TEMPLATES.DateTime \r\n\t\t\t|| f.Template === FIELD_TEMPLATES.Date \r\n\t\t\t|| f.Template === FIELD_TEMPLATES.YearMonth\r\n\t\t);\r\n\t\t\r\n\t\tif(!dateFields || dateFields.length === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tconst registerDateTimeFieldsForTZAbbreviation = (timezoneCode) => {\r\n\t\t\tconst timezoneAbbr = find(TIME_ZONES, z => z.ianaCode === timezoneCode);\r\n\t\t\tdateFields.forEach(f => {\r\n\t\t\t\tf.timezone = timezoneCode;\r\n\t\t\t\tif(f.Template === FIELD_TEMPLATES.DateTime) {\r\n\t\t\t\t\teventBus.register(\r\n\t\t\t\t\t\tEVENT_VALUE_CHANGED(f.Id),\r\n\t\t\t\t\t\t(e, params) => {\r\n\t\t\t\t\t\t\tf.tzAbbr = timezoneAbbr.code(params.value.date);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t$scope\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif(ctrl.form.TimeMode.Code === FORM_TIMEZONE_TYPES.ByUser) {\r\n\t\t\t// TODO:\r\n\t\t\t// registerDateTimeFieldsForTZAbbreviation(*user*.TimeZone.Code);\r\n\t\t\t// if(ctrl.reportMetadata.report.TimeZone && ctrl.reportMetadata.report.TimeZone.Code !== *user*.TimeZone.Code) {\r\n\t\t\t//\tnotifyUserTimezoneError();\r\n\t\t\t// \tthrow new Error();\r\n\t\t\t// }\r\n\r\n\t\t\tnotifyUserTimezoneError();\r\n\t\t\tthrow new Error(\"Not implemented by-user timemode for resolution\");\r\n\t\t}\t\t\r\n\r\n\t\tif(ctrl.form.TimeMode.Code === FORM_TIMEZONE_TYPES.ByForm) {\r\n\t\t\tregisterDateTimeFieldsForTZAbbreviation(ctrl.form.TimeZone.Code);\r\n\t\t\tif(ctrl.reportMetadata.report.TimeZone && ctrl.reportMetadata.report.TimeZone.Code !== ctrl.form.TimeZone.Code) {\r\n\t\t\t\tnotifyFormTimezoneError(ctrl.reportMetadata.report.TimeZone.Code, ctrl.form.TimeZone.Code);\r\n\r\n\t\t\t\tthrow new Error(\"Unexpected time mode form in timezone resolution\");\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst primaryEntityField = find(fields, f => f.IsPrimary && (f.Type.Code === \"ENTITY\" || f.Type.Code === \"ENTITYCONTACT\"));\r\n\t\tprimaryEntityField.setEntityTimezone = true;\r\n\r\n\t\tif(ctrl.reportMetadata.report.TimeZone) {\r\n\t\t\tconst thisReportEntityValue = ctrl.reportMetadata.report.Fields.find(f => f.FieldId === primaryEntityField.Id);\r\n\t\t\tconst thisReportEntityTimezoneCode = entityManager.getUniqueTimezoneForEntity(primaryEntityField.Id, thisReportEntityValue.EntityId);\r\n\t\t\t\r\n\t\t\tif(thisReportEntityTimezoneCode === UNIQUE_TIMEZONE_ERRORS.MULTIPLE) {\r\n\t\t\t\tnotifyMultipleEntityTimezoneError(primaryEntityField.Name);\r\n\t\t\t\tthrow new Error(\"Selected entity has multiple available timezones in ByEntity configuration\");\r\n\t\t\t}\r\n\t\t\telse if(thisReportEntityTimezoneCode === UNIQUE_TIMEZONE_ERRORS.ZERO) {\r\n\t\t\t\tnotifyNoEntityTimezoneError(primaryEntityField.Name);\r\n\t\t\t\tthrow new Error(\"Selected entity has no available timezones in ByEntity configuration\");\r\n\t\t\t}\r\n\r\n\t\t\tif(thisReportEntityTimezoneCode !== ctrl.reportMetadata.report.TimeZone.Code) {\r\n\t\t\t\tnotifyTimezoneDiscrepancy(ctrl.reportMetadata.report.TimeZone.Code, thisReportEntityTimezoneCode, primaryEntityField.Name);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdateFields.forEach(field => {\r\n\t\t\tlet timezoneAbbr;\r\n\t\t\tlet lastVal;\r\n\r\n\t\t\tfield.needsTimezone = true;\r\n\r\n\t\t\teventBus.register(\r\n\t\t\t\tEVENT_TIMEZONE_SET(primaryEntityField.Id),\r\n\t\t\t\t(e, params) => {\r\n\t\t\t\t\tfield.timezone = params.value;\r\n\r\n\t\t\t\t\tif(field.Template === FIELD_TEMPLATES.DateTime) {\r\n\t\t\t\t\t\ttimezoneAbbr = find(TIME_ZONES, z => z.ianaCode === params.value);\r\n\t\t\t\t\t\tfield.tzAbbr = timezoneAbbr.code(lastVal);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t$scope\r\n\t\t\t);\r\n\r\n\t\t\tif(field.Template === FIELD_TEMPLATES.DateTime) {\r\n\t\t\t\teventBus.register(\r\n\t\t\t\t\tEVENT_VALUE_CHANGED(field.Id),\r\n\t\t\t\t\t(e, params) => {\r\n\t\t\t\t\t\tlastVal = params.value.date;\r\n\t\t\t\t\t\tif(timezoneAbbr) {\r\n\t\t\t\t\t\t\tfield.tzAbbr = timezoneAbbr.code(lastVal);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\t$scope\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction setFieldOptions(fields) {\r\n\t\tsetReportReadonlyStatus();\r\n\t\tfields.forEach(field => {\r\n\t\t\tif(field.Template === FIELD_TEMPLATES.Number) {\r\n\t\t\t\tconst isSimpleRangeRule = (rule) => some(rule.appliedFieldIds, y => y === field.Id)\r\n\t\t\t\t\t&& rule.Conditions !== undefined\r\n\t\t\t\t\t&& rule.Conditions.length === 1\r\n\t\t\t\t\t&& rule.Engine !== undefined\r\n\t\t\t\t\t&& rule.Engine.Code === ENGINE_EVALUATIONS.range.code;\r\n\r\n\t\t\t\tconst rangeRule = filter(\r\n\t\t\t\t\tctrl.form.Rules,\r\n\t\t\t\t\tr => {\r\n\t\t\t\t\t\tconst hasChildRangeRule = () => some(r.appliedFieldIds, y => y === field.Id)\r\n\t\t\t\t\t\t\t&& r.Operator\r\n\t\t\t\t\t\t\t&& r.Operator.Code === RULE_OPERATORS.OR\r\n\t\t\t\t\t\t\t&& r.Children\r\n\t\t\t\t\t\t\t&& r.Children.length > 0\r\n\t\t\t\t\t\t\t&& filter(r.Children, c => isSimpleRangeRule(c)).length === 1;\r\n\r\n\t\t\t\t\t\tconst srr = isSimpleRangeRule(r);\r\n\t\t\t\t\t\tconst hcrr = hasChildRangeRule();\r\n\r\n\t\t\t\t\t\treturn srr || hcrr;\r\n\t\t\t\t\t}\r\n\t\t\t\t)[0];\r\n\r\n\t\t\t\tif(rangeRule?.Children !== undefined) {\r\n\t\t\t\t\tconst range = find(rangeRule.Children, y =>\r\n\t\t\t\t\t\ty.Children === undefined && y.Engine.Code === ENGINE_EVALUATIONS.range.code\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tif(!!range && some(rangeRule.Children, y => y.Children === undefined && y.Engine.Code === ENGINE_EVALUATIONS.empty.code)) {\r\n\t\t\t\t\t\tfield.MaxValue = range.Conditions[0].MaxValue;\r\n\t\t\t\t\t\tfield.MinValue = range.Conditions[0].MinValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if(rangeRule?.Conditions !== undefined) {\r\n\t\t\t\t\tfield.MaxValue = rangeRule.Conditions[0].MaxValue;\r\n\t\t\t\t\tfield.MinValue = rangeRule.Conditions[0].MinValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfield.isTiered = (field.Type.Code === \"ENTITY\" || field.Type.Code === \"ENTITYCONTACT\") && !field.isSelf;\r\n\t\t\tsetFieldSize(field);\r\n\r\n\t\t\tif(!field.isTiered && field.Template === FIELD_TEMPLATES.EntitySelector) field.Template = FIELD_TEMPLATES.Selection;\r\n\r\n\t\t\tif(field.Template === \"TextArea\") {\r\n\t\t\t\tfield.MaxValue = 300;\r\n\t\t\t}\r\n\r\n\t\t\tfield.isRequired = some(ctrl.form.Rules, r => r.Engine && r.Engine.Code === ENGINE_EVALUATIONS.required.code && some(r.Conditions, c => c.Field.Id === field.Id));\r\n\r\n\t\t\tfield.hasEffectiveRanges = field.Type.IsEntity && some(field.Data, data => { \r\n\t\t\t\treturn data.Effective?.length > 0 \r\n\t\t\t\t\t|| (\r\n\t\t\t\t\t\tdata.Entities \r\n\t\t\t\t\t\t&& some(data.Entities, e => e.Entity.Effective?.length > 0)\r\n\t\t\t\t\t);\r\n\t\t\t});\r\n\r\n\t\t\tif(ctrl.form.readonly) {\r\n\t\t\t\tfield.isReadonly = true;\r\n\t\t\t} else {\r\n\t\t\t\tif(ctrl.reportMetadata.isNew || field.IsDetail) {\r\n\t\t\t\t\tfield.isReadonly = false;\r\n\t\t\t\t\tinitializeNewField(field, fields);\r\n\t\t\t\t} \r\n\t\t\t\telse if(field.ReadOnlyMode === READ_ONLY_MODES.afterCreate) {\r\n\t\t\t\t\tfield.isReadonly = true;\r\n\t\t\t\t} \r\n\t\t\t\telse {\r\n\t\t\t\t\tconst fieldValue = find(ctrl.reportValues[headerValuesKey], f => f.FieldId === field.Id);\r\n\t\t\t\t\tif(field.ReadOnlyMode === READ_ONLY_MODES.afterFirstSet && !!fieldValue) {\r\n\t\t\t\t\t\tfield.isReadonly = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfield.isReadonly = false;\r\n\t\t\t\t\t\tdisableLockOnDataFields();\r\n\r\n\t\t\t\t\t\tif(field.Template !== FIELD_TEMPLATES.Text || !field.Data || field.Data.length === 0) {\r\n\t\t\t\t\t\t\tfield.isDisabled = fieldValue && fieldValue.IsNotAvailable;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(field.ReadOnlyMode === READ_ONLY_MODES.system || field.ReadOnlyMode === READ_ONLY_MODES.always) {\r\n\t\t\t\t\tfield.isReadonly = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction initializeNewField(field) {\r\n\t\tif(!field.isLocked) {\r\n\t\t\teventBus.trigger(EVENT_CLEAR_VALUE(field.Id), { isInitializing: true });\r\n\t\t\tfield.hasValidationError = false;\r\n\t\t\tfield.hasValidationWarning = false;\r\n\t\t\tfield.validationErrorRepeatIds = [];\r\n\t\t\tfield.validationWarningRepeatIds = [];\r\n\r\n\t\t\tconst parentFields = filter(\r\n\t\t\t\tfield.features,\r\n\t\t\t\tf => f.type === FEATURE_TYPES.filter && f.triggerFieldId && f.triggerFieldId !== field.Id && !find(ctrl.form.Fields, fi => fi.Id === f.triggerFieldId).isLocked\r\n\t\t\t);\r\n\r\n\t\t\tfield.isDisabled = field.hasEffectiveRanges || !!parentFields.length || some(field.features, f => f.Type === FEATURE_TYPES.mapPoint && f.geoJsons === undefined);\r\n\t\t\tfield.isLocked = field.IsSticky;\r\n\r\n\t\t\tif(field.hasEffectiveRanges) {\r\n\t\t\t\tfield.placeHolder = `Please select a ${ctrl.form.nomenclature.PrimaryDate}`;\r\n\t\t\t\tif(field.IsDetail) {\r\n\t\t\t\t\tregisterDetailFieldForPrimaryDate(field);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(parentFields.length) {\r\n\t\t\t\tconst names = parentFields.map(pf => {\r\n\t\t\t\t\treturn (find(ctrl.form.Fields, fi => fi.Id === pf.triggerFieldId) || {}).Name;\r\n\t\t\t\t});\r\n\t\t\t\tfield.placeHolder = `Please select ${names.join(\",\")}`;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction registerDetailFieldForPrimaryDate(field) {\r\n\t\teventBus.register(\r\n\t\t\tEVENT_FILTER_PRIMARYDATE,\r\n\t\t\t(payload, date) => {\r\n\t\t\t\tfield.primaryDate = date;\r\n\t\t\t\tfield.isDisabled = false;\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\t}\r\n\r\n\tfunction setFieldSize(field) {\r\n\t\tlet size = \"col-md-4 col-sm-6 col-print-4\";\r\n\r\n\t\tif(field.IsSmall) {\r\n\t\t\tsize = \"col-md-2 col-sm-3 col-print-2\";\r\n\t\t}\r\n\t\telse if(field.IsFullWidth) {\r\n\t\t\tsize = \"col-md-12 col-sm-12 col-print-12\";\r\n\t\t}\r\n\t\t\r\n\t\tif(field.Template === FIELD_TEMPLATES.EntityContactSelector) {\r\n\t\t\tsize = \"col-md-8 col-sm-12 col-print-8\";\r\n\t\t}\r\n\r\n\t\tfield.size = size;\r\n\t}\r\n\r\n\tfunction initializeFeatures(form) {\r\n\t\tform.Features.forEach(feat => {\r\n\t\t\tif(feat.Type === FEATURE_TYPES.mapPoint) {\r\n\t\t\t\tfeatureHelper.mapPoint(feat, form.Fields, $scope);\r\n\t\t\t} else {\r\n\t\t\t\tfeat.Fields.forEach(featureField => {\r\n\t\t\t\t\tconst field = find(form.Fields, f => featureField.Field.Id == f.Id);\r\n\t\t\t\t\tconst trigger = find(feat.Fields, { Order: featureField.Order - 1 }) || { Field: {} };\r\n\r\n\t\t\t\t\tconst featureProperties = {\r\n\t\t\t\t\t\ttype: feat.Type,\r\n\t\t\t\t\t\tisInitiator: some(feat.Fields, x => x.Order > featureField.Order),\r\n\t\t\t\t\t\tfieldFeature: featureField,\r\n\t\t\t\t\t\ttriggerFieldId: trigger.Field.Id\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tif(featureProperties.triggerFieldId && feat.Type === FEATURE_TYPES.filter) {\r\n\t\t\t\t\t\tregisterFilterEvent(feat, featureField, featureProperties.triggerFieldId);\r\n\t\t\t\t\t\tif(!field.Pivot || field.Pivot !== PIVOT_TYPES.Repeat) {\r\n\t\t\t\t\t\t\tfield.triggerFieldId = trigger.Field.Id;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst triggerField = find(form.Fields, f => featureProperties.triggerFieldId == f.Id);\r\n\t\t\t\t\t\tif(triggerField.Pivot && triggerField.Pivot !== PIVOT_TYPES.Repeat) {\r\n\t\t\t\t\t\t\tforEach(triggerField.Data, dataItem => {\r\n\t\t\t\t\t\t\t\tregisterFilterEvent(feat, featureField, featureProperties.triggerFieldId, dataItem.Id);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(!triggerField.IsDetail && !!field.IsDetail) {\r\n\t\t\t\t\t\t\ttriggerField.lockOnDetailData = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if(feat.Type === FEATURE_TYPES.map) {\r\n\t\t\t\t\t\tfeatureProperties.data = feat.data;\r\n\t\t\t\t\t} else if(feat.Type === FEATURE_TYPES.propagate && featureProperties.triggerFieldId) {\r\n\t\t\t\t\t\teventBus.register(\r\n\t\t\t\t\t\t\tEVENT_VALUE_CHANGED(featureProperties.triggerFieldId),\r\n\t\t\t\t\t\t\t(e, params) => {\r\n\t\t\t\t\t\t\t\tconst currentValues = getAllValues(true);\r\n\t\t\t\t\t\t\t\tconst thisCurrentValue = currentValues.find(v => v.FieldId === field.Id);\r\n\r\n\t\t\t\t\t\t\t\tif(thisCurrentValue === undefined) {\r\n\t\t\t\t\t\t\t\t\teventBus.trigger(EVENT_SET_VALUE(field.Id), { value: params.value });\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t$scope\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!field.features) {\r\n\t\t\t\t\t\tfield.features = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfield.features.push(featureProperties);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction registerFilterEvent(feature, featureField, triggerFieldId, repeatId) {\r\n\t\teventBus.register(EVENT_VALUE_CHANGED(triggerFieldId, repeatId), (e, params) => handleFilterEvent(params, triggerFieldId, feature, featureField, repeatId), $scope);\r\n\t\teventBus.register(EVENT_ENABLE_SUCCESSOR_LOCK(triggerFieldId, undefined), () => {\r\n\t\t\teventBus.trigger(EVENT_HANDLE_SUCCESSOR_LOCK(featureField.Field.Id), { enable: true });\r\n\t\t}, $scope);\r\n\t\teventBus.register(EVENT_DISABLE_SUCCESSOR_LOCK(triggerFieldId, undefined), () => {\r\n\t\t\teventBus.trigger(EVENT_HANDLE_SUCCESSOR_LOCK(featureField.Field.Id), { enable: false });\r\n\t\t}, $scope);\r\n\t}\r\n\r\n\tfunction handleFilterEvent(params, triggerFieldId, feature, featureField, repeatId) {\r\n\t\tconst selectedField = find(feature.Fields, fi => fi.Field.Id === params.field.Id);\r\n\r\n\t\tif(params.refilterThis === true) {\r\n\t\t\tconst previousField = find(feature.Fields, fi => fi.Order === selectedField.Order - 1);\r\n\t\t\texecuteFilter(previousField, selectedField);\r\n\t\t}\r\n\r\n\t\tif(!params.value) {\r\n\t\t\teventBus.trigger(EVENT_FILTER_CURRENT_OPTIONS(featureField.Field.Id), { clear: true, readonly: true });\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tselectedField.value = params.value;\r\n\r\n\t\texecuteFilter(selectedField, featureField);\r\n\r\n\t\tfunction executeFilter(filterField, thisField) {\r\n\t\t\tconst selectedFields = filter(feature.Fields, d => d.value && d.Order <= filterField.Order);\r\n\t\t\tconst results = orderBy(selectedFields, d => d.Order).map(i => {\r\n\t\t\t\tif(Array.isArray(i.value)) {\r\n\t\t\t\t\treturn i.value.join();\r\n\t\t\t\t}\r\n\t\t\t\treturn i.value.Id;\r\n\t\t\t});\r\n\t\t\tconst searchBy = results.join(\",\") + \",\";\r\n\t\t\tconst filtered = filter(feature.data, d => {\r\n\t\t\t\treturn startsWith(d, searchBy);\r\n\t\t\t});\r\n\t\t\tconst nextIds = compact(\r\n\t\t\t\tfiltered.map(f => {\r\n\t\t\t\t\tconst truncatedData = f.substring(searchBy.length, f.length);\r\n\t\t\t\t\tconst end = truncatedData.indexOf(\",\");\r\n\r\n\t\t\t\t\tconst endData = end === -1 ? truncatedData : truncatedData.substring(0, end);\r\n\r\n\t\t\t\t\tif(endData.trim() === \"$[NA]$\") {\r\n\t\t\t\t\t\t//NOTE: endData ends in an invisible newline character. Don't use that.\r\n\t\t\t\t\t\treturn \"$[NA]$\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn parseInt(end === -1 ? truncatedData : truncatedData.substring(0, end));\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t\t\tconst distinctIds = uniq(nextIds);\r\n\r\n\t\t\teventBus.trigger(EVENT_FILTER_CURRENT_OPTIONS(thisField.Field.Id, repeatId), { ids: distinctIds, isFromInitialValue: params.initialValue, forceTrigger: true });\r\n\t\t}\r\n\t}\r\n\r\n\tfunction onDestroy() {\r\n\t\tctrl.deregisterTransitionHook();\r\n\t\tctrl._unsubscribe();\r\n\t\tctrl.detailModalInstance && ctrl.detailModalInstance.dismiss(\"instance dismiss\");\r\n\t\twindow.removeEventListener(\"beforeunload\", ctrl.alertUserIfDirty);\r\n\t}\r\n\r\n\tfunction setHotKeys() {\r\n\t\thotkeys.bindTo($scope).add(hotkeyConfigs.EDIT_REPORT.DIAGNOSTICS(() => {\r\n\t\t\t$logger.debug(`loaded: ${location.protocol}//${location.hostname}${(location.port ? \":\" + location.port : \"\")}/report/dx?b64=${btoa(ctrl.reportMetadata.initial)}`);\r\n\t\t\t$logger.debug(`current: ${location.protocol}//${location.hostname}${(location.port ? \":\" + location.port : \"\")}/report/dx?b64=${btoa(JSON.stringify(ctrl.reportMetadata.report))}`);\r\n\t\t\t$logger.debug(\"metadata\", {\r\n\t\t\t\tmetadata: ctrl.reportMetadata\r\n\t\t\t});\r\n\t\t}));\r\n\r\n\t\tconst hasLockableFields = some(ctrl.form.reportFields, f => f.IsLockable);\r\n\r\n\t\tif(hasLockableFields) {\r\n\t\t\thotkeys.bindTo($scope).add(\r\n\t\t\t\thotkeyConfigs.EDIT_REPORT.DETAILS.LOCK_FIELD(() => {\r\n\t\t\t\t\tctrl.eventBus.trigger(EVENT_HOTKEY_LOCK);\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\thotkeys.bindTo($scope).add(\r\n\t\t\thotkeyConfigs.EDIT_REPORT.ADD_DETAIL(() => {\r\n\t\t\t\tctrl.editDetail();\r\n\t\t\t})\r\n\t\t);\r\n\r\n\t\tif(ctrl.scope && ctrl.scope.getForm) {\r\n\t\t\thotkeys.bindTo($scope).add(\r\n\t\t\t\thotkeyConfigs.EDIT_REPORT.SAVE_HEADER(() => {\r\n\t\t\t\t\tctrl.scope.getForm().$submit();\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setCallbacks(callbacks) {\r\n\t\tctrl.setValidationsForDetails = validations => callbacks.setValidations(validations);\r\n\t}\r\n\r\n\tfunction blockSave(rules) {\r\n\t\tif((rules || {}).length === 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst nonUniqueRules = some(\r\n\t\t\trules,\r\n\t\t\tr =>\r\n\t\t\t\t(r.Engine || {}).Code !== \"UNIQUE\" ||\r\n\t\t\t\t(r.Engine || {}).Code !== \"INTERSECT\" ||\r\n\t\t\t\t(r.Engine || {}).Code !== \"EXISTING\" ||\r\n\t\t\t\tsome(r.Children, c => c.Engine.Code !== \"UNIQUE\" || c.Engine.Code !== \"INTERSECT\" || c.Engine.Code !== \"EXISTING\")\r\n\t\t);\r\n\r\n\t\treturn nonUniqueRules;\r\n\t}\r\n\r\n\tconst propertiesToStrip = [\r\n\t\t\"repeatId\", \r\n\t\t\"isDirty\",\r\n\t\t\"_code\", \r\n\t\t\"Classifications\",\r\n\t\t\"Identifiers\",\r\n\t\t\"Seasons\", \r\n\t\t\"Order\",\r\n\t\t\"DeactivatedAt\",\r\n\t\t\"factor\",\r\n\t\t\"factoredValue\",\r\n\t\t\"hasResultForRuleRun\",\r\n\t\t\"hasFullResult\"\r\n\t];\r\n\r\n\tconst whitelistedProperties = [\r\n\t\t\"ParentDetailLinkKey\",\r\n\t\t\"DetailLinkKey\",\r\n\t\t\"FieldId\",\r\n\t\t\"DataId\",\r\n\t\t\"EntityId\",\r\n\t\t\"Number\",\r\n\t\t\"Date\",\r\n\t\t\"isDeleted\",\r\n\t\t\"IsDeleted\",\r\n\t\t\"DetailId\",\r\n\t\t\"IsNotAvailable\",\r\n\t\t\"String\",\r\n\t\t\"ContactId\",\r\n\t\t\"Latitude\",\r\n\t\t\"Longitude\",\r\n\t\t\"Boolean\"\r\n\t];\r\n\t\r\n\tconst cleanValue = (value) => {\r\n\t\tconst returnVal = {\r\n\t\t\t...value\r\n\t\t};\r\n\r\n\t\tif(!!returnVal.Detail) {\r\n\t\t\tdelete returnVal.Detail;\r\n\t\t}\r\n\r\n\t\tpropertiesToStrip.forEach(p => {\r\n\t\t\tif(Object.prototype.hasOwnProperty.call(returnVal, p)) {\r\n\t\t\t\tdelete returnVal[p];\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst nonWhitelistedPropertiesRemaining = Object.keys(returnVal).filter(k => whitelistedProperties.indexOf(k) === -1);\r\n\r\n\t\treturn { returnVal, nonWhitelistedPropertiesRemaining };\r\n\t};\r\n\r\n\tfunction getAllValues(isApi = false) {\r\n\t\tlet headerVals = ctrl.getFormValues(isApi);\r\n\t\tif(headerVals == null) {\r\n\t\t\tthrow new Error(\"Invalid field value discovered\");\r\n\t\t}\r\n\t\tconst allNonWhitelistedProperties = [];\r\n\r\n\t\tif(isApi) {\r\n\t\t\theaderVals = headerVals.map(v => {\r\n\t\t\t\tconst { returnVal, nonWhitelistedPropertiesRemaining } = cleanValue(v); \r\n\t\t\t\tif(nonWhitelistedPropertiesRemaining?.length) {\r\n\t\t\t\t\tallNonWhitelistedProperties.push(...nonWhitelistedPropertiesRemaining);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn returnVal;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(ctrl.suppressDetails) {\r\n\t\t\treturn headerVals;\r\n\t\t}\r\n\r\n\t\tconst detailValArray = flatten(map(ctrl.reportValues[detailValuesKey], d => {\r\n\t\t\treturn Object.values(d.values)\r\n\t\t\t\t.map(v => {\r\n\t\t\t\t\tif(!isApi) {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t...v\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tconst { returnVal, nonWhitelistedPropertiesRemaining } = cleanValue(v);\r\n\t\t\t\t\tif(nonWhitelistedPropertiesRemaining?.length) {\r\n\t\t\t\t\t\tallNonWhitelistedProperties.push(...nonWhitelistedPropertiesRemaining);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(d.isNewDetail) {\r\n\t\t\t\t\t\tdelete returnVal.DetailId;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn returnVal;\r\n\t\t\t\t})\r\n\t\t\t\t.filter(returnVal => {\r\n\t\t\t\t\tconst valueConfig = ctrl.form.detailFields.find(f => f.Id === returnVal.FieldId);\r\n\t\t\t\t\tif(!Object.prototype.hasOwnProperty.call(returnVal, \"Number\") && valueConfig.Type.Code === \"NUMBER\") {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn returnVal.FieldId > -1\r\n\t\t\t\t\t\t&& returnVal.isDeleted !== true;\r\n\t\t\t\t});\r\n\t\t}));\r\n\r\n\t\tif(allNonWhitelistedProperties.length > 0) {\r\n\t\t\tconst uniqueNonWhitelistedProperties = uniq(allNonWhitelistedProperties);\r\n\r\n\t\t\t$logger.warn(\r\n\t\t\t\t\"Detected non-whitelisted properties being allowed through field value cleanup\",\r\n\t\t\t\t{\r\n\t\t\t\t\tproperties: uniqueNonWhitelistedProperties\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn headerVals.concat(detailValArray);\r\n\t}\r\n\r\n\tfunction saveReport() {\r\n\t\tif(ctrl.reportMetadata.isNew && !!appState.invalidTimeoutAt && appState.invalidTimeoutAt <= new Date()) {\r\n\t\t\tshowForceRefresh();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst allValues = getAllValues(true);\r\n\t\ttriggerPrimaryDateFilter(allValues);\r\n\t\treturn handleSave(getAllValues(true));\r\n\t}\r\n\r\n\tfunction handleSave(updates) {\r\n\t\tconst scopes = [ctrl.reportScopes.report, ctrl.reportScopes.details, ctrl.reportScopes.reportAndDetails, ctrl.reportScopes.metadata];\r\n\r\n\t\tif(ctrl.suppressDetails) {\r\n\t\t\tctrl.reportValues[detailValuesKey] = {}; // wipe here in order to avoid deleting details in an intermediary state\r\n\t\t}\r\n\r\n\t\treturn ctrl.ruleProvider.validate(scopes).then(rules => {\r\n\t\t\t$logger.event(reportSaveEventBuilder(\"requested\"), { \r\n\t\t\t\treport: ctrl.reportMetadata,\r\n\t\t\t\trules\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tctrl.validationService.updateTriggeredRules(rules, scopes);\r\n\t\t\tctrl.validationService.commitValidations();\r\n\t\t\tsetReportState();\r\n\r\n\t\t\tconst type = ctrl.validationService.getRuleValidationsOfType(TRIGGER_OPERATOR_CODES.blockSave);\r\n\r\n\t\t\tif(blockSave(type.rules)) {\r\n\t\t\t\t$logger.event(reportSaveEventBuilder(\"blocked\"), { \r\n\t\t\t\t\treport: ctrl.reportMetadata,\r\n\t\t\t\t\trules\r\n\t\t\t\t});\r\n\r\n\t\t\t\ttoastr.error(\"There are errors preventing you from saving this data.\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst isNewReport = ctrl.reportMetadata.isNew;\r\n\t\t\treturn reportHelper.saveReport(updates, ctrl.reportMetadata.report)\r\n\t\t\t\t.then(resp => {\r\n\t\t\t\t\t$logger.event(reportSaveEventBuilder(\"succeeded\"), {\r\n\t\t\t\t\t\t\"form-id\": ctrl.form.Id,\r\n\t\t\t\t\t\t\"report-id\": resp.Id,\r\n\t\t\t\t\t\tisNewReport\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tsetReportMetadata(resp);\r\n\r\n\t\t\t\t\tsetApiValidations(resp.Rules, isNewReport);\r\n\t\t\t\t\tctrl.validationService.commitValidations();\r\n\t\t\t\t\tsetReportState();\r\n\r\n\t\t\t\t\tctrl.reportMetadata.report = resp;\r\n\r\n\t\t\t\t\tctrl.form = appState.setRecentlyUsed(ctrl.form, updates);\r\n\r\n\t\t\t\t\tsetModifiedDates(isNewReport);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(isNewReport) {\r\n\t\t\t\t\t\tctrl.dirtyDetailTracking = {};\r\n\t\t\t\t\t\tctrl.dirtyHeaderFields = {};\r\n\t\t\t\t\t\tctrl.isReportDirty = false;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$state.go(\r\n\t\t\t\t\t\t\tEDIT_REPORT,\r\n\t\t\t\t\t\t\t{ id: resp.Id, report: ctrl.reportMetadata.report },\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tlocation: \"replace\",\r\n\t\t\t\t\t\t\t\tcustom: {\r\n\t\t\t\t\t\t\t\t\tshowValidations: true,\r\n\t\t\t\t\t\t\t\t\tisNewReport\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst readOnlyModeFields = ctrl.form.Fields.filter(f => !!f.ReadOnlyMode);\r\n\t\t\t\t\tforEach(readOnlyModeFields, f => {\r\n\t\t\t\t\t\tif(f.ReadOnlyMode === READ_ONLY_MODES.afterCreate) {\r\n\t\t\t\t\t\t\tf.isReadonly = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tconst fieldVal = find(ctrl.reportMetadata.report.Fields, v => v.FieldId === f.Id);\r\n\t\t\t\t\t\t\tif(!!fieldVal) {\r\n\t\t\t\t\t\t\t\tf.isReadonly = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\ttoastr.success(`${ctrl.form.nomenclature.PositiveReport} saved.`);\r\n\r\n\t\t\t\t\teventBus.trigger(EVENT_REPORT_SAVED);\r\n\t\t\t\t\teventBus.trigger(EVENT_SET_FORM_PRISTINE);\r\n\r\n\t\t\t\t\treturn resp;\r\n\t\t\t\t}, (resp) => {\r\n\t\t\t\t\tctrl.reportMetadata.report.hasErrors = true;\r\n\t\t\t\t\tif(resp.Data?.Rules) {\r\n\t\t\t\t\t\tresp.Data.Rules.forEach(r => {\r\n\t\t\t\t\t\t\tif(r.Detail && r.Detail.Id === undefined && r.Detail.LinkKey !== undefined) {\r\n\t\t\t\t\t\t\t\tconst matchingVal = Object.values(ctrl.reportValues[detailValuesKey])\r\n\t\t\t\t\t\t\t\t\t.find(detail => Object.values(detail.values).some(v => v.DetailLinkKey === r.Detail.LinkKey));\r\n\t\t\t\t\t\t\t\tr.Detail.Id = matchingVal.detailId;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tsetApiValidations(resp.Data.Rules, isNewReport);\r\n\t\t\t\t\t\tctrl.validationService.commitValidations();\r\n\t\t\t\t\t\tsetReportState();\r\n\r\n\t\t\t\t\t\t$logger.event(reportSaveEventBuilder(\"failed\"), {\r\n\t\t\t\t\t\t\tserverRules: resp.Data.Rules\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$logger.event(reportSaveEventBuilder(\"serverErrored\"));\r\n\t\t\t\t\t\r\n\t\t\t\t\tthrow new Error(\"SAVE FAILED\");\r\n\t\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tfunction handleDetailSave(saveValues) {\r\n\t\t$logger.event($logger.reportDetailEventBuilder(\"completed\"), { saveValues });\r\n\t\tconst newDetails = { ...saveValues };\r\n\t\tconst headerVals = ctrl.getFormValues();\r\n\t\tlet hasBlockSave = false;\r\n\r\n\t\tctrl.validationService.clearPendingValidations();\r\n\t\tconst allSingleDetailEvals = reduce(newDetails, (prevPromise, newDetail) => {\r\n\t\t\treturn prevPromise\r\n\t\t\t\t.then(ruleAcc => {\r\n\t\t\t\t\tconst valuesByScope = {\r\n\t\t\t\t\t\t[ctrl.reportScopes.detail]: values(newDetail.values),\r\n\t\t\t\t\t\t[ctrl.reportScopes.reportAndDetails]: [...headerVals].concat(values(newDetail.values))\r\n\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tconst processed = ctrl.ruleProvider.validate([ctrl.reportScopes.detail, ctrl.reportScopes.reportAndDetails], newDetail.detailId, valuesByScope)\r\n\t\t\t\t\t\t.then(triggeredRules => {\r\n\t\t\t\t\t\t\truleAcc = (ruleAcc || {});\r\n\t\t\t\t\t\t\truleAcc[newDetail.detailId] = {\r\n\t\t\t\t\t\t\t\ttriggeredRules,\r\n\t\t\t\t\t\t\t\tdetail: newDetail,\r\n\t\t\t\t\t\t\t\tdetailId: newDetail.detailId\r\n\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\treturn ruleAcc;\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\treturn processed;\r\n\t\t\t\t});\r\n\t\t}, Promise.resolve())\r\n\t\t\t.then(evals => {\r\n\t\t\t\thasBlockSave = checkEvalsForBlockSave(evals);\r\n\t\t\t\treturn evals;\r\n\t\t\t});\r\n\r\n\t\tconst allDetailEvals = allSingleDetailEvals.then(ruleAcc => {\r\n\t\t\tif(hasBlockSave === true) {\r\n\t\t\t\treturn ruleAcc;\r\n\t\t\t}\r\n\r\n\t\t\treturn runDetailsRules(newDetails).then(triggeredRules => {\r\n\t\t\t\truleAcc = (ruleAcc || {});\r\n\t\t\t\truleAcc[undefined] = {\r\n\t\t\t\t\ttriggeredRules\r\n\t\t\t\t};\r\n\r\n\t\t\t\thasBlockSave = checkEvalsForBlockSave({ rules: triggeredRules });\r\n\t\t\t\treturn ruleAcc;\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\treturn allDetailEvals.then(evals => {\r\n\t\t\tif(hasBlockSave === true) {\r\n\t\t\t\t$logger.event($logger.reportDetailEventBuilder(\"saveBlocked\"), { evals });\r\n\t\t\t\t\r\n\t\t\t\treturn evals;\r\n\t\t\t}\r\n\r\n\t\t\tforEach(evals, (currentDetailEval) => {\r\n\t\t\t\tif(currentDetailEval?.detail) {\r\n\t\t\t\t\tctrl.reportValues[detailValuesKey] = {\r\n\t\t\t\t\t\t...ctrl.reportValues[detailValuesKey],\r\n\t\t\t\t\t\t[currentDetailEval.detailId]: currentDetailEval.detail\r\n\t\t\t\t\t};\r\n\t\t\t\t\teventBus.trigger(EVENT_DETAIL_DIRTY, { detailId: currentDetailEval.detailId });\r\n\t\t\t\t\tctrl.validationService.updateTriggeredRules(currentDetailEval.triggeredRules, [ctrl.reportScopes.detail, ctrl.reportScopes.reportAndDetails], currentDetailEval?.detailId);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tctrl.validationService.updateTriggeredRules(currentDetailEval.triggeredRules, [ctrl.reportScopes.details]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tctrl.validationService.commitValidations();\r\n\t\t\tsetReportState();\r\n\t\t\t$logger.event($logger.reportDetailEventBuilder(\"saved\"), { evals });\r\n\r\n\t\t\treturn evals;\r\n\t\t});\r\n\t}\r\n\r\n\tfunction checkEvalsForBlockSave(keyedEvals) {\r\n\t\tconst evals = values(keyedEvals);\r\n\t\tlet checkBlockSave = false;\r\n\t\tfor(let i = 0; i < evals.length; i++) {\r\n\t\t\tconst currentDetailEval = evals[i];\r\n\r\n\t\t\tif(currentDetailEval.triggeredRules === false) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tconst blockSaveEvalRules = filter(currentDetailEval.triggeredRules, r => {\r\n\t\t\t\tconst hasBlockSaveTrigger = some(r.Triggers, t => t.Operator.Code === TRIGGER_OPERATOR_CODES.blockSave);\r\n\t\t\t\treturn hasBlockSaveTrigger;\r\n\t\t\t});\r\n\r\n\t\t\tif(blockSave(blockSaveEvalRules)) {\r\n\t\t\t\tcurrentDetailEval.blockSave = true;\r\n\t\t\t\tcheckBlockSave = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn checkBlockSave;\r\n\t}\r\n\r\n\tfunction runDetailsRules(newDetails, detailId) {\r\n\t\tconst headerVals = ctrl.getFormValues();\r\n\t\tconst newDetailTableVals = {\r\n\t\t\t...ctrl.reportValues[detailValuesKey]\r\n\t\t};\r\n\r\n\t\tif(newDetails) {\r\n\t\t\tforEach(newDetails, d => newDetailTableVals[d.detailId] = d);\r\n\t\t}\r\n\r\n\t\tconst allDetails = {};\r\n\r\n\t\tallDetails[ctrl.reportScopes.details] = filter(flatMapDeep(newDetailTableVals, d => {\r\n\t\t\tif(d.isDeleted) {\r\n\t\t\t\treturn undefined;\r\n\t\t\t}\r\n\r\n\t\t\tconst detailValues = values(d.values);\r\n\t\t\treturn detailValues.map(v => ({\r\n\t\t\t\t...v,\r\n\t\t\t\tDetailId: d.detailId\r\n\t\t\t}));\r\n\t\t}), d => d !== undefined);\r\n\t\tallDetails[ctrl.reportScopes.reportAndDetails] = [...headerVals].concat(...allDetails[ctrl.reportScopes.details]);\r\n\t\tconst scopes = [ctrl.reportScopes.details, ctrl.reportScopes.reportAndDetails];\r\n\t\tif(detailId !== undefined) {\r\n\t\t\tscopes.push(ctrl.reportScopes.detail);\r\n\t\t\tallDetails[ctrl.reportScopes.detail] = !newDetailTableVals[detailId].isDeleted ?\r\n\t\t\t\tallDetails[ctrl.reportScopes.details].filter(d => d.DetailId === detailId) :\r\n\t\t\t\tundefined;\r\n\t\t}\r\n\r\n\t\treturn ctrl.ruleProvider.validate(scopes, detailId, allDetails);\r\n\t}\r\n\r\n\tfunction setReportState() {\r\n\t\tctrl.validationScopes = ctrl.validationScopes.length > 0 \r\n\t\t\t? ctrl.validationScopes\r\n\t\t\t\t: [ctrl.reportScopes.report, ctrl.reportScopes.details, ctrl.reportScopes.reportAndDetails, ctrl.reportScopes.metadata];\r\n\r\n\t\tctrl.reportMetadata.validations = ctrl.validationService.ruleValidations;\r\n\r\n\t\tctrl.reportMetadata.hasErrors = some(ctrl.reportMetadata.validations,\r\n\t\t\tv => (v.code === TRIGGER_OPERATOR_CODES.blockSave || v.code === TRIGGER_OPERATOR_CODES.blockSubmit) && v.rules.length);\r\n\t\tctrl.reportMetadata.hasWarnings = some(ctrl.reportMetadata.validations, v => v.code === TRIGGER_OPERATOR_CODES.warning && v.rules.length);\r\n\r\n\t\tctrl.setValidationsForDetails && ctrl.setValidationsForDetails(ctrl.reportMetadata.validations);\r\n\t}\r\n\r\n\tfunction processRules(ruleScopes, detailId, commit = true, values) {\r\n\t\treturn ctrl.ruleProvider.validate(ruleScopes, detailId, values).then(rules => {\r\n\t\t\tctrl.validationService.updateTriggeredRules(rules, ruleScopes, detailId);\r\n\t\t\tcommit && ctrl.validationService.commitValidations();\r\n\t\t\tsetReportState();\r\n\t\t\treturn rules;\r\n\t\t});\r\n\t}\r\n\r\n\tfunction initializeRules() {\r\n\t\tconst registeredConditionFieldIds = [];\r\n\t\t\r\n\t\tconst uiRules = filter(ctrl.form.Rules, r => some(r.Triggers, t => t.Type.Code === TRIGGER_TYPES.userInterface));\r\n\t\tconst visibilityRules = filter(uiRules, r => some(r.Triggers, t => \r\n\t\t\tt.Operator.Code === UI_OPERATOR_TYPES.visibility \r\n\t\t\t|| t.Operator.Code === UI_OPERATOR_TYPES.details\r\n\t\t\t|| t.Operator.Code === UI_OPERATOR_TYPES.readonly\r\n\t\t));\r\n\t\tconst filterRules = filter(uiRules, r => some(r.Triggers, t => t.Operator.Code === UI_OPERATOR_TYPES.filter));\r\n\r\n\t\tlet ruleProcessingPromise;\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_PROCESS_UI_RULES,\r\n\t\t\t(e, params) => {\r\n\t\t\t\tif(ctrl.pageIsLoaded !== true) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif(!ctrl.isProcessingRules) {\r\n\t\t\t\t\truleProcessingPromise = runProcessVisibilityRules(params);\r\n\t\t\t\t}\r\n\t\t\t\telse if(params.force) {\r\n\t\t\t\t\truleProcessingPromise = ruleProcessingPromise.then((lastProcess) => {\r\n\t\t\t\t\t\treturn runProcessVisibilityRules(lastProcess.params);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_PROCESS_FILTER_RULES,\r\n\t\t\t(e, params) => {\r\n\t\t\t\trunProcessFilterRules(params.ruleIds, params.values, params.conditionFieldId);\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\r\n\t\teventBus.register(\r\n\t\t\tEVENT_PROCESS_VALIDATIONS,\r\n\t\t\t(e, params) => {\r\n\t\t\t\tctrl.processRules(params.scopes);\r\n\t\t\t},\r\n\t\t\t$scope\r\n\t\t);\r\n\r\n\t\tctrl.fieldRuleMap = {};\r\n\r\n\t\tuiRules.forEach(r => {\r\n\t\t\tconst triggerTypes = r.Triggers.map(t => t.Operator.Code);\r\n\r\n\t\t\tinitializeConditionsOrChildren(r, r.Id, triggerTypes);\r\n\t\t\tr.Triggers\r\n\t\t\t\t.filter(t => t.Type.Code === TRIGGER_TYPES.userInterface)\r\n\t\t\t\t.forEach(t => {\r\n\t\t\t\t\tconst field = find(ctrl.form.Fields, { Id: t.Field?.Id });\r\n\r\n\t\t\t\t\tt.Field = field;\r\n\t\t\t\t});\r\n\t\t});\r\n\r\n\t\tforEach(ctrl.fieldRuleMap, (fr) => {\r\n\t\t\tfr.ruleIds = uniq(fr.ruleIds);\r\n\r\n\t\t\teventBus.register(\r\n\t\t\t\tEVENT_VALUE_CHANGED(fr.conditionFieldId),\r\n\t\t\t\t(_, params) => {\r\n\t\t\t\t\tconst valueScopes = [REPORT_SCOPES.report];\r\n\r\n\t\t\t\t\tif(params.field.IsDetail) {\r\n\t\t\t\t\t\tvalueScopes.push(REPORT_SCOPES.detail);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst rpvalues = ctrl.ruleProvider.getValuesByType(valueScopes);\r\n\r\n\t\t\t\t\tconst allValues = Object.values(rpvalues).reduce((acc, next) => acc.concat(next), []);\r\n\r\n\t\t\t\t\teventBus.trigger(EVENT_PROCESS_FILTER_RULES, { \r\n\t\t\t\t\t\tvalues: allValues, \r\n\t\t\t\t\t\truleIds: fr.ruleIds, \r\n\t\t\t\t\t\tconditionFieldId: fr.conditionFieldId \r\n\t\t\t\t\t});\r\n\t\t\t\t},\r\n\t\t\t\t$scope\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\tconst preemptiveRangeRules = filter(ctrl.form.Rules, r => r.Engine && r.Engine.Code === ENGINE_EVALUATIONS.range.code && r.Operator && r.Operator.Code === RULE_OPERATORS.AND);\r\n\r\n\t\tpreemptiveRangeRules.forEach(({ Conditions }) => {\r\n\t\t\tConditions.forEach(c => {\r\n\t\t\t\tconst field = find(ctrl.form.Fields, { Id: c.Field.Id });\r\n\t\t\t\tif(field && field.Template === FIELD_TEMPLATES.Number) {\r\n\t\t\t\t\tfield.MinValue = c.MinValue;\r\n\t\t\t\t\tfield.MaxValue = c.MaxValue;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tconst preemptiveCompareRules = filter(\r\n\t\t\tctrl.form.Rules,\r\n\t\t\tr =>\r\n\t\t\t\tr.Engine &&\r\n\t\t\t\tr.Engine.Code === ENGINE_EVALUATIONS.compare.code &&\r\n\t\t\t\tr.Operator &&\r\n\t\t\t\tr.Operator.Code === RULE_OPERATORS.AND &&\r\n\t\t\t\tr.Conditions &&\r\n\t\t\t\tevery(r.Conditions, c => Object.prototype.hasOwnProperty.call(c, \"Value\"))\r\n\t\t);\r\n\r\n\t\tpreemptiveCompareRules.forEach(({ Conditions }) => {\r\n\t\t\tConditions.forEach(c => {\r\n\t\t\t\tconst field = find(ctrl.form.Fields, { Id: c.Field.Id });\r\n\r\n\t\t\t\tif(field && field.Template === FIELD_TEMPLATES.Number) {\r\n\t\t\t\t\tconst limit = field.IncrementingStep ? c.Value * field.IncrementingStep : c.Value;\r\n\r\n\t\t\t\t\tswitch(c.Operator.Code) {\r\n\t\t\t\t\t\tcase CONDITION_EVALUATIONS.greaterThan:\r\n\t\t\t\t\t\t\tfield.MinValue = limit + (field.IncrementingStep || 1);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CONDITION_EVALUATIONS.greaterThanOrEqualTo:\r\n\t\t\t\t\t\t\tfield.MinValue = limit;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CONDITION_EVALUATIONS.lessThan:\r\n\t\t\t\t\t\t\tfield.MaxValue = limit - (field.IncrementingStep || 1);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CONDITION_EVALUATIONS.lessThanOrEqualTo:\r\n\t\t\t\t\t\t\tfield.MaxValue = limit;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tfunction initializeConditionsOrChildren(r, rootRuleId, triggerTypes, ruleTriggerFieldIds) {\r\n\t\t\tconst newRuleTriggerFieldIds = (r.Triggers || [])\r\n\t\t\t\t.filter(t => t.Field?.Id !== undefined)\r\n\t\t\t\t.map(t => t.Field.Id)\r\n\t\t\t\t.concat(ruleTriggerFieldIds || []);\r\n\r\n\t\t\tif(!!r.Conditions) {\r\n\t\t\t\tr.Conditions.forEach(c => {\r\n\t\t\t\t\tif(c.Field) {\r\n\t\t\t\t\t\tconst conditionField = find(ctrl.form.Fields, { Id: c.Field.Id });\r\n\t\t\t\t\t\tif(conditionField) {\r\n\t\t\t\t\t\t\tif(triggerTypes.indexOf(UI_OPERATOR_TYPES.filter) > -1) {\r\n\t\t\t\t\t\t\t\t// note: ctrl.fieldRuleMap is a map from conditionFieldId => [ruleIds]\r\n\t\t\t\t\t\t\t\tif(ctrl.fieldRuleMap[conditionField.Id] === undefined) {\r\n\t\t\t\t\t\t\t\t\tctrl.fieldRuleMap[conditionField.Id] = { conditionFieldId: conditionField.Id, ruleIds: [] };\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tctrl.fieldRuleMap[conditionField.Id].ruleIds.push(rootRuleId);\r\n\t\t\t\t\t\t\t\tif(c.Scope === undefined) {\r\n\t\t\t\t\t\t\t\t\tc.Scope = \"Order\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(registeredConditionFieldIds.indexOf(c.Field.Id) > -1) {\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\t\tif(triggerTypes.indexOf(UI_OPERATOR_TYPES.visibility) > -1 \r\n\t\t\t\t\t\t\t\t|| triggerTypes.indexOf(UI_OPERATOR_TYPES.details) > -1\r\n\t\t\t\t\t\t\t\t|| triggerTypes.indexOf(UI_OPERATOR_TYPES.readonly) > -1\r\n\t\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\t\teventBus.register(\r\n\t\t\t\t\t\t\t\t\tEVENT_VALUE_CHANGED(conditionField.Id),\r\n\t\t\t\t\t\t\t\t\t(e, params) => {\r\n\t\t\t\t\t\t\t\t\t\teventBus.trigger(EVENT_PROCESS_UI_RULES, { value: params.value, field: params.field });\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t$scope\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\tregisteredConditionFieldIds.push(c.Field.Id);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tr.Children.forEach(childRule => {\r\n\t\t\t\t\tinitializeConditionsOrChildren(childRule, rootRuleId, triggerTypes, newRuleTriggerFieldIds);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction runProcessVisibilityRules(params) {\r\n\t\t\tctrl.isProcessingRules = true;\r\n\t\t\tctrl.isProcessingQueueInUse = true;\r\n\t\t\tif(ctrl.processingQueueTimer) {\r\n\t\t\t\tclearTimeout(ctrl.processingQueueTimer);\r\n\t\t\t}\r\n\r\n\t\t\tconst sectionScope = params.field && params.field.IsDetail ? REPORT_SCOPES.detail : REPORT_SCOPES.report;\r\n\t\t\tconst valueScopes = [REPORT_SCOPES.report, REPORT_SCOPES.details, sectionScope];\r\n\t\t\tconst runScopes = [REPORT_SCOPES.reportAndDetails, REPORT_SCOPES.details, REPORT_SCOPES.metadata, sectionScope];\r\n\r\n\t\t\tconst values = ctrl.ruleProvider.getValuesByType(valueScopes);\r\n\r\n\t\t\tconst ruleProcesses = [];\r\n\r\n\t\t\tconst visibleFieldIds = ctrl.form.Fields\r\n\t\t\t\t.filter(f => f.visible !== false)\r\n\t\t\t\t.map(f => f.Id);\r\n\r\n\t\t\tlet detailId = ctrl.currentDetailId;\r\n\t\t\tif(sectionScope === REPORT_SCOPES.report) {\r\n\t\t\t\t// if this is operating on the header, then use header + all details' values for R&D run.\r\n\t\t\t\tvalues[REPORT_SCOPES.reportAndDetails] = (values[REPORT_SCOPES.report] || []).concat(values[REPORT_SCOPES.details] || []);\r\n\t\t\t}\r\n\t\t\telse if(sectionScope === REPORT_SCOPES.detail || params.detailId !== undefined) {\r\n\t\t\t\tif(params.detailId !== undefined) {\r\n\t\t\t\t\tdetailId = params.detailId;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconst detailItem = find(values[REPORT_SCOPES.detail], v => v.DetailId !== undefined);\r\n\t\t\t\t\tdetailId = (detailItem || {}).DetailId;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// if this is operating on A SINGLE detail, then only use header + this detail's values for R&D run.\r\n\t\t\t\tconst mergedDetails = detailHelper.mergeDetails([values[REPORT_SCOPES.details] || [], values[REPORT_SCOPES.detail] || []]);\r\n\t\t\t\tvalues[REPORT_SCOPES.reportAndDetails] = values[REPORT_SCOPES.report].concat(mergedDetails);\r\n\t\t\t}\r\n\r\n\t\t\tforEach(runScopes, scope => {\r\n\t\t\t\tif(values[scope]) {\r\n\t\t\t\t\tconst rulesToProcess = visibilityRules.filter(rule => {\r\n\t\t\t\t\t\treturn rule.Scope.Code === scope;\r\n\t\t\t\t\t});\r\n\t\t\t\t\tconst scopeValues = values[scope].filter(v => visibleFieldIds.indexOf(v.FieldId) > -1);\r\n\t\t\t\t\tif(rulesToProcess.length) {\r\n\t\t\t\t\t\tconst processed = ctrl.ruleProvider.process(rulesToProcess, scopeValues, detailId, scope);\r\n\r\n\t\t\t\t\t\truleProcesses.push(processed);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treturn Promise.all(ruleProcesses).then((rules) => {\r\n\t\t\t\tctrl.isProcessingRules = false;\r\n\t\t\t\tctrl.processingQueueTimer = setTimeout(() => {\r\n\t\t\t\t\tctrl.isProcessingQueueUnsettled = false;\r\n\t\t\t\t\tctrl.processingQueueTimer = undefined;\r\n\r\n\t\t\t\t\teventBus.trigger(EVENT_PROCESS_RULES_SETTLED);\r\n\t\t\t\t\t$scope.$apply();\r\n\t\t\t\t}, 100);\r\n\r\n\t\t\t\t$logger.groupEnd();\r\n\r\n\t\t\t\treturn { rules, params };\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction runProcessFilterRules(ruleIds, values, conditionFieldId) {\r\n\t\t\tconst thisFilterRules = ruleIds?.length > 0 ? filter(filterRules, r => ruleIds.indexOf(r.Id) > -1) : filterRules;\r\n\t\t\tfilterService.executeFilterTriggers(thisFilterRules, values, ctrl.currentDetailId, conditionFieldId);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setApiValidations(validations, showHeaderValidationsOnly = false) {\r\n\t\tctrl.validationService.updateApiValidations(validations);\r\n\r\n\t\tctrl.validationScopes = [ctrl.reportScopes.report, ctrl.reportScopes.reportAndDetails, ctrl.reportScopes.metadata];\r\n\r\n\t\tif(!showHeaderValidationsOnly) {\r\n\t\t\tctrl.validationScopes.push(ctrl.reportScopes.details);\r\n\t\t}\r\n\t}\r\n\r\n\tasync function handleRestore() {\r\n\t\ttry {\r\n\t\t\tawait loadingService.watch(reportHelper.restore(ctrl.form.Id, ctrl.report));\r\n\t\t\teventBus.trigger(EVENT_REPORT_UNLOCKED);\r\n\t\t\t\r\n\t\t\ttoastr.success(\"Report restored successfully, and is pending submission.\");\r\n\t\t\t$logger.event($logger.buildReportEvent(\"restore\")(\"succeeded\"), { \r\n\t\t\t\treportId: ctrl.reportMetadata.report.Id, \r\n\t\t\t\tvia: \"edit-report\" \r\n\t\t\t});\r\n\t\t}\r\n\t\tcatch(err) {\r\n\t\t\t$logger.error(err);\r\n\t\t}\r\n\t}\r\n\r\n\tasync function handleWithdraw() {\r\n\t\tconst confirmWithdraw = await confirmWithdrawReport(ctrl.form.nomenclature);\r\n\t\t\t\r\n\t\tif(!confirmWithdraw)\r\n\t\t\treturn;\r\n\t\r\n\t\ttry {\r\n\t\t\tawait loadingService.watch(reportHelper.withdraw(ctrl.form.Id, ctrl.report));\r\n\t\r\n\t\t\teventBus.trigger(EVENT_REPORT_UNLOCKED);\r\n\t\t\ttriggerPrimaryDateFilter();\r\n\t\t\ttoastr.success(`You may now modify this ${ctrl.form.nomenclature.PositiveReport}. Please make sure you submit again when finished.`);\r\n\t\t\t$logger.event($logger.buildReportEvent(\"withdraw\")(\"succeeded\"), { \r\n\t\t\t\treportId: ctrl.reportMetadata.report.Id, \r\n\t\t\t\tvia: \"edit-report\" \r\n\t\t\t});\r\n\t\t}\r\n\t\tcatch(err) {\r\n\t\t\t$logger.error(err);\r\n\t\t}\r\n\t}\r\n\r\n\tasync function handleDelete() {\r\n\t\tconst continueCheck = ctrl.isReportDirty ? await confirmUnsavedChangesWillBeLost() : true;\r\n\t\tif(!continueCheck) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\t// wipe details here instead of on getting all values to avoid wiping them while the report is in an intermediary state\r\n\t\t\tif(ctrl.suppressDetails) {\r\n\t\t\t\tctrl.reportValues[detailValuesKey] = {};\r\n\t\t\t}\r\n\r\n\t\t\teventBus.trigger(EVENT_REVERT_VALUES, { values: { ...ctrl.report } });\r\n\t\t\r\n\t\t\tawait loadingService.watch(reportHelper.delete(ctrl.form.Id, ctrl.report));\r\n\t\t\t\r\n\t\t\teventBus.trigger(EVENT_REPORT_LOCKED);\r\n\t\t\ttoastr.success(`This ${ctrl.form.nomenclature.PositiveReport} has been deleted.`);\t\r\n\t\t\t$logger.event($logger.buildReportEvent(\"delete\")(\"succeeded\"), { \r\n\t\t\t\treportId: ctrl.reportMetadata.report.Id, \r\n\t\t\t\tvia: \"edit-report\" \r\n\t\t\t});\r\n\t\t}\r\n\t\tcatch(resp) {\r\n\t\t\tctrl.reportMetadata.report.hasErrors = true;\r\n\t\t\tif(resp.Data?.Rules) {\r\n\t\t\t\tresp.Data.Rules.forEach(r => {\r\n\t\t\t\t\tif(r.Detail && r.Detail.Id === undefined && r.Detail.LinkKey !== undefined) {\r\n\t\t\t\t\t\tconst matchingVal = Object.values(ctrl.reportValues[detailValuesKey])\r\n\t\t\t\t\t\t\t.find(detail => Object.values(detail.values).some(v => v.DetailLinkKey === r.Detail.LinkKey));\r\n\t\t\t\t\t\tr.Detail.Id = matchingVal.detailId;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tsetApiValidations(resp.Data.Rules, true);\r\n\t\t\t\tctrl.validationService.commitValidations();\r\n\t\t\t\tsetReportState();\r\n\r\n\t\t\t\t$logger.event(reportSaveEventBuilder(\"failed\"), {\r\n\t\t\t\t\tserverRules: resp.Data.Rules\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t$logger.event(reportSaveEventBuilder(\"serverErrored\"));\r\n\t\t}\r\n\t}\r\n\r\n\tasync function handleSubmit(route) {\r\n\t\tif(ctrl.reportMetadata.hasErrors) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttriggerPrimaryDateFilter();\r\n\t\tupdateReportDirty();\r\n\r\n\t\tconst submitRequestEvent = submitEventBuilder(\"requested\");\r\n\t\t\r\n\t\t$timeout(() => {\r\n\t\t\tconst runSubmit = async() => {\r\n\t\t\t\tif(ctrl.isReportDirty) {\r\n\t\t\t\t\tconst dirtyFields = map(ctrl.dirtyHeaderFields, (_, key) => find(ctrl.form.Fields, field => field.Id == key));\r\n\t\t\t\t\tconst numDirtyDetails = size(ctrl.dirtyDetailTracking);\r\n\t\r\n\t\t\t\t\tif(hasHadState(\"PENDING\", ctrl.report)) { // TODO: I think this should be ctrl.reportMetadata.report\r\n\t\t\t\t\t\tconst continueWithDirtySubmission = await confirmDirtySubmission(dirtyFields, numDirtyDetails);\r\n\t\t\t\t\t\tif(!continueWithDirtySubmission) {\r\n\t\t\t\t\t\t\t$logger.event(submitRequestEvent, { \r\n\t\t\t\t\t\t\t\treportIsDirty: true,\r\n\t\t\t\t\t\t\t\tcontinueSubmission: false,\r\n\t\t\t\t\t\t\t\tdirtyFieldCount: dirtyFields, \r\n\t\t\t\t\t\t\t\tdirtyDetailCount: numDirtyDetails\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$logger.event(submitRequestEvent, { \r\n\t\t\t\t\t\treportIsDirty: true,\r\n\t\t\t\t\t\tcontinueSubmission: true,\r\n\t\t\t\t\t\tdirtyFieldCount: dirtyFields, \r\n\t\t\t\t\t\tdirtyDetailCount: numDirtyDetails \r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tawait saveReport();\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tconst activeBlockSave = ctrl.validationService.getRuleValidationsOfType(TRIGGER_OPERATOR_CODES.blockSave);\r\n\t\t\t\tif(activeBlockSave?.rules?.length ?? 0 > 0) {\r\n\t\t\t\t\t$logger.event(submitEventBuilder(\"blocked\"), { \r\n\t\t\t\t\t\tsaveBlocked: true,\r\n\t\t\t\t\t\tactiveBlockSave\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tconst activeBlockSubmit = ctrl.validationService.getRuleValidationsOfType(TRIGGER_OPERATOR_CODES.blockSubmit);\r\n\t\t\t\tif(activeBlockSubmit?.rules?.length ?? 0 > 0) {\r\n\t\t\t\t\t$logger.event(submitEventBuilder(\"blocked\"), { \r\n\t\t\t\t\t\tsubmitBlocked: true,\r\n\t\t\t\t\t\tactiveBlockSubmit\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tconst activeWarnings = ctrl.validationService.getRuleValidationsOfType(TRIGGER_OPERATOR_CODES.warning);\r\n\t\t\t\tif(activeWarnings?.rules?.length ?? 0 > 0) {\r\n\t\t\t\t\tconst confirmWarnings = await confirmRuleWarningsOnReport(activeWarnings);\r\n\t\t\t\t\tif(!confirmWarnings) {\r\n\t\t\t\t\t\t$logger.event(submitEventBuilder(\"cancelled\"), { \r\n\t\t\t\t\t\t\twithWarnings: true,\r\n\t\t\t\t\t\t\tactiveWarnings,\r\n\t\t\t\t\t\t\tconfirmed: false\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$logger.event(submitRequestEvent, { \r\n\t\t\t\t\t\twithWarnings: true,\r\n\t\t\t\t\t\tactiveWarnings,\r\n\t\t\t\t\t\tconfirmed: true\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$logger.event(submitRequestEvent);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn await submitReport(route);\r\n\t\t\t};\r\n\r\n\t\t\tconst submitPromise = runSubmit();\r\n\t\t\tloadingService.watch(submitPromise);\r\n\t\t});\r\n\t}\r\n\r\n\tfunction submitReport(route) {\r\n\t\tconst promise = reportHelper.submit(ctrl.form.Id, ctrl.reportMetadata.report).then(\r\n\t\t\t() => {\r\n\t\t\t\ttoastr.success(\"Submission successful.\");\r\n\t\t\t\t$logger.event(submitEventBuilder(\"succeeded\"));\r\n\r\n\t\t\t\tif(route) {\r\n\t\t\t\t\t$state.transitionTo(route, { via: \"submit-button\" }, { location: \"replace\", reload: route });\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\teventBus.trigger(EVENT_REPORT_LOCKED);\r\n\t\t\t},\r\n\t\t\tresp => {\r\n\t\t\t\t$logger.event(submitEventBuilder(\"failed\"), { rules: resp?.Data?.Rules });\r\n\t\t\t\tif((resp?.Data?.Rules || []).length) {\r\n\t\t\t\t\tsetApiValidations(resp.Data.Rules);\r\n\t\t\t\t\tctrl.validationService.commitValidations();\r\n\t\t\t\t\tsetReportState();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\treturn loadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction updateRuleMetadata(report) {\r\n\t\tconst updatedLMreport = {\r\n\t\t\t...report,\r\n\t\t\tLastModified: new Date()\r\n\t\t};\r\n\r\n\t\tsetReportMetadata(updatedLMreport);\r\n\r\n\t\tsetFieldOptions(ctrl.form.Fields);\r\n\r\n\t\tsetApiValidations(report.Rules, false);\r\n\t\tctrl.validationService.commitValidations();\r\n\t\tsetReportState();\r\n\t\t\t\t\t\r\n\t\teventBus.trigger(EVENT_PROCESS_UI_RULES);\r\n\t}\r\n\r\n\tfunction triggerFilters(fieldsToTrigger, reportValues, isInitializing = true) {\r\n\t\tconst triggerFields = fieldsToTrigger || ctrl.form.Fields;\r\n\t\tconst triggerValues = reportValues || map(ctrl.reportValues[headerValuesKey]);\r\n\r\n\t\tconst filters = filter(ctrl.form.Features, f => f.Type === FEATURE_TYPES.filter);\r\n\r\n\t\tfilters.forEach(f => {\r\n\t\t\tconst initiator = minBy(f.Fields, \"Order\");\r\n\t\t\tconst initiatorField = find(triggerFields, f => f.Id === initiator.Field.Id);\r\n\r\n\t\t\tif(initiatorField) {\r\n\t\t\t\tlet thisFilterValue = triggerValues\r\n\t\t\t\t\t.filter(reportField => {\r\n\t\t\t\t\t\treturn reportField.FieldId === initiator.Field.Id;\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.map(reportVal => {\r\n\t\t\t\t\t\treturn reportVal.DataId;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\tif(thisFilterValue.length < 1) {\r\n\t\t\t\t\tthisFilterValue = null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst params = {\r\n\t\t\t\t\tfield: initiatorField,\r\n\t\t\t\t\tvalue: thisFilterValue\r\n\t\t\t\t};\r\n\t\t\t\tif(isInitializing) {\r\n\t\t\t\t\tparams.initialValue = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\teventBus.trigger(EVENT_VALUE_CHANGED(initiator.Field.Id), params);\r\n\t\t\t\teventBus.trigger(EVENT_HANDLE_SUCCESSOR_LOCK(initiator.Field.Id), { enable: true });\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction triggerAreaFilters() {\r\n\t\tconst areaFilters = filter(ctrl.form.Features, f => f.Type === FEATURE_TYPES.mapPoint);\r\n\r\n\t\tareaFilters.forEach(f => {\r\n\t\t\tconst initiator = minBy(f.Fields, \"Order\");\r\n\t\t\tconst initiatorField = find(ctrl.form.Fields, f => f.Id === initiator.Field.Id);\r\n\r\n\t\t\tconst reportValue = find(ctrl.reportValues[headerValuesKey], reportField => {\r\n\t\t\t\treturn reportField.FieldId === initiator.Field.Id;\r\n\t\t\t});\r\n\r\n\t\t\tif(reportValue) {\r\n\t\t\t\tconst selectedEntity = find(initiatorField.Data, item => {\r\n\t\t\t\t\treturn item.Id === reportValue.EntityId;\r\n\t\t\t\t});\r\n\r\n\t\t\t\teventBus.trigger(EVENT_VALUE_CHANGED(initiator.Field.Id), {\r\n\t\t\t\t\tfield: initiatorField,\r\n\t\t\t\t\tvalue: selectedEntity\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction triggerPrimaryDateFilter(values, autoSelect = true) {\r\n\t\tvalues = values ? groupReportValues(values) : ctrl.reportValues;\r\n\r\n\t\tconst primaryDateValue = primaryDateFilter(values);\r\n\r\n\t\tif(!!primaryDateValue) {\r\n\t\t\teventBus.trigger(EVENT_FILTER_PRIMARYDATE, { date: primaryDateValue.Date, autoSelect });\r\n\t\t}\r\n\t}\r\n\r\n\tfunction primaryDateFilter(values) {\r\n\t\tconst primaryDateFields = ctrl.form.Fields.filter(field => field.Type.Code == \"DATE\" && field.IsPrimary == true);\r\n\r\n\t\tif(primaryDateFields.length !== 1) {\r\n\t\t\t$logger.error(\"Detected more than 1 primary date field\", { form: ctrl.form.Name });\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst primaryDateField = primaryDateFields[0];\r\n\t\tconst primaryDateValue = find(values[headerValuesKey], f => f.FieldId === primaryDateField.Id);\r\n\r\n\t\treturn primaryDateValue;\r\n\t}\r\n\r\n\tfunction prevReport() {\r\n\t\tconst additionalHeaders = { Prefer: \"return=representation\" };\r\n\t\tconst promise = api.get(FORM_REPORT_PREVIOUS(ctrl.form.Id, ctrl.reportMetadata.report.Id), { headers: additionalHeaders }).then(resp => {\r\n\t\t\tupdateReport(resp);\r\n\t\t})\r\n\t\t\t.catch(() => toastr.error(`Previous ${ctrl.form.nomenclature.PositiveReport} not found.`));\r\n\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction nextReport() {\r\n\t\tconst additionalHeaders = { Prefer: \"return=representation\" };\r\n\t\tconst promise = api.get(FORM_REPORT_NEXT(ctrl.form.Id, ctrl.reportMetadata.report.Id), { headers: additionalHeaders }).then(resp => {\r\n\t\t\tupdateReport(resp);\r\n\t\t})\r\n\t\t\t.catch(() => toastr.error(`Next ${ctrl.form.nomenclature.PositiveReport} not found.`));\r\n\r\n\t\tloadingService.watch(promise);\r\n\t}\r\n\r\n\tfunction createReport() {\r\n\t\t$state.go(NEW_REPORT, { via: \"create-new-button\" }, { location: true, reload: ctrl.NEW_REPORT });\r\n\t}\r\n\r\n\tfunction updateReport(resp) {\r\n\t\t$state.go(EDIT_REPORT, { id: resp.Id, report: null }, { reload: EDIT_REPORT });\r\n\t}\r\n\r\n\tfunction handleDetailSelected(detail) {\r\n\t\tctrl.editDetail(detail);\r\n\t}\r\n\r\n\tfunction editDetail(detail) {\r\n\t\tif(!ctrl.detailModalIsOpen) {\r\n\t\t\tctrl.detailModalIsOpen = true;\r\n\t\t\tlet detailValues = undefined;\r\n\t\t\tctrl.currentDetailId = detail?.detailId ?? 0;\r\n\r\n\t\t\t$logger.event($logger.reportDetailEventBuilder(\"editing\"), { detailId: ctrl.currentDetailId });\r\n\t\t\t\r\n\t\t\tif(!!detail) {\r\n\t\t\t\tconst valueDictionary = ctrl.reportValues[detailValuesKey][detail.detailId].values;\r\n\t\t\t\tdetailValues = map(valueDictionary, val => val);\r\n\t\t\t}\r\n\r\n\t\t\tconst allDetailValues = reduce(ctrl.reportValues[detailValuesKey], (acc, val) => {\r\n\t\t\t\tconst thisDetailValueArray = map(val.values);\r\n\t\t\t\treturn acc.concat(thisDetailValueArray);\r\n\t\t\t}, []);\r\n\r\n\t\t\tconst instance = $uibModal.open({\r\n\t\t\t\tcomponent: \"report-details-modal\",\r\n\t\t\t\tsize: \"lg\",\r\n\t\t\t\tbackdrop: \"static\",\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tform: () => ctrl.form,\r\n\t\t\t\t\tvalues: () => detailValues,\r\n\t\t\t\t\tdetailId: () => detail?.detailId,\r\n\t\t\t\t\trules: () => ctrl.form.Rules,\r\n\t\t\t\t\tallValues: () => allDetailValues,\r\n\t\t\t\t\ttriggerFieldFilters: () => {\r\n\t\t\t\t\t\treturn (values) => {\r\n\t\t\t\t\t\t\tconst headerVals = ctrl.ruleProvider.getValuesByType([\"REPORT\"]);\r\n\t\t\t\t\t\t\tconst filterValues = (values || []).concat(headerVals[\"REPORT\"]);\r\n\r\n\t\t\t\t\t\t\tctrl.triggerFilters(ctrl.form.Fields, filterValues, false);\r\n\t\t\t\t\t\t\ttriggerPrimaryDateFilter(filterValues);\r\n\r\n\t\t\t\t\t\t\teventBus.trigger(EVENT_PROCESS_FILTER_RULES, { values: filterValues });\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t},\r\n\t\t\t\t\tinitializeFields: () => {\r\n\t\t\t\t\t\treturn (fields) => {\r\n\t\t\t\t\t\t\tfields.map(field => initializeNewField(field, fields));\r\n\t\t\t\t\t\t\ttriggerPrimaryDateFilter(getAllValues());\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t},\r\n\t\t\t\t\tonSave: () => {\r\n\t\t\t\t\t\treturn updates => {\r\n\t\t\t\t\t\t\treturn ctrl.handleDetailSave(updates);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t},\r\n\t\t\t\t\tvalueProviderRegistrar: () => ctrl.ruleProvider.registerValueProvider,\r\n\t\t\t\t\theaderModifiedDates: () => {\r\n\t\t\t\t\t\treturn { Created: ctrl.reportMetadata.report.Created, LastModified: ctrl.reportMetadata.report.LastModified };\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tinstance.rendered.then(() => (ctrl.detailModalInstance = instance));\r\n\r\n\t\t\tinstance.result.finally(() => {\r\n\t\t\t\tctrl.form.detailFields.map(f => (f.isLocked = false));\r\n\t\t\t\tctrl.detailModalInstance = null;\r\n\t\t\t\tctrl.detailModalIsOpen = false;\r\n\t\t\t\tctrl.currentDetailId = undefined;\r\n\t\t\t\teventBus.trigger(EVENT_PROCESS_UI_RULES, {});\r\n\r\n\t\t\t\t$logger.event($logger.reportDetailEventBuilder(\"modalClosed\"), { detailId: ctrl.currentDetailId });\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tctrl.copyToNew = () => {\r\n\t\tconst allReportValues = getAllValues(true);\r\n\t\tconst merged = {\r\n\t\t\t...ctrl.reportMetadata.report,\r\n\t\t\tFields: [...allReportValues]\r\n\t\t};\r\n\r\n\t\tdelete merged.Created;\r\n\t\tmerged.History = [];\r\n\t\tdelete merged.Id;\r\n\t\tdelete merged.IsDeleted;\r\n\t\tdelete merged.LastModified;\r\n\t\tdelete merged.Number;\r\n\t\tdelete merged.etag;\r\n\t\tdelete merged.Date;\r\n\t\tdelete merged.EntityId;\r\n\t\tdelete merged.FormId;\r\n\t\tdelete merged.TimeZone;\r\n\r\n\t\tconst detailIdToLinkKeyMap = {};\r\n\r\n\t\tfor(const v of merged.Fields) {\r\n\t\t\tif(v.DetailId === undefined && v.Detail?.Id === undefined) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tconst thisDetailId = v.DetailId ?? v.Detail?.Id;\r\n\r\n\t\t\tif(detailIdToLinkKeyMap[thisDetailId] === undefined) {\r\n\t\t\t\tdetailIdToLinkKeyMap[thisDetailId] = [uuid(), uuid()];\r\n\t\t\t}\r\n\r\n\t\t\tv.DetailLinkKey = detailIdToLinkKeyMap[thisDetailId][0];\r\n\t\t\tv.DetailId = detailIdToLinkKeyMap[thisDetailId][1];\r\n\r\n\t\t\tdelete v.Detail;\r\n\t\t}\r\n\r\n\t\t$state.go(NEW_REPORT, { \r\n\t\t\tvia: \"copy\",\r\n\t\t\tid: undefined, \r\n\t\t\treport: merged\r\n\t\t}, { \r\n\t\t\tlocation: \"replace\",\r\n\t\t\tcustom: {\r\n\t\t\t\tshowValidations: true,\r\n\t\t\t\tisNewReport: true\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n}\r\n\r\nexport default angular.module(\"vesl.screens.edit-report\", []).component(\"editReport\", {\r\n\ttemplate,\r\n\tcontroller,\r\n\tbindings: { report: \"<\" },\r\n\trequire: { ruleProvider: \"^ruleProvider\" }\r\n}).name;\r\n","export default \"\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t

    {{$ctrl.form.Name}}

    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t

    {{$ctrl.primaryEntityName}}

    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t
    Phone: {{$ctrl.form.nomenclature.SupportNumber}}
    \\r\\n\\t\\t\\t
    E-Mail: {{$ctrl.form.nomenclature.SupportEmail}}
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t

    REPORT PENDING

    \\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t New {{$ctrl.form.nomenclature.PositiveReport}} \\r\\n\\t\\t\\t\\t\\t {{$ctrl.isReportDirty ? '*' : ''}}{{$ctrl.form.nomenclature.PositiveReport}} #{{$ctrl.reportMetadata.report.Number}} \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t
    0\\\">\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t  Please complete any empty rows before adding a new one.\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Copy to New Report \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Save \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t Submit \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t Submit & Create New \\r\\n\\t\\t\\t\\t\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\t\\t\\t\\tSubmit & View Reporting Status\\r\\n\\t\\t\\t\\t\\t\\t\\t
  • \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Create New \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t Previous {{$ctrl.form.nomenclature.PositiveReport}} \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t Next {{$ctrl.form.nomenclature.PositiveReport}} \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t{{$ctrl.footerNomenclature}}\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\";","import swal from \"sweetalert2\";\r\n\r\nexport function showForceRefresh() {\r\n\treturn swal.fire({\r\n\t\ttitle: \"Error!\",\r\n\t\thtml:\r\n\t\t\t`The current configuration is expired and must be reloaded before you can create a report.\r\n\t\t\t
    \r\n\t\t\t
    \r\n\t\t\tPlease click the refresh button, and try again.`,\r\n\t\ttype: \"error\",\r\n\t\tallowOutsideClick: false,\r\n\t\tallowEscapeKey: false,\r\n\t\tallowEnterKey: false,\r\n\t\tconfirmButtonText: \"Refresh\"\r\n\t})\r\n\t\t.then(res => {\r\n\t\t\tif(!!res) {\r\n\t\t\t\tlocation.reload();\r\n\t\t\t}\r\n\t\t});\r\n}","import \"./entities.less\";\r\nimport template from \"./entities.html\";\r\nimport { FUSE_DEFAULTS } from \"constants.js\";\r\nimport cloneDeep from \"clone-deep\";\r\nimport {\r\n\tfilter,\r\n\tsome,\r\n\tfind,\r\n\tfindIndex,\r\n\tforEach\r\n} from \"lodash\";\r\nimport fuse from \"fuse.js\";\r\nimport { pluralize } from \"humanize-plus\";\r\nimport { ENTITY_TRANSLATION_KEYS } from \"../../services/i18nService\";\r\nimport {\r\n\tanyOf, \r\n\tglobs \r\n} from \"../../services/globs\";\r\nimport { FORM_ENTITIES } from \"routes.js\";\r\nimport { isTypePermittedScope } from \"../../services/security/commonScopes\";\r\n\r\nfunction controller(appState, api, loadingService, tableHelper, $uibModal, $logger, securityService, $scope) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.handleChange = handleChange;\r\n\tctrl.edit = edit;\r\n\r\n\tctrl._uibModal = $uibModal;\r\n\tctrl.onCollapse = onCollapse;\r\n\tctrl.tableWidthCss = \"col-sm-9\";\r\n\tctrl.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\r\n\tctrl.fuse = new fuse([], {\r\n\t\t...FUSE_DEFAULTS,\r\n\t\tdistance: 32,\r\n\t\tthreshold: 0.4\r\n\t});\r\n\r\n\tctrl.table = {\r\n\t\tdata: [],\r\n\t\tactions: {},\r\n\t\tsort: {\r\n\t\t\tpredicate: \"Name\",\r\n\t\t\tdirection: \"asc\"\r\n\t\t},\r\n\t\tfilter: () => { \r\n\t\t\ttableHelper.filter(ctrl.table, ctrl.fuse, \"Name\"); \r\n\t\t\tctrl.paginatorOptions = {\r\n\t\t\t\t...ctrl.paginatorOptions, \r\n\t\t\t\ttotalItems: ctrl.table.data.length\r\n\t\t\t};\r\n\t\t},\r\n\t\treset: () => reset(),\r\n\t\tfilterBy: null\r\n\t};\r\n\r\n\tctrl.paginatorOptions = {};\r\n\tctrl.ENTITY_TRANSLATION_KEYS = ENTITY_TRANSLATION_KEYS;\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.permissions = cloneDeep(appState.permissions.Administration.Entity);\r\n\t\tctrl.permissions.Type = filter(ctrl.permissions.Type, t => !t.IsDisabled);\r\n\r\n\t\tconst legacyPermittedTypes = ctrl.permissions.Type.map(t => t.Code);\r\n\t\tconst allEntityTypes = ctrl.form.Agency.Types;\r\n\t\t\r\n\t\tctrl.allowedEntityTypes = allEntityTypes.filter(t => {\r\n\t\t\treturn legacyPermittedTypes.indexOf(t.Code) > -1\r\n\t\t\t\t|| securityService.isActionScopeAllowed(isTypePermittedScope(t.Code));\r\n\t\t});\r\n\r\n\t\tloadEntities(ctrl.allowedEntityTypes[0]);\r\n\t}\r\n\r\n\tasync function loadEntities(entityType) {\r\n\t\tconst query = [{\r\n\t\t\tType: { Code: entityType.Code }\r\n\t\t}];\r\n\r\n\t\tconst additionalHeaders = { \"X-Vesl-Features-Advanced-Entity-Query\": true };\r\n\t\tctrl.selected = entityType.Code;\r\n\t\tctrl.entityTypeName = entityType.Name;\r\n\t\tctrl.pluralName = pluralize(2, entityType.Name ?? entityType.Code);\r\n\t\tctrl.createAuthorizeAction = globs.entityTypes.byType(entityType.Code).write;\r\n\t\tconst anyEntitySubPath = anyOf(globs.entityTypes.byType(entityType.Code).self);\r\n\r\n\r\n\t\tctrl.canModify = securityService.isPatternAllowed(anyEntitySubPath);\r\n\r\n\t\ttry {\r\n\t\t\tconst promise = api.post(FORM_ENTITIES(ctrl.form.Id), query, { headers: additionalHeaders });\r\n\t\t\tconst results = await loadingService.watch(promise);\r\n\r\n\t\t\tsetTableData(results[0].Entities || []);\r\n\r\n\t\t\t$scope.$apply();\r\n\t\t}\r\n\t\tcatch(err) {\r\n\t\t\t$logger.exception(err, \"There was an error attempting to load entities.\");\r\n\r\n\t\t\tsetTableData([]);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction edit(entity) {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"entity-modal\",\r\n\t\t\tsize: \"lg\",\r\n\t\t\tresolve: {\r\n\t\t\t\tentity: () => entity,\r\n\t\t\t\ttypeConfig: () => ctrl.form.Agency.Types.find(t => t.Code == ctrl.selected),\r\n\t\t\t\tpermissions: () => ctrl.permissions,\r\n\t\t\t\tselectedType: () => ctrl.selected\r\n\t\t\t}\r\n\t\t}).result\r\n\t\t\t.then((updatedEntity) => {\r\n\t\t\t\tif(entity === undefined && updatedEntity !== undefined) {\r\n\t\t\t\t\tupdatedEntity.preventEdit = true;\r\n\t\t\t\t\tctrl.group.Entities = [...ctrl.group.Entities, updatedEntity];\r\n\t\t\t\t\tctrl.group.Count++;\r\n\r\n\t\t\t\t\tsetTableData(ctrl.group.Entities);\r\n\t\t\t\t}\r\n\t\t\t\telse if(updatedEntity) {\r\n\t\t\t\t\tconst entityFields = ctrl.form.Fields.filter((field) => {\r\n\t\t\t\t\t\treturn field.Type.Code === \"ENTITY\" || field.Type.Code === \"ENTITYCONTACT\";\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tconst applicableEntityFields = entityFields.filter((field) => {\r\n\t\t\t\t\t\treturn some(field.Data, (data) => {\r\n\t\t\t\t\t\t\treturn data.Id === updatedEntity.Id;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tfor(let i = 0; i < applicableEntityFields.length; i++) {\r\n\t\t\t\t\t\tconst entityIndex = findIndex(applicableEntityFields[i].Data, (data) => data.Id === updatedEntity.Id);\r\n\r\n\t\t\t\t\t\tapplicableEntityFields[i].Data[entityIndex].Contacts = updatedEntity.Contacts;\r\n\t\t\t\t\t\tapplicableEntityFields[i].Data[entityIndex].Name = updatedEntity.Name;\r\n\t\t\t\t\t\tapplicableEntityFields[i].Data[entityIndex].Code = updatedEntity.Code;\r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction handleChange() {\r\n\t\tctrl.table.filterBy = null;\r\n\t\tconst newType = find(ctrl.allowedEntityTypes, { Code: ctrl.selected });\r\n\r\n\t\tloadEntities(newType);\r\n\t}\r\n\r\n\tfunction setTableData(entities) {\r\n\t\tforEach(entities, e => {\r\n\t\t\te.rank = 1;\r\n\t\t});\r\n\r\n\t\tctrl.table.data = entities;\r\n\r\n\t\tconst typeConfig = ctrl.form.Agency.Types.find(t => t.Code == ctrl.selected);\r\n\t\tctrl.table.hasExternalKeys = typeConfig.IsExternalKeySystemManaged !== true &&\r\n\t\t\t(entities.some(e => e.ExternalKey !== undefined) || typeConfig.ExternalKey?.IsSupported || typeConfig.ExternalKey?.IsRequired);\r\n\t\tctrl.table.hideCodeColumn = typeConfig.IsCodeSystemManaged === true;\r\n\t\t\r\n\t\tctrl.fuse.list = entities;\r\n\t\tctrl.paginatorOptions = {\r\n\t\t\t...ctrl.paginatorOptions, \r\n\t\t\ttotalItems: ctrl.table.data.length\r\n\t\t};\r\n\t}\r\n\r\n\tfunction reset() {\r\n\t\tctrl.table.filterBy = null;\r\n\t\tctrl.table.filter();\r\n\t}\r\n\r\n\tfunction onCollapse() {\r\n\t\tctrl.tableWidthCss = ctrl.isCollapsed ? \"col-sm-12\" : \"col-sm-9\";\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.entities\", [])\r\n\t.component(\"entities\", {\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\tform: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t

    FILTERS

    \\r\\n\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\tACTIONS\\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t Add {{$ctrl.entityTypeName}} \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t 0 ? 'overflow-auto' : ''\\\"\\r\\n\\t\\t\\t\\t\\tgrid-data\\r\\n\\t\\t\\t\\t\\tgrid-options=\\\"$ctrl.table\\\"\\r\\n\\t\\t\\t\\t\\tgrid-actions=\\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\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\r\\n\";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\nimport {\r\n\tFORM_EXPORT_QUEUE_FOR_CONFIG, \r\n\tFORM_REPORTS_BY_ID,\r\n\tFORM_EXPORT_CREATE\r\n} from \"../../../routes\";\r\nimport {\r\n\tCURSOR_DIRECTIONS, \r\n\tFILTER_OPERATORS \r\n} from \"../constants\";\r\nimport moment from \"moment\";\r\n\r\nfunction controller(\r\n\t$scope, \r\n\teventBus, \r\n\t$logger, \r\n\tapi, \r\n\tappState, \r\n\tloadingService, \r\n\tentityManager,\r\n\t$window\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onDestroy = ctrl.handleClose;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\teventBus.register(EVENT_LOGOUT, () => { ctrl.handleClose(); }, $scope);\r\n\r\n\t\tctrl.formConfig = appState.forms.selected;\r\n\t\tctrl.selectedConfig = ctrl.resolve.availableConfigs.find(c => c.Code === ctrl.resolve.selectedConfig);\r\n\t\tctrl.entityLabel = entityManager.primaryFieldLabel;\r\n\t\t\r\n\t\tconst primaryDateField = ctrl.formConfig.Fields.find(f => f.IsPrimary === true && f.Type.Code === \"DATE\");\r\n\t\tctrl.dateLabel = primaryDateField.Name;\r\n\t\tctrl.areAllReportsSelected = true;\r\n\t\tctrl.areAllNegativesSelected = true;\r\n\r\n\t\tloadPendingReports();\r\n\t};\r\n\r\n\tctrl.handleClose = () => {\r\n\t\tctrl.modalInstance.close();\r\n\t};\r\n\r\n\tctrl.handleSaveExport = () => {\r\n\t\tsaveReport().then(() => ctrl.modalInstance.close());\r\n\t};\r\n\r\n\tctrl.updateConfig = () => {\r\n\t\tloadPendingReports();\r\n\t};\r\n\r\n\tctrl.selectAllReports = () => {\r\n\t\tctrl.includedReports.forEach(r => r.isSelected = ctrl.areAllReportsSelected);\r\n\t};\r\n\r\n\tctrl.toggleReportSelection = () => {\r\n\t\tctrl.areAllReportsSelected = !ctrl.includedReports.some(r => r.isSelected !== true);\r\n\t};\r\n\r\n\tctrl.selectAllNegatives = () => {\r\n\t\tctrl.includedNegatives.forEach(r => r.isSelected = ctrl.areAllNegativesSelected);\r\n\t};\r\n\r\n\tctrl.toggleNegativeSelection = () => {\r\n\t\tctrl.areAllNegativesSelected = !ctrl.includedNegatives.some(r => r.isSelected !== true);\r\n\t};\r\n\r\n\tctrl.viewReport = (reportId) => {\r\n\t\t$window.open(`/report?id=${reportId}`, \"_blank\");\r\n\t};\r\n\r\n\tasync function saveReport() {\r\n\t\tconst exportReports = ctrl.includedReports.filter(r => r.isSelected);\r\n\t\tconst exportNegatives = ctrl.includedNegatives.filter(r => r.isSelected);\r\n\r\n\t\tconst reports = exportReports.concat(exportNegatives);\r\n\t\tconst exportLogReports = reports.map(r => ({ Report: { Id: r.Id } }));\r\n\t\tconst exportLogRequest = {\r\n\t\t\tReports: exportLogReports,\r\n\t\t\tConfiguration: { Code: ctrl.selectedConfig.Code }\r\n\t\t};\t\r\n\r\n\t\tconst enqueue = api.post(FORM_EXPORT_CREATE(ctrl.formConfig.Id), exportLogRequest);\r\n\r\n\t\tconst response = await loadingService.watch(enqueue);\r\n\r\n\t\treturn response;\r\n\t}\r\n\r\n\tasync function loadPendingReports() {\r\n\t\tconst exportableReportsPromise = api.get(FORM_EXPORT_QUEUE_FOR_CONFIG(ctrl.formConfig.Id, ctrl.selectedConfig.Code))\r\n\t\t\t.then(exportableReportIds => {\r\n\t\t\t\tconst ids = exportableReportIds.map(r => r.Id);\r\n\t\t\t\tconst Filter = {\r\n\t\t\t\t\tId: { [FILTER_OPERATORS.in.code]: ids }\r\n\t\t\t\t};\r\n\t\t\t\tconst Cursor = {\r\n\t\t\t\t\tCount: ids.length,\r\n\t\t\t\t\tDirection: CURSOR_DIRECTIONS.forward.code\r\n\t\t\t\t};\r\n\t\t\t\tconst request = {\r\n\t\t\t\t\tFilter, \r\n\t\t\t\t\tCursor\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\treturn api.post(FORM_REPORTS_BY_ID(ctrl.formConfig.Id), request);\r\n\t\t\t});\r\n\r\n\t\tconst exportableReports = await loadingService.watch(exportableReportsPromise);\r\n\r\n\t\tconst augmentedReports = (exportableReports.Items ?? [])\r\n\t\t\t.filter(r => r.IsDeleted !== true)\r\n\t\t\t.map(r => {\r\n\t\t\t\tconst friendly = entityManager.getFriendlyForPrimaryId(r.EntityId);\r\n\t\t\t\tlet primary = friendly;\r\n\r\n\t\t\t\tif(friendly.Entities !== undefined) {\r\n\t\t\t\t\tprimary = friendly?.Entities?.find(e => e.Entity.Id === r.EntityId)?.Entity;\r\n\t\t\t\t}\r\n\t\t\t\tconst thisEntity = { primary, friendly };\r\n\t\t\t\t\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...r,\r\n\t\t\t\t\tentity: thisEntity,\r\n\t\t\t\t\tisSelected: true\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\tctrl.includedReports = augmentedReports.filter(r => r.IsNegative !== true);\r\n\t\tctrl.includedNegatives = augmentedReports.filter(r => r.IsNegative === true)\r\n\t\t\t.map(r => {\r\n\t\t\t\tconst periodIds = r.Periods.map(p => p.Id);\r\n\t\t\t\tconst seasonPeriod = {};\r\n\t\t\t\tfor(const season of ctrl.formConfig.Seasons) {\r\n\t\t\t\t\tconst matchingPeriod = season.Periods.find(p => periodIds.indexOf(p.Id) > -1);\r\n\t\t\t\t\tif(matchingPeriod !== undefined) {\r\n\t\t\t\t\t\tseasonPeriod.season = season;\r\n\t\t\t\t\t\tseasonPeriod.period = matchingPeriod;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst begin = moment(seasonPeriod.period.BeginInclusive).format(\"MM-DD-yyyy HH:mm\");\r\n\t\t\t\tconst end = moment(seasonPeriod.period.EndExclusive).format(\"MM-DD-yyyy HH:mm\");\r\n\t\t\t\tconst periodLabel = `${seasonPeriod.season.Code} - ${seasonPeriod.period.Name}`;\r\n\t\t\t\tconst periodRange = `${begin} - ${end}`;\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...r,\r\n\t\t\t\t\tperiodLabel, \r\n\t\t\t\t\tperiodRange\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t}\r\n}\r\n\r\nexport const createExportModal = angular\r\n\t.module(\"vesl.components.create-new-export\", [])\r\n\t.component(\"createNewExport\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t

    \\r\\n\\t\\tCreate New Export\\r\\n\\t

    \\r\\n
    \\r\\n\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t

    FILTERS{{$ctrl.isCollapsed ? ' & ACTIONS' : ''}}

    \\r\\n\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tNo reports are available for export\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t 0\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\tclass=\\\"main-detail-child sub-heading-print\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\tng-repeat=\\\"report in $ctrl.includedReports\\\"\\r\\n\\t\\t\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
    {{$ctrl.formConfig.nomenclature.PositiveReport}}{{$ctrl.entityLabel}}{{$ctrl.dateLabel}}Created
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t{{report.Number}}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t{{report.entity.friendly.Name || report.entity.friendly.Code}}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t{{report.entity.primary.Name || report.entity.primary.Code}}\\r\\n\\t\\t\\t\\t\\t\\t\\t{{report.Date | date: 'MM-dd-yyyy HH:mm'}}{{report.Created | date: 'MM-dd-yyyy HH:mm'}}
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tNo negatives are available for export\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t 0\\\"\\r\\n\\t\\t\\t\\t\\t\\tclass=\\\"main-details\\\"\\r\\n\\t\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
    {{$ctrl.entityLabel}}PeriodCreated
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
    {{report.entity.friendly.Name || report.entity.friendly.Code}}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t{{report.entity.primary.Name || report.entity.primary.Code}}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t{{report.periodLabel}}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t{{report.periodRange}}\\r\\n\\t\\t\\t\\t\\t\\t\\t{{report.Created | date: 'MM-dd-yyyy HH:mm'}}
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\r\\n
    \\r\\n\\t\\r\\n\\t\\tCancel\\r\\n\\t\\r\\n\\t\\r\\n\\t\\tCreate Export\\r\\n\\t\\r\\n
    \";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport { sumBy } from \"lodash\";\r\n\r\nexport function controller() {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\taggregateReportExports();\r\n\t};\r\n\r\n\tctrl.$onChanges = () => {\r\n\t\taggregateReportExports();\r\n\t};\r\n\r\n\tfunction aggregateReportExports() {\r\n\t\tconst reports = ctrl.exportLog?.Reports ?? [];\r\n\r\n\t\tctrl.totalReports = reports?.length ?? 0;\r\n\t\tctrl.committed = sumBy(reports, r => r.IsCommitted ? 1 : 0);\r\n\t\tctrl.suppressed = sumBy(reports, r => r.IsSuppressed ? 1 : 0);\r\n\t\tctrl.errored = sumBy(reports, r => r.Errors?.length > 0 ? 1 : 0);\r\n\t\tctrl.pending = ctrl.totalReports - ctrl.committed - ctrl.suppressed - ctrl.errored;\r\n\t}\r\n}\r\n\r\nexport const informationTab = angular.module(\"vesl.components.exports.view-export.information-tab\", [])\r\n\t.component(\"informationTab\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\texportLog: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\tExport Log Id\\r\\n\\t\\t\\t\\t{{$ctrl.exportLog.Id}}\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\tConfiguration\\r\\n\\t\\t\\t\\t{{$ctrl.exportLog.Configuration.Code}}\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\tCreated\\r\\n\\t\\t\\t\\t{{$ctrl.exportLog.Created | date:'MM/dd/yyyy hh:mm a'}}\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\tTotal\\r\\n\\t\\t\\t\\t{{$ctrl.totalReports}}\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\tCommitted\\r\\n\\t\\t\\t\\t{{$ctrl.committed}}\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\tPending\\r\\n\\t\\t\\t\\t{{$ctrl.pending}}\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\tErrored\\r\\n\\t\\t\\t\\t{{$ctrl.errored}}\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\tSuppressed\\r\\n\\t\\t\\t\\t{{$ctrl.suppressed}}\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n
    \";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\n\r\nexport function controller($logger, clipboard) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.canClipboard = clipboard.supported;\r\n\t};\r\n}\r\n\r\n// type ExportMetadata = {\r\n// \tValue: string;\r\n// \tType: {\r\n// \t\tCode: string;\r\n// \t\tName: string;\r\n// \t\tParticipant: {\r\n// \t\t\tCode: Guid;\r\n// \t\t\tName: string;\r\n// \t\t}\r\n// \t}\r\n// };\r\n\r\nexport const metadataTab = angular.module(\"vesl.components.exports.view-export.metadata-tab\", [])\r\n\t.component(\"metadataTab\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\texportLog: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tNo metadata is available\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t 0\\\"\\r\\n\\t>\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n
    TypeParticipantValue
    \\r\\n\\t\\t\\t\\t{{export.Type.Name || export.Type.Code}}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t{{export.Type.Participant.Name || export.Type.Participant.Code}}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t{{export.Value}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \";","import template from \"./metadata-modal.html\";\r\nimport \"./metadata-modal.less\";\r\nimport { EVENT_LOGOUT } from \"../../../../../../constants\";\r\n\r\nexport class Controller {\r\n\tconstructor(appState, eventBus, $scope, toastr) {\r\n\t\tthis.appState = appState;\r\n\t\tthis.eventBus = eventBus;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$toastr = toastr;\r\n\r\n\t\tthis.export = { \r\n\t\t\tMetadata: [],\r\n\t\t\t...this.resolve.reportExport\r\n\t\t};\r\n\t}\r\n\r\n\t$onInit() {\r\n\t\tthis.eventBus.register(EVENT_LOGOUT, () => { this.handleClose(); }, this.$scope);\r\n\t}\r\n\r\n\thandleClose() {\r\n\t\tthis.modalInstance.dismiss();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.metadata-modal\", [])\r\n\t.component(\"metadataModal\", {\r\n\t\tcontroller: Controller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t Report Export Metadata \\r\\n
    \\r\\n\\r\\n\\t\\r\\n\\r\\n
    \\r\\n\\tClose\\r\\n
    \";","import metadataModal from \"./metadata-modal/metadata-modal\";\r\nimport template from \"./report-export-actions.html\";\r\nimport \"./report-export-actions.less\";\r\n\r\nfunction controller(\r\n\t$logger,\r\n\t$uibModal\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = () => {\r\n\t};\r\n\r\n\tctrl.viewMetadata = () => {\r\n\t\topenMetadataModal();\r\n\t};\r\n\r\n\tasync function openMetadataModal() {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"metadata-modal\",\r\n\t\t\tsize: \"lg\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\treportExport: () => ctrl.reportExport\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.components.report-export-actions\", [metadataModal])\r\n\t.component(\"reportExportActions\", {\r\n\t\ttemplate,\r\n\t\ttransclude: true,\r\n\t\tcontroller,\r\n\t\tbindings: {\r\n\t\t\treportExport: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
      \\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t
        \\r\\n\\t\\t\\t
      • \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tView Metadata\\r\\n\\t\\t\\t
      • \\r\\n\\t\\t
      \\r\\n\\t\\r\\n
    \";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport moment from \"moment\";\r\n\r\nimport {\r\n\tCURSOR_DIRECTIONS, \r\n\tEXPORT_STATUSES, \r\n\tFILTER_OPERATORS \r\n} from \"../../constants\";\r\nimport { FORM_REPORTS_BY_ID } from \"../../../../routes\";\r\nimport reportExportActions from \"./report-export-actions/report-export-actions\";\r\n\r\nexport function controller(appState, entityManager, loadingService, api, $window, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.formConfig = appState.forms.selected;\r\n\t\tctrl.entityLabel = entityManager.primaryFieldLabel;\r\n\t\t\r\n\t\tconst primaryDateField = ctrl.formConfig.Fields.find(f => f.IsPrimary === true && f.Type.Code === \"DATE\");\r\n\t\tctrl.dateLabel = primaryDateField.Name;\r\n\r\n\t\tctrl.includedReports = [];\r\n\t\tctrl.includedNegatives = [];\r\n\r\n\t\tloadingService.watch(loadReports());\r\n\t};\r\n\r\n\tctrl.viewReport = (reportId) => {\r\n\t\t$window.open(`/report?id=${reportId}`, \"_blank\");\r\n\t};\r\n\r\n\tasync function loadReports() {\r\n\t\tconst ids = ctrl.exportLog.Reports.map(r => r.Report.Id);\r\n\t\tconst Filter = {\r\n\t\t\tId: { [FILTER_OPERATORS.in.code]: ids }\r\n\t\t};\r\n\t\tconst Cursor = {\r\n\t\t\tCount: ids.length,\r\n\t\t\tDirection: CURSOR_DIRECTIONS.forward.code\r\n\t\t};\r\n\t\tconst request = {\r\n\t\t\tFilter, \r\n\t\t\tCursor\r\n\t\t};\r\n\t\t\t\t\r\n\t\tconst reports = await api.post(FORM_REPORTS_BY_ID(ctrl.formConfig.Id), request);\r\n\r\n\t\tconst augmentedReports = (reports.Items ?? [])\r\n\t\t\t.map(r => {\r\n\t\t\t\tconst friendly = entityManager.getFriendlyForPrimaryId(r.EntityId);\r\n\t\t\t\tlet primary = friendly;\r\n\r\n\t\t\t\tif(friendly.Entities !== undefined) {\r\n\t\t\t\t\tprimary = friendly?.Entities?.find(e => e.Entity.Id === r.EntityId)?.Entity;\r\n\t\t\t\t}\r\n\t\t\t\tconst thisEntity = { primary, friendly };\r\n\t\t\t\tconst exportReport = ctrl.exportLog.Reports.find(elr => elr.Report.Id === r.Id);\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...r,\r\n\t\t\t\t\tentity: thisEntity,\r\n\t\t\t\t\tisSelected: true,\r\n\t\t\t\t\texport: exportReport,\r\n\t\t\t\t\tstatus: exportReport.IsCommitted === true ? EXPORT_STATUSES.committed\r\n\t\t\t\t\t\t: exportReport.Errors?.length > 0 ? EXPORT_STATUSES.errored\r\n\t\t\t\t\t\t: exportReport.IsSuppressed === true ? EXPORT_STATUSES.suppressed\r\n\t\t\t\t\t\t: EXPORT_STATUSES.pending\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\tctrl.includedReports = augmentedReports.filter(r => r.IsNegative !== true);\r\n\t\tctrl.includedNegatives = augmentedReports.filter(r => r.IsNegative === true)\r\n\t\t\t.map(r => {\r\n\t\t\t\tconst periodIds = r.Periods.map(p => p.Id);\r\n\t\t\t\tconst seasonPeriod = {};\r\n\t\t\t\tfor(const season of ctrl.formConfig.Seasons) {\r\n\t\t\t\t\tconst matchingPeriod = season.Periods.find(p => periodIds.indexOf(p.Id) > -1);\r\n\t\t\t\t\tif(matchingPeriod !== undefined) {\r\n\t\t\t\t\t\tseasonPeriod.season = season;\r\n\t\t\t\t\t\tseasonPeriod.period = matchingPeriod;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst begin = moment(seasonPeriod.period.BeginInclusive).format(\"MM-DD-yyyy HH:mm\");\r\n\t\t\t\tconst end = moment(seasonPeriod.period.EndExclusive).format(\"MM-DD-yyyy HH:mm\");\r\n\t\t\t\tconst periodLabel = `${seasonPeriod.season.Code} - ${seasonPeriod.period.Name}`;\r\n\t\t\t\tconst periodRange = `${begin} - ${end}`;\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...r,\r\n\t\t\t\t\tperiodLabel, \r\n\t\t\t\t\tperiodRange\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\treturn {\r\n\t\t\treports: ctrl.includedReports,\r\n\t\t\tnegatives: ctrl.includedNegatives\r\n\t\t};\r\n\t}\r\n}\r\n\r\nexport const reportsTab = angular.module(\"vesl.components.exports.view-export.reports-tab\", [reportExportActions])\r\n\t.component(\"reportsTab\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\texportLog: \"<\"\r\n\t\t}\r\n\t})\r\n\t.name;\r\n","export default \"
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t

    \\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\tNo reports are available for export\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t 0\\\"\\r\\n\\t\\t\\t\\t\\tclass=\\\"main-detail-child sub-heading-print\\\"\\r\\n\\t\\t\\t\\t\\tng-repeat=\\\"report in $ctrl.includedReports\\\"\\r\\n\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
    {{$ctrl.formConfig.nomenclature.PositiveReport}}{{$ctrl.entityLabel}}{{$ctrl.dateLabel}}CreatedStatus
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t{{report.Number}}\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{report.entity.friendly.Name || report.entity.friendly.Code}}\\r\\n\\t\\t\\t\\t\\t\\t{{report.entity.primary.Name || report.entity.primary.Code}}\\r\\n\\t\\t\\t\\t\\t{{report.Date | date: 'MM-dd-yyyy HH:mm'}}{{report.Created | date: 'MM-dd-yyyy HH:mm'}}\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t

    \\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\tNo negatives are available for export\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t 0\\\"\\r\\n\\t\\t\\t\\tclass=\\\"main-details\\\"\\r\\n\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t
    {{$ctrl.entityLabel}}PeriodCreatedStatus
    {{report.entity.friendly.Name || report.entity.friendly.Code}}\\r\\n\\t\\t\\t\\t\\t\\t{{report.entity.primary.Name || report.entity.primary.Code}}\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t{{report.periodLabel}}\\r\\n\\t\\t\\t\\t\\t\\t{{report.periodRange}}\\r\\n\\t\\t\\t\\t\\t{{report.Created | date: 'MM-dd-yyyy HH:mm'}}\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t
    \\r\\n
    \";","import template from \"./index.html\";\r\nimport \"./index.less\";\r\nimport { EVENT_LOGOUT } from \"../../../constants\";\r\nimport { informationTab } from \"./information-tab\";\r\nimport { metadataTab } from \"./metadata-tab\";\r\nimport { FORM_EXPORT_LOGS } from \"../../../routes\";\r\nimport { reportsTab } from \"./reports-tab\";\r\n\r\nfunction controller(\r\n\t$scope, \r\n\teventBus, \r\n\t$logger, \r\n\tappState, \r\n\tapi,\r\n\tloadingService\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.$onDestroy = ctrl.handleClose;\r\n\tctrl.tabs = [\r\n\t\t{ name: \"Information\" },\r\n\t\t{ name: \"Metadata\" },\r\n\t\t{ name: \"Reports\" }\r\n\t];\r\n\tctrl.selectedTab = ctrl.tabs[0];\r\n\r\n\tctrl.$onInit = () => {\r\n\t\teventBus.register(EVENT_LOGOUT, () => { ctrl.handleClose(); }, $scope);\r\n\r\n\t\tctrl.formConfig = appState.forms.selected;\r\n\t\tloadingService.watch(loadExportLog());\r\n\t};\r\n\r\n\tctrl.handleClose = () => {\r\n\t\tctrl.modalInstance.close();\r\n\t};\r\n\r\n\tasync function loadExportLog() {\r\n\t\tctrl.fullExportLog = await api.get(FORM_EXPORT_LOGS(ctrl.formConfig.Id, ctrl.resolve.exportLog.Id));\r\n\t}\r\n}\r\n\r\nexport const viewExportModal = angular\r\n\t.module(\"vesl.components.view-export\", [informationTab, metadataTab, reportsTab])\r\n\t.component(\"viewExport\", {\r\n\t\tcontroller,\r\n\t\ttemplate,\r\n\t\tbindings: {\r\n\t\t\tclose: \"&\",\r\n\t\t\tdismiss: \"&\",\r\n\t\t\tmodalInstance: \"<\",\r\n\t\t\tresolve: \"<\"\r\n\t\t}\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t

    \\r\\n\\t\\tView Export\\r\\n\\t

    \\r\\n
    \\r\\n\\r\\n
    \\r\\n\\t
    \\r\\n\\t\\t
      \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t{{tab.name}}\\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t
    \\r\\n\\r\\n
    \\r\\n\\t\\r\\n\\t\\tClose\\r\\n\\t\\r\\n
    \";","import \"./exports.less\";\r\nimport template from \"./exports.html\";\r\nimport { FUSE_DEFAULTS } from \"constants.js\";\r\nimport fuse from \"fuse.js\";\r\nimport { FORM_EXPORT_LOG_PAGE } from \"../../routes\";\r\nimport { globs } from \"../../services/globs\";\r\nimport {\r\n\tActionOrPattern,\r\n\tAny\r\n} from \"../../services/security/actionScopes\";\r\nimport {\r\n\tFILTER_OPERATORS, \r\n\tSORT_DIRECTIONS \r\n} from \"./constants\";\r\nimport moment from \"moment\";\r\nimport { debounce } from \"lodash\";\r\nimport { createExportModal } from \"./create-new-export\";\r\nimport { viewExportModal } from \"./view-export\";\r\n\r\nconst allowedConfigsToCreate = [\"BYCHANGED\"];\r\n\r\nfunction controller(\r\n\tappState, \r\n\tloadingService, \r\n\ttableHelper, \r\n\t$uibModal, \r\n\t$logger, \r\n\tapi, \r\n\tsecurityService,\r\n\t$state\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl._uibModal = $uibModal;\r\n\tctrl.onCollapse = onCollapse;\r\n\tctrl.tableWidthCss = \"col-sm-9\";\r\n\r\n\tctrl.fuse = new fuse([], {\r\n\t\t...FUSE_DEFAULTS,\r\n\t\tdistance: 32,\r\n\t\tthreshold: 0.4\r\n\t});\r\n\r\n\tctrl.table = {\r\n\t\tdata: [],\r\n\t\tactions: {},\r\n\t\tsort: {\r\n\t\t\tpredicate: \"Id\",\r\n\t\t\tdirection: \"asc\"\r\n\t\t},\r\n\t\tfilter: () => { \r\n\t\t\ttableHelper.filter(ctrl.table, ctrl.fuse, \"Id\"); \r\n\t\t\tctrl.paginatorOptions = {\r\n\t\t\t\t...ctrl.paginatorOptions, \r\n\t\t\t\ttotalItems: ctrl.totalLogs ?? 0\r\n\t\t\t};\r\n\t\t},\r\n\t\treset: () => reset(),\r\n\t\tfilterBy: null\r\n\t};\r\n\tctrl.paginatorOptions = {};\r\n\tctrl.exportConfigurations = [];\r\n\tctrl.canCreateExport = globs.exports(\"*\").create;\r\n\tctrl.hasAnyUxAction = new Any([\r\n\t\tnew ActionOrPattern(this.canCreateExport)\r\n\t]);\r\n\r\n\tctrl.isByChangedConfig = false;\r\n\r\n\tctrl.$onInit = () => {\r\n\t\tctrl.form = appState.forms.selected;\r\n\r\n\t\tsetDefaultFilters();\r\n\r\n\t\tgetExports(ctrl.paginatorOptions?.currentPage ?? 1, ctrl.paginatorOptions?.itemsPerPage ?? 10);\r\n\t};\r\n\r\n\tctrl.view = (exportData) => {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"view-export\",\r\n\t\t\tsize: \"xlg\",\r\n\t\t\tresolve: {\r\n\t\t\t\tselectedConfig: () => ctrl.filter.selectedExportConfig,\r\n\t\t\t\texportLog: () => exportData\r\n\t\t\t},\r\n\t\t\tkeyboard: false,\r\n\t\t\tbackdrop: \"static\"\r\n\t\t}).result.then(() => {\r\n\t\t});\r\n\t};\r\n\r\n\tctrl.tableDataUpdate = () => {\r\n\t\tgetExports(ctrl.paginatorOptions.currentPage, ctrl.paginatorOptions.itemsPerPage);\r\n\t};\r\n\r\n\tctrl.updateSearchFilter = debounce(ctrl.tableDataUpdate, 500, { \"leading\": false, \"trailing\": true });\r\n\r\n\tctrl.clearSearchFilter = () => {\r\n\t\tif(ctrl.filter.search) {\r\n\t\t\tdelete ctrl.filter.search;\r\n\t\t\tctrl.tableDataUpdate();\r\n\t\t}\r\n\t};\r\n\r\n\tctrl.updateDateFilter = (startDate, endDate) => {\r\n\t\tif(startDate || endDate) {\r\n\t\t\tctrl.filter.startDate = startDate || ctrl.filter.startDate;\r\n\t\t\tctrl.filter.endDate = endDate || ctrl.filter.endDate;\r\n\t\t}\r\n\r\n\t\tctrl.tableDataUpdate();\r\n\t};\r\n\r\n\tctrl.onExportSelectionChanged = (selection) => {\r\n\t\tctrl.filter.selectedExportConfig = selection?.Code;\r\n\t\tctrl.isByChangedConfig = allowedConfigsToCreate.indexOf(selection.Type.Code) > -1;\r\n\r\n\t\tctrl.tableDataUpdate();\r\n\t};\r\n\r\n\tctrl.createNewExport = () => {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"create-new-export\",\r\n\t\t\tsize: \"xlg\",\r\n\t\t\tresolve: {\r\n\t\t\t\tselectedConfig: () => ctrl.filter.selectedExportConfig,\r\n\t\t\t\tavailableConfigs: () => ctrl.exportConfigurations\r\n\t\t\t},\r\n\t\t\tkeyboard: false,\r\n\t\t\tbackdrop: \"static\"\r\n\t\t}).result.then(() => {\r\n\t\t\tgetExports(ctrl.paginatorOptions?.currentPage ?? 1, ctrl.paginatorOptions?.itemsPerPage ?? 10);\r\n\t\t});\r\n\t};\r\n\r\n\tasync function getExports(page, count) {\r\n\t\tif(ctrl.filter.selectedExportConfig === undefined) {\r\n\t\t\tctrl.totalLogs = 0;\r\n\t\t\tsetTableData([]);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst { start, end } = getDateRangeFilter();\r\n\r\n\t\tconst Filter = {\r\n\t\t\tAnd: [\r\n\t\t\t\t{\r\n\t\t\t\t\tCreated: {\r\n\t\t\t\t\t\t[FILTER_OPERATORS.lessThan.code]: end.toISOString()\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tCreated: {\r\n\t\t\t\t\t\t[FILTER_OPERATORS.greaterThanOrEqualTo.code]: start.toISOString()\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tConfiguration: {\r\n\t\t\t\t\t\tCode: {\r\n\t\t\t\t\t\t\t[FILTER_OPERATORS.equals.code]: ctrl.filter.selectedExportConfig\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t};\r\n\t\tif(ctrl.filter.search) {\r\n\t\t\tFilter.And.push({ \r\n\t\t\t\tId: { \r\n\t\t\t\t\t[FILTER_OPERATORS.equals.code]: ctrl.filter.search \r\n\t\t\t\t} \r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tconst logs = api.post(FORM_EXPORT_LOG_PAGE(ctrl.form.Id), {\r\n\t\t\tFilter,\r\n\t\t\tSort: {\r\n\t\t\t\tDirection: SORT_DIRECTIONS.ascending.code,\r\n\t\t\t\tBy: \"Id\"\r\n\t\t\t},\r\n\t\t\tPage: {\r\n\t\t\t\tCount: count,\r\n\t\t\t\tPage: page\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tctrl.currentLogs = await loadingService.watch(logs);\r\n\t\tif(page === 1) {\r\n\t\t\tctrl.totalLogs = ctrl.currentLogs.Total;\r\n\t\t}\r\n\r\n\t\tconst allowedLogs = (ctrl.currentLogs.Data ?? []).filter(l => {\r\n\t\t\tconst isAllowed = securityService.isActionAllowed(globs.exports(l.Configuration.Code).logs(l.Id).read);\r\n\t\t\t\r\n\t\t\treturn isAllowed;\r\n\t\t});\r\n\r\n\t\tsetTableData(allowedLogs);\r\n\t}\r\n\r\n\tfunction getDateRangeFilter() { \r\n\t\t//if this is custom entry, then it will at least get rounded to the next mionute\r\n\t\t//if this is a range, and passed the last second/millisecond of the range, will be rounded to the next probable minute intended\r\n\t\tconst start = moment(ctrl.filter.startDate);\r\n\t\tconst end = moment(ctrl.filter.endDate);\r\n\r\n\t\tconst startDate = start;\r\n\t\tconst endDate = end.second() != 0 || end.millisecond() != 0\r\n\t\t\t? end.add(1, \"minute\")\r\n\t\t\t\t.startOf(\"minute\")\r\n\t\t\t: end;\r\n\r\n\t\treturn {\r\n\t\t\tstart: startDate,\r\n\t\t\tend: endDate\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setDefaultFilters() {\r\n\t\tconst dateStart = $state.params.start;\r\n\t\tconst dateEnd = $state.params.end;\r\n\r\n\t\tconst start = dateStart ? moment(dateStart, \"YYYY/MM/DD\") : moment().startOf(\"month\");\r\n\t\tconst end = dateEnd ? moment(dateEnd, \"YYYY/MM/DD\") : moment().endOf(\"month\");\r\n\t\tctrl.filter = {\r\n\t\t\tstartDate: start.toDate(),\r\n\t\t\tendDate: end.toDate()\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setTableData(exportItems) {\r\n\t\tctrl.table.data = exportItems;\r\n\t\tctrl.fuse.list = exportItems;\r\n\t\tctrl.paginatorOptions = {\r\n\t\t\t...ctrl.paginatorOptions, \r\n\t\t\ttotalItems: ctrl.totalLogs ?? 0\r\n\t\t};\r\n\t}\r\n\r\n\tfunction reset() {\r\n\t\tctrl.table.filterBy = null;\r\n\t\tctrl.table.filter();\r\n\t}\r\n\r\n\tfunction onCollapse() {\r\n\t\tctrl.tableWidthCss = ctrl.isCollapsed ? \"col-sm-12\" : \"col-sm-9\";\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.exports\", [createExportModal, viewExportModal])\r\n\t.component(\"exports\", {\r\n\t\ttemplate,\r\n\t\tcontroller\r\n\t}).name;\r\n","export default \"\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t

    FILTERS

    \\r\\n\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t

    ACTIONS

    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Create New Export\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t 0 ? 'overflow-auto' : ''\\\"\\r\\n\\t\\t\\t\\t\\tgrid-data\\r\\n\\t\\t\\t\\t\\tgrid-options=\\\"$ctrl.table\\\"\\r\\n\\t\\t\\t\\t\\tgrid-actions=\\\"$ctrl.table.actions\\\"\\r\\n\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t Created Date\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t # of Reports\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t Created By\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t Status\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t 0\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t {{item.Created | date:'MM/dd/yyyy hh:mm a'}}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t {{item.Total}}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t {{item.Subject.Username}}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t No exports of this type found. \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\r\\n\";","import \"./messaging.less\";\r\nimport \"./messaging.html\";\r\nimport template from \"./messaging.html\";\r\nimport { DASHBOARD } from \"../../routes\";\r\n\r\nexport class MessagingScreen {\r\n\tconstructor(\r\n\t\tmessagingService, uiHelpers, $state, $featureFlags\r\n\t) {\r\n\t\tthis.messagingService = messagingService;\r\n\t\tthis.uiHelpers = uiHelpers;\r\n\t\tthis.featureFlags = $featureFlags;\r\n\t\tthis.state = $state;\r\n\t}\r\n\r\n\tisCollapsed = false;\r\n\ttableWidthCss = \"col-sm-9\";\r\n\r\n\tthreads;\r\n\tcontacts;\r\n\tcurrentThread = null;\r\n\tnewMessage;\r\n\r\n\tthisUserId = 0;\r\n\tthreadHeader = {};\r\n\r\n\t$onInit() {\r\n\t\tconst showMessaging = this.featureFlags.getFeature(this.featureFlags.FEATURES.Messaging);\r\n\r\n\t\tif(!showMessaging) {\r\n\t\t\tthis.state.transitionTo(DASHBOARD, {}, { location: \"replace\", reload: DASHBOARD });\r\n\t\t}\r\n\r\n\t\tthis.threads = this.messagingService.getThreadList(0);\r\n\t\tthis.contacts = this.messagingService.getAllContacts(0);\r\n\t\tthis.currentThread = null;\r\n\t}\r\n\r\n\tonCollapse() {\r\n\t\tthis.tableWidthCss = this.isCollapsed ? \"col-sm-12\" : \"col-sm-9\";\r\n\t}\r\n\r\n\tselectThread(thread) {\r\n\t\tconst fullThread = this.messagingService.getThread(thread.threadId);\r\n\r\n\t\tthis.currentThread = fullThread;\r\n\t\tthis.loadThreadHeader();\r\n\t}\r\n\r\n\tloadThreadHeader() {\r\n\t\tconst participants = this.currentThread.header.participants.filter((item) => item.userId !== this.thisUserId);\r\n\t\tconst participantArray = participants.map((item) => item.firstName);\r\n\t\tconst participantString = participants.length > 1 ? participantArray.join(\", \") : `${participants[0].firstName} ${participants[0].lastName}`;\r\n\r\n\t\tconst participantInitials = participants[0].firstName.substring(0, 1) + participants[0].lastName.substring(0, 1);\r\n\r\n\t\tconst hexBkColor = this.uiHelpers.stringToHexColour(participantString);\r\n\t\tconst bkColor = \"#\" + hexBkColor.toString(16);\r\n\t\tconst avTextColor = this.uiHelpers.textColorForHexBk(hexBkColor);\r\n\r\n\t\tthis.threadHeader = {\r\n\t\t\tparticipants: participantString,\r\n\t\t\tinitials: participantInitials,\r\n\t\t\tbkColor: bkColor,\r\n\t\t\tavTextColor: avTextColor,\r\n\t\t\tsubject: this.currentThread.header.subject\r\n\t\t};\r\n\t}\r\n\r\n\tpostNewMessage() {\r\n\t\t// eslint-disable-next-line no-unused-vars\r\n\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n\t\tconst postedMessage = this.messagingService.newMessage(this.newMessage, this.currentThread.header.threadId, this.thisUserId);\r\n\r\n\t\tthis.newMessage = \"\";\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.messaging\", [])\r\n\t.component(\"messaging\", {\r\n\t\ttemplate,\r\n\t\tcontroller: MessagingScreen\r\n\t}).name;\r\n","export default \"
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t

    MESSAGES\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t

    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t New Conversation \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t {{$ctrl.threadHeader.initials}}
    \\r\\n\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t{{$ctrl.threadHeader.participants}} » {{$ctrl.threadHeader.subject}}\\r\\n\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t No message thread selected. Please click a conversation or begin a new one to get started. \\r\\n\\t\\r\\n\";","export const ROLE_TYPES = {\r\n\tsysAdmin: \"SYSADMIN\",\r\n\tagent: \"AGENT\",\r\n\tsuperUser: \"SUSER\",\r\n\tuser: \"USER\"\r\n};\r\n","import moment from \"moment-timezone\";\r\nimport \"./report-list.less\";\r\nimport template from \"./report-list.html\";\r\nimport {\r\n\tfilter,\r\n\tfind,\r\n\tsome,\r\n\tuniq\r\n} from \"lodash\";\r\nimport {\r\n\tEVENT_NEW_REPORTING_ENTITY,\r\n\tEVENT_REPORT_STATUS_CHANGE,\r\n\tFIELD_KEYS,\r\n\tFIELD_TEMPLATES,\r\n\tTIME_DISPLAY_OPTIONS,\r\n\tFORM_TIMEZONE_TYPES,\r\n\tEVENT_RESET_REPORTING_ENTITY,\r\n\tREPORT_STATES\r\n} from \"constants.js\";\r\nimport { pluralize } from \"humanize-plus\";\r\nimport {\r\n\tFORM_EXPORT_REPORTS,\r\n\tEDIT_REPORT,\r\n\tNEW_REPORT\r\n} from \"routes.js\";\r\nimport { ROLE_TYPES } from \"config/permissions.js\";\r\nimport { hasHadState } from \"../../utils/\";\r\nimport { entityEffectiveStatus } from \"../../utils/effectiveRanges\";\r\nimport { FORM_REPORT_QUERY } from \"../../routes\";\r\n\r\nfunction controller(\r\n\t$scope,\r\n\t$state,\r\n\t$logger,\r\n\t$sce,\r\n\tappState,\r\n\tapi,\r\n\teventBus,\r\n\tloadingService,\r\n\ttoastr,\r\n\ttimezoneService,\r\n\tentityManager,\r\n\t$userProfile\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.loadReports = loadReports;\r\n\r\n\tctrl.table = {\r\n\t\tdata: [],\r\n\t\tactions: {},\r\n\t\tsort: {\r\n\t\t\tpredicate: \"Number\",\r\n\t\t\tdirection: \"desc\"\r\n\t\t},\r\n\t\tpagination: {\r\n\t\t\tcurrentPage: parseInt($state.params.page) || 1,\r\n\t\t\titemsPerPage: $state.params.itemsPerPage || $userProfile.getUserProfile().pagePreference || \"10\"\r\n\t\t}\r\n\t};\r\n\tctrl.paginatorOptions = {};\r\n\r\n\tctrl.tableWidthCss = \"col-sm-9\";\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.open = open;\r\n\tctrl.download = download;\r\n\tctrl.selectReports = selectReports;\r\n\tctrl.clearSelection = clearSelection;\r\n\tctrl.setSelected = setSelected;\r\n\tctrl.onCollapse = onCollapse;\r\n\tctrl.getEditButtonIcon = getEditButtonIcon;\r\n\tctrl.getExtraData = getExtraData;\r\n\tctrl.updateDateFilter = updateDateFilter;\r\n\tctrl.editReport = editReport;\r\n\tctrl.getDateTime = getDateTime;\r\n\tctrl.onStatusSelectorChange = onStatusSelectorChange;\r\n\tctrl.onLicenseSelectorChange = onLicenseSelectorChange;\r\n\tctrl.updateUserPreference = updateUserPreference;\r\n\r\n\tctrl.showFriendlyEntitySelector = false;\r\n\tctrl.primaryReportingEntity = { Entities: [] };\r\n\r\n\tctrl.NEW_REPORT = NEW_REPORT;\r\n\r\n\tconst buildReportListEvent = $logger.buildWebEvent(\"reportList\");\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.promiseTracker = loadingService.getTracker();\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.permissions = appState.permissions;\r\n\r\n\t\tctrl.timeDisplay = $userProfile.getUserProfile().timeDisplay;\r\n\t\tctrl.timeFormat = this.timeDisplay === TIME_DISPLAY_OPTIONS.TWELVE_HOUR ? \"MM-DD-YYYY hh:mm A\" : \"MM-DD-YYYY HH:mm\";\r\n\t\tctrl.dateOnlyFormat = \"MM-DD-YYYY\";\r\n\r\n\t\tctrl.statusOptions = [\r\n\t\t\t{ key: null, display: \"All\" },\r\n\t\t\t{ key: REPORT_STATES.deleted.code, display: REPORT_STATES.deleted.display },\r\n\t\t\t{ key: REPORT_STATES.pending.code, display: REPORT_STATES.pending.display },\r\n\t\t\t{ key: REPORT_STATES.submitted.code, display: REPORT_STATES.submitted.display },\r\n\t\t\t{ key: REPORT_STATES.declared.code, display: REPORT_STATES.declared.display }\r\n\t\t];\r\n\r\n\t\tctrl.licenses = [{ key: null, display: \"All\" }];\r\n\r\n\t\teventBus.register(EVENT_NEW_REPORTING_ENTITY, updateReportSearch, $scope);\r\n\t\teventBus.register(EVENT_REPORT_STATUS_CHANGE, () => updateReport, $scope);\r\n\r\n\t\tsetDefaultFilters();\r\n\t}\r\n\r\n\tfunction setDefaultFilters() {\r\n\t\tconst dateStart = $state.params.start;\r\n\t\tconst dateEnd = $state.params.end;\r\n\t\tconst statusKey = $state.params.status;\r\n\t\tconst licenseIds = $state.params.entityIds;\r\n\r\n\t\tconst start = dateStart ? moment(dateStart, \"YYYY/MM/DD\") : moment().startOf(\"month\");\r\n\t\tconst end = dateEnd ? moment(dateEnd, \"YYYY/MM/DD\") : moment().endOf(\"month\");\r\n\t\tconst status = statusKey ? ctrl.statusOptions.find(x => x.key === statusKey) : ctrl.statusOptions[0];\r\n\t\tctrl.filter = {\r\n\t\t\tstartDate: start.toDate(),\r\n\t\t\tendDate: end.toDate(),\r\n\t\t\tlicense: licenseIds && licenseIds.length === 1 ? { key: licenseIds[0] } : { key: null, display: \"All\" },\r\n\t\t\tstatus: status\r\n\t\t};\r\n\t}\r\n\r\n\tfunction updateReportingEntitySelector(friendly = ctrl.primaryReportingEntity) {\r\n\t\tctrl.primaryReportingEntity = friendly;\r\n\r\n\t\tif(!ctrl.primaryReportingEntity) {\r\n\t\t\tctrl.licenses = [{ key: null, display: \"All\" }];\r\n\t\t\tctrl.filter.license.key = null;\r\n\t\t}\r\n\r\n\t\telse if(!ctrl.primaryReportingEntity.isSelf) {\r\n\t\t\tconst validEntities = ctrl.primaryReportingEntity.Entities.filter((entity) => entityEffectiveStatus(entity, ctrl.filter.startDate).isEither);\r\n\r\n\t\t\tctrl.licenses = [\r\n\t\t\t\t{ key: null, display: \"All\" },\r\n\t\t\t\t...validEntities.map(x => ({ key: x.Entity.Id, display: x.Entity.Code }))\r\n\t\t\t];\r\n\r\n\t\t\tconst selectedLicenseIsNotValid = ctrl.licenses.map(l => l.key && l.key.toString()).indexOf(ctrl.filter.license.key) < 0;\r\n\t\t\tif(!ctrl.filter.license || selectedLicenseIsNotValid) {\r\n\t\t\t\tctrl.filter.license.key = ctrl.licenses.length === 2 ? ctrl.licenses[1].key : null;\r\n\t\t\t}\r\n\r\n\t\t\tctrl.showFriendlyEntitySelector = ctrl.licenses.length > 2;\r\n\r\n\t\t\tif(ctrl.showFriendlyEntitySelector) {\r\n\t\t\t\tctrl.primaryAssociatedEntityName =\r\n\t\t\t\t\tctrl.primaryReportingEntity && ctrl.primaryReportingEntity.Entities && ctrl.primaryReportingEntity.Entities[0] && ctrl.primaryReportingEntity.Entities[0].Entity\r\n\t\t\t\t\t\t? ctrl.primaryReportingEntity.Entities[0].Entity.Type.Name\r\n\t\t\t\t\t\t: null;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tctrl.licenses = [\r\n\t\t\t\t{ key: null, display: \"All\" },\r\n\t\t\t\t{ key: ctrl.primaryReportingEntity.Id, display: ctrl.primaryReportingEntity.Name || ctrl.primaryReportingEntity.Code }\r\n\t\t\t];\r\n\r\n\t\t\tctrl.filter.license.key = ctrl.primaryReportingEntity.Id;\r\n\t\t}\r\n\t\tif(ctrl.licenses.length < 2) {\r\n\t\t\teventBus.trigger(EVENT_RESET_REPORTING_ENTITY);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tupdateUrl();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateReportSearch() {\r\n\t\tctrl.licenses = [];\r\n\t\tctrl.showFriendlyEntitySelector = false;\r\n\r\n\t\tupdateReportingEntitySelector(entityManager.getSelectedEntity().friendly);\r\n\t}\r\n\r\n\tfunction updateReport(report) {\r\n\t\tctrl.table.data = ctrl.table.data.map(r => {\r\n\t\t\tif(r.Id == report.Id) {\r\n\t\t\t\tr = report;\r\n\t\t\t}\r\n\t\t\treturn r;\r\n\t\t});\r\n\t}\r\n\r\n\tfunction download() {\r\n\t\tconst label = pluralize(ctrl.selected.length, ctrl.form.nomenclature.PositiveReport);\r\n\r\n\t\t$logger.event(buildReportListEvent(\"export\")(\"csv\"), { length: ctrl.selected.length });\r\n\r\n\t\tif(ctrl.selected.length) {\r\n\t\t\tconst params = { Ids: ctrl.selected };\r\n\r\n\t\t\tconst promise = api\r\n\t\t\t\t.post(FORM_EXPORT_REPORTS(ctrl.form.Id), params, { headers: { \"Accept\": \"text/csv\" } })\r\n\t\t\t\t.then(response => {\r\n\t\t\t\t\tconst ie = navigator.userAgent.match(/MSIE\\s([\\d.]+)/);\r\n\t\t\t\t\tconst ie11 = navigator.userAgent.match(/Trident\\/7.0/) && navigator.userAgent.match(/rv:11/);\r\n\t\t\t\t\tconst ieEDGE = navigator.userAgent.match(/Edge/g);\r\n\t\t\t\t\tconst ieVer = ie ? ie[1] : ie11 ? 11 : ieEDGE ? 12 : -1;\r\n\r\n\t\t\t\t\tif(ie && ieVer < 10) {\r\n\t\t\t\t\t\t$logger.warn(\"Blobs are unsupported in this IE version\", { version: ieVer });\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst textFileAsBlob = new Blob([response], {\r\n\t\t\t\t\t\ttype: \"text/plain\"\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tconst fileNameToSaveAs = `VESL_Reports_${moment().format(\"MM-DD-YYYY-HH-mm-ss\")}.csv`;\r\n\r\n\t\t\t\t\tif(ieVer > -1) {\r\n\t\t\t\t\t\twindow.navigator.msSaveBlob(textFileAsBlob, fileNameToSaveAs);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconst anchor = angular.element(\"\");\r\n\t\t\t\t\t\tanchor\r\n\t\t\t\t\t\t\t.attr({\r\n\t\t\t\t\t\t\t\thref: \"data:attachment/csv;charset=utf-8,\" + encodeURIComponent(response),\r\n\t\t\t\t\t\t\t\ttarget: \"_blank\",\r\n\t\t\t\t\t\t\t\tdownload: fileNameToSaveAs\r\n\t\t\t\t\t\t\t})[0]\r\n\t\t\t\t\t\t\t.click();\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.catch(err => {\r\n\t\t\t\t\t$logger.exception(err, \"Failure occurred while exporting reports\");\r\n\t\t\t\t});\r\n\r\n\t\t\tloadingService.watch(promise, \"Downloading...\");\r\n\t\t} else {\r\n\t\t\ttoastr.warning(`Please select ${label} to download.`);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction clearSelection() {\r\n\t\tctrl.selectAll = false;\r\n\t\tselectReports();\r\n\t}\r\n\r\n\tfunction onLicenseSelectorChange() {\r\n\t\tupdateUrl();\r\n\t}\r\n\r\n\tfunction selectReports() {\r\n\t\tif(ctrl.table.data.length < 1) {\r\n\t\t\tctrl.selectAll = false;\r\n\t\t} else {\r\n\t\t\tctrl.table.data.forEach(r => {\r\n\t\t\t\tif(r.Submitted && !r.IsDeleted) {\r\n\t\t\t\t\tr.selected = ctrl.selectAll;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tsetSelected();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setSelected() {\r\n\t\tlet anyNotSelected;\r\n\r\n\t\tctrl.selected = filter(ctrl.table.data, item => {\r\n\t\t\tif(!item.selected && item.Submitted && !item.IsDeleted) {\r\n\t\t\t\tanyNotSelected = true;\r\n\t\t\t}\r\n\t\t\treturn item.selected === true;\r\n\t\t}).map(r => r.Id);\r\n\r\n\t\tctrl.selectAll = (ctrl.selectAll || !anyNotSelected) && !anyNotSelected;\r\n\t}\r\n\r\n\r\n\tfunction updateDateFilter(startDate, endDate) {\r\n\t\tif(startDate || endDate) {\r\n\t\t\tctrl.filter.startDate = startDate || ctrl.filter.startDate;\r\n\t\t\tctrl.filter.endDate = endDate || ctrl.filter.endDate;\r\n\r\n\t\t\tconst endDateParam = endDate && moment(ctrl.filter.endDate).format();\r\n\t\t\tconst startDateParam = startDate && moment(ctrl.filter.startDate).format();\r\n\r\n\t\t\t$state.go(\"authenticated.report-list\", { start: startDateParam, end: endDateParam }, {}).then(() => {\r\n\t\t\t\tupdateReportingEntitySelector();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getDateTime(dateData) {\r\n\t\tlet thisMoment = dateData && moment(dateData);\r\n\r\n\t\tif(!thisMoment.isValid() && dateData) {\r\n\t\t\tthisMoment = moment(dateData, ctrl.timeFormat);\r\n\t\t}\r\n\r\n\t\tif(ctrl.primaryDateColumn.Template === FIELD_TEMPLATES.DateTime) {\r\n\t\t\treturn this.timeDisplay === TIME_DISPLAY_OPTIONS.TWELVE_HOUR ? thisMoment.format(\"MM-DD-YYYY hh:mm A\") : thisMoment.format(\"MM-DD-YYYY HH:mm\");\r\n\t\t}\r\n\r\n\t\treturn thisMoment?.format(ctrl.dateOnlyFormat);\r\n\t}\r\n\r\n\tfunction loadReports() {\r\n\t\tctrl.selected = [];\r\n\t\tctrl.selectAll = false;\r\n\r\n\t\tconst selectedEntity = entityManager.getSelectedEntity();\r\n\r\n\t\tif(selectedEntity && (selectedEntity.primary || selectedEntity.friendly)) {\r\n\t\t\tconst isFriendlySelf = entityManager.isEntitySelf(selectedEntity.friendly);\r\n\t\t\tconst primaryEntity = (selectedEntity.primary.Id ? selectedEntity.primary : null) || (isFriendlySelf ? selectedEntity.friendly : null) || {};\r\n\r\n\t\t\tlet entityId,\r\n\t\t\t\tentityIds = [];\r\n\r\n\t\t\tif(ctrl.showFriendlyEntitySelector) {\r\n\t\t\t\tentityIds = ctrl.filter.license && ctrl.filter.license.key ? [parseInt(ctrl.filter.license.key)] : ctrl.licenses.slice(1).map(x => x.key);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tentityId = ctrl.licenses && ctrl.licenses.length === 2 && ctrl.licenses[1].key;\r\n\t\t\t}\r\n\r\n\t\t\tif(ctrl.filter.startDate && ctrl.filter.endDate && (entityId || (entityIds && entityIds.length > 0))) {\r\n\t\t\t\tconst params = buildReportsRequest(ctrl.filter.startDate, ctrl.filter.endDate, entityId, entityIds, ctrl.filter.status.key);\r\n\r\n\t\t\t\tconst url = FORM_REPORT_QUERY(ctrl.form.Id, params);\r\n\t\t\t\tconst promise = api.get(url).then(response => {\r\n\t\t\t\t\tconst extraColumns = ctrl.form.Fields.filter(field => {\r\n\t\t\t\t\t\tconst user = $userProfile.getUser();\r\n\t\t\t\t\t\tconst isUser = user.roles.indexOf(ROLE_TYPES.user) > -1;\r\n\r\n\t\t\t\t\t\tif(isUser && field.Key.Code === FIELD_KEYS.tripType) field.IsIncludedInHeaderSummary = false;\r\n\r\n\t\t\t\t\t\treturn field.IsIncludedInHeaderSummary === true;\r\n\t\t\t\t\t}).map(field => {\r\n\t\t\t\t\t\tconst fieldInfo = { name: field.Name, type: field.Template };\r\n\r\n\t\t\t\t\t\tif(field.Template === FIELD_TEMPLATES.Number) {\r\n\t\t\t\t\t\t\tfieldInfo[\"rounding\"] = field.RoundingPoint;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn fieldInfo;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tconst dateColumns = extraColumns.filter(field => {\r\n\t\t\t\t\t\tconst rowField = find(ctrl.form.Fields, formField => formField.Name === field.name);\r\n\t\t\t\t\t\treturn rowField.Template === FIELD_TEMPLATES.DateTime;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tctrl.primaryDateColumn = find(ctrl.form.Fields, field => {\r\n\t\t\t\t\t\treturn !!field.IsPrimary && (field.Template === FIELD_TEMPLATES.Date || field.Template === FIELD_TEMPLATES.DateTime || field.Template === FIELD_TEMPLATES.YearMonth);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tctrl.extraColumns = extraColumns;\r\n\r\n\t\t\t\t\tconst timeZoneMode = ctrl.form.TimeMode;\r\n\t\t\t\t\tlet timeZoneCode = null;\r\n\r\n\t\t\t\t\tif(timeZoneMode.Code === FORM_TIMEZONE_TYPES.ByEntity) {\r\n\t\t\t\t\t\tif(primaryEntity.Id === undefined) {\r\n\t\t\t\t\t\t\tconst entitiesTimeZones = selectedEntity.friendly.Entities\r\n\t\t\t\t\t\t\t\t.filter(e => entityIds.indexOf(e.Entity.Id) > -1)\r\n\t\t\t\t\t\t\t\t.map(e => e.Entity.TimeZone.Code);\r\n\t\t\t\t\t\t\tconst uniqueZones = uniq(entitiesTimeZones);\r\n\r\n\t\t\t\t\t\t\tif(uniqueZones.length === 1) {\r\n\t\t\t\t\t\t\t\ttimeZoneCode = uniqueZones[0];\r\n\t\t\t\t\t\t\t\tctrl.timeZoneAbbr = timezoneService.getTimezoneByIANACode(timeZoneCode).name;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tctrl.timeZoneAbbr = -1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ttimeZoneCode = primaryEntity.TimeZone.Code;\r\n\t\t\t\t\t\t\tctrl.timeZoneAbbr = timezoneService.getTimezoneByIANACode(timeZoneCode).name;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if(timeZoneMode.Code === FORM_TIMEZONE_TYPES.ByForm) {\r\n\t\t\t\t\t\ttimeZoneCode = ctrl.form.TimeZone.Code;\r\n\t\t\t\t\t\tctrl.timeZoneAbbr = timezoneService.getTimezoneByIANACode(timeZoneCode).name;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tctrl.table.data = response.map(row => {\r\n\t\t\t\t\t\tif(ctrl.timeZoneAbbr === -1) {\r\n\t\t\t\t\t\t\tconst currentEntity = find(selectedEntity.friendly.Entities, e => e.Entity.Id === row.EntityId);\r\n\t\t\t\t\t\t\ttimeZoneCode = currentEntity.Entity.TimeZone.Code;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst dateTzMoment = row.Date && !!timeZoneCode && moment(row.Date).tz(timeZoneCode);\r\n\t\t\t\t\t\tconst lmTzMoment = !!timeZoneCode && moment(row.LastModified).tz(timeZoneCode);\r\n\r\n\t\t\t\t\t\tif(ctrl.primaryDateColumn.Template === FIELD_TEMPLATES.DateTime) {\r\n\t\t\t\t\t\t\trow.Date = dateTzMoment;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trow.Date = row.Date && moment(row.Date.substring(0, row.Date.indexOf(\"T\")));\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.LastModified = lmTzMoment;\r\n\t\t\t\t\t\tconst license = find(ctrl.licenses, l => l.key === row.EntityId);\r\n\t\t\t\t\t\trow.EntityName = license && license.display;\r\n\r\n\t\t\t\t\t\tif(ctrl.extraColumns.length === 1) {\r\n\t\t\t\t\t\t\tif(row[ctrl.extraColumns[0].name]) {\r\n\t\t\t\t\t\t\t\trow.singleExtraDataColumn = row[ctrl.extraColumns[0].name];\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\trow.singleExtraDataColumn = \"--\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfor(let i = 0; i < dateColumns.length; i++) {\r\n\t\t\t\t\t\t\tif(!row[dateColumns[i].name]) \r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tlet momented = moment(row[dateColumns[i].name]);\r\n\t\t\t\t\t\t\tif(!momented.isValid()) {\r\n\t\t\t\t\t\t\t\tmomented = moment(row[dateColumns[i].name], \"YYYY-MM-DD HH:mm:ss.SSSSSSS ZZ\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconst TZd = !!timeZoneCode && momented.tz(timeZoneCode);\r\n\t\t\t\t\t\t\tconst overridden = TZd;\r\n\r\n\t\t\t\t\t\t\trow[dateColumns[i].name] = overridden.format(ctrl.timeFormat);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.editable = !ctrl.permissions.Reporting.IsDisabled && ctrl.permissions.Reporting.Actions.CanEdit && !row.Submitted && !row.IsDeleted;\r\n\t\t\t\t\t\tif(!ctrl.permissions.Reporting.Actions.CanAmend && !!hasHadState(REPORT_STATES.submitted.code, row)) {\r\n\t\t\t\t\t\t\trow.editable = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn row;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tctrl.fishermanColumn = some(ctrl.table.data, r => r.Fisherman);\r\n\t\t\t\t\tctrl.sellerColumn = some(ctrl.table.data, r => r[\"Selling License\"]);\r\n\t\t\t\t\tctrl.reportsLabel = `${ctrl.table.data.length} ${pluralize(ctrl.table.data.length, ctrl.form.nomenclature.PositiveReport)}`;\r\n\t\t\t\t\tctrl.paginatorOptions = {\r\n\t\t\t\t\t\t...ctrl.paginatorOptions, \r\n\t\t\t\t\t\ttotalItems: ctrl.table.data.length\r\n\t\t\t\t\t};\r\n\t\t\t\t});\r\n\r\n\t\t\t\tctrl.promiseTracker.addPromise(promise);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctrl.table.data.length = 0;\r\n\t\tctrl.paginatorOptions = {\r\n\t\t\t...ctrl.paginatorOptions, \r\n\t\t\ttotalItems: 0\r\n\t\t};\r\n\t}\r\n\r\n\tfunction onCollapse() {\r\n\t\tctrl.tableWidthCss = ctrl.isCollapsed ? \"col-sm-12\" : \"col-sm-9\";\r\n\t}\r\n\r\n\tfunction getEditButtonIcon(item) {\r\n\t\treturn item.editable ? \"zmdi zmdi-edit\" : \"zmdi zmdi-eye\";\r\n\t}\r\n\r\n\tfunction getExtraData(item) {\r\n\t\tif(ctrl.extraColumns?.length === 1) {\r\n\t\t\tif(item[ctrl.extraColumns[0].name]) {\r\n\t\t\t\treturn $sce.trustAsHtml(item[ctrl.extraColumns[0].name]);\r\n\t\t\t} \r\n\t\t\telse {\r\n\t\t\t\treturn $sce.trustAsHtml(\"
    --
    \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst extraData = ctrl.extraColumns.map(col => extractColumnData(col, item));\r\n\r\n\t\tconst dataBlock = `
    \r\n\t\t\t${extraData.join(\"\")}\r\n\t\t
    `;\r\n\r\n\t\treturn $sce.trustAsHtml(dataBlock);\r\n\t}\r\n\r\n\tfunction extractColumnData(col, item) {\r\n\t\tlet rawItemData = item[col.name];\r\n\t\tif(rawItemData === undefined) {\r\n\t\t\treturn `${col.name}: --`;\r\n\t\t} else if(col.type === FIELD_TEMPLATES.Date) {\r\n\t\t\tlet autoParseAttempt = moment(rawItemData).format(\"MM-DD-YYYY\");\r\n\t\t\tif(autoParseAttempt === \"Invalid date\") {\r\n\t\t\t\tautoParseAttempt = moment(rawItemData, \"YYYY-MM-DD HH:mm:ss.SSSSSSS ZZ\").format(\"MM-DD-YYYY\");\r\n\t\t\t}\r\n\r\n\t\t\trawItemData = autoParseAttempt;\r\n\t\t} else if(col.type === FIELD_TEMPLATES.Number) {\r\n\t\t\tconst indexOfUnit = rawItemData.indexOf(\" \");\r\n\t\t\tconst itemUnit = rawItemData.substring(indexOfUnit + 1);\r\n\r\n\t\t\trawItemData = rawItemData.slice(0, indexOfUnit);\r\n\r\n\t\t\tconst rawItemNumber = parseFloat(rawItemData);\r\n\r\n\t\t\trawItemData = rawItemNumber.toFixed(col.rounding);\r\n\r\n\t\t\tif(itemUnit !== \"#\") {\r\n\t\t\t\trawItemData = `${rawItemData} ${itemUnit}`;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn `${col.name}: ${rawItemData}`;\r\n\t}\r\n\r\n\tfunction editReport(itemId) {\r\n\t\t$state.go(EDIT_REPORT, { id: itemId });\r\n\t}\r\n\r\n\tfunction buildReportsRequest(start, end, entityId, entityIds, status) {\r\n\t\tconst params = {\r\n\t\t\tBeginDate: moment(start).format(\"YYYY/MM/DD\"),\r\n\t\t\tEndDate: moment(end).format(\"YYYY/MM/DD\")\r\n\t\t};\r\n\t\tif(!ctrl.showFriendlyEntitySelector) {\r\n\t\t\tparams[\"EntityId\"] = entityId;\r\n\t\t} else {\r\n\t\t\tparams[\"EntityIds\"] = entityIds;\r\n\t\t}\r\n\t\tif(status) {\r\n\t\t\tparams[\"Status\"] = status;\r\n\t\t}\r\n\t\treturn params;\r\n\t}\r\n\r\n\tfunction onStatusSelectorChange() {\r\n\t\tupdateUrl();\r\n\t}\r\n\r\n\tfunction updateUrl() {\r\n\t\tconst endDateParam = ctrl.filter.endDate && moment(ctrl.filter.endDate).format();\r\n\t\tconst startDateParam = ctrl.filter.startDate && moment(ctrl.filter.startDate).format();\r\n\t\tconst entityIdsParam = ctrl.filter.license && ctrl.filter.license.key ? [ctrl.filter.license.key] : ctrl.licenses.slice(1).map(x => x.key);\r\n\r\n\t\t$state.go(\"authenticated.report-list\", {\r\n\t\t\tstart: startDateParam,\r\n\t\t\tend: endDateParam,\r\n\t\t\tstatus: ctrl.filter.status.key,\r\n\t\t\tentityIds: entityIdsParam\r\n\t\t}, {})\r\n\t\t\t.then(() => {\r\n\t\t\t\tloadReports();\r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction updateUserPreference(value) {\r\n\t\tconst currentProfile = $userProfile.getUserProfile();\r\n\t\tcurrentProfile.pagePreference = value;\r\n\t\t$userProfile.setUserProfile(currentProfile);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.report-list\", [])\r\n\t.component(\"reportList\", { template, controller }).name;\r\n","export default \"
    \\r\\n\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t

    ACTIONS

    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\tPlease note - downloaded data is not considered an official record for the program, but can be used for personal or business uses\\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t Download Selected Items\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t Add {{$ctrl.form.nomenclature.PositiveReport}} \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t 0 ? 'overflow-auto' : ''\\\"\\r\\n\\t\\t\\t\\t\\t\\tgrid-data\\r\\n\\t\\t\\t\\t\\t\\tgrid-options=\\\"$ctrl.table\\\"\\r\\n\\t\\t\\t\\t\\t\\tgrid-actions=\\\"$ctrl.table.actions\\\"\\r\\n\\t\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t {{$ctrl.form.nomenclature.PositiveReport}} # \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t {{$ctrl.primaryAssociatedEntityName}} \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t {{$ctrl.form.nomenclature.PrimaryDate}} \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t {{$ctrl.extraColumns[0].name}} \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t 1\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t Last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\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t No {{$ctrl.form.nomenclature.PositiveReport}}s found for the set filters \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t *All times are in {{$ctrl.timeZoneAbbr}} \\r\\n\\t\\t\\t\\t\\t *Time zones vary by the timezone of the {{$ctrl.form.nomenclature.PrimaryEntity}} \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\";","import {\r\n\tflatten,\r\n\tfilter,\r\n\tfind,\r\n\tfindIndex,\r\n\tsome,\r\n\tforEach,\r\n\tgroupBy\r\n} from \"lodash\";\r\nimport {\r\n\tREPORT_SCOPES,\r\n\tEVENT_PROCESS_UI_RULES,\r\n\tAGGREGATION_ACTIONS\r\n} from \"constants.js\";\r\nimport { TRIGGER_TYPES } from \"./constants.js\";\r\n\r\nexport function controller(\r\n\t$q,\r\n\tappState,\r\n\ttriggerMethods,\r\n\tdetailHelper,\r\n\tvalidationServiceFactory,\r\n\truleService,\r\n\teventBus,\r\n\t$timeout,\r\n\truleConfigService,\r\n\t$logger\r\n) {\r\n\tconst ctrl = this;\r\n\tconst observers = [];\r\n\tconst providers = {};\r\n\r\n\tctrl.errors = [];\r\n\tctrl.validationService = validationServiceFactory.getCurrentValidationService();\r\n\r\n\tctrl.notify = notify;\r\n\tctrl.registerValueProvider = registerValueProvider;\r\n\tctrl.subscribe = subscribe;\r\n\tctrl.validate = validate;\r\n\tctrl.process = process;\r\n\tctrl.getValuesByType = getValuesByType;\r\n\tctrl.reportScope = reportScope;\r\n\r\n\tfunction registerValueProvider(types, provider, scope) {\r\n\t\tconst isArray = Array.isArray(types);\r\n\r\n\t\tif(!isArray) {\r\n\t\t\ttypes = [types];\r\n\t\t}\r\n\t\t\r\n\t\tforEach(types, type => {\r\n\t\t\tproviders[type] = providers[type] || [];\r\n\t\t\tproviders[type].push(provider);\r\n\t\t});\r\n\r\n\t\tif(!scope) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tscope.$on(\"$destroy\", () => { \r\n\t\t\tforEach(types, type => {\r\n\t\t\t\tproviders[type] = providers[type].filter(p => p != provider);\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tfunction subscribe(callback) {\r\n\t\tobservers.push(callback);\r\n\t\treturn function unsubscribe() {\r\n\t\t\tconst idx = findIndex(observers, x => x === callback);\r\n\t\t\tif(idx !== -1) {\r\n\t\t\t\tobservers.splice(idx, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tfunction notify(scopes) {\r\n\t\tlet validatePromise = $q.resolve(ctrl.errors);\r\n\t\tif(scopes) {\r\n\t\t\tvalidatePromise = validate(scopes);\r\n\t\t}\r\n\r\n\t\treturn validatePromise.then(errors => {\r\n\t\t\tctrl.errors = errors;\r\n\t\t\tobservers.forEach(cb => cb(validatePromise));\r\n\t\t\treturn errors;\r\n\t\t});\r\n\t}\r\n\r\n\tfunction getValuesByType(scopes) {\r\n\t\tconst valuesArrays = {};\r\n\r\n\t\tscopes\r\n\t\t\t.map(s => {\r\n\t\t\t\tif(s === REPORT_SCOPES.metadata) {\r\n\t\t\t\t\tvaluesArrays[s] = [];\r\n\t\t\t\t}\r\n\t\t\t\tif(providers[s]) {\r\n\t\t\t\t\tconst f = providers[s]\r\n\t\t\t\t\t\t.map(get => {\r\n\t\t\t\t\t\t\tconst val = get();\r\n\t\t\t\t\t\t\tif(val === null) {\r\n\t\t\t\t\t\t\t\treturn [];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn val.filter(v => v.IsDeleted !== true && v.hasResultForRuleRun !== false);\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\tvaluesArrays[s] = flatten(f);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\treturn valuesArrays;\r\n\t}\r\n\r\n\tfunction validate(evalScopes, detailId, values) {\r\n\t\tconst valueScopes = [...evalScopes];\r\n\r\n\t\tconst validationRules = filter(appState.forms.selected.Rules, r =>\r\n\t\t\tsome(r.Triggers, t => t.Type.Code === TRIGGER_TYPES.validation));\r\n\r\n\t\tconst filteredRules = filter(validationRules, (r) => {\r\n\t\t\treturn some(evalScopes, (s) => r.validationScope !== undefined ? r.validationScope.Code === s : r.Scope.Code === s);\r\n\t\t});\r\n\r\n\t\tconst groupedRules = groupBy(filteredRules, (rule) => rule.Scope.Code);\r\n\r\n\t\tif(valueScopes.indexOf(REPORT_SCOPES.details) > -1 && valueScopes.indexOf(REPORT_SCOPES.detail) === -1) {\r\n\t\t\tvalueScopes.push(REPORT_SCOPES.detail);\r\n\t\t}\r\n\r\n\t\tvalues = values || getValuesByType(valueScopes);\r\n\r\n\t\tif(valueScopes.indexOf(REPORT_SCOPES.details) > -1 && !!values[REPORT_SCOPES.detail]) {\r\n\t\t\tvalues[REPORT_SCOPES.details] = detailHelper.mergeDetails([values[REPORT_SCOPES.details], values[REPORT_SCOPES.detail]]);\r\n\t\t}\r\n\r\n\t\tlet ruleEvaluations = [];\r\n\r\n\t\tforEach(evalScopes, (scope) => {\r\n\t\t\tif(values[scope] === undefined) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tif(scope === REPORT_SCOPES.detail) {\r\n\t\t\t\tvalues[scope] = values[scope].map(d => {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\t...d,\r\n\t\t\t\t\t\tDetailId: detailId\r\n\t\t\t\t\t};\r\n\t\t\t\t});\r\n\r\n\t\t\t\tgroupedRules[scope] = !!groupedRules[scope] && groupedRules[scope].map(r => {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\t...r,\r\n\t\t\t\t\t\tDetailId: detailId\r\n\t\t\t\t\t};\r\n\t\t\t\t}) || [];\r\n\r\n\t\t\t\tif(detailHelper.isDetailPivoted(values[scope])) {\r\n\t\t\t\t\tconst detailValues = filter(values[scope], (val) => val.DetailId === detailId);\r\n\r\n\t\t\t\t\tconst detailScopedRules = groupedRules[scope].map(r => {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t...r,\r\n\t\t\t\t\t\t\tDetailLinkKey: detailValues[0].DetailLinkKey,\r\n\t\t\t\t\t\t\trepeatId: detailValues[0].repeatId\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tconst scopeEvals = process(detailScopedRules, detailValues);\r\n\t\t\t\t\truleEvaluations = ruleEvaluations.concat(scopeEvals);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconst scopeEvals = process(groupedRules[scope], values[scope], detailId);\r\n\t\t\t\t\truleEvaluations = ruleEvaluations.concat(scopeEvals);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(scope === REPORT_SCOPES.reportAndDetails) {\r\n\t\t\t\tgroupedRules[scope] = !!groupedRules[scope] && groupedRules[scope].map(r => {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\t...r,\r\n\t\t\t\t\t\tDetailId: detailId\r\n\t\t\t\t\t};\r\n\t\t\t\t}) || [];\r\n\t\t\t\tconst scopeEvals = process(groupedRules[scope], values[scope], detailId);\r\n\t\t\t\truleEvaluations = ruleEvaluations.concat(scopeEvals);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconst scopeEvals = process(groupedRules[scope], values[scope]);\r\n\t\t\t\truleEvaluations = ruleEvaluations.concat(scopeEvals);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn $q\r\n\t\t\t.all([...ruleEvaluations])\r\n\t\t\t.then(validations => {\r\n\t\t\t\tconst allScopeValidations = flatten(validations);\r\n\t\t\t\tconst failed = allScopeValidations.filter(x => x.result === false);\r\n\r\n\t\t\t\treturn failed;\r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction executeTriggers(rule, headerResult, detailResult) {\r\n\t\tlet visibilityChanged = false;\r\n\t\trule.Triggers\r\n\t\t\t.filter(t => t.Type.Code !== \"VALIDATION\" && t.Operator.Code !== \"FILTER\")\r\n\t\t\t.forEach(t => {\r\n\t\t\t\tif(!!t.Section && !t.Field) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst field = t.Field;\r\n\t\t\t\tconst matched = !!field?.IsDetail ? detailResult : headerResult;\r\n\r\n\t\t\t\tlet triggerMetadata = triggerMethods.methods[t.Operator.Code](field, t, matched, rule);\r\n\t\t\t\tif(field && ((field.IsDetail && detailResult === undefined) || (!field.IsDetail && detailResult !== undefined))) {\r\n\t\t\t\t\ttriggerMetadata = undefined;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvisibilityChanged = visibilityChanged || !!triggerMetadata?.visibilityChanged;\r\n\t\t\t});\r\n\r\n\t\treturn { visibilityChanged };\r\n\t}\r\n\r\n\tfunction reportScope(rule) {\r\n\t\tconst fields = appState.forms.selected.Fields;\r\n\r\n\t\treturn ruleConfigService.reportScope(rule, fields);\r\n\t}\r\n\r\n\tfunction process(rules = [], values, processingDetailId, scope) {\r\n\t\tconst notDeletedValues = values.filter(v => v.IsDeleted !== true);\r\n\t\tconst groupedVals = groupBy(notDeletedValues, v => v.DetailId);\r\n\t\tconst detailVals = filter(groupedVals, (v, key) => key !== \"undefined\");\r\n\t\tconst headerVal = groupedVals[undefined];\r\n\r\n\t\tconst detailValuesById = {};\r\n\r\n\t\tif(headerVal && headerVal.length > 0 && detailVals && detailVals.length > 0) {\r\n\t\t\tforEach(detailVals, (detail) => {\r\n\t\t\t\tconst comboVal = headerVal.concat(detail);\r\n\t\t\t\tconst detailId = detail[0].DetailId;\r\n\r\n\t\t\t\tdetailValuesById[detailId] = comboVal;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tconst allProcessedRules = rules.map(rule => {\r\n\t\t\tif(!!rule.Aggregation) {\r\n\t\t\t\tconst aggregationAction = AGGREGATION_ACTIONS[rule.Aggregation.Code];\r\n\t\t\t\tconst detailResults = [];\r\n\r\n\t\t\t\tforEach(detailVals, (detail) => {\r\n\t\t\t\t\tconst detailId = detail[0].DetailId;\r\n\t\t\t\t\tconst comboVal = detailValuesById[detailId];\r\n\r\n\t\t\t\t\tconst ruleResult = ruleService.processSingleRule(rule, comboVal, detailValuesById)\r\n\t\t\t\t\t\t.then(result => ({ result, detailId }));\r\n\t\t\t\t\tdetailResults.push(ruleResult);\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn Promise.all(detailResults).then(results => {\r\n\t\t\t\t\tconst aggregatedResult = aggregationAction(results.map(r => r.result));\r\n\t\t\t\t\treturn aggregatedResult;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rule.Scope.Code === REPORT_SCOPES.reportAndDetails) {\r\n\t\t\t\tconst comboResults = [];\r\n\r\n\t\t\t\tif(rule.visibilityScope?.Code === REPORT_SCOPES.detail && processingDetailId !== undefined) {\r\n\t\t\t\t\tconst comboVal = detailValuesById[processingDetailId];\r\n\r\n\t\t\t\t\tconst singleRuleResult = ruleService.processSingleRule(rule, comboVal, detailValuesById)\r\n\t\t\t\t\t\t.then(result => ({ result, detailId: processingDetailId }));\r\n\t\t\t\t\tcomboResults.push(singleRuleResult);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tforEach(detailVals, (detail) => {\r\n\t\t\t\t\t\tconst detailId = detail[0].DetailId;\r\n\t\t\t\t\t\tconst comboVal = detailValuesById[detailId];\r\n\r\n\t\t\t\t\t\tconst singleRuleResult = ruleService.processSingleRule(rule, comboVal, detailValuesById)\r\n\t\t\t\t\t\t\t.then(result => ({ result, detailId: processingDetailId || detailId }));\r\n\t\t\t\t\t\tcomboResults.push(singleRuleResult);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(comboResults.length === 0) {\r\n\t\t\t\t\tconst headerOnlyResult = ruleService.processSingleRule(rule, headerVal, detailValuesById)\r\n\t\t\t\t\t\t.then(result => ({ result: result }));\r\n\r\n\t\t\t\t\tcomboResults.push(headerOnlyResult);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn Promise.all(comboResults).then(r => {\r\n\t\t\t\t\tconst triggerType = rule.Triggers && rule.Triggers[0] && rule.Triggers[0].Type.Code;\r\n\r\n\t\t\t\t\tif(triggerType === TRIGGER_TYPES.validation) {\r\n\t\t\t\t\t\tconst result = some(r, result => !result.result);\r\n\t\t\t\t\t\trule.result = !result;\r\n\t\t\t\t\t\trule.results = r;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tconst result = some(r, result => result.result);\r\n\t\t\t\t\t\trule.result = result;\r\n\t\t\t\t\t\trule.results = r;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn rule;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\treturn ruleService.processSingleRule(rule, values, detailValuesById)\r\n\t\t\t\t.then(result => {\r\n\t\t\t\t\trule.result = result;\r\n\t\t\t\t\tconst detailId = (find(values, v => v.DetailId !== undefined) || {}).DetailId;\r\n\t\t\t\t\tif((rule.Scope.Code === REPORT_SCOPES.detail || rule.validationScope.Code === REPORT_SCOPES.reportAndDetails) && detailId !== undefined && detailId !== null) {\r\n\t\t\t\t\t\trule.results = [\r\n\t\t\t\t\t\t\t{ result: result, detailId: detailId }\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\trule.results = [\r\n\t\t\t\t\t\t\t{ result: result }\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn rule;\r\n\t\t\t\t});\r\n\t\t});\r\n\r\n\t\tlet shouldReRun = false;\r\n\t\treturn Promise.all(allProcessedRules)\r\n\t\t\t.then(validatedRules => {\r\n\t\t\t\tconst mapping = validatedRules.map(r => ({\r\n\t\t\t\t\tId: r.Id,\r\n\t\t\t\t\tTitle: r.Title,\r\n\t\t\t\t\tOperator: r.Operator?.Code,\r\n\t\t\t\t\tResult: r.result,\r\n\t\t\t\t\tScope: `(${r.validationScope?.Code},${r.visibilityScope?.Code})`,\r\n\t\t\t\t\tDetails: r\r\n\t\t\t\t}));\r\n\r\n\t\t\t\tif(mapping.length > 0) {\r\n\t\t\t\t\t$logger.groupCollapsed(`Processed ${mapping.length} Rules ${new Date().toISOString()}`);\r\n\t\t\t\t\t$logger.table(mapping);\r\n\t\t\t\t\t$logger.groupEnd();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn validatedRules;\r\n\t\t\t})\r\n\t\t\t.then(validatedRules => {\r\n\t\t\t\tforEach(validatedRules, vr => {\r\n\t\t\t\t\tlet thisResult = {};\r\n\r\n\t\t\t\t\tif(processingDetailId !== undefined) {\r\n\t\t\t\t\t\tthisResult = find(vr.results, r => r.detailId === processingDetailId) || {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(scope === REPORT_SCOPES.detail) {\r\n\t\t\t\t\t\tthisResult = vr;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(vr.Triggers && thisResult) {\r\n\t\t\t\t\t\tconst triggerReturn = executeTriggers(vr, vr.result, thisResult.result);\r\n\r\n\t\t\t\t\t\tshouldReRun = shouldReRun || (!!triggerReturn && triggerReturn.visibilityChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\treturn validatedRules;\r\n\t\t\t})\r\n\t\t\t.then(validatedRules => {\r\n\t\t\t\tif(shouldReRun) {\r\n\t\t\t\t\t$timeout(() => {\r\n\t\t\t\t\t\teventBus.trigger(EVENT_PROCESS_UI_RULES, { \r\n\t\t\t\t\t\t\tforce: true, \r\n\t\t\t\t\t\t\tdetailId: processingDetailId, \r\n\t\t\t\t\t\t\tfield: { IsDetail: (processingDetailId !== undefined || scope === REPORT_SCOPES.detail) } \r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn validatedRules;\r\n\t\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.rule-provider\", [])\r\n\t.component(\"ruleProvider\", {\r\n\t\ttransclude: true,\r\n\t\ttemplate: \"\",\r\n\t\tcontroller,\r\n\t\tcontrollerAs: \"$ctrl\"\r\n\t}).name;\r\n","import \"./proxies.less\";\r\nimport template from \"./proxies.html\";\r\nimport { FUSE_DEFAULTS } from \"constants.js\";\r\nimport { FORM_PROXIES } from \"routes\";\r\nimport fuse from \"fuse.js\";\r\n\r\nfunction controller(appState, loadingService, $uibModal, $state, api) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl.run = run;\r\n\r\n\tctrl.onCollapse = onCollapse;\r\n\tctrl.tableWidthCss = \"col-sm-9\";\r\n\r\n\tctrl.table = {\r\n\t\tdata: [],\r\n\t\tactions: {},\r\n\t\tsort: {\r\n\t\t\tpredicate: \"Name\",\r\n\t\t\tdirection: \"asc\"\r\n\t\t},\r\n\t\tfilter: () => filterTable(),\r\n\t\treset: () => reset(),\r\n\t\tfilterBy: null\r\n\t};\r\n\tctrl.paginatorOptions = {};\r\n\r\n\tctrl.fuse = new fuse([], {\r\n\t\t...FUSE_DEFAULTS,\r\n\t\tkeys: [\r\n\t\t\t\"Name\"\r\n\t\t]\r\n\t});\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\r\n\t\tswitch($state.current.name) {\r\n\t\t\tcase \"authenticated.analytics\":\r\n\t\t\t\tctrl.singularItemLabel = \"Query\";\r\n\t\t\t\tctrl.pluralItemLabel = \"Queries\";\r\n\t\t\t\tctrl.proxyFilter = (d) => d.Type.Code === \"QUERY\" || d.Type.Code === \"SYSTEM\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"authenticated.operations\":\r\n\t\t\t\tctrl.singularItemLabel = \"Operation\";\r\n\t\t\t\tctrl.pluralItemLabel = \"Operations\";\r\n\t\t\t\tctrl.proxyFilter = (d) => d.Type.Code === \"OPERATION\" || d.Type.Code === \"SYSTEM\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"authenticated.reporting\":\r\n\t\t\t\tctrl.singularItemLabel = \"Report\";\r\n\t\t\t\tctrl.pluralItemLabel = \"Reports\";\r\n\t\t\t\tctrl.proxyFilter = (d) => d.Type.Code === \"REPORT\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tgetProxies();\r\n\t}\r\n\r\n\tasync function run(proxyHeader) {\r\n\t\tawait $uibModal.open({\r\n\t\t\tcomponent: \"proxy-modal\",\r\n\t\t\tsize: \"m\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tkeyboard: false,\r\n\t\t\tresolve: {\r\n\t\t\t\tproxy: () => proxyHeader,\r\n\t\t\t\ttitle: () => ctrl.singularItemLabel\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction getProxies() {\r\n\t\tconst url = FORM_PROXIES(ctrl.form.Id);\r\n\r\n\t\tconst promise = api.get(url).then(response => {\r\n\t\t\tconst data = response;\r\n\r\n\t\t\tconst forThisScreen = data.filter(ctrl.proxyFilter);\r\n\r\n\t\t\tsetTableData(forThisScreen);\r\n\t\t});\r\n\t\tctrl.promiseTracker.addPromise(promise);\r\n\t}\r\n\r\n\tfunction setTableData(proxies) {\r\n\t\tctrl.table.data = proxies;\r\n\t\tctrl.fuse.list = proxies;\r\n\t\tctrl.paginatorOptions = {\r\n\t\t\t...ctrl.paginatorOptions, \r\n\t\t\ttotalItems: ctrl.table.data.length\r\n\t\t};\r\n\t}\r\n\r\n\tfunction filterTable() {\r\n\t\tctrl.table.data = (ctrl.table.filterBy) ?\r\n\t\t\tctrl.fuse.search(ctrl.table.filterBy) :\r\n\t\t\tctrl.fuse.list;\r\n\r\n\t\tctrl.paginatorOptions = {\r\n\t\t\t...ctrl.paginatorOptions, \r\n\t\t\ttotalItems: ctrl.table.data.length\r\n\t\t};\r\n\t}\r\n\r\n\tfunction reset() {\r\n\t\tctrl.table.filterBy = null;\r\n\t\tctrl.table.filter();\r\n\t}\r\n\r\n\tfunction onCollapse() {\r\n\t\tctrl.tableWidthCss = ctrl.isCollapsed ? \"col-sm-12\" : \"col-sm-9\";\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.proxies\", [])\r\n\t.component(\"proxies\", {\r\n\t\ttemplate,\r\n\t\tcontroller,\r\n\t\tbindings: { form: \"<\" }\r\n\t}).name;\r\n","export default \"\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t

    FILTERS

    \\r\\n\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t 0 ? 'overflow-auto' : ''\\\"\\r\\n\\t\\t\\t\\t\\tgrid-data\\r\\n\\t\\t\\t\\t\\tgrid-options=\\\"$ctrl.table\\\"\\r\\n\\t\\t\\t\\t\\tgrid-actions=\\\"$ctrl.table.actions\\\"\\r\\n\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t{{$ctrl.singularItemLabel}} Names\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t 0\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t{{item.Name}}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tNo {{$ctrl.pluralItemLabel}} found.\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\r\\n\";","import \"./users.less\";\r\nimport template from \"./users.html\";\r\nimport { FUSE_DEFAULTS } from \"constants.js\";\r\nimport {\r\n\tFORM_USERS,\r\n\tPASSWORD_RESET,\r\n\tINVITE_RESEND\r\n} from \"routes.js\";\r\nimport fuse from \"fuse.js\";\r\nimport * as filters from \"../../filters/filters.js\";\r\nimport { ROLE_TYPES } from \"../../config/permissions\";\r\nimport moment from \"moment\";\r\n\r\nfunction controller(\r\n\t$userProfile,\r\n\t$uibModal,\r\n\t$logger,\r\n\ttableHelper,\r\n\tappState,\r\n\tapi,\r\n\tloadingService,\r\n\ttoastr,\r\n\tpromiseTracker\r\n) {\r\n\tconst ctrl = this;\r\n\r\n\tctrl.promiseTracker = loadingService.getTracker();\r\n\r\n\tctrl.$onInit = onInit;\r\n\tctrl._uibModal = $uibModal;\r\n\r\n\tctrl.edit = edit;\r\n\tctrl.resetPassword = resetPassword;\r\n\tctrl.resendInvite = resendInvite;\r\n\tctrl.onCollapse = onCollapse;\r\n\tctrl.onLastLoginChange = onLastLoginChange;\r\n\r\n\tctrl.tableWidthCss = \"col-sm-9\";\r\n\tctrl.windowResizeDesktopCallback = windowResizeDesktopCallback;\r\n\tctrl.impersonate = impersonate;\r\n\tctrl.signinTracker = promiseTracker();\r\n\r\n\r\n\tctrl.fuse = new fuse([], {\r\n\t\t...FUSE_DEFAULTS,\r\n\t\tdistance: 4,\r\n\t\tthreshold: .2,\r\n\t\tkeys: [\r\n\t\t\t\"Name\",\r\n\t\t\t\"Username\"\r\n\t\t]\r\n\t});\r\n\r\n\tctrl.loginRanges = [\r\n\t\t{ key: 0, display: \"All\", rangeBegin: null },\r\n\t\t{ key: 1, display: \"Never\", rangeBegin: moment() },\r\n\t\t{ key: 2, display: \"Last Day\", rangeBegin: moment().subtract(1, \"day\") },\r\n\t\t{ key: 3, display: \"Last Week\", rangeBegin: moment().subtract(1, \"week\") },\r\n\t\t{ key: 4, display: \"Last Month\", rangeBegin: moment().subtract(1, \"month\") },\r\n\t\t{ key: 6, display: \"Last 6 Months\", rangeBegin: moment().subtract(6, \"month\") },\r\n\t\t{ key: 5, display: \"Last Year\", rangeBegin: moment().subtract(1, \"year\") }\r\n\t];\r\n\tctrl.lastLoginRange = ctrl.loginRanges[0];\r\n\r\n\tctrl.table = {\r\n\t\tdata: [],\r\n\t\tallData: [],\r\n\t\tactions: {},\r\n\t\tsort: {\r\n\t\t\tpredicate: \"meta.username\", // custom property added since angular-data-grid can't handle multiple sort functionality\r\n\t\t\tdirection: \"asc\"\r\n\t\t},\r\n\t\tfilter: () => {\r\n\t\t\ttableHelper.filter(ctrl.table, ctrl.fuse, \"meta.username\"); \r\n\t\t\tctrl.paginatorOptions = {\r\n\t\t\t\t...ctrl.paginatorOptions, \r\n\t\t\t\ttotalItems: ctrl.table.data.length\r\n\t\t\t};\r\n\t\t},\r\n\t\treset: () => reset(),\r\n\t\tfilterBy: null,\r\n\t\trange: ctrl.loginRanges[0]\r\n\t};\r\n\tctrl.paginatorOptions = {};\r\n\r\n\tfunction onInit() {\r\n\t\tctrl.form = appState.forms.selected;\r\n\t\tctrl.permissions = appState.permissions.Administration.User;\r\n\r\n\t\tgetUsers();\r\n\r\n\t\tconst thisUser = $userProfile.getUser();\r\n\t\tctrl.isSysAdmin = thisUser.roles.indexOf(ROLE_TYPES.sysAdmin) > -1;\r\n\t}\r\n\r\n\tfunction windowResizeDesktopCallback() {\r\n\t}\r\n\r\n\tfunction reset() {\r\n\t\tctrl.table.filterBy = null;\r\n\t\tctrl.table.filter();\r\n\t}\r\n\r\n\tfunction resetPassword(user) {\r\n\t\tconst params = {\r\n\t\t\tUsername: user.Username\r\n\t\t};\r\n\r\n\t\tconst promise = api.post(PASSWORD_RESET, params).then(() => {\r\n\t\t\ttoastr.success(\r\n\t\t\t\t`A password reset email has been sent to ${user.Username}.`\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\tctrl.promiseTracker.addPromise(promise);\r\n\t}\r\n\r\n\tasync function resendInvite(user) {\r\n\t\ttry {\r\n\t\t\tawait api.post(INVITE_RESEND, { User: user });\r\n\t\t\ttoastr.success(`An invitation email was sent to ${user.Username}.`);\r\n\t\t}\r\n\t\tcatch(err) {\r\n\t\t\t$logger.exception(\"invitation email failed to send\");\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getUsers() {\r\n\t\tconst route = FORM_USERS(ctrl.form.Id);\r\n\t\tconst promise = api.get(route).then(response => {\r\n\t\t\tconst createName = filters.fullNameFilter();\r\n\t\t\tconst users = response.map(user => ({\r\n\t\t\t\t...user,\r\n\t\t\t\tName: createName(user.Contact),\r\n\t\t\t\tmeta: { username: `${user?.IsRequestOutstanding ? \"0\" : \"1\"}${user?.Username?.toLowerCase()}` } \r\n\t\t\t}));\r\n\t\t\tctrl.table.data = users;\r\n\t\t\tctrl.table.allData = users;\r\n\t\t\tctrl.fuse.list = users;\r\n\t\t\tctrl.paginatorOptions = {\r\n\t\t\t\t...ctrl.paginatorOptions, \r\n\t\t\t\ttotalItems: ctrl.table.data.length\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tctrl.promiseTracker.addPromise(promise);\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tfunction edit(user) {\r\n\t\t$uibModal.open({\r\n\t\t\tcomponent: \"user-modal\",\r\n\t\t\tsize: \"xlg\",\r\n\t\t\tresolve: {\r\n\t\t\t\tuser: () => user\r\n\t\t\t}\r\n\t\t\t// getUsers: () => getUsers() //manual call not working, therefore, fell back to refreshing upon every close\r\n\t\t}).result.then(() => {\r\n\t\t\tgetUsers().then(() => {\r\n\t\t\t\tctrl.table.filter();\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tfunction onCollapse() {\r\n\t\tctrl.tableWidthCss = ctrl.isCollapsed ? \"col-sm-12\" : \"col-sm-9\";\r\n\t}\r\n\r\n\tfunction impersonate() {\r\n\t\t$logger.debug(\"impoersonate not-implemented\");\r\n\t\ttoastr.error(\"This feature is no longer implemented\");\r\n\t}\r\n\r\n\tfunction onLastLoginChange() {\r\n\t\tctrl.table.filter();\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.screens.users\", [])\r\n\t.component(\"users\", { template, controller }).name;\r\n","// un-authenticated\r\nimport publicPages from \"./public/index.js\";\r\n// authenticated\r\nimport complianceReport from \"./compliance/compliance.js\";\r\nimport dashboard from \"./dashboard/index.js\";\r\nimport welcome from \"./welcome/index.js\";\r\nimport editReport from \"./edit-report/edit-report.js\";\r\nimport entities from \"./entities/entities.js\";\r\nimport exports from \"./exports/exports.js\";\r\nimport messaging from \"./messaging/messaging.js\";\r\nimport reportList from \"./report-list/report-list.js\";\r\nimport ruleProvider from \"./rule-provider/rule-provider.js\";\r\nimport proxies from \"./proxies/proxies.js\";\r\nimport { TRIGGER_METHODS } from \"./rule-provider/constants.js\";\r\nimport users from \"./users/users.js\";\r\n\r\nconst deps = [\r\n\tcomplianceReport,\r\n\tdashboard,\r\n\teditReport,\r\n\tentities,\r\n\tmessaging,\r\n\tproxies,\r\n\tpublicPages,\r\n\treportList,\r\n\truleProvider,\r\n\tTRIGGER_METHODS,\r\n\tusers,\r\n\twelcome, \r\n\texports\r\n];\r\n\r\nexport default angular.module(\"vesl.screens\", deps).name;\r\n","export default \"\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\tFILTERS\\r\\n\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    • \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\tACTIONS\\r\\n\\t\\t\\t\\t

    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Add User \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\r\\n\\t\\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t 0 ? 'overflow-visible' : ''\\\"\\r\\n\\t\\t\\t\\t\\tgrid-data\\r\\n\\t\\t\\t\\t\\tgrid-options=\\\"$ctrl.table\\\"\\r\\n\\t\\t\\t\\t\\tgrid-actions=\\\"$ctrl.table.actions\\\"\\r\\n\\t\\t\\t\\t>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tEdit\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t Name \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t Username \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t Last Active \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tAdditional actions\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\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t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t Impersonate\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t No users found. \\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\r\\n\\t\\t
    \\r\\n\\t\\r\\n\";","import moment from \"moment\";\r\n\r\nwindow.vesl = window.vesl || {};\r\n\r\nfunction ApiService(\r\n\t$http,\r\n\t$q,\r\n\tconfig\r\n) {\r\n\tconst service = this;\r\n\tconst baseUrl = config.apiUrl;\r\n\r\n\tconst resolve = response => {\r\n\t\tif(!response)\r\n\t\t\treturn reject(response);\r\n\r\n\t\tif(response.data?.Success)\r\n\t\t\treturn response.data.Data;\r\n\r\n\t\telse if(response.config.url === baseUrl) {\r\n\t\t\treturn response.data;\r\n\t\t}\r\n\r\n\t\treturn reject(response);\r\n\t};\r\n\r\n\tconst reject = response => {\r\n\t\treturn $q.reject(response?.data ?? response);\r\n\t};\r\n\r\n\tservice.delete = apiDelete;\r\n\tservice.get = apiGet;\r\n\tservice.post = apiPost;\r\n\tservice.put = apiPut;\r\n\tservice.downloadCsv = downloadCsv;\r\n\tservice.setDefaultHeader = setDefaultHeader;\r\n\tservice.http = customApi;\r\n\r\n\tsetDefaultHeader(\"Cache-Control\", \"no-cache\");\r\n\tsetDefaultHeader(\"Pragma\", \"no-cache\");\r\n\tsetDefaultHeader(\"Expires\", \"-1\");\r\n\r\n\tfunction apiGet(endpoint, httpConfig = {}) {\r\n\t\treturn $http.get(baseUrl + endpoint, httpConfig).then(resolve, reject);\r\n\t}\r\n\r\n\tfunction downloadCsv(endpoint) {\r\n\t\treturn $http({\r\n\t\t\tmethod: \"GET\",\r\n\t\t\turl: baseUrl + endpoint,\r\n\t\t\theaders: { Accept: \"text/csv\" }\r\n\t\t})\r\n\t\t\t.success(data => {\r\n\t\t\t\tconst anchor = angular.element(\"\");\r\n\t\t\t\tanchor\r\n\t\t\t\t\t.attr({\r\n\t\t\t\t\t\thref: \"data:attachment/csv;charset=utf-8,\" + encodeURI(data),\r\n\t\t\t\t\t\ttarget: \"_blank\",\r\n\t\t\t\t\t\tdownload: `VESL_Reports_${moment().format(\"MM-DD-YYYY-HH-mm-ss\")}.csv`\r\n\t\t\t\t\t})[0]\r\n\t\t\t\t\t.click();\r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction apiPost(endpoint, data, httpConfig = {}) {\r\n\t\treturn $http\r\n\t\t\t.post(baseUrl + endpoint, data, httpConfig)\r\n\t\t\t.then((response) => {\r\n\t\t\t\tif(!Object.prototype.hasOwnProperty.call(httpConfig, \"headers\") || !Object.prototype.hasOwnProperty.call(httpConfig.headers, \"Accept\")) {\r\n\t\t\t\t\treturn resolve(response);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn response.data;\r\n\t\t\t}, reject);\r\n\t}\r\n\r\n\tfunction apiPut(endpoint, data, httpConfig = {}) {\r\n\t\treturn $http.put(baseUrl + endpoint, data, httpConfig).then(resolve, reject);\r\n\t}\r\n\r\n\tfunction apiDelete(endpoint, data) {\r\n\t\treturn $http({\r\n\t\t\turl: baseUrl + endpoint,\r\n\t\t\tmethod: \"DELETE\",\r\n\t\t\tdata: data,\r\n\t\t\theaders: {\r\n\t\t\t\t\"Content-Type\": \"application/json\"\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction customApi(config) {\r\n\t\treturn $http(config);\r\n\t}\r\n\r\n\tfunction setDefaultHeader(key, value) {\r\n\t\t$http.defaults.headers.common[key] = value;\r\n\t}\r\n\r\n\treturn service;\r\n}\r\n\r\nconst apiServiceModule = angular.module(\"vesl.services.api\", []);\r\n\r\napiServiceModule.factory(\"http:request-authorization-interceptor\", function($q, openIdService, $injector, toastr) {\r\n\tlet isRetrying = false;\r\n\r\n\tconst showErrorToastAndLogout = () => {\r\n\t\ttoastr.error(\"You are being logged out due to inactivity.\", \"\", {\r\n\t\t\ttimeout: 5000\r\n\t\t});\r\n\r\n\t\treturn new Promise(() => {\r\n\t\t\tsetTimeout(() => openIdService.logout(), 5000);\r\n\t\t});\r\n\t};\r\n\r\n\treturn {\r\n\t\trequest: function(config) {\r\n\t\t\tconst promise = openIdService.getAccessToken()\r\n\t\t\t\t.then(token => {\r\n\t\t\t\t\tconfig.headers[\"Authorization\"] = `Bearer ${token}`;\r\n\t\t\t\t\treturn config;\r\n\t\t\t\t});\r\n\t\t\treturn promise;\r\n\t\t},\r\n\t\trequestError: function(rejection) {\r\n\t\t\treturn $q.reject(rejection);\r\n\t\t},\r\n\t\tresponse: function(response) {\r\n\t\t\tisRetrying = false;\r\n\t\t\treturn response;\r\n\t\t},\r\n\t\tresponseError: function(rejection) {\r\n\t\t\tif(rejection.status === 401) {\r\n\t\t\t\tif(!isRetrying) {\r\n\t\t\t\t\tisRetrying = true;\r\n\t\t\t\t\tconst promise = openIdService.oidcProvider.signinSilent()\r\n\t\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\t\tconst $http = $injector.get(\"$http\");\r\n\t\t\t\t\t\t\treturn $http(rejection.config);\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.catch(() => {\r\n\t\t\t\t\t\t\tshowErrorToastAndLogout();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\treturn promise;\r\n\t\t\t\t}\r\n\t\t\t\tisRetrying = false;\r\n\t\t\t\treturn showErrorToastAndLogout();\r\n\t\t\t}\r\n\t\t\tisRetrying = false;\r\n\t\t\treturn $q.reject(rejection);\r\n\t\t}\r\n\t};\r\n});\r\n\r\napiServiceModule.config([\"$httpProvider\", http => http.interceptors.push(\"http:request-authorization-interceptor\")]);\r\n\r\nexport default apiServiceModule.service(\"api\", ApiService).name;\r\n","import {\r\n\tvalues,\r\n\tmerge,\r\n\treduce\r\n} from \"lodash\";\r\nimport { ENTITY_TYPES } from \"constants.js\";\r\n\r\nconst basePermissions = {\r\n\t\"Blob\": {\r\n\t\t\"IsDisabled\": false\r\n\t},\r\n\t\"Compliance\": {\r\n\t\t\"IsDisabled\": false\r\n\t},\r\n\t\"Settings\": {\r\n\t\t\"IsDisabled\": true\r\n\t},\r\n\t\"Feedback\": {\r\n\t\t\"IsDisabled\": false,\r\n\t\t\"Actions\": {\r\n\t\t\t\"ShowPhoneNumber\": true,\r\n\t\t\t\"ShowRemoteSupport\": true\r\n\t\t}\r\n\t},\r\n\t\"Reporting\": {\r\n\t\t\"IsDisabled\": false,\r\n\t\t\"Actions\": {\r\n\t\t\t\"CanWithdraw\": true,\r\n\t\t\t\"CanSubmit\": true,\r\n\t\t\t\"CanDelete\": true,\r\n\t\t\t\"CanRestore\": true,\r\n\t\t\t\"CanEdit\": true,\r\n\t\t\t\"CanAmend\": true,\r\n\t\t\t\"CanCreate\": true,\r\n\t\t\t\"CanFileNegative\": true,\r\n\t\t\t\"CanWithdrawNegative\": true, \r\n\t\t\t\"CanViewExports\": false\r\n\t\t},\r\n\t\t\"Details\": {\r\n\t\t\t\"IsDisabled\": false,\r\n\t\t\t\"Actions\": {\r\n\t\t\t\t\"CanDelete\": true,\r\n\t\t\t\t\"CanRestore\": true,\r\n\t\t\t\t\"CanCreate\": true,\r\n\t\t\t\t\"CanEdit\": true\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t\"History\": {\r\n\t\t\"IsDisabled\": false,\r\n\t\t\"Actions\": {\r\n\t\t\t\"CanExportByIds\": true,\r\n\t\t\t\"CanExportByDataLog\": true,\r\n\t\t\t\"CanExportByDifference\": true\r\n\t\t}\r\n\t},\r\n\t\"Administration\": {\r\n\t\t\"IsDisabled\": false,\r\n\t\t\"User\": {\r\n\t\t\t\"IsDisabled\": true,\r\n\t\t\t\"Actions\": {\r\n\t\t\t\t\"CanAdd\": true,\r\n\t\t\t\t\"CanEdit\": true,\r\n\t\t\t\t\"CanPermit\": true,\r\n\t\t\t\t\"CanFavorite\": true,\r\n\t\t\t\t\"CanResetPassword\": true,\r\n\t\t\t\t\"CanImpersonate\": false,\r\n\t\t\t\t\"CanViewLoginHistory\": true,\r\n\t\t\t\t\"CanSetSecurity\": false\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"Entity\": {\r\n\t\t\t\"IsDisabled\": true,\r\n\t\t\t\"Actions\": {\r\n\t\t\t\t\"CanImport\": false,\r\n\t\t\t\t\"CanCreate\": false\r\n\t\t\t},\r\n\t\t\t\"Type\": {}\r\n\t\t},\r\n\t\t\"Analytics\": {\r\n\t\t\t\"IsDisabled\": true\r\n\t\t},\r\n\t\t\"Operations\": {\r\n\t\t\t\"IsDisabled\": true\r\n\t\t},\r\n\t\t\"Reporting\": {\r\n\t\t\t\"IsDisabled\": false\r\n\t\t}\r\n\t}\r\n};\r\n\r\nexport const baseEntityPermission = {\r\n\t\"Code\": \"\",\r\n\t\"KnownAs\": \"\",\r\n\t\"IsDisabled\": true,\r\n\t\"Actions\": {\r\n\t\t\"CanAdd\": true,\r\n\t\t\"CanEdit\": true,\r\n\t\t\"CanDeactivate\": true\r\n\t},\r\n\t\"Relationships\": {\r\n\t\t\"IsDisabled\": true,\r\n\t\t\"Actions\": {\r\n\t\t\t\"CanAdd\": true,\r\n\t\t\t\"CanEdit\": true,\r\n\t\t\t\"CanRemove\": true\r\n\t\t}\r\n\t},\r\n\t\"Identifiers\": {\r\n\t\t\"IsDisabled\": true,\r\n\t\t\"Actions\": {\r\n\t\t\t\"CanAdd\": true,\r\n\t\t\t\"CanEdit\": true,\r\n\t\t\t\"CanRemove\": true\r\n\t\t}\r\n\t},\r\n\t\"Contacts\": {\r\n\t\t\"IsDisabled\": true,\r\n\t\t\"Actions\": {\r\n\t\t\t\"CanAdd\": true,\r\n\t\t\t\"CanEdit\": true,\r\n\t\t\t\"CanRemove\": true\r\n\t\t}\r\n\t},\r\n\t\"Seasons\": {\r\n\t\t\"IsDisabled\": true,\r\n\t\t\"Actions\": {\r\n\t\t\t\"CanAdd\": false,\r\n\t\t\t\"CanEdit\": false,\r\n\t\t\t\"CanRemove\": false\r\n\t\t}\r\n\t},\r\n\t\"Effective\": {\r\n\t\t\"IsDisabled\": true,\r\n\t\t\"Actions\": {\r\n\t\t\t\"CanAdd\": true,\r\n\t\t\t\"CanEdit\": true,\r\n\t\t\t\"CanRemove\": true\r\n\t\t}\r\n\t},\r\n\t\"Classifications\": {\r\n\t\t\"IsDisabled\": true,\r\n\t\t\"Actions\": {\r\n\t\t\t\"CanAdd\": true,\r\n\t\t\t\"CanRemove\": true\r\n\t\t}\r\n\t},\r\n\t\"History\": {\r\n\t\t\"IsDisabled\": true\r\n\t},\r\n\t\"Users\": {\r\n\t\t\"IsDisabled\": true\r\n\t},\r\n\t\"Reporting\": {\r\n\t\t\"IsDisabled\": true\r\n\t}\r\n};\r\n\r\nconst allTypePermissions = reduce(values(ENTITY_TYPES), (acc, entityType) => {\r\n\tif(entityType.Code === undefined) {\r\n\t\treturn acc;\r\n\t}\r\n\r\n\tacc[entityType.Code] = merge({}, baseEntityPermission, { \"Code\": entityType.Code, \"KnownAs\": entityType.Name });\r\n\r\n\treturn acc;\r\n}, {});\r\n\r\nconst allTypePermissionsTransform = { \"Administration\": { \"Entity\": { \"Type\": allTypePermissions } } };\r\n\r\nexport const defaultPermissions = merge({}, basePermissions, allTypePermissionsTransform);\r\n","import {\r\n\treduce,\r\n\tmerge,\r\n\tkeys\r\n} from \"lodash\";\r\nimport { defaultPermissions } from \"./basePermissions.const\";\r\n\r\nconst rolePermissionTransforms = {\r\n\t\"USER\": {\r\n\t},\r\n\t\"SUSER\": {\r\n\t},\r\n\t\"AGENT\": {\r\n\t\t\"Reporting\": {\r\n\t\t\t\"Actions\": {\r\n\t\t\t\t\"CanViewExports\": true\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"Administration\": {\r\n\t\t\t\"IsDisabled\": false,\r\n\t\t\t\"User\": {\r\n\t\t\t\t\"IsDisabled\": false,\r\n\t\t\t\t\"Actions\": {\r\n\t\t\t\t\t\"CanSetSecurity\": true\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\"Entity\": {\r\n\t\t\t\t\"IsDisabled\": false,\r\n\t\t\t\t\"Actions\": {\r\n\t\t\t\t\t\"CanImport\": true,\r\n\t\t\t\t\t\"CanCreate\": true\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t\"SYSADMIN\": {\r\n\t\t\"Settings\": {\r\n\t\t\t\"IsDisabled\": false\r\n\t\t},\r\n\t\t\"Reporting\": {\r\n\t\t\t\"Actions\": {\r\n\t\t\t\t\"CanViewExports\": true\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"Administration\": {\r\n\t\t\t\"IsDisabled\": false,\r\n\t\t\t\"User\": {\r\n\t\t\t\t\"IsDisabled\": false,\r\n\t\t\t\t\"Actions\": {\r\n\t\t\t\t\t\"CanImpersonate\": true,\r\n\t\t\t\t\t\"CanSetSecurity\": true\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\"Entity\": {\r\n\t\t\t\t\"IsDisabled\": false,\r\n\t\t\t\t\"Actions\": {\r\n\t\t\t\t\t\"CanImport\": true,\r\n\t\t\t\t\t\"CanCreate\": true\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\"Analytics\": {\r\n\t\t\t\t\"IsDisabled\": false\r\n\t\t\t},\r\n\t\t\t\"Operations\": {\r\n\t\t\t\t\"IsDisabled\": false\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\n\r\nconst allRolePermissions = reduce(keys(rolePermissionTransforms), (acc, role) => {\r\n\tacc[role] = merge({}, defaultPermissions, rolePermissionTransforms[role]);\r\n\r\n\treturn acc;\r\n}, {});\r\n\r\nexport const defaultRolePermissions = allRolePermissions;\r\n","import {\r\n\tassign,\r\n\tfind,\r\n\tfindIndex,\r\n\tsome,\r\n\tfilter,\r\n\tforEach,\r\n\tmerge\r\n} from \"lodash\";\r\nimport {\r\n\tFORM_CONFIG, \r\n\tFORM_PERMISSIONS \r\n} from \"routes.js\";\r\nimport {\r\n\tFIELD_TYPES,\r\n\tFEATURE_TYPES,\r\n\tTIME_DISPLAY_OPTIONS,\r\n\tSECURITY_ROLES, \r\n\tENTITY_TYPES\r\n} from \"constants.js\";\r\nimport { defaultRolePermissions } from \"./baseRolePermissions.const\";\r\nimport { baseEntityPermission } from \"./basePermissions.const\";\r\nimport swal from \"sweetalert2\";\r\nimport moment from \"moment\";\r\nimport CryptoJS from \"crypto-js\";\r\nimport {\r\n\tend as durationEnd, \r\n\tparse as parseDuration,\r\n\tpattern as durationPattern,\r\n\ttoSeconds\r\n} from \"iso8601-duration\";\r\nimport {\r\n\tDEFAULT_NAMESPACE, \r\n\tI18NextContext \r\n} from \"./i18nService\";\r\n\r\nconst deps = [];\r\n\r\nfunction AppState(\r\n\t$window,\r\n\t$base64,\r\n\t$logger,\r\n\t$uibModal,\r\n\tapi,\r\n\tloadingService,\r\n\tentityManager,\r\n\truleConfigService,\r\n\t$userProfile,\r\n\thotkeys, \r\n\truleValidator,\r\n\topenIdService,\r\n\ttoastr, \r\n\tsecurityService,\r\n\tformService\r\n) {\r\n\tconst service = this;\r\n\r\n\tservice.reset = reset;\r\n\tservice.clearSelectedEntity = clearSelectedEntity;\r\n\tservice.setRecentlyUsed = setRecentlyUsed;\r\n\tservice.getRecentlyUsed = getRecentlyUsed;\r\n\tservice.setUnavailable = setUnavailable;\r\n\tservice.clearUnavailable = clearUnavailable;\r\n\tservice.updateEntity = updateEntity;\r\n\tservice.permissions = defaultRolePermissions[SECURITY_ROLES.USER.name];\r\n\tservice.reloadForm = () => loadForm(service.forms.selected);\r\n\r\n\tfunction initProfiles() {\r\n\t\tconst currentProfile = $userProfile.getUserProfile();\r\n\r\n\t\tif(currentProfile) {\r\n\t\t\tcurrentProfile.timeDisplay = currentProfile.timeDisplay || TIME_DISPLAY_OPTIONS.TWELVE_HOUR;\r\n\t\t\tcurrentProfile.shortcutsEnabled = currentProfile.shortcutsEnabled || true;\r\n\r\n\t\t\tif(service.forms && service.forms.selected && !currentProfile.formId) {\r\n\t\t\t\tcurrentProfile.formId = service.forms.selected.Id;\r\n\t\t\t}\r\n\r\n\t\t\tif(currentProfile.shortcutsEnabled === false) {\r\n\t\t\t\thotkeys.pause();\r\n\t\t\t}\r\n\r\n\t\t\t$userProfile.setUserProfile(currentProfile);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction loadPermissions(formConfig, apiRoles) {\r\n\t\tconst assignedRoleCode = apiRoles.Assigned?.[0].Code;\r\n\t\tconst assignedRole = apiRoles.Roles.find(ro => ro.Code === assignedRoleCode);\r\n\r\n\t\tconst defaultRoleNames = Object.keys(defaultRolePermissions);\r\n\t\tconst assignedRoleName = defaultRoleNames.indexOf(assignedRole.Code) > 0 \r\n\t\t\t? assignedRole.Code\r\n\t\t\t: defaultRoleNames.indexOf(assignedRole.Name) > 0 \r\n\t\t\t\t? assignedRole.Name\r\n\t\t\t\t: \"USER\";\r\n\r\n\t\tservice.operatingUserRole = assignedRoleName;\r\n\r\n\t\tconst defaultPermissions = merge({}, defaultRolePermissions);\r\n\t\tconst permissions = merge(defaultPermissions, formConfig.Permissions);\r\n\t\t\r\n\t\tconst webSpecificPermissions = merge({}, formConfig.Permissions?.[assignedRoleName]?.Web ?? {});\r\n\t\tconst allUserPermissions = merge({}, permissions[assignedRoleName] ?? {});\r\n\r\n\t\tservice.permissions = merge({}, allUserPermissions, webSpecificPermissions);\r\n\t\t\r\n\t\tconst irregularEntityTypes = Object.entries(service.permissions.Administration.Entity.Type)\r\n\t\t\t.filter(([, t]) => Object.keys(ENTITY_TYPES).indexOf(t.Code) < 0);\r\n\t\tirregularEntityTypes.forEach(([key, type]) => {\r\n\t\t\ttype.Code = key;\r\n\t\t\tconst newType = merge({}, baseEntityPermission, type);\r\n\r\n\t\t\tservice.permissions.Administration.Entity.Type[key] = newType;\r\n\t\t});\r\n\r\n\t\twindow.vesl.getPermissions = () => service.permissions;\r\n\t}\r\n\r\n\tfunction getDefaultState() {\r\n\t\tinitProfiles();\r\n\r\n\t\treturn {\r\n\t\t\tuser: {},\r\n\t\t\tforms: {\r\n\t\t\t\titems: [],\r\n\t\t\t\tselected: null,\r\n\r\n\t\t\t\tsetSelected(form) {\r\n\t\t\t\t\tinitProfiles();\r\n\t\t\t\t\tthis.items = this.items.map(f => {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t...f,\r\n\t\t\t\t\t\t\tselected: f.Id === form.Id,\r\n\t\t\t\t\t\t\treport: {}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t$window.sessionStorage.setItem(\"forms\", angular.toJson(this.items));\r\n\r\n\t\t\t\t\tconst thisUserProfile = $userProfile.getUserProfile();\r\n\r\n\t\t\t\t\tthisUserProfile.formId = form.Id;\r\n\r\n\t\t\t\t\t$userProfile.setUserProfile(thisUserProfile);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tselect(form) {\r\n\t\t\t\t\tif(this.selected && form.Id == this.selected.Id) {\r\n\t\t\t\t\t\treturn Promise.resolve(service.forms.selected);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.selected = form;\r\n\t\t\t\t\tthis.setSelected(form);\r\n\r\n\t\t\t\t\tif(form.nomenclature.FormUseAcceptance !== undefined && form.nomenclature.FormUseAcceptance !== \"\") {\r\n\t\t\t\t\t\tconst userProfile = $userProfile.getUserProfile();\r\n\r\n\t\t\t\t\t\tconst hash = CryptoJS.SHA256(form.nomenclature.FormUseAcceptance);\r\n\t\t\t\t\t\tconst userFormHash = userProfile.formAcceptances?.[form.Code];\r\n\r\n\t\t\t\t\t\tif(userFormHash !== undefined && hash.toString(CryptoJS.enc.Hex) === userFormHash) {\r\n\t\t\t\t\t\t\treturn loadForm(form);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst modalInstance = $uibModal.open({\r\n\t\t\t\t\t\t\tcomponent: \"form-acceptance-modal\",\r\n\t\t\t\t\t\t\tsize: \"lg\",\r\n\t\t\t\t\t\t\tbackdrop: \"static\",\r\n\t\t\t\t\t\t\tkeyboard: false,\r\n\t\t\t\t\t\t\twindowClass: \"vesl-top\",\r\n\t\t\t\t\t\t\tresolve: {\r\n\t\t\t\t\t\t\t\tnomenclature: () => form.nomenclature, \r\n\t\t\t\t\t\t\t\tformCode: () => form.Code\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn modalInstance.result\r\n\t\t\t\t\t\t\t.then((shouldPersistAcceptance) => {\r\n\t\t\t\t\t\t\t\tif(shouldPersistAcceptance) {\r\n\t\t\t\t\t\t\t\t\tuserProfile.formAcceptances = userProfile.formAcceptances ?? {};\r\n\t\t\t\t\t\t\t\t\tuserProfile.formAcceptances[form.Code] = hash.toString(CryptoJS.enc.Hex);\r\n\t\t\t\t\t\t\t\t\t$userProfile.setUserProfile(userProfile);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\treturn loadForm(form);\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t.catch(() => {\r\n\t\t\t\t\t\t\t\tif(this.items.length === 1) {\r\n\t\t\t\t\t\t\t\t\ttoastr.error(\"Form acceptance rejected, logging out.\", \"\", {\r\n\t\t\t\t\t\t\t\t\t\ttimeout: 2000\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\treturn new Promise(() => {\r\n\t\t\t\t\t\t\t\t\t\tsetTimeout(() => openIdService.logout(), 2000);\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t$uibModal.open({\r\n\t\t\t\t\t\t\t\t\tcomponent: \"form-selector-modal\",\r\n\t\t\t\t\t\t\t\t\tbackdrop: \"static\",\r\n\t\t\t\t\t\t\t\t\tkeyboard: false,\r\n\t\t\t\t\t\t\t\t\tsize: \"md\", \r\n\t\t\t\t\t\t\t\t\tresolve: {\r\n\t\t\t\t\t\t\t\t\t\tmustSelect: () => true\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\r\n\t\t\t\t\t\t\t\treturn loadForm(form);\r\n\t\t\t\t\t\t\t}); \r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn loadForm(form);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tselectByFormId(id) {\r\n\t\t\t\t\tconst foundForm = this.items.filter((form) => form.Id === id);\r\n\t\t\t\t\tif(foundForm.length === 1) {\r\n\t\t\t\t\t\treturn this.select(foundForm[0]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$logger.warn(\"Requested to select form that is not available\", { form: id });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tassociatedEntities: {\r\n\t\t\t\titems: [],\r\n\t\t\t\tselected: {\r\n\t\t\t\t\tprimary: null,\r\n\t\t\t\t\tfriendly: null\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tisServiceUnavailable: false,\r\n\t\t\tswalInstance: null, \r\n\t\t\tstaleTimeoutAt: null,\r\n\t\t\tinvalidTimeoutAt: null,\r\n\t\t\tinvalidTimeoutPadded: null\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setUnavailable(message, isBackgroundRequest = false) {\r\n\t\tif(!service.isServiceUnavailable) {\r\n\t\t\tswal.fire({\r\n\t\t\t\ttitle: \"Please Hold\",\r\n\t\t\t\thtml:\r\n\t\t\t\t\t`${message}\r\n\t\t\t\t\t\t

    \r\n\t\t\t\t\t\tDo not close or refresh this page${isBackgroundRequest ? \"\" : \", we will automatically retry your request as soon as possible\"}.\r\n\t\t\t\t\t\t

    \r\n\t\t\t\t\t\tPlease be patient...\r\n\t\t\t\t\t\t

    \r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    `,\r\n\t\t\t\tallowOutsideClick: false,\r\n\t\t\t\tallowEscapeKey: false,\r\n\t\t\t\tallowEnterKey: false,\r\n\t\t\t\tshowConfirmButton: false,\r\n\t\t\t\tshowCancelButton: false,\r\n\t\t\t\ttype: \"warning\",\r\n\t\t\t\tonOpen: () => {\r\n\t\t\t\t\tservice.swalInstance = swal;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tservice.isServiceUnavailable = true;\r\n\t}\r\n\r\n\tfunction clearUnavailable() {\r\n\t\tservice.isServiceUnavailable = false;\r\n\t\tif(service.swalInstance) {\r\n\t\t\tservice.swalInstance.close();\r\n\t\t}\r\n\t\tservice.swalInstance = null;\r\n\t}\r\n\r\n\tfunction loadForm(form) {\r\n\t\tconst promise = api.get(FORM_CONFIG(form.Id))\r\n\t\t\t.then(response => {\r\n\t\t\t\tconst updatedForm = {\r\n\t\t\t\t\t...form,\r\n\t\t\t\t\t...response\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(updatedForm.StaleTimeout && durationPattern.test(updatedForm.StaleTimeout)) {\r\n\t\t\t\t\tservice.staleTimeoutAt = durationEnd(parseDuration(updatedForm.StaleTimeout));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(updatedForm.InvalidTimeout && durationPattern.test(updatedForm.InvalidTimeout)) {\r\n\t\t\t\t\tconst TIMEOUT_EXPIRATION_PAD = 0.90;\r\n\t\t\t\t\tconst timeoutDuration = parseDuration(updatedForm.InvalidTimeout);\r\n\t\t\t\t\tconst paddedDurationInMs = toSeconds(timeoutDuration) * TIMEOUT_EXPIRATION_PAD;\r\n\t\t\t\t\tservice.invalidTimeoutAt = durationEnd(timeoutDuration);\r\n\t\t\t\t\tservice.invalidTimeoutPadded = new Date(new Date().valueOf() + (paddedDurationInMs*1000));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tupdatedForm.Agency.Classifications = response.Agency.Classifications;\r\n\t\t\t\tforEach(updatedForm.Fields, field => {\r\n\t\t\t\t\tconst fullSection = find(updatedForm.Sections, (section) => section.Id === field.Section?.Id);\r\n\t\t\t\t\tfield.Section = fullSection;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tmapFeaturesToFields(updatedForm);\r\n\t\t\t\tsetAssociatedEntities(updatedForm.Fields);\r\n\r\n\t\t\t\tforEach(updatedForm.Seasons, season => {\r\n\t\t\t\t\tforEach(season.Periods, period => {\r\n\t\t\t\t\t\tperiod.beginInclusiveMoment = moment(period.BeginInclusive);\r\n\t\t\t\t\t\tperiod.endExclusiveMoment = moment(period.EndExclusive);\r\n\t\t\t\t\t\tperiod.openRange = moment.range(period.BeginInclusive, period.EndExclusive);\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\r\n\t\t\t\tentityManager.reset();\r\n\t\t\t\tentityManager.loadEntityFieldData(updatedForm);\r\n\t\t\t\tupdatedForm.Rules = ruleValidator.filterToValidRules(updatedForm.Rules, updatedForm.Fields);\r\n\r\n\t\t\t\tupdatedForm.Rules\r\n\t\t\t\t\t.forEach(r => {\r\n\t\t\t\t\t\tconst conditionFields = ruleConfigService.evaluatedConditionFieldIds(r);\r\n\t\t\t\t\t\truleConfigService.assignFieldOrders(r, updatedForm.Fields, conditionFields);\r\n\t\t\t\t\t\tr.Scope = { Code: ruleConfigService.reportScope(r, updatedForm.Fields) };\r\n\r\n\t\t\t\t\t\t// note that for validation block purposes, the scope may differ from the rule evaluation scope\r\n\t\t\t\t\t\tr.validationScope = { Code: ruleConfigService.validationScope(r, updatedForm.Fields) };\r\n\t\t\t\t\t\tr.visibilityScope = { Code: ruleConfigService.getVisibilityRuleScope(r, updatedForm.Fields) };\r\n\r\n\t\t\t\t\t\truleConfigService.applyFunctionToAllChildRules(r, (childRule) => {\r\n\t\t\t\t\t\t\tif(childRule.Blob?.Binary) {\r\n\t\t\t\t\t\t\t\tconst csvText = $base64.decode(childRule.Blob?.Binary);\r\n\t\t\t\t\t\t\t\tchildRule.Blob.combinations = csvText.split(\"\\n\").map(r => r.replace(\"\\r\", \"\"));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\tconst translations = formService.buildFormTranslations(updatedForm, \"en-us\", true);\r\n\t\t\t\tconst i18n = I18NextContext.Instance.i18n;\r\n\t\t\t\ti18n.addResourceBundle(\"en-us\", DEFAULT_NAMESPACE, translations);\r\n\r\n\t\t\t\treturn updatedForm;\r\n\t\t\t})\r\n\t\t\t.then(selectedForm => api.get(FORM_PERMISSIONS(selectedForm.Id))\r\n\t\t\t\t.then((securityResponse) => {\r\n\t\t\t\t\tloadPermissions(selectedForm, securityResponse);\r\n\r\n\t\t\t\t\tif(selectedForm.Security === undefined) {\r\n\t\t\t\t\t\tselectedForm.Security = securityResponse;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tsecurityResponse.Roles.forEach(r => {\r\n\t\t\t\t\t\tconst formSecurityRoleIndex = selectedForm.Security.Roles.findIndex(s => s.Code === r.Code);\r\n\t\t\t\t\t\tselectedForm.Security.Roles[formSecurityRoleIndex] = r;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tservice.forms.selected = selectedForm;\r\n\t\t\t\t\tsecurityService.init(securityResponse);\r\n\r\n\t\t\t\t\twindow.vesl && (window.vesl.form = () => { $logger.object(service.forms.selected); });\r\n\t\t\t\t\twindow.vesl && (window.vesl.state = () => { $logger.object(service); });\r\n\r\n\t\t\t\t\treturn selectedForm;\r\n\t\t\t\t})\r\n\t\t\t\t.then(selected => {\r\n\t\t\t\t\tservice.forms.selected = selected;\r\n\t\t\t\t\treturn selected;\r\n\t\t\t\t})\r\n\t\t\t);\r\n\r\n\t\treturn loadingService.watch(promise, \"Loading...\");\r\n\t}\r\n\r\n\tfunction mapFeaturesToFields(form) {\r\n\t\tform.Features.map(feat => {\r\n\t\t\tif(feat.Type == FEATURE_TYPES.filter && feat.Blob) {\r\n\t\t\t\tconst csvText = $base64.decode(feat.Blob.Binary);\r\n\t\t\t\tfeat.data = csvText.split(\"\\n\");\r\n\t\t\t}\r\n\r\n\t\t\tif(feat.Type == FEATURE_TYPES.map || feat.Type == FEATURE_TYPES.mapPoint) {\r\n\t\t\t\tconst fields = filter(form.Fields, (f) => some(f.Data, (d) => (d.Shape || {}).GeoJson));\r\n\t\t\t\tfeat.data = fields;\r\n\r\n\t\t\t\tif(feat.Type === FEATURE_TYPES.mapPoint && feat.Blob && feat.Blob.Binary) {\r\n\t\t\t\t\tfeat.buoys = JSON.parse($base64.decode(feat.Blob.Binary));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction setAssociatedEntities(fields) {\r\n\t\tconst primaryEntityField = find(fields, (f) => {\r\n\t\t\treturn (f.Type.Code === FIELD_TYPES.entity || f.Type.Code === FIELD_TYPES.entityContact) && f.IsPrimary;\r\n\t\t});\r\n\r\n\t\tif(!primaryEntityField) {\r\n\t\t\tthrow new Error(\"Primary entity field not found.\");\r\n\t\t}\r\n\r\n\t\tif(!primaryEntityField.Data) {\r\n\t\t\tprimaryEntityField.Data = [];\r\n\t\t}\r\n\r\n\t\t$window.sessionStorage.setItem(\"entities\", angular.toJson(primaryEntityField.Data));\r\n\t}\r\n\r\n\tfunction updateContacts(original, updated) {\r\n\t\tif(updated.Id === original.Id) {\r\n\t\t\toriginal.Contacts = updated.Contacts;\r\n\t\t}\r\n\t\tif(!original.Entities)\r\n\t\t\treturn;\r\n\t\tfor(const e of original.Entities) {\r\n\t\t\tupdateContacts(e.Entity, updated);\r\n\t\t}\t\r\n\t}\r\n\r\n\tfunction updateEntity(entity) {\r\n\t\tconst allEntities = angular.fromJson($window.sessionStorage.getItem(\"entities\"));\r\n\r\n\t\tconst toUpdateIndex = findIndex(allEntities, (e) => e.Id === entity.Id);\r\n\t\tconst toUpdateItem = allEntities[toUpdateIndex];\r\n\r\n\t\tconst updatedItem = {\r\n\t\t\t...toUpdateItem,\r\n\t\t\t...entity\r\n\t\t};\r\n\r\n\t\tallEntities[toUpdateIndex] = updatedItem;\r\n\t\tentityManager.updateEntity(updatedItem);\r\n\r\n\t\t$window.sessionStorage.setItem(\"entities\", angular.toJson(allEntities));\r\n\r\n\t\tfor(const field of this.forms.selected.Fields) {\r\n\t\t\tif(!field.EntityQueryConfiguration)\r\n\t\t\t\tcontinue;\r\n\t\t\tfor(const data of field.Data) {\r\n\t\t\t\tupdateContacts(data, updatedItem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setRecentlyUsed(form, updates) {\r\n\t\tupdates.map(f => {\r\n\t\t\tmapRecentlyUsedUpdate(form, f);\r\n\t\t\tmapRecentlyUsedUpdate(this.forms.selected, f);\r\n\t\t});\r\n\r\n\t\tthis.selected = form;\r\n\r\n\t\treturn form;\r\n\t}\r\n\r\n\tfunction mapRecentlyUsedUpdate(form, update) {\r\n\t\tconst field = find(form.Fields, { Id: update.FieldId });\r\n\r\n\t\tif(field && field.IsRecentlyUsedEnabled) {\r\n\t\t\tconst index = findIndex(field.Data, (d) => (d.Id === update.EntityId || d.Id === update.DataId));\r\n\r\n\t\t\tif(index !== -1) {\r\n\t\t\t\tfield.Data[index].IsRecent = true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getRecentlyUsed() {\r\n\t\treturn this.selected;\r\n\t}\r\n\r\n\tfunction clearSelectedEntity() {\r\n\t\tthis.associatedEntities.selected = {\r\n\t\t\tprimary: null,\r\n\t\t\tfriendly: null\r\n\t\t};\r\n\t}\r\n\r\n\tassign(service, getDefaultState());\r\n\r\n\tfunction reset() {\r\n\t\t$logger.user(null);\r\n\r\n\t\t$window.sessionStorage.clear();\r\n\r\n\t\tassign(service, getDefaultState());\r\n\t}\r\n\r\n\treturn service;\r\n}\r\nexport default angular\r\n\t.module(\"vesl.services.app-state\", deps)\r\n\t.service(\"appState\", AppState).name;\r\n","import decoder from \"jwt-decode\";\r\nimport { uuid } from \"../utils/\";\r\n\r\nfunction authService(\r\n\t$logger,\r\n\t$userProfile\r\n) {\r\n\tconst svc = this;\r\n\tsvc.logout = logout;\r\n\tsvc.getCurrentUrl = getCurrentUrl;\r\n\tsvc.uuid = uuid;\r\n\tsvc.setAuthData = setAuthData;\r\n\r\n\tfunction setAuthData(oAuthUser) {\r\n\t\tconst accessObject = decoder(oAuthUser.access_token);\r\n\r\n\t\tconst userSubscriberId = oAuthUser.profile.sub;\r\n\t\tconst subscriberClaims = userSubscriberId.split(\"_\");\r\n\t\tconst userDbId = subscriberClaims[2];\r\n\r\n\t\tconst authData = {\r\n\t\t\texpires: accessObject.exp,\r\n\t\t\tissued: accessObject.nbf,\r\n\t\t\tuser: {\r\n\t\t\t\tuserId: oAuthUser.profile.sub,\r\n\t\t\t\tname: oAuthUser.profile.name,\r\n\t\t\t\tusername: oAuthUser.profile.preferred_username,\r\n\t\t\t\troles: [oAuthUser.profile.role],\r\n\t\t\t\tdatabaseId: userDbId\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t$userProfile.setUser(authData.user || {});\r\n\t\t$logger.user(authData.user.userId);\r\n\r\n\t\tconst currentProfile = $userProfile.getUserProfile();\r\n\t\tcurrentProfile.user = authData;\r\n\t\t$userProfile.setUserProfile(currentProfile);\r\n\r\n\t\treturn authData;\r\n\t}\r\n\r\n\r\n\tfunction logout() { }\r\n\r\n\tfunction getCurrentUrl() {\r\n\t\treturn (\r\n\t\t\tlocation.protocol +\r\n\t\t\t\"//\" +\r\n\t\t\tlocation.hostname +\r\n\t\t\t(location.port ? \":\" + location.port : \"\")\r\n\t\t);\r\n\t}\r\n\r\n\treturn svc;\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.auth\", [])\r\n\t.service(\"auth\", authService).name;\r\n","const DEFAULT_MAP_ID = x => x.id;\r\n\r\nfunction dataloader(\r\n\t$q,\r\n\t$logger\r\n) {\r\n\tthis.newLoader = newLoader;\r\n\r\n\tfunction newLoader(...args) {\r\n\t\treturn new Loader(...args);\r\n\t}\r\n\r\n\tfunction Loader(\r\n\t\tbatchCall,\r\n\t\t{\r\n\t\t\twait = 20,\r\n\t\t\tmapKeyFn = DEFAULT_MAP_ID,\r\n\t\t\tcacheArgFn = x => x,\r\n\t\t\tlimit = -1\r\n\t\t} = {}\r\n\t) {\r\n\t\tlet cache = {};\r\n\t\tconst queuedKeys = [];\r\n\r\n\t\tconst processBatch = () => {\r\n\t\t\tconst args = [...queuedKeys];\r\n\r\n\t\t\tqueuedKeys.length = 0;\r\n\r\n\t\t\treturn batchCall(args).then(\r\n\t\t\t\t(resp) => resp.forEach(x => cache[mapKeyFn(x)].resolve(x)),\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\t$logger.exception(err, \"Error in map data-loader cache\");\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t\t.catch(err =>\r\n\t\t\t\t\t$logger.exception(err, \"Error in map data-loader batch\")\r\n\t\t\t\t);\r\n\t\t};\r\n\r\n\t\tconst debouncedProcessBatch = debounce(processBatch, wait);\r\n\r\n\t\treturn {\r\n\t\t\tload(key) {\r\n\t\t\t\tif(!cache[cacheArgFn(key)]) {\r\n\t\t\t\t\tcache[cacheArgFn(key)] = getResolvablePromise();\r\n\t\t\t\t\tqueuedKeys.push(key);\r\n\r\n\t\t\t\t\tif(limit && queuedKeys.length == limit) {\r\n\t\t\t\t\t\tdebouncedProcessBatch.cancel();\r\n\t\t\t\t\t\tprocessBatch();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdebouncedProcessBatch();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn cache[cacheArgFn(key)];\r\n\t\t\t},\r\n\t\t\tclear(key) {\r\n\t\t\t\tif(key) {\r\n\t\t\t\t\tdelete cache[cacheArgFn(key)];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcache = {};\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tflush() {\r\n\t\t\t\tdebouncedProcessBatch.cancel();\r\n\t\t\t\tprocessBatch();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tfunction getResolvablePromise() {\r\n\t\tlet resolve;\r\n\t\tlet reject;\r\n\r\n\t\tconst p = $q((res, rej) => {\r\n\t\t\tresolve = res;\r\n\t\t\treject = rej;\r\n\t\t});\r\n\r\n\t\tp.resolve = val => resolve(val);\r\n\t\tp.reject = val => reject(val);\r\n\r\n\t\treturn p;\r\n\t}\r\n\r\n\tfunction debounce(func, wait, immediate) {\r\n\t\tlet timeout;\r\n\r\n\t\tfn.cancel = () => clearTimeout(timeout);\r\n\t\treturn fn;\r\n\r\n\t\tfunction fn() {\r\n\t\t\tconst context = this;\r\n\t\t\tconst args = arguments;\r\n\t\t\tconst callNow = immediate && !timeout;\r\n\r\n\t\t\tclearTimeout(timeout);\r\n\t\t\ttimeout = setTimeout(later, wait);\r\n\r\n\t\t\tif(callNow) {\r\n\t\t\t\tfunc.apply(context, args);\r\n\t\t\t}\r\n\r\n\t\t\tfunction later() {\r\n\t\t\t\ttimeout = null;\r\n\t\t\t\tif(!immediate) {\r\n\t\t\t\t\tfunc.apply(context, args);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.dataloader\", [])\r\n\t.service(\"dataloader\", dataloader).name;\r\n","import { kebabCase } from \"lodash\";\r\n\r\nfunction dynamicComponent($compile, $injector) {\r\n\tthis.compile = compile;\r\n\r\n\tfunction compile(\r\n\t\tsettings,\r\n\t\tlocals,\r\n\t\tscope,\r\n\t\thostElement,\r\n\t\tcontext\r\n\t) {\r\n\t\tconst bindings = $injector.invoke(settings.resolve, context, locals);\r\n\r\n\t\t// get \"simple\" properties\r\n\t\tconst defaultProps = Object.keys(settings.props || {})\r\n\t\t\t.map(key => `${kebabCase(key)}=\"${settings.props[key]}\"`)\r\n\t\t\t.join(\" \");\r\n\r\n\t\t// resolve component \"bindings\"\r\n\t\t// join with properties\r\n\t\tconst props = Object.keys(bindings)\r\n\t\t\t.map(key => `${kebabCase(key)}=\"${key}\"`)\r\n\t\t\t.concat(defaultProps)\r\n\t\t\t.join(\" \");\r\n\r\n\t\t// add component binding values to corresponding scope\r\n\t\tscope = Object.keys(bindings).reduce((acc, key) => {\r\n\t\t\tacc[key] = bindings[key];\r\n\t\t\treturn acc;\r\n\t\t}, scope);\r\n\r\n\t\tconst html = `<${settings.component} ${props}>`;\r\n\t\tconst el = angular.element(html);\r\n\r\n\t\thostElement.empty().append(el);\r\n\r\n\t\t$compile(el)(scope);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.dynamic-component\", [])\r\n\t.service(\"dynamicComponent\", dynamicComponent).name;\r\n","// this may seem redundant, but this allows for a performance gain\r\n// with easier event unbinding when a component is destroyed\r\nfunction EventBus($logger, $rootScope, $timeout) {\r\n\tconst service = this;\r\n\r\n\tservice.register = register;\r\n\tservice.trigger = trigger;\r\n\tservice.unregister = unregister;\r\n\r\n\tfunction register(event, callback, scope) {\r\n\t\tconst unbinder = $rootScope.$on(event, callback);\r\n\r\n\t\tif(scope) {\r\n\t\t\tscope.$on(\"$destroy\", unbinder);\r\n\t\t} else {\r\n\t\t\t$logger.warn(\"An event was loaded without a scope. If unintentional, this could lead to ghost handlers\", { event: event });\r\n\t\t}\r\n\r\n\t\treturn unbinder;\r\n\t}\r\n\r\n\tfunction unregister(unbinder) {\r\n\t\tif(unbinder) {\r\n\t\t\tunbinder();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction trigger(event, payload = {}) {\r\n\t\t$timeout(() => {\r\n\t\t\t$rootScope.$emit(event, payload); //I have data to send\r\n\t\t}, 0);\r\n\t}\r\n\r\n\treturn service;\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.event-bus\", [])\r\n\t.service(\"eventBus\", EventBus).name;\r\n","import { entityEffectiveStatus } from \"../utils/effectiveRanges\";\r\n\r\nexport class FeatureCallbacks {\r\n\tnestedEntityDateFilter(entity, asOf) {\r\n\t\tif(!entity) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(entity.Entities) {\r\n\t\t\tfor(const child of entity.Entities) {\r\n\t\t\t\tthis.nestedEntityDateFilter(child.Entity, asOf);\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!entity.Effective?.length) {\r\n\t\t\tentity.valid = true;\r\n\t\t\tentity.inGrace = false;\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!asOf) {\r\n\t\t\tentity.valid = undefined;\r\n\t\t\tentity.inGrace = undefined;\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst status = entityEffectiveStatus(entity, asOf);\r\n\t\tentity.valid = status.isValid;\r\n\t\tentity.inGrace = status.isInGrace;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.feature-callbacks\", [])\r\n\t.service(\"featureCallbacks\", FeatureCallbacks).name;\r\n","import {\r\n\tfind,\r\n\tfilter,\r\n\tminBy,\r\n\tflatMap\r\n} from \"lodash\";\r\nimport {\r\n\tEVENT_VALUE_CHANGED,\r\n\tEVENT_FIELD_DISABLE,\r\n\tEVENT_FIELD_ENABLE,\r\n\tEVENT_SET_FEATURE_DATA,\r\n\tFIELD_TEMPLATES,\r\n\tEVENT_CLEAR_VALUE\r\n} from \"constants.js\";\r\nimport fieldHelpers from \"../components/field-helpers/lookup.config.js\";\r\nimport { IS_NOT_AVAILABLE_OPTIONS } from \"../constants.js\";\r\n\r\nfunction featureHelper(eventBus, $base64) {\r\n\tthis.getNotAvailableFeature = getNotAvailableFeature;\r\n\tthis.getCustomInputFeature = getCustomInputFeature;\r\n\tthis.mapPoint = mapPoint;\r\n\tthis.checkNotAvailable = checkNotAvailable;\r\n\tthis._eventBus = eventBus;\r\n\tthis._base64 = $base64;\r\n\r\n\tfunction checkNotAvailable(field, compareValue) {\r\n\t\tif(field.IsNotAvailableEnabled === false\r\n\t\t\t|| field.IsNotAvailableEnabled === undefined\r\n\t\t\t|| field.IsNotAvailableEnabled === IS_NOT_AVAILABLE_OPTIONS.never) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif((field.IsNotAvailableEnabled === true || field.IsNotAvailableEnabled === null) && compareValue === IS_NOT_AVAILABLE_OPTIONS.always) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn field.IsNotAvailableEnabled === compareValue;\r\n\t}\r\n\r\n\tfunction getNotAvailableFeature(field, initialIsNotAvailableState, action) {\r\n\t\tconst name = fieldHelpers.NotAvailable.name;\r\n\t\tconst disable = field.isReadonly || field.isDisabled;\r\n\r\n\t\treturn {\r\n\t\t\tname: name,\r\n\t\t\tfieldId: field.Id,\r\n\t\t\tdisabled: disable,\r\n\t\t\tstate: initialIsNotAvailableState,\r\n\t\t\taction: action\r\n\t\t};\r\n\t}\r\n\r\n\tfunction getCustomInputFeature(field, initialIsCustomInputState, action) {\r\n\t\tconst name = fieldHelpers.CustomInput.name;\r\n\t\tconst disable = field.isReadonly || field.isDisabled;\r\n\r\n\t\treturn {\r\n\t\t\tname: name,\r\n\t\t\tfieldId: field.Id,\r\n\t\t\tdisabled: disable,\r\n\t\t\tstate: initialIsCustomInputState,\r\n\t\t\taction: action\r\n\t\t};\r\n\t}\r\n\r\n\tfunction mapPoint(feat, fields, scope) {\r\n\t\tconst trigger = minBy(feat.Fields, \"Order\");\r\n\t\tconst locationFields = filter(fields, f => f.Template === FIELD_TEMPLATES.Location);\r\n\t\tconst areaDefinition = filter(fields, f => f.Key.Code == \"TRIP.AREAS.SINGLE\");\r\n\t\tconst triggerField = find(fields, f => f.Id === trigger.Field.Id);\r\n\r\n\t\tfeat.locationFields = [];\r\n\r\n\t\tlocationFields.forEach(f => {\r\n\t\t\tf.features = [feat];\r\n\t\t\tfeat.locationFields.push({ Id: f.Id, fieldId: f.Id, fieldKey: f.Key.Code, Key: { Code: f.Key.Code } });\r\n\t\t});\r\n\r\n\t\tareaDefinition.forEach(f => {\r\n\t\t\tf.features = [feat];\r\n\t\t});\r\n\r\n\t\tif(triggerField.Type.Code !== \"AREA\") {\r\n\t\t\tthis._eventBus.register(EVENT_VALUE_CHANGED(trigger.Field.Id), (e, params) => {\r\n\t\t\t\tconst entity = params.fullEntity ? params.fullEntity : params.value;\r\n\t\t\t\tif(entity && entity.Form && entity.Form.Fields.length === 1) {\r\n\t\t\t\t\tconst fieldDataPoints = entity.Form.Fields[0];\r\n\r\n\t\t\t\t\tconst shapeFields = flatMap(feat.data, f => {\r\n\t\t\t\t\t\treturn f.Id === fieldDataPoints.Id &&\r\n\t\t\t\t\t\t\tflatMap(fieldDataPoints.Data, dp =>\r\n\t\t\t\t\t\t\t\tfilter(f.Data, (d) => dp.Id === d.Id));\r\n\t\t\t\t\t});\r\n\t\t\t\t\tconst geoJsons = flatMap(shapeFields, sf => JSON.parse(this._base64.decode(sf.Shape.GeoJson)));\r\n\t\t\t\t\tconst areaIds = flatMap(shapeFields, sf => sf.Id);\r\n\r\n\t\t\t\t\tthis._eventBus.trigger(EVENT_SET_FEATURE_DATA(feat.Type), { geoJsons, locationFields, areaIds });\r\n\r\n\t\t\t\t\tif(!triggerField.isReadonly) {\r\n\t\t\t\t\t\tlocationFields.forEach(f => {\r\n\t\t\t\t\t\t\tconst event = entity ? EVENT_FIELD_ENABLE(f.Id) : EVENT_FIELD_DISABLE(f.Id);\r\n\r\n\t\t\t\t\t\t\tthis._eventBus.trigger(event);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlocationFields.forEach(f => {\r\n\t\t\t\t\t\tthis._eventBus.trigger(EVENT_FIELD_DISABLE(f.Id));\r\n\t\t\t\t\t\tthis._eventBus.trigger(EVENT_CLEAR_VALUE(f.Id));\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}, scope);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tconst shapeFields = flatMap(feat.data, f => {\r\n\t\t\t\treturn f.Data;\r\n\t\t\t});\r\n\t\t\tconst geoJsons = flatMap(shapeFields, sf => JSON.parse(this._base64.decode(sf.Shape.GeoJson)));\r\n\t\t\tfeat.geoJsons = geoJsons;\r\n\t\t\tlocationFields.forEach(f => f.isDisabled = false);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.feature-helper\", [])\r\n\t.service(\"featureHelper\", featureHelper).name;\r\n","function intervalService($interval, $window, auth) {\r\n\tconst service = this;\r\n\r\n\tservice.process = null;\r\n\tservice.start = start;\r\n\tservice.stop = stop;\r\n\r\n\tfunction start() {\r\n\t\tif(service.process) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst authData = angular.fromJson(\r\n\t\t\t$window.sessionStorage.getItem(\"authData\")\r\n\t\t);\r\n\r\n\t\tif(authData) {\r\n\t\t\tconst time = (authData.expires - authData.issued) * 0.9 * 1000;\r\n\t\t\tservice.process = $interval(function() {\r\n\t\t\t\tauth.refreshAccessToken();\r\n\t\t\t}, time);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction stop() {\r\n\t\tif(service.process) {\r\n\t\t\t$interval.cancel(service.process);\r\n\t\t}\r\n\t\tservice.process = null;\r\n\t}\r\n\r\n\treturn service;\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.interval-service\", [])\r\n\t.service(\"intervalService\", intervalService).name;\r\n","const template = `\r\n
    \r\n\t

    {{loadingMessage}}

    \r\n
    \r\n
    \r\n\t
    \r\n\t
    \r\n\t\t \r\n\t\t\t \r\n\t\t \r\n\t
    \r\n\t
    \r\n
    \r\n`;\r\n\r\nfunction LoadingService($rootScope, $uibModal, promiseTracker) {\r\n\tconst svc = this;\r\n\r\n\tlet loadingModal;\r\n\tconst loadingModalScope = $rootScope.$new();\r\n\r\n\r\n\tsvc.watch = watch;\r\n\tsvc.getTracker = getTracker;\r\n\tsvc.isActive = isActive;\r\n\r\n\tinit();\r\n\r\n\tfunction init() {\r\n\t\tsvc.overlayLoader = getTracker();\r\n\t\t$rootScope.$watch(svc.overlayLoader.active, (curr, prev) => {\r\n\t\t\tif(curr && curr != prev) {\r\n\t\t\t\tshowModal();\r\n\t\t\t} else if(loadingModal && curr === false && prev === true) {\r\n\t\t\t\tloadingModal.dismiss();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction getTracker() {\r\n\t\treturn promiseTracker({\r\n\t\t\tactivationDelay: 0,\r\n\t\t\tminDuration: 500\r\n\t\t});\r\n\t}\r\n\r\n\tfunction showModal() {\r\n\t\tloadingModal = $uibModal.open({\r\n\t\t\ttemplate,\r\n\t\t\tscope: loadingModalScope,\r\n\t\t\tbackdrop: \"static\" /* this prevent user interaction with the background */,\r\n\t\t\tkeyboard: false\r\n\t\t});\r\n\t}\r\n\r\n\tfunction watch(promise, message = \"Loading...\") {\r\n\t\tloadingModalScope.loadingMessage = message;\r\n\t\tsvc.overlayLoader.addPromise(promise);\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tfunction isActive() {\r\n\t\treturn svc.overlayLoader.active();\r\n\t}\r\n\r\n\treturn svc;\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.loading-service\", [])\r\n\t.service(\"loadingService\", LoadingService).name;\r\n","/* eslint-disable object-curly-newline */\r\n/* eslint-disable no-console */\r\nimport { ApplicationInsights, SeverityLevel, RemoteDependencyData, Util } from \"@microsoft/applicationinsights-web\";\r\n\r\nfunction LoggingService(config) {\r\n\tconst service = this;\r\n\r\n\tservice.appInsights = null;\r\n\tservice.filters = [];\r\n\r\n\tfunction initialize() {\r\n\t\tsetupAi();\r\n\t\tsetupKeyboardEventCapture();\r\n\t}\r\n\r\n\tfunction setupAi() {\r\n\t\tservice.appInsights = new ApplicationInsights({\r\n\t\t\tconfig: {\r\n\t\t\t\tconnectionString: `InstrumentationKey=${config.appInsights};IngestionEndpoint=https://buoy.bluefindata.com;`,\r\n\t\t\t\tenableDebug: false,\r\n\t\t\t\tverboseLogging: false,\r\n\t\t\t\tenableCorsCorrelation: true,\r\n\t\t\t\tmaxAjaxCallsPerView: -1,\r\n\t\t\t\tautoTrackPageVisitTime: true,\r\n\t\t\t\tcorrelationHeaderExcludedDomains: [\"cdn.configcat.com\"]\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tservice.appInsights.loadAppInsights();\r\n\t\tfor(const initializer of telemetryInitializers())\r\n\t\t\tservice.appInsights.addTelemetryInitializer(initializer);\r\n\r\n\t\tservice.filters.push((level, message) => message == null || !(message instanceof String) ? true : !(message.indexOf(\"WDS\") > -1));\r\n\t\tservice.filters.push((level, message) => message == null || !(message instanceof String) ? true : !(message.indexOf(\"HMR\") > -1));\r\n\t\tservice.filters.push((level) => level != LEVELS.PageView || window.vesl && window.vesl.enablePageViewConsole);\r\n\t\tservice.filters.push((level) => level != LEVELS.Event || window.vesl && window.vesl.enableEventConsole);\r\n\t\tservice.filters.push((level) => level != LEVELS.Verbose || window.vesl && window.vesl.enableVerboseConsole);\r\n\t}\r\n\r\n\tfunction setupKeyboardEventCapture() { \r\n\t\tconst Mousetrap = window.Mousetrap;\r\n\r\n\t\tconst telemetryCallback = (keys, originalCallback) => () => {\r\n\t\t\tservice.event(\"web-ux-keyboard-shortcut\", null, { shortcut: keys });\r\n\r\n\t\t\toriginalCallback();\r\n\t\t};\r\n\r\n\t\tconst originalBind = Mousetrap.bind;\r\n\t\t\r\n\t\tfunction interceptedBind(\r\n\t\t\tkeys, \r\n\t\t\tcallback, \r\n\t\t\taction, \r\n\t\t\t...otherBindArgs\r\n\t\t) {\r\n\t\t\tconst loggingCallback = telemetryCallback(keys, callback);\r\n\r\n\t\t\toriginalBind.apply(Mousetrap, [keys, loggingCallback, action, ...otherBindArgs]);\r\n\t\t}\r\n\t\t\r\n\t\tMousetrap.bind = interceptedBind.bind(Mousetrap);\r\n\t}\r\n\r\n\tfunction telemetryInitializers() {\r\n\t\tconst excludeWebpackTelemetryInitializer = function(envelope) {\r\n\t\t\tif(envelope.name === RemoteDependencyData.envelopeType) {\r\n\t\t\t\tif(envelope.baseData.name.indexOf(\"hot-update.json\") > -1)\r\n\t\t\t\t\treturn false;\r\n\t\t\t\tif(envelope.baseData.name.indexOf(\"sockjs-node\") > -1)\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t};\r\n\r\n\t\tconst coerceStatusCodesToSuccess = function(envelope) {\r\n\t\t\tconst migratees = [0, 400, 401, 403, 404];\r\n\t\t\tif(envelope.name === RemoteDependencyData.envelopeType) {\r\n\t\t\t\tif(!envelope.baseData.success && migratees.indexOf(envelope.baseData.responseCode) > -1)\r\n\t\t\t\t\tenvelope.baseData.success = true;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn [excludeWebpackTelemetryInitializer, coerceStatusCodesToSuccess];\r\n\t}\r\n\r\n\tfunction getCircularReplacer() {\r\n\t\tconst seen = new WeakSet();\r\n\r\n\t\treturn (key, value) => {\r\n\t\t\tif(typeof value === \"object\" && value !== null) {\r\n\t\t\t\tif(seen.has(value)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tseen.add(value);\r\n\t\t\t}\r\n\t\t\treturn value;\r\n\t\t};\r\n\t}\r\n\r\n\tfunction simplify(...rest) {\r\n\t\tif(!rest || rest.length == 0)\r\n\t\t\treturn null;\r\n\r\n\t\tif(rest.length > 1)\r\n\t\t\tservice.debug(\"Passed multiple properties for logged AI method. Only first property is ever used.\");\r\n\r\n\t\tconst properties = rest[0];\r\n\t\tif(typeof properties != \"object\")\r\n\t\t\treturn null;\r\n\r\n\t\tconst empty = {};\r\n\t\tlet simplified = empty;\r\n\t\tfor(const key in properties) {\r\n\t\t\t// ask james about this one\r\n\t\t\t// eslint-disable-next-line no-prototype-builtins\r\n\t\t\tif(Object.hasOwnProperty(key))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif(typeof properties[key] !== \"object\" && properties[key] !== undefined && properties[key] !== null && properties[key] !== undefined) {\r\n\t\t\t\tsimplified = { ...simplified, [key]: properties[key] };\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn simplified === empty ? null : simplified;\r\n\t}\r\n\r\n\tfunction shouldLog(level, message) {\r\n\t\tfor(const filter of service.filters) {\r\n\t\t\tif(!filter(level, message)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\tconst LEVELS = {\r\n\t\tWarning: \"warn\",\r\n\t\tInfo: \"info\",\r\n\t\tCritical: \"critical\",\r\n\t\tError: \"error\",\r\n\t\tVerbose: \"verbose\",\r\n\t\tDebug: \"debug\",\r\n\r\n\t\tNotImplemented: \"not-implemented\",\r\n\t\tPageView: \"page-view\",\r\n\t\tEvent: \"event\",\r\n\t\tObject: \"object\",\r\n\t\tSnapshot: \"snapshot\"\r\n\t};\r\n\r\n\tfunction processMessage(level, message, ...properties) {\r\n\t\tif(!shouldLog(level, message))\r\n\t\t\treturn;\r\n\r\n\t\tlet config = null;\r\n\t\tswitch(level) {\r\n\t\t\tcase LEVELS.Warning:\r\n\t\t\t\tconfig = { severity: SeverityLevel.Warning, method: \"log\", color: \"#000\", background: \"#eed202\" };\r\n\t\t\t\tbreak;\r\n\t\t\tcase LEVELS.Info:\r\n\t\t\t\tconfig = { severity: SeverityLevel.Information, method: \"info\", color: \"#fff\", background: \"#44e\" };\r\n\t\t\t\tbreak;\r\n\t\t\tcase LEVELS.Critical:\r\n\t\t\t\tconfig = { severity: SeverityLevel.Critical, method: \"error\", color: \"#fff\", background: \"#ff0000\" };\r\n\t\t\t\tbreak;\r\n\t\t\tcase LEVELS.Error:\r\n\t\t\t\tconfig = { severity: SeverityLevel.Error, method: \"error\", color: \"#000\", background: \"#f95\" };\r\n\t\t\t\tbreak;\r\n\t\t\tcase LEVELS.Trace:\r\n\t\t\tcase LEVELS.Verbose:\r\n\t\t\t\tconfig = { severity: SeverityLevel.Verbose, method: \"log\", color: \"#000\", background: \"#ccc\" };\r\n\t\t\t\tbreak;\r\n\t\t\tcase LEVELS.NotImplemented:\r\n\t\t\t\tconfig = { severity: SeverityLevel.Error, method: \"error\", color: \"#fff\", background: \"#f70\" };\r\n\t\t\t\tbreak;\r\n\t\t\tcase LEVELS.Object:\r\n\t\t\tcase LEVELS.Snapshot:\r\n\t\t\t\tconfig = { method: \"log\", color: \"#fff\", background: \"#000\" };\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tconfig = { method: \"log\", color: \"#fff\", background: \"#808\" };\r\n\t\t}\r\n\r\n\t\tconsole[config.method](`%c[${level}]%c ${message}`.trimRight(), `color: ${config.color}; background-color: ${config.background};`, \"\", ...properties);\r\n\r\n\t\tif(config.severity !== undefined) {\r\n\t\t\tif(!(message instanceof String || typeof message === \"string\")) {\r\n\t\t\t\tservice.debug(\"Passed non-string message parameter for logged AI method. Suppressing any outgoing AI log.\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tservice.appInsights.trackTrace({ message: message, severityLevel: config.severity, properties: simplify(...properties) });\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//core logging methods (ordered by severity desc)\r\n\tservice.critical = (message, ...properties) => processMessage(LEVELS.Critical, message, ...properties);\r\n\tservice.error = (message, ...properties) => processMessage(LEVELS.Error, message, ...properties);\r\n\tservice.warn = (message, ...properties) => processMessage(LEVELS.Warning, message, ...properties);\r\n\tservice.info = (message, ...properties) => processMessage(LEVELS.Info, message, ...properties);\r\n\tservice.trace = service.verbose = (message, ...properties) => processMessage(LEVELS.Verbose, message, ...properties);\r\n\tservice.debug = (message, ...properties) => processMessage(LEVELS.Debug, message, ...properties);\r\n\tservice.debugWhen = (condition, message, ...properties) => condition() ? service.debug(message, ...properties) : null;\r\n\r\n\tservice.missing = (message, ...properties) => processMessage(LEVELS.NotImplemented, message, ...properties);\r\n\tservice.snapshot = (message, ...objs) => processMessage(LEVELS.Snapshot, message, ...(objs.map(obj => !!obj ? JSON.parse(JSON.stringify(obj, getCircularReplacer())) : \"empty object\")));\r\n\tservice.object = (...objs) => processMessage(LEVELS.Object, null, ...objs);\r\n\r\n\tservice.exception = (e, message, ...properties) => {\r\n\t\tservice.error(message, { exception: e, ...{ properties } });\r\n\r\n\t\tservice.appInsights.trackException({ exception: e, properties: simplify(properties) });\r\n\t};\r\n\r\n\tservice.view = (name, uri, properties) => {\r\n\t\tconst telemetryContext = service.appInsights.properties.context.telemetryTrace;\r\n\t\tif(telemetryContext.name != name) {\r\n\t\t\tproperties = { ...properties, from: telemetryContext.name };\r\n\r\n\t\t\ttelemetryContext.traceID = Util.newId();\r\n\t\t\ttelemetryContext.name = name;\r\n\t\t}\r\n\r\n\t\tprocessMessage(LEVELS.PageView, name, properties);\r\n\r\n\t\tservice.appInsights.trackPageView({ name: name, uri: uri, properties: simplify(properties) });\r\n\t};\r\n\r\n\tservice.buildWebEvent = (module) => (action) => (name) => `@vesl/web-${module}-${action}-${name}`;\r\n\tservice.buildReportEvent = this.buildWebEvent(\"report\");\r\n\tservice.reportDetailEventBuilder = this.buildReportEvent(\"detail\");\r\n\r\n\tservice.event = (name, measurements, properties) => {\r\n\t\tconst parser = /([a-zA-Z]+)-([a-zA-Z]+)-([a-zA-Z]+)-([a-zA-Z]+)/;\r\n\t\tconst payload = parser.exec(name);\r\n\r\n\t\tproperties = { ...simplify(properties), product: payload[1], module: payload[2], action: payload[3], event: payload[4] };\r\n\t\tconst diagnostics = !(properties || measurements)\r\n\t\t\t? null\r\n\t\t\t: {\r\n\t\t\t\t...{ properties },\r\n\t\t\t\t...(measurements ? { measurements } : null)\r\n\t\t\t};\r\n\r\n\t\tprocessMessage(LEVELS.Event, name, diagnostics);\r\n\r\n\t\tif(!!measurements) {\r\n\t\t\tproperties.measurements = measurements;\r\n\t\t}\r\n\r\n\t\tservice.appInsights.trackEvent({ name, properties });\r\n\t};\r\n\r\n\tservice.time = console.time;\r\n\tservice.timeEnd = console.timeEnd;\r\n\tservice.timeLog = console.timeLog;\r\n\tservice.timeStamp = console.timeStamp;\r\n\r\n\tservice.group = (...args) => console.group(...args);\r\n\tservice.groupEnd = (...args) => console.groupEnd(...args);\r\n\tservice.groupCollapsed = (...args) => console.groupCollapsed(...args);\r\n\r\n\tservice.user = function(user) {\r\n\t\tif(user)\r\n\t\t\tservice.appInsights.setAuthenticatedUserContext(user);\r\n\t\telse\r\n\t\t\tservice.appInsights.clearAuthenticatedUserContext();\r\n\t};\r\n\r\n\tservice.table = (...args) => console.table ? console.table(...args) : (() => {});\r\n\r\n\tinitialize();\r\n\r\n\treturn service;\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.logging\", [])\r\n\t.service(\"$logger\", LoggingService).name;\r\n","import { round } from \"lodash\";\r\nimport { UNITS } from \"../constants\";\r\n\r\nconst mapKeyFn = x =>\r\n\tJSON.stringify({\r\n\t\tlat: round(x.location.lat(), 5),\r\n\t\tlng: round(x.location.lng(), 5)\r\n\t});\r\n\r\nconst cacheArgFn = x =>\r\n\tJSON.stringify({\r\n\t\tlat: round(x.lat, 5),\r\n\t\tlng: round(x.lng, 5)\r\n\t});\r\n\r\nfunction mapHelpers($q, dataloader) {\r\n\tconst elevator = new window.google.maps.ElevationService();\r\n\r\n\tthis.elevationLoader = dataloader.newLoader(latLng => getElevation(latLng), {\r\n\t\twait: 1000,\r\n\t\tlimit: 512,\r\n\t\tmapKeyFn,\r\n\t\tcacheArgFn\r\n\t});\r\n\r\n\tfunction getElevation(latLngObjs) {\r\n\t\treturn $q((res, rej) => {\r\n\t\t\tconst params = { locations: latLngObjs };\r\n\t\t\televator.getElevationForLocations(params, onSuccess);\r\n\t\t\t\r\n\t\t\tfunction onSuccess(results, status) {\r\n\t\t\t\tif(status === \"OK\" && results[0]) {\r\n\t\t\t\t\tconst enhancedResults = [];\r\n\t\t\t\t\tfor(const result of results) {\r\n\t\t\t\t\t\tconst enhancedResult = {\r\n\t\t\t\t\t\t\t...result,\r\n\t\t\t\t\t\t\tisAboveSeaLevel: result.elevation > 0,\r\n\t\t\t\t\t\t\trawValue: parseFloat(result.elevation),\r\n\t\t\t\t\t\t\tmeters: Math.abs(parseFloat(result.elevation)),\r\n\t\t\t\t\t\t\tfeet: Math.abs(parseFloat(result.elevation)) * UNITS.feet.per.meter\t\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tenhancedResults.push(enhancedResult);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tres(enhancedResults);\r\n\t\t\t\t} else {\r\n\t\t\t\t\trej(\"Elevation service failed due to: \" + status);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.map-helpers\", [])\r\n\t.service(\"mapHelpers\", mapHelpers).name;\r\n","// import { FORM_REPORT_SUBMIT, FORM_REPORT_WITHDRAW, FORM_REPORT_DELETE, FORM_REPORT_RESTORE } from \"../routes\";\r\n// import { EVENT_REPORT_STATUS_CHANGE } from \"../constants\";\r\nimport * as angular from \"angular\";\r\n// import * as models from './messaging-models';\r\n\r\nclass MessagingService {\r\n\tparticipants = [\r\n\t\t{\r\n\t\t\tuserId: 0,\r\n\t\t\tfirstName: \"Paul\",\r\n\t\t\tlastName: \"Vicknair\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tuserId: 1,\r\n\t\t\tfirstName: \"James\",\r\n\t\t\tlastName: \"Sampson\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tuserId: 2,\r\n\t\t\tfirstName: \"Andrew\",\r\n\t\t\tlastName: \"Petersen\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tuserId: 3,\r\n\t\t\tfirstName: \"Victoria\",\r\n\t\t\tlastName: \"Petersen\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tuserId: 4,\r\n\t\t\tfirstName: \"C4First\",\r\n\t\t\tlastName: \"C4Last\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tuserId: 5,\r\n\t\t\tfirstName: \"C5First\",\r\n\t\t\tlastName: \"C5Last\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tuserId: 6,\r\n\t\t\tfirstName: \"C6First\",\r\n\t\t\tlastName: \"C6Last\"\r\n\t\t}\r\n\t];\r\n\r\n\tthreads = [\r\n\t\t{\r\n\t\t\theader: {\r\n\t\t\t\tthreadId: 0,\r\n\t\t\t\tparticipants: [this.participants[0], this.participants[3]],\r\n\t\t\t\tsubject: \"subject 00\"\r\n\t\t\t},\r\n\t\t\tmessages: [\r\n\t\t\t\t{\r\n\t\t\t\t\tmessageId: 0,\r\n\t\t\t\t\tcontact: this.participants[0],\r\n\t\t\t\t\ttimestamp: new Date(),\r\n\t\t\t\t\tmessage: \"Hello this is 0\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tmessageId: 1,\r\n\t\t\t\t\tcontact: this.participants[3],\r\n\t\t\t\t\ttimestamp: new Date(),\r\n\t\t\t\t\tmessage: \"Hello this is 3\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tmessageId: 2,\r\n\t\t\t\t\tcontact: this.participants[0],\r\n\t\t\t\t\ttimestamp: new Date(),\r\n\t\t\t\t\tmessage: \"How are you 3\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tmessageId: 3,\r\n\t\t\t\t\tcontact: this.participants[3],\r\n\t\t\t\t\ttimestamp: new Date(),\r\n\t\t\t\t\tmessage: \"I'm good 0\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tmessageId: 4,\r\n\t\t\t\t\tcontact: this.participants[0],\r\n\t\t\t\t\ttimestamp: new Date(),\r\n\t\t\t\t\tmessage: \"Quisque consequat arcu eget odio cursus, ut tempor arcu vestibulum. Etiam ex arcu, porta a urna non, lacinia pellentesque orci.\" +\r\n\t\t\t\t\t\t\"Proin semper sagittis erat, eget condimentum sapien viverra et. Mauris volutpat magna nibh, et condimentum est rutrum a. Nunc sed\" +\r\n\t\t\t\t\t\t\" turpis mi. In eu massa a sem pulvinar lobortis.\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\theader: {\r\n\t\t\t\tthreadId: 1,\r\n\t\t\t\tparticipants: [this.participants[0], this.participants[1], this.participants[2]],\r\n\t\t\t\tsubject: \"subject 01\"\r\n\t\t\t},\r\n\t\t\tmessages: [\r\n\t\t\t\t{\r\n\t\t\t\t\tmessageId: 4,\r\n\t\t\t\t\tcontact: this.participants[1],\r\n\t\t\t\t\ttimestamp: new Date(),\r\n\t\t\t\t\tmessage: \"Hello this is 1\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tmessageId: 5,\r\n\t\t\t\t\tcontact: this.participants[2],\r\n\t\t\t\t\ttimestamp: new Date(),\r\n\t\t\t\t\tmessage: \"Hello this is 2\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tmessageId: 6,\r\n\t\t\t\t\tcontact: this.participants[1],\r\n\t\t\t\t\ttimestamp: new Date(),\r\n\t\t\t\t\tmessage: \"How are you 2\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tmessageId: 7,\r\n\t\t\t\t\tcontact: this.participants[2],\r\n\t\t\t\t\ttimestamp: new Date(),\r\n\t\t\t\t\tmessage: \"I'm good 1\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tmessageId: 8,\r\n\t\t\t\t\tcontact: this.participants[0],\r\n\t\t\t\t\ttimestamp: new Date(),\r\n\t\t\t\t\tmessage: \"Me Too\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t];\r\n\r\n\tconstructor(api, loadingService) {\r\n\t\tthis.api = api;\r\n\t\tthis._loadingService = loadingService;\r\n\t}\r\n\r\n\tgetThreadList() {\r\n\t\tconst allThreadHeaders = this.threads.map((item) => { return item.header; });\r\n\t\treturn allThreadHeaders;\r\n\t}\r\n\r\n\tgetThread(threadId) {\r\n\t\tconst thread = this.threads.filter((item) => { return item.header.threadId == threadId; });\r\n\r\n\t\treturn thread[0];\r\n\t}\r\n\r\n\tgetAllContacts() {\r\n\t\treturn this.participants;\r\n\t}\r\n\r\n\tnewMessage(message, threadId, userId) {\r\n\t\tconst thisThread = this.threads.filter((item) => { return item.header.threadId == threadId; })[0];\r\n\t\tconst thisContact = this.participants.filter((item) => { return item.userId == userId; })[0];\r\n\t\tconst newMessage = {\r\n\t\t\tcontact: thisContact,\r\n\t\t\tmessage: message,\r\n\t\t\tmessageId: -1,\r\n\t\t\ttimestamp: new Date()\r\n\t\t};\r\n\r\n\t\tthisThread.messages.push(newMessage);\r\n\r\n\t\treturn newMessage;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.messaging-service\", [])\r\n\t.service(\"messagingService\", MessagingService).name;\r\n","import {\r\n\tFORM_REPORT_DELETE, FORM_REPORT_SUBMIT, FORM_REPORT_RESTORE, FORM_REPORT_WITHDRAW, FORM_REPORT_CREATE, FORM_REPORT_UPDATE\r\n} from \"routes.js\";\r\nimport { EVENT_REPORT_STATUS_CHANGE } from \"constants.js\";\r\n\r\nexport class ReportHelper {\r\n\tconstructor(eventBus, api, loadingService, appState, $logger) {\r\n\t\tthis._eventBus = eventBus;\r\n\t\tthis.api = api;\r\n\t\tthis.loadingService = loadingService;\r\n\t\tthis.appState = appState;\r\n\t\tthis.$logger = $logger;\r\n\t}\r\n\r\n\tsubmit(formId, report) {\r\n\t\treturn this.api\r\n\t\t\t.put(FORM_REPORT_SUBMIT(formId, report.Id))\r\n\t\t\t.then((resp) => {\r\n\t\t\t\tconst updates = {\r\n\t\t\t\t\t...report,\r\n\t\t\t\t\t...resp,\r\n\t\t\t\t\tRules: resp.Rules ?? []\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis._eventBus.trigger(EVENT_REPORT_STATUS_CHANGE, updates);\r\n\t\t\t})\r\n\t\t\t.catch(err => this.handleStatusChangeError(err));\r\n\t}\r\n\r\n\twithdraw(formId, report) {\r\n\t\treturn this.api\r\n\t\t\t.put(FORM_REPORT_WITHDRAW(formId, report.Id))\r\n\t\t\t.then((resp) => {\r\n\t\t\t\treport = {\r\n\t\t\t\t\t...report,\r\n\t\t\t\t\t...resp,\r\n\t\t\t\t\tRules: resp.Rules ?? []\r\n\t\t\t\t};\r\n\r\n\t\t\t\tdelete report.Submitted;\r\n\r\n\t\t\t\tthis._eventBus.trigger(EVENT_REPORT_STATUS_CHANGE, report);\r\n\t\t\t})\r\n\t\t\t.catch(err => this.handleStatusChangeError(err));\r\n\t}\r\n\r\n\tdelete(formId, report) {\r\n\t\treturn this.api\r\n\t\t\t.put(FORM_REPORT_DELETE(formId, report.Id)).then((resp) => {\r\n\t\t\t\treport = {\r\n\t\t\t\t\t...report,\r\n\t\t\t\t\t...resp\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis._eventBus.trigger(EVENT_REPORT_STATUS_CHANGE, resp);\r\n\t\t\t})\r\n\t\t\t.catch(err => this.handleStatusChangeError(err));\r\n\t}\r\n\r\n\trestore(formId, report) {\r\n\t\treturn this.api\r\n\t\t\t.put(FORM_REPORT_RESTORE(formId, report.Id)).then((resp) => {\r\n\t\t\t\treport = {\r\n\t\t\t\t\t...report,\r\n\t\t\t\t\t...resp\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.$logger.debug(\"resore\", report);\r\n\t\t\t\tthis._eventBus.trigger(EVENT_REPORT_STATUS_CHANGE, report);\r\n\t\t\t})\r\n\t\t\t.catch(err => this.handleStatusChangeError(err));\r\n\t\t\r\n\t}\r\n\r\n\tsaveReport(updates, report) {\r\n\t\tconst isNewReport = (!report || !report.Id);\r\n\t\tconst formId = this.appState.forms.selected.Id;\r\n\r\n\t\tconst params = {\r\n\t\t\tId: isNewReport ? undefined : report.Id,\r\n\t\t\tFormId: formId,\r\n\t\t\tFields: updates\r\n\t\t};\r\n\r\n\t\tconst request = {\r\n\t\t\taction: isNewReport ? this.api.post : this.api.put,\r\n\t\t\turl: isNewReport ? FORM_REPORT_CREATE(formId) : FORM_REPORT_UPDATE(formId, report.Id)\r\n\t\t};\r\n\r\n\t\tconst promise = this.loadingService.watch(request.action(request.url, params));\r\n\t\treturn promise;\r\n\t}\r\n\r\n\thandleStatusChangeError = (err) => {\r\n\t\tif(err?.Data?.Rules) {\r\n\t\t\tthis._eventBus.trigger(EVENT_REPORT_STATUS_CHANGE, err.Data);\r\n\t\t}\r\n\r\n\t\tthrow err;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.report-helper\", [])\r\n\t.service(\"reportHelper\", ReportHelper).name;\r\n","import {\r\n\tforEach,\r\n\tsome,\r\n\tgroupBy,\r\n\tfind,\r\n\tfilter,\r\n\tflatMap\r\n} from \"lodash\";\r\n\r\nimport { PIVOT_TYPES } from \"constants.js\";\r\n\r\nclass DetailHelper {\r\n\tconstructor(auth, $logger) {\r\n\t\tthis.auth = auth;\r\n\t\tthis.$logger = $logger;\r\n\t}\r\n\r\n\texplodePivotedRowsAndAssignLinkKeys(updates, fieldDefinitions, repeatToLinkKeyMap = {}) {\r\n\t\tconst hasPivotedRows = this.isDetailPivoted(updates);\r\n\r\n\t\tupdates = updates.filter((val) => val.hasResultForRuleRun !== false);\r\n\r\n\t\tif(hasPivotedRows) {\r\n\t\t\tupdates = updates.filter(val => val.hasFullResult !== false);\r\n\r\n\t\t\tconst pivotField = fieldDefinitions && find(fieldDefinitions, field => field.Pivot && field.Pivot !== PIVOT_TYPES.Repeat);\r\n\t\t\tconst groupedValues = groupBy(updates, (update) => update.repeatId);\r\n\r\n\t\t\tforEach(groupedValues, (values, repeatId) => {\r\n\t\t\t\tif(values.length === 1 && (pivotField && values[0].FieldId === pivotField.Id)) {\r\n\t\t\t\t\tgroupedValues[repeatId] = [];\r\n\t\t\t\t}\r\n\t\t\t\telse if(repeatId !== undefined && repeatId !== \"undefined\") {\r\n\t\t\t\t\t//groupedValues[undefined] are static fields - if they exist add them to each detail row\r\n\t\t\t\t\tgroupedValues[undefined] && groupedValues[undefined].map(val => {\r\n\t\t\t\t\t\tgroupedValues[repeatId].push({ ...val });\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\trepeatToLinkKeyMap = this.assignDetailLinkKeys(groupedValues[repeatId], repeatId, repeatToLinkKeyMap);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tconst detailGroupedValues = filter(groupedValues, (val, index) => (index !== undefined && index !== \"undefined\"));\r\n\r\n\t\t\tupdates = flatMap(detailGroupedValues, (val) => val);\r\n\r\n\t\t\t//if all pivoted rows are empty, still attempt to save one row with non-pivoting data\r\n\t\t\tif(updates && updates.length === 0 && groupedValues[undefined] && groupedValues[undefined].length > 0) {\r\n\t\t\t\tupdates = groupedValues[undefined];\r\n\t\t\t\trepeatToLinkKeyMap = this.assignDetailLinkKeys(updates, -1, repeatToLinkKeyMap);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\trepeatToLinkKeyMap = this.assignDetailLinkKeys(updates, -1, repeatToLinkKeyMap);\r\n\t\t}\r\n\r\n\t\treturn { updates, repeatToLinkKeyMap };\r\n\t}\r\n\r\n\tisDetailPivoted(updates) {\r\n\t\treturn some(updates, update => !!update.repeatId);\r\n\t}\r\n\r\n\tassignDetailLinkKeys(rowValues, repeatId, repeatToLinkKeyMap) {\r\n\t\tconst linkKey = repeatToLinkKeyMap[repeatId] || this.auth.uuid();\r\n\r\n\t\trowValues.map((update) => {\r\n\t\t\tupdate.DetailLinkKey = linkKey;\r\n\t\t});\r\n\r\n\t\treturn {\r\n\t\t\t...repeatToLinkKeyMap,\r\n\t\t\t[repeatId]: linkKey\r\n\t\t};\r\n\t}\r\n\r\n\tclearRepeatIds(values) {\r\n\t\tvalues.map((update) => {\r\n\t\t\tif(update.repeatId) {\r\n\t\t\t\tdelete update.repeatId;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//dedups details by detailId, replacing earlier details in the array list with later details\r\n\tmergeDetails(detailValueArrays) {\r\n\t\tconst detailsById = {};\r\n\t\tforEach(detailValueArrays, a => {\r\n\t\t\tconst keyedValArray = groupBy(a, val => val.DetailId);\r\n\r\n\t\t\tforEach(keyedValArray, (va, id) => {\r\n\t\t\t\tdetailsById[id] = va;\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tconst flattened = flatMap(detailsById);\r\n\r\n\t\treturn flattened;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.detail-helper\", [])\r\n\t.service(\"detailHelper\", DetailHelper).name;\r\n","import moment from \"moment\";\r\n\r\nclass TableHelper {\r\n\tverifyScore(fuseOptions, query, result) {\r\n\t\tif(result.score > 0.1)\r\n\t\t\treturn result.score;\r\n\r\n\t\tfor(let i = 0; i < fuseOptions.keys.length; i++) {\r\n\t\t\tconst values = fuseOptions.getFn(result.item, fuseOptions.keys[i]);\r\n\t\t\tfor(let j = 0; j < values.length; j++) {\r\n\t\t\t\tif(values[j].toLowerCase() === query.toLowerCase())\r\n\t\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result.score;\r\n\t}\r\n\r\n\tfilter(table, fuse, defaultName) {\r\n\t\tif(table.filterBy === \"\" || table.filterBy === undefined || table.filterBy === null) {\r\n\t\t\ttable.data = fuse.list;\r\n\t\t\tif(table.isNoFilterSorted !== true) {\r\n\t\t\t\ttable.actions.sort(defaultName);\r\n\t\t\t\ttable.actions.sort(defaultName); //yes, twice, so that it'll sort ascending again.\r\n\t\t\t\ttable.isNoFilterSorted = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttable.data = fuse.search(table.filterBy).map(i => ({ ...i.item, rank: this.verifyScore(fuse.options, table.filterBy, i) }));\r\n\t\t\ttable.actions.sort(\"rank\");\r\n\t\t\ttable.actions.sort(\"rank\"); //yes twice, otherwise ascending/descending will flip on each keystroke *rolleyes\r\n\t\t\ttable.isNoFilterSorted = false;\r\n\t\t}\r\n\r\n\t\tif(!!table.range && !!table.range.rangeBegin) {\r\n\t\t\tif(table.range.rangeBegin.isSame(moment(), \"day\")) {\r\n\t\t\t\ttable.data = table.data.filter((item) => !item.LastLogin);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttable.data = table.data.filter((item) => {\r\n\t\t\t\t\tif(!item.LastLogin) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn table.range.rangeBegin.isBefore(moment(item.LastLogin), \"day\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.table-helper\", [])\r\n\t.service(\"tableHelper\", TableHelper).name;\r\n","import moment from \"moment\";\r\nimport {\r\n\tfind,\r\n\torderBy,\r\n\tpadEnd,\r\n\tpadStart\r\n} from \"lodash\";\r\nimport cloneDeep from \"clone-deep\";\r\n\r\nfunction uiHelpers($anchorScroll, $timeout, $logger) {\r\n\tthis.flash = flash;\r\n\tthis.setDisplay = setDisplay;\r\n\tthis.getEntityDisplay = getEntityDisplay;\r\n\tthis.getLastFour = getLastFour;\r\n\tthis.stringToHexColour = stringToHexColour;\r\n\tthis.textColorForHexBk = textColorForHexBk;\r\n\tthis.intToHexColorString = intToHexColorString;\r\n\r\n\tfunction getLastFour(item, subStringOf) {\r\n\t\tif(!subStringOf)\r\n\t\t\treturn item;\r\n\t\tconst subString = subStringOf.length < 5 ?\r\n\t\t\t`(${subStringOf})` :\r\n\t\t\t`(-${subStringOf.substr(subStringOf.length - 4)})`;\r\n\t\treturn `${item} ${subString}`;\r\n\t}\r\n\r\n\tfunction stringToHexColour(str) {\r\n\t\tlet hash = 0;\r\n\t\tfor(let i = 0; i < str.length; i++) {\r\n\t\t\thash = str.charCodeAt(i) + ((hash << 5) - hash);\r\n\t\t}\r\n\t\tlet colour = \"#\";\r\n\t\tlet colorNum = 0;\r\n\t\tfor(let i = 0; i < 3; i++) {\r\n\t\t\tconst value = (hash >> (i * 8)) & 0xFF;\r\n\t\t\tcolour += (\"00\" + value.toString(16)).substr(-2);\r\n\t\t\tcolorNum = (colorNum << (i * 8)) + value;\r\n\t\t}\r\n\t\tconst inted = parseInt(colour.substring(1, 7), 16);\r\n\t\treturn inted;\r\n\t}\r\n\r\n\tfunction intToHexColorString(num) {\r\n\t\treturn \"#\" + num.toString(16);\r\n\t}\r\n\r\n\tfunction textColorForHexBk(hexBkColor) {\r\n\t\tconst redVal = (hexBkColor & 0xFF0000) >> 16;\r\n\t\tconst greenVal = (hexBkColor & 0x00FF00) >> 8;\r\n\t\tconst blueVal = hexBkColor & 0x0000FF;\r\n\r\n\t\tconst perceptiveLuminance = Math.round(1 - ((0.299 * redVal) + (0.587 * greenVal) + (0.114 * blueVal)) / 255) * 255;\r\n\r\n\t\treturn (perceptiveLuminance) > 0 ? \"#FFFFFF\" : \"#000000\";\r\n\t}\r\n\r\n\r\n\tfunction mapItems(data, hideCode, renderingOptions) {\r\n\t\tconst getSlotDisplay = (slot) => {\r\n\t\t\tif(!slot?.hasOption || !slot?.hasData) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\r\n\t\t\treturn `${slot.data}`;\r\n\t\t};\r\n\r\n\t\tconst results = data.map((item) => {\r\n\t\t\tlet display = item.Name || item.Code;\r\n\t\t\tlet searchOptions = item.Name || item.Code;\r\n\r\n\t\t\tif(!!renderingOptions) {\r\n\t\t\t\tconst slots = getRenderingSlots(item, renderingOptions).map(s => getSlotDisplay(s));\r\n\t\t\t\t\r\n\t\t\t\tdisplay = `${slots[0]} ${slots[1]}${slots[2]}`;\r\n\t\t\t\tsearchOptions = `${slots[0]} ${slots[1]} ${slots[2]} `;\r\n\t\t\t}\r\n\t\t\telse if(item.Name && item.Code && !hideCode) {\r\n\t\t\t\tdisplay = `${item.Name}${item.Code}`;\r\n\t\t\t\tsearchOptions = `${item.Code || \"\"} ${item.Name || \"\"} `;\r\n\t\t\t}\r\n\r\n\t\t\tconst itemIsDeactivated = item.DeactivatedAt && moment(item.DeactivatedAt).isBefore(moment());\r\n\r\n\t\t\tconst isRecentBadge = \"\";\r\n\t\t\tconst isDeactivatedBadge = \"\";\r\n\r\n\t\t\tconst badge = itemIsDeactivated ? isDeactivatedBadge \r\n\t\t\t\t\t\t\t: item.IsRecent ? isRecentBadge \r\n\t\t\t\t\t\t\t: \"\";\r\n\r\n\t\t\treturn {\r\n\t\t\t\tvalue: item.Id?.toString() ?? item.Code ?? item.Name,\r\n\t\t\t\tlabel: badge ? badge + \" \" + display : display,\r\n\t\t\t\tcustomProperties: {\r\n\t\t\t\t\tisRecent: !itemIsDeactivated && item.IsRecent,\r\n\t\t\t\t\tsearchBy: searchOptions,\r\n\t\t\t\t\tisActive: item.IsActive || (item.IsActive === undefined && !itemIsDeactivated),\r\n\t\t\t\t\tdeactivatedAt: itemIsDeactivated\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tconst getAdvancedDirectiveValue = (nestedSelectedEntity, advancedRenderingOption) => {\r\n\t\tconst getSingleRenderedValue = (nestedSelectedEntity, optionValue) => {\r\n\t\t\tif(typeof optionValue === \"string\" || optionValue instanceof String) {\r\n\t\t\t\treturn optionValue;\r\n\t\t\t}\r\n\r\n\t\t\tif(\r\n\t\t\t\tObject.prototype.hasOwnProperty.call(optionValue, \"isBold\") \r\n\t\t\t\t|| Object.prototype.hasOwnProperty.call(optionValue, \"isItalic\") \r\n\t\t\t\t|| Object.prototype.hasOwnProperty.call(optionValue, \"content\")\r\n\t\t\t) {\r\n\t\t\t\tconst value = getSingleRenderedValue(nestedSelectedEntity, optionValue.content);\r\n\t\t\t\tif(optionValue.isBold || optionValue.isItalic) {\r\n\t\t\t\t\tconst styleProp = `\r\n\t\t\t\t\t\tstyle=\"font-weight: ${optionValue.isBold ? \"bold\" : \"normal\"}; font-style: ${optionValue.isItalic ? \"italic\" : \"normal\"}\"\r\n\t\t\t\t\t`;\r\n\r\n\t\t\t\t\treturn `\r\n\t\t\t\t\t\t${value}\r\n\t\t\t\t\t`;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst item = findDataItem(optionValue, nestedSelectedEntity);\r\n\t\t\tlet dataValue = item?.data;\r\n\t\t\tif(Object.values(item?.option ?? {}).length > 0) {\r\n\t\t\t\tconst dataModifiers = item.option;\r\n\r\n\t\t\t\tif(dataModifiers.padLeft !== undefined && dataModifiers.minLength !== undefined) {\r\n\t\t\t\t\tdataValue = padStart(dataValue, dataModifiers.minLength, dataModifiers.padLeft);\r\n\t\t\t\t}\r\n\t\t\t\telse if(dataModifiers.padRight !== undefined && dataModifiers.minLength !== undefined) {\r\n\t\t\t\t\tdataValue = padEnd(dataValue, dataModifiers.minLength, dataModifiers.padRight);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn dataValue;\r\n\t\t};\r\n\t\t\r\n\t\tconst renderedValues = advancedRenderingOption.map(o => getSingleRenderedValue(nestedSelectedEntity, o));\r\n\r\n\t\treturn renderedValues.join(\"\");\r\n\t};\r\n\r\n\tconst getSlotData = (nestedSelectedEntity, renderingOption) => {\r\n\t\tif(Array.isArray(renderingOption)) {\r\n\t\t\treturn getAdvancedDirectiveValue(nestedSelectedEntity, renderingOption);\r\n\t\t}\r\n\r\n\t\tif(Object.values(renderingOption).length > 0) {\r\n\t\t\tconst foundData = findDataItem(renderingOption, nestedSelectedEntity);\r\n\r\n\t\t\treturn foundData?.data;\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t};\r\n\r\n\tconst getRenderingSlots = (nestedSelectedEntity, renderingSlotDefinitions) => {\r\n\t\tconst renderedOptionData = renderingSlotDefinitions.map(opt => {\r\n\t\t\tif(opt === undefined || Object.values(opt).length === 0) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tdata: undefined,\r\n\t\t\t\t\thasOption: false, \r\n\t\t\t\t\thasData: false\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tconst data = getSlotData(nestedSelectedEntity, opt);\r\n\t\t\tconst slot = {\r\n\t\t\t\tdata,\r\n\t\t\t\thasOption: true, \r\n\t\t\t\thasData: data !== undefined\r\n\t\t\t};\r\n\r\n\t\t\tif(Array.isArray(slot.data)) {\r\n\t\t\t\tslot.data = slot.data.join(\", \");\r\n\t\t\t}\r\n\r\n\t\t\treturn slot;\r\n\t\t});\r\n\r\n\t\tif(!Array.isArray(renderingSlotDefinitions[1])) {\r\n\t\t\tif(renderedOptionData[1].hasOption && renderedOptionData[1].hasData) {\r\n\t\t\t\trenderedOptionData[1].data = `(${renderedOptionData[1].data ?? \"\\u2014\"})`;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\trenderedOptionData[1].hasData = false;\r\n\t\t\t\trenderedOptionData[1].hasOption = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn renderedOptionData;\r\n\t};\r\n\r\n\tconst getHtmlForDirective = (friendly, primary, renderingOption, appliedClass) => {\r\n\t\tconst friendlyCopy = cloneDeep(friendly);\r\n\t\tfriendlyCopy.Entities = [{ Entity: primary }];\r\n\r\n\t\tconst [\r\n\t\t\tslot0Data,\r\n\t\t\tslot1Data,\r\n\t\t\tslot2Data,\r\n\t\t\tslot3Data\r\n\t\t] = getRenderingSlots(friendlyCopy, renderingOption);\r\n\r\n\t\tconst getSlotDisplay = (slot) => {\r\n\t\t\tif(!slot?.hasOption) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\r\n\t\t\treturn `${slot.data ?? \"\\u2014\"}`;\r\n\t\t};\r\n\r\n\t\treturn `\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t${getSlotDisplay(slot0Data)} ${getSlotDisplay(slot1Data)}\r\n\t\t\t\t \r\n\t\t\t\t${getSlotDisplay(slot2Data)} ${getSlotDisplay(slot3Data)}\r\n\t\t\t\r\n\t\t`;\r\n\t};\r\n\r\n\tconst getDefaultEntityDisplay = (friendly, primary, hideCode, hidePrimary, appliedClass = \"\") => {\r\n\t\tlet friendlyDisplay = friendly.Name || friendly.Code;\r\n\r\n\t\tif(friendly.Name && friendly.Code && !hideCode) {\r\n\t\t\tfriendlyDisplay = `${friendly.Name} (${friendly.Code})`;\r\n\t\t}\r\n\t\tif(!primary?.Id || hidePrimary) {\r\n\t\t\treturn `${friendlyDisplay}`;\r\n\t\t}\r\n\r\n\t\tconst primaryDisplay = primary.Name || primary.Code || \"\";\r\n\r\n\t\treturn `\r\n\t\t\t\r\n\t\t\t\t${friendlyDisplay} \r\n\t\t\t\t${primaryDisplay}\r\n\t\t\t\r\n\t\t`;\r\n\t};\r\n\r\n\tfunction getEntityDisplay(friendly, primary, hideCode, hidePrimary, renderingOptions) {\r\n\t\tif(!!renderingOptions && Object.values(renderingOptions).filter(o => o !== undefined).length > 0) {\r\n\t\t\tconst displayBlocks = Object.entries(renderingOptions)\r\n\t\t\t\t.map(([cssClass, renderingOption]) => {\r\n\t\t\t\t\tif(renderingOption !== undefined) {\r\n\t\t\t\t\t\tconst html = getHtmlForDirective(friendly, primary, renderingOption, cssClass);\r\n\t\t\t\t\t\treturn html;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn getDefaultEntityDisplay(friendly, primary, hideCode, hidePrimary, cssClass);\r\n\t\t\t\t});\r\n\r\n\t\t\treturn `
    ${displayBlocks.join(\"\")}
    `;\r\n\t\t}\r\n\r\n\t\treturn getDefaultEntityDisplay(friendly, primary, hideCode, hidePrimary);\r\n\t}\r\n\r\n\t// type optionsType = {\r\n\t//\t\trecentlyUsedEnabled: boolean;\r\n\t//\t\thideCode: boolean;\r\n\t//\t\tmatchSpecificity: boolean;\r\n\t// }\r\n\tfunction setDisplay(items, options, renderingOptions) {\r\n\t\tif(!(items || {}).length)\r\n\t\t\treturn [];\r\n\r\n\t\toptions = options ?? {};\r\n\t\tconst { hideCode } = options;\r\n\r\n\t\tconst isRecentAndNotDeactivated = (item) => {\r\n\t\t\tconst isNotDeactivated = !item.DeactivatedAt || moment(item.DeactivatedAt).isBefore(moment());\r\n\t\t\tif(!isNotDeactivated)\r\n\t\t\t\treturn 1;\r\n\r\n\t\t\treturn item.IsRecent ? 0 : 1;\r\n\t\t};\r\n\r\n\t\titems = orderBy(items, [isRecentAndNotDeactivated, \"Order\", \"Name\"], [\"asc\", \"asc\", \"asc\"]);\r\n\r\n\t\tconst mapped = mapItems(items, hideCode, renderingOptions);\r\n\r\n\t\tif(items.length > 11) {\r\n\t\t\tconst label = ` ${items.length} total options Type to filter`;\r\n\r\n\t\t\tconst header = {\r\n\t\t\t\tvalue: \"-1\",\r\n\t\t\t\tlabel: label,\r\n\t\t\t\tplaceholder: \"hi\",\r\n\t\t\t\tdisabled: true,\r\n\t\t\t\tcustomProperties: {}\r\n\t\t\t};\r\n\r\n\t\t\tmapped.unshift(header);\r\n\t\t}\r\n\r\n\t\treturn mapped;\r\n\t}\r\n\r\n\tfunction flash(elementId) {\r\n\t\t$timeout(() => {\r\n\t\t\t$anchorScroll(elementId);\r\n\t\t\tconst el = document.getElementById(elementId);\r\n\t\t\tangular.element(el).addClass(\"flash\");\r\n\t\t\t$timeout(() => {\r\n\t\t\t\tangular.element(el).removeClass(\"flash\");\r\n\t\t\t}, 2000);\r\n\t\t}, 1);\r\n\t}\r\n\r\n\tfunction findDataItem(renderingOption, dataItem) {\r\n\t\tconst singleKey = Object.keys(renderingOption)[0];\r\n\t\tconst nestedOption = renderingOption[singleKey];\r\n\t\tconst nestedData = dataItem[singleKey];\r\n\r\n\t\tif(nestedData === undefined) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\tif(Array.isArray(nestedOption)) {\r\n\t\t\tconst arrayData = findItemInArray(nestedOption[0], nestedData);\r\n\t\t\tif(!arrayData || !Array.isArray(arrayData)) {\r\n\t\t\t\treturn arrayData;\r\n\t\t\t}\r\n\r\n\t\t\tconst filteredArrayData = arrayData.filter(d => d !== undefined)\r\n\t\t\t\t.map(d => d.data);\r\n\r\n\t\t\tconst returnVal = {\r\n\t\t\t\toption: nestedOption[0],\r\n\t\t\t\tdata: filteredArrayData.length === 0 ? undefined : filteredArrayData.join(\", \")\r\n\t\t\t};\r\n\r\n\t\t\treturn returnVal;\r\n\t\t}\r\n\r\n\t\tif(typeof nestedData !== \"string\" && typeof nestedOption !== \"string\" && Object.keys(nestedOption).length > 0) {\r\n\t\t\treturn findDataItem(nestedOption, nestedData);\r\n\t\t}\r\n\r\n\t\tif(\r\n\t\t\tnestedData === nestedOption \r\n\t\t\t|| Object.keys(nestedOption).length === 0 \r\n\t\t\t|| ((typeof nestedData === \"string\" \r\n\t\t\t\t|| nestedData instanceof String)\r\n\t\t\t\t&& typeof nestedOption === \"object\")\r\n\t\t) {\r\n\t\t\treturn { data: nestedData, option: nestedOption };\r\n\t\t}\r\n\r\n\t\treturn undefined;\r\n\r\n\t\tfunction findItemInArray(keyValOption, dataItemArray) {\r\n\t\t\tif(!!keyValOption.Key) {\r\n\t\t\t\tconst foundDataItem = find(dataItemArray, d => {\r\n\t\t\t\t\tconst foundData = findDataItem(keyValOption.Key, d);\r\n\r\n\t\t\t\t\treturn foundData;\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn foundDataItem !== undefined ? findDataItem(keyValOption.Value, foundDataItem) : \"\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconst items = dataItemArray.map(d => {\r\n\t\t\t\t\treturn findDataItem(keyValOption.Value, d);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(items.length === 1) {\r\n\t\t\t\t\treturn items[0];\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn items;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.ui-helpers\", [])\r\n\t.service(\"uiHelpers\", uiHelpers).name;\r\n","import {\r\n\tTIME_ZONES,\r\n\tFORM_TIMEZONE_TYPES\r\n} from \"constants.js\";\r\nimport { find } from \"lodash\";\r\nimport moment from \"moment\";\r\n\r\nclass TimezoneService {\r\n\tconstructor(appState) {\r\n\t\tthis.appState = appState;\r\n\t}\r\n\r\n\tgetConfiguredTimezoneCode(entity) {\r\n\t\tif(this.appState.forms.selected.TimeMode.Code === FORM_TIMEZONE_TYPES.ByEntity) {\r\n\t\t\tconst entityTimeZoneCode = (entity?.primary?.TimeZone || entity?.friendly?.TimeZone)?.Code;\r\n\t\t\tif(entityTimeZoneCode)\t\r\n\t\t\t\treturn ({ \r\n\t\t\t\t\texact: true,\r\n\t\t\t\t\tsource: FORM_TIMEZONE_TYPES.ByEntity,\r\n\t\t\t\t\ttimeZoneCode: entityTimeZoneCode,\r\n\t\t\t\t\ttimeZoneAbbr: this.getTimezoneByIANACode(entityTimeZoneCode).name\r\n\t\t\t\t});\r\n\t\t} else if(this.appState.forms.selected.TimeMode.Code == FORM_TIMEZONE_TYPES.ByUser) {\r\n\t\t\tconst userTimeZoneCode = moment.tz.guess();\r\n\t\t\tif(userTimeZoneCode)\t\r\n\t\t\t\treturn ({ \r\n\t\t\t\t\texact: true,\r\n\t\t\t\t\tsource: FORM_TIMEZONE_TYPES.ByUser,\r\n\t\t\t\t\ttimeZoneCode: userTimeZoneCode,\r\n\t\t\t\t\ttimeZoneAbbr: this.getTimezoneByIANACode(userTimeZoneCode).name\r\n\t\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn ({\r\n\t\t\texact: this.appState.forms.selected.TimeMode.Code === FORM_TIMEZONE_TYPES.ByForm,\r\n\t\t\tsource: FORM_TIMEZONE_TYPES.ByForm,\r\n\t\t\ttimeZoneCode: this.appState.forms.selected.TimeZone.Code,\r\n\t\t\ttimeZoneAbbr: this.getTimezoneByIANACode(this.appState.forms.selected.TimeZone.Code).name\r\n\t\t});\r\n\t}\r\n\r\n\tgetTimezoneByIANACode(code) {\r\n\t\tconst ianaTZ = find(TIME_ZONES, z => z.ianaCode === code);\r\n\t\treturn ianaTZ;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.timezone-service\", [])\r\n\t.service(\"timezoneService\", TimezoneService).name;\r\n","import {\r\n\tTRIGGER_TYPES,\r\n\tTRIGGER_OPERATOR_CODES,\r\n\tVALIDATION_OPERATORS\r\n} from \"screens/rule-provider/constants.js\";\r\nimport {\r\n\tfilter,\r\n\tfind,\r\n\tsome,\r\n\tuniqWith,\r\n\tremove,\r\n\tforEach,\r\n\tuniq\r\n} from \"lodash\";\r\nimport { REPORT_SCOPES } from \"constants.js\";\r\n\r\nclass validationService {\r\n\tconstructor($logger) {\r\n\t\tthis.hasPendingValidations = false;\r\n\t\tthis.$logger = $logger;\r\n\t}\r\n\r\n\tinit(formRules = [], formFields) {\r\n\t\tthis.formRules = formRules;\r\n\t\tthis.formFields = formFields;\r\n\t\tthis.ruleValidations = [];\r\n\r\n\t\tformRules.map((rule) => this.getRuleFields(rule));\r\n\t}\r\n\r\n\tupdateApiValidations(validations = []) {\r\n\t\tthis.findTriggeredRules(validations);\r\n\t\tthis.updateRuleValidations();\r\n\t}\r\n\r\n\tgetRuleById(id) {\r\n\t\tconst thisRule = find(this.formRules, r => r.Id === id);\r\n\r\n\t\treturn { ...thisRule };\r\n\t}\r\n\r\n\tupdateTriggeredRules(rules = [], scopes, detailId) {\r\n\t\tforEach(scopes, (scope) => {\r\n\t\t\tif(scope === REPORT_SCOPES.details || scope === REPORT_SCOPES.report || scope === REPORT_SCOPES.reportAndDetails) {\r\n\t\t\t\tremove(this.triggeredRules, (rule) => {\r\n\t\t\t\t\treturn rule.Scope.Code === scope;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tremove(this.triggeredRules, (rule) => {\r\n\t\t\t\t\treturn rule.DetailId === detailId && rule.Scope.Code === scope;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.triggeredRules = this.triggeredRules || [];\r\n\r\n\t\tthis.triggeredRules = this.triggeredRules.concat(rules);\r\n\t\tthis.triggeredRules = uniqWith(this.triggeredRules, (currRule, lastRule) => {\r\n\t\t\tlet isSameDetail = currRule.DetailId === lastRule.DetailId\r\n\t\t\t\t&& currRule.Id === lastRule.Id\r\n\t\t\t\t&& currRule.Scope.Code === lastRule.Scope.Code;\r\n\r\n\t\t\tif(currRule.DetailId === undefined && lastRule.DetailId === undefined\r\n\t\t\t\t&& currRule.DetailLinkKey !== undefined && lastRule.DetailLinkKey !== undefined) {\r\n\t\t\t\tisSameDetail = isSameDetail && (lastRule.DetailLinkKey === currRule.DetailLinkKey);\r\n\t\t\t}\r\n\r\n\t\t\treturn isSameDetail;\r\n\t\t});\r\n\r\n\t\tthis.triggeredRules.map((rule) => this.getRuleFields(rule));\r\n\t\tthis.updateRuleValidations();\r\n\t}\r\n\r\n\tgetRuleValidationsOfType(validationOperator, detailId) {\r\n\t\tconst type = {\r\n\t\t\t...find(this.ruleValidations,\r\n\t\t\t\t(v) => v.code === validationOperator\r\n\t\t\t)\r\n\t\t};\r\n\r\n\t\tconst pendingType = {\r\n\t\t\t...find(this.pendingValidations,\r\n\t\t\t\t(v) => v.code === validationOperator\r\n\t\t\t)\r\n\t\t};\r\n\r\n\t\tif(pendingType && pendingType.rules && pendingType.rules.length > 0) {\r\n\t\t\tconst combinedRules = (type?.rules || []).concat(pendingType.rules);\r\n\t\t\ttype.rules = uniqWith(combinedRules, (next, curr) => next.Id === curr.Id && next.DetailId === curr.DetailId && next.repeatId === curr.repeatId);\r\n\r\n\t\t\tif(detailId) {\r\n\t\t\t\ttype.rules = type.rules.filter(rule => rule.DetailId === detailId);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn type;\r\n\t}\r\n\r\n\tgetPendingValidationsOfType(validationOperator, detailId) {\r\n\t\tconst type = {\r\n\t\t\t...find(this.pendingValidations,\r\n\t\t\t\t(v) => v.code === validationOperator\r\n\t\t\t)\r\n\t\t};\r\n\r\n\t\tif(type && type.rules && type.rules.length > 0) {\r\n\t\t\ttype.rules = uniqWith(type.Rules, (next, curr) => next.Id === curr.Id && next.DetailId === curr.DetailId);\r\n\r\n\t\t\tif(detailId) {\r\n\t\t\t\ttype.rules = type.rules.filter(rule => rule.DetailId === detailId);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn type;\r\n\t}\r\n\r\n\tfindTriggeredRules(validations = []) {\r\n\t\tconst triggeredRules = validations.map((validation) => {\r\n\t\t\tconst ruleId = validation.Rule.Id;\r\n\r\n\t\t\tconst thisTriggeredRule = find(this.formRules, (formRule) => {\r\n\t\t\t\treturn formRule.Id === ruleId;\r\n\t\t\t});\r\n\r\n\t\t\tif(thisTriggeredRule) {\r\n\t\t\t\tconst newTriggeredRule = {\r\n\t\t\t\t\t...thisTriggeredRule,\r\n\t\t\t\t\tDetailId: validation.Detail && validation.Detail.Id,\r\n\t\t\t\t\tLinkKey: validation.Detail && validation.Detail.LinkKey\r\n\t\t\t\t};\r\n\t\t\t\treturn newTriggeredRule;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.triggeredRules = triggeredRules.filter((rule) => !!rule); //filter out undefined rules, which are probably rules that fired then were removed from the config\r\n\t}\r\n\r\n\tupdateRuleValidations() {\r\n\t\tthis.formFields.map((field) => {\r\n\t\t\tfield.hasValidationError = false;\r\n\t\t\tfield.hasValidationWarning = false;\r\n\t\t});\r\n\r\n\t\tthis.pendingValidations = VALIDATION_OPERATORS.map(o => {\r\n\t\t\treturn {\r\n\t\t\t\t...o,\r\n\t\t\t\trules: filter(this.triggeredRules, (r) => {\r\n\t\t\t\t\treturn some(r.Triggers, (t) =>\r\n\t\t\t\t\t\tt.Operator.Code == o.code &&\r\n\t\t\t\t\t\tt.Type.Code === TRIGGER_TYPES.validation\r\n\t\t\t\t\t);\r\n\t\t\t\t})\r\n\t\t\t};\r\n\t\t});\r\n\t\tthis.hasPendingValidations = true;\r\n\r\n\t\tthis.updateFieldHighlights();\r\n\t}\r\n\r\n\tupdateFieldHighlights(detailId) {\r\n\t\tconst self = this;\r\n\t\tif(this.pendingValidations.length > 0) {\r\n\t\t\tthis.pendingValidations.filter((scope) => scope.code === TRIGGER_OPERATOR_CODES.warning)[0].rules\r\n\t\t\t\t.map((rule) => {\r\n\t\t\t\t\tif(rule.Triggers && some(rule.Triggers, t => t.Operator.Code === TRIGGER_OPERATOR_CODES.highlight)) {\r\n\t\t\t\t\t\tconst highlightTriggers = filter(rule.Triggers, t => t.Operator.Code === TRIGGER_OPERATOR_CODES.highlight);\r\n\t\t\t\t\t\tconst conditionFields = findTriggerFields(rule, highlightTriggers);\r\n\t\t\t\t\t\tforEach(conditionFields, f => {\r\n\t\t\t\t\t\t\tapplyWarningValidation(f, rule);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\trule.appliedFieldIds.map((fieldId) => {\r\n\t\t\t\t\t\t\tconst conditionField = findConditionField(rule, fieldId);\r\n\t\t\t\t\t\t\tapplyWarningValidation(conditionField, rule);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\tthis.pendingValidations.filter((scope) => scope.code === TRIGGER_OPERATOR_CODES.blockSave)[0].rules\r\n\t\t\t\t.map((rule) => {\r\n\t\t\t\t\tif(rule.Triggers && some(rule.Triggers, t => t.Operator.Code === TRIGGER_OPERATOR_CODES.highlight)) {\r\n\t\t\t\t\t\tconst highlightTriggers = filter(rule.Triggers, t => t.Operator.Code === TRIGGER_OPERATOR_CODES.highlight);\r\n\t\t\t\t\t\tconst conditionFields = findTriggerFields(rule, highlightTriggers);\r\n\t\t\t\t\t\tforEach(conditionFields, f => {\r\n\t\t\t\t\t\t\tapplyErrorValidation(f, rule);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\trule.appliedFieldIds.map((fieldId) => {\r\n\t\t\t\t\t\t\tconst conditionField = findConditionField(rule, fieldId);\r\n\t\t\t\t\t\t\tapplyErrorValidation(conditionField, rule);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\tthis.pendingValidations.filter((scope) => scope.code === TRIGGER_OPERATOR_CODES.blockSubmit)[0].rules\r\n\t\t\t\t.map((rule) => {\r\n\t\t\t\t\tif(rule.Triggers && some(rule.Triggers, t => t.Operator.Code === TRIGGER_OPERATOR_CODES.highlight)) {\r\n\t\t\t\t\t\tconst highlightTriggers = filter(rule.Triggers, t => t.Operator.Code === TRIGGER_OPERATOR_CODES.highlight);\r\n\t\t\t\t\t\tconst conditionFields = findTriggerFields(rule, highlightTriggers);\r\n\t\t\t\t\t\tforEach(conditionFields, f => {\r\n\t\t\t\t\t\t\tapplyErrorValidation(f, rule);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\trule.appliedFieldIds.map((fieldId) => {\r\n\t\t\t\t\t\t\tconst conditionField = findConditionField(rule, fieldId);\r\n\t\t\t\t\t\t\tapplyErrorValidation(conditionField, rule);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction findConditionField(rule, fieldId) {\r\n\t\t\tconst checkDetailId = !!rule.DetailId;\r\n\t\t\tconst isRuleForDetail = (checkDetailId && rule.DetailId === detailId) || rule.Scope.Code === REPORT_SCOPES.reportAndDetails || rule.Scope.Code === REPORT_SCOPES.detail;\r\n\t\t\tconst conditionField = find(self.formFields, (field) => {\r\n\t\t\t\tconst isField = field.Id === fieldId;\r\n\t\t\t\tif(checkDetailId) {\r\n\t\t\t\t\treturn isField && isRuleForDetail;\r\n\t\t\t\t}\r\n\t\t\t\treturn isField;\r\n\t\t\t});\r\n\r\n\t\t\treturn conditionField;\r\n\t\t}\r\n\r\n\t\tfunction findTriggerFields(rule, highlightTriggers) {\r\n\t\t\tconst triggerFields = [];\r\n\t\t\tconst checkDetailId = !!rule.DetailId;\r\n\t\t\tconst isRuleForDetail = (checkDetailId && rule.DetailId === detailId) || rule.Scope.Code === REPORT_SCOPES.reportAndDetails;\r\n\r\n\t\t\tforEach(highlightTriggers, t => {\r\n\t\t\t\tif(isRuleForDetail || !checkDetailId) {\r\n\t\t\t\t\tconst triggerField = find(self.formFields, (field) => {\r\n\t\t\t\t\t\treturn field.Id === t.Field.Id;\r\n\t\t\t\t\t});\r\n\t\t\t\t\ttriggerFields.push(triggerField);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treturn triggerFields;\r\n\t\t}\r\n\r\n\t\tfunction applyErrorValidation(conditionField, rule) {\r\n\t\t\tconditionField && (conditionField.hasValidationError = true);\r\n\t\t\tif(conditionField && rule.repeatId) {\r\n\t\t\t\tconditionField.validationErrorRepeatIds = conditionField.validationErrorRepeatIds || [];\r\n\t\t\t\tconditionField.validationErrorRepeatIds.push(rule.repeatId);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction applyWarningValidation(conditionField, rule) {\r\n\t\t\tconditionField && (conditionField.hasValidationWarning = true);\r\n\t\t\tif(conditionField && rule.repeatId) {\r\n\t\t\t\tconditionField.validationWarningRepeatIds = conditionField.validationWarningRepeatIds || [];\r\n\t\t\t\tconditionField.validationWarningRepeatIds.push(rule.repeatId);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcommitValidations() {\r\n\t\tif(this.hasPendingValidations) {\r\n\t\t\tthis.ruleValidations = this.pendingValidations;\r\n\t\t}\r\n\t\telse if(this.ruleValidations === undefined) {\r\n\t\t\tthis.ruleValidations = [];\r\n\t\t}\r\n\t\tthis.clearPendingValidations();\r\n\t}\r\n\r\n\tclearPendingValidations() {\r\n\t\tthis.pendingValidations = [];\r\n\t\tthis.hasPendingValidations = false;\r\n\t}\r\n\r\n\tgetRuleFields(rule) {\r\n\t\tif(rule.Conditions) {\r\n\t\t\trule.appliedFieldIds = uniq(rule.Conditions\r\n\t\t\t\t.map((cond) => cond.Field?.Id)\r\n\t\t\t\t.filter(id => id !== undefined));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\trule.appliedFieldIds = uniq(rule.Children.map((child) => {\r\n\t\t\tthis.getRuleFields(child);\r\n\t\t\treturn child.appliedFieldIds;\r\n\t\t}).reduce((acc, curr) => acc.concat(curr)));\r\n\t}\r\n\r\n\tloadRulesForDetailModal(detailId) {\r\n\t\tthis.pendingValidations = this.ruleValidations;\r\n\t\tthis.hasPendingValidations = true;\r\n\t\tthis.updateFieldHighlights(detailId);\r\n\t}\r\n}\r\n\r\nclass validationServiceInstantiator {\r\n\tconstructor($logger) {\r\n\t\tthis.$logger = $logger;\r\n\t}\r\n\r\n\tgetNewValidationService() {\r\n\t\tthis.service = new validationService(this.$logger);\r\n\t\treturn this.service;\r\n\t}\r\n\r\n\tgetCurrentValidationService() {\r\n\t\treturn this.service;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.validation-service-factory\", [])\r\n\t.service(\"validationServiceFactory\", validationServiceInstantiator).name;\r\n","import {\r\n\tfind,\r\n\tsome\r\n} from \"lodash\";\r\nimport moment from \"moment-timezone\";\r\nimport { FORM_TIMEZONE_TYPES } from \"../constants\";\r\nimport {\r\n\tEDIT_REPORT,\r\n\tNEW_REPORT\r\n} from \"../routes\";\r\n\r\n\r\n//%*0115107629*Y19*SDO1039184?\r\nclass CardSwipeService {\r\n\tconstructor($uibModal, appState, reportHelper, auth, $state) {\r\n\t\tthis.$uibModal = $uibModal;\r\n\t\tthis.appState = appState;\r\n\t\tthis.reportHelper = reportHelper;\r\n\t\tthis.auth = auth;\r\n\t\tthis.$state = $state;\r\n\r\n\t\tthis.NEW_REPORT = NEW_REPORT;\r\n\t}\r\n\r\n\t$onInit() {\r\n\r\n\t}\r\n\r\n\tinitializeCardSwipe() {\r\n\t\tconst instance = this.$uibModal.open({\r\n\t\t\tcomponent: \"card-swipe-modal\",\r\n\t\t\tsize: \"md\",\r\n\t\t\tbackdrop: \"static\",\r\n\t\t\tresolve: {\r\n\t\t\t\tformConfig: () => this.appState.forms.selected\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tinstance.result\r\n\t\t\t.then((cardInfo) => {\r\n\t\t\t\tconst updates = this.createCardSwipeReport(cardInfo);\r\n\t\t\t\tthis.reportHelper.saveReport(updates).then((resp) => {\r\n\t\t\t\t\tthis.$state.go(EDIT_REPORT, { id: resp.Id });\r\n\t\t\t\t});\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.selectedDetail = undefined;\r\n\t\t\t\tthis.form.detailFields.map(f => f.isLocked = false);\r\n\t\t\t});\r\n\t}\r\n\r\n\tcreateCardSwipeReport(cardInfo) {\r\n\t\tconst updates = cardInfo.map(i => {\r\n\t\t\tconst update = {\r\n\t\t\t\tFieldId: i.fieldId,\r\n\t\t\t\tEntityId: i.value\r\n\t\t\t};\r\n\r\n\t\t\tif(i.isDetail) {\r\n\t\t\t\tupdate[\"DetailLinkKey\"] = this.auth.uuid();\r\n\t\t\t}\r\n\r\n\t\t\treturn update;\r\n\t\t});\r\n\r\n\t\tlet timeZone = null;\r\n\r\n\t\tif(this.appState.forms.selected.TimeMode.Code === FORM_TIMEZONE_TYPES.ByForm) {\r\n\t\t\ttimeZone = this.appState.forms.selected.TimeZone.Code;\r\n\t\t}\r\n\t\telse if(this.appState.forms.selected.TimeMode.Code === FORM_TIMEZONE_TYPES.ByEntity) {\r\n\t\t\tconst primaryEntityField = find(this.appState.forms.selected.Fields, (field) => {\r\n\t\t\t\treturn (field.Type.Code === \"ENTITY\" || field.Type.Code === \"ENTITYCONTACT\") && field.IsPrimary === true;\r\n\t\t\t});\r\n\t\t\tconst selectedPrimaryEntityValue = find(updates, u => u.FieldId === primaryEntityField.Id);\r\n\r\n\t\t\tif(selectedPrimaryEntityValue) {\r\n\t\t\t\tconst selectedPrimaryEntity = find(primaryEntityField, f => (f.Id === selectedPrimaryEntityValue.EntityId)\r\n\t\t\t\t\t|| (some(f.Entities, e => e.Entity.Id === selectedPrimaryEntityValue.EntityId)));\r\n\t\t\t\ttimeZone = selectedPrimaryEntity.TimeZone.Code;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet now = moment().startOf(\"day\")\r\n\t\t\t.local()\r\n\t\t\t.format();\r\n\r\n\t\tif(timeZone) {\r\n\t\t\tnow = moment().startOf(\"day\")\r\n\t\t\t\t.tz(timeZone)\r\n\t\t\t\t.format();\r\n\t\t}\r\n\r\n\t\tconst primaryDateField = find(this.appState.forms.selected.Fields, (field) => field.Template === \"Date\" && field.IsPrimary === true);\r\n\t\tupdates.push(\r\n\t\t\t{\r\n\t\t\t\tFieldId: primaryDateField.Id,\r\n\t\t\t\tDate: now\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\treturn updates;\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.card-swipe-service\", [])\r\n\t.service(\"cardSwipeService\", CardSwipeService).name;\r\n","import {\r\n\tfind,\r\n\tfilter,\r\n\tforEach,\r\n\tgroupBy\r\n} from \"lodash\";\r\nimport { FIELD_TEMPLATES } from \"constants.js\";\r\nimport {\r\n\tCONDITION_OPERATORS,\r\n\tENGINE_EVALUATIONS,\r\n\tENGINE_TYPES,\r\n\tEVALUATION_PREPARERS,\r\n\tOPERATOR_ACTIONS,\r\n\tAGGREGATION_ACTIONS\r\n} from \"../screens/rule-provider/constants.js\";\r\n\r\nconst trueShortCircuitEngines = [\r\n\tENGINE_TYPES.INTERSECT,\r\n\tENGINE_TYPES.CONTAINS,\r\n\tENGINE_TYPES.EXISTING\r\n];\r\n\r\nconst falseShortCircuitEngines = [\r\n\tENGINE_TYPES.CHANGE\r\n];\r\n\r\nclass RuleService {\r\n\tconstructor($logger, appState) {\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.appState = appState;\r\n\t}\r\n\r\n\tsetReportState(report) {\r\n\t\tthis.reportState = report;\r\n\t}\r\n\r\n\tprocessSingleRule(rule, currentValues, detailValuesById) {\r\n\t\tconst operatorAction = rule.IsNot === true \r\n\t\t\t? (...args) => !OPERATOR_ACTIONS[rule.Operator.Code](...args)\r\n\t\t\t: OPERATOR_ACTIONS[rule.Operator.Code];\r\n\r\n\t\tif(rule.Engine && rule.Conditions) {\r\n\t\t\tif(ENGINE_TYPES[rule.Engine.Code].isAggregate || ENGINE_TYPES[rule.Engine.Code].isConditionAggregate) {\r\n\t\t\t\tconst ac = this.evaluateAllConditions(rule, currentValues);\r\n\t\t\t\tconst postInverter = rule.IsNot === true ? !ac : ac;\r\n\t\t\t\treturn Promise.resolve(postInverter);\r\n\t\t\t}\r\n\r\n\t\t\tconst conditionEvaluations = rule.Conditions.map(condition => {\r\n\t\t\t\treturn this.evaluateCondition(rule, condition, currentValues);\r\n\t\t\t});\r\n\r\n\t\t\treturn Promise\r\n\t\t\t\t.all(conditionEvaluations)\r\n\t\t\t\t.then(\r\n\t\t\t\t\tvalidations => {\r\n\t\t\t\t\t\tconst result = operatorAction(validations);\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t});\r\n\t\t}\r\n\t\telse if(!!rule.Aggregation) {\r\n\t\t\tif(rule.Children === undefined) {\r\n\t\t\t\tthis.$logger.error(\"An aggregation operator was specified without child rules\", rule);\r\n\t\t\t}\r\n\r\n\t\t\tconst aggregationAction = AGGREGATION_ACTIONS[rule.Aggregation.Code];\r\n\t\t\tconst detailResults = [];\r\n\r\n\t\t\tObject.values(detailValuesById).forEach(comboVal => {\r\n\t\t\t\tconst detailId = comboVal[0].DetailId;\r\n\r\n\t\t\t\tconst ruleResult = this.handleChildEvaluations(rule, currentValues, detailValuesById, operatorAction)\r\n\t\t\t\t\t.then(result => ({ result, detailId }));\r\n\t\t\t\tdetailResults.push(ruleResult);\r\n\t\t\t});\r\n\r\n\t\t\treturn Promise.all(detailResults).then(results => {\r\n\t\t\t\tconst aggregatedResult = aggregationAction(results.map(r => r.result));\r\n\t\t\t\treturn aggregatedResult;\r\n\t\t\t});\r\n\t\t}\r\n\t\telse if(!!rule.Children) {\r\n\t\t\treturn this.handleChildEvaluations(rule, currentValues, detailValuesById, operatorAction);\r\n\t\t}\r\n\r\n\t\tthis.$logger.warn(`${rule.Title} (id: ${rule.Id}) has neither children nor conditions with an engine.`);\r\n\t\treturn new Promise(resolve => resolve(false));\r\n\t}\r\n\r\n\thandleChildEvaluations = (rule, values, allDetails, operatorAction) => {\r\n\t\tconst childrenEvaluations = rule.Children.map(childRule => this.processSingleRule(childRule, values, allDetails));\r\n\r\n\t\treturn Promise\r\n\t\t\t.all(childrenEvaluations)\r\n\t\t\t.then(validations => {\r\n\t\t\t\tconst result = operatorAction(validations);\r\n\t\t\t\treturn result;\r\n\t\t\t});\r\n\t}\r\n\r\n\tevaluateCondition(rule, condition, values = []) {\r\n\t\tif(trueShortCircuitEngines.indexOf(ENGINE_TYPES[rule.Engine.Code]) > -1)\r\n\t\t\treturn true;\r\n\r\n\t\telse if(falseShortCircuitEngines.indexOf(ENGINE_TYPES[rule.Engine.Code]) > -1) {\r\n\t\t\trule.compareValues = values.filter(value => value.FieldId === condition.Field.Id);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst { Field, CompareToField } = condition;\r\n\t\tconst templateField = Field && find(this.appState.forms.selected.Fields, { Id: Field.Id });\r\n\t\tconst Template = templateField?.Template;\r\n\r\n\t\tconst engineType = ENGINE_TYPES[rule.Engine.Code];\r\n\r\n\t\tif(!engineType) {\r\n\t\t\tthrow new Error(`${rule.Engine.Code} engine not found.`);\r\n\t\t}\r\n\r\n\t\tif(!Template && !engineType.isMetadataEngine) {\r\n\t\t\tthrow new Error(`Can not find field for Id: ${Field.Id}`);\r\n\t\t}\r\n\r\n\t\tif(!!engineType.isMetadataEngine && condition.Value === undefined) {\r\n\t\t\tthrow new Error(`Report state engine is missing a value: ${rule.Id}`);\r\n\t\t}\r\n\r\n\t\tconst fieldValues = engineType.isMetadataEngine ?\r\n\t\t\t[condition.Value] :\r\n\t\t\tfilter(values, (v) => v.FieldId === Field.Id || v.FieldId === (CompareToField || {}).Id);\r\n\r\n\t\tconst engine = ENGINE_EVALUATIONS[engineType.function];\r\n\r\n\t\tconst evaluator = (condition.Operator) ? engine[CONDITION_OPERATORS[condition.Operator.Code]]\r\n\t\t\t: engine.evaluate;\r\n\r\n\t\tconst templateName = engineType.isMetadataEngine ? \"Metadata\" : FIELD_TEMPLATES[Template];\r\n\r\n\t\tconst provider = EVALUATION_PREPARERS[templateName];\r\n\r\n\t\tif(!provider) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t`Can not find operators for template: ${Template}`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn provider(\r\n\t\t\tevaluator, \r\n\t\t\tcondition, \r\n\t\t\t{ \r\n\t\t\t\tform: this.appState.forms.selected, \r\n\t\t\t\treport: this.reportState, \r\n\t\t\t\tisOnline: window.navigator.onLine \r\n\t\t\t}, \r\n\t\t\tfieldValues\r\n\t\t);\r\n\t}\r\n\r\n\tevaluateAllConditions(rule, values) {\r\n\t\tif(trueShortCircuitEngines.indexOf(engineType) > -1)\r\n\t\t\treturn true;\r\n\r\n\t\telse if(falseShortCircuitEngines.indexOf(engineType) > -1) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst preparedValuesByDetailId = {};\r\n\r\n\t\tconst engineType = ENGINE_TYPES[rule.Engine.Code];\r\n\r\n\t\tif(!engineType) {\r\n\t\t\tthrow new Error(`${rule.Engine.Code} engine not found.`);\r\n\t\t}\r\n\r\n\t\tconst valuesByDetailId = groupBy(values, v => v.DetailId);\r\n\r\n\t\tObject.entries(valuesByDetailId).forEach(([key, valuesForDetail]) => {\r\n\t\t\tforEach(rule.Conditions, condition => {\r\n\t\t\t\tconst { Field, CompareToField } = condition;\r\n\t\t\t\tconst { Template } = find(this.appState.forms.selected.Fields, { Id: Field.Id });\r\n\t\r\n\t\t\t\tif(!Template) {\r\n\t\t\t\t\tthrow new Error(`Can not find field for Id: ${Field.Id}`);\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tconst fieldValues = filter(valuesForDetail, (v) => v.FieldId === Field.Id || v.FieldId === (CompareToField || {}).Id);\r\n\t\r\n\t\t\t\tconst provider = EVALUATION_PREPARERS[FIELD_TEMPLATES[Template]];\r\n\t\r\n\t\t\t\tif(!provider) {\r\n\t\t\t\t\tthrow new Error(\r\n\t\t\t\t\t\t`Can not find operators for template: ${Template}`\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(preparedValuesByDetailId[key] === undefined) {\r\n\t\t\t\t\tpreparedValuesByDetailId[key] = {};\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tpreparedValuesByDetailId[key][Field.Id] = fieldValues;\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tconst engine = ENGINE_EVALUATIONS[engineType.function];\r\n\t\treturn engine.evaluate(preparedValuesByDetailId, undefined, { form: this.appState.forms.selected, rule });\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.rule-service\", [])\r\n\t.service(\"ruleService\", RuleService).name;\r\n","import {\r\n\tuniqWith,\r\n\tevery,\r\n\tflatten,\r\n\tisEqual,\r\n\tsome,\r\n\tfind\r\n} from \"lodash\";\r\nimport { REPORT_SCOPES } from \"constants.js\";\r\nimport {\r\n\tENGINE_TYPES,\r\n\tTRIGGER_OPERATOR_CODES,\r\n\tTRIGGER_TYPES,\r\n\tUI_OPERATOR_TYPES\r\n} from \"../screens/rule-provider/constants.js\";\r\n\r\nclass RuleConfigService {\r\n\tconstructor($logger) {\r\n\t\tthis.$logger = $logger;\r\n\t}\r\n\r\n\treportScope(rule, fields) {\r\n\t\tconst evaluatees = this.evaluatedFieldIds(rule);\r\n\t\tif(evaluatees.length === 0) {\r\n\t\t\treturn REPORT_SCOPES.metadata;\r\n\t\t}\r\n\r\n\t\tconst scopes = evaluatees.map(f => {\r\n\t\t\tconst field = find(fields, m => m.Id == f);\r\n\t\t\tif(field.IsDetail)\r\n\t\t\t\treturn REPORT_SCOPES.details;\r\n\t\t\telse\r\n\t\t\t\treturn REPORT_SCOPES.report;\r\n\t\t});\r\n\r\n\t\tif(some(scopes, s => s == REPORT_SCOPES.report)) {\r\n\t\t\tif(some(scopes, s => s == REPORT_SCOPES.details))\r\n\t\t\t\treturn REPORT_SCOPES.reportAndDetails;\r\n\t\t\treturn REPORT_SCOPES.report;\r\n\t\t}\r\n\r\n\t\tif(this.isAggregate(rule)) {\r\n\t\t\treturn REPORT_SCOPES.details;\r\n\t\t}\r\n\r\n\t\treturn REPORT_SCOPES.detail;\r\n\t}\r\n\r\n\tvalidationScope(rule, fields) {\r\n\t\tif(!some(rule.Triggers, t => !!t.Operator && t.Operator.Code === TRIGGER_OPERATOR_CODES.highlight)) {\r\n\t\t\treturn rule.Scope.Code || this.reportScope(rule, fields).Code;\r\n\t\t}\r\n\r\n\t\tconst highlightTriggers = rule.Triggers.filter(t => !!t.Operator && t.Operator.Code === TRIGGER_OPERATOR_CODES.highlight);\r\n\t\tconst highlightTriggerFields = highlightTriggers.map(t => find(fields, f => f.Id === t.Field.Id));\r\n\r\n\t\tif(every(highlightTriggerFields, f => f.IsDetail)) {\r\n\t\t\tif(this.isAggregate(rule)) {\r\n\t\t\t\treturn REPORT_SCOPES.details;\r\n\t\t\t}\r\n\t\t\treturn REPORT_SCOPES.detail;\r\n\t\t}\r\n\t\tif(every(highlightTriggerFields, f => !f.IsDetail)) {\r\n\t\t\treturn REPORT_SCOPES.report;\r\n\t\t}\r\n\r\n\t\treturn REPORT_SCOPES.reportAndDetails;\r\n\t}\r\n\r\n\tgetVisibilityRuleScope(rule, fields) {\r\n\t\tconst visibilityTriggers = rule.Triggers.filter(t => !!t.Operator && (t.Operator.Code === TRIGGER_OPERATOR_CODES.visibility || t.Operator.Code === TRIGGER_OPERATOR_CODES.readonly));\r\n\r\n\t\tif(!visibilityTriggers?.length) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\tconst uxTriggerFields = visibilityTriggers\r\n\t\t\t.filter(t => t.Field?.Id !== undefined)\r\n\t\t\t.map(t => find(fields, f => f.Id === t.Field.Id));\r\n\r\n\t\tif(every(uxTriggerFields, f => f.IsDetail)) {\r\n\t\t\tif(this.isAggregate(rule)) {\r\n\t\t\t\treturn REPORT_SCOPES.details;\r\n\t\t\t}\r\n\t\t\treturn REPORT_SCOPES.detail;\r\n\t\t}\r\n\t\tif(every(uxTriggerFields, f => !f.IsDetail)) {\r\n\t\t\treturn REPORT_SCOPES.report;\r\n\t\t}\r\n\r\n\t\treturn REPORT_SCOPES.reportAndDetails;\r\n\t}\r\n\r\n\tevaluatedFieldIds(rule) {\r\n\t\tconst conditionFieldIds = this.evaluatedConditionFieldIds(rule);\r\n\t\tconst triggerFieldIds = this.evaluatedTriggerFieldIds(rule);\r\n\r\n\t\treturn uniqWith(conditionFieldIds.concat(triggerFieldIds), isEqual);\r\n\t}\r\n\r\n\tevaluatedConditionFieldIds(rule) {\r\n\t\tif(!rule.Conditions?.length && !rule.Children?.length) {\r\n\t\t\tthrow `There are no conditions or children associated with rule #${rule.id}.`;\r\n\t\t}\r\n\r\n\t\tif(rule.Conditions && rule.Conditions.length > 0) {\r\n\t\t\treturn uniqWith(flatten(rule.Conditions.map(c => {\r\n\t\t\t\tconst conditionFields = [];\r\n\t\t\t\tif(c.Field)\r\n\t\t\t\t\tconditionFields.push(c.Field.Id);\r\n\t\t\t\tif(c.CompareToField)\r\n\t\t\t\t\tconditionFields.push(c.CompareToField.Id);\r\n\t\t\t\treturn conditionFields;\r\n\t\t\t})), isEqual);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn uniqWith(flatten(rule.Children.map((c) => this.evaluatedConditionFieldIds(c))), isEqual);\r\n\t\t}\r\n\t}\r\n\r\n\tevaluatedTriggerFieldIds(rule) {\r\n\t\tlet triggerFieldIds = [];\r\n\t\tif(rule.Triggers && rule.Triggers.length > 0) {\r\n\t\t\ttriggerFieldIds = rule.Triggers\r\n\t\t\t\t.filter(t => t.Field?.Id !== undefined)\r\n\t\t\t\t.map(t => t.Field.Id);\r\n\t\t}\r\n\r\n\t\treturn triggerFieldIds;\r\n\t}\r\n\r\n\tisAggregate(rule) {\r\n\t\tif(rule.Children && rule.Children.length > 0) {\r\n\t\t\tfor(let i = 0; i < rule.Children.length; i++) {\r\n\t\t\t\tconst aggregated = this.isAggregate(rule.Children[i]);\r\n\t\t\t\tif(aggregated)\r\n\t\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(rule.Engine != null) {\r\n\t\t\treturn ENGINE_TYPES[rule.Engine.Code].isAggregate;\r\n\t\t}\r\n\r\n\t\tthrow `Rule ${rule.Id} with unspecified children or conditions.`;\r\n\t}\r\n\r\n\tapplyFunctionToAllChildRules(rule, updater) {\r\n\t\tif(rule.Children?.length) {\r\n\t\t\tfor(const child of rule.Children) {\r\n\t\t\t\tthis.applyFunctionToAllChildRules(child, updater);\r\n\t\t\t\tupdater(child);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tupdater(rule);\r\n\t}\r\n\r\n\tassignFieldOrders = (rule, fieldConfigs, conditionFieldIds) => {\r\n\t\tif(!!rule.Triggers?.length) {\r\n\t\t\trule.Triggers\r\n\t\t\t\t.filter(t => t.Type?.Code === TRIGGER_TYPES.userInterface && t.Operator?.Code === UI_OPERATOR_TYPES.filter)\r\n\t\t\t\t.forEach(t => {\r\n\t\t\t\t\tt.order = fieldConfigs.find(f => f.Id === t.Field.Id)?.Order;\r\n\t\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(!!conditionFieldIds?.length) {\r\n\t\t\tconst conditionFields = conditionFieldIds\r\n\t\t\t\t.map(id => {\r\n\t\t\t\t\tconst config = fieldConfigs.find(f => f.Id === id);\r\n\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tfieldId: id, \r\n\t\t\t\t\t\torder: config.Order\r\n\t\t\t\t\t};\r\n\t\t\t\t});\r\n\r\n\t\t\trule.conditionFields = [...conditionFields].sort((a, b) => a.order < b.order ? -1 : 1);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.rule-config-service\", [])\r\n\t.service(\"ruleConfigService\", RuleConfigService).name;\r\n","import { forEach } from \"lodash\";\r\nimport { \r\n\tEVENT_FILTER_ALL_OPTIONS, \r\n\tFIELD_TYPES\r\n} from \"constants.js\";\r\nimport {\r\n\tTRIGGER_TYPES,\r\n\tUI_OPERATOR_TYPES\r\n} from \"../screens/rule-provider/constants\";\r\nimport { getSeasonsByEffectiveRanges } from \"../utils/getSeasonsByEffectiveRanges\";\r\n\r\nfunction FilterService(eventBus, ruleService, appState, $logger) {\r\n\tconst ctrl = this;\r\n\r\n\tconst getFullItemValue = (fieldId, currentItem, parentItem, isEntityItem, currentDetailId) => {\r\n\t\tconst Classifications = [\r\n\t\t\t...(parentItem?.Classifications ?? []),\r\n\t\t\t...(parentItem?.Classification ? [parentItem.Classification] : []),\r\n\t\t\t...(currentItem?.Classifications ?? []),\r\n\t\t\t...(currentItem?.Classification ? [currentItem.Classification] : [])\r\n\t\t];\r\n\r\n\t\tconst Identifiers = (currentItem?.Identifiers || []).concat(parentItem?.Identifiers || []);\r\n\r\n\t\tconst itemValue = {\r\n\t\t\t...currentItem,\r\n\t\t\tFieldId: fieldId,\r\n\t\t\t_code: currentItem.Code, \r\n\t\t\tClassifications, \r\n\t\t\tIdentifiers,\r\n\t\t\tDetailId: currentDetailId\r\n\t\t};\r\n\t\t\r\n\t\tif(isEntityItem) {\r\n\t\t\tif(currentItem.Effective) {\r\n\t\t\t\titemValue.Seasons = getSeasonsByEffectiveRanges(currentItem.Effective, appState.forms.selected.Seasons);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\titemValue.Seasons = appState.forms.selected.Seasons;\r\n\t\t\t}\r\n\t\t\titemValue.EntityId = currentItem.Id;\r\n\t\t}\r\n\t\telse {\r\n\t\t\titemValue.DataId = currentItem.Id;\r\n\t\t}\r\n\r\n\t\treturn itemValue;\r\n\t};\r\n\r\n\tconst evaluateValueCombination = (rule, currentItem, reportValues) => {\r\n\t\tconst triggerAddedValues = [\r\n\t\t\t...reportValues,\r\n\t\t\tcurrentItem\r\n\t\t];\r\n\r\n\t\tconst ruleEval = ruleService.processSingleRule(rule, triggerAddedValues)\r\n\t\t\t.then(evaluated => {\r\n\t\t\t\tconst result = {\r\n\t\t\t\t\tevaluated,\r\n\t\t\t\t\tdataItemId: currentItem.Id\r\n\t\t\t\t};\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t});\r\n\r\n\t\treturn ruleEval;\r\n\t};\r\n\r\n\tctrl.executeFilterTriggers = (rules, currentValues, currentDetailId, conditionFieldId) => {\r\n\t\tforEach(rules, r => {\r\n\t\t\tconst ruleFilterTriggers = getOrderedRuleFilterTriggers(r, conditionFieldId);\r\n\t\t\tconst allDataItemFilters = [];\r\n\t\t\tconst allFilterFieldIds = [];\r\n\t\t\t\r\n\t\t\truleFilterTriggers.forEach(t => {\r\n\t\t\t\tconst isEntityTriggerField = t.Field.Type.Code === FIELD_TYPES.entity || t.Field.Type.Code === FIELD_TYPES.entityContact;\r\n\t\t\t\tconst paramValues = [\r\n\t\t\t\t\t...currentValues\r\n\t\t\t\t];\r\n\r\n\t\t\t\tconst triggerRemovedValues = paramValues.filter(v => v.FieldId !== t.Field.Id);\r\n\t\t\t\t\r\n\t\t\t\tallFilterFieldIds.push(t.Field.Id);\r\n\t\t\t\tforEach(t.Field.Data, d => {\r\n\t\t\t\t\tif(d.Entities) {\r\n\t\t\t\t\t\td.Entities.forEach(e => {\r\n\t\t\t\t\t\t\tconst entityItem = getFullItemValue(t.Field.Id, e.Entity, d, isEntityTriggerField, currentDetailId);\r\n\t\t\t\t\t\t\tconst ruleEval = evaluateValueCombination(r, entityItem, triggerRemovedValues)\r\n\t\t\t\t\t\t\t\t.then(result => ({ result, fieldId: t.Field.Id }));\r\n\t\t\t\t\t\t\tallDataItemFilters.push(ruleEval); \r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tconst item = getFullItemValue(t.Field.Id, d, undefined, isEntityTriggerField, currentDetailId);\r\n\t\t\t\t\t\tconst ruleEval = evaluateValueCombination(r, item, triggerRemovedValues)\r\n\t\t\t\t\t\t\t.then(result => ({ result, fieldId: t.Field.Id }));\r\n\t\t\t\t\t\tallDataItemFilters.push(ruleEval); \r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tPromise.all(allDataItemFilters)\r\n\t\t\t\t.then(evals => {\r\n\t\t\t\t\tconst trueEvaluations = Object.values(evals)\r\n\t\t\t\t\t\t.reduce((acc, e) => {\r\n\t\t\t\t\t\t\tif(acc[e.fieldId] === undefined) {\r\n\t\t\t\t\t\t\t\tacc[e.fieldId] = {\r\n\t\t\t\t\t\t\t\t\tfieldId: e.fieldId,\r\n\t\t\t\t\t\t\t\t\tdataItemIds: []\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(e.result.evaluated) {\r\n\t\t\t\t\t\t\t\tacc[e.fieldId].dataItemIds.push(e.result.dataItemId);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn acc;\r\n\t\t\t\t\t\t}, {});\r\n\r\n\t\t\t\t\tObject.values(trueEvaluations).forEach(e => {\r\n\t\t\t\t\t\teventBus.trigger(EVENT_FILTER_ALL_OPTIONS(e.fieldId), { ids: e.dataItemIds });\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t});\r\n\t};\r\n\r\n\tfunction getOrderedRuleFilterTriggers(rule, triggeringFieldId) {\r\n\t\tif(rule.Triggers && rule.Triggers.length > 0) {\r\n\t\t\tconst filterTriggers = rule.Triggers.filter(t => \r\n\t\t\t\tt.Type?.Code === TRIGGER_TYPES.userInterface \r\n\t\t\t\t\t&& t.Operator?.Code === UI_OPERATOR_TYPES.filter\r\n\t\t\t\t\t&& (triggeringFieldId === undefined || t.Field?.Id !== triggeringFieldId)\r\n\t\t\t);\r\n\r\n\t\t\tconst orderedTriggers = [...filterTriggers].sort((a, b) => a.order < b.order ? -1 : 1);\r\n\r\n\t\t\treturn orderedTriggers;\r\n\t\t}\r\n\t\treturn [];\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.filter-service\", [])\r\n\t.service(\"filterService\", FilterService).name;\r\n","import { \r\n\tmerge, \r\n\tset \r\n} from \"lodash\";\r\n\r\nimport {\r\n\tComponentTranslationBundle, \r\n\ti18NextJson, \r\n\tLanguageSpecifier \r\n} from \"../i18nService\";\r\n\r\ntype AgencyTypeDto = {\r\n Code: string;\r\n Name: string;\r\n Translations?: ComponentTranslationBundle;\r\n}\r\n\r\ntype FormDto = {\r\n Name: string;\r\n\tAgency: {\r\n\t\tTypes: AgencyTypeDto[];\r\n\t}\r\n nomenclature: Record;\r\n Nomenclature: Record;\r\n Translations?: ComponentTranslationBundle;\r\n}\r\n\r\nconst nomenclatureTranslationKeyMap = {\r\n\t\"PositiveReport\": \"reporting.types.POSITIVE.name\",\r\n\t\"NegativeReport\": \"reporting.types.NEGATIVE.name\",\r\n\t\"ReportFooter\": \"reporting.types.POSITIVE.footer\",\r\n\t\"PrimaryEntity\": \"meta.primary.entity.name\",\r\n\t\"PrimaryDate\": \"meta.primary.date.name\",\r\n\t\"FormUseAcceptance\": \"meta.acceptance\",\r\n\t\"SupportEmail\": \"feedback.email\",\r\n\t\"SupportNumber\": \"feedback.phoneNumber\",\r\n\t\"SupportMarkdown\": \"feedback.markdown\",\r\n\t\"FORM.REPORTING.POSITIVE\": \"reporting.types.POSITIVE.name\",\r\n\t\"FORM.REPORTING.NEGATIVE\": \"reporting.types.NEGATIVE.name\",\r\n\t\"FORM.REPORTING.FOOTER\": \"reporting.types.POSITIVE.footer\",\r\n\t\"FORM.PRIMARY.ENTITY\": \"meta.primary.entity.name\",\r\n\t\"FORM.PRIMARY.DATE\": \"meta.primary.date.name\",\r\n\t\"FORM.ACCEPTANCE\": \"meta.acceptance\",\r\n\t\"FORM.SUPPORT.EMAIL\": \"feedback.email\",\r\n\t\"FORM.SUPPORT.PHONE\": \"feedback.phoneNumber\",\r\n\t\"FORM.SUPPORT.MARKDOWN\": \"feedback.markdown\"\r\n};\r\n\r\nexport const buildFormTranslations = (\r\n\tform: FormDto,\r\n\tlanguage: LanguageSpecifier,\r\n\tisDefault: boolean\r\n): i18NextJson => {\r\n\t//we want to construct an object that looks like this:\r\n\t/*\r\n\t\t{\r\n\t\t\t\"name\": \"Form Name\" : from the FormDto.translations,\r\n\t\t\t\"types\": {\r\n\t\t\t\t\"CODE\": {\r\n\t\t\t\t\t\"name\": \"Type Code\" : from the AgencyTypeDto.translations if defined, else type.Name\r\n\t\t\t\t\t//should use the getTypeTranslations function\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t*/\r\n\r\n\tconst nomenclatureTranslations = mapNomenclatureToTranslations({\r\n\t\t...form.nomenclature,\r\n\t\t...form.Nomenclature\r\n\t});\r\n\t\r\n\tconst typesTranslations = getTypesTranslations(form, language, isDefault);\r\n\tconst translations: Record = merge(\r\n\t\t{},\r\n\t\t(isDefault ? {\r\n\t\t\tname: form.Name\r\n\t\t} : {}),\r\n\t\tnomenclatureTranslations,\r\n\t\t(form.Translations?.[language] ?? {}),\r\n\t\ttypesTranslations\r\n\t);\r\n\t\r\n\t//now, some of the trannslations keys may be stringified object representations\r\n\t//similar to types.DEALER.{ \"code\": \"something\" }\r\n\t//we need to convert this to an actual object\r\n\t//we do also have access to lodash, so we can probably use that:\r\n\t\r\n\tconst filtered = Object.entries(translations)\r\n\t\t.filter(([key, value]) => !key.includes(\".\") || !!value)\r\n\t\t.map(e => e[0]);\r\n\t\r\n\tconst final = {};\r\n\tfor(const key of filtered) {\r\n\t\tset(final, key, translations[key]);\r\n\t}\r\n\r\n\treturn final;\r\n};\r\n\r\nconst mapNomenclatureToTranslations = (nomenclature: Record): Record => {\r\n\tconst translations = Object.entries(nomenclatureTranslationKeyMap).reduce((acc, [nextKey, nextVal]) => {\r\n\t\tif(nomenclature[nextKey] !== undefined) {\r\n\t\t\tacc[nextVal] = (nomenclature[nextKey] as { text: string }).text ?? nomenclature[nextKey];\r\n\t\t}\r\n\r\n\t\treturn acc;\r\n\t}, {});\r\n\r\n\treturn translations;\r\n};\r\n\t\r\nconst getTypesTranslations = (\r\n\tform: FormDto,\r\n\tlanguage: LanguageSpecifier,\r\n\tisDefault: boolean\r\n) => {\r\n\tconst typeTranslations = Object.values(form.Agency.Types)\r\n\t\t.reduce((acc, type) => {\r\n\t\t\tconst translations = getTypeTranslations(type, language, isDefault);\r\n\t\r\n\t\t\tif(translations) {\r\n\t\t\t\tacc[getTypeKeyPrefix(type)] = translations;\r\n\t\t\t}\r\n\t\r\n\t\t\treturn acc;\r\n\t\t}, {} as Record>);\r\n\t\r\n\treturn typeTranslations;\r\n};\r\n\t\r\nconst getTypeKeyPrefix = (type: string | AgencyTypeDto) => {\r\n\treturn `types.${typeof type === \"string\" ? type : type.Code}`;\r\n};\r\n\t\r\nconst getTypeTranslations = (\r\n\ttype: AgencyTypeDto,\r\n\tlanguage: LanguageSpecifier,\r\n\tisDefault: boolean\r\n) => {\r\n\t//we want to construct an object that looks like this:\r\n\t/*\r\n\t\t{\r\n\t\t\t\"name\": \"Type Code\" : from the AgencyTypeDto.translations if defined, else type.Name\r\n\t\t}\r\n\t\t*/\r\n\t\r\n\tif(!type.Translations?.[language] && !isDefault) {\r\n\t\treturn undefined;\r\n\t}\r\n\t\r\n\treturn merge(\r\n\t\t{}, \r\n\t\t(isDefault ? {\r\n\t\t\tName: type.Name,\r\n\t\t\tLabels: {\r\n\t\t\t\tName: type.Name,\r\n\t\t\t\tCode: `${type.Name} #`,\r\n\t\t\t\tExternalKey: \"External Key\",\r\n\t\t\t\tClassification: \"Classification\",\r\n\t\t\t\tExternalKey_other: \"External Keys\",\r\n\t\t\t\tClassification_other: \"Classifications\"\r\n\t\t\t}\r\n\t\t} : undefined),\r\n\t\t(type.Translations?.[language] ?? {})\r\n\t);\r\n};\r\n","import { buildFormTranslations } from \"./buildFormTranslations\";\r\n\r\nfunction FormService(\r\n) {\r\n\tconst service = this;\r\n\r\n\tservice.buildFormTranslations = buildFormTranslations;\r\n\r\n\treturn service;\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.form-service\", [])\r\n\t.service(\"formService\", FormService).name;","import { find } from \"lodash\";\r\nimport { NOMENCLATURE } from \"constants.js\";\r\n\r\nfunction FormsService(\r\n\tapi,\r\n\t$window,\r\n\t$userProfile, \r\n\tappState\r\n) {\r\n\tconst service = this;\r\n\r\n\tservice.getForms = getForms;\r\n\r\n\tfunction setNomenclature(forms) {\r\n\t\tforms.map(form => {\r\n\t\t\tform.nomenclature = {};\r\n\r\n\t\t\tfor(const key in NOMENCLATURE) {\r\n\t\t\t\tconst item = find(form.Nomenclature, { Code: NOMENCLATURE[key] });\r\n\r\n\t\t\t\tform.nomenclature[key] = (item || {}).Text;\r\n\t\t\t}\r\n\r\n\t\t\tform.Nomenclature = undefined;\r\n\t\t});\r\n\t}\r\n\r\n\tgetForms.loading = null;\r\n\r\n\tfunction getForms() {\r\n\t\tconst forms = angular.fromJson($window.sessionStorage.getItem(\"forms\"));\r\n\r\n\t\tif(forms && forms.length) {\r\n\t\t\tappState.forms.items = forms;\r\n\r\n\t\t\tlet form = find(forms, { selected: true });\r\n\r\n\t\t\tform = form || forms[0];\r\n\r\n\t\t\treturn appState.forms.select(form);\r\n\t\t}\r\n\r\n\t\tgetForms.loading = api.get(\"api/forms\").then(\r\n\t\t\tresponse => {\r\n\t\t\t\tgetForms.loading = null;\r\n\r\n\t\t\t\tconst thisUserProfile = $userProfile.getUserProfile();\r\n\r\n\t\t\t\tconst form = find(response, { Id: thisUserProfile.formId }) || response[0];\r\n\r\n\t\t\t\tif(response.length >= 1) {\r\n\t\t\t\t\t$window.sessionStorage.setItem(\"forms\", angular.toJson(response));\r\n\t\t\t\t\tappState.forms.items = response;\r\n\t\t\t\t\tsetNomenclature(appState.forms.items);\r\n\r\n\t\t\t\t\treturn appState.forms.select(form);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn response;\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\treturn getForms.loading;\r\n\t}\r\n\r\n\treturn service;\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.forms-service\", [])\r\n\t.service(\"formsService\", FormsService).name;","import { forEach } from \"lodash\";\r\nimport * as configcat from \"configcat-js\";\r\n\r\nfunction FeatureFlagService(config, $userProfile) {\r\n\tconst service = this;\r\n\tconst featureValues = {};\r\n\tlet featureFlagClient = null;\r\n\tlet initPromise = null;\r\n\tlet featuresLoaded = false;\r\n\r\n\tthis.FEATURES = {\r\n\t\tComplianceTimeline: \"vesl_web_compliance_newtimeline\",\r\n\t\tActionInfoBlock: \"vesl_web_action_status_block\",\r\n\t\tMessaging: \"vesl_web_messaging\",\r\n\t\tieNotification: \"vesl_web_ie_notification\"\r\n\t};\r\n\r\n\tfunction initialize() {\r\n\t\tfeatureFlagClient = configcat.createClientWithManualPoll(config.configCat);\r\n\r\n\t\tinitPromise = featureFlagClient.forceRefreshAsync()\r\n\t\t\t.then(() => {\r\n\t\t\t\tforEach(service.FEATURES, (f) => {\r\n\t\t\t\t\tfeatureValues[f] = false;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tinitPromise.complete = true;\r\n\t\t\t});\r\n\r\n\t\treturn initPromise;\r\n\t}\r\n\r\n\tthis.loadFeaturesForCurrentUser = loadFeaturesForCurrentUser;\r\n\tfunction loadFeaturesForCurrentUser() {\r\n\t\tif(initPromise.complete === true) {\r\n\t\t\treturn loadFeatures();\r\n\t\t}\r\n\r\n\t\treturn initPromise.then(() => loadFeatures());\r\n\t}\r\n\r\n\tfunction loadFeatures() {\r\n\t\tif(featuresLoaded !== true) {\r\n\t\t\tconst featurePromises = [];\r\n\r\n\t\t\tforEach(service.FEATURES, (f) => {\r\n\t\t\t\tconst featurePromise = getFeatureValue(f)\r\n\t\t\t\t\t.then((val) => {\r\n\t\t\t\t\t\tfeatureValues[f] = val;\r\n\t\t\t\t\t});\r\n\t\t\t\tfeaturePromises.push(featurePromise);\r\n\t\t\t});\r\n\r\n\t\t\treturn Promise.all(featurePromises)\r\n\t\t\t\t.then(() => { featuresLoaded = true; });\r\n\t\t}\r\n\r\n\t\treturn new Promise(resolve => resolve());\r\n\t}\r\n\r\n\tthis.getFeature = (featureName) => {\r\n\t\treturn featureValues[featureName];\r\n\t};\r\n\r\n\tfunction getFeatureValue(featureName) {\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tconst userId = ((($userProfile.getUserProfile() || {}).user || {}).user || {}).userId;\r\n\t\t\tif(userId === null || userId === undefined) {\r\n\t\t\t\treject(\"No user id found in profile service\");\r\n\t\t\t}\r\n\r\n\t\t\tconst userObject = { identifier: userId };\r\n\r\n\t\t\tfeatureFlagClient.getValue(featureName, false, value => {\r\n\t\t\t\tresolve(value);\r\n\t\t\t}, userObject);\r\n\t\t});\r\n\t}\r\n\r\n\tthis.clearFeatures = clearFeatures;\r\n\tfunction clearFeatures() {\r\n\t\tforEach(service.FEATURES, (f) => {\r\n\t\t\tfeatureValues[f] = false;\r\n\t\t});\r\n\t\tfeaturesLoaded = false;\r\n\t}\r\n\r\n\tinitialize();\r\n\treturn service;\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.feature-flags\", [])\r\n\t.service(\"$featureFlags\", FeatureFlagService).name;\r\n","const deps = [];\r\n\r\nfunction UserProfile(\r\n\t$window\r\n) {\r\n\tconst service = this;\r\n\r\n\tservice.setUserProfile = setUserProfile;\r\n\tservice.getUserProfile = getUserProfile;\r\n\tservice.setUser = setUser;\r\n\tservice.clear = clear;\r\n\tservice.getUser = getUser;\r\n\r\n\tfunction setUser(user) {\r\n\t\tservice.user = user;\r\n\t}\r\n\r\n\tfunction clear() {\r\n\t\tservice.user = null;\r\n\t\tservice.allProfiles = null;\r\n\t}\r\n\r\n\tfunction getUser() {\r\n\t\treturn service.user;\r\n\t}\r\n\r\n\tfunction setUserProfile(profile) {\r\n\t\tif(service.user && service.user.userId) {\r\n\t\t\tservice.allProfiles[service.user.userId] = profile;\r\n\t\t\t$window.localStorage.setItem(\"profile\", angular.toJson(service.allProfiles));\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getUserProfile() {\r\n\t\tif(service.user && service.user.userId) {\r\n\t\t\tif(!service.allProfiles) {\r\n\t\t\t\tservice.allProfiles = angular.fromJson($window.localStorage.getItem(\"profile\")) || {};\r\n\t\t\t\t$window.localStorage.setItem(\"profile\", angular.toJson(service.allProfiles));\r\n\t\t\t}\r\n\r\n\t\t\tif(!service.allProfiles[service.user.userId]) {\r\n\t\t\t\tservice.allProfiles[service.user.userId] = {};\r\n\t\t\t\t$window.localStorage.setItem(\"profile\", angular.toJson(service.allProfiles));\r\n\t\t\t}\r\n\r\n\t\t\tconst thisUserId = service.user.userId;\r\n\t\t\treturn service.allProfiles[thisUserId];\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn service;\r\n}\r\nexport default angular\r\n\t.module(\"vesl.services.user-profile\", deps)\r\n\t.service(\"$userProfile\", UserProfile).name;\r\n","import { UserManager } from \"oidc-client\";\r\nimport { config } from \"../config/index\";\r\nimport { openIdCallbackSuffix } from \"constants.js\";\r\nimport swal from \"sweetalert2\";\r\n\r\nconst baseUrl = `${location.protocol}//${location.hostname}${(location.port ? \":\" + location.port : \"\")}`;\r\nconst oidcSettings = {\r\n\tauthority: config.ssoUrl,\r\n\tclient_id: \"vesl-web\",\r\n\tredirect_uri: `${baseUrl}${openIdCallbackSuffix}`,\r\n\tsilent_redirect_uri: `${baseUrl}/assets/silent.html`,\r\n\tpost_logout_redirect_uri: baseUrl,\r\n\tresponse_type: \"id_token token\",\r\n\tscope: \"openid profile email api\",\r\n\tautomaticSilentRenew: true\r\n};\r\n\r\nclass OpenIdService {\r\n\tconstructor($state, $window, $logger) {\r\n\t\tthis.$window = $window;\r\n\t\tthis.$state = $state;\r\n\t\tthis.$logger = $logger;\r\n\r\n\t\tthis.oidcProvider = new UserManager(oidcSettings);\r\n\t\twindow.vesl.logout = () => this.oidcProvider.signoutRedirect();\r\n\r\n\t\tthis.oidcProvider.events.addSilentRenewError((e) => {\r\n\t\t\t$logger.exception(e, \"Session renewal error\");\r\n\r\n\t\t\tif(e.error == \"login_required\")\r\n\t\t\t\treturn this.oidcProvider.signoutRedirect();\r\n\t\t\telse\r\n\t\t\t\tthis.renewError();\r\n\t\t});\r\n\r\n\t\tthis.oidcProvider.clearStaleState();\r\n\t}\r\n\r\n\tlogout = () => {\r\n\t\treturn this.oidcProvider.signoutRedirect();\r\n\t}\r\n\r\n\trenewError = async() => {\r\n\t\ttry\t{\r\n\t\t\tawait swal.fire({\r\n\t\t\t\ttitle: \"Are you offline?\",\r\n\t\t\t\thtml: `You appear to be offline, or a connection could not be made.\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\tClick below to try again.`,\r\n\t\t\t\tshowCloseButton: false,\r\n\t\t\t\ttype: \"warning\",\r\n\t\t\t\tshowCancelButton: false,\r\n\t\t\t\tconfirmButtonColor: \"#8CC541\",\r\n\t\t\t\tconfirmButtonText: \"Retry\",\r\n\t\t\t\tallowOutsideClick: false,\r\n\t\t\t\tallowEscapeKey: false,\r\n\t\t\t\tshowLoaderOnConfirm: true,\r\n\t\t\t\tpreConfirm: async() => {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tawait this.oidcProvider.signinSilent();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}catch{ \r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}catch(e) {\r\n\t\t\tthis.$logger.exception(e, \"An uncaught error occurred during session-retry\");\r\n\r\n\t\t\treturn this.oidcProvider.signoutRedirect();\r\n\t\t}\r\n\t}\r\n\r\n\tgetUserManager = () => this.oidcProvider;\r\n\r\n\tgetAccessToken = () => this.oidcProvider.getUser().then(user => ((user || {}).access_token || \"\"));\r\n\r\n\tsetFromRoute = (routeName, routeParams) => {\r\n\t\tconst fromRoute = JSON.stringify({ name: routeName, params: routeParams });\r\n\r\n\t\tthis.$window.localStorage.setItem(\"loginFromRoute\", fromRoute);\r\n\t}\r\n\r\n\tgetFromRoute = () => {\r\n\t\tconst fromRouteJSON = this.$window.localStorage.getItem(\"loginFromRoute\");\r\n\t\treturn JSON.parse(fromRouteJSON);\r\n\t};\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.open-id-service\", [])\r\n\t.service(\"openIdService\", OpenIdService).name;\r\n","import {\r\n\tkeyBy,\r\n\tfind\r\n} from \"lodash\";\r\nimport {\r\n\tCONDITION_OPERATORS,\r\n\tENGINE_TYPES,\r\n\tENGINE_EVALUATIONS,\r\n\tTRIGGER_OPERATOR_CODES\r\n} from \"../screens/rule-provider/constants.js\";\r\n\r\nclass RuleValidator {\r\n\tconstructor($logger, triggerMethods, ruleConfigService) {\r\n\t\tthis.$logger = $logger;\r\n\t\tthis.triggerMethods = triggerMethods;\r\n\t\tthis.ruleConfigService = ruleConfigService;\r\n\t}\r\n\r\n\tcheckRuleForPresenceOfChildrenOrEngine = (rule) => {\r\n\t\tif(\r\n\t\t\t(!!rule.Conditions && !!rule.Children)\r\n\t\t\t|| (!!rule.Engine && !!rule.Children && !!rule.Conditions)\r\n\t\t) {\r\n\t\t\tthis.$logger.error(`Rule Id ${rule.Id} has an invalid combination of Engine, Conditions, and Children. Removing rule.`, {\r\n\t\t\t\trule\r\n\t\t\t});\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(!rule.Engine && !rule.Conditions && !rule.Children) {\r\n\t\t\tthis.$logger.error(`Rule Id ${rule.Id} has none of Engine, Conditions, nor Children. Removing rule.`, {\r\n\t\t\t\trule\r\n\t\t\t});\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(!rule.Children && (!!rule.Engine !== !!rule.Conditions?.length)) {\r\n\t\t\tthis.$logger.error(`Rule Id ${rule.Id} has an engine without conditions or conditions without an engine. Removing rule.`, {\r\n\t\t\t\trule,\r\n\t\t\t\tchildren: !!rule.Children,\r\n\t\t\t\tengine: !!rule.Engine,\r\n\t\t\t\tconditions: !!rule.Conditions?.length\r\n\t\t\t});\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\r\n\tcheckRuleForValidEngineAndEvaluation = (rule) => {\r\n\t\tif(!!rule.Children) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif(!rule.Engine || !ENGINE_TYPES[rule.Engine.Code]) {\r\n\t\t\tthis.$logger.error(`Rule Id ${rule.Id} uses unimplemented Engine ${rule.Engine.Code}. Removing rule.`, { rule });\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tconst engineFuncName = ENGINE_TYPES[rule.Engine.Code].function;\r\n\t\tconst validConditions = rule.Conditions.every(c => {\r\n\t\t\tconst thisConditionOperator = c.Operator?.Code ? CONDITION_OPERATORS[c.Operator?.Code] : \"evaluate\";\r\n\t\t\treturn !!ENGINE_EVALUATIONS[engineFuncName]?.[thisConditionOperator];\r\n\t\t});\r\n\t\t\r\n\t\tif(!validConditions) {\r\n\t\t\tthis.$logger.error(`Rule Id ${rule.Id} uses an invalid engine/condition combination. Removing rule.`, { rule });\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t};\r\n\r\n\tcheckRuleForValidFields = (fields) => (rule) => {\r\n\t\tconst evaluatees = this.ruleConfigService.evaluatedFieldIds(rule);\r\n\t\treturn evaluatees.every(e => {\r\n\t\t\tconst field = find(fields, m => m.Id == e);\r\n\t\t\tif(field === undefined) {\r\n\t\t\t\tthis.$logger.error(`Rule Id ${rule.Id} references a field that is not on the current form. Removing rule.`, {\r\n\t\t\t\t\trule, \r\n\t\t\t\t\tinvalidFieldId: e\r\n\t\t\t\t});\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\t};\r\n\r\n\tcheckRuleForValidTriggers = (rule) => {\r\n\t\tif(!rule.Triggers?.length) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst validTriggerOperators = keyBy(Object.values(TRIGGER_OPERATOR_CODES));\r\n\t\tconst hasValidTriggers = rule.Triggers.every(t => !!validTriggerOperators[t.Operator.Code]);\r\n\t\tif(!hasValidTriggers) {\r\n\t\t\tthis.$logger.error(`Rule Id ${rule.Id} uses an invalid trigger operator. Removing rule.`, { rule });\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t};\r\n\r\n\tvalidateRule = (rule, validators) => {\r\n\t\tlet isValid = true;\r\n\t\tif(rule.Children) {\r\n\t\t\tisValid = rule.Children.every(c => this.validateRule(c, validators));\r\n\t\t}\r\n\t\tif(isValid) {\r\n\t\t\treturn validators.every(v => v(rule)); \r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\r\n\tfilterToValidRules(rules = [], fields = []) {\r\n\t\tconst validators = [\r\n\t\t\tthis.checkRuleForPresenceOfChildrenOrEngine,\r\n\t\t\tthis.checkRuleForValidEngineAndEvaluation,\r\n\t\t\tthis.checkRuleForValidTriggers,\r\n\t\t\tthis.checkRuleForValidFields(fields)\r\n\t\t];\r\n\r\n\t\treturn rules.filter(r => this.validateRule(r, validators));\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.rule-validator\", [])\r\n\t.service(\"ruleValidator\", RuleValidator).name;\r\n","import {\r\n\tACCOUNT_NOTICE_READ, \r\n\tFORM_NOTICES \r\n} from \"../routes\";\r\n\r\nfunction NoticeService(\r\n\tapi,\r\n\t$logger\r\n) {\r\n\tconst service = this;\r\n\tservice.notices = [];\r\n\tservice.hasUnreadNotices = false;\r\n\r\n\tservice.isNoticeValid = (notice) => {\r\n\t\tconst now = new Date();\r\n\t\tconst noticeBegin = notice.BeginInclusive !== undefined ? new Date(notice.BeginInclusive) : undefined;\r\n\t\tconst noticeEnd = notice.EndExclusive !== undefined ? new Date(notice.EndExclusive) : undefined;\r\n\t\t\r\n\t\tconst isNoticeStarted = noticeBegin === undefined || noticeBegin <= now;\r\n\t\tconst isNoticeExpired = noticeEnd !== undefined && noticeEnd < now;\r\n\r\n\t\treturn isNoticeStarted && !isNoticeExpired;\r\n\t};\r\n\r\n\tservice.showNoticeUnread = (notice) => {\r\n\t\tif(notice.Read === undefined) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(notice.Interval === undefined) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tconst now = new Date();\r\n\t\tconst lastRead = new Date(notice.Read);\r\n\t\tconst [hours, minutes, seconds] = notice.Interval.split(\":\").map(part => parseInt(part, 10));\r\n\t\tconst totalDurationInSeconds = seconds + (minutes *60) + (hours*60*60);\r\n\r\n\t\tconst resetAt = new Date(lastRead.getTime() + (totalDurationInSeconds * 1000));\r\n\r\n\t\treturn resetAt < now; \r\n\t};\r\n\r\n\tservice.getNotices = (formId) => {\r\n\t\treturn api.get(FORM_NOTICES(formId)).then(notices => {\r\n\t\t\tservice.notices = notices.sort((a, b) => a.Id > b.Id ? -1 : 1);\r\n\t\t\tservice.hasUnreadNotices = notices.some(n => {\r\n\t\t\t\treturn service.showNoticeUnread(n);\r\n\t\t\t});\r\n\r\n\t\t\treturn service.notices;\r\n\t\t});\t\r\n\t};\r\n\r\n\tservice.readNotice = (noticeId) => {\r\n\t\treturn api.post(ACCOUNT_NOTICE_READ(noticeId))\r\n\t\t\t.then((resp) => {\r\n\t\t\t\tconst noticeIndex = service.notices.findIndex(n => n.Id === noticeId);\r\n\r\n\t\t\t\tservice.notices = [...service.notices];\r\n\t\t\t\tservice.notices[noticeIndex] = {\r\n\t\t\t\t\t...service.notices[noticeIndex], \r\n\t\t\t\t\tRead: resp.Read\r\n\t\t\t\t};\r\n\t\t\t\tservice.hasUnreadNotices = service.notices.some(n => n.Read === undefined);\r\n\t\t\t});\r\n\t};\r\n\r\n\tservice.readAllNotices = () => {\r\n\t\tconst unreadNotices = service.notices.filter(n => n.Read === undefined);\r\n\r\n\t\tconst allRead = unreadNotices.map(n => {\r\n\t\t\treturn api.post(ACCOUNT_NOTICE_READ(n.Id));\r\n\t\t});\r\n\r\n\t\treturn Promise.all(allRead).then(allResp => {\r\n\t\t\tservice.notices = [...service.notices];\r\n\t\t\tallResp.forEach(r => {\r\n\t\t\t\tconst thisNotice = service.notices.find(n => n.Id === r.Notice.Id);\r\n\t\t\t\tthisNotice.Read = r.Read;\r\n\t\t\t});\r\n\t\t\tservice.hasUnreadNotices = false;\r\n\t\t});\r\n\t};\r\n\r\n\treturn service;\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.notice-service\", [])\r\n\t.service(\"noticeService\", NoticeService).name;","import {\r\n\tGlob, \r\n\tIGlob \r\n} from \"../glob\";\r\n\r\nexport const SecurityActionEffects = {\r\n\tAllow: \"Allow\" as const,\r\n\tDeny: \"Deny\" as const\r\n};\r\n\r\nexport type SecurityActionEffect = typeof SecurityActionEffects[keyof typeof SecurityActionEffects]\r\n\r\nexport interface ISecurityAction {\r\n\tEffect: SecurityActionEffect;\r\n\tPath: string;\r\n}\r\n\r\nexport class ActionAdapter\r\n{\r\n\tprivate readonly $action: ISecurityAction;\r\n\tprivate readonly $glob: IGlob;\r\n\r\n\tconstructor(action: ISecurityAction) {\r\n\t\tthis.$action = action;\r\n\t\tthis.$glob = new Glob(action.Path);\r\n\t}\r\n\r\n\tget path(): string {\r\n\t\treturn this.$action.Path;\r\n\t}\r\n\r\n\tget glob(): IGlob {\r\n\t\treturn this.$glob;\r\n\t}\r\n\r\n\tget effect(): SecurityActionEffect {\r\n\t\treturn this.$action.Effect;\r\n\t}\r\n\r\n\tisMatch = (path: string) => this.glob.isMatch(path);\r\n\r\n\tisCongruent = (pathOrGlob: string | IGlob) => {\r\n\t\treturn this.glob.isCongruent(pathOrGlob);\r\n\t};\r\n}\r\n","import {\r\n\tAction,\r\n\tActionScope,\r\n\tPattern\r\n} from \"../actionScopes\";\r\nimport {\r\n\tActionAdapter, \r\n\tSecurityActionEffects \r\n} from \"./actionAdapter\";\r\n\r\nexport class ActionsAdapter implements Iterable {\r\n\tprivate readonly $actions: ActionAdapter[];\r\n\r\n\tconstructor(actions: ActionAdapter[]) {\r\n\t\tthis.$actions = actions;\r\n\t}\r\n\r\n\t[Symbol.iterator](): Iterator {\r\n\t\treturn this.$actions[Symbol.iterator]();\r\n\t}\r\n\r\n\thasSubpath = (subpath: string) => {\r\n\t\treturn this.$actions.some(a => a.path.startsWith(subpath));\r\n\t}\r\n\r\n\tisAllowed(check: ActionScope | Action) {\r\n\t\tif((check as ActionScope)?.check) {\r\n\t\t\t//type is either iactionscope base, or more specifically Action\r\n\t\t\tif(!(check as Action)?.action) {\r\n\t\t\t\treturn (check).check(this);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//unwrap to get to the inner action\r\n\t\tconst action = (check).action;\r\n\r\n\t\tlet isAllowed = false;\r\n\t\tfor(const adapter of this.$actions) {\r\n\t\t\tif(!adapter.isMatch(action))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif(adapter.effect === SecurityActionEffects.Deny)\r\n\t\t\t\treturn false;\r\n\r\n\t\t\tisAllowed = adapter.effect === SecurityActionEffects.Allow;\r\n\t\t}\r\n\r\n\t\treturn isAllowed;\r\n\t}\r\n\r\n\thasCongruency(pattern: Pattern) {\r\n\t\tlet isAllowed = false;\r\n\r\n\t\tfor(const action of this.$actions) {\r\n\t\t\tif(!isAllowed && action.effect == SecurityActionEffects.Allow && action.isCongruent(pattern.pattern))\r\n\t\t\t\tisAllowed = true;\r\n\t\t\telse if(action.isMatch(pattern.pattern.path) && action.effect == SecurityActionEffects.Deny)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn isAllowed;\r\n\t}\r\n\r\n\tadd(other: ActionsAdapter) {\r\n\t\treturn new ActionsAdapter(this.$actions.concat(other.$actions));\r\n\t}\r\n\r\n\treduce() {\r\n\t\tconst denies = this.$actions.filter(a => a.effect == SecurityActionEffects.Deny);\r\n\r\n\t\tlet effective = this.$actions.filter(a => a.effect == SecurityActionEffects.Allow);\r\n\r\n\t\tfor(const deny of denies) {\r\n\t\t\teffective = effective.filter(e => !deny.isMatch(e.path));\r\n\t\t}\r\n\r\n\t\treturn new ActionsAdapter(effective.concat(denies));\r\n\t}\r\n}\r\n","import * as angular from \"angular\";\r\nimport { \r\n\tActionAdapter, \r\n\tActionsAdapter \r\n} from \"./adapters\";\r\nimport { \r\n\tAction, \r\n\tActionOrPattern, \r\n\tActionScope, \r\n\tPattern \r\n} from \"./actionScopes\";\r\n\r\nclass SecurityService {\r\n\tprivate $logger;\r\n\tprivate $appState;\r\n\tprivate securityActions: ActionsAdapter;\r\n\r\n\tconstructor($logger) {\r\n\t\tthis.$logger = $logger;\r\n\t}\r\n\r\n\tpublic init = (securityBlob: any) => {\r\n\t\tconst formSecurity = securityBlob;\r\n\t\t\r\n\t\tconst selectedRoleCode = formSecurity.Assigned?.[0]?.Code;\r\n\t\tconst selectedRole = selectedRoleCode && formSecurity.Roles.find(r => r.Code == selectedRoleCode);\r\n\r\n\t\tif(!selectedRole) {\r\n\t\t\tthis.securityActions = new ActionsAdapter([]);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst formActionAdapters = selectedRole.Actions.map(a => new ActionAdapter(a));\r\n\r\n\t\tthis.securityActions = new ActionsAdapter(formActionAdapters).reduce();\r\n\t}\r\n\r\n\tpublic isActionAllowed = (action: string) => {\r\n\t\treturn this.securityActions.isAllowed(new Action(action));\r\n\t};\r\n\r\n\tpublic isPatternAllowed = (pattern: string) => {\r\n\t\treturn this.securityActions.isAllowed(new Pattern(pattern));\r\n\t};\r\n\r\n\tpublic isActionOrPatternAllowed = (actionOrPattern: string) => {\r\n\t\treturn this.securityActions.isAllowed(new ActionOrPattern(actionOrPattern));\r\n\t};\r\n\r\n\tpublic isActionScopeAllowed = (actionScope: ActionScope) => {\r\n\t\treturn this.securityActions.isAllowed(actionScope);\r\n\t};\r\n\r\n\tpublic hasApplicablePermission = (action: string) => {\r\n\t\treturn this.securityActions.hasSubpath(action);\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.security-service\", [])\r\n\t.service(\"securityService\", SecurityService).name;","import { EVENT_PAGE_LOADED } from \"constants.js\";\r\n\r\nexport class InitializationService {\r\n\tconstructor(eventBus, $rootScope) {\r\n\t\tthis.pageLoaded = false;\r\n\t\tthis.actions = [];\r\n\r\n\t\teventBus.register(EVENT_PAGE_LOADED, () => {\r\n\t\t\tthis.pageLoaded = true;\r\n\t\t\tthis.actions.forEach(action => action());\r\n\t\t\tthis.actions = [];\r\n\t\t}, $rootScope);\r\n\t}\r\n\r\n\tisPageLoaded() {\r\n\t\treturn this.pageLoaded;\r\n\t}\r\n\r\n\trunWhenPageLoaded(action) {\r\n\t\tif(this.pageLoaded) {\r\n\t\t\taction();\r\n\t\t} else {\r\n\t\t\tthis.actions.push(action);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default angular\r\n\t.module(\"vesl.services.initialization\", [])\r\n\t.service(\"initializationService\", InitializationService)\r\n\t.name;","import api from \"./api.js\";\r\nimport appState from \"./app-state.js\";\r\nimport auth from \"./auth.js\";\r\nimport dataloader from \"./dataloader.js\";\r\nimport dynamicComponent from \"./dynamic-component.js\";\r\nimport eventBus from \"./event-bus.js\";\r\nimport featureCallbacks from \"./feature-callbacks.js\";\r\nimport featureHelper from \"./feature-helper.js\";\r\nimport intervalService from \"./interval-service.js\";\r\nimport loadingService from \"./loading-service.js\";\r\nimport logger from \"./logging.js\";\r\nimport mapHelpers from \"./map-helpers.js\";\r\nimport messagingService from \"./messaging-service\";\r\nimport reportHelper from \"./report-helper\";\r\nimport detailHelper from \"./detail-helper\";\r\nimport tableHelper from \"./table-helper\";\r\nimport uiHelpers from \"./ui-helpers\";\r\nimport timezone from \"./timezone-service\";\r\nimport validationService from \"./validation-service.js\";\r\nimport cardSwipeService from \"./card-swipe-service.js\";\r\nimport entityManager from \"./entity-manager\";\r\nimport ruleService from \"./rule-service\";\r\nimport ruleConfigService from \"./rule-config-service.js\";\r\nimport filterService from \"./filter-service\";\r\nimport formService from \"./formService/formService.js\";\r\nimport formsService from \"./formService/formsService.js\";\r\nimport featureFlags from \"./feature-flags\";\r\nimport userProfileSvc from \"./user-profile\";\r\nimport openIdService from \"./oidcService\";\r\nimport ruleValidator from \"./rule-validator\";\r\nimport noticeService from \"./noticeService.js\";\r\nimport securityService from \"./security/index.ts\";\r\nimport initializationService from \"./initialization-service.js\";\r\n\r\nconst deps = [\r\n\tapi,\r\n\tappState,\r\n\tauth,\r\n\tcardSwipeService,\r\n\tdataloader,\r\n\tdetailHelper,\r\n\tdynamicComponent,\r\n\tentityManager,\r\n\teventBus,\r\n\tfeatureCallbacks,\r\n\tfeatureFlags,\r\n\tfeatureHelper,\r\n\tintervalService,\r\n\tloadingService,\r\n\tlogger,\r\n\tmapHelpers,\r\n\tmessagingService,\r\n\topenIdService,\r\n\treportHelper,\r\n\truleService,\r\n\truleConfigService,\r\n\tfilterService,\r\n\ttableHelper,\r\n\ttimezone,\r\n\tuiHelpers,\r\n\tvalidationService,\r\n\tuserProfileSvc, \r\n\truleValidator,\r\n\tformService,\r\n\tformsService,\r\n\tnoticeService, \r\n\tsecurityService,\r\n\tinitializationService\r\n];\r\n\r\nexport default angular.module(\"vesl.services\", deps).name;\r\n","// style\r\nimport \"./less/app.less\";\r\nimport \"material-design-iconic-font/dist/css/material-design-iconic-font.min.css\";\r\nimport \"angular-toastr/dist/angular-toastr.min.css\";\r\nimport \"angular-hotkeys/build/hotkeys.css\";\r\nimport \"ui-select/dist/select.min.css\";\r\nimport \"sweetalert2/dist/sweetalert2.min.css\";\r\nimport \"index.less\";\r\nimport \"choices.js/assets/styles/css/choices.min.css\";\r\n\r\n// npm\r\nimport \"core-js\";\r\nimport \"regenerator-runtime/runtime\";\r\nimport * as angular from \"angular\";\r\n\r\nimport angularToastr from \"angular-toastr\";\r\nimport uiSelect from \"ui-select\";\r\nimport focusIf from \"ng-focus-if\";\r\nimport uibs from \"angular-ui-bootstrap\";\r\nimport \"@iamadamjowett/angular-click-outside\";\r\n\r\nimport \"angular-data-grid/dist/dataGrid.min.js\";\r\nimport \"angular-data-grid/dist/pagination.min.js\";\r\nimport \"angular-promise-tracker\";\r\nimport \"angular-base64/angular-base64.min.js\";\r\n\r\nimport \"object-assign-shim\";\r\nimport \"angular-schema-form\";\r\nimport \"angular-schema-form-bootstrap\";\r\nimport \"angular-json-tree\";\r\nimport \"angular-messages\";\r\nimport clipboard from \"angular-clipboard\";\r\n\r\nimport \"./utils\";\r\n\r\nimport layout from \"./layout/index.js\";\r\n\r\n// config\r\nimport config from \"./config/index.js\";\r\n\r\nimport behaviors from \"./behaviors/index.js\";\r\nimport components from \"./components/index.js\";\r\nimport filters from \"./filters/index.js\";\r\nimport screens from \"./screens/screens.js\";\r\nimport services from \"./services/index.js\";\r\n\r\nimport bootstrapper from \"./bootstrapper.ts\";\r\n\r\nconst deps = [\r\n\t\"ajoslin.promise-tracker\",\r\n\t\"dataGrid\",\r\n\t\"pagination\",\r\n\t\"base64\",\r\n\tuibs,\r\n\tangularToastr,\r\n\tuiSelect,\r\n\tfocusIf,\r\n\tlayout,\r\n\tconfig,\r\n\tservices,\r\n\tscreens,\r\n\tcomponents,\r\n\tbehaviors,\r\n\tfilters,\r\n\t\"angular-click-outside\",\r\n\t\"schemaForm\",\r\n\t\"angular-json-tree\" ,\r\n\tclipboard.name\r\n];\r\n\r\nangular.module(\"vesl\", deps).run(bootstrapper);\r\n\r\nangular.bootstrap(document, [\"vesl\"]);","import { I18NextContext } from \"./services/i18nService\";\r\n\r\nconst timePickerTemplate = `\r\n \t
    \r\n\t
    \r\n`;\r\n\r\nexport default function bootstrapper(\r\n\t$rootScope,\r\n\t$templateCache,\r\n\tuiState,\r\n\tconfig,\r\n\t$logger\r\n) {\r\n\t$rootScope.uiState = uiState;\r\n\r\n\t$templateCache.put(\"time-picker-template.html\", timePickerTemplate);\r\n\r\n\tI18NextContext.Instance.init($logger);\r\n}\r\n"],"sourceRoot":""}