@hmcts/opal-frontend-common 0.0.67 → 0.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +54 -8
- package/package.json +71 -38
- package/styles/styles.scss +10 -14
- package/types/package.json +4 -0
- package/components/abstract/abstract-nested-form-base/README.md +0 -89
- package/components/abstract/abstract-table-filter/README.md +0 -76
- package/components/govuk/govuk-tabs/govuk-tabs-list-item/README.md +0 -74
- package/components/govuk/govuk-tabs/govuk-tabs-panel/README.md +0 -52
- package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-header/README.md +0 -43
- package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-option/README.md +0 -81
- package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-option/moj-filter-panel-option-form-group-item/README.md +0 -53
- package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-option/moj-filter-panel-option-form-group-keyword/README.md +0 -59
- package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-selected/README.md +0 -55
- package/components/moj/moj-filter/moj-filter-panel/moj-filter-panel-selected/moj-filter-panel-selected-tag/README.md +0 -52
- package/fesm2022/hmcts-opal-frontend-common-access-denied.component-B14ZVnte.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-account-created.component-DMjRN8Y1.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-parent-base.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-parent-base.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-nested-form-base.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-types.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-tab-data.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter-types.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-back-link.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-button.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-details.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-footer-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-footer.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption-types.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-inset-text.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-notification-banner.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-panel.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-table.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-panel.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tag.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-task-list.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-helpers.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-badge.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-header.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-item.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-keyword.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected-moj-filter-panel-selected-tag.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-inset-text.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-notification-badge.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-page-header.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-ticket-panel.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-timeline.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-concurrency-failure.component-CQS1DbQQ.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-constants.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-directives-moj-multi-select.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-account.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-auth.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-can-deactivate-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-can-deactivate-types.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-can-deactivate.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-has-flow-state.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-has-url-state-match.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-helpers.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-route-permissions.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-signed-in.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-types.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-interceptors-http-error-constants.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-interceptors-http-error-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-interceptors-http-error.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-internal-server-error.component-lCp06yT-.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-access-denied.component-B14ZVnte.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-account-created.component-DMjRN8Y1.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-concurrency-failure.component-CQS1DbQQ.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-dashboard-page-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-dashboard-page.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-internal-server-error.component-lCp06yT-.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-permission-denied.component-DYa3iGTj.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-routing-constants.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-routing-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in-stub.component-B87UHy9K.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in.component-Ctc9YosM.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-permission-denied.component-DYa3iGTj.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pipes-date-format.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pipes-monetary.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-app-initializer-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-app-insights-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service-constants.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-date-service-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-date-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service-mocks.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-opal-user-service-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-opal-user-service-mocks.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-opal-user-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-session-service-constants.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-session-service-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-session-service-mocks.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-sort-service-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service-mocks.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service-constants.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-services-utils-service.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-sign-in-stub.component-B87UHy9K.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-sign-in.component-BjLHMHMm.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-stores-global-constants.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-stores-global-interfaces.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-stores-global-types.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-stores-global.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-types.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-amount.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-date-after-year.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-date-before.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-date-of-birth.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-future-date.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-invalid-value.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-national-insurance-number.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-optional-max-length.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-optional-valid-date.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-optional-valid-telephone.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-over-eighteen.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-past-date.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-pattern-validator.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-valid-value.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common.mjs.map +0 -1
- package/guards/has-url-state-match/README.md +0 -160
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-pages-sign-in.component-Ctc9YosM.mjs","sources":["../../../projects/opal-frontend-common/pages/sign-in/sign-in.component.ts","../../../projects/opal-frontend-common/pages/sign-in/sign-in.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { SignInStubComponent } from './sign-in-stub/sign-in-stub.component';\nimport { ISignInStubForm } from './interfaces/sign-in-stub-form.interface';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { SSO_ENDPOINTS } from '@hmcts/opal-frontend-common/services/auth-service/constants';\n\n@Component({\n selector: 'opal-lib-sign-in',\n imports: [SignInStubComponent],\n templateUrl: './sign-in.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SignInComponent {\n private readonly document = inject(DOCUMENT);\n\n public readonly globalStore = inject(GlobalStore);\n public ssoEnabled: boolean | null = true;\n\n /**\n * Handles the submission of the stub sign-in form.\n * Redirects the user to the SSO login page with the provided email.\n * @param formData - The form data containing the email.\n */\n public handleStubSignInFormSubmit(formData: ISignInStubForm): void {\n this.document.location.href = `${SSO_ENDPOINTS.login}?email=${formData.email}`;\n }\n}\n","@defer (when !globalStore.ssoEnabled()) {\n <opal-lib-sign-in-stub (signInFormSubmit)=\"handleStubSignInFormSubmit($event)\"></opal-lib-sign-in-stub>\n}\n"],"names":[],"mappings":";;;;;;MAaa,eAAe,CAAA;AACT,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAE5B,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IAC1C,UAAU,GAAmB,IAAI;AAExC;;;;AAIG;AACI,IAAA,0BAA0B,CAAC,QAAyB,EAAA;AACzD,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAA,EAAG,aAAa,CAAC,KAAK,CAAA,OAAA,EAAU,QAAQ,CAAC,KAAK,EAAE;IAChF;uGAbW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,4ECb5B,6JAGA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,sBAAA,EAAA,CAAA,MAAA,CAAA,OAAA,wEAAA,CAAA,CAAA,IAAA,CAAA,CAAA,IAAA,CAAA,CAAA,mBAAA,CAAA,CAAA,CAAA,EAAA,CAAA;;gGDUa,eAAe,EAAA,mBAAA,EAAA,MAAA,CAAA,OAAA,wEAAA,CAAA,CAAA,IAAA,CAAA,CAAA,IAAA,CAAA,CAAA,mBAAA,CAAA,CAAA,EAAA,eAAA,EAAA,mBAAA,KAAA,EAAA,UAAA,EAAA,CAAA;sBAN3B,SAAS;AACE,gBAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,WACnB,CAAC,mBAAmB,CAAC,EAAA,eAAA,EAEb,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,6JAAA,EAAA;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-pages.mjs","sources":["../../../projects/opal-frontend-common/pages/routing/pages.routes.ts","../../../projects/opal-frontend-common/pages/hmcts-opal-frontend-common-pages.ts"],"sourcesContent":["import { Routes } from '@angular/router';\nimport { PAGES_ROUTING_TITLES, PAGES_ROUTING_PATHS } from '@hmcts/opal-frontend-common/pages/routing/constants';\nimport { authGuard } from '@hmcts/opal-frontend-common/guards/auth';\nimport { signedInGuard } from '@hmcts/opal-frontend-common/guards/signed-in';\nimport { TitleResolver } from '@hmcts/opal-frontend-common/resolvers/title';\nimport { accountGuard } from '@hmcts/opal-frontend-common/guards/account';\n\nexport const routing: Routes = [\n { path: '', redirectTo: 'dashboard', pathMatch: 'full' },\n {\n path: PAGES_ROUTING_PATHS.children.accessDenied,\n loadComponent: () => import('../access-denied/access-denied.component').then((c) => c.AccessDeniedComponent),\n canActivate: [authGuard, accountGuard],\n data: { title: PAGES_ROUTING_TITLES.children.accessDenied },\n resolve: { title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.concurrencyFailure,\n loadComponent: () =>\n import('../concurrency-failure/concurrency-failure.component').then((c) => c.ConcurrencyFailureComponent),\n data: { title: PAGES_ROUTING_TITLES.children.concurrencyFailure },\n resolve: { title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.permissionDenied,\n loadComponent: () =>\n import('../permission-denied/permission-denied.component').then((c) => c.PermissionDeniedComponent),\n data: { title: PAGES_ROUTING_TITLES.children.permissionDenied },\n resolve: { title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.internalServerError,\n loadComponent: () =>\n import('../internal-server-error/internal-server-error.component').then((c) => c.InternalServerErrorComponent),\n data: { title: PAGES_ROUTING_TITLES.children.internalServerError },\n resolve: { title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.signIn,\n loadComponent: () => import('../sign-in/sign-in.component').then((c) => c.SignInComponent),\n canActivate: [signedInGuard],\n data: { title: PAGES_ROUTING_TITLES.children.signIn },\n resolve: { title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.accountCreated,\n loadComponent: () => import('../account-created/account-created.component').then((c) => c.AccountCreated),\n canActivate: [authGuard],\n data: { title: PAGES_ROUTING_TITLES.children.accountCreated },\n resolve: { title: TitleResolver },\n },\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,OAAO,GAAW;IAC7B,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE;AACxD,IAAA;AACE,QAAA,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,YAAY;AAC/C,QAAA,aAAa,EAAE,MAAM,OAAO,yEAA0C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC;AAC5G,QAAA,WAAW,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC;QACtC,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,YAAY,EAAE;AAC3D,QAAA,OAAO,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;AAClC,K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EAAE,oBAAoB,CAAC,QAAQ,CAAC,MAAM,EAAE;AACrD,QAAA,OAAO,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;AAClC,KAAA;AACD,IAAA;AACE,QAAA,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,cAAc;AACjD,QAAA,aAAa,EAAE,MAAM,OAAO,2EAA8C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC;QACzG,WAAW,EAAE,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,cAAc,EAAE;AAC7D,QAAA,OAAO,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;AAClC,KAAA;;;AClDH;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-permission-denied.component-DYa3iGTj.mjs","sources":["../../../projects/opal-frontend-common/pages/permission-denied/permission-denied.component.ts","../../../projects/opal-frontend-common/pages/permission-denied/permission-denied.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-permission-denied',\n standalone: true,\n imports: [],\n templateUrl: './permission-denied.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PermissionDeniedComponent {}\n","<div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-l\">You do not have permission for this</h1>\n <p class=\"govuk-body\">This may be because:</p>\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>the account is outside your business unit and some features are restricted</li>\n <li>you are not permitted to use this feature</li>\n </ul>\n <p class=\"govuk-body\">If you think this is incorrect, contact your line manager.</p>\n</div>\n"],"names":[],"mappings":";;;MASa,yBAAyB,CAAA;uGAAzB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,sFCTtC,0dASA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDAa,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAPrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,4BAA4B,cAC1B,IAAI,EAAA,OAAA,EACP,EAAE,EAAA,eAAA,EAEM,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,0dAAA,EAAA;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-pipes-date-format.mjs","sources":["../../../projects/opal-frontend-common/pipes/date-format/date-format.pipe.ts","../../../projects/opal-frontend-common/pipes/date-format/hmcts-opal-frontend-common-pipes-date-format.ts"],"sourcesContent":["import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { DateService } from '@hmcts/opal-frontend-common/services/date-service';\n\n@Pipe({\n name: 'dateFormat',\n standalone: true,\n})\nexport class DateFormatPipe implements PipeTransform {\n private readonly dateService = inject(DateService);\n\n transform(value: string | null | undefined, inputFormat: string, outputFormat: string): string {\n if (!value) return '—';\n\n const formatted = this.dateService.getFromFormatToFormat(value, inputFormat, outputFormat);\n\n return formatted;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,cAAc,CAAA;AACR,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAElD,IAAA,SAAS,CAAC,KAAgC,EAAE,WAAmB,EAAE,YAAoB,EAAA;AACnF,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,GAAG;AAEtB,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,CAAC;AAE1F,QAAA,OAAO,SAAS;IAClB;uGATW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,YAAY;AAClB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-pipes-days-ago.mjs","sources":["../../../projects/opal-frontend-common/pipes/days-ago/days-ago.pipe.ts","../../../projects/opal-frontend-common/pipes/days-ago/hmcts-opal-frontend-common-pipes-days-ago.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'daysAgo',\n standalone: true,\n})\nexport class DaysAgoPipe implements PipeTransform {\n transform(value: number): string {\n if (value === 0) {\n return 'Today';\n } else if (value === 1) {\n return '1 day ago';\n } else if (value === -1) {\n return 'Tomorrow';\n } else if (value > 1) {\n return `${value} days ago`;\n } else if (value < -1) {\n return `In ${Math.abs(value)} days`;\n } else {\n return 'Invalid date';\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,WAAW,CAAA;AACtB,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACf,YAAA,OAAO,OAAO;QAChB;AAAO,aAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACtB,YAAA,OAAO,WAAW;QACpB;AAAO,aAAA,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;AACvB,YAAA,OAAO,UAAU;QACnB;AAAO,aAAA,IAAI,KAAK,GAAG,CAAC,EAAE;YACpB,OAAO,CAAA,EAAG,KAAK,CAAA,SAAA,CAAW;QAC5B;AAAO,aAAA,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;YACrB,OAAO,CAAA,GAAA,EAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO;QACrC;aAAO;AACL,YAAA,OAAO,cAAc;QACvB;IACF;uGAfW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,SAAS;AACf,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-pipes-monetary.mjs","sources":["../../../projects/opal-frontend-common/pipes/monetary/monetary.pipe.ts","../../../projects/opal-frontend-common/pipes/monetary/hmcts-opal-frontend-common-pipes-monetary.ts"],"sourcesContent":["import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { UtilsService } from '@hmcts/opal-frontend-common/services/utils-service';\n\n@Pipe({\n name: 'monetary',\n standalone: true,\n})\nexport class MonetaryPipe implements PipeTransform {\n private readonly utilsService = inject(UtilsService);\n\n transform(value: number | string): string {\n return this.utilsService.convertToMonetaryString(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,YAAY,CAAA;AACN,IAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AAEpD,IAAA,SAAS,CAAC,KAAsB,EAAA;QAC9B,OAAO,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,KAAK,CAAC;IACzD;uGALW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,UAAU;AAChB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-pipes-national-insurance.mjs","sources":["../../../projects/opal-frontend-common/pipes/national-insurance/national-insurance.pipe.ts","../../../projects/opal-frontend-common/pipes/national-insurance/hmcts-opal-frontend-common-pipes-national-insurance.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'nationalInsurance',\n standalone: true,\n})\nexport class NationalInsurancePipe implements PipeTransform {\n transform(value: string | null): string {\n if (!value) {\n return '';\n }\n\n const cleaned = value.replaceAll(/[^a-zA-Z0-9]/g, '').toUpperCase();\n\n if (cleaned.length < 9) return value;\n\n return `${cleaned.slice(0, 2)} ${cleaned.slice(2, 4)} ${cleaned.slice(4, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8)}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,qBAAqB,CAAA;AAChC,IAAA,SAAS,CAAC,KAAoB,EAAA;QAC5B,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,OAAO,EAAE;QACX;AAEA,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;AAEnE,QAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;AAAE,YAAA,OAAO,KAAK;QAEpC,OAAO,CAAA,EAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAC1H;uGAXW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,mBAAmB;AACzB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-resolvers-title.mjs","sources":["../../../projects/opal-frontend-common/resolvers/title/title.resolver.ts","../../../projects/opal-frontend-common/resolvers/title/hmcts-opal-frontend-common-resolvers-title.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { Resolve, ActivatedRouteSnapshot } from '@angular/router';\nimport { Title } from '@angular/platform-browser';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TitleResolver implements Resolve<void> {\n private readonly titleService = inject(Title);\n\n resolve(route: ActivatedRouteSnapshot): void {\n const title = route.data['title'] ?? 'Frontend';\n this.titleService.setTitle(`OPAL - ${title}`);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,aAAa,CAAA;AACP,IAAA,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC;AAE7C,IAAA,OAAO,CAAC,KAA6B,EAAA;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU;QAC/C,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAA,OAAA,EAAU,KAAK,CAAA,CAAE,CAAC;IAC/C;uGANW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA;;2FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-app-initializer-service.mjs","sources":["../../../projects/opal-frontend-common/services/app-initializer-service/app-initializer.service.ts","../../../projects/opal-frontend-common/services/app-initializer-service/hmcts-opal-frontend-common-services-app-initializer-service.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport { TransferStateService } from '@hmcts/opal-frontend-common/services/transfer-state-service';\nimport { AppInsightsService } from '@hmcts/opal-frontend-common/services/app-insights-service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AppInitializerService {\n private readonly transferStateService = inject(TransferStateService);\n private readonly appInsightsService = inject(AppInsightsService);\n\n /**\n * Initializes the SSO (Single Sign-On) enabled state.\n * This method calls the `initializeSsoEnabled` method of the `transferStateService`.\n */\n private initializeSsoEnabled(): void {\n this.transferStateService.initializeSsoEnabled();\n }\n\n /**\n * Initializes the LaunchDarkly configuration.\n */\n private initializeLaunchDarkly(): void {\n this.transferStateService.initializeLaunchDarklyConfig();\n }\n\n /**\n * Initializes the Application Insights configuration.\n */\n private initializeAppInsights(): void {\n this.transferStateService.initializeAppInsightsConfig();\n }\n\n /**\n * Initializes the user state cache expiration milliseconds.\n */\n private initializeUserStateCacheExpirationMilliseconds(): void {\n this.transferStateService.initializeUserStateCacheExpirationMilliseconds();\n }\n\n /**\n * Initializes the application.\n * This method calls the necessary initialization functions.\n */\n public async initializeApp(): Promise<void> {\n this.initializeSsoEnabled();\n this.initializeLaunchDarkly();\n this.initializeAppInsights();\n this.initializeUserStateCacheExpirationMilliseconds();\n await this.appInsightsService.initialize();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAOa,qBAAqB,CAAA;AACf,IAAA,oBAAoB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACnD,IAAA,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAEhE;;;AAGG;IACK,oBAAoB,GAAA;AAC1B,QAAA,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,EAAE;IAClD;AAEA;;AAEG;IACK,sBAAsB,GAAA;AAC5B,QAAA,IAAI,CAAC,oBAAoB,CAAC,4BAA4B,EAAE;IAC1D;AAEA;;AAEG;IACK,qBAAqB,GAAA;AAC3B,QAAA,IAAI,CAAC,oBAAoB,CAAC,2BAA2B,EAAE;IACzD;AAEA;;AAEG;IACK,8CAA8C,GAAA;AACpD,QAAA,IAAI,CAAC,oBAAoB,CAAC,8CAA8C,EAAE;IAC5E;AAEA;;;AAGG;AACI,IAAA,MAAM,aAAa,GAAA;QACxB,IAAI,CAAC,oBAAoB,EAAE;QAC3B,IAAI,CAAC,sBAAsB,EAAE;QAC7B,IAAI,CAAC,qBAAqB,EAAE;QAC5B,IAAI,CAAC,8CAA8C,EAAE;AACrD,QAAA,MAAM,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE;IAC5C;uGA3CW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAArB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cAFpB,MAAM,EAAA,CAAA;;2FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-app-insights-service.mjs","sources":["../../../projects/opal-frontend-common/services/app-insights-service/app-insights.service.ts","../../../projects/opal-frontend-common/services/app-insights-service/hmcts-opal-frontend-common-services-app-insights-service.ts"],"sourcesContent":["import { inject, Injectable, PLATFORM_ID } from '@angular/core';\nimport { ITelemetryItem } from '@microsoft/applicationinsights-web';\nimport { isPlatformBrowser } from '@angular/common';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AppInsightsService {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private appInsights!: any;\n private isInitialized = false;\n private readonly globalStore = inject(GlobalStore);\n private readonly platformId = inject(PLATFORM_ID);\n\n private async initializeAppInsights(): Promise<void> {\n const { ApplicationInsights } = await import('@microsoft/applicationinsights-web');\n const config = this.globalStore.appInsightsConfig();\n if (isPlatformBrowser(this.platformId) && config.enabled) {\n this.appInsights = new ApplicationInsights({\n config: {\n connectionString: config.connectionString,\n enableAutoRouteTracking: true,\n },\n });\n\n this.appInsights.addTelemetryInitializer(this.telemetryInitializer.bind(this));\n this.appInsights.loadAppInsights();\n\n this.isInitialized = true;\n }\n }\n\n private telemetryInitializer(envelope: ITelemetryItem): void {\n envelope.tags = envelope.tags || {};\n const config = this.globalStore.appInsightsConfig();\n if (config.enabled) {\n envelope.tags['ai.cloud.role'] = config.cloudRoleName!;\n }\n }\n\n public logPageView(name?: string, url?: string): void {\n const config = this.globalStore.appInsightsConfig();\n if (!this.isInitialized || !config.enabled) {\n return;\n }\n this.appInsights.trackPageView({ name, uri: url });\n }\n\n public logException(exception: Error, severityLevel?: number): void {\n const config = this.globalStore.appInsightsConfig();\n if (!this.isInitialized || !config.enabled) {\n return;\n }\n this.appInsights.trackException({ exception, severityLevel });\n }\n\n public async initialize(): Promise<void> {\n await this.initializeAppInsights();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAQa,kBAAkB,CAAA;;AAErB,IAAA,WAAW;IACX,aAAa,GAAG,KAAK;AACZ,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAEzC,IAAA,MAAM,qBAAqB,GAAA;QACjC,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,OAAO,oCAAoC,CAAC;QAClF,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE;QACnD,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE;AACxD,YAAA,IAAI,CAAC,WAAW,GAAG,IAAI,mBAAmB,CAAC;AACzC,gBAAA,MAAM,EAAE;oBACN,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;AACzC,oBAAA,uBAAuB,EAAE,IAAI;AAC9B,iBAAA;AACF,aAAA,CAAC;AAEF,YAAA,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9E,YAAA,IAAI,CAAC,WAAW,CA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A,EAAA,IAAA,EAAA,kBAAkB,cAFjB,MAAM,EAAA,CAAA;;2FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-auth-service-constants.mjs","sources":["../../../projects/opal-frontend-common/services/auth-service/constants/sso-endpoints.constant.ts","../../../projects/opal-frontend-common/services/auth-service/constants/hmcts-opal-frontend-common-services-auth-service-constants.ts"],"sourcesContent":["import { ISsoEndpoints } from '@hmcts/opal-frontend-common/services/auth-service/interfaces';\n\nexport const SSO_ENDPOINTS: ISsoEndpoints = {\n login: '/sso/login',\n logout: '/sso/logout',\n callback: '/sso/callback',\n authenticated: '/sso/authenticated',\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEO,MAAM,aAAa,GAAkB;AAC1C,IAAA,KAAK,EAAE,YAAY;AACnB,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,QAAQ,EAAE,eAAe;AACzB,IAAA,aAAa,EAAE,oBAAoB;;;ACNrC;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-auth-service-interfaces.mjs","sources":["../../../projects/opal-frontend-common/services/auth-service/interfaces/hmcts-opal-frontend-common-services-auth-service-interfaces.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-auth-service.mjs","sources":["../../../projects/opal-frontend-common/services/auth-service/auth.service.ts","../../../projects/opal-frontend-common/services/auth-service/hmcts-opal-frontend-common-services-auth-service.ts"],"sourcesContent":["import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { catchError, tap, throwError } from 'rxjs';\nimport { SSO_ENDPOINTS } from '@hmcts/opal-frontend-common/services/auth-service/constants';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthService {\n private readonly http = inject(HttpClient);\n private readonly globalStore = inject(GlobalStore);\n\n public checkAuthenticated() {\n return this.http\n .get<boolean>(SSO_ENDPOINTS.authenticated, {\n headers: new HttpHeaders({\n 'Cache-Control': 'no-cache',\n Pragma: 'no-cache',\n Expires: '0',\n }),\n })\n .pipe(\n tap((resp) => {\n this.globalStore.setAuthenticated(resp);\n }),\n )\n .pipe(\n catchError((error) => {\n this.globalStore.setAuthenticated(false);\n return throwError(() => error);\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MASa,WAAW,CAAA;AACL,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IAE3C,kBAAkB,GAAA;QACvB,OAAO,IAAI,CAAC;AACT,aAAA,GAAG,CAAU,aAAa,CAAC,aAAa,EAAE;YACzC,OAAO,EAAE,IAAI,WAAW,CAAC;AACvB,gBAAA,eAAe,EAAE,UAAU;AAC3B,gBAAA,MAAM,EAAE,UAAU;AAClB,gBAAA,OAAO,EAAE,GAAG;aACb,CAAC;SACH;AACA,aAAA,IAAI,CACH,GAAG,CAAC,CAAC,IAAI,KAAI;AACX,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC;AACzC,QAAA,CAAC,CAAC;AAEH,aAAA,IAAI,CACH,UAAU,CAAC,CAAC,KAAK,KAAI;AACnB,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,CAAC;AACxC,YAAA,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC;QAChC,CAAC,CAAC,CACH;IACL;uGAxBW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAX,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cAFV,MAAM,EAAA,CAAA;;2FAEP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-date-service-interfaces.mjs","sources":["../../../projects/opal-frontend-common/services/date-service/interfaces/hmcts-opal-frontend-common-services-date-service-interfaces.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-date-service.mjs","sources":["../../../projects/opal-frontend-common/services/date-service/date.service.ts","../../../projects/opal-frontend-common/services/date-service/hmcts-opal-frontend-common-services-date-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { DateTime, Duration, DurationLikeObject } from 'luxon';\nimport { IDateRange, IAgeObject } from './interfaces/date.service.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DateService {\n /**\n * Calculates the difference in minutes between two DateTime objects.\n * @param startDate The start date and time.\n * @param endDate The end date and time.\n * @returns The difference in minutes between the start and end dates.\n */\n public calculateMinutesDifference(startDate: DateTime, endDate: DateTime): number {\n const minuteDifference = endDate.diff(startDate, 'minutes');\n return Math.max(0, Math.ceil(minuteDifference.minutes));\n }\n\n /**\n * Converts milliseconds to minutes.\n * @param milliseconds - The number of milliseconds to convert.\n * @returns The equivalent number of minutes.\n */\n public convertMillisecondsToMinutes(milliseconds: number): number {\n const minutes = Duration.fromMillis(milliseconds).as('minutes');\n return Math.max(0, Math.ceil(minutes));\n }\n\n /**\n * Calculates the age based on the given date of birth.\n * @param dateOfBirth - The date of birth to calculate the age from.\n * @param format - The format of the date of birth. Defaults to 'dd/MM/yyyy'.\n * @returns The calculated age.\n */\n public calculateAge(dateOfBirth: DateTime | string, format: string = 'dd/MM/yyyy'): number {\n const date = typeof dateOfBirth === 'string' ? this.getFromFormat(dateOfBirth, format) : dateOfBirth;\n\n return Math.floor(DateTime.now().diff(date, 'years').years);\n }\n\n /**\n * Checks if a given date is valid.\n * @param dateInput - The date to be checked. It can be a DateTime object, a string, or null.\n * @param format - The format of the date string (default: 'dd/MM/yyyy').\n * @returns A boolean indicating whether the date is valid or not.\n */\n public isValidDate(dateInput: DateTime | string | null, format: string = 'dd/MM/yyyy'): boolean {\n if (dateInput) {\n const date = typeof dateInput === 'string' ? this.getFromFormat(dateInput, format) : dateInput;\n return date.isValid;\n }\n return false;\n }\n\n /**\n * Returns a string representation of a date subtracted by the given duration.\n * @param duration A DurationLikeObject representing the amount of time to subtract from the current date.\n * @returns A string representing the subtracted date in the format specified by the current locale.\n */\n public getPreviousDate(duration: DurationLikeObject): string {\n return DateTime.now().minus(duration).setLocale('en-gb').toLocaleString();\n }\n\n /**\n * Parses a string value into a DateTime object based on the specified format.\n * @param value - The string value to parse.\n * @param format - The format of the string value.\n * @returns A DateTime object representing the parsed value.\n */\n public getFromFormat(value: string, format: string): DateTime<true> | DateTime<false> {\n return DateTime.fromFormat(value, format);\n }\n\n /**\n * Returns an object containing the age and age group based on the date of birth.\n * @param dateOfBirth - The date of birth to calculate the age from.\n * @returns An object containing the age value and group ('Adult' or 'Youth') if the date is valid, or null if the date is invalid.\n */\n public getAgeObject(dateOfBirth: string): IAgeObject | null {\n if (this.isValidDate(dateOfBirth)) {\n const age = this.calculateAge(dateOfBirth);\n return {\n value: age,\n group: age >= 18 ? 'Adult' : 'Youth',\n };\n }\n return null;\n }\n\n /**\n * Parses a string value into a native JavaScript Date object based on the specified format.\n * @param value - The string value to parse.\n * @param format - The format of the string value.\n * @returns A Date object representing the parsed value, or null if parsing fails.\n */\n public getDateFromFormat(value: string, format: string): Date | null {\n const dateTime = DateTime.fromFormat(value, format);\n return dateTime.isValid ? dateTime.toJSDate() : null;\n }\n\n /**\n * Converts a DateTime value to a formatted string.\n *\n * @param value - The DateTime value to format.\n * @param format - The format string to apply to the DateTime value.\n * @returns The formatted string representation of the DateTime value.\n */\n public toFormat(value: DateTime<true> | DateTime<false>, format: string): string {\n return value.toFormat(format);\n }\n\n /**\n * Converts a given Date object to a formatted string based on the specified format.\n *\n * @param value - The Date object to be formatted.\n * @param format - The string format to apply to the Date object.\n * @returns The formatted date string.\n */\n public toDateStringFormat(value: Date, format: string): string {\n return DateTime.fromJSDate(value).toFormat(format);\n }\n\n /**\n * Converts a string in ISO format to a DateTime object.\n * @param value - The string value in ISO format.\n * @returns A DateTime object representing the given value.\n */\n public getFromIso(value: string): DateTime {\n return DateTime.fromISO(value);\n }\n\n /**\n * Returns the current date and time.\n * @returns {DateTime} The current date and time.\n */\n public getDateNow(): DateTime {\n return DateTime.now();\n }\n\n /**\n * Adds a duration to a given date and returns the result in the specified format.\n * @param date - The date to which the duration will be added.\n * @param years - The number of years to add to the date (default: 0).\n * @param months - The number of months to add to the date (default: 0).\n * @param weeks - The number of weeks to add to the date (default: 0).\n * @param days - The number of days to add to the date (default: 0).\n * @param format - The format in which the resulting date will be returned (default: 'dd/MM/yyyy').\n * @returns The resulting date in the specified format.\n */\n public addDurationToDate(\n date: string,\n years: number = 0,\n months: number = 0,\n weeks: number = 0,\n days: number = 0,\n format: string = 'dd/MM/yyyy',\n ): string {\n const dateObj = this.getFromFormat(date, format);\n const newDate = dateObj.plus({ years, months, weeks, days });\n return newDate.toFormat(format);\n }\n\n /**\n * Calculates the number of days between two dates.\n * @param startDate - The start date in the specified format.\n * @param endDate - The end date in the specified format.\n * @param format - The format of the dates (default: 'dd/MM/yyyy').\n * @returns The number of days between the start and end dates.\n */\n public calculateDaysBetweenDates(startDate: string, endDate: string, format: string = 'dd/MM/yyyy'): number {\n const start = this.getFromFormat(startDate, format);\n const end = this.getFromFormat(endDate, format);\n const diff = end.diff(start, 'days');\n return diff.days;\n }\n\n /**\n * Checks if a given date is in the past.\n * @param date - The date to check.\n * @param format - The format of the date string. Defaults to 'dd/MM/yyyy'.\n * @returns True if the date is in the past, false otherwise.\n */\n public isDateInThePast(date: string, format: string = 'dd/MM/yyyy'): boolean {\n return this.getFromFormat(date, format) < DateTime.now();\n }\n\n /**\n * Checks if a given date is in the future.\n * @param date - The date to check.\n * @param yearsInTheFuture - Optional. The number of years in the future to compare against. If not provided, the current date is used.\n * @param format - Optional. The format of the input date. Defaults to 'dd/MM/yyyy'.\n * @returns True if the date is in the future, false otherwise.\n */\n public isDateInTheFuture(date: string, yearsInTheFuture?: number, format: string = 'dd/MM/yyyy'): boolean {\n const now = DateTime.now();\n const dateValue = this.getFromFormat(date, format);\n\n if (yearsInTheFuture) {\n const futureDate = now.plus({ years: yearsInTheFuture });\n return dateValue > futureDate;\n }\n\n return dateValue > now;\n }\n\n /**\n * Converts a date string from one format to another.\n *\n * @param date - The date string to be converted.\n * @param fromFormat - The format of the input date string.\n * @param toFormat - The desired format of the output date string.\n * @returns The date string in the desired format.\n */\n public getFromFormatToFormat(date: string, fromFormat: string, toFormat: string): string {\n return this.getFromFormat(date, fromFormat).toFormat(toFormat);\n }\n\n /**\n * Calculates the number of days between the current date and a given ISO date string.\n *\n * @param value - An ISO 8601 formatted date string representing the target date.\n * @returns The number of days between the current date and the input date.\n * Returns 0 if the input date is invalid.\n */\n public getDaysAgo(value: string): number {\n const inputDate = this.getFromIso(value).startOf('day');\n\n const now = this.getDateNow().startOf('day');\n return Math.round(now.diff(inputDate, 'days').days);\n }\n\n /**\n * Returns a date range object with 'from' and 'to' properties.\n * @param pastDays - The number of days in the past from today.\n * @param futureDays - The number of days in the future from today.\n * @param format - The format for the date strings (default: 'yyyy-MM-dd').\n * @returns An object containing 'from' and 'to' date strings in the specified format.\n */\n public getDateRange(pastDays: number = 0, futureDays: number = 0, format: string = 'yyyy-MM-dd'): IDateRange {\n const dateTo = this.getDateNow().plus({ days: futureDays }).toISODate();\n const dateFrom = this.getDateNow().minus({ days: pastDays }).toISODate();\n\n if (!dateTo || !dateFrom) {\n throw new Error('Invalid date range');\n }\n\n return {\n from: this.toFormat(this.getFromIso(dateFrom), format),\n to: this.toFormat(this.getFromIso(dateTo), format),\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,WAAW,CAAA;AACtB;;;;;AAKG;IACI,0BAA0B,CAAC,SAAmB,EAAE,OAAiB,EAAA;QACtE,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC;AAC3D,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzD;AAEA;;;;AAIG;AACI,IAAA,4BAA4B,CAAC,YAAoB,EAAA;AACtD,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC;AAC/D,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC;AAEA;;;;;AAKG;AACI,IAAA,YAAY,CAAC,WAA8B,EAAE,MAAA,GAAiB,YAAY,EAAA;QAC/E,MAAM,IAAI,GAAG,OAAO,WAAW,KAAK,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,WAAW;AAE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iB,YAAY,EAAA;AAC7F,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,SAAS,EAAE;AACvE,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,SAAS,EAAE;AAExE,QAAA,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE;AACxB,YAAA,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC;QACvC;QAEA,OAAO;AACL,YAAA,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;AACtD,YAAA,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;SACnD;IACH;uGApPW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAX,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cAFV,MAAM,EAAA,CAAA;;2FAEP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-launch-darkly-service-mocks.mjs","sources":["../../../projects/opal-frontend-common/services/launch-darkly-service/mocks/launch-darkly-change-flags.mock.ts","../../../projects/opal-frontend-common/services/launch-darkly-service/mocks/launch-darkly-flags.mock.ts","../../../projects/opal-frontend-common/services/launch-darkly-service/mocks/hmcts-opal-frontend-common-services-launch-darkly-service-mocks.ts"],"sourcesContent":["export const LAUNCH_DARKLY_CHANGE_FLAGS_MOCK = {\n flag1: { current: true, previous: false },\n flag2: { current: false, previous: true },\n};\n","export const LAUNCH_DARKLY_FLAGS_MOCK = {\n flag1: true,\n flag2: false,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAO,MAAM,+BAA+B,GAAG;IAC7C,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;IACzC,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE;;;ACFpC,MAAM,wBAAwB,GAAG;AACtC,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,KAAK,EAAE,KAAK;;;ACFd;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-launch-darkly-service.mjs","sources":["../../../projects/opal-frontend-common/services/launch-darkly-service/launch-darkly.service.ts","../../../projects/opal-frontend-common/services/launch-darkly-service/hmcts-opal-frontend-common-services-launch-darkly-service.ts"],"sourcesContent":["import { inject, Injectable, OnDestroy } from '@angular/core';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { initialize, LDClient, LDFlagChangeset, LDFlagSet } from 'launchdarkly-js-client-sdk';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LaunchDarklyService implements OnDestroy {\n private readonly globalStore = inject(GlobalStore);\n private ldClient!: LDClient;\n\n /**\n * Sets the LaunchDarkly flags by updating the featureFlags in the state service.\n */\n private setLaunchDarklyFlags() {\n if (this.ldClient) {\n this.globalStore.setFeatureFlags(this.ldClient.allFlags());\n }\n }\n\n /**\n * Formats the LDFlagChangeset into an LDFlagSet.\n *\n * @param flags - The LDFlagChangeset to be formatted.\n * @returns The formatted LDFlagSet.\n */\n private formatChangeFlags(flags: LDFlagChangeset): LDFlagSet {\n return Object.keys(flags).reduce((flag: LDFlagSet, key) => {\n flag[key] = flags[key].current;\n return flag;\n }, {});\n }\n\n /**\n * Closes the LaunchDarkly client if it is open.\n */\n private closeLaunchDarklyClient(): void {\n if (this.ldClient) {\n this.ldClient.close();\n }\n }\n\n /**\n * Initializes the LaunchDarkly change listener.\n * This method listens for changes in feature flags and updates the state accordingly.\n */\n public initializeLaunchDarklyChangeListener() {\n if (this.ldClient && this.globalStore.launchDarklyConfig().stream) {\n this.ldClient.on('change', (flags: LDFlagChangeset) => {\n const updatedFlags = { ...this.globalStore.featureFlags(), ...this.formatChangeFlags(flags) };\n this.globalStore.setFeatureFlags(updatedFlags);\n });\n }\n }\n\n /**\n * Initializes the LaunchDarkly flags and sets them.\n * If the LD client is already initialized, it waits for initialization and then sets the flags.\n * If the LD client is not initialized, it returns a resolved promise.\n * @returns A promise that resolves when the flags are set.\n */\n public async initializeLaunchDarklyFlags(): Promise<void> {\n if (this.ldClient) {\n return this.ldClient\n .waitForInitialization(5)\n .then(() => this.setLaunchDarklyFlags())\n .catch((err) => {\n throw err;\n });\n }\n }\n\n /**\n * Initializes the LaunchDarkly client.\n * If a stored LaunchDarkly client ID exists, it initializes the client with the ID and anonymous mode enabled.\n */\n public initializeLaunchDarklyClient(): void {\n if (this.globalStore.launchDarklyConfig()) {\n const { enabled, clientId } = this.globalStore.launchDarklyConfig();\n\n if (enabled && clientId) {\n this.ldClient = initialize(clientId, {\n anonymous: true,\n });\n }\n }\n }\n\n ngOnDestroy(): void {\n this.closeLaunchDarklyClient();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAOa,mBAAmB,CAAA;AACb,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1C,IAAA,QAAQ;AAEhB;;AAEG;IACK,oBAAoB,GAAA;AAC1B,QAAA,IAAI,IA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I;AACb,gBAAA,MAAM,GAAG;AACX,YAAA,CAAC,CAAC;QACN;IACF;AAEA;;;AAGG;IACI,4BAA4B,GAAA;AACjC,QAAA,IAAI,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,EAAE;AACzC,YAAA,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE;AAEnE,YAAA,IAAI,OAAO,IAAI,QAAQ,EAAE;AACvB,gBAAA,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE;AACnC,oBAAA,SAAS,EAAE,IAAI;AAChB,iBAAA,CAAC;YACJ;QACF;IACF;IAEA,WAAW,GAAA;QACT,IAAI,CAAC,uBAAuB,EAAE;IAChC;uGAnFW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA;;2FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-opal-user-service-interfaces.mjs","sources":["../../../projects/opal-frontend-common/services/opal-user-service/interfaces/hmcts-opal-frontend-common-services-opal-user-service-interfaces.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-opal-user-service-mocks.mjs","sources":["../../../projects/opal-frontend-common/services/opal-user-service/mocks/opal-user-permissions.mock.ts","../../../projects/opal-frontend-common/services/opal-user-service/mocks/opal-user-business-unit-user.mock.ts","../../../projects/opal-frontend-common/services/opal-user-service/mocks/opal-user-state.mock.ts","../../../projects/opal-frontend-common/services/opal-user-service/mocks/hmcts-opal-frontend-common-services-opal-user-service-mocks.ts"],"sourcesContent":["import { IOpalUserPermissions } from '@hmcts/opal-frontend-common/services/opal-user-service/interfaces';\n\nexport const OPAL_USER_PERMISSIONS_MOCK: IOpalUserPermissions[] = [\n {\n permission_id: 54,\n permission_name: 'Account Enquiry',\n },\n {\n permission_id: 41,\n permission_name: 'Account Enquiry - Account Notes',\n },\n];\n","import { IOpalUserBusinessUnitUser } from '@hmcts/opal-frontend-common/services/opal-user-service/interfaces';\nimport { OPAL_USER_PERMISSIONS_MOCK } from './opal-user-permissions.mock';\n\nexport const OPAL_USER_BUSINESS_UNIT_USER_MOCK: IOpalUserBusinessUnitUser[] = [\n {\n business_unit_user_id: 'L017KG',\n business_unit_id: 17,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L016KG',\n business_unit_id: 16,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L019KG',\n business_unit_id: 19,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L013KG',\n business_unit_id: 13,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L076KG',\n business_unit_id: 76,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L081KG',\n business_unit_id: 81,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L077KG',\n business_unit_id: 77,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L078KG',\n business_unit_id: 78,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L079KG',\n business_unit_id: 79,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L040KG',\n business_unit_id: 40,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L066KG',\n business_unit_id: 66,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L072KG',\n business_unit_id: 72,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L067KG',\n business_unit_id: 67,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L073KG',\n business_unit_id: 73,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L068KG',\n business_unit_id: 68,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L074KG',\n business_unit_id: 74,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L069KG',\n business_unit_id: 69,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L075KG',\n business_unit_id: 75,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L080KG',\n business_unit_id: 80,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L062KG',\n business_unit_id: 62,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L025KG',\n business_unit_id: 25,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L032KG',\n business_unit_id: 32,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L063KG',\n business_unit_id: 63,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L064KG',\n business_unit_id: 64,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L070KG',\n business_unit_id: 70,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L065KG',\n business_unit_id: 65,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n {\n business_unit_user_id: 'L071KG',\n business_unit_id: 71,\n permissions: OPAL_USER_PERMISSIONS_MOCK,\n },\n];\n","import { IOpalUserState } from '@hmcts/opal-frontend-common/services/opal-user-service/interfaces';\nimport { OPAL_USER_BUSINESS_UNIT_USER_MOCK } from './opal-user-business-unit-user.mock';\n\nexport const OPAL_USER_STATE_MOCK: IOpalUserState = {\n user_id: 50000000,\n username: 'timmyTest@HMCTS.NET',\n name: 'Timmy Test',\n status: 'active',\n version: 1,\n business_unit_users: OPAL_USER_BUSINESS_UNIT_USER_MOCK,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEO,MAAM,0BAA0B,GAA2B;AAChE,IAAA;AACE,QAAA,aAAa,EAAE,EAAE;AACjB,QAAA,eAAe,EAAE,iBAAiB;AACnC,KAAA;AACD,IAAA;AACE,QAAA,aAAa,EAAE,EAAE;AACjB,QAAA,eAAe,EAAE,iCAAiC;AACnD,KAAA;;;ACPI,MAAM,iCAAiC,GAAgC;AAC5E,IAAA;AACE,QAAA,qBAAqB,EAAE,QAAQ;AAC/B,QAAA,gBAAgB,EAAE,EAAE;AACpB,QAAA,WAAW,EAAE,0BAA0B;AACxC,KAAA;AACD,IAAA;AACE,QAAA,qBAAqB,EAAE,QAAQ;AAC/B,QAAA,gBAAgB,EAAE,EAAE;AACpB,QAAA,WAAW,EAAE,0BAA0B;AACxC,KAAA;AACD,IAAA;AACE,QAAA,qBAAqB,EAAE,QAAQ;AAC/B,QAAA,gBAAgB,EAAE,EAAE;AACpB,QAAA,WAAW,EAAE,0BAA0B;AACxC,KAAA;AACD,IAAA;AACE,QAAA,qBAAqB,EAAE,QAAQ;AAC/B,Q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AA,WAAW,EAAE,0BAA0B;AACxC,KAAA;AACD,IAAA;AACE,QAAA,qBAAqB,EAAE,QAAQ;AAC/B,QAAA,gBAAgB,EAAE,EAAE;AACpB,QAAA,WAAW,EAAE,0BAA0B;AACxC,KAAA;AACD,IAAA;AACE,QAAA,qBAAqB,EAAE,QAAQ;AAC/B,QAAA,gBAAgB,EAAE,EAAE;AACpB,QAAA,WAAW,EAAE,0BAA0B;AACxC,KAAA;AACD,IAAA;AACE,QAAA,qBAAqB,EAAE,QAAQ;AAC/B,QAAA,gBAAgB,EAAE,EAAE;AACpB,QAAA,WAAW,EAAE,0BAA0B;AACxC,KAAA;;;ACvII,MAAM,oBAAoB,GAAmB;AAClD,IAAA,OAAO,EAAE,QAAQ;AACjB,IAAA,QAAQ,EAAE,qBAAqB;AAC/B,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,mBAAmB,EAAE,iCAAiC;;;ACTxD;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-opal-user-service.mjs","sources":["../../../projects/opal-frontend-common/services/opal-user-service/constants/opal-user-paths.constant.ts","../../../projects/opal-frontend-common/services/opal-user-service/opal-user.service.ts","../../../projects/opal-frontend-common/services/opal-user-service/hmcts-opal-frontend-common-services-opal-user-service.ts"],"sourcesContent":["import { IOpalUserPaths } from '@hmcts/opal-frontend-common/services/opal-user-service/interfaces';\n\nconst baseUrl = '/opal-user-service';\nconst users = '/users';\nconst currentUser = '/0';\nconst userState = '/state';\n\nexport const OPAL_USER_PATHS: IOpalUserPaths = {\n loggedInUserState: `${baseUrl}${users}${currentUser}${userState}`,\n};\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { IOpalUserState } from './interfaces/opal-user-state.interface';\nimport { tap, Observable, of } from 'rxjs';\nimport { OPAL_USER_PATHS } from './constants/opal-user-paths.constant';\nimport { IOpalUserStateCached } from './interfaces/opal-user-state-cached.interface';\nimport { DateService } from '@hmcts/opal-frontend-common/services/date-service';\n\n@Injectable({ providedIn: 'root' })\nexport class OpalUserService {\n private readonly http = inject(HttpClient);\n private readonly globalStore = inject(GlobalStore);\n private readonly dateService = inject(DateService);\n private userStateCache!: IOpalUserStateCached;\n\n /**\n * Checks if the cached user state has expired.\n *\n * @returns True if the cache has expired, false otherwise.\n */\n private isCacheExpired(): boolean {\n if (!this.userStateCache?.expiryAt) {\n return true;\n }\n\n const now = this.dateService.getDateNow();\n const expiryTime = this.dateService.getFromIso(this.userStateCache.expiryAt);\n return now > expiryTime;\n }\n\n /**\n * Clears the cached user state.\n */\n private clearCache(): void {\n this.userStateCache = {} as IOpalUserStateCached;\n }\n\n /**\n * Returns cached user state when present, unexpired, and matching the store identity; otherwise null.\n */\n private getCachedUserIfValid(): IOpalUserState | null {\n const cachedUser = this.userStateCache?.userState;\n if (!cachedUser) {\n return null;\n }\n\n if (this.isCacheExpired()) {\n return null;\n }\n\n const storeUser = this.globalStore.userState();\n if (storeUser?.user_id && cachedUser.user_id && storeUser.user_id !== cachedUser.user_id) {\n return null;\n }\n\n return cachedUser;\n }\n\n /**\n * Retrieves the logged-in user's state as an observable.\n *\n * This method first checks if the user state is cached and the cache is still valid.\n * If so, it returns the cached user state. Otherwise, it fetches the user state\n * from the server, updates the cache, and sets the user state in the global store.\n *\n * @returns {Observable<IOpalUserState>} An observable that emits the logged-in user's state.\n */\n public getLoggedInUserState(): Observable<IOpalUserState> {\n const cachedUser = this.getCachedUserIfValid();\n if (cachedUser) {\n this.globalStore.setUserState(cachedUser);\n return of(cachedUser);\n }\n\n // Calculate new expiry time\n const expiresAt = this.dateService\n .getDateNow()\n .plus({ milliseconds: this.globalStore.userStateCacheExpirationMilliseconds() });\n\n // Fetch fresh data\n return this.http.get<IOpalUserState>(OPAL_USER_PATHS.loggedInUserState).pipe(\n tap((userState) => {\n this.userStateCache = {\n userState: userState,\n expiryAt: expiresAt.toISO(),\n };\n this.globalStore.setUserState(userState);\n }),\n );\n }\n\n /**\n * Clears cached user state and resets the global store user to an empty object.\n *\n * Useful for logout/identity switches to avoid reusing stale state.\n */\n public clearUserStateCache(): void {\n this.clearCache();\n this.globalStore.setUserState({} as IOpalUserState);\n }\n\n /**\n * Forces a fresh fetch of user state, bypassing the cache.\n *\n * @returns An Observable that emits the current {@link IOpalUserState}.\n */\n public refreshUserState(): Observable<IOpalUserState> {\n this.clearUserStateCache();\n return this.getLoggedInUserState();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAEA,MAAM,OAAO,GAAG,oBAAoB;AACpC,MAAM,KAAK,GAAG,QAAQ;AACtB,MAAM,WAAW,GAAG,IAAI;AACxB,MAAM,SAAS,GAAG,QAAQ;AAEnB,MAAM,eAAe,GAAmB;IAC7C,iBAAiB,EAAE,GAAG,OAAO,CAAA,EAAG,KAAK,CAAA,EAAG,WAAW,CAAA,EAAG,SAAS,CAAA,CAAE;CAClE;;MCCY,eAAe,CAAA;AACT,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1C,IAAA,cAAc;AAEtB;;;;AAIG;IACK,cAAc,GAAA;AACpB,QAAA,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,EAAE;AAClC,YAAA,OAAO,IAAI;QACb;QAEA,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE;AACzC,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC;QAC5E,OAAO,GAAG,GAAG,UAAU;IACzB;AAEA;;A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C,CAAC,CAAC,CACH;IACH;AAEA;;;;AAIG;IACI,mBAAmB,GAAA;QACxB,IAAI,CAAC,UAAU,EAAE;AACjB,QAAA,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,EAAoB,CAAC;IACrD;AAEA;;;;AAIG;IACI,gBAAgB,GAAA;QACrB,IAAI,CAAC,mBAAmB,EAAE;AAC1B,QAAA,OAAO,IAAI,CAAC,oBAAoB,EAAE;IACpC;uGApGW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAf,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cADF,MAAM,EAAA,CAAA;;2FACnB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACTlC;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-permissions-service.mjs","sources":["../../../projects/opal-frontend-common/services/permissions-service/permissions.service.ts","../../../projects/opal-frontend-common/services/permissions-service/hmcts-opal-frontend-common-services-permissions-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n IOpalUserState,\n IOpalUserBusinessUnitUser,\n} from '@hmcts/opal-frontend-common/services/opal-user-service/interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PermissionsService {\n private storedUniquePermissionIds: number[] = [];\n\n /**\n * Retrieves the unique permission IDs associated with the user.\n * If the unique permission IDs have not been stored yet, it calculates them based on the user's roles and permissions.\n * @returns An array of unique permission IDs.\n */\n public getUniquePermissions(userState: IOpalUserState | null): number[] {\n const roles = userState ? userState['business_unit_users'] : null;\n\n if (!this.storedUniquePermissionIds.length && roles) {\n const permissionIds = roles.flatMap((role) => {\n return role.permissions.map(({ permission_id: permissionId }) => permissionId);\n });\n\n this.storedUniquePermissionIds = [...new Set(permissionIds)];\n }\n\n return this.storedUniquePermissionIds;\n }\n\n /**\n * Determines whether the user has access to a specific permission based on their roles.\n *\n * This method short-circuits and returns as soon as a matching permission is found for efficiency.\n *\n * @param permissionId - The ID of the permission to check for access.\n * @param roles - An array of user roles, each containing a list of permissions.\n * @returns `true` if the user has the specified permission in any of their roles,\n * or if no roles are provided; otherwise, returns `false`.\n */\n public hasPermissionAccess(permissionId: number, roles: IOpalUserBusinessUnitUser[]): boolean {\n if (roles?.length) {\n return roles.some((role) => role.permissions.some((permission) => permission.permission_id === permissionId));\n }\n // if we don't have any roles, we can't have any permissions\n return true;\n }\n\n /**\n * Checks if the user has access to a specific permission within a given business unit.\n *\n * This method short-circuits and returns as soon as a matching permission is found for efficiency.\n *\n * @param permissionId - The ID of the permission to check.\n * @param businessUnitId - The ID of the business unit to check against.\n * @param roles - An array of user roles, each containing permissions and associated business unit IDs.\n * @returns `true` if the user has the specified permission for the business unit, or if no roles are provided; otherwise, `false`.\n */\n public hasBusinessUnitPermissionAccess(\n permissionId: number,\n businessUnitId: number,\n roles: IOpalUserBusinessUnitUser[],\n ): boolean {\n if (roles?.length) {\n return roles.some(\n (role) =>\n role.business_unit_id === businessUnitId &&\n role.permissions.some((permission) => permission.permission_id === permissionId),\n );\n }\n // if we don't have any roles, we can't have any permissions\n return true;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MASa,kBAAkB,CAAA;IACrB,yBAAyB,GAAa,EAAE;AAEhD;;;;AAIG;AACI,IAAA,oBAAoB,CAAC,SAAgC,EAAA;AAC1D,QAAA,MAAM,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC,qBAAqB,CAAC,GAAG,IAAI;QAEjE,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,IAAI,KAAK,EAAE;YACnD,MA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,cAFjB,MAAM,EAAA,CAAA;;2FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-session-service-constants.mjs","sources":["../../../projects/opal-frontend-common/services/session-service/constants/session-endpoints.constant.ts","../../../projects/opal-frontend-common/services/session-service/constants/hmcts-opal-frontend-common-services-session-service-constants.ts"],"sourcesContent":["import { ISessionEndpoints } from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\nexport const SESSION_ENDPOINTS: ISessionEndpoints = {\n expiry: '/session/expiry',\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEO,MAAM,iBAAiB,GAAsB;AAClD,IAAA,MAAM,EAAE,iBAAiB;;;ACH3B;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-session-service-interfaces.mjs","sources":["../../../projects/opal-frontend-common/services/session-service/interfaces/hmcts-opal-frontend-common-services-session-service-interfaces.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-session-service-mocks.mjs","sources":["../../../projects/opal-frontend-common/services/session-service/mocks/session-token-expiry.mock.ts","../../../projects/opal-frontend-common/services/session-service/mocks/hmcts-opal-frontend-common-services-session-service-mocks.ts"],"sourcesContent":["import { ISessionTokenExpiry } from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\nexport const SESSION_TOKEN_EXPIRY_MOCK: ISessionTokenExpiry = {\n expiry: 'test',\n warningThresholdInMilliseconds: 5,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEO,MAAM,yBAAyB,GAAwB;AAC5D,IAAA,MAAM,EAAE,MAAM;AACd,IAAA,8BAA8B,EAAE,CAAC;;;ACJnC;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-session-service.mjs","sources":["../../../projects/opal-frontend-common/services/session-service/session.service.ts","../../../projects/opal-frontend-common/services/session-service/hmcts-opal-frontend-common-services-session-service.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { Observable, timer } from 'rxjs';\nimport { retry, shareReplay, tap } from 'rxjs/operators';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { SESSION_ENDPOINTS } from '@hmcts/opal-frontend-common/services/session-service/constants';\nimport { ISessionTokenExpiry } from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\n@Injectable({ providedIn: 'root' })\nexport class SessionService {\n private readonly http = inject(HttpClient);\n private readonly globalStore = inject(GlobalStore);\n private tokenExpiryCache$!: Observable<ISessionTokenExpiry>;\n\n private readonly MAX_RETRIES = 5;\n private readonly RETRY_DELAY_MS = 1000;\n\n /**\n * Always fetch access-token expiry from the server (no in-memory caching).\n * Adds cache-busting query param and no-cache headers.\n */\n public getTokenExpiry(): Observable<ISessionTokenExpiry> {\n this.tokenExpiryCache$ ??= this.http.get<ISessionTokenExpiry>(SESSION_ENDPOINTS.expiry).pipe(\n retry({\n count: this.MAX_RETRIES,\n delay: () => timer(this.RETRY_DELAY_MS),\n }),\n tap((expiry) => {\n this.globalStore.setTokenExpiry(expiry);\n }),\n shareReplay(1),\n );\n return this.tokenExpiryCache$;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MASa,cAAc,CAAA;AACR,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1C,IAAA,iBAAiB;IAER,WAAW,GAAG,CAAC;IACf,cAAc,GAAG,IAAI;AAEtC;;;AAGG;IACI,cAAc,GAAA;AACnB,QAAA,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,CAC1F,KAAK,CAAC;YACJ,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,KAAK,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC;AACxC,SAAA,CAAC,EACF,GAAG,CAAC,CAAC,MAAM,KAAI;AACb,YAAA,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC;AACzC,QAAA,CAAC,CAAC,EACF,WAAW,CAAC,CAAC,CAAC,CACf;QACD,OAAO,IAAI,CAAC,iBAAiB;IAC/B;uGAxBW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADD,MAAM,EAAA,CAAA;;2FACnB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACRlC;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-sort-service-interfaces.mjs","sources":["../../../projects/opal-frontend-common/services/sort-service/interfaces/hmcts-opal-frontend-common-services-sort-service-interfaces.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-sort-service.mjs","sources":["../../../projects/opal-frontend-common/services/sort-service/sort.service.ts","../../../projects/opal-frontend-common/services/sort-service/hmcts-opal-frontend-common-services-sort-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { sort } from 'fast-sort';\nimport {\n ISortServiceConfig,\n ISortServiceValues,\n ISortServiceArrayValues,\n} from '@hmcts/opal-frontend-common/services/sort-service/interfaces';\nimport { SortableValuesType } from '@hmcts/opal-frontend-common/components/abstract/abstract-sortable-table/types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SortService {\n /**\n * Sorts an array of objects based on a specified key and sort type.\n *\n * @param array - The array of objects to be sorted. Each object should implement the `ISortServiceValues` interface.\n * @param config - The configuration object containing the key to sort by and the sort type (ascending or descending).\n * @returns The sorted array of objects.\n *\n * @remarks\n * - If the input array is not an array or the config key is not provided, the original array is returned.\n * - The `sortType` can be either 'ascending' or 'descending'.\n *\n * @example\n * ```typescript\n * const array = [\n * { name: 'Alice', age: 30 },\n * { name: 'Bob', age: 25 },\n * ];\n * const config = { key: 'age', sortType: 'ascending' };\n * const sortedArray = getObjects(array, config);\n * // sortedArray will be:\n * // [\n * // { name: 'Bob', age: 25 },\n * // { name: 'Alice', age: 30 },\n * // ]\n * ```\n */\n private sortObjectArray(\n array: ISortServiceValues<SortableValuesType>[] | null,\n config: ISortServiceConfig,\n ): ISortServiceValues<SortableValuesType>[] | null {\n if (!Array.isArray(array) || !config.key) {\n return array;\n }\n\n const { key, sortType } = config;\n\n if (sortType === 'ascending') {\n return sort(array).asc((obj) => obj[key]);\n } else {\n return sort(array).desc((obj) => obj[key]);\n }\n }\n\n /**\n * Sorts an array of objects in ascending order based on the specified key.\n *\n * @param array - The array of objects to be sorted.\n * @param key - The key of the object property to sort by.\n * @returns The sorted array of objects.\n */\n public sortObjectArrayAsc(\n array: ISortServiceValues<SortableValuesType>[] | null,\n key: string,\n ): ISortServiceValues<SortableValuesType>[] | null {\n return this.sortObjectArray(array, { key, sortType: 'ascending' });\n }\n\n /**\n * Sorts an array of objects in descending order based on the specified key.\n *\n * @param array - The array of objects to be sorted. Each object should implement the ISortServiceValues interface.\n * @param key - The key of the object property to sort by.\n * @returns The sorted array of objects in descending order.\n */\n public sortObjectArrayDesc(\n array: ISortServiceValues<SortableValuesType>[] | null,\n key: string,\n ): ISortServiceValues<SortableValuesType>[] | null {\n return this.sortObjectArray(array, { key, sortType: 'descending' });\n }\n\n /**\n * Sorts an array of values in ascending order.\n *\n * @param array - The array of values to be sorted.\n * @returns The sorted array in ascending order.\n */\n public arraySortAsc(array: ISortServiceArrayValues): ISortServiceArrayValues {\n return sort(array).asc();\n }\n\n /**\n * Sorts an array of values in descending order.\n *\n * @param array - The array of values to be sorted.\n * @returns The sorted array in descending order.\n */\n public arraySortDesc(array: ISortServiceArrayValues): ISortServiceArrayValues {\n return sort(array).desc();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAYa,WAAW,CAAA;AACtB;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;IACK,eAAe,CACrB,KAAsD,EACtD,MAA0B,EAAA;AAE1B,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;AACxC,YAAA,OAAO,KAAK;QACd;AAEA,QAAA,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,MAAM;AAEhC,QAAA,IAAI,QAAQ,KAAK,WAAW,EAAE;AAC5B,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3C;aAAO;AACL,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5C;IACF;AAEA;;;;;;AAMG;IACI,kBAAkB,CACvB,KAAsD,EACtD,GAAW,EAAA;AAEX,QAAA,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;IACpE;AAEA;;;;;;AAMG;IACI,mBAAmB,CACxB,KAAsD,EACtD,GAAW,EAAA;AAEX,QAAA,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;IACrE;AAEA;;;;;AAKG;AACI,IAAA,YAAY,CAAC,KAA8B,EAAA;AAChD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE;IAC1B;AAEA;;;;;AAKG;AACI,IAAA,aAAa,CAAC,KAA8B,EAAA;AACjD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;IAC3B;uGA1FW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAX,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cAFV,MAAM,EAAA,CAAA;;2FAEP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACXD;;AAEG;;;;"}
|
package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service-interfaces.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-transfer-state-service-interfaces.mjs","sources":["../../../projects/opal-frontend-common/services/transfer-state-service/interfaces/hmcts-opal-frontend-common-services-transfer-state-service-interfaces.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-transfer-state-service-mocks.mjs","sources":["../../../projects/opal-frontend-common/services/transfer-state-service/mocks/transfer-state-app-insights-config.mock.ts","../../../projects/opal-frontend-common/services/transfer-state-service/mocks/transfer-state-launch-darkly-config.mock.ts","../../../projects/opal-frontend-common/services/transfer-state-service/mocks/transfer-state.mock.ts","../../../projects/opal-frontend-common/services/transfer-state-service/mocks/hmcts-opal-frontend-common-services-transfer-state-service-mocks.ts"],"sourcesContent":["export const TRANSFER_STATE_APP_INSIGHTS_CONFIG_MOCK = {\n enabled: true,\n connectionString:\n 'InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://your-ingestion-endpoint/',\n cloudRoleName: 'opal-frontend',\n};\n","export const TRANSFER_STATE_LAUNCH_DARKLY_CONFIG_MOCK = {\n enabled: true,\n clientId: '12345',\n stream: true,\n};\n","import { ITransferStateServerState } from '@hmcts/opal-frontend-common/services/transfer-state-service/interfaces';\nimport { TRANSFER_STATE_LAUNCH_DARKLY_CONFIG_MOCK } from './transfer-state-launch-darkly-config.mock';\nimport { TRANSFER_STATE_APP_INSIGHTS_CONFIG_MOCK } from './transfer-state-app-insights-config.mock';\n\nexport const TRANSFER_STATE_MOCK: ITransferStateServerState = {\n launchDarklyConfig: TRANSFER_STATE_LAUNCH_DARKLY_CONFIG_MOCK,\n ssoEnabled: true,\n appInsightsConfig: TRANSFER_STATE_APP_INSIGHTS_CONFIG_MOCK,\n userStateCacheExpirationMilliseconds: 1800000,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAO,MAAM,uCAAuC,GAAG;AACrD,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,gBAAgB,EACd,4GAA4G;AAC9G,IAAA,aAAa,EAAE,eAAe;;;ACJzB,MAAM,wCAAwC,GAAG;AACtD,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,QAAQ,EAAE,OAAO;AACjB,IAAA,MAAM,EAAE,IAAI;;;ACCP,MAAM,mBAAmB,GAA8B;AAC5D,IAAA,kBAAkB,EAAE,wCAAwC;AAC5D,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,iBAAiB,EAAE,uCAAuC;AAC1D,IAAA,oCAAoC,EAAE,OAAO;;;ACR/C;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-transfer-state-service.mjs","sources":["../../../projects/opal-frontend-common/services/transfer-state-service/transfer-state.service.ts","../../../projects/opal-frontend-common/services/transfer-state-service/hmcts-opal-frontend-common-services-transfer-state-service.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { Injectable, PLATFORM_ID, TransferState, inject, makeStateKey } from '@angular/core';\nimport { ITransferStateServerState } from '@hmcts/opal-frontend-common/services/transfer-state-service/interfaces';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TransferStateService {\n private readonly platformId = inject(PLATFORM_ID);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly serverTransferState = inject<ITransferStateServerState | null>('serverTransferState' as any, {\n optional: true,\n });\n private readonly transferState = inject(TransferState);\n\n private readonly globalStore = inject(GlobalStore);\n private readonly storedServerTransferState!: ITransferStateServerState;\n\n constructor() {\n const storeKeyTransferState = makeStateKey<ITransferStateServerState>('serverTransferState');\n\n if (isPlatformBrowser(this.platformId)) {\n // get user state from transfer state if browser side\n this.serverTransferState = this.transferState.get(storeKeyTransferState, null);\n\n if (this.serverTransferState) {\n this.storedServerTransferState = this.serverTransferState;\n }\n } else {\n // server side: store server transfer state\n this.transferState.set(storeKeyTransferState, this.serverTransferState);\n }\n }\n\n /**\n * Initializes the SSO (Single Sign-On) enabled state.\n * Sets the SSO enabled state based on the stored server transfer state.\n */\n public initializeSsoEnabled(): void {\n this.globalStore.setSsoEnabled(this.storedServerTransferState?.ssoEnabled);\n }\n\n /**\n * Initializes the LaunchDarkly configuration by assigning the stored server transfer state's\n * launchDarklyConfig value to the globalStore's launchDarklyConfig property.\n */\n public initializeLaunchDarklyConfig(): void {\n this.globalStore.setLaunchDarklyConfig(this.storedServerTransferState?.launchDarklyConfig);\n }\n\n /**\n * Initializes the Application Insights configuration by assigning the stored server transfer state's\n * appInsightsConfig value to the globalStore's appInsightsConfig property.\n */\n public initializeAppInsightsConfig(): void {\n this.globalStore.setAppInsightsConfig(this.storedServerTransferState?.appInsightsConfig);\n }\n\n /**\n * Initializes the user state cache expiration time in milliseconds.\n * This method retrieves the `userStateCacheExpirationMilliseconds` value\n * from the stored server transfer state and sets it in the global store.\n *\n * @remarks\n * Ensure that `storedServerTransferState` is properly populated before\n * calling this method to avoid setting an undefined value.\n */\n public initializeUserStateCacheExpirationMilliseconds(): void {\n this.globalStore.setUserStateCacheExpirationMilliseconds(\n this.storedServerTransferState?.userStateCacheExpirationMilliseconds,\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAQa,oBAAoB,CAAA;AACd,IAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;;AAEhC,IAAA,mBAAmB,GAAG,MAAM,CAAmC,qBAA4B,EAAE;AAC5G,QAAA,QAAQ,EAAE,IAAI;AACf,KAAA,CAAC;AACe,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AAErC,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,yBAAyB;AAE1C,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,qBAAqB,GAAG,YAAY,CAA4B,qBAAqB,CAAC;AAE5F,QAAA,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;;AAEtC,YA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D;;AAEG;;;;"}
|
package/fesm2022/hmcts-opal-frontend-common-services-transformation-service-constants.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-transformation-service-constants.mjs","sources":["../../../projects/opal-frontend-common/services/transformation-service/constants/transform-item.constant.ts","../../../projects/opal-frontend-common/services/transformation-service/constants/hmcts-opal-frontend-common-services-transformation-service-constants.ts"],"sourcesContent":["import { ITransformItem } from '@hmcts/opal-frontend-common/services/transformation-service/interfaces';\n\nexport const TRANSFORM_ITEM_DEFAULTS: Pick<ITransformItem, 'dateConfig' | 'timeConfig'> = {\n dateConfig: null,\n timeConfig: null,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEO,MAAM,uBAAuB,GAAsD;AACxF,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,UAAU,EAAE,IAAI;;;ACJlB;;AAEG;;;;"}
|
package/fesm2022/hmcts-opal-frontend-common-services-transformation-service-interfaces.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-transformation-service-interfaces.mjs","sources":["../../../projects/opal-frontend-common/services/transformation-service/interfaces/hmcts-opal-frontend-common-services-transformation-service-interfaces.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-transformation-service.mjs","sources":["../../../projects/opal-frontend-common/services/transformation-service/transformation.service.ts","../../../projects/opal-frontend-common/services/transformation-service/hmcts-opal-frontend-common-services-transformation-service.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { ITransformItem } from '@hmcts/opal-frontend-common/services/transformation-service/interfaces';\nimport { DateService } from '@hmcts/opal-frontend-common/services/date-service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TransformationService {\n private readonly dateService = inject(DateService);\n\n /**\n * Applies a transformation to the given value based on the specified transformation configuration.\n *\n * @param value - The value to be transformed.\n * @param transformItem - The configuration for the transformation, including the type of transformation and any necessary format details.\n * @returns The transformed value, or the original value if no transformation is applied.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private applyTransformation(value: any, transformItem: ITransformItem): any {\n if (!value) {\n return value;\n }\n\n if (transformItem.transformType === 'date' && transformItem.dateConfig) {\n const parsedDate = this.dateService.getFromFormat(value, transformItem.dateConfig.inputFormat);\n if (this.dateService.isValidDate(parsedDate)) {\n return this.dateService.toFormat(parsedDate, transformItem.dateConfig.outputFormat);\n }\n return value;\n }\n\n if (transformItem.transformType === 'time' && transformItem.timeConfig) {\n if (transformItem.timeConfig.addOffset) {\n // Add offset to the time value\n return `${value}:00Z`;\n } else if (transformItem.timeConfig.removeOffset) {\n // Remove offset from the time value\n return value.replace(/:00Z$/, '');\n }\n }\n\n return value;\n }\n\n /**\n * Transforms the values of an object based on a given transformation configuration.\n *\n * @param obj - The object whose values need to be transformed. It should be a non-null object.\n * @param toTransform - An array of transformation configurations, where each configuration specifies\n * the key to transform and the transformation details.\n * @returns The transformed object with values modified according to the transformation configuration.\n *\n * @remarks\n * - If the input `obj` is not an object or is null, it returns the input as is.\n * - The function recursively processes nested objects.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public transformObjectValues(obj: { [key: string]: any }, toTransform: ITransformItem[]): any {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n\n for (const [key, value] of Object.entries(obj)) {\n const transformItem = toTransform.find((item) => item.key === key);\n\n if (transformItem) {\n obj[key] = this.applyTransformation(value, transformItem);\n } else if (Array.isArray(value)) {\n obj[key] = value.map((item) =>\n typeof item === 'object' ? this.transformObjectValues(item, toTransform) : item,\n );\n } else if (typeof value === 'object') {\n obj[key] = this.transformObjectValues(value, toTransform); // Recursive call\n }\n }\n return obj;\n }\n\n /**\n * replaces the keys in the object provided\n * by replacing the current prefix with a new prefix.\n * Useful when mapping object keys to a different format or structure.\n * @param data - The data object containing key-value pairs.\n * @param currentPrefix - The prefix to be replaced in the keys.\n * @param replacementPrefix - The prefix to replace the current prefix with.\n * @returns A new object with the keys replaced.\n * @template T - The type of the form data object.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public replaceKeys<T extends object>(data: T, currentPrefix: string, replacementPrefix: string): Record<string, any> {\n if (typeof data !== 'object' || data === null) {\n return {};\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const newKey = key.replace(currentPrefix, replacementPrefix);\n result[newKey] = value;\n }\n\n return result;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,qBAAqB,CAAA;AACf,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAElD;;;;;;AAMG;;IAEK,mBAAmB,CAAC,KAAU,EAAE,aAA6B,EAAA;QACnE,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,OAAO,KAAK;QACd;QAEA,IAAI,aAAa,CAAC,aAAa,KAAK,MAAM,IAAI,aAAa,CAAC,UAAU,EAAE;AACtE,YAAA,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC;YAC9F,IAAI,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;AAC5C,gBAAA,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,YAAY,CAAC;YACrF;AACA,YAAA,OAAO,KAAK;QACd;QAEA,IAAI,aAAa,CAAC,aAAa,KAAK,MAAM,IAAI,aAAa,CAAC,UAAU,EAAE;AACtE,YAAA,IAAI,aAAa,CAAC,UAAU,CAAC,SAAS,EAAE;;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,EAAE,iBAAyB,EAAA;QAC5F,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;AAC7C,YAAA,OAAO,EAAE;QACX;;QAEA,MAAM,MAAM,GAAwB,EAAE;AAEtC,QAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC/C,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,iBAAiB,CAAC;AAC5D,YAAA,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK;QACxB;AAEA,QAAA,OAAO,MAAM;IACf;uGA/FW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAArB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cAFpB,MAAM,EAAA,CAAA;;2FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-utils-service.mjs","sources":["../../../projects/opal-frontend-common/services/utils-service/utils.service.ts","../../../projects/opal-frontend-common/services/utils-service/hmcts-opal-frontend-common-services-utils-service.ts"],"sourcesContent":["import { ViewportScroller } from '@angular/common';\nimport { inject, Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UtilsService {\n private readonly viewportScroller = inject(ViewportScroller);\n\n /**\n * Converts the first letter of a string to uppercase.\n * @param str - The input string.\n * @returns The input string with the first letter capitalized.\n */\n public upperCaseFirstLetter(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }\n\n /**\n * Converts the entire string to uppercase.\n * @param str - The input string.\n * @returns The input string in uppercase.\n */\n public upperCaseAllLetters(str: string): string {\n return str.toUpperCase();\n }\n\n /**\n * Converts a number to a monetary string representation.\n * @param amount - The number to convert.\n * @returns The monetary string representation of the number.\n */\n public convertToMonetaryString(amount: number | string): string {\n let negativeValue = false;\n if (typeof amount === 'string') {\n amount = Number.parseFloat(amount);\n }\n if (amount < 0) {\n negativeValue = true;\n amount = Math.abs(amount);\n }\n return `${negativeValue ? '-' : ''}£${amount.toFixed(2)}`;\n }\n\n /**\n * Formats a 6-digit number or string as a sort code.\n * @param value - The 6-digit value to format.\n * @returns The formatted sort code string (xx-xx-xx).\n */\n public formatSortCode(value: string | number): string {\n const sortCode = value.toString();\n return `${sortCode.slice(0, 2)}-${sortCode.slice(2, 4)}-${sortCode.slice(4, 6)}`;\n }\n\n /**\n * Filters out null or empty strings from an array of address lines.\n *\n * @param address - An array of address lines which may contain strings or null values.\n * @returns A new array containing only non-empty strings from the input array.\n */\n public formatAddress(address: (string | null)[]): string[] {\n return address.filter((line): line is string => !!line?.trim());\n }\n\n /**\n * Scrolls the viewport to the top of the page.\n * Utilizes the `viewportScroller` service to scroll to the position [0, 0].\n */\n public scrollToTop(): void {\n this.viewportScroller.scrollToPosition([0, 0]);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public checkFormValues(form: { [key: string]: any }): boolean {\n return Object.values(form).some((value) => {\n return Array.isArray(value) ? value.length > 0 : Boolean(value);\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public checkFormArrayValues(forms: { [key: string]: any }[]): boolean {\n return forms.every((form) => this.checkFormValues(form));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public getFormStatus(form: { [key: string]: any }, providedMessage: string, notProvidedMessage: string): string {\n return this.checkFormValues(form) ? providedMessage : notProvidedMessage;\n }\n\n public getArrayFormStatus(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n forms: { [key: string]: any }[],\n providedMessage: string,\n notProvidedMessage: string,\n ): string {\n return forms.every((form) => this.checkFormValues(form)) ? providedMessage : notProvidedMessage;\n }\n\n /**\n * Copies the provided string value to the clipboard.\n *\n * @param value - The string value to be copied to the clipboard.\n *\n * @remarks\n * This method uses the `navigator.clipboard.writeText` API to copy text to the clipboard.\n * Ensure that the browser supports the Clipboard API before using this method.\n */\n public copyToClipboard(value: string): Promise<void> {\n return navigator.clipboard.writeText(value);\n }\n\n /**\n * Recursively filters out properties from an object where the value is `null` or `undefined`.\n *\n * @param obj - The object to filter. Can include nested objects.\n * @returns A new object with only non-null and non-undefined values.\n *\n * @example\n * ```ts\n * const input = {\n * a: 1,\n * b: null,\n * c: undefined,\n * d: 'hello',\n * e: { x: null, y: 2 },\n * f: { z: undefined },\n * };\n * const result = filterNullOrUndefined(input);\n * console.log(result); // Output: { a: 1, d: 'hello', e: { y: 2 } }\n * ```\n */\n public filterNullOrUndefined(obj: Record<string, unknown>): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(obj)\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .filter(([_, value]) => value !== null && value !== undefined)\n .map(([key, value]) => {\n if (typeof value === 'object' && !Array.isArray(value) && value !== null) {\n return [key, this.filterNullOrUndefined(value as Record<string, unknown>)];\n }\n return [key, value];\n }),\n );\n }\n\n /**\n * Strips out the first parentheses block from the given text.\n * This method looks for the first occurrence of parentheses in the text,\n * removes the content within them, and returns the modified text.\n * @param {string} text - The text from which to strip the first parentheses block.\n * @returns {string} - The modified text with the first parentheses block removed.\n */\n public stripFirstParenthesesBlock(text: string): string {\n const open = text.indexOf('(');\n const close = text.indexOf(')', open);\n if (open !== -1 && close !== -1 && close > open) {\n const before = text.slice(0, open);\n const after = text.slice(close + 1);\n return (before + after).trim();\n }\n return text.trim();\n }\n\n /**\n * Determines whether the provided object has at least one property set to a meaningful value.\n *\n * A property is considered \"set\" if:\n * - It is a boolean and its value is `true`.\n * - It is not a boolean and its value is neither `null` nor an empty string.\n *\n * @param value - The object to check for set properties. Can be `null` or `undefined`.\n * @returns `true` if at least one property is set; otherwise, `false`.\n */\n public hasSetProperty(value: object | null | undefined): boolean {\n return Object.values(value ?? {}).some((v) => (typeof v === 'boolean' ? v === true : v !== null && v !== ''));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAMa,YAAY,CAAA;AACN,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAE5D;;;;AAIG;AACI,IAAA,oBAAoB,CAAC,GAAW,EAAA;AACrC,QAAA,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD;AAEA;;;;AAIG;AACI,IAAA,mBAAmB,CAAC,GAAW,EAAA;AACpC,QAAA,OAAO,GAAG,CAAC,WAAW,EAAE;IAC1B;AAEA;;;;AAIG;AACI,IAAA,uBAAuB,CAAC,MAAuB,EAAA;QACpD,IAAI,aAAa,GAAG,KAAK;AACzB,QAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC9B,YAAA,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC;QACpC;AACA,QAAA,IAAI,MAAM,GAAG,CAAC,EAAE;YACd,aAAa,GAAG,IAAI;AACpB,YAAA,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;QAC3B;AACA,QAAA,OAAO,GAAG,aAAa,GAAG,GAAG,GAAG,EAAE,CAAA,CAAA,EAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;IAC3D;AAEA;;;;AAIG;AACI,IAAA,cAAc,CAAC,KAAsB,EAAA;AAC1C,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE;AACjC,QAAA,OAAO,CAAA,E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AAE;QAChC;AACA,QAAA,OAAO,IAAI,CAAC,IAAI,EAAE;IACpB;AAEA;;;;;;;;;AASG;AACI,IAAA,cAAc,CAAC,KAAgC,EAAA;AACpD,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,KAAK,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IAC/G;uGAzKW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAZ,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cAFX,MAAM,EAAA,CAAA;;2FAEP,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-sign-in-stub.component-B87UHy9K.mjs","sources":["../../../projects/opal-frontend-common/pages/sign-in/sign-in-stub/sign-in-stub.component.ts","../../../projects/opal-frontend-common/pages/sign-in/sign-in-stub/sign-in-stub.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { ISignInStubForm } from '../interfaces/sign-in-stub-form.interface';\nimport { GovukTextInputComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-text-input';\nimport { GovukButtonComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-button';\n\n@Component({\n selector: 'opal-lib-sign-in-stub',\n imports: [FormsModule, ReactiveFormsModule, GovukTextInputComponent, GovukButtonComponent],\n templateUrl: './sign-in-stub.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SignInStubComponent implements OnInit {\n @Output() private readonly signInFormSubmit = new EventEmitter<ISignInStubForm>();\n\n public signInForm!: FormGroup;\n\n /**\n * Sets up the sign-in form.\n */\n private setupSignInForm(): void {\n this.signInForm = new FormGroup({\n email: new FormControl(null, [Validators.required]),\n });\n }\n\n /**\n * Handles the form submission.\n * If the signInForm is valid, emits the signInForm value using the signInFormSubmit event.\n */\n public handleFormSubmit(): void {\n if (this.signInForm.valid) {\n this.signInFormSubmit.emit(this.signInForm.value);\n }\n }\n\n public ngOnInit(): void {\n this.setupSignInForm();\n }\n}\n","<form (submit)=\"handleFormSubmit()\">\n <div class=\"govuk-grid-column-two-thirds\">\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 class=\"govuk-fieldset__heading\">Sign in</h1>\n </legend>\n\n <div [formGroup]=\"signInForm\">\n <opal-lib-govuk-text-input\n labelText=\"Email\"\n inputId=\"email\"\n inputName=\"email\"\n inputClasses=\"govuk-!-width-one-half\"\n [control]=\"signInForm.controls['email']\"\n ></opal-lib-govuk-text-input>\n </div>\n </fieldset>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-one-third\">\n <opal-lib-govuk-button buttonId=\"submitForm\" type=\"submit\"> Sign in</opal-lib-govuk-button>\n </div>\n </div>\n </div>\n</form>\n"],"names":[],"mappings":";;;;;;;MAYa,mBAAmB,CAAA;AACH,IAAA,gBAAgB,GAAG,IAAI,YAAY,EAAmB;AAE1E,IAAA,UAAU;AAEjB;;AAEG;IACK,eAAe,GAAA;AACrB,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,SAAS,CAAC;YAC9B,KAAK,EAAE,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC,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A,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAI9E,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAN/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,EAAA,OAAA,EACxB,CAAC,WAAW,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,oBAAoB,CAAC,EAAA,eAAA,EAEzE,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,g2BAAA,EAAA;;sBAG9C;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-sign-in.component-BjLHMHMm.mjs","sources":["../../../projects/opal-frontend-common/pages/sign-in/sign-in.component.ts","../../../projects/opal-frontend-common/pages/sign-in/sign-in.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { SignInStubComponent } from './sign-in-stub/sign-in-stub.component';\nimport { ISignInStubForm } from './interfaces/sign-in-stub-form.interface';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { SSO_ENDPOINTS } from '@hmcts/opal-frontend-common/services/auth-service/constants';\n\n@Component({\n selector: 'opal-lib-sign-in',\n imports: [SignInStubComponent],\n templateUrl: './sign-in.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SignInComponent {\n private readonly document = inject(DOCUMENT);\n\n public readonly globalStore = inject(GlobalStore);\n public ssoEnabled: boolean | null = true;\n\n /**\n * Handles the submission of the stub sign-in form.\n * Redirects the user to the SSO login page with the provided email.\n * @param formData - The form data containing the email.\n */\n public handleStubSignInFormSubmit(formData: ISignInStubForm): void {\n this.document.location.href = `${SSO_ENDPOINTS.login}?email=${formData.email}`;\n }\n}\n","@defer (when !globalStore.ssoEnabled()) {\n <opal-lib-sign-in-stub (signInFormSubmit)=\"hand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"file":"hmcts-opal-frontend-common-stores-global-constants.mjs","sources":["../../../projects/opal-frontend-common/stores/global/constants/global-store-error-state.constant.ts","../../../projects/opal-frontend-common/stores/global/constants/hmcts-opal-frontend-common-stores-global-constants.ts"],"sourcesContent":["import { IGlobalErrorState } from '@hmcts/opal-frontend-common/stores/global/interfaces';\n\nexport const GLOBAL_ERROR_STATE: IGlobalErrorState = {\n error: null,\n title: null,\n message: null,\n operationId: null,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAsB;AACnD,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,WAAW,EAAE,IAAI;;;ACNnB;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-stores-global-interfaces.mjs","sources":["../../../projects/opal-frontend-common/stores/global/interfaces/hmcts-opal-frontend-common-stores-global-interfaces.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-stores-global-types.mjs","sources":["../../../projects/opal-frontend-common/stores/global/types/hmcts-opal-frontend-common-stores-global-types.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-stores-global.mjs","sources":["../../../projects/opal-frontend-common/stores/global/global.store.ts","../../../projects/opal-frontend-common/stores/global/hmcts-opal-frontend-common-stores-global.ts"],"sourcesContent":["import { patchState, signalStore, withMethods, withState } from '@ngrx/signals';\nimport { LDFlagSet } from 'launchdarkly-js-client-sdk';\nimport {\n ITransferStateLaunchDarklyConfig,\n ITransferStateAppInsightsConfig,\n} from '@hmcts/opal-frontend-common/services/transfer-state-service/interfaces';\nimport { ISessionTokenExpiry } from '@hmcts/opal-frontend-common/services/session-service/interfaces';\nimport { IGlobalErrorState } from '@hmcts/opal-frontend-common/stores/global/interfaces';\nimport { IOpalUserState } from '@hmcts/opal-frontend-common/services/opal-user-service/interfaces';\nimport { GLOBAL_ERROR_STATE } from '@hmcts/opal-frontend-common/stores/global/constants';\nexport const GlobalStore = signalStore(\n { providedIn: 'root' },\n withState(() => ({\n authenticated: false,\n bannerError: { ...GLOBAL_ERROR_STATE },\n featureFlags: {} as LDFlagSet,\n userState: {} as IOpalUserState,\n ssoEnabled: false,\n launchDarklyConfig: {} as ITransferStateLaunchDarklyConfig,\n appInsightsConfig: {} as ITransferStateAppInsightsConfig,\n tokenExpiry: {} as ISessionTokenExpiry,\n userStateCacheExpirationMilliseconds: 1800000,\n })),\n withMethods((store) => ({\n setAuthenticated: (authenticated: boolean) => {\n patchState(store, { authenticated });\n },\n setBannerError: (error: IGlobalErrorState) => {\n patchState(store, { bannerError: error });\n },\n resetBannerError: () => {\n patchState(store, { bannerError: { ...GLOBAL_ERROR_STATE } });\n },\n setFeatureFlags: (featureFlags: LDFlagSet) => {\n patchState(store, { featureFlags });\n },\n setUserState: (userState: IOpalUserState) => {\n patchState(store, { userState });\n },\n setSsoEnabled: (ssoEnabled: boolean) => {\n patchState(store, { ssoEnabled });\n },\n setLaunchDarklyConfig: (config: ITransferStateLaunchDarklyConfig) => {\n patchState(store, { launchDarklyConfig: config });\n },\n setAppInsightsConfig: (config: ITransferStateAppInsightsConfig) => {\n patchState(store, { appInsightsConfig: config });\n },\n setTokenExpiry: (tokenExpiry: ISessionTokenExpiry) => {\n patchState(store, { tokenExpiry });\n },\n setUserStateCacheExpirationMilliseconds: (milliseconds: number) => {\n patchState(store, { userStateCacheExpirationMilliseconds: milliseconds });\n },\n })),\n);\n","/**\n * Generated bundle index. Do not edit.\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CAAC,MAAwC,KAAI;QAClE,UAAU,CAAC,KAAK,EAAE,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IACnD,CAAC;AACD,IAAA,oBAAoB,EAAE,CAAC,MAAuC,KAAI;QAChE,UAAU,CAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAClD,CAAC;AACD,IAAA,cAAc,EAAE,CAAC,WAAgC,KAAI;AACnD,QAAA,UAAU,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC;IACpC,CAAC;AACD,IAAA,uCAAuC,EAAE,CAAC,YAAoB,KAAI;QAChE,UAAU,CAAC,KAAK,EAAE,EAAE,oCAAoC,EAAE,YAAY,EAAE,CAAC;IAC3E,CAAC;CACF,CAAC,CAAC;;ACtDL;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-types.mjs","sources":["../../../projects/opal-frontend-common/types/hmcts-opal-frontend-common-types.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-amount.mjs","sources":["../../../projects/opal-frontend-common/validators/amount/amount.validator.ts","../../../projects/opal-frontend-common/validators/amount/hmcts-opal-frontend-common-validators-amount.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport function amountValidator(maxIntegers: number, maxDecimals: number): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control.value === null || control.value === undefined || control.value === '') {\n return null;\n }\n\n // Ensure the value is numerical, allowing only digits and optionally one decimal point\n if (Number.isNaN(Number(control.value))) {\n return { invalidAmountValue: true };\n }\n\n // Regex to match numbers with the specified integer and decimal places\n const regex = new RegExp(String.raw`^-?(0|[1-9]\\d{0,${maxIntegers - 1}})(.\\d{0,${maxDecimals}})?$`);\n\n return regex.test(control.value) ? null : { invalidAmount: true };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,eAAe,CAAC,WAAmB,EAAE,WAAmB,EAAA;IACtE,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,KAAK,EAAE,EAAE;AACjF,YAAA,OAAO,IAAI;QACb;;AAGA,QAAA,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;AACvC,YAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE;QACrC;;AAGA,QAAA,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,CAAA,gBAAA,EAAmB,WAAW,GAAG,CAAC,YAAY,WAAW,CAAA,IAAA,CAAM,CAAC;QAEnG,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE;AACnE,IAAA,CAAC;AACH;;AClBA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-date-after-year.mjs","sources":["../../../projects/opal-frontend-common/validators/date-after-year/date-after-year.validator.ts","../../../projects/opal-frontend-common/validators/date-after-year/hmcts-opal-frontend-common-validators-date-after-year.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function dateAfterYearValidator(year: number): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const yearInput = Number(control.value.split('/')[2]);\n\n if (yearInput <= year) {\n return { invalidYear: { value: control.value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,sBAAsB,CAAC,IAAY,EAAA;IACjD,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAErD,YAAA,IAAI,SAAS,IAAI,IAAI,EAAE;gBACrB,OAAO,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;YAClD;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACbA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-date-before.mjs","sources":["../../../projects/opal-frontend-common/validators/date-before/date-before.validator.ts","../../../projects/opal-frontend-common/validators/date-before/hmcts-opal-frontend-common-validators-date-before.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function dateBeforeValidator(targetDate: Date | null): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const inputValue = control.value;\n if (!inputValue || !targetDate) {\n return null;\n }\n\n const [day, month, year] = inputValue.split('/').map(Number);\n const inputDate = new Date(year, month - 1, day);\n\n if (inputDate < targetDate) {\n return { dateNotBefore: { value: inputValue } };\n }\n\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,mBAAmB,CAAC,UAAuB,EAAA;IACzD,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK;AAChC,QAAA,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,EAAE;AAC9B,YAAA,OAAO,IAAI;QACb;AAEA,QAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;AAC5D,QAAA,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC;AAEhD,QAAA,IAAI,SAAS,GAAG,UAAU,EAAE;YAC1B,OAAO,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;QACjD;AAEA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;AClBA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-date-of-birth.mjs","sources":["../../../projects/opal-frontend-common/validators/date-of-birth/date-of-birth.validator.ts","../../../projects/opal-frontend-common/validators/date-of-birth/hmcts-opal-frontend-common-validators-date-of-birth.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function dateOfBirthValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value) {\n const [day, month, year] = value.split('/').map((part: string) => Number.parseInt(part, 10));\n const date = new Date(year, month - 1, day);\n\n // Check if the date is in the past\n const today = new Date();\n // Set the time of today to the start of the day to avoid time comparison issues\n today.setHours(0, 0, 0, 0);\n\n if (date >= today) {\n return { invalidDateOfBirth: { value: value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,oBAAoB,GAAA;IAClC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,EAAE;AACT,YAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAY,KAAK,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5F,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC;;AAG3C,YAAA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;;YAExB,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAE1B,YAAA,IAAI,IAAI,IAAI,KAAK,EAAE;gBACjB,OAAO,EAAE,kBAAkB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACjD;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACpBA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-future-date.mjs","sources":["../../../projects/opal-frontend-common/validators/future-date/future-date.validator.ts","../../../projects/opal-frontend-common/validators/future-date/hmcts-opal-frontend-common-validators-future-date.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function futureDateValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const [day, month, year] = control.value.split('/');\n const date = new Date(Date.parse(`${month}/${day}/${year}`));\n\n // Check if the date is in the future\n const today = new Date();\n\n if (date >= today) {\n return { invalidFutureDate: { value: control.value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,mBAAmB,GAAA;IACjC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AACnD,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA,EAAG,KAAK,IAAI,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAC,CAAC;;AAG5D,YAAA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;AAExB,YAAA,IAAI,IAAI,IAAI,KAAK,EAAE;gBACjB,OAAO,EAAE,iBAAiB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;YACxD;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-invalid-value.mjs","sources":["../../../projects/opal-frontend-common/validators/invalid-value/invalid-value.validator.ts","../../../projects/opal-frontend-common/validators/invalid-value/hmcts-opal-frontend-common-validators-invalid-value.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport function invalidValueValidator(invalidValues: string[]): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control.value === null || control.value === undefined || control.value === '') {\n return null;\n }\n\n return invalidValues.includes(control.value) ? { valueInArray: true } : null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,qBAAqB,CAAC,aAAuB,EAAA;IAC3D,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,KAAK,EAAE,EAAE;AACjF,YAAA,OAAO,IAAI;QACb;QAEA,OAAO,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAI;AAC9E,IAAA,CAAC;AACH;;ACVA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-national-insurance-number.mjs","sources":["../../../projects/opal-frontend-common/validators/national-insurance-number/national-insurance-number.validator.ts","../../../projects/opal-frontend-common/validators/national-insurance-number/hmcts-opal-frontend-common-validators-national-insurance-number.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function nationalInsuranceNumberValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value) {\n // Check if the value has exactly 9 characters and matches the National Insurance number format\n const ninoRegex = /^[A-Z]{2}\\d{6}[A-D]$/;\n if (value.length !== 9 || !ninoRegex.test(value)) {\n return { nationalInsuranceNumberPattern: { value: value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,gCAAgC,GAAA;IAC9C,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,EAAE;;YAET,MAAM,SAAS,GAAG,sBAAsB;AACxC,YAAA,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;gBAChD,OAAO,EAAE,8BAA8B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC7D;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACdA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-optional-max-length.mjs","sources":["../../../projects/opal-frontend-common/validators/optional-max-length/optional-max-length.validator.ts","../../../projects/opal-frontend-common/validators/optional-max-length/hmcts-opal-frontend-common-validators-optional-max-length.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl, Validators } from '@angular/forms';\n\nexport function optionalMaxLengthValidator(maxLength: number): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n return Validators.maxLength(maxLength)(control);\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEM,SAAU,0BAA0B,CAAC,SAAiB,EAAA;IAC1D,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,OAAO,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC;QACjD;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACTA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-optional-valid-date.mjs","sources":["../../../projects/opal-frontend-common/validators/optional-valid-date/optional-valid-date.validator.ts","../../../projects/opal-frontend-common/validators/optional-valid-date/hmcts-opal-frontend-common-validators-optional-valid-date.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function optionalValidDateValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n const value = control.value;\n if (value) {\n // Check if the value matches the format dd/MM/yyyy\n const dateRegex = /^(\\d{2})\\/(\\d{2})\\/(\\d{4})$/;\n const match = value.match(dateRegex);\n\n if (!match) {\n return { invalidDateFormat: { value: value } };\n }\n\n const [, day, month, year] = match;\n\n // Check if the date is valid\n const date = new Date(`${year}-${month}-${day}`);\n if (\n date.getDate() !== Number.parseInt(day, 10) ||\n date.getMonth() + 1 !== Number.parseInt(month, 10) ||\n date.getFullYear() !== Number.parseInt(year, 10)\n ) {\n return { invalidDate: { value: value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,0BAA0B,GAAA;IACxC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;QAC3B,IAAI,KAAK,EAAE;;YAET,MAAM,SAAS,GAAG,6BAA6B;YAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;YAEpC,IAAI,CAAC,KAAK,EAAE;gBACV,OAAO,EAAE,iBAAiB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAChD;YAEA,MAAM,GAAG,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,KAAK;;AAGlC,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,KAAK,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE,CAAC;AAChD,YAAA,IACE,IAAI,CAAC,OAAO,EAAE,KAAK,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC;AAC3C,gBAAA,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;AAClD,gBAAA,IAAI,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,EAChD;gBACA,OAAO,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC1C;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;AC5BA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-optional-valid-telephone.mjs","sources":["../../../projects/opal-frontend-common/validators/optional-valid-telephone/optional-valid-telephone.validator.ts","../../../projects/opal-frontend-common/validators/optional-valid-telephone/hmcts-opal-frontend-common-validators-optional-valid-telephone.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function optionalPhoneNumberValidator(): ValidatorFn {\n const numericPattern = /^[\\d\\s]*$/;\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const valueWithoutSpaces = control.value.replaceAll(/\\s+/g, '');\n const isValidPattern = numericPattern.test(control.value);\n const isValidLength = valueWithoutSpaces.length === 11;\n const valid = isValidPattern && isValidLength;\n return valid ? null : { phoneNumberPattern: { value: control.value } };\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,4BAA4B,GAAA;IAC1C,MAAM,cAAc,GAAG,WAAW;IAClC,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC;YAC/D,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AACzD,YAAA,MAAM,aAAa,GAAG,kBAAkB,CAAC,MAAM,KAAK,EAAE;AACtD,YAAA,MAAM,KAAK,GAAG,cAAc,IAAI,aAAa;AAC7C,YAAA,OAAO,KAAK,GAAG,IAAI,GAAG,EAAE,kBAAkB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;QACxE;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACdA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-over-eighteen.mjs","sources":["../../../projects/opal-frontend-common/validators/over-eighteen/over-eighteen.validator.ts","../../../projects/opal-frontend-common/validators/over-eighteen/hmcts-opal-frontend-common-validators-over-eighteen.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl, ValidationErrors } from '@angular/forms';\nimport { DateService } from '@hmcts/opal-frontend-common/services/date-service';\n\n/**\n * Validates whether a date, constructed from provided form controls for day, month and year\n * is at least 18 years in the past.\n *\n * @param dayControl - Name of the control for the day portion of the date\n * @param monthControl - Name of the control for the month portion of the date\n * @param yearControl - Name of the control for the year portion of the date\n * @param dateService - An instance of DateService\n * @returns Validator function that returns null if the date is valid and the age is 18 years older,\n * or an error object within { underEighteen: true } if under 18.\n */\nexport const overEighteenValidator = (\n dayControl: string,\n monthControl: string,\n yearControl: string,\n dateService: DateService,\n): ValidatorFn => {\n return (group: AbstractControl): ValidationErrors | null => {\n const day = group.get(dayControl);\n const month = group.get(monthControl);\n const year = group.get(yearControl);\n\n // Return if controls are not defined or values are not provided\n if (!day || !month || !year || !day.value || !month.value || !year.value) {\n return null;\n }\n\n // Format day and month to ensure two digits\n const formattedDay = day.value.toString().padStart(2, '0');\n const formattedMonth = month.value.toString().padStart(2, '0');\n const formattedYear = year.value.toString();\n\n // Create the date string in the format dd/MM/yyyy\n const dateValue = `${formattedDay}/${formattedMonth}/${formattedYear}`;\n const inputDate = dateService.getFromFormat(dateValue, 'dd/MM/yyyy');\n\n if (inputDate.isValid) {\n // Verify if the entered date is at least 18 years in the past\n const underEighteen = inputDate.diffNow('years').years > -18;\n\n if (underEighteen) {\n year.setErrors({ underEighteen: true });\n return { underEighteen: true };\n } else {\n year.setErrors(null);\n return null;\n }\n } else {\n return null;\n }\n };\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAGA;;;;;;;;;;AAUG;AACI,MAAM,qBAAqB,GAAG,CACnC,UAAkB,EAClB,YAAoB,EACpB,WAAmB,EACnB,WAAwB,KACT;IACf,OAAO,CAAC,KAAsB,KAA6B;QACzD,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC;QACjC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;;QAGnC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;AACxE,YAAA,OAAO,IAAI;QACb;;AAGA,QAAA,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAC1D,QAAA,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;QAC9D,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;;QAG3C,MAAM,SAAS,GAAG,CAAA,EAAG,YAAY,IAAI,cAAc,CAAA,CAAA,EAAI,aAAa,CAAA,CAAE;QACtE,MAAM,SAAS,GAAG,WAAW,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,CAAC;AAEpE,QAAA,IAAI,SAAS,CAAC,OAAO,EAAE;;AAErB,YAAA,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE;YAE5D,IAAI,aAAa,EAAE;gBACjB,IAAI,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AACvC,gBAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE;YAChC;iBAAO;AACL,gBAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;AACpB,gBAAA,OAAO,IAAI;YACb;QACF;aAAO;AACL,YAAA,OAAO,IAAI;QACb;AACF,IAAA,CAAC;AACH;;ACtDA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-past-date.mjs","sources":["../../../projects/opal-frontend-common/validators/past-date/past-date.validator.ts","../../../projects/opal-frontend-common/validators/past-date/hmcts-opal-frontend-common-validators-past-date.ts"],"sourcesContent":["import { ValidatorFn, AbstractControl } from '@angular/forms';\n\nexport function pastDateValidator(): ValidatorFn {\n const today = new Date();\n today.setHours(0, 0, 0, 0); // Set time to start of the day to avoid time comparison issues\n\n return (control: AbstractControl): { [key: string]: unknown } | null => {\n if (control.value) {\n const [day, month, year] = control.value.split('/');\n const date = new Date(Date.parse(`${month}/${day}/${year}`));\n\n // Check if the date is in the past\n if (date < today) {\n return { invalidPastDate: { value: control.value } };\n }\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"SAEgB,iBAAiB,GAAA;AAC/B,IAAA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE;AACxB,IAAA,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3B,OAAO,CAAC,OAAwB,KAAuC;AACrE,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,YAAA,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AACnD,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA,EAAG,KAAK,IAAI,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAC,CAAC;;AAG5D,YAAA,IAAI,IAAI,GAAG,KAAK,EAAE;gBAChB,OAAO,EAAE,eAAe,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE;YACtD;QACF;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;AClBA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-pattern-validator.mjs","sources":["../../../projects/opal-frontend-common/validators/pattern-validator/pattern.validator.ts","../../../projects/opal-frontend-common/validators/pattern-validator/hmcts-opal-frontend-common-validators-pattern-validator.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\n/**\n * Returns a validator function that tests a form control's value against a given regular expression.\n * If the value does not match the pattern, it returns a validation error with the provided error key.\n * Returns null for empty or valid values.\n *\n * @param pattern - The regular expression to test the control's value against.\n * @param errorKey - The key to use in the returned validation error object (defaults to 'patternInvalid').\n * @returns A ValidatorFn that returns a validation error object or null.\n */\nexport function patternValidator(pattern: RegExp, errorKey: string = 'patternInvalid'): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!control.value) {\n return null;\n }\n\n return pattern.test(control.value)\n ? null\n : {\n [errorKey]: true,\n };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEA;;;;;;;;AAQG;SACa,gBAAgB,CAAC,OAAe,EAAE,WAAmB,gBAAgB,EAAA;IACnF,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AAClB,YAAA,OAAO,IAAI;QACb;AAEA,QAAA,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK;AAC/B,cAAE;AACF,cAAE;gBACE,CAAC,QAAQ,GAAG,IAAI;aACjB;AACP,IAAA,CAAC;AACH;;ACvBA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-validators-valid-value.mjs","sources":["../../../projects/opal-frontend-common/validators/valid-value/valid-value.validator.ts","../../../projects/opal-frontend-common/validators/valid-value/hmcts-opal-frontend-common-validators-valid-value.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport function validValueValidator(validValues: string[]): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control.value === null || control.value === undefined || control.value === '') {\n return null;\n }\n\n return validValues.includes(control.value) ? null : { valueNotInArray: true };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEM,SAAU,mBAAmB,CAAC,WAAqB,EAAA;IACvD,OAAO,CAAC,OAAwB,KAA6B;AAC3D,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,KAAK,EAAE,EAAE;AACjF,YAAA,OAAO,IAAI;QACb;QAEA,OAAO,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE;AAC/E,IAAA,CAAC;AACH;;ACVA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common.mjs","sources":["../../../projects/opal-frontend-common/constants/src/footer-links.constant.ts","../../../projects/opal-frontend-common/constants/src/header-links.constant.ts","../../../projects/opal-frontend-common/constants/src/regex-patterns.constant.ts","../../../projects/opal-frontend-common/pages/routing/pages.routes.ts","../../../projects/opal-frontend-common/public-api.ts","../../../projects/opal-frontend-common/hmcts-opal-frontend-common.ts"],"sourcesContent":["import { IGovukFooterLinks } from '@hmcts/opal-frontend-common/components/govuk/govuk-footer/interfaces';\n\nexport const FOOTER_LINKS: IGovukFooterLinks = {\n licenseLink: 'https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/',\n licenseVersion: '3.0',\n copyrightLink:\n 'https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/',\n};\n","import { IMojHeaderLinks } from '@hmcts/opal-frontend-common/components/moj/moj-header/interfaces';\n\nexport const HEADER_LINKS: IMojHeaderLinks = {\n govukLink: 'https://www.gov.uk/',\n serviceLink: '/',\n};\n","export const ALPHANUMERIC_WITH_SPACES_PATTERN = /^[a-zA-Z0-9 ]*$/;\nexport const ALPHANUMERIC_WITH_HYPHENS_SPACES_APOSTROPHES_DOT_PATTERN = /^[a-zA-Z0-9\\s'.-]*$/;\nexport const LETTERS_WITH_SPACES_PATTERN = /^[a-zA-Z ]*$/;\nexport const LETTERS_WITH_SPACES_DOT_PATTERN = /^[a-zA-Z\\s.]*$/;\nexport const LETTERS_SPACES_HYPHENS_APOSTROPHES_DOT_PATTERN = /^[a-zA-Z\\s'.-]*$/;\nexport const SPECIAL_CHARACTERS_PATTERN = /^[a-zA-Z0-9 ]*$/;\nexport const NUMERIC_PATTERN = /^\\d*$/;\nexport const DRIVING_LICENCE_NUMBER_PATTERN = /^[A-Za-z]{5}\\d{6}[A-Za-z]{2}[A-Za-z0-9]{3}$/;\nexport const EMAIL_ADDRESS_PATTERN = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\nexport const TIME_FORMAT_PATTERN = /^([01]\\d|2[0-3]):[0-5]\\d$/;\nexport const TWO_DECIMAL_PLACES_PATTERN = /^\\d+(\\.\\d{0,2})?$/;\nexport const ACCOUNT_NUMBER_PATTERN = /^\\d{8}([A-Z])?$/;\n","import { Routes } from '@angular/router';\nimport { PAGES_ROUTING_TITLES, PAGES_ROUTING_PATHS } from '@hmcts/opal-frontend-common/pages/routing/constants';\nimport { authGuard } from '@hmcts/opal-frontend-common/guards/auth';\nimport { signedInGuard } from '@hmcts/opal-frontend-common/guards/signed-in';\nimport { TitleResolver } from '@hmcts/opal-frontend-common/resolvers/title';\nimport { accountGuard } from '@hmcts/opal-frontend-common/guards/account';\n\nexport const routing: Routes = [\n { path: '', redirectTo: 'dashboard', pathMatch: 'full' },\n {\n path: PAGES_ROUTING_PATHS.children.accessDenied,\n loadComponent: () => import('../access-denied/access-denied.component').then((c) => c.AccessDeniedComponent),\n canActivate: [authGuard, accountGuard],\n data: { title: PAGES_ROUTING_TITLES.children.accessDenied },\n resolve: { title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.concurrencyFailure,\n loadComponent: () =>\n import('../concurrency-failure/concurrency-failure.component').then((c) => c.ConcurrencyFailureComponent),\n data: { title: PAGES_ROUTING_TITLES.children.concurrencyFailure },\n resolve: { title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.permissionDenied,\n loadComponent: () =>\n import('../permission-denied/permission-denied.component').then((c) => c.PermissionDeniedComponent),\n data: { title: PAGES_ROUTING_TITLES.children.permissionDenied },\n resolve: { title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.internalServerError,\n loadComponent: () =>\n import('../internal-server-error/internal-server-error.component').then((c) => c.InternalServerErrorComponent),\n data: { title: PAGES_ROUTING_TITLES.children.internalServerError },\n resolve: { title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.signIn,\n loadComponent: () => import('../sign-in/sign-in.component').then((c) => c.SignInComponent),\n canActivate: [signedInGuard],\n data: { title: PAGES_ROUTING_TITLES.children.signIn },\n resolve: { title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.accountCreated,\n loadComponent: () => import('../account-created/account-created.component').then((c) => c.AccountCreated),\n canActivate: [authGuard],\n data: { title: PAGES_ROUTING_TITLES.children.accountCreated },\n resolve: { title: TitleResolver },\n },\n];\n","/*\n * Public API Surface of @hmcts/opal-frontend-common\n *\n * This library uses individual entry points for components, services, and utilities\n * as defined in ng-package.json. This allows for tree-shaking and selective imports.\n *\n * Most exports are available through their specific entry points, such as:\n * - @hmcts/opal-frontend-common/components/govuk/govuk-button\n * - @hmcts/opal-frontend-common/services/auth-service\n * - @hmcts/opal-frontend-common/validators/amount\n *\n * The exports below are for common utilities that should be available\n * at the main entry point.\n */\n\n// Constants - commonly used across applications\nexport * from './constants/public-api';\n\n// Pages - routing configuration\nexport * from './pages/public-api';\n\n// Types - commonly used types and interfaces\nexport * from './types/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAEO,MAAM,YAAY,GAAsB;AAC7C,IAAA,WAAW,EAAE,4EAA4E;AACzF,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,aAAa,EACX,kJA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