{"version":3,"file":"scion-workbench.mjs","sources":["../../../../projects/scion/workbench/src/lib/workbench-config.ts","../../../../projects/scion/workbench/src/lib/common/throw-error.util.ts","../../../../projects/scion/workbench/src/lib/common/resolve-when.util.ts","../../../../projects/scion/workbench/src/lib/storage/workbench-storage.ts","../../../../projects/scion/workbench/src/lib/layout/rendering-flag.ts","../../../../projects/scion/workbench/src/lib/common/uid.util.ts","../../../../projects/scion/workbench/src/lib/common/math.util.ts","../../../../projects/scion/workbench/src/lib/common/dom.util.ts","../../../../projects/scion/workbench/src/lib/layout/workbench-layout.service.ts","../../../../projects/scion/workbench/src/lib/workbench.constants.ts","../../../../projects/scion/workbench/src/lib/common/operators.ts","../../../../projects/scion/workbench/src/lib/executor/single-task-executor.ts","../../../../projects/scion/workbench/src/lib/routing/workbench-navigational-states.ts","../../../../projects/scion/workbench/src/lib/text/workbench-text-provider.model.ts","../../../../projects/scion/workbench/src/lib/text/text.ts","../../../../projects/scion/workbench/src/lib/text/text.pipe.ts","../../../../projects/scion/workbench/src/lib/view/workbench-view.model.ts","../../../../projects/scion/workbench/src/lib/part/workbench-part.model.ts","../../../../projects/scion/workbench/src/lib/dialog/workbench-dialog.model.ts","../../../../projects/scion/workbench/src/lib/popup/workbench-popup.model.ts","../../../../projects/scion/workbench/src/lib/page-not-found/page-not-found.component.ts","../../../../projects/scion/workbench/src/lib/page-not-found/page-not-found.component.html","../../../../projects/scion/workbench/src/lib/routing/workbench-route-data.ts","../../../../projects/scion/workbench/src/lib/routing/empty-outlet/empty-outlet.component.ts","../../../../projects/scion/workbench/src/lib/routing/empty-outlet/empty-outlet.component.html","../../../../projects/scion/workbench/src/lib/null-content/null-content.component.ts","../../../../projects/scion/workbench/src/lib/null-content/null-content.component.html","../../../../projects/scion/workbench/src/lib/routing/workbench-route-guards.ts","../../../../projects/scion/workbench/src/lib/routing/workbench-auxiliary-route-installer.service.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-platform-initializer.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/manifest-object-cache.service.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host/microfrontend-host-routes.ts","../../../../projects/scion/workbench/src/lib/workbench.identifiers.ts","../../../../projects/scion/workbench/src/lib/routing/routing.util.ts","../../../../projects/scion/workbench/src/lib/routing/url-segment-matcher.ts","../../../../projects/scion/workbench/src/lib/registry/workbench-element-registry.ts","../../../../projects/scion/workbench/src/lib/view/workbench-view.registry.ts","../../../../projects/scion/workbench/src/lib/common/asserts.util.ts","../../../../projects/scion/workbench/src/lib/layout/workbench-grid.model.ts","../../../../projects/scion/workbench/src/lib/layout/workbench-layouts.util.ts","../../../../projects/scion/workbench/src/lib/layout/workbench-layout.ts","../../../../projects/scion/workbench/src/lib/routing/ɵworkbench-router.service.ts","../../../../projects/scion/workbench/src/lib/routing/workbench-router.service.ts","../../../../projects/scion/workbench/src/lib/migration/workbench-migrator.ts","../../../../projects/scion/workbench/src/lib/layout/migration/model/workbench-grid-migration-v3.model.ts","../../../../projects/scion/workbench/src/lib/layout/migration/workbench-grid-migration-v3.service.ts","../../../../projects/scion/workbench/src/lib/layout/migration/workbench-grid-migration-v4.service.ts","../../../../projects/scion/workbench/src/lib/layout/migration/workbench-grid-migration-v5.service.ts","../../../../projects/scion/workbench/src/lib/layout/migration/workbench-grid-migration-v6.service.ts","../../../../projects/scion/workbench/src/lib/layout/stringifier.ts","../../../../projects/scion/workbench/src/lib/layout/migration/workbench-grid-migration-v7.service.ts","../../../../projects/scion/workbench/src/lib/layout/migration/workbench-layout-migration-v2.service.ts","../../../../projects/scion/workbench/src/lib/layout/migration/workbench-layout-migration-v3.service.ts","../../../../projects/scion/workbench/src/lib/layout/migration/workbench-layout-migration-v4.service.ts","../../../../projects/scion/workbench/src/lib/layout/migration/workbench-layout-migration-v5.service.ts","../../../../projects/scion/workbench/src/lib/layout/migration/workbench-layout-migration-v6.service.ts","../../../../projects/scion/workbench/src/lib/layout/workbench-layout-serializer.service.ts","../../../../projects/scion/workbench/src/lib/logging/logging.model.ts","../../../../projects/scion/workbench/src/lib/logging/console-appender.service.ts","../../../../projects/scion/workbench/src/lib/logging/ɵlogger.ts","../../../../projects/scion/workbench/src/lib/logging/logger.ts","../../../../projects/scion/workbench/src/lib/logging/logger-names.ts","../../../../projects/scion/workbench/src/lib/logging/logging-support.ts","../../../../projects/scion/workbench/src/lib/logging/index.ts","../../../../projects/scion/workbench/src/lib/activity/workbench-activity.model.ts","../../../../projects/scion/workbench/src/lib/activation-instant.provider.ts","../../../../projects/scion/workbench/src/lib/common/prune.util.ts","../../../../projects/scion/workbench/src/lib/layout/ɵworkbench-layout.ts","../../../../projects/scion/workbench/src/lib/layout/ɵworkbench-layout.factory.ts","../../../../projects/scion/workbench/src/lib/layout/workbench-layout-merger.service.ts","../../../../projects/scion/workbench/src/lib/layout/workbench-layout-storage.service.ts","../../../../projects/scion/workbench/src/lib/executor/latest-task-executor.ts","../../../../projects/scion/workbench/src/lib/perspective/workbench-perspective.registry.ts","../../../../projects/scion/workbench/src/lib/startup/workbench-initializer.ts","../../../../projects/scion/workbench/src/lib/startup/ɵworkbench-launcher.service.ts","../../../../projects/scion/workbench/src/lib/startup/ɵworkbench-startup.service.ts","../../../../projects/scion/workbench/src/lib/startup/workbench-startup.service.ts","../../../../projects/scion/workbench/src/lib/perspective/ɵworkbench-perspective.model.ts","../../../../projects/scion/workbench/src/lib/perspective/workbench-perspective.service.ts","../../../../projects/scion/workbench/src/lib/part/workbench-part.registry.ts","../../../../projects/scion/workbench/src/lib/part/workbench-part-action.registry.ts","../../../../projects/scion/workbench/src/lib/theme/workbench-theme-switcher.service.ts","../../../../projects/scion/workbench/src/lib/view/workbench-view-menu-item.registry.ts","../../../../projects/scion/workbench/src/lib/focus/workbench-focus-tracker.service.ts","../../../../projects/scion/workbench/src/lib/dialog/workbench-dialog.registry.ts","../../../../projects/scion/workbench/src/lib/popup/workbench-popup.registry.ts","../../../../projects/scion/workbench/src/lib/ɵworkbench.service.ts","../../../../projects/scion/workbench/src/lib/workbench.service.ts","../../../../projects/scion/workbench/src/lib/workbench-element-references.ts","../../../../projects/scion/workbench/src/lib/common/class-list.ts","../../../../projects/scion/workbench/src/lib/portal/wb-component-portal.ts","../../../../projects/scion/workbench/src/lib/routing/router-outlet-root-context.directive.ts","../../../../projects/scion/workbench/src/lib/common/ɵdestroy-ref.ts","../../../../projects/scion/workbench/src/lib/glass-pane/glass-pane.directive.ts","../../../../projects/scion/workbench/src/lib/part/part-slot/part-slot.component.ts","../../../../projects/scion/workbench/src/lib/part/part-slot/part-slot.component.html","../../../../projects/scion/workbench/src/lib/communication/workbench-broadcast-channel.ts","../../../../projects/scion/workbench/src/lib/view-dnd/view-drag.service.ts","../../../../projects/scion/workbench/src/lib/view-dnd/view-drop-placeholder-renderer.service.ts","../../../../projects/scion/workbench/src/lib/view-dnd/view-drop-zone.directive.ts","../../../../projects/scion/workbench/src/lib/view-dnd/grid-drop-targets.util.ts","../../../../projects/scion/workbench/src/lib/portal/workbench-portal-outlet.directive.ts","../../../../projects/scion/workbench/src/lib/part/part-portal.pipe.ts","../../../../projects/scion/workbench/src/lib/layout/grid-element/tree-node-sash-sizes.pipe.ts","../../../../projects/scion/workbench/src/lib/layout/grid-element/grid-element.component.ts","../../../../projects/scion/workbench/src/lib/layout/grid-element/grid-element.component.html","../../../../projects/scion/workbench/src/lib/view-dnd/requires-drop-zone.pipe.ts","../../../../projects/scion/workbench/src/lib/layout/grid/grid.component.ts","../../../../projects/scion/workbench/src/lib/layout/grid/grid.component.html","../../../../projects/scion/workbench/src/lib/common/dasherize.util.ts","../../../../projects/scion/workbench/src/lib/desktop/desktop-slot/desktop-slot.component.ts","../../../../projects/scion/workbench/src/lib/desktop/desktop-slot/desktop-slot.component.html","../../../../projects/scion/workbench/src/lib/desktop/workbench-desktop.model.ts","../../../../projects/scion/workbench/src/lib/part/main-area-part/main-area-part.component.ts","../../../../projects/scion/workbench/src/lib/part/main-area-part/main-area-part.component.html","../../../../projects/scion/workbench/src/lib/common/instanceof.pipe.ts","../../../../projects/scion/workbench/src/lib/part/part-action/part-action.component.ts","../../../../projects/scion/workbench/src/lib/part/part-action/part-action.component.html","../../../../projects/scion/workbench/src/lib/icon/workbench-icon-provider.model.ts","../../../../projects/scion/workbench/src/lib/icon/icon.component.ts","../../../../projects/scion/workbench/src/lib/filter-field/filter-field.component.ts","../../../../projects/scion/workbench/src/lib/filter-field/filter-field.component.html","../../../../projects/scion/workbench/src/lib/part/view-tab-content/view-tab-content.component.ts","../../../../projects/scion/workbench/src/lib/part/view-tab-content/view-tab-content.component.html","../../../../projects/scion/workbench/src/lib/part/view-list-item/view-list-item.component.ts","../../../../projects/scion/workbench/src/lib/part/view-list-item/view-list-item.component.html","../../../../projects/scion/workbench/src/lib/part/view-list/view-list.component.ts","../../../../projects/scion/workbench/src/lib/part/view-list/view-list.component.html","../../../../projects/scion/workbench/src/lib/part/view-list-button/view-list-button.component.ts","../../../../projects/scion/workbench/src/lib/part/view-list-button/view-list-button.component.html","../../../../projects/scion/workbench/src/lib/view/view-slot.component.ts","../../../../projects/scion/workbench/src/lib/view/view-slot.component.html","../../../../projects/scion/workbench/src/lib/common/observables.ts","../../../../projects/scion/workbench/src/lib/dialog/movable.directive.ts","../../../../projects/scion/workbench/src/lib/dialog/resizable.directive.ts","../../../../projects/scion/workbench/src/lib/dialog/dialog-header/dialog-header.component.ts","../../../../projects/scion/workbench/src/lib/dialog/dialog-header/dialog-header.component.html","../../../../projects/scion/workbench/src/lib/common/null-if-empty.pipe.ts","../../../../projects/scion/workbench/src/lib/dialog/dialog-footer/dialog-action-filter.pipe.ts","../../../../projects/scion/workbench/src/lib/dialog/dialog-footer/dialog-footer.component.ts","../../../../projects/scion/workbench/src/lib/dialog/dialog-footer/dialog-footer.component.html","../../../../projects/scion/workbench/src/lib/dialog/workbench-dialog.component.ts","../../../../projects/scion/workbench/src/lib/dialog/workbench-dialog.component.html","../../../../projects/scion/workbench/src/lib/dialog/workbench-dialog.service.ts","../../../../projects/scion/workbench/src/lib/message-box/message-box-footer/message-box-footer.component.ts","../../../../projects/scion/workbench/src/lib/message-box/message-box-footer/message-box-footer.component.html","../../../../projects/scion/workbench/src/lib/dialog/dialog-footer/workbench-dialog-footer.directive.ts","../../../../projects/scion/workbench/src/lib/dialog/dialog-header/workbench-dialog-header.directive.ts","../../../../projects/scion/workbench/src/lib/message-box/message-box-header/message-box-header.component.ts","../../../../projects/scion/workbench/src/lib/message-box/message-box-header/message-box-header.component.html","../../../../projects/scion/workbench/src/lib/common/typeof.pipe.ts","../../../../projects/scion/workbench/src/lib/message-box/workbench-message-box.component.ts","../../../../projects/scion/workbench/src/lib/message-box/workbench-message-box.component.html","../../../../projects/scion/workbench/src/lib/message-box/workbench-message-box.service.ts","../../../../projects/scion/workbench/src/lib/message-box/ɵworkbench-message-box.service.ts","../../../../projects/scion/workbench/src/lib/popup/workbench-popup.component.ts","../../../../projects/scion/workbench/src/lib/popup/workbench-popup.component.html","../../../../projects/scion/workbench/src/lib/popup/popup.ts","../../../../projects/scion/workbench/src/lib/popup/workbench-popup-context.provider.ts","../../../../projects/scion/workbench/src/lib/popup/ɵworkbench-popup.model.ts","../../../../projects/scion/workbench/src/lib/notification/workbench-notification.registry.ts","../../../../projects/scion/workbench/src/lib/invocation-context/invocation-context.ts","../../../../projects/scion/workbench/src/lib/popup/workbench-popup.service.ts","../../../../projects/scion/workbench/src/lib/popup/ɵpopup.service.ts","../../../../projects/scion/workbench/src/lib/popup/popup.service.ts","../../../../projects/scion/workbench/src/lib/popup/ɵworkbench-popup.service.ts","../../../../projects/scion/workbench/src/lib/dialog/workbench-dialog-context.provider.ts","../../../../projects/scion/workbench/src/lib/dialog/ɵworkbench-dialog.model.ts","../../../../projects/scion/workbench/src/lib/dialog/ɵworkbench-dialog.service.ts","../../../../projects/scion/workbench/src/lib/view/workbench-view-context.provider.ts","../../../../projects/scion/workbench/src/lib/view/ɵworkbench-view.model.ts","../../../../projects/scion/workbench/src/lib/part/view-context-menu/accelerator-format.pipe.ts","../../../../projects/scion/workbench/src/lib/part/view-context-menu/menu-item/menu-item.component.ts","../../../../projects/scion/workbench/src/lib/part/view-context-menu/menu-item/menu-item.component.html","../../../../projects/scion/workbench/src/lib/part/view-context-menu/view-menu.component.ts","../../../../projects/scion/workbench/src/lib/part/view-context-menu/view-menu.component.html","../../../../projects/scion/workbench/src/lib/part/view-context-menu/text/text.component.ts","../../../../projects/scion/workbench/src/lib/common/rxjs-interop.util.ts","../../../../projects/scion/workbench/src/lib/part/view-context-menu/view-menu.service.ts","../../../../projects/scion/workbench/src/lib/part/view-tab/view-tab.component.ts","../../../../projects/scion/workbench/src/lib/part/view-tab/view-tab.component.html","../../../../projects/scion/workbench/src/lib/part/view-tab-drag-image/view-tab-drag-image.component.ts","../../../../projects/scion/workbench/src/lib/view-dnd/view-tab-drag-image-renderer.service.ts","../../../../projects/scion/workbench/src/lib/part/view-tab-bar/view-tab-bar.component.ts","../../../../projects/scion/workbench/src/lib/part/view-tab-bar/view-tab-bar.component.html","../../../../projects/scion/workbench/src/lib/part/part-bar/part-bar.component.ts","../../../../projects/scion/workbench/src/lib/part/part-bar/part-bar.component.html","../../../../projects/scion/workbench/src/lib/part/part.component.ts","../../../../projects/scion/workbench/src/lib/part/part.component.html","../../../../projects/scion/workbench/src/lib/part/workbench-part-context.provider.ts","../../../../projects/scion/workbench/src/lib/part/ɵworkbench-part.model.ts","../../../../projects/scion/workbench/src/lib/routing/workbench-layout-differ.ts","../../../../projects/scion/workbench/src/lib/routing/workbench-outlet-differ.ts","../../../../projects/scion/workbench/src/lib/routing/workbench-url-observer.service.ts","../../../../projects/scion/workbench/src/lib/view/view-move-handler.service.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-platform.config.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/ng-zone-observable-decorator.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-platform-config-loader.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-platform.provider.ts","../../../../projects/scion/workbench/src/lib/common/stringify-error.util.ts","../../../../projects/scion/workbench/src/lib/content-projection/content-as-overlay.component.ts","../../../../projects/scion/workbench/src/lib/content-projection/content-as-overlay.component.html","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-splash/microfrontend-splash.component.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-splash/microfrontend-splash.component.html","../../../../projects/scion/workbench/src/lib/microfrontend-platform/common/microfrontend.util.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-text/remote-text-provider.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-view/microfrontend-view.component.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-view/microfrontend-view.component.html","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host/microfrontend-host.model.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host/microfrontend-host.component.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host/microfrontend-host.component.html","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host-view/microfrontend-host-view.model.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-view/microfrontend-view-routes.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-perspective/workbench-perspective-data.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-part/microfrontend-part.component.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-part/microfrontend-part.component.html","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host-part/microfrontend-host-part.model.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-part/microfrontend-part-routes.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-perspective/param-validator.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-perspective/microfrontend-perspective-installer.service.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-perspective/microfrontend-perspective-intent-handler.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-perspective/microfrontend-perspective-capability-migrator.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-perspective/microfrontend-perspective-capability-validator.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/stable-capability-id-assigner.provider.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-perspective/microfrontend-perspective-intention-provider.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-perspective/microfrontend-perspective.provider.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-part/microfrontend-part-capability-validator.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-part/microfrontend-part-intention-provider.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-part/legacy-microfrontend-part-navigation-migration.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-part/microfrontend-part.provider.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-view/microfrontend-view-command-handler.service.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-view/microfrontend-view-intent-handler.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-view/microfrontend-view-transient-parameter-deprecation-logger.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-view/view-capability-preload-capability-interceptor.service.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-view/microfrontend-view-capability-validator.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-view/microfrontend-view-intention-provider.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-view/legacy-microfrontend-view-navigation-migration.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-view/microfrontend-view.provider.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host-notification/notification-text-message/notification-text-message.component.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host-notification/notification-text-message/notification-text-message.component.html","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-notification/microfrontend-text-notification-capability-provider.interceptor.ts","../../../../projects/scion/workbench/src/lib/notification/workbench-notification.model.ts","../../../../projects/scion/workbench/src/lib/notification/ɵnotification.ts","../../../../projects/scion/workbench/src/lib/notification/notification.ts","../../../../projects/scion/workbench/src/lib/notification/remove-legacy-input.pipe.ts","../../../../projects/scion/workbench/src/lib/notification/workbench-notification.component.ts","../../../../projects/scion/workbench/src/lib/notification/workbench-notification.component.html","../../../../projects/scion/workbench/src/lib/notification/workbench-notification-context.provider.ts","../../../../projects/scion/workbench/src/lib/notification/ɵworkbench-notification.model.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-notification/microfrontend-notification.component.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-notification/microfrontend-notification.component.html","../../../../projects/scion/workbench/src/lib/notification/ɵworkbench-notification.service.ts","../../../../projects/scion/workbench/src/lib/notification/workbench-notification.service.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host-notification/microfrontend-host-notification.model.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-notification/microfrontend-notification-intent-handler.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-notification/microfrontend-notification-routes.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-notification/microfrontend-notification-capability-validator.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-notification/microfrontend-notification.provider.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-dialog/microfrontend-dialog.component.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-dialog/microfrontend-dialog.component.html","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host-dialog/microfrontend-host-dialog.model.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-dialog/microfrontend-dialog-intent-handler.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-dialog/microfrontend-dialog-capability-validator.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-dialog/microfrontend-dialog.provider.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-message-box/microfrontend-message-box.component.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-message-box/microfrontend-message-box.component.html","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host-message-box/microfrontend-host-message-box.model.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-message-box/microfrontend-message-box-intent-handler.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host-message-box/text-message/text-message.component.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host-message-box/text-message/text-message.component.html","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-message-box/microfrontend-message-box-capability-validator.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-message-box/microfrontend-message-box-routes.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-message-box/microfrontend-text-message-box-capability-provider.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-message-box/microfrontend-message-box.provider.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-text/microfrontend-text-intention-provider.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-text/host-text-provider.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-text/microfrontend-text.provider.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-popup/microfrontend-popup.component.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-popup/microfrontend-popup.component.html","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host-popup/microfrontend-host-popup.model.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-popup/microfrontend-popup-intent-handler.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-popup/microfrontend-popup-capability-validator.interceptor.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-popup/microfrontend-popup.provider.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/workbench-microfrontend-support.ts","../../../../projects/scion/workbench/src/lib/routing/ɵlocation.ts","../../../../projects/scion/workbench/src/lib/text/workbench-text-provider.ts","../../../../projects/scion/workbench/src/lib/text/text-providers.ts","../../../../projects/scion/workbench/src/lib/icon/material-icon-provider.ts","../../../../projects/scion/workbench/src/lib/icon/workbench-icon-provider.ts","../../../../projects/scion/workbench/src/lib/icon/icon-providers.ts","../../../../projects/scion/workbench/src/lib/workbench.provider.ts","../../../../projects/scion/workbench/src/lib/startup/workbench-launcher.service.ts","../../../../projects/scion/workbench/src/lib/startup/splash/splash.component.ts","../../../../projects/scion/workbench/src/lib/startup/splash/splash.component.html","../../../../projects/scion/workbench/src/lib/notification/notification-list.component.ts","../../../../projects/scion/workbench/src/lib/notification/notification-list.component.html","../../../../projects/scion/workbench/src/lib/activity/activity-bar/activity-item/activity-item.component.ts","../../../../projects/scion/workbench/src/lib/activity/activity-bar/activity-item/activity-item.component.html","../../../../projects/scion/workbench/src/lib/activity/activity-bar/activity-stack/activity-stack.component.ts","../../../../projects/scion/workbench/src/lib/activity/activity-bar/activity-stack/activity-stack.component.html","../../../../projects/scion/workbench/src/lib/activity/activity-bar/activity-bar.component.ts","../../../../projects/scion/workbench/src/lib/activity/activity-bar/activity-bar.component.html","../../../../projects/scion/workbench/src/lib/activity/activity-panel/activity-panel.component.ts","../../../../projects/scion/workbench/src/lib/activity/activity-panel/activity-panel.component.html","../../../../projects/scion/workbench/src/lib/layout/layout.component.ts","../../../../projects/scion/workbench/src/lib/layout/layout.component.html","../../../../projects/scion/workbench/src/lib/workbench.component.ts","../../../../projects/scion/workbench/src/lib/workbench.component.html","../../../../projects/scion/workbench/src/lib/layout/workbench-layout.factory.ts","../../../../projects/scion/workbench/src/lib/layout/public_api.ts","../../../../projects/scion/workbench/src/lib/desktop/desktop.directive.ts","../../../../projects/scion/workbench/src/lib/desktop/public_api.ts","../../../../projects/scion/workbench/src/lib/perspective/public_api.ts","../../../../projects/scion/workbench/src/lib/part/view-context-menu/view-menu-item.directive.ts","../../../../projects/scion/workbench/src/lib/part/part-action-bar/part-action.directive.ts","../../../../projects/scion/workbench/src/lib/part/public_api.ts","../../../../projects/scion/workbench/src/lib/view/public_api.ts","../../../../projects/scion/workbench/src/lib/routing/workbench-router-link.directive.ts","../../../../projects/scion/workbench/src/lib/routing/public_api.ts","../../../../projects/scion/workbench/src/lib/message-box/public_api.ts","../../../../projects/scion/workbench/src/lib/dialog/dialog-footer/workbench-dialog-action.directive.ts","../../../../projects/scion/workbench/src/lib/dialog/public_api.ts","../../../../projects/scion/workbench/src/lib/notification/notification.service.ts","../../../../projects/scion/workbench/src/lib/notification/public_api.ts","../../../../projects/scion/workbench/src/lib/popup/popup.config.ts","../../../../projects/scion/workbench/src/lib/popup/public_api.ts","../../../../projects/scion/workbench/src/lib/common/public_api.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/microfrontend-host/public_api.ts","../../../../projects/scion/workbench/src/lib/microfrontend-platform/public_api.ts","../../../../projects/scion/workbench/src/lib/startup/public_api.ts","../../../../projects/scion/workbench/src/lib/logging/public_api.ts","../../../../projects/scion/workbench/src/lib/storage/public_api.ts","../../../../projects/scion/workbench/src/lib/activity/public_api.ts","../../../../projects/scion/workbench/src/lib/text/public_api.ts","../../../../projects/scion/workbench/src/lib/icon/public_api.ts","../../../../projects/scion/workbench/src/lib/public_api.ts","../../../../projects/scion/workbench/src/public-api.ts","../../../../projects/scion/workbench/src/scion-workbench.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ComponentType} from '@angular/cdk/portal';\nimport {Type} from '@angular/core';\nimport {LogAppender, LogLevel} from './logging';\nimport {MicrofrontendPlatformConfig} from '@scion/microfrontend-platform';\nimport {MicrofrontendPlatformConfigLoader} from './microfrontend-platform/microfrontend-platform-config-loader';\nimport {WorkbenchPerspectives} from './perspective/workbench-perspective.model';\nimport {WorkbenchStorage} from './storage/workbench-storage';\nimport {WorkbenchTextProviderFn} from './text/workbench-text-provider.model';\nimport {WorkbenchIconProviderFn} from './icon/workbench-icon-provider.model';\nimport {WorkbenchLayoutFn} from './layout/workbench-layout';\n\n/**\n * Configuration of the SCION Workbench.\n */\nexport abstract class WorkbenchConfig {\n\n  /**\n   * Defines the layout(s) of the application. Defaults to a single layout with only a main area.\n   *\n   * An application can have multiple layouts, called perspectives. A perspective defines an arrangement of parts and views.\n   * Parts can be docked to the side or positioned relative to each other. Views are stacked in parts and can be dragged to other parts.\n   * Content can be displayed in both parts and views.\n   *\n   * A perspective typically has a main area part and parts docked to the side, providing navigation and context-sensitive assistance to support\n   * the user's workflow. Initially empty or displaying a welcome page, the main area is where the workbench opens views by default.\n   * Unlike any other part, the main area is shared between perspectives, and its layout is not reset when resetting perspectives.\n   *\n   * See {@link WorkbenchLayoutFn} for more information and an example.\n   */\n  public abstract layout?: WorkbenchLayoutFn | WorkbenchPerspectives;\n\n  /**\n   * Provides texts to the SCION Workbench.\n   *\n   * A text provider is a function that returns the text for a translation key.\n   *\n   * Texts starting with the percent symbol (`%`) are passed to the text provider for translation, with the percent symbol omitted.\n   *\n   * The SCION Workbench uses the following translation keys for built-in texts:\n   * - workbench.clear.tooltip\n   * - workbench.close.action\n   * - workbench.close_all_tabs.action\n   * - workbench.close_other_tabs.action\n   * - workbench.close_tab.action\n   * - workbench.close_tab.tooltip\n   * - workbench.close_tabs_to_the_left.action\n   * - workbench.close_tabs_to_the_right.action\n   * - workbench.close.tooltip\n   * - workbench.dev_mode_only_hint.tooltip\n   * - workbench.minimize.tooltip\n   * - workbench.move_tab_down.action\n   * - workbench.move_tab_to_new_window.action\n   * - workbench.move_tab_to_the_left.action\n   * - workbench.move_tab_to_the_right.action\n   * - workbench.move_tab_up.action\n   * - workbench.null_content.message\n   * - workbench.null_view_developer_hint.message\n   * - workbench.ok.action\n   * - workbench.page_not_found.message\n   * - workbench.page_not_found.title\n   * - workbench.page_not_found_developer_hint.message\n   * - workbench.page_not_found_part.message\n   * - workbench.page_not_found_view.message\n   * - workbench.reset_perspective.action\n   * - workbench.show_open_tabs.tooltip\n   *\n   * The function:\n   * - Can call `inject` to get any required dependencies.\n   * - Can call `toSignal` to convert an Observable to a Signal.\n   *\n   * @see WorkbenchTextProviderFn\n   */\n  public abstract textProvider?: WorkbenchTextProviderFn;\n\n  /**\n   * Provides icons to the SCION Workbench.\n   *\n   * An icon provider is a function that returns a component for an icon. The component renders the icon.\n   *\n   * Defaults to a Material icon provider, interpreting the icon as a Material icon ligature.\n   *\n   * The default icon provider requires the application to include the Material icon font, for example in `styles.scss`, as follows:\n   * ```scss\n   * @import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded');\n   * ```\n   *\n   * The SCION Workbench uses the following icons:\n   * - `workbench.clear`: Clear button in input fields\n   * - `workbench.close`: Close button in views, dialogs and notifications\n   * - `workbench.dirty`: Visual indicator for view with unsaved content\n   * - `workbench.menu_down`: Menu button of drop down menus\n   * - `workbench.minimize`: Minimize button in docked parts\n   * - `workbench.pin`: Visual indicator for a pinned view\n   * - `workbench.search`: Visual indicator in search or filter fields\n   *\n   * To not replace built-in workbench icons, the icon provider can return `undefined` for icons starting with the `workbench.` prefix.\n   *\n   * The function can call `inject` to get any required dependencies.\n   *\n   * @see WorkbenchIconProviderFn\n   */\n  public abstract iconProvider?: WorkbenchIconProviderFn;\n\n  /**\n   * Specifies the component to display in `<wb-workbench>` while the workbench is starting.\n   *\n   * Defaults to a splash showing a loading indicator (ellipsis throbber).\n   *\n   * Note: No splash screen is displayed if starting the workbench in an app initializer.\n   */\n  public abstract splashComponent?: ComponentType<unknown>;\n\n  /**\n   * Specifies the component to display a view tab, enabling custom design or functionality.\n   *\n   * The component can inject {@link WorkbenchView} and {@link VIEW_TAB_RENDERING_CONTEXT} to get a reference to the view and the rendering context.\n   */\n  public abstract viewTabComponent?: ComponentType<unknown>;\n\n  /**\n   * Defines the component to display when no route matches the requested path.\n   *\n   * This can happen when navigating to a non-existent route or after loading the application, if the routes have changed since the user's last session.\n   *\n   * The component can inject {@link WorkbenchView} to get a reference to the view, e.g., to obtain the requested URL.\n   */\n  public abstract pageNotFoundComponent?: ComponentType<unknown>;\n\n  /**\n   * Controls which built-in menu items to display in the view context menu.\n   *\n   * Set to `false` to exclude all built-in menu items.\n   */\n  public abstract viewMenuItems?: ViewMenuItemsConfig | false;\n\n  /**\n   * Configures microfrontend support in the workbench, allowing the integration of microfrontends as workbench views or\n   * workbench popups.\n   *\n   * The workbench uses the \"SCION Microfrontend Platform\" for providing microfrontend support. To learn more about the\n   * \"SCION Microfrontend Platform\", refer to https://github.com/SchweizerischeBundesbahnen/scion-microfrontend-platform.\n   *\n   * The workbench allows any web page to be embedded as a workbench view or workbench popup. The web app has to provide\n   * a manifest in which it describes its views and popups. To integrate a third-party application where customization is not\n   * possible, the host application can provide a manifest for that application. If embedded content needs to interact with\n   * the workbench, the web app can use the library `@scion/workbench-client`, a pure TypeScript library based on the\n   * web stack-agnostic `@scion/microfrontend-platform` library.\n   *\n   * The workbench integrates microfrontends through so-called intents, a mechanism known from Android development, enabling\n   * controlled collaboration across application boundaries. \"SCION Microfrontend Platform DevTools\" can help to inspect\n   * integrated applications and dependencies. The DevTools are available in the form of a microfrontend that can be embedded\n   * like any other microfrontend. Refer to the documentation for detailed instructions on how to integrate\n   * \"SCION Microfrontend Platform DevTools\".\n   *\n   * Typically, the host app provides API to integrated micro apps via the intent mechanism. Consider registering intent handlers\n   * in an initializer function registered via {@link provideMicrofrontendPlatformInitializer}.\n   */\n  public abstract microfrontendPlatform?: MicrofrontendPlatformConfig | Type<MicrofrontendPlatformConfigLoader>;\n\n  /**\n   * Provides persistent storage to the SCION Workbench.\n   *\n   * If not set, the workbench uses the browser's local storage as persistent storage.\n   */\n  public abstract storage?: Type<WorkbenchStorage>;\n\n  /**\n   * Configures the behavior of workbench dialogs.\n   */\n  public abstract dialog?: {\n    /**\n     * Configures the area to block for application-modal dialogs. Defaults to `workbench`.\n     *\n     * One of:\n     * - `workbench`: Blocks the workbench, still allowing interaction with elements outside the workbench.\n     * - `viewport`: Blocks the browser viewport, preventing interaction with the application until application-modal dialogs are closed.\n     */\n    modalityScope?: 'workbench' | 'viewport';\n  };\n\n  /**\n   * Configures logging for the workbench.\n   */\n  public abstract logging?: {\n    /**\n     * Sets the minimum severity level a log message must have in order to be logged. By default, if not specified, it is set to {@link LogLevel#INFO}.\n     *\n     * At runtime, you can change the minimum required log level by setting the `loglevel` query parameter.\n     */\n    logLevel?: LogLevel;\n    /**\n     * Registers log appenders to output log messages. Multiple appenders are allowed. By default, if not specified, log messages are written to the console.\n     */\n    logAppenders?: Type<LogAppender>[];\n  };\n}\n\n/**\n * Configuration of built-in menu items in the view's context menu.\n *\n * Each property represents a menu item, allowing customization of visibility, accelerators, and more.\n *\n * Texts can be changed or localized using a {@link WorkbenchTextProviderFn text provider} passed to {@link provideWorkbench} via the workbench config object.\n */\nexport interface ViewMenuItemsConfig {\n  /**\n   * Configures the menu item for closing a view tab.\n   *\n   * Set to `false` to exclude it.\n   *\n   * The menu item text can be changed or localized using a {@link WorkbenchTextProviderFn}.\n   * Translation key: `workbench.close_tab.action`\n   */\n  close?: MenuItemConfig | false;\n  /**\n   * Configures the menu item for closing other view tabs.\n   *\n   * Set to `false` to exclude it.\n   *\n   * The menu item text can be changed or localized using a {@link WorkbenchTextProviderFn}.\n   * Translation key: `workbench.close_other_tabs.action`\n   */\n  closeOthers?: MenuItemConfig | false;\n  /**\n   * Configures the menu item for closing all view tabs.\n   *\n   * Set to `false` to exclude it.\n   *\n   * The menu item text can be changed or localized using a {@link WorkbenchTextProviderFn}.\n   * Translation key: `workbench.close_all_tabs.action`\n   */\n  closeAll?: MenuItemConfig | false;\n  /**\n   * Configures the menu item for closing view tabs to the right.\n   *\n   * Set to `false` to exclude it.\n   *\n   * The menu item text can be changed or localized using a {@link WorkbenchTextProviderFn}.\n   * Translation key: `workbench.close_tabs_to_the_right.action`\n   */\n  closeToTheRight?: MenuItemConfig | false;\n  /**\n   * Configures the menu item for closing view tabs to the left.\n   *\n   * Set to `false` to exclude it.\n   *\n   * The menu item text can be changed or localized using a {@link WorkbenchTextProviderFn}.\n   * Translation key: `workbench.close_tabs_to_the_left.action`\n   */\n  closeToTheLeft?: MenuItemConfig | false;\n  /**\n   * Configures the menu item for moving a view up.\n   *\n   * Set to `false` to exclude it.\n   *\n   * The menu item text can be changed or localized using a {@link WorkbenchTextProviderFn}.\n   * Translation key: `workbench.move_tab_up.action`\n   */\n  moveUp?: MenuItemConfig | false;\n  /**\n   * Configures the menu item for moving a view to the right.\n   *\n   * Set to `false` to exclude it.\n   *\n   * The menu item text can be changed or localized using a {@link WorkbenchTextProviderFn}.\n   * Translation key: `workbench.move_tab_to_the_right.action`\n   */\n  moveRight?: MenuItemConfig | false;\n  /**\n   * Configures the menu item for moving a view down.\n   *\n   * Set to `false` to exclude it.\n   *\n   * The menu item text can be changed or localized using a {@link WorkbenchTextProviderFn}.\n   * Translation key: `workbenchworkbench.move_tab_down.action`\n   */\n  moveDown?: MenuItemConfig | false;\n  /**\n   * Configures the menu item for moving a view to the left.\n   *\n   * Set to `false` to exclude it.\n   *\n   * The menu item text can be changed or localized using a {@link WorkbenchTextProviderFn}.\n   * Translation key: `workbench.move_tab_to_the_left.action`\n   */\n  moveLeft?: MenuItemConfig | false;\n  /**\n   * Configures the menu item for moving a view to a new window.\n   *\n   * Set to `false` to exclude it.\n   *\n   * The menu item text can be changed or localized using a {@link WorkbenchTextProviderFn}.\n   * Translation key: `workbench.move_tab_to_new_window.action`\n   */\n  moveToNewWindow?: MenuItemConfig | false;\n}\n\n/**\n * Configures a built-in menu item.\n */\nexport interface MenuItemConfig {\n  accelerator?: string[];\n  group?: string;\n  cssClass?: string | string[];\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/**\n * Throws the specified error, useful in arrow functions that do not support throwing without a body.\n */\nexport function throwError(error: string): never {\n  throw Error(error);\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {effect, Injector, Signal, untracked} from '@angular/core';\n\n/**\n * Returns a Promise that resolves when signaling `true`.\n *\n * This function must be called within an injection context, or an explicit {@link Injector} passed.\n */\nexport function resolveWhen(condition: Signal<boolean>, options?: {injector?: Injector}): Promise<void> {\n  return new Promise<void>(resolve => {\n    const effectRef = effect(() => {\n      if (condition()) {\n        untracked(() => resolve());\n        effectRef.destroy();\n      }\n    }, {injector: options?.injector});\n  });\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\n\n/**\n * Provides persistent storage to the SCION Workbench.\n */\nexport abstract class WorkbenchStorage {\n\n  /**\n   * Method invoked to load a value from persisted storage.\n   */\n  public abstract load(key: string): Promise<string | null> | string | null;\n\n  /**\n   * Method invoked to write a value to persisted storage.\n   *\n   * This method may be called during page unload. If sending data to a web server,\n   * use `navigator.sendBeacon()` instead of `window.fetch()` to reliably transmit data.\n   */\n  public abstract store(key: string, value: string): Promise<void> | void;\n}\n\n/**\n * Default storage used by the SCION workbench to persist data in local storage.\n *\n * Local storage maintains a persistent storage area per origin. Data does not expire and remains after the browser restarts.\n *\n * @internal\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as registered conditionally under `WorkbenchStorage` DI token. */)\nexport class DefaultWorkbenchStorage implements WorkbenchStorage {\n\n  public load(key: string): string | null {\n    return localStorage.getItem(key);\n  }\n\n  public store(key: string, value: string): void {\n    localStorage.setItem(key, value);\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {booleanAttribute, DestroyRef, inject, Injector, numberAttribute, signal, WritableSignal} from '@angular/core';\nimport {WorkbenchStorage} from '../storage/workbench-storage';\nimport {takeUntilDestroyed, toObservable} from '@angular/core/rxjs-interop';\nimport {skipUntil} from 'rxjs/operators';\n\n/**\n * Creates a writable signal to read and write specified flag from and to workbench storage.\n */\nexport function renderingFlag<T extends string | number | boolean | null>(storageKey: string, defaultValue: T, options?: {injector?: Injector}): WritableSignal<T> {\n  const injector = options?.injector ?? inject(Injector);\n  const workbenchStorage = injector.get(WorkbenchStorage);\n  const flag = signal<T>(defaultValue);\n\n  // Read flag from storage.\n  const whenReadFromStorage = readFromStorage(storageKey).then(storedValue => {\n    if (storedValue === null) {\n      return;\n    }\n    switch (typeof defaultValue) {\n      case 'number': {\n        flag.set(numberAttribute(storedValue, defaultValue) as T);\n        break;\n      }\n      case 'boolean': {\n        flag.set(booleanAttribute(storedValue) as T);\n        break;\n      }\n      default: {\n        flag.set(storedValue as T);\n      }\n    }\n  });\n\n  // Write flag to storage.\n  toObservable(flag, {injector})\n    .pipe(\n      skipUntil(whenReadFromStorage),\n      takeUntilDestroyed(injector.get(DestroyRef)),\n    )\n    .subscribe(value => void workbenchStorage.store(storageKey, `${value}`));\n\n  return flag;\n}\n\nasync function readFromStorage(key: string): Promise<string | null> {\n  return inject(WorkbenchStorage).load(key);\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {UUID} from '@scion/toolkit/uuid';\n\n/**\n * Generates a UID (unique identifier).\n */\nexport const UID = {\n  /**\n   * Generates a UID (unique identifier) with length 8.\n   */\n  randomUID: (): string => {\n    return UUID.randomUUID().substring(0, 8);\n  },\n};\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/**\n * Returns the value clamped to the inclusive range of min and max.\n */\nexport function clamp(value: number, minmax: {min: number; max: number}): number {\n  return Math.max(minmax.min, Math.min(value, minmax.max));\n}\n","import {coerceElement} from '@angular/cdk/coercion';\nimport {booleanAttribute, DestroyRef, DOCUMENT, ElementRef, inject, Injector, numberAttribute} from '@angular/core';\nimport {Arrays} from '@scion/toolkit/util';\n\nimport {UID} from './uid.util';\nimport {DisposeFn} from './disposable';\nimport {Observable} from 'rxjs';\nimport {clamp} from './math.util';\n\n/**\n * Creates an HTML element and optionally adds it to the DOM.\n */\nexport function createElement(tag: string, options: ElementCreateOptions): HTMLElement {\n  const element = document.createElement(tag);\n  options.style && setStyle(element, options.style);\n  options.cssClass && element.classList.add(...Arrays.coerce(options.cssClass));\n  options.attributes && setAttribute(element, options.attributes);\n  options.text && (element.innerText = options.text);\n  options.parent?.appendChild(element);\n  return element;\n}\n\n/**\n * Applies the given style(s) to the given element.\n *\n * Specify styles to be modified by passing a dictionary containing CSS property names (hyphen case).\n * To remove a style, set its value to `null`.\n */\nexport function setStyle(element: HTMLElement | ElementRef<HTMLElement>, styles: {[style: string]: string | null}): void {\n  const target = coerceElement(element);\n  Object.entries(styles).forEach(([name, value]) => {\n    if (value === null) {\n      target.style.removeProperty(name);\n    }\n    else {\n      target.style.setProperty(name, value);\n    }\n  });\n}\n\n/**\n * Sets the given attribute(s) on the given element.\n * To remove an attribute, set its value to `null`.\n */\nexport function setAttribute(element: HTMLElement | ElementRef<HTMLElement>, attributes: {[name: string]: string | null}): void {\n  const target = coerceElement(element);\n  Object.entries(attributes).forEach(([name, value]) => {\n    if (value === null) {\n      target.removeAttribute(name);\n    }\n    else {\n      target.setAttribute(name, value);\n    }\n  });\n}\n\n/**\n * Sets specified CSS variable(s) to the given element.\n *\n * To remove a CSS variable, set its value to `null`, or use {@link unsetCssVariable}.\n */\nexport function setCssVariable(element: HTMLElement | ElementRef<HTMLElement>, variables: {[name: string]: string | null}): void {\n  const target = coerceElement(element);\n  Object.entries(variables).forEach(([name, value]) => {\n    if (value === null) {\n      target.style.removeProperty(name);\n    }\n    else {\n      target.style.setProperty(name, value);\n    }\n  });\n}\n\n/**\n * Removes specified CSS variable(s) from the given element.\n */\nexport function unsetCssVariable(element: HTMLElement | ElementRef<HTMLElement>, ...names: string[]): void {\n  const target = coerceElement(element);\n  names.forEach(name => target.style.removeProperty(name));\n}\n\n/**\n * Reads and parses specified CSS variable from given element. Defaults to the specified value if not available.\n */\nexport function readCssVariable<T extends string | number | boolean | null>(element: Element, variable: string, defaultValue: T): T {\n  const value = getComputedStyle(element).getPropertyValue(variable) || defaultValue; // empty string if not set\n  switch (typeof defaultValue) {\n    case 'number': {\n      return numberAttribute(value, defaultValue) as T;\n    }\n    case 'boolean': {\n      return booleanAttribute(value) as T;\n    }\n    default: {\n      return value as T;\n    }\n  }\n}\n\n/**\n * Sets specified CSS class(es) to the given element.\n */\nexport function setCssClass(element: HTMLElement | ElementRef<HTMLElement>, ...classes: string[]): void {\n  coerceElement(element).classList.add(...classes);\n}\n\n/**\n * Removes specified CSS class(es) from the given element.\n */\nexport function unsetCssClass(element: HTMLElement | ElementRef<HTMLElement>, ...classes: string[]): void {\n  coerceElement(element).classList.remove(...classes);\n}\n\n/**\n * Reads the current vertical and horizontal translation of given element.\n */\nexport function getCssTranslation(element: Element): {translateX: string | 'none'; translateY: string | 'none'} {\n  const transformStyle = getComputedStyle(element).getPropertyValue('transform');\n  if (transformStyle === 'none') {\n    return {\n      translateX: 'none',\n      translateY: 'none',\n    };\n  }\n\n  // The transform property returns a matrix in the form `matrix(a, b, c, d, tx, ty)`, where `tx` is the horizontal translation and `ty` is the vertical translation.\n  const matrix = transformStyle.slice('matrix('.length, -1).split(/,\\s+/);\n  return {\n    translateX: matrix[4]!,\n    translateY: matrix[5]!,\n  };\n}\n\n/**\n * Ensures that the given HTML element is positioned, setting its position to `relative` if it is not already positioned.\n *\n * Positioning is set using a constructable CSS stylesheet with a CSS layer. CSS layers have lower priority than \"normal\"\n * CSS declarations, and the layer name indicates the styling originates from `@scion/workbench`.\n *\n * This function adds an attribute to the element to locate it from the stylesheet, with the name containing a random identifier plus the context.\n *\n * This function must be passed an injector or called in an injection context. Destroying the injector will remove the attribute and the stylesheet.\n */\nexport function positionElement(elementLike: Element | ElementRef<Element>, options: {context: string; injector?: Injector}): void {\n  const injector = options.injector ?? inject(Injector);\n  const element = coerceElement(elementLike);\n  const document = injector.get(DOCUMENT);\n  const disposables = new Array<DisposeFn>();\n\n  // Generate identifiers to locate the element from the stylesheet.\n  const elementIdentifier = `data-wb-${options.context}-${UID.randomUID()}`;\n  const elementIdentifierImportant = `${elementIdentifier}-important`;\n\n  // Add stylesheet to change the element's position to relative.\n  const styleSheet = new CSSStyleSheet({});\n  styleSheet.insertRule(`\n      @layer sci-workbench {\n        [${elementIdentifier}] {\n          position: relative;\n        }\n      }`,\n  );\n  document.adoptedStyleSheets.push(styleSheet);\n  disposables.push(() => Arrays.remove(document.adoptedStyleSheets, styleSheet));\n\n  // Add attribute to locate the element from the stylesheet.\n  element.setAttribute(elementIdentifier, '');\n  disposables.push(() => element.removeAttribute(elementIdentifier));\n\n  // If CSS layer styles have no effect due to 'static' positioning or unset styles, enforce positioning with !important.\n  const animationFrame = requestAnimationFrame(() => {\n    if (getComputedStyle(element).position === 'static') {\n      styleSheet.insertRule(`\n        [${elementIdentifierImportant}] {\n          position: relative !important;\n        }\n      `);\n      element.setAttribute(elementIdentifierImportant, '');\n      disposables.push(() => element.removeAttribute(elementIdentifierImportant));\n    }\n  });\n  disposables.push(() => cancelAnimationFrame(animationFrame));\n\n  // Clean up when the injection context is destroyed.\n  injector.get(DestroyRef).onDestroy(() => disposables.forEach(disposable => disposable()));\n}\n\n/**\n * Emits when the next animation frame is executed.\n *\n * Unlike using `timer(0, animationFrameScheduler)`, this observable emits within the zone where it is subscribed.\n *\n * Note that the RxJS `animationFrameScheduler` may not necessarily execute in the current execution context, such as inside or outside Angular.\n * The scheduler always executes tasks in the zone where it was first used in the application.\n */\nexport function nextAnimationFrame$(): Observable<void> {\n  return new Observable<void>(observer => {\n    const animationFrame = requestAnimationFrame(() => observer.next());\n    return () => cancelAnimationFrame(animationFrame);\n  });\n}\n\n/**\n * Constrain passed bounding box based on specified constraints.\n */\nexport function constrainClientRect(clientRect: DOMRect, constraints: DOMRect | undefined): DOMRect;\nexport function constrainClientRect(clientRect: DOMRect | undefined, constraints: DOMRect | undefined): DOMRect | undefined;\nexport function constrainClientRect(clientRect: DOMRect | undefined, constraints: DOMRect | undefined): DOMRect | undefined {\n  if (!clientRect) {\n    return undefined;\n  }\n  if (!constraints) {\n    return clientRect;\n  }\n  const top = clamp(clientRect.top, {min: constraints.top, max: constraints.bottom});\n  const right = clamp(clientRect.right, {min: constraints.left, max: constraints.right});\n  const bottom = clamp(clientRect.bottom, {min: constraints.top, max: constraints.bottom});\n  const left = clamp(clientRect.left, {min: constraints.left, max: constraints.right});\n  const width = right - left;\n  const height = bottom - top;\n  return new DOMRect(left, top, width, height);\n}\n\n/**\n * Describes how to create a new HTML element.\n */\nexport interface ElementCreateOptions {\n  /**\n   * Specifies the parent where to add this element to the DOM tree.\n   * If not specified, the element is not added to the DOM.\n   */\n  parent?: Node;\n  cssClass?: string | string[];\n  style?: {[style: string]: any};\n  attributes?: {[name: string]: any};\n  text?: string;\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, DOCUMENT, inject, Injectable, signal} from '@angular/core';\nimport {ɵWorkbenchLayout} from './ɵworkbench-layout';\nimport {throwError} from '../common/throw-error.util';\nimport {resolveWhen} from '../common/resolve-when.util';\nimport {renderingFlag} from './rendering-flag';\nimport {readCssVariable} from '../common/dom.util';\n\n/**\n * Provides access to the workbench layout.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchLayoutService {\n\n  private readonly _layout = signal<ɵWorkbenchLayout | null>(null);\n  private readonly _dragging = signal(false);\n  private readonly _moving = signal(false);\n  private readonly _resizing = signal(false);\n\n  /**\n   * Provides the layout of the workbench, throwing an error if the initial layout is not yet available.\n   */\n  public readonly layout = computed(() => this._layout() ?? throwError('[NullLayoutError] Workbench layout not available yet.'));\n\n  /**\n   * Indicates whether the layout is available, i.e., after Angular has performed the initial navigation.\n   */\n  public readonly hasLayout = computed(() => this._layout() !== null);\n\n  /**\n   * Resolves when the layout is available, i.e., after Angular has performed the initial navigation.\n   */\n  public readonly whenLayoutAvailable = resolveWhen(this.hasLayout);\n\n  /**\n   * Indicates if a drag operation is active, such as moving a view or dialog, or resizing a part.\n   */\n  public readonly dragging = computed(() => this._dragging() || this._moving() || this._resizing());\n\n  /**\n   * Controls the alignment of the bottom activity panel.\n   *\n   * Defaults to the `--sci-workbench-layout-panel-align` design token, or `justify` if not set.\n   */\n  public readonly panelAlignment = renderingFlag(\n    'scion.workbench.layout.panel.align',\n    readCssVariable(inject(DOCUMENT).documentElement, '--sci-workbench-layout-panel-align', 'justify'),\n  );\n\n  /**\n   * Controls animation of activity panels.\n   *\n   * Defaults to the `--sci-workbench-layout-panel-animate` design token, or `true` if not set.\n   */\n  public readonly panelAnimation = renderingFlag(\n    'scion.workbench.layout.panel.animate',\n    readCssVariable(inject(DOCUMENT).documentElement, '--sci-workbench-layout-panel-animate', true),\n  );\n\n  /**\n   * Signals dragging a workbench element, such as dragging a view tab.\n   */\n  public signalDragging(dragging: boolean): void {\n    this._dragging.set(dragging);\n  }\n\n  /**\n   * Signals moving a workbench element, such as moving a dialog.\n   */\n  public signalMoving(moving: boolean): void {\n    this._moving.set(moving);\n  }\n\n  /**\n   * Signals resizing a workbench element, such as resizing a dialog or part.\n   */\n  public signalResizing(resizing: boolean): void {\n    this._resizing.set(resizing);\n  }\n\n  /**\n   * Sets the given {@link WorkbenchLayout}.\n   */\n  public setLayout(layout: ɵWorkbenchLayout): void {\n    this._layout.set(layout);\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {InjectionToken} from '@angular/core';\nimport {Route} from '@angular/router';\n\n/**\n * Name of the query parameter that contains the layout of the main area.\n */\nexport const MAIN_AREA_LAYOUT_QUERY_PARAM = 'main_area';\n\n/**\n * Defines the context in which a viewtab is rendered.\n *\n * - `tab`: if rendered as view tab in the tabbar\n * - `list-item`:  if rendered as list item in the view list menu\n * - `drag-image`: if rendered as drag image while dragging a view tab\n */\nexport type ViewTabRenderingContext = 'tab' | 'list-item' | 'drag-image';\n\n/**\n * DI token to inject the context in which the view tab is rendered.\n */\nexport const VIEW_TAB_RENDERING_CONTEXT = new InjectionToken<ViewTabRenderingContext>('VIEW_TAB_RENDERING_CONTEXT');\n\n/**\n * Prefix used to identify an anonymous perspective that the workbench creates for views moved to a new window.\n */\nexport const ANONYMOUS_PERSPECTIVE_ID_PREFIX = 'anonymous.';\n\n/**\n * DI token for registering workbench-specific routes for workbench outlets.\n */\nexport const WORKBENCH_ROUTE = new InjectionToken<Route>('WORKBENCH_ROUTE');\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Observable, OperatorFunction} from 'rxjs';\nimport {mergeMap} from 'rxjs/operators';\n\n/**\n * Serializes the execution of elements emitted by the source Observable.\n *\n * For each element emitted by the source, the specified callback function is called.\n * The next element will only be processed once the Promise or Observable returned by\n * the callback function resolves or completes.\n */\nexport function serializeExecution<IN, OUT>(fn: (value: IN) => Observable<OUT> | Promise<OUT>): OperatorFunction<IN, OUT> {\n  return mergeMap(element => fn(element), 1);\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {asapScheduler, AsyncSubject, lastValueFrom, Subject} from 'rxjs';\nimport {serializeExecution} from '../common/operators';\nimport {catchError, observeOn} from 'rxjs/operators';\nimport {InjectionToken} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\n\n/**\n * Serializes navigation requests to the Angular Router to prevent the cancellation of previously initiated asynchronous navigations.\n */\nexport const ANGULAR_ROUTER_MUTEX = new InjectionToken<SingleTaskExecutor>('ANGULAR_ROUTER_MUTEX', {\n  providedIn: 'root',\n  factory: () => new SingleTaskExecutor(),\n});\n\n/**\n * Allows the serial execution of tasks.\n *\n * At any one time, there is only one task executing. When submitting a task and if there is a task already executing,\n * the submitted task will be queued for later execution.\n *\n * This executor must be constructed within an injection context. Destroying the injection context will also destroy the executor.\n */\nexport class SingleTaskExecutor {\n\n  private _task$ = new Subject<Task>();\n\n  constructor() {\n    this._task$\n      .pipe(\n        // Schedule the task asynchronously so that it is not executed if the executor is destroyed in the same \"call stack\",\n        // happening, for example, when destroying the Testbed in unit tests. Angular destroys contexts from the bottom up,\n        // i.e., child contexts are destroyed before parent contexts. If a task is scheduled in a destroy lifecycle hook of\n        // a child context, the task would still be executed because the executor is not destroyed yet.\n        observeOn(asapScheduler),\n        serializeExecution(task => task.execute()),\n        catchError((error, caught) => caught),\n        takeUntilDestroyed(),\n      )\n      .subscribe();\n  }\n\n  /**\n   * Submits a task for serial execution.\n   *\n   * Returns a Promise that resolves to the result of the passed task.\n   */\n  public submit<T>(task: () => Promise<T>): Promise<T> {\n    const ɵtask = new Task<T>(task);\n    this._task$.next(ɵtask);\n    return ɵtask.await();\n  }\n}\n\nclass Task<T = any> {\n\n  private _done$ = new AsyncSubject<T>();\n\n  constructor(private _work: () => Promise<T>) {\n  }\n\n  public async execute(): Promise<void> {\n    try {\n      const result = await this._work();\n      this._done$.next(result);\n      this._done$.complete();\n    }\n    catch (error) {\n      this._done$.error(error);\n    }\n  }\n\n  public await(): Promise<T> {\n    return lastValueFrom(this._done$);\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Navigation} from '@angular/router';\nimport {NavigationStates} from './routing.model';\nimport {ActivityId} from '../workbench.identifiers';\n\n/**\n * Provides methods to associate {@link WorkbenchNavigationalState} with a navigation.\n */\nexport const WorkbenchNavigationalStates = {\n\n  /**\n   * Returns workbench-specific state associated with given navigation, or `null` if the navigation was not performed through the workbench router.\n   */\n  fromNavigation: (navigation: Navigation): WorkbenchNavigationalState | null => {\n    return navigation.extras.state?.[WORKBENCH_NAVIGATION_STATE_KEY] as WorkbenchNavigationalState | undefined ?? null;\n  },\n\n  /**\n   * Creates a state object with workbench-specific data that can be passed to a workbench navigation.\n   */\n  create: (state: WorkbenchNavigationalState): {[key: string]: unknown} => {\n    return {\n      [WORKBENCH_NAVIGATION_STATE_KEY]: state,\n    };\n  },\n} as const;\n\n/**\n * Represents workbench-specific state associated with a navigation.\n */\nexport interface WorkbenchNavigationalState {\n  /**\n   * Arrangement of parts and views.\n   */\n  grids: {\n    /**\n     * Serialized main grid.\n     */\n    main: string;\n    /**\n     * Serialized activity grids.\n     */\n    [activityId: ActivityId]: string;\n  };\n  /**\n   * Arrangement of activities.\n   */\n  activityLayout: string;\n  /**\n   * Identifies the perspective that is navigated.\n   */\n  perspectiveId?: string;\n  /**\n   * Provides navigation state of views contained in the workbench layout.\n   */\n  navigationStates: NavigationStates;\n}\n\n/**\n * Key for associating workbench-specific state with a navigation.\n */\nconst WORKBENCH_NAVIGATION_STATE_KEY = 'ɵworkbench';\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {InjectionToken, Signal} from '@angular/core';\n\n/**\n * Signature of a function to provide texts to the SCION Workbench.\n *\n * Texts starting with the percent symbol (`%`) are passed to the text provider for translation, with the percent symbol omitted.\n *\n * A text provider can be registered via configuration passed to the {@link provideWorkbench} function.\n *\n * The function:\n * - Can call `inject` to get any required dependencies.\n * - Can call `toSignal` to convert an Observable to a Signal.\n *\n * @param key - Translation key of the text.\n * @param params - Parameters used for text interpolation.\n * @return Text associated with the key, or `undefined` if not found.\n *         Localized applications should return the text in the current language, and update the signal with the translated text each time when the language changes.\n */\nexport type WorkbenchTextProviderFn = (key: string, params: {[name: string]: string}) => Signal<string> | string | undefined;\n\n/**\n * Represents either a text or a key for translation.\n *\n * A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n * Key and parameters are passed to {@link WorkbenchConfig.textProvider} for translation.\n *\n * Semicolons in interpolation parameters must be escaped with two backslashes (`\\\\;`).\n *\n * Examples:\n * - `%key`: translation key\n * - `%key;param=value`: translation key with a single interpolation parameter\n * - `%key;param1=value1;param2=value2`: translation key with multiple interpolation parameters\n * - `text`: no translation key, text is returned as is\n */\nexport type Translatable = string | `%${string}`;\n\n/**\n * DI token for injecting text providers to localize the SCION Workbench.\n *\n * Multiple text providers can be registered. Providers are called in registration order.\n * If a provider does not provide the text, the next provider is called, and so on.\n */\nexport const WORKBENCH_TEXT_PROVIDER = new InjectionToken<WorkbenchTextProviderFn>('WORKBENCH_TEXT_PROVIDER');\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {assertNotInReactiveContext, computed, createEnvironmentInjector, DestroyRef, EnvironmentInjector, inject, Injector, isSignal, runInInjectionContext, signal, Signal, untracked} from '@angular/core';\nimport {Translatable, WORKBENCH_TEXT_PROVIDER, WorkbenchTextProviderFn} from './workbench-text-provider.model';\n\n/**\n * Provides the text for the given {@link Translatable} based on registered text providers.\n *\n * A {@link Translatable} is a string that, if starting with the percent symbol (`%`), is passed to the text provider for translation, with the percent symbol omitted.\n * Otherwise, the text is returned as is. A translation key may include parameters in matrix notation for text interpolation.\n *\n * Examples:\n * - `%key`: translation key\n * - `%key;param=value`: translation key with a single interpolation parameter\n * - `%key;param1=value1;param2=value2`: translation key with multiple interpolation parameters\n * - `text`: no translation key, text is returned as is\n *\n * The function:\n * - Must be called within an injection context, or an explicit {@link Injector} passed.\n * - Must be called in a non-reactive (non-tracking) context.\n *\n * @experimental since 20.0.0-beta.3; API and behavior may change in any version without notice.\n */\nexport function text(translatable: Signal<Translatable> | Translatable, options?: {injector?: Injector}): Signal<string>;\nexport function text(translatable: Signal<Translatable | undefined> | Translatable | undefined, options?: {injector?: Injector}): Signal<string | undefined>;\nexport function text(translatable: Signal<Translatable | null> | Translatable | null, options?: {injector?: Injector}): Signal<string | null>;\nexport function text(translatable: Signal<Translatable | undefined | null> | Translatable | undefined | null, options?: {injector?: Injector}): Signal<string | undefined | null>;\nexport function text(translatable: Signal<Translatable | undefined | null> | Translatable | undefined | null, options?: {injector?: Injector}): Signal<string | undefined | null> {\n  assertNotInReactiveContext(text, 'Call text() in a non-reactive (non-tracking) context, as it may allocate resources that are not released until the injection context is destroyed.');\n  const injector = options?.injector ?? inject(Injector);\n\n  // Use a separate injection context per translatable to clean up allocated resources when it changes.\n  let provideTextInjector: EnvironmentInjector | undefined;\n  injector.get(DestroyRef).onDestroy(() => provideTextInjector?.destroy());\n\n  // Call the text provider function.\n  const translation = computed(() => {\n    const keyOrText = isSignal(translatable) ? translatable() : translatable;\n\n    return untracked(() => {\n      // Destroy previous injection context (if any) to clean up allocated resources, like RxJS subscriptions.\n      provideTextInjector?.destroy();\n      // Create a separate injection context.\n      provideTextInjector = createEnvironmentInjector([], injector.get(EnvironmentInjector));\n      // Call text provider.\n      return runInInjectionContext(provideTextInjector, () => provideText(keyOrText));\n    });\n  });\n\n  // Track translation in separate reactive context to not call the text provider function on translation change.\n  return computed(() => translation()());\n}\n\n/**\n * Provides the text for the given {@link Translatable} based on text providers registered under the {@link WORKBENCH_TEXT_PROVIDER} DI token.\n *\n * Multiple text providers can be registered. Providers are called in registration order. If a provider does not provide the text, the next provider is called, and so on.\n */\nfunction provideText(translatable: Translatable | undefined | null): Signal<string | undefined | null> {\n  const textProviders = inject(WORKBENCH_TEXT_PROVIDER, {optional: true}) as WorkbenchTextProviderFn[] | null;\n  if (!textProviders?.length || !translatable?.startsWith('%') || translatable === '%') {\n    return signal(translatable);\n  }\n\n  const {key, params} = parseTranslatable(translatable as `%${string}`);\n  for (const textProvider of textProviders) {\n    const text = textProvider(key, params);\n    if (text !== undefined) {\n      return isSignal(text) ? text : signal(text);\n    }\n  }\n  return signal(translatable);\n}\n\n/**\n * Parses a translation key into its key and parameters, if any.\n *\n * Examples:\n * - `%key`: translation key\n * - `%key;param=value`: translation key with a single interpolation parameter\n * - `%key;param1=value1;param2=value2`: translation key with multiple interpolation parameters\n */\nfunction parseTranslatable(translationKey: `%${string}`): {key: string; params: Record<string, string>} {\n  const {key, params} = /^%(?<key>[^;]+)(;(?<params>.*))?$/.exec(translationKey)!.groups!;\n  return {key: key!, params: parseMatrixParams(params)};\n}\n\n/**\n * Parses params in matrix notation.\n *\n * Format: `param1=value1;param2=value2`\n */\nfunction parseMatrixParams(matrixParams: string | undefined): Record<string, string> {\n  if (!matrixParams?.length) {\n    return {};\n  }\n\n  const params: Record<string, string> = {};\n  for (const match of encodeEscapedSemicolons(matrixParams).matchAll(/(?<paramName>[^=;]+)=(?<paramValue>[^;]*)/g)) {\n    const {paramName, paramValue} = match.groups as {paramName: string; paramValue: string};\n    params[paramName] = decodeSemicolons(paramValue);\n  }\n  return params;\n\n  /**\n   * Encodes escaped semicolons (`\\\\;`) as `&#x3b` (Unicode) to prevent interpretation as interpolation parameter separators.\n   */\n  function encodeEscapedSemicolons(value: string): string {\n    return value.replaceAll('\\\\;', '&#x3b');\n  }\n\n  /**\n   * Decodes encoded semicolons (`&#x3b`) back to semicolons (`;`).\n   */\n  function decodeSemicolons(value: string): string {\n    return value.replaceAll('&#x3b', ';');\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Pipe, PipeTransform, signal, Signal, untracked} from '@angular/core';\nimport {Translatable} from './workbench-text-provider.model';\nimport {text} from './text';\n\n/**\n * Enables the translation of a given {@link Translatable}.\n *\n * A {@link Translatable} is a string that, if starting with the percent symbol (`%`), is passed to the text provider for translation, with the percent symbol omitted.\n * Otherwise, the text is returned as is. A translation key may include parameters in matrix notation for text interpolation.\n *\n * Examples:\n * - `%key`: translation key\n * - `%key;param=value`: translation key with a single interpolation parameter\n * - `%key;param1=value1;param2=value2`: translation key with multiple interpolation parameters\n * - `text`: no translation key, text is returned as is\n *\n * @experimental since 20.0.0-beta.3; API and behavior may change in any version without notice.\n */\n@Pipe({name: 'wbText'})\nexport class TextPipe implements PipeTransform {\n\n  private _translatable = signal<Translatable | undefined | null>(undefined);\n  private _text = text(this._translatable);\n\n  public transform(translatable: Translatable): Signal<string>;\n  public transform(translatable: Translatable | undefined): Signal<string | undefined>;\n  public transform(translatable: Translatable | null): Signal<string | null>;\n  public transform(translatable: Translatable | undefined | null): Signal<string | undefined | null> {\n    // DO NOT call text() on key change to avoid stale RxJS subscriptions of previous texts,\n    // as allocated resources are only cleaned up when the injection context, such as this pipe, is destroyed.\n    untracked(() => this._translatable.set(translatable));\n    return this._text;\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {UrlSegment} from '@angular/router';\nimport {CanCloseFn, CanCloseRef, WorkbenchMenuItem} from '../workbench.model';\nimport {WorkbenchPart} from '../part/workbench-part.model';\nimport {NavigationData, NavigationState} from '../routing/routing.model';\nimport {Signal} from '@angular/core';\nimport {ViewId} from '../workbench.identifiers';\nimport {Translatable} from '../text/workbench-text-provider.model';\n\n/**\n * A view is a visual workbench element for displaying content stacked or side-by-side in the workbench layout.\n *\n * Users can drag views from one part to another, even across windows, or place them side-by-side, horizontally and vertically.\n *\n * The view component can inject this handle to interact with the view.\n *\n * @see WorkbenchRouter\n */\nexport abstract class WorkbenchView {\n\n  /**\n   * Identity of this view.\n   *\n   * @see alternativeId\n   */\n  public abstract readonly id: ViewId;\n\n  /**\n   * Alternative identity of this view.\n   *\n   * A view can have an alternative id, a meaningful but not necessarily unique name. A view can\n   * be identified either by its unique or alternative id.\n   *\n   * @see id\n   */\n  public abstract readonly alternativeId: string | undefined;\n\n  /**\n   * Provides navigation details of this view.\n   *\n   * A view can be navigated using {@link WorkbenchRouter#navigate} or {@link WorkbenchLayout#navigateView}.\n   */\n  public abstract readonly navigation: Signal<WorkbenchViewNavigation | undefined>;\n\n  /**\n   * Part which contains this view.\n   *\n   * Note: the part of a view can change, e.g., when the view is moved to another part.\n   */\n  public abstract readonly part: Signal<WorkbenchPart>;\n\n  /**\n   * Title displayed in the view tab.\n   *\n   * Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   */\n  public abstract get title(): Signal<Translatable | null>;\n  public abstract set title(title: Translatable | null);\n\n  /**\n   * Subtitle displayed in the view tab.\n   *\n   * Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   */\n  public abstract get heading(): Signal<Translatable | null>;\n  public abstract set heading(heading: Translatable | null);\n\n  /**\n   * Specifies CSS class(es) to add to the view, e.g., to locate the view in tests.\n   */\n  public abstract get cssClass(): Signal<string[]>;\n  public abstract set cssClass(cssClass: string | string[]);\n\n  /**\n   * Indicates whether the view has unsaved changes.\n   * If marked as dirty, a visual indicator is displayed in the view tab.\n   */\n  public abstract get dirty(): Signal<boolean>;\n  public abstract set dirty(dirty: boolean);\n\n  /**\n   * Controls whether the view can be closed. Defaults to `true`.\n   */\n  public abstract get closable(): Signal<boolean>;\n  public abstract set closable(closable: boolean);\n\n  /**\n   * Computes whether this view can be effectively closed based on its current state, e.g., is closable and not blocked.\n   *\n   * @internal\n   */\n  public abstract readonly isClosable: Signal<boolean>;\n\n  /**\n   * Indicates whether this view is active or inactive.\n   */\n  public abstract readonly active: Signal<boolean>;\n\n  /**\n   * Indicates whether this view has the focus.\n   */\n  public abstract readonly focused: Signal<boolean>;\n\n  /**\n   * The position of this view in the tabbar.\n   */\n  public abstract readonly position: Signal<number>;\n\n  /**\n   * `True` when this view is the first view in the tabbar.\n   */\n  public abstract readonly first: Signal<boolean>;\n\n  /**\n   * `True` when this view is the last view in the tabbar.\n   */\n  public abstract readonly last: Signal<boolean>;\n\n  /**\n   * Indicates whether the tab of this view is scrolled into the tabbar.\n   */\n  public abstract readonly scrolledIntoView: Signal<boolean>;\n\n  /**\n   * Menu items associated with this view.\n   */\n  public abstract readonly menuItems: Signal<WorkbenchMenuItem[]>;\n\n  /**\n   * Gets the activation instant of this view.\n   */\n  public abstract readonly activationInstant: Signal<number>;\n\n  /**\n   * Activates this view.\n   */\n  public abstract activate(): Promise<boolean>;\n\n  /**\n   * Destroys this view (or sibling views) and the associated routed component.\n   *\n   * @param target\n   *        Allows to control which view(s) to close:\n   *\n   *        - self: closes this view\n   *        - all-views: closes all views of this part\n   *        - other-views: closes the other views of this part\n   *        - views-to-the-right: closes the views to the right of this view\n   *        - views-to-the-left: closes the views to the left of this view\n   *\n   */\n  public abstract close(target?: 'self' | 'all-views' | 'other-views' | 'views-to-the-right' | 'views-to-the-left'): Promise<boolean>;\n\n  /**\n   * Moves this view to a new browser window.\n   */\n  public abstract move(target: 'new-window'): void;\n\n  /**\n   * Moves this view to a different or new part in the specified region.\n   *\n   * Specifying a target workbench identifier allows the view to be moved to a workbench in a different browser window.\n   * The target workbench ID is available via {@link WORKBENCH_ID} DI token in the target application.\n   */\n  public abstract move(partId: string, options?: {region?: 'north' | 'south' | 'west' | 'east'; workbenchId?: string}): void;\n\n  /**\n   * Registers a guard to confirm closing the view, replacing any previous guard.\n   *\n   * The callback can call `inject` to get dependencies.\n   *\n   * Example:\n   * ```ts\n   * import {inject} from '@angular/core';\n   * import {WorkbenchMessageBoxService, WorkbenchView} from '@scion/workbench';\n   *\n   * inject(WorkbenchView).canClose(async () => {\n   *   if (!inject(WorkbenchView).dirty()) {\n   *     return true;\n   *   }\n   *   const action = await inject(WorkbenchMessageBoxService).open('Do you want to save changes?', {\n   *     actions: {\n   *       yes: 'Yes',\n   *       no: 'No',\n   *       cancel: 'Cancel'\n   *     }\n   *   });\n   *\n   *   switch (action) {\n   *     case 'yes':\n   *       // Store changes ...\n   *       return true;\n   *     case 'no':\n   *       return true;\n   *     default:\n   *       return false;\n   *   }\n   * });\n   * ```\n   *\n   * @param canClose - Callback to confirm closing the view.\n   * @returns Reference to the `CanClose` guard, which can be used to unregister the guard.\n   */\n  public abstract canClose(canClose: CanCloseFn): CanCloseRef;\n\n  /**\n   * Gets size and position of this view, or `undefined` if not constructed.\n   */\n  public abstract readonly bounds: Signal<DOMRect | undefined>;\n}\n\n/**\n * Provides navigation details of a workbench view.\n */\nexport interface WorkbenchViewNavigation {\n  /**\n   * Unique ID per navigation.\n   *\n   * @internal\n   */\n  id: string;\n\n  /**\n   * Path of this view.\n   */\n  path: UrlSegment[];\n\n  /**\n   * Hint passed to the navigation.\n   */\n  hint?: string;\n\n  /**\n   * Data passed to the navigation.\n   */\n  data?: NavigationData;\n\n  /**\n   * State passed to the navigation.\n   */\n  state?: NavigationState;\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {WorkbenchPartAction} from '../workbench.model';\nimport {WorkbenchView} from '../view/workbench-view.model';\nimport {Signal} from '@angular/core';\nimport {NavigationData, NavigationState} from '../routing/routing.model';\nimport {UrlSegment} from '@angular/router';\nimport {PartId, ViewId} from '../workbench.identifiers';\nimport {Translatable} from '../text/workbench-text-provider.model';\n\n/**\n * A part is a visual element of the workbench layout. Parts can be docked to the side or\n * positioned relative to each other. A part can display content or stack views.\n *\n * The part component can inject this handle to interact with the part.\n *\n * @see WorkbenchView\n */\nexport abstract class WorkbenchPart {\n\n  /**\n   * Identity of this part.\n   */\n  public abstract readonly id: PartId;\n\n  /**\n   * Alternative identity of this part.\n   *\n   * A part can have an alternative id, a meaningful but not necessarily unique name. A part can\n   * be identified either by its unique or alternative id.\n   *\n   * @see id\n   */\n  public abstract readonly alternativeId: string | undefined;\n\n  /**\n   * Title displayed in the part bar.\n   *\n   * Note that the title of the top-leftmost part of a docked part cannot be changed.\n   *\n   * Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   */\n  public abstract get title(): Signal<Translatable | undefined>;\n  public abstract set title(title: Translatable | undefined);\n\n  /**\n   * Indicates whether this part is located in the workbench main area.\n   */\n  public abstract readonly isInMainArea: boolean;\n\n  /**\n   * Indicates whether this part is located in the workbench peripheral area.\n   */\n  public abstract readonly peripheral: Signal<boolean>;\n\n  /**\n   * Indicates whether this part is the top-leftmost part.\n   */\n  public abstract readonly topLeft: Signal<boolean>;\n\n  /**\n   * Indicates whether this part is the top-rightmost part.\n   */\n  public abstract readonly topRight: Signal<boolean>;\n\n  /**\n   * Indicates whether this part is active or inactive.\n   */\n  public abstract readonly active: Signal<boolean>;\n\n  /**\n   * Indicates whether this part has the focus.\n   */\n  public abstract readonly focused: Signal<boolean>;\n\n  /**\n   * Identifies the active view, or `null` if none.\n   *\n   * @deprecated since version 20.0.0-beta.4. Use `WorkbenchPart.activeView` instead. API will be removed in version 22.\n   */\n  public abstract readonly activeViewId: Signal<ViewId | null>;\n\n  /**\n   * Identifies views opened in this part.\n   *\n   * @deprecated since version 20.0.0-beta.4. Use `WorkbenchPart.views` instead. API will be removed in version 22.\n   */\n  public abstract readonly viewIds: Signal<ViewId[]>;\n\n  /**\n   * Gets the active view of this part, or `null` if none.\n   */\n  public abstract readonly activeView: Signal<WorkbenchView | null>;\n\n  /**\n   * Gets views opened in this part.\n   */\n  public abstract readonly views: Signal<WorkbenchView[]>;\n\n  /**\n   * Actions associated with this part.\n   */\n  public abstract readonly actions: Signal<WorkbenchPartAction[]>;\n\n  /**\n   * Specifies CSS class(es) to add to the part, e.g., to locate the part in tests.\n   */\n  public abstract get cssClass(): Signal<string[]>;\n  public abstract set cssClass(cssClass: string | string[]);\n\n  /**\n   * Provides navigation details of this part.\n   *\n   * A part can be navigated to display content when its view stack is empty.\n   * A navigated part can still have views but won't display navigated content unless its view stack is empty.\n   *\n   * A part can be navigated using {@link WorkbenchLayout#navigatePart}.\n   */\n  public abstract readonly navigation: Signal<WorkbenchPartNavigation | undefined>;\n\n  /**\n   * Gets the activation instant of this part.\n   */\n  public abstract readonly activationInstant: Signal<number>;\n\n  /**\n   * Activates this part.\n   */\n  public abstract activate(): Promise<boolean>;\n\n  /**\n   * Gets size and position of this part, or `undefined` if not constructed.\n   */\n  public abstract readonly bounds: Signal<DOMRect | undefined>;\n}\n\n/**\n * Provides navigation details of a workbench part.\n */\nexport interface WorkbenchPartNavigation {\n  /**\n   * Unique ID per navigation.\n   *\n   * @internal\n   */\n  id: string;\n\n  /**\n   * Path of this part.\n   */\n  path: UrlSegment[];\n\n  /**\n   * Hint passed to the navigation.\n   */\n  hint?: string;\n\n  /**\n   * Data passed to the navigation.\n   */\n  data?: NavigationData;\n\n  /**\n   * State passed to the navigation.\n   */\n  state?: NavigationState;\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Signal} from '@angular/core';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {DialogId} from '../workbench.identifiers';\n\n/**\n * Handle to interact with a dialog opened via {@link WorkbenchDialogService}.\n *\n * The dialog component can inject this handle to interact with the dialog.\n *\n * Dialog inputs are available as input properties in the dialog component.\n */\nexport abstract class WorkbenchDialog {\n\n  /**\n   * Identity of this dialog.\n   */\n  public abstract readonly id: DialogId;\n\n  /**\n   * Sets the title of the dialog.\n   *\n   * Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   */\n  public abstract get title(): Signal<Translatable | undefined>;\n  public abstract set title(title: Translatable | undefined);\n\n  /**\n   * Sets the preferred dialog size. Defaults to the content's intrinsic size, constrained by min and max size, if set.\n   */\n  public abstract readonly size: WorkbenchDialogSize;\n\n  /**\n   * Controls if to apply a padding to the content of the dialog. Defaults to `true`.\n   *\n   * This setting does not affect the padding of the dialog header and footer.\n   *\n   * The default padding can be changed via the CSS variable `--sci-workbench-dialog-padding`.\n   */\n  public abstract get padding(): Signal<boolean>;\n  public abstract set padding(padding: boolean);\n\n  /**\n   * Specifies if to display a close button in the dialog header. Defaults to `true`.\n   */\n  public abstract get closable(): Signal<boolean>;\n  public abstract set closable(closable: boolean);\n\n  /**\n   * Specifies if the user can resize the dialog. Defaults to `true`.\n   */\n  public abstract get resizable(): Signal<boolean>;\n  public abstract set resizable(resizable: boolean);\n\n  /**\n   * Specifies CSS class(es) to add to the dialog, e.g., to locate the dialog in tests.\n   */\n  public abstract get cssClass(): Signal<string[]>;\n  public abstract set cssClass(cssClass: string | string[]);\n\n  /**\n   * Indicates whether this dialog has the focus.\n   */\n  public abstract readonly focused: Signal<boolean>;\n\n  /**\n   * Closes the dialog. Optionally, pass a result or an error to the dialog opener.\n   */\n  public abstract close<R>(result?: R | Error): void;\n\n  /**\n   * Gets size and position of this dialog, or `undefined` if not constructed.\n   */\n  public abstract readonly bounds: Signal<DOMRect | undefined>;\n}\n\n/**\n * Represents the preferred dialog size.\n */\nexport interface WorkbenchDialogSize {\n  /**\n   * Specifies the height of the dialog, constrained by {@link minHeight} and {@link maxHeight}, if any.\n   */\n  get height(): Signal<string | undefined>;\n\n  set height(height: string | undefined);\n\n  /**\n   * Specifies the width of the dialog, constrained by {@link minWidth} and {@link maxWidth}, if any.\n   */\n  get width(): Signal<string | undefined>;\n\n  set width(width: string | undefined);\n\n  /**\n   * Specifies the minimum height of the dialog.\n   */\n  get minHeight(): Signal<string | undefined>;\n\n  set minHeight(minHeight: string | undefined);\n\n  /**\n   * Specifies the maximum height of the dialog.\n   */\n  get maxHeight(): Signal<string | undefined>;\n\n  set maxHeight(maxHeight: string | undefined);\n\n  /**\n   * Specifies the minimum width of the dialog.\n   */\n  get minWidth(): Signal<string | undefined>;\n\n  set minWidth(minWidth: string | undefined);\n\n  /**\n   * Specifies the maximum width of the dialog.\n   */\n  get maxWidth(): Signal<string | undefined>;\n\n  set maxWidth(maxWidth: string | undefined);\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {PopupId} from '../workbench.identifiers';\nimport {Signal} from '@angular/core';\n\n/**\n * A popup is a visual workbench element for displaying content above other content. The popup is positioned relative\n * to an anchor based on its preferred alignment. The anchor can be an element or a coordinate.\n *\n * The popup component can inject this handle to interact with the popup.\n *\n * Popup inputs are available as input properties in the popup component.\n *\n * @see WorkbenchPopupService\n */\nexport abstract class WorkbenchPopup {\n\n  /**\n   * Identity of this popup.\n   */\n  public abstract readonly id: PopupId;\n\n  /**\n   * Sets the preferred popup size. Defaults to the content's intrinsic size, constrained by min and max size, if set.\n   */\n  public abstract readonly size: WorkbenchPopupSize;\n\n  /**\n   * Specifies CSS class(es) to add to the popup, e.g., to locate the popup in tests.\n   */\n  public abstract get cssClass(): Signal<string[]>;\n  public abstract set cssClass(cssClass: string | string[]);\n\n  /**\n   * Indicates whether this popup has the focus.\n   */\n  public abstract readonly focused: Signal<boolean>;\n\n  /**\n   * Sets a result that will be passed to the popup opener when the popup is closed on focus loss {@link CloseStrategy#onFocusLost}.\n   */\n  public abstract setResult<R>(result?: R): void;\n\n  /**\n   * Closes the popup. Optionally, pass a result or an error to the popup opener.\n   */\n  public abstract close<R>(result?: R | Error): void;\n\n  /**\n   * Gets size and position of this popup, or `undefined` if not constructed.\n   */\n  public abstract readonly bounds: Signal<DOMRect | undefined>;\n}\n\n/**\n * Represents the preferred size of a popup.\n */\nexport interface WorkbenchPopupSize {\n  /**\n   * Specifies the height of the popup, constrained by {@link minHeight} and {@link maxHeight}, if any.\n   */\n  get height(): Signal<string | undefined>;\n\n  set height(height: string | undefined);\n\n  /**\n   * Specifies the width of the popup, constrained by {@link minWidth} and {@link maxWidth}, if any.\n   */\n  get width(): Signal<string | undefined>;\n\n  set width(width: string | undefined);\n\n  /**\n   * Specifies the minimum height of the popup.\n   */\n  get minHeight(): Signal<string | undefined>;\n\n  set minHeight(minHeight: string | undefined);\n\n  /**\n   * Specifies the maximum height of the popup.\n   */\n  get maxHeight(): Signal<string | undefined>;\n\n  set maxHeight(maxHeight: string | undefined);\n\n  /**\n   * Specifies the minimum width of the popup.\n   */\n  get minWidth(): Signal<string | undefined>;\n\n  set minWidth(minWidth: string | undefined);\n\n  /**\n   * Specifies the maximum width of the popup.\n   */\n  get maxWidth(): Signal<string | undefined>;\n\n  set maxWidth(maxWidth: string | undefined);\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component, computed, inject, isDevMode} from '@angular/core';\nimport {TextPipe} from '../text/text.pipe';\nimport {WorkbenchService} from '../workbench.service';\nimport {WorkbenchView} from '../view/workbench-view.model';\nimport {WorkbenchPart} from '../part/workbench-part.model';\nimport {WorkbenchDialog} from '../dialog/workbench-dialog.model';\nimport {WorkbenchPopup} from '../popup/workbench-popup.model';\n\n@Component({\n  selector: 'wb-page-not-found',\n  templateUrl: './page-not-found.component.html',\n  styleUrls: ['./page-not-found.component.scss'],\n  imports: [\n    TextPipe,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class PageNotFoundComponent {\n\n  protected readonly isDevMode = isDevMode();\n  protected readonly workbenchService = inject(WorkbenchService);\n\n  protected readonly view = inject(WorkbenchView, {optional: true});\n  protected readonly part = inject(WorkbenchPart, {optional: true});\n  protected readonly dialog = inject(WorkbenchDialog, {optional: true});\n  protected readonly popup = inject(WorkbenchPopup, {optional: true});\n  protected readonly path = computed(() => (this.view ?? this.part)?.navigation()?.path.map(segment => `${segment}`).join('/') ?? '');\n}\n","<header>{{('%workbench.page_not_found.title' | wbText)()}}</header>\n\n@if (view) {\n  @let message = '%workbench.page_not_found_view.message;path=' + path() | wbText;\n  <section class=\"message\" [innerHTML]=\"message()\"></section>\n} @else if (part) {\n  @let message = '%workbench.page_not_found_part.message;path=' + path() | wbText;\n  <section class=\"message\" [innerHTML]=\"message()\"></section>\n} @else {\n  @let message = '%workbench.page_not_found.message;path=' + path() | wbText;\n  <section class=\"message\" [innerHTML]=\"message()\"></section>\n}\n\n<section class=\"actions\">\n  @if (view) {\n    <button (click)=\"workbenchService.resetPerspective()\">{{('%workbench.reset_perspective.action' | wbText)()}}</button>\n    <button (click)=\"view.close()\">{{('%workbench.close.action' | wbText)()}}</button>\n  } @else if (part) {\n    <button (click)=\"workbenchService.resetPerspective()\">{{('%workbench.reset_perspective.action' | wbText)()}}</button>\n  } @else if (dialog) {\n    <button (click)=\"dialog.close()\">{{('%workbench.close.action' | wbText)()}}</button>\n  } @else if (popup) {\n    <button (click)=\"popup.close()\">{{('%workbench.close.action' | wbText)()}}</button>\n  }\n</section>\n\n@if (isDevMode) {\n  @let hint = '%workbench.page_not_found_developer_hint.message' | wbText;\n  @let tooltip = '%workbench.dev_mode_only_hint.tooltip' | wbText;\n  <section class=\"developer-hint\" [title]=\"tooltip()\">{{hint()}}</section>\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/**\n * Keys for associating workbench-specific data with a route in {@link Route.data}.\n *\n * @see Route.data\n */\nexport const WorkbenchRouteData = {\n\n  /**\n   * Property to set the title of a view in {@link Route.data}.\n   *\n   * Use a {@link Translatable} to localize the title.\n   */\n  title: 'ɵworkbenchViewTitle',\n\n  /**\n   * Property to set the heading of a view in {@link Route.data}.\n   *\n   * Use a {@link Translatable} to localize the heading.\n   */\n  heading: 'ɵworkbenchViewHeading',\n\n  /**\n   * Property to associate CSS class(es) with a workbench element in {@link Route.data}, e.g., to locate it in tests.\n   */\n  cssClass: 'ɵworkbenchCssClass',\n} as const;\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component} from '@angular/core';\nimport {RouterOutlet} from '@angular/router';\n\n/**\n * Angular standardizes component-less auxiliary routes by adding the `ɵEmptyOutletComponent` component,\n * but only for routes registered via {@link ROUTES} DI token or passed to {@link Router#resetConfig}.\n *\n * Consequently, auxiliary routes that the workbench dynamically registers based on the current workbench\n * state must also be standardized. However, we do not use Angular's {@link ɵEmptyOutletComponent} component\n * as it does not fill the content to the available space, required for view content.\n *\n * For more information, see the `standardizeConfig` function in Angular.\n */\n@Component({\n  templateUrl: './empty-outlet.component.html',\n  styleUrls: ['./empty-outlet.component.scss'],\n  imports: [RouterOutlet],\n})\nexport class ɵEmptyOutletComponent {\n}\n","<router-outlet/>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, inject, isDevMode} from '@angular/core';\nimport {TextPipe} from '../text/text.pipe';\nimport {WorkbenchView} from '../view/workbench-view.model';\n\n/**\n * Indicates that there is no content to display.\n */\n@Component({\n  selector: 'wb-null-content',\n  templateUrl: './null-content.component.html',\n  styleUrls: ['./null-content.component.scss'],\n  imports: [\n    TextPipe,\n  ],\n})\nexport class NullContentComponent {\n\n  protected readonly isDevMode = isDevMode();\n  protected readonly view = inject(WorkbenchView, {optional: true});\n}\n","@if (isDevMode && view) {\n  @let hint = '%workbench.null_view_developer_hint.message;view=' + (view.alternativeId ?? view.id) | wbText;\n  @let tooltip = '%workbench.dev_mode_only_hint.tooltip' | wbText;\n  <section class=\"developer-hint\" [title]=\"tooltip()\" [innerHTML]=\"hint()\"></section>\n} @else {\n  {{('%workbench.null_content.message' | wbText)()}}\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {CanMatchFn, Route, UrlSegment} from '@angular/router';\nimport {inject} from '@angular/core';\nimport {ɵWorkbenchRouter} from './ɵworkbench-router.service';\nimport {WORKBENCH_OUTLET} from './workbench-auxiliary-route-installer.service';\nimport {isPartOutlet, isViewOutlet, isWorkbenchOutlet} from '../workbench.identifiers';\nimport {isMicrofrontendHostOutlet} from '../microfrontend-platform/microfrontend-host/microfrontend-host-routes';\n\n/**\n * Configures a route to only match workbench views navigated with a specific hint.\n *\n * Use as a `canMatch` guard in {@link Route} config to differentiate between routes with identical paths.\n * For example, multiple views can navigate to the same path while resolving to different routes, such as the empty-path route to maintain a clean URL.\n *\n * Example for navigating a view to the 'SearchComponent':\n * ```ts\n * import {WorkbenchRouter} from '@scion/workbench';\n *\n * inject(WorkbenchRouter).navigate([], {hint: 'search'});\n * ```\n *\n * Routes:\n * ```ts\n * import {Routes} from '@angular/router';\n * import {canMatchWorkbenchView} from '@scion/workbench';\n *\n * const routes: Routes = [\n *   {path: '', canMatch: [canMatchWorkbenchView('search')], component: SearchComponent},\n *   {path: '', canMatch: [canMatchWorkbenchView('outline')], component: OutlineComponent},\n * ];\n * ```\n */\nexport function canMatchWorkbenchView(navigationHint: string): CanMatchFn;\n/**\n * Configures a route to only or never match workbench views.\n *\n * @see canMatchWorkbenchOutlet\n */\nexport function canMatchWorkbenchView(canMatch: boolean): CanMatchFn;\nexport function canMatchWorkbenchView(condition: string | boolean): CanMatchFn {\n  return (): boolean => {\n    const outlet = inject(WORKBENCH_OUTLET, {optional: true});\n\n    switch (condition) {\n      case true:\n        return isViewOutlet(outlet);\n      case false:\n        return !isViewOutlet(outlet);\n      default: { // hint\n        if (!isViewOutlet(outlet)) {\n          return false;\n        }\n\n        const layout = inject(ɵWorkbenchRouter).getCurrentNavigationContext().layout;\n        const view = layout.view({viewId: outlet}, {orElse: null});\n        return view?.navigation?.hint === condition;\n      }\n    }\n  };\n}\n\n/**\n * Configures a route to only match workbench parts navigated with a specific hint.\n *\n * Use as a `canMatch` guard in {@link Route} config to differentiate between routes with identical paths.\n * For example, multiple parts can navigate to the same path while resolving to different routes, such as the empty-path route to maintain a clean URL.\n *\n * Example for navigating a part to the 'SearchComponent':\n * ```ts\n * import {WorkbenchRouter} from '@scion/workbench';\n *\n * inject(WorkbenchRouter).navigate(layout => {\n *   return layout.navigatePart('search', [], {hint: 'search'});\n * });\n * ```\n *\n * Routes:\n * ```ts\n * import {Routes} from '@angular/router';\n * import {canMatchWorkbenchPart} from '@scion/workbench';\n *\n * const routes: Routes = [\n *   {path: '', canMatch: [canMatchWorkbenchPart('search')], component: SearchComponent},\n *   {path: '', canMatch: [canMatchWorkbenchPart('outline')], component: OutlineComponent},\n * ];\n * ```\n */\nexport function canMatchWorkbenchPart(navigationHint: string): CanMatchFn;\n/**\n * Configures a route to only or never match workbench parts.\n *\n * @see canMatchWorkbenchOutlet\n */\nexport function canMatchWorkbenchPart(canMatch: boolean): CanMatchFn;\nexport function canMatchWorkbenchPart(condition: string | boolean): CanMatchFn {\n  return (): boolean => {\n    const outlet = inject(WORKBENCH_OUTLET, {optional: true});\n\n    switch (condition) {\n      case true:\n        return isPartOutlet(outlet);\n      case false:\n        return !isPartOutlet(outlet);\n      default: { // hint\n        if (!isPartOutlet(outlet)) {\n          return false;\n        }\n\n        const layout = inject(ɵWorkbenchRouter).getCurrentNavigationContext().layout;\n        const part = layout.part({partId: outlet}, {orElse: null});\n        return part?.navigation?.hint === condition;\n      }\n    }\n  };\n}\n\n/**\n * Configures a route to only or never match workbench outlets.\n *\n * A workbench outlet can be a part, view, dialog, popup, or messagebox.\n *\n * Usage:\n * - Use `canMatchWorkbenchOutlet(false)` guard on the application's default route (`\"\"`) to prevent matching workbench outlets, such as parts and views, avoiding infinite loops.\n * - Use `canMatchWorkbenchOutlet(true)` guard on view and part routes to prevent matching the primary router outlet.\n *\n * Example:\n *\n * ```ts\n * import {Routes} from '@angular/router';\n * import {canMatchWorkbenchOutlet, canMatchWorkbenchPart, canMatchWorkbenchView, WorkbenchComponent} from '@scion/workbench';\n *\n * const routes: Routes = [\n *   {\n *     path: '',\n *     canActivate: [authorizedGuard()],\n *     children: [\n *       // Default route\n *       {\n *         path: '',\n *         canMatch: [canMatchWorkbenchOutlet(false)],\n *         component: WorkbenchComponent,\n *       },\n *       // Workbench view and part routes\n *       {\n *         path: '',\n *         canMatch: [canMatchWorkbenchOutlet(true)],\n *         children: [\n *           {path: 'path/to/page1', component: ...},\n *           {path: 'path/to/page2', component: ...},\n *           {path: '', canMatch: [canMatchWorkbenchPart('hint-1')], component: ...},\n *           {path: '', canMatch: [canMatchWorkbenchView('hint-2')], component: ...},\n *           ...\n *         ],\n *       },\n *     ],\n *   },\n * ];\n * ```\n *\n * @see canMatchWorkbenchPart\n * @see canMatchWorkbenchView\n */\nexport function canMatchWorkbenchOutlet(matchWorkbenchOutlet: boolean): CanMatchFn {\n  return (): boolean => {\n    const outlet = inject(WORKBENCH_OUTLET, {optional: true});\n    return matchWorkbenchOutlet ? isWorkbenchOutlet(outlet) : !isWorkbenchOutlet(outlet);\n  };\n}\n\n/**\n * Matches the route based on the active perspective.\n *\n * Can be used to activate a different route based on the active perspective.\n */\nexport function canMatchWorkbenchPerspective(id: string): CanMatchFn {\n  return (): boolean => {\n    return inject(ɵWorkbenchRouter).getCurrentNavigationContext().layout.perspectiveId === id;\n  };\n}\n\n/**\n * Matches the route only if it has been navigated.\n *\n * @internal\n */\nexport const matchesIfNavigated: CanMatchFn = (_route: Route, segments: UrlSegment[]): boolean => {\n  const outlet = inject(WORKBENCH_OUTLET, {optional: true});\n\n  if (isViewOutlet(outlet)) {\n    const layout = inject(ɵWorkbenchRouter).getCurrentNavigationContext().layout;\n    const view = layout.view({viewId: outlet}, {orElse: null});\n    return !!view?.navigation;\n  }\n  if (isPartOutlet(outlet)) {\n    const layout = inject(ɵWorkbenchRouter).getCurrentNavigationContext().layout;\n    const part = layout.part({partId: outlet}, {orElse: null});\n    return !!part?.navigation;\n  }\n  if (isMicrofrontendHostOutlet(outlet)) {\n    return true; // navigated implicitly as empty-path route\n  }\n  return segments.length > 0;\n};\n","/*\n* Copyright (c) 2018-2024 Swiss Federal Railways\n*\n* This program and the accompanying materials are made\n* available under the terms of the Eclipse Public License 2.0\n* which is available at https://www.eclipse.org/legal/epl-2.0/\n*\n* SPDX-License-Identifier: EPL-2.0\n*/\n\nimport {inject, Injectable, InjectionToken} from '@angular/core';\nimport {CanMatchFn, PRIMARY_OUTLET, Route, Router, Routes} from '@angular/router';\nimport {WorkbenchConfig} from '../workbench-config';\nimport PageNotFoundComponent from '../page-not-found/page-not-found.component';\nimport {WorkbenchRouteData} from './workbench-route-data';\nimport {ɵEmptyOutletComponent} from './empty-outlet/empty-outlet.component';\nimport {NullContentComponent} from '../null-content/null-content.component';\nimport {WORKBENCH_ROUTE} from '../workbench.constants';\nimport {matchesIfNavigated} from './workbench-route-guards';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {WorkbenchOutlet} from '../workbench.identifiers';\n\n/**\n * Enables the registration of auxiliary routes of top-level primary routes.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchAuxiliaryRouteInstaller {\n\n  private readonly _workbenchConfig = inject(WorkbenchConfig);\n  private readonly _router = inject(Router);\n  private readonly _workbenchRoutes = inject(WORKBENCH_ROUTE, {optional: true}) as Route[] | null ?? [];\n\n  /**\n   * Creates an empty-path auxiliary route for each passed outlet and adds the primary routes defined in the router config as child routes,\n   * enabling navigation in specified router outlets.\n   *\n   * @param outlets - Specifies outlets for which to create auxiliary routes.\n   * @param config - Specifies the config of the auxiliary routes.\n   */\n  public registerAuxiliaryRoutes(outlets: WorkbenchOutlet[], config: AuxiliaryRouteConfig = {}): Routes {\n    if (!outlets.length) {\n      return [];\n    }\n\n    const registeredRoutes = outlets\n      .map((outlet: WorkbenchOutlet): Route => ({\n        path: '',\n        outlet,\n        providers: [{provide: WORKBENCH_OUTLET, useValue: outlet}],\n        component: ɵEmptyOutletComponent,\n        children: new Array<Route>()\n          // Add workbench-specific routes.\n          .concat(...this._workbenchRoutes)\n          // Add application-specific routes.\n          .concat(this._router.config\n            // Filter primary routes.\n            .filter(route => !route.outlet || route.outlet === PRIMARY_OUTLET)\n            // Filter wildcard route as most likely not indended for workbench outlets. Otherwise, the \"Not Found\" and \"Nothing to Show\" pages would never be matched.\n            .filter(route => route.path !== '**')\n            // Only match the route if the outlet has been navigated, preventing the following issues for application having an empty-path parent route (tested in `app-with-guard.e2e-spec.ts`, `app-with-redirect.e2e-spec.ts`):\n            // - Redirecting in a `CanActivate` guard on an empty-path parent route would lead to an infinite loop.\n            // - The \"Not Found\" page would not be displayed for an empty-path navigation.\n            // - The \"Not Found\" page would not be displayed when clearing the outlets from the URL.\n            // - The \"Nothing to Show\" page would not be displayed at all.\n            //\n            // The issues are caused because Angular always attempts to match empty-path auxiliary routes if the outlet is not included in the URL, regardless\n            // of whether the outlet has been navigated to the empty-path route or not. Additionally, Angular's route matcher does not backtrack if it cannot\n            // find a route for an empty-path outlet in an empty-path subtree. This prevents fallback to a top-level wildcard route, such as a \"Not Found\" or\n            // \"Nothing to Show\" route.\n            .map(route => ({...route, canMatch: [...route.canMatch ?? [], matchesIfNavigated]})),\n          )\n          // Copy the route for each outlet to prevent unexpected routing behavior like infinite loops.\n          // TODO [Angular 22] Run test suite to check if still required\n          .map(route => ({...route})),\n      }))\n      // Add \"Page Not Found\" wildcard route.\n      .map(route => addNotFoundWildcardRoute(route, {component: this._workbenchConfig.pageNotFoundComponent, canMatch: config.notFoundRoute}))\n      // Add \"Nothing to Show\" wildcard route.\n      .map(route => addNullContentWildcardRoute(route));\n\n    this.replaceRouterConfig([\n      ...this._router.config,\n      ...registeredRoutes,\n    ]);\n\n    return registeredRoutes;\n  }\n\n  /**\n   * Unregisters auxiliary routes for the given outlet.\n   */\n  public unregisterAuxiliaryRoutes(outlets: string[]): void {\n    const outletsToRemove = new Set<string>(outlets);\n\n    function shouldRemoveRoute(route: Route): boolean {\n      return !!route.outlet && outletsToRemove.has(route.outlet);\n    }\n\n    this.replaceRouterConfig(this._router.config.filter(route => !shouldRemoveRoute(route)));\n  }\n\n  /**\n   * Replaces the router configuration to install or uninstall auxiliary routes.\n   */\n  private replaceRouterConfig(config: Routes): void {\n    // Note:\n    //   - Do not use Router.resetConfig(...) which would destroy any currently routed component because copying all routes\n    //   - Do not assign the router a new Routes object (Router.config = ...) to allow resolution of routes added during `NavigationStart` (since Angular 7.x)\n    //     (because Angular uses a reference to the Routes object during route navigation)\n    const newRoutes: Routes = [...config];\n    this._router.config.splice(0, this._router.config.length, ...newRoutes);\n  }\n}\n\n/**\n * Recursively adds a \"Not Found\" wildcard route to the specified route and its child routes.\n *\n * Has no effect if the route has no child routes or if no `CanMatch` guard is provided.\n *\n * @see PageNotFoundComponent\n */\nfunction addNotFoundWildcardRoute(route: Route, options: {component?: ComponentType<unknown>; canMatch?: true | CanMatchFn}): Route {\n  if (!options.canMatch) {\n    return route;\n  }\n  if (!route.children) {\n    return route;\n  }\n\n  return {\n    ...route,\n    children: [\n      ...route.children.map(child => addNotFoundWildcardRoute(child, options)),\n      {\n        path: '**',\n        component: options.component ?? PageNotFoundComponent,\n        data: {[WorkbenchRouteData.title]: '%workbench.page_not_found.title', [WorkbenchRouteData.cssClass]: 'e2e-page-not-found'},\n        canMatch: options.canMatch === true ? undefined : [options.canMatch],\n      },\n    ],\n  };\n}\n\n/**\n * Adds the \"Nothing to Show\" wildcard route as child route.\n *\n * @see NullContentComponent\n */\nfunction addNullContentWildcardRoute(route: Route): Route {\n  return {\n    ...route,\n    children: [\n      ...route.children ?? [],\n      {\n        path: '**',\n        component: NullContentComponent,\n      },\n    ],\n  };\n}\n\n/**\n * Configures auxiliary routes.\n */\nexport interface AuxiliaryRouteConfig {\n  /**\n   * Controls whether to install the wildcard route (\"**\") if no route matches.\n   *\n   * A `CanMatch` guard can be provided for conditional installation.\n   *\n   * Defaults to not adding the wildcard route.\n   */\n  notFoundRoute?: true | CanMatchFn;\n}\n\n/**\n * DI token to inject the outlet name of a workbench auxiliary route.\n *\n * Can be injected in a `CanMatch` guard to obtain a reference to the workbench element.\n */\nexport const WORKBENCH_OUTLET = new InjectionToken<WorkbenchOutlet>('ɵWORKBENCH_OUTLET');\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, InjectionToken, Injector, makeEnvironmentProviders, runInInjectionContext} from '@angular/core';\n\n/**\n * Registers a function that is executed during the startup of the SCION Microfrontend Platform.\n *\n * Initializers are used to run initialization tasks during startup of the SCION Microfrontend Platform.\n * The SCION Microfrontend Platform is fully started once all initializers have completed.\n *\n * Initializers can specify a phase for execution. Initializers in lower phases execute before initializers in higher phases.\n * Initializers in the same phase may execute in parallel. If no phase is specified, the initializer executes in the `PostStartup` phase.\n *\n * Available phases, in order of execution:\n * - {@link MicrofrontendPlatformStartupPhase.PreStartup}\n * - {@link MicrofrontendPlatformStartupPhase.PostStartup}\n *\n * Microfrontend platform initializers run during the {@link WorkbenchStartupPhase.Startup} phase.\n *\n * The function can call `inject` to get any required dependencies.\n *\n * Initializers are only called if microfrontend support is enabled.\n *\n * @param initializerFn - Specifies the function to execute.\n * @param options - Controls execution of the function.\n * @return A set of dependency-injection providers to be registered in Angular.\n */\nexport function provideMicrofrontendPlatformInitializer(initializerFn: MicrofrontendPlatformInitializerFn, options?: MicrofrontendPlatformInitializerOptions): EnvironmentProviders {\n  const token = MICROFRONTEND_PLATFORM_STARTUP_TOKENS.get(options?.phase ?? MicrofrontendPlatformStartupPhase.PostStartup);\n  return makeEnvironmentProviders([{\n    provide: token,\n    useValue: initializerFn,\n    multi: true,\n  }]);\n}\n\n/**\n * Controls the execution of an initializer function during the startup of the SCION Microfrontend Platform.\n */\nexport interface MicrofrontendPlatformInitializerOptions {\n  /**\n   * Controls in which phase to execute the initializer.\n   */\n  phase?: MicrofrontendPlatformStartupPhase;\n}\n\n/**\n * Enumeration of phases for running a {@link MicrofrontendPlatformInitializerFn} function during the startup of the SCION Microfrontend Platform.\n *\n * Functions associated with the same phase may run in parallel. Defaults to {@link PostStartup} phase.\n */\nexport enum MicrofrontendPlatformStartupPhase {\n  /**\n   * Use to run an initializer before starting the SCION Microfrontend Platform.\n   *\n   * Typically, you would configure the SCION Microfrontend Platform in this phase, for example, register interceptors or decorators.\n   * At this point, you cannot interact with the Microfrontend Platform because it has not been started yet.\n   *\n   * This phase is only called if microfrontend support is enabled.\n   */\n  PreStartup = 0,\n  /**\n   * Use to run an initializer after started the SCION Microfrontend Platform.\n   *\n   * Typically, you would install intent and message handlers in this phase.\n   * At this point, the activators of the micro applications are not yet installed.\n   *\n   * This is the default phase if not specifying a phase.\n   *\n   * This phase is only called if microfrontend support is enabled.\n   */\n  PostStartup = 2,\n}\n\n/**\n * The signature of a function executed during the startup of the SCION Microfrontend Platform.\n *\n * Initializers are used to run initialization tasks during startup of the SCION Microfrontend Platform.\n *\n * Initializers are registered using the `provideMicrofrontendPlatformInitializer()` function and can specify a phase for execution.\n * Initializers in lower phases execute before initializers in higher phases. Initializers in the same phase may\n * execute in parallel. If no phase is specified, the initializer executes in the `PostStartup` phase.\n *\n * Microfrontend platform initializers run during the {@link WorkbenchStartupPhase.Startup} phase.\n *\n * Available phases, in order of execution:\n * - {@link MicrofrontendPlatformStartupPhase.PreStartup}\n * - {@link MicrofrontendPlatformStartupPhase.PostStartup}\n *\n * The function can call `inject` to get any required dependencies.\n *\n * @example - Registration of an initializer function\n * ```ts\n * import {provideWorkbench, provideMicrofrontendPlatformInitializer} from '@scion/workbench';\n * import {bootstrapApplication} from '@angular/platform-browser';\n * import {inject} from '@angular/core';\n *\n * bootstrapApplication(AppComponent, {\n *   providers: [\n *     provideWorkbench(),\n *     provideMicrofrontendPlatformInitializer(() => inject(SomeService).init()),\n *   ],\n * });\n * ```\n * @see provideMicrofrontendPlatformInitializer\n */\nexport type MicrofrontendPlatformInitializerFn = () => void | Promise<void>;\n\n/**\n * Runs microfrontend platform initializers in the given phase. Initializer functions can call `inject` to get required dependencies.\n *\n * Microfrontend platform initializers run during startup of the SCION Microfrontend Platform and only execute if microfrontend support is enabled.\n */\nexport async function runMicrofrontendPlatformInitializers(phase: MicrofrontendPlatformStartupPhase, injector: Injector): Promise<void> {\n  const token = MICROFRONTEND_PLATFORM_STARTUP_TOKENS.get(phase)!;\n  const initializers = injector.get<MicrofrontendPlatformInitializerFn[]>(token, [], {optional: true});\n  if (!initializers.length) {\n    return;\n  }\n\n  // Run and await initializer functions in parallel.\n  await Promise.all(initializers.map(initializer => runInInjectionContext(injector, initializer))); // eslint-disable-line @typescript-eslint/await-thenable\n}\n\n/**\n * Associates Microfrontend Platform startup phases with Workbench DI tokens.\n */\nconst MICROFRONTEND_PLATFORM_STARTUP_TOKENS = new Map<MicrofrontendPlatformStartupPhase, InjectionToken<MicrofrontendPlatformInitializerFn>>()\n  .set(MicrofrontendPlatformStartupPhase.PreStartup, new InjectionToken<MicrofrontendPlatformInitializerFn>('MICROFRONTEND_PLATFORM_PRE_STARTUP'))\n  .set(MicrofrontendPlatformStartupPhase.PostStartup, new InjectionToken<MicrofrontendPlatformInitializerFn>('MICROFRONTEND_PLATFORM_POST_STARTUP'));\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {assertNotInReactiveContext, computed, EnvironmentProviders, inject, Injectable, isSignal, makeEnvironmentProviders, Signal, signal} from '@angular/core';\nimport {Capability, ManifestService} from '@scion/microfrontend-platform';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tapFirst} from '@scion/toolkit/operators';\nimport {provideMicrofrontendPlatformInitializer} from './microfrontend-platform-initializer';\nimport {map} from 'rxjs/operators';\n\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class ManifestObjectCache {\n\n  public readonly capabilities = signal(new Map<string, Capability>());\n\n  public async init(): Promise<void> {\n    const manifestService = inject(ManifestService);\n\n    return new Promise<void>(resolve => {\n      manifestService.lookupCapabilities$()\n        .pipe(\n          map(capabilities => capabilities.reduce((acc, capability) => acc.set(capability.metadata!.id, capability), new Map<string, Capability>())),\n          tapFirst(() => resolve()),\n          takeUntilDestroyed(),\n        )\n        .subscribe(capabilities => {\n          this.capabilities.set(capabilities);\n        });\n    });\n  }\n\n  /**\n   * Tracks specified capability, returning a signal with requested capability or `undefined` if not found.\n   *\n   * Method must not be called in a reactive context.\n   */\n  public capability<T extends Capability = Capability>(capabilityId: Signal<string> | string): Signal<T | undefined> {\n    assertNotInReactiveContext(this.capability, 'Call ManifestObjectCache.computeCapability() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    const id = isSignal(capabilityId) ? capabilityId : signal(capabilityId);\n    return computed(\n      () => this.capabilities().get(id()) as T | undefined,\n      {equal: (a, b) => a?.metadata!.id === b?.metadata!.id},\n    );\n  }\n}\n\n/**\n * Provides cached access to manifest objects.\n */\nexport function provideManifestObjectCache(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    ManifestObjectCache,\n    provideMicrofrontendPlatformInitializer(() => inject(ManifestObjectCache).init()),\n  ]);\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {CanMatchFn} from '@angular/router';\nimport {inject} from '@angular/core';\nimport {MicrofrontendPlatform, PlatformState, Qualifier, QualifierMatcher} from '@scion/microfrontend-platform';\nimport {WORKBENCH_OUTLET} from '../../routing/workbench-auxiliary-route-installer.service';\nimport {ManifestObjectCache} from '../manifest-object-cache.service';\nimport {DialogId, NotificationId, PartId, PopupId, ViewId} from '../../workbench.identifiers';\nimport {WorkbenchCapabilities} from '@scion/workbench-client';\n\n/**\n * Configures a route to only match workbench parts navigated to the specified part capability.\n *\n * Use this guard to differentiate microfrontend routes, which must all have an empty path.\n *\n * @example - Route matching a part capability with qualifier {part: 'navigator'}\n * ```ts\n * import {Routes} from '@angular/router';\n * import {canMatchWorkbenchPartCapability} from '@scion/workbench';\n *\n * const routes: Routes = [\n *   {path: '', canMatch: [canMatchWorkbenchPartCapability({part: 'navigator'})], component: NavigatorComponent},\n * ];\n * ```\n *\n * The above route matches the following part capability:\n *\n * ```json\n * {\n *   \"type\": \"part\",\n *   \"qualifier\": {\n *     \"part\": \"navigator\"\n *   },\n *   \"properties\": {\n *     \"path\": \"\"\n *   }\n * }\n * ```\n *\n * @param qualifier - Identifies the part capability.\n * @return guard matching the specified part capability.\n */\nexport function canMatchWorkbenchPartCapability(qualifier: Qualifier): CanMatchFn {\n  return canMatchWorkbenchCapability('part', WorkbenchCapabilities.Part, qualifier);\n}\n\n/**\n * Configures a route to only match workbench views navigated to the specified view capability.\n *\n * Use this guard to differentiate microfrontend routes, which must all have an empty path.\n *\n * @example - Route matching a view capability with qualifier {view: 'search'}\n * ```ts\n * import {Routes} from '@angular/router';\n * import {canMatchWorkbenchViewCapability} from '@scion/workbench';\n *\n * const routes: Routes = [\n *   {path: '', canMatch: [canMatchWorkbenchViewCapability({view: 'search'})], component: SearchComponent},\n * ];\n * ```\n *\n * The above route matches the following view capability:\n *\n * ```json\n * {\n *   \"type\": \"view\",\n *   \"qualifier\": {\n *     \"view\": \"search\"\n *   },\n *   \"properties\": {\n *     \"path\": \"\"\n *   }\n * }\n * ```\n *\n * @param qualifier - Identifies the view capability.\n * @return guard matching the specified view capability.\n */\nexport function canMatchWorkbenchViewCapability(qualifier: Qualifier): CanMatchFn {\n  return canMatchWorkbenchCapability('view', WorkbenchCapabilities.View, qualifier);\n}\n\n/**\n * Configures a route to only match workbench dialogs navigated to the specified dialog capability.\n *\n * Use this guard to differentiate microfrontend routes, which must all have an empty path.\n *\n * @example - Route matching a dialog capability with qualifier {dialog: 'about'}\n * ```ts\n * import {Routes} from '@angular/router';\n * import {canMatchWorkbenchDialogCapability} from '@scion/workbench';\n *\n * const routes: Routes = [\n *   {path: '', canMatch: [canMatchWorkbenchDialogCapability({dialog: 'about'})], component: AboutComponent},\n * ];\n * ```\n *\n * The above route matches the following dialog capability:\n *\n * ```json\n * {\n *   \"type\": \"dialog\",\n *   \"qualifier\": {\n *     \"dialog\": \"about\"\n *   },\n *   \"properties\": {\n *     \"path\": \"\"\n *   }\n * }\n * ```\n *\n * @param qualifier - Identifies the dialog capability.\n * @return guard matching the specified dialog capability.\n */\nexport function canMatchWorkbenchDialogCapability(qualifier: Qualifier): CanMatchFn {\n  return canMatchWorkbenchCapability('dialog', WorkbenchCapabilities.Dialog, qualifier);\n}\n\n/**\n * Configures a route to only match workbench messageboxes navigated to the specified messagebox capability.\n *\n * Use this guard to differentiate microfrontend routes, which must all have an empty path.\n *\n * @example - Route matching a messagebox capability with qualifier {messagebox: 'alert'}\n * ```ts\n * import {Routes} from '@angular/router';\n * import {canMatchWorkbenchMessageBoxCapability} from '@scion/workbench';\n *\n * const routes: Routes = [\n *   {path: '', canMatch: [canMatchWorkbenchMessageBoxCapability({messagebox: 'alert'})], component: AlertComponent},\n * ];\n * ```\n *\n * The above route matches the following messagebox capability:\n *\n * ```json\n * {\n *   \"type\": \"messagebox\",\n *   \"qualifier\": {\n *     \"messagebox\": \"alert\"\n *   },\n *   \"properties\": {\n *     \"path\": \"\"\n *   }\n * }\n * ```\n *\n * @param qualifier - Identifies the messagebox capability.\n * @return guard matching the specified messagebox capability.\n */\nexport function canMatchWorkbenchMessageBoxCapability(qualifier: Qualifier): CanMatchFn {\n  return canMatchWorkbenchCapability('dialog', WorkbenchCapabilities.MessageBox, qualifier);\n}\n\n/**\n * Configures a route to only match workbench popups navigated to the specified popup capability.\n *\n * Use this guard to differentiate microfrontend routes, which must all have an empty path.\n *\n * @example - Route matching a popup capability with qualifier {popup: 'info'}\n * ```ts\n * import {Routes} from '@angular/router';\n * import {canMatchWorkbenchPopupCapability} from '@scion/workbench';\n *\n * const routes: Routes = [\n *   {path: '', canMatch: [canMatchWorkbenchPopupCapability({popup: 'info'})], component: InfoComponent},\n * ];\n * ```\n *\n * The above route matches the following popup capability:\n *\n * ```json\n * {\n *   \"type\": \"popup\",\n *   \"qualifier\": {\n *     \"popup\": \"info\"\n *   },\n *   \"properties\": {\n *     \"path\": \"\"\n *   }\n * }\n * ```\n *\n * @param qualifier - Identifies the popup capability.\n * @return guard matching the specified popup capability.\n */\nexport function canMatchWorkbenchPopupCapability(qualifier: Qualifier): CanMatchFn {\n  return canMatchWorkbenchCapability('popup', WorkbenchCapabilities.Popup, qualifier);\n}\n\n/**\n * Configures a route to only match workbench notifications navigated to the specified notification capability.\n *\n * Use this guard to differentiate microfrontend routes, which must all have an empty path.\n *\n * @example - Route matching a notification capability with qualifier {notification: 'info'}\n * ```ts\n * import {Routes} from '@angular/router';\n * import {canMatchWorkbenchNotificationCapability} from '@scion/workbench';\n *\n * const routes: Routes = [\n *   {path: '', canMatch: [canMatchWorkbenchNotificationCapability({notification: 'info'})], component: InfoComponent},\n * ];\n * ```\n *\n * The above route matches the following notification capability:\n *\n * ```json\n * {\n *   \"type\": \"notification\",\n *   \"qualifier\": {\n *     \"notification\": \"info\"\n *   },\n *   \"properties\": {\n *     \"path\": \"\"\n *   }\n * }\n * ```\n *\n * @param qualifier - Identifies the notification capability.\n * @return guard matching the specified notification capability.\n */\nexport function canMatchWorkbenchNotificationCapability(qualifier: Qualifier): CanMatchFn {\n  return canMatchWorkbenchCapability('notification', WorkbenchCapabilities.Notification, qualifier);\n}\n\n/**\n * Matches a route if navigated to the specified capability displayed in the specified workbench element.\n */\nfunction canMatchWorkbenchCapability(workbenchElementType: 'part' | 'view' | 'dialog' | 'popup' | 'notification', capabilityType: WorkbenchCapabilities, qualifier: Qualifier): CanMatchFn {\n  return (): boolean => {\n    const outlet = inject(WORKBENCH_OUTLET, {optional: true});\n\n    const hostOutletMatch = matchMicrofrontendHostOutlet(outlet);\n    if (!hostOutletMatch) {\n      return false;\n    }\n    if (hostOutletMatch.type !== workbenchElementType) {\n      return false;\n    }\n\n    // Guards cannot block waiting for platform startup, as the platform may start later in the bootstrapping, causing a deadlock.\n    // Guards are re-evaluated after startup. See `runCanMatchGuardsAfterStartup`.\n    if (MicrofrontendPlatform.state !== PlatformState.Started) {\n      return false;\n    }\n\n    const capability = inject(ManifestObjectCache).capability(hostOutletMatch.capabilityId)();\n    if (!capability) {\n      return false;\n    }\n    if (capability.type !== capabilityType) {\n      return false; // required because messagebox capabilities are embedded in a dialog outlet.\n    }\n    if (!new QualifierMatcher(capability.qualifier).matches(qualifier)) {\n      return false;\n    }\n    return true;\n  };\n}\n\n/**\n * Tests if the given outlet matches the format of a microfrontend host outlet.\n *\n * Microfrontend host outlets are used to render microfrontends provided by the host application.\n */\nexport function isMicrofrontendHostOutlet(outlet: string | undefined | null): outlet is MicrofrontendHostOutlet {\n  return matchMicrofrontendHostOutlet(outlet) !== null;\n}\n\n/**\n * Matches a given outlet to be a microfrontend host outlet. Returns the parsed outlet or `null` if it does not match.\n */\nfunction matchMicrofrontendHostOutlet(outlet: string | undefined | null): MicrofrontendHostOutletMatch | null {\n  if (!outlet) {\n    return null;\n  }\n\n  const match = MICROFRONTEND_HOST_OUTLET_REGEX.exec(outlet);\n  if (!match) {\n    return null;\n  }\n\n  return {\n    type: match.groups!['workbenchElementType']! as 'part' | 'view' | 'dialog' | 'popup' | 'notification',\n    capabilityId: match.groups!['capabilityId']!,\n  };\n}\n\n/**\n * Format of a microfrontend capability id.\n */\ntype MicrofrontendCapabilityId = string;\n\n/**\n * Format of a microfrontend host outlet name.\n *\n * Microfrontend host outlets are used to render microfrontends provided by the host application.\n *\n * Format: `workbench.microfrontend.host.<capabilityId>.<workbenchElementType>.<workbenchElementId>`\n * Example: `workbench.microfrontend.host.39768ab.part.5485357a`\n */\nexport type MicrofrontendHostOutlet = `workbench.microfrontend.host.${MicrofrontendCapabilityId}.${PartId | ViewId | DialogId | PopupId | NotificationId}`;\n\n/**\n * Regular expression to match a microfrontend host outlet.\n */\nconst MICROFRONTEND_HOST_OUTLET_REGEX = /^workbench\\.microfrontend\\.host\\.(?<capabilityId>[^.]+)\\.(?<workbenchElementType>[^.]+)\\.(?<workbenchElementId>.+)$/;\n\n/**\n * Represents a successful match of a microfrontend host outlet.\n */\ninterface MicrofrontendHostOutletMatch {\n  /**\n   * Type of the workbench element displaying the microfrontend.\n   */\n  type: 'part' | 'view' | 'dialog' | 'popup' | 'notification';\n  /**\n   * Identity of the capability providing the microfrontend.\n   *\n   * @see WorkbenchPartCapability\n   * @see WorkbenchViewCapability\n   * @see WorkbenchDialogCapability\n   * @see WorkbenchMessageBoxCapability\n   * @see WorkbenchPopupCapability\n   * @see WorkbenchNotificationCapability\n   */\n  capabilityId: string;\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {InjectionToken} from '@angular/core';\nimport {UUID} from '@scion/toolkit/uuid';\nimport {UID} from './common/uid.util';\nimport {isMicrofrontendHostOutlet, MicrofrontendHostOutlet} from './microfrontend-platform/microfrontend-host/microfrontend-host-routes';\n\n/**\n * DI token to get a unique id of the workbench.\n *\n * The id is different each time the app is reloaded. Different workbench windows have different ids.\n */\nexport const WORKBENCH_ID = new InjectionToken<string>('WORKBENCH_ID', {\n  providedIn: 'root',\n  factory: () => UUID.randomUUID(),\n});\n\n/**\n * Format of a part identifier.\n *\n * Each part is assigned a unique identifier (e.g., `part.9fdf7ab4`, `part.c6485225`, etc.).\n * A part can also have an alternative id, a meaningful but not necessarily unique name. A part can\n * be identified either by its unique or alternative id.\n */\nexport type PartId = `${typeof PART_ID_PREFIX}${string}`;\n\n/**\n * Format of a view identifier.\n *\n * Each view is assigned a unique identifier (e.g., `view.d4de99fb`, `view.cad347dd`, etc.).\n * A view can also have an alternative id, a meaningful but not necessarily unique name. A view can\n * be identified either by its unique or alternative id.\n */\nexport type ViewId = `${typeof VIEW_ID_PREFIX}${string}`;\n\n/**\n * Format of a dialog identifier.\n */\nexport type DialogId = `${typeof DIALOG_ID_PREFIX}${string}`;\n\n/**\n * Format of a popup identifier.\n */\nexport type PopupId = `${typeof POPUP_ID_PREFIX}${string}`;\n\n/**\n * Format of a notification identifier.\n */\nexport type NotificationId = `${typeof NOTIFICATION_ID_PREFIX}${string}`;\n\n/**\n * Format of an activity identifier.\n *\n * Each activity is assigned a unique identifier (e.g., `activity.9fdf7ab4`, `activity.c6485225`, etc.).\n *\n * @docs-private Not public API. For internal use only.\n */\nexport type ActivityId = `${typeof ACTIVITY_ID_PREFIX}${string}`;\n\n/**\n * Tests if the given id matches the format of a view identifier.\n */\nexport function isViewId(viewId: string | undefined | null): viewId is ViewId {\n  return viewId?.startsWith(VIEW_ID_PREFIX) ?? false;\n}\n\n/**\n * Tests if the given outlet matches the format of the view outlet.\n */\nexport function isViewOutlet(outlet: string | undefined | null): outlet is ViewOutlet {\n  return isViewId(outlet);\n}\n\n/**\n * Tests if the given id matches the format of a part identifier.\n */\nexport function isPartId(partId: string | undefined | null): partId is PartId {\n  return partId?.startsWith(PART_ID_PREFIX) ?? false;\n}\n\n/**\n * Tests if the given outlet matches the format of the part outlet.\n */\nexport function isPartOutlet(outlet: string | undefined | null): outlet is PartOutlet {\n  return isPartId(outlet);\n}\n\n/**\n * Tests if the given id matches the format of a dialog identifier.\n */\nexport function isDialogId(dialogId: string | undefined | null): dialogId is DialogId {\n  return dialogId?.startsWith(DIALOG_ID_PREFIX) ?? false;\n}\n\n/**\n * Tests if the given id matches the format of a dialog identifier.\n */\nexport function isPopupId(popupId: string | undefined | null): popupId is PopupId {\n  return popupId?.startsWith(POPUP_ID_PREFIX) ?? false;\n}\n\n/**\n * Tests if the given id matches the format of a notification identifier.\n */\nexport function isNotificationId(notificationId: string | undefined | null): notificationId is NotificationId {\n  return notificationId?.startsWith(NOTIFICATION_ID_PREFIX) ?? false;\n}\n\n/**\n * Tests if the given id matches the format of an activity identifier.\n */\nexport function isActivityId(activityId: string | undefined | null): activityId is ActivityId {\n  return activityId?.startsWith(ACTIVITY_ID_PREFIX) ?? false;\n}\n\n/**\n * Tests if the given outlet matches the format of a workbench outlet.\n */\nexport function isWorkbenchOutlet(outlet: string | undefined | null): outlet is WorkbenchOutlet {\n  return isPartOutlet(outlet) || isViewOutlet(outlet) || isMicrofrontendHostOutlet(outlet);\n}\n\n/**\n * Computes a unique view id.\n */\nexport function computeViewId(): ViewId {\n  return `${VIEW_ID_PREFIX}${UID.randomUID()}`;\n}\n\n/**\n * Computes a unique part id.\n */\nexport function computePartId(): PartId {\n  return `${PART_ID_PREFIX}${UID.randomUID()}`;\n}\n\n/**\n * Computes a unique dialog id.\n */\nexport function computeDialogId(): DialogId {\n  return `${DIALOG_ID_PREFIX}${UID.randomUID()}`;\n}\n\n/**\n * Computes a unique popup id.\n */\nexport function computePopupId(): PopupId {\n  return `${POPUP_ID_PREFIX}${UID.randomUID()}`;\n}\n\n/**\n * Computes a unique notification id.\n */\nexport function computeNotificationId(): NotificationId {\n  return `${NOTIFICATION_ID_PREFIX}${UID.randomUID()}`;\n}\n\n/**\n * Computes a unique activity id.\n */\nexport function computeActivityId(): ActivityId {\n  return `${ACTIVITY_ID_PREFIX}${UID.randomUID()}`;\n}\n\n/**\n * Format of a view outlet name.\n */\nexport type ViewOutlet = ViewId;\n\n/**\n * Format of a part outlet name.\n */\nexport type PartOutlet = PartId;\n\n/**\n * Union of workbench outlets.\n */\nexport type WorkbenchOutlet = PartOutlet | ViewOutlet | MicrofrontendHostOutlet;\n\n/**\n * Represents the id prefix of views.\n *\n * @see ViewId\n */\nexport const VIEW_ID_PREFIX = 'view.';\n\n/**\n * Represents the id prefix of parts.\n *\n * @see PartId\n */\nexport const PART_ID_PREFIX = 'part.';\n\n/**\n * Represents the id prefix of activities.\n *\n * @see ActivityId\n */\nexport const ACTIVITY_ID_PREFIX = 'activity.';\n\n/**\n * Represents the id prefix of dialogs.\n *\n * @see DialogId\n */\nconst DIALOG_ID_PREFIX = 'dialog.';\n\n/**\n * Represents the id prefix of notifications.\n *\n * @see NotificationId\n */\nconst NOTIFICATION_ID_PREFIX = 'notification.';\n\n/**\n * Represents the id prefix of popups.\n *\n * @see PopupId\n */\nconst POPUP_ID_PREFIX = 'popup.';\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, ChildrenOutletContexts, Event, NavigationStart, OutletContext, PRIMARY_OUTLET, Router, RouterEvent, UrlSegment, UrlSegmentGroup, UrlTree} from '@angular/router';\nimport {Commands} from '../routing/routing.model';\nimport {inject, Injector} from '@angular/core';\nimport {EMPTY, iif, MonoTypeOperatorFunction, Observable, of, OperatorFunction, pairwise, race, switchMap} from 'rxjs';\nimport {filter, map, startWith, take} from 'rxjs/operators';\nimport {isPartOutlet, isViewOutlet, PartOutlet, ViewOutlet, WorkbenchOutlet} from '../workbench.identifiers';\nimport {ANGULAR_ROUTER_MUTEX} from '../executor/single-task-executor';\n\n/**\n * Provides utility functions for router operations.\n */\nexport const Routing = {\n\n  /**\n   * Converts given URL segments into an array of commands that can be passed to the Angular router for navigation.\n   */\n  segmentsToCommands: (segments: UrlSegment[]): Commands => {\n    const commands = new Array<unknown>();\n\n    segments.forEach(segment => {\n      if (segment.path) {\n        commands.push(segment.path);\n      }\n      if (Object.keys(segment.parameters).length) {\n        commands.push(segment.parameters);\n      }\n    });\n\n    return commands;\n  },\n\n  /**\n   * Constructs URL segments from given commands, resolving any relative navigational symbols.\n   *\n   * This function must be called within an injection context.\n   */\n  commandsToSegments: (commands: Commands, options?: {relativeTo?: ActivatedRoute | null}): UrlSegment[] => {\n    // Ignore `relativeTo` for absolute commands.\n    const isAbsolutePath = typeof commands[0] === 'string' && commands[0].startsWith('/');\n    const relativeTo = isAbsolutePath ? null : (options?.relativeTo ?? null);\n\n    // Angular throws the error 'NG04003: Root segment cannot have matrix parameters' when passing an empty-path command\n    // followed by a matrix params object, but not when passing matrix params as the first command. For consistency, when\n    // passing matrix params as the first command, we prepend an empty-path for Angular to throw the same error.\n    if (typeof commands[0] === 'object' && (!relativeTo || Routing.hasEmptyPathFromRoot(relativeTo))) {\n      commands = ['', ...commands];\n    }\n\n    const urlTree = inject(Router).createUrlTree(commands, {relativeTo});\n    return urlTree.root.children[relativeTo?.pathFromRoot[1]?.outlet ?? PRIMARY_OUTLET]?.segments ?? [];\n  },\n\n  /**\n   * Parses the given path and matrix parameters into an array of commands that can be passed to the Angular router for navigation.\n   *\n   * This function must be called within an injection context.\n   */\n  pathToCommands: (path: string): Commands => {\n    const urlTree = inject(Router).parseUrl(path);\n    const segmentGroup = urlTree.root.children[PRIMARY_OUTLET] as UrlSegmentGroup | undefined;\n    if (!segmentGroup?.segments) {\n      throw Error(`[RouterError] Cannot match any routes for path '${path}'.`);\n    }\n    return Routing.segmentsToCommands(segmentGroup.segments);\n  },\n\n  /**\n   * Resolves the effective (=leaf) {@link ActivatedRoute} activated in a router outlet.\n   *\n   * Depending on the route hierarchy, when navigating to a child route with component-less parent routes, the route of an outlet may not be the effectively activated child route.\n   */\n  resolveEffectiveRoute: (route: ActivatedRoute): ActivatedRoute => {\n    return route.firstChild ? Routing.resolveEffectiveRoute(route.firstChild) : route;\n  },\n\n  /**\n   * Resolves the effective (=leaf) {@link OutletContext} of a router outlet.\n   *\n   * Depending on the route hierarchy, when navigating to a child route with component-less parent routes, the context of an outlet may not be the effectively activated child context.\n   */\n  resolveEffectiveOutletContext: (outletContext: OutletContext | null): OutletContext | null => {\n    const childOutletContext = outletContext?.children.getContext(PRIMARY_OUTLET);\n    return childOutletContext ? Routing.resolveEffectiveOutletContext(childOutletContext) : outletContext;\n  },\n\n  /**\n   * Looks for requested data on given route, or its parent route(s) if not found.\n   */\n  lookupRouteData: <T>(activatedRoute: ActivatedRouteSnapshot, dataKey: string): T | undefined => {\n    return activatedRoute.pathFromRoot.reduceRight<T | undefined>((resolvedData, route) => resolvedData ?? route.data[dataKey] as T | undefined, undefined);\n  },\n\n  /**\n   * Reads outlets from given URL.\n   */\n  parseOutlets: parseOutlets,\n\n  /**\n   * Tests if given route has an empty path from root.\n   */\n  hasEmptyPathFromRoot: (route: ActivatedRoute): boolean => {\n    return route.snapshot.pathFromRoot.flatMap(route => route.url).filter(segment => segment.path.length).length === 0;\n  },\n\n  /**\n   * Observes the route activation for the specified outlet.\n   *\n   * The observable emits after the previous component has been destroyed (if any) but before constructing the new component.\n   *\n   * Options to control when to emit:\n   * - `routeChange`: Emit only when navigating the outlet to a different route.\n   * - `routeOrParamChange`: Emit when navigating the outlet to a different route or changing params (named path params or matrix params).\n   * - `always`: Emit at every navigation, even if the outlet is not the target of the navigation.\n   *\n   * This method must be called within an injection context.\n   *\n   * Note: Listening for route activations/deactivations on the router outlet alone is insufficient for nested routes, as the outlet does not report\n   * activations/deactivations of child routes.\n   *\n   * @param outlet - Specifies the outlet to observe.\n   * @param options - Controls when to emit the observable.\n   * @return An observable emitting a tuple of the previous and current route snapshots.\n   */\n  activatedRoute$: (outlet: string, options: {emitOn: 'routeChange' | 'routeOrParamChange' | 'always'}): Observable<[ActivatedRouteSnapshot | null, ActivatedRouteSnapshot]> => {\n    const router = inject(Router);\n    const childrenOutletContexts = inject(ChildrenOutletContexts);\n\n    const onNavigationStart$ = router.events.pipe(filterNavigationStart());\n    const onActivationStart$ = router.events.pipe(filterActivationStart(), filterByOutlet(outlet));\n    const onActivationEnd$ = router.events.pipe(filterActivationEnd(), filterByOutlet(outlet));\n\n    // On each navigation start (`NavigationStart`), subscribe to the outlet's `ActivationStart` event and then to the outlet's deactivate event,\n    // enabling continuing of the execution chain after the previous component has been destroyed.\n    //\n    // If `emitOn` is set to `always`, additionally subscribe to the outlet's `ActivationEnd` event, since no activation (`ActivationStart`) occurs if\n    // the outlet is not navigated (e.g., navigating another outlet or updating query params).\n    //\n    // Note that Angular activates nested routes from parent to child and deactivates them from child to parent, triggering multiple `ActivationStart`\n    // and `ActivationEnd` events. For the outlet, the latest `ActivationStart` and the first `ActivationEnd` events are relevant.\n    //\n    // `ActivationStart` is emitted only if the outlet is actually navigated (route or parameter change), whereas `ActivationEnd` is always emitted.\n    //\n    // If a navigation is currently in progress, start immediately, allowing subscriptions even during ongoing navigation, such as after the navigation\n    // has started.\n    return iif(() => !router.currentNavigation(), onNavigationStart$, onNavigationStart$.pipe(startWith(undefined)))\n      .pipe(\n        // Subscribe to the outlet's `ActivationStart` (and also `ActivationEnd` if the `emitOn` option is set to `always`).\n        switchMap(() => options.emitOn === 'always' ? race(onActivationStart$, onActivationEnd$.pipe(take(1))) : onActivationStart$),\n        map(event => event.snapshot),\n        startWith(null as unknown as ActivatedRouteSnapshot), // initialize pairwise operator\n        pairwise(),\n        switchMap(([previous, current]: [ActivatedRouteSnapshot | null, ActivatedRouteSnapshot]): Observable<[ActivatedRouteSnapshot | null, ActivatedRouteSnapshot]> => {\n          // If the route hasn't changed and `emitOn` is set to `always` or `routeOrParamChange`, emit immediately since no deactivation will occur.\n          const routeChanged = previous?.routeConfig !== current.routeConfig;\n          if (!routeChanged) {\n            return options.emitOn === 'routeChange' ? EMPTY : of([previous, current]);\n          }\n\n          // If there's no previously activated component in the outlet, emit immediately since no deactivation will occur.\n          const outletContext = Routing.resolveEffectiveOutletContext(childrenOutletContexts.getContext(outlet));\n          if (!outletContext?.outlet?.isActivated) {\n            return of([previous, current]);\n          }\n\n          // Delay emission until the previously activated component has been destroyed by subscribing to the outlet's deactivation event.\n          // Nested routes activate from parent to child, canceling \"deactivation\" subscriptions of parent outlets, so only the deactivation of the actual outlet is emitted.\n          return outletContext.outlet.deactivateEvents!.pipe(map(() => [previous, current]));\n        }),\n      );\n\n    /**\n     * Filters {@link NavigationStart} router events.\n     */\n    function filterNavigationStart(): OperatorFunction<Event | RouterEvent, NavigationStart> {\n      return filter((event: Event | RouterEvent): event is NavigationStart => event instanceof NavigationStart);\n    }\n\n    /**\n     * Filters {@link ActivationStart} router events.\n     */\n    function filterActivationStart(): OperatorFunction<Event | RouterEvent, ActivationStart> {\n      return filter((event: Event | RouterEvent): event is ActivationStart => event instanceof ActivationStart);\n    }\n\n    /**\n     * Filters {@link ActivationEnd} router events. This event is emitted for each outlet regardless of whether it has been navigated or not.\n     */\n    function filterActivationEnd(): OperatorFunction<Event | RouterEvent, ActivationEnd> {\n      return filter((event: Event | RouterEvent): event is ActivationEnd => event instanceof ActivationEnd);\n    }\n\n    /**\n     * Filters router events for the specified outlet.\n     */\n    function filterByOutlet<T extends ActivationStart | ActivationEnd>(outlet: string): MonoTypeOperatorFunction<T> {\n      return filter(event => event.snapshot.pathFromRoot[1]?.outlet === outlet);\n    }\n  },\n  /**\n   * Performs a \"fake\" navigation for Angular to evaluate `CanMatch` route guards, required if guards depend on external conditions\n   * like the completed startup of the SCION Microfrontend Platform or capability registration at runtime.\n   */\n  runCanMatchGuards: async (options?: {injector?: Injector}): Promise<void> => {\n    const injector = options?.injector ?? inject(Injector);\n    await injector.get(ANGULAR_ROUTER_MUTEX).submit(() => injector.get(Router).navigate([{outlets: {}}], {skipLocationChange: true, queryParamsHandling: 'preserve', preserveFragment: true}));\n  },\n} as const;\n\nfunction parseOutlets(url: UrlTree, selector: {view: true}): Map<ViewOutlet, UrlSegment[]>;\nfunction parseOutlets(url: UrlTree, selector: {part: true}): Map<PartOutlet, UrlSegment[]>;\nfunction parseOutlets(url: UrlTree, selector: {view?: true; part?: true}): Map<WorkbenchOutlet, UrlSegment[]>;\nfunction parseOutlets(url: UrlTree, selector: {view?: true; part?: true}): Map<WorkbenchOutlet, UrlSegment[]> {\n  const outlets = new Map<WorkbenchOutlet, UrlSegment[]>();\n  Object.entries(url.root.children).forEach(([outlet, segmentGroup]) => {\n    if (selector.view && isViewOutlet(outlet)) {\n      outlets.set(outlet, segmentGroup.segments);\n    }\n    if (selector.part && isPartOutlet(outlet)) {\n      outlets.set(outlet, segmentGroup.segments);\n    }\n  });\n  return outlets;\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {UrlSegment} from '@angular/router';\nimport {Objects} from '@scion/toolkit/util';\n\n/**\n * Matches an array of URL segments against another array of URL segments.\n *\n * Flags:\n * - matchWildcardPath: Indicates if wildcard path matching is enabled. If enabled, the asterisk `*` path matches any path of the segment.\n * - matchMatrixParams: Controls whether to match matrix parameters.\n */\nexport class UrlSegmentMatcher {\n\n  constructor(private _pattern: UrlSegment[], private _flags: {matchWildcardPath: boolean; matchMatrixParams: boolean}) {\n  }\n\n  /**\n   * Matches given array of URL segments.\n   */\n  public matches(segments: UrlSegment[]): boolean {\n    if (segments === this._pattern) {\n      return true;\n    }\n\n    if (segments.length !== this._pattern.length) {\n      return false;\n    }\n\n    return segments.every((segment, index) => {\n      const checkMatrixParams = this._flags.matchMatrixParams;\n      const checkPath = !this._flags.matchWildcardPath || this._pattern[index]!.path !== '*';\n\n      if (checkPath && segment.path !== this._pattern[index]!.path) {\n        return false;\n      }\n      if (checkMatrixParams && !Objects.isEqual(segment.parameters, this._pattern[index]!.parameters)) {\n        return false;\n      }\n      return true;\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {DestroyRef, inject, signal} from '@angular/core';\n\n/**\n * Registry for workbench model elements.\n */\nexport class WorkbenchElementRegistry<KEY, T> {\n\n  private readonly _elements = signal<T[]>([]);\n  private readonly _elementById = new Map<KEY, T>();\n\n  private readonly _nullElementErrorFn: (key: KEY) => Error;\n  private readonly _onUnregister: ((element: T) => void) | undefined;\n\n  public readonly elements = this._elements.asReadonly();\n\n  /**\n   * Creates an instance of the registry.\n   *\n   * This registry must be constructed within an injection context. Destroying the injection context will also destroy the registry,\n   * invoking the specified `onUnregister` function for each element in the registry.\n   *\n   * @param config - Configures the registry.\n   * @param config.nullElementErrorFn - Function to provide an error when looking up an element not contained in the registry.\n   * @param config.onUnregister - Function invoked when an element is unregistered.\n   */\n  constructor(config?: {nullElementErrorFn?: (key: KEY) => Error; onUnregister?: (element: T) => void}) {\n    this._nullElementErrorFn = config?.nullElementErrorFn ?? ((key: KEY) => Error(`[NullElementError] Element '${key}' not found.`));\n    this._onUnregister = config?.onUnregister;\n\n    // Clear registry when the current injection context is destroyed.\n    inject(DestroyRef).onDestroy(() => this.clear());\n  }\n\n  /**\n   * Registers an element under given key, replacing any previously registered element with the same key.\n   */\n  public register(key: KEY, element: T): void {\n    this.replace(key, {key, element});\n  }\n\n  /**\n   * Registers an element under given key, replacing any previously registered element with the specified key.\n   *\n   * @param key - Specifies the key of the element to replace by {@link replaceBy}.\n   * @param replaceBy - Specifies the element to replace another element.\n   */\n  public replace(key: KEY, replaceBy: {key: KEY; element: T}): void {\n    const prevElement = this._elementById.get(key);\n\n    // Unregister previous element, if any.\n    if (prevElement) {\n      this._elementById.delete(key);\n      this._onUnregister?.(prevElement);\n    }\n\n    // Add to Map.\n    this._elementById.set(replaceBy.key, replaceBy.element);\n\n    // Add to Signal.\n    this._elements.update(elements => {\n      const copy = [...elements];\n      if (prevElement) {\n        copy.splice(copy.indexOf(prevElement), 1, replaceBy.element); // Replace element.\n      }\n      else {\n        copy.push(replaceBy.element); // Append element.\n      }\n      return copy;\n    });\n  }\n\n  /**\n   * Unregisters specified element.\n   */\n  public unregister(key: KEY): T | null {\n    const element = this._elementById.get(key);\n    if (!element) {\n      return null;\n    }\n\n    // Invoke unregister function.\n    this._onUnregister?.(element);\n\n    // Remove from Map.\n    this._elementById.delete(key);\n    // Remove from Signal.\n    this._elements.update(elements => {\n      const copy = [...elements];\n      copy.splice(copy.indexOf(element), 1);\n      return copy;\n    });\n    return element;\n  }\n\n  /**\n   * Returns the element of the given identity. If not found, by default, throws an error unless setting the `orElseNull` option.\n   */\n  public get(key: KEY): T;\n  public get(key: KEY, options?: {orElse: null}): T | null;\n  public get(key: KEY, options?: {orElse: null}): T | null {\n    const element = this._elementById.get(key);\n    if (!element && !options) {\n      throw this._nullElementErrorFn(key);\n    }\n    return element ?? null;\n  }\n\n  /**\n   * Indicates whether an element with the specified key exists or not.\n   */\n  public has(key: KEY): boolean {\n    return this._elementById.has(key);\n  }\n\n  /**\n   * Indicates whether this registry is empty.\n   */\n  public isEmpty(): boolean {\n    return this._elementById.size === 0;\n  }\n\n  /**\n   * Clears this registry.\n   */\n  public clear(): void {\n    this._onUnregister && this.elements().forEach(this._onUnregister);\n    this._elementById.clear();\n    this._elements.set([]);\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {ɵWorkbenchView} from './ɵworkbench-view.model';\nimport {WorkbenchElementRegistry} from '../registry/workbench-element-registry';\nimport {ViewId} from '../workbench.identifiers';\n\n/**\n * Registry for {@link WorkbenchView} elements.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchViewRegistry extends WorkbenchElementRegistry<ViewId, ɵWorkbenchView> {\n  constructor() {\n    super({\n      nullElementErrorFn: viewId => Error(`[NullViewError] View '${viewId}' not found.`),\n      onUnregister: view => view.destroy(),\n    });\n  }\n}\n","import {Type} from '@angular/core';\nimport {Arrays} from '@scion/toolkit/util';\n\n/**\n * Asserts the given object to be of the given type (and not simply a JavaScript object literal).\n *\n * Throws an error if not of the given type, or if `null` or `undefined`.\n */\nexport function assertType(object: unknown, assert: {toBeOneOf: Type<any>[] | Type<any>}): void {\n  if (object === null) {\n    throw Error(`[AssertError] Object must not be 'null'.`);\n  }\n  if (object === undefined) {\n    throw Error(`[AssertError] Object must not be 'undefined'.`);\n  }\n  if (!Arrays.coerce(assert.toBeOneOf).some(expectedType => object instanceof expectedType)) {\n    const expectedType = Arrays.coerce(assert.toBeOneOf).map(it => it.name).join(' or ');\n    const actualType = object.constructor.name;\n    throw Error(`[AssertError] Object not of the expected type [expected=${expectedType}, actual=${actualType}].`);\n  }\n}\n\n/**\n * Asserts the given object not to be `null` or `undefined.\n */\nexport function assertNotNullish(value: any, errorFn?: () => Error): void {\n  if (value === null) {\n    throw errorFn?.() ?? Error('[AssertError] Value expected not to be `null`, but was `null`.');\n  }\n  if (value === undefined) {\n    throw errorFn?.() ?? Error('[AssertError] Value expected not to be `undefined`, but was `undefined`.');\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {assertType} from '../common/asserts.util';\nimport {NavigationData} from '../routing/routing.model';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {ActivityId, PartId, ViewId} from '../workbench.identifiers';\n\n/**\n * Represents the arrangement of parts as grid.\n *\n * The M-prefix indicates this object is a model object that is serialized and stored, requiring migration on breaking change.\n */\nexport interface MPartGrid {\n  root: MTreeNode | MPart;\n  activePartId: PartId;\n  /**\n   * Specifies the reference part of this grid.\n   *\n   * For grids of an activity, the reference part corresponds to the part used to create the activity.\n   *\n   * Characteristics:\n   * - Remains visible if no other parts in the grid are visible.\n   * - Removing the reference part removes the activity.\n   * - Provides the activity title, regardless of visibility or position in the layout.\n   */\n  referencePartId?: PartId;\n}\n\n/**\n * Represents a node in the grid.\n *\n * A node contains two children, which are either a {@link MPart} or a {@link MTreeNode}, respectively.\n * The ratio together with the direction describes how to arrange the two children.\n *\n * The M-prefix indicates this object is a model object that is serialized and stored, requiring migration on breaking change.\n */\nexport class MTreeNode {\n\n  /**\n   * Discriminator to unmarshall {@link MTreeNode} to its class type.\n   */\n  public readonly type = 'MTreeNode';\n  public id!: string;\n  public child1!: MTreeNode | MPart;\n  public child2!: MTreeNode | MPart;\n  public ratio!: number;\n  public direction!: 'column' | 'row';\n  public parent?: MTreeNode;\n  /**\n   * Indicates whether this node is visible.\n   *\n   * NOTE: This property is computed when deserializing the grid: {@link WorkbenchLayoutSerializer.deserializeGrid}.\n   */\n  public visible?: boolean;\n\n  constructor(treeNode: Omit<MTreeNode, 'type'>) {\n    treeNode.parent && assertType(treeNode.parent, {toBeOneOf: MTreeNode}); // assert not to be an object literal\n    assertType(treeNode.child1, {toBeOneOf: [MTreeNode, MPart]}); // assert not to be an object literal\n    assertType(treeNode.child2, {toBeOneOf: [MTreeNode, MPart]}); // assert not to be an object literal\n    Object.assign(this, treeNode);\n  }\n\n  /**\n   * Tests if the given object is a {@link MTreeNode}.\n   */\n  public static isMTreeNode(object: unknown): object is MTreeNode {\n    return !!object && (object as Partial<MTreeNode>).type === 'MTreeNode';\n  }\n}\n\n/**\n * Represents a part in the grid.\n *\n * A part can display content or stack views.\n *\n * The M-prefix indicates this object is a model object that is serialized and stored, requiring migration on breaking change.\n */\nexport class MPart {\n\n  /**\n   * Discriminator to unmarshall {@link MPart} to its class type.\n   */\n  public readonly type = 'MPart';\n  public id!: PartId;\n  public alternativeId?: string;\n  public title?: Translatable;\n  public parent?: MTreeNode;\n  public views!: MView[];\n  public activeViewId?: ViewId;\n  public structural!: boolean;\n  public cssClass?: string[];\n  /**\n   * Indicates whether this part is visible.\n   *\n   * NOTE: This property is computed when deserializing the grid: {@link WorkbenchLayoutSerializer.deserializeGrid}.\n   */\n  public visible?: boolean;\n  public activationInstant?: number;\n  public navigation?: {\n    id: string;\n    hint?: string;\n    data?: NavigationData;\n    cssClass?: string[];\n  };\n\n  constructor(part: Omit<MPart, 'type'>) {\n    part.parent && assertType(part.parent, {toBeOneOf: MTreeNode}); // assert not to be an object literal\n    Object.assign(this, part);\n  }\n\n  /**\n   * Tests if the given object is a {@link MPart}.\n   */\n  public static isMPart(object: unknown): object is MPart {\n    return !!object && (object as Partial<MPart>).type === 'MPart';\n  }\n}\n\n/**\n * Represents a view contained in a {@link MPart}.\n *\n * The M-prefix indicates this object is a model object that is serialized and stored, requiring migration on breaking change.\n */\nexport interface MView {\n  id: ViewId;\n  alternativeId?: string;\n  cssClass?: string[];\n  markedForRemoval?: true;\n  activationInstant?: number;\n  navigation?: {\n    id: string;\n    hint?: string;\n    data?: NavigationData;\n    cssClass?: string[];\n  };\n}\n\n/**\n * Grids referenced in the workbench layout.\n */\nexport interface WorkbenchGrids<T = MPartGrid> {\n  /**\n   * Reference to the \"root\" grid of the workbench layout.\n   */\n  main: T;\n  /**\n   * Reference to the main area grid, a sub-grid embedded by the main area part contained in the main grid.\n   *\n   * The main area grid is always present even if the layout has no main area part, as it is shared between perspectives.\n   */\n  mainArea: T;\n\n  /**\n   * Grids associated with activities.\n   *\n   * An activity has at least one part, the reference part, specified when creating the activity (docked part).\n   * Removing the reference part removes the activity. Most activities have a grid with only the reference part.\n   */\n  [activityId: ActivityId]: T;\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {MPart, MPartGrid, MTreeNode, WorkbenchGrids} from './workbench-grid.model';\nimport {ActivityId, isActivityId} from '../workbench.identifiers';\n\n/**\n * Provides helper functions for operating on a workbench layout.\n */\nexport const WorkbenchLayouts = {\n\n  /**\n   * Finds the part matching the given predicate, or `null` if not found.\n   */\n  findPart: (element: MPart | MTreeNode, predicate: (part: MPart) => boolean): MPart | null => {\n    if (element instanceof MPart) {\n      return predicate(element) ? element : null;\n    }\n    else {\n      return WorkbenchLayouts.findPart(element.child1, predicate) ?? WorkbenchLayouts.findPart(element.child2, predicate);\n    }\n  },\n\n  /**\n   * Tests if the given {@link MPartGrid} is empty.\n   *\n   * An empty grid has a single, non-structural part with no views and no navigation.\n   */\n  isGridEmpty: (grid: MPartGrid | undefined): boolean => {\n    return !grid || (grid.root instanceof MPart && !grid.root.views.length && !grid.root.navigation && !grid.root.structural);\n  },\n\n  /**\n   * Picks grids related to activities from the given grids, optionally filtering and/or transforming them.\n   *\n   * If the transform function returns `undefined`, the grid is excluded.\n   */\n  pickActivityGrids: pickActivityGrids,\n} as const;\n\nfunction pickActivityGrids<T>(grids: Partial<WorkbenchGrids<T>> | undefined): {[activityId: ActivityId]: T};\nfunction pickActivityGrids<T, P>(grids: Partial<WorkbenchGrids<T>> | undefined, transformFn: (activityGrid: T) => P | undefined): {[activityId: ActivityId]: P};\nfunction pickActivityGrids<T, P = T>(grids: Partial<WorkbenchGrids<T>> | undefined, transformFn?: (activityGrid: T) => P | undefined): {[activityId: ActivityId]: P | T} {\n  return Object.fromEntries(Object.entries(grids ?? {}).reduce((acc, [gridName, grid]) => {\n    if (!grid) {\n      return acc;\n    }\n    if (!isActivityId(gridName)) {\n      return acc;\n    }\n\n    if (!transformFn) {\n      return acc.set(gridName, grid);\n    }\n\n    const transformedGrid = transformFn(grid);\n    return transformedGrid ? acc.set(gridName, transformedGrid) : acc;\n  }, new Map<ActivityId, P | T>()));\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Commands, NavigationData, NavigationState} from '../routing/routing.model';\nimport {ActivatedRoute} from '@angular/router';\nimport {ActivityId} from '../workbench.identifiers';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {WorkbenchLayoutFactory} from './workbench-layout.factory';\n\n/**\n * The workbench layout is an arrangement of parts and views. Parts can be docked to the side or positioned relative to each other.\n * Views are stacked in parts and can be dragged to other parts. Content can be displayed in both parts and views.\n *\n * A typical workbench application has a main area part and parts docked to the side, providing navigation and context-sensitive assistance to\n * support the user's workflow.\n *\n * Multiple layouts, called perspectives, can be created. Users can switch between perspectives. Perspectives share the same main area, if any.\n *\n * The layout has methods for modifying it. The layout is immutable; each modification creates a new instance.\n */\nexport interface WorkbenchLayout {\n\n  /**\n   * Adds a part with the given id to this layout. Position and size are expressed relative to a reference part.\n   *\n   * A part can also be aligned relative to a docked part, enabling inline layouts within docked parts, such as splitting the docked parts into multiple sections.\n   *\n   * @param id - The id of the part to add. Use {@link MAIN_AREA} to add the main area.\n   * @param relativeTo - Specifies the reference part to lay out the part.\n   * @param extras - Controls how to add the part to the layout.\n   * @return a copy of this layout with the part added.\n   */\n  addPart(id: string | MAIN_AREA, relativeTo: ReferencePart, extras?: PartExtras): WorkbenchLayout;\n\n  /**\n   * Adds a part with the given id to this layout, docking it to the specified docking area.\n   *\n   * Docked parts can be minimized to create more space for the main content. Users cannot drag views into or out of docked parts.\n   *\n   * A part can be docked to the left, right, or bottom side of the workbench.\n   * Each side has two docking areas: `left-top` and `left-bottom`, `right-top` and `right-bottom`, and `bottom-left` and `bottom-right`.\n   * Parts added to the same area are stacked, with only one part active per stack. If there is an active part in both stacks of a side,\n   * the two parts are split vertically or horizontally, depending on the side.\n   *\n   * A docked part may be navigated to display content, have views, or define a layout with multiple parts aligned relative to each other.\n   *\n   * @param id - The id of the part to add.\n   * @param dockTo - Controls to which area to dock the part.\n   * @param extras - Controls how to add the part to the layout.\n   * @return a copy of this layout with the part added.\n   */\n  addPart(id: string, dockTo: DockingArea, extras: DockedPartExtras): WorkbenchLayout;\n\n  /**\n   * Navigates the specified part based on the provided array of commands and extras.\n   *\n   * Navigating a part displays content when its view stack is empty. A navigated part can still have views but won't display\n   * navigated content unless its view stack is empty. Views cannot be dragged into parts displaying navigated content, except\n   * for the main area part.\n   *\n   * A command can be a string or an object literal. A string represents a path segment, an object literal associates matrix parameters with the preceding segment.\n   * Multiple segments can be combined into a single command, separated by a forward slash.\n   *\n   * By default, navigation is absolute. Set `relativeTo` in extras for relative navigation.\n   *\n   * Usage:\n   * ```\n   * layout.navigatePart(partId, ['path', 'to', 'part', {param 'value'}]);\n   * layout.navigatePart(partId, ['path/to/part', {param: 'value'}]);\n   * ```\n   *\n   * @param id - Identifies the part for navigation.\n   * @param commands - Instructs the router which route to navigate to.\n   * @param extras - Controls navigation:\n   * @param extras.hint - Allows differentiation between routes with identical paths.\n   *                      Multiple parts can navigate to the same path but still resolve to different routes, e.g., the empty-path route to maintain a clean URL.\n   *\n   *                      Example:\n   *                      ```ts\n   *                      import {canMatchWorkbenchPart} from '@scion/workbench';\n   *\n   *                      const routes = [\n   *                         {\n   *                           path: '',\n   *                           component: Part1Component,\n   *                           canMatch: [canMatchWorkbenchPart('hint-1')], // matches navigations with hint 'hint-1'\n   *                         },\n   *                         {\n   *                           path: '',\n   *                           component: Part2Component,\n   *                           canMatch: [canMatchWorkbenchPart('hint-2')], // matches navigations with hint 'hint-1'\n   *                         },\n   *                       ];\n   *                      ```\n   * @param extras.relativeTo - Specifies the route for relative navigation, supporting navigational symbols such as '/', './', or '../' in the commands.\n   * @param extras.data - Associates data with the navigation.\n   *                      Unlike matrix parameters, navigation data is stored in the layout and not added to the URL, allowing data to be passed to an empty-path navigation.\n   *                      Data must be JSON serializable. Data can be read from {@link WorkbenchPart.navigation.data}.\n   * @param extras.state - Passes state to the navigation.\n   *                       State is not persistent, unlike {@link data}; however, state is added to the browser's session history to support back/forward browser navigation.\n   *                       State can be read from {@link WorkbenchPart.navigation.state} or from the browser's session history via `history.state`.\n   * @param extras.cssClass - Specifies CSS class(es) to add to the part, e.g., to locate the part in tests.\n   * @return a copy of this layout with the part navigated.\n   */\n  navigatePart(id: string, commands: Commands, extras?: {hint?: string; relativeTo?: ActivatedRoute; data?: NavigationData; state?: NavigationState; cssClass?: string | string[]}): WorkbenchLayout;\n\n  /**\n   * Adds a view to the specified part.\n   *\n   * @param id - The id of the view to add.\n   * @param extras - Controls how to add the view to the layout.\n   * @param extras.partId - References the part to which to add the view.\n   * @param extras.position - Specifies the position where to insert the view. The position is zero-based. Defaults to `end`.\n   * @param extras.activateView - Controls whether to activate the view. Defaults to `false`.\n   * @param extras.activatePart - Controls whether to activate the part that contains the view. Defaults to `false`.\n   * @param extras.cssClass - Specifies CSS class(es) to add to the view, e.g., to locate the view in tests.\n   * @return a copy of this layout with the view added.\n   */\n  addView(id: string, extras: {partId: string; position?: number | 'start' | 'end' | 'before-active-view' | 'after-active-view'; activateView?: boolean; activatePart?: boolean; cssClass?: string | string[]}): WorkbenchLayout;\n\n  /**\n   * Navigates the specified view based on the provided array of commands and extras.\n   *\n   * A command can be a string or an object literal. A string represents a path segment, an object literal associates matrix parameters with the preceding segment.\n   * Multiple segments can be combined into a single command, separated by a forward slash.\n   *\n   * By default, navigation is absolute. Set `relativeTo` in extras for relative navigation.\n   *\n   * Usage:\n   * ```\n   * layout.navigateView(viewId, ['path', 'to', 'view', {param 'value'}]);\n   * layout.navigateView(viewId, ['path/to/view', {param: 'value'}]);\n   * ```\n   *\n   * @param id - Identifies the view for navigation.\n   * @param commands - Instructs the router which route to navigate to.\n   * @param extras - Controls navigation:\n   * @param extras.hint - Allows differentiation between routes with identical paths.\n   *                      Multiple views can navigate to the same path but still resolve to different routes, e.g., the empty-path route to maintain a clean URL.\n   *                      Like the path, a hint affects view resolution. If set, the router will only navigate views with an equivalent hint, or if not set, views without a hint.\n   *\n   *                      Example route config matching routes based on the hint passed to the navigation:\n   *                      ```ts\n   *                      import {canMatchWorkbenchView} from '@scion/workbench';\n   *\n   *                      const routes = [\n   *                        {\n   *                          path: '',\n   *                          component: View1Component,\n   *                          canMatch: [canMatchWorkbenchView('hint-1')], // matches navigations with hint 'hint-1'\n   *                        },\n   *                        {\n   *                          path: '',\n   *                          component: View2Component,\n   *                          canMatch: [canMatchWorkbenchView('hint-2')], // matches navigations with hint 'hint-2'\n   *                        },\n   *                      ];\n   *                      ```\n   * @param extras.relativeTo - Specifies the route for relative navigation, supporting navigational symbols such as '/', './', or '../' in the commands.\n   * @param extras.data - Associates data with the navigation.\n   *                      Unlike matrix parameters, navigation data is stored in the layout and not added to the URL, allowing data to be passed to an empty-path navigation.\n   *                      Data must be JSON serializable. Data can be read from {@link WorkbenchView.navigation.data}.\n   * @param extras.state - Passes state to the navigation.\n   *                       State is not persistent, unlike {@link data}; however, state is added to the browser's session history to support back/forward browser navigation.\n   *                       State can be read from {@link WorkbenchView.navigation.state} or from the browser's session history via `history.state`.\n   * @param extras.cssClass - Specifies CSS class(es) to add to the view, e.g., to locate the view in tests.\n   * @return a copy of this layout with the view navigated.\n   */\n  navigateView(id: string, commands: Commands, extras?: {hint?: string; relativeTo?: ActivatedRoute; data?: NavigationData; state?: NavigationState; cssClass?: string | string[]}): WorkbenchLayout;\n\n  /**\n   * Removes given view from the layout.\n   *\n   * - If the view is active, the last used view is activated.\n   * - If the view is the last view in the part, the part is removed unless it is the last part in its grid or a structural part.\n   *\n   * @param id - Specifies the id of the view to remove.\n   * @return a copy of this layout with the view removed.\n   */\n  removeView(id: string): WorkbenchLayout;\n\n  /**\n   * Removes given part from the layout.\n   *\n   * If the part is active, the last used part is activated.\n   *\n   * @param id - The id of the part to remove.\n   * @return a copy of this layout with the part removed.\n   */\n  removePart(id: string): WorkbenchLayout;\n\n  /**\n   * Moves a view to a different part or moves it within a part.\n   *\n   * @param id - The id of the view to be moved.\n   * @param targetPartId - The id of the part to which to move the view.\n   * @param options - Controls moving of the view.\n   * @param options.position - Specifies the position where to move the view in the target part. The position is zero-based. Defaults to `end` when moving the view to a different part.\n   * @param options.activateView - Controls if to activate the view. Defaults to `false`.\n   * @param options.activatePart - Controls if to activate the target part. Defaults to `false`.\n   * @return a copy of this layout with the view moved.\n   */\n  moveView(id: string, targetPartId: string, options?: {position?: number | 'start' | 'end' | 'before-active-view' | 'after-active-view'; activateView?: boolean; activatePart?: boolean}): WorkbenchLayout;\n\n  /**\n   * Activates the given view.\n   *\n   * @param id - The id of the view which to activate.\n   * @param options - Controls view activation.\n   * @param options.activatePart - Controls whether to activate the part that contains the view. Defaults to `false`.\n   * @return a copy of this layout with the view activated.\n   */\n  activateView(id: string, options?: {activatePart?: boolean}): WorkbenchLayout;\n\n  /**\n   * Activates the given part.\n   *\n   * @param id - The id of the part which to activate.\n   * @return a copy of this layout with the part activated.\n   */\n  activatePart(id: string): WorkbenchLayout;\n\n  /**\n   * Tests if given part is contained in the layout.\n   */\n  hasPart(id: string): boolean;\n\n  /**\n   * Tests if given view is contained in the layout.\n   */\n  hasView(id: string): boolean;\n\n  /**\n   * Applies a modification function to this layout, enabling conditional changes while maintaining method chaining.\n   *\n   * @param modifyFn - A function that takes the current layout and returns a modified layout.\n   * @return The modified layout returned by the modify function.\n   */\n  modify(modifyFn: (layout: WorkbenchLayout) => WorkbenchLayout): WorkbenchLayout;\n}\n\n/**\n * Describes how to lay out a part relative to another part.\n */\nexport interface ReferencePart {\n  /**\n   * Specifies the part which to use as the reference part to lay out the part.\n   * If not set, the part will be aligned relative to the root of the workbench layout.\n   */\n  relativeTo?: string;\n  /**\n   * Specifies the side of the reference part where to add the part.\n   */\n  align: 'left' | 'right' | 'top' | 'bottom';\n  /**\n   * Specifies the proportional size of the part relative to the reference part.\n   * The ratio is the closed interval [0,1]. If not set, defaults to `0.5`.\n   */\n  ratio?: number;\n}\n\n/**\n * Controls the appearance and behavior of a part.\n */\nexport interface PartExtras {\n  /**\n   * Title displayed in the part bar.\n   *\n   * Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   */\n  title?: Translatable;\n  /**\n   * Specifies CSS class(es) to add to the part, e.g., to locate the part in tests.\n   */\n  cssClass?: string | string[];\n  /**\n   * Controls whether to activate the part. Defaults to `false`.\n   */\n  activate?: boolean;\n}\n\n/**\n * Controls the appearance of a docked part and its toggle button.\n *\n * A docked part is a part that is docked to the left, right, or bottom side of the workbench.\n *\n * Docked parts can be minimized to create more space for the main content. Users cannot drag\n * views into or out of docked parts.\n */\nexport interface DockedPartExtras {\n  /**\n   * Icon (key) displayed in the toggle button.\n   *\n   * The actual icon is resolved through an {@link WorkbenchIconProviderFn} registered in {@link WorkbenchConfig.iconProvider}.\n   *\n   * If no icon provider is configured, the icon defaults to a Material Icon font ligature. The default icon provider requires\n   * the application to include the Material icon font, for example in `styles.scss`, as follows:\n   *\n   * ```scss\n   * @import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded');\n   * ```\n   *\n   * The application can then reference icons from the Material Icons Font: https://fonts.google.com/icons\n   */\n  icon: string;\n  /**\n   * Label displayed in the toggle button.\n   *\n   * Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   */\n  label: Translatable;\n  /**\n   * Tooltip displayed when hovering over the toggle button.\n   *\n   * Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   */\n  tooltip?: Translatable;\n  /**\n   * Title displayed in the part bar.\n   *\n   * If not provided, defaults to {@link DockedPartExtras.label}. Set to `false` to not display a title.\n   *\n   * Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   */\n  title?: Translatable | false;\n  /**\n   * CSS class(es) to add to the docked part and its toggle button, e.g., to locate the part in tests.\n   */\n  cssClass?: string | string[];\n  /**\n   * Controls whether to activate the docked part. Defaults to `false`.\n   */\n  activate?: boolean;\n  /**\n   * Internal identifier for the docked part.\n   *\n   * @docs-private Not public API. For internal use only.\n   */\n  ɵactivityId?: ActivityId;\n}\n\n/**\n * A part can be docked to the left, right, or bottom side of the workbench.\n *\n * Each side has two docking areas: `left-top` and `left-bottom`, `right-top` and `right-bottom`, and `bottom-left` and `bottom-right`.\n * Parts added to the same area are stacked, with only one part active per stack. If there is an active part in both stacks of a side,\n * the two parts are split vertically or horizontally, depending on the side.\n */\nexport interface DockingArea {\n  /**\n   * Controls where to dock a part.\n   * - `left-top`: Dock to the top on the left side.\n   * - `left-bottom`: Dock to the bottom on the left side.\n   * - `right-top`: Dock to the top on the right side.\n   * - `right-bottom`: Dock to the bottom on the right side.\n   * - `bottom-left`: Dock to the left on the bottom side.\n   * - `bottom-right`: Dock to the right on the bottom side.\n   */\n  dockTo: 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom' | 'bottom-left' | 'bottom-right';\n}\n\n/**\n * Identifies the main area part in the workbench layout.\n *\n * Refer to this part to align parts relative to the main area.\n *\n * The main area is a special part that can be added to the layout. The main area is where the workbench opens views by default.\n * It is shared between perspectives and its layout is not reset when resetting perspectives.\n */\nexport const MAIN_AREA: MAIN_AREA = 'part.main-area';\n\n/**\n * Represents the type of the {@link MAIN_AREA} constant.\n */\nexport type MAIN_AREA = 'part.main-area';\n\n/**\n * Represents the alternative id of the main area part.\n *\n * @see MAIN_AREA\n */\nexport const MAIN_AREA_ALTERNATIVE_ID = 'main-area';\n\n/**\n * Contains different versions of a workbench layout.\n *\n * The M-prefix indicates this object is a model object that is serialized and stored, requiring migration on breaking change.\n */\nexport interface MWorkbenchLayout {\n  /**\n   * Layout before any user personalization (initial layout).\n   */\n  referenceLayout: {\n    /**\n     * @see WorkbenchLayoutSerializer.serializeGrids\n     * @see WorkbenchLayoutSerializer.deserializeGrid\n     */\n    grids: {\n      main: string;\n      [activityId: ActivityId]: string;\n    };\n    /**\n     * @see WorkbenchLayoutSerializer.serializeActivityLayout\n     */\n    activityLayout: string;\n    /**\n     * @see WorkbenchLayoutSerializer.serializeOutlets\n     * @see WorkbenchLayoutSerializer.deserializeOutlets\n     */\n    outlets: string;\n  };\n  /**\n   * Layout personalized by the user.\n   */\n  userLayout: {\n    /**\n     * @see WorkbenchLayoutSerializer.serializeGrids\n     * @see WorkbenchLayoutSerializer.deserializeGrid\n     */\n    grids: {\n      main: string;\n      [activityId: ActivityId]: string;\n    };\n    /**\n     * @see WorkbenchLayoutSerializer.serializeActivityLayout\n     */\n    activityLayout: string;\n    /**\n     * @see WorkbenchLayoutSerializer.serializeOutlets\n     * @see WorkbenchLayoutSerializer.deserializeOutlets\n     */\n    outlets: string;\n  };\n}\n\n/**\n * Signature of a function to provide a workbench layout.\n *\n * The workbench will invoke this function with a factory object to create the layout. The layout is immutable; each modification creates a new instance.\n *\n * The function can call `inject` to get any required dependencies.\n *\n * ## Workbench Layout\n * The workbench layout is an arrangement of parts and views. Parts can be docked to the side or positioned relative to each other.\n * Views are stacked in parts and can be dragged to other parts. Content can be displayed in both parts and views.\n *\n * The layout typically has a main area part and parts docked to the side, providing navigation and context-sensitive assistance to support\n * the user's workflow. Initially empty or displaying a welcome page, the main area is where the workbench opens views by default.\n * Unlike any other part, the main area is shared between perspectives, and its layout is not reset when resetting perspectives.\n\n * ## Steps to create the layout\n * Start by adding parts to the layout. Parts can be docked to a specific area (`left-top`, `left-bottom`, `right-top`, `right-bottom`, `bottom-left`, `bottom-right`)\n * or aligned relative to each other. Views can be added to any part except the main area part. To display content, navigate parts and views to registered routes.\n *\n * To maintain a clean URL, navigate parts and views in the layout to empty-path routes and use a navigation hint for differentiation.\n * - Use the `canMatchWorkbenchPart` guard to match a route only for parts navigated with a particular hint.\n * - Use the `canMatchWorkbenchView` guard to match a route only for views navigated with a particular hint.\n *\n * ## Example\n * The following example defines a layout with a main area and four parts docked to the side:\n *\n * ```plain\n * +------+-----------+------+\n * |      |           |      |\n * |      |           |      |\n * | left | main area | right|\n * |      |           |      |\n * |      |           |      |\n * +------+-----------+------+\n * |          bottom         |\n * +-------------------------+\n * ```\n *\n * ```ts\n * import {bootstrapApplication} from '@angular/platform-browser';\n * import {MAIN_AREA, provideWorkbench, WorkbenchLayoutFactory} from '@scion/workbench';\n *\n * bootstrapApplication(AppComponent, {\n *   providers: [\n *     provideWorkbench({\n *       layout: (factory: WorkbenchLayoutFactory) => factory\n *         // Add parts to dock areas on the side.\n *         .addPart(MAIN_AREA)\n *         .addPart('navigator', {dockTo: 'left-top'}, {label: 'Navigator', icon: 'folder'})\n *         .addPart('find', {dockTo: 'bottom-left'}, {label: 'Find', icon: 'search'})\n *         .addPart('inventory', {dockTo: 'right-top'}, {label: 'Inventory', icon: 'inventory'})\n *         .addPart('notifications', {dockTo: 'right-bottom'}, {label: 'Notifications', icon: 'notifications'})\n *\n *         // Add views to parts.\n *         .addView('find1', {partId: 'find'})\n *         .addView('find2', {partId: 'find'})\n *         .addView('find3', {partId: 'find'})\n *\n *         // Navigate the main area to display a welcome page.\n *         .navigatePart(MAIN_AREA, [], {hint: 'welcome'})\n *\n *         // Navigate parts to display content.\n *         .navigatePart('navigator', [], {hint: 'navigator'})\n *         .navigatePart('inventory', ['path/to/inventory'])\n *         .navigatePart('notifications', [], {hint: 'notifications'})\n *\n *         // Navigate views to display content.\n *         .navigateView('find1', ['path/to/find'])\n *         .navigateView('find2', ['path/to/find'])\n *         .navigateView('find3', ['path/to/find'])\n *\n *         // Activate parts to open docked parts.\n *         .activatePart('navigator')\n *         .activatePart('find')\n *         .activatePart('inventory'),\n *     }),\n *   ],\n * });\n * ```\n *\n * The layout requires the following routes.\n *\n * ```ts\n * import {bootstrapApplication} from '@angular/platform-browser';\n * import {provideRouter} from '@angular/router';\n * import {canMatchWorkbenchView, canMatchWorkbenchPart} from '@scion/workbench';\n *\n * bootstrapApplication(AppComponent, {\n *   providers: [\n *     provideRouter([\n *      // Route for the \"MAIN_AREA Part\"\n *       {path: '', canMatch: [canMatchWorkbenchPart('welcome')], loadComponent: () => import('./welcome/welcome.component')},\n *       // Route for the \"Navigator Part\"\n *       {path: '', canMatch: [canMatchWorkbenchPart('navigator')], loadComponent: () => import('./navigator/navigator.component')},\n *       // Route for the \"Find View\"\n *       {path: 'path/to/find', loadComponent: () => import('./find/find.component')},\n *       // Route for the \"Inventory Part\"\n *       {path: 'path/to/inventory', loadComponent: () => import('./inventory/inventory.component')},\n *       // Route for the \"Notifications Part\"\n *       {path: '', canMatch: [canMatchWorkbenchPart('notifications')], loadComponent: () => import('./notifications/notifications.component')},\n *     ]),\n *   ],\n * });\n * ```\n */\nexport type WorkbenchLayoutFn = (factory: WorkbenchLayoutFactory) => Promise<WorkbenchLayout> | WorkbenchLayout;\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {NavigationExtras, Router, UrlSegment, UrlTree} from '@angular/router';\nimport {WorkbenchRouter} from './workbench-router.service';\nimport {Defined, Objects} from '@scion/toolkit/util';\nimport {assertNotInReactiveContext, inject, Injectable, Injector, NgZone, runInInjectionContext} from '@angular/core';\nimport {WorkbenchLayoutService} from '../layout/workbench-layout.service';\nimport {MAIN_AREA_LAYOUT_QUERY_PARAM} from '../workbench.constants';\nimport {ANGULAR_ROUTER_MUTEX, SingleTaskExecutor} from '../executor/single-task-executor';\nimport {firstValueFrom} from 'rxjs';\nimport {WorkbenchNavigationalStates} from './workbench-navigational-states';\nimport {ɵWorkbenchLayout} from '../layout/ɵworkbench-layout';\nimport {Routing} from './routing.util';\nimport {Commands, Outlets, WorkbenchNavigationContext, WorkbenchNavigationExtras} from './routing.model';\nimport {UrlSegmentMatcher} from './url-segment-matcher';\nimport {WorkbenchViewRegistry} from '../view/workbench-view.registry';\nimport {ɵWorkbenchView} from '../view/ɵworkbench-view.model';\nimport {WorkbenchLayouts} from '../layout/workbench-layouts.util';\nimport {MAIN_AREA} from '../layout/workbench-layout';\nimport {computeViewId, ViewId, WorkbenchOutlet} from '../workbench.identifiers';\n\n/** @inheritDoc */\n@Injectable({providedIn: 'root'})\nexport class ɵWorkbenchRouter implements WorkbenchRouter {\n\n  private readonly _router = inject(Router);\n  private readonly _workbenchLayoutService = inject(WorkbenchLayoutService);\n  private readonly _workbenchViewRegistry = inject(WorkbenchViewRegistry);\n  private readonly _injector = inject(Injector);\n  private readonly _zone = inject(NgZone);\n  /** Mutex to serialize Workbench Router navigation requests, preventing race conditions when modifying the active workbench layout to operate on the most-recent layout. */\n  private readonly _workbenchRouterMutex = new SingleTaskExecutor();\n  /** Mutex to serialize Angular Router navigation requests, preventing the cancellation of previously initiated asynchronous navigations. */\n  private readonly _angularRouterMutex = inject(ANGULAR_ROUTER_MUTEX);\n  /** Holds the current navigational context during a workbench navigation, or `null` if no navigation is in progress. */\n  private _currentNavigationContext: WorkbenchNavigationContext | null = null;\n\n  constructor() {\n    // Instruct the Angular router to process navigations that do not change the current URL, i.e., when only updating navigation state.\n    // For example, the main grid is passed to the navigation as state, not as a query parameter. Without this flag set, changes to\n    // the main grid would not be added to the browsing history stack.\n    // Although the `onSameUrlNavigation` flag can be set per navigation via the navigation extras, this is not sufficient because the\n    // Angular router ignores it when navigating back and forth in the browsing history.\n    // See Angular router.ts#setUpLocationChangeListener and router.ts#navigateToSyncWithBrowser\n    this._router.onSameUrlNavigation = 'reload';\n  }\n\n  /** @inheritDoc */\n  public navigate(commands: Commands, extras?: WorkbenchNavigationExtras): Promise<boolean>;\n  public navigate(navigateFn: ɵNavigateFn, extras?: Omit<NavigationExtras, 'relativeTo' | 'state'>): Promise<boolean>;\n  public navigate(commandsOrNavigateFn: Commands | ɵNavigateFn, extras?: WorkbenchNavigationExtras | Omit<NavigationExtras, 'relativeTo' | 'state'>): Promise<boolean>;\n  public async navigate(commandsOrNavigateFn: Commands | ɵNavigateFn, extras?: WorkbenchNavigationExtras | Omit<NavigationExtras, 'relativeTo' | 'state'>): Promise<boolean> {\n    assertNotInReactiveContext(this.navigate, 'Call WorkbenchRouter.navigate() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    // Ensure to run in Angular zone.\n    if (!NgZone.isInAngularZone()) {\n      return this._zone.run(() => this.navigate(commandsOrNavigateFn, extras));\n    }\n\n    const navigateFn = typeof commandsOrNavigateFn === 'function' ? commandsOrNavigateFn : createNavigationFromCommands(commandsOrNavigateFn, extras ?? {});\n\n    // Serialize navigation requests to avoid race conditions when modifying the active workbench layout, ensuring layout operations are performed on the most-recent layout.\n    const newLayout = await this._workbenchRouterMutex.submit(async () => {\n      // Wait until Angular has performed the initial navigation to avoid overriding the layout as specified in the URL.\n      if (!this._workbenchLayoutService.hasLayout()) {\n        await this._workbenchLayoutService.whenLayoutAvailable;\n      }\n\n      // Let the navigator compute the new workbench layout.\n      const currentLayout = this._workbenchLayoutService.layout();\n      let newLayout = await runInInjectionContext(this._injector, () => navigateFn(currentLayout));\n      if (!newLayout) {\n        return null;\n      }\n\n      // Remove views marked for removal that have no `CanClose` guard.\n      // Views with a `CanClose` guard are removed later, outside the navigation mutex, to avoid blocking the workbench router.\n      newLayout = this.removeViewsWithoutGuard(newLayout);\n\n      // Skip navigation if the layout has not changed, such as when only closing views with a `CanClose` guard.\n      if (newLayout.equals(currentLayout, {excludeViewMarkedForRemoval: true})) {\n        return newLayout;\n      }\n\n      // Create extras with workbench navigation instructions.\n      extras = createNavigationExtras({newLayout, currentLayout}, extras);\n\n      // Perform the navigation.\n      const urlTree = this._router.parseUrl(this._router.url); // Read outlets from the current URL and not the current layout to update or remove migrated outlets.\n      const currentOutlets = Object.fromEntries(Routing.parseOutlets(urlTree, {part: true, view: true}));\n      const newOutlets = newLayout.outlets({mainGrid: true, mainAreaGrid: true, activityGrids: true});\n      const commands: Commands = computeNavigationCommands(currentOutlets, newOutlets);\n      if (!await this._angularRouterMutex.submit(() => this._router.navigate(commands, extras))) {\n        return null;\n      }\n\n      // Block subsequent navigation(s) until Angular has flushed the changed layout to the DOM.\n      await firstValueFrom(this._zone.onStable);\n      return newLayout;\n    });\n\n    if (!newLayout) {\n      return false;\n    }\n\n    // Remove views marked for removal, confirming closing by calling each view's `CanClose` guard.\n    return this.scheduleViewRemoval(newLayout);\n  }\n\n  /**\n   * Performs changes to the current workbench layout.\n   *\n   * Unlike {@link navigate}, does not perform the navigation but returns the URL tree instead.\n   *\n   * The router will invoke the callback and pass the current layout for modification. The callback can call `inject` to get any required dependencies.\n   *\n   * The following example adds a part to the left of the main area, inserts a view and navigates it.\n   *\n   * ```ts\n   * inject(WorkbenchRouter).createUrlTree(layout => layout\n   *   .addPart('left', {relativeTo: MAIN_AREA, align: 'left'})\n   *   .addView('navigator', {partId: 'left'})\n   *   .navigateView('navigator', ['path/to/view'])\n   *   .activateView('navigator'),\n   * );\n   * ```\n   *\n   * @param onNavigate - Specifies the callback to modify the layout.\n   * @param extras - Controls how to perform the navigation.\n   * @see NavigateFn\n   */\n  public async createUrlTree(onNavigate: (layout: ɵWorkbenchLayout) => Promise<ɵWorkbenchLayout | null> | ɵWorkbenchLayout | null, extras?: Omit<NavigationExtras, 'relativeTo' | 'state'>): Promise<UrlTree | null> {\n    assertNotInReactiveContext(this.createUrlTree, 'Call WorkbenchRouter.createUrlTree() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    // Ensure to run in Angular zone.\n    if (!NgZone.isInAngularZone()) {\n      return this._zone.run(() => this.createUrlTree(onNavigate, extras));\n    }\n\n    // Serialize navigation requests to avoid race conditions when modifying the active workbench layout, ensuring layout operations are performed on the most-recent layout.\n    return this._workbenchRouterMutex.submit(async () => {\n      // Wait until Angular has performed the initial navigation to avoid overriding the layout as specified in the URL.\n      if (!this._workbenchLayoutService.hasLayout()) {\n        await this._workbenchLayoutService.whenLayoutAvailable;\n      }\n\n      // Let the navigator compute the new workbench layout.\n      const currentLayout = this._workbenchLayoutService.layout();\n      let newLayout: ɵWorkbenchLayout | null = await runInInjectionContext(this._injector, () => onNavigate(currentLayout));\n      if (!newLayout) {\n        return null;\n      }\n\n      // Remove views marked for removal.\n      newLayout.views({markedForRemoval: true}).forEach(view => {\n        newLayout = newLayout!.removeView(view.id, {force: true});\n      });\n\n      // Create extras with workbench navigation instructions.\n      extras = createNavigationExtras({newLayout, currentLayout}, extras);\n\n      // Create the new URL tree.\n      const currentOutlets = currentLayout.outlets({mainGrid: true, mainAreaGrid: true, activityGrids: true});\n      const newOutlets = newLayout.outlets({mainGrid: true, mainAreaGrid: true, activityGrids: true});\n      const commands: Commands = computeNavigationCommands(currentOutlets, newOutlets);\n      return this._router.createUrlTree(commands, extras);\n    });\n  }\n\n  /**\n   * Remove views marked for removal that have no `CanClose` guard.\n   */\n  private removeViewsWithoutGuard(layout: ɵWorkbenchLayout): ɵWorkbenchLayout {\n    return layout.views({markedForRemoval: true}).reduce((layout, mView) => {\n      const view = this._workbenchViewRegistry.get(mView.id, {orElse: null});\n      if (!view || (view.isClosable() && !view.canCloseGuard)) {\n        return layout.removeView(mView.id, {force: true});\n      }\n      return layout;\n    }, layout);\n  }\n\n  /**\n   * Removes views marked for removal, confirming closing by calling each view's `CanClose` guard.\n   *\n   * Guards are executed in parallel, and views are removed in separate navigations.\n   *\n   * @return a Promise that resolves to `true` when all marked views were successfully closed or declined closing.\n   */\n  private async scheduleViewRemoval(layout: ɵWorkbenchLayout): Promise<boolean> {\n    const navigations = layout.views({markedForRemoval: true})\n      .map(mView => this._workbenchViewRegistry.get(mView.id, {orElse: null}))\n      .filter((view): view is ɵWorkbenchView => !!view && view.isClosable())\n      .map(async view => {\n        // Capture current navigation id to not proceed closing if navigated in the meantime.\n        const navigationId = view.navigation()?.id;\n        // Make view non-closable to prevent closing the view again while awaiting closing confirmation.\n        view.closable = false;\n        try {\n          const close = await view.canCloseGuard!();\n          if (close && view.navigation()?.id === navigationId) {\n            return await this.navigate(layout => layout.removeView(view.id, {force: true}));\n          }\n          return true;\n        }\n        finally {\n          view.closable = true;\n        }\n      });\n\n    // Wait for all `CanClose` guards to resolve and subsequent navigations to complete.\n    return (await Promise.all(navigations)).every(Boolean);\n  }\n\n  /**\n   * Returns the context of the current workbench navigation, when being invoked during navigation, or throws an error otherwise.\n   */\n  public getCurrentNavigationContext(): WorkbenchNavigationContext {\n    if (!this._currentNavigationContext) {\n      throw Error('[NavigateError] Navigation context not available because no navigation is in progress.');\n    }\n    return this._currentNavigationContext;\n  }\n\n  /**\n   * Sets navigational contextual data.\n   */\n  public setCurrentNavigationContext(context: WorkbenchNavigationContext | null): void {\n    this._currentNavigationContext = context;\n  }\n}\n\n/**\n * Creates a navigation to navigate view(s) based on the provided array of commands and extras.\n */\nexport function createNavigationFromCommands(commands: Commands, extras: WorkbenchNavigationExtras): ɵNavigateFn {\n  return (layout: ɵWorkbenchLayout): ɵWorkbenchLayout | null => {\n    if (extras.close) {\n      if (extras.target) {\n        if (commands.length || extras.hint || extras.partId || extras.relativeTo) {\n          throw Error('[NavigateError] Commands, hint, part or relativeTo must not be set when closing a view by id.');\n        }\n        return layout.removeView(extras.target);\n      }\n      const urlSegments = Routing.commandsToSegments(commands, {relativeTo: extras.relativeTo});\n      return layout\n        .views({\n          peripheral: extras.partId ? undefined : false,\n          partId: extras.partId,\n          segments: new UrlSegmentMatcher(urlSegments, {matchMatrixParams: false, matchWildcardPath: true}),\n          navigationHint: extras.hint ?? null,\n        })\n        .reduce((layout, view) => layout.removeView(view.id), layout);\n    }\n    else {\n      switch (extras.target ?? 'auto') {\n        case 'blank': {\n          return addView(computeViewId(), layout);\n        }\n        case 'auto': {\n          const urlSegments = Routing.commandsToSegments(commands, {relativeTo: extras.relativeTo});\n          const views = layout.views({\n            peripheral: extras.partId ? undefined : false,\n            partId: extras.partId,\n            segments: new UrlSegmentMatcher(urlSegments, {matchMatrixParams: false, matchWildcardPath: false}),\n            navigationHint: extras.hint ?? null,\n          });\n          if (views.length) {\n            return views.reduce((layout, view) => updateView(view.id, layout), layout);\n          }\n          else {\n            return addView(computeViewId(), layout);\n          }\n        }\n        default: {\n          const viewId = extras.target!;\n          if (layout.hasView(viewId)) {\n            return updateView(viewId, layout);\n          }\n          else {\n            return addView(viewId, layout);\n          }\n        }\n      }\n    }\n  };\n\n  /**\n   * Adds the specified view to the layout.\n   */\n  function addView(viewId: ViewId | string, layout: ɵWorkbenchLayout): ɵWorkbenchLayout {\n    // Default to the active part if not specified or not in the layout, with the active part of the main area taking precedence.\n    const partId = ((): string => {\n      if (extras.partId && layout.hasPart(extras.partId)) {\n        return extras.partId;\n      }\n      return layout.hasPart(MAIN_AREA) ? layout.activePart({grid: 'mainArea'}).id : layout.activePart({grid: 'main'}).id;\n    })();\n\n    return layout\n      .addView(viewId, {\n        partId: partId,\n        position: extras.position ?? 'after-active-view',\n        activateView: extras.activate ?? true,\n        activatePart: extras.activate ?? true,\n      })\n      .navigateView(viewId, commands, {\n        relativeTo: extras.relativeTo,\n        hint: extras.hint,\n        cssClass: extras.cssClass,\n        data: extras.data,\n        state: extras.state,\n      });\n  }\n\n  /**\n   * Updates the specified view.\n   */\n  function updateView(viewId: ViewId | string, layout: ɵWorkbenchLayout): ɵWorkbenchLayout {\n    if (extras.activate ?? true) {\n      layout = layout.activateView(viewId, {activatePart: true});\n    }\n\n    return layout.navigateView(viewId, commands, {\n      relativeTo: extras.relativeTo,\n      hint: extras.hint,\n      cssClass: extras.cssClass,\n      data: extras.data,\n      state: extras.state,\n    });\n  }\n}\n\n/**\n * Creates navigation extras with workbench navigation instructions.\n */\nfunction createNavigationExtras(layouts: {newLayout: ɵWorkbenchLayout; currentLayout?: ɵWorkbenchLayout | undefined}, extras?: Omit<NavigationExtras, 'relativeTo' | 'state'>): NavigationExtras {\n  const {newLayout, currentLayout} = layouts;\n  const newLayoutSerialized = newLayout.serialize({excludeViewMarkedForRemoval: true});\n\n  // IMPORTANT: Update `ɵWorkbenchLayout.equals` function when adding new state properties.\n\n  return {\n    ...extras,\n    // Instruct the Angular router to process the navigation even if the URL does not change, e.g., when changing the main grid which is not contained in the URL.\n    onSameUrlNavigation: 'reload',\n    // Unset `relativeTo` because commands are already normalized to their absolute form.\n    relativeTo: null,\n    // Associate workbench-specific state with the navigation.\n    state: WorkbenchNavigationalStates.create({\n      grids: {\n        main: newLayoutSerialized.grids.main,\n        ...WorkbenchLayouts.pickActivityGrids(newLayoutSerialized.grids),\n      },\n      activityLayout: newLayoutSerialized.activityLayout,\n      // Fall back to the current layout's perspective if not specified by the new layout,\n      // e.g., the navigator provides a new layout to replace the current layout.\n      perspectiveId: newLayout.perspectiveId ?? currentLayout?.perspectiveId,\n      navigationStates: newLayout.navigationStates(),\n    }),\n    // Add the main area as query parameter.\n    queryParams: {\n      ...extras?.queryParams,\n      [MAIN_AREA_LAYOUT_QUERY_PARAM]: WorkbenchLayouts.isGridEmpty(newLayout.grids.mainArea) ? undefined : newLayoutSerialized.grids.mainArea,\n    },\n    // Merge with existing query params unless specified an explicit strategy, e.g., for migrating an outdated layout URL.\n    // Note that `null` is a valid strategy for clearing existing query params, so do not use the nullish coalescing operator (??).\n    queryParamsHandling: Defined.orElse(extras?.queryParamsHandling, 'merge'),\n    preserveFragment: extras?.preserveFragment ?? !extras?.fragment,\n  };\n}\n\n/**\n * Computes commands that can be passed to the Angular router to navigate views and parts.\n */\nfunction computeNavigationCommands(currentOutlets: Outlets, newOutlets: Outlets): [{outlets: {[outlet: WorkbenchOutlet]: Commands | null}}] | [] {\n  const currentOutletMap = new Map<WorkbenchOutlet, UrlSegment[]>(Objects.entries(currentOutlets));\n  const newOutletMap = new Map<WorkbenchOutlet, UrlSegment[]>(Objects.entries(newOutlets));\n\n  const commands = new Map<WorkbenchOutlet, Commands | null>();\n  const outlets = new Set<WorkbenchOutlet>([...currentOutletMap.keys(), ...newOutletMap.keys()]);\n\n  outlets.forEach(outlet => {\n    // Test if the outlet has been added to the layout.\n    if (!currentOutletMap.has(outlet)) {\n      commands.set(outlet, Routing.segmentsToCommands(newOutletMap.get(outlet)!));\n    }\n    // Test if the outlet has been removed from the layout.\n    else if (!newOutletMap.has(outlet)) {\n      commands.set(outlet, null);\n    }\n    // Test if the outlet has been changed.\n    else if (!new UrlSegmentMatcher(currentOutletMap.get(outlet)!, {matchMatrixParams: true, matchWildcardPath: false}).matches(newOutletMap.get(outlet)!)) {\n      commands.set(outlet, Routing.segmentsToCommands(newOutletMap.get(outlet)!));\n    }\n  });\n\n  // Add commands to the 'outlets' property to be interpreted by the Angular router.\n  return commands.size ? [{outlets: Object.fromEntries(commands)}] : [];\n}\n\n/**\n * @inheritDoc\n * @see NavigateFn\n */\nexport type ɵNavigateFn = (layout: ɵWorkbenchLayout) => Promise<ɵWorkbenchLayout | null> | ɵWorkbenchLayout | null;\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {NavigationExtras} from '@angular/router';\nimport {Injectable} from '@angular/core';\nimport {Commands, NavigateFn, WorkbenchNavigationExtras} from './routing.model';\nimport {ɵWorkbenchRouter} from './ɵworkbench-router.service';\n\n/**\n * Enables navigation of workbench views and modification of the workbench layout.\n *\n * A view is a visual workbench element for displaying content side-by-side or stacked. A view can be navigated to any route.\n *\n * A view can inject `ActivatedRoute` to get parameters passed to the navigation and read data associated with the route.\n */\n@Injectable({providedIn: 'root', useExisting: ɵWorkbenchRouter})\nexport abstract class WorkbenchRouter {\n\n  /**\n   * Navigates views based on the provided array of commands and extras. This method is similar to Angular's `Router.navigate(...)`, but with a view as the navigation target.\n   *\n   * A command can be a string or an object literal. A string represents a path segment, an object literal associates matrix parameters with the preceding segment.\n   * Multiple segments can be combined into a single command, separated by a forward slash.\n   *\n   * By default, navigates existing views that match the path, or opens a new view otherwise. Matrix params do not affect view resolution.\n   * This behavior can be changed by setting an explicit navigation target in navigation extras.\n   *\n   * By default, navigation is absolute. Set `relativeTo` in extras for relative navigation.\n   *\n   * The router supports for closing views matching the routing commands by setting `close` in navigation extras.\n   *\n   * ### Usage\n   * ```\n   * inject(WorkbenchRouter).navigate(['team', 33, 'user', 11]);\n   * inject(WorkbenchRouter).navigate(['team/11/user', userName, {details: true}]); // multiple static segments can be merged into one\n   * inject(WorkbenchRouter).navigate(['teams', {selection: 33'}]); // matrix parameter `selection` with the value `33`.\n   * ```\n   *\n   * @see WorkbenchRouterLinkDirective\n   */\n  public abstract navigate(commands: Commands, extras?: WorkbenchNavigationExtras): Promise<boolean>;\n\n  /**\n   * Performs changes to the current workbench layout.\n   *\n   * The router will invoke this function with the current workbench layout. The layout has methods for modifying it.\n   * The layout is immutable; each modification creates a new instance.\n   *\n   * The function can call `inject` to get any required dependencies.\n   *\n   * ## Workbench Layout\n   * The workbench layout is an arrangement of parts and views. Parts can be docked to the side or positioned relative to each other.\n   * Views are stacked in parts and can be dragged to other parts. Content can be displayed in both parts and views.\n   *\n   * ## Example\n   * The following example adds a part to the left of the main area, inserts a view and navigates it.\n   *\n   * ```ts\n   * inject(WorkbenchRouter).navigate(layout => layout\n   *   .addPart('left', {relativeTo: MAIN_AREA, align: 'left'})\n   *   .addView('navigator', {partId: 'left'})\n   *   .navigateView('navigator', ['path/to/view'])\n   *   .activateView('navigator')\n   * );\n   * ```\n   *\n   * @param onNavigate - Specifies the callback to modify the layout.\n   * @param extras - Controls how to perform the navigation.\n   * @see NavigateFn\n   */\n  public abstract navigate(onNavigate: NavigateFn, extras?: Omit<NavigationExtras, 'relativeTo' | 'state'>): Promise<boolean>;\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {WorkbenchMigration} from './workbench-migration';\n\n/**\n * Migrates serialized workbench data to the latest version.\n */\nexport class WorkbenchMigrator {\n\n  private _migrators = new Map<number, WorkbenchMigration>();\n\n  /**\n   * Registers a migration from a specific version to the next version.\n   */\n  public registerMigration(fromVersion: number, migration: WorkbenchMigration): this {\n    this._migrators.set(fromVersion, migration);\n    return this;\n  }\n\n  /**\n   * Migrates serialized workbench data to the latest version.\n   */\n  public migrate(json: string, version: {from: number; to: number}): string {\n    for (let v = version.from; v < version.to; v++) {\n      const migrator = this._migrators.get(v);\n      if (!migrator) {\n        throw Error(`[NullMigrationError] Cannot perform workbench data migration. No migration registered for version ${v}.`);\n      }\n      json = migrator.migrate(json);\n    }\n    return json;\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport interface MPartV3 {\n  type: 'MPart';\n  id: string;\n  views: MViewV3[];\n  activeViewId?: ViewIdV3;\n  structural: boolean;\n}\n\nexport interface MTreeNodeV3 {\n  type: 'MTreeNode';\n  nodeId: string;\n  child1: MTreeNodeV3 | MPartV3;\n  child2: MTreeNodeV3 | MPartV3;\n  ratio: number;\n  direction: 'column' | 'row';\n}\n\nexport interface MPartGridV3 {\n  root: MTreeNodeV3 | MPartV3;\n  activePartId: string;\n}\n\nexport interface MViewV3 {\n  id: ViewIdV3;\n  alternativeId?: string;\n  cssClass?: string[];\n  navigation?: {\n    hint?: string;\n    cssClass?: string[];\n  };\n}\n\nexport type ViewIdV3 = `view.${string}`;\n\nexport const VIEW_ID_PREFIX_V3 = 'view.';\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable} from '@angular/core';\nimport {MPartGridV2, MPartV2, MTreeNodeV2, MViewV2} from './model/workbench-grid-migration-v2.model';\nimport {MPartGridV3, MPartV3, MTreeNodeV3, MViewV3, VIEW_ID_PREFIX_V3, ViewIdV3} from './model/workbench-grid-migration-v3.model';\nimport {Router, UrlTree} from '@angular/router';\nimport {WorkbenchMigration} from '../../migration/workbench-migration';\nimport {Routing} from '../../routing/routing.util';\n\n/**\n * Migrates the workbench grid model from version 2 to version 3.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchGridMigrationV3 implements WorkbenchMigration {\n\n  private readonly _router = inject(Router);\n\n  public migrate(json: string): string {\n    const partGridV2 = JSON.parse(json) as MPartGridV2;\n\n    // Consider the ids of views contained in the URL as already used.\n    // Otherwise, when migrating the main area and using a view id already present in the perspective,\n    // the view outlet would not be removed from the URL, resulting the migrated view to display\n    // \"Not Found\" page or incorrect content.\n    const viewOutlets = Routing.parseOutlets(this.getCurrentUrl(), {view: true});\n    const usedViewIds = new Set<ViewIdV3>([...viewOutlets.keys(), ...collectViewIds(partGridV2.root)]);\n\n    // Migrate the grid.\n    const partGridV3: MPartGridV3 = {\n      root: migrateGridElement(partGridV2.root),\n      activePartId: partGridV2.activePartId,\n    };\n    return JSON.stringify(partGridV3);\n\n    function migrateGridElement(elementV2: MTreeNodeV2 | MPartV2): MTreeNodeV3 | MPartV3 {\n      switch (elementV2.type) {\n        case 'MTreeNode':\n          return migrateNode(elementV2);\n        case 'MPart':\n          return migratePart(elementV2);\n        default:\n          throw Error(`[WorkbenchLayoutError] Unable to migrate to the latest version. Expected element to be of type 'MPart' or 'MTreeNode'. [version=2, element=${JSON.stringify(elementV2)}]`);\n      }\n    }\n\n    function migrateNode(nodeV2: MTreeNodeV2): MTreeNodeV3 {\n      return {\n        type: 'MTreeNode',\n        nodeId: nodeV2.nodeId,\n        child1: migrateGridElement(nodeV2.child1),\n        child2: migrateGridElement(nodeV2.child2),\n        ratio: nodeV2.ratio,\n        direction: nodeV2.direction,\n      };\n    }\n\n    function migratePart(partV2: MPartV2): MPartV3 {\n      const partV3: MPartV3 = {\n        type: 'MPart',\n        id: partV2.id,\n        structural: partV2.structural,\n        views: [],\n      };\n\n      // Add views and set the active view.\n      partV2.views.forEach((viewV2: MViewV2) => {\n        const viewV3: MViewV3 = migrateView(viewV2);\n        if (partV2.activeViewId === viewV2.id) {\n          partV3.activeViewId = viewV3.id;\n        }\n        partV3.views.push(viewV3);\n        usedViewIds.add(viewV3.id);\n      });\n\n      return partV3;\n    }\n\n    function migrateView(viewV2: MViewV2): MViewV3 {\n      if (isViewId(viewV2.id)) {\n        return {id: viewV2.id, navigation: {}};\n      }\n      else {\n        return {id: computeNextViewId(usedViewIds), alternativeId: viewV2.id, navigation: {hint: viewV2.id}};\n      }\n    }\n  }\n\n  private getCurrentUrl(): UrlTree {\n    return this._router.currentNavigation()?.initialUrl ?? this._router.parseUrl(this._router.url);\n  }\n}\n\nfunction computeNextViewId(viewIds: Iterable<ViewIdV3>): ViewIdV3 {\n  const ids = Array.from(viewIds)\n    .map(viewId => Number(viewId.substring(VIEW_ID_PREFIX_V3.length)))\n    .reduce((set, id) => set.add(id), new Set<number>());\n\n  for (let i = 1; i <= ids.size; i++) {\n    if (!ids.has(i)) {\n      return VIEW_ID_PREFIX_V3.concat(`${i}`) as ViewIdV3;\n    }\n  }\n  return VIEW_ID_PREFIX_V3.concat(`${ids.size + 1}`) as ViewIdV3;\n}\n\nfunction isViewId(viewId: string): viewId is ViewIdV3 {\n  return viewId.startsWith(VIEW_ID_PREFIX_V3);\n}\n\nfunction collectViewIds(node: MPartV2 | MTreeNodeV2): Set<ViewIdV3> {\n  if (node.type === 'MPart') {\n    return new Set(node.views.map(view => view.id).filter(isViewId));\n  }\n  else {\n    return new Set([...collectViewIds(node.child1), ...collectViewIds(node.child2)]);\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {MPartGridV3, MPartV3, MTreeNodeV3, MViewV3} from './model/workbench-grid-migration-v3.model';\nimport {WorkbenchMigration} from '../../migration/workbench-migration';\nimport {MPartGridV4, MPartV4, MTreeNodeV4, MViewV4} from './model/workbench-grid-migration-v4.model';\n\n/**\n * Migrates the workbench grid model from version 3 to version 4.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchGridMigrationV4 implements WorkbenchMigration {\n\n  public migrate(json: string): string {\n    const partGridV3 = JSON.parse(json) as MPartGridV3;\n\n    // Migrate the grid.\n    const partGridV4: MPartGridV4 = {\n      ...partGridV3,\n      root: migrateGridElement(partGridV3.root),\n    };\n    return JSON.stringify(partGridV4);\n\n    function migrateGridElement(elementV3: MTreeNodeV3 | MPartV3): MTreeNodeV4 | MPartV4 {\n      switch (elementV3.type) {\n        case 'MTreeNode':\n          return migrateNode(elementV3);\n        case 'MPart':\n          return migratePart(elementV3);\n        default:\n          throw Error(`[WorkbenchLayoutError] Unable to migrate to the latest version. Expected element to be of type 'MPart' or 'MTreeNode'. [version=3, element=${JSON.stringify(elementV3)}]`);\n      }\n    }\n\n    function migrateNode(nodeV3: MTreeNodeV3): MTreeNodeV4 {\n      return {\n        ...nodeV3,\n        child1: migrateGridElement(nodeV3.child1),\n        child2: migrateGridElement(nodeV3.child2),\n      };\n    }\n\n    function migratePart(partV3: MPartV3): MPartV4 {\n      return {...partV3, views: partV3.views.map(migrateView)};\n    }\n\n    function migrateView(viewV3: MViewV3): MViewV4 {\n      return {...viewV3, uid: undefined!}; // `uid` is transient, i.e., set when deserializing the grid.\n    }\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {MPartGridV4, MPartV4, MTreeNodeV4, MViewV4} from './model/workbench-grid-migration-v4.model';\nimport {WorkbenchMigration} from '../../migration/workbench-migration';\nimport {MPartGridV5, MPartV5, MTreeNodeV5, MViewV5} from './model/workbench-grid-migration-v5.model';\nimport {UID} from '../../common/uid.util';\n\n/**\n * Migrates the workbench grid model from version 4 to version 5.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchGridMigrationV5 implements WorkbenchMigration {\n\n  public migrate(json: string): string {\n    const partGridV4 = JSON.parse(json) as MPartGridV4;\n\n    // Migrate the grid.\n    const partGridV5: MPartGridV5 = {\n      ...partGridV4,\n      root: migrateGridElement(partGridV4.root),\n    };\n    return JSON.stringify(partGridV5);\n\n    function migrateGridElement(elementV4: MTreeNodeV4 | MPartV4): MTreeNodeV5 | MPartV5 {\n      switch (elementV4.type) {\n        case 'MTreeNode':\n          return migrateNode(elementV4);\n        case 'MPart':\n          return migratePart(elementV4);\n        default:\n          throw Error(`[WorkbenchLayoutError] Unable to migrate to the latest version. Expected element to be of type 'MPart' or 'MTreeNode'. [version=4, element=${JSON.stringify(elementV4)}]`);\n      }\n    }\n\n    function migrateNode(nodeV4: MTreeNodeV4): MTreeNodeV5 {\n      return {\n        ...nodeV4,\n        id: UID.randomUID(),\n        child1: migrateGridElement(nodeV4.child1),\n        child2: migrateGridElement(nodeV4.child2),\n      };\n    }\n\n    function migratePart(partV4: MPartV4): MPartV5 {\n      return {...partV4, views: partV4.views.map(migrateView)};\n    }\n\n    function migrateView(viewV4: MViewV4): MViewV5 {\n      const viewV5: MViewV5 = {\n        ...viewV4,\n        uid: UID.randomUID(),\n        navigation: viewV4.navigation ? {...viewV4.navigation, id: UID.randomUID()} : undefined,\n      };\n      if (!viewV5.navigation) {\n        delete viewV5.navigation;\n      }\n      return viewV5;\n    }\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {MPartGridV5, MPartV5, MTreeNodeV5, MViewV5} from './model/workbench-grid-migration-v5.model';\nimport {MPartGridV6, MPartV6, MTreeNodeV6, MViewV6} from './model/workbench-grid-migration-v6.model';\nimport {WorkbenchMigration} from '../../migration/workbench-migration';\n\n/**\n * Migrates the workbench grid model from version 5 to version 6.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchGridMigrationV6 implements WorkbenchMigration {\n\n  public migrate(json: string): string {\n    const partGridV5 = JSON.parse(json) as MPartGridV5;\n\n    // Migrate the grid.\n    const partGridV6: MPartGridV6 = {\n      ...partGridV5,\n      root: migrateGridElement(partGridV5.root),\n    };\n    return JSON.stringify(partGridV6);\n\n    function migrateGridElement(elementV5: MTreeNodeV5 | MPartV5): MTreeNodeV6 | MPartV6 {\n      switch (elementV5.type) {\n        case 'MTreeNode':\n          return migrateNode(elementV5);\n        case 'MPart':\n          return migratePart(elementV5);\n        default:\n          throw Error(`[WorkbenchLayoutError] Unable to migrate to the latest version. Expected element to be of type 'MPart' or 'MTreeNode'. [version=5, element=${JSON.stringify(elementV5)}]`);\n      }\n    }\n\n    function migrateNode(nodeV5: MTreeNodeV5): MTreeNodeV6 {\n      return {\n        ...nodeV5,\n        child1: migrateGridElement(nodeV5.child1),\n        child2: migrateGridElement(nodeV5.child2),\n      };\n    }\n\n    function migratePart(partV5: MPartV5): MPartV6 {\n      return {...partV5, views: partV5.views.map(migrateView)};\n    }\n\n    function migrateView(viewV5: MViewV5): MViewV6 {\n      const viewV6: MViewV6 = {...viewV5};\n      delete (viewV6 as Record<keyof MViewV5, unknown>).uid;\n      return viewV6;\n    }\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/**\n * Stringifies given data, exluding specified fields from serialization.\n *\n * @param data - Data to serialize to json.\n * @param options - Controls how to serialize data.\n * @param options.exclusions - Controls which fields to exclude from serialization.\\\n *                             To exclude a field, specify the path to the field in the object tree,\n *                             using the slash as delimiter. The path supports the asterisk (`*`) to match a\n *                             single segment or the globstar (`**`) to match multiple segments.\n * @param options.sort - Controls if to sort the fields by name. Defaults to `false`.\n */\nexport function stringify(data: unknown, options?: {exclusions?: Array<string | Exclusion>; sort?: true}): string {\n  const exclusions = options?.exclusions ?? [];\n  const sort = options?.sort ?? false;\n\n  const objectStack = new Array<ObjectValue>();\n  const compiledExclusions = exclusions.map(exclusion => new CompiledExclusion(exclusion));\n\n  return JSON.stringify(data, (key: string, value: unknown) => {\n    if (key === '') { // root node\n      return sort ? sortProperties(value) : value;\n    }\n\n    // Remove object(s) from the stack if finished their serialization.\n    while (objectStack.at(-1)?.fieldsToSerialize.size === 0) {\n      objectStack.pop();\n    }\n\n    // Mark current field as serialized.\n    objectStack.at(-1)?.fieldsToSerialize.delete(key);\n\n    // Check if to exclude the current field from serialization.\n    const exclude = compiledExclusions.some(exclusion => exclusion.matches(objectStack, key, value));\n\n    // Push object to stack if type of object.\n    if (!exclude && typeof value === 'object' && value !== null) {\n      objectStack.push({key, value, fieldsToSerialize: new Set(Object.keys(value))});\n    }\n\n    if (exclude) {\n      return undefined;\n    }\n\n    return sort ? sortProperties(value) : value;\n  });\n}\n\n/**\n * Sorts the properties of the passed object literal by name. The original object literal will not be changed. Has no effect if not an object literal.\n */\nfunction sortProperties(value: unknown): unknown {\n  if (typeof value !== 'object' || value === null || Array.isArray(value) || value instanceof Set || value instanceof Map) {\n    return value;\n  }\n\n  const unsorted = value as Record<string, unknown>;\n  return Object.keys(unsorted)\n    .sort()\n    .reduce((sorted, key) => {\n      sorted[key] = unsorted[key];\n      return sorted;\n    }, {} as Record<string, unknown>);\n}\n\n/**\n * Represents an object in the object tree.\n */\ninterface ObjectValue {\n  /**\n   * Key under which the object is associated in the parent object.\n   */\n  key: string;\n  /**\n   * Represents the object.\n   */\n  value: unknown;\n  /**\n   * Fields of the object that have not yet been serialized.\n   */\n  fieldsToSerialize: Set<string>;\n}\n\n/**\n * Describes a field to exclude from serialization.\n */\nexport interface Exclusion {\n  /**\n   * Specifies the path to the field in the object tree, using the slash as delimiter.\n   * The path supports the asterisk (`*`) to match a single segment or the globstar (`**`) to match multiple segments.\n   */\n  path: string;\n  /**\n   * Tests if to exclude the resolved field, enabling extended checks if the field cannot be uniquely identified via the path.\n   *\n   * @param objectPath - path to the field in the object tree.\n   * @param key - key under which the field is associated in the parent object.\n   * @param value - value of the field.\n   */\n  predicate: (objectPath: unknown[], key: string, value: unknown) => boolean;\n}\n\n/**\n * Represents an exclusion, with the path compiled to a regex.\n */\nclass CompiledExclusion {\n\n  private readonly _regex: RegExp;\n  private readonly _predicate: Exclusion['predicate'];\n\n  constructor(exclusion: string | Exclusion) {\n    exclusion = typeof exclusion === 'string' ? ({path: exclusion, predicate: () => true}) : exclusion;\n    const path = exclusion.path\n      .replaceAll('/*/', '/[^/]+/') // replace asterisk to match single segment\n      .replaceAll('**/', '.+/') // replace globstar to match multiple root segments\n      .replaceAll('/**/', '/.+/'); // replace globstar to match multiple segments\n    this._regex = new RegExp(`^${path}$`);\n    this._predicate = exclusion.predicate;\n  }\n\n  /**\n   * Tests if given field matches this exclusion.\n   */\n  public matches(objectStack: ObjectValue[], key: string, value: unknown): boolean {\n    const path = objectStack.map(objectValue => objectValue.key).concat(key).join('/');\n    if (!this._regex.test(path)) {\n      return false;\n    }\n\n    const objectPath = objectStack.map(objectValue => objectValue.value);\n    if (!this._predicate(objectPath, key, value)) {\n      return false;\n    }\n\n    return true;\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {MPartGridV6, MPartV6, MTreeNodeV6} from './model/workbench-grid-migration-v6.model';\nimport {WorkbenchMigration} from '../../migration/workbench-migration';\nimport {MPartGridV7, MPartV7, MTreeNodeV7, PartIdV7} from './model/workbench-grid-migration-v7.model';\nimport {UID} from '../../common/uid.util';\n\n/**\n * Migrates the workbench grid model from version 6 to version 7.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchGridMigrationV7 implements WorkbenchMigration {\n\n  public migrate(json: string): string {\n    const partGridV6 = JSON.parse(json) as MPartGridV6;\n    const oldActivePartId = partGridV6.activePartId;\n    const newActivePartId = migratePartId(oldActivePartId);\n\n    // Migrate the grid.\n    const partGridV7: MPartGridV7 = {\n      root: migrateGridElement(partGridV6.root),\n      activePartId: newActivePartId,\n    };\n    return JSON.stringify(partGridV7);\n\n    function migrateGridElement(elementV6: MTreeNodeV6 | MPartV6): MTreeNodeV7 | MPartV7 {\n      switch (elementV6.type) {\n        case 'MTreeNode':\n          return migrateNode(elementV6);\n        case 'MPart':\n          return migratePart(elementV6);\n        default:\n          throw Error(`[WorkbenchLayoutError] Unable to migrate to the latest version. Expected element to be of type 'MPart' or 'MTreeNode'. [version=6, element=${JSON.stringify(elementV6)}]`);\n      }\n    }\n\n    function migrateNode(nodeV6: MTreeNodeV6): MTreeNodeV7 {\n      return {\n        ...nodeV6,\n        child1: migrateGridElement(nodeV6.child1),\n        child2: migrateGridElement(nodeV6.child2),\n      };\n    }\n\n    function migratePart(partV6: MPartV6): MPartV7 {\n      return {\n        ...partV6,\n        id: partV6.id === oldActivePartId ? newActivePartId : migratePartId(partV6.id),\n        alternativeId: partV6.id,\n      };\n    }\n  }\n}\n\nfunction migratePartId(partId: string): PartIdV7 {\n  return partId === 'main-area' ? 'part.main-area' : `part.${UID.randomUID()}`;\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {PerspectiveDataV1} from './model/workbench-layout-migration-v1.model';\nimport {MPerspectiveLayoutV2} from './model/workbench-layout-migration-v2.model';\nimport {Commands} from '../../routing/routing.model';\nimport {WorkbenchMigration} from '../../migration/workbench-migration';\n\n/**\n * Migrates the workbench layout from version 1 to version 2.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchLayoutMigrationV2 implements WorkbenchMigration {\n\n  public migrate(json: string): string {\n    const perspectiveDataV1 = JSON.parse(json) as PerspectiveDataV1;\n    const perspectiveLayoutV2: MPerspectiveLayoutV2 = {\n      userLayout: {\n        workbenchGrid: perspectiveDataV1.workbenchGrid,\n        viewOutlets: this.migrateViewOutlets(perspectiveDataV1.viewOutlets),\n      },\n      referenceLayout: {\n        workbenchGrid: perspectiveDataV1.initialWorkbenchGrid,\n        viewOutlets: JSON.stringify({}),\n      },\n    };\n    return JSON.stringify(perspectiveLayoutV2);\n  }\n\n  private migrateViewOutlets(viewOutlets: {[viewId: string]: Commands}): string {\n    return JSON.stringify(Object.fromEntries(Object.entries(viewOutlets)\n      .map(([viewId, commands]: [string, Commands]): [string, MUrlSegmentV2[]] => {\n        return [viewId, commandsToSegments(commands)];\n      }),\n    ));\n  }\n}\n\nfunction commandsToSegments(commands: Commands): MUrlSegmentV2[] {\n  const segments = new Array<MUrlSegmentV2>();\n\n  commands.forEach(command => {\n    if (typeof command === 'string') {\n      segments.push({path: command, parameters: {}});\n    }\n    else {\n      segments.at(-1)!.parameters = command as Record<string, string>;\n    }\n  });\n\n  return segments;\n}\n\ninterface MUrlSegmentV2 {\n  path: string;\n  parameters: {[name: string]: string};\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {MPerspectiveLayoutV2} from './model/workbench-layout-migration-v2.model';\nimport {MPerspectiveLayoutV3} from './model/workbench-layout-migration-v3.model';\nimport {WorkbenchMigration} from '../../migration/workbench-migration';\n\n/**\n * Migrates the workbench layout from version 2 to version 3.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchLayoutMigrationV3 implements WorkbenchMigration {\n\n  public migrate(json: string): string {\n    const perspectiveLayoutV2 = JSON.parse(json) as MPerspectiveLayoutV2;\n    const perspectiveLayoutV3: MPerspectiveLayoutV3 = {\n      userLayout: {\n        workbenchGrid: perspectiveLayoutV2.userLayout.workbenchGrid,\n        outlets: perspectiveLayoutV2.userLayout.viewOutlets,\n      },\n      referenceLayout: {\n        workbenchGrid: perspectiveLayoutV2.referenceLayout.workbenchGrid,\n        outlets: perspectiveLayoutV2.referenceLayout.viewOutlets,\n      },\n    };\n    return JSON.stringify(perspectiveLayoutV3);\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {MPerspectiveLayoutV3} from './model/workbench-layout-migration-v3.model';\nimport {WorkbenchMigration} from '../../migration/workbench-migration';\nimport {MWorkbenchLayoutV4} from './model/workbench-layout-migration-v4.model';\n\n/**\n * Migrates the workbench layout from version 3 to version 4.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchLayoutMigrationV4 implements WorkbenchMigration {\n\n  public migrate(json: string): string {\n    const perspectiveLayoutV3 = JSON.parse(json) as MPerspectiveLayoutV3;\n    const workbenchLayoutV4: MWorkbenchLayoutV4 = {\n      userLayout: {\n        grids: {\n          main: perspectiveLayoutV3.userLayout.workbenchGrid,\n        },\n        outlets: perspectiveLayoutV3.userLayout.outlets,\n        activityLayout: undefined!,\n      },\n      referenceLayout: {\n        grids: {\n          main: perspectiveLayoutV3.referenceLayout.workbenchGrid,\n        },\n        outlets: perspectiveLayoutV3.referenceLayout.outlets,\n        activityLayout: undefined!,\n      },\n    };\n    return JSON.stringify(workbenchLayoutV4);\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, Injector} from '@angular/core';\nimport {WorkbenchMigration} from '../../migration/workbench-migration';\nimport {MWorkbenchLayoutV4} from './model/workbench-layout-migration-v4.model';\nimport {MWorkbenchLayoutV5} from './model/workbench-layout-migration-v5.model';\nimport {ɵWorkbenchLayoutFactory} from '../ɵworkbench-layout.factory';\nimport {UID} from '../../common/uid.util';\nimport {WorkbenchLayoutSerializer} from '../workbench-layout-serializer.service';\n\n/**\n * Migrates the workbench layout from version 4 to version 5.\n *\n * Migrates sequential view identifiers to \"random\" view identifiers and renames associated outlets.\n *\n * This migrator is required for views in the peripheral area not to collide with views in the main area.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchLayoutMigrationV5 implements WorkbenchMigration {\n\n  private readonly _workbenchLayoutFactory = inject(ɵWorkbenchLayoutFactory);\n  private readonly _injector = inject(Injector);\n\n  public migrate(json: string): string {\n    const workbenchLayoutV4 = JSON.parse(json) as MWorkbenchLayoutV4;\n    const sequentialViewFormat = /^view\\.\\d+$/;\n\n    // Migrate user layout.\n    let userLayoutV4 = this._workbenchLayoutFactory.create({\n      grids: workbenchLayoutV4.userLayout.grids,\n      activityLayout: workbenchLayoutV4.userLayout.activityLayout,\n      outlets: workbenchLayoutV4.userLayout.outlets,\n    });\n\n    // Rename sequential view identifiers to \"random\" view identifiers.\n    userLayoutV4.views().forEach(view => {\n      if (sequentialViewFormat.test(view.id)) {\n        userLayoutV4 = userLayoutV4.renameView(view.id, `view.${UID.randomUID()}`);\n      }\n    });\n\n    // Migrate reference layout.\n    let referenceLayoutV4 = this._workbenchLayoutFactory.create({\n      grids: workbenchLayoutV4.referenceLayout.grids,\n      activityLayout: workbenchLayoutV4.referenceLayout.activityLayout,\n      outlets: workbenchLayoutV4.referenceLayout.outlets,\n    });\n\n    // Rename sequential view identifiers to \"random\" view identifiers.\n    referenceLayoutV4.views().forEach(view => {\n      if (sequentialViewFormat.test(view.id)) {\n        referenceLayoutV4 = referenceLayoutV4.renameView(view.id, `view.${UID.randomUID()}`);\n      }\n    });\n\n    const workbenchSerializer = this._injector.get(WorkbenchLayoutSerializer);\n    const workbenchLayoutV5: MWorkbenchLayoutV5 = {\n      userLayout: {\n        grids: workbenchSerializer.serializeGrids(userLayoutV4.grids),\n        activityLayout: workbenchSerializer.serializeActivityLayout(userLayoutV4.activityLayout),\n        outlets: workbenchSerializer.serializeOutlets(userLayoutV4.outlets({mainGrid: true, activityGrids: true})),\n      },\n      referenceLayout: {\n        grids: workbenchSerializer.serializeGrids(referenceLayoutV4.grids),\n        activityLayout: workbenchSerializer.serializeActivityLayout(referenceLayoutV4.activityLayout),\n        outlets: workbenchSerializer.serializeOutlets(referenceLayoutV4.outlets({mainGrid: true, activityGrids: true})),\n      },\n    };\n    return JSON.stringify(workbenchLayoutV5);\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, Injector, runInInjectionContext} from '@angular/core';\nimport {WorkbenchMigration} from '../../migration/workbench-migration';\nimport {MWorkbenchLayoutV5} from './model/workbench-layout-migration-v5.model';\nimport {WorkbenchLayoutSerializer} from '../workbench-layout-serializer.service';\nimport {MWorkbenchLayoutV6} from './model/workbench-layout-migration-v6.model';\nimport {MActivity} from '../../activity/workbench-activity.model';\nimport {ActivityId, PartId} from '../../workbench.identifiers';\n\n/**\n * Migrates the workbench layout from version 5 to version 6.\n *\n * Moves the `referencePartId` property from `MActivity` to `MPartGrid`.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchLayoutMigrationV6 implements WorkbenchMigration {\n\n  private readonly _injector = inject(Injector);\n\n  public migrate(json: string): string {\n    const workbenchLayoutV5 = JSON.parse(json) as MWorkbenchLayoutV5;\n\n    const workbenchLayoutV6: MWorkbenchLayoutV6 = runInInjectionContext(this._injector, () => ({\n      userLayout: this.migrateLayout(workbenchLayoutV5.userLayout),\n      referenceLayout: this.migrateLayout(workbenchLayoutV5.referenceLayout),\n    }));\n    return JSON.stringify(workbenchLayoutV6);\n  }\n\n  private migrateLayout(layoutV5: MWorkbenchLayoutV5['referenceLayout'] | MWorkbenchLayoutV5['userLayout']): MWorkbenchLayoutV6['referenceLayout'] | MWorkbenchLayoutV6['userLayout'] {\n    const activityLayout = inject(WorkbenchLayoutSerializer).deserializeActivityLayout(layoutV5.activityLayout);\n    const activities = [\n      ...activityLayout.toolbars.leftTop.activities,\n      ...activityLayout.toolbars.leftBottom.activities,\n      ...activityLayout.toolbars.rightTop.activities,\n      ...activityLayout.toolbars.rightBottom.activities,\n      ...activityLayout.toolbars.bottomLeft.activities,\n      ...activityLayout.toolbars.bottomRight.activities,\n    ];\n    const activityGrids = new Map<ActivityId, string>();\n\n    // Move `referencePartId` property from `MActivity` to `MPartGrid`.\n    activities.forEach((activity: (MActivity & {referencePartId?: PartId})) => {\n      // Add `referencePartId` to `MPartGrid`.\n      activityGrids.set(activity.id, this.migrateGrid(layoutV5.grids[activity.id]!, activity.referencePartId!));\n      // Remove `referencePartId` from `MActivity`.\n      delete activity.referencePartId;\n    });\n\n    return {\n      activityLayout: inject(WorkbenchLayoutSerializer).serializeActivityLayout(activityLayout),\n      grids: {...layoutV5.grids, ...Object.fromEntries(activityGrids)},\n      outlets: layoutV5.outlets,\n    };\n  }\n\n  private migrateGrid(serializedGrid: string, referencePartId: PartId): string {\n    const grid = inject(WorkbenchLayoutSerializer).deserializeGrid(serializedGrid);\n    grid.referencePartId = referencePartId;\n    return inject(WorkbenchLayoutSerializer).serializeGrid(grid);\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable} from '@angular/core';\nimport {MPart, MPartGrid, MTreeNode, WorkbenchGrids} from './workbench-grid.model';\nimport {Outlets} from '../routing/routing.model';\nimport {UrlSegment} from '@angular/router';\nimport {WorkbenchMigrator} from '../migration/workbench-migrator';\nimport {WorkbenchGridMigrationV3} from './migration/workbench-grid-migration-v3.service';\nimport {WorkbenchGridMigrationV4} from './migration/workbench-grid-migration-v4.service';\nimport {WorkbenchGridMigrationV5} from './migration/workbench-grid-migration-v5.service';\nimport {WorkbenchGridMigrationV6} from './migration/workbench-grid-migration-v6.service';\nimport {Exclusion, stringify} from './stringifier';\nimport {WorkbenchOutlet} from '../workbench.identifiers';\nimport {WorkbenchGridMigrationV7} from './migration/workbench-grid-migration-v7.service';\nimport {MActivityLayout} from '../activity/workbench-activity.model';\nimport {WorkbenchLayoutMigrationV2} from './migration/workbench-layout-migration-v2.service';\nimport {WorkbenchLayoutMigrationV3} from './migration/workbench-layout-migration-v3.service';\nimport {WorkbenchLayoutMigrationV4} from './migration/workbench-layout-migration-v4.service';\nimport {WorkbenchLayoutMigrationV5} from './migration/workbench-layout-migration-v5.service';\nimport {MAIN_AREA, MWorkbenchLayout} from './workbench-layout';\nimport {WorkbenchLayouts} from './workbench-layouts.util';\nimport {WorkbenchLayoutMigrationV6} from './migration/workbench-layout-migration-v6.service';\nimport {throwError} from '../common/throw-error.util';\nimport {Objects} from '@scion/toolkit/util';\n\n/**\n * Represents the current version of the workbench layout.\n *\n * Increment this version and write a migrator when introducing a breaking layout model change.\n *\n * @see WorkbenchMigrator\n */\nconst WORKBENCH_LAYOUT_VERSION = 6;\n\n/**\n * Represents the current version of the workbench grid model.\n *\n * Increment this version and write a migrator when introducing a breaking grid model change.\n *\n * @see WorkbenchMigrator\n */\nconst WORKBENCH_GRID_VERSION = 7;\n\n/**\n * Represents the current version of the workbench activity model.\n *\n * Increment this version and write a migrator when introducing a breaking activity model change.\n *\n * @see WorkbenchMigrator\n */\nconst WORKBENCH_ACTIVITY_LAYOUT_VERSION = 1;\n\n/**\n * Serializes and deserializes a base64-encoded JSON into a {@link MPartGrid}.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchLayoutSerializer {\n\n  /**\n   * Migrates a serialized {@link MWorkbenchLayout} to the latest version.\n   */\n  private _workbenchLayoutMigrator = new WorkbenchMigrator()\n    .registerMigration(1, inject(WorkbenchLayoutMigrationV2))\n    .registerMigration(2, inject(WorkbenchLayoutMigrationV3))\n    .registerMigration(3, inject(WorkbenchLayoutMigrationV4))\n    .registerMigration(4, inject(WorkbenchLayoutMigrationV5))\n    .registerMigration(5, inject(WorkbenchLayoutMigrationV6));\n\n  /**\n   * Migrates a serialized {@link MPartGrid} to the latest version.\n   */\n  private _workbenchGridMigrator = new WorkbenchMigrator()\n    .registerMigration(2, inject(WorkbenchGridMigrationV3))\n    .registerMigration(3, inject(WorkbenchGridMigrationV4))\n    .registerMigration(4, inject(WorkbenchGridMigrationV5))\n    .registerMigration(5, inject(WorkbenchGridMigrationV6))\n    .registerMigration(6, inject(WorkbenchGridMigrationV7));\n\n  /**\n   * Migrates a serialized {@link MActivityLayout} to the latest version.\n   */\n  private _workbenchActivityLayoutMigrator = new WorkbenchMigrator();\n\n  /**\n   * Serializes the given workbench layout into a URL-safe base64 string.\n   */\n  public serialize(data: MWorkbenchLayout): string {\n    const json = JSON.stringify(data);\n    return window.btoa(appendVersion(json, WORKBENCH_LAYOUT_VERSION));\n  }\n\n  /**\n   * Deserializes the given base64-serialized workbench layout, applying necessary migrations if the serialized layout is outdated.\n   */\n  public deserialize(serialized: string | null | undefined): MWorkbenchLayout | null {\n    if (!serialized?.length) {\n      return null;\n    }\n\n    const {json, version} = parseVersion(window.atob(serialized));\n    const migrated = this._workbenchLayoutMigrator.migrate(json, {from: version, to: WORKBENCH_LAYOUT_VERSION});\n    return JSON.parse(migrated) as MWorkbenchLayout;\n  }\n\n  /**\n   * Serializes given grid into a URL-safe base64 string.\n   *\n   * @param grid - Specifies the grid to serialize.\n   * @param flags - Controls how to serialize the grids.\n   */\n  public serializeGrid(grid: MPartGrid, flags?: LayoutSerializationFlags): string {\n    const json = stringify(grid, {\n      exclusions: new Array<string | Exclusion>()\n        .concat('**/parent')\n        .concat('migrated')\n        .concat('**/visible') // computed when deserializing the grid\n        .concat(flags?.excludeTreeNodeId ? ({path: '**/id', predicate: context => context.at(-1) instanceof MTreeNode}) : [])\n        .concat(flags?.excludeViewMarkedForRemoval ? '**/views/*/markedForRemoval' : [])\n        .concat(flags?.excludeViewNavigationId ? '**/views/*/navigation/id' : [])\n        .concat(flags?.excludePartNavigationId ? ({path: '**/navigation/id', predicate: context => context.at(-2) instanceof MPart}) : [])\n        .concat(flags?.excludeViewActivationInstant ? '**/views/*/activationInstant' : [])\n        .concat(flags?.excludePartActivationInstant ? ({path: '**/activationInstant', predicate: context => context.at(-1) instanceof MPart}) : []),\n      sort: flags?.sort,\n    });\n    return window.btoa(appendVersion(json, WORKBENCH_GRID_VERSION));\n  }\n\n  /**\n   * Serializes given grids into a URL-safe base64 string.\n   *\n   * @param grids - Specifies the grids to serialize.\n   * @param flags - Controls how to serialize the grids.\n   */\n  public serializeGrids(grids: WorkbenchGrids, flags?: LayoutSerializationFlags): WorkbenchGrids<string> {\n    return Objects.entries(grids).reduce((acc, [gridName, grid]) => {\n      acc[gridName] = this.serializeGrid(grid, flags);\n      return acc;\n    }, {} as WorkbenchGrids<string>);\n  }\n\n  /**\n   * Deserializes the given base64-serialized grid, applying necessary migrations if the serialized grid is outdated.\n   */\n  public deserializeGrid(serialized: string): MPartGrid {\n    const {json, version} = parseVersion(window.atob(serialized));\n    const migratedJsonGrid = this._workbenchGridMigrator.migrate(json, {from: version, to: WORKBENCH_GRID_VERSION});\n\n    // Parse the JSON.\n    const grid = JSON.parse(migratedJsonGrid, (key: string, value: unknown) => {\n      if (MPart.isMPart(value)) {\n        const mPart = new MPart(value); // create a class object from the object literal\n        // Compute part visibility.\n        mPart.visible = value.id === MAIN_AREA || value.views.length > 0 || !!value.navigation;\n        return mPart;\n      }\n      if (MTreeNode.isMTreeNode(value)) {\n        const mTreeNode = new MTreeNode(value); // create a class object from the object literal\n        // Compute node visibility.\n        const child1Visible = value.child1.visible ?? throwError(`[GridDeserializeError] Missing required property 'visible' [elementId=${value.child1.id}]`);\n        const child2Visible = value.child2.visible ?? throwError(`[GridDeserializeError] Missing required property 'visible' [elementId=${value.child2.id}]`);\n        mTreeNode.visible = child1Visible || child2Visible;\n        return mTreeNode;\n      }\n      return value;\n    }) as MPartGrid;\n\n    // Link parent tree nodes\n    (function linkParentNodes(node: MTreeNode | MPart, parent: MTreeNode | undefined): void {\n      node.parent = parent;\n\n      if (node instanceof MTreeNode) {\n        linkParentNodes(node.child1, node);\n        linkParentNodes(node.child2, node);\n      }\n    })(grid.root, undefined);\n\n    // If the grid is not visible, mark the reference part, if any, and its parent nodes as visible.\n    if (!grid.root.visible) {\n      const referencePart = WorkbenchLayouts.findPart(grid.root, part => part.id === grid.referencePartId);\n      if (referencePart) {\n        referencePart.visible = true;\n        let parent = referencePart.parent;\n        while (parent) {\n          parent.visible = true;\n          parent = parent.parent;\n        }\n      }\n    }\n\n    return grid;\n  }\n\n  /**\n   * Serializes given activity layout into a URL-safe base64 string.\n   *\n   * @param layout - Specifies the activity layout to serialize.\n   * @param flags - Controls how to serialize the activity layout.\n   */\n  public serializeActivityLayout(layout: MActivityLayout, flags?: LayoutSerializationFlags): string;\n  public serializeActivityLayout(layout: MActivityLayout | undefined, flags?: LayoutSerializationFlags): string | undefined;\n  public serializeActivityLayout(layout: MActivityLayout | undefined, flags?: LayoutSerializationFlags): string | undefined {\n    if (layout === undefined) {\n      return undefined;\n    }\n\n    const json = stringify(layout, {\n      sort: flags?.sort,\n    });\n    return window.btoa(appendVersion(json, WORKBENCH_ACTIVITY_LAYOUT_VERSION));\n  }\n\n  /**\n   * Deserializes the given base64-serialized activity layout, applying necessary migrations if the serialized layout is outdated.\n   */\n  public deserializeActivityLayout(serialized: string): MActivityLayout {\n    const {json, version} = parseVersion(window.atob(serialized));\n    const migratedJsonLayout = this._workbenchActivityLayoutMigrator.migrate(json, {from: version, to: WORKBENCH_ACTIVITY_LAYOUT_VERSION});\n    return JSON.parse(migratedJsonLayout) as MActivityLayout;\n  }\n\n  /**\n   * Serializes the given outlets.\n   */\n  public serializeOutlets(outlets: Outlets): string {\n    return JSON.stringify(Object.fromEntries(Object.entries(outlets)\n      .map(([outlet, segments]: [string, UrlSegment[]]): [string, MUrlSegment[]] => {\n        return [outlet, segments.map(segment => ({path: segment.path, parameters: segment.parameters}))];\n      })));\n  }\n\n  /**\n   * Deserializes the given outlets.\n   */\n  public deserializeOutlets(serialized: string): Map<WorkbenchOutlet, UrlSegment[]> {\n    const outlets = JSON.parse(serialized) as {[outlet: WorkbenchOutlet]: MUrlSegment[]};\n\n    return new Map(Objects.entries(outlets).map(([outlet, segments]) => {\n      return [outlet, segments.map(segment => new UrlSegment(segment.path, segment.parameters))];\n    }));\n  }\n}\n\n/**\n * Represents a segment in the URL.\n *\n * The M-prefix indicates this object is a model object that is serialized and stored, requiring migration on breaking change.\n */\ninterface MUrlSegment {\n  path: string;\n  parameters: {[name: string]: string};\n}\n\n/**\n * Controls how to serialize the workbench layout.\n */\nexport interface LayoutSerializationFlags {\n  /**\n   * Excludes the node id from the serialization.\n   */\n  excludeTreeNodeId?: true;\n  /**\n   * Excludes views marked for removal from the serialization.\n   */\n  excludeViewMarkedForRemoval?: true;\n  /**\n   * Excludes the view navigation id from the serialization.\n   */\n  excludeViewNavigationId?: true;\n  /**\n   * Excludes the part navigation id from the serialization.\n   */\n  excludePartNavigationId?: true;\n  /**\n   * Excludes the view activation instant from the serialization.\n   */\n  excludeViewActivationInstant?: true;\n  /**\n   * Excludes the part activation instant from the serialization.\n   */\n  excludePartActivationInstant?: true;\n  /**\n   * Assigns each view a stable id based on its position in the grid.\n   *\n   * Stable view identifiers are required to compare the initial grid with the user-modified grid to detect layout changes.\n   */\n  assignStableViewIdentifier?: true;\n  /**\n   * Assigns each part a stable id based on its position in the grid.\n   *\n   * Stable identifiers may be required to compare two layouts for equality.\n   */\n  assignStablePartIdentifier?: true;\n  /**\n   * Assigns each activity a stable id based on its position in the layout.\n   *\n   * Stable identifiers may be required to compare two layouts for equality.\n   */\n  assignStableActivityIdentifier?: true;\n  /**\n   * Controls if to sort the fields of object literals by name. Defaults to `false`.\n   *\n   * Stable sort order may be required to compare two layouts for equality.\n   */\n  sort?: true;\n}\n\n/**\n * Separator between serialized data and its version.\n */\nconst VERSION_SEPARATOR = '//';\n\n/**\n * Regex to extract JSON and version from a versioned string.\n */\nconst VERSION_REGEX = /(?<json>.+)(\\/\\/(?<version>\\d+)?)$/;\n\n/**\n * Adds specified version to the JSON string.\n */\nfunction appendVersion(json: string, version: number): string {\n  return `${json}${VERSION_SEPARATOR}${version}`;\n}\n\n/**\n * Extracts JSON and version from a versioned string.\n */\nfunction parseVersion(versioned: string): {json: string; version: number} {\n  const match = VERSION_REGEX.exec(versioned);\n  if (match) {\n    return {json: match.groups!['json']!, version: +match.groups!['version']!};\n  }\n  return {json: versioned, version: 1}; // not versioned yet\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\n\n/**\n * Set of log levels to control logging output.\n */\nexport enum LogLevel {\n  DEBUG, INFO, WARN, ERROR,\n}\n\n/**\n * Provides information about a message to be logged.\n */\nexport interface LogEvent {\n  /**\n   * Severity of the message.\n   */\n  level: LogLevel;\n  /**\n   * Name of the logger used to log the message.\n   */\n  logger: string;\n  /**\n   * Supplies the message.\n   */\n  messageSupplier: () => string;\n  /**\n   * Arguments as passed to the logger.\n   */\n  args: any[];\n}\n\n/**\n * Delivers log events to a destination, e.g., writing logs to the console.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as used as DI token for the actual appenders. */)\nexport abstract class LogAppender {\n\n  /**\n   * Each message to be logged is passed to this method in the form of a {@link LogEvent} object.\n   */\n  public abstract onLogMessage(event: LogEvent): void;\n}\n\n/**\n * Logger name to be used to log a message.\n *\n * Pass an instance of this class as the first argument to the logger when logging a message.\n */\nexport class LoggerName {\n\n  constructor(private readonly _value: string) {\n  }\n\n  public toString(): string {\n    return this._value;\n  }\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {LogAppender, LogEvent, LogLevel} from './logging.model';\n\n/**\n * Logs messages to the console, if available.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as registered under `LogAppender` DI token. */)\nexport class ConsoleAppender implements LogAppender {\n\n  public onLogMessage(event: LogEvent): void {\n    switch (event.level) {\n      case LogLevel.DEBUG: {\n        console.debug(...[`[${event.logger}] ${event.messageSupplier()}`].concat(event.args));\n        break;\n      }\n      case LogLevel.WARN: {\n        console.warn(...[`[${event.logger}] ${event.messageSupplier()}`].concat(event.args));\n        break;\n      }\n      case LogLevel.ERROR: {\n        console.error(...[`[${event.logger}] ${event.messageSupplier()}`].concat(event.args));\n        break;\n      }\n      default: {\n        console.log(...[`[${event.logger}] ${event.messageSupplier()}`].concat(event.args));\n        break;\n      }\n    }\n  }\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, inject, Injectable, Signal} from '@angular/core';\nimport {NavigationStart, Router} from '@angular/router';\nimport {filter, map, startWith} from 'rxjs/operators';\nimport {LogAppender, LogEvent, LoggerName, LogLevel} from './logging.model';\nimport {Logger} from './logger';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {WorkbenchConfig} from '../workbench-config';\n\n@Injectable(/* DO NOT provide via 'providedIn' metadata as registered under `Logger` DI token. */)\nexport class ɵLogger implements Logger {\n\n  // TODO [Angular 22] Remove cast when Angular supports type safety for multi-injection with abstract class DI tokens. See https://github.com/angular/angular/issues/55555\n  private readonly _logAppenders = inject(LogAppender, {optional: true}) as LogAppender[] | null ?? [];\n  private readonly _logLevel: Signal<LogLevel>;\n\n  constructor() {\n    const defaultLogLevel = inject(WorkbenchConfig, {optional: true})?.logging?.logLevel ?? LogLevel.INFO;\n    const logLevel = queryParam('loglevel');\n    this._logLevel = computed(() => parseLogLevel(logLevel()) ?? defaultLogLevel);\n  }\n\n  /** @inheritDoc */\n  public get logLevel(): LogLevel {\n    return this._logLevel();\n  }\n\n  /** @inheritDoc */\n  public debug(message: string | (() => string), ...args: any[]): void {\n    this.log(coerceLogEvent(LogLevel.DEBUG, message, args));\n  }\n\n  /** @inheritDoc */\n  public info(message: string | (() => string), ...args: any[]): void {\n    this.log(coerceLogEvent(LogLevel.INFO, message, args));\n  }\n\n  /** @inheritDoc */\n  public warn(message: string | (() => string), ...args: any[]): void {\n    this.log(coerceLogEvent(LogLevel.WARN, message, args));\n  }\n\n  /** @inheritDoc */\n  public error(message: string | (() => string), ...args: any[]): void {\n    this.log(coerceLogEvent(LogLevel.ERROR, message, args));\n  }\n\n  private log(event: LogEvent): void {\n    if (!this._logAppenders.length) {\n      return;\n    }\n\n    if (event.level < this.logLevel) {\n      return;\n    }\n\n    this._logAppenders.forEach(logAppender => logAppender.onLogMessage(event));\n  }\n}\n\n/**\n * Reads the specified query parameter from the URL.\n */\nfunction queryParam(queryParam: string): Signal<string | null> {\n  const router = inject(Router);\n  const queryParam$ = router.events\n    .pipe(\n      filter(event => event instanceof NavigationStart),\n      map(event => event.url),\n      startWith(router.url),\n      map(url => router.parseUrl(url).queryParamMap.get(queryParam)),\n    );\n  return toSignal(queryParam$, {requireSync: true});\n}\n\n/**\n * Parses the given log level string into a {@link LogLevel} enum.\n */\nfunction parseLogLevel(logLevel: string | null): LogLevel | undefined {\n  return logLevel ? LogLevel[logLevel.toUpperCase() as keyof typeof LogLevel] as LogLevel | undefined : undefined;\n}\n\n/**\n * Coerces the given arguments to a {@link LogEvent}.\n */\nfunction coerceLogEvent(level: LogLevel, message: string | (() => string), args: any[]): LogEvent {\n  const messageSupplier: () => string = typeof message === 'function' ? message : () => message;\n  if (args[0] instanceof LoggerName) {\n    return {level, messageSupplier, logger: args[0].toString(), args: args.slice(1)};\n  }\n  return {level, messageSupplier, logger: 'workbench', args};\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {LoggerName, LogLevel} from './logging.model';\nimport {ɵLogger} from './ɵlogger';\n\n/**\n * Logger used by the workbench to log messages.\n *\n * Log messages are passed to registered log appenders in the form of log events for delivery to a destination.\n *\n * When configuring the workbench, you can register one or more log appenders and specify the minimum severity\n * level a message must have in order to be logged. At runtime, you can change the minimum required log level\n * by setting the `loglevel` query parameter. For example, to log messages with debug severity or higher, set\n * the query parameters as follows: `loglevel=debug`.\n *\n * By default, if not registering a log appender, the workbench registers a console log appender. The default\n * minimal required log level is set to {@link LogLevel#INFO}.\n *\n * @see {@link LogAppender}\n */\n@Injectable({providedIn: 'root', useClass: ɵLogger})\nexport abstract class Logger {\n\n  /**\n   * Log level of the workbench logger.\n   */\n  public abstract readonly logLevel: LogLevel;\n\n  /**\n   * Logs a message with debug severity.\n   *\n   * For messages that are expensive to compose, you can provide a message supplier function.\n   * The logger will call this function only if at least `DEBUG` log level is enabled.\n   *\n   * Optionally, you can pass the logger name as the first argument in the `args` list. The log message\n   * will then be prefixed with that logger name. Logger names must be instances of {@link LoggerName}.\n   */\n  public abstract debug(message: string | (() => string), ...args: any[]): void;\n  public abstract debug(message: string | (() => string), loggerName: LoggerName, ...args: any[]): void;\n\n  /**\n   * Logs a message with info severity.\n   *\n   * For messages that are expensive to compose, you can provide a message supplier function.\n   * The logger will call this function only if at least `INFO` log level is enabled.\n   *\n   * Optionally, you can pass the logger name as the first argument in the `args` list. The log message\n   * will then be prefixed with that logger name. Logger names must be instances of {@link LoggerName}.\n   */\n  public abstract info(message: string | (() => string), ...args: any[]): void;\n  public abstract info(message: string | (() => string), loggerName: LoggerName, ...args: any[]): void;\n\n  /**\n   * Logs a message with warn severity.\n   *\n   * For messages that are expensive to compose, you can provide a message supplier function.\n   * The logger will call this function only if at least `WARN` log level is enabled.\n   *\n   * Optionally, you can pass the logger name as the first argument in the `args` list. The log message\n   * will then be prefixed with that logger name. Logger names must be instances of {@link LoggerName}.\n   */\n  public abstract warn(message: string | (() => string), ...args: any[]): void;\n  public abstract warn(message: string | (() => string), loggerName: LoggerName, ...args: any[]): void;\n\n  /**\n   * Logs a message with error severity.\n   *\n   * For messages that are expensive to compose, you can provide a message supplier function.\n   * The logger will call this function only if at least `ERROR` log level is enabled.\n   *\n   * Optionally, you can pass the logger name as the first argument in the `args` list. The log message\n   * will then be prefixed with that logger name. Logger names must be instances of {@link LoggerName}.\n   */\n  public abstract error(message: string | (() => string), ...args: any[]): void;\n  public abstract error(message: string | (() => string), loggerName: LoggerName, ...args: any[]): void;\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {LoggerName} from './logging.model';\n\n/**\n * Enumerates logger names used by the workbench.\n */\nexport const LoggerNames = {\n\n  /**\n   * Use this logger name to log messages related to workbench routing.\n   */\n  ROUTING: new LoggerName('workbench:router'),\n\n  /**\n   * Use this logger name to log messages related to the workbench lifecycle.\n   */\n  LIFECYCLE: new LoggerName('workbench:lifecycle'),\n\n  /**\n   * Use this logger name to log messages related to the microfrontend integration.\n   */\n  MICROFRONTEND: new LoggerName('workbench:microfrontend'),\n\n  /**\n   * Use this logger name to log messages related to the microfrontend routing.\n   */\n  MICROFRONTEND_ROUTING: new LoggerName('workbench:microfrontend/routing'),\n} as const;\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, makeEnvironmentProviders, Provider, Type} from '@angular/core';\nimport {WorkbenchConfig} from '../workbench-config';\nimport {LogAppender} from './logging.model';\nimport {ConsoleAppender} from './console-appender.service';\n\n/**\n * Provides a set of DI providers for installing workbench logging.\n */\nexport function provideLogging(workbenchConfig: WorkbenchConfig): EnvironmentProviders {\n  const logAppenders: Type<LogAppender>[] = workbenchConfig.logging?.logAppenders ?? [ConsoleAppender];\n  return makeEnvironmentProviders([\n    logAppenders.map((logAppender: Type<LogAppender>): Provider => ({\n      provide: LogAppender,\n      multi: true,\n      useClass: logAppender,\n    })),\n  ]);\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport * from './console-appender.service';\nexport * from './logging.model';\nexport * from './logger';\nexport * from './logger-names';\nexport * from './logging-support';\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ActivityId} from '../workbench.identifiers';\nimport {Translatable} from '../text/workbench-text-provider.model';\n\n/**\n * Defines the arrangement of docked parts (also referred to as activities) in the workbench.\n *\n * Docked parts can be minimized to create more space for the main content.\n *\n * A part can be docked to the left, right, or bottom side of the workbench.\n * Each side has two docking areas: `left-top` and `left-bottom`, `right-top` and `right-bottom`, and `bottom-left` and `bottom-right`.\n * Parts added to the same area are stacked, with only one part active per stack. If there is an active part in both stacks of a side,\n * the two parts are split vertically or horizontally, depending on the side.\n *\n * A docked part may be navigated to display content, have views, or define a layout with multiple parts aligned relative to each other.\n *\n * The M-prefix indicates this object is a model object that is serialized and stored, requiring migration on breaking change.\n */\nexport interface MActivityLayout {\n  toolbars: {\n    leftTop: MActivityStack;\n    leftBottom: MActivityStack;\n    rightTop: MActivityStack;\n    rightBottom: MActivityStack;\n    bottomLeft: MActivityStack;\n    bottomRight: MActivityStack;\n  };\n  panels: {\n    left: {\n      width: number;\n      ratio: number;\n    };\n    right: {\n      width: number;\n      ratio: number;\n    };\n    bottom: {\n      height: number;\n      ratio: number;\n    };\n  };\n}\n\n/**\n * Stack of activities in a docking area.\n *\n * The M-prefix indicates this object is a model object that is serialized and stored, requiring migration on breaking change.\n */\nexport interface MActivityStack {\n  /**\n   * List of activities in the stack.\n   */\n  activities: MActivity[];\n  /**\n   * Reference to the currently active activity in the stack.\n   */\n  activeActivityId?: ActivityId;\n  /**\n   * Reference to the activity that was active prior to minimization, used to restore the active activity when exiting minimization mode.\n   */\n  minimizedActivityId?: ActivityId;\n}\n\n/**\n * Represents an activity docked to a side of the workbench.\n *\n * The M-prefix indicates this object is a model object that is serialized and stored, requiring migration on breaking change.\n */\nexport interface MActivity {\n  /** @see DockedPartExtras#ɵactivityId */\n  id: ActivityId;\n  /** @see DockedPartExtras#icon */\n  icon: string;\n  /** @see DockedPartExtras#label */\n  label: Translatable;\n  /** @see DockedPartExtras#tooltip */\n  tooltip?: Translatable;\n  /** @see DockedPartExtras#cssClass */\n  cssClass?: string | string[];\n}\n\n/**\n * Specifies the default width of the left and right activity panels.\n *\n * Used as the default width if the design tokens '--sci-workbench-layout-panel-left-width' or '--sci-workbench-layout-panel-right-width' are not set.\n */\nexport const ACTIVITY_PANEL_WIDTH = 300;\n\n/**\n * Specifies the default height of the bottom activity panel.\n *\n * Used as the default height if the design token '--sci-workbench-layout-panel-bottom-height' is not set.\n */\nexport const ACTIVITY_PANEL_HEIGHT = 250;\n\n/**\n * Specifies the default split ratio of the activity panels.\n */\nexport const ACTIVITY_PANEL_RATIO = .5;\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\n\n/**\n * Provides instants for the activation of workbench components like parts or views.\n *\n * Two consecutive calls always have different instants, in ascending order.\n */\n@Injectable({providedIn: 'root'})\nexport class ActivationInstantProvider {\n\n  private _origin = Date.now();\n\n  /**\n   * Provides the next instant.\n   */\n  public next(): number {\n    return ++this._origin;\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/**\n * Mutates the passed object by recursively deleting `undefined` properties, optionally also pruning empty objects.\n *\n * By default, empty objects are retained.\n *\n * @returns Pruned object or `undefined` depending on options.\n */\nexport function prune<T>(object: T): T;\nexport function prune<T>(object: T, options: {pruneIfEmpty: true}): T | undefined;\nexport function prune<T>(object: T, options?: {pruneIfEmpty: boolean}): T | undefined;\nexport function prune<T>(object: T, options?: {pruneIfEmpty: boolean}): T | undefined {\n  const pruneIfEmpty = options?.pruneIfEmpty ?? false;\n\n  if (object === null || object instanceof Map || object instanceof Set || Array.isArray(object)) {\n    return object;\n  }\n\n  if (typeof object === 'object') {\n    Object.entries(object).forEach(([key, value]) => {\n      if (prune(value, {pruneIfEmpty}) === undefined) {\n        delete (object as Record<string, unknown>)[key]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n      }\n    });\n    if (!Object.keys(object).length && pruneIfEmpty) {\n      return undefined;\n    }\n  }\n  return object;\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {MPart, MPartGrid, MTreeNode, MView, WorkbenchGrids} from './workbench-grid.model';\nimport {UID} from '../common/uid.util';\nimport {DockedPartExtras, DockingArea, MAIN_AREA, MAIN_AREA_ALTERNATIVE_ID, PartExtras, ReferencePart, WorkbenchLayout} from './workbench-layout';\nimport {LayoutSerializationFlags, WorkbenchLayoutSerializer} from './workbench-layout-serializer.service';\nimport {DOCUMENT, inject, InjectionToken, Injector, runInInjectionContext} from '@angular/core';\nimport {Routing} from '../routing/routing.util';\nimport {Commands, NavigationData, NavigationState, NavigationStates, Outlets} from '../routing/routing.model';\nimport {ActivatedRoute, UrlSegment} from '@angular/router';\nimport {ACTIVITY_ID_PREFIX, ActivityId, computeActivityId, computePartId, computeViewId, isPartId, isViewId, PART_ID_PREFIX, PartId, VIEW_ID_PREFIX, ViewId, WorkbenchOutlet} from '../workbench.identifiers';\nimport {Arrays, Objects} from '@scion/toolkit/util';\nimport {UrlSegmentMatcher} from '../routing/url-segment-matcher';\nimport {WorkbenchLayouts} from './workbench-layouts.util';\nimport {Logger} from '../logging';\nimport {ACTIVITY_PANEL_HEIGHT, ACTIVITY_PANEL_RATIO, ACTIVITY_PANEL_WIDTH, MActivity, MActivityLayout, MActivityStack} from '../activity/workbench-activity.model';\nimport {RequireOne} from '../common/utility-types';\nimport {readCssVariable} from '../common/dom.util';\nimport {ActivationInstantProvider} from '../activation-instant.provider';\nimport {prune} from '../common/prune.util';\n\n/**\n * @inheritDoc\n *\n * IMPORTANT: Methods starting with an underscore indicate they are not working on a working copy, but modifying the layout instance.\n */\nexport class ɵWorkbenchLayout implements WorkbenchLayout {\n\n  private readonly _grids: WorkbenchGrids;\n  private readonly _activityLayout: MActivityLayout;\n  private readonly _outlets: Map<WorkbenchOutlet, UrlSegment[]>;\n  private readonly _navigationStates: Map<WorkbenchOutlet, NavigationState>;\n  private readonly _instantProvider = inject(ActivationInstantProvider);\n  private readonly _workbenchLayoutSerializer = inject(WorkbenchLayoutSerializer);\n  private readonly _injector = inject(Injector);\n\n  /** Identifies the perspective of this layout, if any. */\n  public readonly perspectiveId: string | undefined;\n\n  /**\n   * Creates a workbench layout based on given config.\n   *\n   * @see WorkbenchLayoutConstructConfig\n   */\n  constructor(config?: WorkbenchLayoutConstructConfig) {\n    ({activityLayout: this._activityLayout, grids: this._grids, outlets: this._outlets} = deserializeLayout(config));\n    this._navigationStates = new Map(Objects.entries(config?.navigationStates ?? {}));\n    this.perspectiveId = config?.perspectiveId;\n    this.assertGrids();\n    this.assertActivities();\n  }\n\n  public get activityLayout(): MActivityLayout {\n    return this._activityLayout;\n  }\n\n  public get grids(): WorkbenchGrids {\n    return this._grids;\n  }\n\n  /**\n   * Tests if given activity is contained in this layout.\n   */\n  public hasActivity(id: ActivityId): boolean {\n    return this.activities({id}).length > 0;\n  }\n\n  /**\n   * Indicates if this layout contains activities.\n   */\n  public hasActivities(): boolean {\n    return this.activities().length > 0;\n  }\n\n  /** @inheritDoc */\n  public hasPart(id: string, options?: {grid?: keyof WorkbenchGrids}): boolean {\n    return this.parts({id, grid: options?.grid}).length > 0;\n  }\n\n  /** @inheritDoc */\n  public hasView(id: string, options?: {grid?: keyof WorkbenchGrids}): boolean {\n    return this.views({id, grid: options?.grid}).length > 0;\n  }\n\n  /**\n   * Finds the URL of outlets based on the specified filter.\n   *\n   * @param selector - Defines the search scope.\n   * @return outlets matching the filter criteria.\n   */\n  public outlets(selector: RequireOne<{mainGrid: true; mainAreaGrid: true; activityGrids: true}>): Outlets {\n    const gridNames = new Array<keyof WorkbenchGrids>()\n      .concat(selector.mainGrid ? 'main' : [])\n      .concat(selector.mainAreaGrid ? 'mainArea' : [])\n      .concat(selector.activityGrids ? Objects.keys(WorkbenchLayouts.pickActivityGrids(this._grids)) : []);\n\n    const partOutlets = this.parts({grid: gridNames}).filter(part => this._outlets.has(part.id)).map<[PartId, UrlSegment[]]>(part => [part.id, this._outlets.get(part.id)!]);\n    const viewOutlets = this.views({grid: gridNames}).filter(view => this._outlets.has(view.id)).map<[ViewId, UrlSegment[]]>(view => [view.id, this._outlets.get(view.id)!]);\n    return Object.fromEntries([...partOutlets, ...viewOutlets]);\n  }\n\n  /**\n   * Finds navigational state based on the specified filter.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.grid - Searches outlets in the specified grid.\n   * @return state matching the filter criteria.\n   */\n  public navigationStates(findBy?: {grid?: keyof WorkbenchGrids}): NavigationStates {\n    const partStates = this.parts({grid: findBy?.grid}).filter(part => this._navigationStates.has(part.id)).map<[PartId, NavigationState]>(part => [part.id, this._navigationStates.get(part.id)!]);\n    const viewStates = this.views({grid: findBy?.grid}).filter(view => this._navigationStates.has(view.id)).map<[ViewId, NavigationState]>(view => [view.id, this._navigationStates.get(view.id)!]);\n    return Object.fromEntries([...partStates, ...viewStates]);\n  }\n\n  /**\n   * Finds the navigational state of specified outlet.\n   */\n  public navigationState(findBy: {outlet: WorkbenchOutlet}): NavigationState {\n    return this._navigationStates.get(findBy.outlet) ?? {};\n  }\n\n  /**\n   * Finds the URL of specified outlet.\n   */\n  public urlSegments(findBy: {outlet: WorkbenchOutlet}): UrlSegment[] {\n    return this._outlets.get(findBy.outlet) ?? [];\n  }\n\n  /**\n   * Maximizes the main content by minimizing activities, or restores activities to the state prior to the last minimization otherwise.\n   *\n   * Has no effect for layouts without activities.\n   *\n   * @return a copy of this layout with the maximization changed.\n   */\n  public toggleMaximized(): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.__toggleMaximized();\n    return workingCopy;\n  }\n\n  /**\n   * Finds activities based on the specified filter.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.id - Searches for activities with the specified id.\n   * @param findBy.active - Searches for activities which are active.\n   * @param findBy.partId - Searches for activities that contain the specified part.\n   * @param findBy.viewId - Searches for activities that contain the specified view.\n   * @param options - Controls the search.\n   * @param options.throwIfEmpty - Controls to error if no activity is found.\n   * @param options.throwIfMulti - Controls to error if multiple activities are found.\n   * @return activities matching the filter criteria.\n   */\n  public activities(findBy: {id?: ActivityId; active?: boolean; partId?: PartId; viewId?: ViewId}, options: {throwIfEmpty: (() => Error) | true; throwIfMulti: (() => Error) | true}): readonly [MActivity];\n  public activities(findBy: {id?: ActivityId; active?: boolean; partId?: PartId; viewId?: ViewId}, options: {throwIfEmpty: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly [MActivity, ...MActivity[]];\n  public activities(findBy?: {id?: ActivityId; active?: boolean; partId?: PartId; viewId?: ViewId}, options?: {throwIfEmpty?: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly MActivity[];\n  public activities(findBy?: {id?: ActivityId; active?: boolean; partId?: PartId; viewId?: ViewId}, options?: {throwIfEmpty?: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly MActivity[] {\n    const activities = this.activityStacks().flatMap(stack => stack.activities.filter(activity => {\n      if (findBy?.id && activity.id !== findBy.id) {\n        return false;\n      }\n      if (findBy?.active !== undefined && (stack.activeActivityId === activity.id) !== findBy.active) {\n        return false;\n      }\n      if (findBy?.partId && !this.part({partId: findBy.partId, grid: activity.id}, {orElse: null})) {\n        return false;\n      }\n      if (findBy?.viewId && !this.part({viewId: findBy.viewId, grid: activity.id}, {orElse: null})) {\n        return false;\n      }\n      return true;\n    }));\n\n    if (options?.throwIfEmpty && !activities.length) {\n      throw typeof options.throwIfEmpty === 'function' ? options.throwIfEmpty() : Error(`[NullActivityError] No matching activity found: [${stringifyFilter(findBy ?? {})}]`);\n    }\n    if (options?.throwIfMulti && activities.length > 1) {\n      throw typeof options.throwIfMulti === 'function' ? options.throwIfMulti() : Error(`[MultiActivityError] Multiple activities found: [${stringifyFilter(findBy ?? {})}]`);\n    }\n    return activities;\n  }\n\n  /**\n   * Finds an activity based on the specified filter. If not found, by default, throws an error unless setting the `orElseNull` option.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.id - Searches for an activity with the specified id.\n   * @param findBy.active - Searches for an activity which is active.\n   * @param findBy.partId - Searches for an activity that contains the specified part.\n   * @param findBy.viewId - Searches for an activity that contains the specified view.\n   * @param options - Controls the search.\n   * @param options.orElse - Controls to return `null` instead of throwing an error if no activity is found.\n   * @return activity matching the filter criteria.\n   */\n  public activity(findBy: RequireOne<{id: ActivityId; active: boolean; partId: PartId; viewId: ViewId}>): MActivity;\n  public activity(findBy: RequireOne<{id: ActivityId; active: boolean; partId: PartId; viewId: ViewId}>, options: {orElse: null}): MActivity | null;\n  public activity(findBy: RequireOne<{id: ActivityId; active: boolean; partId: PartId; viewId: ViewId}>, options?: {orElse: null}): MActivity | null {\n    const [activity] = this.activities({id: findBy.id, active: findBy.active, partId: findBy.partId, viewId: findBy.viewId}, {throwIfMulti: true, throwIfEmpty: options?.orElse === null ? undefined : true});\n    return activity ?? null;\n  }\n\n  /**\n   * Finds activity stacks based on the specified filter.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.activityId - Searches for an activity stack that contains the specified activity.\n   * @param findBy.dockTo - Searches for an activity stack in the specified docking area.\n   * @param findBy.partId - Searches for an activity stack that contains the specified part.\n   * @param findBy.viewId - Searches for an activity stack that contains the specified view.\n   * @param options - Controls the search.\n   * @param options.throwIfEmpty - Controls to error if no activity stack is found.\n   * @param options.throwIfMulti - Controls to error if multiple activity stacks are found.\n   * @return activity stacks matching the filter criteria.\n   */\n  public activityStacks(findBy: {activityId?: ActivityId; dockTo?: DockingArea; partId?: PartId; viewId?: ViewId}, options: {throwIfEmpty: (() => Error) | true; throwIfMulti: (() => Error) | true}): readonly [MActivityStack];\n  public activityStacks(findBy: {activityId?: ActivityId; dockTo?: DockingArea; partId?: PartId; viewId?: ViewId}, options: {throwIfEmpty: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly [MActivityStack, ...MActivityStack[]];\n  public activityStacks(findBy?: {activityId?: ActivityId; dockTo?: DockingArea; partId?: PartId; viewId?: ViewId}, options?: {throwIfEmpty?: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly MActivityStack[];\n  public activityStacks(findBy?: {activityId?: ActivityId; dockTo?: DockingArea; partId?: PartId; viewId?: ViewId}, options?: {throwIfEmpty?: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly MActivityStack[] {\n    const activityStacks = {\n      'left-top': this.activityLayout.toolbars.leftTop,\n      'left-bottom': this.activityLayout.toolbars.leftBottom,\n      'right-top': this.activityLayout.toolbars.rightTop,\n      'right-bottom': this.activityLayout.toolbars.rightBottom,\n      'bottom-left': this.activityLayout.toolbars.bottomLeft,\n      'bottom-right': this.activityLayout.toolbars.bottomRight,\n    };\n\n    const stacks = Objects.entries(activityStacks)\n      .filter(([dockTo, stack]) => {\n        const activities = stack.activities;\n        if (findBy?.dockTo && findBy.dockTo.dockTo !== dockTo) {\n          return false;\n        }\n        if (findBy?.activityId && !activities.some(activity => activity.id === findBy.activityId)) {\n          return false;\n        }\n        if (findBy?.partId && !activities.some(activity => this.hasPart(findBy.partId!, {grid: activity.id}))) {\n          return false;\n        }\n        if (findBy?.viewId && !activities.some(activity => this.hasView(findBy.viewId!, {grid: activity.id}))) {\n          return false;\n        }\n        return true;\n      })\n      .map(([_dockTo, stack]) => stack);\n\n    if (options?.throwIfEmpty && !stacks.length) {\n      throw typeof options.throwIfEmpty === 'function' ? options.throwIfEmpty() : Error(`[NullActivityStackError] No matching activity stack found: [${stringifyFilter(findBy ?? {})}]`);\n    }\n    if (options?.throwIfMulti && stacks.length > 1) {\n      throw typeof options.throwIfMulti === 'function' ? options.throwIfMulti() : Error(`[MultiActivityStackError] Multiple activity stacks found: [${stringifyFilter(findBy ?? {})}]`);\n    }\n    return stacks;\n  }\n\n  /**\n   * Finds an activity stack based on the specified filter. If not found, by default, throws an error unless setting the `orElseNull` option.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.activityId - Searches for an activity stack that contains the specified activity.\n   * @param findBy.dockTo - Searches for an activity stack in the specified docking area.\n   * @param findBy.partId - Searches for an activity stack that contains the specified part.\n   * @param findBy.viewId - Searches for an activity stack that contains the specified view.\n   * @param options - Controls the search.\n   * @param options.orElse - Controls to return `null` instead of throwing an error if no activity stack is found.\n   * @return activity stack matching the filter criteria.\n   */\n  public activityStack(findBy: RequireOne<{activityId: ActivityId; dockTo: DockingArea; partId: PartId; viewId: ViewId}>): MActivityStack;\n  public activityStack(findBy: RequireOne<{activityId: ActivityId; dockTo: DockingArea; partId: PartId; viewId: ViewId}>, options: {orElse: null}): MActivityStack | null;\n  public activityStack(findBy: RequireOne<{activityId: ActivityId; dockTo: DockingArea; partId: PartId; viewId: ViewId}>, options?: {orElse: null}): MActivityStack | null {\n    const [activityStack] = this.activityStacks({activityId: findBy.activityId, dockTo: findBy.dockTo, partId: findBy.partId, viewId: findBy.viewId}, {throwIfMulti: true, throwIfEmpty: options?.orElse === null ? undefined : true});\n    return activityStack ?? null;\n  }\n\n  /**\n   * Toggles the visibility of specified activity.\n   */\n  public toggleActivity(id: ActivityId): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.__toggleActivity(id);\n    return workingCopy;\n  }\n\n  /**\n   * Sets the size of the specified activity panel.\n   */\n  public setActivityPanelSize(panel: 'left' | 'right' | 'bottom', size: number): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.__setActivityPanelSize(panel, size);\n    return workingCopy;\n  }\n\n  /**\n   * Sets the split ratio of two activities displayed in the specified panel.\n   */\n  public setActivityPanelSplitRatio(panel: 'left' | 'right' | 'bottom', ratio: number): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.__setActivityPanelSplitRatio(panel, ratio);\n    return workingCopy;\n  }\n\n  /**\n   * Finds parts based on the specified filter.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.id - Searches for parts with the specified id.\n   * @param findBy.viewId - Searches for parts that contain the specified view.\n   * @param findBy.peripheral - Searches for parts located in or out of the peripheral area.\n   * @param findBy.grid - Searches for parts contained in the specified grid.\n   * @param options - Controls the search.\n   * @param options.throwIfEmpty - Controls to error if no part is found.\n   * @param options.throwIfMulti - Controls to error if multiple parts are found.\n   * @return parts matching the filter criteria.\n   */\n  public parts(findBy: {id?: string; viewId?: string; peripheral?: boolean; grid?: keyof WorkbenchGrids | Array<keyof WorkbenchGrids>}, options: {throwIfEmpty: (() => Error) | true; throwIfMulti: (() => Error) | true}): readonly [MPart];\n  public parts(findBy: {id?: string; viewId?: string; peripheral?: boolean; grid?: keyof WorkbenchGrids | Array<keyof WorkbenchGrids>}, options: {throwIfEmpty: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly [MPart, ...MPart[]];\n  public parts(findBy?: {id?: string; viewId?: string; peripheral?: boolean; grid?: keyof WorkbenchGrids | Array<keyof WorkbenchGrids>}, options?: {throwIfEmpty?: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly MPart[];\n  public parts(findBy?: {id?: string; viewId?: string; peripheral?: boolean; grid?: keyof WorkbenchGrids | Array<keyof WorkbenchGrids>}, options?: {throwIfEmpty?: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly MPart[] {\n    const parts = this.findTreeElements((element: MTreeNode | MPart): element is MPart => {\n      if (!(element instanceof MPart)) {\n        return false;\n      }\n      if (findBy?.id !== undefined && !matchesPartId(findBy.id, element)) {\n        return false;\n      }\n      if (findBy?.viewId !== undefined && !element.views.some(view => matchesViewId(findBy.viewId!, view))) {\n        return false;\n      }\n      if (findBy?.peripheral !== undefined && this.isPeripheralPart(element.id) !== findBy.peripheral) {\n        return false;\n      }\n      return true;\n    }, {grid: findBy?.grid});\n\n    if (options?.throwIfEmpty && !parts.length) {\n      throw typeof options.throwIfEmpty === 'function' ? options.throwIfEmpty() : Error(`[NullPartError] No matching part found: [${stringifyFilter(findBy ?? {})}]`);\n    }\n    if (options?.throwIfMulti && parts.length > 1) {\n      throw typeof options.throwIfMulti === 'function' ? options.throwIfMulti() : Error(`[MultiPartError] Multiple parts found: [${stringifyFilter(findBy ?? {})}]`);\n    }\n    return parts;\n  }\n\n  /**\n   * Finds a part based on the specified filter. If not found, by default, throws an error unless setting the `orElseNull` option.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.partId - Searches for a part with the specified id.\n   * @param findBy.viewId - Searches for a part that contains the specified view.\n   * @param findBy.grid - Searches for a part contained in the specified grid.\n   * @param options - Controls the search.\n   * @param options.orElse - Controls to return `null` instead of throwing an error if no part is found.\n   * @return part matching the filter criteria.\n   */\n  public part(findBy: RequireOne<{partId: PartId; viewId: string}> & {grid?: keyof WorkbenchGrids}): MPart;\n  public part(findBy: RequireOne<{partId: PartId; viewId: string}> & {grid?: keyof WorkbenchGrids}, options: {orElse: null}): MPart | null;\n  public part(findBy: RequireOne<{partId: PartId; viewId: string}> & {grid?: keyof WorkbenchGrids}, options?: {orElse: null}): MPart | null {\n    const [part] = this.parts({id: findBy.partId, viewId: findBy.viewId, grid: findBy.grid}, {throwIfMulti: true, throwIfEmpty: options?.orElse === null ? undefined : true});\n    return part ?? null;\n  }\n\n  /**\n   * @inheritDoc\n   *\n   * @param id - @inheritDoc\n   * @param relativeTo - @inheritDoc\n   * @param extras - @inheritDoc\n   * @param extras.activate - @inheritDoc\n   * @param extras.structural - Specifies if this is a structural part. A structural part will not be removed when removing its last view. Defaults to `true`.\n   */\n  public addPart(id: string | MAIN_AREA, relativeTo: ReferenceElement, extras?: PartExtras & {structural?: boolean}): ɵWorkbenchLayout;\n  public addPart(id: string, dockTo: DockingArea, extras: DockedPartExtras): ɵWorkbenchLayout;\n  public addPart(id: string, reference: ReferencePart | DockingArea, extras?: (PartExtras & {structural?: boolean}) | DockedPartExtras): ɵWorkbenchLayout {\n    const partId = isPartId(id) ? id : (id === MAIN_AREA_ALTERNATIVE_ID ? MAIN_AREA : computePartId());\n    const alternativeId = isPartId(id) ? (id === MAIN_AREA ? MAIN_AREA_ALTERNATIVE_ID : undefined) : id;\n    const workingCopy = this.workingCopy();\n\n    if ('dockTo' in reference) {\n      workingCopy.__addActivity(partId, reference, {...extras, alternativeId} as DockedPartExtras & {alternativeId?: string});\n    }\n    else {\n      workingCopy.__addPart(partId, reference, {...extras, alternativeId} as PartExtras & {alternativeId?: string; structural?: boolean});\n    }\n    return workingCopy;\n  }\n\n  /** @inheritDoc */\n  public removePart(id: string): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.parts({id}, {throwIfEmpty: true}).forEach(part => workingCopy.__removePart(part));\n    return workingCopy;\n  }\n\n  /**\n   * Renames a part.\n   *\n   * @param id - Identifies the part to rename.\n   * @param newPartId - The new identity of the part.\n   * @return a copy of this layout with the part renamed.\n   */\n  public renamePart(id: PartId, newPartId: PartId): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.__renamePart(workingCopy.part({partId: id}), newPartId);\n    return workingCopy;\n  }\n\n  /** @inheritDoc */\n  public navigatePart(id: string, commands: Commands, extras?: {hint?: string; relativeTo?: ActivatedRoute | null; data?: NavigationData; state?: NavigationState; cssClass?: string | string[]}): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.parts({id}, {throwIfEmpty: true}).forEach(part => workingCopy.__navigatePart(part, commands, extras));\n    return workingCopy;\n  }\n\n  /**\n   * Returns the active part of the specified grid, or `null` if specified grid is not present.\n   */\n  public activePart(find: {grid: 'main' | 'mainArea'}): Readonly<MPart>;\n  public activePart(find: {grid: keyof WorkbenchGrids}): Readonly<MPart> | null;\n  public activePart(find: {grid: keyof WorkbenchGrids}): Readonly<MPart> | null {\n    const grid = this._grids[find.grid];\n    if (!grid) {\n      return null;\n    }\n    return this.part({partId: grid.activePartId, grid: find.grid});\n  }\n\n  /** @inheritDoc */\n  public activatePart(id: string): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.parts({id}, {throwIfEmpty: true}).forEach(part => workingCopy.__activatePart(part));\n    return workingCopy;\n  }\n\n  /**\n   * Finds a view based on the specified filter. If not found, by default, throws an error unless setting the `orElseNull` option.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.viewId - Searches for a view with the specified id.\n   * @param options - Controls the search.\n   * @param options.orElse - Controls to return `null` instead of throwing an error if no view is found.\n   * @return view matching the filter criteria.\n   */\n  public view(findBy: {viewId: ViewId}): MView;\n  public view(findBy: {viewId: ViewId}, options: {orElse: null}): MView | null;\n  public view(findBy: {viewId: ViewId}, options?: {orElse: null}): MView | null {\n    const [view] = this.views({id: findBy.viewId}, {throwIfMulti: true, throwIfEmpty: options?.orElse === null ? undefined : true});\n    return view ?? null;\n  }\n\n  /**\n   * Finds views based on the specified filter.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.id - Searches for views with the specified id.\n   * @param findBy.partId - Searches for views contained in the specified part.\n   * @param findBy.segments - Searches for views navigated to the specified URL.\n   * @param findBy.navigationHint - Searches for views navigated with given hint. Passing `null` searches for views navigated without a hint.\n   * @param findBy.markedForRemoval - Searches for views marked (or not marked) for removal.\n   * @param findBy.grid - Searches for views contained in the specified grid.\n   * @param options - Controls the search.\n   * @param options.throwIfEmpty - Controls to error if no view is found.\n   * @param options.throwIfMulti - Controls to error if multiple views are found.\n   * @return views matching the filter criteria.\n   */\n  public views(findBy: {id?: string; partId?: string; peripheral?: boolean; segments?: UrlSegmentMatcher; navigationHint?: string | null; markedForRemoval?: boolean; grid?: keyof WorkbenchGrids | Array<keyof WorkbenchGrids>}, options: {throwIfEmpty: (() => Error) | true; throwIfMulti: (() => Error) | true}): readonly [MView];\n  public views(findBy: {id?: string; partId?: string; peripheral?: boolean; segments?: UrlSegmentMatcher; navigationHint?: string | null; markedForRemoval?: boolean; grid?: keyof WorkbenchGrids | Array<keyof WorkbenchGrids>}, options: {throwIfEmpty: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly [MView, ...MView[]];\n  public views(findBy?: {id?: string; partId?: string; peripheral?: boolean; segments?: UrlSegmentMatcher; navigationHint?: string | null; markedForRemoval?: boolean; grid?: keyof WorkbenchGrids | Array<keyof WorkbenchGrids>}, options?: {throwIfEmpty?: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly MView[];\n  public views(findBy?: {id?: string; partId?: string; peripheral?: boolean; segments?: UrlSegmentMatcher; navigationHint?: string | null; markedForRemoval?: boolean; grid?: keyof WorkbenchGrids | Array<keyof WorkbenchGrids>}, options?: {throwIfEmpty?: (() => Error) | true; throwIfMulti?: (() => Error) | true}): readonly MView[] {\n    const views = this.parts({id: findBy?.partId, grid: findBy?.grid, peripheral: findBy?.peripheral})\n      .flatMap(part => part.views)\n      .filter(view => {\n        if (findBy?.id !== undefined && !matchesViewId(findBy.id, view)) {\n          return false;\n        }\n        if (findBy?.segments && !findBy.segments.matches(this.urlSegments({outlet: view.id}))) {\n          return false;\n        }\n        if (findBy?.navigationHint !== undefined && findBy.navigationHint !== (view.navigation?.hint ?? null)) {\n          return false;\n        }\n        if (findBy?.markedForRemoval !== undefined && findBy.markedForRemoval !== (view.markedForRemoval ?? false)) {\n          return false;\n        }\n        return true;\n      });\n\n    if (options?.throwIfEmpty && !views.length) {\n      throw typeof options.throwIfEmpty === 'function' ? options.throwIfEmpty() : Error(`[NullViewError] No matching view found: [${stringifyFilter(findBy ?? {})}]`);\n    }\n    if (options?.throwIfMulti && views.length > 1) {\n      throw typeof options.throwIfMulti === 'function' ? options.throwIfMulti() : Error(`[MultiViewError] Multiple views found: [${stringifyFilter(findBy ?? {})}]`);\n    }\n    return views;\n  }\n\n  /** @inheritDoc */\n  public addView(id: string, extras: {partId: string; position?: number | 'start' | 'end' | 'before-active-view' | 'after-active-view'; activateView?: boolean; activatePart?: boolean; cssClass?: string | string[]}): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    if (isViewId(id)) {\n      workingCopy.__addView({id}, extras);\n    }\n    else {\n      workingCopy.__addView({id: computeViewId(), alternativeId: id}, extras);\n    }\n    return workingCopy;\n  }\n\n  /** @inheritDoc */\n  public navigateView(id: string, commands: Commands, extras?: {hint?: string; relativeTo?: ActivatedRoute | null; data?: NavigationData; state?: NavigationState; cssClass?: string | string[]}): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.views({id}, {throwIfEmpty: true}).forEach(view => workingCopy.__navigateView(view, commands, extras));\n    return workingCopy;\n  }\n\n  /**\n   * @inheritDoc\n   *\n   * @param id - @inheritDoc\n   * @param options - Controls removal of the view.\n   * @param options.force - Specifies whether to force remove the view, bypassing `CanClose` guard.\n   */\n  public removeView(id: string, options?: {force?: boolean}): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.views({id}, {throwIfEmpty: true}).forEach(view => workingCopy.__removeView(view, {force: options?.force}));\n    return workingCopy;\n  }\n\n  /** @inheritDoc */\n  public moveView(id: string, targetPartId: string, options?: {position?: number | 'start' | 'end' | 'before-active-view' | 'after-active-view'; activateView?: boolean; activatePart?: boolean}): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.views({id}, {throwIfEmpty: true}).forEach(view => workingCopy.__moveView(view, targetPartId, options));\n    return workingCopy;\n  }\n\n  /** @inheritDoc */\n  public activateView(id: string, options?: {activatePart?: boolean}): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.views({id}, {throwIfEmpty: true}).forEach(view => workingCopy.__activateView(view, options));\n    return workingCopy;\n  }\n\n  /**\n   * Activates the adjacent view to the right or left of the specified view.\n   *\n   * If no adjacent view is found, the part's active view is unset.\n   *\n   * @param id - The id of the view to activate its adjacent view.\n   * @param options - Controls view activation.\n   * @param options.activatePart - Controls if to activate the part. Defaults to `false`.\n   * @return a copy of this layout with the adjacent view activated.\n   */\n  public activateAdjacentView(id: string, options?: {activatePart?: boolean}): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.views({id}, {throwIfEmpty: true}).forEach(view => workingCopy.__activateAdjacentView(view, options));\n    return workingCopy;\n  }\n\n  /**\n   * Renames a view.\n   *\n   * @param id - Identifies the view to rename.\n   * @param newViewId - The new identity of the view.\n   * @return a copy of this layout with the view renamed.\n   */\n  public renameView(id: ViewId, newViewId: ViewId): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.__renameView(workingCopy.view({viewId: id}), newViewId);\n    return workingCopy;\n  }\n\n  /**\n   * Renames an activity.\n   *\n   * @param id - Identifies the activity to rename.\n   * @param newActivityId - The new identity of the activity.\n   * @return a copy of this layout with the part renamed.\n   */\n  public renameActivity(id: ActivityId, newActivityId: ActivityId): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.__renameActivity(workingCopy.activity({id}), newActivityId);\n    return workingCopy;\n  }\n\n  /**\n   * Clears the activation instants of parts and views, optionally matching the passed filter.\n   *\n   * @return a copy of this layout with the activation instants cleared.\n   */\n  public clearActivationInstants(filter?: {grid?: keyof WorkbenchGrids | Array<keyof WorkbenchGrids>}): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.__clearActivationInstants(filter);\n    return workingCopy;\n  }\n\n  /**\n   * Finds a {@link MTreeNode} based on the specified filter. If not found, by default, throws an error unless setting the `orElseNull` option.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.nodeId - Searches for a node with the specified id.\n   * @param options - Controls the search.\n   * @param options.orElse - Controls to return `null` instead of throwing an error if no node is found.\n   * @return node matching the filter criteria.\n   */\n  public treeNode(findBy: {nodeId: string}): MTreeNode;\n  public treeNode(findBy: {nodeId: string}, options: {orElse: null}): MTreeNode | null;\n  public treeNode(findBy: {nodeId: string}, options?: {orElse: null}): MTreeNode | null {\n    const [node] = this.findTreeElements((element: MTreeNode | MPart): element is MTreeNode => element instanceof MTreeNode && element.id === findBy.nodeId);\n    if (!node && !options) {\n      throw Error(`[NullTreeNodeError] No MTreeNode found with id '${findBy.nodeId}'.`);\n    }\n    return node ?? null;\n  }\n\n  /**\n   * Sets the split ratio for the two children of a {@link MTreeNode}.\n   *\n   * @param nodeId - The id of the node to set the split ratio for.\n   * @param ratio - The proportional size between the two children, expressed as closed interval [0,1].\n   *                Example: To give 1/3 of the space to the first child, set the ratio to `0.3`.\n   * @return a copy of this layout with the split ratio set.\n   */\n  public setTreeNodeSplitRatio(nodeId: string, ratio: number): ɵWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n    workingCopy.__setTreeNodeSplitRatio(nodeId, ratio);\n    return workingCopy;\n  }\n\n  /**\n   * Gets the view to the right of the given view, or the view to the left if not found, or `undefined` otherwise.\n   *\n   * @param view - The view for which to find its adjacent view.\n   * @return The adjacent view, or `undefined` if the reference view is the last view of the part.\n   */\n  private adjacentView(view: MView): MView | undefined {\n    const part = this.part({viewId: view.id});\n    const viewIndex = part.views.indexOf(view);\n    return part.views[viewIndex + 1] ?? part.views[viewIndex - 1];\n  }\n\n  /**\n   * Checks if the provided activation instant is the most recent activation instant for any view and part.\n   */\n  public isLatestActivationInstant(activationInstant: number): boolean {\n    return activationInstant > 0 && !this.parts().some(part => (part.activationInstant ?? 0) > activationInstant) && !this.views().some(view => (view.activationInstant ?? 0) > activationInstant);\n  }\n\n  /** @inheritDoc */\n  public modify(modifyFn: (layout: ɵWorkbenchLayout) => ɵWorkbenchLayout): ɵWorkbenchLayout {\n    return modifyFn(this.workingCopy());\n  }\n\n  /**\n   * Serializes this layout into a URL-safe base64 string.\n   */\n  public serialize(flags?: LayoutSerializationFlags): SerializedWorkbenchLayout {\n    const workingCopy = this.workingCopy();\n\n    // Check if to assign each view a stable id based on its position in the grid.\n    if (flags?.assignStableViewIdentifier) {\n      workingCopy.__assignStableViewIdentifier();\n    }\n\n    // Check if to assign each part a stable id based on its position in the grid.\n    if (flags?.assignStablePartIdentifier) {\n      workingCopy.__assignStablePartIdentifier();\n    }\n\n    // Check if to assign each activity a stable id based on its position in the activity layout.\n    if (flags?.assignStableActivityIdentifier) {\n      workingCopy.__assignStableActivityIdentifier();\n    }\n\n    return {\n      grids: this._workbenchLayoutSerializer.serializeGrids(workingCopy.grids, flags),\n      activityLayout: this._workbenchLayoutSerializer.serializeActivityLayout(workingCopy.activityLayout, flags),\n      outlets: (selector: RequireOne<{mainGrid: true; mainAreaGrid: true; activityGrids: true}>): string => {\n        return this._workbenchLayoutSerializer.serializeOutlets(workingCopy.outlets(selector));\n      },\n    };\n  }\n\n  /**\n   * Tests if the current layout is equal to another layout based on provided flags.\n   */\n  public equals(other: ɵWorkbenchLayout, flags?: LayoutSerializationFlags): boolean {\n    if (this === other) {\n      return true;\n    }\n\n    const layout1 = this.serialize(flags);\n    const layout2 = other.serialize(flags);\n\n    return (\n      Objects.isEqual(layout1.grids, layout2.grids) &&\n      layout1.activityLayout === layout2.activityLayout &&\n      layout1.outlets({mainGrid: true}) === layout2.outlets({mainGrid: true}) &&\n      layout1.outlets({mainAreaGrid: true}) === layout2.outlets({mainAreaGrid: true}) &&\n      layout1.outlets({activityGrids: true}) === layout2.outlets({activityGrids: true}) &&\n      this.perspectiveId === other.perspectiveId\n      // Navigational state is not tested for equality as it is set through view navigation, resulting in a new navigation id when modified.\n    );\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __addActivity(id: PartId, dockTo: DockingArea, extras: DockedPartExtras & {alternativeId?: string}): void {\n    if (this.hasPart(id)) {\n      throw Error(`[PartAddError] Part id must be unique. The layout already contains a part with the id '${id}'.`);\n    }\n\n    if (extras.ɵactivityId && this.hasActivity(extras.ɵactivityId)) {\n      throw Error(`[ActivityAddError] Activity id must be unique. The layout already contains an activity with the id '${extras.ɵactivityId}'.`);\n    }\n\n    const activityId = extras.ɵactivityId ?? computeActivityId();\n    const title = extras.title === false ? undefined : extras.title ?? extras.label;\n    const part = new MPart({\n      id,\n      alternativeId: extras.alternativeId,\n      title,\n      structural: true,\n      views: [],\n      cssClass: extras.cssClass ? Arrays.coerce(extras.cssClass) : undefined,\n    });\n\n    this._grids[activityId] = {\n      root: part,\n      activePartId: id,\n      referencePartId: id,\n    };\n\n    const activityStack = this.activityStack({dockTo});\n    activityStack.activities.push({\n      id: activityId,\n      icon: extras.icon,\n      label: extras.label,\n      tooltip: extras.tooltip ?? extras.label,\n      cssClass: extras.cssClass,\n    });\n\n    // Activate the part.\n    if (extras.activate) {\n      this.__activatePart(part);\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __removeActivity(activity: MActivity): void {\n    // Remove outlets and state of parts contained in this activity.\n    this.parts({grid: activity.id}).forEach(part => {\n      this._outlets.delete(part.id);\n      this._navigationStates.delete(part.id);\n    });\n    // Remove outlets and state of views contained in this activity.\n    this.views({grid: activity.id}).forEach(view => {\n      this._outlets.delete(view.id);\n      this._navigationStates.delete(view.id);\n    });\n\n    // Remove activity grid.\n    delete this._grids[activity.id]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n\n    // Remove activity from layout.\n    const activityStack = this.activityStack({activityId: activity.id});\n    Arrays.remove(activityStack.activities, activity);\n    if (activityStack.activeActivityId === activity.id) {\n      delete activityStack.activeActivityId;\n    }\n    if (activityStack.minimizedActivityId === activity.id) {\n      delete activityStack.minimizedActivityId;\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __toggleActivity(id: ActivityId): void {\n    const stack = this.activityStack({activityId: id});\n    if (stack.activeActivityId === id) {\n      delete stack.activeActivityId;\n    }\n    else {\n      stack.activeActivityId = id;\n\n      // Activate part (and view) to update activation instant.\n      const activePart = this.activePart({grid: id})!;\n      if (activePart.activeViewId) {\n        this.__activateView(this.view({viewId: activePart.activeViewId}), {activatePart: true});\n      }\n      else {\n        this.__activatePart(activePart);\n      }\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __assignStableActivityIdentifier(): void {\n    this.activities().forEach((activity, index) => this.__renameActivity(activity, `${ACTIVITY_ID_PREFIX}__${index + 1}__`)); // surround with underscores to avoid collision with existing identifiers\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __renameActivity(activity: MActivity, newActivityId: ActivityId): void {\n    if (this.hasActivity(newActivityId)) {\n      throw Error(`[ActivityRenameError] Activity id must be unique. The layout already contains an activity with the id '${newActivityId}'.`);\n    }\n\n    // Rename grid.\n    this._grids[newActivityId] = this.grids[activity.id]!;\n    delete this.grids[activity.id]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n\n    // Rename references in activity stack.\n    const stack = this.activityStack({activityId: activity.id});\n    if (stack.activeActivityId === activity.id) {\n      stack.activeActivityId = newActivityId;\n    }\n    if (stack.minimizedActivityId === activity.id) {\n      stack.minimizedActivityId = newActivityId;\n    }\n\n    // Rename activity.\n    activity.id = newActivityId;\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __toggleMaximized(): void {\n    if (!this.hasActivities()) {\n      return;\n    }\n\n    const minimize = this.activities({active: true}).length > 0;\n    this.activityStacks().forEach(activityStack => {\n      if (minimize) {\n        activityStack.minimizedActivityId = activityStack.activeActivityId;\n        activityStack.activeActivityId = undefined;\n        // Clear activation instants for minimized activities, preventing focusing on maximization.\n        activityStack.activities.forEach(activity => this.__clearActivationInstants({grid: activity.id}));\n      }\n      else {\n        activityStack.activeActivityId = activityStack.minimizedActivityId;\n        activityStack.minimizedActivityId = undefined;\n      }\n    });\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __setActivityPanelSize(panel: 'left' | 'right' | 'bottom', size: number): void {\n    if (size < 0) {\n      throw Error(`[LayoutModifyError] '${panel}' activity panel size must be 0 or greater, but was '${size}'.`);\n    }\n\n    switch (panel) {\n      case 'left':\n        this._activityLayout.panels.left.width = size;\n        break;\n      case 'right':\n        this._activityLayout.panels.right.width = size;\n        break;\n      case 'bottom':\n        this._activityLayout.panels.bottom.height = size;\n        break;\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __setActivityPanelSplitRatio(panel: 'left' | 'right' | 'bottom', ratio: number): void {\n    if (ratio < 0 || ratio > 1) {\n      throw Error(`[LayoutModifyError] Ratio for '${panel}' activity panel must be in the closed interval [0,1], but was '${ratio}'.`);\n    }\n    this._activityLayout.panels[panel].ratio = ratio;\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __addPart(id: PartId, relativeTo: ReferenceElement, extras?: PartExtras & {alternativeId?: string; structural?: boolean}): void {\n    if (this.hasPart(id)) {\n      throw Error(`[PartAddError] Part id must be unique. The layout already contains a part with the id '${id}'.`);\n    }\n\n    const newPart = new MPart({\n      id,\n      alternativeId: extras?.alternativeId,\n      title: extras?.title,\n      structural: extras?.structural ?? true,\n      views: [],\n      cssClass: extras?.cssClass ? Arrays.coerce(extras.cssClass) : undefined,\n    });\n\n    // Find the reference element, if specified, or use the layout root as reference otherwise.\n    const referenceElement = relativeTo.relativeTo ? this.findTreeElement({id: relativeTo.relativeTo}) : this.grids.main.root;\n    const addBefore = relativeTo.align === 'left' || relativeTo.align === 'top';\n    const ratio = relativeTo.ratio ?? .5;\n\n    // Create a new tree node.\n    const newTreeNode: MTreeNode = new MTreeNode({\n      id: UID.randomUID(),\n      child1: addBefore ? newPart : referenceElement,\n      child2: addBefore ? referenceElement : newPart,\n      direction: relativeTo.align === 'left' || relativeTo.align === 'right' ? 'row' : 'column',\n      ratio: addBefore ? ratio : 1 - ratio,\n      parent: referenceElement.parent,\n    });\n\n    // Add the tree node to the layout.\n    if (!referenceElement.parent) {\n      const {grid} = this.grid(referenceElement.type === 'MPart' ? {partId: referenceElement.id} : {nodeId: referenceElement.id});\n      grid.root = newTreeNode; // top-level node\n    }\n    else if (referenceElement.parent.child1 === referenceElement) {\n      referenceElement.parent.child1 = newTreeNode;\n    }\n    else {\n      referenceElement.parent.child2 = newTreeNode;\n    }\n    referenceElement.parent = newTreeNode;\n    newPart.parent = newTreeNode;\n\n    // Activate the part.\n    if (extras?.activate) {\n      this.__activatePart(newPart);\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __removePart(part: MPart): void {\n    const {gridName, grid} = this.grid({partId: part.id});\n\n    // Remove activity if this part is the reference part of an activity.\n    const activity = this.activity({partId: part.id}, {orElse: null});\n    if (activity && part.id === grid.referencePartId) {\n      this.__removeActivity(activity);\n      return;\n    }\n\n    // The last part is never removed.\n    const parts = this.parts({grid: gridName});\n    if (parts.length === 1) {\n      return;\n    }\n\n    // Remove the part.\n    const parentPart = part.parent!;\n    const siblingElement = (parentPart.child1 === part ? parentPart.child2 : parentPart.child1);\n    if (!parentPart.parent) {\n      grid.root = siblingElement;\n      grid.root.parent = undefined;\n    }\n    else if (parentPart.parent.child1 === part.parent) {\n      parentPart.parent.child1 = siblingElement;\n    }\n    else {\n      parentPart.parent.child2 = siblingElement;\n    }\n\n    // Remove the part outlet.\n    this._outlets.delete(part.id);\n\n    // Remove navigation state.\n    this._navigationStates.delete(part.id);\n\n    // Remove outlets and state of views contained in the part.\n    part.views.forEach(view => {\n      this._outlets.delete(view.id);\n      this._navigationStates.delete(view.id);\n    });\n\n    // If the removed part was the active part, make the last used part the active part.\n    if (grid.activePartId === part.id) {\n      const [activePart] = parts\n        .filter(mPart => mPart.id !== part.id)\n        .sort((part1, part2) => (part2.activationInstant ?? 0) - (part1.activationInstant ?? 0));\n      grid.activePartId = activePart!.id;\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __navigatePart(part: MPart, commands: Commands, extras?: {hint?: string; relativeTo?: ActivatedRoute | null; data?: NavigationData; state?: NavigationState; cssClass?: string | string[]}): void {\n    if (!commands.length && !extras?.hint && !extras?.relativeTo) {\n      throw Error('[NavigateError] Commands, relativeTo or hint must be set.');\n    }\n\n    const urlSegments = runInInjectionContext(this._injector, () => Routing.commandsToSegments(commands, {relativeTo: extras?.relativeTo}));\n    if (urlSegments.length) {\n      this._outlets.set(part.id, urlSegments);\n    }\n    else {\n      this._outlets.delete(part.id);\n    }\n\n    if (extras?.state && Objects.keys(extras.state).length) {\n      this._navigationStates.set(part.id, extras.state);\n    }\n    else {\n      this._navigationStates.delete(part.id);\n    }\n\n    part.navigation = prune({\n      id: UID.randomUID(),\n      hint: extras?.hint,\n      data: extras?.data,\n      cssClass: extras?.cssClass ? Arrays.coerce(extras.cssClass) : undefined,\n    } satisfies MPart['navigation']);\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __renamePart(part: MPart, newPartId: PartId): void {\n    if (this.hasPart(newPartId)) {\n      throw Error(`[PartRenameError] Part id must be unique. The layout already contains a part with the id '${newPartId}'.`);\n    }\n\n    if (this._outlets.has(part.id)) {\n      this._outlets.set(newPartId, this._outlets.get(part.id)!);\n      this._outlets.delete(part.id);\n    }\n    if (this._navigationStates.has(part.id)) {\n      this._navigationStates.set(newPartId, this._navigationStates.get(part.id)!);\n      this._navigationStates.delete(part.id);\n    }\n    const {grid} = this.grid({partId: part.id});\n    if (grid.referencePartId === part.id) {\n      grid.referencePartId = newPartId;\n    }\n    if (grid.activePartId === part.id) {\n      grid.activePartId = newPartId;\n    }\n\n    part.id = newPartId;\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __assignStablePartIdentifier(): void {\n    this.parts().forEach((part, index) => this.__renamePart(part, `${PART_ID_PREFIX}__${index + 1}__`)); // surround with underscores to avoid collision with existing identifiers\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __addView(view: MView, options: {partId: string; position?: number | 'start' | 'end' | 'before-active-view' | 'after-active-view'; activateView?: boolean; activatePart?: boolean; cssClass?: string | string[]}): void {\n    if (this.hasView(view.id)) {\n      throw Error(`[ViewAddError] View id must be unique. The layout already contains a view with the id '${view.id}'.`);\n    }\n    const [part] = this.parts({id: options.partId}, {\n      throwIfEmpty: () => Error(`[ViewAddError] Cannot add view. No part found with id '${options.partId}'.`),\n      throwIfMulti: () => Error(`[ViewAddError] Cannot add view to multiple parts. Multiple parts found with id '${options.partId}'.`),\n    });\n\n    const position = coerceViewPosition(options.position ?? 'end', part);\n    part.views.splice(position, 0, view);\n\n    const activationInstant = this._instantProvider.next();\n    if (options.activateView) {\n      this.__activateView(view, {activationInstant});\n    }\n\n    if (options.activatePart) {\n      this.__activatePart(part, {activationInstant});\n    }\n    if (options.cssClass) {\n      view.cssClass = Arrays.coerce(options.cssClass);\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __navigateView(view: MView, commands: Commands, extras?: {hint?: string; relativeTo?: ActivatedRoute | null; data?: NavigationData; state?: NavigationState; cssClass?: string | string[]}): void {\n    if (!commands.length && !extras?.hint && !extras?.relativeTo) {\n      throw Error('[NavigateError] Commands, relativeTo or hint must be set.');\n    }\n\n    const urlSegments = runInInjectionContext(this._injector, () => Routing.commandsToSegments(commands, {relativeTo: extras?.relativeTo}));\n    if (urlSegments.length) {\n      this._outlets.set(view.id, urlSegments);\n    }\n    else {\n      this._outlets.delete(view.id);\n    }\n\n    if (extras?.state && Objects.keys(extras.state).length) {\n      this._navigationStates.set(view.id, extras.state);\n    }\n    else {\n      this._navigationStates.delete(view.id);\n    }\n\n    view.navigation = prune({\n      id: UID.randomUID(),\n      hint: extras?.hint,\n      data: extras?.data,\n      cssClass: extras?.cssClass ? Arrays.coerce(extras.cssClass) : undefined,\n    } satisfies MView['navigation']);\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __moveView(view: MView, targetPartId: string, options?: {position?: number | 'start' | 'end' | 'before-active-view' | 'after-active-view'; activateView?: boolean; activatePart?: boolean}): void {\n    const sourcePart = this.part({viewId: view.id});\n    const [targetPart] = this.parts({id: targetPartId}, {\n      throwIfEmpty: () => Error(`[ViewMoveError] Cannot move view. No part found with id '${targetPartId}'.`),\n      throwIfMulti: () => Error(`[ViewMoveError] Cannot move view. Multiple parts found with id '${targetPartId}'.`),\n    });\n\n    // Move the view.\n    if (sourcePart !== targetPart) {\n      this.__removeView(view, {removeOutlet: false, removeNavigationState: false, force: true});\n      this.__addView(view, {partId: targetPartId, position: options?.position});\n    }\n    else if (options?.position !== undefined) {\n      const position = coerceViewPosition(options.position, targetPart);\n      const referenceView: MView | undefined = sourcePart.views.at(position);\n      sourcePart.views.splice(sourcePart.views.indexOf(view), 1);\n      sourcePart.views.splice(referenceView ? sourcePart.views.indexOf(referenceView) : sourcePart.views.length, 0, view);\n    }\n\n    // Activate view and part.\n    const activationInstant = this._instantProvider.next();\n    if (options?.activateView) {\n      this.__activateView(view, {activationInstant});\n    }\n    if (options?.activatePart) {\n      this.__activatePart(targetPart, {activationInstant});\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __removeView(view: MView, options?: {removeOutlet?: false; removeNavigationState?: false; force?: boolean}): void {\n    if (!options?.force) {\n      view.markedForRemoval = true;\n      return;\n    }\n\n    const part = this.part({viewId: view.id});\n    const adjacentView = this.adjacentView(view);\n\n    // Remove view.\n    part.views.splice(part.views.indexOf(view), 1);\n\n    // Remove outlet.\n    if (options.removeOutlet ?? true) {\n      this._outlets.delete(view.id);\n    }\n\n    // Remove navigation state.\n    if (options.removeNavigationState ?? true) {\n      this._navigationStates.delete(view.id);\n    }\n\n    // Activate the last used view or the adjacent view.\n    if (part.activeViewId === view.id) {\n      // Activate the last used view, if any.\n      if (part.views.some(view => view.activationInstant)) {\n        const [lastUsedView] = [...part.views].sort((view1, view2) => (view2.activationInstant ?? 0) - (view1.activationInstant ?? 0));\n        this.__activateView(lastUsedView!);\n      }\n      // Activate adjacent view, if any.\n      else if (adjacentView) {\n        this.__activateView(adjacentView);\n      }\n      else {\n        delete part.activeViewId;\n      }\n    }\n\n    if (!part.views.length) {\n      // Remove the part when removing its last view, but only if the part has no navigation and is not a structural part.\n      if (!part.navigation && !part.structural) {\n        this.__removePart(part);\n      }\n      // Activate the part when removing its last view, but only if has been navigated.\n      else if (part.navigation) {\n        this.__activatePart(part);\n      }\n\n      // Close activity when removing its last view, but only if having no navigated parts.\n      const activity = this.activity({partId: part.id}, {orElse: null});\n      if (activity && !this.views({grid: activity.id}).length && !this.parts({grid: activity.id}).some(part => part.navigation)) {\n        const stack = this.activityStack({activityId: activity.id});\n        delete stack.activeActivityId;\n      }\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __activateView(view: MView, options?: {activatePart?: boolean; activationInstant?: number}): void {\n    // Activate the view.\n    const part = this.part({viewId: view.id});\n    const activationInstant = options?.activationInstant ?? this._instantProvider.next();\n    part.activeViewId = view.id;\n    view.activationInstant = activationInstant;\n\n    // Activate the part.\n    if (options?.activatePart) {\n      this.__activatePart(part, {activationInstant});\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __activateAdjacentView(view: MView, options?: {activatePart?: boolean}): void {\n    const adjacentView = this.adjacentView(view);\n    if (adjacentView) { // no adjacent view if it is the last view of the part\n      this.__activateView(adjacentView, {activatePart: options?.activatePart});\n    }\n    else {\n      delete this.part({viewId: view.id}).activeViewId;\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __clearActivationInstants(filter?: {grid?: keyof WorkbenchGrids | Array<keyof WorkbenchGrids>}): void {\n    this.parts({grid: filter?.grid}).forEach(part => delete part.activationInstant);\n    this.views({grid: filter?.grid}).forEach(view => delete view.activationInstant);\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __setTreeNodeSplitRatio(nodeId: string, ratio: number): void {\n    if (ratio < 0 || ratio > 1) {\n      throw Error(`[LayoutModifyError] Ratio for node '${nodeId}' must be in the closed interval [0,1], but was '${ratio}'.`);\n    }\n    this.treeNode({nodeId}).ratio = ratio;\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __activatePart(part: MPart, options?: {activationInstant?: number}): void {\n    // Activate part.\n    this.grid({partId: part.id}).grid.activePartId = part.id;\n    part.activationInstant = options?.activationInstant ?? this._instantProvider.next();\n\n    // Activate activity.\n    const activity = this.activity({partId: part.id}, {orElse: null});\n    if (activity) {\n      this.activityStack({activityId: activity.id}).activeActivityId = activity.id;\n    }\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __renameView(view: MView, newViewId: ViewId): void {\n    if (this.hasView(newViewId)) {\n      throw Error(`[ViewRenameError] View id must be unique. The layout already contains a view with the id '${newViewId}'.`);\n    }\n\n    const part = this.part({viewId: view.id});\n\n    if (this._outlets.has(view.id)) {\n      this._outlets.set(newViewId, this._outlets.get(view.id)!);\n      this._outlets.delete(view.id);\n    }\n    if (this._navigationStates.has(view.id)) {\n      this._navigationStates.set(newViewId, this._navigationStates.get(view.id)!);\n      this._navigationStates.delete(view.id);\n    }\n\n    if (part.activeViewId === view.id) {\n      part.activeViewId = newViewId;\n    }\n\n    view.id = newViewId;\n  }\n\n  /**\n   * Note: This method name begins with underscores, indicating that it does not operate on a working copy, but modifies this layout instead.\n   */\n  private __assignStableViewIdentifier(): void {\n    this.views().forEach((view, index) => this.__renameView(view, `${VIEW_ID_PREFIX}__${index + 1}__`)); // surround with underscores to avoid collision with existing identifiers\n  }\n\n  /**\n   * Finds a grid based on the specified filter. If not found, by default, throws an error unless setting the `orElseNull` option.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.partId - Searches for a grid that contains the specified part.\n   * @param findBy.viewId - Searches for a grid that contains the specified view.\n   * @param findBy.nodeId - Searches for a grid that contains the specified node.\n   * @param findBy.grid - Searches for specified grid.\n   * @param options - Controls the search.\n   * @param options.orElse - Controls to return `null` instead of throwing an error if no grid is found.\n   * @return grid matching the filter criteria.\n   */\n  public grid(findBy: RequireOne<{partId: PartId; viewId: ViewId; nodeId: string; grid: MPartGrid}>): {gridName: keyof WorkbenchGrids; grid: MPartGrid};\n  public grid(findBy: RequireOne<{partId: PartId; viewId: ViewId; nodeId: string; grid: MPartGrid}>, options: {orElse: null}): {gridName: keyof WorkbenchGrids; grid: MPartGrid} | null;\n  public grid(findBy: RequireOne<{partId: PartId; viewId: ViewId; nodeId: string; grid: MPartGrid}>, options?: {orElse: null}): {gridName: keyof WorkbenchGrids; grid: MPartGrid} | null {\n    const gridName = Objects.keys(this._grids).find(gridName => {\n      if (findBy.grid && this._grids[gridName] !== findBy.grid) {\n        return false;\n      }\n\n      return this.findTreeElements((element: MTreeNode | MPart): element is MPart | MTreeNode => {\n        if (findBy.partId && (element.type !== 'MPart' || element.id !== findBy.partId)) {\n          return false;\n        }\n        if (findBy.nodeId && (element.type !== 'MTreeNode' || element.id !== findBy.nodeId)) {\n          return false;\n        }\n        if (findBy.viewId && (element.type !== 'MPart' || !element.views.some(view => matchesViewId(findBy.viewId!, view)))) {\n          return false;\n        }\n        return true;\n      }, {findFirst: true, grid: gridName}).length > 0;\n    });\n\n    if (!gridName && !options) {\n      throw Error(`[NullGridError] No matching grid found: [${stringifyFilter(findBy)}]`);\n    }\n\n    return gridName ? {gridName, grid: this._grids[gridName]!} : null;\n  }\n\n  /**\n   * Computes if the specified part is located in the peripheral area.\n   */\n  public isPeripheralPart(partId: PartId): boolean {\n    if (partId === MAIN_AREA) {\n      return false;\n    }\n    else if (this.hasActivities()) {\n      return this.activity({partId}, {orElse: null}) !== null;\n    }\n    else {\n      return this.hasPart(partId, {grid: 'main'}) && this.hasPart(MAIN_AREA, {grid: 'main'});\n    }\n  }\n\n  /**\n   * Traverses the tree to find an element that matches the given predicate.\n   *\n   * @param findBy - Defines the search scope.\n   * @param findBy.id - Searches for an element with the specified id.\n   * @return Element matching the filter criteria.\n   */\n  private findTreeElement<T extends MTreeNode | MPart>(findBy: {id: string}): T {\n    const [element] = this.findTreeElements((element: MTreeNode | MPart): element is T => {\n      if (element instanceof MPart) {\n        return matchesPartId(findBy.id, element);\n      }\n      return element.id === findBy.id;\n    }, {findFirst: true});\n\n    if (!element) {\n      throw Error(`[NullElementError] No element found with id '${findBy.id}'.`);\n    }\n    return element;\n  }\n\n  /**\n   * Traverses the tree to find elements that match the given predicate.\n   *\n   * @param predicateFn - Predicate function to match.\n   * @param options - Defines search scope and options.\n   * @param options.findFirst - If specified, stops traversing on first match. If not set, defaults to `false`.\n   * @param options.grid - Searches for an element contained in the specified grid.\n   * @return Elements matching the filter criteria.\n   */\n  private findTreeElements<T extends MTreeNode | MPart>(predicateFn: (element: MTreeNode | MPart) => element is T, options?: {findFirst?: boolean; grid?: keyof WorkbenchGrids | Array<keyof WorkbenchGrids>}): T[] {\n    const result: T[] = [];\n    const gridFilter = options?.grid ? new Set<keyof WorkbenchGrids>(Arrays.coerce(options.grid)) : undefined;\n    for (const [gridName, grid] of Objects.entries(this._grids)) {\n      if (gridFilter && !gridFilter.has(gridName)) {\n        continue;\n      }\n      if (!visitGridElements(grid.root)) {\n        break;\n      }\n    }\n\n    return result;\n\n    function visitGridElements(element: MTreeNode | MPart): boolean {\n      if (predicateFn(element)) {\n        result.push(element);\n        if (options?.findFirst) {\n          return false; // stop visiting other elements\n        }\n      }\n\n      if (element instanceof MTreeNode) {\n        return visitGridElements(element.child1) && visitGridElements(element.child2);\n      }\n      return true;\n    }\n  }\n\n  /**\n   * Asserts integrity of grids.\n   */\n  private assertGrids(): void {\n    Objects.entries(this.grids).forEach(([gridName, grid]) => {\n      // Assert active part to exist.\n      if (!this.part({partId: grid.activePartId, grid: gridName}, {orElse: null})) {\n        throw Error(`[NullActivePartError] Active part \"${grid.activePartId}\" not found in grid ${gridName}.`);\n      }\n      // Assert reference part to exist.\n      if (grid.referencePartId && !this.part({partId: grid.referencePartId, grid: gridName}, {orElse: null})) {\n        throw Error(`[NullReferencePartError] Reference part \"${grid.activePartId}\" not found in grid ${gridName}.`);\n      }\n    });\n  }\n\n  /**\n   * Asserts each activity to have a grid.\n   */\n  private assertActivities(): void {\n    const mActivities = this.activityStacks().flatMap(stack => stack.activities);\n\n    // Assert each MActivity to have a MPartGrid.\n    mActivities.forEach(activity => {\n      if (!this._grids[activity.id]) {\n        throw Error(`[NullGridError] Missing MPartGrid for activity ${activity.id}.`);\n      }\n    });\n\n    // Assert each activity MPartGrid to have a MActivity.\n    Objects.keys(WorkbenchLayouts.pickActivityGrids(this._grids)).forEach(activityId => {\n      if (!mActivities.some(activity => activity.id === activityId)) {\n        throw Error(`[NullActivityError] Missing MActivity ${activityId}.`);\n      }\n    });\n\n    // Assert activity to have reference part.\n    mActivities.forEach(activity => {\n      if (!this.grids[activity.id]!.referencePartId) {\n        throw Error(`[NullReferencePartError] Missing reference part for activity ${activity.id}.`);\n      }\n    });\n  }\n\n  /**\n   * Creates a copy of this layout.\n   */\n  private workingCopy(): ɵWorkbenchLayout {\n    return runInInjectionContext(this._injector, () => new ɵWorkbenchLayout({\n      grids: this._workbenchLayoutSerializer.serializeGrids(this._grids),\n      activityLayout: this._workbenchLayoutSerializer.serializeActivityLayout(this._activityLayout),\n      perspectiveId: this.perspectiveId,\n      outlets: Object.fromEntries(this._outlets),\n      navigationStates: Object.fromEntries(this._navigationStates),\n    }));\n  }\n}\n\n/**\n * Creates the layout to dock parts to well-defined areas in the workbench layout.\n */\nfunction createDefaultActivityLayout(): MActivityLayout {\n  const documentRoot = inject(DOCUMENT).documentElement;\n  return {\n    toolbars: {\n      leftTop: {activities: []},\n      leftBottom: {activities: []},\n      rightTop: {activities: []},\n      rightBottom: {activities: []},\n      bottomLeft: {activities: []},\n      bottomRight: {activities: []},\n    },\n    panels: {\n      left: {\n        width: Number.parseInt(readCssVariable(documentRoot, '--sci-workbench-layout-panel-left-width', `${ACTIVITY_PANEL_WIDTH}px`)),\n        ratio: ACTIVITY_PANEL_RATIO,\n      },\n      right: {\n        width: Number.parseInt(readCssVariable(documentRoot, '--sci-workbench-layout-panel-right-width', `${ACTIVITY_PANEL_WIDTH}px`)),\n        ratio: ACTIVITY_PANEL_RATIO,\n      },\n      bottom: {\n        height: Number.parseInt(readCssVariable(documentRoot, '--sci-workbench-layout-panel-bottom-height', `${ACTIVITY_PANEL_HEIGHT}px`)),\n        ratio: ACTIVITY_PANEL_RATIO,\n      },\n    },\n  };\n}\n\n/**\n * Creates the default main grid with a main area.\n */\nfunction createDefaultMainGrid(): MPartGrid {\n  return {\n    root: new MPart({id: MAIN_AREA, alternativeId: MAIN_AREA_ALTERNATIVE_ID, structural: true, views: []}),\n    activePartId: MAIN_AREA,\n  };\n}\n\n/**\n * Creates the default main area grid with an initial part.\n *\n * The DI token {@link MAIN_AREA_INITIAL_PART_ID} is used to assign the initial part its identity.\n */\nfunction createDefaultMainAreaGrid(): MPartGrid {\n  return {\n    root: new MPart({id: inject(MAIN_AREA_INITIAL_PART_ID), structural: false, views: []}),\n    activePartId: inject(MAIN_AREA_INITIAL_PART_ID),\n  };\n}\n\n/**\n * Deserializes the workbench layout from the given configuration.\n */\nfunction deserializeLayout(config?: WorkbenchLayoutConstructConfig): {activityLayout: MActivityLayout; grids: WorkbenchGrids; outlets: Map<WorkbenchOutlet, UrlSegment[]>} {\n  // Deserialize and migrate outlets.\n  const outlets = deserializeOutlets(config?.outlets) ?? new Map<WorkbenchOutlet, UrlSegment[]>();\n\n  // Deserialize and migrate the activity layout.\n  const activityLayout = deserializeActivityLayout(config?.activityLayout) ?? createDefaultActivityLayout();\n\n  // Deserialize and migrate grids.\n  const grids = {\n    main: deserializeGrid(config?.grids?.main) ?? createDefaultMainGrid(),\n    mainArea: deserializeGrid(config?.grids?.mainArea) ?? createDefaultMainAreaGrid(),\n    ...WorkbenchLayouts.pickActivityGrids(config?.grids, grid => deserializeGrid(grid)),\n  };\n\n  return {activityLayout, grids, outlets};\n}\n\n/**\n * Deserializes specified {@link MActivityLayout} if serialized, applying necessary migrations if the serialized layout is outdated.\n *\n * @return Deserialized activity layout, or `undefined` if no layout is passed or deserialization fails.\n */\nfunction deserializeActivityLayout(layout: string | MActivityLayout | undefined): MActivityLayout | undefined {\n  if (!layout) {\n    return undefined;\n  }\n  if (typeof layout === 'object') {\n    return layout;\n  }\n\n  try {\n    return inject(WorkbenchLayoutSerializer).deserializeActivityLayout(layout);\n  }\n  catch (error) {\n    inject(Logger).error('[WorkbenchSerializeError] Failed to deserialize \"MActivityLayout\". Please clear your browser storage and reload the application.', error);\n    return undefined;\n  }\n}\n\n/**\n * Deserializes specified {@link MPartGrid} if serialized, applying necessary migrations if the serialized grid is outdated.\n *\n * @return Deserialized grid, or `undefined` if no grid is passed or deserialization fails.\n */\nfunction deserializeGrid(grid: string | MPartGrid | undefined): MPartGrid | undefined {\n  if (!grid) {\n    return undefined;\n  }\n  if (typeof grid === 'object') {\n    return grid;\n  }\n\n  try {\n    return inject(WorkbenchLayoutSerializer).deserializeGrid(grid);\n  }\n  catch (error) {\n    inject(Logger).error('[WorkbenchSerializeError] Failed to deserialize \"MPartGrid\". Please clear your browser storage and reload the application.', error);\n    return undefined;\n  }\n}\n\n/**\n * Deserializes specified {@link Outlets} if serialized, applying necessary migrations if the serialized outlets are outdated.\n *\n * @return Deserialized outlets, or `undefined` if no outlets are passed or deserialization fails.\n */\nfunction deserializeOutlets(outlets: string | Outlets | undefined): Map<WorkbenchOutlet, UrlSegment[]> | undefined {\n  if (!outlets) {\n    return undefined;\n  }\n\n  if (typeof outlets === 'object') {\n    return new Map(Objects.entries(outlets));\n  }\n\n  try {\n    return inject(WorkbenchLayoutSerializer).deserializeOutlets(outlets);\n  }\n  catch (error) {\n    inject(Logger).error('[WorkbenchSerializeError] Failed to deserialize \"Outlets\". Please clear your browser storage and reload the application.', error);\n    return undefined;\n  }\n}\n\n/**\n * Coerces a view position, returning the given position if it is a number, or computes it from the given literal otherwise.\n */\nfunction coerceViewPosition(position: number | 'start' | 'end' | 'before-active-view' | 'after-active-view', part: MPart): number {\n  switch (position) {\n    case 'start': {\n      return 0;\n    }\n    case 'end': {\n      return part.views.length;\n    }\n    case 'before-active-view': {\n      const activeViewIndex = part.views.findIndex(view => view.id === part.activeViewId);\n      return (activeViewIndex > -1 ? activeViewIndex : part.views.length);\n    }\n    case 'after-active-view': {\n      const activeViewIndex = part.views.findIndex(view => view.id === part.activeViewId);\n      return (activeViewIndex > -1 ? activeViewIndex + 1 : part.views.length);\n    }\n    default: {\n      return position;\n    }\n  }\n}\n\n/**\n * Describes how to lay out a part relative to another part or node.\n */\nexport interface ReferenceElement extends ReferencePart {\n  /**\n   * Specifies the part or node which to use as the reference element to lay out the part.\n   * If not set, the part will be aligned relative to the root of the workbench layout.\n   */\n  relativeTo?: string;\n}\n\n/**\n * DI token to control the identity of the initial part in the main area.\n *\n * The initial part is automatically created by the workbench if the main area has no part, but it has no\n * special meaning to the workbench and can be removed by the user. If not set, a UUID is assigned.\n *\n * Overwrite this DI token in tests to control the identity of the initial part.\n *\n * ```ts\n * TestBed.overrideProvider(MAIN_AREA_INITIAL_PART_ID, {useValue: 'part.initial'})\n * ```\n *\n * @docs-private Not public API. For internal use only.\n */\nexport const MAIN_AREA_INITIAL_PART_ID = new InjectionToken<PartId>('MAIN_AREA_INITIAL_PART_ID', {\n  providedIn: 'root',\n  factory: () => computePartId(),\n});\n\n/**\n * Matches given view by its primary or alternative id, depending on the type of the passed id.\n */\nfunction matchesViewId(id: ViewId | string, view: MView): boolean {\n  if (isViewId(id)) {\n    return view.id === id;\n  }\n  else {\n    return view.alternativeId === id;\n  }\n}\n\n/**\n * Matches given part by its primary or alternative id, depending on the type of the passed id.\n */\nfunction matchesPartId(id: PartId | string, part: MPart): boolean {\n  if (isPartId(id)) {\n    return part.id === id;\n  }\n  else {\n    return part.alternativeId === id;\n  }\n}\n\n/**\n * Stringifies the given filter to be used in error messages.\n */\nfunction stringifyFilter(filter: {[property: string]: unknown}): string {\n  return Object.entries(filter).map(([key, value]) => `${key}=${value}`).join(', ');\n}\n\n/**\n * Serialized artifacts of the workbench layout.\n */\nexport interface SerializedWorkbenchLayout {\n  grids: WorkbenchGrids<string>;\n  activityLayout: string;\n  outlets: (selector: RequireOne<{mainGrid: true; mainAreaGrid: true; activityGrids: true}>) => string;\n}\n\n/**\n * Configuration for constructing the workbench layout.\n *\n * Grids and the activity layout can be passed in serialized or deserialized form.\n * If they are not provided, default layouts will be created.\n *\n * The following rules apply:\n * - If the main grid is not provided, it defaults to a layout with a main area.\n * - If the grid for the main area is not provided, but the main grid has a main area part,\n *   it defaults to a main area grid with an initial part. The DI token {@link MAIN_AREA_INITIAL_PART_ID}\n *   can be used to assign the initial part its identity.\n */\nexport interface WorkbenchLayoutConstructConfig {\n  grids?: Partial<WorkbenchGrids<MPartGrid | string>>;\n  activityLayout?: MActivityLayout | string;\n  perspectiveId?: string;\n  outlets?: Outlets | string;\n  navigationStates?: NavigationStates;\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {WorkbenchLayoutConstructConfig, ɵWorkbenchLayout} from './ɵworkbench-layout';\nimport {MPart} from './workbench-grid.model';\nimport {WorkbenchLayoutFactory} from './workbench-layout.factory';\nimport {inject, Injectable, Injector, runInInjectionContext} from '@angular/core';\nimport {MAIN_AREA, MAIN_AREA_ALTERNATIVE_ID, PartExtras} from './workbench-layout';\nimport {Arrays} from '@scion/toolkit/util';\nimport {computePartId, isPartId} from '../workbench.identifiers';\n\n/**\n * @inheritDoc\n */\n@Injectable({providedIn: 'root'})\nexport class ɵWorkbenchLayoutFactory implements WorkbenchLayoutFactory {\n\n  private readonly _injector = inject(Injector);\n\n  /**\n   * @inheritDoc\n   */\n  public addPart(id: string | MAIN_AREA, extras?: PartExtras): ɵWorkbenchLayout {\n    const partId = isPartId(id) ? id : (id === MAIN_AREA_ALTERNATIVE_ID ? MAIN_AREA : computePartId());\n    const alternativeId = isPartId(id) ? (id === MAIN_AREA ? MAIN_AREA_ALTERNATIVE_ID : undefined) : id;\n\n    return this.create({\n      grids: {\n        main: {\n          root: new MPart({\n            id: partId,\n            alternativeId,\n            title: extras?.title,\n            structural: true,\n            views: [],\n            cssClass: extras?.cssClass ? Arrays.coerce(extras.cssClass) : undefined,\n          }),\n          activePartId: partId,\n        },\n      },\n    });\n  }\n\n  /**\n   * Creates a workbench layout that consists of the specified grids.\n   *\n   * @see ɵWorkbenchLayout.constructor\n   */\n  public create(config?: WorkbenchLayoutConstructConfig): ɵWorkbenchLayout {\n    return runInInjectionContext(this._injector, () => new ɵWorkbenchLayout(config));\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {Injectable} from '@angular/core';\nimport {ɵWorkbenchLayout} from './ɵworkbench-layout';\nimport {LayoutSerializationFlags} from './workbench-layout-serializer.service';\n\n/**\n * Performs a three-way merge of the local and remote layouts, using the base layout (common ancestor) as the base of the merge operation.\n *\n * TODO [#452] This implementation discards local changes when a new layout is available.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchLayoutMerger {\n\n  /**\n   * Performs a merge of given local and remote layouts, using the base layout as the common ancestor.\n   */\n  public merge(layouts: {local: ɵWorkbenchLayout; remote: ɵWorkbenchLayout; base: ɵWorkbenchLayout}): ɵWorkbenchLayout {\n    if (!layouts.base.equals(layouts.remote, compareFlags)) {\n      return layouts.remote;\n    }\n\n    return layouts.local;\n  }\n}\n\n/**\n * Flags to compare two layouts for equality.\n */\nconst compareFlags: LayoutSerializationFlags = {\n  excludeTreeNodeId: true,\n  excludePartNavigationId: true,\n  excludeViewNavigationId: true,\n  excludePartActivationInstant: true,\n  excludeViewActivationInstant: true,\n  assignStablePartIdentifier: true,\n  assignStableViewIdentifier: true,\n  assignStableActivityIdentifier: true,\n  sort: true,\n} as const;\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable} from '@angular/core';\nimport {WorkbenchStorage} from '../storage/workbench-storage';\nimport {Logger} from '../logging';\nimport {WorkbenchLayoutSerializer} from './workbench-layout-serializer.service';\nimport {MWorkbenchLayout} from './workbench-layout';\n\n/**\n * Provides API for reading and writing the workbench layout to storage.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchLayoutStorageService {\n\n  private readonly _storage = inject(WorkbenchStorage);\n  private readonly _workbenchLayoutSerializer = inject(WorkbenchLayoutSerializer);\n  private readonly _logger = inject(Logger);\n\n  /**\n   * Loads specified layout from storage, applying necessary migrations if the serialized layout is outdated.\n   */\n  public async load(perspectiveId: string): Promise<MWorkbenchLayout | null> {\n    const layoutStorageKey = storageKeys.layout(perspectiveId);\n    const serialized = await this._storage.load(layoutStorageKey);\n    try {\n      return this._workbenchLayoutSerializer.deserialize(serialized);\n    }\n    catch (error) {\n      this._logger.error(`[WorkbenchSerializeError] Failed to deserialize the layout of the perspective '${perspectiveId}'. Please clear your browser storage and reload the application.`, error);\n      return null;\n    }\n  }\n\n  /**\n   * Stores specified layout to storage.\n   */\n  public async store(perspectiveId: string, layout: MWorkbenchLayout): Promise<void> {\n    const serialized = this._workbenchLayoutSerializer.serialize(layout);\n    const layoutStorageKey = storageKeys.layout(perspectiveId);\n    await this._storage.store(layoutStorageKey, serialized);\n  }\n\n  /**\n   * Reads the id of the active perspective from storage.\n   */\n  public async loadActivePerspectiveId(): Promise<string | null> {\n    return this._storage.load(storageKeys.activePerspectiveId);\n  }\n\n  /**\n   * Writes the id of the active perspective to storage.\n   */\n  public async storeActivePerspectiveId(perspectiveId: string): Promise<void> {\n    return this._storage.store(storageKeys.activePerspectiveId, perspectiveId);\n  }\n}\n\n/**\n * Represents keys to associate data in the storage.\n */\nconst storageKeys = {\n  layout: (perspectiveId: string): string => `scion.workbench.perspectives.${perspectiveId}`,\n  activePerspectiveId: 'scion.workbench.perspective',\n};\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {DestroyRef, inject} from '@angular/core';\n\n/**\n * Executes submitted tasks in serial order.\n *\n * Unlike {@link SingleTaskExecutor}, this executor has a queue size of 1, with only the most recently scheduled task being queued.\n *\n * Tasks are executed in serial order. At any one time, there is only one task executing and a maximum of one task pending.\n * When a task is submitted and there is a task already executing, the submitted task will be queued for later execution.\n * Any task previously placed in the queue is discarded.\n *\n * This executor must be constructed within an injection context. Destroying the injection context will also destroy the executor.\n */\nexport class LatestTaskExecutor {\n\n  private _executing = false;\n  private _latestTask: (() => Promise<void>) | undefined;\n\n  constructor() {\n    // Clear pending tasks when the current injection context is destroyed.\n    inject(DestroyRef).onDestroy(() => this.onDestroy());\n  }\n\n  /**\n   * Submits a task for serial execution.\n   */\n  public submit(task: () => Promise<void>): void {\n    this._latestTask = task;\n    this.executeLatestTask();\n  }\n\n  /**\n   * Executes the last task in the queue (if any).\n   * After completion, this process is repeated until the task queue is empty.\n   */\n  private executeLatestTask(): void {\n    if (this._executing || !this._latestTask) {\n      return;\n    }\n\n    const task = this._latestTask;\n    this._latestTask = undefined;\n\n    this._executing = true;\n    void task().finally(() => {\n      this._executing = false;\n      this.executeLatestTask();\n    });\n  }\n\n  private onDestroy(): void {\n    this._latestTask = undefined;\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {WorkbenchElementRegistry} from '../registry/workbench-element-registry';\nimport {ɵWorkbenchPerspective} from './ɵworkbench-perspective.model';\nimport {Injectable} from '@angular/core';\n\n/**\n * Registry for {@link ɵWorkbenchPerspective} elements.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchPerspectiveRegistry extends WorkbenchElementRegistry<string, ɵWorkbenchPerspective> {\n  constructor() {\n    super({\n      nullElementErrorFn: perspectiveId => Error(`[NullPerspectiveError] Perspective '${perspectiveId}' not found.`),\n      onUnregister: perspective => perspective.destroy(),\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, InjectionToken, Injector, makeEnvironmentProviders, runInInjectionContext} from '@angular/core';\n\n/**\n * Registers a function that is executed during the startup of the SCION Workbench.\n *\n * Initializers are used to run initialization tasks during startup of the SCION Workbench.\n * The workbench is fully started once all initializers have completed.\n *\n * Initializers can specify a phase for execution. Initializers in lower phases execute before initializers in higher phases.\n * Initializers in the same phase may execute in parallel. If no phase is specified, the initializer executes in the `Startup` phase.\n *\n * Available phases, in order of execution:\n * - {@link WorkbenchStartupPhase.PreStartup}\n * - {@link WorkbenchStartupPhase.Startup}\n * - {@link WorkbenchStartupPhase.PostStartup}\n *\n * The function can call `inject` to get any required dependencies.\n *\n * @param initializerFn - Specifies the function to execute.\n * @param options - Controls execution of the function.\n * @return A set of dependency-injection providers to be registered in Angular.\n */\nexport function provideWorkbenchInitializer(initializerFn: WorkbenchInitializerFn, options?: WorkbenchInitializerOptions): EnvironmentProviders {\n  const token = WORKBENCH_STARTUP_TOKENS.get(options?.phase ?? WorkbenchStartupPhase.Startup);\n  return makeEnvironmentProviders([{\n    provide: token,\n    useValue: initializerFn,\n    multi: true,\n  }]);\n}\n\n/**\n * Controls the execution of an initializer function during the startup of the SCION Workbench.\n */\nexport interface WorkbenchInitializerOptions {\n  /**\n   * Controls in which phase to execute the initializer.\n   */\n  phase?: WorkbenchStartupPhase;\n}\n\n/**\n * Enumeration of phases for running a {@link WorkbenchInitializerFn} function during the startup of the SCION Workbench.\n *\n * Functions associated with the same phase may run in parallel. Defaults to {@link Startup} phase.\n */\nexport enum WorkbenchStartupPhase {\n  /**\n   * Use to run an initializer before starting the workbench.\n   */\n  PreStartup = 0,\n  /**\n   * Use to run an initializer function after initializers of the {@link PreStartup} phase.\n   *\n   * This is the default phase if not specifying a phase.\n   */\n  Startup = 1,\n  /**\n   * Use to run an initializer function after initializers of the {@link Startup} phase.\n   */\n  PostStartup = 2,\n}\n\n/**\n * The signature of a function executed during the startup of the SCION Workbench.\n *\n * Initializers are used to run initialization tasks during startup of the SCION Workbench.\n * The workbench is fully started once all initializers have completed.\n *\n * Initializers are registered using the `provideWorkbenchInitializer()` function and can specify a phase for execution.\n * Initializers in lower phases execute before initializers in higher phases. Initializers in the same phase may\n * execute in parallel. If no phase is specified, the initializer executes in the `Startup` phase.\n *\n * Available phases, in order of execution:\n * - {@link WorkbenchStartupPhase.PreStartup}\n * - {@link WorkbenchStartupPhase.Startup}\n * - {@link WorkbenchStartupPhase.PostStartup}\n *\n * The function can call `inject` to get any required dependencies.\n *\n * @example - Registration of an initializer function\n * ```ts\n * import {provideWorkbench, provideWorkbenchInitializer} from '@scion/workbench';\n * import {bootstrapApplication} from '@angular/platform-browser';\n * import {inject} from '@angular/core';\n *\n * bootstrapApplication(AppComponent, {\n *   providers: [\n *     provideWorkbench(),\n *     provideWorkbenchInitializer(() => inject(SomeService).init()),\n *   ],\n * });\n * ```\n * @see provideWorkbenchInitializer\n */\nexport type WorkbenchInitializerFn = () => void | Promise<void>;\n\n/**\n * Runs workbench initializers in the given phase. Initializer functions can call `inject` to get required dependencies.\n */\nexport async function runWorkbenchInitializers(phase: WorkbenchStartupPhase, injector: Injector): Promise<void> {\n  const token = WORKBENCH_STARTUP_TOKENS.get(phase)!;\n  const initializers = injector.get<WorkbenchInitializerFn[]>(token, [], {optional: true});\n  if (!initializers.length) {\n    return;\n  }\n\n  // Run and await initializer functions in parallel.\n  await Promise.all(initializers.map(initializer => runInInjectionContext(injector, initializer))); // eslint-disable-line @typescript-eslint/await-thenable\n}\n\n/**\n * Associates Workbench startup phases with Workbench DI tokens.\n */\nconst WORKBENCH_STARTUP_TOKENS = new Map<WorkbenchStartupPhase, InjectionToken<WorkbenchInitializerFn>>()\n  .set(WorkbenchStartupPhase.PreStartup, new InjectionToken<WorkbenchInitializerFn>('WORKBENCH_PRE_STARTUP'))\n  .set(WorkbenchStartupPhase.Startup, new InjectionToken<WorkbenchInitializerFn>('WORKBENCH_STARTUP'))\n  .set(WorkbenchStartupPhase.PostStartup, new InjectionToken<WorkbenchInitializerFn>('WORKBENCH_POST_STARTUP'));\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {WorkbenchConfig} from '../workbench-config';\nimport {assertNotInReactiveContext, computed, inject, Injectable, Injector, NgZone, signal, ɵZONELESS_ENABLED} from '@angular/core';\nimport {runWorkbenchInitializers, WorkbenchStartupPhase} from './workbench-initializer';\nimport {Logger, LoggerNames} from '../logging';\nimport {WorkbenchLauncher} from './workbench-launcher.service';\nimport {resolveWhen} from '../common/resolve-when.util';\n\n@Injectable({providedIn: 'root'})\nexport class ɵWorkbenchLauncher implements WorkbenchLauncher {\n\n  private readonly _logger: Logger;\n  private readonly _zone: NgZone;\n  private readonly _injector: Injector;\n  private readonly _whenStarted = resolveWhen(computed(() => this.state() === LaunchState.Started));\n\n  public readonly state = signal(LaunchState.Stopped);\n\n  constructor() {\n    const workbenchConfig = inject(WorkbenchConfig, {optional: true});\n    if (!workbenchConfig) {\n      throw Error(`[WorkbenchError] Missing required workbench providers. Did you forget to call 'provideWorkbench()' in the providers array of 'bootstrapApplication' or the root 'NgModule'?`);\n    }\n\n    if (inject(ɵZONELESS_ENABLED, {optional: true})) {\n      throw Error(`[WorkbenchError] SCION Workbench does not support zoneless. Add 'provideZoneChangeDetection()' to the list of providers in your app.config.ts or main.ts. Support is planned for 2026.`);\n    }\n\n    // Do not inject dependencies before the above check to avoid `NullInjectorError` error.\n    this._logger = inject(Logger);\n    this._zone = inject(NgZone);\n    this._injector = inject(Injector);\n  }\n\n  /** @inheritDoc */\n  public async launch(): Promise<true> {\n    assertNotInReactiveContext(this.launch, 'Call WorkbenchLauncher.launch() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    // Ensure to run in the Angular zone to check the workbench for changes even if called from outside the Angular zone, e.g. in unit tests.\n    if (!NgZone.isInAngularZone()) {\n      return this._zone.run(() => this.launch());\n    }\n\n    switch (this.state()) {\n      case LaunchState.Stopped: {\n        this._logger.debug(() => 'Starting Workbench. Waiting for workbench initializers to complete.', LoggerNames.LIFECYCLE);\n        this.state.set(LaunchState.Starting);\n        await runWorkbenchInitializers(WorkbenchStartupPhase.PreStartup, this._injector);\n        await runWorkbenchInitializers(WorkbenchStartupPhase.Startup, this._injector);\n        await runWorkbenchInitializers(WorkbenchStartupPhase.PostStartup, this._injector);\n        this.state.set(LaunchState.Started);\n        this._logger.debug(() => 'Workbench started.', LoggerNames.LIFECYCLE);\n        return true;\n      }\n      case LaunchState.Starting:\n      case LaunchState.Started: {\n        await this._whenStarted;\n        return true;\n      }\n    }\n  }\n}\n\nexport enum LaunchState {\n  Stopped, Starting, Started,\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, inject, Injectable} from '@angular/core';\nimport {WorkbenchStartup} from './workbench-startup.service';\nimport {resolveWhen} from '../common/resolve-when.util';\nimport {WorkbenchLayoutService} from '../layout/workbench-layout.service';\nimport {LaunchState, ɵWorkbenchLauncher} from './ɵworkbench-launcher.service';\n\n@Injectable(/* DO NOT provide via 'providedIn' metadata as registered under `WorkbenchStartup` DI token. */)\nexport class ɵWorkbenchStartup implements WorkbenchStartup {\n\n  private readonly _launcher = inject(ɵWorkbenchLauncher);\n  private readonly _workbenchLayoutService = inject(WorkbenchLayoutService);\n\n  /** @inheritDoc */\n  public readonly done = computed(() => this._launcher.state() === LaunchState.Started && this._workbenchLayoutService.hasLayout());\n\n  /** @inheritDoc */\n  public readonly whenDone = resolveWhen(this.done);\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable, Signal} from '@angular/core';\nimport {ɵWorkbenchStartup} from './ɵworkbench-startup.service';\n\n/**\n * Provides the status of the SCION Workbench startup.\n */\n@Injectable({providedIn: 'root', useClass: ɵWorkbenchStartup})\nexport abstract class WorkbenchStartup {\n\n  /**\n   * Indicates whether the workbench has completed startup.\n   *\n   * After startup, the workbench layout is available.\n   */\n  public abstract readonly done: Signal<boolean>;\n\n  /**\n   * Resolves when the workbench has completed startup.\n   *\n   * After startup, the workbench layout is available.\n   */\n  public abstract readonly whenDone: Promise<void>;\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {ɵWorkbenchLayoutFactory} from '../layout/ɵworkbench-layout.factory';\nimport {computed, DestroyableInjector, inject, InjectionToken, Injector, runInInjectionContext, Signal} from '@angular/core';\nimport {WorkbenchPerspective, WorkbenchPerspectiveDefinition} from './workbench-perspective.model';\nimport {ɵWorkbenchRouter} from '../routing/ɵworkbench-router.service';\nimport {ɵWorkbenchLayout} from '../layout/ɵworkbench-layout';\nimport {WorkbenchLayoutMerger} from '../layout/workbench-layout-merger.service';\nimport {WorkbenchLayoutStorageService} from '../layout/workbench-layout-storage.service';\nimport {WorkbenchLayoutService} from '../layout/workbench-layout.service';\nimport {LatestTaskExecutor} from '../executor/latest-task-executor';\nimport {UrlSegment} from '@angular/router';\nimport {WorkbenchLayoutFn} from '../layout/workbench-layout';\nimport {WorkbenchPerspectiveRegistry} from './workbench-perspective.registry';\nimport {WorkbenchStartup} from '../startup/workbench-startup.service';\nimport {Objects} from '@scion/toolkit/util';\nimport {WorkbenchLayouts} from '../layout/workbench-layouts.util';\nimport {takeUntilDestroyed, toObservable} from '@angular/core/rxjs-interop';\nimport {filter, skip, switchMap} from 'rxjs/operators';\nimport {from} from 'rxjs';\n\n/**\n * @inheritDoc\n */\nexport class ɵWorkbenchPerspective implements WorkbenchPerspective {\n\n  /** Injector for the perspective; destroyed when the perspective is unregistered. */\n  public readonly injector = inject(Injector) as DestroyableInjector;\n  private readonly _workbenchLayoutFactory = inject(ɵWorkbenchLayoutFactory);\n  private readonly _workbenchLayoutService = inject(WorkbenchLayoutService);\n  private readonly _workbenchLayoutMerger = inject(WorkbenchLayoutMerger);\n  private readonly _workbenchlayoutStorageService = inject(WorkbenchLayoutStorageService);\n  private readonly _workbenchRouter = inject(ɵWorkbenchRouter);\n  private readonly _initialLayoutFn: WorkbenchLayoutFn;\n  private readonly _activePerspective = inject(ACTIVE_PERSPECTIVE);\n\n  public readonly id: string;\n  public readonly transient: boolean;\n  public readonly data: {[key: string]: any};\n  public readonly active: Signal<boolean>;\n\n  private _initialLayout: ɵWorkbenchLayout | undefined;\n  private _layout: ɵWorkbenchLayout | undefined;\n\n  constructor(definition: WorkbenchPerspectiveDefinition) {\n    this.id = definition.id;\n    this.transient = definition.transient ?? false;\n    this.data = definition.data ?? {};\n\n    const activePerspective = inject(ACTIVE_PERSPECTIVE);\n    this.active = computed(() => activePerspective()?.id === this.id);\n\n    this._initialLayoutFn = definition.layout;\n    this.installLayoutPersister();\n  }\n\n  /**\n   * Activates this perspective.\n   */\n  public async activate(): Promise<boolean> {\n    // Create the initial layout when constructed for the first time.\n    this._initialLayout ??= await this.createInitialLayout();\n\n    // Load the layout from the storage, if present, or use the initial layout otherwise.\n    this._layout = (await this.loadLayout()) ?? this._initialLayout;\n\n    // Do not push new state into browser session history when activating the initial workbench perspective.\n    const replaceUrl = this._activePerspective() === undefined;\n\n    // Perform navigation to activate the layout of this perspective.\n    return this._workbenchRouter.navigate(currentLayout => this.createLayoutForActivation(currentLayout), {replaceUrl});\n  }\n\n  /**\n   * Resets this perspective to its initial layout.\n   */\n  public async reset(): Promise<void> {\n    this._layout = this._initialLayout;\n\n    // Reset to the initial layout.\n    await this._workbenchRouter.navigate(currentLayout => this.createLayoutForActivation(currentLayout));\n  }\n\n  /**\n   * Creates the perspective layout using the main area of the current layout.\n   */\n  private createLayoutForActivation(currentLayout: ɵWorkbenchLayout): ɵWorkbenchLayout {\n    if (!this._layout) {\n      throw Error(`[PerspectiveActivateError] Perspective '${this.id}' not constructed.`);\n    }\n\n    // Outlets of the new layout.\n    const outlets = new Map<string, UrlSegment[]>();\n\n    // Add outlets of this perspective.\n    Objects.entries(this._layout.outlets({mainGrid: true, activityGrids: true})).forEach(([outlet, segments]) => {\n      outlets.set(outlet, segments);\n    });\n\n    // Add outlets of the shared main area.\n    Objects.entries(currentLayout.outlets({mainAreaGrid: true})).forEach(([outlet, segments]) => {\n      outlets.set(outlet, segments);\n    });\n\n    // Create the layout for this perspective.\n    return this._workbenchLayoutFactory.create({\n      grids: {\n        ...this._layout.grids,\n        mainArea: currentLayout.grids.mainArea,\n      },\n      activityLayout: this._layout.activityLayout,\n      perspectiveId: this.id,\n      outlets: Object.fromEntries(outlets),\n      navigationStates: currentLayout.navigationStates({grid: 'mainArea'}), // preserve navigation state of parts and views in the main area; navigation state of parts and views outside the main area cannot be restored since not persisted.\n    });\n  }\n\n  /**\n   * Creates the initial layout of this perspective as defined in the perspective definition.\n   */\n  private async createInitialLayout(): Promise<ɵWorkbenchLayout> {\n    let initialLayout = await runInInjectionContext(this.injector, () => this._initialLayoutFn(this._workbenchLayoutFactory)) as ɵWorkbenchLayout;\n\n    // Ensure each part to have an active view.\n    initialLayout.parts()\n      .filter(part => part.views.length && !part.activeViewId)\n      .forEach(part => {\n        initialLayout = initialLayout.activateView(part.views[0]!.id);\n      });\n\n    // Clear activation instants.\n    initialLayout = initialLayout.clearActivationInstants();\n\n    return initialLayout;\n  }\n\n  /**\n   * Sets up automatic persistence of the perspective layout on every layout change.\n   */\n  private installLayoutPersister(): void {\n    const executor = new LatestTaskExecutor();\n    const injector = inject(Injector);\n\n    from(this._workbenchLayoutService.whenLayoutAvailable)\n      .pipe(\n        switchMap(() => toObservable(this._workbenchLayoutService.layout, {injector})),\n        skip(1), // Skip immediate layout emission to only persist on layout change.\n        filter(() => this.active()),\n        takeUntilDestroyed(),\n      )\n      .subscribe(layout => executor.submit(() => this.storeLayout(layout)));\n  }\n\n  /**\n   * Loads the layout of this perspective from storage, applying necessary migrations if the layout is outdated.\n   * Returns `undefined` if not stored or could not be deserialized.\n   */\n  private async loadLayout(): Promise<ɵWorkbenchLayout | undefined> {\n    if (this.transient) {\n      return this._layout;\n    }\n\n    const layout = await this._workbenchlayoutStorageService.load(this.id);\n    if (!layout) {\n      return undefined;\n    }\n\n    return this._workbenchLayoutMerger.merge({\n      local: this._workbenchLayoutFactory.create({\n        grids: {\n          main: layout.userLayout.grids.main,\n          ...WorkbenchLayouts.pickActivityGrids(layout.userLayout.grids),\n        },\n        activityLayout: layout.userLayout.activityLayout,\n        outlets: layout.userLayout.outlets,\n      }),\n      base: this._workbenchLayoutFactory.create({\n        grids: {\n          main: layout.referenceLayout.grids.main,\n          ...WorkbenchLayouts.pickActivityGrids(layout.referenceLayout.grids),\n        },\n        activityLayout: layout.referenceLayout.activityLayout,\n        outlets: layout.referenceLayout.outlets,\n      }),\n      remote: this._initialLayout!,\n    });\n  }\n\n  /**\n   * Stores the layout of this perspective.\n   *\n   * If an anonymous perspective, only memoizes the layout, but does not write it to storage.\n   */\n  private async storeLayout(currentLayout: ɵWorkbenchLayout): Promise<void> {\n    // Memoize the layout of this perspective.\n    this._layout = this._workbenchLayoutFactory.create({\n      grids: {\n        main: currentLayout.grids.main,\n        ...WorkbenchLayouts.pickActivityGrids(currentLayout.grids),\n      },\n      activityLayout: currentLayout.activityLayout,\n      outlets: currentLayout.outlets({mainGrid: true, activityGrids: true}),\n    });\n\n    // Do not store the layout if a transient perspective.\n    if (this.transient) {\n      return;\n    }\n\n    const serializedReferenceLayout = this._initialLayout!.serialize();\n    const serializedUserLayout = this._layout.serialize();\n\n    await this._workbenchlayoutStorageService.store(this.id, {\n      referenceLayout: {\n        grids: {\n          main: serializedReferenceLayout.grids.main,\n          ...WorkbenchLayouts.pickActivityGrids(serializedReferenceLayout.grids),\n        },\n        activityLayout: serializedReferenceLayout.activityLayout,\n        outlets: serializedReferenceLayout.outlets({mainGrid: true, activityGrids: true}),\n      },\n      userLayout: {\n        grids: {\n          main: serializedUserLayout.grids.main,\n          ...WorkbenchLayouts.pickActivityGrids(serializedUserLayout.grids),\n        },\n        activityLayout: serializedUserLayout.activityLayout,\n        outlets: serializedUserLayout.outlets({mainGrid: true, activityGrids: true}),\n      },\n    });\n  }\n\n  public destroy(): void {\n    this.injector.destroy();\n  }\n}\n\n/**\n * Provides the currently active perspective in the workbench.\n */\nexport const ACTIVE_PERSPECTIVE = new InjectionToken<Signal<ɵWorkbenchPerspective | undefined>>('ACTIVE_PERSPECTIVE', {\n  providedIn: 'root',\n  factory: (): Signal<ɵWorkbenchPerspective | undefined> => {\n    const layout = inject(WorkbenchLayoutService).layout;\n    const perspectiveRegistry = inject(WorkbenchPerspectiveRegistry);\n    const workbenchStartup = inject(WorkbenchStartup);\n\n    return computed(() => {\n      // Perspectives are not registered until the workbench startup is complete.\n      if (!workbenchStartup.done()) {\n        return undefined;\n      }\n\n      const perspectiveId = layout().perspectiveId;\n      if (!perspectiveId) {\n        return undefined; // The initial perspective has not been activated yet.\n      }\n\n      return perspectiveRegistry.get(perspectiveId);\n    });\n  },\n});\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {ApplicationInitStatus, inject, Injectable, Injector, runInInjectionContext, Signal, signal} from '@angular/core';\nimport {ACTIVE_PERSPECTIVE, ɵWorkbenchPerspective} from './ɵworkbench-perspective.model';\nimport {WorkbenchPerspectiveDefinition} from './workbench-perspective.model';\nimport {WorkbenchLayoutStorageService} from '../layout/workbench-layout-storage.service';\nimport {ANONYMOUS_PERSPECTIVE_ID_PREFIX} from '../workbench.constants';\nimport {MAIN_AREA} from '../layout/workbench-layout';\nimport {WorkbenchConfig} from '../workbench-config';\nimport {WorkbenchLayoutFactory} from '../layout/workbench-layout.factory';\nimport {WorkbenchPerspectiveRegistry} from './workbench-perspective.registry';\nimport {Logger} from '../logging';\n\n/**\n * Enables registration and activation of perspectives.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchPerspectiveService {\n\n  private readonly _workbenchConfig = inject(WorkbenchConfig);\n  private readonly _perspectiveRegistry = inject(WorkbenchPerspectiveRegistry);\n  private readonly _injector = inject(Injector);\n  private readonly _applicationInitStatus = inject(ApplicationInitStatus);\n  private readonly _layoutStorageService = inject(WorkbenchLayoutStorageService);\n  public readonly _logger = inject(Logger);\n\n  private readonly _switchingPerspective = signal(false);\n  private readonly _resettingPerspective = signal(false);\n\n  public readonly activePerspective = inject(ACTIVE_PERSPECTIVE);\n\n  public async init(): Promise<void> {\n    try {\n      await this.registerPerspectivesFromConfig();\n      await this.registerAnonymousPerspectiveFromWindowName();\n      await this.activateInitialPerspective();\n    }\n    catch (error) {\n      // Catch error to not abort workbench startup.\n      this._logger.error('Failed to load workbench perspective. Caused by:', error);\n    }\n  }\n\n  /**\n   * Registers perspectives configured in {@link WorkbenchConfig}.\n   */\n  private async registerPerspectivesFromConfig(): Promise<void> {\n    const layout = this._workbenchConfig.layout;\n\n    // Create perspective from layout (if any).\n    if (typeof layout === 'function') {\n      await this.registerPerspective({id: DEFAULT_WORKBENCH_PERSPECTIVE_ID, layout});\n    }\n    // Register configured perspectives (if any).\n    else if (layout?.perspectives?.length) {\n      for (const perspective of layout.perspectives) {\n        await this.registerPerspective(perspective);\n      }\n    }\n    // Register default perspective if no perspective is registered.\n    else if (this._perspectiveRegistry.isEmpty()) {\n      await this.registerPerspective({id: DEFAULT_WORKBENCH_PERSPECTIVE_ID, layout: (factory: WorkbenchLayoutFactory) => factory.addPart(MAIN_AREA)});\n    }\n  }\n\n  /**\n   * Registers an anonymous perspective if the window name indicates it.\n   * The perspective is marked transient, with its layout only memoized, not persisted.\n   */\n  private async registerAnonymousPerspectiveFromWindowName(): Promise<void> {\n    const windowPerspectiveId = parsePerspectiveIdFromWindowName();\n    if (windowPerspectiveId?.startsWith(ANONYMOUS_PERSPECTIVE_ID_PREFIX)) {\n      await this.registerPerspective({\n        id: windowPerspectiveId,\n        layout: factory => factory.addPart(MAIN_AREA),\n        transient: true,\n      });\n    }\n  }\n\n  /**\n   * Registers the given perspective to arrange views around the main area.\n   */\n  public async registerPerspective(definition: WorkbenchPerspectiveDefinition): Promise<void> {\n    const perspectiveId = definition.id;\n\n    if (this._perspectiveRegistry.has(perspectiveId)) {\n      throw Error(`Failed to register perspective '${perspectiveId}'. Another perspective is already registered under that identity.`);\n    }\n    if (definition.canActivate && !(await runInInjectionContext(this._injector, () => definition.canActivate!()))) {\n      return;\n    }\n\n    this._perspectiveRegistry.register(perspectiveId, this.createPerspective(definition));\n  }\n\n  private createPerspective(definition: WorkbenchPerspectiveDefinition): ɵWorkbenchPerspective {\n    // Construct the handle in an injection context that shares the perspective's lifecycle, allowing for automatic cleanup of effects and RxJS interop functions.\n    const perspectiveInjector = Injector.create({parent: this._injector, providers: [], name: `Workbench Perspective ${definition.id}`});\n    return runInInjectionContext(perspectiveInjector, () => new ɵWorkbenchPerspective(definition));\n  }\n\n  /**\n   * Switches to the specified perspective. The main area will not change, if any.\n   *\n   * @param id - Specifies the id of the perspective to activate.\n   * @param options - Controls activation of the perspective.\n   * @param options.storePerspectiveAsActive - Controls if to store the perspective as the active perspective. Defaults to `true`.\n   * @return `true` if activated the perspective, otherwise `false`.\n   */\n  public async switchPerspective(id: string, options?: {storePerspectiveAsActive?: boolean}): Promise<boolean> {\n    if (this.activePerspective()?.id === id) {\n      return true;\n    }\n\n    // Switch perspective.\n    this._switchingPerspective.set(true);\n    const activated = await this._perspectiveRegistry.get(id).activate().finally(() => this._switchingPerspective.set(false));\n\n    // Store activated perspective.\n    if (activated && (options?.storePerspectiveAsActive ?? true)) {\n      await this._layoutStorageService.storeActivePerspectiveId(id);\n      window.name = generatePerspectiveWindowName(id);\n    }\n    return activated;\n  }\n\n  /**\n   * Resets the currently active perspective to its initial layout. The main area will not change.\n   */\n  public async resetPerspective(): Promise<void> {\n    const activePerspective = this.activePerspective();\n    if (!activePerspective) {\n      return;\n    }\n    this._resettingPerspective.set(true);\n    try {\n      await activePerspective.reset();\n    }\n    finally {\n      this._resettingPerspective.set(false);\n    }\n  }\n\n  /**\n   * Indicates when switching perspective.\n   */\n  public get switchingPerspective(): Signal<boolean> {\n    return this._switchingPerspective;\n  }\n\n  /**\n   * Indicates when resetting perspective.\n   */\n  public get resettingPerspective(): Signal<boolean> {\n    return this._resettingPerspective;\n  }\n\n  /**\n   * Activates the initial perspective.\n   */\n  private async activateInitialPerspective(): Promise<void> {\n    if (this._perspectiveRegistry.isEmpty()) {\n      throw Error('[NullPerspectiveError] No perspective found to activate.');\n    }\n\n    const perspectiveId = await this.determineInitialPerspective() ?? this._perspectiveRegistry.elements()[0]!.id;\n    const activation = this.switchPerspective(perspectiveId, {storePerspectiveAsActive: false});\n\n    // Switching perspective blocks until the initial navigation has been performed. By default, Angular performs\n    // the initial navigation after running app initializers. Therefore, do not await perspective activation when\n    // starting the workbench during app initialization. Otherwise, Angular would never complete app initialization.\n    if (this._applicationInitStatus.done as boolean) {\n      await activation;\n    }\n  }\n\n  /**\n   * Determines which perspective to activate, with the following precedence:\n   *\n   * 1. Perspective defined as window name.\n   * 2. Perspective defined in storage.\n   * 3. Perspective configured in the workbench config.\n   */\n  private async determineInitialPerspective(): Promise<string | undefined> {\n    // Find perspective in window name.\n    const perspectiveFromWindow = parsePerspectiveIdFromWindowName();\n    if (perspectiveFromWindow && this._perspectiveRegistry.has(perspectiveFromWindow)) {\n      return perspectiveFromWindow;\n    }\n\n    // Find perspective in storage.\n    const perspectiveFromStorage = await this._layoutStorageService.loadActivePerspectiveId();\n    if (perspectiveFromStorage && this._perspectiveRegistry.has(perspectiveFromStorage)) {\n      return perspectiveFromStorage;\n    }\n\n    // Find perspective in config.\n    const perspectiveFromConfig = typeof this._workbenchConfig.layout === 'object' && this._workbenchConfig.layout.initialPerspective;\n    if (typeof perspectiveFromConfig === 'string') {\n      return perspectiveFromConfig;\n    }\n    if (typeof perspectiveFromConfig === 'function') {\n      return (await runInInjectionContext(this._injector, () => perspectiveFromConfig([...this._perspectiveRegistry.elements()])));\n    }\n    return undefined;\n  }\n}\n\n/**\n * Identifier for the \"default\" perspective that the workbench creates if not providing a named layout.\n */\nconst DEFAULT_WORKBENCH_PERSPECTIVE_ID = 'default';\n\n/**\n * Generates the window name for given perspective to control which perspective to display in a window.\n */\nexport function generatePerspectiveWindowName(perspectiveId: string): string {\n  return `scion.workbench.perspective.${perspectiveId}`;\n}\n\n/**\n * Parses the perspective identity from the window name, returning `null` if not set.\n */\nfunction parsePerspectiveIdFromWindowName(): string | null {\n  const windowNameRegex = new RegExp(`^${generatePerspectiveWindowName('(?<perspective>.+)')}$`);\n  return window.name.match(windowNameRegex)?.groups!['perspective'] ?? null;\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {ɵWorkbenchPart} from './ɵworkbench-part.model';\nimport {WorkbenchElementRegistry} from '../registry/workbench-element-registry';\nimport {PartId} from '../workbench.identifiers';\n\n/**\n * Registry for {@link WorkbenchPart} elements.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchPartRegistry extends WorkbenchElementRegistry<PartId, ɵWorkbenchPart> {\n  constructor() {\n    super({\n      nullElementErrorFn: partId => Error(`[NullPartError] Part '${partId}' not found.`),\n      onUnregister: part => part.destroy(),\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {WorkbenchPartActionFn} from '../workbench.model';\nimport {Injectable} from '@angular/core';\nimport {WorkbenchElementRegistry} from '../registry/workbench-element-registry';\n\n/**\n * Registry for {@link WorkbenchPartAction} factory functions.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchPartActionRegistry extends WorkbenchElementRegistry<WorkbenchPartActionFn, WorkbenchPartActionFn> {\n\n  constructor() {\n    super({}); // NG2006: Angular requires a super call\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {DOCUMENT, effect, inject, Injectable, untracked} from '@angular/core';\nimport {fromMutation$} from '@scion/toolkit/observable';\nimport {map, subscribeOn} from 'rxjs/operators';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {renderingFlag} from '../layout/rendering-flag';\nimport {readCssVariable} from '../common/dom.util';\nimport {animationFrameScheduler} from 'rxjs';\n\n/**\n * Enables switching between workbench themes.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchThemeSwitcher {\n\n  /**\n   * Specifies the workbench theme.\n   *\n   * Defaults to the `sci-theme` attribute set on the HTML root element, or to the user's OS color scheme preference if not set.\n   *\n   * Built-in themes: `scion-light` and `scion-dark`.\n   */\n  public readonly theme = renderingFlag<string | null>(\n    'scion.workbench.theme',\n    readCssVariable(inject(DOCUMENT).documentElement, '--sci-theme', null),\n  );\n\n  constructor() {\n    this.installThemeAttributeSynchronizer();\n  }\n\n  /**\n   * Synchronizes {@link WorkbenchService.settings.theme} and 'sci-theme' attribute on HTML root element.\n   *\n   * ```html\n   * <html [attr.sci-theme]=\"workbenchService.settings.theme\">\n   *   ...\n   * </html>\n   * ```\n   */\n  private installThemeAttributeSynchronizer(): void {\n    const documentRoot = inject(DOCUMENT).documentElement;\n\n    // Add theme attribute to the HTML root element.\n    effect(() => {\n      const theme = this.theme();\n      untracked(() => {\n        if (theme) {\n          documentRoot.setAttribute('sci-theme', theme);\n        }\n        else {\n          documentRoot.removeAttribute('sci-theme');\n        }\n      });\n    });\n\n    // Read theme from HTML root element.\n    fromMutation$(documentRoot, {attributeFilter: ['sci-theme']})\n      .pipe(\n        subscribeOn(animationFrameScheduler), // ensure styles of theme to be applied when reading computed styles\n        map(() => getComputedStyle(documentRoot).getPropertyValue('--sci-theme') || null),\n        takeUntilDestroyed(),\n      )\n      .subscribe(theme => {\n        this.theme.set(theme);\n      });\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {WorkbenchViewMenuItemFn} from '../workbench.model';\nimport {Injectable} from '@angular/core';\nimport {WorkbenchElementRegistry} from '../registry/workbench-element-registry';\n\n/**\n * Registry for {@link WorkbenchMenuItem} factory functions to contribute menu items to the context menu of views.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchViewMenuItemRegistry extends WorkbenchElementRegistry<WorkbenchViewMenuItemFn, WorkbenchViewMenuItemFn> {\n\n  constructor() {\n    super({}); // NG2006: Angular requires a super call\n  }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {forwardRef, inject, Injectable, Signal, signal} from '@angular/core';\nimport {takeUntilDestroyed, toObservable} from '@angular/core/rxjs-interop';\nimport {EMPTY, fromEvent, merge, switchMap} from 'rxjs';\nimport {finalize, startWith} from 'rxjs/operators';\nimport {WorkbenchElement} from '../workbench.model';\n\n/**\n * Provides the workbench element that contains the focused DOM element, which is currently receiving keyboard events.\n */\n@Injectable({providedIn: 'root', useExisting: forwardRef(() => ɵWorkbenchFocusMonitor)})\nexport abstract class WorkbenchFocusMonitor {\n\n  /**\n   * Provides the focused workbench element, or `null` if the focus is on a DOM element outside any workbench element.\n   */\n  public abstract readonly activeElement: Signal<WorkbenchElement | null>;\n}\n\n/**\n * Tracks the focus of the passed HTML element, making the workbench element the workbench focus owner when the element\n * or any of its direct or indirect child elements gains focus.\n *\n * Stops focus tracking when the current injection context is destroyed, unsetting the active workbench element if it was the focus owner.\n *\n * This function must be called within an injection context.\n */\nexport function trackFocus(target: HTMLElement, workbenchElement: WorkbenchElement | null): FocusTrackerRef {\n  const focusMonitor = inject(ɵWorkbenchFocusMonitor);\n\n  toObservable(focusMonitor.activeElement)\n    .pipe(\n      startWith(focusMonitor.activeElement()), // Immediately subscribe to `focusin` events, required when the DOM element is focused right after invocation.\n      switchMap(activeWorkbenchElement => activeWorkbenchElement === workbenchElement ? EMPTY : merge(fromEvent<FocusEvent>(target, 'focusin', {once: true}), fromEvent(target, 'sci-microfrontend-focusin', {once: true}))),\n      finalize(() => requestAnimationFrame(() => focusMonitor.unsetActiveElement(workbenchElement))), // Asynchronously unset the active workbench element to prevent a `null` focus during destruction until the next element gains focus.\n      takeUntilDestroyed(),\n    )\n    .subscribe(() => {\n      focusMonitor.setActiveElement(workbenchElement);\n    });\n\n  return {\n    unsetActiveElement: () => focusMonitor.unsetActiveElement(workbenchElement),\n  };\n}\n\n/**\n * Reference for tracking focus state of the workbench element.\n */\nexport interface FocusTrackerRef {\n\n  /**\n   * Unsets the active workbench element if the tracked element was the focus owner.\n   */\n  unsetActiveElement(): void;\n}\n\n@Injectable({providedIn: 'root'})\nclass ɵWorkbenchFocusMonitor implements WorkbenchFocusMonitor {\n\n  public activeElement = signal<WorkbenchElement | null>(null);\n\n  public setActiveElement(element: WorkbenchElement | null): void {\n    this.activeElement.set(element);\n  }\n\n  public unsetActiveElement(element: WorkbenchElement | null): void {\n    if (this.activeElement() === element) {\n      this.activeElement.set(null);\n    }\n  }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {assertNotInReactiveContext, computed, Injectable, Signal} from '@angular/core';\nimport {ɵWorkbenchDialog} from './ɵworkbench-dialog.model';\nimport {DialogId, NotificationId, PartId, PopupId, ViewId} from '../workbench.identifiers';\nimport {WorkbenchElementRegistry} from '../registry/workbench-element-registry';\n\n/**\n * Registry for {@link ɵWorkbenchDialog} elements.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchDialogRegistry extends WorkbenchElementRegistry<DialogId, ɵWorkbenchDialog> {\n\n  constructor() {\n    super({\n      nullElementErrorFn: dialogId => Error(`[NullDialogError] Dialog '${dialogId}' not found.`),\n      onUnregister: dialog => dialog.destroy(),\n    });\n  }\n\n  /**\n   * Gets the position of a dialog in its invocation context.\n   */\n  public indexOf(dialog: ɵWorkbenchDialog): number {\n    const index = this.elements().filter(element => element.invocationContext?.elementId === dialog.invocationContext?.elementId).indexOf(dialog);\n    if (index === -1) {\n      throw Error('[NullDialogError] Dialog not found');\n    }\n    return index;\n  }\n\n  /**\n   * Gets the topmost dialog in the given context, including application modal dialogs overlapping any context.\n   *\n   * Method must not be called in a reactive context.\n   */\n  public top(context?: ViewId | PartId | DialogId | PopupId | NotificationId): Signal<ɵWorkbenchDialog | null> {\n    assertNotInReactiveContext(this.top, 'Call WorkbenchDialogRegistry.top() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    return computed(() => {\n      const top = this.elements()\n        .filter(dialog => dialog.modal)\n        .filter(dialog => !dialog.invocationContext || dialog.invocationContext.elementId === context)\n        .at(-1) ?? null;\n      if (!top || top.id === context) {\n        return null;\n      }\n\n      return top;\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {WorkbenchElementRegistry} from '../registry/workbench-element-registry';\nimport {PopupId} from '../workbench.identifiers';\nimport {ɵWorkbenchPopup} from './ɵworkbench-popup.model';\n\n/**\n * Registry for {@link WorkbenchPopup} elements.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchPopupRegistry extends WorkbenchElementRegistry<PopupId, ɵWorkbenchPopup> {\n  constructor() {\n    super({\n      nullElementErrorFn: popupId => Error(`[NullPopupError] Popup '${popupId}' not found.`),\n      onUnregister: popup => popup.destroy(),\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {assertNotInReactiveContext, inject, Injectable} from '@angular/core';\nimport {WorkbenchPartActionFn, WorkbenchViewMenuItemFn} from './workbench.model';\nimport {Disposable} from './common/disposable';\nimport {WorkbenchService} from './workbench.service';\nimport {WorkbenchRouter} from './routing/workbench-router.service';\nimport {WorkbenchViewRegistry} from './view/workbench-view.registry';\nimport {WorkbenchPerspectiveService} from './perspective/workbench-perspective.service';\nimport {WorkbenchPerspectiveDefinition} from './perspective/workbench-perspective.model';\nimport {WorkbenchPartRegistry} from './part/workbench-part.registry';\nimport {ɵWorkbenchView} from './view/ɵworkbench-view.model';\nimport {ɵWorkbenchPart} from './part/ɵworkbench-part.model';\nimport {ɵWorkbenchPerspective} from './perspective/ɵworkbench-perspective.model';\nimport {WorkbenchPerspectiveRegistry} from './perspective/workbench-perspective.registry';\nimport {WorkbenchPartActionRegistry} from './part/workbench-part-action.registry';\nimport {WorkbenchThemeSwitcher} from './theme/workbench-theme-switcher.service';\nimport {DialogId, PartId, PopupId, ViewId} from './workbench.identifiers';\nimport {WorkbenchLayoutService} from './layout/workbench-layout.service';\nimport {WorkbenchViewMenuItemRegistry} from './view/workbench-view-menu-item.registry';\nimport {WorkbenchFocusMonitor} from './focus/workbench-focus-tracker.service';\nimport {WorkbenchDialogRegistry} from './dialog/workbench-dialog.registry';\nimport {WorkbenchPopupRegistry} from './popup/workbench-popup.registry';\nimport {ɵWorkbenchPopup} from './popup/ɵworkbench-popup.model';\nimport {ɵWorkbenchDialog} from './dialog/ɵworkbench-dialog.model';\n\n@Injectable({providedIn: 'root'})\nexport class ɵWorkbenchService implements WorkbenchService {\n\n  private readonly _workbenchRouter = inject(WorkbenchRouter);\n  private readonly _perspectiveRegistry = inject(WorkbenchPerspectiveRegistry);\n  private readonly _partRegistry = inject(WorkbenchPartRegistry);\n  private readonly _viewRegistry = inject(WorkbenchViewRegistry);\n  private readonly _dialogRegistry = inject(WorkbenchDialogRegistry);\n  private readonly _popupRegistry = inject(WorkbenchPopupRegistry);\n  private readonly _partActionRegistry = inject(WorkbenchPartActionRegistry);\n  private readonly _viewMenuItemRegistry = inject(WorkbenchViewMenuItemRegistry);\n  private readonly _perspectiveService = inject(WorkbenchPerspectiveService);\n\n  public readonly layout = inject(WorkbenchLayoutService).layout;\n  public readonly perspectives = inject(WorkbenchPerspectiveRegistry).elements;\n  public readonly parts = inject(WorkbenchPartRegistry).elements;\n  public readonly views = inject(WorkbenchViewRegistry).elements;\n  public readonly dialogs = inject(WorkbenchDialogRegistry).elements;\n  public readonly popups = inject(WorkbenchPopupRegistry).elements;\n  public readonly activePerspective = inject(WorkbenchPerspectiveService).activePerspective;\n  public readonly activeElement = inject(WorkbenchFocusMonitor).activeElement;\n  public readonly settings = {\n    theme: inject(WorkbenchThemeSwitcher).theme,\n    panelAlignment: inject(WorkbenchLayoutService).panelAlignment,\n    panelAnimation: inject(WorkbenchLayoutService).panelAnimation,\n  };\n\n  /** @inheritDoc */\n  public getPerspective(perspectiveId: string): ɵWorkbenchPerspective | null {\n    return this._perspectiveRegistry.get(perspectiveId, {orElse: null});\n  }\n\n  /** @inheritDoc */\n  public getPart(partId: PartId): ɵWorkbenchPart | null {\n    return this._partRegistry.get(partId, {orElse: null});\n  }\n\n  /** @inheritDoc */\n  public getView(viewId: ViewId): ɵWorkbenchView | null {\n    return this._viewRegistry.get(viewId, {orElse: null});\n  }\n\n  /** @inheritDoc */\n  public getDialog(dialogId: DialogId): ɵWorkbenchDialog | null {\n    return this._dialogRegistry.get(dialogId, {orElse: null});\n  }\n\n  /** @inheritDoc */\n  public getPopup(popupId: PopupId): ɵWorkbenchPopup | null {\n    return this._popupRegistry.get(popupId, {orElse: null});\n  }\n\n  /** @inheritDoc */\n  public registerPerspective(perspective: WorkbenchPerspectiveDefinition): Promise<void> {\n    assertNotInReactiveContext(this.registerPerspective, 'Call WorkbenchService.registerPerspective() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n    return this._perspectiveService.registerPerspective(perspective);\n  }\n\n  /** @inheritDoc */\n  public switchPerspective(id: string): Promise<boolean> {\n    assertNotInReactiveContext(this.switchPerspective, 'Call WorkbenchService.switchPerspective() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n    return this._perspectiveService.switchPerspective(id);\n  }\n\n  /** @inheritDoc */\n  public async resetPerspective(): Promise<void> {\n    assertNotInReactiveContext(this.resetPerspective, 'Call WorkbenchService.resetPerspective() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n    await this._perspectiveService.resetPerspective();\n  }\n\n  /** @inheritDoc */\n  public async closeViews(...viewIds: ViewId[]): Promise<boolean> {\n    assertNotInReactiveContext(this.closeViews, 'Call WorkbenchService.closeViews() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n    return this._workbenchRouter.navigate(layout => viewIds.reduce((layout, viewId) => layout.removeView(viewId), layout));\n  }\n\n  /** @inheritDoc */\n  public registerPartAction(fn: WorkbenchPartActionFn): Disposable {\n    assertNotInReactiveContext(this.registerPartAction, 'Call WorkbenchService.registerPartAction() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n    this._partActionRegistry.register(fn, fn);\n    return {\n      dispose: () => this._partActionRegistry.unregister(fn),\n    };\n  }\n\n  /** @inheritDoc */\n  public registerViewMenuItem(fn: WorkbenchViewMenuItemFn): Disposable {\n    assertNotInReactiveContext(this.registerViewMenuItem, 'Call WorkbenchService.registerViewMenuItem() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n    this._viewMenuItemRegistry.register(fn, fn);\n    return {\n      dispose: () => this._viewMenuItemRegistry.unregister(fn),\n    };\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Disposable} from './common/disposable';\nimport {WorkbenchElement, WorkbenchPartActionFn, WorkbenchViewMenuItemFn} from './workbench.model';\nimport {WorkbenchView} from './view/workbench-view.model';\nimport {WorkbenchPerspective, WorkbenchPerspectiveDefinition} from './perspective/workbench-perspective.model';\nimport {WorkbenchPart} from './part/workbench-part.model';\nimport {Injectable, Signal, WritableSignal} from '@angular/core';\nimport {ɵWorkbenchService} from './ɵworkbench.service';\nimport {WorkbenchLayout} from './layout/workbench-layout';\nimport {DialogId, PartId, PopupId, ViewId} from './workbench.identifiers';\nimport {WorkbenchDialog} from './dialog/workbench-dialog.model';\nimport {WorkbenchPopup} from './popup/workbench-popup.model';\n\n/**\n * The central class of the SCION Workbench.\n *\n * SCION Workbench enables the creation of Angular web applications that require a flexible layout to display content side-by-side\n * or stacked, all personalizable by the user via drag & drop. This type of layout is ideal for applications with non-linear workflows,\n * enabling users to work on content in parallel.\n *\n * An application can have multiple layouts, called perspectives. A perspective defines an arrangement of parts and views.\n * Parts can be docked to the side or positioned relative to each other. Views are stacked in parts and can be dragged to other parts.\n * Content can be displayed in both parts and views.\n *\n * Users can personalize the layout of a perspective and switch between perspectives. The workbench remembers the layout of a perspective,\n * restoring it the next time it is activated.\n *\n * A perspective typically has a main area part and parts docked to the side, providing navigation and context-sensitive assistance to support\n * the user's workflow. Initially empty or displaying a welcome page, the main area is where the workbench opens views by default. Users can split\n * the main area (or any other part) by dragging views side-by-side, vertically and horizontally, even across windows.\n *\n * Unlike any other part, the main area is shared between perspectives, and its layout is not reset when resetting perspectives. Having a main area and\n * multiple perspectives is optional.\n */\n@Injectable({providedIn: 'root', useExisting: ɵWorkbenchService})\nexport abstract class WorkbenchService {\n\n  /**\n   * Provides the layout of the workbench.\n   *\n   * The layout is an immutable object. Modifications have no side effects. The layout can be modified using {@link WorkbenchRouter.navigate}.\n   */\n  public abstract readonly layout: Signal<WorkbenchLayout>;\n\n  /**\n   * Provides the handles of the perspectives registered in the workbench.\n   *\n   * Each handle represents a perspective registered in the workbench. The handle has methods to interact with the perspective.\n   * Perspectives are registered via {@link WorkbenchConfig} passed to {@link provideWorkbench} or via {@link WorkbenchService}.\n   */\n  public abstract readonly perspectives: Signal<WorkbenchPerspective[]>;\n\n  /**\n   * Provides the active perspective, or `undefined` if none is active (e.g., during workbench startup).\n   */\n  public abstract readonly activePerspective: Signal<WorkbenchPerspective | undefined>;\n\n  /**\n   * Returns the handle of the specified perspective, or `null` if not found.\n   */\n  public abstract getPerspective(perspectiveId: string): WorkbenchPerspective | null;\n\n  /**\n   * Registers the given perspective.\n   *\n   * The perspective can be activated via {@link WorkbenchService#switchPerspective}.\n   */\n  public abstract registerPerspective(perspective: WorkbenchPerspectiveDefinition): Promise<void>;\n\n  /**\n   * Switches to the specified perspective.\n   *\n   * Switching perspective does not change the layout of the main area, if any.\n   */\n  public abstract switchPerspective(id: string): Promise<boolean>;\n\n  /**\n   * Resets the currently active perspective to its initial layout. Resetting the perspective does not change the layout of the main area, if any.\n   */\n  public abstract resetPerspective(): Promise<void>;\n\n  /**\n   * Provides the handles of the parts in the current workbench layout.\n   *\n   * Each handle represents a part in the layout. The handle has methods to interact with the part. Parts are added to the layout via {@link WorkbenchRouter}.\n   */\n  public abstract readonly parts: Signal<WorkbenchPart[]>;\n\n  /**\n   * Provides the handles of the views in the current workbench layout.\n   *\n   * Each handle represents a view in the layout. The handle has methods to interact with the view. Views are opened via {@link WorkbenchRouter}.\n   */\n  public abstract readonly views: Signal<WorkbenchView[]>;\n\n  /**\n   * Provides the handles of the dialogs opened in the workbench.\n   *\n   * Each handle represents a dialog. The handle has methods to interact with the dialog. Dialogs are opened via {@link WorkbenchDialogService}.\n   */\n  public abstract readonly dialogs: Signal<WorkbenchDialog[]>;\n\n  /**\n   * Provides the handles of the popups opened in the workbench.\n   *\n   * Each handle represents a popup. The handle has methods to interact with the popup. Popups are opened via {@link WorkbenchPopupService}.\n   */\n  public abstract readonly popups: Signal<WorkbenchPopup[]>;\n\n  /**\n   * Returns the handle of the specified part, or `null` if not found.\n   *\n   * A handle represents a part in the layout. The handle has methods to interact with the part. A part is added to the layout via {@link WorkbenchRouter}.\n   */\n  public abstract getPart(partId: PartId): WorkbenchPart | null;\n\n  /**\n   * Returns the handle of the specified view, or `null` if not found.\n   *\n   * A handle represents a view in the layout. The handle has methods to interact with the view. A view is opened via {@link WorkbenchRouter}.\n   */\n  public abstract getView(viewId: ViewId): WorkbenchView | null;\n\n  /**\n   * Returns the handle of the specified dialog, or `null` if not found.\n   *\n   * A handle represents a dialog opened in the workbench. The handle has methods to interact with the dialog. A dialog is opened via {@link WorkbenchDialogService}.\n   */\n  public abstract getDialog(dialogId: DialogId): WorkbenchDialog | null;\n\n  /**\n   * Returns the handle of the specified popup, or `null` if not found.\n   *\n   * A handle represents a popup opened in the workbench. The handle has methods to interact with the popup. A popup is opened via {@link WorkbenchPopupService}.\n   */\n  public abstract getPopup(popupId: PopupId): WorkbenchPopup | null;\n\n  /**\n   * Closes the specified workbench views.\n   *\n   * Note: This instruction runs asynchronously via URL routing.\n   */\n  public abstract closeViews(...viewIds: ViewId[]): Promise<boolean>;\n\n  /**\n   * Registers a factory function to contribute an action to a {@link WorkbenchPart}.\n   *\n   * Part actions are displayed in the part bar, enabling interaction with the part and its content. Actions can be aligned to the left or right.\n   *\n   * The function:\n   * - Can return a component or template, or an object literal for an object literal for more control.\n   * - Is called per part. Returning the action adds it to the part, returning `null` skips it.\n   * - Can call `inject` to get any required dependencies.\n   * - Runs in a reactive context and is called again when tracked signals change.\n   *   Use Angular's untracked function to execute code outside this reactive context.\n   *\n   * Alternatively to registering a function, actions can be provided declaratively in HTML templates using the {@link WorkbenchPartActionDirective}.\n   *\n   * ```html\n   * <ng-template wbPartAction let-part>\n   *   ...\n   * </ng-template>\n   * ```\n   *\n   * @param fn - function to contribute an action.\n   * @return handle to unregister the action.\n   */\n  public abstract registerPartAction(fn: WorkbenchPartActionFn): Disposable;\n\n  /**\n   * Registers a factory function to contribute a menu item to the context menu of a {@link WorkbenchView}.\n   *\n   * Right-clicking on a view tab opens a context menu to interact with the view and its content.\n   *\n   * The function:\n   * - Is called per view. Returning the menu item adds it to the context menu of the view, returning `null` skips it.\n   * - Can call `inject` to get any required dependencies.\n   * - Runs in a reactive context and is called again when tracked signals change.\n   *   Use Angular's `untracked` function to execute code outside this reactive context.\n   *\n   * Alternatively to registering a function, menu items can be provided declaratively in HTML templates using the {@link WorkbenchViewMenuItemDirective}.\n   *\n   * ```html\n   * <ng-template wbViewMenuItem (action)=\"...\" let-view>\n   *   ...\n   * </ng-template>\n   * ```\n   *\n   * @param fn - function to contribute a menu item.\n   * @return handle to unregister the menu item.\n   */\n  public abstract registerViewMenuItem(fn: WorkbenchViewMenuItemFn): Disposable;\n\n  /**\n   * Defines settings to adapt the workbench to personal preferences and working styles.\n   *\n   * Settings are stored in {@link WorkbenchConfig.storage} (defaults to local storage).\n   */\n  public abstract readonly settings: {\n    /**\n     * Specifies the workbench theme.\n     *\n     * Defaults to the `sci-theme` attribute set on the HTML root element, or to the user's OS color scheme preference if not set.\n     *\n     * Built-in themes: `scion-light` and `scion-dark`.\n     */\n    theme: WritableSignal<string | null>;\n    /**\n     * Controls the alignment of the bottom docked panel.\n     *\n     * Defaults to the `--sci-workbench-layout-panel-align` design token, or `justify` if not set.\n     */\n    panelAlignment: WritableSignal<'left' | 'right' | 'center' | 'justify'>;\n    /**\n     * Controls animation of docked panels.\n     *\n     * Defaults to the `--sci-workbench-layout-panel-animate` design token, or `true` if not set.\n     */\n    panelAnimation: WritableSignal<boolean>;\n  };\n\n  /**\n   * Provides the focused workbench element, or `null` if the focus is on a DOM element outside any workbench element.\n   */\n  public abstract readonly activeElement: Signal<WorkbenchElement | null>;\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, inject, InjectionToken, Signal, signal, ViewContainerRef, WritableSignal} from '@angular/core';\nimport {boundingClientRect} from '@scion/components/dimension';\nimport {WorkbenchElement} from './workbench.model';\n\n/**\n * DI token to inject the DOM location where to attach iframes.\n */\nexport const IFRAME_OVERLAY_HOST = new InjectionToken<WritableSignal<ViewContainerRef | undefined>>('IFRAME_OVERLAY_HOST', {\n  providedIn: 'root',\n  factory: () => signal(undefined),\n});\n\n/**\n * DI token to inject the DOM location where to attach the visual placeholder when dragging a view over a drop zone.\n */\nexport const VIEW_DROP_ZONE_OVERLAY_HOST = new InjectionToken<WritableSignal<ViewContainerRef | undefined>>('VIEW_DROP_ZONE_OVERLAY_HOST', {\n  providedIn: 'root',\n  factory: () => signal(undefined),\n});\n\n/**\n * DI token to inject the DOM location of the {@link WorkbenchComponent} HTML element.\n */\nexport const WORKBENCH_COMPONENT_REF = new InjectionToken<WritableSignal<ViewContainerRef | undefined>>('WORKBENCH_COMPONENT_REF', {\n  providedIn: 'root',\n  factory: () => signal(undefined),\n});\n\n/**\n * DI token to inject the bounds of the {@link WorkbenchComponent} HTML element.\n */\nexport const WORKBENCH_COMPONENT_BOUNDS = new InjectionToken<Signal<DOMRect | undefined>>('WORKBENCH_COMPONENT_BOUNDS', {\n  providedIn: 'root',\n  factory: () => {\n    const workbenchElement = inject(WORKBENCH_COMPONENT_REF);\n    return boundingClientRect(computed(() => workbenchElement()?.element.nativeElement as HTMLElement | undefined));\n  },\n});\n\n/**\n * DI token to inject the workbench element available in the current context.\n */\nexport const WORKBENCH_ELEMENT = new InjectionToken<WorkbenchElement>('WORKBENCH_ELEMENT');\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Arrays, Objects} from '@scion/toolkit/util';\nimport {computed, Signal, signal} from '@angular/core';\n\n/**\n * Container for managing CSS classes set in different scopes.\n */\nexport class ClassList {\n\n  private readonly _layout = signal<string[]>([], {equal: isEqualArray});\n  private readonly _navigation = signal<string[]>([], {equal: isEqualArray});\n  private readonly _route = signal<string[]>([], {equal: isEqualArray});\n  private readonly _application = signal<string[]>([], {equal: isEqualArray});\n\n  /**\n   * CSS classes as list.\n   */\n  public readonly asList: Signal<string[]>;\n\n  /**\n   * CSS classes as {@link Map} grouped by scope.\n   */\n  public readonly asMap: Signal<ClassListMap>;\n\n  constructor() {\n    this.asList = computed(() => Arrays.distinct(new Array<string>()\n      .concat(this._layout())\n      .concat(this._navigation())\n      .concat(this._route())\n      .concat(this._application())));\n\n    this.asMap = computed(() => removeEmptyEntries(new Map<ClassListScopes, string[]>()\n      .set('layout', this._layout())\n      .set('navigation', this._navigation())\n      .set('route', this._route())\n      .set('application', this._application())));\n  }\n\n  /**\n   * Specifies CSS classes defined by the layout.\n   */\n  public set layout(cssClasses: string | string[] | null | undefined) {\n    this._layout.set(Arrays.coerce(cssClasses));\n  }\n\n  /**\n   * Returns CSS classes defined in the scope 'layout'.\n   */\n  public get layout(): Signal<string[]> {\n    return this._layout;\n  }\n\n  /**\n   * Specifies CSS classes associated with the navigation.\n   */\n  public set navigation(cssClasses: string | string[] | null | undefined) {\n    this._navigation.set(Arrays.coerce(cssClasses));\n  }\n\n  /**\n   * Returns CSS classes defined in the scope 'navigation'.\n   */\n  public get navigation(): Signal<string[]> {\n    return this._navigation;\n  }\n\n  /**\n   * Specifies CSS classes defined by the route.\n   */\n  public set route(cssClasses: string | string[] | null | undefined) {\n    this._route.set(Arrays.coerce(cssClasses));\n  }\n\n  /**\n   * Returns CSS classes defined in the scope 'route'.\n   */\n  public get route(): Signal<string[]> {\n    return this._route;\n  }\n\n  /**\n   * Specifies CSS classes set by the application.\n   */\n  public set application(cssClasses: string | string[] | null | undefined) {\n    this._application.set(Arrays.coerce(cssClasses));\n  }\n\n  /**\n   * Returns classes defined in the scope 'application'.\n   */\n  public get application(): Signal<string[]> {\n    return this._application;\n  }\n}\n\n/**\n * Represents scopes used in {@link ClassList}.\n *\n * `layout`: Use for CSS classes defined on the layout.\n * `navigation`: Use for CSS classes associated with the navigation.\n * `route`: Use for CSS classes defined on the route.\n * `application`: Use for CSS classes set by the application.\n */\nexport type ClassListScopes = 'layout' | 'navigation' | 'route' | 'application';\n\n/**\n * CSS classes grouped by scope.\n */\nexport type ClassListMap = ReadonlyMap<ClassListScopes, string[]>;\n\n/**\n * Creates a copy with empty map entries removed.\n */\nfunction removeEmptyEntries<K, V>(map: Map<K, V[]>): Map<K, V[]> {\n  const copy = new Map<K, V[]>(map);\n  for (const key of copy.keys()) {\n    if (!copy.get(key)?.length) {\n      copy.delete(key);\n    }\n  }\n  return copy;\n}\n\n/**\n * Compares two arrays of strings for equality, ignoring element order.\n */\nfunction isEqualArray(a: string[], b: string[]): boolean {\n  return Objects.isEqual(a, b, {ignoreArrayOrder: true});\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ComponentType} from '@angular/cdk/portal';\nimport {assertNotInReactiveContext, ComponentRef, computed, createComponent, DestroyRef, Directive, EnvironmentInjector, inject, Injector, Provider, signal, ViewContainerRef} from '@angular/core';\nimport {Logger, LoggerNames} from '../logging';\n\n/**\n * Like the Angular CDK 'ComponentPortal' but does not destroy the component on detach.\n *\n * The portal must be constructed within an injection context. Destroying the injection context will also destroy the portal.\n *\n * @see WorkbenchPortalOutletDirective\n */\nexport class WbComponentPortal<T = unknown> {\n\n  private readonly _viewContainerRef = signal<ViewContainerRef | null>(null);\n  private readonly _componentRef = signal<ComponentRef<T> | null | undefined>(undefined);\n  private readonly _attached = signal(false);\n  private readonly _logger = inject(Logger);\n\n  /**\n   * Gets the {@link ComponentRef} of the portal, or `undefined` if not constructed.\n   */\n  public readonly componentRef = this._componentRef.asReadonly();\n\n  /**\n   * Gets the {@link HTMLElement} of the portal, or `undefined` if not constructed.\n   */\n  public readonly element = computed(() => this.componentRef()?.location.nativeElement as HTMLElement | undefined);\n\n  /**\n   * Indicates if the portal has been constructed.\n   */\n  public readonly constructed = computed(() => !!this._componentRef());\n\n  /**\n   * Indicates if the portal is attached to the DOM.\n   */\n  public readonly attached = this._attached.asReadonly();\n\n  /**\n   * Indicates if the portal has been destroyed.\n   */\n  public readonly destroyed = computed(() => this._componentRef() === null);\n\n  constructor(private _componentType: ComponentType<T>, private _options?: PortalOptions) {\n    // IMPORTANT: In order for the component to have the \"correct\" injection context, construct it the time attaching it to the Angular component tree,\n    // or by calling {@link construct}. The \"correct\" injection context is crucial, for example, if the portal is displayed in a router outlet, so that\n    // child outlets can register with their logical parent outlet. The Angular router uses the logical outlet hierarchy to resolve and activate child routes.\n\n    // Destroy portal and component when the injection context is destroyed.\n    inject(DestroyRef).onDestroy(() => this.destroy());\n  }\n\n  /**\n   * Constructs the portal's component using the given injection context.\n   */\n  public construct(injector: Injector): void {\n    assertNotInReactiveContext(this.construct);\n\n    if (this.constructed()) {\n      throw Error(`[PortalError] Component already constructed. [component=${this._componentType}]`);\n    }\n    this._componentRef.set(createPortalComponent(this._componentType, {providers: this._options?.providers, injector}));\n\n    // Trigger change detection to complete the initialization of the component, necessary for components detached from the Angular component tree.\n    this._componentRef()!.changeDetectorRef.detectChanges();\n  }\n\n  /**\n   * Attaches this portal to the given {@link ViewContainerRef} according to the following rules:\n   *\n   * - If the component is not yet constructed, constructs it based on the given view container's injection context.\n   * - If already attached to the given view container, does nothing.\n   * - If already attached to a different view container, detaches it first.\n   */\n  public attach(viewContainerRef: ViewContainerRef): void {\n    assertNotInReactiveContext(this.attach);\n\n    if (this.isAttachedTo(viewContainerRef)) {\n      return;\n    }\n\n    if (this.attached()) {\n      this.detach();\n    }\n\n    this._viewContainerRef.set(viewContainerRef);\n    this._componentRef.update(componentRef => componentRef ?? createPortalComponent(this._componentType, {providers: this._options?.providers, injector: this._options?.injector ?? viewContainerRef.injector}));\n    this._logger.debug(() => 'Attaching portal', LoggerNames.LIFECYCLE, this._options?.debugName ?? this._componentType.name);\n    this._componentRef()!.changeDetectorRef.reattach();\n    this._viewContainerRef()!.insert(this._componentRef()!.hostView);\n    this._attached.set(true);\n    (this._componentRef()!.instance as Partial<OnAttach>).onAttach?.();\n  }\n\n  /**\n   * Detaches this portal from its view container without destroying it. Does nothing if not attached.\n   *\n   * The portal is removed from the DOM and its change detector detached from the Angular change detector tree,\n   * so it will not be checked for changes until it is reattached.\n   */\n  public detach(): void {\n    assertNotInReactiveContext(this.detach);\n\n    if (!this.attached()) {\n      return;\n    }\n\n    this._logger.debug(() => 'Detaching portal', LoggerNames.LIFECYCLE, this._options?.debugName ?? this._componentType.name);\n\n    (this._componentRef()!.instance as Partial<OnDetach>).onDetach?.();\n    this._viewContainerRef()!.detach(this._viewContainerRef()!.indexOf(this._componentRef()!.hostView));\n    this._componentRef()!.changeDetectorRef.detach();\n    this._attached.set(false);\n  }\n\n  /**\n   * Tests if attached to the given {@link ViewContainerRef}.\n   */\n  public isAttachedTo(viewContainerRef: ViewContainerRef): boolean {\n    return this._viewContainerRef() === viewContainerRef && this.attached();\n  }\n\n  /**\n   * Destroys the portal's component.\n   */\n  public destroy(): void {\n    assertNotInReactiveContext(this.destroy);\n\n    this._logger.debug(() => 'Destroying portal', LoggerNames.LIFECYCLE, this._options?.debugName ?? this._componentType.name);\n    this._componentRef()?.destroy();\n    this._componentRef.set(null);\n    this._viewContainerRef.set(null);\n    this._attached.set(false);\n  }\n}\n\n/**\n * Controls instantiation of the component.\n */\nexport interface PortalOptions {\n  /**\n   * Specifies providers available for injection in the component.\n   */\n  providers?: Provider[];\n  /**\n   * Specifies the injector for the instantiation of the component, giving control over the objects available\n   * for injection in the component. Defaults to the element injector.\n   */\n  injector?: Injector;\n  /**\n   * Optional name used in portal lifecycle logs.\n   */\n  debugName?: string;\n}\n\n/**\n * Lifecycle hook for the component rendered by {@link WbComponentPortal} after attached to the DOM.\n */\nexport interface OnAttach {\n\n  /**\n   * Method invoked after attached this component to the DOM.\n   */\n  onAttach(): void;\n}\n\n/**\n * Lifecycle hook for the component rendered by {@link WbComponentPortal} before detached from the DOM.\n */\nexport interface OnDetach {\n\n  /**\n   * Method invoked before detaching this component from the DOM.\n   */\n  onDetach(): void;\n}\n\n/**\n * Creates the specified component based on given options.\n */\nfunction createPortalComponent<T>(componentType: ComponentType<T>, options: {injector: Injector; providers?: Provider[]}): ComponentRef<T> {\n  // Provide providers via host directive.\n  @Directive({providers: options.providers ?? []})\n  class InjectionContextDirective {\n  }\n\n  return createComponent(componentType, {\n    directives: [InjectionContextDirective],\n    elementInjector: options.injector,\n    environmentInjector: options.injector.get(EnvironmentInjector),\n  });\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ApplicationRef, Directive, inject} from '@angular/core';\nimport {ChildrenOutletContexts} from '@angular/router';\n\n/**\n * Pretends the router outlet to be a top-level router outlet.\n *\n * Use this directive on nested router outlets to be the target of top-level routes, i.e., routes registered by the workbench for each part and view.\n */\n@Directive({\n  selector: 'router-outlet[wbRouterOutletRootContext]',\n  providers: [\n    {provide: ChildrenOutletContexts, useFactory: () => inject(ApplicationRef).injector.get(ChildrenOutletContexts)},\n  ],\n})\nexport class RouterOutletRootContextDirective {\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {DestroyRef} from '@angular/core';\nimport {noop} from 'rxjs';\n\n/**\n * Implementation of {@link DestroyRef} that can be used in non-Angular managed workbench elements such as handles.\n */\nexport class ɵDestroyRef implements DestroyRef {\n\n  private _callbacks = new Set<() => void>();\n  private _destroyed = false;\n\n  public onDestroy(callback: () => void): () => void {\n    if (this._destroyed) {\n      callback();\n      return noop;\n    }\n\n    this._callbacks.add(callback);\n    return () => this._callbacks.delete(callback);\n  }\n\n  public destroy(): void {\n    this._callbacks.forEach(callback => callback());\n    this._callbacks.clear();\n    this._destroyed = true;\n  }\n\n  public get destroyed(): boolean {\n    return this._destroyed;\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Directive, effect, ElementRef, inject, InjectionToken, untracked} from '@angular/core';\nimport {createElement, positionElement, setStyle} from '../common/dom.util';\nimport {fromEvent} from 'rxjs';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ɵDestroyRef} from '../common/ɵdestroy-ref';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {Blocking} from './blocking';\nimport {Blockable} from './blockable';\nimport {Arrays} from '@scion/toolkit/util';\n\n/**\n * Prevents user interaction of the host when blocked by placing a glass pane over the host element.\n *\n * Configure this direktive via the following DI tokens. These tokens must be provided at the component level.\n * - {@link GLASS_PANE_BLOCKABLE}: Represents the object to be blocked.\n * - {@link GLASS_PANE_TARGET_ELEMENT}: Controls the HTML element to block. Defaults to the directive's host element if not set.\n * - {@link GLASS_PANE_OPTIONS}: Configures the glass pane.\n */\n@Directive({selector: '[wbGlassPane]'})\nexport class GlassPaneDirective {\n\n  private readonly _targetElement = coerceElement<HTMLElement>(inject(GLASS_PANE_TARGET_ELEMENT, {optional: true, host: true}) ?? inject(ElementRef));\n  private readonly _options = inject(GLASS_PANE_OPTIONS, {optional: true, host: true}) ?? undefined;\n\n  constructor() {\n    positionElement(this._targetElement, {context: 'glasspane'});\n    this.installGlassPane();\n  }\n\n  private installGlassPane(): void {\n    const blockable = inject(GLASS_PANE_BLOCKABLE, {host: true});\n    effect(onCleanup => {\n      const blockedBy = blockable.blockedBy();\n      if (!blockedBy) {\n        return;\n      }\n\n      untracked(() => {\n        const glassPane = new GlassPane(this._targetElement, blockedBy, this._options);\n        onCleanup(() => glassPane.dispose());\n      });\n    });\n  }\n}\n\n/**\n * Represents the glass pane added to the target element.\n */\nclass GlassPane {\n\n  private readonly _destroyRef = new ɵDestroyRef();\n\n  constructor(targetElement: HTMLElement, blockedBy: Blocking, options?: GlassPaneOptions) {\n    const glassPaneElement = createElement('div', {\n      parent: targetElement,\n      cssClass: ['glasspane', 'e2e-glasspane', ...Arrays.coerce(options?.cssClass)],\n      attributes: {\n        'data-owner': blockedBy.id,\n        ...options?.attributes,\n      },\n      style: {\n        'position': 'absolute',\n        'inset': 0,\n        'pointer-events': 'auto',\n      },\n    });\n\n    // Indicate the user that this element is blocked when clicking it.\n    fromEvent<MouseEvent>(glassPaneElement, 'mousedown')\n      .pipe(takeUntilDestroyed(this._destroyRef))\n      .subscribe((event: MouseEvent) => {\n        event.preventDefault(); // to not lose focus\n        blockedBy.blink();\n      });\n\n    // Prevent the target from gaining focus via sequential keyboard navigation.\n    fromEvent(targetElement, 'focusin')\n      .pipe(takeUntilDestroyed(this._destroyRef))\n      .subscribe(() => {\n        blockedBy.focus();\n      });\n\n    // Ignore pointer events to block elements overlapping the glass pane, e.g., resize handles of a dialog.\n    const currentPointerEvents = targetElement.style.pointerEvents || null;\n    setStyle(targetElement, {'pointer-events': 'none'});\n\n    this._destroyRef.onDestroy(() => {\n      glassPaneElement.remove();\n      setStyle(targetElement, {'pointer-events': currentPointerEvents});\n    });\n  }\n\n  public dispose(): void {\n    this._destroyRef.destroy();\n  }\n}\n\n/**\n * Configures the glass pane.\n */\nexport interface GlassPaneOptions {\n  /**\n   * Specifies CSS class(es) to add to the glass pane HTML element.\n   */\n  cssClass?: string | string[];\n  /**\n   * Specifies attributes to add to the glass pane HTML element.\n   */\n  attributes?: {[key: string]: string};\n}\n\n/**\n * DI token to configure the {@link GlassPaneDirective} with the [object]{@link Blockable} to block.\n */\nexport const GLASS_PANE_BLOCKABLE = new InjectionToken<Blockable>('GLASS_PANE_BLOCKABLE');\n\n/**\n * DI token to configure the {@link GlassPaneDirective} with the HTML element to block.\n * Defaults to the host element of the {@link GlassPaneDirective} if not specified.\n */\nexport const GLASS_PANE_TARGET_ELEMENT = new InjectionToken<HTMLElement | ElementRef<HTMLElement>>('GLASS_PANE_TARGET_ELEMENT');\n\n/**\n * DI token to configure the {@link GlassPaneDirective}.\n */\nexport const GLASS_PANE_OPTIONS = new InjectionToken<GlassPaneOptions>('GLASS_PANE_OPTIONS');\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {afterRenderEffect, Component, DOCUMENT, ElementRef, inject, Provider, untracked, viewChild} from '@angular/core';\nimport {RouterOutlet} from '@angular/router';\nimport {RouterOutletRootContextDirective} from '../../routing/router-outlet-root-context.directive';\nimport {ɵWorkbenchPart} from '../ɵworkbench-part.model';\nimport {SciViewportComponent} from '@scion/components/viewport';\nimport {OnAttach, OnDetach} from '../../portal/wb-component-portal';\nimport {FocusTrackerRef, trackFocus} from '../../focus/workbench-focus-tracker.service';\nimport {GLASS_PANE_BLOCKABLE, GLASS_PANE_OPTIONS, GlassPaneDirective, GlassPaneOptions} from '../../glass-pane/glass-pane.directive';\nimport {WorkbenchPart} from '../workbench-part.model';\n\n/**\n * Acts as a placeholder for a part's content that Angular fills based on the current router state of the associated part outlet.\n */\n@Component({\n  selector: 'wb-part-slot',\n  templateUrl: './part-slot.component.html',\n  styleUrl: './part-slot.component.scss',\n  imports: [\n    RouterOutlet,\n    RouterOutletRootContextDirective,\n    SciViewportComponent,\n  ],\n  hostDirectives: [\n    GlassPaneDirective,\n  ],\n  providers: [\n    configurePartGlassPane(),\n  ],\n})\nexport class PartSlotComponent implements OnAttach, OnDetach {\n\n  protected readonly part = inject(ɵWorkbenchPart);\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _document = inject(DOCUMENT);\n  private readonly _viewport = viewChild.required(SciViewportComponent);\n  private readonly _focusTrackerRef: FocusTrackerRef;\n\n  private _scrollTop = 0;\n  private _scrollLeft = 0;\n  private _activeElementBeforeDetach: HTMLElement | undefined;\n\n  constructor() {\n    this._focusTrackerRef = trackFocus(this._host, this.part);\n    this.unsetActiveElementOnPartDeactivate();\n  }\n\n  public focus(): void {\n    if (!this._host.contains(this._document.activeElement)) {\n      this._viewport().focus();\n    }\n  }\n\n  /**\n   * Method invoked after attached this component to the DOM.\n   */\n  public onAttach(): void {\n    this._viewport().scrollTop = this._scrollTop;\n    this._viewport().scrollLeft = this._scrollLeft;\n\n    if (this.part.focused()) {\n      this._activeElementBeforeDetach?.focus();\n      this._activeElementBeforeDetach = undefined;\n    }\n  }\n\n  /**\n   * Method invoked before detaching this component from the DOM.\n   */\n  public onDetach(): void {\n    this._scrollTop = this._viewport().scrollTop;\n    this._scrollLeft = this._viewport().scrollLeft;\n\n    if (this.part.focused()) {\n      const activeElement = this._document.activeElement;\n      if (this._host.contains(activeElement) && activeElement instanceof HTMLElement) {\n        this._activeElementBeforeDetach = activeElement;\n      }\n    }\n  }\n\n  /**\n   * Unsets the active workbench element if this part was the focused element when it is deactivated,\n   * such as when closing the activity containing this part. Otherwise, the active element would not be unset.\n   */\n  private unsetActiveElementOnPartDeactivate(): void {\n    afterRenderEffect(() => {\n      const active = this.part.active();\n      if (!active) {\n        untracked(() => this._focusTrackerRef.unsetActiveElement());\n      }\n    });\n  }\n}\n\n/**\n * Blocks this part when dialog(s) overlay it.\n */\nfunction configurePartGlassPane(): Provider[] {\n  return [\n    {\n      provide: GLASS_PANE_BLOCKABLE,\n      useFactory: () => inject(ɵWorkbenchPart),\n    },\n    {\n      provide: GLASS_PANE_OPTIONS,\n      useFactory: (): GlassPaneOptions => ({attributes: {'data-partid': inject(WorkbenchPart).id}}),\n    },\n  ];\n}\n","<sci-viewport>\n  <router-outlet [name]=\"part.id\" wbRouterOutletRootContext/>\n</sci-viewport>\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {fromEvent, merge, Observable, Subject} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n/**\n * Allows sending events between browsing contexts of this origin.\n *\n * Like the native `BroadcastChannel`, but also receives events posted on this channel instance.\n */\nexport class WorkbenchBroadcastChannel<T> {\n\n  /**\n   * Channel to transport events to other `BroadcastChannel` instances.\n   */\n  private _broadcastChannel: BroadcastChannel;\n  /**\n   * Subject to transport events to this instance since the native `BroadcastChannel` transports events only to other `BroadcastChannel` instances.\n   */\n  private _localBrowsingContextEvent$ = new Subject<T>();\n  /**\n   * Receives events posted on this broadcast channel. Events are received across app instances of the same origin.\n   */\n  public readonly observe$: Observable<T>;\n\n  constructor(name: string) {\n    this._broadcastChannel = new BroadcastChannel(name);\n    this.observe$ = merge(this._localBrowsingContextEvent$, fromEvent<MessageEvent<T>>(this._broadcastChannel, 'message').pipe(map(event => event.data)));\n  }\n\n  /**\n   * Posts the given event to app instances of this origin.\n   */\n  public postMessage(event?: T): void {\n    this._localBrowsingContextEvent$.next(event as T); // Emit locally since the native broadcast channel does not emit on the instance that posted the message.\n    this._broadcastChannel.postMessage(event);\n  }\n\n  public destroy(): void {\n    this._broadcastChannel.close();\n    this._localBrowsingContextEvent$.complete();\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, effect, inject, Injectable, Injector, isSignal, NgZone, OnDestroy, Signal, untracked} from '@angular/core';\nimport {BehaviorSubject, EMPTY, fromEvent, merge, mergeMap, mergeWith, MonoTypeOperatorFunction, Observable, Observer, Subject, switchMap, TeardownLogic} from 'rxjs';\nimport {filter, map} from 'rxjs/operators';\nimport {Arrays} from '@scion/toolkit/util';\nimport {WorkbenchBroadcastChannel} from '../communication/workbench-broadcast-channel';\nimport {observeIn, subscribeIn} from '@scion/toolkit/operators';\nimport {WorkbenchViewNavigation} from '../view/workbench-view.model';\nimport {ClassListMap} from '../common/class-list';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {MActivity} from '../activity/workbench-activity.model';\nimport {MPartGrid} from '../layout/workbench-grid.model';\nimport {WorkbenchLayoutService} from '../layout/workbench-layout.service';\nimport {ɵWorkbenchLayout} from '../layout/ɵworkbench-layout';\nimport {ɵWorkbenchPart} from '../part/ɵworkbench-part.model';\nimport {ActivityId, isActivityId, PartId, ViewId, WORKBENCH_ID} from '../workbench.identifiers';\n\n/**\n * Coordinates cross application drag and drop of views.\n *\n * Views can only be moved across applications of the same origin.\n */\n@Injectable({providedIn: 'root'})\nexport class ViewDragService implements OnDestroy {\n\n  private readonly _injector = inject(Injector);\n  private readonly _workbenchId = inject(WORKBENCH_ID);\n  private readonly _zone = inject(NgZone);\n  private readonly _workbenchLayoutService = inject(WorkbenchLayoutService);\n  private readonly _viewDragStartBroadcastChannel = new WorkbenchBroadcastChannel<ViewDragData>('workbench/view/dragstart');\n  private readonly _viewDragEndBroadcastChannel = new WorkbenchBroadcastChannel<void>('workbench/view/dragend');\n  private readonly _viewMoveBroadcastChannel = new WorkbenchBroadcastChannel<ViewMoveEvent>('workbench/view/move');\n  private readonly _tabbarDragOver$ = new BehaviorSubject<PartId | false>(false);\n  private readonly _viewMoved$ = new Subject<ViewMoveEvent>();\n\n  /**\n   * Notifies when to move a view. The event is broadcasted to all application instances of the same origin.\n   */\n  public readonly viewMove$: Observable<ViewMoveEvent> = this._viewMoveBroadcastChannel.observe$;\n\n  /**\n   * Notifies when the layout of this application has been updated after a view move event.\n   */\n  public readonly viewMoved$: Observable<ViewMoveEvent> = this._viewMoved$;\n\n  /**\n   * Notifies when dragging a tab over a tabbar. The event is the id of the part being dragged over, or `false` if not dragging over a tabbar.\n   *\n   * Upon subscription, emits the current dragover state, and then each time the state changes. The observable never completes.\n   */\n  public readonly tabbarDragOver$: Observable<PartId | false> = this._tabbarDragOver$;\n\n  /**\n   * Provides the drag data of the current drag operation. Is `null` if no drag operation is in progress.\n   */\n  public readonly viewDragData = toSignal<ViewDragData | null>(\n    merge(\n      this._viewDragStartBroadcastChannel.observe$,\n      this._viewDragEndBroadcastChannel.observe$.pipe(map(() => null)),\n    ),\n    {initialValue: null},\n  );\n\n  /**\n   * Indicates if a drag operation is active across application instances of the same origin.\n   */\n  public readonly dragging = computed<boolean>(() => this.viewDragData() !== null);\n\n  constructor() {\n    this.installDragDetector();\n  }\n\n  /**\n   * Signals start dragging a tab over specified tabbar (dragenter).\n   */\n  public signalTabbarDragEnter(partId: PartId): void {\n    this._tabbarDragOver$.next(partId);\n  }\n\n  /**\n   * Signals end dragging a tab over specified tabbar (dragleave).\n   */\n  public signalTabbarDragLeave(partId: PartId): void {\n    if (this._tabbarDragOver$.value === partId) {\n      this._tabbarDragOver$.next(false);\n    }\n  }\n\n  /**\n   * Signals successful move of a view in the layout of this app instance.\n   */\n  public signalViewMoved(event: ViewMoveEvent): void {\n    this._viewMoved$.next(event);\n  }\n\n  /**\n   * Indicates if dragging a tab over a tabbar, returning the id of the part being dragged over, or `false` if not dragging over a tabbar.\n   */\n  public get isDragOverTabbar(): PartId | false {\n    return this._tabbarDragOver$.value;\n  }\n\n  /**\n   * Tests given event to be a view drag event of an app of this origin.\n   */\n  public isViewDragEvent(event: DragEvent): boolean {\n    if (!event.dataTransfer?.types.includes(VIEW_DRAG_TRANSFER_TYPE)) {\n      return false;\n    }\n    // Test the event to originate from an app of this origin.\n    return this.dragging();\n  }\n\n  /**\n   * Tests if a view can be dropped on the specified target.\n   */\n  public canDrop(target: ɵWorkbenchPart | MPartGrid | Signal<ɵWorkbenchPart | MPartGrid>): Signal<boolean> {\n    return computed(() => {\n      const dropTarget = isSignal(target) ? target() : target;\n      const dragData = this.viewDragData();\n\n      return untracked(() => {\n        if (!dragData) {\n          return false;\n        }\n\n        // Dragging a view from or to an activity is only valid within the same activity and application instance.\n        const dragSourceActivityId = dragData.activityId;\n        const dropTargetActivityId = getContainingActivity(dropTarget, this._workbenchLayoutService.layout())?.id;\n        if (dragSourceActivityId || dropTargetActivityId) {\n          return dragSourceActivityId === dropTargetActivityId && dragData.workbenchId === this._workbenchId;\n        }\n\n        return true;\n      });\n\n      /**\n       * Gets the activity that contains the specified element, or `null` if the element is not contained in an activity.\n       */\n      function getContainingActivity(element: ɵWorkbenchPart | MPartGrid, layout: ɵWorkbenchLayout): MActivity | null {\n        if (element instanceof ɵWorkbenchPart) {\n          return layout.activity({partId: element.id}, {orElse: null});\n        }\n\n        const gridName = layout.grid({grid: element}).gridName;\n        return isActivityId(gridName) ? layout.activity({id: gridName}) : null;\n      }\n    });\n  }\n\n  /**\n   * Listens for same-origin view drag events on the given target element.\n   *\n   * Unlike when installing a \"native\" event handler for `dragenter` and/or `dragleave` events,\n   * this observable does not emit when dragging over child elements of the target element.\n   *\n   * Following drag events are emitted:\n   * - dragstart: when start dragging a view tab\n   * - dragend: when end dragging a view tab\n   * - dragenter: when entering the target element while dragging a view tab\n   * - dragover: when dragging a view tab over the target element, every few hundred milliseconds\n   * - dragleave: when leaving the target element while dragging a view tab\n   * - drop: when dropping a view tab on a valid drop target\n   *\n   * As by design of native drag and drop, the `dragleave` event is not fired on drop action.\n   * Therefore, always handle both events, `dragleave` and `drop` events, respectively.\n   *\n   * @param target - Specifies the element on which to subscribe for drag events.\n   * @param options - Controls how to subscribe for drag events.\n   * @param options.eventType - Filters for specified drag events; defaults to any event.\n   * @param options.capture - Controls whether to subscribe for drag events in the capturing phase; defaults to `false`, i.e., `bubbling` phase.\n   */\n  public viewDrag$(target: Element | Window, options?: ViewDragEventListenerOptions): Observable<DragEvent> {\n    const filteredEventTypes = new Set<string>(Arrays.coerce(options?.eventType));\n    const isViewDragEvent = this.isViewDragEvent.bind(this);\n\n    return new Observable((observer: Observer<DragEvent>): TeardownLogic => {\n      const insideAngular = NgZone.isInAngularZone();\n\n      const subscription = merge(\n        shouldSubscribe('dragstart') ? dragstart$() : EMPTY,\n        shouldSubscribe('dragend') ? dragend$() : EMPTY,\n        shouldSubscribe('dragover') ? dragover$() : EMPTY,\n        shouldSubscribe('dragenter') || shouldSubscribe('dragleave') || shouldSubscribe('drop') ? dragenterOrDragleaveOrDrop$() : EMPTY,\n      )\n        .pipe(\n          subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n          observeIn(fn => insideAngular ? this._zone.run(fn) : this._zone.runOutsideAngular(fn)),\n        )\n        .subscribe(observer);\n\n      return (): void => subscription.unsubscribe();\n    });\n\n    function dragstart$(): Observable<DragEvent> {\n      return fromEvent<DragEvent>(target, 'dragstart', options ?? {})\n        .pipe(filter(event => isViewDragEvent(event)));\n    }\n\n    function dragend$(): Observable<DragEvent> {\n      // The `dragend` event does not contain a drag transfer type.\n      // To filter view-related `dragend` events, we subscribe to view-related `dragstart` events in the first place.\n      // When receiving a `dragstart` event we subscribe for the next `dragend` event, expecting it to be view-related.\n      return fromEvent<DragEvent>(target, 'dragstart', options ?? {})\n        .pipe(\n          filter(event => isViewDragEvent(event)),\n          switchMap(() => fromEvent<DragEvent>(target, 'dragend', {...options, once: true})),\n        );\n    }\n\n    function dragover$(): Observable<DragEvent> {\n      return fromEvent<DragEvent>(target, 'dragover', options ?? {})\n        .pipe(filter(event => isViewDragEvent(event)));\n    }\n\n    function dragenterOrDragleaveOrDrop$(): Observable<DragEvent> {\n      // We emit `dragenter` only when entering the target element (or any child element) for the first time\n      // and only again after entering it again. The same applies for `dragleave`.\n      let dragEnterCount = 0;\n      return merge(\n        fromEvent<DragEvent>(target, 'dragenter', options ?? {}),\n        fromEvent<DragEvent>(target, 'dragleave', options ?? {}),\n        fromEvent<DragEvent>(target, 'drop', options ?? {}),\n      )\n        .pipe(\n          filter(event => isViewDragEvent(event)),\n          filter((event: DragEvent) => {\n            switch (event.type) {\n              case 'dragenter': {\n                return (++dragEnterCount === 1);\n              }\n              case 'dragleave':\n              case 'drop': {\n                return (--dragEnterCount === 0);\n              }\n              default:\n                return true;\n            }\n          }),\n          resetOnDragEnd(),\n          filter(event => shouldSubscribe(event.type)),\n        );\n\n      /**\n       * Resets `dragEnterCount` on `dragend` to prevent inconsistent state if `dragend` should not be triggered.\n       */\n      function resetOnDragEnd<T>(): MonoTypeOperatorFunction<T> {\n        return mergeWith(fromEvent<DragEvent>(target, 'dragend', options ?? {})\n          .pipe(mergeMap(() => {\n            dragEnterCount = 0;\n            return EMPTY;\n          })),\n        );\n      }\n    }\n\n    function shouldSubscribe(eventType: string): boolean {\n      return !filteredEventTypes.size || filteredEventTypes.has(eventType);\n    }\n  }\n\n  /**\n   * Dispatches the given view move event, broadcasting it to all application instances of the same origin.\n   */\n  public dispatchViewMoveEvent(event: ViewMoveEvent): void {\n    // Dispatch the event after the current drag operation, if any, has ended, preventing destruction of the drag source\n    // during the drag operation which would break the drag operation, i.e., `dragend` and `dragleave` events would not be fired.\n    this.onDragEnd(() => this._viewMoveBroadcastChannel.postMessage(event), {once: true, injector: this._injector});\n  }\n\n  /**\n   * Sets given drag data, broadcasting it to all application instances of the same origin.\n   *\n   * Invoke this method inside 'dragstart' event handler of the element where the drag operation started.\n   */\n  public setViewDragData(viewDragData: ViewDragData): void {\n    this._viewDragStartBroadcastChannel.postMessage(viewDragData);\n  }\n\n  /**\n   * Unsets the current drag data.\n   *\n   * Invoke this method inside 'dragend' event handler of the element where the drag operation started.\n   */\n  public unsetViewDragData(): void {\n    this._viewDragEndBroadcastChannel.postMessage();\n  }\n\n  /**\n   * Registers a callback to be executed when a drag operation ends, executing it immediately if no drag operation is in progress at the time of registration.\n   *\n   * Automatically unregisters the function when the current injection context or the provided injector is destroyed.\n   * Setting `once` unregisters the function after the first execution.\n   */\n  public onDragEnd(onDragEnd: () => void, options?: {injector?: Injector; once?: true}): void {\n    const effectRef = effect(() => {\n      if (!this.dragging()) {\n        untracked(() => onDragEnd());\n        options?.once && effectRef.destroy();\n      }\n    }, {injector: options?.injector});\n  }\n\n  /**\n   * Signals when start dragging a view.\n   */\n  private installDragDetector(): void {\n    effect(() => {\n      const dragging = this.dragging();\n      untracked(() => this._workbenchLayoutService.signalDragging(dragging));\n    });\n  }\n\n  public ngOnDestroy(): void {\n    this._viewMoveBroadcastChannel.destroy();\n    this._viewDragStartBroadcastChannel.destroy();\n    this._viewDragEndBroadcastChannel.destroy();\n  }\n}\n\n/**\n * Represents data of a view drag operation.\n */\nexport interface ViewDragData {\n  /**\n   * Unique id of the drag operation.\n   */\n  uid: string;\n  /**\n   * X-coordinate of the mouse pointer, relative to the view tab drag image.\n   */\n  viewTabPointerOffsetX: number;\n  /**\n   * Y-coordinate of the mouse pointer, relative to the view tab drag image.\n   */\n  viewTabPointerOffsetY: number;\n  viewId: ViewId;\n  partId: PartId;\n  activityId?: ActivityId;\n  alternativeViewId?: string;\n  viewTitle: Translatable | null;\n  viewHeading: Translatable | null;\n  navigation?: Omit<WorkbenchViewNavigation, 'id' | 'state'>;\n  viewClosable: boolean | 'disabled';\n  viewDirty: boolean;\n  viewTabWidth: number;\n  viewTabHeight: number;\n  viewTitleOffsetRight?: string | undefined;\n  workbenchId: string;\n  classList?: ClassListMap;\n}\n\n/**\n * Event for moving a view in the workbench layout.\n */\nexport interface ViewMoveEvent {\n  /**\n   * Describes which view to move.\n   */\n  source: ViewMoveEventSource;\n  /**\n   * Describes where to move the view.\n   */\n  target: ViewMoveEventTarget;\n  /**\n   * Drag data associated with this operation. Is only set if moving a view via drag and drop.\n   */\n  dragData?: ViewDragData;\n}\n\n/**\n * Describes which view to move.\n */\nexport interface ViewMoveEventSource {\n  viewId: ViewId;\n  partId: PartId;\n  navigation?: Omit<WorkbenchViewNavigation, 'id' | 'state'>;\n  alternativeViewId?: string;\n  workbenchId: string;\n  classList?: ClassListMap;\n}\n\n/**\n * Describes where to move a view.\n */\nexport interface ViewMoveEventTarget {\n  /**\n   * Part (or node) where (or relative to which) to add the view.\n   *\n   * Rules for different regions:\n   * - If not specifying a region, {@link elementId} is mandatory and must reference a part.\n   * - For regions `north`, `south`, `east`, or `west`, {@link elementId} can reference a part or node,\n   *   relative to which to align the view. If not set, the view is aligned relative to the root of\n   *   the entire layout.\n   *\n   * Note: Property is ignored when moving the view to a new window.\n   */\n  elementId?: PartId | string;\n  /**\n   * Region of {@link elementId} where to add the view (in a new part).\n   *\n   * If not specified, {@link elementId} must reference a part to which to add the view.\n   *\n   * Note:\n   * - Property is ignored when moving the view to a new window.\n   * - Property is required if {@link elementId} is a node.\n   */\n  region?: 'north' | 'east' | 'south' | 'west';\n  /**\n   * Position where to insert the view. The position is zero-based. If not set, adds the view after the active view.\n   */\n  position?: number | 'start' | 'end';\n  /**\n   * Identifier of the target workbench, or 'new-window' to move the view to a new browser window.\n   */\n  workbenchId: string | 'new-window';\n  /**\n   * Describes the part to be created if the region is 'north', 'east', 'south', or 'west'.\n   */\n  newPart?: {\n    /**\n     * Identity of the new part. If not set, assigns a random id.\n     */\n    id?: PartId;\n    /**\n     * Proportional size of the part relative to the reference part.\n     * The ratio is the closed interval [0,1]. If not set, defaults to `0.5`.\n     */\n    ratio?: number;\n  };\n}\n\n/**\n * Controls how to subscribe to drag events.\n */\nexport interface ViewDragEventListenerOptions extends EventListenerOptions {\n  /**\n   * Controls which event(s) to subscribe.\n   */\n  eventType?: ViewDragEventType | ViewDragEventType[];\n}\n\n/**\n * Represents the type of drag event.\n */\nexport type ViewDragEventType = 'dragstart' | 'dragend' | 'dragenter' | 'dragover' | 'dragleave' | 'drop';\n\n/**\n * Transfer type for dragging a view.\n */\nexport const VIEW_DRAG_TRANSFER_TYPE = 'workbench/view';\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable} from '@angular/core';\nimport {createElement, setAttribute, setStyle} from '../common/dom.util';\nimport {VIEW_DROP_ZONE_OVERLAY_HOST} from '../workbench-element-references';\n\n/**\n * Renders the visual placeholder when dragging a view over a valid drop zone.\n *\n * To animate the transition of the placeholder, we use a single HTML element for the placeholder and\n * adjust its position when the drop zone changes.\n */\n@Injectable({providedIn: 'root'})\nexport class ViewDropPlaceholderRenderer {\n\n  private readonly _dropPlaceholderOverlayHost = inject(VIEW_DROP_ZONE_OVERLAY_HOST);\n\n  private _dropPlaceholder: HTMLElement | null = null;\n\n  /**\n   * Identifies the drop zone displaying the placeholder.\n   *\n   * This id is used to guard disposal, so that only the drop zone displaying the placeholder can remove it.\n   */\n  private _dropZoneId: string | null = null;\n\n  /**\n   * Renders the placeholder.\n   *\n   * @param dropZoneId - Identifies the drop zone which renders the placeholder.\n   * @param rect - Specifies position and size of the placeholder. Passing `null` removes the placeholder.\n   */\n  public render(dropZoneId: string, rect: DOMRect | null): void {\n    if (rect) {\n      this._dropZoneId = dropZoneId;\n      this._dropPlaceholder ??= this.createDropPlaceholder();\n\n      setStyle(this._dropPlaceholder, {\n        top: `${rect.top}px`,\n        left: `${rect.left}px`,\n        width: `${rect.width}px`,\n        height: `${rect.height}px`,\n      });\n      setAttribute(this._dropPlaceholder, {\n        'data-dropzoneid': this._dropZoneId,\n      });\n    }\n    else if (dropZoneId === this._dropZoneId) {\n      this._dropPlaceholder?.remove();\n      this._dropPlaceholder = null;\n      this._dropZoneId = null;\n    }\n  }\n\n  private createDropPlaceholder(): HTMLElement {\n    return createElement('div', {\n      parent: this._dropPlaceholderOverlayHost()!.element.nativeElement as HTMLElement,\n      cssClass: 'e2e-drop-placeholder',\n      style: {\n        'position': 'fixed',\n        'background-color': 'var(--sci-workbench-part-dropzone-background-color)',\n        'border': '1px var(--sci-workbench-part-dropzone-border-style) var(--sci-workbench-part-dropzone-border-color)',\n        'border-radius': 'var(--sci-workbench-part-dropzone-border-radius)',\n        'pointer-events': 'none',\n        'transition-duration': '125ms',\n        'transition-property': 'top,left,width,height',\n        'transition-timing-function': 'ease-out',\n      },\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, Directive, effect, ElementRef, inject, input, NgZone, output, untracked} from '@angular/core';\nimport {createElement, positionElement, setAttribute, setStyle} from '../common/dom.util';\nimport {ViewDragData, ViewDragService} from './view-drag.service';\nimport {ViewDropPlaceholderRenderer} from './view-drop-placeholder-renderer.service';\nimport {Disposable} from '../common/disposable';\nimport {boundingClientRect} from '@scion/components/dimension';\nimport {UUID} from '@scion/toolkit/uuid';\nimport {BehaviorSubject, delay, identity, of, switchMap} from 'rxjs';\nimport {subscribeIn} from '@scion/toolkit/operators';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {distinctUntilChanged, finalize} from 'rxjs/operators';\n\n/**\n * Makes the host element a drop zone for views.\n *\n * Views can be dropped in the configured region(s) (north, east, south, west, center).\n *\n * The drop zone is aligned with the bounds of the host element, requiring the host to define a positioning context.\n * If not positioned, the element is changed to be positioned relative.\n */\n@Directive({selector: '[wbViewDropZone]'})\nexport class ViewDropZoneDirective {\n\n  /**\n   * Specifies the regions where views can be dropped. Defaults to every region.\n   */\n  public readonly regions = input<DropZoneRegion | false>(undefined, {alias: 'wbViewDropZoneRegions'});\n\n  /**\n   * Specifies attribute(s) to add to the drop zone.\n   */\n  public readonly attributes = input<{[name: string]: unknown} | undefined>(undefined, {alias: 'wbViewDropZoneAttributes'});\n\n  /**\n   * Specifies the size of a drop zone region, either as percentage value [0,1] or absolute pixel value.\n   */\n  public readonly dropRegionSize = input(.5, {alias: 'wbViewDropZoneRegionSize', transform: (value: number | undefined) => value ?? .5});\n\n  /**\n   * Specifies the size of the visual placeholder when dragging a view over a drop region.\n   * Can be a percentage value [0,1] or absolute pixel value. Defaults to {@link dropRegionSize}.\n   */\n  public readonly dropPlaceholderSize = input<number | undefined>(undefined, {alias: 'wbViewDropZonePlaceholderSize'});\n\n  /**\n   * Notifies when dropping a view.\n   */\n  public readonly viewDrop = output<WbViewDropEvent>({alias: 'wbViewDropZoneDrop'});\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _viewDragService = inject(ViewDragService);\n  private readonly _viewDropPlaceholderRenderer = inject(ViewDropPlaceholderRenderer);\n  private readonly _zone = inject(NgZone);\n  private readonly _id = UUID.randomUUID();\n  private readonly _boundingClientRect = boundingClientRect(inject(ElementRef));\n  private readonly _dropRegion$ = new BehaviorSubject<Region | null>(null);\n\n  private readonly _dropRegionSize = computed(() => ({\n    maxHeight: coercePixelValue(this.dropRegionSize(), {containerSize: this._boundingClientRect().height}),\n    maxWidth: coercePixelValue(this.dropRegionSize(), {containerSize: this._boundingClientRect().width}),\n  }));\n\n  constructor() {\n    this.installDropZone();\n    this.installDropPlaceholderRenderer();\n    positionElement(this._host, {context: 'dropzone'});\n  }\n\n  /**\n   * Creates a drop zone when start dragging a view and disposes it when end dragging the view.\n   *\n   * When a view is dragged over the drop zone, computes the drop region and renders the drop placeholder using the {@link ViewDropPlaceholderRenderer}.\n   */\n  private installDropZone(): void {\n    effect(onCleanup => {\n      if (this._viewDragService.dragging()) {\n        const dropZone = untracked(() => this.createDropZone());\n        onCleanup(() => dropZone.dispose());\n      }\n    });\n  }\n\n  /**\n   * Creates the drop zone element.\n   *\n   * Views can be dropped in configured drop regions (north, east, south, west, center).\n   * The current drop region is computed based on the pointer position. Adjacent drop regions are split\n   * at a 45° angle.\n   *\n   * +-----------------------+\n   * | \\       north       / |\n   * | w +---------------+ e |\n   * | e |               | a |\n   * | s |    center     | s |\n   * | t |               | t |\n   * |   +---------------+   |\n   * | /       south       \\ |\n   * +-----------------------+\n   */\n  public createDropZone(): Disposable {\n    const dropZoneElement = createElement('div', {\n      parent: this._host,\n      attributes: {\n        ...this.attributes(),\n        'data-id': this._id,\n      },\n      cssClass: 'e2e-drop-zone',\n      style: {\n        'position': 'absolute',\n        'inset': 0,\n        'pointer-events': 'none',\n      },\n    });\n\n    // Subscribe to drag events on the host, not on the drop zone element, because disabled when not dragging over an allowed drop region.\n    // Moving the pointer out of allowed drop regions disables the drop zone element, making pointer events available to nested drop zones.\n    // Moving the pointer back re-enables the drop zone element.\n    const dragHandler = this._viewDragService.viewDrag$(this._host, {eventType: ['dragenter', 'dragover', 'dragleave', 'drop']})\n      .pipe(subscribeIn(fn => this._zone.runOutsideAngular(fn)))\n      .subscribe((event: DragEvent) => {\n        // Unset region when dragging over the tab bar or out of the host element.\n        if (this._viewDragService.isDragOverTabbar || event.type === 'dragleave') {\n          this._dropRegion$.next(null);\n          return;\n        }\n\n        // Compute the drop region.\n        const region = this.computeDropZoneRegion(event);\n        this._dropRegion$.next(region);\n        if (!region) {\n          return;\n        }\n\n        switch (event.type) {\n          case 'dragover':\n            event.preventDefault(); // allow view drop\n            break;\n          case 'drop':\n            this._zone.run(() => this.viewDrop.emit({\n              dropRegion: region,\n              dragData: this._viewDragService.viewDragData()!,\n            }));\n            break;\n        }\n      });\n\n    // Enable drop zone based on dragging over an allowed drop region.\n    // If enabled, drag events are not received by nested drop zones.\n    const dropZoneActivator = this._dropRegion$\n      .pipe(distinctUntilChanged())\n      .subscribe(dropRegion => {\n        setStyle(dropZoneElement, {'pointer-events': dropRegion ? null : 'none'});\n        setAttribute(dropZoneElement, {'data-region': dropRegion});\n      });\n\n    return {\n      dispose: () => {\n        dragHandler.unsubscribe();\n        dropZoneActivator.unsubscribe();\n        dropZoneElement.remove();\n        this._dropRegion$.next(null);\n      },\n    };\n  }\n\n  /**\n   * Renders or removes the drop placeholder based on the current drop region.\n   */\n  private installDropPlaceholderRenderer(): void {\n    // Use an observable instead of an effect to control when to call `ViewDropPlaceholderRenderer.render`.\n    // Child elements must invoke the render method before parent elements. Otherwise, nested drop zones\n    // would override the drop placeholder of parent drop zones.\n\n    // Component effects always execute top-down the component tree, the opposite direction to drag events\n    // that bubble up the component tree. The same applies to root effects, which execute in registration\n    // order rather than in the order of tracked signal changes.\n\n    const dragging = this._viewDragService.dragging;\n    this._dropRegion$\n      .pipe(\n        distinctUntilChanged(),\n        // When leaving the drop zone (no drop region) but continue dragging, remove the drop zone asynchronously\n        // to animate transition of the placeholder to another drop zone. If ended dragging, remove the placeholder\n        // immediately.\n        switchMap((region: Region | null) => of(region).pipe(!region && dragging() ? delay(50) : identity)),\n        finalize(() => this._viewDropPlaceholderRenderer.render(this._id, null)),\n        takeUntilDestroyed(),\n      )\n      .subscribe((region: Region | null) => {\n        if (region) {\n          // Render the drop placeholder.\n          const rect = this.computeDropPlaceholderRect(region, this.dropPlaceholderSize() ?? this.dropRegionSize());\n          this._viewDropPlaceholderRenderer.render(this._id, rect);\n        }\n        else {\n          // Remove the drop placeholder.\n          this._viewDropPlaceholderRenderer.render(this._id, null);\n        }\n      });\n  }\n\n  /**\n   * Computes the drop region based on the pointer position and allowed regions, returning `null` if not dragging over an allowed region.\n   */\n  private computeDropZoneRegion(event: DragEvent): Region | null {\n    const regions = this.regions() ?? {north: true, east: true, south: true, west: true, center: true};\n    if (!regions) {\n      return null;\n    }\n\n    const {width, height, left, top, right, bottom} = this._boundingClientRect();\n    const {maxHeight, maxWidth} = this._dropRegionSize();\n    const hCenter = width / 2;\n    const vCenter = height / 2;\n\n    // Calculate pointer insets relative to the host.\n    const pointerInset = {\n      top: event.clientY - top,\n      right: right - event.clientX,\n      bottom: bottom - event.clientY,\n      left: event.clientX - left,\n    };\n\n    // Compute allowed regions.\n    const north = regions.north && pointerInset.top <= maxHeight && 'north';\n    const south = regions.south && pointerInset.bottom <= maxHeight && 'south';\n    const east = regions.east && pointerInset.right <= maxWidth && 'east';\n    const west = regions.west && pointerInset.left <= maxWidth && 'west';\n    const center = regions.center && 'center';\n\n    // Calculate region in top/left quadrant.\n    if (pointerInset.left <= hCenter && pointerInset.top <= vCenter) {\n      if (pointerInset.left < pointerInset.top) {\n        return west || north || center || null;\n      }\n      else {\n        return north || west || center || null;\n      }\n    }\n    // Calculate region in top/right quadrant.\n    else if (pointerInset.left >= hCenter && pointerInset.top <= vCenter) {\n      if (pointerInset.right < pointerInset.top) {\n        return east || north || center || null;\n      }\n      else {\n        return north || east || center || null;\n      }\n    }\n    // Calculate region in bottom/left quadrant.\n    else if (pointerInset.left <= hCenter && pointerInset.top >= vCenter) {\n      if (pointerInset.left < pointerInset.bottom) {\n        return west || south || center || null;\n      }\n      else {\n        return south || west || center || null;\n      }\n    }\n    // Calculate region in bottom/right quadrant.\n    else if (pointerInset.left >= hCenter && pointerInset.top >= vCenter) {\n      if (pointerInset.right < pointerInset.bottom) {\n        return east || south || center || null;\n      }\n      else {\n        return south || east || center || null;\n      }\n    }\n\n    return center || null;\n  }\n\n  /**\n   * Calculates the bounding box of the drop placeholder in given region based on the given size.\n   *\n   * If passing a ratio [0,1] for the size, the size is interpreted as a percentage value relative to the size of the host element.\n   */\n  private computeDropPlaceholderRect(region: Region, size: number): DOMRect {\n    const {x, y, width, height} = this._boundingClientRect();\n    return new DOMRect(\n      x + (region === 'east' ? width - coercePixelValue(size, {containerSize: width}) : 0),\n      y + (region === 'south' ? height - coercePixelValue(size, {containerSize: height}) : 0),\n      region === 'west' || region === 'east' ? coercePixelValue(size, {containerSize: width}) : width,\n      region === 'north' || region === 'south' ? coercePixelValue(size, {containerSize: height}) : height,\n    );\n  }\n}\n\n/**\n * Coerces given value to a CSS pixel value.\n *\n * If passing a ratio [0,1], it is interpreted as a percentage value relative to the size of the container.\n */\nfunction coercePixelValue(pixelOrRatio: number, options: {containerSize: number}): number {\n  return (pixelOrRatio <= 1) ? options.containerSize * pixelOrRatio : pixelOrRatio;\n}\n\n/**\n * Event that is emitted when dropping a view.\n */\nexport interface WbViewDropEvent {\n  dropRegion: Region;\n  dragData: ViewDragData;\n}\n\n/**\n * Specifies the regions where a drop zone should be installed.\n */\nexport interface DropZoneRegion {\n  north: boolean;\n  south: boolean;\n  west: boolean;\n  east: boolean;\n  center: boolean;\n}\n\n/**\n * Represents a drop region.\n */\ntype Region = 'north' | 'east' | 'south' | 'west' | 'center';\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ViewMoveEventTarget} from './view-drag.service';\nimport {MPart, MPartGrid} from '../layout/workbench-grid.model';\n\n/**\n * Provides helper functions for dragging a view to a grid.\n */\nexport const GridDropTargets = {\n\n  /**\n   * Resolves the drop target for moving a view to the root part (or node) of a grid.\n   *\n   * Examples:\n   * - Droping a view at the grid's boundaries (north, south, east, west).\n   * - Dropping a view on the grid's desktop (center).\n   *\n   * When dropping a view on the grid's desktop, the root of the grid can be a part or a node,\n   * depending on whether the grid contains structural parts.\n   */\n  resolve: (target: {grid: MPartGrid; dropRegion: 'west' | 'east' | 'north' | 'south' | 'center'; workbenchId: string}): ViewMoveEventTarget => {\n    const {grid, dropRegion, workbenchId} = target;\n\n    switch (dropRegion) {\n      case 'center': {\n        if (grid.root instanceof MPart) {\n          return {elementId: grid.root.id, workbenchId};\n        }\n        return {elementId: grid.activePartId, workbenchId};\n      }\n      default: {\n        return {\n          elementId: grid.root.id,\n          region: dropRegion,\n          workbenchId,\n          newPart: {ratio: .2},\n        };\n      }\n    }\n  },\n} as const;\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Directive, effect, inject, input, TemplateRef, untracked, ViewContainerRef} from '@angular/core';\nimport {WbComponentPortal} from './wb-component-portal';\n\n/**\n * Renders a {@link WbComponentPortal}, similar to `CdkPortalOutlet`, but with the option to detach it when destroying this directive.\n *\n * Usage:\n *\n * ```html\n * <ng-container *wbPortalOutlet=\"portal; destroyOnDetach: true\"/>\n * ````\n *\n * @see WbComponentPortal\n */\n@Directive({selector: 'ng-template[wbPortalOutlet]'})\nexport class WorkbenchPortalOutletDirective {\n\n  /**\n   * Specifies the portal.\n   */\n  public readonly portal = input.required<WbComponentPortal | null | undefined>({alias: 'wbPortalOutlet'});\n\n  /**\n   * Controls if to detach the portal's component instead of destroying it when this directive is destroyed, such as during a page re-layout\n   */\n  public readonly destroyOnDetach = input.required<boolean>({alias: 'wbPortalOutletDestroyOnDetach'});\n\n  private readonly _viewContainerRef = inject(ViewContainerRef);\n\n  constructor() {\n    const nullTemplate = inject(TemplateRef) as TemplateRef<void>;\n\n    // Insert a pseudo-element before the portal to detect when Angular is about to destroy the portal.\n    // This element gets destroyed first, enabling the portal to detach to prevent destruction.\n    this._viewContainerRef.createEmbeddedView(nullTemplate).onDestroy(() => !this.destroyOnDetach() && this.detach(this.portal()));\n\n    // Add an extra element between the pseudo-element and the portal to prevent breaking Angular's destroy algorithm.\n    // Angular's destroy algorithm terminates when an element removes its immediate successor during destruction, but it continues\n    // if the next but one element is removed instead. It is crucial to insert this intermediary element; otherwise, unmounting\n    // the workbench with opened views would fail to destroy the workbench component entirely.\n    // Refer to tests in `workbench-unmount.e2e-spec.ts`.\n    this._viewContainerRef.createEmbeddedView(nullTemplate);\n\n    // Install the portal.\n    effect(onCleanup => {\n      const portal = this.portal();\n      untracked(() => this.attach(portal));\n      onCleanup(() => this.detach(portal));\n    });\n  }\n\n  private attach(portal: WbComponentPortal | null | undefined): void {\n    portal?.attach(this._viewContainerRef);\n  }\n\n  private detach(portal: WbComponentPortal | null | undefined): void {\n    if (!portal?.isAttachedTo(this._viewContainerRef)) {\n      return;\n    }\n\n    if (this.destroyOnDetach()) {\n      portal.destroy();\n    }\n    else {\n      portal.detach();\n    }\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Pipe, PipeTransform} from '@angular/core';\nimport {WorkbenchPartRegistry} from './workbench-part.registry';\nimport type {PartComponent} from './part.component';\nimport {PartId} from '../workbench.identifiers';\nimport {WbComponentPortal} from '../portal/wb-component-portal';\nimport {MainAreaPartComponent} from './main-area-part/main-area-part.component';\n\n/**\n * Resolves to the portal of given part, or throws an error if the part is not registered.\n */\n@Pipe({name: 'wbPartPortal'})\nexport class PartPortalPipe implements PipeTransform {\n\n  private readonly _partRegistry = inject(WorkbenchPartRegistry);\n\n  public transform(partId: PartId | null): WbComponentPortal<PartComponent | MainAreaPartComponent> | null {\n    if (!partId) {\n      return null;\n    }\n\n    return this._partRegistry.get(partId).portal;\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * Calculates the two sash proportions for the given ratio of a {@link MTreeNode}. Each proportion is >= 1.\n */\n@Pipe({name: 'wbTreeNodeSashSizes'})\nexport class TreeNodeSashSizesPipe implements PipeTransform {\n\n  public transform(ratio: number): [string, string] {\n    // Important: `SciSashboxComponent` requires proportions to be >= 1. For this reason we cannot simply calculate [ratio, 1 - ratio].\n    if (ratio === 0) {\n      return ['0px', '1'];\n    }\n    if (ratio === 1) {\n      return ['1', '0px'];\n    }\n\n    return [`${1 / (1 - ratio)}`, `${1 / ratio}`];\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, inject, input} from '@angular/core';\nimport {MPart, MTreeNode} from '../workbench-grid.model';\nimport {ɵWorkbenchRouter} from '../../routing/ɵworkbench-router.service';\nimport {WorkbenchLayoutService} from '../workbench-layout.service';\nimport {WorkbenchPortalOutletDirective} from '../../portal/workbench-portal-outlet.directive';\nimport {PartPortalPipe} from '../../part/part-portal.pipe';\nimport {SciSashboxComponent, SciSashDirective} from '@scion/components/sashbox';\nimport {TreeNodeSashSizesPipe} from './tree-node-sash-sizes.pipe';\n\n/**\n * Renders a {@link MTreeNode} or {@link MPart}.\n *\n * The workbench layout is modeled as a tree of nodes `{@link MTreeNode}` and parts `{@link MPart}`.\n * Each node has two children, which can be either another node or a part (leaf). A node defines\n * a split layout in which the two children are arranged vertically or horizontally.\n *\n * Nodes are rendered as {@link SciSashboxComponent} and parts as {@link PartComponent} or {@link MainAreaPartComponent}.\n */\n@Component({\n  selector: 'wb-grid-element',\n  templateUrl: './grid-element.component.html',\n  styleUrls: ['./grid-element.component.scss'],\n  imports: [\n    WorkbenchPortalOutletDirective,\n    PartPortalPipe,\n    SciSashboxComponent,\n    SciSashDirective,\n    TreeNodeSashSizesPipe,\n  ],\n  host: {\n    '[attr.data-parentnodeid]': 'element().parent?.id',\n    '[attr.data-nodeid]': 'nodeId()',\n    '[attr.data-partid]': 'partId()',\n  },\n})\nexport class GridElementComponent {\n\n  public readonly element = input.required<MTreeNode | MPart>();\n\n  private readonly _workbenchRouter = inject(ɵWorkbenchRouter);\n  private readonly _workbenchLayoutService = inject(WorkbenchLayoutService);\n\n  protected readonly nodeId = computed(() => this.element() instanceof MTreeNode ? this.element().id : undefined);\n  protected readonly partId = computed(() => this.element() instanceof MPart ? this.element().id : undefined);\n\n  protected onSashStart(): void {\n    this._workbenchLayoutService.signalResizing(true);\n  }\n\n  protected onSashEnd(treeNode: MTreeNode, {sash1, sash2}: {[sashKey: string]: number}): void {\n    const ratio = sash1! / (sash1! + sash2!);\n    this._workbenchLayoutService.signalResizing(false);\n    void this._workbenchRouter.navigate(layout => layout.setTreeNodeSplitRatio(treeNode.id, ratio));\n  }\n}\n","@let element = this.element();\n\n@if (element.type === 'MPart') {\n  <ng-container *wbPortalOutlet=\"element.id | wbPartPortal; destroyOnDetach: true\"/>\n} @else if (element.child1.visible && element.child2.visible) {\n  @let sashSizes = element.ratio | wbTreeNodeSashSizes;\n  <sci-sashbox [direction]=\"element.direction\"\n               [attr.data-nodeid]=\"element.id\"\n               (sashStart)=\"onSashStart()\"\n               (sashEnd)=\"onSashEnd(element, $event)\">\n    <!-- Child 1 -->\n    <ng-template sciSash [size]=\"sashSizes[0]\" key=\"sash1\">\n      <wb-grid-element [element]=\"element.child1\" class=\"sash-1\"/>\n    </ng-template>\n    <!-- Child 2 -->\n    <ng-template sciSash [size]=\"sashSizes[1]\" key=\"sash2\">\n      <wb-grid-element [element]=\"element.child2\" class=\"sash-2\"/>\n    </ng-template>\n  </sci-sashbox>\n} @else if (element.child1.visible) {\n  <wb-grid-element [element]=\"element.child1\"/>\n} @else if (element.child2.visible) {\n  <wb-grid-element [element]=\"element.child2\"/>\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\nimport {MPart, MTreeNode} from '../layout/workbench-grid.model';\nimport {MAIN_AREA} from '../layout/workbench-layout';\n\n/**\n * Determines whether the given element requires a drop zone in the specified region.\n *\n * An element requires a drop zone if its layout is divided into multiple parts in that region.\n */\n@Pipe({name: 'wbRequiresDropZone'})\nexport class RequiresDropZonePipe implements PipeTransform {\n\n  public transform(element: MTreeNode | MPart, region: 'north' | 'south' | 'east' | 'west'): boolean {\n    return requiresDropZone(element, region);\n  }\n}\n\nfunction requiresDropZone(element: MTreeNode | MPart, region: 'north' | 'south' | 'east' | 'west'): boolean {\n  if (element instanceof MPart) {\n    // Return `false` for every part except the main area part, allowing for dragging a first view to the side of the main area grid.\n    return element.id === MAIN_AREA;\n  }\n\n  const {child1, child2} = element;\n  if (child1.visible && child2.visible) {\n    switch (region) {\n      case 'north':\n        // The element requires a drop zone if the element (or its first child) is divided horizontally into multiple parts.\n        return element.direction === 'row' || requiresDropZone(child1, region);\n      case 'south':\n        // The element requires a drop zone if the element (or its second child) is divided horizontally into multiple parts.\n        return element.direction === 'row' || requiresDropZone(child2, region);\n      case 'west':\n        // The element requires a drop zone if the element (or its first child) is divided vertically into multiple parts.\n        return element.direction === 'column' || requiresDropZone(child1, region);\n      case 'east':\n        // The element requires a drop zone if the element (or its second child) is divided vertically into multiple parts.\n        return element.direction === 'column' || requiresDropZone(child2, region);\n      default:\n        return false; // unsupported\n    }\n  }\n  return requiresDropZone(child1.visible ? child1 : child2, region);\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, inject, input} from '@angular/core';\nimport {GridElementComponent} from '../grid-element/grid-element.component';\nimport {RequiresDropZonePipe} from '../../view-dnd/requires-drop-zone.pipe';\nimport {ViewDropZoneDirective, WbViewDropEvent} from '../../view-dnd/view-drop-zone.directive';\nimport {MPartGrid} from '../workbench-grid.model';\nimport {GridDropTargets} from '../../view-dnd/grid-drop-targets.util';\nimport {WORKBENCH_ID} from '../../workbench.identifiers';\nimport {ViewDragService} from '../../view-dnd/view-drag.service';\n\n/**\n * Renders the layout of the workbench.\n *\n * The workbench layout is a grid of parts. It contains at least one part. A special part, the main area part, is not a stack of views\n * but embeds a sub-grid, the main area grid. It defines the arrangement of parts in the main area. The main area is optional.\n *\n * The layout is modeled as a tree of nodes `{@link MTreeNode}` and parts `{@link MPart}`. Each node has two children, which can be either\n * another node or a part (leaf). A node defines a split layout in which the two children are arranged vertically or horizontally.\n *\n *                       MTreeNode\n *                           |\n *            +--------------+--------------+\n *            |                             |                        +--------+-----------------------+\n *        MTreeNode                       MPart                      |  left  | +---------+---------+ |\n *     +------+------+                 (MAIN_AREA)                   |  top   | |         |         | |\n *     |             |                      |              ======>   |--------+ | left    | right   | |\n *   MPart         MPart                 MTreeNode         renders   |  left  | |         |         | |\n * (left-top)  (left-bottom)         +------+------+                 | bottom | +---------+---------+ |\n *                                   |             |                 +--------+-----------------------+\n *                                 MPart         MPart\n *                                (left)        (right)\n */\n@Component({\n  selector: 'wb-grid',\n  templateUrl: './grid.component.html',\n  styleUrls: ['./grid.component.scss'],\n  imports: [\n    GridElementComponent,\n    ViewDropZoneDirective,\n    RequiresDropZonePipe,\n  ],\n})\nexport class GridComponent {\n\n  /**\n   * Specifies the grid to render.\n   */\n  public readonly grid = input.required<MPartGrid>();\n\n  /**\n   * Controls dropping at the grid boundaries.\n   */\n  public readonly gridDropZone = input<GridDropZoneConfig | false>(false);\n\n  private readonly _workbenchId = inject(WORKBENCH_ID);\n  private readonly _viewDragService = inject(ViewDragService);\n\n  protected readonly canDrop = inject(ViewDragService).canDrop(this.grid);\n\n  protected onViewDrop(event: WbViewDropEvent): void {\n    this._viewDragService.dispatchViewMoveEvent({\n      source: {\n        workbenchId: event.dragData.workbenchId,\n        partId: event.dragData.partId,\n        viewId: event.dragData.viewId,\n        alternativeViewId: event.dragData.alternativeViewId,\n        navigation: event.dragData.navigation,\n        classList: event.dragData.classList,\n      },\n      target: GridDropTargets.resolve({\n        grid: this.grid(),\n        workbenchId: this._workbenchId,\n        dropRegion: event.dropRegion,\n      }),\n      dragData: event.dragData,\n    });\n  }\n}\n\n/**\n * Configures the drop zones of a grid.\n */\nexport interface GridDropZoneConfig {\n  /**\n   * Specifies the size of a drop zone region, either as percentage value [0,1] or absolute pixel value.\n   */\n  dropRegionSize?: number;\n  /**\n   * Specifies the size of the visual placeholder when dragging a view over a drop region.\n   * Can be a percentage value [0,1] or absolute pixel value. Defaults to {@link dropRegionSize}.\n   */\n  dropPlaceholderSize?: number;\n  /**\n   * Specifies attribute(s) to add to the drop zones.\n   */\n  dropZoneAttributes?: {[name: string]: unknown};\n}\n","@let dropZone = gridDropZone();\n@if (dropZone) {\n  <wb-grid-element [element]=\"grid().root\"\n                   wbViewDropZone\n                   [wbViewDropZoneRegionSize]=\"dropZone.dropRegionSize\"\n                   [wbViewDropZonePlaceholderSize]=\"dropZone.dropPlaceholderSize\"\n                   [wbViewDropZoneRegions]=\"canDrop() && {\n                     north: false,\n                     south: grid().root | wbRequiresDropZone:'south',\n                     west: grid().root | wbRequiresDropZone:'west',\n                     east: grid().root | wbRequiresDropZone:'east',\n                     center: false,\n                   }\"\n                   [wbViewDropZoneAttributes]=\"dropZone.dropZoneAttributes\"\n                   (wbViewDropZoneDrop)=\"onViewDrop($event)\"/>\n} @else {\n  <wb-grid-element [element]=\"grid().root\"/>\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/**\n * Converts a camelCase string to a dash-separated string.\n */\nexport function dasherize(value: string): string {\n  return value.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`);\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, DOCUMENT, ElementRef, inject, viewChild} from '@angular/core';\nimport {SciViewportComponent} from '@scion/components/viewport';\nimport {OnAttach, OnDetach} from '../../portal/wb-component-portal';\nimport {trackFocus} from '../../focus/workbench-focus-tracker.service';\nimport {WorkbenchDesktop} from '../workbench-desktop.model';\nimport {NgTemplateOutlet} from '@angular/common';\n\n/**\n * Acts as a placeholder for the desktop content.\n */\n@Component({\n  selector: 'wb-desktop-slot',\n  templateUrl: './desktop-slot.component.html',\n  styleUrl: './desktop-slot.component.scss',\n  imports: [\n    SciViewportComponent,\n    NgTemplateOutlet,\n  ],\n})\nexport class DesktopSlotComponent implements OnAttach, OnDetach {\n\n  protected readonly desktop = inject(WorkbenchDesktop);\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _document = inject(DOCUMENT);\n  private readonly _viewport = viewChild.required(SciViewportComponent);\n\n  private _scrollTop = 0;\n  private _scrollLeft = 0;\n  private _activeElementBeforeDetach: HTMLElement | undefined;\n\n  constructor() {\n    trackFocus(this._host, null);\n  }\n\n  /**\n   * Method invoked after attached this component to the DOM.\n   */\n  public onAttach(): void {\n    this._viewport().scrollTop = this._scrollTop;\n    this._viewport().scrollLeft = this._scrollLeft;\n\n    this._activeElementBeforeDetach?.focus();\n    this._activeElementBeforeDetach = undefined;\n  }\n\n  /**\n   * Method invoked before detaching this component from the DOM.\n   */\n  public onDetach(): void {\n    this._scrollTop = this._viewport().scrollTop;\n    this._scrollLeft = this._viewport().scrollLeft;\n\n    const activeElement = this._document.activeElement;\n    if (this._host.contains(activeElement) && activeElement instanceof HTMLElement) {\n      this._activeElementBeforeDetach = activeElement;\n    }\n  }\n}\n","<sci-viewport>\n  <ng-container *ngTemplateOutlet=\"desktop.template()\"/>\n</sci-viewport>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {Injectable, signal, TemplateRef} from '@angular/core';\nimport {WbComponentPortal} from '../portal/wb-component-portal';\nimport {DesktopSlotComponent} from './desktop-slot/desktop-slot.component';\n\n/**\n * A desktop is a visual workbench element for displaying content when the layout is empty (no view and no navigated part).\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchDesktop {\n\n  public readonly template = signal<TemplateRef<void> | undefined>(undefined);\n  public readonly slot: {portal: WbComponentPortal<DesktopSlotComponent>};\n\n  constructor() {\n    this.slot = {portal: this.createPortal()};\n  }\n\n  private createPortal(): WbComponentPortal<DesktopSlotComponent> {\n    return new WbComponentPortal(DesktopSlotComponent, {\n      debugName: 'DesktopSlotComponent',\n      providers: [\n        {provide: WorkbenchDesktop, useValue: this},\n      ],\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, inject} from '@angular/core';\nimport {ɵWorkbenchPart} from '../ɵworkbench-part.model';\nimport {WorkbenchLayoutService} from '../../layout/workbench-layout.service';\nimport {ViewDragService} from '../../view-dnd/view-drag.service';\nimport {ViewDropZoneDirective, WbViewDropEvent} from '../../view-dnd/view-drop-zone.directive';\nimport {WORKBENCH_ID} from '../../workbench.identifiers';\nimport {GridDropTargets} from '../../view-dnd/grid-drop-targets.util';\nimport {MAIN_AREA} from '../../layout/workbench-layout';\nimport {GridComponent} from '../../layout/grid/grid.component';\nimport {dasherize} from '../../common/dasherize.util';\nimport {WorkbenchPortalOutletDirective} from '../../portal/workbench-portal-outlet.directive';\nimport {WorkbenchDesktop} from '../../desktop/workbench-desktop.model';\n\n/**\n * Renders the layout of the {@link MAIN_AREA} part.\n *\n * The main area is a special part that is a subgrid, not a stack of views.\n *\n * The main area has the following characteristics:\n * - is optional;\n * - is the primary place to open views;\n * - is shared by perspectives having a main area;\n * - can be maximized;\n *\n * The layout is modeled as a tree of nodes `{@link MTreeNode}` and parts `{@link MPart}`. Each node has two children, which can be either\n * another node or a part (leaf). A node defines a split layout in which the two children are arranged vertically or horizontally.\n *\n *         MTreeNode\n *            |                         +------+-------+\n *     +------+------+        ======>   | left | right |\n *     |             |        renders   +------+-------+\n *   MPart         MPart\n *  (left)        (right)\n */\n@Component({\n  selector: `wb-part[data-partid=\"${MAIN_AREA}\"]`, // eslint-disable-line @angular-eslint/component-selector\n  templateUrl: './main-area-part.component.html',\n  styleUrls: ['./main-area-part.component.scss'],\n  imports: [\n    GridComponent,\n    ViewDropZoneDirective,\n    WorkbenchPortalOutletDirective,\n  ],\n  host: {\n    '[attr.data-grid]': 'dasherize(part.gridName())',\n    '[attr.data-active]': `part.active() ? '' : null`,\n  },\n})\nexport class MainAreaPartComponent {\n\n  private readonly _workbenchId = inject(WORKBENCH_ID);\n  private readonly _layout = inject(WorkbenchLayoutService).layout;\n  private readonly _viewDragService = inject(ViewDragService);\n\n  protected readonly part = inject(ɵWorkbenchPart);\n  protected readonly mainAreaGrid = computed(() => this._layout().grids.mainArea);\n  protected readonly desktop = inject(WorkbenchDesktop);\n  protected readonly dasherize = dasherize;\n  protected readonly canDrop = inject(ViewDragService).canDrop(computed(() => this._layout().grids.mainArea));\n\n  protected onDesktopViewDrop(event: WbViewDropEvent): void {\n    this._viewDragService.dispatchViewMoveEvent({\n      source: {\n        workbenchId: event.dragData.workbenchId,\n        partId: event.dragData.partId,\n        viewId: event.dragData.viewId,\n        alternativeViewId: event.dragData.alternativeViewId,\n        navigation: event.dragData.navigation,\n        classList: event.dragData.classList,\n      },\n      target: GridDropTargets.resolve({\n        grid: this.mainAreaGrid(),\n        workbenchId: this._workbenchId,\n        dropRegion: event.dropRegion,\n      }),\n      dragData: event.dragData,\n    });\n  }\n}\n","@if (mainAreaGrid().root.visible) {\n  <wb-grid [grid]=\"mainAreaGrid()\"\n           [gridDropZone]=\"{\n             dropRegionSize: 100,\n             dropPlaceholderSize: 100,\n             dropZoneAttributes: {\n               'data-grid': 'main-area',\n               'data-partid': part.id,\n             }\n           }\"\n           [attr.data-grid]=\"'main-area'\"\n           class=\"e2e-slot\"/>\n} @else {\n  <div wbViewDropZone\n       [wbViewDropZoneRegions]=\"canDrop() && {center: true, north: false, south: false, west: false, east: false}\"\n       [wbViewDropZoneAttributes]=\"{\n         'data-desktop': '',\n         'data-partid': part.id,\n       }\"\n       (wbViewDropZoneDrop)=\"onDesktopViewDrop($event)\"\n       class=\"desktop e2e-part-slot e2e-slot\">\n    @if (part.navigation()) {\n      <ng-container *wbPortalOutlet=\"part.slot.portal; destroyOnDetach: false\"/>\n    } @else {\n      <ng-container *wbPortalOutlet=\"desktop.slot.portal; destroyOnDetach: false\"/>\n    }\n  </div>\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Pipe, PipeTransform, Type} from '@angular/core';\n\n/**\n * Tests if the object is of the specified type. If so, returns the object, otherwise returns `null`.\n */\n@Pipe({name: 'wbInstanceof'})\nexport class InstanceofPipe implements PipeTransform {\n\n  public transform<T>(object: unknown | undefined, type: Type<T>): T | null {\n    return object instanceof type ? object : null;\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, inject, Injector, input, runInInjectionContext, TemplateRef} from '@angular/core';\nimport {WorkbenchPartAction} from '../../workbench.model';\nimport {WorkbenchPart} from '../workbench-part.model';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {NgComponentOutlet, NgTemplateOutlet} from '@angular/common';\nimport {ɵWorkbenchPart} from '../ɵworkbench-part.model';\nimport {InstanceofPipe} from '../../common/instanceof.pipe';\n\n@Component({\n  selector: 'wb-part-action',\n  templateUrl: './part-action.component.html',\n  styleUrl: './part-action.component.scss',\n  imports: [\n    NgTemplateOutlet,\n    NgComponentOutlet,\n    InstanceofPipe,\n  ],\n})\nexport class PartActionComponent {\n\n  public readonly action = input.required({transform: (action: WorkbenchPartAction) => runInInjectionContext(this._injector, () => transform(action))});\n\n  private readonly _injector = inject(Injector);\n\n  protected readonly TemplatePartAction = TemplatePartAction;\n  protected readonly ComponentPartAction = ComponentPartAction;\n}\n\n/**\n * Transforms a {@link WorkbenchPartAction} into a {@link ComponentPartAction} or {@link TemplatePartAction}.\n */\nfunction transform(action: WorkbenchPartAction): ComponentPartAction | TemplatePartAction {\n  const part = inject(WorkbenchPart);\n  const injector = Injector.create({\n    parent: action.injector ?? inject(Injector),\n    providers: [\n      {provide: ɵWorkbenchPart, useValue: part},\n      {provide: WorkbenchPart, useExisting: ɵWorkbenchPart},\n    ],\n  });\n\n  if (action.content instanceof TemplateRef) {\n    return new TemplatePartAction(action.content, {$implicit: part, ...action.inputs}, injector);\n  }\n  else {\n    return new ComponentPartAction(action.content, action.inputs, injector);\n  }\n}\n\n/**\n * Represents a part action with a component.\n */\nclass ComponentPartAction {\n\n  constructor(public component: ComponentType<unknown>,\n              public inputs: {[name: string]: unknown} | undefined,\n              public injector: Injector) {\n  }\n}\n\n/**\n * Represents a part action with a template.\n */\nexport class TemplatePartAction {\n\n  constructor(public template: TemplateRef<unknown>,\n              public context: {[name: string]: unknown},\n              public injector: Injector) {\n  }\n}\n","@if (action() | wbInstanceof:TemplatePartAction; as action) {\n  <ng-container *ngTemplateOutlet=\"action.template; context: action.context; injector: action.injector\"/>\n}\n@if (action() | wbInstanceof:ComponentPartAction; as action) {\n  <ng-container *ngComponentOutlet=\"action.component; inputs: action.inputs; injector: action.injector\"/>\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {InjectionToken, Injector} from '@angular/core';\nimport {ComponentType} from '@angular/cdk/portal';\n\n/**\n * Signature of a function to provide icons to the SCION Workbench.\n *\n * An icon provider is a function that returns the component for an icon. The component renders the icon.\n *\n * Alternatively, the icon provider can return a descriptor, allowing for additional configuration such as inputs.\n * Inputs are available as input properties in the component. The component can use the inputs to render the icon.\n *\n * Icon keys used by the SCION Workbench start with the `workbench.` prefix. To not replace built-in workbench icons,\n * the icon provider can return `undefined` for icons starting with the `workbench.` prefix.\n *\n * An icon provider can be registered via configuration passed to the {@link provideWorkbench} function.\n *\n * The function can call `inject` to get any required dependencies.\n *\n * @param icon - The key of the icon for which to provide the icon component.\n * @return ComponentType or {@link WorkbenchIconDescriptor} to render the icon, or `undefined` if not found.\n */\nexport type WorkbenchIconProviderFn = (icon: string) => ComponentType<unknown> | WorkbenchIconDescriptor | undefined;\n\n/**\n * Controls rendering of a workbench icon.\n */\nexport interface WorkbenchIconDescriptor {\n  /**\n   * Specifies the component to render the icon.\n   */\n  component: ComponentType<unknown>;\n  /**\n   * Specifies data to pass to the component. Inputs are available as input properties in the component.\n   *\n   * ```ts\n   * @Component({...})\n   * class SomeIconComponent {\n   *   icon = input.required<string>();\n   * }\n   * ```\n   */\n  inputs?: {[name: string]: unknown};\n  /**\n   * Sets the injector for the instantiation of the component, giving control over the objects available for injection.\n   *\n   * **Example:**\n   * ```ts\n   * Injector.create({\n   *   parent: ...,\n   *   providers: [\n   *    {provide: <TOKEN>, useValue: <VALUE>}\n   *   ],\n   * })\n   * ```\n   */\n  injector?: Injector;\n}\n\n/**\n * DI token for injecting icon providers to provide icons to the SCION Workbench.\n *\n * Multiple icon providers can be registered. Providers are called in registration order.\n * If a provider does not provide the icon, the next provider is called, and so on.\n */\nexport const WORKBENCH_ICON_PROVIDER = new InjectionToken<WorkbenchIconProviderFn>('WORKBENCH_ICON_PROVIDER');\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n *  SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component, computed, createComponent, DestroyRef, effect, ElementRef, EnvironmentInjector, inject, Injector, input, Renderer2, runInInjectionContext, signal, Signal, untracked} from '@angular/core';\nimport {WORKBENCH_ICON_PROVIDER, WorkbenchIconDescriptor, WorkbenchIconProviderFn} from './workbench-icon-provider.model';\n\n/**\n * Renders an icon based on registered icon providers.\n *\n * Multiple icon providers can be registered. Providers are called in registration order.\n * If a provider does not provide the icon, the next provider is called, and so on.\n *\n * @experimental since 20.0.0-beta.3; API and behavior may change in any version without notice.\n */\n@Component({\n  selector: 'wb-icon',\n  template: '',\n  styleUrl: './icon.component.scss',\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class IconComponent {\n\n  /**\n   * Specifies the icon to display.\n   *\n   * Refer to the installed icon providers for a list of supported icons.\n   */\n  public readonly icon = input.required<string | undefined>();\n\n  private readonly _injector = inject(Injector);\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _renderer = inject(Renderer2);\n\n  private readonly _iconDescriptor = computeIconDescriptor(this.icon);\n\n  constructor() {\n    // Render icon in an animation frame to capture CSS classes set on the host.\n    const animationFrame = requestAnimationFrame(() => this.renderIcon());\n    inject(DestroyRef).onDestroy(() => cancelAnimationFrame(animationFrame));\n  }\n\n  /**\n   * Renders the icon, using this element (`wb-icon`) as the host of the icon component.\n   */\n  private renderIcon(): void {\n    effect(onCleanup => {\n      const {component, injector, inputs} = this._iconDescriptor() ?? {};\n\n      untracked(() => {\n        // Capture CSS classes of the host (before constructing the icon component).\n        const hostCssClass = this._host.classList.value;\n\n        // Create the icon component and attach it, rendering a placeholder component if no provider\n        // is found to effectively remove the previous component (if any) from the DOM.\n        const componentRef = createComponent(component ?? NullIconComponent, {\n          elementInjector: injector ?? this._injector,\n          environmentInjector: this._injector.get(EnvironmentInjector),\n          hostElement: this._host,\n        });\n\n        // Set inputs.\n        for (const input in inputs) {\n          componentRef.setInput(input, inputs[input]);\n        }\n        componentRef.changeDetectorRef.detectChanges();\n\n        // Destroy the component when the icon is changed.\n        onCleanup(() => {\n          componentRef.destroy();\n          // Destroying the component does not unset its host bindings, e.g., CSS classes applied to the host element.\n          // Therefore, manually reset CSS classes to the CSS classes of the host.\n          this._renderer.setAttribute(this._host, 'class', hostCssClass);\n        });\n      });\n    }, {injector: this._injector});\n  }\n}\n\n/**\n * Computes the icon descriptor for the specified icon based on the installed icon providers.\n */\nfunction computeIconDescriptor(icon: Signal<string | undefined>): Signal<WorkbenchIconDescriptor | undefined> {\n  const injector = inject(Injector);\n  const iconProviders = inject(WORKBENCH_ICON_PROVIDER, {optional: true}) as WorkbenchIconProviderFn[] | null;\n  if (!iconProviders?.length) {\n    return signal(undefined);\n  }\n\n  return computed(() => {\n    if (!icon()) {\n      return undefined;\n    }\n\n    return untracked(() => {\n      for (const iconProvider of iconProviders) {\n        const componentOrDescriptor = runInInjectionContext(injector, () => iconProvider(icon()!));\n        if (componentOrDescriptor) {\n          return typeof componentOrDescriptor === 'function' ? {component: componentOrDescriptor} : componentOrDescriptor;\n        }\n      }\n      return undefined;\n    });\n  });\n}\n\n/**\n * Acts as placeholder if no icon could be found.\n */\n@Component({template: ''})\nexport class NullIconComponent {\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n *  SPDX-License-Identifier: EPL-2.0\n */\n\nimport {booleanAttribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, DestroyRef, effect, ElementRef, forwardRef, HostBinding, HostListener, inject, input, linkedSignal, output, untracked, viewChild} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR, NonNullableFormBuilder, ReactiveFormsModule} from '@angular/forms';\nimport {noop} from 'rxjs';\nimport {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {UUID} from '@scion/toolkit/uuid';\nimport {TextPipe} from '../text/text.pipe';\nimport {IconComponent} from '../icon/icon.component';\n\n/**\n * Provides a filter control.\n */\n@Component({\n  selector: 'wb-filter-field',\n  templateUrl: './filter-field.component.html',\n  styleUrls: ['./filter-field.component.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  imports: [\n    ReactiveFormsModule,\n    TextPipe,\n    IconComponent,\n  ],\n  providers: [\n    {provide: NG_VALUE_ACCESSOR, multi: true, useExisting: forwardRef(() => FilterFieldComponent)},\n  ],\n})\nexport class FilterFieldComponent implements ControlValueAccessor {\n\n  /**\n   * Sets focus order in sequential keyboard navigation.\n   * If not specified, the focus order is according to the position in the document (tabindex=0).\n   */\n  public readonly tabindex = input<number>();\n\n  /**\n   * Specifies the hint displayed when this field is empty.\n   */\n  public readonly placeholder = input<string>();\n  public readonly disabled = input(false, {transform: booleanAttribute});\n\n  /**\n   * Emits on filter change.\n   */\n  public readonly filter = output<string>();\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _focusManager = inject(FocusMonitor);\n  private readonly _cd = inject(ChangeDetectorRef);\n  private readonly _inputElement = viewChild.required<ElementRef<HTMLInputElement>>('input');\n  private readonly _disabled = linkedSignal(() => this.disabled());\n\n  protected readonly id = UUID.randomUUID();\n  protected readonly formControl = inject(NonNullableFormBuilder).control('', {updateOn: 'change'});\n\n  private _cvaChangeFn: (value: string) => void = noop;\n  private _cvaTouchedFn: () => void = noop;\n\n  @HostBinding('attr.tabindex')\n  protected componentTabindex = -1; // component is not focusable in sequential keyboard navigation, but tabindex (if any) is installed on input field\n\n  @HostBinding('class.empty')\n  protected get empty(): boolean {\n    return !this.formControl.value;\n  }\n\n  constructor() {\n    this.formControl.valueChanges\n      .pipe(takeUntilDestroyed())\n      .subscribe(value => {\n        this._cvaChangeFn(value);\n        this.filter.emit(value);\n      });\n\n    this._focusManager.monitor(this._host, true)\n      .pipe(takeUntilDestroyed())\n      .subscribe((focusOrigin: FocusOrigin) => {\n        if (!focusOrigin) {\n          this._cvaTouchedFn(); // triggers form field validation and signals a blur event\n        }\n      });\n\n    effect(() => {\n      const disabled = this._disabled();\n      // Prevent value emission when changing form control enabled state.\n      untracked(() => disabled ? this.formControl.disable({emitEvent: false}) : this.formControl.enable({emitEvent: false}));\n    });\n\n    inject(DestroyRef).onDestroy(() => this._focusManager.stopMonitoring(this._host));\n  }\n\n  @HostListener('focus')\n  public focus(): void {\n    this._inputElement().nativeElement.focus();\n  }\n\n  protected onClear(): void {\n    this.formControl.setValue('');\n    this.focus(); // restore the focus\n  }\n\n  /**\n   * Method implemented as part of `ControlValueAccessor` to work with Angular forms API\n   * @docs-private\n   */\n  public registerOnChange(fn: (value: string) => void): void {\n    this._cvaChangeFn = fn;\n  }\n\n  /**\n   * Method implemented as part of `ControlValueAccessor` to work with Angular forms API\n   * @docs-private\n   */\n  public registerOnTouched(fn: () => void): void {\n    this._cvaTouchedFn = fn;\n  }\n\n  /**\n   * Method implemented as part of `ControlValueAccessor` to work with Angular forms API\n   * @docs-private\n   */\n  public setDisabledState(isDisabled: boolean): void {\n    this._disabled.set(isDisabled);\n  }\n\n  /**\n   * Method implemented as part of `ControlValueAccessor` to work with Angular forms API\n   * @docs-private\n   */\n  public writeValue(value: string | null | undefined): void {\n    this.formControl.setValue(value ?? '', {emitEvent: false});\n    this._cd.markForCheck();\n  }\n}\n","<label [for]=\"id\" class=\"filter-icon\">\n  <wb-icon icon=\"workbench.search\"/>\n</label>\n<input #input\n       [attr.id]=\"id\"\n       autocomplete=\"off\"\n       [formControl]=\"formControl\"\n       [tabindex]=\"tabindex() ?? 0\"\n       [placeholder]=\"placeholder() ?? ''\">\n<button class=\"clear\" tabindex=\"-1\" (click)=\"onClear()\" [title]=\"('%workbench.clear.tooltip' | wbText)()\">\n  <wb-icon icon=\"workbench.clear\"/>\n</button>\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, inject} from '@angular/core';\nimport {WorkbenchView} from '../../view/workbench-view.model';\nimport {TextPipe} from '../../text/text.pipe';\nimport {IconComponent} from '../../icon/icon.component';\n\n@Component({\n  selector: 'wb-view-tab-content',\n  templateUrl: './view-tab-content.component.html',\n  styleUrls: ['./view-tab-content.component.scss'],\n  imports: [\n    TextPipe,\n    IconComponent,\n  ],\n})\nexport class ViewTabContentComponent {\n\n  protected readonly view = inject(WorkbenchView);\n}\n","@if (view.dirty()) {\n  <wb-icon icon=\"workbench.dirty\" class=\"dirty e2e-dirty\"/>\n}\n\n<span class=\"title e2e-title\">\n  {{(view.title() | wbText)()}}\n</span>\n\n@if (view.heading()) {\n  <span class=\"heading e2e-heading\">\n    {{(view.heading() | wbText)()}}\n  </span>\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component, computed, inject, Injector, input, Signal} from '@angular/core';\nimport {CdkPortalOutlet, ComponentPortal} from '@angular/cdk/portal';\nimport {WorkbenchViewRegistry} from '../../view/workbench-view.registry';\nimport {ViewTabContentComponent} from '../view-tab-content/view-tab-content.component';\nimport {WorkbenchConfig} from '../../workbench-config';\nimport {ViewId} from '../../workbench.identifiers';\nimport {WorkbenchView} from '../../view/workbench-view.model';\nimport {VIEW_TAB_RENDERING_CONTEXT, ViewTabRenderingContext} from '../../workbench.constants';\nimport {TextPipe} from '../../text/text.pipe';\nimport {IconComponent} from '../../icon/icon.component';\n\n@Component({\n  selector: 'wb-view-list-item',\n  templateUrl: './view-list-item.component.html',\n  styleUrls: ['./view-list-item.component.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  imports: [\n    CdkPortalOutlet,\n    TextPipe,\n    IconComponent,\n  ],\n  host: {\n    '[class.active]': 'view().active()',\n    '[attr.data-viewid]': 'view().id',\n  },\n})\nexport class ViewListItemComponent {\n\n  public readonly viewId = input.required<ViewId>();\n\n  private readonly _viewRegistry = inject(WorkbenchViewRegistry);\n\n  protected view = computed(() => this._viewRegistry.get(this.viewId()));\n  protected viewTabContentPortal = this.computeViewTabContentPortal();\n\n  protected onClose(): void {\n    void this.view().close();\n  }\n\n  private computeViewTabContentPortal(): Signal<ComponentPortal<unknown>> {\n    const injector = inject(Injector);\n    const workbenchConfig = inject(WorkbenchConfig);\n\n    return computed(() => {\n      const componentType = workbenchConfig.viewTabComponent ?? ViewTabContentComponent;\n      return new ComponentPortal(componentType, null, Injector.create({\n        parent: injector,\n        providers: [\n          {provide: WorkbenchView, useValue: this.view()},\n          {provide: VIEW_TAB_RENDERING_CONTEXT, useValue: 'list-item' satisfies ViewTabRenderingContext},\n        ],\n      }));\n    });\n  }\n}\n","<div class=\"content\">\n  <ng-container *cdkPortalOutlet=\"viewTabContentPortal()\"/>\n</div>\n\n@if (view().closable()) {\n  <button (click)=\"onClose()\"\n          [title]=\"('%workbench.close.tooltip' | wbText)()\"\n          [disabled]=\"!view().isClosable()\"\n          class=\"close e2e-close\">\n    <wb-icon icon=\"workbench.close\"/>\n  </button>\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component, computed, effect, HostBinding, HostListener, inject, Signal, viewChild} from '@angular/core';\nimport {OverlayRef} from '@angular/cdk/overlay';\nimport {WorkbenchView} from '../../view/workbench-view.model';\nimport {NonNullableFormBuilder, ReactiveFormsModule} from '@angular/forms';\nimport {FilterFieldComponent} from '../../filter-field/filter-field.component';\nimport {PartId} from '../../workbench.identifiers';\nimport {WorkbenchPart} from '../workbench-part.model';\nimport {SciViewportComponent} from '@scion/components/viewport';\nimport {ViewListItemComponent} from '../view-list-item/view-list-item.component';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {text} from '../../text/text';\n\n@Component({\n  selector: 'wb-view-list',\n  templateUrl: './view-list.component.html',\n  styleUrls: ['./view-list.component.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  imports: [\n    ReactiveFormsModule,\n    FilterFieldComponent,\n    ViewListItemComponent,\n    SciViewportComponent,\n  ],\n})\nexport class ViewListComponent {\n\n  private readonly _filterFieldComponent = viewChild.required(FilterFieldComponent);\n  private readonly _part = inject(WorkbenchPart);\n  private readonly _overlayRef = inject(OverlayRef);\n\n  /** Views that are scrolled into the tab bar. */\n  protected readonly viewsInsideTabbar: Signal<WorkbenchView[]>;\n  /** Views that are scrolled out of the tab bar. */\n  protected readonly viewsOutsideTabbar: Signal<WorkbenchView[]>;\n  protected readonly filterFormControl = inject(NonNullableFormBuilder).control('');\n\n  @HostBinding('attr.data-partid')\n  protected get partId(): PartId {\n    return this._part.id;\n  }\n\n  constructor() {\n    const filterText = toSignal(this.filterFormControl.valueChanges, {initialValue: this.filterFormControl.value});\n    const views = this._part.views().map(view => new FilterableView(view));\n\n    this.viewsInsideTabbar = computed(() => views\n      .filter(({view}) => view.scrolledIntoView())\n      .filter(view => view.matches(filterText()))\n      .map(({view}) => view),\n    );\n    this.viewsOutsideTabbar = computed(() => views\n      .filter(({view}) => !view.scrolledIntoView())\n      .filter(view => view.matches(filterText()))\n      .map(({view}) => view),\n    );\n\n    const effectRef = effect(() => {\n      this._filterFieldComponent().focus();\n      effectRef.destroy();\n    });\n  }\n\n  protected onActivateView(view: WorkbenchView): void {\n    void view.activate();\n    this._overlayRef.dispose();\n  }\n\n  @HostListener('document:keydown.escape')\n  protected onEscape(): void {\n    this._overlayRef.dispose();\n  }\n\n  @HostListener('mousedown', ['$event'])\n  @HostListener('sci-microfrontend-focusin', ['$event'])\n  protected onHostCloseEvent(event: Event): void {\n    event.stopPropagation(); // Prevent closing this overlay if emitted from a child of this overlay.\n  }\n\n  @HostListener('document:mousedown')\n  @HostListener('document:sci-microfrontend-focusin')\n  protected onDocumentCloseEvent(): void {\n    this._overlayRef.dispose();\n  }\n}\n\n/**\n * Creates a regular expression of the given filter text.\n */\nfunction toFilterRegExp(filterText: string): RegExp {\n  // Escape the user input\n  const escapedString = filterText.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, '\\\\$&');\n  return new RegExp(escapedString, 'i');\n}\n\n/**\n * Represents a {@link WorkbenchView} that can be filtered by its translated title and heading.\n */\nclass FilterableView {\n\n  private readonly _title: Signal<string | null>;\n  private readonly _heading: Signal<string | null>;\n\n  constructor(public readonly view: WorkbenchView) {\n    this._title = text(view.title);\n    this._heading = text(view.heading);\n  }\n\n  /**\n   * Checks if this view matches the specified filter text.\n   */\n  public matches(filterText: string): boolean {\n    const viewText = `${this._title() ?? ''} ${this._heading() ?? ''}`;\n    return !filterText || !!viewText.match(toFilterRegExp(filterText));\n  }\n}\n","<wb-filter-field [formControl]=\"filterFormControl\" class=\"e2e-view-filter\"/>\n\n@if (viewsOutsideTabbar().length || viewsInsideTabbar().length) {\n  <sci-viewport>\n    @for (view of viewsOutsideTabbar(); track view.id) {\n      <wb-view-list-item [viewId]=\"view.id\" (click)=\"onActivateView(view)\"/>\n    }\n    @if (viewsOutsideTabbar().length && viewsInsideTabbar().length) {\n      <hr>\n    }\n    @for (view of viewsInsideTabbar(); track view.id) {\n      <wb-view-list-item [viewId]=\"view.id\" (click)=\"onActivateView(view)\"/>\n    }\n  </sci-viewport>\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, DestroyRef, ElementRef, HostListener, inject, Injector, signal, Signal} from '@angular/core';\nimport {ConnectedPosition, Overlay, OverlayConfig, OverlayRef} from '@angular/cdk/overlay';\nimport {ComponentPortal} from '@angular/cdk/portal';\nimport {ViewListComponent} from '../view-list/view-list.component';\nimport {WorkbenchPart} from '../workbench-part.model';\nimport {IconComponent} from '../../icon/icon.component';\n\n@Component({\n  selector: 'wb-view-list-button',\n  templateUrl: './view-list-button.component.html',\n  styleUrls: ['./view-list-button.component.scss'],\n  host: {\n    '[class.menu-open]': `menuState() === 'open'`,\n    '[attr.tabindex]': '0',\n  },\n  imports: [\n    IconComponent,\n  ],\n})\nexport class ViewListButtonComponent {\n\n  private static readonly SOUTH: ConnectedPosition = {originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', panelClass: 'wb-south'};\n  private static readonly NORTH: ConnectedPosition = {originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', panelClass: 'wb-north'};\n\n  private readonly _host = inject(ElementRef);\n  private readonly _overlay = inject(Overlay);\n  private readonly _injector = inject(Injector);\n  private readonly _destroyRef = inject(DestroyRef);\n\n  /** Number of views that are scrolled out of the tab bar. */\n  protected readonly scrolledOutOfViewTabCount: Signal<number>;\n  protected readonly menuState = signal<'open' | 'closed'>('closed');\n\n  constructor() {\n    const part = inject(WorkbenchPart);\n    this.scrolledOutOfViewTabCount = computed(() => part.views().reduce((count, view) => view.scrolledIntoView() ? count : count + 1, 0));\n  }\n\n  @HostListener('click')\n  @HostListener('keydown.enter')\n  @HostListener('keydown.space')\n  protected onClick(): void {\n    this.menuState.set('open');\n    void this.openMenu().finally(() => this.menuState.set('closed'));\n  }\n\n  private openMenu(): Promise<void> {\n    const positionStrategy = this._overlay.position()\n      .flexibleConnectedTo(this._host)\n      .withFlexibleDimensions(false)\n      .withPositions([ViewListButtonComponent.SOUTH, ViewListButtonComponent.NORTH]);\n\n    const overlayRef = this._overlay.create(new OverlayConfig({\n      scrollStrategy: this._overlay.scrollStrategies.noop(),\n      disposeOnNavigation: true,\n      panelClass: 'wb-view-list-menu',\n      positionStrategy,\n    }));\n\n    const componentRef = overlayRef.attach(new ComponentPortal(ViewListComponent, null, Injector.create({\n      parent: this._injector,\n      providers: [{provide: OverlayRef, useValue: overlayRef}],\n    })));\n\n    this._destroyRef.onDestroy(() => overlayRef.dispose());\n    return new Promise<void>(resolve => componentRef.onDestroy(resolve));\n  }\n}\n","<wb-icon icon=\"workbench.menu_down\" class=\"menu-down\"/>\n@if (scrolledOutOfViewTabCount(); as count) {\n  <span class=\"count e2e-hidden-tab-count\">{{count}}</span>\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {afterRenderEffect, Component, DestroyRef, DOCUMENT, ElementRef, inject, Provider, untracked, viewChild} from '@angular/core';\nimport {RouterOutlet} from '@angular/router';\nimport {SciViewportComponent} from '@scion/components/viewport';\nimport {ViewMenuService} from '../part/view-context-menu/view-menu.service';\nimport {ɵWorkbenchView} from './ɵworkbench-view.model';\nimport {Logger, LoggerNames} from '../logging';\nimport {CdkTrapFocus} from '@angular/cdk/a11y';\nimport {ViewDragService} from '../view-dnd/view-drag.service';\nimport {GLASS_PANE_BLOCKABLE, GLASS_PANE_OPTIONS, GlassPaneDirective, GlassPaneOptions} from '../glass-pane/glass-pane.directive';\nimport {WorkbenchView} from './workbench-view.model';\nimport {OnAttach, OnDetach} from '../portal/wb-component-portal';\nimport {RouterOutletRootContextDirective} from '../routing/router-outlet-root-context.directive';\nimport {FocusTrackerRef, trackFocus} from '../focus/workbench-focus-tracker.service';\n\n/**\n * Acts as a placeholder for a view's content that Angular fills based on the current router state of the associated view outlet.\n */\n@Component({\n  selector: 'wb-view-slot',\n  templateUrl: './view-slot.component.html',\n  styleUrls: ['./view-slot.component.scss'],\n  imports: [\n    RouterOutlet,\n    RouterOutletRootContextDirective,\n    CdkTrapFocus,\n    SciViewportComponent,\n  ],\n  hostDirectives: [\n    GlassPaneDirective,\n  ],\n  host: {\n    '[attr.data-viewid]': 'view.id',\n    '[attr.data-active]': `view.active() ? '' : null`,\n    '[class.view-drag]': 'viewDragService.dragging()',\n    '[class]': 'view.classList.asList()',\n  },\n  providers: [\n    configureViewGlassPane(),\n  ],\n})\nexport class ViewSlotComponent implements OnAttach, OnDetach {\n\n  protected readonly view = inject(ɵWorkbenchView);\n  protected readonly viewDragService = inject(ViewDragService);\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _document = inject(DOCUMENT);\n  private readonly _viewport = viewChild.required(SciViewportComponent);\n  private readonly _focusTrackerRef: FocusTrackerRef;\n\n  private _scrollTop = 0;\n  private _scrollLeft = 0;\n  private _activeElementBeforeDetach: HTMLElement | undefined;\n\n  constructor() {\n    this._focusTrackerRef = trackFocus(this._host, this.view);\n\n    this.installComponentLifecycleLogger();\n    this.installMenuAccelerators();\n    this.unsetActiveElementOnPartDeactivate();\n  }\n\n  public focus(): void {\n    if (!this._host.contains(this._document.activeElement)) {\n      this._viewport().focus();\n    }\n  }\n\n  /**\n   * Method invoked after attached this component to the DOM.\n   */\n  public onAttach(): void {\n    this._viewport().scrollTop = this._scrollTop;\n    this._viewport().scrollLeft = this._scrollLeft;\n\n    if (this.view.focused()) {\n      this._activeElementBeforeDetach?.focus();\n      this._activeElementBeforeDetach = undefined;\n    }\n  }\n\n  /**\n   * Method invoked before detaching this component from the DOM.\n   */\n  public onDetach(): void {\n    this._scrollTop = this._viewport().scrollTop;\n    this._scrollLeft = this._viewport().scrollLeft;\n\n    if (this.view.focused()) {\n      const activeElement = this._document.activeElement;\n      if (this._host.contains(activeElement) && activeElement instanceof HTMLElement) {\n        this._activeElementBeforeDetach = activeElement;\n      }\n    }\n  }\n\n  private installMenuAccelerators(): void {\n    inject(ViewMenuService).installMenuAccelerators(inject(ElementRef), this.view);\n  }\n\n  /**\n   * Unsets the active workbench element if this view was the focused element when its part is deactivated,\n   * such as when closing the activity containing this view. Otherwise, the active element would not be unset.\n   */\n  private unsetActiveElementOnPartDeactivate(): void {\n    afterRenderEffect(() => {\n      const partActive = this.view.part().active();\n      if (!partActive) {\n        untracked(() => this._focusTrackerRef.unsetActiveElement());\n      }\n    });\n  }\n\n  private installComponentLifecycleLogger(): void {\n    const logger = inject(Logger);\n    logger.debug(() => `Constructing ViewComponent. [viewId=${this.view.id}]`, LoggerNames.LIFECYCLE);\n    inject(DestroyRef).onDestroy(() => logger.debug(() => `Destroying ViewComponent [viewId=${this.view.id}]'`, LoggerNames.LIFECYCLE));\n  }\n}\n\n/**\n * Blocks this view when dialog(s) overlay it.\n */\nfunction configureViewGlassPane(): Provider[] {\n  return [\n    {\n      provide: GLASS_PANE_BLOCKABLE,\n      useFactory: () => inject(ɵWorkbenchView),\n    },\n    {\n      provide: GLASS_PANE_OPTIONS,\n      useFactory: (): GlassPaneOptions => ({attributes: {'data-viewid': inject(WorkbenchView).id}}),\n    },\n  ];\n}\n","<sci-viewport cdkTrapFocus>\n  <router-outlet [name]=\"view.id\" wbRouterOutletRootContext/>\n</sci-viewport>\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {fromEvent, Observable, race} from 'rxjs';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ɵDestroyRef} from './ɵdestroy-ref';\n\n/**\n * Makes the given handle \"movable\" for the user to move it by mouse or touch gesture.\n *\n * The returned Observable emits when start moving the handle, while moving it, and when stop moving the handle.\n * The Observable never completes.\n */\nexport function fromMoveHandle$(handle: HTMLElement): Observable<HandleMoveEvent> {\n  return new Observable<HandleMoveEvent>(observer => {\n    const destroyRef = new ɵDestroyRef();\n    const document = handle.ownerDocument;\n\n    // Subscribe for mousedown events.\n    fromEvent<MouseEvent>(handle, 'mousedown')\n      .pipe(takeUntilDestroyed(destroyRef))\n      .subscribe((event: MouseEvent) => onMouseDown(event));\n\n    // Subscribe for touch start events.\n    fromEvent<TouchEvent>(handle, 'touchstart')\n      .pipe(takeUntilDestroyed(destroyRef))\n      .subscribe((event: TouchEvent) => onTouchStart(event));\n\n    return () => destroyRef.destroy();\n\n    function onMouseDown(mouseDownEvent: MouseEvent): void {\n      if (mouseDownEvent.button !== 0) { // 0 = main button pressed, usually the left button\n        return;\n      }\n      observer.next({type: 'mousestart', mouseEvent: mouseDownEvent});\n\n      // Subscribe for 'mousemove' events\n      const mouseMoveSubscription = fromEvent<MouseEvent>(document, 'mousemove')\n        .pipe(takeUntilDestroyed(destroyRef))\n        .subscribe((mouseMoveEvent: MouseEvent) => {\n          observer.next({type: 'mousemove', mouseEvent: mouseMoveEvent});\n        });\n\n      // Subscribe for 'mouseup' events\n      fromEvent<MouseEvent>(document, 'mouseup', {once: true})\n        .pipe(takeUntilDestroyed(destroyRef))\n        .subscribe((mouseUpEvent: MouseEvent) => {\n          mouseMoveSubscription.unsubscribe();\n          observer.next({type: 'mouseend', mouseEvent: mouseUpEvent});\n        });\n    }\n\n    function onTouchStart(touchStartEvent: TouchEvent): void {\n      observer.next({type: 'touchstart', touchEvent: touchStartEvent});\n\n      // Subscribe for 'touchmove' events\n      const touchMoveSubscription = fromEvent<TouchEvent>(document, 'touchmove')\n        .pipe(takeUntilDestroyed(destroyRef))\n        .subscribe((touchMoveEvent: TouchEvent) => {\n          observer.next({type: 'touchmove', touchEvent: touchMoveEvent});\n        });\n\n      // Subscribe for 'touchend' and 'touchcancel' events\n      race(fromEvent<TouchEvent>(document, 'touchend', {once: true}), fromEvent<TouchEvent>(document, 'touchcancel', {once: true}))\n        .pipe(takeUntilDestroyed(destroyRef))\n        .subscribe((touchEndEvent: TouchEvent) => {\n          touchMoveSubscription.unsubscribe();\n          observer.next({type: 'touchend', touchEvent: touchEndEvent});\n        });\n    }\n  });\n}\n\n/**\n * Event emitted when moving the handle by mouse.\n */\nexport interface MouseMoveEvent {\n  type: 'mousestart' | 'mousemove' | 'mouseend';\n  mouseEvent: MouseEvent;\n}\n\n/**\n * Event emitted when moving the handle by touch gesture.\n */\nexport interface TouchMoveEvent {\n  type: 'touchstart' | 'touchmove' | 'touchend';\n  touchEvent: TouchEvent;\n}\n\n/**\n * Event emitted when moving the handle.\n */\nexport type HandleMoveEvent = MouseMoveEvent | TouchMoveEvent;\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Directive, effect, ElementRef, inject, input, output, untracked} from '@angular/core';\nimport {WorkbenchLayoutService} from '../layout/workbench-layout.service';\nimport {getCssTranslation} from '../common/dom.util';\nimport {fromMoveHandle$, HandleMoveEvent} from '../common/observables';\nimport {Disposable} from '../common/disposable';\n\n/**\n * Enables moving the host element via mouse or touch gesture.\n *\n * This directive makes the specified handle 'movable', emitting an event\n * when moving it. The host must apply the changed position by updating\n * respective DOM properties.\n */\n@Directive({selector: '[wbMovable]'})\nexport class MovableDirective {\n\n  public readonly wbHandleElement = input.required<HTMLElement>({alias: 'wbHandle'});\n  public readonly wbMove = output<WbMoveEvent>({alias: 'wbMovableMove'});\n\n  private readonly _workbenchLayoutService = inject(WorkbenchLayoutService);\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n\n  private _x = 0;\n  private _y = 0;\n\n  constructor() {\n    this.installMoveHandle();\n  }\n\n  /**\n   * Installs a handle for moving the element.\n   */\n  private installMoveHandle(): void {\n    effect(onCleanup => {\n      const element = this.wbHandleElement();\n      const handle = untracked(() => this.createMoveHandle(element));\n      onCleanup(() => handle.dispose());\n    });\n  }\n\n  /**\n   * Method invoked when start moving the handle.\n   */\n  private onMoveStart(event: MouseEvent | Touch): void {\n    this._workbenchLayoutService.signalMoving(true);\n    this._x = event.clientX;\n    this._y = event.clientY;\n  }\n\n  /**\n   * Method invoked while moving the handle.\n   */\n  private onMove(event: MouseEvent | Touch): void {\n    const translation = getComputedTranslation(this._host);\n    const deltaX = event.clientX - this._x;\n    const deltaY = event.clientY - this._y;\n\n    this._x = event.clientX;\n    this._y = event.clientY;\n\n    this.wbMove.emit({\n      translateX: translation.translateX + deltaX,\n      translateY: translation.translateY + deltaY,\n    });\n  }\n\n  /**\n   * Method invoked when end moving the handle.\n   */\n  private onMoveEnd(): void {\n    this._workbenchLayoutService.signalMoving(false);\n  }\n\n  private createMoveHandle(element: HTMLElement): Disposable {\n    // Subscribe to move events.\n    const subscription = fromMoveHandle$(element)\n      .subscribe((event: HandleMoveEvent) => {\n        switch (event.type) {\n          case 'mousestart': {\n            event.mouseEvent.preventDefault(); // prevent dragging user selection (e.g., by previous Ctrl+A)\n            this.onMoveStart(event.mouseEvent);\n            break;\n          }\n          case 'touchstart': {\n            this.onMoveStart(event.touchEvent.touches[0]!);\n            break;\n          }\n          case 'mousemove': {\n            this.onMove(event.mouseEvent);\n            break;\n          }\n          case 'touchmove': {\n            this.onMove(event.touchEvent.touches[0]!);\n            break;\n          }\n          case 'mouseend': {\n            this.onMoveEnd();\n            break;\n          }\n          case 'touchend': {\n            this.onMoveEnd();\n            break;\n          }\n        }\n      });\n\n    return {\n      dispose: () => subscription.unsubscribe(),\n    };\n  }\n}\n\n/**\n * Event emitted when moving the handle.\n */\nexport interface WbMoveEvent {\n  /**\n   * Specifies the new horizontal translation of the host.\n   */\n  translateX: number;\n  /**\n   * Specifies the new vertical translation of the host.\n   */\n  translateY: number;\n}\n\n/**\n * Reads the current CSS translation of given element.\n */\nfunction getComputedTranslation(element: HTMLElement): {translateX: number; translateY: number} {\n  const {translateX, translateY} = getCssTranslation(element);\n  return {\n    translateX: translateX === 'none' ? 0 : parseInt(translateX, 10),\n    translateY: translateY === 'none' ? 0 : parseInt(translateY, 10),\n  };\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Directive, effect, ElementRef, inject, input, output, untracked} from '@angular/core';\nimport {createElement, positionElement, getCssTranslation} from '../common/dom.util';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ɵDestroyRef} from '../common/ɵdestroy-ref';\nimport {WorkbenchLayoutService} from '../layout/workbench-layout.service';\nimport {fromMoveHandle$, HandleMoveEvent} from '../common/observables';\n\nconst HANDLE_SIZE = 6;\n\n/**\n * Enables resizing the host element via mouse or touch gesture.\n *\n * This directive adds resize handles to the boundaries and corners of the host\n * element, emitting an event when moving the handles. The host must apply the\n * changed position and size by updating respective DOM properties.\n *\n * The following requirements apply for the host:\n * - must be positioned, either relative or absolute\n * - must be horizontally centered in its layout\n */\n@Directive({selector: '[wbResizable]'})\nexport class ResizableDirective {\n\n  public readonly enabled = input(true, {alias: 'wbResizableEnabled'});\n  public readonly wbResize = output<WbResizeEvent>({alias: 'wbResizableResize'});\n\n  private readonly _workbenchLayoutService = inject(WorkbenchLayoutService);\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n\n  private minHeight: number | undefined;\n  private maxHeight: number | undefined;\n\n  private minWidth: number | undefined;\n  private maxWidth: number | undefined;\n\n  constructor() {\n    positionElement(this._host, {context: 'resizable'});\n    this.installResizeHandles();\n  }\n\n  /**\n   * Installs handles for resizing the host at its edges and corners.\n   */\n  private installResizeHandles(): void {\n    effect(onCleanup => {\n      if (this.enabled()) {\n        const handles = untracked(() => this.createResizeHandles());\n        onCleanup(() => handles.forEach(handle => handle.dispose()));\n      }\n    });\n  }\n\n  private createResizeHandles(): ResizeHandle[] {\n    // Calculate offset to be flush with the component boundaries, not the content boundaries.\n    const borderWidth = parseInt(getComputedStyle(this._host).borderWidth, 10);\n    const justified = `-${borderWidth + HANDLE_SIZE / 2}px`;\n\n    return [\n      // top handle\n      new ResizeHandle(this._host, {\n        cursor: 'ns-resize',\n        left: justified, top: justified, right: justified, height: `${HANDLE_SIZE}px`,\n        onResizeStart: () => this.onResizeStart(),\n        onResize: event => this.onResizeTop(event),\n        onResizeEnd: () => this.onResizeEnd(),\n      }),\n      // right handle\n      new ResizeHandle(this._host, {\n        cursor: 'ew-resize',\n        top: justified, right: justified, bottom: justified, width: `${HANDLE_SIZE}px`,\n        onResizeStart: () => this.onResizeStart(),\n        onResize: event => this.onResizeRight(event),\n        onResizeEnd: () => this.onResizeEnd(),\n      }),\n      // bottom handle\n      new ResizeHandle(this._host, {\n        cursor: 'ns-resize',\n        left: justified, bottom: justified, right: justified, height: `${HANDLE_SIZE}px`,\n        onResizeStart: () => this.onResizeStart(),\n        onResize: event => this.onResizeBottom(event),\n        onResizeEnd: () => this.onResizeEnd(),\n      }),\n      // left handle\n      new ResizeHandle(this._host, {\n        cursor: 'ew-resize',\n        top: justified, left: justified, bottom: justified, width: `${HANDLE_SIZE}px`,\n        onResizeStart: () => this.onResizeStart(),\n        onResize: event => this.onResizeLeft(event),\n        onResizeEnd: () => this.onResizeEnd(),\n      }),\n      // top-left handle\n      new ResizeHandle(this._host, {\n        cursor: 'nwse-resize',\n        top: justified, left: justified, width: `${HANDLE_SIZE}px`, height: `${HANDLE_SIZE}px`,\n        onResizeStart: () => this.onResizeStart(),\n        onResize: event => {\n          this.onResizeTop(event);\n          this.onResizeLeft(event);\n        },\n        onResizeEnd: () => this.onResizeEnd(),\n      }),\n      // top-right handle\n      new ResizeHandle(this._host, {\n        cursor: 'nesw-resize',\n        top: justified, right: justified, width: `${HANDLE_SIZE}px`, height: `${HANDLE_SIZE}px`,\n        onResizeStart: () => this.onResizeStart(),\n        onResize: event => {\n          this.onResizeTop(event);\n          this.onResizeRight(event);\n        },\n        onResizeEnd: () => this.onResizeEnd(),\n      }),\n      // bottom-right handle\n      new ResizeHandle(this._host, {\n        cursor: 'nwse-resize',\n        bottom: justified, right: justified, width: `${HANDLE_SIZE}px`, height: `${HANDLE_SIZE}px`,\n        onResizeStart: () => this.onResizeStart(),\n        onResize: event => {\n          this.onResizeBottom(event);\n          this.onResizeRight(event);\n        },\n        onResizeEnd: () => this.onResizeEnd(),\n      }),\n      // bottom-left handle\n      new ResizeHandle(this._host, {\n        cursor: 'nesw-resize',\n        bottom: justified, left: justified, width: `${HANDLE_SIZE}px`, height: `${HANDLE_SIZE}px`,\n        onResizeStart: () => this.onResizeStart(),\n        onResize: event => {\n          this.onResizeBottom(event);\n          this.onResizeLeft(event);\n        },\n        onResizeEnd: () => this.onResizeEnd(),\n      }),\n    ];\n  }\n\n  /**\n   * Method invoked when start resizing the host.\n   */\n  private onResizeStart(): void {\n    const {minHeight, maxHeight, minWidth, maxWidth} = getComputedStyle(this._host);\n    const parent = this._host.parentElement!;\n\n    this.minHeight = toPixel(minHeight, {parentSize: parent.clientHeight});\n    this.maxHeight = toPixel(maxHeight, {parentSize: parent.clientHeight});\n    this.minWidth = toPixel(minWidth, {parentSize: parent.clientWidth});\n    this.maxWidth = toPixel(maxWidth, {parentSize: parent.clientWidth});\n    if (this.maxWidth !== undefined && this.minWidth !== undefined && this.minWidth > this.maxWidth) {\n      this.maxWidth = this.minWidth; // prefer min-width over max-width (as in CSS)\n    }\n    if (this.maxHeight !== undefined && this.minHeight !== undefined && this.minHeight > this.maxHeight) {\n      this.maxHeight = this.minHeight; // prefer min-height over max-height (as in CSS)\n    }\n    this._workbenchLayoutService.signalResizing(true);\n  }\n\n  /**\n   * Method invoked when end resizing the host.\n   */\n  private onResizeEnd(): void {\n    this.minHeight = undefined;\n    this.maxHeight = undefined;\n    this.minWidth = undefined;\n    this.maxWidth = undefined;\n    this._workbenchLayoutService.signalResizing(false);\n  }\n\n  /**\n   * Method invoked when moving the top handle.\n   */\n  private onResizeTop(event: MouseEvent | Touch): void {\n    const hostBounds = this._host.getBoundingClientRect();\n\n    // Calculate delta, respecting minimal and maximal size constraints.\n    const delta = (() => {\n      // Round the delta to the nearest integer to get stable positioning since CSS translations do not have decimal precision.\n      const delta = Math.round(event.clientY - hostBounds.top);\n      // Do not enlarge if the cursor is located below the handle and moving it upwards.\n      if (delta < 0 && event.clientY > hostBounds.top) {\n        return 0;\n      }\n      // Ensure minimal height.\n      if (this.minHeight && delta > 0 && event.clientY > hostBounds.bottom - this.minHeight) {\n        return hostBounds.height - this.minHeight;\n      }\n      // Ensure maximal height.\n      if (this.maxHeight && delta < 0 && event.clientY < hostBounds.bottom - this.maxHeight) {\n        return hostBounds.height - this.maxHeight;\n      }\n      return delta;\n    })();\n\n    if (delta === 0) {\n      return;\n    }\n\n    this.wbResize.emit({\n      height: hostBounds.height - delta,\n      translateY: getComputedTranslateY(this._host) + delta,\n    });\n  }\n\n  /**\n   * Method invoked when moving the bottom handle.\n   */\n  private onResizeBottom(event: MouseEvent | Touch): void {\n    const hostBounds = this._host.getBoundingClientRect();\n\n    // Calculate delta, respecting minimal and maximal size constraints.\n    const delta = (() => {\n      // Round the delta to the nearest integer to get stable positioning since CSS translations do not have decimal precision.\n      const delta = Math.round(event.clientY - hostBounds.bottom);\n      // Do not enlarge if the cursor is located above the handle and moving it downwards.\n      if (delta > 0 && event.clientY < hostBounds.bottom) {\n        return 0;\n      }\n      // Ensure minimal height.\n      if (this.minHeight && delta < 0 && event.clientY < hostBounds.top + this.minHeight) {\n        return this.minHeight - hostBounds.height;\n      }\n      // Ensure maximal height.\n      if (this.maxHeight && delta > 0 && event.clientY > hostBounds.top + this.maxHeight) {\n        return this.maxHeight - hostBounds.height;\n      }\n      return delta;\n    })();\n\n    if (delta === 0) {\n      return;\n    }\n\n    this.wbResize.emit({\n      height: hostBounds.height + delta,\n    });\n  }\n\n  /**\n   * Method invoked when moving the left handle.\n   */\n  private onResizeLeft(event: MouseEvent | Touch): void {\n    const hostBounds = this._host.getBoundingClientRect();\n\n    // Calculate delta, respecting minimal and maximal size constraints.\n    const delta = (() => {\n      // Divide the delta by two because the host only needs to be moved by half the delta as centered horizontally.\n      // Also round the delta to the nearest integer to get stable positioning since CSS translations do not have decimal precision.\n      const delta = Math.round((event.clientX - hostBounds.left) / 2) * 2;\n      // Do not enlarge if the cursor is located right to the handle and moving it to the left.\n      if (delta < 0 && event.clientX > hostBounds.left) {\n        return 0;\n      }\n      // Ensure minimal width.\n      if (this.minWidth && delta > 0 && event.clientX > hostBounds.right - this.minWidth) {\n        return Math.round((hostBounds.width - this.minWidth) / 2) * 2; // Ensure delta to be dividable by two without remainder to have a stable position as CSS translations do not have decimal precision.\n      }\n      // Ensure maximal width.\n      if (this.maxWidth && delta < 0 && event.clientX < hostBounds.right - this.maxWidth) {\n        return Math.round((hostBounds.width - this.maxWidth) / 2) * 2; // Ensure delta to be dividable by two without remainder to have a stable position as CSS translations do not have decimal precision.\n      }\n      return delta;\n    })();\n\n    if (delta === 0) {\n      return;\n    }\n\n    this.wbResize.emit({\n      width: hostBounds.width - delta,\n      translateX: getComputedTranslateX(this._host) + delta / 2, // Move only by half the delta as centered horizontally.\n    });\n  }\n\n  /**\n   * Method invoked when moving the right handle.\n   */\n  private onResizeRight(event: MouseEvent | Touch): void {\n    const hostBounds = this._host.getBoundingClientRect();\n\n    // Calculate delta, respecting minimal and maximal size constraints.\n    const delta = (() => {\n      // Divide the delta by two because the host only needs to be moved by half the delta as centered horizontally.\n      // Also round the delta to the nearest integer to get stable positioning since CSS translations do not have decimal precision.\n      const delta = Math.round((event.clientX - hostBounds.right) / 2) * 2;\n      // Do not enlarge if the cursor is located left to the handle and moving it to the right.\n      if (delta > 0 && event.clientX < hostBounds.right) {\n        return 0;\n      }\n      // Ensure minimal width.\n      if (this.minWidth && delta < 0 && event.clientX < hostBounds.left + this.minWidth) {\n        return Math.round((this.minWidth - hostBounds.width) / 2) * 2; // Ensure delta to be dividable by two without remainder to have a stable position as CSS translations do not have decimal precision.\n      }\n      // Ensure maximal width.\n      if (this.maxWidth && delta > 0 && event.clientX > hostBounds.left + this.maxWidth) {\n        return Math.round((this.maxWidth - hostBounds.width) / 2) * 2; // Ensure delta to be dividable by two without remainder to have a stable position as CSS translations do not have decimal precision.\n      }\n      return delta;\n    })();\n\n    if (delta === 0) {\n      return;\n    }\n\n    this.wbResize.emit({\n      width: hostBounds.width + delta,\n      translateX: getComputedTranslateX(this._host) + delta / 2, // Move only by half the delta as centered horizontally.\n    });\n  }\n}\n\n/**\n * Represents a handle to resize the host element.\n */\nclass ResizeHandle {\n\n  private readonly _document: Document;\n  private readonly _destroyRef = new ɵDestroyRef();\n  private readonly _handleElement: HTMLElement;\n\n  constructor(host: HTMLElement, private _config: ResizeHandleConfig) {\n    this._document = host.ownerDocument;\n    this._handleElement = createElement('div', {\n      parent: host,\n      cssClass: 'e2e-resize-handle',\n      style: {\n        cursor: this._config.cursor,\n        position: 'absolute',\n        top: this._config.top ?? null,\n        right: this._config.right ?? null,\n        bottom: this._config.bottom ?? null,\n        left: this._config.left ?? null,\n        width: this._config.width ?? null,\n        height: this._config.height ?? null,\n      },\n    });\n    this.makeHandleMovable();\n  }\n\n  private makeHandleMovable(): void {\n    let prevBodyCursor: string | undefined;\n\n    fromMoveHandle$(this._handleElement)\n      .pipe(takeUntilDestroyed(this._destroyRef))\n      .subscribe((event: HandleMoveEvent) => {\n        switch (event.type) {\n          case 'mousestart': {\n            event.mouseEvent.preventDefault(); // prevent dragging user selection (e.g., by previous Ctrl+A)\n\n            // Apply cursor on document level to prevent flickering while resizing\n            prevBodyCursor = this._document.body.style.cursor;\n            this._document.body.style.cursor = this._config.cursor;\n            this._config.onResizeStart();\n            break;\n          }\n          case 'touchstart': {\n            this._config.onResizeStart();\n            break;\n          }\n          case 'mousemove': {\n            this._config.onResize(event.mouseEvent);\n            break;\n          }\n          case 'touchmove': {\n            this._config.onResize(event.touchEvent.touches[0]!);\n            break;\n          }\n          case 'mouseend': {\n            this._document.body.style.cursor = prevBodyCursor!;\n            this._config.onResizeEnd();\n            break;\n          }\n          case 'touchend': {\n            this._config.onResizeEnd();\n            break;\n          }\n        }\n      });\n  }\n\n  public dispose(): void {\n    this._handleElement.remove();\n    this._destroyRef.destroy();\n  }\n}\n\n/**\n * Event emitted when resizing the host element.\n */\nexport interface WbResizeEvent {\n  /**\n   * Specifies the new width of the host.\n   */\n  width?: number;\n  /**\n   * Specifies the new height of the host.\n   */\n  height?: number;\n  /**\n   * Specifies the new horizontal translation of the host.\n   */\n  translateX?: number;\n  /**\n   * Specifies the new vertical translation of the host.\n   */\n  translateY?: number;\n}\n\n/**\n * Configuration of a resize handle.\n */\ninterface ResizeHandleConfig {\n  top?: string;\n  right?: string;\n  bottom?: string;\n  left?: string;\n  height?: string;\n  width?: string;\n  cursor: 'ew-resize' | 'ns-resize' | 'nwse-resize' | 'nesw-resize';\n  onResizeStart: () => void;\n  onResize: (event: MouseEvent | Touch) => void;\n  onResizeEnd: () => void;\n}\n\n/**\n * Converts the passed pixel or percentage value into a numerical pixel value, or returns `undefined` if passing `none`.\n */\nfunction toPixel(size: string | 'none', options: {parentSize: number}): number | undefined {\n  if (size === 'none') {\n    return undefined;\n  }\n  return size.endsWith('%') ? options.parentSize * parseInt(size, 10) / 100 : parseInt(size, 10);\n}\n\nfunction getComputedTranslateX(element: HTMLElement): number {\n  const {translateX} = getCssTranslation(element);\n  return translateX === 'none' ? 0 : parseInt(translateX, 10);\n}\n\nfunction getComputedTranslateY(element: HTMLElement): number {\n  const {translateY} = getCssTranslation(element);\n  return translateY === 'none' ? 0 : parseInt(translateY, 10);\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, inject} from '@angular/core';\nimport {ɵWorkbenchDialog} from '../ɵworkbench-dialog.model';\nimport {TextPipe} from '../../text/text.pipe';\nimport {IconComponent} from '../../icon/icon.component';\n\n/**\n * Renders the dialog header with a close button and optional title.\n */\n@Component({\n  selector: 'wb-dialog-header',\n  templateUrl: './dialog-header.component.html',\n  styleUrls: ['./dialog-header.component.scss'],\n  imports: [\n    TextPipe,\n    IconComponent,\n  ],\n})\nexport class DialogHeaderComponent {\n\n  protected readonly dialog = inject(ɵWorkbenchDialog);\n\n  protected onCloseClick(): void {\n    this.dialog.close();\n  }\n\n  protected onCloseMouseDown(event: Event): void {\n    event.stopPropagation(); // Prevent dragging the dialog with the close button.\n  }\n}\n","@if (dialog.title(); as title) {\n  <div class=\"title e2e-title\">\n    <span>{{(title | wbText)()}}</span>\n  </div>\n}\n\n@if (dialog.closable()) {\n  <button tabindex=\"-1\" class=\"close e2e-close\"\n          [title]=\"('%workbench.close.tooltip' | wbText)()\"\n          (mousedown)=\"onCloseMouseDown($event)\"\n          (click)=\"onCloseClick()\">\n    <wb-icon icon=\"workbench.close\"/>\n  </button>\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * Returns `null` if the given object is empty.\n */\n@Pipe({name: 'wbNullIfEmpty'})\nexport class NullIfEmptyPipe implements PipeTransform {\n\n  public transform<T>(value: T): T | null {\n    if (value === null || value === undefined) {\n      return null;\n    }\n    else if (value instanceof Map || value instanceof Set) {\n      return value.size ? value : null;\n    }\n    else if (Array.isArray(value) || typeof value === 'string') {\n      return value.length ? value : null;\n    }\n    else if (typeof value === 'object') {\n      return Object.keys(value).length ? value : null;\n    }\n    return value;\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\nimport {WorkbenchDialogActionDirective} from './workbench-dialog-action.directive';\n\n/**\n * Filters actions by specified alignment.\n */\n@Pipe({name: 'wbDialogActionFilter'})\nexport class DialogActionFilterPipe implements PipeTransform {\n\n  public transform(actions: WorkbenchDialogActionDirective[] | null | undefined, align: 'start' | 'end'): WorkbenchDialogActionDirective[] {\n    return actions?.filter(action => action.align() === align) ?? [];\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {Component, inject} from '@angular/core';\nimport {ɵWorkbenchDialog} from '../ɵworkbench-dialog.model';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {NullIfEmptyPipe} from '../../common/null-if-empty.pipe';\nimport {DialogActionFilterPipe} from './dialog-action-filter.pipe';\n\n/**\n * Renders the dialog footer with actions modeled as {@link WorkbenchDialogActionDirective} templates.\n */\n@Component({\n  selector: 'wb-dialog-footer',\n  templateUrl: './dialog-footer.component.html',\n  styleUrls: ['./dialog-footer.component.scss'],\n  imports: [\n    NgTemplateOutlet,\n    NullIfEmptyPipe,\n    DialogActionFilterPipe,\n  ],\n})\nexport class DialogFooterComponent {\n\n  protected readonly dialog = inject(ɵWorkbenchDialog);\n}\n","<!-- Start Actions -->\n@if (dialog.actions | wbDialogActionFilter:'start' | wbNullIfEmpty; as actions) {\n  <div class=\"actions start\">\n    @for (action of actions; track action) {\n      <ng-container *ngTemplateOutlet=\"action.template\"/>\n    }\n  </div>\n}\n\n<!-- End Actions -->\n@if (dialog.actions | wbDialogActionFilter:'end' | wbNullIfEmpty; as actions) {\n  <div class=\"actions end\">\n    @for (action of actions; track action) {\n      <ng-container *ngTemplateOutlet=\"action.template\"/>\n    }\n  </div>\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, effect, ElementRef, HostListener, inject, NgZone, Provider, signal, untracked, viewChild} from '@angular/core';\nimport {BehaviorSubject, fromEvent} from 'rxjs';\nimport {CdkTrapFocus} from '@angular/cdk/a11y';\nimport {AsyncPipe, NgComponentOutlet, NgTemplateOutlet} from '@angular/common';\nimport {ɵWorkbenchDialog} from './ɵworkbench-dialog.model';\nimport {SciViewportComponent} from '@scion/components/viewport';\nimport {animate, AnimationMetadata, style, transition, trigger} from '@angular/animations';\nimport {subscribeIn} from '@scion/toolkit/operators';\nimport {MovableDirective, WbMoveEvent} from './movable.directive';\nimport {ResizableDirective, WbResizeEvent} from './resizable.directive';\nimport {SciDimension, SciDimensionDirective} from '@scion/components/dimension';\nimport {DialogHeaderComponent} from './dialog-header/dialog-header.component';\nimport {DialogFooterComponent} from './dialog-footer/dialog-footer.component';\nimport {GLASS_PANE_BLOCKABLE, GLASS_PANE_OPTIONS, GlassPaneDirective, GlassPaneOptions} from '../glass-pane/glass-pane.directive';\nimport {filter, map, startWith, takeUntil} from 'rxjs/operators';\nimport {fromMutation$} from '@scion/toolkit/observable';\nimport {trackFocus} from '../focus/workbench-focus-tracker.service';\n\n/**\n * Renders the content of a workbench dialog.\n */\n@Component({\n  selector: 'wb-dialog',\n  templateUrl: './workbench-dialog.component.html',\n  styleUrls: ['./workbench-dialog.component.scss'],\n  imports: [\n    NgComponentOutlet,\n    NgTemplateOutlet,\n    CdkTrapFocus,\n    AsyncPipe,\n    MovableDirective,\n    ResizableDirective,\n    SciViewportComponent,\n    SciDimensionDirective,\n    DialogHeaderComponent,\n    DialogFooterComponent,\n    GlassPaneDirective,\n  ],\n  animations: [\n    trigger('enter', provideEnterAnimation()),\n  ],\n  viewProviders: [\n    configureDialogGlassPane(),\n  ],\n  host: {\n    '[attr.data-dialogid]': 'dialog.id',\n    '[class.justified]': '!dialog.padding()',\n    '[style.--ɵdialog-transform-translate-x]': 'transformTranslateX()',\n    '[style.--ɵdialog-transform-translate-y]': 'transformTranslateY()',\n    '[style.--ɵdialog-min-height]': 'dialog.size.minHeight() ?? headerHeight()',\n    '[style.--ɵdialog-height]': 'dialog.size.height()',\n    '[style.--ɵdialog-max-height]': 'dialog.size.maxHeight()',\n    '[style.--ɵdialog-min-width]': 'dialog.size.minWidth() ?? \\'100px\\'',\n    '[style.--ɵdialog-width]': 'dialog.size.width()',\n    '[style.--ɵdialog-max-width]': 'dialog.size.maxWidth()',\n    '[style.--ɵslot-anchor]': '`--${slotAnchorName}`',\n    '[class]': 'dialog.cssClass()',\n  },\n})\nexport class WorkbenchDialogComponent {\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _zone = inject(NgZone);\n  private readonly _cdkTrapFocus = viewChild.required(CdkTrapFocus);\n  private readonly _dialogElement = viewChild.required<ElementRef<HTMLElement>>('dialog_element');\n\n  /** Element of the dialog that has or last had focus */\n  private readonly _activeElement$ = new BehaviorSubject<HTMLElement | undefined>(undefined);\n\n  protected readonly dialog = inject(ɵWorkbenchDialog);\n\n  protected readonly headerHeight = signal<string | undefined>(undefined);\n  protected readonly transformTranslateX = signal(0);\n  protected readonly transformTranslateY = signal(0);\n  protected readonly slotAnchorName = this.dialog.id.replace('.', '_'); // Anchor must not contain a dot.\n\n  public readonly dialogSlotBounds = viewChild.required('slot_bounds', {read: ElementRef<HTMLElement>});\n\n  constructor() {\n    this.setDialogOffset();\n    this.trackFocus();\n    this.autoFocus();\n\n    trackFocus(this._host, this.dialog);\n  }\n\n  private setDialogOffset(): void {\n    const stackPosition = this.dialog.getPositionInDialogStack();\n    this.transformTranslateX.set(stackPosition * 10);\n    this.transformTranslateY.set(stackPosition * 10);\n  }\n\n  /**\n   * Focuses this dialog, restoring the focus to the last element that had the focus,\n   * or otherwise focuses the first focusable element.\n   */\n  public focus(): void {\n    if (this.dialog.blockedBy()) {\n      return;\n    }\n\n    const activeElement = this._activeElement$.getValue();\n    if (activeElement) {\n      activeElement.focus();\n    }\n    else if (!this._cdkTrapFocus().focusTrap.focusFirstTabbableElement()) {\n      // Focus dialog element so that it can be closed via Escape keystroke.\n      this._dialogElement().nativeElement.focus();\n    }\n  }\n\n  /**\n   * Tracks the focus of the dialog.\n   */\n  private trackFocus(): void {\n    effect(onCleanup => {\n      const dialogElement = this._dialogElement().nativeElement;\n\n      untracked(() => {\n        const subscription = fromEvent<FocusEvent>(dialogElement, 'focusin')\n          .pipe(\n            subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n            map(event => event.target instanceof HTMLElement ? event.target : undefined),\n            // The dialog is focused if it has no focusable element, so the dialog can be closed via Escape.\n            // However, in order not to cancel the autofocus, the dialog element must not be memoized as the\n            // active element. Otherwise, delayed content would not be focused.\n            filter(element => element !== dialogElement),\n          )\n          .subscribe(activeElement => {\n            this._activeElement$.next(activeElement);\n          });\n        onCleanup(() => subscription.unsubscribe());\n      });\n    });\n  }\n\n  /**\n   * Focuses the first focusable element in the dialog. Has no effect if an element in the dialog already has the focus.\n   *\n   * If no focusable element can be found, the focusing will be repeated on the next DOM change until an element has the\n   * focus, allowing delayed content to get focus.\n   */\n  private autoFocus(): void {\n    effect(onCleanup => {\n      const dialogElement = this._dialogElement().nativeElement;\n\n      untracked(() => {\n        const subscription = fromMutation$(dialogElement, {subtree: true, childList: true})\n          .pipe(\n            startWith(undefined as void),\n            takeUntil(this._activeElement$.pipe(filter(Boolean))),\n          )\n          .subscribe(() => {\n            this.focus();\n          });\n        onCleanup(() => subscription.unsubscribe());\n      });\n    });\n  }\n\n  @HostListener('keydown.escape', ['$event'])\n  protected onEscape(event: Event): void {\n    if (this.dialog.closable()) {\n      this.dialog.close();\n      event.stopPropagation();\n    }\n  }\n\n  protected onMove(event: WbMoveEvent): void {\n    this.transformTranslateX.set(event.translateX);\n    this.transformTranslateY.set(event.translateY);\n  }\n\n  protected onResize(event: WbResizeEvent): void {\n    if (event.height !== undefined) {\n      this.dialog.size.height = `${event.height}px`;\n    }\n    if (event.width !== undefined) {\n      this.dialog.size.width = `${event.width}px`;\n    }\n    if (event.translateX !== undefined) {\n      this.transformTranslateX.set(event.translateX);\n    }\n    if (event.translateY !== undefined) {\n      this.transformTranslateY.set(event.translateY);\n    }\n  }\n\n  protected onHeaderDimensionChange(dimension: SciDimension): void {\n    this.headerHeight.set(`${dimension.offsetHeight}px`);\n  }\n\n  protected onDialogMouseDown(): void {\n    // Focus the dialog on `mousedown`. The `wbMovable` directive on the header calls `preventDefault()` during `mousedown`,\n    // which prevents a `focusin` event from firing and so the workbench focus owner would not be updated. Calling `focus()`\n    // ensures the dialog becomes the active/focused element.\n    this.focus();\n  }\n}\n\n/**\n * Returns animation metadata to slide-in a new dialog.\n */\nfunction provideEnterAnimation(): AnimationMetadata[] {\n  return [\n    transition(':enter', [\n      style({opacity: 0, bottom: '100%', top: 'unset'}),\n      animate('.1s ease-out', style({opacity: 1, bottom: '*'})),\n    ]),\n  ];\n}\n\n/**\n * Blocks this dialog when other dialog(s) overlay it.\n */\nfunction configureDialogGlassPane(): Provider[] {\n  return [\n    {\n      provide: GLASS_PANE_BLOCKABLE,\n      useFactory: () => inject(ɵWorkbenchDialog),\n    },\n    {\n      provide: GLASS_PANE_OPTIONS,\n      useFactory: (): GlassPaneOptions => ({attributes: {'data-dialogid': inject(ɵWorkbenchDialog).id}}),\n    },\n  ];\n}\n","<div class=\"dialog e2e-dialog\"\n     [class.blinking]=\"dialog.blinking$ | async\"\n     [tabindex]=\"-1\"\n     wbMovable [wbHandle]=\"header\" (wbMovableMove)=\"onMove($event)\"\n     (mousedown)=\"onDialogMouseDown()\"\n     wbResizable [wbResizableEnabled]=\"dialog.resizable()\" (wbResizableResize)=\"onResize($event)\"\n     @enter\n     [@.disabled]=\"!dialog.animate\"\n     wbGlassPane\n     #dialog_element>\n  <div class=\"dialog-box e2e-dialog-box\" cdkTrapFocus>\n    <header #header\n            class=\"e2e-dialog-header\"\n            [class.divider]=\"dialog.header?.divider() ?? true\"\n            sciDimension (sciDimensionChange)=\"onHeaderDimensionChange($event)\">\n      <ng-container *ngTemplateOutlet=\"dialog.header?.template ?? default_dialog_header\"/>\n    </header>\n\n    <sci-viewport class=\"e2e-dialog-slot\">\n      <ng-container *ngComponentOutlet=\"dialog.component; inputs: dialog.inputs\"/>\n    </sci-viewport>\n\n    <!-- Extra DIV to capture bounds available to slotted content, excluding viewport content padding. May differ from the actual content size if content overflows or does not fill the slot. -->\n    <div class=\"slot-bounds e2e-dialog-slot-bounds\" #slot_bounds></div>\n\n    @if (dialog.footer || dialog.actions.length) {\n      <footer class=\"e2e-dialog-footer\" [class.divider]=\"dialog.footer?.divider() ?? true\">\n        <ng-container *ngTemplateOutlet=\"dialog.footer?.template ?? default_dialog_footer\"/>\n      </footer>\n    }\n  </div>\n</div>\n\n<ng-template #default_dialog_header>\n  <wb-dialog-header/>\n</ng-template>\n\n<ng-template #default_dialog_footer>\n  <wb-dialog-footer/>\n</ng-template>\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {WorkbenchDialogOptions} from './workbench-dialog.options';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {ɵWorkbenchDialogService} from './ɵworkbench-dialog.service';\n\n/**\n * Enables the display of a component in a dialog.\n *\n * A dialog is a visual element for focused interaction with the user, such as prompting the user for input or confirming actions.\n * The user can move and resize a dialog.\n *\n * Displayed on top of other content, a modal dialog blocks interaction with other parts of the application.\n *\n * ## Modality\n * A dialog can be context-modal or application-modal. Context-modal blocks a specific part of the application, as specified by the context;\n * application-modal blocks the workbench or browser viewport, based on {@link WorkbenchConfig.dialog.modalityScope}.\n *\n * ## Context\n * A dialog can be bound to a context (e.g., part or view), defaulting to the calling context.\n * The dialog is displayed only if the context is visible and closes when the context is disposed.\n *\n * ## Positioning\n * A dialog is opened in the center of its context, if any, unless opened from the peripheral area.\n *\n * ## Stacking\n * Dialogs are stacked per modality, with only the topmost dialog in each stack being interactive.\n *\n * ## Dialog Component\n * The dialog component can inject the {@link WorkbenchDialog} handle to interact with the dialog, such as setting the title or closing the dialog.\n * Inputs passed to the dialog are available as input properties in the dialog component.\n *\n * ## Dialog Header\n * By default, the dialog displays the title and a close button in the header. Alternatively, the dialog supports the use of a custom header.\n * To provide a custom header, add an Angular template to the HTML of the dialog component and decorate it with the `wbDialogHeader` directive.\n *\n * ```html\n * <ng-template wbDialogHeader>\n *   <app-dialog-header/>\n * </ng-template>\n * ```\n *\n * ## Dialog Footer\n * A dialog has a default footer that displays actions defined in the HTML of the dialog component. An action is an Angular template decorated with\n * the `wbDialogAction` directive. Multiple actions are supported, rendered in modeling order, and can be left- or right-aligned.\n *\n * ```html\n * <!-- Checkbox -->\n * <ng-template wbDialogAction align=\"start\">\n *   <label>\n *     <input type=\"checkbox\"/>\n *     Do not ask me again\n *   </label>\n * </ng-template>\n *\n * <!-- OK Button -->\n * <ng-template wbDialogAction align=\"end\">\n *   <button (click)=\"...\">OK</button>\n * </ng-template>\n *\n * <!-- Cancel Button -->\n * <ng-template wbDialogAction align=\"end\">\n *   <button (click)=\"...\">Cancel</button>\n * </ng-template>\n * ```\n *\n * Alternatively, the dialog supports the use of a custom footer. To provide a custom footer, add an Angular template to the HTML of the dialog component and\n * decorate it with the `wbDialogFooter` directive.\n *\n * ```html\n * <ng-template wbDialogFooter>\n *   <app-dialog-footer/>\n * </ng-template>\n * ```\n *\n * ## Styling\n * The following CSS variables can be set to customize the default look of a dialog.\n *\n * - `--sci-workbench-dialog-padding`\n * - `--sci-workbench-dialog-header-height`\n * - `--sci-workbench-dialog-header-background-color`\n * - `--sci-workbench-dialog-title-font-family`\n * - `--sci-workbench-dialog-title-font-weight`\n * - `--sci-workbench-dialog-title-font-size`\n * - `--sci-workbench-dialog-title-align`\n */\n@Injectable({providedIn: 'root', useExisting: ɵWorkbenchDialogService})\nexport abstract class WorkbenchDialogService {\n\n  /**\n   * Opens a dialog with the specified component and options.\n   *\n   * By default, the dialog is modal to the calling context. Specify a different modality in {@link WorkbenchDialogOptions.modality}.\n   *\n   * Data can be passed to the component as inputs via {@link WorkbenchDialogOptions.inputs} option. Inputs are available as input\n   * properties in the component. Alternatively, data can be passed for injection via a custom injector ({@link WorkbenchDialogOptions.injector})\n   * or providers ({@link WorkbenchDialogOptions.providers}).\n   *\n   * @param component - Specifies the component to display in the dialog.\n   * @param options - Controls the appearance and behavior of the dialog.\n   * @returns Promise that resolves to the dialog result, if any, or that rejects if the dialog couldn't be opened or was closed with an error.\n   */\n  public abstract open<R>(component: ComponentType<unknown>, options?: WorkbenchDialogOptions): Promise<R | undefined>;\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {Component, ElementRef, inject, input, output, viewChildren} from '@angular/core';\nimport {KeyValuePipe} from '@angular/common';\nimport {observeOn} from 'rxjs/operators';\nimport {animationFrameScheduler, firstValueFrom} from 'rxjs';\nimport {fromResize$} from '@scion/toolkit/observable';\nimport {TextPipe} from '../../text/text.pipe';\n\n@Component({\n  selector: 'wb-message-box-footer',\n  templateUrl: './message-box-footer.component.html',\n  styleUrls: ['./message-box-footer.component.scss'],\n  imports: [\n    KeyValuePipe,\n    TextPipe,\n  ],\n  host: {\n    '[attr.data-severity]': 'severity()',\n  },\n})\nexport class MessageBoxFooterComponent {\n\n  public readonly actions = input.required<{[key: string]: string}>();\n  public readonly severity = input.required<'info' | 'warn' | 'error'>();\n  public readonly action = output<string>();\n  public readonly preferredSizeChange = output<number>();\n\n  private readonly _actionButtons = viewChildren<ElementRef<HTMLElement>>('action_button');\n\n  constructor() {\n    void this.emitPreferredSize();\n  }\n\n  protected insertionSortOrderFn = (): number => 0;\n\n  protected onAction(key: string): void {\n    this.action.emit(key);\n  }\n\n  protected onArrowKey(index: number, direction: 'left' | 'right'): void {\n    const actionButtonCount = this._actionButtons().length;\n    const newIndex = (direction === 'left' ? index - 1 : index + 1);\n    this._actionButtons()[(newIndex + actionButtonCount) % actionButtonCount]!.nativeElement.focus();\n  }\n\n  private async emitPreferredSize(): Promise<void> {\n    const host = inject(ElementRef).nativeElement as HTMLElement;\n    host.classList.add('calculating-min-width');\n    try {\n      // Wait for the CSS class to take effect, then wait an animation frame to avoid the error: \"ResizeObserver loop completed with undelivered notifications\".\n      await firstValueFrom(fromResize$(host).pipe(observeOn(animationFrameScheduler)));\n      this.preferredSizeChange.emit(host.offsetWidth);\n    }\n    finally {\n      host.classList.remove('calculating-min-width');\n    }\n  }\n}\n","@for (action of actions() | keyvalue:insertionSortOrderFn; track action.key) {\n  <button #action_button\n          (click)=\"onAction(action.key)\"\n          (keydown.arrowLeft)=\"onArrowKey($index, 'left')\"\n          (keydown.arrowRight)=\"onArrowKey($index, 'right')\"\n          [attr.data-action]=\"action.key\"\n          class=\"action e2e-action\">\n    {{(action.value | wbText)()}}\n  </button>\n\n  @if (!$last) {\n    <span class=\"divider\"></span>\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {booleanAttribute, DestroyRef, Directive, inject, input, TemplateRef} from '@angular/core';\nimport {ɵWorkbenchDialog} from '../ɵworkbench-dialog.model';\nimport {Disposable} from '../../common/disposable';\nimport {asapScheduler} from 'rxjs';\n\n/**\n * Use this directive to replace the default dialog footer that renders actions contributed via the {@link WorkbenchDialogActionDirective} directive.\n *\n * The host element of this modeling directive must be a <ng-template>. The footer shares the lifecycle of the host element.\n *\n * **Example:**\n * ```html\n * <ng-template wbDialogFooter>\n *   <app-dialog-footer/>\n * </ng-template>\n * ```\n */\n@Directive({selector: 'ng-template[wbDialogFooter]'})\nexport class WorkbenchDialogFooterDirective {\n\n  /**\n   * Specifies if to display a visual separator between the dialog content and this footer.\n   * Defaults to `true`.\n   */\n  public readonly divider = input(undefined, {transform: booleanAttribute});\n  public readonly template = inject(TemplateRef) as TemplateRef<void>;\n\n  private _footer: Disposable | undefined;\n\n  constructor() {\n    const dialog = inject(ɵWorkbenchDialog);\n\n    // Defer registering footer to avoid `ExpressionChangedAfterItHasBeenCheckedError`.\n    asapScheduler.schedule(() => this._footer = dialog.registerFooter(this));\n\n    // Defer disposing footer to avoid `ExpressionChangedAfterItHasBeenCheckedError`.\n    inject(DestroyRef).onDestroy(() => asapScheduler.schedule(() => this._footer?.dispose()));\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {booleanAttribute, DestroyRef, Directive, inject, input, TemplateRef} from '@angular/core';\nimport {ɵWorkbenchDialog} from '../ɵworkbench-dialog.model';\nimport {Disposable} from '../../common/disposable';\nimport {asapScheduler} from 'rxjs';\n\n/**\n * Use this directive to replace the default dialog header that displays the title and a close button.\n *\n * The host element of this modeling directive must be a <ng-template>. The header shares the lifecycle of the host element.\n *\n * **Example:**\n * ```html\n * <ng-template wbDialogHeader>\n *   <app-dialog-header/>\n * </ng-template>\n * ```\n */\n@Directive({selector: 'ng-template[wbDialogHeader]'})\nexport class WorkbenchDialogHeaderDirective {\n\n  /**\n   * Specifies if to display a visual separator between this header and the dialog content.\n   * Defaults to `true`.\n   */\n  public readonly divider = input(undefined, {transform: booleanAttribute});\n  public readonly template = inject(TemplateRef) as TemplateRef<void>;\n\n  private _header: Disposable | undefined;\n\n  constructor() {\n    const dialog = inject(ɵWorkbenchDialog);\n\n    // Defer registering header to avoid `ExpressionChangedAfterItHasBeenCheckedError`.\n    asapScheduler.schedule(() => this._header = dialog.registerHeader(this));\n\n    // Defer disposing header to avoid `ExpressionChangedAfterItHasBeenCheckedError`.\n    inject(DestroyRef).onDestroy(() => asapScheduler.schedule(() => this._header?.dispose()));\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {Component, input} from '@angular/core';\nimport {Translatable} from '../../text/workbench-text-provider.model';\nimport {TextPipe} from '../../text/text.pipe';\n\n@Component({\n  selector: 'wb-message-box-header',\n  templateUrl: './message-box-header.component.html',\n  styleUrls: ['./message-box-header.component.scss'],\n  imports: [\n    TextPipe,\n  ],\n  host: {\n    '[attr.data-severity]': 'severity()',\n  },\n})\nexport class MessageBoxHeaderComponent {\n\n  public readonly title = input<Translatable | undefined>();\n  public readonly severity = input.required<'info' | 'warn' | 'error'>();\n}\n","@if (title()) {\n  <span class=\"title e2e-title\">{{(title() | wbText)()}}</span>\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * Tests if the object is of the specified type.\n */\n@Pipe({name: 'wbTypeof'})\nexport class TypeofPipe implements PipeTransform {\n\n  public transform<T>(object: T, type: 'undefined' | 'object' | 'boolean' | 'number' | 'string' | 'symbol' | 'function' | 'bigint'): object is T {\n    return typeof object === type;\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {Component, effect, inject, input, signal} from '@angular/core';\nimport {MessageBoxFooterComponent} from './message-box-footer/message-box-footer.component';\nimport {WorkbenchMessageBoxOptions} from './workbench-message-box.options';\nimport {ɵWorkbenchDialog} from '../dialog/ɵworkbench-dialog.model';\nimport {NgComponentOutlet} from '@angular/common';\nimport {WorkbenchDialogFooterDirective} from '../dialog/dialog-footer/workbench-dialog-footer.directive';\nimport {WorkbenchDialogHeaderDirective} from '../dialog/dialog-header/workbench-dialog-header.directive';\nimport {MessageBoxHeaderComponent} from './message-box-header/message-box-header.component';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {TypeofPipe} from '../common/typeof.pipe';\nimport {SciDimension, SciDimensionDirective} from '@scion/components/dimension';\nimport {TextPipe} from '../text/text.pipe';\nimport {Translatable} from '../text/workbench-text-provider.model';\n\n/**\n * Renders the workbench message box.\n *\n * This component is designed to be opened in a workbench dialog.\n */\n@Component({\n  selector: 'wb-message-box',\n  templateUrl: './workbench-message-box.component.html',\n  styleUrls: ['./workbench-message-box.component.scss'],\n  imports: [\n    NgComponentOutlet,\n    SciDimensionDirective,\n    WorkbenchDialogHeaderDirective,\n    WorkbenchDialogFooterDirective,\n    MessageBoxHeaderComponent,\n    MessageBoxFooterComponent,\n    TypeofPipe,\n    TextPipe,\n  ],\n  host: {\n    // Ensure host element to be focusable in order to close the message box on Escape keystroke.\n    '[attr.tabindex]': '-1',\n    '[class.empty]': 'empty()',\n    '[class.content-selectable]': 'options()?.contentSelectable',\n    '[class.has-title]': '!!this.options()?.title',\n    '(keydown.escape)': 'onEscape()',\n  },\n})\nexport class WorkbenchMessageBoxComponent {\n\n  public readonly message = input.required({transform: nullIfEmptyMessage});\n  public readonly options = input<WorkbenchMessageBoxOptions>();\n\n  private readonly _dialog = inject(ɵWorkbenchDialog);\n\n  protected readonly empty = signal(false);\n\n  constructor() {\n    this._dialog.closable = false;\n    this._dialog.resizable = false;\n    this._dialog.padding = false;\n\n    // Limit the maximum messagebox width if text message to break the message.\n    effect(() => {\n      if (typeof this.message() === 'string' || this.message() === null) {\n        this._dialog.size.maxWidth = 'var(--sci-workbench-messagebox-max-width)';\n      }\n    });\n  }\n\n  protected onAction(action: string): void {\n    this._dialog.close(action);\n  }\n\n  protected onEscape(): void {\n    if ('cancel' in (this.options()?.actions ?? {})) {\n      this._dialog.close('cancel');\n    }\n  }\n\n  protected onFooterPreferredSizeChange(preferredSize: number): void {\n    this._dialog.size.minWidth = `${preferredSize}px`;\n  }\n\n  protected onContentDimensionChange(dimension: SciDimension): void {\n    this.empty.set(!dimension.offsetHeight);\n  }\n}\n\nfunction nullIfEmptyMessage(message: Translatable | null | ComponentType<unknown>): Translatable | ComponentType<unknown> | null {\n  return message !== '' ? message : null;\n}\n","@let options = this.options() ?? {};\n<ng-template wbDialogHeader [divider]=\"false\">\n  <wb-message-box-header [title]=\"options.title\" [severity]=\"options.severity ?? 'info'\"/>\n</ng-template>\n\n@let message = this.message();\n<div class=\"slot e2e-slot\" [class.text]=\"message | wbTypeof:'string'\" sciDimension (sciDimensionChange)=\"onContentDimensionChange($event)\">\n  @if (message | wbTypeof:'string') {\n    {{($any(message) | wbText)()}}\n  } @else {\n    <ng-container *ngComponentOutlet=\"message; inputs: options.inputs\"/>\n  }\n</div>\n\n<ng-template wbDialogFooter>\n  <wb-message-box-footer [actions]=\"options.actions ?? {ok: '%workbench.ok.action'}\"\n                         [severity]=\"options.severity ?? 'info'\"\n                         (action)=\"onAction($event)\"\n                         (keydown.escape)=\"onEscape()\"\n                         (preferredSizeChange)=\"onFooterPreferredSizeChange($event)\"/>\n</ng-template>\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {WorkbenchMessageBoxOptions} from './workbench-message-box.options';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {Injectable} from '@angular/core';\nimport {ɵWorkbenchMessageBoxService} from './ɵworkbench-message-box.service';\nimport {Translatable} from '../text/workbench-text-provider.model';\n\n/**\n * Provides a standardized dialog for presenting a message to the user, such as an info, warning or alert,\n * or for prompting the user for confirmation. The message can be plain text or a component, allowing for\n * structured content or input prompts.\n *\n * Displayed on top of other content, a modal message box blocks interaction with other parts of the application.\n *\n * ## Modality\n * A message box can be context-modal or application-modal. Context-modal blocks a specific part of the application, as specified by the context;\n * application-modal blocks the workbench or browser viewport, based on {@link WorkbenchConfig.dialog.modalityScope}.\n *\n * ## Context\n * A message box can be bound to a context (e.g., part or view), defaulting to the calling context.\n * The message box is displayed only if the context is visible and closes when the context is disposed.\n *\n * ## Positioning\n * A message box is opened in the center of its context, if any, unless opened from the peripheral area.\n *\n * ## Stacking\n * Message boxes are stacked per modality, with only the topmost message box in each stack being interactive.\n *\n * ## Styling\n * The following CSS variables can be set to customize the default look of a message box.\n *\n * - `--sci-workbench-messagebox-max-width`\n * - `--sci-workbench-messagebox-severity-indicator-size`\n * - `--sci-workbench-messagebox-padding`\n * - `--sci-workbench-messagebox-text-align`\n * - `--sci-workbench-messagebox-title-align`\n * - `--sci-workbench-messagebox-title-font-family`\n * - `--sci-workbench-messagebox-title-font-weight`\n * - `--sci-workbench-messagebox-title-font-size`\n */\n@Injectable({providedIn: 'root', useExisting: ɵWorkbenchMessageBoxService})\nexport abstract class WorkbenchMessageBoxService {\n\n  /**\n   * Displays the specified message in a message box.\n   *\n   * By default, the message box is modal to the calling context. Specify a different modality in {@link WorkbenchMessageBoxOptions.modality}.\n   *\n   * @example\n   * ```ts\n   * const action = await inject(WorkbenchMessageBoxService).open('Do you want to save changes?', {\n   *   actions: {\n   *     yes: 'Yes',\n   *     no: 'No',\n   *     cancel: 'Cancel',\n   *   },\n   * });\n   * ```\n   *\n   * @param  message - Specifies the text to display, if any.\n   *                   Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   * @param options - Controls the appearance and behavior of the message box.\n   * @return Promise that resolves to the key of the action button that the user clicked to close the message box.\n   */\n  public abstract open(message: Translatable | null, options?: WorkbenchMessageBoxOptions): Promise<string>;\n\n  /**\n   * Displays the specified component in a message box.\n   *\n   * By default, the message box is modal to the calling context. Specify a different modality in {@link WorkbenchMessageBoxOptions.modality}.\n   *\n   * Data can be passed to the component as inputs via {@link WorkbenchMessageBoxOptions.inputs} option. Inputs are available as input\n   * properties in the component. Alternatively, data can be passed for injection via a custom injector ({@link WorkbenchMessageBoxOptions.injector})\n   * or providers ({@link WorkbenchMessageBoxOptions.providers}).\n   *\n   * @example\n   * ```ts\n   * const action = await inject(WorkbenchMessageBoxService).open(SomeComponent, {\n   *   inputs: {\n   *     a: '...',\n   *     b: '...',\n   *   },\n   *   actions: {\n   *     yes: 'Yes',\n   *     no: 'No',\n   *     cancel: 'Cancel',\n   *   },\n   * });\n   * ```\n   *\n   * ```ts\n   * @Component({...})\n   * export class SomeComponent {\n   *\n   *   @Input({required: true})\n   *   public a!: string;\n   *\n   *   @Input()\n   *   public b?: string;\n   * }\n   * ```\n   *\n   * @param component - Specifies the component to render as the message.\n   * @param options - Controls the appearance and behavior of the message box.\n   * @return Promise that resolves to the key of the action button that the user clicked to close the message box.\n   */\n  public abstract open(component: ComponentType<unknown>, options?: WorkbenchMessageBoxOptions): Promise<string>;\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {assertNotInReactiveContext, DestroyRef, inject, Injectable, NgZone, Provider} from '@angular/core';\nimport {WorkbenchMessageBoxOptions} from './workbench-message-box.options';\nimport {WorkbenchDialogService} from '../dialog/workbench-dialog.service';\nimport {WorkbenchMessageBoxComponent} from './workbench-message-box.component';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {WorkbenchMessageBoxService} from './workbench-message-box.service';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {Logger, LoggerNames} from '../logging';\nimport {WORKBENCH_ELEMENT} from '../workbench-element-references';\n\n/** @inheritDoc */\n@Injectable({providedIn: 'root'})\nexport class ɵWorkbenchMessageBoxService implements WorkbenchMessageBoxService {\n\n  private readonly _workbenchDialogService = inject(WorkbenchDialogService);\n  private readonly _zone = inject(NgZone);\n\n  constructor() {\n    this.installServiceLifecycleLogger();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public async open(message: Translatable | null | ComponentType<unknown>, options?: WorkbenchMessageBoxOptions): Promise<string> {\n    assertNotInReactiveContext(this.open, 'Call WorkbenchMessageBoxService.open() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    // Ensure to run in Angular zone to display the message box even if called from outside the Angular zone, e.g. from an error handler.\n    if (!NgZone.isInAngularZone()) {\n      return this._zone.run(() => this.open(message, options));\n    }\n\n    return (await this._workbenchDialogService.open<string>(WorkbenchMessageBoxComponent, {\n      inputs: {message, options},\n      modality: options?.modality,\n      injector: options?.injector,\n      providers: options?.providers,\n      cssClass: options?.cssClass,\n      context: options?.context,\n      animate: true,\n    }))!;\n  }\n\n  private installServiceLifecycleLogger(): void {\n    const logger = inject(Logger);\n    const workbenchElement = inject(WORKBENCH_ELEMENT, {optional: true});\n    logger.debug(() => `Constructing WorkbenchMessageBoxService [context=${workbenchElement?.id}]`, LoggerNames.LIFECYCLE);\n    inject(DestroyRef).onDestroy(() => logger.debug(() => `Destroying WorkbenchMessageBoxService [context=${workbenchElement?.id}]'`, LoggerNames.LIFECYCLE));\n  }\n}\n\n/**\n * Provides {@link WorkbenchDialogService} for dependency injection.\n */\nexport function provideWorkbenchMessageBoxService(): Provider[] {\n  return [\n    ɵWorkbenchMessageBoxService,\n    {provide: WorkbenchMessageBoxService, useExisting: ɵWorkbenchMessageBoxService},\n  ];\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, effect, ElementRef, inject, Provider, viewChild} from '@angular/core';\nimport {CdkTrapFocus} from '@angular/cdk/a11y';\nimport {SciViewportComponent} from '@scion/components/viewport';\nimport {GLASS_PANE_BLOCKABLE, GLASS_PANE_OPTIONS, GlassPaneDirective, GlassPaneOptions} from '../glass-pane/glass-pane.directive';\nimport {trackFocus} from '../focus/workbench-focus-tracker.service';\nimport {ɵWorkbenchPopup} from './ɵworkbench-popup.model';\nimport {NgComponentOutlet} from '@angular/common';\n\n/**\n * Renders the content of a workbench popup.\n */\n@Component({\n  selector: 'wb-popup',\n  templateUrl: './workbench-popup.component.html',\n  styleUrl: './workbench-popup.component.scss',\n  imports: [\n    CdkTrapFocus,\n    SciViewportComponent,\n    NgComponentOutlet,\n  ],\n  hostDirectives: [\n    GlassPaneDirective,\n  ],\n  providers: [\n    configurePopupGlassPane(),\n  ],\n  host: {\n    '[attr.data-popupid]': 'popup.id',\n    '[style.width]': 'popup.size.width()',\n    '[style.min-width]': 'popup.size.minWidth()',\n    '[style.max-width]': 'popup.size.maxWidth()',\n    '[style.height]': 'popup.size.height()',\n    '[style.min-height]': 'popup.size.minHeight()',\n    '[style.max-height]': 'popup.size.maxHeight()',\n    '[class]': 'popup.cssClass()',\n  },\n})\nexport class WorkbenchPopupComponent {\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _cdkTrapFocus = viewChild.required('focus_trap', {read: CdkTrapFocus});\n\n  protected readonly popup = inject(ɵWorkbenchPopup);\n\n  constructor() {\n    trackFocus(this._host, this.popup);\n    this.focusInitialElement();\n  }\n\n  private focusInitialElement(): void {\n    const effectRef = effect(() => {\n      // [Angular 14] The initial focus must not be requested via `cdkTrapFocusAutoCapture` as this would restore\n      // focus to the previously focused element when the `FocusTrap` is destroyed. This behavior is unwanted if the\n      // popup is closed by losing focus. Otherwise, the newly focused element that caused the loss of focus and thus\n      // the closing of the popup would immediately become unfocused again. This behavior could only be observed when\n      // the popup loses focus by clicking on an element in a microfrontend.\n      void this._cdkTrapFocus().focusTrap.focusInitialElementWhenReady();\n      effectRef.destroy();\n    });\n  }\n}\n\n/**\n * Blocks this popup when dialog(s) overlay it.\n */\nfunction configurePopupGlassPane(): Provider[] {\n  return [\n    {\n      provide: GLASS_PANE_BLOCKABLE,\n      useFactory: () => inject(ɵWorkbenchPopup),\n    },\n    {\n      provide: GLASS_PANE_OPTIONS,\n      useFactory: (): GlassPaneOptions => ({attributes: {'data-popupid': inject(ɵWorkbenchPopup).id}}),\n    },\n  ];\n}\n","<sci-viewport cdkTrapFocus class=\"e2e-popup-viewport\" #focus_trap>\n  <ng-container *ngComponentOutlet=\"popup.component; inputs: popup.inputs\"/>\n</sci-viewport>\n","import {WorkbenchPopup} from './workbench-popup.model';\n\n/**\n * A popup is a visual workbench element for displaying content above other content. The popup is positioned relative\n * to an anchor based on its preferred alignment. The anchor can be an element or a coordinate.\n *\n * The popup component can inject this handle to interact with the popup.\n *\n * Popup inputs are available as input properties in the popup component.\n *\n * @see WorkbenchPopupService\n *\n * @deprecated since version 21.0.0-beta.1. Replaced by `WorkbenchPopup`. Marked for removal in version 22.\n */\nexport abstract class Popup<T = unknown, R = unknown> extends WorkbenchPopup { // eslint-disable-line @typescript-eslint/no-unused-vars\n\n  /**\n   * Input data as passed by the popup opener when opened the popup, or `undefined` if not passed.\n   *\n   * @deprecated since version 21.0.0-beta.1. Use `WorkbenchPopupService` to open popups. Inputs are available as input properties in the popup component. Marked for removal in version 22.\n   */\n  public abstract readonly input: T | undefined;\n\n  /**\n   * CSS classes associated with the popup.\n   *\n   * @deprecated since version 21.0.0-beta.1. Use `WorkbenchPopup.cssClass` instead. Marked for removal in version 22.\n   */\n  public abstract readonly cssClasses: string[];\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {InjectionToken, Provider} from '@angular/core';\nimport {provideWorkbenchDialogService} from '../dialog/ɵworkbench-dialog.service';\nimport {provideWorkbenchMessageBoxService} from '../message-box/ɵworkbench-message-box.service';\nimport {provideWorkbenchPopupService} from './ɵworkbench-popup.service';\n\n/**\n * DI token to register providers available for DI if in the context of a workbench popup.\n */\nexport const WORKBENCH_POPUP_CONTEXT = new InjectionToken<Provider[]>('WORKBENCH_POPUP_CONTEXT');\n\n/**\n * Provides providers available for DI if in the context of a workbench popup.\n */\nexport function provideWorkbenchPopupContext(): Provider {\n  return {\n    provide: WORKBENCH_POPUP_CONTEXT,\n    useFactory: (): Provider[] => [\n      provideWorkbenchDialogService(),\n      provideWorkbenchMessageBoxService(),\n      provideWorkbenchPopupService(),\n    ],\n    multi: true,\n  };\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Blockable} from '../glass-pane/blockable';\nimport {assertNotInReactiveContext, ComponentRef, computed, DestroyableInjector, DestroyRef, DOCUMENT, effect, ElementRef, inject, InjectionToken, Injector, NgZone, Signal, signal, untracked, WritableSignal} from '@angular/core';\nimport {WorkbenchFocusMonitor} from '../focus/workbench-focus-tracker.service';\nimport {ComponentPortal, ComponentType} from '@angular/cdk/portal';\nimport {WorkbenchPopupComponent} from './workbench-popup.component';\nimport {boundingClientRect} from '@scion/components/dimension';\nimport {fromEvent} from 'rxjs';\nimport {ɵWorkbenchDialog} from '../dialog/ɵworkbench-dialog.model';\nimport {Arrays, Observables} from '@scion/toolkit/util';\nimport {ConnectedPosition, FlexibleConnectedPositionStrategy, Overlay, OverlayRef, PositionStrategy} from '@angular/cdk/overlay';\nimport {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y';\nimport {fromResize$} from '@scion/toolkit/observable';\nimport {observeIn, subscribeIn} from '@scion/toolkit/operators';\nimport {takeUntilDestroyed, toSignal} from '@angular/core/rxjs-interop';\nimport {WORKBENCH_COMPONENT_REF, WORKBENCH_ELEMENT} from '../workbench-element-references';\nimport {filter} from 'rxjs/operators';\nimport {WorkbenchDialogRegistry} from '../dialog/workbench-dialog.registry';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {PopupId} from '../workbench.identifiers';\nimport {BottomLeftPoint, BottomRightPoint, Point, PopupOrigin, TopLeftPoint, TopRightPoint} from './popup.origin';\nimport {constrainClientRect, setStyle} from '../common/dom.util';\nimport {WorkbenchPopup, WorkbenchPopupSize} from './workbench-popup.model';\nimport {WorkbenchInvocationContext} from '../invocation-context/invocation-context';\nimport {ViewDragService} from '../view-dnd/view-drag.service';\nimport {WorkbenchPopupOptions} from './workbench-popup.options';\nimport {Popup} from './popup';\nimport {WORKBENCH_POPUP_CONTEXT} from './workbench-popup-context.provider';\n\n/** @inheritDoc */\nexport class ɵWorkbenchPopup implements Popup, WorkbenchPopup, Blockable {\n\n  /** Injector for the popup; destroyed when the popup is closed. */\n  public readonly injector = inject(Injector) as DestroyableInjector;\n\n  private readonly _overlayRef: OverlayRef;\n  private readonly _focusMonitor = inject(WorkbenchFocusMonitor);\n  private readonly _portal: ComponentPortal<WorkbenchPopupComponent>;\n  private readonly _componentRef = signal<ComponentRef<WorkbenchPopupComponent> | undefined>(undefined);\n  private readonly _popupOrigin: Signal<DOMRect | undefined>;\n  private readonly _cssClass = signal<string[]>([]);\n\n  public readonly size: WorkbenchPopupSize;\n  public readonly focused = computed(() => this._focusMonitor.activeElement()?.id === this.id);\n  public readonly attached: Signal<boolean>;\n  public readonly destroyed = signal<boolean>(false);\n  public readonly bounds = boundingClientRect(computed(() => this._componentRef()?.location.nativeElement as HTMLElement | undefined));\n  public readonly blockedBy: Signal<ɵWorkbenchDialog | null>;\n  // TODO [Angular 22] Remove with Angular 22. Used for backward compatiblity.\n  public readonly input: unknown | undefined;\n  public result: unknown | Error | undefined;\n\n  constructor(public id: PopupId,\n              public component: ComponentType<unknown>,\n              public invocationContext: WorkbenchInvocationContext | null,\n              private _options: WorkbenchPopupOptions) {\n    this._portal = this.createPortal();\n    this.input = this._portal.injector?.get(LEGACY_POPUP_INPUT, undefined, {optional: true});\n    this._popupOrigin = this.trackPopupOrigin();\n    this._cssClass.set(Arrays.coerce(this._options.cssClass));\n    this.size = new ɵWorkbenchPopupSize(this._options);\n    this.blockedBy = inject(WorkbenchDialogRegistry).top(this.id);\n    this.attached = this.monitorHostElementAttached();\n\n    const positionStrategy = inject(Overlay).position()\n      .flexibleConnectedTo({x: 0, y: 0})\n      .withFlexibleDimensions(false)\n      .withLockedPosition(false) // If locked, the popup won't attempt to reposition itself if not enough space available.\n      .withPositions(((): ConnectedPosition[] => {\n        switch (this._options.align ?? 'north') {\n          case 'north':\n            return [NORTH, SOUTH, WEST, EAST];\n          case 'south':\n            return [SOUTH, NORTH, WEST, EAST];\n          case 'west':\n            return [WEST, EAST, NORTH, SOUTH];\n          case 'east':\n            return [EAST, WEST, NORTH, SOUTH];\n          default:\n            throw Error('[PopupPositionError] Illegal position; must be north, south, west or east');\n        }\n      })());\n\n    this._overlayRef = this.createOverlay(positionStrategy);\n    const componentRef = this._overlayRef.attach(this._portal);\n    const popupElement = componentRef.location.nativeElement as HTMLElement;\n    this._componentRef.set(componentRef);\n\n    // Make the popup focusable to request focus.\n    popupElement.setAttribute('tabindex', '-1');\n\n    this.stickToAnchor(positionStrategy);\n    this.repositionOnResize();\n    this.bindToHostElement(popupElement);\n    this.closeOnHostDestroy();\n    this.closeOnFocusLoss(popupElement);\n    this.closeOnEscape(popupElement);\n\n    inject(DestroyRef).onDestroy(() => this.destroyed.set(true));\n  }\n\n  /**\n   * Waits for the popup to close, resolving to its result or rejecting if closed with an error.\n   */\n  public waitForClose<R>(): Promise<R | undefined> {\n    return new Promise<R | undefined>((resolve, reject) => {\n      this.injector.get(DestroyRef).onDestroy(() => {\n        this.result instanceof Error ? reject(this.result) : resolve(this.result as R);\n      });\n    });\n  }\n\n  /**\n   * Creates a portal to render {@link WorkbenchPopupComponent} in the popup's injection context.\n   */\n  private createPortal(): ComponentPortal<WorkbenchPopupComponent> {\n    const injector = Injector.create({\n      parent: this._options.injector ?? inject(Injector),\n      providers: [\n        {provide: ɵWorkbenchPopup, useValue: this},\n        {provide: WorkbenchPopup, useExisting: ɵWorkbenchPopup},\n        {provide: Popup, useExisting: ɵWorkbenchPopup},\n        {provide: WORKBENCH_ELEMENT, useExisting: ɵWorkbenchPopup},\n        inject(WORKBENCH_POPUP_CONTEXT, {optional: true}) ?? [],\n        this._options.providers ?? [],\n      ],\n    });\n    inject(DestroyRef).onDestroy(() => injector.destroy());\n    return new ComponentPortal(WorkbenchPopupComponent, null, injector);\n  }\n\n  /**\n   * Creates a dedicated overlay per popup to place it on top of previously created overlays, such as dialogs, popups, dropdowns, etc.\n   */\n  private createOverlay(positionStrategy: PositionStrategy): OverlayRef {\n    return inject(Overlay).create({\n      panelClass: 'wb-popup',\n      hasBackdrop: false,\n      positionStrategy: positionStrategy,\n      scrollStrategy: inject(Overlay).scrollStrategies.noop(),\n      disposeOnNavigation: true,\n    });\n  }\n\n  /**\n   * Moves the popup with the anchor.\n   */\n  private stickToAnchor(positionStrategy: FlexibleConnectedPositionStrategy): void {\n    effect(() => {\n      const origin = this._popupOrigin();\n      untracked(() => {\n        if (origin) {\n          positionStrategy.setOrigin(origin);\n          this._overlayRef.updatePosition();\n        }\n      });\n    });\n  }\n\n  /**\n   * Monitors attachment of the host element.\n   */\n  private monitorHostElementAttached(): Signal<boolean> {\n    if (this.invocationContext) {\n      return this.invocationContext.attached;\n    }\n    const workbenchComponentRef = inject(WORKBENCH_COMPONENT_REF);\n    return computed(() => !!workbenchComponentRef());\n  }\n\n  /**\n   * Repositions the popup position when resized.\n   */\n  private repositionOnResize(): void {\n    const zone = inject(NgZone);\n\n    fromResize$(this._overlayRef.overlayElement)\n      .pipe(\n        observeIn(fn => zone.run(fn)),\n        takeUntilDestroyed(),\n      )\n      .subscribe(() => {\n        this._overlayRef.updatePosition();\n      });\n  }\n\n  /**\n   * Closes the popup on focus loss, if configured.\n   */\n  private closeOnFocusLoss(popupElement: HTMLElement): void {\n    const focusMonitor = inject(FocusMonitor);\n\n    if (this._options.closeStrategy?.onFocusLost ?? true) {\n      effect(onCleanup => {\n        if (!this.attached() || !this._popupOrigin()) {\n          return;\n        }\n        untracked(() => {\n          const subscription = focusMonitor.monitor(popupElement, true)\n            .pipe(filter((focusOrigin: FocusOrigin) => !focusOrigin))\n            .subscribe(() => this.close(this.result));\n          onCleanup(() => subscription.unsubscribe());\n        });\n      });\n    }\n  }\n\n  /**\n   * Closes the popup on escape keystroke.\n   */\n  private closeOnEscape(popupElement: HTMLElement): void {\n    const zone = inject(NgZone);\n\n    if (this._options.closeStrategy?.onEscape ?? true) {\n      fromEvent<KeyboardEvent>(popupElement, 'keydown')\n        .pipe(\n          subscribeIn(fn => zone.runOutsideAngular(fn)),\n          filter((event: KeyboardEvent) => event.key === 'Escape'),\n          observeIn(fn => zone.run(fn)),\n          takeUntilDestroyed(),\n        )\n        .subscribe(() => this.close());\n    }\n  }\n\n  /**\n   * Closes the popup when the context element is destroyed.\n   */\n  private closeOnHostDestroy(): void {\n    if (this.invocationContext) {\n      effect(() => {\n        if (this.invocationContext!.destroyed()) {\n          untracked(() => this.close());\n        }\n      });\n    }\n  }\n\n  /**\n   * Binds this popup to its workbench host element, displaying it only when the host element is attached.\n   */\n  private bindToHostElement(popupElement: HTMLElement): void {\n    const zone = inject(NgZone);\n    const document = inject(DOCUMENT);\n    const viewDragService = inject(ViewDragService);\n\n    let activeElement = popupElement;\n\n    // Compute visibility as separate signal to only run the effect on visibility change.\n    const visible = computed(() => this.attached() && !!this._popupOrigin() && !viewDragService.dragging());\n\n    effect(() => {\n      const isVisible = visible();\n      untracked(() => {\n        if (isVisible) {\n          setStyle(this._overlayRef.overlayElement, {visibility: null});\n          activeElement.focus();\n        }\n        else {\n          setStyle(this._overlayRef.overlayElement, {visibility: 'hidden'}); // Hide via `visibility` instead of `display` property to retain the size.\n        }\n      });\n    });\n\n    // Track the focus in the popup to restore it when attaching the popup.\n    fromEvent(this._overlayRef.overlayElement, 'focusin')\n      .pipe(\n        subscribeIn(fn => zone.runOutsideAngular(fn)),\n        takeUntilDestroyed(),\n      )\n      .subscribe(() => {\n        activeElement = document.activeElement instanceof HTMLElement ? document.activeElement : popupElement;\n      });\n  }\n\n  /**\n   * Creates a signal that tracks the position of the popup anchor.\n   */\n  private trackPopupOrigin(): Signal<DOMRect | undefined> {\n    if (this._options.anchor instanceof Element || this._options.anchor instanceof ElementRef) {\n      const anchor = coerceElement(this._options.anchor) as HTMLElement;\n      const anchorBounds = boundingClientRect(anchor);\n\n      return computed(() => {\n        // Maintain position and size when detached to prevent flickering when attached again and to support for virtual scrolling in popup content.\n        if (!this.attached()) {\n          return undefined;\n        }\n\n        // IMPORTANT: Track anchor and host bounds only if attached to prevent flickering.\n\n        // The `boundingClientRect` signal does not detect position changes when the element is scrolled out of view.\n        // Consequently, if the popup anchor is scrolled out of view and the context element is enlarged, the popup may not align\n        // with the context boundaries. Therefore, we read the anchor's bounding box directly from the DOM.\n        anchorBounds();\n\n        return constrainClientRect(anchor.getBoundingClientRect(), this.invocationContext?.bounds());\n      }, {equal: isEqualDomRect});\n    }\n    else {\n      const documentBounds = boundingClientRect(document.documentElement);\n      const anchorBounds = toSignal(Observables.coerce(this._options.anchor));\n\n      return computed(() => {\n        // Maintain position and size when detached to prevent flickering when attached again and to support for virtual scrolling in popup content.\n        if (!this.attached()) {\n          return undefined;\n        }\n\n        // IMPORTANT: Track anchor and host bounds only if attached to prevent flickering.\n        if (!anchorBounds()) {\n          return undefined;\n        }\n\n        const relativeTo = anchorBounds()!.relativeTo ?? 'context';\n        const {x, y} = mapToPageCoordinates(anchorBounds()!, relativeTo === 'viewport' ? documentBounds() : (this.invocationContext?.bounds() ?? documentBounds()));\n        const {width, height} = anchorBounds()!;\n        return constrainClientRect(new DOMRect(x, y, width, height), this.invocationContext?.bounds());\n      }, {equal: isEqualDomRect});\n    }\n  }\n\n  /** @inheritDoc */\n  public setResult<R>(result?: R): void {\n    this.result = result;\n  }\n\n  /** @inheritDoc */\n  public close<R>(result?: R | Error): void {\n    assertNotInReactiveContext(this.close, 'Call WorkbenchPopup.close() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    // Prevent closing if blocked.\n    if (this.blockedBy()) {\n      return;\n    }\n\n    this.result = result;\n    this.destroy();\n  }\n\n  /** @inheritDoc */\n  public get cssClass(): Signal<string[]> {\n    return this._cssClass;\n  }\n\n  /** @inheritDoc */\n  public set cssClass(cssClass: string | string[]) {\n    untracked(() => this._cssClass.set(new Array<string>().concat(this._options.cssClass ?? []).concat(cssClass)));\n  }\n\n  // TODO [Angular 22] Remove with Angular 22. Used for backward compatiblity.\n  public set cssClasses(cssClasses: string[]) {\n    this.cssClass = cssClasses;\n  }\n\n  // TODO [Angular 22] Remove with Angular 22. Used for backward compatiblity.\n  public get cssClasses(): string[] {\n    return this.cssClass();\n  }\n\n  /**\n   * Inputs passed to the popup.\n   */\n  public get inputs(): {[name: string]: unknown} | undefined {\n    return this._options.inputs;\n  }\n\n  /**\n   * Destroys this popup and associated resources.\n   */\n  public destroy(): void {\n    if (!this.destroyed()) {\n      this.injector.destroy();\n      this._overlayRef.dispose();\n    }\n  }\n}\n\n/** @inheritDoc */\nclass ɵWorkbenchPopupSize implements WorkbenchPopupSize {\n\n  private readonly _height: WritableSignal<string | undefined>;\n  private readonly _width: WritableSignal<string | undefined>;\n  private readonly _minHeight: WritableSignal<string | undefined>;\n  private readonly _maxHeight: WritableSignal<string | undefined>;\n  private readonly _minWidth: WritableSignal<string | undefined>;\n  private readonly _maxWidth: WritableSignal<string | undefined>;\n\n  constructor(options: WorkbenchPopupOptions) {\n    // Migrate deprecation analogous to `ɵWorkbenchDialogSize`.\n    this._height = signal<string | undefined>(options.size?.height);\n    this._width = signal<string | undefined>(options.size?.width);\n    this._minHeight = signal<string | undefined>(options.size?.minHeight);\n    this._maxHeight = signal<string | undefined>(options.size?.maxHeight);\n    this._minWidth = signal<string | undefined>(options.size?.minWidth);\n    this._maxWidth = signal<string | undefined>(options.size?.maxWidth);\n  }\n\n  /** @inheritDoc */\n  public get height(): Signal<string | undefined> {\n    return this._height;\n  }\n\n  /** @inheritDoc */\n  public set height(height: string | undefined) {\n    untracked(() => this._height.set(height));\n  }\n\n  /** @inheritDoc */\n  public get width(): Signal<string | undefined> {\n    return this._width;\n  }\n\n  /** @inheritDoc */\n  public set width(width: string | undefined) {\n    untracked(() => this._width.set(width));\n  }\n\n  /** @inheritDoc */\n  public get minHeight(): Signal<string | undefined> {\n    return this._minHeight;\n  }\n\n  /** @inheritDoc */\n  public set minHeight(minHeight: string | undefined) {\n    untracked(() => this._minHeight.set(minHeight));\n  }\n\n  /** @inheritDoc */\n  public get maxHeight(): Signal<string | undefined> {\n    return this._maxHeight;\n  }\n\n  /** @inheritDoc */\n  public set maxHeight(maxHeight: string | undefined) {\n    untracked(() => this._maxHeight.set(maxHeight));\n  }\n\n  /** @inheritDoc */\n  public get minWidth(): Signal<string | undefined> {\n    return this._minWidth;\n  }\n\n  /** @inheritDoc */\n  public set minWidth(minWidth: string | undefined) {\n    untracked(() => this._minWidth.set(minWidth));\n  }\n\n  /** @inheritDoc */\n  public get maxWidth(): Signal<string | undefined> {\n    return this._maxWidth;\n  }\n\n  /** @inheritDoc */\n  public set maxWidth(maxWidth: string | undefined) {\n    untracked(() => this._maxWidth.set(maxWidth));\n  }\n}\n\nconst NORTH: ConnectedPosition = {originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', panelClass: 'wb-north'};\nconst SOUTH: ConnectedPosition = {originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', panelClass: 'wb-south'};\nconst WEST: ConnectedPosition = {originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', panelClass: 'wb-west'};\nconst EAST: ConnectedPosition = {originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', panelClass: 'wb-east'};\n\n/**\n * Maps given context coordinates to absolute page coordinates.\n */\nfunction mapToPageCoordinates(origin: PopupOrigin, relativeTo: DOMRect): Point {\n  const xy = origin as Partial<Point>;\n  if (xy.x !== undefined && xy.y !== undefined) {\n    return {\n      x: relativeTo.x + xy.x,\n      y: relativeTo.y + xy.y,\n    };\n  }\n  const topLeft = origin as Partial<TopLeftPoint>;\n  if (topLeft.top !== undefined && topLeft.left !== undefined) {\n    return {\n      x: relativeTo.x + topLeft.left,\n      y: relativeTo.y + topLeft.top,\n    };\n  }\n  const topRight = origin as Partial<TopRightPoint>;\n  if (topRight.top !== undefined && topRight.right !== undefined) {\n    return {\n      x: relativeTo.x + (relativeTo.width - topRight.right),\n      y: relativeTo.y + topRight.top,\n    };\n  }\n  const bottomLeft = origin as Partial<BottomLeftPoint>;\n  if (bottomLeft.bottom !== undefined && bottomLeft.left !== undefined) {\n    return {\n      x: relativeTo.x + bottomLeft.left,\n      y: relativeTo.y + (relativeTo.height - bottomLeft.bottom),\n    };\n  }\n  const bottomRight = origin as Partial<BottomRightPoint>;\n  if (bottomRight.bottom !== undefined && bottomRight.right !== undefined) {\n    return {\n      x: relativeTo.x + (relativeTo.width - bottomRight.right),\n      y: relativeTo.y + (relativeTo.height - bottomRight.bottom),\n    };\n  }\n  throw Error('[PopupOriginError] Illegal popup origin; must be \"Point\", \"TopLeftPoint\", \"TopRightPoint\", \"BottomLeftPoint\" or \"BottomRightPoint\".');\n}\n\nfunction isEqualDomRect(a: DOMRect | undefined, b: DOMRect | undefined): boolean {\n  return a?.top === b?.top && a?.right === b?.right && a?.bottom === b?.bottom && a?.left === b?.left;\n}\n\n/**\n * TODO [Angular 22] Remove with Angular 22. Used for backward compatiblity.\n */\nexport const LEGACY_POPUP_INPUT = new InjectionToken<unknown>('LEGACY_POPUP_INPUT');\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, Injectable, Signal} from '@angular/core';\nimport {WorkbenchElementRegistry} from '../registry/workbench-element-registry';\nimport {ɵWorkbenchNotification} from './ɵworkbench-notification.model';\nimport {NotificationId} from '../workbench.identifiers';\n\n/**\n * Registry for {@link WorkbenchNotification} elements.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchNotificationRegistry extends WorkbenchElementRegistry<NotificationId, ɵWorkbenchNotification> {\n\n  /**\n   * Gets the most recently opened notification.\n   */\n  public top: Signal<ɵWorkbenchNotification | undefined>;\n\n  constructor() {\n    super({\n      nullElementErrorFn: notificationId => Error(`[NullNotificationError] Notification '${notificationId}' not found.`),\n      onUnregister: notification => notification.destroy(),\n    });\n\n    this.top = computed(() => this.elements().at(-1));\n  }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, inject, Injector, Signal, signal} from '@angular/core';\nimport {DialogId, isDialogId, isNotificationId, isPartId, isPopupId, isViewId, NotificationId, PartId, PopupId, ViewId} from '../workbench.identifiers';\nimport {WorkbenchPartRegistry} from '../part/workbench-part.registry';\nimport {constrainClientRect} from '../common/dom.util';\nimport {WorkbenchViewRegistry} from '../view/workbench-view.registry';\nimport {WorkbenchDialogRegistry} from '../dialog/workbench-dialog.registry';\nimport {WorkbenchPopupRegistry} from '../popup/workbench-popup.registry';\nimport {WORKBENCH_ELEMENT} from '../workbench-element-references';\nimport {WorkbenchNotificationRegistry} from '../notification/workbench-notification.registry';\n\n/**\n * Creates the invocation context for given element.\n *\n * Passing `undefined` derives the context from the current (or passed) injection context; passing `null` returns `null`.\n *\n * The current invocation context is obtained from the {@link WORKBENCH_ELEMENT} DI token.\n *\n * @see WORKBENCH_ELEMENT\n */\nexport function createInvocationContext(elementId: PartId | ViewId | DialogId | PopupId | NotificationId | null | undefined, options?: {injector?: Injector}): WorkbenchInvocationContext | null {\n  if (elementId === null) {\n    return null;\n  }\n\n  const injector = options?.injector ?? inject(Injector);\n  const contextualElementId = elementId ?? injector.get(WORKBENCH_ELEMENT, null, {optional: true})?.id;\n  if (isPartId(contextualElementId)) {\n    const part = injector.get(WorkbenchPartRegistry).get(contextualElementId);\n    return {\n      elementId: part.id,\n      attached: part.slot.portal.attached,\n      bounds: computed(() => constrainClientRect(part.slot.bounds(), part.partBounds())),\n      destroyed: part.slot.portal.destroyed,\n      peripheral: part.peripheral,\n    };\n  }\n  else if (isViewId(contextualElementId)) {\n    const view = injector.get(WorkbenchViewRegistry).get(contextualElementId);\n    return {\n      elementId: view.id,\n      attached: view.slot.portal.attached,\n      bounds: computed(() => constrainClientRect(view.slot.bounds(), view.part().partBounds())),\n      destroyed: view.slot.portal.destroyed,\n      peripheral: computed(() => view.part().peripheral()),\n    };\n  }\n  else if (isDialogId(contextualElementId)) {\n    const dialog = injector.get(WorkbenchDialogRegistry).get(contextualElementId);\n    return {\n      elementId: dialog.id,\n      attached: dialog.attached,\n      bounds: dialog.bounds,\n      destroyed: dialog.destroyed,\n      peripheral: signal(false),\n    };\n  }\n  else if (isPopupId(contextualElementId)) {\n    const popup = injector.get(WorkbenchPopupRegistry).get(contextualElementId);\n    return {\n      elementId: popup.id,\n      attached: popup.attached,\n      bounds: popup.bounds,\n      destroyed: popup.destroyed,\n      peripheral: signal(false),\n    };\n  }\n  else if (isNotificationId(contextualElementId)) {\n    const notification = injector.get(WorkbenchNotificationRegistry).get(contextualElementId);\n    return {\n      elementId: notification.id,\n      attached: computed(() => !notification.destroyed()),\n      bounds: notification.bounds,\n      destroyed: notification.destroyed,\n      peripheral: signal(true),\n    };\n  }\n\n  return null;\n}\n\n/**\n * Information about the source of an invocation.\n */\nexport interface WorkbenchInvocationContext {\n  /**\n   * Identifies the element that initiated the interaction.\n   */\n  elementId: PartId | ViewId | DialogId | PopupId | NotificationId;\n  /**\n   * Indicates whether the source is attached to the DOM.\n   */\n  attached: Signal<boolean>;\n  /**\n   * Tracks the source's bounding box.\n   */\n  bounds: Signal<DOMRect | undefined>;\n  /**\n   * Indicates whether the source is located in the peripheral area of the workbench layout.\n   */\n  peripheral: Signal<boolean>;\n  /**\n   * Indicates whether the source has been destroyed.\n   */\n  destroyed: Signal<boolean>;\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {ɵWorkbenchPopupService} from './ɵworkbench-popup.service';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {WorkbenchPopupOptions} from './workbench-popup.options';\n\n/**\n * Enables the display of a component in a popup.\n *\n * A popup is a visual workbench element for displaying content above other content. It is positioned relative to an anchor,\n * which can be an element or a coordinate. The popup moves with the anchor. By default, the popup closes on focus loss or\n * when pressing the escape key.\n *\n * A popup can be bound to a context (e.g., part or view), displaying the popup only if the context is visible and closing\n * it when the context is disposed. Defaults to the calling context.\n */\n@Injectable({providedIn: 'root', useExisting: ɵWorkbenchPopupService})\nexport abstract class WorkbenchPopupService {\n\n  /**\n   * Opens a popup with the specified component and options.\n   *\n   * An anchor is used to position the popup based on its preferred alignment. The anchor can be an element or a coordinate.\n   *\n   * Data can be passed to the component as inputs via {@link WorkbenchPopupOptions.inputs} option. Inputs are available as input\n   * properties in the component. Alternatively, data can be passed for injection via a custom injector ({@link WorkbenchPopupOptions.injector})\n   * or providers ({@link WorkbenchPopupOptions.providers}).\n   *\n   * By default, the popup closes on focus loss or when pressing the escape key.\n   *\n   * @param component - Specifies the component to display in the popup.\n   * @param options - Controls the appearance and behavior of the popup.\n   * @returns Promise that resolves to the popup result, if any, or that rejects if the popup couldn't be opened or was closed with an error.\n   */\n  public abstract open<R>(component: ComponentType<unknown>, options: WorkbenchPopupOptions): Promise<R | undefined>;\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable} from '@angular/core';\nimport {LEGACY_POPUP_INPUT} from './ɵworkbench-popup.model';\nimport {PopupConfig} from './popup.config';\nimport {PopupService} from './popup.service';\nimport {WorkbenchPopupService} from './workbench-popup.service';\n\n/** @inheritDoc */\n@Injectable({providedIn: 'root'})\nexport class ɵPopupService implements PopupService {\n\n  private readonly _workbenchPopupService = inject(WorkbenchPopupService);\n\n  /** @inheritDoc */\n  public open<R>(config: PopupConfig): Promise<R | undefined> {\n    return this._workbenchPopupService.open(config.component, {\n      id: config.id,\n      anchor: config.anchor,\n      align: config.align,\n      closeStrategy: config.closeStrategy,\n      size: config.size,\n      cssClass: config.cssClass,\n      context: config.context,\n      injector: config.componentConstructOptions?.injector,\n      providers: [\n        ...config.componentConstructOptions?.providers ?? [],\n        {provide: LEGACY_POPUP_INPUT, useValue: config.input as unknown},\n      ],\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {PopupConfig} from './popup.config';\nimport {ɵPopupService} from './ɵpopup.service';\n\n/**\n * Enables the display of a component in a popup.\n *\n * A popup is a visual workbench element for displaying content above other content. It is positioned relative to an anchor,\n * which can be an element or a coordinate. The popup moves with the anchor. By default, the popup closes on focus loss or\n * when pressing the escape key.\n *\n * A popup can be bound to a context (e.g., part or view), displaying the popup only if the context is visible and closing\n * it when the context is disposed. Defaults to the calling context.\n *\n * @deprecated since version 21.0.0-beta.1. Use `WorkbenchPopupService` to open popups. Marked for removal in version 22.\n */\n@Injectable({providedIn: 'root', useExisting: ɵPopupService})\nexport abstract class PopupService {\n\n  /**\n   * Opens a popup with the specified component and options.\n   *\n   * An anchor is used to position the popup based on its preferred alignment. The anchor can be an element or a coordinate.\n   *\n   * Data can be passed to the component via {@link PopupConfig.input} property. The component can inject the popup handle {@link WorkbenchPopup} to\n   * read input data or to close the popup.\n   *\n   * By default, the popup closes on focus loss or when pressing the escape key.\n   *\n   * @param config - Controls the appearance and behavior of the popup.\n   * @returns Promise that resolves to the popup result, if any, or that rejects if the popup couldn't be opened or was closed with an error.\n   *\n   * @deprecated since version 21.0.0-beta.1. Use `WorkbenchPopupService` to open popups. Marked for removal in version 22.\n   */\n  public abstract open<R>(config: PopupConfig): Promise<R | undefined>;\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ApplicationRef, assertNotInReactiveContext, inject, Injectable, Injector, NgZone, Provider, runInInjectionContext} from '@angular/core';\nimport {WorkbenchPopupRegistry} from './workbench-popup.registry';\nimport {computePopupId} from '../workbench.identifiers';\nimport {ɵWorkbenchPopup} from './ɵworkbench-popup.model';\nimport {createInvocationContext, WorkbenchInvocationContext} from '../invocation-context/invocation-context';\nimport {WorkbenchPopupService} from './workbench-popup.service';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {WorkbenchPopupOptions} from './workbench-popup.options';\nimport {ɵPopupService} from './ɵpopup.service';\nimport {PopupService} from './popup.service';\n\n/** @inheritDoc */\n@Injectable({providedIn: 'root'})\nexport class ɵWorkbenchPopupService implements WorkbenchPopupService {\n\n  private readonly _injector = inject(Injector);\n  private readonly _rootInjector = inject(ApplicationRef).injector;\n  private readonly _popupRegistry = inject(WorkbenchPopupRegistry);\n  private readonly _zone = inject(NgZone);\n\n  /** @inheritDoc */\n  public async open<R>(component: ComponentType<unknown>, options: WorkbenchPopupOptions): Promise<R | undefined> {\n    assertNotInReactiveContext(this.open, 'Call WorkbenchPopupService.open() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    // Ensure to run in Angular zone to display the popup even when called from outside the Angular zone.\n    if (!NgZone.isInAngularZone()) {\n      return this._zone.run(() => this.open(component, options));\n    }\n\n    const popup = this.createPopup(component, options);\n    this._popupRegistry.register(popup.id, popup);\n    try {\n      return await popup.waitForClose();\n    }\n    finally {\n      this._popupRegistry.unregister(popup.id);\n    }\n  }\n\n  /**\n   * Creates the popup handle.\n   */\n  private createPopup(component: ComponentType<unknown>, options: WorkbenchPopupOptions): ɵWorkbenchPopup {\n    // Construct the handle in an injection context that shares the popup's lifecycle, allowing for automatic cleanup of effects and RxJS interop functions.\n    const popupId = options.id ?? computePopupId();\n    const popupInjector = Injector.create({\n      parent: this._rootInjector, // use root injector to be independent of service construction context\n      providers: [],\n      name: `Workbench Popup ${popupId}`,\n    });\n    const invocationContext = createPopupInvocationContext(options, this._injector);\n    return runInInjectionContext(popupInjector, () => new ɵWorkbenchPopup(popupId, component, invocationContext, options));\n  }\n}\n\n/**\n * Computes the popup's invocation context based on passsed options and injection context.\n */\nfunction createPopupInvocationContext(options: WorkbenchPopupOptions, injector: Injector): WorkbenchInvocationContext | null {\n  return createInvocationContext(options.context && (typeof options.context === 'object' ? options.context.viewId : options.context), {injector});\n}\n\n/**\n * Provides {@link WorkbenchPopupService} for dependency injection.\n */\nexport function provideWorkbenchPopupService(): Provider[] {\n  return [\n    ɵWorkbenchPopupService,\n    ɵPopupService,\n    {provide: WorkbenchPopupService, useExisting: ɵWorkbenchPopupService},\n    {provide: PopupService, useExisting: ɵPopupService},\n  ];\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {InjectionToken, Provider} from '@angular/core';\nimport {provideWorkbenchDialogService} from './ɵworkbench-dialog.service';\nimport {provideWorkbenchMessageBoxService} from '../message-box/ɵworkbench-message-box.service';\nimport {provideWorkbenchPopupService} from '../popup/ɵworkbench-popup.service';\n\n/**\n * DI token to register providers available for DI if in the context of a workbench dialog.\n */\nexport const WORKBENCH_DIALOG_CONTEXT = new InjectionToken<Provider[]>('WORKBENCH_DIALOG_CONTEXT');\n\n/**\n * Provides providers available for DI if in the context of a workbench dialog.\n */\nexport function provideWorkbenchDialogContext(): Provider {\n  return {\n    provide: WORKBENCH_DIALOG_CONTEXT,\n    useFactory: (): Provider[] => [\n      provideWorkbenchDialogService(),\n      provideWorkbenchMessageBoxService(),\n      provideWorkbenchPopupService(),\n    ],\n    multi: true,\n  };\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {BehaviorSubject, concatWith, delay, firstValueFrom, of, Subject, switchMap} from 'rxjs';\nimport {assertNotInReactiveContext, ComponentRef, computed, DestroyableInjector, DestroyRef, DOCUMENT, effect, inject, Injector, Signal, signal, untracked} from '@angular/core';\nimport {WorkbenchDialog, WorkbenchDialogSize} from './workbench-dialog.model';\nimport {WorkbenchDialogOptions} from './workbench-dialog.options';\nimport {ComponentPortal, ComponentType} from '@angular/cdk/portal';\nimport {Overlay, OverlayRef} from '@angular/cdk/overlay';\nimport {WorkbenchDialogComponent} from './workbench-dialog.component';\nimport {WorkbenchDialogRegistry} from './workbench-dialog.registry';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {setStyle} from '../common/dom.util';\nimport {fromResize$} from '@scion/toolkit/observable';\nimport {ViewDragService} from '../view-dnd/view-drag.service';\nimport {WORKBENCH_COMPONENT_BOUNDS, WORKBENCH_COMPONENT_REF, WORKBENCH_ELEMENT} from '../workbench-element-references';\nimport {Arrays} from '@scion/toolkit/util';\nimport {WorkbenchConfig} from '../workbench-config';\nimport {distinctUntilChanged} from 'rxjs/operators';\nimport {WorkbenchDialogActionDirective} from './dialog-footer/workbench-dialog-action.directive';\nimport {WorkbenchDialogFooterDirective} from './dialog-footer/workbench-dialog-footer.directive';\nimport {WorkbenchDialogHeaderDirective} from './dialog-header/workbench-dialog-header.directive';\nimport {Disposable} from '../common/disposable';\nimport {Blockable} from '../glass-pane/blockable';\nimport {Blocking} from '../glass-pane/blocking';\nimport {boundingClientRect} from '@scion/components/dimension';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {WorkbenchFocusMonitor} from '../focus/workbench-focus-tracker.service';\nimport {DialogId} from '../workbench.identifiers';\nimport {WorkbenchInvocationContext} from '../invocation-context/invocation-context';\nimport {WORKBENCH_DIALOG_CONTEXT} from './workbench-dialog-context.provider';\n\n/** @inheritDoc */\nexport class ɵWorkbenchDialog implements WorkbenchDialog, Blockable, Blocking {\n\n  /** Injector for the dialog; destroyed when the dialog is closed. */\n  public readonly injector = inject(Injector) as DestroyableInjector;\n\n  private readonly _overlayRef: OverlayRef;\n  private readonly _portal: ComponentPortal<WorkbenchDialogComponent>;\n  private readonly _workbenchDialogRegistry = inject(WorkbenchDialogRegistry);\n  private readonly _workbenchConfig = inject(WorkbenchConfig);\n  private readonly _blink$ = new Subject<void>();\n  private readonly _focusMonitor = inject(WorkbenchFocusMonitor);\n  private readonly _title = signal<Translatable | undefined>(undefined);\n  private readonly _closable = signal(true);\n  private readonly _resizable = signal(true);\n  private readonly _padding = signal(true);\n  private readonly _cssClass = signal<string[]>([]);\n\n  /** Result (or error) to be passed to the dialog opener. */\n  private _result: unknown | Error | undefined;\n  private _componentRef = signal<ComponentRef<WorkbenchDialogComponent> | undefined>(undefined);\n\n  public readonly blockedBy: Signal<ɵWorkbenchDialog | null>;\n  public readonly size: WorkbenchDialogSize = new ɵWorkbenchDialogSize();\n  public readonly focused = computed(() => this._focusMonitor.activeElement()?.id === this.id);\n  public readonly attached: Signal<boolean>;\n  public readonly destroyed = signal<boolean>(false);\n  public readonly bounds = boundingClientRect(computed(() => this._componentRef()?.instance.dialogSlotBounds()));\n  public readonly modal: boolean;\n  public readonly blinking$ = new BehaviorSubject(false);\n\n  public header: WorkbenchDialogHeaderDirective | undefined;\n  public footer: WorkbenchDialogFooterDirective | undefined;\n  public actions = new Array<WorkbenchDialogActionDirective>();\n\n  constructor(public id: DialogId,\n              public component: ComponentType<unknown>,\n              public invocationContext: WorkbenchInvocationContext | null,\n              private _options: WorkbenchDialogOptions) {\n    this._overlayRef = this.createOverlay();\n    this._portal = this.createPortal();\n    this._cssClass.set(Arrays.coerce(this._options.cssClass));\n    this.attached = this.monitorHostElementAttached();\n    this.blockedBy = this.computeBlocked();\n    this.modal = this._options.modality !== 'none';\n    this.bindToHostElement();\n    this.restoreFocusOnAttach();\n    this.restoreFocusOnUnblock();\n    this.closeOnHostDestroy();\n    this.blinkOnRequest();\n\n    inject(DestroyRef).onDestroy(() => this.destroyed.set(true));\n  }\n\n  /**\n   * Waits for the dialog to close, resolving to its result or rejecting if closed with an error.\n   */\n  public async waitForClose<R>(): Promise<R | undefined> {\n    // Wait for the overlay to be initially positioned to have a smooth slide-in animation.\n    if (this.animate) {\n      await firstValueFrom(fromResize$(this._overlayRef.hostElement));\n    }\n\n    // Attach the dialog portal to the overlay.\n    this._componentRef.set(this._overlayRef.attach(this._portal));\n\n    // Ensure to destroy this handle on browser back/forward navigation.\n    this._componentRef()!.onDestroy(() => this.destroy());\n\n    // Trigger a manual change detection cycle to avoid 'ExpressionChangedAfterItHasBeenCheckedError'\n    // when the dialog sets dialog-specific properties such as title or size during construction.\n    this._componentRef()!.changeDetectorRef.detectChanges();\n\n    // Wait for the dialog to close, resolving to its result or rejecting if closed with an error.\n    return new Promise<R | undefined>((resolve, reject) => {\n      this.injector.get(DestroyRef).onDestroy(() => {\n        this._result instanceof Error ? reject(this._result) : resolve(this._result as R);\n      });\n    });\n  }\n\n  /** @inheritDoc */\n  public close<R>(result?: R | Error): void {\n    assertNotInReactiveContext(this.close, 'Call WorkbenchDialog.close() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    // Prevent closing if blocked.\n    if (this.blockedBy()) {\n      return;\n    }\n\n    this._result = result;\n    this.destroy();\n  }\n\n  /**\n   * Inputs passed to the dialog.\n   */\n  public get inputs(): {[name: string]: unknown} | undefined {\n    return this._options.inputs;\n  }\n\n  /**\n   * Indicates if to animate the dialog.\n   */\n  public get animate(): boolean {\n    return this._options.animate ?? false;\n  }\n\n  /** @inheritDoc */\n  public focus(): void {\n    if (!this.blockedBy()) {\n      this._componentRef()?.instance.focus();\n    }\n  }\n\n  public registerHeader(header: WorkbenchDialogHeaderDirective): Disposable {\n    this.header = header;\n    return {\n      dispose: () => {\n        if (this.header === header) {\n          this.header = undefined;\n        }\n      },\n    };\n  }\n\n  public registerFooter(footer: WorkbenchDialogFooterDirective): Disposable {\n    if (this.actions.length) {\n      throw Error('[DialogInitError] Custom dialog footer not supported if using dialog actions.');\n    }\n    this.footer = footer;\n    return {\n      dispose: () => {\n        if (this.footer === footer) {\n          this.footer = undefined;\n        }\n      },\n    };\n  }\n\n  public registerAction(action: WorkbenchDialogActionDirective): Disposable {\n    if (this.footer) {\n      throw Error('[DialogInitError] Dialog actions not supported if using a custom dialog footer.');\n    }\n    this.actions = this.actions.concat(action);\n    return {\n      dispose: () => this.actions = this.actions.filter(candidate => candidate !== action),\n    };\n  }\n\n  /** @inheritDoc */\n  public get title(): Signal<Translatable | undefined> {\n    return this._title;\n  }\n\n  /** @inheritDoc */\n  public set title(title: Translatable | undefined) {\n    untracked(() => this._title.set(title));\n  }\n\n  /** @inheritDoc */\n  public get closable(): Signal<boolean> {\n    return this._closable;\n  }\n\n  /** @inheritDoc */\n  public set closable(closable: boolean) {\n    untracked(() => this._closable.set(closable));\n  }\n\n  /** @inheritDoc */\n  public get resizable(): Signal<boolean> {\n    return this._resizable;\n  }\n\n  /** @inheritDoc */\n  public set resizable(resizable: boolean) {\n    untracked(() => this._resizable.set(resizable));\n  }\n\n  /** @inheritDoc */\n  public get padding(): Signal<boolean> {\n    return this._padding;\n  }\n\n  /** @inheritDoc */\n  public set padding(padding: boolean) {\n    untracked(() => this._padding.set(padding));\n  }\n\n  /** @inheritDoc */\n  public get cssClass(): Signal<string[]> {\n    return this._cssClass;\n  }\n\n  /** @inheritDoc */\n  public set cssClass(cssClass: string | string[]) {\n    untracked(() => this._cssClass.set(new Array<string>().concat(this._options.cssClass ?? []).concat(cssClass)));\n  }\n\n  /**\n   * Returns the position of the dialog in the dialog stack.\n   */\n  public getPositionInDialogStack(): number {\n    return this._workbenchDialogRegistry.indexOf(this);\n  }\n\n  /** @inheritDoc */\n  public blink(): void {\n    this._blink$.next();\n  }\n\n  /**\n   * Creates a portal to render {@link WorkbenchDialogComponent} in the dialog's injection context.\n   */\n  private createPortal(): ComponentPortal<WorkbenchDialogComponent> {\n    const injector = Injector.create({\n      parent: this._options.injector ?? inject(Injector),\n      providers: [\n        {provide: ɵWorkbenchDialog, useValue: this},\n        {provide: WorkbenchDialog, useExisting: ɵWorkbenchDialog},\n        {provide: WORKBENCH_ELEMENT, useExisting: ɵWorkbenchDialog},\n        inject(WORKBENCH_DIALOG_CONTEXT, {optional: true}) ?? [],\n        this._options.providers ?? [],\n      ],\n    });\n    inject(DestroyRef).onDestroy(() => injector.destroy());\n    return new ComponentPortal(WorkbenchDialogComponent, null, injector);\n  }\n\n  /**\n   * Creates a dedicated overlay per dialog to place it on top of previously created overlays, such as dialogs, popups, dropdowns, etc.\n   */\n  private createOverlay(): OverlayRef {\n    const overlay = inject(Overlay);\n    return overlay.create({\n      disposeOnNavigation: true, // dispose dialog on browser back/forward navigation\n      panelClass: ['wb-dialog-modality-context'],\n      positionStrategy: overlay.position().global(),\n      scrollStrategy: overlay.scrollStrategies.noop(),\n    });\n  }\n\n  /**\n   * Restores focus when re-attaching this dialog.\n   */\n  private restoreFocusOnAttach(): void {\n    effect(() => {\n      const attached = this.attached();\n      untracked(() => attached && this.focus());\n    });\n  }\n\n  /**\n   * Restores focus when unblocking this dialog.\n   */\n  private restoreFocusOnUnblock(): void {\n    effect(() => {\n      const blocked = this.blockedBy();\n      untracked(() => !blocked && this.focus());\n    });\n  }\n\n  /**\n   * Monitors attachment of the host element.\n   */\n  private monitorHostElementAttached(): Signal<boolean> {\n    if (this.invocationContext) {\n      return this.invocationContext.attached;\n    }\n    if (this._workbenchConfig.dialog?.modalityScope === 'viewport') {\n      return computed(() => true);\n    }\n    const workbenchComponentRef = inject(WORKBENCH_COMPONENT_REF);\n    return computed(() => !!workbenchComponentRef());\n  }\n\n  /**\n   * Binds this dialog to its workbench host element, displaying it only when the host element is attached.\n   *\n   * Dialogs opened in non-peripheral area are displayed in the center of the host.\n   */\n  private bindToHostElement(): void {\n    if (!this.invocationContext && this._workbenchConfig.dialog?.modalityScope === 'viewport') {\n      setStyle(this._overlayRef.hostElement, {inset: '0'});\n    }\n    else {\n      const viewDragService = inject(ViewDragService);\n      const workbenchComponentBounds = inject(WORKBENCH_COMPONENT_BOUNDS);\n      const document = inject(DOCUMENT);\n\n      effect(() => {\n        const visible = this.attached() && !viewDragService.dragging();\n\n        // Maintain position and size when hidden to prevent flickering when visible again and to support for virtual scrolling in dialog content.\n        if (!visible) {\n          setStyle(this._overlayRef.overlayElement, {visibility: 'hidden'}); // Hide via `visibility` instead of `display` property to retain the size.\n          return;\n        }\n\n        // IMPORTANT: Track host bounds only if visible to prevent flickering.\n\n        // Align dialog relative to contextual element if opened in non-peripheral area.\n        const hostBounds = this.invocationContext?.peripheral() === false ? this.invocationContext.bounds() : workbenchComponentBounds();\n        if (!hostBounds) {\n          setStyle(this._overlayRef.overlayElement, {visibility: 'hidden'}); // Hide via `visibility` instead of `display` property to retain the size.\n          return;\n        }\n\n        setStyle(this._overlayRef.overlayElement, {visibility: null});\n\n        // Center the dialog horizontally within the host bounds.\n        // Shift the overlay instead of fitting it to the host bounds, so the dialog can grow beyond host bounds\n        // if not specifying dialog size via a dialog handle.\n        const {left, top, width} = hostBounds;\n        const viewportCenter = document.documentElement.offsetWidth / 2;\n        const dialogCenter = left + width / 2;\n        const xDelta = -1 * (viewportCenter - dialogCenter);\n\n        setStyle(this._overlayRef.hostElement, {\n          transform: `translateX(${Math.round(xDelta)}px) translateY(${Math.round(top)}px)`, // round offset to avoid blurry dialog\n        });\n      });\n    }\n  }\n\n  /**\n   * Computes if this dialog is blocked by another dialog.\n   */\n  private computeBlocked(): Signal<ɵWorkbenchDialog | null> {\n    const dialogRegistry = inject(WorkbenchDialogRegistry);\n    const topInThisContext = dialogRegistry.top(this.id);\n    const topInInvocationContext = dialogRegistry.top(this.invocationContext?.elementId);\n\n    return computed(() => {\n      // Get the top dialog in the context spawned by this dialog.\n      if (topInThisContext()) {\n        return topInThisContext();\n      }\n      // Get the top dialog in the context this dialog was opened in.\n      if (topInInvocationContext() !== this) {\n        return topInInvocationContext();\n      }\n      return null;\n    });\n  }\n\n  private blinkOnRequest(): void {\n    this._blink$\n      .pipe(\n        switchMap(() => of(true).pipe(concatWith(of(false).pipe(delay(300))))),\n        distinctUntilChanged(),\n        takeUntilDestroyed(),\n      )\n      .subscribe(this.blinking$);\n  }\n\n  /**\n   * Closes the dialog when the context element is destroyed.\n   */\n  private closeOnHostDestroy(): void {\n    if (this.invocationContext) {\n      effect(() => {\n        if (this.invocationContext!.destroyed()) {\n          untracked(() => this.close());\n        }\n      });\n    }\n  }\n\n  /**\n   * Destroys this dialog and associated resources.\n   */\n  public destroy(): void {\n    if (!this.destroyed()) {\n      this.injector.destroy();\n      this._overlayRef.dispose();\n    }\n  }\n}\n\n/** @inheritDoc */\nclass ɵWorkbenchDialogSize implements WorkbenchDialogSize {\n\n  private readonly _height = signal<string | undefined>(undefined);\n  private readonly _width = signal<string | undefined>(undefined);\n  private readonly _minHeight = signal<string | undefined>(undefined);\n  private readonly _maxHeight = signal<string | undefined>(undefined);\n  private readonly _minWidth = signal<string | undefined>(undefined);\n  private readonly _maxWidth = signal<string | undefined>(undefined);\n\n  /** @inheritDoc */\n  public get height(): Signal<string | undefined> {\n    return this._height;\n  }\n\n  /** @inheritDoc */\n  public set height(height: string | undefined) {\n    untracked(() => this._height.set(height));\n  }\n\n  /** @inheritDoc */\n  public get width(): Signal<string | undefined> {\n    return this._width;\n  }\n\n  /** @inheritDoc */\n  public set width(width: string | undefined) {\n    untracked(() => this._width.set(width));\n  }\n\n  /** @inheritDoc */\n  public get minHeight(): Signal<string | undefined> {\n    return this._minHeight;\n  }\n\n  /** @inheritDoc */\n  public set minHeight(minHeight: string | undefined) {\n    untracked(() => this._minHeight.set(minHeight));\n  }\n\n  /** @inheritDoc */\n  public get maxHeight(): Signal<string | undefined> {\n    return this._maxHeight;\n  }\n\n  /** @inheritDoc */\n  public set maxHeight(maxHeight: string | undefined) {\n    untracked(() => this._maxHeight.set(maxHeight));\n  }\n\n  /** @inheritDoc */\n  public get minWidth(): Signal<string | undefined> {\n    return this._minWidth;\n  }\n\n  /** @inheritDoc */\n  public set minWidth(minWidth: string | undefined) {\n    untracked(() => this._minWidth.set(minWidth));\n  }\n\n  /** @inheritDoc */\n  public get maxWidth(): Signal<string | undefined> {\n    return this._maxWidth;\n  }\n\n  /** @inheritDoc */\n  public set maxWidth(maxWidth: string | undefined) {\n    untracked(() => this._maxWidth.set(maxWidth));\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ApplicationRef, assertNotInReactiveContext, DestroyRef, DOCUMENT, inject, Injectable, Injector, NgZone, Provider, runInInjectionContext} from '@angular/core';\nimport {WorkbenchDialogOptions} from './workbench-dialog.options';\nimport {ɵWorkbenchDialog} from './ɵworkbench-dialog.model';\nimport {firstValueFrom} from 'rxjs';\nimport {WorkbenchDialogRegistry} from './workbench-dialog.registry';\nimport {filter} from 'rxjs/operators';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {WorkbenchDialogService} from './workbench-dialog.service';\nimport {computeDialogId} from '../workbench.identifiers';\nimport {createInvocationContext, WorkbenchInvocationContext} from '../invocation-context/invocation-context';\nimport {WORKBENCH_ELEMENT} from '../workbench-element-references';\nimport {Logger, LoggerNames} from '../logging';\nimport {toObservable} from '@angular/core/rxjs-interop';\n\n/** @inheritDoc */\n@Injectable({providedIn: 'root'})\nexport class ɵWorkbenchDialogService implements WorkbenchDialogService {\n\n  private readonly _injector = inject(Injector);\n  private readonly _rootInjector = inject(ApplicationRef).injector;\n  private readonly _dialogRegistry = inject(WorkbenchDialogRegistry);\n  private readonly _document = inject(DOCUMENT);\n  private readonly _zone = inject(NgZone);\n\n  constructor() {\n    this.installServiceLifecycleLogger();\n  }\n\n  /** @inheritDoc */\n  public async open<R>(component: ComponentType<unknown>, options?: WorkbenchDialogOptions): Promise<R | undefined> {\n    assertNotInReactiveContext(this.open, 'Call WorkbenchDialogService.open() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    // Ensure to run in Angular zone to display the dialog even when called from outside the Angular zone.\n    if (!NgZone.isInAngularZone()) {\n      return this._zone.run(() => this.open(component, options));\n    }\n\n    // Delay the opening of a context-modal dialog until all application-modal dialogs are closed.\n    // Otherwise, the context-modal dialog would overlap already opened application-modal dialogs.\n    const invocationContext = createDialogInvocationContext(options ?? {}, this._injector);\n    if (invocationContext) {\n      await this.waitUntilApplicationModalDialogsClosed();\n    }\n\n    // Create the dialog.\n    const dialog = this.createDialog(component, invocationContext, options ?? {});\n    this._dialogRegistry.register(dialog.id, dialog);\n\n    // Capture focused element to restore focus when closing the dialog.\n    const previouslyFocusedElement = this._document.activeElement instanceof HTMLElement ? this._document.activeElement : undefined;\n    try {\n      return await dialog.waitForClose();\n    }\n    finally {\n      this._dialogRegistry.unregister(dialog.id);\n\n      // Restore focus to previously focused element when closing the last dialog in the current context.\n      if (previouslyFocusedElement && !this._dialogRegistry.top(invocationContext?.elementId)()) {\n        previouslyFocusedElement.focus();\n      }\n    }\n  }\n\n  /**\n   * Creates the dialog handle.\n   */\n  private createDialog(component: ComponentType<unknown>, invocationContext: WorkbenchInvocationContext | null, options: WorkbenchDialogOptions): ɵWorkbenchDialog {\n    // Construct the handle in an injection context that shares the dialog's lifecycle, allowing for automatic cleanup of effects and RxJS interop functions.\n    const dialogId = computeDialogId();\n    const dialogInjector = Injector.create({\n      parent: this._rootInjector, // use root injector to be independent of service construction context\n      providers: [],\n      name: `Workbench Dialog ${dialogId}`,\n    });\n    return runInInjectionContext(dialogInjector, () => new ɵWorkbenchDialog(dialogId, component, invocationContext, options));\n  }\n\n  /**\n   * Returns a Promise that resolves when all application modal-dialogs are closed. If none are opened, the Promise resolves immediately.\n   */\n  private async waitUntilApplicationModalDialogsClosed(): Promise<void> {\n    // Use root injector to be independent of service construction context.\n    const injector = Injector.create({parent: this._rootInjector, providers: []});\n    await firstValueFrom(toObservable(this._dialogRegistry.top(), {injector}).pipe(filter(top => !top)));\n    injector.destroy();\n  }\n\n  private installServiceLifecycleLogger(): void {\n    const logger = inject(Logger);\n    const workbenchElement = inject(WORKBENCH_ELEMENT, {optional: true});\n    logger.debug(() => `Constructing WorkbenchDialogService [context=${workbenchElement?.id}]`, LoggerNames.LIFECYCLE);\n    inject(DestroyRef).onDestroy(() => logger.debug(() => `Destroying WorkbenchDialogService [context=${workbenchElement?.id}]'`, LoggerNames.LIFECYCLE));\n  }\n}\n\n/**\n * Computes the dialog's invocation context based on passsed options and injection context.\n */\nfunction createDialogInvocationContext(options: WorkbenchDialogOptions, injector: Injector): WorkbenchInvocationContext | null {\n  if (options.modality === 'application') {\n    return null;\n  }\n\n  return createInvocationContext(options.context && (typeof options.context === 'object' ? options.context.viewId : options.context), {injector});\n}\n\n/**\n * Provides {@link WorkbenchDialogService} for dependency injection.\n */\nexport function provideWorkbenchDialogService(): Provider[] {\n  return [\n    ɵWorkbenchDialogService,\n    {provide: WorkbenchDialogService, useExisting: ɵWorkbenchDialogService},\n  ];\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {InjectionToken, Provider} from '@angular/core';\nimport {provideWorkbenchDialogService} from '../dialog/ɵworkbench-dialog.service';\nimport {provideWorkbenchMessageBoxService} from '../message-box/ɵworkbench-message-box.service';\nimport {provideWorkbenchPopupService} from '../popup/ɵworkbench-popup.service';\n\n/**\n * DI token to register providers available for DI if in the context of a workbench view.\n */\nexport const WORKBENCH_VIEW_CONTEXT = new InjectionToken<Provider[]>('WORKBENCH_VIEW_CONTEXT');\n\n/**\n * Provides providers available for DI if in the context of a workbench view.\n */\nexport function provideWorkbenchViewContext(): Provider {\n  return {\n    provide: WORKBENCH_VIEW_CONTEXT,\n    useFactory: (): Provider[] => [\n      provideWorkbenchDialogService(),\n      provideWorkbenchMessageBoxService(),\n      provideWorkbenchPopupService(),\n    ],\n    multi: true,\n  };\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {firstValueFrom} from 'rxjs';\nimport {ActivatedRouteSnapshot, ChildrenOutletContexts} from '@angular/router';\nimport {ViewDragService, ViewMoveEventSource} from '../view-dnd/view-drag.service';\nimport {CanCloseFn, CanCloseRef, WorkbenchMenuItem, WorkbenchViewMenuItemFn} from '../workbench.model';\nimport {WORKBENCH_ELEMENT} from '../workbench-element-references';\nimport {WorkbenchView, WorkbenchViewNavigation} from './workbench-view.model';\nimport {WorkbenchPart} from '../part/workbench-part.model';\nimport {ɵWorkbenchService} from '../ɵworkbench.service';\nimport {WbComponentPortal} from '../portal/wb-component-portal';\nimport {afterRenderEffect, assertNotInReactiveContext, computed, DestroyableInjector, effect, inject, Injector, IterableDiffers, runInInjectionContext, Signal, signal, untracked} from '@angular/core';\nimport {ɵWorkbenchPart} from '../part/ɵworkbench-part.model';\nimport {WorkbenchPartRegistry} from '../part/workbench-part.registry';\nimport {WorkbenchLayoutService} from '../layout/workbench-layout.service';\nimport {WorkbenchDialogRegistry} from '../dialog/workbench-dialog.registry';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ɵWorkbenchDialog} from '../dialog/ɵworkbench-dialog.model';\nimport {Blockable} from '../glass-pane/blockable';\nimport {ViewId, WORKBENCH_ID} from '../workbench.identifiers';\nimport {ClassList} from '../common/class-list';\nimport {Routing} from '../routing/routing.util';\nimport {WorkbenchRouteData} from '../routing/workbench-route-data';\nimport {ɵWorkbenchRouter} from '../routing/ɵworkbench-router.service';\nimport {ɵWorkbenchLayout} from '../layout/ɵworkbench-layout';\nimport {Objects, Observables} from '@scion/toolkit/util';\nimport {Logger} from '../logging/logger';\nimport {WorkbenchViewMenuItemRegistry} from './workbench-view-menu-item.registry';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {ViewSlotComponent} from './view-slot.component';\nimport {WorkbenchFocusMonitor} from '../focus/workbench-focus-tracker.service';\nimport {WorkbenchPopupRegistry} from '../popup/workbench-popup.registry';\nimport {boundingClientRect} from '@scion/components/dimension';\nimport {WORKBENCH_VIEW_CONTEXT} from './workbench-view-context.provider';\n\n/** @inheritDoc */\nexport class ɵWorkbenchView implements WorkbenchView, Blockable {\n\n  /** Injector for the view; destroyed when the view is closed. */\n  public readonly injector = inject(Injector) as DestroyableInjector;\n  private readonly _workbenchId = inject(WORKBENCH_ID);\n  private readonly _workbenchService = inject(ɵWorkbenchService);\n  private readonly _layout = inject(WorkbenchLayoutService).layout;\n  private readonly _workbenchRouter = inject(ɵWorkbenchRouter);\n  private readonly _rootOutletContexts = inject(ChildrenOutletContexts);\n  private readonly _partRegistry = inject(WorkbenchPartRegistry);\n  private readonly _viewDragService = inject(ViewDragService);\n  private readonly _focusMonitor = inject(WorkbenchFocusMonitor);\n  private readonly _logger = inject(Logger);\n\n  private readonly _title = signal<Translatable | null>(null);\n  private readonly _heading = signal<Translatable | null>(null);\n  private readonly _dirty = signal(false);\n  private readonly _closable = signal(true);\n  private readonly _scrolledIntoView = signal(true);\n\n  public readonly alternativeId: string | undefined;\n  public readonly navigation = signal<WorkbenchViewNavigation | undefined>(undefined);\n  public readonly position = computed(() => this.part().views().indexOf(this));\n  public readonly first = computed(() => this.position() === 0);\n  public readonly last = computed(() => this.position() === this.part().views().length - 1);\n\n  public readonly part = signal<ɵWorkbenchPart>(null!);\n  public readonly activationInstant = signal(0);\n  public readonly active = signal<boolean>(false);\n  public readonly focused = computed(() => this._focusMonitor.activeElement()?.id === this.id);\n  public readonly menuItems: Signal<WorkbenchMenuItem[]>;\n  public readonly blockedBy: Signal<ɵWorkbenchDialog | null>;\n  public readonly bounds = computed(() => this.slot.bounds());\n  public readonly slot: {\n    portal: WbComponentPortal<ViewSlotComponent>;\n    bounds: Signal<DOMRect | undefined>;\n  };\n  public readonly classList = new ClassList();\n  public readonly isClosable = computed(() => this._closable() && !this.blockedBy());\n\n  /**\n   * Guard to confirm closing the view, if any.\n   *\n   * @see canClose\n   */\n  public canCloseGuard: (() => Promise<boolean>) | undefined;\n\n  constructor(public readonly id: ViewId, layout: ɵWorkbenchLayout) {\n    this.alternativeId = layout.view({viewId: this.id}).alternativeId;\n    this.slot = {\n      portal: this.createPortal(),\n      bounds: boundingClientRect(computed(() => this.slot.portal.element()), {injector: this.injector}),\n    };\n    this.menuItems = this.computeMenuItems();\n    this.blockedBy = inject(WorkbenchDialogRegistry).top(this.id);\n\n    this.installModelUpdater();\n    this.onLayoutChange({layout});\n    this.activateOnFocus();\n    this.focusOnActivate();\n  }\n\n  /**\n   * Creates a portal to render {@link ViewSlotComponent} in the view's injection context.\n   */\n  private createPortal(): WbComponentPortal<ViewSlotComponent> {\n    return new WbComponentPortal(ViewSlotComponent, {\n      debugName: `ViewSlotComponent [${this.id}]`,\n      providers: [\n        {provide: ɵWorkbenchView, useValue: this},\n        {provide: WorkbenchView, useExisting: ɵWorkbenchView},\n        {provide: WORKBENCH_ELEMENT, useExisting: ɵWorkbenchView},\n        inject(WORKBENCH_VIEW_CONTEXT, {optional: true}) ?? [],\n        // Prevent injecting this part into the view because the view may be dragged to a different part.\n        {provide: WorkbenchPart, useFactory: () => undefined},\n        {provide: ɵWorkbenchPart, useFactory: () => undefined},\n      ],\n    });\n  }\n\n  /**\n   * Method invoked when the workbench layout has changed.\n   *\n   * This method:\n   * - is called on every layout change, enabling the update of view properties defined in the layout (navigation hint, navigation data, part, ...).\n   * - is called on route activation (after destroyed the previous component (if any), but before constructing the new component).\n   */\n  private onLayoutChange(change: {layout: ɵWorkbenchLayout; route?: ActivatedRouteSnapshot; previousRoute?: ActivatedRouteSnapshot | null}): void {\n    const {layout, route, previousRoute} = change;\n\n    const mPart = layout.part({viewId: this.id});\n    const mView = layout.view({viewId: this.id});\n\n    this.part.set(this._partRegistry.get(mPart.id));\n    this.active.set(mPart.activeViewId === this.id);\n    this.activationInstant.set(mView.activationInstant ?? 0);\n    this.classList.layout = mView.cssClass;\n\n    // Test if a new route has been activated for this view.\n    const routeChanged = route && route.routeConfig !== previousRoute?.routeConfig;\n    if (routeChanged) {\n      this.title = Routing.lookupRouteData(route, WorkbenchRouteData.title) ?? null;\n      this.heading = Routing.lookupRouteData(route, WorkbenchRouteData.heading) ?? null;\n      this.dirty = false;\n      this.classList.route = Routing.lookupRouteData(route, WorkbenchRouteData.cssClass);\n      this.classList.application = [];\n      this.canCloseGuard = undefined;\n    }\n\n    // Test if this view was navigated. Navigation does not necessarily cause the route to change.\n    const navigationChanged = mView.navigation?.id !== this.navigation()?.id;\n    if (navigationChanged) {\n      this.navigation.set(mView.navigation && {\n        id: mView.navigation.id,\n        hint: mView.navigation.hint,\n        data: mView.navigation.data,\n        state: layout.navigationState({outlet: this.id}),\n        path: layout.urlSegments({outlet: this.id}),\n      });\n      this.classList.navigation = mView.navigation?.cssClass;\n    }\n\n    // If this view is inactive, Angular does not check it for changes as it is detached from the Angular component tree.\n    // To complete the initialization of the routed component (to ensure that `ngOnInit` is called), we manually trigger change\n    // detection. We cannot perform change detection right now because the routed component has not been activated/constructed yet.\n    // Use case: Navigating an (existing) inactive view to another route.\n    if (!this.active() && this.slot.portal.constructed() && routeChanged) {\n      this._workbenchRouter.getCurrentNavigationContext().registerPostNavigationAction(() => this.slot.portal.componentRef()!.changeDetectorRef.detectChanges());\n    }\n  }\n\n  public focus(): void {\n    assertNotInReactiveContext(this.focus, 'Call WorkbenchView.focus() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n    this.slot.portal.componentRef()?.instance.focus();\n  }\n\n  /**\n   * Returns the component of this view. Returns `null` if not navigated the view, or before it was activated for the first time.\n   */\n  public getComponent<T = unknown>(): T | null {\n    const outlet = Routing.resolveEffectiveOutletContext(this._rootOutletContexts.getContext(this.id))?.outlet;\n    return outlet?.isActivated ? outlet.component as T : null;\n  }\n\n  /** @inheritDoc */\n  public get title(): Signal<Translatable | null> {\n    return this._title;\n  }\n\n  /** @inheritDoc */\n  public set title(title: Translatable | null) {\n    untracked(() => this._title.set(title));\n  }\n\n  /** @inheritDoc */\n  public get heading(): Signal<Translatable | null> {\n    return this._heading;\n  }\n\n  /** @inheritDoc */\n  public set heading(heading: Translatable | null) {\n    untracked(() => this._heading.set(heading));\n  }\n\n  /** @inheritDoc */\n  public get dirty(): Signal<boolean> {\n    return this._dirty;\n  }\n\n  /** @inheritDoc */\n  public set dirty(dirty: boolean) {\n    untracked(() => this._dirty.set(dirty));\n  }\n\n  /** @inheritDoc */\n  public get scrolledIntoView(): Signal<boolean> {\n    return this._scrolledIntoView;\n  }\n\n  public set scrolledIntoView(scrolledIntoView: boolean) {\n    this._scrolledIntoView.set(scrolledIntoView);\n  }\n\n  /** @inheritDoc */\n  public set cssClass(cssClass: string | string[]) {\n    untracked(() => this.classList.application = cssClass);\n  }\n\n  /** @inheritDoc */\n  public get cssClass(): Signal<string[]> {\n    return this.classList.application;\n  }\n\n  /** @inheritDoc */\n  public set closable(closable: boolean) {\n    untracked(() => this._closable.set(closable));\n  }\n\n  /** @inheritDoc */\n  public get closable(): Signal<boolean> {\n    return this._closable;\n  }\n\n  /** @inheritDoc */\n  public async activate(options?: {skipLocationChange?: boolean}): Promise<boolean> {\n    assertNotInReactiveContext(this.activate, 'Call WorkbenchView.activate() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    if (this.active() && this.part().active() && this.focused() && this._layout().isLatestActivationInstant(this.activationInstant())) {\n      return true;\n    }\n\n    const skipLocationChange = options?.skipLocationChange ?? this.active();\n    const currentLayout = this._layout();\n    return this._workbenchRouter.navigate(\n      layout => currentLayout === layout ? layout.activateView(this.id, {activatePart: true}) : null, // cancel navigation if the layout has become stale\n      {skipLocationChange},\n    );\n  }\n\n  /** @inheritDoc */\n  public close(target?: 'self' | 'all-views' | 'other-views' | 'views-to-the-right' | 'views-to-the-left'): Promise<boolean> {\n    assertNotInReactiveContext(this.close, 'Call WorkbenchView.close() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n    switch (target ?? 'self') {\n      case 'self': {\n        return this._workbenchService.closeViews(this.id);\n      }\n      case 'all-views': {\n        return this._workbenchService.closeViews(...this.part().views().map(view => view.id));\n      }\n      case 'other-views': {\n        return this._workbenchService.closeViews(...this.part().views().filter(view => view !== this).map(view => view.id));\n      }\n      case 'views-to-the-right': {\n        const views = this.part().views();\n        return this._workbenchService.closeViews(...views.slice(views.indexOf(this) + 1).map(view => view.id));\n      }\n      case 'views-to-the-left': {\n        const views = this.part().views();\n        return this._workbenchService.closeViews(...views.slice(0, views.indexOf(this)).map(view => view.id));\n      }\n      default: {\n        return Promise.resolve(false);\n      }\n    }\n  }\n\n  /** @inheritDoc */\n  public move(target: 'new-window'): void;\n  public move(partId: string, options?: {region?: 'north' | 'south' | 'west' | 'east'; workbenchId?: string}): void;\n  public move(target: 'new-window' | string, options?: {region?: 'north' | 'south' | 'west' | 'east'; workbenchId?: string}): void {\n    assertNotInReactiveContext(this.move, 'Call WorkbenchView.move() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n    const source: ViewMoveEventSource = {\n      workbenchId: this._workbenchId,\n      partId: this.part().id,\n      viewId: this.id,\n      alternativeViewId: this.alternativeId,\n      navigation: this.navigation() && {\n        path: this.navigation()!.path,\n        hint: this.navigation()!.hint,\n        data: this.navigation()!.data,\n      },\n      classList: this.classList.asMap(),\n    };\n\n    if (target === 'new-window') {\n      this._viewDragService.dispatchViewMoveEvent({source, target: {workbenchId: 'new-window'}});\n    }\n    else {\n      this._viewDragService.dispatchViewMoveEvent({\n        source,\n        target: {\n          elementId: target,\n          region: options?.region,\n          workbenchId: options?.workbenchId ?? this._workbenchId,\n        },\n      });\n    }\n  }\n\n  /** @inheritDoc */\n  public canClose(canClose: CanCloseFn): CanCloseRef {\n    const canCloseGuard = this.canCloseGuard = async (): Promise<boolean> => {\n      try {\n        const close = runInInjectionContext(this.slot.portal.componentRef()!.injector, canClose);\n        return await firstValueFrom(Observables.coerce(close), {defaultValue: true});\n      }\n      catch (error) {\n        this._logger.error(`Unhandled error while invoking 'CanClose' function of view '${this.id}'.`, error);\n        return true;\n      }\n    };\n\n    return {\n      dispose: () => {\n        if (canCloseGuard === this.canCloseGuard) {\n          this.canCloseGuard = undefined;\n        }\n      },\n    };\n  }\n\n  public get destroyed(): Signal<boolean> {\n    return this.slot.portal.destroyed;\n  }\n\n  /**\n   * Computes menu items matching this view.\n   */\n  private computeMenuItems(): Signal<WorkbenchMenuItem[]> {\n    const injector = inject(Injector);\n\n    // Use a differ to avoid re-creating every menu item on registration or change.\n    const differ = inject(IterableDiffers).find([]).create<WorkbenchViewMenuItemFn>();\n    const menuItemRegistry = inject(WorkbenchViewMenuItemRegistry);\n    const menuItems = new Map<WorkbenchViewMenuItemFn, Signal<WorkbenchMenuItem | null>>();\n\n    return computed(() => {\n      const changes = differ.diff(menuItemRegistry.elements());\n      changes?.forEachAddedItem(({item: fn}) => menuItems.set(fn, computed(() => runInInjectionContext(constructInjector(this, this.part()), () => fn(this)))));\n      changes?.forEachRemovedItem(({item: fn}) => menuItems.delete(fn));\n      return Array.from(menuItems.values()).map(menuItem => menuItem()).filter(menuItem => !!menuItem);\n    }, {equal: (a, b) => Objects.isEqual(a, b)});\n\n    function constructInjector(view: ɵWorkbenchView, part: ɵWorkbenchPart): Injector {\n      return Injector.create({\n        parent: injector,\n        providers: [\n          {provide: ɵWorkbenchView, useValue: view},\n          {provide: WorkbenchView, useExisting: ɵWorkbenchView},\n          {provide: ɵWorkbenchPart, useValue: part},\n          {provide: WorkbenchPart, useExisting: ɵWorkbenchPart},\n        ],\n      });\n    }\n  }\n\n  /**\n   * Sets up automatic synchronization of {@link WorkbenchView} on every layout change.\n   *\n   * If the operation is cancelled (e.g., due to a navigation failure), it reverts the changes.\n   */\n  private installModelUpdater(): void {\n    Routing.activatedRoute$(this.id, {emitOn: 'always'})\n      .pipe(takeUntilDestroyed())\n      .subscribe(([previousRoute, route]: [ActivatedRouteSnapshot | null, ActivatedRouteSnapshot]) => {\n        const navigationContext = this._workbenchRouter.getCurrentNavigationContext();\n        const {layout, previousLayout, layoutDiff} = navigationContext;\n\n        if (layoutDiff.removedViews.includes(this.id)) {\n          return;\n        }\n\n        this.onLayoutChange({layout, route, previousRoute});\n\n        // Revert change in case the navigation fails.\n        if (previousLayout?.hasView(this.id)) {\n          navigationContext.registerUndoAction(() => this.onLayoutChange({layout: previousLayout, route: previousRoute!, previousRoute: route}));\n        }\n      });\n  }\n\n  /**\n   * Focuses this view when activated, either by focus or routing.\n   */\n  private activateOnFocus(): void {\n    effect(() => {\n      if (this.focused()) {\n        untracked(() => void this.activate());\n      }\n    });\n  }\n\n  /**\n   * Focuses this view when activated, either by focus or routing.\n   */\n  private focusOnActivate(): void {\n    const dialogRegistry = inject(WorkbenchDialogRegistry);\n    const popupRegistry = inject(WorkbenchPopupRegistry);\n\n    afterRenderEffect(() => {\n      const activationInstant = this.activationInstant();\n\n      // Request focus only once attached to the DOM.\n      if (!this.slot.portal.attached()) {\n        return;\n      }\n\n      untracked(() => {\n        // Do not request focus if no interaction has occurred yet.\n        if (!activationInstant) {\n          return;\n        }\n\n        // Do not request focus if already focused.\n        if (this.focused()) {\n          return;\n        }\n\n        // Do not request focus if the part is inactive, such as closed activities.\n        if (!this.part().active()) {\n          return;\n        }\n\n        // Do not request focus if the view is blocked by a dialog.\n        if (dialogRegistry.elements().some(dialog => !dialog.invocationContext || dialog.invocationContext.elementId === this.id)) {\n          return;\n        }\n\n        // Do not request focus if a popup is opened within this view.\n        if (popupRegistry.elements().some(popup => popup.invocationContext?.elementId === this.id)) {\n          return;\n        }\n\n        // Do not request focus if not the most recently interacted element, avoiding stale focus requests when switching perspectives.\n        if (!this._layout().isLatestActivationInstant(activationInstant) && !this._layout().isLatestActivationInstant(this.part().activationInstant())) {\n          return;\n        }\n\n        this.focus();\n      });\n    });\n  }\n\n  public destroy(): void {\n    this.injector.destroy();\n  }\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * Formats given keyboard accelerator for display to the user.\n */\n@Pipe({name: 'wbFormatAccelerator'})\nexport class WbFormatAcceleratorPipe implements PipeTransform {\n\n  public transform(accelerator: string[] | null | undefined): string {\n    if (!accelerator || accelerator.length === 0) {\n      return '';\n    }\n\n    return accelerator\n      .map(key => key[0]!.toUpperCase() + key.substring(1).toLowerCase())\n      .join('+');\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, inject, Injector, input, runInInjectionContext, TemplateRef} from '@angular/core';\nimport {WorkbenchMenuItem} from '../../../workbench.model';\nimport {WORKBENCH_ELEMENT} from '../../../workbench-element-references';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {NgComponentOutlet, NgTemplateOutlet} from '@angular/common';\nimport {InstanceofPipe} from '../../../common/instanceof.pipe';\nimport {ɵWorkbenchView} from '../../../view/ɵworkbench-view.model';\nimport {WorkbenchView} from '../../../view/workbench-view.model';\n\n@Component({\n  selector: 'wb-menu-item',\n  templateUrl: './menu-item.component.html',\n  styleUrl: './menu-item.component.scss',\n  imports: [\n    NgTemplateOutlet,\n    NgComponentOutlet,\n    InstanceofPipe,\n  ],\n})\nexport class MenuItemComponent {\n\n  public readonly menuItem = input.required({transform: (menuItem: WorkbenchMenuItem) => runInInjectionContext(this._injector, () => transform(menuItem))});\n\n  private readonly _injector = inject(Injector);\n\n  protected readonly TemplateMenuItem = TemplateMenuItem;\n  protected readonly ComponentMenuItem = ComponentMenuItem;\n}\n\n/**\n * Transforms a {@link WorkbenchMenuItem} into a {@link ComponentMenuItem} or {@link TemplateMenuItem}.\n */\nfunction transform(menuItem: WorkbenchMenuItem): ComponentMenuItem | TemplateMenuItem {\n  const view = inject(ɵWorkbenchView);\n  const injector = Injector.create({\n    parent: menuItem.injector ?? inject(Injector),\n    providers: [\n      {provide: ɵWorkbenchView, useValue: view},\n      {provide: WorkbenchView, useExisting: ɵWorkbenchView},\n      {provide: WORKBENCH_ELEMENT, useExisting: ɵWorkbenchView},\n    ],\n  });\n\n  if (menuItem.content instanceof TemplateRef) {\n    return new TemplateMenuItem(menuItem.content, {$implicit: view, ...menuItem.inputs}, injector);\n  }\n  else {\n    return new ComponentMenuItem(menuItem.content, menuItem.inputs, injector);\n  }\n}\n\n/**\n * Represents a menu item with a component.\n */\nclass ComponentMenuItem {\n\n  constructor(public component: ComponentType<unknown>,\n              public inputs: {[name: string]: unknown} | undefined,\n              public injector: Injector) {\n  }\n}\n\n/**\n * Represents a menu item with a template.\n */\nexport class TemplateMenuItem {\n\n  constructor(public template: TemplateRef<unknown>,\n              public context: {[name: string]: unknown},\n              public injector: Injector) {\n  }\n}\n","@if (menuItem() | wbInstanceof:TemplateMenuItem; as menuItem) {\n  <ng-container *ngTemplateOutlet=\"menuItem.template; context: menuItem.context; injector: menuItem.injector\"/>\n}\n@if (menuItem() | wbInstanceof:ComponentMenuItem; as menuItem) {\n  <ng-container *ngComponentOutlet=\"menuItem.component; inputs: menuItem.inputs; injector: menuItem.injector\"/>\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, HostBinding, HostListener, inject, Injector, runInInjectionContext, Signal} from '@angular/core';\nimport {OverlayRef} from '@angular/cdk/overlay';\nimport {WorkbenchMenuItem} from '../../workbench.model';\nimport {ɵWorkbenchView} from '../../view/ɵworkbench-view.model';\nimport {KeyValuePipe, NgClass} from '@angular/common';\nimport {WbFormatAcceleratorPipe} from './accelerator-format.pipe';\nimport {ViewId} from '../../workbench.identifiers';\nimport {Maps} from '@scion/toolkit/util';\nimport {MenuItemComponent} from './menu-item/menu-item.component';\n\n/**\n * Renders the menu items of a {@link WorkbenchView} grouped by their menu item group.\n */\n@Component({\n  selector: 'wb-view-menu',\n  templateUrl: './view-menu.component.html',\n  styleUrls: ['./view-menu.component.scss'],\n  imports: [\n    NgClass,\n    KeyValuePipe,\n    WbFormatAcceleratorPipe,\n    MenuItemComponent,\n  ],\n})\nexport class ViewMenuComponent {\n\n  private readonly _overlayRef = inject(OverlayRef);\n  private readonly _view = inject(ɵWorkbenchView);\n  private readonly _injector = inject(Injector);\n\n  protected readonly menuItemGroups: Signal<Map<string, WorkbenchMenuItem[]>>;\n\n  constructor() {\n    this.menuItemGroups = this.groupMenuItems();\n  }\n\n  protected onMenuItemClick(menuItem: WorkbenchMenuItem): void {\n    if (menuItem.disabled) {\n      return;\n    }\n    runInInjectionContext(this._injector, () => menuItem.onAction());\n    this._overlayRef.dispose();\n  }\n\n  @HostBinding('attr.data-viewid')\n  protected get viewId(): ViewId {\n    return this._view.id;\n  }\n\n  @HostListener('document:keydown.escape')\n  protected onEscape(): void {\n    this._overlayRef.dispose();\n  }\n\n  @HostListener('mousedown', ['$event'])\n  @HostListener('sci-microfrontend-focusin', ['$event'])\n  protected onHostCloseEvent(event: Event): void {\n    event.stopPropagation(); // Prevent closing this overlay if emitted from a child of this overlay.\n  }\n\n  @HostListener('document:mousedown')\n  @HostListener('document:sci-microfrontend-focusin')\n  protected onDocumentCloseEvent(): void {\n    this._overlayRef.dispose();\n  }\n\n  private groupMenuItems(): Signal<Map<string, WorkbenchMenuItem[]>> {\n    return computed(() => this._view.menuItems().reduce((groups, menuItem) => {\n      return Maps.addListValue(groups, menuItem.group ?? 'default', menuItem);\n    }, new Map<string, WorkbenchMenuItem[]>()));\n  }\n}\n","@for (menuItemGroup of menuItemGroups() | keyvalue; track menuItemGroup; let isLast = $last) {\n  @for (menuItem of menuItemGroup.value; track menuItem) {\n    <button class=\"menu-item\"\n            [ngClass]=\"menuItem.cssClass\"\n            [disabled]=\"menuItem.disabled\"\n            (click)=\"onMenuItemClick(menuItem)\">\n      <wb-menu-item [menuItem]=\"menuItem\"/>\n      <div class=\"accelerator\">{{menuItem.accelerator | wbFormatAccelerator}}</div>\n    </button>\n  }\n  @if (!isLast) {\n    <hr>\n  }\n}\n","import {Component, input} from '@angular/core';\nimport {TextPipe} from '../../../text/text.pipe';\n\n@Component({\n  selector: 'wb-text',\n  template: '{{(text() | wbText)()}}',\n  styleUrl: './text.component.scss',\n  imports: [\n    TextPipe,\n  ],\n})\nexport class TextComponent {\n\n  public readonly text = input.required<string>();\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ApplicationRef, CreateEffectOptions, createEnvironmentInjector, DestroyRef, effect, EffectCleanupRegisterFn, EffectRef, inject, Injector, Signal} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {toObservable, ToObservableOptions} from '@angular/core/rxjs-interop';\n\n/**\n * Registers an effect outside Angular's component context, not disabling the effect if the component is detached from the change detector tree.\n *\n * Unlike component effects, a root effect executes during the change detection of the root component, so it should not rely on component inputs being\n * available in its first execution.\n *\n * Use this type of effect in components that may be detached, such as workbench views, to still execute if detached.\n *\n * The effect's lifecycle is bound to the calling injection context (or passed injector) and will be unregistered when the injector is destroyed.\n *\n * Note that {@link afterRenderEffect} is also a root effect.\n *\n * ## From the Angular Documentation\n * Angular has two different kinds of effect: component effects and root effects. Component effects are created when `effect()` is called from a component,\n * directive, or within a service of a component/directive. Root effects are created when `effect()` is called from outside the component tree, such as in\n * a root service.\n */\nexport function rootEffect(effectFn: (onCleanup: EffectCleanupRegisterFn) => void, options?: CreateEffectOptions): EffectRef {\n  const injector = options?.injector ?? inject(Injector);\n  const rootInjector = injector.get(ApplicationRef).injector;\n\n  const effectRef = effect(effectFn, {\n    ...options,\n    injector: rootInjector,\n    manualCleanup: true,\n  });\n\n  const manualCleanup = options?.manualCleanup ?? false;\n  if (!manualCleanup) {\n    injector.get(DestroyRef).onDestroy(() => effectRef.destroy());\n  }\n\n  return effectRef;\n}\n\n/**\n * Like {@link toObservable}, but uses a root effect to continue emitting even if the \"contextual\" component is detached from the change detector tree.\n *\n * @see rootEffect\n */\nexport function toRootObservable<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T> {\n  const injector = options?.injector ?? inject(Injector);\n  const rootInjector = injector.get(ApplicationRef).injector;\n\n  const observableInjector = createEnvironmentInjector([], rootInjector);\n  injector.get(DestroyRef).onDestroy(() => observableInjector.destroy());\n\n  return toObservable(source, {injector: observableInjector});\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ElementRef, inject, Injectable, Injector, isSignal, NgZone, runInInjectionContext, Signal, untracked} from '@angular/core';\nimport {ConnectedPosition, Overlay, OverlayConfig, OverlayRef} from '@angular/cdk/overlay';\nimport {ComponentPortal} from '@angular/cdk/portal';\nimport {ViewMenuComponent} from './view-menu.component';\nimport {WorkbenchMenuItem} from '../../workbench.model';\nimport {WORKBENCH_ELEMENT} from '../../workbench-element-references';\nimport {WorkbenchViewRegistry} from '../../view/workbench-view.registry';\nimport {fromEvent, Subscription} from 'rxjs';\nimport {MenuItemConfig, WorkbenchConfig} from '../../workbench-config';\nimport {WorkbenchService} from '../../workbench.service';\nimport {subscribeIn} from '@scion/toolkit/operators';\nimport {ViewId} from '../../workbench.identifiers';\nimport {WorkbenchView} from '../../view/workbench-view.model';\nimport {TextComponent} from './text/text.component';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {rootEffect} from '../../common/rxjs-interop.util';\nimport {ɵWorkbenchView} from '../../view/ɵworkbench-view.model';\nimport {WORKBENCH_VIEW_CONTEXT} from '../../view/workbench-view-context.provider';\nimport {Objects} from '@scion/toolkit/util';\n\n/**\n * Shows menu items of a {@link WorkbenchView} in a menu.\n */\n@Injectable({providedIn: 'root'})\nexport class ViewMenuService {\n\n  private static readonly TOP_LEFT: ConnectedPosition = {originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'top'};\n  private static readonly TOP_RIGHT: ConnectedPosition = {originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top'};\n  private static readonly BOTTOM_LEFT: ConnectedPosition = {originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom'};\n  private static readonly BOTTOM_RIGHT: ConnectedPosition = {originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'bottom'};\n\n  private readonly _overlay = inject(Overlay);\n  private readonly _injector = inject(Injector);\n  private readonly _viewRegistry = inject(WorkbenchViewRegistry);\n  private readonly _workbenchService = inject(WorkbenchService);\n  private readonly _workbenchConfig = inject(WorkbenchConfig);\n\n  constructor() {\n    this.registerBuiltInMenuItems();\n  }\n\n  /**\n   * Registers built-in menu items added to the context menu of every view tab.\n   */\n  private registerBuiltInMenuItems(): void {\n    const config = this._workbenchConfig.viewMenuItems ?? {};\n    if (config === false) {\n      return;\n    }\n\n    this.registerCloseMenuItem(config.close ?? {});\n    this.registerCloseOtherTabsMenuItem(config.closeOthers ?? {});\n    this.registerCloseAllTabsMenuItem(config.closeAll ?? {});\n    this.registerCloseRightTabsMenuItem(config.closeToTheRight ?? {});\n    this.registerCloseLeftTabsMenuItem(config.closeToTheLeft ?? {});\n    this.registerMoveRightMenuItem(config.moveRight ?? {});\n    this.registerMoveLeftMenuItem(config.moveLeft ?? {});\n    this.registerMoveUpMenuItem(config.moveUp ?? {});\n    this.registerMoveDownMenuItem(config.moveDown ?? {});\n    this.registerMoveToNewWindowMenuItem(config.moveToNewWindow ?? {});\n  }\n\n  /**\n   * Shows a menu with menu items registered in given {@link WorkbenchView}.\n   *\n   * @see {@link WorkbenchView.registerViewMenuItem}\n   */\n  public async showMenu(location: Point, viewId: ViewId): Promise<boolean> {\n    const view = this._viewRegistry.get(viewId);\n\n    // Do not show the menu if there are no menu items registered.\n    if (!view.menuItems().length) {\n      return false;\n    }\n\n    // Prepare and display the menu overlay.\n    const config = new OverlayConfig({\n      scrollStrategy: this._overlay.scrollStrategies.noop(),\n      disposeOnNavigation: true,\n      positionStrategy: this._overlay.position()\n        .flexibleConnectedTo(location)\n        .withFlexibleDimensions(false)\n        .withPositions([ViewMenuService.TOP_LEFT, ViewMenuService.TOP_RIGHT, ViewMenuService.BOTTOM_LEFT, ViewMenuService.BOTTOM_RIGHT]),\n    });\n\n    const overlayRef = this._overlay.create(config);\n    const injector = Injector.create({\n      parent: this._injector,\n      providers: [\n        {provide: OverlayRef, useValue: overlayRef},\n        {provide: ɵWorkbenchView, useValue: view},\n        {provide: WorkbenchView, useExisting: ɵWorkbenchView},\n        {provide: WORKBENCH_ELEMENT, useExisting: ɵWorkbenchView},\n        this._injector.get(WORKBENCH_VIEW_CONTEXT, [], {optional: true}),\n      ],\n    });\n    overlayRef.attach(new ComponentPortal(ViewMenuComponent, null, injector));\n    return true;\n  }\n\n  /**\n   * Subscribes to keyboard events for menu items of given {@link WorkbenchView} on specified element.\n   *\n   * This method must be passed an injector or called in an injection context. If used in a component, use the component's injector.\n   * Unsubscribes from keyboard events when the injection context is destroyed.\n   */\n  public installMenuAccelerators(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement>>, viewLike: WorkbenchView | Signal<WorkbenchView>, options?: {injector?: Injector}): void {\n    const injector = options?.injector ?? inject(Injector);\n    const zone = injector.get(NgZone);\n\n    // Use root effect to run even if the parent component is detached from change detection (e.g., if the view is not visible).\n    rootEffect(onCleanup => {\n      const element = coerceElement(isSignal(elementLike) ? elementLike() : elementLike);\n      const view = isSignal(viewLike) ? viewLike() : viewLike;\n\n      untracked(() => {\n        const subscription = installMenuAccelerators(element, view);\n        onCleanup(() => subscription.unsubscribe());\n      });\n    }, {injector});\n\n    /**\n     * Subscribes to keyboard events for menu items of given {@link WorkbenchView} on specified element.\n     */\n    function installMenuAccelerators(element: HTMLElement, view: WorkbenchView): Subscription {\n      return fromEvent<KeyboardEvent>(element, 'keydown')\n        .pipe(subscribeIn(fn => zone.runOutsideAngular(fn)))\n        .subscribe(event => {\n          const menuItems = findMatchingMenuItems(view.menuItems(), event);\n          if (!menuItems.length) {\n            return;\n          }\n\n          runInInjectionContext(injector, () => zone.run(() => {\n            menuItems.forEach(menuItem => menuItem.onAction());\n          }));\n\n          event.preventDefault();\n          event.stopPropagation();\n        });\n    }\n\n    /**\n     * Finds menu items that match the given keyboard event.\n     */\n    function findMatchingMenuItems(menuItems: WorkbenchMenuItem[], event: KeyboardEvent): WorkbenchMenuItem[] {\n      const eventKey = (event.key as string | undefined)?.toLowerCase(); // `event.key` can be `undefined`, for example, when selecting an option from an input element's datalist.\n      const eventModifierKeys = getModifierState(event);\n\n      return menuItems\n        .filter(menuItem => !menuItem.disabled)\n        .filter(menuItem => {\n          const accelerator = menuItem.accelerator;\n          if (!accelerator?.length) {\n            return false;\n          }\n\n          const key = accelerator.at(-1)!.toLocaleLowerCase();\n          const modifierKeys = accelerator.slice(0, -1);\n          return key === eventKey && Objects.isEqual(modifierKeys, eventModifierKeys, {ignoreArrayOrder: true});\n        });\n    }\n  }\n\n  private registerCloseMenuItem(config: MenuItemConfig | false): void {\n    if (config) {\n      this._workbenchService.registerViewMenuItem(view => ({\n        content: TextComponent,\n        inputs: {text: '%workbench.close_tab.action'},\n        accelerator: config.accelerator ?? ['ctrl', 'k'],\n        group: config.group ?? 'close',\n        cssClass: config.cssClass ?? 'e2e-close',\n        disabled: !view.isClosable(),\n        onAction: () => void view.close(),\n      }));\n    }\n  }\n\n  private registerCloseOtherTabsMenuItem(config: MenuItemConfig | false): void {\n    if (config) {\n      this._workbenchService.registerViewMenuItem(view => ({\n        content: TextComponent,\n        inputs: {text: '%workbench.close_other_tabs.action'},\n        accelerator: config.accelerator ?? ['ctrl', 'shift', 'k'],\n        group: config.group ?? 'close',\n        cssClass: config.cssClass ?? 'e2e-close-other-tabs',\n        disabled: view.first() && view.last(),\n        onAction: () => void view.close('other-views'),\n      }));\n    }\n  }\n\n  private registerCloseAllTabsMenuItem(config: MenuItemConfig | false): void {\n    if (config) {\n      this._workbenchService.registerViewMenuItem(view => ({\n        content: TextComponent,\n        inputs: {text: '%workbench.close_all_tabs.action'},\n        accelerator: config.accelerator ?? ['ctrl', 'shift', 'alt', 'k'],\n        group: config.group ?? 'close',\n        cssClass: config.cssClass ?? 'e2e-close-all-tabs',\n        onAction: () => void view.close('all-views'),\n      }));\n    }\n  }\n\n  private registerCloseRightTabsMenuItem(config: MenuItemConfig | false): void {\n    if (config) {\n      this._workbenchService.registerViewMenuItem(view => ({\n        content: TextComponent,\n        inputs: {text: '%workbench.close_tabs_to_the_right.action'},\n        group: config.group ?? 'close',\n        cssClass: config.cssClass ?? 'e2e-close-right-tabs',\n        disabled: view.last(),\n        onAction: () => void view.close('views-to-the-right'),\n      }));\n    }\n  }\n\n  private registerCloseLeftTabsMenuItem(config: MenuItemConfig | false): void {\n    if (config) {\n      this._workbenchService.registerViewMenuItem(view => ({\n        content: TextComponent,\n        inputs: {text: '%workbench.close_tabs_to_the_left.action'},\n        group: config.group ?? 'close',\n        cssClass: config.cssClass ?? 'e2e-close-left-tabs',\n        disabled: view.first(),\n        onAction: () => void view.close('views-to-the-left'),\n      }));\n    }\n  }\n\n  private registerMoveRightMenuItem(config: MenuItemConfig | false): void {\n    if (config) {\n      this._workbenchService.registerViewMenuItem(view => ({\n        content: TextComponent,\n        inputs: {text: '%workbench.move_tab_to_the_right.action'},\n        accelerator: ['ctrl', 'alt', 'end'],\n        group: config.group ?? 'move',\n        cssClass: config.cssClass ?? 'e2e-move-right',\n        disabled: view.first() && view.last(),\n        onAction: () => view.move(view.part().id, {region: 'east'}),\n      }));\n    }\n  }\n\n  private registerMoveLeftMenuItem(config: MenuItemConfig | false): void {\n    if (config) {\n      this._workbenchService.registerViewMenuItem(view => ({\n        content: TextComponent,\n        inputs: {text: '%workbench.move_tab_to_the_left.action'},\n        group: config.group ?? 'move',\n        cssClass: config.cssClass ?? 'e2e-move-left',\n        disabled: view.first() && view.last(),\n        onAction: () => view.move(view.part().id, {region: 'west'}),\n      }));\n    }\n  }\n\n  private registerMoveUpMenuItem(config: MenuItemConfig | false): void {\n    if (config) {\n      this._workbenchService.registerViewMenuItem(view => ({\n        content: TextComponent,\n        inputs: {text: '%workbench.move_tab_up.action'},\n        group: config.group ?? 'move',\n        cssClass: config.cssClass ?? 'e2e-move-up',\n        disabled: view.first() && view.last(),\n        onAction: () => view.move(view.part().id, {region: 'north'}),\n      }));\n    }\n  }\n\n  private registerMoveDownMenuItem(config: MenuItemConfig | false): void {\n    if (config) {\n      this._workbenchService.registerViewMenuItem(view => ({\n        content: TextComponent,\n        inputs: {text: '%workbench.move_tab_down.action'},\n        group: config.group ?? 'move',\n        cssClass: config.cssClass ?? 'e2e-move-down',\n        disabled: view.first() && view.last(),\n        onAction: () => view.move(view.part().id, {region: 'south'}),\n      }));\n    }\n  }\n\n  private registerMoveToNewWindowMenuItem(config: MenuItemConfig | false): void {\n    if (config) {\n      this._workbenchService.registerViewMenuItem(view => {\n        if (view.part().peripheral()) {\n          return null;\n        }\n\n        return {\n          content: TextComponent,\n          inputs: {text: '%workbench.move_tab_to_new_window.action'},\n          group: config.group ?? 'open',\n          cssClass: config.cssClass ?? 'e2e-move-to-new-window',\n          onAction: () => view.move('new-window'),\n        };\n      });\n    }\n  }\n}\n\n/**\n * Returns the pressed modifier keys (ctrl, shift, alt, meta) as array items.\n */\nfunction getModifierState(event: KeyboardEvent): string[] {\n  const modifierState: string[] = [];\n  if (event.ctrlKey) {\n    modifierState.push('ctrl');\n  }\n  if (event.shiftKey) {\n    modifierState.push('shift');\n  }\n  if (event.altKey) {\n    modifierState.push('alt');\n  }\n  if (event.metaKey) {\n    modifierState.push('meta');\n  }\n  return modifierState;\n}\n\nexport interface Point {\n  x: number;\n  y: number;\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, ElementRef, inject, Injector, input, Signal} from '@angular/core';\nimport {WorkbenchViewRegistry} from '../../view/workbench-view.registry';\nimport {VIEW_DRAG_TRANSFER_TYPE, ViewDragService} from '../../view-dnd/view-drag.service';\nimport {createElement} from '../../common/dom.util';\nimport {CdkPortalOutlet, ComponentPortal} from '@angular/cdk/portal';\nimport {VIEW_TAB_RENDERING_CONTEXT, ViewTabRenderingContext} from '../../workbench.constants';\nimport {WorkbenchConfig} from '../../workbench-config';\nimport {ViewTabContentComponent} from '../view-tab-content/view-tab-content.component';\nimport {ViewMenuService} from '../view-context-menu/view-menu.service';\nimport {ViewId, WORKBENCH_ID} from '../../workbench.identifiers';\nimport {WorkbenchView} from '../../view/workbench-view.model';\nimport {boundingClientRect} from '@scion/components/dimension';\nimport {UUID} from '@scion/toolkit/uuid';\nimport {TextPipe} from '../../text/text.pipe';\nimport {IconComponent} from '../../icon/icon.component';\nimport {WorkbenchLayoutService} from '../../layout/workbench-layout.service';\n\n/**\n * IMPORTANT: HTML and CSS also used by {@link ViewTabDragImageComponent}.\n *\n * @see ViewTabDragImageComponent\n */\n@Component({\n  selector: 'wb-view-tab',\n  templateUrl: './view-tab.component.html',\n  styleUrls: ['./view-tab.component.scss'],\n  imports: [\n    CdkPortalOutlet,\n    TextPipe,\n    IconComponent,\n  ],\n  host: {\n    '[attr.data-viewid]': 'view().id',\n    '[attr.data-active]': `view().active() ? '' : null`,\n    '[attr.data-dirty]': `view().dirty() ? '' : null`,\n    '[attr.data-focus-within-view]': `view().focused() ? '' : null`,\n    '[attr.draggable]': 'true',\n    '[attr.tabindex]': '-1', // make the view focusable to install view menu accelerators\n    '[class.view-drag]': 'viewDragService.dragging()',\n    '[class]': 'view().classList.asList()',\n    '[style.--sci-workbench-tab-title-offset-right]': 'viewTitleOffsetRight()',\n    '(click)': 'onClick()',\n    '(auxclick)': 'onAuxClick($event)',\n    '(contextmenu)': 'onContextmenu($event)',\n    '(dragstart)': 'onDragStart($event)',\n    '(dragend)': 'onDragEnd()',\n  },\n})\nexport class ViewTabComponent {\n\n  private readonly _workbenchId = inject(WORKBENCH_ID);\n  private readonly _workbenchConfig = inject(WorkbenchConfig);\n  private readonly _viewRegistry = inject(WorkbenchViewRegistry);\n  private readonly _viewMenuService = inject(ViewMenuService);\n  private readonly _layout = inject(WorkbenchLayoutService).layout;\n  private readonly _injector = inject(Injector);\n\n  public readonly host = inject(ElementRef).nativeElement as HTMLElement;\n  public readonly view = input.required({alias: 'viewId', transform: (viewId: ViewId) => this._viewRegistry.get(viewId)});\n  public readonly boundingClientRect = boundingClientRect(inject(ElementRef));\n\n  protected readonly viewTabContentPortal: Signal<ComponentPortal<unknown>>;\n  protected readonly viewDragService = inject(ViewDragService);\n  protected readonly viewTitleOffsetRight = computed(() => this.view().closable() ? '1.5rem' : undefined); // offset for the title to not overlap the close button\n\n  constructor() {\n    this.installMenuAccelerators();\n    this.viewTabContentPortal = this.createViewTabContentPortal();\n  }\n\n  protected onClick(): void {\n    void this.view().activate();\n  }\n\n  protected onClose(event: MouseEvent): void {\n    event.stopPropagation(); // prevent the view from being activated\n    this.closeView(event);\n  }\n\n  protected onAuxClick(event: MouseEvent): void {\n    if (event.button === 1) { // primary aux button\n      event.preventDefault(); // prevent user-agent default action\n      this.closeView(event);\n    }\n  }\n\n  protected onContextmenu(event: MouseEvent): void {\n    void this._viewMenuService.showMenu({x: event.clientX, y: event.clientY}, this.view().id);\n    event.stopPropagation();\n    event.preventDefault();\n  }\n\n  protected onDragStart(event: DragEvent): void {\n    if (!event.dataTransfer) {\n      return;\n    }\n\n    const view = this.view();\n    event.dataTransfer.effectAllowed = 'move';\n    event.dataTransfer.setData(VIEW_DRAG_TRANSFER_TYPE, view.id);\n    // Use an invisible <div> as the native drag image because the workbench renders the drag image in {@link ViewTabDragImageRenderer}.\n    event.dataTransfer.setDragImage(createElement('div', {style: {display: 'none'}}), 0, 0);\n\n    this.viewDragService.setViewDragData({\n      uid: UUID.randomUUID(),\n      viewId: view.id,\n      viewTitle: view.title(),\n      viewHeading: view.heading(),\n      viewDirty: view.dirty(),\n      viewClosable: view.isClosable() || (view.closable() ? 'disabled' : false),\n      navigation: view.navigation() && {\n        path: view.navigation()!.path,\n        hint: view.navigation()!.hint,\n        data: view.navigation()!.data,\n      },\n      alternativeViewId: view.alternativeId,\n      partId: view.part().id,\n      viewTabPointerOffsetX: event.offsetX,\n      viewTabPointerOffsetY: event.offsetY,\n      viewTabWidth: this.host.getBoundingClientRect().width,\n      viewTabHeight: this.host.getBoundingClientRect().height,\n      viewTitleOffsetRight: this.viewTitleOffsetRight(),\n      workbenchId: this._workbenchId,\n      classList: view.classList.asMap(),\n      activityId: this._layout().activity({viewId: view.id}, {orElse: null})?.id,\n    });\n\n    void view.activate();\n  }\n\n  protected onDragEnd(): void {\n    this.viewDragService.unsetViewDragData();\n  }\n\n  /**\n   * Closes the current view or other views if the 'Alt' key is pressed.\n   */\n  private closeView(event: MouseEvent): void {\n    if (event.altKey) {\n      void this.view().close('other-views');\n    }\n    else {\n      void this.view().close();\n    }\n  }\n\n  private installMenuAccelerators(): void {\n    this._viewMenuService.installMenuAccelerators(this.host, this.view);\n  }\n\n  private createViewTabContentPortal(): Signal<ComponentPortal<unknown>> {\n    return computed(() => {\n      const componentType = this._workbenchConfig.viewTabComponent ?? ViewTabContentComponent;\n      return new ComponentPortal(componentType, null, Injector.create({\n        parent: this._injector,\n        providers: [\n          {provide: WorkbenchView, useValue: this.view()},\n          {provide: VIEW_TAB_RENDERING_CONTEXT, useValue: 'tab' satisfies ViewTabRenderingContext},\n        ],\n      }));\n    });\n  }\n}\n","<!-- IMPORTANT: THIS HTML FILE IS ALSO USED BY `ViewTabDragImageComponent` -->\n\n@if (view().active()) {\n  <div class=\"corner-radius start\">\n    <div class=\"circle\"></div>\n  </div>\n}\n\n<div class=\"content\">\n  <ng-container *cdkPortalOutlet=\"viewTabContentPortal()\"/>\n</div>\n\n@if (view().active()) {\n  <div class=\"corner-radius end\">\n    <div class=\"circle\"></div>\n  </div>\n}\n\n@if (view().closable()) {\n  <button (click)=\"onClose($event)\"\n          [title]=\"('%workbench.close_tab.tooltip;close_others_modifier=Alt' | wbText)()\"\n          [disabled]=\"!view().isClosable()\"\n          class=\"close e2e-close\">\n    <wb-icon icon=\"workbench.close\"/>\n  </button>\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, DOCUMENT, inject, Injector, NgZone, signal, Signal, untracked} from '@angular/core';\nimport {ViewDragService} from '../../view-dnd/view-drag.service';\nimport {CdkPortalOutlet, ComponentPortal} from '@angular/cdk/portal';\nimport {WorkbenchConfig} from '../../workbench-config';\nimport {ViewTabContentComponent} from '../view-tab-content/view-tab-content.component';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {WorkbenchView} from '../../view/workbench-view.model';\nimport {subscribeIn} from '@scion/toolkit/operators';\nimport {distinctUntilChanged, map} from 'rxjs/operators';\nimport {WorkbenchPartRegistry} from '../workbench-part.registry';\nimport {IconComponent} from '../../icon/icon.component';\nimport {TextPipe} from '../../text/text.pipe';\nimport {PartId} from '../../workbench.identifiers';\n\n/**\n * @see ViewTabComponent\n */\n@Component({\n  selector: 'wb-view-tab-drag-image',\n  templateUrl: '../view-tab/view-tab.component.html',\n  styleUrls: [\n    '../view-tab/view-tab.component.scss',\n    './view-tab-drag-image.partial.component.scss',\n  ],\n  imports: [\n    CdkPortalOutlet,\n    TextPipe,\n    IconComponent,\n  ],\n  host: {\n    '[attr.data-viewid]': 'view().id',\n    '[attr.data-active]': `view().active() ? '' : null`,\n    '[class.view-drag]': 'true',\n    '[class.can-drop]': 'canDrop()',\n    '[class.drag-over-tabbar]': 'isDragOverTabbar()',\n    '[class.drag-over-peripheral-tabbar]': 'isDragOverPeripheralTabbar()',\n  },\n})\nexport class ViewTabDragImageComponent {\n\n  protected readonly view = signal(inject(WorkbenchView)).asReadonly();\n  protected readonly viewTabContentPortal = signal(createViewTabContentPortal()).asReadonly();\n\n  /**\n   * Indicates if dragging this view tab over a tabbar.\n   */\n  protected readonly isDragOverTabbar = this.computeDragOverTabbar();\n\n  /**\n   * Indicates if dragging this view tab over a tabbar located in the peripheral area.\n   */\n  protected readonly isDragOverPeripheralTabbar = this.computeDragOverPeripheralTabbar();\n\n  /**\n   * Indicates if dragging this view tab over a valid drop target.\n   */\n  protected readonly canDrop = this.computeCanDrop();\n\n  protected onClose(..._: unknown[]): void {\n    throw Error('[UnsupportedOperationError]');\n  }\n\n  /**\n   * Computes if dragging this view tab over a tabbar.\n   */\n  private computeDragOverTabbar(): Signal<PartId | false> {\n    return toSignal(inject(ViewDragService).tabbarDragOver$, {requireSync: true});\n  }\n\n  /**\n   * Computes if dragging this view tab over a tabbar located in the peripheral area.\n   */\n  private computeDragOverPeripheralTabbar(): Signal<boolean> {\n    const partRegistry = inject(WorkbenchPartRegistry);\n    return computed(() => {\n      const partId = this.isDragOverTabbar();\n      return untracked(() => partId && partRegistry.get(partId).peripheral());\n    });\n  }\n\n  /**\n   * Computes if dragging this view tab over a valid drop target.\n   */\n  private computeCanDrop(): Signal<boolean> {\n    const documentRoot = inject(DOCUMENT).documentElement;\n    const zone = inject(NgZone);\n    const canDrop$ = inject(ViewDragService).viewDrag$(documentRoot, {eventType: 'dragover'})\n      .pipe(\n        subscribeIn(fn => zone.runOutsideAngular(fn)),\n        map(event => event.defaultPrevented),\n        distinctUntilChanged(),\n      );\n    return toSignal(canDrop$, {initialValue: false});\n  }\n}\n\nfunction createViewTabContentPortal(): ComponentPortal<unknown> {\n  const componentType = inject(WorkbenchConfig).viewTabComponent ?? ViewTabContentComponent;\n  return new ComponentPortal(componentType, null, inject(Injector));\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ApplicationRef, computed, inject, Injectable, Injector, NgZone, signal, Signal} from '@angular/core';\nimport {take} from 'rxjs/operators';\nimport {createElement, setStyle} from '../common/dom.util';\nimport {ViewDragData, ViewDragService} from './view-drag.service';\nimport {ComponentPortal, DomPortalOutlet} from '@angular/cdk/portal';\nimport {subscribeIn} from '@scion/toolkit/operators';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ViewTabDragImageComponent} from '../part/view-tab-drag-image/view-tab-drag-image.component';\nimport {CanCloseFn, CanCloseRef, WorkbenchMenuItem} from '../workbench.model';\nimport {ViewId} from '../workbench.identifiers';\nimport {WorkbenchView, WorkbenchViewNavigation} from '../view/workbench-view.model';\nimport {VIEW_TAB_RENDERING_CONTEXT, ViewTabRenderingContext} from '../workbench.constants';\nimport {WorkbenchPart} from '../part/workbench-part.model';\nimport {Disposable} from '../common/disposable';\nimport {throwError} from '../common/throw-error.util';\nimport {UUID} from '@scion/toolkit/uuid';\nimport {Translatable} from '../text/workbench-text-provider.model';\n\nexport type ConstrainFn = (rect: DOMRect) => DOMRect;\n\n/**\n * Renders a drag image during a view drag operation.\n *\n * Unlike when using the native drag image support, it allows controlling the drag image position and its size during the drag operation.\n * For instance, allows snapping the view tab into the view tab bar (drop zone) when being dragged over.\n */\n@Injectable({providedIn: 'root'})\nexport class ViewTabDragImageRenderer {\n\n  private readonly _viewDragService = inject(ViewDragService);\n  private readonly _applicationRef = inject(ApplicationRef);\n  private readonly _injector = inject(Injector);\n  private readonly _zone = inject(NgZone);\n\n  private _viewDragImagePortalOutlet: DomPortalOutlet | null = null;\n  private _constrainDragImageRectFn: ConstrainFn | null = null;\n\n  constructor() {\n    this.installWindowViewDragListener();\n  }\n\n  /**\n   * Allows to constrain the position and dimension of the drag image during a view drag operation.\n   */\n  public setConstrainDragImageRectFn(fn: ConstrainFn): void {\n    this._constrainDragImageRectFn = fn;\n  }\n\n  /**\n   * Unsets the drag image constrain function, if registered.\n   */\n  public unsetConstrainDragImageRectFn(fn: ConstrainFn): void {\n    if (fn === this._constrainDragImageRectFn) {\n      this._constrainDragImageRectFn = null;\n    }\n  }\n\n  private onWindowDragStart(event: DragEvent): void {\n    this.createDragImage(event);\n  }\n\n  private onWindowDragEnd(): void {\n    this.disposeDragImage();\n  }\n\n  /**\n   * Method invoked when dragging a view into the current window. It is invoked outside the Angular zone.\n   *\n   * If the user starts the drag operation in the current window, this method is invoked immediately,\n   * or when dragging the view tab into this window if started the drag operation in another window.\n   */\n  private onWindowDragEnter(event: DragEvent): void {\n    this.createDragImage(event);\n  }\n\n  /**\n   * Method invoked while dragging a view over the current window. It is invoked outside the Angular zone.\n   */\n  private onWindowDragOver(event: DragEvent): void {\n    const dragPosition = this.calculateDragImageRect(this._viewDragService.viewDragData()!, event);\n\n    // update the drag image position\n    setStyle(this._viewDragImagePortalOutlet!.outletElement as HTMLElement, {\n      left: `${dragPosition.x}px`,\n      top: `${dragPosition.y}px`,\n      height: `${dragPosition.height}px`,\n    });\n  }\n\n  /**\n   * Method invoked when the drag operation ends for the current window, which is when the user drags the view tab outside of\n   * the current window or when the user cancels the drag operation (e.g., by pressing the escape key).\n   */\n  private onWindowDragLeave(): void {\n    this.disposeDragImage();\n  }\n\n  /**\n   * Method invoked when the drag operation ends for the current window which is when the user drops the view.\n   */\n  private onWindowDrop(): void {\n    // Wait for the zone to stabilize before disposing the tab drag image. Otherwise, the tabbar would flicker\n    // because the tab has not yet been rendered at its new position.\n    this._zone.onStable\n      .pipe(take(1))\n      .subscribe(() => {\n        this.disposeDragImage();\n      });\n  }\n\n  private createDragImage(event: DragEvent): void {\n    if (this._viewDragImagePortalOutlet) {\n      return;\n    }\n\n    const dragData = this._viewDragService.viewDragData()!;\n    const dragPosition = this.calculateDragImageRect(dragData, event);\n\n    // create the drag image\n    const outletElement = createElement('div', {\n      parent: document.body,\n      cssClass: 'wb-view-tab-drag-image',\n      style: {\n        left: `${dragPosition.x}px`,\n        top: `${dragPosition.y}px`,\n        width: `${dragPosition.width}px`,\n        height: `${dragPosition.height}px`,\n        '--sci-workbench-tab-title-offset-right': dragData.viewTitleOffsetRight,\n      },\n    });\n    this._viewDragImagePortalOutlet = new DomPortalOutlet(outletElement, this._applicationRef, this._injector);\n    const componentRef = this._viewDragImagePortalOutlet.attachComponentPortal(new ComponentPortal(ViewTabDragImageComponent, null, Injector.create({\n      parent: this._injector,\n      providers: [\n        {provide: WorkbenchView, useValue: new DragImageWorkbenchView(dragData)},\n        {provide: VIEW_TAB_RENDERING_CONTEXT, useValue: 'drag-image' satisfies ViewTabRenderingContext},\n      ],\n    })));\n    // Detect for changes because constructed outside of Angular.\n    componentRef.changeDetectorRef.detectChanges();\n  }\n\n  private disposeDragImage(): void {\n    this._viewDragImagePortalOutlet?.dispose();\n    this._viewDragImagePortalOutlet = null;\n  }\n\n  /**\n   * Calculates client position and dimension for the drag image, accounting for any constraints.\n   */\n  public calculateDragImageRect(dragData: ViewDragData, event: DragEvent): DOMRect {\n    const rect = new DOMRect(\n      event.clientX - dragData.viewTabPointerOffsetX,\n      event.clientY - dragData.viewTabPointerOffsetY,\n      dragData.viewTabWidth,\n      dragData.viewTabHeight,\n    );\n    return this._constrainDragImageRectFn ? this._constrainDragImageRectFn(rect) : rect;\n  }\n\n  private installWindowViewDragListener(): void {\n    this._viewDragService.viewDrag$(window)\n      .pipe(\n        subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n        takeUntilDestroyed(),\n      )\n      .subscribe((event: DragEvent) => {\n        switch (event.type) {\n          case 'dragstart':\n            this.onWindowDragStart(event);\n            break;\n          case 'dragenter':\n            this.onWindowDragEnter(event);\n            break;\n          case 'dragover':\n            this.onWindowDragOver(event);\n            break;\n          case 'dragleave':\n            this.onWindowDragLeave();\n            break;\n          case 'drop':\n            this.onWindowDrop();\n            break;\n          case 'dragend':\n            this.onWindowDragEnd();\n            break;\n        }\n      });\n  }\n}\n\nclass DragImageWorkbenchView implements WorkbenchView {\n\n  public readonly id: ViewId;\n  public readonly alternativeId: string | undefined;\n  public readonly navigation: Signal<WorkbenchViewNavigation | undefined>;\n  public readonly part: Signal<WorkbenchPart>;\n  public readonly title: Signal<Translatable | null>;\n  public readonly heading: Signal<Translatable | null>;\n  public readonly dirty: Signal<boolean>;\n  public readonly closable: Signal<boolean>;\n  public readonly destroyed = false;\n  public readonly active = signal(true).asReadonly();\n  public readonly focused = signal(true).asReadonly();\n  public readonly blocked = false;\n  public readonly cssClass = signal([]).asReadonly();\n  public readonly first = signal(true).asReadonly();\n  public readonly last = signal(true).asReadonly();\n  public readonly position = signal(0).asReadonly();\n  public readonly scrolledIntoView = signal(true).asReadonly();\n  public readonly menuItems = signal([]);\n  public readonly isClosable: Signal<boolean>;\n  public readonly activationInstant = signal(0);\n  public readonly bounds = signal(undefined);\n\n  constructor(dragData: ViewDragData) {\n    this.id = dragData.viewId;\n    this.alternativeId = dragData.alternativeViewId;\n    this.part = computed(() => throwError('UnsupportedOperationError'));\n    this.navigation = signal(dragData.navigation && {...dragData.navigation, id: UUID.randomUUID()});\n    this.title = signal(dragData.viewTitle).asReadonly();\n    this.heading = signal(dragData.viewHeading).asReadonly();\n    this.dirty = signal(dragData.viewDirty).asReadonly();\n    this.closable = signal(dragData.viewClosable !== false).asReadonly();\n    this.isClosable = signal(dragData.viewClosable === true).asReadonly();\n  }\n\n  public close(): Promise<boolean> {\n    throw Error('[UnsupportedOperationError]');\n  }\n\n  public move(target: 'new-window' | string, options?: {region?: 'north' | 'south' | 'west' | 'east'; workbenchId?: string}): void {\n    throw Error('[UnsupportedOperationError]');\n  }\n\n  public registerMenuItem(menuItem: WorkbenchMenuItem): Disposable {\n    throw Error('[UnsupportedOperationError]');\n  }\n\n  public activate(): Promise<boolean> {\n    throw Error('[UnsupportedOperationError]');\n  }\n\n  public canClose(canClose: CanCloseFn): CanCloseRef {\n    throw Error('[UnsupportedOperationError]');\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {afterRenderEffect, Component, computed, effect, ElementRef, inject, input, NgZone, OnDestroy, signal, untracked, viewChild, viewChildren} from '@angular/core';\nimport {ViewTabComponent} from '../view-tab/view-tab.component';\nimport {map, mergeMap, takeUntil} from 'rxjs/operators';\nimport {from, fromEvent, merge, Observable, OperatorFunction, Subject} from 'rxjs';\nimport {ConstrainFn, ViewTabDragImageRenderer} from '../../view-dnd/view-tab-drag-image-renderer.service';\nimport {ViewDragData, ViewDragService, ViewMoveEvent} from '../../view-dnd/view-drag.service';\nimport {getCssTranslation, setCssClass, setCssVariable, unsetCssClass, unsetCssVariable} from '../../common/dom.util';\nimport {ɵWorkbenchPart} from '../ɵworkbench-part.model';\nimport {filterArray, subscribeIn} from '@scion/toolkit/operators';\nimport {SciViewportComponent} from '@scion/components/viewport';\nimport {ɵWorkbenchRouter} from '../../routing/ɵworkbench-router.service';\nimport {boundingClientRect, dimension} from '@scion/components/dimension';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {WORKBENCH_ID} from '../../workbench.identifiers';\nimport {clamp} from '../../common/math.util';\nimport {PART_BAR_ELEMENT} from '../part-bar/part-bar.component';\n\n/**\n * Renders view tabs of a {@link WorkbenchPart}.\n *\n * Tabs are added to a viewport, which the user can scroll if not enough space. The viewport grows with its tabs,\n * allowing actions to be placed directly after the last tab or on the right side.\n *\n * ## Drag and Drop\n * This component subscribes to drag events to visualize tabs during a drag operation. The drag operation is initiated in {@link ViewTabComponent}.\n *\n * We use native drag and drop to support dragging views to other windows.\n *\n * Following events are triggered:\n * - dragstart: when start dragging a tab (only received in the tabbar where the drag operation has started)\n * - dragend:   when end dragging a tab, either via drop or cancel (only received in the tabbar where the drag operation has started)\n * - dragenter: when a tab enters the tabbar\n * - dragover:  when dragging a tab over the tabbar, every few hundred milliseconds\n * - dragleave: when a tab leaves the tabbar\n * - drop:      when the user drops a tab in the tabbar\n *\n * - Note that `dragleave` event is not fired on drop action. Therefore, always handle both events, `dragleave` and `drop` events, respectively.\n *\n * ## Terminology\n * - Drag source: Tab that is being dragged.\n * - Drop target: Tab before which to insert the drag source on drop, or `end` if dropping it after the last tab.\n * - Drag image:  Image for the tab to be dragged. We do not use the native drag image support to control drag image position and size,\n *                e.g., to snap the drag image to the tabbar when dragging near it.\n */\n@Component({\n  selector: 'wb-view-tab-bar',\n  templateUrl: './view-tab-bar.component.html',\n  styleUrls: ['./view-tab-bar.component.scss'],\n  imports: [\n    SciViewportComponent,\n    ViewTabComponent,\n  ],\n})\nexport class ViewTabBarComponent implements OnDestroy {\n\n  /**\n   * Defines the maximum available width for the tab bar, used to constrain the drag image to the tab bar bounds.\n   */\n  public readonly maxWidth = input.required<number>();\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _partBarElement = inject(PART_BAR_ELEMENT);\n  private readonly _viewportChange$ = new Subject<void>();\n  private readonly _workbenchId = inject(WORKBENCH_ID);\n  private readonly _router = inject(ɵWorkbenchRouter);\n  private readonly _viewTabDragImageRenderer = inject(ViewTabDragImageRenderer);\n  private readonly _viewDragService = inject(ViewDragService);\n  private readonly _zone = inject(NgZone);\n  private readonly _viewTabs = viewChildren(ViewTabComponent);\n  private readonly _hostBoundingClientRect = boundingClientRect(inject(ElementRef));\n  private readonly _viewportComponent = viewChild.required(SciViewportComponent);\n  private readonly _viewportComponentElement = viewChild.required(SciViewportComponent, {read: ElementRef<HTMLElement>});\n  private readonly _tabCornerRadiusElement = viewChild.required('tab_corner_radius', {read: ElementRef<HTMLElement>});\n  private readonly _viewportBoundingBox = boundingClientRect(this._viewportComponentElement);\n  private readonly _canDrop = inject(ViewDragService).canDrop(inject(ɵWorkbenchPart));\n\n  /**\n   * Reference to the part.\n   */\n  protected readonly part = inject(ɵWorkbenchPart);\n\n  /**\n   * Reference to the tab before which to insert the drag source on drop, or `end` if dropping it after the last tab.\n   */\n  protected dropTargetViewTab = signal<ViewTabComponent | 'end' | null>(null);\n\n  /**\n   * Reference to the tab where the drag operation was started.\n   * This reference is only set if the drag operation started on a tab of this tabbar.\n   */\n  protected dragSourceViewTab = signal<ViewTabComponent | null>(null);\n\n  /**\n   * Transfer data of the tab being dragged over this tabbar.\n   */\n  private _dragData: ViewDragData | null = null;\n\n  /**\n   * Function for snapping the drag image to the tabbar when dragging near it.\n   */\n  private _constrainFn: ConstrainFn | null = null;\n\n  /**\n   * Signals when unsetting drag state.\n   */\n  private _onUnsetDragState = signal<void>(undefined, {equal: () => false});\n\n  /**\n   * Tabbar indents where to display the rounded bottom corners of the first and last view tab.\n   */\n  private _tabbarIndent = {\n    left: 0,\n    right: 0,\n  };\n\n  constructor() {\n    this.installActiveViewScroller();\n    this.installScrolledIntoViewUpdater();\n    this.installViewDragListener();\n    this.installTabbarIndentSizeTracker();\n    this.installViewportChangeTracker();\n  }\n\n  /**\n   * Method invoked when the user starts dragging a tab of this tabbar, only in the tabbar where the drag started.\n   */\n  private onTabDragStart(): void {\n    // Memoize drag data.\n    this._dragData = this._viewDragService.viewDragData()!;\n\n    // Indicate dragging over this tabbar.\n    this._viewDragService.signalTabbarDragEnter(this.part.id);\n\n    // Snap drag image to tabbar when dragging near it.\n    this._constrainFn = this.createDragImageConstrainFn();\n    this._viewTabDragImageRenderer.setConstrainDragImageRectFn(this._constrainFn);\n\n    // Disable pointer events to not break the drag operation (in Firefox, but not Chrome and Edge).\n    requestAnimationFrame(() => setCssClass(this._host, 'pointer-events-disabled'));\n\n    // Set CSS class to not animate start dragging.\n    setCssClass(this._host, 'on-drag-start');\n    this.onDragAnimationStable(() => unsetCssClass(this._host, 'on-drag-start'));\n\n    // Check if the user continues dragging over this tabbar.\n    // If not, the user has quickly dragged the tab out of the tabbar, so manually call `onTabbarDragEnter` and `onTabbarDragLeave`.\n    fromEvent<DragEvent>(window, 'dragenter', {once: true})\n      .pipe(takeUntil(merge(fromEvent(this._partBarElement, 'dragenter'), fromEvent(this._partBarElement, 'dragend'))))\n      .subscribe(event => {\n        this.onTabbarDragEnter(event);\n        this.onTabbarDragLeave(event);\n      });\n  }\n\n  /**\n   * Method invoked when the user ends dragging a tab of this tabbar, either by drop or cancel, only in the tabbar where the drag started.\n   */\n  private onTabDragEnd(event: DragEvent): void {\n    // Unset drag state only on cancel, not on drop, to prevent tabs from temporarily reverting to their pre-drag state. Drag state is reset in `onTabMoved` after a drop.\n    if (event.dataTransfer!.dropEffect === 'none') {\n      // Reactivate the drag source view on cancel.\n      void this.dragSourceViewTab()?.view().activate({skipLocationChange: true});\n      // Unset drag state.\n      this.unsetDragState();\n    }\n  }\n\n  /**\n   * Method invoked when the layout has changed after a drop. The drop may not be related to a tab of this tabbar.\n   */\n  private onTabMoved(event: ViewMoveEvent): void {\n    // Unset drag state only if no new drag has started since the drop.\n    if (this._dragData?.uid === event.dragData?.uid) {\n      this.unsetDragState();\n    }\n  }\n\n  /**\n   * Method invoked when the user drags a tab into this tabbar.\n   */\n  private onTabbarDragEnter(event: DragEvent): void {\n    if (!this._canDrop()) {\n      return;\n    }\n\n    // Memoize drag data.\n    const dragData = this._dragData = this._viewDragService.viewDragData()!;\n\n    // Indicate dragging over this tabbar.\n    this._viewDragService.signalTabbarDragEnter(this.part.id);\n\n    // Snap drag image to tabbar when dragging near it.\n    this._constrainFn = this.createDragImageConstrainFn();\n    this._viewTabDragImageRenderer.setConstrainDragImageRectFn(this._constrainFn);\n\n    // Set drag source, but only if started the drag operation in this part.\n    // We do not set the drag source in `dragstart` to not break the drag operation (in Chrome and Edge, but not Firefox).\n    if (this._host.classList.contains('on-drag-start')) {\n      this.dragSourceViewTab.set(this._viewTabs().find(viewTab => viewTab.view().id === dragData.viewId) ?? null);\n      setCssVariable(this._host, {'--ɵpart-bar-drag-placeholder-width': `${dragData.viewTabWidth}px`});\n    }\n\n    // Locate the tab the user is dragging over.\n    this.dropTargetViewTab.set(this.computeDropTarget(event));\n\n    // Disable pointer events on the tabbar for a smoother drag and drop experience when quickly swapping tabs.\n    setCssClass(this._host, 'pointer-events-disabled');\n\n    // Set CSS class to animate entering the tabbar.\n    setCssClass(this._host, 'on-drag-enter');\n    this.onDragAnimationStable(() => unsetCssClass(this._host, 'on-drag-enter'));\n\n    // Inject drag source width into CSS.\n    setCssVariable(this._host, {'--ɵpart-bar-drag-source-width': `${dragData.viewTabWidth}px`});\n  }\n\n  /**\n   * Method invoked when the user drags a tab out of this tabbar.\n   */\n  private onTabbarDragLeave(event: DragEvent): void {\n    if (!this._canDrop()) {\n      return;\n    }\n\n    // Set CSS class to animate leaving the tabbar, but not when canceling the drag operation for instant reset.\n    // Pointer coordinates are not set when the drag operation is canceled or when dragging the tab out of the window.\n    if (event.screenX || event.screenY) {\n      setCssClass(this._host, 'on-drag-leave');\n      this.onDragAnimationStable(() => unsetCssClass(this._host, 'on-drag-leave'));\n    }\n\n    // Activate the adjacent tab, only if the drag operation is not canceled.\n    const canceled = !event.x && !event.y && !event.screenX && !event.screenY;\n    if (this.dragSourceViewTab()?.view().active && !canceled) {\n      void this._router.navigate(layout => layout.activateAdjacentView(this.dragSourceViewTab()!.view().id), {skipLocationChange: true});\n    }\n\n    // Clean up drag state.\n    this.unsetDragState({unsetDragSource: false, unsetDragData: false});\n  }\n\n  /**\n   * Method invoked when the user is dragging a tab over this tabbar.\n   */\n  private onTabbarDragOver(event: DragEvent, dragDistance: number, scrollDistance: number): void {\n    NgZone.assertNotInAngularZone();\n\n    if (!this._canDrop()) {\n      return;\n    }\n\n    event.preventDefault(); // allow view drop\n\n    // Locate the tab the user is dragging over.\n    // - Run in animation frame for better performance, most noticeable on lower CPU power.\n    // - Do not wait for the drag animation to complete for a smoother drag and drop experience when quickly moving the tab in the tabbar.\n    requestAnimationFrame(() => {\n      // Skip if the drag operation has ended.\n      if (this._viewDragService.isDragOverTabbar !== this.part.id) {\n        return;\n      }\n\n      // Ignore the drag distance if `drag-enter` animation is in progress to avoid incorrect drop target computation when dragging a tab from the left.\n      if (this._host.classList.contains('on-drag-enter')) {\n        this.dropTargetViewTab.set(this.computeDropTarget(event, 0));\n      }\n      // Compute drop target only when moving the drag pointer to prevent tabs from sliding back and forth (while animation is in progress)\n      else if (dragDistance) {\n        this.dropTargetViewTab.set(this.computeDropTarget(event, dragDistance));\n      }\n      // Compute drop target when scrolling the viewport, i.e., not moving the drag pointer but scrolling the viewport because placed the drag pointer at the viewport edges.\n      else if (scrollDistance) {\n        this.dropTargetViewTab.set(this.computeDropTarget(event, scrollDistance));\n      }\n\n      // Set CSS class to animate dragging over the tabbar.\n      setCssClass(this._host, 'drag-over');\n\n      // Calculate the new size of the drag source placeholder.\n      // The placeholder expands the viewport when dragging a tab to the right, moving part actions along with the dragover event.\n      setCssVariable(this._host, {'--ɵpart-bar-drag-placeholder-width': `${this.calculateDragPlaceholderWidth(event)}px`});\n    });\n  }\n\n  /**\n   * Method invoked when the user drops a tab in this tabbar.\n   */\n  private async onTabbarDrop(): Promise<void> {\n    const dragData = this._dragData!;\n    const dropTargetViewTab = this.dropTargetViewTab()!;\n    const dropPosition = dropTargetViewTab === 'end' ? 'end' : this._viewTabs().indexOf(dropTargetViewTab);\n\n    this._viewDragService.dispatchViewMoveEvent({\n      source: {\n        workbenchId: dragData.workbenchId,\n        partId: dragData.partId,\n        viewId: dragData.viewId,\n        alternativeViewId: dragData.alternativeViewId,\n        navigation: dragData.navigation,\n        classList: dragData.classList,\n      },\n      target: {\n        workbenchId: this._workbenchId,\n        position: dropPosition,\n        elementId: this.part.id,\n      },\n      dragData: dragData,\n    });\n  }\n\n  /**\n   * Locates the tab before which the dragged tab is to be inserted when it is dropped. Dragging beyond the last tab returns `end`.\n   */\n  private computeDropTarget(event: DragEvent, dragDistanceX: number = 0): ViewTabComponent | 'end' {\n    const dragImage = this._viewTabDragImageRenderer.calculateDragImageRect(this._dragData!, event);\n    const viewTabs = this._viewTabs().filter(viewTab => viewTab !== this.dragSourceViewTab());\n\n    for (const viewTab of viewTabs) {\n      const {left, width} = viewTab.boundingClientRect();\n      const viewTabHCenter = left + (width / 2);\n\n      // Moving the pointer to the left.\n      if (dragDistanceX <= 0 && dragImage.left < viewTabHCenter) {\n        return viewTab;\n      }\n      // Moving the pinter to the right.\n      if (dragDistanceX > 0 && dragImage.right < viewTabHCenter) {\n        return viewTab;\n      }\n    }\n    return 'end';\n  }\n\n  /**\n   * Creates the function for snapping the drag image to the tabbar when dragging near it.\n   */\n  private createDragImageConstrainFn(): ConstrainFn {\n    return (dragImage: DOMRect): DOMRect => new DOMRect(\n      clamp(dragImage.x, {\n        min: this._hostBoundingClientRect().left + this._tabbarIndent.left,\n        max: this._hostBoundingClientRect().left + this.maxWidth() - dragImage.width - this._tabbarIndent.right,\n      }),\n      this._viewportBoundingBox().top,\n      dragImage.width,\n      this._viewportBoundingBox().height, // fit into tabbar, e.g., when dragging a tab into a tabbar of a different height\n    );\n  }\n\n  /**\n   * Calculates the width for the drag placeholder.\n   *\n   * The placeholder expands the viewport when dragging a tab to the right, moving part actions along with the dragover event.\n   *\n   * Calculation:\n   * - When dragging over tabs, the width is equal to the width of the drag source.\n   * - When dragging to the right of the last tab, the width of the placeholder is the distance between the last tab and the position of the drag pointer.\n   */\n  private calculateDragPlaceholderWidth(event: DragEvent): number {\n    const viewDragImageRect = this._viewTabDragImageRenderer.calculateDragImageRect(this._dragData!, event);\n    const lastViewTab = this._viewTabs().filter(viewTab => viewTab !== this.dragSourceViewTab()).at(-1);\n    const lastViewTabRight = lastViewTab?.boundingClientRect().right ?? this._hostBoundingClientRect().left + this._tabbarIndent.left;\n    return Math.max(lastViewTabRight + viewDragImageRect.width, viewDragImageRect.right) - lastViewTabRight;\n  }\n\n  /**\n   * Indicates whether CSS animations have finished when dragging a tab over the tabbar.\n   * The animation is considered stable when all tabs have moved to their final position.\n   */\n  private isDragAnimationStable(): boolean {\n    const dropTargetViewTab = this.dropTargetViewTab();\n    if (this._viewDragService.isDragOverTabbar !== this.part.id) {\n      return this._viewTabs().every(viewTab => getCssTranslation(viewTab.host).translateX === 'none');\n    }\n\n    const viewTabs = this._viewTabs().filter(viewTab => viewTab !== this.dragSourceViewTab());\n    const dropTargetIndex = dropTargetViewTab === 'end' ? viewTabs.length : viewTabs.indexOf(dropTargetViewTab!);\n    const dragSourceWidth = this._dragData!.viewTabWidth;\n\n    return viewTabs.every((viewTab, i) => {\n      const viewTabTranslateX = getCssTranslation(viewTab.host).translateX;\n      // Expect tabs preceding the drop target not to be shifted to the right.\n      if (i < dropTargetIndex && viewTabTranslateX !== 'none') {\n        return false;\n      }\n      // Expect drop target and tabs following the drop target to be shifted to the right.\n      if (i >= dropTargetIndex && Math.floor(Number(viewTabTranslateX)) !== Math.floor(dragSourceWidth)) { // compare floored numbers because `translateX` is not precise\n        return false;\n      }\n      return true;\n    });\n  }\n\n  /**\n   * Cleans up the drag state, unsetting drag data and drag source based on provided options.\n   */\n  private unsetDragState(options?: {unsetDragSource?: false; unsetDragData?: false}): void {\n    this.dropTargetViewTab.set(null);\n    this._onUnsetDragState.set();\n    this._viewTabDragImageRenderer.unsetConstrainDragImageRectFn(this._constrainFn!);\n    this._viewDragService.signalTabbarDragLeave(this.part.id);\n    this._constrainFn = null;\n\n    unsetCssClass(this._host, 'drag-over', 'pointer-events-disabled');\n    unsetCssVariable(this._host, '--ɵpart-bar-drag-source-width', '--ɵpart-bar-drag-placeholder-width');\n\n    if (options?.unsetDragSource ?? true) {\n      this.dragSourceViewTab.set(null);\n    }\n    if (options?.unsetDragData ?? true) {\n      this._dragData = null;\n    }\n  }\n\n  /**\n   * Executes given function when the drag animation has finished, i.e., tabs have transitioned to their final position.\n   */\n  private onDragAnimationStable(callback: () => void): void {\n    if (NgZone.isInAngularZone()) {\n      this._zone.runOutsideAngular(() => this.onDragAnimationStable(callback));\n      return;\n    }\n    requestAnimationFrame(() => this.isDragAnimationStable() ? callback() : this.onDragAnimationStable(callback));\n  }\n\n  /**\n   * Scrolls the tab of the active view into view.\n   */\n  private installActiveViewScroller(): void {\n    afterRenderEffect(() => {\n      // Track the active view.\n      const activeView = this.part.activeView();\n\n      // There may be no active view, e.g., if no view has been activated, or when dragging the last view out of the tabbar.\n      if (!activeView) {\n        return;\n      }\n\n      // Track navigation of the active view, scrolling its tab into view if necessary.\n      activeView.navigation();\n\n      // Track unsetting drag state to ensure the active view is scrolled into view after drop or cancel.\n      this._onUnsetDragState();\n\n      // Do not track rendered tabs to prevent unwanted scrolling when opening or closing inactive tabs.\n      const activeViewTab = untracked(() => this._viewTabs().find(viewTab => viewTab.view() === activeView))!;\n\n      // Scroll the tab into view if scrolled out of view.\n      untracked(() => requestAnimationFrame(() => {\n        if (!this._viewportComponent().isElementInView(activeViewTab.host, 'full')) {\n          this._viewportComponent().scrollIntoView(activeViewTab.host);\n        }\n      }));\n    });\n  }\n\n  /**\n   * Updates {@link ɵWorkbenchView} when its tab is scrolled into view.\n   */\n  private installScrolledIntoViewUpdater(): void {\n    this._viewportChange$\n      .pipe(\n        map(() => this._viewTabs()),\n        filterArray(viewTab => viewTab !== this.dragSourceViewTab()), // skip drag source as always scrolled out of view\n        mergeMap(viewTabs => from(viewTabs)),\n        takeUntilDestroyed(),\n      )\n      .subscribe(viewTab => {\n        viewTab.view().scrolledIntoView = this._viewportComponent().isElementInView(viewTab.host, 'full');\n      });\n  }\n\n  /**\n   * Subscribes to drag events.\n   */\n  private installViewDragListener(): void {\n    const zone = inject(NgZone);\n\n    // Subscribe to drag events relevant for this tabbar.\n    this._viewDragService.viewDrag$(this._partBarElement)\n      .pipe(\n        subscribeIn(fn => zone.runOutsideAngular(fn)),\n        calculateDistance(() => this._viewportComponent()), // provide viewport lazily because not injected yet\n        takeUntilDestroyed(),\n      )\n      .subscribe(({event, dragDistance, scrollDistance}) => {\n        switch (event.type) {\n          case 'dragstart':\n            this.onTabDragStart();\n            break;\n          case 'dragend':\n            this.onTabDragEnd(event);\n            break;\n          case 'dragenter':\n            this.onTabbarDragEnter(event);\n            break;\n          case 'dragover':\n            this.onTabbarDragOver(event, dragDistance, scrollDistance);\n            break;\n          case 'dragleave':\n            this.onTabbarDragLeave(event);\n            break;\n          case 'drop':\n            void this.onTabbarDrop();\n            break;\n        }\n      });\n\n    // Get notified when a view has moved in the layout.\n    this._viewDragService.viewMoved$\n      .pipe(\n        subscribeIn(fn => zone.runOutsideAngular(fn)),\n        takeUntilDestroyed(),\n      )\n      .subscribe(event => this.onTabMoved(event));\n\n    /**\n     * Calculates the distance the drag pointer and viewport have moved since the last drag event.\n     */\n    function calculateDistance(viewport: () => SciViewportComponent): OperatorFunction<DragEvent, DragEventPlusDistance> {\n      return source$ => new Observable<DragEventPlusDistance>(observer => {\n        let lastScreenX: number | undefined;\n        let lastScrollLeft: number | undefined;\n\n        const subscription = source$.subscribe(event => {\n          observer.next({\n            event,\n            dragDistance: event.screenX - (lastScreenX ?? event.screenX),\n            scrollDistance: viewport().scrollLeft - (lastScrollLeft ?? viewport().scrollLeft),\n          });\n          lastScreenX = event.screenX;\n          lastScrollLeft = viewport().scrollLeft;\n        });\n        return () => subscription.unsubscribe();\n      });\n    }\n  }\n\n  /**\n   * Emits on {@link _viewportChange$} when the viewport size or scroll position changes.\n   */\n  private installViewportChangeTracker(): void {\n    const viewportSize = dimension(computed(() => this._viewportComponentElement().nativeElement as HTMLElement));\n    const viewportClientSize = dimension(computed(() => this._viewportComponent().viewportClientElement));\n    const zone = inject(NgZone);\n\n    // Detect resizing.\n    effect(() => {\n      // Track viewport and viewport client sizes.\n      viewportSize();\n      viewportClientSize();\n      untracked(() => this._viewportChange$.next());\n    });\n\n    // Detect scrolling.\n    effect(onCleanup => {\n      const viewport = this._viewportComponent().viewportElement;\n      untracked(() => {\n        const subscription = fromEvent(viewport, 'scroll')\n          .pipe(subscribeIn(fn => zone.runOutsideAngular(fn)))\n          .subscribe(() => this._viewportChange$.next());\n        onCleanup(() => subscription.unsubscribe());\n      });\n    });\n  }\n\n  /**\n   * Tracks the tabbar indents.\n   */\n  private installTabbarIndentSizeTracker(): void {\n    const tabCornerRadiusDimension = dimension(this._tabCornerRadiusElement);\n\n    effect(() => {\n      const indent = tabCornerRadiusDimension().clientWidth;\n      this._tabbarIndent = {left: indent, right: indent};\n      setCssVariable(this._host, {\n        '--ɵpart-bar-indent-left': `${this._tabbarIndent.left}px`,\n        '--ɵpart-bar-indent-right': `${this._tabbarIndent.right}px`,\n      });\n    });\n  }\n\n  public ngOnDestroy(): void {\n    this.unsetDragState();\n  }\n}\n\n/**\n * Contains the event plus drag and scroll distance.\n */\ninterface DragEventPlusDistance {\n  /**\n   * Reference to the drag event.\n   */\n  event: DragEvent;\n  /**\n   * Distance the drag pointer has moved since the last drag event.\n   */\n  dragDistance: number;\n  /**\n   * Distance the viewport has scrolled since the last drag event.\n   */\n  scrollDistance: number;\n}\n","<sci-viewport class=\"e2e-tab-viewport\" scrollbarStyle=\"hidden\">\n  @for (view of part.views(); track view.id) {\n    @if (viewtab === dropTargetViewTab()) {\n      <div class=\"divider\"></div>\n    }\n    <wb-view-tab #viewtab\n                 [viewId]=\"view.id\"\n                 [class.drag-source]=\"viewtab === dragSourceViewTab()\"\n                 [class.drop-target]=\"viewtab === dropTargetViewTab()\"/>\n    <div class=\"divider\"></div>\n  }\n\n  <!-- Placeholder for expanding the viewport when dragging a tab to the right, moving part actions along with the dragover event. -->\n  <div class=\"drag-placeholder\"></div>\n</sci-viewport>\n\n<!-- Element for injecting the corner radius into the component. -->\n<div class=\"tab-corner-radius\" #tab_corner_radius></div>\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, effect, ElementRef, inject, InjectionToken, NgZone, Signal, untracked, viewChild} from '@angular/core';\nimport {ɵWorkbenchPart} from '../ɵworkbench-part.model';\nimport {ɵWorkbenchRouter} from '../../routing/ɵworkbench-router.service';\nimport {PartActionComponent} from '../part-action/part-action.component';\nimport {ViewListButtonComponent} from '../view-list-button/view-list-button.component';\nimport {ViewTabBarComponent} from '../view-tab-bar/view-tab-bar.component';\nimport {dimension} from '@scion/components/dimension';\nimport {NgClass} from '@angular/common';\nimport {EMPTY, fromEvent, mergeMap, of, pairwise, withLatestFrom} from 'rxjs';\nimport {subscribeIn} from '@scion/toolkit/operators';\nimport {TextPipe} from '../../text/text.pipe';\nimport {IconComponent} from '../../icon/icon.component';\n\n/**\n * DI token to inject the HTML element of the {@link PartBarComponent}.\n */\nexport const PART_BAR_ELEMENT = new InjectionToken<HTMLElement>('PART_BAR_ELEMENT');\n\n@Component({\n  selector: 'wb-part-bar',\n  templateUrl: './part-bar.component.html',\n  styleUrls: ['./part-bar.component.scss'],\n  imports: [\n    ViewTabBarComponent,\n    PartActionComponent,\n    ViewListButtonComponent,\n    NgClass,\n    TextPipe,\n    IconComponent,\n  ],\n  providers: [\n    {provide: PART_BAR_ELEMENT, useFactory: () => inject(ElementRef).nativeElement as HTMLElement},\n  ],\n})\nexport class PartBarComponent {\n\n  private readonly _router = inject(ɵWorkbenchRouter);\n  private readonly _viewTabBar = viewChild(ViewTabBarComponent, {read: ElementRef<HTMLElement>});\n  private readonly _fillerElement = viewChild.required<ElementRef<HTMLElement>>('filler');\n\n  protected readonly part = inject(ɵWorkbenchPart);\n  protected readonly startActions = computed(() => this.part.actions().filter(action => action.align === 'start'));\n  protected readonly endActions = computed(() => this.part.actions().filter(action => action.align !== 'start'));\n  protected readonly maxViewTabBarWidth: Signal<number>;\n\n  constructor() {\n    this.maxViewTabBarWidth = this.calculateMaxViewTabBarWidth();\n    this.installActivityMinimizer();\n  }\n\n  protected onPartBarMouseDown(event: Event): void {\n    // Activate the part or its active view, if any.\n    if (this.part.activeView()) {\n      void this.part.activeView()!.activate();\n    }\n    else {\n      void this.part.activate();\n    }\n\n    // Prevent default to maintain focus on part and view content.\n    event.preventDefault();\n  }\n\n  protected onMinimize(): void {\n    void this._router.navigate(layout => layout.toggleActivity(this.part.activity()!.id));\n  }\n\n  /**\n   * Minimizes activities when double-clicking the tabbar or filler, but only if the first and second clicks target the same DOM element.\n   * This prevents unintended maximization or minimization when double-clicking a tab's close button.\n   */\n  private installActivityMinimizer(): void {\n    const host = inject(ElementRef).nativeElement as HTMLElement;\n    const zone = inject(NgZone);\n\n    effect(onCleanup => {\n      // Maximization/minimization is only supported for tabs not located in the peripheral area.\n      if (this.part.peripheral()) {\n        return;\n      }\n\n      const viewTabBar = this._viewTabBar()?.nativeElement as HTMLElement | undefined;\n      const filler = this._fillerElement().nativeElement;\n\n      untracked(() => {\n        const subscription = fromEvent<MouseEvent>([filler].concat(viewTabBar ?? []), 'dblclick')\n          .pipe(\n            withLatestFrom(fromEvent<MouseEvent>(host, 'click', {capture: true}).pipe(pairwise(), subscribeIn(fn => zone.runOutsideAngular(fn)))),\n            mergeMap(([dblClickEvent, [clickEvent1, clickEvent2]]) => clickEvent1.target === clickEvent2.target ? of(dblClickEvent) : EMPTY),\n          )\n          .subscribe(event => {\n            void this._router.navigate(layout => layout.toggleMaximized());\n            event.preventDefault();\n          });\n        onCleanup(() => subscription.unsubscribe());\n      });\n    });\n  }\n\n  /**\n   * Calculates the maximum available width for the view tab bar.\n   */\n  private calculateMaxViewTabBarWidth(): Signal<number> {\n    const fillerDimension = dimension(this._fillerElement);\n    const viewTabBarDimension = dimension(this._viewTabBar);\n    return computed(() => (viewTabBarDimension()?.offsetWidth ?? 0) + fillerDimension().offsetWidth);\n  }\n}\n","<!-- Title -->\n@if (part.title()) {\n  <span class=\"title e2e-title\" (mousedown)=\"onPartBarMouseDown($event)\">{{(part.title() | wbText)()}}</span>\n}\n\n<!-- View Tabs -->\n@if (part.views().length) {\n  <wb-view-tab-bar [maxWidth]=\"maxViewTabBarWidth()\"/>\n}\n\n<!-- Start Actions -->\n@if (startActions().length) {\n  <div class=\"actions\">\n    @for (action of startActions(); track action) {\n      <wb-part-action [action]=\"action\" [ngClass]=\"action.cssClass\" data-align=\"start\"/>\n    }\n  </div>\n}\n\n<!-- Filler -->\n<div class=\"filler e2e-filler\" #filler (mousedown)=\"onPartBarMouseDown($event)\"></div>\n\n<!-- End Actions -->\n@if (endActions().length) {\n  <div class=\"actions\">\n    @for (action of endActions(); track action) {\n      <wb-part-action [action]=\"action\" [ngClass]=\"action.cssClass\" data-align=\"end\"/>\n    }\n  </div>\n}\n\n<!-- View List Dropdown -->\n@if (part.views().length) {\n  <wb-view-list-button [title]=\"('%workbench.show_open_tabs.tooltip' | wbText)()\"/>\n}\n\n<!-- Minimize Button -->\n@if (part.canMinimize()) {\n  <button (click)=\"onMinimize()\" [title]=\"('%workbench.minimize.tooltip' | wbText)()\" class=\"minimize e2e-minimize\">\n    <wb-icon icon=\"workbench.minimize\"/>\n  </button>\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectorRef, Component, DestroyRef, effect, inject, Injector, OnInit, untracked} from '@angular/core';\nimport {ViewDropZoneDirective, WbViewDropEvent} from '../view-dnd/view-drop-zone.directive';\nimport {ViewDragService} from '../view-dnd/view-drag.service';\nimport {ɵWorkbenchPart} from './ɵworkbench-part.model';\nimport {Logger, LoggerNames} from '../logging';\nimport {PartBarComponent} from './part-bar/part-bar.component';\nimport {WorkbenchPortalOutletDirective} from '../portal/workbench-portal-outlet.directive';\nimport {WORKBENCH_ID} from '../workbench.identifiers';\nimport {dasherize} from '../common/dasherize.util';\n\n@Component({\n  selector: 'wb-part',\n  templateUrl: './part.component.html',\n  styleUrl: './part.component.scss',\n  imports: [\n    PartBarComponent,\n    ViewDropZoneDirective,\n    WorkbenchPortalOutletDirective,\n  ],\n  host: {\n    '[attr.data-partid]': 'part.id',\n    '[attr.data-peripheral]': `part.peripheral() ? '' : null`,\n    '[attr.data-grid]': 'dasherize(part.gridName())',\n    '[attr.data-active]': `part.active() ? '' : null`,\n    '[attr.data-referencepart]': `part.referencePart() ? '' : null`,\n    '[attr.tabindex]': '-1',\n    '[class]': 'part.classList.asList()',\n  },\n})\nexport class PartComponent implements OnInit {\n\n  private readonly _workbenchId = inject(WORKBENCH_ID);\n  private readonly _viewDragService = inject(ViewDragService);\n  private readonly _injector = inject(Injector);\n  private readonly _cd = inject(ChangeDetectorRef);\n\n  protected readonly part = inject(ɵWorkbenchPart);\n  protected readonly canDrop = inject(ViewDragService).canDrop(inject(ɵWorkbenchPart));\n  protected readonly dasherize = dasherize;\n\n  constructor() {\n    this.installComponentLifecycleLogger();\n    this.constructInactiveViewComponents();\n  }\n\n  public ngOnInit(): void {\n    // Perform a manual change detection run to avoid `ExpressionChangedAfterItHasBeenCheckedError` that would occur\n    // when the view sets view properties in its constructor. Because the view tab is located before the view in the\n    // Angular component tree, Angular checks the view tab for changes before the view. Therefore, if the view sets\n    // its title during construction, then the view tab label will also change, causing the error.\n    this._cd.detectChanges();\n  }\n\n  /**\n   * Method invoked to move a view into this part.\n   */\n  protected onViewDrop(event: WbViewDropEvent): void {\n    this._viewDragService.dispatchViewMoveEvent({\n      source: {\n        workbenchId: event.dragData.workbenchId,\n        partId: event.dragData.partId,\n        viewId: event.dragData.viewId,\n        alternativeViewId: event.dragData.alternativeViewId,\n        navigation: event.dragData.navigation,\n        classList: event.dragData.classList,\n      },\n      target: {\n        workbenchId: this._workbenchId,\n        elementId: this.part.id,\n        region: event.dropRegion === 'center' ? undefined : event.dropRegion,\n      },\n      dragData: event.dragData,\n    });\n  }\n\n  /**\n   * Constructs view components of inactive views, so they can initialize, e.g., to set the view tab title.\n   */\n  private constructInactiveViewComponents(): void {\n    effect(() => {\n      const views = this.part.views();\n      untracked(() => views\n        .filter(view => !view.active() && !view.slot.portal.constructed())\n        .forEach(inactiveView => {\n          inactiveView.slot.portal.construct(this._injector);\n        }));\n    });\n  }\n\n  private installComponentLifecycleLogger(): void {\n    const logger = inject(Logger);\n    logger.debug(() => `Constructing PartComponent [partId=${this.part.id}]`, LoggerNames.LIFECYCLE);\n    inject(DestroyRef).onDestroy(() => logger.debug(() => `Destroying PartComponent [partId=${this.part.id}]'`, LoggerNames.LIFECYCLE));\n  }\n}\n","@if (part.title() || part.views().length || part.actions().length || part.canMinimize()) {\n  <wb-part-bar/>\n}\n\n@if (part.views().length) {\n  <!-- Prevent splitting if there is no active view, i.e, when dragging the last view out of the tabbar. -->\n  @let canSplit = !!part.activeView();\n  <div wbViewDropZone\n       [wbViewDropZoneRegionSize]=\".25\"\n       [wbViewDropZonePlaceholderSize]=\".5\"\n       [wbViewDropZoneAttributes]=\"{'data-partid': part.id}\"\n       [wbViewDropZoneRegions]=\"canDrop() && {center: true, north: canSplit, south: canSplit, west: canSplit, east: canSplit}\"\n       (wbViewDropZoneDrop)=\"onViewDrop($event)\"\n       class=\"slot e2e-slot e2e-view-slot\">\n    <ng-container *wbPortalOutlet=\"part.activeView()?.slot!.portal; destroyOnDetach: false\"/>\n  </div>\n} @else {\n  <div wbViewDropZone\n       [wbViewDropZoneRegions]=\"canDrop() && {center: false, north: true, south: true, west: true, east: true}\"\n       [wbViewDropZoneAttributes]=\"{'data-partid': part.id}\"\n       (wbViewDropZoneDrop)=\"onViewDrop($event)\"\n       class=\"slot e2e-slot e2e-part-slot\">\n    <ng-container *wbPortalOutlet=\"part.slot.portal; destroyOnDetach: false\"/>\n  </div>\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {InjectionToken, Provider} from '@angular/core';\nimport {provideWorkbenchDialogService} from '../dialog/ɵworkbench-dialog.service';\nimport {provideWorkbenchMessageBoxService} from '../message-box/ɵworkbench-message-box.service';\nimport {provideWorkbenchPopupService} from '../popup/ɵworkbench-popup.service';\n\n/**\n * DI token to register providers available for DI if in the context of a workbench part.\n */\nexport const WORKBENCH_PART_CONTEXT = new InjectionToken<Provider[]>('WORKBENCH_PART_CONTEXT');\n\n/**\n * Provides providers available for DI if in the context of a workbench part.\n */\nexport function provideWorkbenchPartContext(): Provider {\n  return {\n    provide: WORKBENCH_PART_CONTEXT,\n    useFactory: (): Provider[] => [\n      provideWorkbenchDialogService(),\n      provideWorkbenchMessageBoxService(),\n      provideWorkbenchPopupService(),\n    ],\n    multi: true,\n  };\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\nimport {afterRenderEffect, assertNotInReactiveContext, computed, DestroyableInjector, effect, inject, Injector, IterableDiffers, runInInjectionContext, Signal, signal, TemplateRef, untracked, WritableSignal} from '@angular/core';\nimport {WorkbenchPartAction, WorkbenchPartActionFn} from '../workbench.model';\nimport {WORKBENCH_ELEMENT} from '../workbench-element-references';\nimport {WorkbenchPart, WorkbenchPartNavigation} from './workbench-part.model';\nimport {PartId} from '../workbench.identifiers';\nimport {WorkbenchViewRegistry} from '../view/workbench-view.registry';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {ɵWorkbenchLayout} from '../layout/ɵworkbench-layout';\nimport {WorkbenchLayoutService} from '../layout/workbench-layout.service';\nimport {ActivatedRouteSnapshot, ChildrenOutletContexts} from '@angular/router';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ɵWorkbenchRouter} from '../routing/ɵworkbench-router.service';\nimport {WorkbenchPartActionRegistry} from './workbench-part-action.registry';\nimport {ClassList} from '../common/class-list';\nimport {Routing} from '../routing/routing.util';\nimport {WorkbenchRouteData} from '../routing/workbench-route-data';\nimport {MPart, MTreeNode, WorkbenchGrids} from '../layout/workbench-grid.model';\nimport {MActivity} from '../activity/workbench-activity.model';\nimport {WbComponentPortal} from '../portal/wb-component-portal';\nimport {PartSlotComponent} from './part-slot/part-slot.component';\nimport {MAIN_AREA} from '../layout/workbench-layout';\nimport {MainAreaPartComponent} from './main-area-part/main-area-part.component';\nimport {PartComponent} from './part.component';\nimport {ɵWorkbenchView} from '../view/ɵworkbench-view.model';\nimport {WorkbenchFocusMonitor} from '../focus/workbench-focus-tracker.service';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {boundingClientRect} from '@scion/components/dimension';\nimport {Blockable} from '../glass-pane/blockable';\nimport {ɵWorkbenchDialog} from '../dialog/ɵworkbench-dialog.model';\nimport {WorkbenchDialogRegistry} from '../dialog/workbench-dialog.registry';\nimport {WORKBENCH_PART_CONTEXT} from './workbench-part-context.provider';\nimport {Objects} from '@scion/toolkit/util';\n\n/** @inheritDoc */\nexport class ɵWorkbenchPart implements WorkbenchPart, Blockable {\n\n  /** Injector for the part; destroyed when the part is removed. */\n  public readonly injector = inject(Injector) as DestroyableInjector;\n  private readonly _workbenchRouter = inject(ɵWorkbenchRouter);\n  private readonly _rootOutletContexts = inject(ChildrenOutletContexts);\n  private readonly _focusMonitor = inject(WorkbenchFocusMonitor);\n  private readonly _layout = inject(WorkbenchLayoutService).layout;\n  private readonly _title = signal<Translatable | undefined>(undefined);\n  private readonly _titleComputed = this.computeTitle();\n\n  public readonly alternativeId: string | undefined;\n  public readonly navigation = signal<WorkbenchPartNavigation | undefined>(undefined);\n  public readonly activationInstant = signal(0);\n  public readonly active = signal(false);\n  public readonly focused = computed(() => this._focusMonitor.activeElement()?.id === this.id);\n  public readonly viewIds = computed(() => this.views().map(view => view.id));\n  public readonly activeViewId = computed(() => this.activeView()?.id ?? null);\n  public readonly mPart: WritableSignal<MPart>;\n  public readonly gridName: WritableSignal<keyof WorkbenchGrids>;\n  public readonly peripheral = signal(false);\n  public readonly referencePart = signal(false);\n  public readonly topLeft = signal(false);\n  public readonly topRight = signal(false);\n  public readonly activity = signal<MActivity | null>(null);\n  public readonly canMinimize = computed(() => this.activity() !== null && this.topRight());\n  public readonly actions: Signal<WorkbenchPartAction[]>;\n  public readonly activeView: Signal<ɵWorkbenchView | null>;\n  public readonly views: Signal<ɵWorkbenchView[]>;\n  public readonly classList = new ClassList();\n  public readonly portal: WbComponentPortal<MainAreaPartComponent | PartComponent>;\n  public readonly partBounds: Signal<DOMRect | undefined>;\n  /** Represents the bounds of the slot. Used for public API. Internally, use {@link slot.bounds()} instead. */\n  public readonly bounds = computed(() => this.slot.bounds());\n  public readonly blockedBy: Signal<ɵWorkbenchDialog | null>;\n  public readonly slot: {\n    portal: WbComponentPortal<PartSlotComponent>;\n    bounds: Signal<DOMRect | undefined>;\n  };\n\n  private _isInMainArea: boolean | undefined;\n\n  constructor(public readonly id: PartId, layout: ɵWorkbenchLayout) {\n    this.mPart = signal(layout.part({partId: id}));\n    this.gridName = signal(layout.grid({partId: id}).gridName);\n    this.actions = computePartActions(this);\n    this.activeView = computeActiveView(this.mPart);\n    this.views = computeViews(this.mPart);\n    this.alternativeId = this.mPart().alternativeId;\n    this.portal = this.createPartPortal();\n    this.partBounds = boundingClientRect(computed(() => this.portal.element()));\n    this.blockedBy = inject(WorkbenchDialogRegistry).top(this.id);\n    this.slot = {\n      portal: this.createPartSlotPortal(),\n      bounds: boundingClientRect(computed(() => this.slot.portal.element())),\n    };\n    this.installModelUpdater();\n    this.onLayoutChange({layout});\n    this.activateOnFocus();\n    this.focusOnActivate();\n  }\n\n  public focus(): void {\n    assertNotInReactiveContext(this.focus, 'Call WorkbenchView.focus() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n    this.slot.portal.componentRef()?.instance.focus();\n  }\n\n  /**\n   * Creates a portal to render {@link PartComponent} or {@link MainAreaPartComponent} in the part's injection context.\n   */\n  private createPartPortal(): WbComponentPortal<MainAreaPartComponent | PartComponent> {\n    return new WbComponentPortal<MainAreaPartComponent | PartComponent>(this.id === MAIN_AREA ? MainAreaPartComponent : PartComponent, {\n      debugName: `${this.id === MAIN_AREA ? 'MainAreaPartComponent' : 'PartComponent'} [${this.id}]`,\n      providers: [\n        {provide: ɵWorkbenchPart, useValue: this},\n        {provide: WorkbenchPart, useExisting: ɵWorkbenchPart},\n        {provide: WORKBENCH_ELEMENT, useExisting: ɵWorkbenchPart},\n      ],\n    });\n  }\n\n  /**\n   * Creates a portal to render {@link PartSlotComponent} in the part's injection context.\n   */\n  private createPartSlotPortal(): WbComponentPortal<PartSlotComponent> {\n    return new WbComponentPortal(PartSlotComponent, {\n      debugName: `PartSlotComponent [${this.id}]`,\n      providers: [\n        {provide: ɵWorkbenchPart, useValue: this},\n        {provide: WorkbenchPart, useExisting: ɵWorkbenchPart},\n        {provide: WORKBENCH_ELEMENT, useExisting: ɵWorkbenchPart},\n        inject(WORKBENCH_PART_CONTEXT, {optional: true}) ?? [],\n      ],\n    });\n  }\n\n  /**\n   * Method invoked when the workbench layout has changed.\n   *\n   * This method:\n   * - is called on every layout change, enabling the update of part properties defined in the layout (navigation hint, navigation data, ...).\n   * - is called on route activation (after destroyed the previous component (if any), but before constructing the new component).\n   */\n  private onLayoutChange(change: {layout: ɵWorkbenchLayout; route?: ActivatedRouteSnapshot; previousRoute?: ActivatedRouteSnapshot | null}): void {\n    const {layout, route, previousRoute} = change;\n\n    this._isInMainArea ??= layout.hasPart(this.id, {grid: 'mainArea'});\n    const mPart = layout.part({partId: this.id});\n    const {gridName, grid} = layout.grid({partId: this.id});\n    this.mPart.set(mPart);\n    this.gridName.set(gridName);\n    this.peripheral.set(layout.isPeripheralPart(this.id));\n    this.referencePart.set(grid.referencePartId === this.id);\n    this.active.set(isActive(this.id, layout));\n    this.activity.set(layout.activity({partId: this.id}, {orElse: null}));\n    this.topLeft.set(isTopLeft(grid.root, mPart));\n    this.topRight.set(isTopRight(grid.root, mPart));\n    this.activationInstant.set(mPart.activationInstant ?? 0);\n    this.classList.layout = mPart.cssClass;\n\n    // Test if a new route has been activated for this part.\n    const routeChanged = route && route.routeConfig !== previousRoute?.routeConfig;\n    if (routeChanged) {\n      this.classList.route = Routing.lookupRouteData(route, WorkbenchRouteData.cssClass);\n      this.classList.application = [];\n    }\n\n    // Test if this part was navigated. Navigation does not necessarily cause the route to change.\n    const navigationChanged = mPart.navigation?.id !== this.navigation()?.id;\n    if (navigationChanged) {\n      this.navigation.set(mPart.navigation && {\n        id: mPart.navigation.id,\n        hint: mPart.navigation.hint,\n        data: mPart.navigation.data,\n        state: layout.navigationState({outlet: this.id}),\n        path: layout.urlSegments({outlet: this.id}),\n      });\n      this.classList.navigation = mPart.navigation?.cssClass;\n    }\n  }\n\n  private computeTitle(): Signal<Translatable | undefined> {\n    return computed(() => {\n      const activity = this.activity();\n\n      // If this part is not contained in an activity, return the title from the handle or layout.\n      if (!activity) {\n        return this._title() ?? this._layout().part({partId: this.id}).title;\n      }\n\n      // Compute the title based on the activity's reference part if this part is the top-leftmost part.\n      if (this.topLeft()) {\n        const referencePartId = this._layout().grids[activity.id]!.referencePartId!;\n        return this._layout().part({partId: referencePartId, grid: activity.id}).title;\n      }\n\n      // If this part is the reference part but not positioned top-leftmost, only return the handle's title, not the activity title set on the layout.\n      if (this.referencePart()) {\n        return this._title();\n      }\n\n      // Default to the title set on the handle or defined on the layout.\n      return this._title() ?? this._layout().part({partId: this.id}).title;\n    });\n  }\n\n  /**\n   * Returns the component of this part. Returns `null` if not displaying navigated content.\n   */\n  public getComponent<T = unknown>(): T | null {\n    const outlet = Routing.resolveEffectiveOutletContext(this._rootOutletContexts.getContext(this.id))?.outlet;\n    return outlet?.isActivated ? outlet.component as T : null;\n  }\n\n  /** @inheritDoc */\n  public async activate(): Promise<boolean> {\n    assertNotInReactiveContext(this.activate, 'Call WorkbenchPart.activate() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    if (this.active() && this.focused() && this._layout().isLatestActivationInstant(this.activationInstant())) {\n      return true;\n    }\n\n    const currentLayout = this._layout();\n    return this._workbenchRouter.navigate(\n      layout => currentLayout === layout ? layout.activatePart(this.id) : null, // cancel navigation if the layout has become stale\n      {skipLocationChange: true}, // do not add part activation into browser session history stack\n    );\n  }\n\n  /** @inheritDoc */\n  public get isInMainArea(): boolean {\n    return this._isInMainArea ?? false;\n  }\n\n  /** @inheritDoc */\n  public get title(): Signal<Translatable | undefined> {\n    return this._titleComputed;\n  }\n\n  /** @inheritDoc */\n  public set title(title: Translatable | undefined) {\n    untracked(() => this._title.set(title));\n  }\n\n  /** @inheritDoc */\n  public set cssClass(cssClass: string | string[]) {\n    untracked(() => this.classList.application = cssClass);\n  }\n\n  /** @inheritDoc */\n  public get cssClass(): Signal<string[]> {\n    return this.classList.application;\n  }\n\n  /**\n   * Sets up automatic synchronization of {@link WorkbenchPart} on every layout change.\n   *\n   * If the operation is cancelled (e.g., due to a navigation failure), it reverts the changes.\n   */\n  private installModelUpdater(): void {\n    Routing.activatedRoute$(this.id, {emitOn: 'always'})\n      .pipe(takeUntilDestroyed())\n      .subscribe(([previousRoute, route]: [ActivatedRouteSnapshot | null, ActivatedRouteSnapshot]) => {\n        const navigationContext = this._workbenchRouter.getCurrentNavigationContext();\n        const {layout, previousLayout, layoutDiff} = navigationContext;\n\n        if (layoutDiff.removedParts.includes(this.id)) {\n          return;\n        }\n\n        this.onLayoutChange({layout, route, previousRoute});\n\n        // Revert change in case the navigation fails.\n        if (previousLayout?.hasPart(this.id)) {\n          navigationContext.registerUndoAction(() => this.onLayoutChange({layout: previousLayout, route: previousRoute!, previousRoute: route}));\n        }\n      });\n  }\n\n  /**\n   * Activates this part when focused.\n   */\n  private activateOnFocus(): void {\n    effect(() => {\n      if (this.focused()) {\n        untracked(() => void this.activate());\n      }\n    });\n  }\n\n  /**\n   * Focuses this part when activated, either by focus or routing.\n   */\n  private focusOnActivate(): void {\n    afterRenderEffect(() => {\n      const activationInstant = this.activationInstant();\n\n      // Request focus only once attached to the DOM.\n      if (!this.slot.portal.attached()) {\n        return;\n      }\n\n      untracked(() => {\n        // Do not request focus if no interaction has occurred yet.\n        if (!activationInstant) {\n          return;\n        }\n\n        // Do not request focus if already focused.\n        if (this.focused()) {\n          return;\n        }\n\n        // Do not request focus if not the most recently interacted element, avoiding stale focus requests when switching perspectives.\n        if (!this._layout().isLatestActivationInstant(activationInstant)) {\n          return;\n        }\n\n        this.focus();\n      });\n    });\n  }\n\n  public destroy(): void {\n    this.injector.destroy();\n  }\n}\n\n/**\n * Computes if this part is the top-leftmost part.\n */\nfunction isTopLeft(element: MTreeNode | MPart, testee: MPart): boolean {\n  if (element instanceof MPart) {\n    return element.id === testee.id;\n  }\n\n  const {child1, child2} = element;\n  return isTopLeft(child1.visible ? child1 : child2, testee);\n}\n\n/**\n * Computes if this part is the top-rightmost part.\n */\nfunction isTopRight(element: MTreeNode | MPart, testee: MPart): boolean {\n  if (element instanceof MPart) {\n    return element.id === testee.id;\n  }\n\n  const {child1, child2} = element;\n  if (child1.visible && child2.visible) {\n    return element.direction === 'column' ? isTopRight(child1, testee) : isTopRight(child2, testee);\n  }\n  return isTopRight(child1.visible ? child1 : child2, testee);\n}\n\n/**\n * Computes if the given part is active.\n *\n * A part is considered active if it is the currently active part in its grid.\n * Additionally, if the part is associated with an activity, the activity must also be active.\n */\nfunction isActive(partId: PartId, layout: ɵWorkbenchLayout): boolean {\n  const {grid} = layout.grid({partId: partId});\n  if (grid.activePartId !== partId) {\n    return false;\n  }\n\n  const activity = layout.activity({partId: partId}, {orElse: null});\n  if (activity && layout.activityStack({activityId: activity.id}).activeActivityId !== activity.id) {\n    return false;\n  }\n  return true;\n}\n\n/**\n * Computes actions matching this part.\n */\nfunction computePartActions(part: ɵWorkbenchPart): Signal<WorkbenchPartAction[]> {\n  const injector = Injector.create({\n    parent: inject(Injector),\n    providers: [\n      {provide: ɵWorkbenchPart, useValue: part},\n      {provide: WorkbenchPart, useExisting: ɵWorkbenchPart},\n    ],\n  });\n\n  // Use a differ to avoid re-creating every action on registration or change.\n  const differ = inject(IterableDiffers).find([]).create<WorkbenchPartActionFn>();\n  const partActionRegistry = inject(WorkbenchPartActionRegistry);\n  const partActions = new Map<WorkbenchPartActionFn, Signal<WorkbenchPartAction | null>>();\n\n  return computed(() => {\n    const changes = differ.diff(partActionRegistry.elements());\n    changes?.forEachAddedItem(({item: fn}) => partActions.set(fn, computed(() => constructPartAction(fn, injector))));\n    changes?.forEachRemovedItem(({item: fn}) => partActions.delete(fn));\n    return Array.from(partActions.values()).map(partAction => partAction()).filter(partAction => !!partAction);\n  }, {equal: (a, b) => Objects.isEqual(a, b)});\n\n  function constructPartAction(factoryFn: WorkbenchPartActionFn, injector: Injector): WorkbenchPartAction | null {\n    const action: WorkbenchPartAction | ComponentType<unknown> | TemplateRef<unknown> | null = runInInjectionContext(injector, () => factoryFn(inject(ɵWorkbenchPart)));\n    if (action instanceof TemplateRef || typeof action === 'function') {\n      return {content: action};\n    }\n    return action;\n  }\n}\n\n/**\n * Computes the active view of given part, or `null` if none.\n */\nfunction computeActiveView(mPart: Signal<MPart>): Signal<ɵWorkbenchView | null> {\n  const viewRegistry = inject(WorkbenchViewRegistry);\n  return computed(() => mPart().activeViewId ? viewRegistry.get(mPart().activeViewId!) : null);\n}\n\n/**\n * Computes the views opened in given part.\n */\nfunction computeViews(mPart: Signal<MPart>): Signal<ɵWorkbenchView[]> {\n  const viewRegistry = inject(WorkbenchViewRegistry);\n  return computed(() => mPart().views.map(mView => viewRegistry.get(mView.id)), {equal: (a, b) => Objects.isEqual(a, b)});\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, IterableChanges, IterableDiffer, IterableDiffers} from '@angular/core';\nimport {ɵWorkbenchLayout} from '../layout/ɵworkbench-layout';\nimport {PartId, ViewId} from '../workbench.identifiers';\n\n/**\n * Stateful differ for finding added/removed workbench layout elements.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchLayoutDiffer {\n\n  private _partsDiffer: IterableDiffer<PartId>;\n  private _viewsDiffer: IterableDiffer<ViewId>;\n\n  constructor() {\n    const differs = inject(IterableDiffers);\n\n    this._partsDiffer = differs.find([]).create<PartId>();\n    this._viewsDiffer = differs.find([]).create<ViewId>();\n  }\n\n  /**\n   * Computes differences in the layout since last time {@link WorkbenchLayoutDiffer#diff} was invoked.\n   */\n  public diff(workbenchLayout: ɵWorkbenchLayout | null): WorkbenchLayoutDiff {\n    const parts = workbenchLayout?.parts().map(part => part.id);\n    const views = workbenchLayout?.views().map(view => view.id);\n    return new WorkbenchLayoutDiff({\n      parts: this._partsDiffer.diff(parts),\n      views: this._viewsDiffer.diff(views),\n    });\n  }\n}\n\n/**\n * Lists the layout elements added/removed in the current navigation.\n */\nexport class WorkbenchLayoutDiff {\n\n  public readonly addedParts = new Array<PartId>();\n  public readonly removedParts = new Array<PartId>();\n\n  public readonly addedViews = new Array<ViewId>();\n  public readonly removedViews = new Array<ViewId>();\n\n  constructor(changes: {parts: IterableChanges<PartId> | null; views: IterableChanges<ViewId> | null}) {\n    changes.parts?.forEachAddedItem(({item}) => this.addedParts.push(item));\n    changes.parts?.forEachRemovedItem(({item}) => this.removedParts.push(item));\n\n    changes.views?.forEachAddedItem(({item}) => this.addedViews.push(item));\n    changes.views?.forEachRemovedItem(({item}) => this.removedViews.push(item));\n  }\n\n  public toString(): string {\n    return new Array<string>()\n      .concat(this.addedParts.length ? `addedParts=[${this.addedParts}]` : [])\n      .concat(this.removedParts.length ? `removedParts=[${this.removedParts}]` : [])\n      .concat(this.addedViews.length ? `addedViews=[${this.addedViews}]` : [])\n      .concat(this.removedViews.length ? `removedViews=[${this.removedViews}]` : [])\n      .join(', ');\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, IterableChanges, IterableDiffers} from '@angular/core';\nimport {ɵWorkbenchLayout} from '../layout/ɵworkbench-layout';\nimport {UrlTree} from '@angular/router';\nimport {Routing} from './routing.util';\nimport {PartOutlet, ViewOutlet} from '../workbench.identifiers';\n\n/**\n * Stateful differ to compute added and removed outlets.\n *\n * Use this differ to register/unregister auxiliary routes for added/removed outlets.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchOutletDiffer {\n\n  private readonly _viewsDiffer = inject(IterableDiffers).find([]).create<ViewOutlet>();\n  private readonly _partsDiffer = inject(IterableDiffers).find([]).create<PartOutlet>();\n\n  /**\n   * Computes differences since last time {@link WorkbenchOutletDiffer#diff} was invoked.\n   */\n  public diff(workbenchLayout: ɵWorkbenchLayout | null, urlTree: UrlTree): WorkbenchOutletDiff {\n    // Combine view outlets from the URL and the layout, using a `Set` to remove duplicate entries.\n    // We require both sources because the layout is not available during initial navigation, and\n    // the URL does not contain outlets for empty-path navigations.\n    const viewOutlets = new Set([\n      ...Routing.parseOutlets(urlTree, {view: true}).keys(),\n      ...workbenchLayout?.views().map(view => view.id) ?? [],\n    ]);\n    // Combine part outlets from the URL and the layout, using a `Set` to remove duplicate entries.\n    // We require both sources because the layout is not available during initial navigation, and\n    // the URL does not contain outlets for empty-path navigations.\n    const partOutlets = new Set([\n      ...Routing.parseOutlets(urlTree, {part: true}).keys(),\n      ...workbenchLayout?.parts().map(part => part.id) ?? [],\n    ]);\n\n    return new WorkbenchOutletDiff({\n      views: this._viewsDiffer.diff(viewOutlets),\n      parts: this._partsDiffer.diff(partOutlets),\n    });\n  }\n}\n\n/**\n * Lists outlets added or removed in the current navigation.\n */\nexport class WorkbenchOutletDiff {\n\n  public readonly addedViewOutlets = new Array<ViewOutlet>();\n  public readonly removedViewOutlets = new Array<ViewOutlet>();\n\n  public readonly addedPartOutlets = new Array<PartOutlet>();\n  public readonly removedPartOutlets = new Array<PartOutlet>();\n\n  constructor(changes: WorkbenchOutletChanges) {\n    changes.views?.forEachAddedItem(({item}) => this.addedViewOutlets.push(item));\n    changes.views?.forEachRemovedItem(({item}) => this.removedViewOutlets.push(item));\n    changes.parts?.forEachAddedItem(({item}) => this.addedPartOutlets.push(item));\n    changes.parts?.forEachRemovedItem(({item}) => this.removedPartOutlets.push(item));\n  }\n\n  public toString(): string {\n    return new Array<string>()\n      .concat(this.addedViewOutlets.length ? `addedViewOutlets=[${this.addedViewOutlets}]` : [])\n      .concat(this.removedViewOutlets.length ? `removedViewOutlets=[${this.removedViewOutlets}]` : [])\n      .concat(this.addedPartOutlets.length ? `addedPartOutlets=[${this.addedPartOutlets}]` : [])\n      .concat(this.removedPartOutlets.length ? `removedPartOutlets=[${this.removedPartOutlets}]` : [])\n      .join(', ');\n  }\n}\n\ninterface WorkbenchOutletChanges {\n  views: IterableChanges<ViewOutlet> | null;\n  parts: IterableChanges<PartOutlet> | null;\n}\n","/*\n* Copyright (c) 2018-2024 Swiss Federal Railways\n*\n* This program and the accompanying materials are made\n* available under the terms of the Eclipse Public License 2.0\n* which is available at https://www.eclipse.org/legal/epl-2.0/\n*\n* SPDX-License-Identifier: EPL-2.0\n*/\n\nimport {Event, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router, RouterEvent} from '@angular/router';\nimport {inject, Injectable, Injector, runInInjectionContext} from '@angular/core';\nimport {WorkbenchAuxiliaryRouteInstaller} from './workbench-auxiliary-route-installer.service';\nimport {MAIN_AREA_LAYOUT_QUERY_PARAM} from '../workbench.constants';\nimport {WorkbenchViewRegistry} from '../view/workbench-view.registry';\nimport {WorkbenchPartRegistry} from '../part/workbench-part.registry';\nimport {WorkbenchLayoutService} from '../layout/workbench-layout.service';\nimport {ɵWorkbenchPart} from '../part/ɵworkbench-part.model';\nimport {ɵWorkbenchView} from '../view/ɵworkbench-view.model';\nimport {WorkbenchLayoutDiffer} from './workbench-layout-differ';\nimport {Logger, LoggerNames} from '../logging';\nimport {WorkbenchNavigationalStates} from './workbench-navigational-states';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ɵWorkbenchLayoutFactory} from '../layout/ɵworkbench-layout.factory';\nimport {Routing} from './routing.util';\nimport {ɵWorkbenchRouter} from './ɵworkbench-router.service';\nimport {WorkbenchNavigationContext} from './routing.model';\nimport {matchesIfNavigated} from './workbench-route-guards';\nimport {WorkbenchOutletDiffer} from './workbench-outlet-differ';\nimport {filter} from 'rxjs/operators';\nimport {PartId, ViewId} from '../workbench.identifiers';\nimport {ɵWorkbenchLayout} from '../layout/ɵworkbench-layout';\nimport {WorkbenchLayouts} from '../layout/workbench-layouts.util';\nimport {MPartGrid} from '../layout/workbench-grid.model';\n\n/**\n * Tracks the browser URL for workbench layout changes.\n *\n * - For each added view, constructs a {@link WorkbenchView} and registers view specific auxiliary routes of all top-level routes\n * - For each removed view, destroys {@link WorkbenchView} and unregisters its auxiliary routes\n * - For each added part, constructs a {@link WorkbenchPart}\n * - For each removed part, destroys {@link WorkbenchPart}\n * - Parses the serialized layout and injects it into {@link WorkbenchLayoutService}.\n */\n@Injectable({providedIn: 'root'})\nexport class WorkbenchUrlObserver {\n\n  private readonly _router = inject(Router);\n  private readonly _auxiliaryRouteInstaller = inject(WorkbenchAuxiliaryRouteInstaller);\n  private readonly _viewRegistry = inject(WorkbenchViewRegistry);\n  private readonly _partRegistry = inject(WorkbenchPartRegistry);\n  private readonly _workbenchLayoutService = inject(WorkbenchLayoutService);\n  private readonly _injector = inject(Injector);\n  private readonly _workbenchRouter = inject(ɵWorkbenchRouter);\n  private readonly _workbenchLayoutFactory = inject(ɵWorkbenchLayoutFactory);\n  private readonly _workbenchLayoutDiffer = inject(WorkbenchLayoutDiffer);\n  private readonly _workbenchOutletDiffer = inject(WorkbenchOutletDiffer);\n  private readonly _logger = inject(Logger);\n\n  constructor() {\n    this.installRouterEventListeners();\n  }\n\n  /** Invoked at the beginning of each navigation */\n  private onNavigationStart(event: NavigationStart): void {\n    const context = this.createWorkbenchNavigationContext(event.url);\n    this._logger.debug(() => 'onNavigationStart', LoggerNames.ROUTING, event, `NavigationContext [parts=${context.layout.parts().map(part => part.id)}, layoutDiff=${context.layoutDiff}, outletDiff=${context.outletDiff}]`);\n    this._workbenchRouter.setCurrentNavigationContext(context);\n    this.registerAddedOutletAuxiliaryRoutes();\n    this.registerAddedWorkbenchParts();\n    this.registerAddedWorkbenchViews();\n  }\n\n  /** Invoked upon successful navigation */\n  private onNavigationEnd(event: NavigationEnd): void {\n    this._logger.debug(() => 'onNavigationEnd', LoggerNames.ROUTING, event);\n    this.unregisterRemovedOutletAuxiliaryRoutes();\n    this.unregisterRemovedWorkbenchParts();\n    this.unregisterRemovedWorkbenchViews();\n    this.applyWorkbenchLayout();\n    this._workbenchRouter.getCurrentNavigationContext().runPostNavigationActions();\n    this._workbenchRouter.setCurrentNavigationContext(null);\n  }\n\n  /** Invoked when cancelled the navigation, e.g., in a guard */\n  private onNavigationCancel(event: NavigationCancel): void {\n    this._logger.debug(() => 'onNavigationCancel', LoggerNames.ROUTING, event);\n    this._workbenchRouter.getCurrentNavigationContext().undoChanges();\n    this._workbenchRouter.setCurrentNavigationContext(null);\n  }\n\n  /** Invoked when the navigation failed */\n  private onNavigationError(event: NavigationError): void {\n    this._logger.debug(() => 'onNavigationError', LoggerNames.ROUTING, event);\n    this._workbenchRouter.getCurrentNavigationContext().undoChanges();\n    this._workbenchRouter.setCurrentNavigationContext(null);\n  }\n\n  /**\n   * Creates the context of the current navigation. The context provides access to the new layout and how it differs from the current layout.\n   */\n  private createWorkbenchNavigationContext(url: string): WorkbenchNavigationContext {\n    const urlTree = this._router.parseUrl(url);\n    const workbenchNavigationalState = WorkbenchNavigationalStates.fromNavigation(this._router.currentNavigation()!);\n    const previousLayout = this._workbenchLayoutService.hasLayout() ? this._workbenchLayoutService.layout() : null;\n    const previousUrl = this._router.parseUrl(this._router.url); // Browser URL is only updated after successful navigation\n\n    const newLayout = this._workbenchLayoutFactory.create({\n      grids: {\n        main: workbenchNavigationalState?.grids.main ?? previousLayout?.grids.main,\n        mainArea: (() => {\n          // Read the main area grid from the query parameter.\n          const mainAreaGrid = urlTree.queryParamMap.get(MAIN_AREA_LAYOUT_QUERY_PARAM);\n          if (mainAreaGrid) {\n            return mainAreaGrid;\n          }\n\n          // Do not fall back to the current layout if the navigation was performed via the Workbench Router.\n          const isWorkbenchRouterNavigation = workbenchNavigationalState !== null;\n          if (isWorkbenchRouterNavigation) {\n            return undefined;\n          }\n\n          // Do not fall back to the current layout if the navigation was triggered from outside the Angular Router, i.e., the browser back/forward buttons.\n          const isExternalNavigation = this._router.currentNavigation()!.trigger === 'popstate';\n          if (isExternalNavigation) {\n            return undefined;\n          }\n\n          // Fall back to the current layout if the navigation was performed via the Angular router, i.e., the navigator did not preserve the query params.\n          return previousLayout?.grids.mainArea;\n        })(),\n        ...WorkbenchLayouts.pickActivityGrids<string | MPartGrid>(workbenchNavigationalState?.grids ?? previousLayout?.grids),\n      },\n      activityLayout: workbenchNavigationalState?.activityLayout ?? previousLayout?.activityLayout,\n      perspectiveId: workbenchNavigationalState?.perspectiveId ?? previousLayout?.perspectiveId,\n      navigationStates: workbenchNavigationalState?.navigationStates ?? previousLayout?.navigationStates(),\n      outlets: Object.fromEntries(Routing.parseOutlets(urlTree, {part: true, view: true})),\n    });\n\n    const undoActions = new Array<() => void>();\n    const postNavigationActions = new Array<() => void>();\n\n    return {\n      layout: newLayout,\n      previousLayout,\n      layoutDiff: this._workbenchLayoutDiffer.diff(newLayout),\n      outletDiff: this._workbenchOutletDiffer.diff(newLayout, urlTree),\n      undoChanges: () => {\n        // Revert differs to the state before the navigation.\n        this._workbenchLayoutDiffer.diff(previousLayout);\n        this._workbenchOutletDiffer.diff(previousLayout, previousUrl);\n        // Run registered undo actions.\n        undoActions.forEach(action => action());\n      },\n      runPostNavigationActions: () => postNavigationActions.forEach(action => action()),\n      registerUndoAction: action => undoActions.push(action),\n      registerPostNavigationAction: action => postNavigationActions.push(action),\n    };\n  }\n\n  /**\n   * For each added workbench outlet, registers auxiliary routes of all top-level routes.\n   */\n  private registerAddedOutletAuxiliaryRoutes(): void {\n    const navigationContext = this._workbenchRouter.getCurrentNavigationContext();\n\n    // Register view auxiliary routes.\n    const addedViewOutlets = navigationContext.outletDiff.addedViewOutlets;\n    if (addedViewOutlets.length) {\n      const auxiliaryRoutes = this._auxiliaryRouteInstaller.registerAuxiliaryRoutes(addedViewOutlets, {notFoundRoute: matchesIfNavigated});\n      this._logger.debug(() => `Registered auxiliary routes for views: ${addedViewOutlets}`, LoggerNames.ROUTING, auxiliaryRoutes);\n    }\n\n    // Register part auxiliary routes.\n    const addedPartOutlets = navigationContext.outletDiff.addedPartOutlets;\n    if (addedPartOutlets.length) {\n      const auxiliaryRoutes = this._auxiliaryRouteInstaller.registerAuxiliaryRoutes(addedPartOutlets, {notFoundRoute: matchesIfNavigated});\n      this._logger.debug(() => `Registered auxiliary routes for parts: ${addedPartOutlets}`, LoggerNames.ROUTING, auxiliaryRoutes);\n    }\n\n    // Revert registration if the navigation fails.\n    navigationContext.registerUndoAction(() => {\n      const addedOutlets = [...addedViewOutlets, ...addedPartOutlets];\n      this._auxiliaryRouteInstaller.unregisterAuxiliaryRoutes(addedOutlets);\n    });\n  }\n\n  /**\n   * Unregisters auxiliary routes of removed workbench outlets.\n   */\n  private unregisterRemovedOutletAuxiliaryRoutes(): void {\n    const navigationContext = this._workbenchRouter.getCurrentNavigationContext();\n    const removedOutlets: string[] = [\n      ...navigationContext.outletDiff.removedViewOutlets,\n      ...navigationContext.outletDiff.removedPartOutlets,\n    ];\n    if (removedOutlets.length) {\n      this._logger.debug(() => 'Unregistering outlet auxiliary routes: ', LoggerNames.ROUTING, removedOutlets);\n      this._auxiliaryRouteInstaller.unregisterAuxiliaryRoutes(removedOutlets);\n    }\n  }\n\n  /**\n   * For each added part, constructs a {@link WorkbenchPart} and registers it in {@link WorkbenchPartRegistry}.\n   */\n  private registerAddedWorkbenchParts(): void {\n    const navigationContext = this._workbenchRouter.getCurrentNavigationContext();\n    const {layoutDiff, layout} = navigationContext;\n\n    layoutDiff.addedParts.forEach(partId => {\n      this._logger.debug(() => `Constructing ɵWorkbenchPart [partId=${partId}]`, LoggerNames.LIFECYCLE);\n      this._partRegistry.register(partId, this.createWorkbenchPart(partId, layout));\n      navigationContext.registerUndoAction(() => this._partRegistry.unregister(partId));\n    });\n  }\n\n  /**\n   * For each removed part, destroys the {@link WorkbenchPart} and unregisters it in {@link WorkbenchPartRegistry}.\n   */\n  private unregisterRemovedWorkbenchParts(): void {\n    const {layoutDiff} = this._workbenchRouter.getCurrentNavigationContext();\n\n    layoutDiff.removedParts.forEach(partId => {\n      this._logger.debug(() => `Destroying ɵWorkbenchPart [partId=${partId}]`, LoggerNames.LIFECYCLE);\n      this._partRegistry.unregister(partId);\n    });\n  }\n\n  /**\n   * For each added view, constructs a {@link WorkbenchView} and registers it in {@link WorkbenchViewRegistry}.\n   */\n  private registerAddedWorkbenchViews(): void {\n    const navigationContext = this._workbenchRouter.getCurrentNavigationContext();\n    const {layoutDiff, layout} = navigationContext;\n\n    layoutDiff.addedViews.forEach(viewId => {\n      this._logger.debug(() => `Constructing ɵWorkbenchView [viewId=${viewId}]`, LoggerNames.LIFECYCLE);\n      this._viewRegistry.register(viewId, this.createWorkbenchView(viewId, layout));\n      navigationContext.registerUndoAction(() => this._viewRegistry.unregister(viewId));\n    });\n  }\n\n  /**\n   * For each removed view, destroys the {@link WorkbenchView} and unregisters it from {@link WorkbenchViewRegistry}.\n   */\n  private unregisterRemovedWorkbenchViews(): void {\n    const {layoutDiff} = this._workbenchRouter.getCurrentNavigationContext();\n\n    layoutDiff.removedViews.forEach(viewId => {\n      this._logger.debug(() => `Destroying ɵWorkbenchView [viewId=${viewId}]`, LoggerNames.LIFECYCLE);\n      this._viewRegistry.unregister(viewId);\n    });\n  }\n\n  private createWorkbenchPart(partId: PartId, layout: ɵWorkbenchLayout): ɵWorkbenchPart {\n    // Construct the handle in an injection context that shares the part's lifecycle, allowing for automatic cleanup of effects and RxJS interop functions.\n    const partInjector = Injector.create({parent: this._injector, providers: [], name: `Workbench Part ${partId}`});\n    return runInInjectionContext(partInjector, () => new ɵWorkbenchPart(partId, layout));\n  }\n\n  private createWorkbenchView(viewId: ViewId, layout: ɵWorkbenchLayout): ɵWorkbenchView {\n    // Construct the handle in an injection context that shares the view's lifecycle, allowing for automatic cleanup of effects and RxJS interop functions.\n    const viewInjector = Injector.create({parent: this._injector, providers: [], name: `Workbench View ${viewId}`});\n    return runInInjectionContext(viewInjector, () => new ɵWorkbenchView(viewId, layout));\n  }\n\n  /**\n   * Applies the current layout to the workbench.\n   */\n  private applyWorkbenchLayout(): void {\n    const {layout} = this._workbenchRouter.getCurrentNavigationContext();\n    this._workbenchLayoutService.setLayout(layout);\n    this._logger.debug(() => 'Applied workbench layout', LoggerNames.ROUTING, layout);\n  }\n\n  private installRouterEventListeners(): void {\n    this._router.events\n      .pipe(\n        filter((event: Event | RouterEvent): event is RouterEvent => event instanceof RouterEvent),\n        takeUntilDestroyed(),\n      )\n      .subscribe((event: RouterEvent) => {\n        if (event instanceof NavigationStart) {\n          this.onNavigationStart(event);\n        }\n        else if (event instanceof NavigationEnd) {\n          this.onNavigationEnd(event);\n        }\n        else if (event instanceof NavigationCancel) {\n          this.onNavigationCancel(event);\n        }\n        else if (event instanceof NavigationError) {\n          this.onNavigationError(event);\n        }\n      });\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable} from '@angular/core';\nimport {ViewDragService, ViewMoveEvent} from '../view-dnd/view-drag.service';\nimport {Router} from '@angular/router';\nimport {LocationStrategy} from '@angular/common';\nimport {ɵWorkbenchRouter} from '../routing/ɵworkbench-router.service';\nimport {Routing} from '../routing/routing.util';\nimport {ɵWorkbenchLayoutFactory} from '../layout/ɵworkbench-layout.factory';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {Defined} from '@scion/toolkit/util';\nimport {generatePerspectiveWindowName} from '../perspective/workbench-perspective.service';\nimport {ANONYMOUS_PERSPECTIVE_ID_PREFIX} from '../workbench.constants';\nimport {computePartId, computeViewId, WORKBENCH_ID} from '../workbench.identifiers';\nimport {UID} from '../common/uid.util';\nimport {filter} from 'rxjs/operators';\n\n/**\n * Updates the workbench layout when receiving a {@link ViewMoveEvent} event relevant for this application.\n */\n@Injectable({providedIn: 'root'})\nexport class ViewMoveHandler {\n\n  private readonly _workbenchId = inject(WORKBENCH_ID);\n  private readonly _workbenchRouter = inject(ɵWorkbenchRouter);\n  private readonly _workbenchLayoutFactory = inject(ɵWorkbenchLayoutFactory);\n  private readonly _router = inject(Router);\n  private readonly _locationStrategy = inject(LocationStrategy);\n\n  constructor() {\n    this.installViewMoveHandler();\n  }\n\n  /**\n   * Updates the workbench layout when receiving a {@link ViewMoveEvent} event relevant for this application.\n   */\n  private async onViewMove(event: ViewMoveEvent): Promise<void> {\n    const crossWorkbenchViewDrag = (event.source.workbenchId !== event.target.workbenchId);\n\n    // Check if to remove the view from this workbench instance if being moved to another workbench instance.\n    if (crossWorkbenchViewDrag && event.source.workbenchId === this._workbenchId) {\n      // Check if to add the view to a new browser window.\n      if (event.target.workbenchId === 'new-window') {\n        await this.moveViewToNewWindow(event);\n      }\n      else {\n        await this.removeView(event);\n      }\n    }\n    // Check if to add the view to this workbench instance if being moved from another workbench instance to this workbench instance.\n    else if (crossWorkbenchViewDrag && event.target.workbenchId === this._workbenchId) {\n      await this.addView(event);\n    }\n    // Move the view within the same workbench instance.\n    else {\n      await this.moveView(event);\n    }\n  }\n\n  private async addView(event: ViewMoveEvent): Promise<void> {\n    const region = event.target.region;\n    const addToNewPart = !!region;\n    const commands = Routing.segmentsToCommands(event.source.navigation?.path ?? []);\n\n    await this._workbenchRouter.navigate(layout => {\n      const newViewId = event.source.alternativeViewId ?? computeViewId();\n      if (addToNewPart) {\n        const newPartId = event.target.newPart?.id ?? computePartId();\n        return layout\n          .addPart(newPartId, {relativeTo: event.target.elementId, align: coerceAlignProperty(region), ratio: event.target.newPart?.ratio}, {structural: false})\n          .addView(newViewId, {partId: newPartId, activateView: true, activatePart: true, cssClass: event.source.classList?.get('layout')})\n          .modify(layout => event.source.navigation ? layout.navigateView(newViewId, commands, {hint: event.source.navigation.hint, cssClass: event.source.classList?.get('navigation'), data: event.source.navigation.data}) : layout);\n      }\n      else {\n        return layout\n          .addView(newViewId, {\n            partId: Defined.orElseThrow(event.target.elementId, () => Error(`[ViewMoveError] Target part required for region 'center'.`)),\n            position: event.target.position ?? 'after-active-view',\n            cssClass: event.source.classList?.get('layout'),\n            activateView: true,\n            activatePart: true,\n          })\n          .modify(layout => event.source.navigation ? layout.navigateView(newViewId, commands, {hint: event.source.navigation.hint, cssClass: event.source.classList?.get('navigation'), data: event.source.navigation.data}) : layout);\n      }\n    });\n  }\n\n  private async moveViewToNewWindow(event: ViewMoveEvent): Promise<void> {\n    // Open the view \"standalone\" in a blank window in an anonymous perspective.\n    const urlTree = await this._workbenchRouter.createUrlTree(() => {\n      const newLayout = this._workbenchLayoutFactory.create();\n      const newViewId = event.source.alternativeViewId ?? computeViewId();\n      const commands = Routing.segmentsToCommands(event.source.navigation?.path ?? []);\n      return newLayout\n        .addView(newViewId, {\n          partId: newLayout.activePart({grid: 'mainArea'}).id,\n          activateView: true,\n          cssClass: event.source.classList?.get('layout'),\n        })\n        .modify(layout => event.source.navigation ? layout.navigateView(newViewId, commands, {hint: event.source.navigation.hint, cssClass: event.source.classList?.get('navigation'), data: event.source.navigation.data}) : layout);\n    });\n    const target = generatePerspectiveWindowName(`${ANONYMOUS_PERSPECTIVE_ID_PREFIX}${UID.randomUID()}`);\n    if (window.open(this._locationStrategy.prepareExternalUrl(this._router.serializeUrl(urlTree!)), target)) {\n      await this.removeView(event);\n    }\n  }\n\n  private async removeView(event: ViewMoveEvent): Promise<void> {\n    await this._workbenchRouter.navigate(layout => layout.removeView(event.source.viewId, {force: true}));\n  }\n\n  private async moveView(event: ViewMoveEvent): Promise<void> {\n    const addToNewPart = !!event.target.region;\n    if (addToNewPart) {\n      const newPartId = event.target.newPart?.id ?? computePartId();\n      await this._workbenchRouter.navigate(layout => layout\n        .addPart(newPartId, {relativeTo: event.target.elementId, align: coerceAlignProperty(event.target.region!), ratio: event.target.newPart?.ratio}, {structural: false})\n        .moveView(event.source.viewId, newPartId, {activatePart: true, activateView: true}),\n      );\n    }\n    else {\n      const targetPartId = Defined.orElseThrow(event.target.elementId, () => Error(`[ViewMoveError] Target part required for region 'center'.`));\n      await this._workbenchRouter.navigate(layout => layout.moveView(event.source.viewId, targetPartId, {\n        position: event.target.position ?? (event.source.partId === targetPartId ? undefined : 'after-active-view'),\n        activateView: true,\n        activatePart: true,\n      }));\n    }\n  }\n\n  /**\n   * Subscribes to {@link ViewMoveEvent} events relevant for this app instance,\n   * invoking {@link onViewMove} for each event and signaling completion once the view has been moved.\n   */\n  private installViewMoveHandler(): void {\n    const viewDragService = inject(ViewDragService);\n\n    viewDragService.viewMove$\n      .pipe(\n        // Skip events not relevant for this app instance.\n        filter(event => event.source.workbenchId === this._workbenchId || event.target.workbenchId === this._workbenchId),\n        takeUntilDestroyed(),\n      )\n      .subscribe(event => {\n        void this.onViewMove(event).finally(() => viewDragService.signalViewMoved(event));\n      });\n  }\n}\n\nfunction coerceAlignProperty(region: 'north' | 'east' | 'south' | 'west' | 'center'): 'left' | 'right' | 'top' | 'bottom' {\n  switch (region) {\n    case 'west':\n      return 'left';\n    case 'east':\n      return 'right';\n    case 'north':\n      return 'top';\n    case 'south':\n      return 'bottom';\n    default:\n      throw Error(`[UnsupportedRegionError] Supported regions are 'north', 'east', 'south' or 'west', but is '${region}'.`);\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ComponentType} from '@angular/cdk/portal';\n\n/**\n * Patches '@scion/microfrontend-platform' typedef definition via module augmentation.\n */\ndeclare module '@scion/microfrontend-platform' {\n\n  /**\n   * Adds workbench-specific configuration to {@link @scion/microfrontend-platform!MicrofrontendPlatformConfig}.\n   */\n  export interface MicrofrontendPlatformConfig {\n    /**\n     * Splash to display until microfrontend signals readiness.\n     *\n     * A microfrontend can instruct the workbench to display a splash until signaled ready. By default, the workbench displays a loading indicator.\n     *\n     * @see WorkbenchViewCapability.properties.showSplash\n     * @see WorkbenchPopupCapability.properties.showSplash\n     */\n    splash?: ComponentType<unknown>;\n\n    /**\n     * Controls whether to preload inactive microfrontend views not defining the `lazy` property to maintain compatibility with applications setting view titles and headings in view microfrontends. Defaults to `false`.\n     *\n     * @deprecated since version 20.0.0-beta.6. Introduced in 20.0.0-beta.6 to maintain compatibility with applications setting view titles and headings in view microfrontends. View capabilities can now define localized titles with optional interpolation parameters using resolvers. Applications should migrate to lazy view capabilities by setting 'lazy' in capability properties and define titles in the manifest. API will be removed in version 22.\n     */\n    preloadInactiveViews?: true;\n  }\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Observable} from 'rxjs';\nimport {inject, Injectable, NgZone} from '@angular/core';\nimport {observeIn, subscribeIn} from '@scion/toolkit/operators';\nimport {ObservableDecorator} from '@scion/microfrontend-platform';\n\n/**\n * Mirrors the source, but ensures subscription and emission {@link NgZone} to be identical.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class NgZoneObservableDecorator implements ObservableDecorator {\n\n  private readonly _zone = inject(NgZone);\n\n  public decorate$<T>(source$: Observable<T>): Observable<T> {\n    return new Observable<T>(observer => {\n      const insideAngular = NgZone.isInAngularZone();\n      const subscription = source$\n        .pipe(\n          subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n          observeIn(fn => insideAngular ? this._zone.run(fn) : this._zone.runOutsideAngular(fn)),\n        )\n        .subscribe(observer);\n      return () => subscription.unsubscribe();\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {MicrofrontendPlatformConfig} from '@scion/microfrontend-platform';\nimport {Injectable} from '@angular/core';\n\n/**\n * Allows loading the configuration for the SCION Microfrontend Platform asynchronously, e.g., over the network or from a JSON file.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as used as DI token for the actual config. */)\nexport abstract class MicrofrontendPlatformConfigLoader {\n\n  /**\n   * Loads the platform configuration asynchronously.\n   */\n  public abstract load(): Promise<MicrofrontendPlatformConfig>;\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {DestroyRef, EnvironmentProviders, inject, Injectable, Injector, makeEnvironmentProviders, NgZone, Provider} from '@angular/core';\nimport {MicrofrontendPlatform, MicrofrontendPlatformConfig, MicrofrontendPlatformHost, ObservableDecorator} from '@scion/microfrontend-platform';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {Logger, LoggerNames} from '../logging';\nimport {NgZoneObservableDecorator} from './ng-zone-observable-decorator';\nimport {MicrofrontendPlatformStartupPhase, provideMicrofrontendPlatformInitializer, runMicrofrontendPlatformInitializers} from './microfrontend-platform-initializer';\nimport {MicrofrontendPlatformConfigLoader} from './microfrontend-platform-config-loader';\nimport {WorkbenchDialogService, WorkbenchMessageBoxService, WorkbenchNotificationService, WorkbenchPopupService, WorkbenchRouter, WorkbenchTextService, ɵWorkbenchDialogService, ɵWorkbenchMessageBoxService, ɵWorkbenchNotificationService, ɵWorkbenchPopupService, ɵWorkbenchRouter, ɵWorkbenchTextService} from '@scion/workbench-client';\nimport {WorkbenchConfig} from '../workbench-config';\nimport {provideWorkbenchInitializer} from '../startup/workbench-initializer';\n\n/**\n * Provides a set of DI providers starting the SCION Microfrontend Platform.\n */\nexport function provideMicrofrontendPlatform(config: WorkbenchConfig): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    provideWorkbenchInitializer(startMicrofrontendPlatform),\n    provideMicrofrontendPlatformConfigLoader(config),\n    provideMicrofrontendPlatformInitializer(onPreStartup, {phase: MicrofrontendPlatformStartupPhase.PreStartup}),\n    NgZoneObservableDecorator,\n  ]);\n\n  function onPreStartup(): void {\n    // Register beans of @scion/workbench-client.\n    Beans.register(WorkbenchRouter, {useClass: ɵWorkbenchRouter});\n    Beans.register(WorkbenchDialogService, {useClass: ɵWorkbenchDialogService});\n    Beans.register(WorkbenchMessageBoxService, {useClass: ɵWorkbenchMessageBoxService});\n    Beans.register(WorkbenchPopupService, {useClass: ɵWorkbenchPopupService});\n    Beans.register(WorkbenchNotificationService, {useClass: ɵWorkbenchNotificationService});\n    Beans.register(WorkbenchTextService, {useClass: ɵWorkbenchTextService});\n\n    // Synchronize emissions of Observables exposed by the SCION Microfrontend Platform with the Angular zone.\n    Beans.register(ObservableDecorator, {useValue: inject(NgZoneObservableDecorator)});\n  }\n}\n\n/**\n * Starts the SCION Microfrontend Platform.\n */\nasync function startMicrofrontendPlatform(): Promise<void> {\n  const zone = inject(NgZone);\n  const logger = inject(Logger);\n  const injector = inject(Injector);\n\n  logger.debug('Starting SCION Microfrontend Platform...', LoggerNames.LIFECYCLE);\n\n  // Load config of the SCION Microfrontend Platform.\n  const microfrontendPlatformConfig: Mutable<MicrofrontendPlatformConfig> = await inject(MicrofrontendPlatformConfigLoader).load();\n\n  // Disable scope check for the workbench to read private capabilities.\n  microfrontendPlatformConfig.host = {\n    ...microfrontendPlatformConfig.host, // eslint-disable-line @typescript-eslint/no-misused-spread\n    scopeCheckDisabled: true,\n  };\n\n  // Create injector to provide the config during platform startup.\n  const injectorWithConfig = Injector.create({\n    parent: injector,\n    providers: [{provide: MicrofrontendPlatformConfig, useValue: microfrontendPlatformConfig}],\n  });\n\n  // Run initializers in `PreStartup` phase.\n  await runMicrofrontendPlatformInitializers(MicrofrontendPlatformStartupPhase.PreStartup, injectorWithConfig);\n\n  // Run initializers in `PostStartup` phase; must be done in runlevel 2, i.e., before activator microfrontends are installed.\n  Beans.registerInitializer({\n    useFunction: () => zone.run(() => runMicrofrontendPlatformInitializers(MicrofrontendPlatformStartupPhase.PostStartup, injectorWithConfig)),\n    runlevel: 2,\n  });\n\n  // Start the SCION Microfrontend Platform.\n  // We start the platform outside the Angular zone to avoid excessive change detection cycles of platform-internal\n  // subscriptions to global DOM events.\n  await zone.runOutsideAngular(() => MicrofrontendPlatformHost.start(microfrontendPlatformConfig));\n\n  // Destroy the SCION Microfrontend Platform on shutdown.\n  injector.get(DestroyRef).onDestroy(() => void MicrofrontendPlatform.destroy());\n\n  logger.debug('SCION Microfrontend Platform started.', LoggerNames.LIFECYCLE, microfrontendPlatformConfig);\n}\n\n/**\n * Provides {@link MicrofrontendPlatformConfigLoader} for injection.\n */\nfunction provideMicrofrontendPlatformConfigLoader(config: WorkbenchConfig): Provider {\n  if (typeof config.microfrontendPlatform === 'function') {\n    return {\n      provide: MicrofrontendPlatformConfigLoader,\n      useClass: config.microfrontendPlatform,\n    };\n  }\n  else {\n    return {\n      provide: MicrofrontendPlatformConfigLoader,\n      useClass: StaticMicrofrontendPlatformConfigLoader,\n    };\n  }\n}\n\n/**\n * Make all properties in T mutable.\n */\ntype Mutable<T> = {\n  -readonly [P in keyof T]: T[P];\n};\n\n/**\n * Provides {@link WorkbenchConfig.microfrontendPlatform} config as passed to {@link provideWorkbench}.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as contributed conditionally. */)\nclass StaticMicrofrontendPlatformConfigLoader implements MicrofrontendPlatformConfigLoader {\n\n  private readonly _workbenchConfig = inject(WorkbenchConfig);\n\n  public async load(): Promise<MicrofrontendPlatformConfig> {\n    return this._workbenchConfig.microfrontendPlatform! as MicrofrontendPlatformConfig;\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/**\n * Returns the error message if given an error object, or the `toString` representation otherwise.\n */\nexport function stringifyError(error: unknown): string {\n  if (error instanceof Error) {\n    return error.message;\n  }\n  return `${error}`;\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, effect, ElementRef, inject, input, signal, Signal, TemplateRef, untracked, viewChild, ViewContainerRef} from '@angular/core';\nimport {setStyle} from '../common/dom.util';\nimport {boundingClientRect} from '@scion/components/dimension';\nimport {rootEffect} from '../common/rxjs-interop.util';\n\n/**\n * Projects `ng-content` to a top-level DOM element and aligns it with this component's bounding box.\n *\n * When this component is moved in the DOM, projected content is not moved in the DOM; only its position and size are changed.\n * For example, an iframe would reload when moved in the DOM.\n *\n * Style `ng-content` outside the `:host` CSS pseudo-class as not a direct child of this component.\n *\n * ---\n * Usage:\n * ```html\n * <wb-content-as-overlay [config]=\"...\">\n *   <iframe [src]=\"...\"></iframe>\n * </wb-content-as-overlay>\n * ```\n *\n * ```scss\n * iframe {\n *   background-color: gray;\n * }\n * ```\n */\n@Component({\n  selector: 'wb-content-as-overlay',\n  templateUrl: './content-as-overlay.component.html',\n})\nexport class ContentAsOverlayComponent {\n\n  /**\n   * Configures content projection of `ng-content`.\n   *\n   * A config input is used instead of separate input properties to support updating the config if detached from the Angular change detector.\n   */\n  public readonly config = input.required<ContentAsOverlayConfig>();\n\n  private readonly _template = viewChild.required(TemplateRef);\n  private readonly _visible = computed(() => this.config().visible());\n  private readonly _location = computed(() => this.config().location());\n  private readonly _overlay = signal<HTMLElement | undefined>(undefined);\n\n  constructor() {\n    this.createOverlay();\n    this.alignOverlayToHostBounds();\n  }\n\n  /**\n   * Creates the overlay for rendering projected content.\n   */\n  private createOverlay(): void {\n    effect(onCleanup => {\n      const location = this._location();\n      if (!location) {\n        return;\n      }\n\n      const template = this._template();\n\n      untracked(() => {\n        // Create an embedded view from the content template.\n        const overlayViewRef = location.createEmbeddedView(template, null);\n        overlayViewRef.detectChanges();\n        if (overlayViewRef.rootNodes.length !== 1) {\n          throw Error(`[ContentAsOverlayError] Expected single root node for content projection, but received ${overlayViewRef.rootNodes.length} root nodes.`);\n        }\n        const [overlayElement] = overlayViewRef.rootNodes as [HTMLElement];\n\n        // Position projected content out of the document flow relative to the page viewport.\n        setStyle(overlayElement, {position: 'fixed'});\n\n        this._overlay.set(overlayElement);\n\n        // Destroy overlay when the location or template changes.\n        onCleanup(() => untracked(() => {\n          overlayViewRef.destroy();\n          this._overlay.set(undefined);\n        }));\n      });\n    }); // Do not run as root effect for component inputs to be available in the effect.\n  }\n\n  /**\n   * Aligns the overlay to the bounding box of this component.\n   */\n  private alignOverlayToHostBounds(): void {\n    const hostBounds = boundingClientRect(inject(ElementRef<HTMLElement>));\n\n    // Use root effect to run even if the parent component is detached from change detection (e.g., if the view is not visible).\n    rootEffect(() => {\n      const overlay = this._overlay();\n      if (!overlay) {\n        return;\n      }\n\n      // Maintain position and size when hidden to prevent flickering when visible again and to support for virtual scrolling in projected content.\n      const visible = this._visible();\n      if (!visible) {\n        setStyle(overlay, {visibility: 'hidden'}); // Hide via `visibility` instead of `display` property to retain the size.\n        return;\n      }\n\n      // IMPORTANT: Track host bounds only if visible to prevent flickering.\n      const {top, left, width, height} = hostBounds();\n      setStyle(overlay, {\n        top: `${top}px`,\n        left: `${left}px`,\n        width: `${width}px`,\n        height: `${height}px`,\n        visibility: null,\n      });\n    });\n  }\n}\n\n/**\n * Configures content projection.\n */\nexport interface ContentAsOverlayConfig {\n  /**\n   * Specifies the location where to attach projected content in the DOM.\n   */\n  location: Signal<ViewContainerRef | undefined>;\n  /**\n   * Controls the visibility of the projected content.\n   */\n  visible: Signal<boolean>;\n}\n","<ng-template>\n  <ng-content/>\n</ng-template>\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {SciThrobberComponent} from '@scion/components/throbber';\n\n@Component({\n  selector: 'wb-microfrontend-splash',\n  templateUrl: './microfrontend-splash.component.html',\n  styleUrls: ['./microfrontend-splash.component.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  imports: [SciThrobberComponent],\n})\nexport class MicrofrontendSplashComponent {\n}\n","<sci-throbber type=\"ellipsis\"/>\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {APP_IDENTITY, Capability, SciRouterOutletElement} from '@scion/microfrontend-platform';\nimport {DOCUMENT, ElementRef, inject, Injector, Signal, untracked} from '@angular/core';\nimport {WorkbenchTheme, ɵTHEME_CONTEXT_KEY} from '@scion/workbench-client';\nimport {WorkbenchService} from '../../workbench.service';\nimport {Crypto} from '@scion/toolkit/crypto';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {first} from 'rxjs/operators';\nimport {rootEffect} from '../../common/rxjs-interop.util';\nimport {Beans} from '@scion/toolkit/bean-manager';\n\n/**\n * Provides functions related to workbench themes.\n */\nexport const Microfrontends = {\n  /**\n   * Propagates the workbench theme and color scheme via contextual data to the microfrontend displayed in the given router outlet,\n   * ensuring consistent styling across microfrontends.\n   *\n   * This method must be passed an injector or called in an injection context. If used in a component, use the component's injector.\n   * Stops theme propagation when the injection context is destroyed.\n   */\n  propagateTheme: (routerOutletElement: Signal<SciRouterOutletElement | ElementRef<SciRouterOutletElement>>, options?: {injector?: Injector}): void => {\n    const injector = options?.injector ?? inject(Injector);\n    const documentRoot = injector.get(DOCUMENT).documentElement;\n    const settings = injector.get(WorkbenchService).settings;\n\n    // Use root effect to run even if the parent component is detached from change detection (e.g., if the view is not visible).\n    rootEffect(() => {\n      const routerOutlet = coerceElement(routerOutletElement());\n      const theme = settings.theme();\n\n      untracked(() => {\n        if (theme) {\n          const colorScheme = getComputedStyle(documentRoot).colorScheme as 'light' | 'dark';\n          routerOutlet.setContextValue<WorkbenchTheme>(ɵTHEME_CONTEXT_KEY, {name: theme, colorScheme});\n          routerOutlet.setContextValue('color-scheme', colorScheme);\n        }\n        else {\n          routerOutlet.removeContextValue(ɵTHEME_CONTEXT_KEY);\n          routerOutlet.removeContextValue('color-scheme');\n        }\n      });\n    }, {injector});\n  },\n  /**\n   * Waits for contextual data to be available to embedded content.\n   *\n   * This method must be passed an injector or called in an injection context. If used in a component, use the component's injector.\n   * Stops waiting when the injection context is destroyed.\n   */\n  waitForContext: (routerOutletElement: Signal<SciRouterOutletElement | ElementRef<SciRouterOutletElement>>, name: string, options?: {injector?: Injector}): Promise<void> => {\n    const injector = options?.injector ?? inject(Injector);\n\n    return new Promise<void>(resolve => {\n      // Use root effect to run even if the parent component is detached from change detection (e.g., if the view is not visible).\n      rootEffect(onCleanup => {\n        const routerOutlet = coerceElement(routerOutletElement());\n\n        untracked(() => {\n          const subscription = routerOutlet.contextValues$\n            .pipe(first(context => context.has(name)))\n            .subscribe(() => resolve());\n          onCleanup(() => subscription.unsubscribe());\n        });\n      }, {injector});\n    });\n  },\n  /**\n   * Creates a stable identifier for given capability.\n   */\n  createStableIdentifier: async (capability: Capability): Promise<string> => {\n    const type = capability.type;\n    const qualifier = capability.qualifier!;\n    const application = capability.metadata!.appSymbolicName;\n\n    // Create identifier consisting of vendor and sorted qualifier entries.\n    const identifier = Object.entries(qualifier)\n      .sort(([key1], [key2]) => key1.localeCompare(key2))\n      .reduce(\n        (acc, [key, value]) => acc.concat(key).concat(`${value}`),\n        new Array<string>(application, type),\n      )\n      .join(';');\n\n    // Hash the identifier.\n    const identifierHash = await Crypto.digest(identifier);\n    // Use the first 7 digits of the hash.\n    return identifierHash.substring(0, 7);\n  },\n  /**\n   * Tests if given capability is provided by the host application.\n   */\n  isHostProvider: (capability: Partial<Capability>): boolean => {\n    return capability.metadata?.appSymbolicName === Beans.get(APP_IDENTITY);\n  },\n  /**\n   * Replaces named parameters in the given value with values contained in the given {@link Map}.\n   * Named parameters start with a colon (`:`).\n   */\n  substituteNamedParameters,\n} as const;\n\nfunction substituteNamedParameters(value: string, params?: Map<string, unknown>): string;\nfunction substituteNamedParameters(value: string | null, params?: Map<string, unknown>): string | null;\nfunction substituteNamedParameters(value: string | undefined, params?: Map<string, unknown>): string | undefined;\nfunction substituteNamedParameters(value: string | null | undefined, params?: Map<string, unknown>): string | null | undefined {\n  if (!value || !params?.size) {\n    return value;\n  }\n  return [...params].reduce((acc, [paramKey, paramValue]) => {\n    if (paramValue === undefined) {\n      return acc;\n    }\n    return acc.replaceAll(`:${paramKey}`, `${paramValue}`);\n  }, value);\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Translatable, WORKBENCH_TEXT_PROVIDER, WorkbenchTextProviderFn} from '../../text/workbench-text-provider.model';\nimport {EnvironmentProviders, makeEnvironmentProviders, Signal} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {animationFrameScheduler, combineLatest, concatWith, map, NEVER, Observable, of, ReplaySubject, share, switchMap, timer} from 'rxjs';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {mapToBody, MessageClient} from '@scion/microfrontend-platform';\nimport {WorkbenchTextService} from '@scion/workbench-client';\nimport {Dictionaries} from '@scion/toolkit/util';\nimport {finalize} from 'rxjs/operators';\n\n/**\n * Registers a text provider for the SCION Workbench to get texts from micro apps.\n *\n * This text provider provides texts for keys matching the format: \"workbench.external.scion-workbench-client.<APP_SYMBOLIC_NAME>.<TRANSLATABLE>\".\n *\n * @see createRemoteTranslatable\n */\nexport function provideRemoteTextProvider(): EnvironmentProviders {\n  const REMOTE_TRANSLATION_KEY = /^workbench\\.external\\.scion-workbench-client\\.(?<provider>[^\\\\.]+)\\.%(?<key>.+)$/;\n  const REMOTE_TEXT = /^workbench\\.external\\.scion-workbench-client\\.(?<provider>[^\\\\.]+)\\.(?<text>[^%].+)$/;\n  const cache = new Map<string, Observable<string>>();\n\n  return makeEnvironmentProviders([\n    {\n      provide: WORKBENCH_TEXT_PROVIDER,\n      useValue: provideRemoteText satisfies WorkbenchTextProviderFn,\n      multi: true,\n    },\n    {\n      provide: WORKBENCH_TEXT_PROVIDER,\n      useValue: interpolateRemoteText satisfies WorkbenchTextProviderFn,\n      multi: true,\n    },\n  ]);\n\n  /**\n   * Provides text from a remote app.\n   */\n  function provideRemoteText(translationKey: string | `workbench.external.scion-workbench-client.${string}.%${string}`, params: {[name: string]: string | `topic://${string}`}): Signal<string> | undefined {\n    // Test if the key matches a remote translation key.\n    const match = REMOTE_TRANSLATION_KEY.exec(translationKey);\n    if (!match) {\n      return undefined;\n    }\n\n    // Parse key and provider from the remote translation key.\n    const {key, provider} = match.groups as {key: string; provider: string};\n\n    // Return cached text if cached.\n    const cacheKey = createCacheKey(translationKey, params, provider);\n    if (cache.has(cacheKey)) {\n      return toSignal(cache.get(cacheKey)!, {initialValue: ''});\n    }\n\n    // Request the text by intent. Parameters starting with the topic protocol 'topic://' are resolved via messaging.\n    const text$ = observeParams$(params, {provider})\n      .pipe(\n        // Ensure the observable to never complete independent of text provider request completion, simplifying cache cleanup as\n        // finalize is only called when the last subscriber unsubscribes, after the specified TTL.\n        concatWith(NEVER),\n        switchMap(params => Beans.get(WorkbenchTextService).text$(`%${key}`, {provider, params: new Map(params)})),\n        map(text => text ?? `%${key}`),\n        // Remove cached text when an error occurs, or when the subscriber count drops to zero, after the specified TTL.\n        finalize(() => cache.delete(cacheKey)),\n        share({\n          connector: () => new ReplaySubject(1),\n          resetOnRefCountZero: () => timer(0, animationFrameScheduler), // reset asynchronously to prevent flickering of translated texts on re-layout\n        }),\n      );\n    cache.set(cacheKey, text$);\n\n    return toSignal(text$, {initialValue: ''});\n  }\n\n  /**\n   * Substitutes named parameters in a remote text.\n   */\n  function interpolateRemoteText(translationKey: string | `workbench.external.scion-workbench-client.${string}.${string}`, params: {[name: string]: string | `topic://${string}`}): Signal<string> | undefined {\n    // Test if the key matches a remote text.\n    const match = REMOTE_TEXT.exec(translationKey);\n    if (!match) {\n      return undefined;\n    }\n\n    // Parse text and provider from the remote text.\n    const {text, provider} = match.groups as {text: string; provider: string};\n\n    // Return cached text if cached.\n    const cacheKey = createCacheKey(translationKey, params, provider);\n    if (cache.has(cacheKey)) {\n      return toSignal(cache.get(cacheKey)!, {initialValue: ''});\n    }\n\n    // Substitute params. Parameters starting with the topic protocol 'topic://' are resolved via messaging.\n    const text$ = observeParams$(params, {provider})\n      .pipe(\n        // Never complete the observable, simplifying cache cleanup as `finalize` is only called when the last subscriber unsubscribes, after the specified TTL.\n        concatWith(NEVER),\n        map(params => params.reduce((text, [param, value]) => text.replaceAll(`:${param}`, value), decodeSemicolons(text))),\n        // Remove cached text when an error occurs, or when the subscriber count drops to zero, after the specified TTL.\n        finalize(() => cache.delete(cacheKey)),\n        share({\n          connector: () => new ReplaySubject(1),\n          resetOnRefCountZero: () => timer(0, animationFrameScheduler), // reset asynchronously to prevent flickering of translated texts on re-layout\n        }),\n      );\n    cache.set(cacheKey, text$);\n\n    return toSignal(text$, {initialValue: ''});\n  }\n\n  /**\n   * Creates an Observable that emits tuples of name-value pairs from the passed parameters.\n   *\n   * Parameters starting with the topic protocol 'topic://' are resolved via topic-based messaging.\n   */\n  function observeParams$(params: {[name: string]: string | `topic://${string}`}, options: {provider: string}): Observable<Array<[string, string]>> {\n    const observableParams: Array<Observable<[string, string]>> = Object.entries(params).map(([param, value]) => {\n      if (!value.startsWith(TOPIC_PROTOCOL)) {\n        return of([param, value]);\n      }\n\n      const topic = value.substring(TOPIC_PROTOCOL.length);\n      return Beans.get(MessageClient).request$<Translatable | undefined>(topic, undefined, {retain: true})\n        .pipe(\n          mapToBody(),\n          // Resolve text if the resolver returns a translatable.\n          switchMap(resolved => resolved?.startsWith('%') ? Beans.get(WorkbenchTextService).text$(resolved, options) : of(resolved)),\n          map(resolved => [param, resolved ?? '']),\n        );\n    });\n\n    return observableParams.length ? combineLatest(observableParams) : of([]);\n  }\n\n  /**\n   * Creates the cache key for specified translatable.\n   */\n  function createCacheKey(key: string, params: {[name: string]: string}, provider: string): string {\n    const translatable = Object.entries(params).reduce((translatable, [param, value]) => `${translatable};${param}=${value}`, `%${key}`);\n    return `${translatable}@${provider}`;\n  }\n}\n\n/**\n * Creates a translatable for the SCION Workbench to request the text from a micro app.\n *\n * Passed parameters are used to substitute named parameters in the text or interpolation parameters of the translation key.\n *\n * A named parameter starts with a colon (`:`) followed by the parameter name and can be substituted by an explicit value (passed as value param) or topic (passed as topic param).\n * Topic params define a topic with the actual value requested when resolving the translatable. A topic can also reference value params as named params in topic segments.\n *\n * @example - Translation Key\n * `%translationKey;param1=:namedParam1;param2=:namedParam2`\n *\n * @example - Text\n * `Text with :namedParam1 and :namedParam2`\n *\n * @param translatable - Specifies the translatable.\n * @param config - Specifies the text provider and values for substituting named parameters.\n * @return Translatable that can be passed to the workbench's {@link text()} function for translation.\n *\n * @see provideRemoteTextProvider\n */\nexport function createRemoteTranslatable(translatable: undefined, config: {appSymbolicName: string; valueParams?: {[name: string]: unknown} | Map<string, unknown>; topicParams?: {[name: string]: string} | Map<string, string>}): undefined;\nexport function createRemoteTranslatable(translatable: Translatable, config: {appSymbolicName: string; valueParams?: {[name: string]: unknown} | Map<string, unknown>; topicParams?: {[name: string]: string} | Map<string, string>}): Translatable;\nexport function createRemoteTranslatable(translatable: Translatable | undefined, config: {appSymbolicName: string; valueParams?: {[name: string]: unknown} | Map<string, unknown>; topicParams?: {[name: string]: string} | Map<string, string>}): Translatable | undefined;\nexport function createRemoteTranslatable(translatable: Translatable | undefined, config: {appSymbolicName: string; valueParams?: {[name: string]: unknown} | Map<string, unknown>; topicParams?: {[name: string]: string} | Map<string, string>}): Translatable | undefined {\n  if (!translatable || translatable === '%') {\n    return translatable;\n  }\n\n  // Create Map of value params.\n  const valueParams = new Map(Object.entries(Dictionaries.coerce(config.valueParams)).map(([param, value]) => [param, encodeSemicolons(value)]));\n  // Create Map of topic params, substituting referenced value params.\n  const topicParams = new Map(Object.entries(Dictionaries.coerce(config.topicParams)).map(([param, topic]) => [param, toTopicParam(topic)]));\n\n  // Return text as-is if not a translation key nor referencing parameters.\n  if (!translatable.startsWith('%') && !containsParam(translatable, valueParams) && !containsParam(translatable, topicParams)) {\n    return translatable;\n  }\n\n  const remoteTranslatablePrefix = `%workbench.external.scion-workbench-client.${config.appSymbolicName}`;\n  if (translatable.startsWith('%')) {\n    // Substitute named parameters in interpolation params.\n    return `${remoteTranslatablePrefix}.${translatable}`.replace(/(?<==):(?<namedParam>[^;]+)/g, (match: string, param: string) => valueParams.get(param) ?? topicParams.get(param) ?? match);\n  }\n  else {\n    // Append referenced parameters in matrix notation.\n    return [...valueParams, ...topicParams]\n      .filter(([param]) => translatable.includes(`:${param}`))\n      .reduce((translatable, [param, value]) => `${translatable};${param}=${value}`, `${remoteTranslatablePrefix}.${encodeSemicolons(translatable)}`);\n  }\n\n  /**\n   * Adds the topic protocol to indicate resolution via topic-based messaging and substitutes named topic segments.\n   */\n  function toTopicParam(topic: string): string {\n    return `${TOPIC_PROTOCOL}${topic.replace(/(?<=\\/|^):(?<namedParam>[^/]+)/g, (match: string, namedParam: string) => {\n      return valueParams.get(namedParam) ?? match;\n    })}`;\n  }\n\n  /**\n   * Tests whether the passed text references any of the passed params.\n   */\n  function containsParam(text: string, params: Map<string, unknown>): boolean {\n    return Array.from(params.keys()).some(param => text.includes(`:${param}`));\n  }\n}\n\n/**\n * Prefix of topic params.\n */\nconst TOPIC_PROTOCOL = 'topic://';\n\n/**\n * Encodes semicolons (`;`) as `&#x3b` (Unicode) to prevent interpretation as interpolation parameter separators.\n */\nfunction encodeSemicolons(value: unknown): string {\n  return `${value}`.replaceAll(';', '&#x3b');\n}\n\n/**\n * Decodes encoded semicolons (`&#x3b`) back to semicolons (`;`).\n */\nfunction decodeSemicolons(value: string): string {\n  return value.replaceAll('&#x3b', ';');\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectorRef, Component, computed, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, ElementRef, inject, Injector, linkedSignal, Provider, signal, Signal, untracked, viewChild} from '@angular/core';\nimport {firstValueFrom, MonoTypeOperatorFunction, switchMap, tap} from 'rxjs';\nimport {filter, first, map, take} from 'rxjs/operators';\nimport {ManifestService, mapToBody, MessageClient, MessageHeaders, MicrofrontendPlatformConfig, OutletRouter, ResponseStatusCodes, SciRouterOutletElement, TopicMessage} from '@scion/microfrontend-platform';\nimport {ManifestObjectCache} from '../manifest-object-cache.service';\nimport {WorkbenchViewCapability, ɵVIEW_CAPABILITY_ID_PARAM_NAME, ɵVIEW_ID_CONTEXT_KEY, ɵViewParamsUpdateCommand, ɵWorkbenchCommands} from '@scion/workbench-client';\nimport {Dictionaries, Maps, Objects} from '@scion/toolkit/util';\nimport {Logger, LoggerNames} from '../../logging';\nimport {CanCloseRef} from '../../workbench.model';\nimport {IFRAME_OVERLAY_HOST} from '../../workbench-element-references';\nimport {serializeExecution} from '../../common/operators';\nimport {ɵWorkbenchView} from '../../view/ɵworkbench-view.model';\nimport {ViewMenuService} from '../../part/view-context-menu/view-menu.service';\nimport {WorkbenchRouter} from '../../routing/workbench-router.service';\nimport {stringifyError} from '../../common/stringify-error.util';\nimport {MICROFRONTEND_VIEW_NAVIGATION_HINT, MICROFRONTEND_VIEW_STATE_TRANSIENT_PARAMS, splitMicrofrontendViewParams} from './microfrontend-view-routes';\nimport {NgComponentOutlet} from '@angular/common';\nimport {ContentAsOverlayComponent, ContentAsOverlayConfig} from '../../content-projection/content-as-overlay.component';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {WorkbenchLayoutService} from '../../layout/workbench-layout.service';\nimport {MicrofrontendSplashComponent} from '../microfrontend-splash/microfrontend-splash.component';\nimport {GLASS_PANE_BLOCKABLE, GLASS_PANE_OPTIONS, GlassPaneDirective, GlassPaneOptions} from '../../glass-pane/glass-pane.directive';\nimport {Microfrontends} from '../common/microfrontend.util';\nimport {WorkbenchView} from '../../view/workbench-view.model';\nimport {rootEffect, toRootObservable} from '../../common/rxjs-interop.util';\nimport {createRemoteTranslatable} from '../microfrontend-text/remote-text-provider';\nimport {prune} from '../../common/prune.util';\nimport {MicrofrontendViewNavigationData} from './microfrontend-view-navigation-data';\nimport {Routing} from '../../routing/routing.util';\n\n/**\n * Embeds the microfrontend of a view capability.\n */\n@Component({\n  selector: 'wb-microfrontend-view',\n  styleUrls: ['./microfrontend-view.component.scss'],\n  templateUrl: './microfrontend-view.component.html',\n  imports: [\n    ContentAsOverlayComponent,\n    NgComponentOutlet,\n    GlassPaneDirective,\n  ],\n  viewProviders: [\n    configureMicrofrontendGlassPane(),\n  ],\n  schemas: [CUSTOM_ELEMENTS_SCHEMA], // required because <sci-router-outlet> is a custom element\n})\nexport class MicrofrontendViewComponent {\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _outletRouter = inject(OutletRouter);\n  private readonly _manifestService = inject(ManifestService);\n  private readonly _messageClient = inject(MessageClient);\n  private readonly _logger = inject(Logger);\n  private readonly _workbenchRouter = inject(WorkbenchRouter);\n  private readonly _injector = inject(Injector);\n  private readonly _changeDetectorRef = inject(ChangeDetectorRef);\n\n  private readonly _routerOutletElement = viewChild.required<ElementRef<SciRouterOutletElement>>('router_outlet');\n  private readonly _universalKeystrokes = [\n    ['escape'], // keystroke to close notifications\n    ['ctrl', 'shift', 'F12'], // keystroke to minimize activities\n  ];\n\n  protected readonly view = inject(ɵWorkbenchView);\n  protected readonly workbenchLayoutService = inject(WorkbenchLayoutService);\n  /** Splash to display until the microfrontend signals readiness. */\n  protected readonly splash = inject(MicrofrontendPlatformConfig).splash ?? MicrofrontendSplashComponent;\n  /** Keystrokes which to bubble across iframe boundaries from embedded content. */\n  protected readonly keystrokesToBubble = this.computeKeyStrokesToBubble();\n  protected readonly focusWithin = signal(false);\n  /** Configures iframe projection. */\n  protected readonly overlayConfig: ContentAsOverlayConfig = {\n    location: inject(IFRAME_OVERLAY_HOST),\n    visible: this.view.slot.portal.attached,\n  };\n\n  protected readonly navigationContext = this.computeNavigationContext();\n\n  constructor() {\n    this._logger.debug(() => `Constructing MicrofrontendViewComponent. [viewId=${this.view.id}]`, LoggerNames.MICROFRONTEND_ROUTING);\n    this.installViewActivePublisher();\n    this.installViewFocusedPublisher();\n    this.installPartIdPublisher();\n    this.installCanCloseGuard();\n    this.installMenuAccelerators();\n    this.propagateWorkbenchTheme();\n    this.propagateViewContext();\n    this.installNavigator();\n    this.installParamsUpdater();\n\n    inject(DestroyRef).onDestroy(() => this.unload());\n  }\n\n  private installNavigator(): void {\n    // Use a root effect to emit even if detached from change detection.\n    toRootObservable(this.navigationContext)\n      .pipe(\n        tap(context => this.onPreNavigate(context)),\n        filter((context): context is NavigationContext => !!context.capability),\n        delayIfLazy(),\n        serializeExecution(context => this.onNavigate(context)),\n        takeUntilDestroyed(),\n      )\n      .subscribe();\n  }\n\n  /**\n   * Computes the current navigation of this microfrontend view.\n   */\n  private computeNavigationContext(): Signal<NavigationContext> {\n    const manifestObjectCache = inject(ManifestObjectCache);\n    const navigationData = computed(() => this.view.navigation()!.data as unknown as MicrofrontendViewNavigationData);\n    const transientParams = computed(() => this.view.navigation()!.state?.[MICROFRONTEND_VIEW_STATE_TRANSIENT_PARAMS] ?? {});\n    const capability = manifestObjectCache.capability<WorkbenchViewCapability>(computed(() => navigationData().capabilityId));\n\n    return linkedSignal({\n      source: () => ({navigationData: navigationData(), capability: capability(), transientParams: transientParams()}),\n      computation: ({navigationData, capability, transientParams}, previousNavigationContext) => ({\n        capabilityId: navigationData.capabilityId,\n        capability: capability,\n        prevCapability: previousNavigationContext?.value.capability,\n        params: Maps.coerce({\n          ...navigationData.params,\n          ...transientParams,\n        }),\n        referrer: navigationData.referrer,\n      }),\n      equal: (a, b) => a.capability?.metadata!.id === b.capability?.metadata!.id && Objects.isEqual(a.params, b.params), // do not create new navigation context when navigating to the same capability with the same params\n    });\n  }\n\n  /**\n   * Provides the view context to embedded content.\n   */\n  private propagateViewContext(): void {\n    // Use root effect to run even if the parent component is detached from change detection (e.g., if the view is not visible).\n    rootEffect(() => {\n      const routerOutletElement = this._routerOutletElement().nativeElement;\n      untracked(() => routerOutletElement.setContextValue(ɵVIEW_ID_CONTEXT_KEY, this.view.id));\n    });\n  }\n\n  /**\n   * Method invoked before performing the actual navigation.\n   *\n   * Unlike {@link onNavigate}, this method is also invoked if the view is inactive, allowing for updating view properties such as the view tab title.\n   */\n  private onPreNavigate(context: NavigationContext): void {\n    const {capability, params, prevCapability} = context;\n\n    // Signal application about unloading.\n    if (context.prevCapability?.metadata!.appSymbolicName !== capability?.metadata!.appSymbolicName) {\n      void this._messageClient.publish(ɵWorkbenchCommands.viewUnloadingTopic(this.view.id));\n    }\n\n    // Unset view properties on capability change.\n    if (!capability || prevCapability?.metadata!.id !== capability.metadata!.id) {\n      this.view.title = null;\n      this.view.heading = null;\n      this.view.classList.application = capability?.properties.cssClass;\n      this.view.closable = capability?.properties.closable ?? true;\n      this.view.dirty = false;\n    }\n\n    // Update configured title, if any, to substitute interpolation parameters.\n    if (capability?.properties.title) {\n      this.view.title = createRemoteTranslatable(capability.properties.title, {appSymbolicName: capability.metadata!.appSymbolicName, valueParams: params, topicParams: capability.properties.resolve});\n    }\n    // Update configured heading, if any, to substitute interpolation parameters.\n    if (capability?.properties.heading) {\n      this.view.heading = createRemoteTranslatable(capability.properties.heading, {appSymbolicName: capability.metadata!.appSymbolicName, valueParams: params, topicParams: capability.properties.resolve});\n    }\n\n    // Trigger manual change detection to update attributes on the `sci-router-outlet`,\n    // required for inactive views since detached from the Angular component tree.\n    if (!this.view.active()) {\n      this._changeDetectorRef.detectChanges();\n    }\n\n    // Unload microfrontend if capability was not found.\n    if (!capability) {\n      this._logger.warn(() => `[NullCapabilityError] No application found to provide a view capability of id '${context.capabilityId}'. Maybe, the requested view is not public API or the providing application not available.`, LoggerNames.MICROFRONTEND_ROUTING);\n\n      // Unload microfrontend and free resources.\n      this.unload();\n      void Routing.runCanMatchGuards({injector: this._injector});\n    }\n  }\n\n  /**\n   * Method invoked to perform a navigation.\n   *\n   * This method is invoked only if the view is active, blocking any subsequent navigation until this method returns.\n   */\n  private async onNavigate(context: NavigationContext): Promise<void> {\n    const capability = context.capability!;\n    const params = context.params;\n    const prevCapability = context.prevCapability;\n\n    // Pass parameters to the microfrontend.\n    await this._messageClient.publish(ɵWorkbenchCommands.viewParamsTopic(this.view.id), new Map(params).set(ɵVIEW_CAPABILITY_ID_PARAM_NAME, context.capabilityId), {retain: true});\n\n    // When navigating to another view capability of the same app, wait until transported the params to the microfrontend before loading the\n    // new microfrontend into the iframe, allowing the currently loaded microfrontend to clean up subscriptions.\n    if (prevCapability &&\n      prevCapability.metadata!.appSymbolicName === capability.metadata!.appSymbolicName &&\n      prevCapability.metadata!.id !== capability.metadata!.id) {\n      await this.waitForCapabilityParam(capability.metadata!.id);\n    }\n\n    // Wait for the context to be set on the router outlet, as @scion/workbench-client expects it to be available on startup.\n    if (!prevCapability) {\n      await Microfrontends.waitForContext(this._routerOutletElement, ɵVIEW_ID_CONTEXT_KEY, {injector: this._injector});\n    }\n\n    // Navigate to the microfrontend.\n    const application = this._manifestService.getApplication(capability.metadata!.appSymbolicName);\n    this._logger.debug(() => `Loading microfrontend into \"${this.view.id}\" [app=${capability.metadata!.appSymbolicName}, baseUrl=${application.baseUrl}, path=${(capability.properties.path)}].`, LoggerNames.MICROFRONTEND_ROUTING, params, capability);\n    await this._outletRouter.navigate(capability.properties.path, {\n      outlet: this.view.id,\n      relativeTo: application.baseUrl,\n      params: params,\n      pushStateToSessionHistoryStack: false,\n      showSplash: capability.metadata!.id !== prevCapability?.metadata?.id ? capability.properties.showSplash : false,\n    });\n  }\n\n  private installMenuAccelerators(): void {\n    // Since the iframe is added at a top-level location in the DOM, that is, not as a child element of this component,\n    // the workbench view misses keyboard events from embedded content. As a result, menu item accelerators of the context\n    // menu of this view do not work, so we install the accelerators on the router outlet as well.\n    inject(ViewMenuService).installMenuAccelerators(this._routerOutletElement, this.view);\n  }\n\n  /**\n   * Subscribes to requests from the currently loaded microfrontend to update its parameters.\n   */\n  private installParamsUpdater(): void {\n    this._messageClient.observe$<ɵViewParamsUpdateCommand>(ɵWorkbenchCommands.viewParamsUpdateTopic(this.view.id, ':capabilityId'))\n      .pipe(takeUntilDestroyed())\n      .subscribe((request: TopicMessage<ɵViewParamsUpdateCommand>) => {\n        const replyTo = request.headers.get(MessageHeaders.ReplyTo) as string;\n        const context = this.navigationContext();\n\n        // Ignore request if not target of this capability.\n        if (request.params!.get('capabilityId') !== context.capabilityId) {\n          return;\n        }\n\n        // Perform navigation to update view params.\n        void this._workbenchRouter.navigate(layout => {\n          // Cancel navigation if closed or navigated the view.\n          if (this.view.destroyed() || this.navigationContext() !== context) {\n            return null;\n          }\n\n          const paramsHandling = request.body!.paramsHandling;\n          const currentParams = Dictionaries.coerce(context.params);\n          const newParams = Dictionaries.coerce(request.body!.params);\n          const mergedParams = prune(paramsHandling === 'merge' ? {...currentParams, ...newParams} : newParams);\n          const {params, transientParams} = splitMicrofrontendViewParams(mergedParams, context.capability!);\n\n          return layout.navigateView(this.view.id, [], {\n            hint: MICROFRONTEND_VIEW_NAVIGATION_HINT,\n            data: {\n              capabilityId: context.capabilityId,\n              params,\n              referrer: context.referrer,\n            } satisfies MicrofrontendViewNavigationData,\n            state: prune({\n              [MICROFRONTEND_VIEW_STATE_TRANSIENT_PARAMS]: Object.keys(transientParams).length ? transientParams : undefined,\n            }),\n          });\n        })\n          .then(success => this._messageClient.publish(replyTo, success, {headers: new Map().set(MessageHeaders.Status, ResponseStatusCodes.TERMINAL)}))\n          .catch((error: unknown) => this._messageClient.publish(replyTo, stringifyError(error), {headers: new Map().set(MessageHeaders.Status, ResponseStatusCodes.ERROR)}));\n      });\n  }\n\n  private installViewActivePublisher(): void {\n    // Use root effect to run even if the parent component is detached from change detection (e.g., if the view is not visible).\n    rootEffect(() => {\n      const active = this.view.active();\n      untracked(() => {\n        const commandTopic = ɵWorkbenchCommands.viewActiveTopic(this.view.id);\n        void this._messageClient.publish(commandTopic, active, {retain: true});\n      });\n    });\n  }\n\n  private installViewFocusedPublisher(): void {\n    // Use root effect to run even if the parent component is detached from change detection (e.g., if the view is not visible).\n    rootEffect(() => {\n      const focused = this.view.focused();\n      untracked(() => {\n        const commandTopic = ɵWorkbenchCommands.viewFocusedTopic(this.view.id);\n        void this._messageClient.publish(commandTopic, focused, {retain: true});\n      });\n    });\n  }\n\n  private installPartIdPublisher(): void {\n    // Use root effect to run even if the parent component is detached from change detection (e.g., if the view is not visible).\n    rootEffect(() => {\n      const part = this.view.part();\n      untracked(() => {\n        const commandTopic = ɵWorkbenchCommands.viewPartIdTopic(this.view.id);\n        void this._messageClient.publish(commandTopic, part.id, {retain: true});\n      });\n    });\n  }\n\n  /**\n   * Promise that resolves once params contain the given capability id.\n   */\n  private async waitForCapabilityParam(capabilityId: string): Promise<void> {\n    const viewParams$ = this._messageClient.observe$<Map<string, string>>(ɵWorkbenchCommands.viewParamsTopic(this.view.id))\n      .pipe(\n        mapToBody(),\n        first(params => params.get(ɵVIEW_CAPABILITY_ID_PARAM_NAME) === capabilityId),\n      );\n    await firstValueFrom(viewParams$);\n  }\n\n  private installCanCloseGuard(): void {\n    const canCloseTopic = ɵWorkbenchCommands.canCloseTopic(this.view.id);\n    let canCloseRef: CanCloseRef | undefined;\n    this._messageClient.subscriberCount$(canCloseTopic)\n      .pipe(\n        map(count => count > 0),\n        takeUntilDestroyed(),\n      )\n      .subscribe(confirmClosing => {\n        if (confirmClosing) {\n          canCloseRef = this.view.canClose(() => this._messageClient.request$<boolean>(canCloseTopic).pipe(mapToBody()));\n        }\n        else {\n          canCloseRef?.dispose();\n        }\n      });\n  }\n\n  protected onFocusWithin(event: Event): void {\n    const {detail: focusWithin} = event as CustomEvent<boolean>;\n    this.focusWithin.set(focusWithin);\n\n    if (focusWithin) {\n      this._host.dispatchEvent(new CustomEvent('sci-microfrontend-focusin', {bubbles: true}));\n    }\n  }\n\n  /**\n   * Computes keystrokes to bubble through the iframe boundary.\n   */\n  private computeKeyStrokesToBubble(): Signal<string[]> {\n    return computed(() => {\n      const accelerators = [\n        ...this._universalKeystrokes,\n        ...this.view.menuItems().map(menuItem => menuItem.accelerator ?? []),\n      ];\n\n      return accelerators\n        .filter(accelerator => accelerator.length)\n        .map(accelerator => accelerator.map(segment => {\n          // Normalize keystrokes according to `SciRouterOutletElement#keystrokes`\n          switch (segment) {\n            case 'ctrl':\n              return 'control';\n            case '.':\n              return 'dot';\n            case ' ':\n              return 'space';\n            default:\n              return segment;\n          }\n        }))\n        .map(accelerator => `keydown.${accelerator.join('.')}{preventDefault=true}`);\n    }, {equal: (a, b) => Objects.isEqual(a, b, {ignoreArrayOrder: true})});\n  }\n\n  private propagateWorkbenchTheme(): void {\n    Microfrontends.propagateTheme(this._routerOutletElement);\n  }\n\n  private unload(): void {\n    // Delete retained messages to free resources.\n    void this._messageClient.publish(ɵWorkbenchCommands.viewActiveTopic(this.view.id), undefined, {retain: true});\n    void this._messageClient.publish(ɵWorkbenchCommands.viewFocusedTopic(this.view.id), undefined, {retain: true});\n    void this._messageClient.publish(ɵWorkbenchCommands.viewParamsTopic(this.view.id), undefined, {retain: true});\n    void this._messageClient.publish(ɵWorkbenchCommands.viewPartIdTopic(this.view.id), undefined, {retain: true});\n    void this._outletRouter.navigate(null, {outlet: this.view.id});\n  }\n}\n\n/**\n * Blocks the microfrontend outlet when dialog(s) overlay this view.\n */\nfunction configureMicrofrontendGlassPane(): Provider[] {\n  return [\n    {\n      provide: GLASS_PANE_BLOCKABLE,\n      useFactory: () => inject(ɵWorkbenchView),\n    },\n    {\n      provide: GLASS_PANE_OPTIONS,\n      useFactory: (): GlassPaneOptions => ({attributes: {'data-viewid': inject(WorkbenchView).id}}),\n    },\n  ];\n}\n\n/**\n * Mirrors the source if the view is active or non-lazy. Otherwise, emission is delayed until the view is activated.\n *\n * Cancels any previous delayed emission when the source emits again.\n */\nfunction delayIfLazy(): MonoTypeOperatorFunction<NavigationContext> {\n  // Use a root effect to continue emitting even if the component is detached from change detection.\n  const active$ = toRootObservable(inject(ɵWorkbenchView).active);\n\n  return switchMap(context => {\n    const lazy = context.capability!.properties.lazy ?? true;\n    return active$.pipe(\n      filter(active => active || !lazy),\n      map(() => context),\n      take(1),\n    );\n  });\n}\n\n/**\n * Context available during a navigation.\n */\ninterface NavigationContext {\n  capabilityId: string;\n  capability?: WorkbenchViewCapability;\n  prevCapability?: WorkbenchViewCapability;\n  params: Map<string, unknown>;\n  referrer: string;\n}\n","@let capability = navigationContext().capability;\n\n<wb-content-as-overlay [config]=\"overlayConfig\">\n  <div class=\"microfrontend-view\"\n       [class.workbench-drag]=\"workbenchLayoutService.dragging()\"\n       [attr.data-viewid]=\"view.id\"\n       wbGlassPane>\n    <sci-router-outlet #router_outlet\n                       [name]=\"view.id\"\n                       [attr.data-capabilityid]=\"capability?.metadata!.id\"\n                       [attr.data-app]=\"capability?.metadata!.appSymbolicName\"\n                       [attr.data-focus]=\"focusWithin() ? '' : null\"\n                       [keystrokes]=\"keystrokesToBubble()\"\n                       [class]=\"view.classList.asList()\"\n                       (focuswithin)=\"onFocusWithin($event)\">\n      <ng-container *ngComponentOutlet=\"splash\"/>\n    </sci-router-outlet>\n  </div>\n</wb-content-as-overlay>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability} from '@scion/microfrontend-platform';\nimport {Signal} from '@angular/core';\n\n/**\n * Provides capability and parameters of a host microfrontend.\n *\n * Can be injected into a microfrontend component of the host application.\n */\nexport abstract class ActivatedMicrofrontend {\n  /**\n   * Capability associated with the microfrontend.\n   */\n  public abstract readonly capability: Signal<Capability>;\n  /**\n   * Parameters passed to the microfrontend.\n   */\n  public abstract readonly params: Signal<Map<string, unknown>>;\n  /**\n   * Symbolic name of the application that opened the microfrontend.\n   */\n  public abstract readonly referrer: Signal<string>;\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, inject, Injector, input, Signal, untracked} from '@angular/core';\nimport {Logger, LoggerNames} from '../../logging';\nimport {rootEffect} from '../../common/rxjs-interop.util';\nimport {RouterOutlet} from '@angular/router';\nimport {RouterOutletRootContextDirective} from '../../routing/router-outlet-root-context.directive';\nimport {WorkbenchAuxiliaryRouteInstaller} from '../../routing/workbench-auxiliary-route-installer.service';\nimport {ActivatedMicrofrontend} from './microfrontend-host.model';\nimport {Routing} from '../../routing/routing.util';\nimport {WORKBENCH_ELEMENT} from '../../workbench-element-references';\nimport {MicrofrontendHostOutlet} from './microfrontend-host-routes';\n\n/**\n * Embeds the microfrontend of a capability provided by the workbench host application.\n */\n@Component({\n  selector: 'wb-microfrontend-host',\n  styleUrls: ['./microfrontend-host.component.scss'],\n  templateUrl: './microfrontend-host.component.html',\n  imports: [\n    RouterOutlet,\n    RouterOutletRootContextDirective,\n  ],\n  host: {\n    '[attr.data-capabilityid]': 'capability().metadata!.id',\n    '[attr.data-app]': 'capability().metadata!.appSymbolicName',\n    '[attr.data-focus]': `workbenchElement.focused() ? '' : null`,\n  },\n  providers: [\n    // Provide `ActivatedMicrofrontend` for DI in router outlet. Otherwise, `ActivatedMicrofrontend` would not be available, most likely because provided on the route level.\n    // TODO [Angular 22] Check if still required. If not, remove this TODO.\n    {provide: ActivatedMicrofrontend, useFactory: () => inject(ActivatedMicrofrontend, {skipSelf: true})},\n  ],\n})\nexport class MicrofrontendHostComponent {\n\n  /**\n   * Parameters passed to the microfrontend, required to reduce inputs for notification capabilities.\n   *\n   * @see MicrofrontendNotificationIntentHandler\n   */\n  public readonly params = input<Map<string, unknown>>();\n\n  private readonly _logger = inject(Logger);\n\n  protected readonly workbenchElement = inject(WORKBENCH_ELEMENT);\n  protected readonly capability = inject(ActivatedMicrofrontend).capability;\n  protected readonly outlet = this.computeOutlet();\n\n  constructor() {\n    this._logger.debug(() => `Constructing MicrofrontendHostComponent. [${this.workbenchElement}]`, LoggerNames.MICROFRONTEND_ROUTING);\n    this.registerOutletAuxiliaryRoutes();\n  }\n\n  /**\n   * Computes the router outlet name for the host microfrontend based on the workbench element and capability id.\n   */\n  private computeOutlet(): Signal<MicrofrontendHostOutlet> {\n    return computed((): MicrofrontendHostOutlet => `workbench.microfrontend.host.${this.capability().metadata!.id}.${this.workbenchElement.id}`);\n  }\n\n  /**\n   * Registers auxiliary routes of top-level primary routes for use as host microfrontend.\n   */\n  private registerOutletAuxiliaryRoutes(): void {\n    const auxiliaryRouteInstaller = inject(WorkbenchAuxiliaryRouteInstaller);\n    const injector = inject(Injector);\n\n    // Use root effect to run even if the parent component is detached from change detection.\n    rootEffect(onCleanup => {\n      const outlet = this.outlet();\n\n      untracked(() => {\n        const auxiliaryRoutes = auxiliaryRouteInstaller.registerAuxiliaryRoutes([outlet], {notFoundRoute: true});\n        this._logger.debug(() => `Registered auxiliary routes for host microfrontend: ${outlet}`, LoggerNames.ROUTING, auxiliaryRoutes);\n        void Routing.runCanMatchGuards({injector});\n\n        onCleanup(() => {\n          this._logger.debug(() => `Unregistered auxiliary routes for host microfrontend: ${outlet}`, LoggerNames.ROUTING, auxiliaryRoutes);\n          auxiliaryRouteInstaller.unregisterAuxiliaryRoutes([outlet]);\n        });\n      });\n    });\n  }\n}\n","<router-outlet [name]=\"outlet()\" wbRouterOutletRootContext/>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {computed, effect, inject, Injector, linkedSignal, Signal, untracked} from '@angular/core';\nimport {WorkbenchViewCapability} from '@scion/workbench-client';\nimport {MicrofrontendViewNavigationData} from '../microfrontend-view/microfrontend-view-navigation-data';\nimport {ManifestObjectCache} from '../manifest-object-cache.service';\nimport {Maps} from '@scion/toolkit/util';\nimport {createRemoteTranslatable} from '../microfrontend-text/remote-text-provider';\nimport {ɵWorkbenchView} from '../../view/ɵworkbench-view.model';\nimport {throwError} from '../../common/throw-error.util';\nimport {Routing} from '../../routing/routing.util';\n\n/** @inheritDoc */\nexport class MicrofrontendHostView implements ActivatedMicrofrontend {\n\n  public readonly capability: Signal<WorkbenchViewCapability>;\n  public readonly params: Signal<Map<string, unknown>>;\n  public readonly referrer: Signal<string>;\n\n  constructor(view: ɵWorkbenchView) {\n    const navigationData = computed(() => view.navigation()!.data as unknown as MicrofrontendViewNavigationData);\n    this.capability = this.trackViewCapability(navigationData);\n    this.params = computed(() => Maps.coerce(navigationData().params));\n    this.referrer = computed(() => navigationData().referrer);\n    this.setViewProperties(view);\n    this.runCanMatchGuardsIfCapabilityNotFound(navigationData);\n  }\n\n  private setViewProperties(view: ɵWorkbenchView): void {\n    // Unset view state on capability change.\n    effect(() => {\n      const capability = this.capability();\n\n      untracked(() => {\n        view.title = null;\n        view.heading = null;\n        view.classList.application = capability.properties.cssClass;\n        view.closable = capability.properties.closable ?? true;\n        view.dirty = false;\n      });\n    });\n\n    // Set title and heading on both capability and parameter changes to substitute interpolation parameters.\n    effect(() => {\n      const capability = this.capability();\n      const params = this.params();\n\n      untracked(() => {\n        // Compute title, if configured.\n        if (capability.properties.title) {\n          view.title = createRemoteTranslatable(capability.properties.title, {appSymbolicName: capability.metadata!.appSymbolicName, valueParams: params, topicParams: capability.properties.resolve});\n        }\n        // Compute heading, if configured.\n        if (capability.properties.heading) {\n          view.heading = createRemoteTranslatable(capability.properties.heading, {appSymbolicName: capability.metadata!.appSymbolicName, valueParams: params, topicParams: capability.properties.resolve});\n        }\n      });\n    });\n  }\n\n  private trackViewCapability(navigationData: Signal<MicrofrontendViewNavigationData>): Signal<WorkbenchViewCapability> {\n    const capability = inject(ManifestObjectCache).capability<WorkbenchViewCapability>(computed(() => navigationData().capabilityId));\n\n    return linkedSignal({\n      source: capability,\n      computation: (capability, previous) => {\n        if (capability) {\n          return capability;\n        }\n\n        // Fallback to previous capability, e.g., when unregistering the part capability while the part is open. See `runCanMatchGuardsIfCapabilityNotFound`.\n        return previous?.value ?? throwError(`[NullCapabilityError] View capability '${navigationData().capabilityId}' not found.`);\n      },\n    });\n  }\n\n  /**\n   * Instructs Angular to evaluate `CanMatch` route guards to display the \"Not Found\" page when unregistering the view capability while the view is open.\n   */\n  private runCanMatchGuardsIfCapabilityNotFound(navigationData: Signal<MicrofrontendViewNavigationData>): void {\n    const injector = inject(Injector);\n    const capability = inject(ManifestObjectCache).capability<WorkbenchViewCapability>(computed(() => navigationData().capabilityId));\n\n    effect(() => {\n      if (!capability()) {\n        untracked(() => void Routing.runCanMatchGuards({injector}));\n      }\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {CanMatchFn, Params, Route} from '@angular/router';\nimport {WorkbenchViewCapability} from '@scion/workbench-client';\nimport {EnvironmentProviders, inject, makeEnvironmentProviders, runInInjectionContext, StaticProvider} from '@angular/core';\nimport {ɵWorkbenchRouter} from '../../routing/ɵworkbench-router.service';\nimport {ViewId} from '../../workbench.identifiers';\nimport {MicrofrontendPlatform, PlatformState} from '@scion/microfrontend-platform';\nimport {ManifestObjectCache} from '../manifest-object-cache.service';\nimport {canMatchWorkbenchView} from '../../routing/workbench-route-guards';\nimport {WORKBENCH_ROUTE} from '../../workbench.constants';\nimport {MicrofrontendViewComponent} from './microfrontend-view.component';\nimport {MicrofrontendViewNavigationData} from './microfrontend-view-navigation-data';\nimport {WORKBENCH_OUTLET} from '../../routing/workbench-auxiliary-route-installer.service';\nimport {MicrofrontendHostComponent} from '../microfrontend-host/microfrontend-host.component';\nimport {WorkbenchViewRegistry} from '../../view/workbench-view.registry';\nimport {MicrofrontendHostView} from '../microfrontend-host-view/microfrontend-host-view.model';\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {Microfrontends} from '../common/microfrontend.util';\n\n/**\n * Hint passed to the navigation when navigating a microfrontend view.\n */\nexport const MICROFRONTEND_VIEW_NAVIGATION_HINT = 'scion.workbench.microfrontend-view';\n\n/**\n * Key for associating transient parameters with the navigation state of a microfrontend view navigation.\n */\nexport const MICROFRONTEND_VIEW_STATE_TRANSIENT_PARAMS = 'transientParams';\n\n/**\n * Splits given params into URL and transient params.\n */\nexport function splitMicrofrontendViewParams(params: Params, capability: WorkbenchViewCapability): {params: Params; transientParams: Params} {\n  const transientParamNames = new Set(capability.params?.filter(param => param.transient).map(param => param.name));\n\n  return Object.entries(params).reduce((groups, [name, value]: [string, unknown]) => {\n    if (transientParamNames.has(name)) {\n      groups.transientParams[name] = value;\n    }\n    else {\n      groups.params[name] = value;\n    }\n    return groups;\n  }, {params: {} as Params, transientParams: {} as Params});\n}\n\n/**\n * Provides the route for integrating microfrontend views.\n */\nexport function provideMicrofrontendViewRoute(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    // Route for embedding non-host microfrontend using <sci-router-outlet>.\n    {\n      provide: WORKBENCH_ROUTE,\n      useFactory: (): Route => ({\n        path: '',\n        component: MicrofrontendViewComponent,\n        canMatch: [canMatchMicrofrontendView({host: false})], // use a single matcher because Angular evaluates matchers in parallel\n      }),\n      multi: true,\n    },\n    // Route for embedding host microfrontend using Angular <router-outlet>.\n    {\n      provide: WORKBENCH_ROUTE,\n      useFactory: (): Route => ({\n        path: '',\n        component: MicrofrontendHostComponent,\n        canMatch: [canMatchMicrofrontendView({host: true})], // use a single matcher because Angular evaluates matchers in parallel\n        providers: [provideActivatedMicrofrontend()],\n      }),\n      multi: true,\n    },\n  ]);\n}\n\n/**\n * Matches the route if target of a workbench view navigated to a view microfrontend, but only\n * if the view capability exists.\n */\nfunction canMatchMicrofrontendView(matcher: {host: boolean}): CanMatchFn {\n  return (route, segments): boolean => {\n    if (!canMatchWorkbenchView(MICROFRONTEND_VIEW_NAVIGATION_HINT)(route, segments)) {\n      return false;\n    }\n\n    // Guards cannot block waiting for platform startup, as the platform may start later in the bootstrapping, causing a deadlock.\n    // Guards are re-evaluated after startup. See `runCanMatchGuardsAfterStartup`.\n    if (MicrofrontendPlatform.state !== PlatformState.Started) {\n      return false;\n    }\n\n    const viewId = inject(WORKBENCH_OUTLET) as ViewId;\n    const layout = inject(ɵWorkbenchRouter).getCurrentNavigationContext().layout;\n    const view = layout.view({viewId});\n    const {capabilityId} = view.navigation!.data as unknown as MicrofrontendViewNavigationData;\n    const capability = inject(ManifestObjectCache).capability(capabilityId)();\n    if (!capability) {\n      return false;\n    }\n\n    return matcher.host === Microfrontends.isHostProvider(capability);\n  };\n}\n\n/**\n * Provides {@link ActivatedMicrofrontend} for injection in the host microfrontend.\n */\nfunction provideActivatedMicrofrontend(): StaticProvider {\n  return {\n    provide: ActivatedMicrofrontend,\n    useFactory: () => {\n      const view = inject(WorkbenchViewRegistry).get(inject(WORKBENCH_OUTLET) as ViewId);\n      // Create in view's injection context to bind 'MicrofrontendView' to the view's lifecycle.\n      return runInInjectionContext(view.injector, () => new MicrofrontendHostView(view));\n    },\n  };\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/**\n * Keys for associating workbench-specific data with a perspective.\n */\nexport const WorkbenchPerspectiveData = {\n\n  /**\n   * Property to get the capability providing the perspective.\n   */\n  capability: 'ɵcapability',\n} as const;\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, ElementRef, inject, Injector, linkedSignal, Provider, signal, Signal, untracked, viewChild} from '@angular/core';\nimport {ManifestService, MessageClient, MicrofrontendPlatformConfig, OutletRouter, SciRouterOutletElement} from '@scion/microfrontend-platform';\nimport {ManifestObjectCache} from '../manifest-object-cache.service';\nimport {WorkbenchPartCapability, ɵWORKBENCH_PART_CONTEXT, ɵWorkbenchCommands, ɵWorkbenchPartContext} from '@scion/workbench-client';\nimport {Maps} from '@scion/toolkit/util';\nimport {Logger, LoggerNames} from '../../logging';\nimport {IFRAME_OVERLAY_HOST} from '../../workbench-element-references';\nimport {serializeExecution} from '../../common/operators';\nimport {NgComponentOutlet} from '@angular/common';\nimport {ContentAsOverlayComponent, ContentAsOverlayConfig} from '../../content-projection/content-as-overlay.component';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {WorkbenchLayoutService} from '../../layout/workbench-layout.service';\nimport {MicrofrontendSplashComponent} from '../microfrontend-splash/microfrontend-splash.component';\nimport {Microfrontends} from '../common/microfrontend.util';\nimport {rootEffect, toRootObservable} from '../../common/rxjs-interop.util';\nimport {ɵWorkbenchPart} from '../../part/ɵworkbench-part.model';\nimport {MicrofrontendPartNavigationData} from './microfrontend-part-navigation-data';\nimport {GLASS_PANE_BLOCKABLE, GLASS_PANE_OPTIONS, GlassPaneDirective, GlassPaneOptions} from '../../glass-pane/glass-pane.directive';\nimport {WorkbenchPart} from '../../part/workbench-part.model';\nimport {Routing} from '../../routing/routing.util';\n\n/**\n * Embeds the microfrontend of a part capability.\n */\n@Component({\n  selector: 'wb-microfrontend-part',\n  styleUrls: ['./microfrontend-part.component.scss'],\n  templateUrl: './microfrontend-part.component.html',\n  imports: [\n    ContentAsOverlayComponent,\n    NgComponentOutlet,\n    GlassPaneDirective,\n  ],\n  viewProviders: [\n    configureMicrofrontendGlassPane(),\n  ],\n  schemas: [CUSTOM_ELEMENTS_SCHEMA], // required because <sci-router-outlet> is a custom element\n})\nexport class MicrofrontendPartComponent {\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _outletRouter = inject(OutletRouter);\n  private readonly _manifestService = inject(ManifestService);\n  private readonly _messageClient = inject(MessageClient);\n  private readonly _logger = inject(Logger);\n  private readonly _injector = inject(Injector);\n  private readonly _routerOutletElement = viewChild.required<ElementRef<SciRouterOutletElement>>('router_outlet');\n\n  protected readonly part = inject(ɵWorkbenchPart);\n  protected readonly workbenchLayoutService = inject(WorkbenchLayoutService);\n  /** Splash to display until the microfrontend signals readiness. */\n  protected readonly splash = inject(MicrofrontendPlatformConfig).splash ?? MicrofrontendSplashComponent;\n  protected readonly focusWithin = signal(false);\n  /** Configures iframe projection. */\n  protected readonly overlayConfig: ContentAsOverlayConfig = {\n    location: inject(IFRAME_OVERLAY_HOST),\n    visible: this.part.slot.portal.attached,\n  };\n\n  protected readonly navigationContext = this.computeNavigationContext();\n\n  constructor() {\n    this._logger.debug(() => `Constructing MicrofrontendPartComponent. [partId=${this.part.id}]`, LoggerNames.MICROFRONTEND_ROUTING);\n    this.installPartActivePublisher();\n    this.installPartFocusedPublisher();\n    this.propagateWorkbenchTheme();\n    this.propagatePartContext();\n    this.installNavigator();\n\n    inject(DestroyRef).onDestroy(() => this.unload());\n  }\n\n  private installNavigator(): void {\n    // Use a root effect to emit even if detached from change detection.\n    toRootObservable(this.navigationContext)\n      .pipe(\n        serializeExecution(context => this.onNavigate(context)),\n        takeUntilDestroyed(),\n      )\n      .subscribe();\n  }\n\n  private async onNavigate(context: NavigationContext): Promise<void> {\n    if (!context.capability) {\n      this._logger.warn(() => `[NullCapabilityError] No application found to provide a part capability of id '${context.capabilityId}'. Maybe, the requested part is not public API or the providing application not available.`, LoggerNames.MICROFRONTEND_ROUTING);\n      this.unload();\n      void Routing.runCanMatchGuards({injector: this._injector});\n      return;\n    }\n\n    const {capability, params} = context;\n\n    // Wait for the context to be set on the router outlet, as @scion/workbench-client expects it to be available on startup.\n    await Microfrontends.waitForContext(this._routerOutletElement, ɵWORKBENCH_PART_CONTEXT, {injector: this._injector});\n\n    // Navigate to the microfrontend.\n    const application = this._manifestService.getApplication(capability.metadata!.appSymbolicName);\n    this._logger.debug(() => `Loading microfrontend into workbench part [partId=${this.part.id}, app=${capability.metadata!.appSymbolicName}, baseUrl=${application.baseUrl}, path=${(capability.properties!.path)}].`, LoggerNames.MICROFRONTEND_ROUTING, params, capability);\n    await this._outletRouter.navigate(capability.properties!.path!, {\n      outlet: this.part.id,\n      relativeTo: application.baseUrl,\n      params: params,\n      pushStateToSessionHistoryStack: false,\n      showSplash: context.prevCapability?.metadata!.id !== context.capabilityId ? capability.properties?.showSplash : false,\n    });\n  }\n\n  private installPartActivePublisher(): void {\n    // Use root effect to run even if the parent component is detached from change detection (e.g., if the part is not visible).\n    rootEffect(() => {\n      const active = this.part.active();\n      untracked(() => {\n        const commandTopic = ɵWorkbenchCommands.partActiveTopic(this.part.id);\n        void this._messageClient.publish(commandTopic, active, {retain: true});\n      });\n    });\n  }\n\n  private installPartFocusedPublisher(): void {\n    // Use root effect to run even if the parent component is detached from change detection (e.g., if the part is not visible).\n    rootEffect(() => {\n      const focused = this.part.focused();\n      untracked(() => {\n        const commandTopic = ɵWorkbenchCommands.partFocusedTopic(this.part.id);\n        void this._messageClient.publish(commandTopic, focused, {retain: true});\n      });\n    });\n  }\n\n  protected onFocusWithin(event: Event): void {\n    const {detail: focusWithin} = event as CustomEvent<boolean>;\n    this.focusWithin.set(focusWithin);\n\n    if (focusWithin) {\n      this._host.dispatchEvent(new CustomEvent('sci-microfrontend-focusin', {bubbles: true}));\n    }\n  }\n\n  /**\n   * Provides the part context to embedded content.\n   */\n  private propagatePartContext(): void {\n    // Run as root effect to run even if the parent component is detached from change detection (e.g., if the part is not visible).\n    rootEffect(() => {\n      const routerOutletElement = this._routerOutletElement().nativeElement;\n      const context = this.navigationContext();\n\n      untracked(() => {\n        if (context.capability) {\n          routerOutletElement.setContextValue<ɵWorkbenchPartContext>(ɵWORKBENCH_PART_CONTEXT, {\n            partId: this.part.id,\n            capability: context.capability,\n            params: context.params,\n          });\n        }\n        else {\n          routerOutletElement.removeContextValue(ɵWORKBENCH_PART_CONTEXT);\n        }\n      });\n    });\n  }\n\n  /**\n   * Computes the current navigation of this microfrontend part.\n   */\n  private computeNavigationContext(): Signal<NavigationContext> {\n    const manifestObjectCache = inject(ManifestObjectCache);\n    const navigationData = computed(() => this.part.navigation()!.data as unknown as MicrofrontendPartNavigationData);\n    const capability = manifestObjectCache.capability<WorkbenchPartCapability>(computed(() => navigationData().capabilityId));\n\n    return linkedSignal({\n      source: () => ({navigationData: navigationData(), capability: capability()}),\n      computation: ({navigationData, capability}, previousNavigationContext) => ({\n        capabilityId: navigationData.capabilityId,\n        capability: capability,\n        prevCapability: previousNavigationContext?.value.capability,\n        params: Maps.coerce(navigationData.params),\n      }),\n    });\n  }\n\n  private propagateWorkbenchTheme(): void {\n    Microfrontends.propagateTheme(this._routerOutletElement);\n  }\n\n  private unload(): void {\n    // Delete retained messages to free resources.\n    void this._messageClient.publish(ɵWorkbenchCommands.partActiveTopic(this.part.id), undefined, {retain: true});\n    void this._messageClient.publish(ɵWorkbenchCommands.partFocusedTopic(this.part.id), undefined, {retain: true});\n    void this._outletRouter.navigate(null, {outlet: this.part.id});\n  }\n}\n\n/**\n * Blocks the microfrontend outlet when dialog(s) overlay this part.\n */\nfunction configureMicrofrontendGlassPane(): Provider[] {\n  return [\n    {\n      provide: GLASS_PANE_BLOCKABLE,\n      useFactory: () => inject(ɵWorkbenchPart),\n    },\n    {\n      provide: GLASS_PANE_OPTIONS,\n      useFactory: (): GlassPaneOptions => ({attributes: {'data-partid': inject(WorkbenchPart).id}}),\n    },\n  ];\n}\n\n/**\n * Context available during a navigation.\n */\ninterface NavigationContext {\n  capabilityId: string;\n  capability?: WorkbenchPartCapability;\n  prevCapability?: WorkbenchPartCapability;\n  params: Map<string, unknown>;\n}\n","@let capability = navigationContext().capability;\n\n<wb-content-as-overlay [config]=\"overlayConfig\">\n  <div class=\"microfrontend-part\"\n       [class.workbench-drag]=\"workbenchLayoutService.dragging()\"\n       [attr.data-partid]=\"part.id\"\n       wbGlassPane>\n    <sci-router-outlet #router_outlet\n                       [name]=\"part.id\"\n                       [attr.data-capabilityid]=\"capability?.metadata!.id\"\n                       [attr.data-app]=\"capability?.metadata!.appSymbolicName\"\n                       [attr.data-focus]=\"focusWithin() ? '' : null\"\n                       [keystrokes]=\"['keydown.escape','keydown.control.shift.F12']\"\n                       [class]=\"part.classList.asList()\"\n                       (focuswithin)=\"onFocusWithin($event)\">\n      <ng-container *ngComponentOutlet=\"splash\"/>\n    </sci-router-outlet>\n  </div>\n</wb-content-as-overlay>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {computed, effect, inject, Injector, linkedSignal, Signal, untracked} from '@angular/core';\nimport {WorkbenchPartCapability} from '@scion/workbench-client';\nimport {ManifestObjectCache} from '../manifest-object-cache.service';\nimport {throwError} from '../../common/throw-error.util';\nimport {Maps} from '@scion/toolkit/util';\nimport {ɵWorkbenchPart} from '../../part/ɵworkbench-part.model';\nimport {MicrofrontendPartNavigationData} from '../microfrontend-part/microfrontend-part-navigation-data';\nimport {Routing} from '../../routing/routing.util';\n\n/** @inheritDoc */\nexport class MicrofrontendHostPart implements ActivatedMicrofrontend {\n\n  public readonly capability: Signal<WorkbenchPartCapability>;\n  public readonly params: Signal<Map<string, unknown>>;\n  public readonly referrer: Signal<string>;\n\n  constructor(part: ɵWorkbenchPart) {\n    const navigationData = computed(() => part.navigation()!.data as unknown as MicrofrontendPartNavigationData);\n    this.capability = this.trackPartCapability(navigationData);\n    this.params = computed(() => Maps.coerce(navigationData().params));\n    this.referrer = computed(() => navigationData().referrer);\n    this.runCanMatchGuardsIfCapabilityNotFound(navigationData);\n  }\n\n  private trackPartCapability(navigationData: Signal<MicrofrontendPartNavigationData>): Signal<WorkbenchPartCapability> {\n    const capability = inject(ManifestObjectCache).capability<WorkbenchPartCapability>(computed(() => navigationData().capabilityId));\n\n    return linkedSignal({\n      source: capability,\n      computation: (capability, previous) => {\n        if (capability) {\n          return capability;\n        }\n\n        // Fallback to previous capability, e.g., when unregistering the part capability while the part is open. See `runCanMatchGuardsIfCapabilityNotFound`.\n        return previous?.value ?? throwError(`[NullCapabilityError] Part capability '${navigationData().capabilityId}' not found.`);\n      },\n    });\n  }\n\n  /**\n   * Instructs Angular to evaluate `CanMatch` route guards to display the \"Not Found\" page when unregistering the part capability while the part is open.\n   */\n  private runCanMatchGuardsIfCapabilityNotFound(navigationData: Signal<MicrofrontendPartNavigationData>): void {\n    const injector = inject(Injector);\n    const capability = inject(ManifestObjectCache).capability<WorkbenchPartCapability>(computed(() => navigationData().capabilityId));\n\n    effect(() => {\n      if (!capability()) {\n        untracked(() => void Routing.runCanMatchGuards({injector}));\n      }\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {CanMatchFn, Route} from '@angular/router';\nimport {EnvironmentProviders, inject, makeEnvironmentProviders, runInInjectionContext, StaticProvider} from '@angular/core';\nimport {MicrofrontendPlatform, PlatformState} from '@scion/microfrontend-platform';\nimport {MicrofrontendPartNavigationData} from './microfrontend-part-navigation-data';\nimport {ManifestObjectCache} from '../manifest-object-cache.service';\nimport {WORKBENCH_ROUTE} from '../../workbench.constants';\nimport {MicrofrontendPartComponent} from './microfrontend-part.component';\nimport {WORKBENCH_OUTLET} from '../../routing/workbench-auxiliary-route-installer.service';\nimport {ɵWorkbenchRouter} from '../../routing/ɵworkbench-router.service';\nimport {canMatchWorkbenchPart} from '../../routing/workbench-route-guards';\nimport {PartId} from '../../workbench.identifiers';\nimport {WorkbenchPartRegistry} from '../../part/workbench-part.registry';\nimport {MicrofrontendHostComponent} from '../microfrontend-host/microfrontend-host.component';\nimport {MicrofrontendHostPart} from '../microfrontend-host-part/microfrontend-host-part.model';\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {Microfrontends} from '../common/microfrontend.util';\n\n/**\n * Hint passed to the navigation when navigating a microfrontend part.\n */\nexport const MICROFRONTEND_PART_NAVIGATION_HINT = 'scion.workbench.microfrontend-part';\n\n/**\n * Provides the route for integrating microfrontend parts.\n */\nexport function provideMicrofrontendPartRoute(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    // Route for embedding non-host microfrontend using <sci-router-outlet>.\n    {\n      provide: WORKBENCH_ROUTE,\n      useFactory: (): Route => ({\n        path: '',\n        component: MicrofrontendPartComponent,\n        canMatch: [canMatchMicrofrontendPart({host: false})], // use a single matcher because Angular evaluates matchers in parallel\n      }),\n      multi: true,\n    },\n    // Route for embedding host microfrontend using Angular <router-outlet>.\n    {\n      provide: WORKBENCH_ROUTE,\n      useFactory: (): Route => ({\n        path: '',\n        component: MicrofrontendHostComponent,\n        canMatch: [canMatchMicrofrontendPart({host: true})], // use a single matcher because Angular evaluates matchers in parallel\n        providers: [provideActivatedMicrofrontend()],\n      }),\n      multi: true,\n    },\n  ]);\n}\n\n/**\n * Matches the route if target of a workbench part navigated to a part microfrontend, but only\n * if the part capability exists.\n */\nfunction canMatchMicrofrontendPart(matcher: {host: boolean}): CanMatchFn {\n  return (route, segments): boolean => {\n    if (!canMatchWorkbenchPart(MICROFRONTEND_PART_NAVIGATION_HINT)(route, segments)) {\n      return false;\n    }\n\n    // Guards cannot block waiting for platform startup, as the platform may start later in the bootstrapping, causing a deadlock.\n    // Guards are re-evaluated after startup. See `runCanMatchGuardsAfterStartup`.\n    if (MicrofrontendPlatform.state !== PlatformState.Started) {\n      return false;\n    }\n\n    const partId = inject(WORKBENCH_OUTLET) as PartId;\n    const layout = inject(ɵWorkbenchRouter).getCurrentNavigationContext().layout;\n    const part = layout.part({partId});\n    const {capabilityId} = part.navigation!.data as unknown as MicrofrontendPartNavigationData;\n    const capability = inject(ManifestObjectCache).capability(capabilityId)();\n    if (!capability) {\n      return false;\n    }\n\n    return matcher.host === Microfrontends.isHostProvider(capability);\n  };\n}\n\n/**\n * Provides {@link ActivatedMicrofrontend} for injection in the host microfrontend.\n */\nfunction provideActivatedMicrofrontend(): StaticProvider {\n  return {\n    provide: ActivatedMicrofrontend,\n    useFactory: () => {\n      const part = inject(WorkbenchPartRegistry).get(inject(WORKBENCH_OUTLET) as PartId);\n      // Create in part's injection context to bind 'MicrofrontendPart' to the part's lifecycle.\n      return runInInjectionContext(part.injector, () => new MicrofrontendHostPart(part));\n    },\n  };\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject} from '@angular/core';\nimport {Logger, LoggerNames} from '../../logging';\nimport {Capability, ParamMatcher} from '@scion/microfrontend-platform';\nimport {Dictionaries, Objects} from '@scion/toolkit/util';\n\n/**\n * Validates parameters and migrates deprecated parameters.\n */\nexport class ParamValidator {\n\n  private readonly _logger = inject(Logger);\n\n  /**\n   * Validates passed parameters against parameters defined by the specified part capability, migrating deprecated params, if any.\n   *\n   * @return Validated, possibly migrated parameters, or `false` if not valid.\n   */\n  public validatePartParams(params: Params | undefined, partCapability: Capability, context: {perspectiveCapability: Capability; partId: string}): Params | false {\n    const {perspectiveCapability, partId} = context;\n\n    return this.validateParams(params, partCapability, {\n      deprecated: param => `[PerspectiveDefinitionWarning] Perspective '${qualifier(perspectiveCapability)}' of app '${app(perspectiveCapability)}' passes the deprecated parameter '${param}' to part '${partId}'. Migrate deprecated parameters as specified in the capability documentation of part '${qualifier(partCapability)}'.`,\n      missing: param => `[PerspectiveDefinitionError] Perspective '${qualifier(perspectiveCapability)}' of app '${app(perspectiveCapability)}' does not pass the required parameter '${param}' to part '${partId}'. Pass required parameters as specified in the capability documentation of part '${qualifier(partCapability)}'. Ignoring part.`,\n      unexpected: param => `[PerspectiveDefinitionError] Perspective '${qualifier(perspectiveCapability)}' of app '${app(perspectiveCapability)}' passes the unexpected parameter '${param}' to part '${partId}'. Pass parameters as specified in the capability documentation of part '${qualifier(partCapability)}'. Ignoring part.`,\n    });\n  }\n\n  /**\n   * Validates passed parameters against parameters defined by the specified view capability, migrating deprecated params, if any.\n   *\n   * @return Validated, possibly migrated parameters, or `false` if not valid.\n   */\n  public validateViewParams(params: Params | undefined, viewCapability: Capability, context: {partCapability: Capability}): Params | false {\n    const {partCapability} = context;\n    return this.validateParams(params, viewCapability, {\n      deprecated: param => `[PartDefinitionWarning] Part '${qualifier(partCapability)}' of app '${app(partCapability)}' passes the deprecated parameter '${param}' to view '${qualifier(viewCapability)}'. Migrate deprecated parameters as specified in the capability documentation.`,\n      missing: param => `[PartDefinitionError] Part '${qualifier(partCapability)}' of app '${app(partCapability)}' does not pass the required parameter '${param}' to view '${qualifier(viewCapability)}'. Pass required parameters as specified in the capability documentation. Ignoring view.`,\n      unexpected: param => `[PartDefinitionError] Part '${qualifier(partCapability)}' of app '${app(partCapability)}' passes the unexpected parameter '${param}' to view '${qualifier(viewCapability)}'. Pass parameters as specified in the capability documentation. Ignoring view.`,\n    });\n  }\n\n  private validateParams(params: Params | undefined, capability: Capability, messageFactory: ValidationMessageFactory): Params | false {\n    const match = new ParamMatcher(capability.params).match(params);\n    if (match.matches && !match.deprecatedParams.length) {\n      return Dictionaries.coerce(match.params);\n    }\n\n    // Log deprecated params.\n    match.deprecatedParams.forEach(({deprecated: deprecation, name: param}) => {\n      const useInstead = (typeof deprecation === 'object' && deprecation.useInstead) || undefined;\n      const deprecationMessage = (typeof deprecation === 'object' && deprecation.message) || undefined;\n\n      this._logger.warn(new Array<string>()\n        .concat(messageFactory.deprecated(param))\n        .concat(useInstead ? `Pass parameter '${useInstead}' instead.` : [])\n        .concat(deprecationMessage || [])\n        .join(' '), LoggerNames.MICROFRONTEND);\n    });\n\n    // Log missing params.\n    match.missingParams.forEach(param => this._logger.error(messageFactory.missing(param.name), LoggerNames.MICROFRONTEND));\n\n    // Log unexpected params.\n    match.unexpectedParams.forEach(param => this._logger.error(messageFactory.unexpected(param), LoggerNames.MICROFRONTEND));\n\n    return match.matches ? Dictionaries.coerce(match.params) : false;\n  }\n}\n\n/**\n * Factory to create validation messages.\n */\ninterface ValidationMessageFactory {\n  deprecated: (param: string) => string;\n  missing: (param: string) => string;\n  unexpected: (param: string) => string;\n}\n\n/**\n * Represents parameters.\n */\nexport interface Params {\n  [name: string]: unknown;\n}\n\n/**\n * Returns the qualifier as string.\n */\nfunction qualifier(capability: Capability): string {\n  return Objects.toMatrixNotation(capability.qualifier);\n}\n\n/**\n * Returns the app symbolic name.\n */\nfunction app(capability: Capability): string {\n  return capability.metadata!.appSymbolicName;\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, IterableDiffers} from '@angular/core';\nimport {Capability, ManifestService, Qualifier} from '@scion/microfrontend-platform';\nimport {WorkbenchCapabilities, WorkbenchPartCapability, WorkbenchPartRef, WorkbenchPerspectiveCapability, WorkbenchViewCapability, WorkbenchViewRef} from '@scion/workbench-client';\nimport {WorkbenchService} from '../../workbench.service';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {MAIN_AREA, MAIN_AREA_ALTERNATIVE_ID, WorkbenchLayout} from '../../layout/workbench-layout';\nimport {firstValueFrom} from 'rxjs';\nimport {WorkbenchLayoutFactory} from '../../layout/workbench-layout.factory';\nimport {MICROFRONTEND_VIEW_NAVIGATION_HINT} from '../microfrontend-view/microfrontend-view-routes';\nimport {Logger, LoggerNames} from '../../logging';\nimport {Arrays, Objects} from '@scion/toolkit/util';\nimport {WorkbenchPerspectiveData} from './workbench-perspective-data';\nimport {computeViewId} from '../../workbench.identifiers';\nimport {createRemoteTranslatable} from '../microfrontend-text/remote-text-provider';\nimport {MicrofrontendPartNavigationData} from '../microfrontend-part/microfrontend-part-navigation-data';\nimport {Translatable} from '../../text/workbench-text-provider.model';\nimport {MICROFRONTEND_PART_NAVIGATION_HINT} from '../microfrontend-part/microfrontend-part-routes';\nimport {Params, ParamValidator} from './param-validator';\nimport {MicrofrontendViewNavigationData} from '../microfrontend-view/microfrontend-view-navigation-data';\n\n/**\n * Registers perspectives provided as workbench perspective capabilities.\n *\n * @see WorkbenchPerspectiveCapability\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendPerspectiveInstaller {\n\n  private readonly _manifestService = inject(ManifestService);\n  private readonly _workbenchService = inject(WorkbenchService);\n  private readonly _logger = inject(Logger);\n  private readonly _paramValidator = new ParamValidator();\n\n  constructor() {\n    const differ = inject(IterableDiffers).find([]).create<WorkbenchPerspectiveCapability>((_index, perspectiveCapability) => perspectiveCapability.metadata!.id);\n    this._manifestService.lookupCapabilities$<WorkbenchPerspectiveCapability>({type: WorkbenchCapabilities.Perspective})\n      .pipe(takeUntilDestroyed())\n      .subscribe(perspectiveCapabilities => {\n        const changes = differ.diff(perspectiveCapabilities);\n        changes?.forEachAddedItem(({item: perspectiveCapability}) => void this.registerPerspective(perspectiveCapability));\n      });\n  }\n\n  /**\n   * Creates and registers a workbench perspective from given perspective capability.\n   */\n  private async registerPerspective(perspectiveCapability: WorkbenchPerspectiveCapability): Promise<void> {\n    return this._workbenchService.registerPerspective({\n      id: perspectiveCapability.metadata!.id,\n      layout: async (factory: WorkbenchLayoutFactory) => {\n        const [initialPartRef, ...partRefs] = perspectiveCapability.properties.parts;\n\n        // Add initial part.\n        let layout = await this.addInitialPart(initialPartRef, perspectiveCapability, factory);\n\n        // Add other parts.\n        for (const partRef of partRefs) {\n          layout = await this.addPart(partRef, perspectiveCapability, layout);\n        }\n        return layout;\n      },\n      data: {\n        ...perspectiveCapability.properties.data,\n        [WorkbenchPerspectiveData.capability]: perspectiveCapability,\n      },\n    });\n  }\n\n  /**\n   * Adds given part as the initial part to the layout.\n   *\n   * - If multiple part capabilities are found, logs an error and uses the first.\n   * - If no part capability is found, adds an empty part and logs an error.\n   * - If the part is not valid, adds an empty part and logs an error.\n   * - A part is navigated only if the capability specifies a path.\n   */\n  private async addInitialPart(partRef: Omit<WorkbenchPartRef, 'position'>, perspectiveCapability: WorkbenchPerspectiveCapability, layoutFactory: WorkbenchLayoutFactory): Promise<WorkbenchLayout> {\n    const partCapability = await this.lookupCapability<WorkbenchPartCapability>(WorkbenchCapabilities.Part, partRef.qualifier, {requester: perspectiveCapability, logLevelIfEmpty: 'error'});\n    if (!partCapability) {\n      return layoutFactory.addPart(partRef.id, {cssClass: partRef.cssClass, activate: partRef.active});\n    }\n\n    // Validate part capability. If not valid, add an empty initial part to the layout.\n    if (!this.validatePartCapability(partCapability, partRef, {perspectiveCapability})) {\n      return layoutFactory.addPart(partRef.id, {cssClass: partRef.cssClass, activate: partRef.active});\n    }\n\n    // Validate params and migrate deprecated params. If not valid, add an empty initial part to the layout.\n    const params = this._paramValidator.validatePartParams(partRef.params, partCapability, {perspectiveCapability, partId: partRef.id});\n    if (!params) {\n      return layoutFactory.addPart(partRef.id, {cssClass: partRef.cssClass, activate: partRef.active});\n    }\n\n    // Replace parameters as they may have been migrated.\n    partRef.params = params;\n\n    // Add the initial part to the layout.\n    let layout = layoutFactory.addPart(partRef.id, {\n      title: createCapabilityRemoteTranslatable(partCapability.properties?.title || undefined, partCapability, partRef.params),\n      cssClass: [...Arrays.coerce(partCapability.properties?.cssClass), ...Arrays.coerce(partRef.cssClass)],\n      activate: partRef.active,\n    });\n\n    // Navigate the initial part.\n    if (partCapability.properties?.path !== undefined) { // support empty-path navigation\n      layout = this.navigatePart(partRef, partCapability, perspectiveCapability, layout);\n    }\n\n    // Add views to the initial part.\n    for (const viewRef of partCapability.properties?.views ?? []) {\n      layout = await this.addView(viewRef, partRef, partCapability, layout);\n    }\n    return layout;\n  }\n\n  /**\n   * Adds given part to the layout.\n   *\n   * - If multiple part capabilities are found, logs an error and uses the first.\n   * - If no part capability is found, ignores the part if a docked part, or adds an empty part otherwise.\n   *   No error is logged to support conditional parts, unless there are parts not visible to the perspective provider.\n   * - If a relative aligned part and the reference part cannot be found, ignores the part.\n   *   No error is logged to support conditional parts, i.e., if aligned relative to a conditional docked part.\n   * - If the part is not valid, ignores the part and logs an error.\n   * - A part is navigated only if the capability specifies a path.\n   */\n  private async addPart(partRef: WorkbenchPartRef, perspectiveCapability: WorkbenchPerspectiveCapability, layout: WorkbenchLayout): Promise<WorkbenchLayout> {\n    // If a relative aligned part and the reference part cannot be found, ignore the part.\n    // Do not log an error to support conditional parts, i.e., if aligned relative to a conditional docked part.\n    if (typeof partRef.position === 'object' && partRef.position.relativeTo && !layout.hasPart(partRef.position.relativeTo)) {\n      this._logger.debug(`[PerspectiveDefinitionInfo] Perspective '${qualifier(perspectiveCapability)}' of app '${app(perspectiveCapability)}' aligns part '${partRef.id}' relative to missing part '${partRef.position.relativeTo}'. The reference part may not be available. Ignoring part.`, LoggerNames.MICROFRONTEND);\n      return layout;\n    }\n\n    // If capability cannot be found, ignore the part if docked, or add an empty part otherwise, required to support layouts with conditional reference parts.\n    const partCapability = await this.lookupCapability<WorkbenchPartCapability>(WorkbenchCapabilities.Part, partRef.qualifier, {requester: perspectiveCapability, logLevelIfEmpty: 'debug'});\n    if (!partCapability) {\n      return typeof partRef.position === 'string' ? layout : layout.addPart(partRef.id, {\n        relativeTo: partRef.position.relativeTo,\n        align: partRef.position.align,\n        ratio: partRef.position.ratio,\n      }, {\n        activate: partRef.active,\n        cssClass: partRef.cssClass,\n      });\n    }\n\n    // Validate part capability. If not valid, ignore the part.\n    if (!this.validatePartCapability(partCapability, partRef, {perspectiveCapability})) {\n      return layout;\n    }\n\n    // Validate params and migrate deprecated params. If not valid, ignore the part.\n    const params = this._paramValidator.validatePartParams(partRef.params, partCapability, {perspectiveCapability, partId: partRef.id});\n    if (!params) {\n      return layout;\n    }\n\n    // Replace parameters as they may have been migrated.\n    partRef.params = params;\n\n    if (typeof partRef.position === 'string') { // docked part\n      const dockedPartExtras = partCapability.properties!.extras!; // docked parts have been validated to have extras\n      layout = layout.addPart(partRef.id, {dockTo: partRef.position}, {\n        icon: dockedPartExtras.icon,\n        label: createCapabilityRemoteTranslatable(dockedPartExtras.label, partCapability, partRef.params),\n        title: partCapability.properties!.title === false ? false : createCapabilityRemoteTranslatable(partCapability.properties!.title, partCapability, partRef.params),\n        tooltip: createCapabilityRemoteTranslatable(dockedPartExtras.tooltip, partCapability, partRef.params),\n        cssClass: [...Arrays.coerce(partCapability.properties!.cssClass), ...Arrays.coerce(partRef.cssClass)],\n        activate: partRef.active,\n        ɵactivityId: partRef.ɵactivityId,\n      });\n    }\n    else {\n      layout = layout.addPart(partRef.id, {\n        relativeTo: partRef.position.relativeTo,\n        align: partRef.position.align,\n        ratio: partRef.position.ratio,\n      }, {\n        title: createCapabilityRemoteTranslatable(partCapability.properties?.title || undefined, partCapability, partRef.params),\n        activate: partRef.active,\n        cssClass: [...Arrays.coerce(partCapability.properties?.cssClass), ...Arrays.coerce(partRef.cssClass)],\n      });\n    }\n\n    // Navigate the part.\n    if (partCapability.properties?.path !== undefined) { // support empty-path navigation\n      layout = this.navigatePart(partRef, partCapability, perspectiveCapability, layout);\n    }\n\n    // Add views to the part.\n    for (const viewRef of partCapability.properties?.views ?? []) {\n      layout = await this.addView(viewRef, partRef, partCapability, layout);\n    }\n\n    return layout;\n  }\n\n  /**\n   * Navigates specified part.\n   */\n  private navigatePart(partRef: Omit<WorkbenchPartRef, 'position'> | WorkbenchPartRef, partCapability: WorkbenchPartCapability, perspectiveCapability: WorkbenchPerspectiveCapability, layout: WorkbenchLayout): WorkbenchLayout {\n    return layout.navigatePart(partRef.id, [], {\n      hint: MICROFRONTEND_PART_NAVIGATION_HINT,\n      data: {\n        capabilityId: partCapability.metadata!.id,\n        params: partRef.params!,\n        referrer: perspectiveCapability.metadata!.appSymbolicName,\n      } satisfies MicrofrontendPartNavigationData,\n    });\n  }\n\n  /**\n   * Adds given view to specified part.\n   *\n   * - If multiple view capabilities are found, logs an error and uses the first.\n   * - If no view capability is found, ignores the view. No error is logged to support conditional views, unless there are views not visible to the part provider.\n   */\n  private async addView(viewRef: WorkbenchViewRef, partRef: Omit<WorkbenchPartRef, 'position'> | WorkbenchPartRef, partCapability: WorkbenchPartCapability, layout: WorkbenchLayout): Promise<WorkbenchLayout> {\n    const viewCapability = await this.lookupCapability<WorkbenchViewCapability>(WorkbenchCapabilities.View, viewRef.qualifier, {requester: partCapability, logLevelIfEmpty: 'debug'});\n    if (!viewCapability) {\n      return layout;\n    }\n\n    // Validate params and migrate deprecated params.\n    const params = this._paramValidator.validateViewParams(viewRef.params, viewCapability, {partCapability});\n    if (!params) {\n      return layout;\n    }\n\n    // Add and navigate view.\n    const viewId = computeViewId();\n    return layout\n      .addView(viewId, {partId: partRef.id, activateView: viewRef.active, cssClass: viewRef.cssClass})\n      .navigateView(viewId, [], {\n        hint: MICROFRONTEND_VIEW_NAVIGATION_HINT,\n        data: {\n          capabilityId: viewCapability.metadata!.id,\n          params,\n          referrer: partCapability.metadata!.appSymbolicName,\n        } satisfies MicrofrontendViewNavigationData,\n        cssClass: viewCapability.properties.cssClass,\n      });\n  }\n\n  /**\n   * Looks up capabilities matching the specified qualifier and are visible to the requester.\n   */\n  private async lookupCapability<T extends Capability>(type: string, qualifier: Qualifier, context: {requester: Capability; logLevelIfEmpty: 'debug' | 'error'}): Promise<T | undefined> {\n    const {requester} = context;\n    const capabilities = await firstValueFrom(this._manifestService.lookupCapabilities$<T>({type, qualifier}));\n\n    // Filter capabilities visible to the requester.\n    const visibleCapabilities = new Array<T>();\n    for (const capability of capabilities) {\n      const visible = await firstValueFrom(this._manifestService.isApplicationQualified$(requester.metadata!.appSymbolicName, {capabilityId: capability.metadata!.id}));\n      if (visible) {\n        visibleCapabilities.push(capability);\n      }\n    }\n\n    if (visibleCapabilities.length > 1) {\n      this._logger.error(`[PerspectiveDefinitionError] Multiple ${type} capabilities found for qualifier '${Objects.toMatrixNotation(qualifier)}' in ${requester.type} '${Objects.toMatrixNotation(requester.qualifier)}' of app '${app(requester)}'. Defaulting to first. Ensure ${type} capabilities to have a unique qualifier.`, LoggerNames.MICROFRONTEND);\n    }\n    else if (!visibleCapabilities.length && capabilities.length) {\n      this._logger.error(`[PerspectiveDefinitionError] Application '${app(requester)}' is not qualified to use ${type} capability '${Objects.toMatrixNotation(qualifier)}' in ${requester.type} '${Objects.toMatrixNotation(requester.qualifier)}'. Ensure to have declared an intention and the capability is not private.`, LoggerNames.MICROFRONTEND);\n    }\n    else if (!visibleCapabilities.length) {\n      const message = `No ${type} capability found for qualifier '${Objects.toMatrixNotation(qualifier)}' in ${requester.type} '${Objects.toMatrixNotation(requester.qualifier)}' of app '${app(requester)}'. The qualifier may be incorrect, the capability not registered, or the providing application not available.`;\n      if (context.logLevelIfEmpty === 'error') {\n        this._logger.error(`[PerspectiveDefinitionError] ${message}`, LoggerNames.MICROFRONTEND);\n      }\n      else {\n        this._logger.debug(`[PerspectiveDefinitionInfo] ${message}`, LoggerNames.MICROFRONTEND);\n      }\n    }\n\n    return visibleCapabilities[0];\n  }\n\n  /**\n   * Validates properties of a part capability.\n   *\n   * The part:\n   * - must not have views if the main area part.\n   * - requires a label and icon if a docked part.\n   */\n  private validatePartCapability(partCapability: WorkbenchPartCapability, partRef: WorkbenchPartRef | Omit<WorkbenchPartRef, 'position'>, context: {perspectiveCapability: WorkbenchPerspectiveCapability}): boolean {\n    // Validate main area part not to have views.\n    const isMainAreaPart = partRef.id === MAIN_AREA || partRef.id === MAIN_AREA_ALTERNATIVE_ID;\n    if (isMainAreaPart && partCapability.properties?.views?.length) {\n      this._logger.error(`[PerspectiveDefinitionError] Part '${qualifier(partCapability)}' of app '${app(partCapability)}' is used as main area part in perspective '${qualifier(context.perspectiveCapability)}' and defines views. Views cannot be added to the main area of a perspective. Ignoring part.`, LoggerNames.MICROFRONTEND);\n      return false;\n    }\n\n    // Validate extras of docked part.\n    if ('position' in partRef && typeof partRef.position === 'string') {\n      const dockedPartExtras = partCapability.properties?.extras;\n      if (!dockedPartExtras?.label || !dockedPartExtras.icon) {\n        this._logger.error(`[PerspectiveDefinitionError] Part '${qualifier(partCapability)}' of app '${app(partCapability)}' is used as a docked part in perspective '${qualifier(context.perspectiveCapability)}' but does not define an icon and label. A docked part must define both an icon and a label: { properties: { extras: { icon: '<icon-name>', label: '<text>' } } }. Ignoring part.`, LoggerNames.MICROFRONTEND);\n        return false;\n      }\n    }\n\n    return true;\n  }\n}\n\n/**\n * Creates a remote translatable from given translatable for given capability.\n */\nfunction createCapabilityRemoteTranslatable(translatable: Translatable, capability: WorkbenchPartCapability, params: Params | undefined): string;\nfunction createCapabilityRemoteTranslatable(translatable: Translatable | undefined, capability: WorkbenchPartCapability, params: Params | undefined): string | undefined;\nfunction createCapabilityRemoteTranslatable(translatable: Translatable | undefined, capability: WorkbenchPartCapability, params: Params | undefined): string | undefined {\n  return createRemoteTranslatable(translatable, {\n    appSymbolicName: capability.metadata!.appSymbolicName,\n    valueParams: params,\n    topicParams: capability.properties?.resolve,\n  });\n}\n\n/**\n * Returns the qualifier as string.\n */\nfunction qualifier(capability: Capability): string {\n  return Objects.toMatrixNotation(capability.qualifier);\n}\n\n/**\n * Returns the app symbolic name.\n */\nfunction app(capability: Capability): string {\n  return capability.metadata!.appSymbolicName;\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Handler, IntentInterceptor, IntentMessage, MessageClient, MessageHeaders, ResponseStatusCodes} from '@scion/microfrontend-platform';\nimport {inject, Injectable} from '@angular/core';\nimport {WorkbenchCapabilities} from '@scion/workbench-client';\nimport {Logger, LoggerNames} from '../../logging';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {WorkbenchService} from '../../workbench.service';\n\n/**\n * Handles perspective intents, switching to resolved capability.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendPerspectiveIntentHandler implements IntentInterceptor {\n\n  private readonly _workbenchService = inject(WorkbenchService);\n  private readonly _logger = inject(Logger);\n\n  /**\n   * Perspective intents are handled in this interceptor and then swallowed.\n   */\n  public intercept(intentMessage: IntentMessage, next: Handler<IntentMessage>): Promise<void> {\n    if (intentMessage.intent.type === WorkbenchCapabilities.Perspective) {\n      return this.consumePerspectiveIntent(intentMessage as IntentMessage<void>);\n    }\n    else {\n      return next.handle(intentMessage);\n    }\n  }\n\n  private async consumePerspectiveIntent(message: IntentMessage<void>): Promise<void> {\n    const replyTo = message.headers.get(MessageHeaders.ReplyTo) as string;\n    const success = await this.switchPerspective(message);\n    if (replyTo) {\n      await Beans.get(MessageClient).publish(replyTo, success, {headers: new Map().set(MessageHeaders.Status, ResponseStatusCodes.TERMINAL)});\n    }\n  }\n\n  private switchPerspective(message: IntentMessage<void>): Promise<boolean> {\n    const perspectiveId = message.capability.metadata!.id;\n    this._logger.debug(() => `Switching to perspective ${perspectiveId}.`, LoggerNames.MICROFRONTEND);\n    return this._workbenchService.switchPerspective(perspectiveId);\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability, CapabilityInterceptor, Qualifier} from '@scion/microfrontend-platform';\nimport {inject, Injectable} from '@angular/core';\nimport {WorkbenchCapabilities, WorkbenchPartCapability, WorkbenchPartRef, WorkbenchPerspectiveCapability, WorkbenchViewRef} from '@scion/workbench-client';\nimport {MAIN_AREA} from '../../layout/workbench-layout';\nimport {UID} from '../../common/uid.util';\nimport {Logger, LoggerNames} from '../../logging';\nimport {Objects} from '@scion/toolkit/util';\n\n/**\n * Migrates to the new perspective capability model, where parts are modeled as separate part capabilities and views referenced from part capabilities.\n *\n * TODO [Angular 22] Remove with Angular 22.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendPerspectiveCapabilityMigrator implements CapabilityInterceptor {\n\n  private readonly _logger = inject(Logger);\n\n  public async intercept(capability: Capability, manifest: CapabilityInterceptor.Manifest): Promise<Capability> {\n    if (capability.type === WorkbenchCapabilities.Perspective && 'layout' in (capability.properties ?? {})) {\n      return this.migrate(capability as WorkbenchPerspectiveCapabilityV1, manifest);\n    }\n    return capability;\n  }\n\n  private async migrate(perspectiveCapabilityV1: WorkbenchPerspectiveCapabilityV1, manifest: CapabilityInterceptor.Manifest): Promise<WorkbenchPerspectiveCapability> {\n    this._logger.warn(`[PerspectiveDefinitionWarning] Deprecated perspective definition detected. The perspective capability '${Objects.toMatrixNotation(perspectiveCapabilityV1.qualifier)}' of app '${perspectiveCapabilityV1.metadata!.appSymbolicName}' uses a deprecated model. Parts must be modeled as part capabilities and views referenced from part capabilities. To migrate, update @scion/workbench-client to version '1.0.0-beta.34' or higher and refer to the documentation of 'WorkbenchPerspectiveCapability' and 'WorkbenchPartCapability'. Support for the deprecated model will be removed in SCION Workbench version 22.`, LoggerNames.MICROFRONTEND);\n\n    const [initialPartV1, ...partsV1] = perspectiveCapabilityV1.properties.layout;\n    return {\n      type: WorkbenchCapabilities.Perspective,\n      qualifier: perspectiveCapabilityV1.qualifier,\n      properties: {\n        parts: [\n          await this.migrateInitialPart(initialPartV1, manifest),\n          ...await Promise.all(partsV1.map(partV1 => this.migratePart(partV1, manifest))),\n        ],\n        data: perspectiveCapabilityV1.properties.data,\n      },\n      metadata: perspectiveCapabilityV1.metadata,\n    };\n  }\n\n  /**\n   * Migrates the initial part to the new part model.\n   *\n   * Parts are modeled as separate part capabilities and views referenced from part capabilities.\n   */\n  private async migrateInitialPart(initialPartV1: Pick<WorkbenchPerspectivePartV1, 'id' | 'views'>, manifest: CapabilityInterceptor.Manifest): Promise<Omit<WorkbenchPartRef, 'position'>> {\n    const qualifier: Qualifier = {part: `${UID.randomUID()}-auto-generated`};\n\n    // Register part capability.\n    await manifest.addCapability({\n      type: WorkbenchCapabilities.Part,\n      qualifier,\n      properties: {\n        views: initialPartV1.views?.map(view => this.migrateViewRef(view)),\n      },\n    } satisfies WorkbenchPartCapability);\n\n    // Return part reference.\n    return {\n      id: initialPartV1.id,\n      qualifier,\n    };\n  }\n\n  /**\n   * Migrates a part to the new part model.\n   *\n   * Parts are modeled as separate part capabilities and views referenced from part capabilities.\n   */\n  private async migratePart(partV1: WorkbenchPerspectivePartV1, manifest: CapabilityInterceptor.Manifest): Promise<WorkbenchPartRef> {\n    const qualifier: Qualifier = {part: `${UID.randomUID()}-auto-generated`};\n\n    // Register part capability.\n    await manifest.addCapability({\n      type: WorkbenchCapabilities.Part,\n      qualifier,\n      properties: {\n        views: partV1.views?.map(view => this.migrateViewRef(view)),\n      },\n    } satisfies WorkbenchPartCapability);\n\n    // Return part reference.\n    return {\n      id: partV1.id,\n      qualifier,\n      position: {\n        relativeTo: partV1.relativeTo,\n        align: partV1.align,\n        ratio: partV1.ratio,\n      },\n    };\n  }\n\n  /**\n   * Migrates a view to the new view model.\n   */\n  private migrateViewRef(viewRefV1: WorkbenchPerspectiveViewV1): WorkbenchViewRef {\n    return {\n      qualifier: viewRefV1.qualifier,\n      params: viewRefV1.params,\n      active: viewRefV1.active,\n      cssClass: viewRefV1.cssClass,\n    };\n  }\n}\n\ninterface WorkbenchPerspectiveCapabilityV1 extends Capability {\n  type: WorkbenchCapabilities.Perspective;\n  qualifier: Qualifier;\n  properties: {\n    layout: [Pick<WorkbenchPerspectivePartV1, 'id' | 'views'>, ...WorkbenchPerspectivePartV1[]];\n    data?: {[key: string]: unknown};\n  };\n}\n\ninterface WorkbenchPerspectivePartV1 {\n  id: string | MAIN_AREA;\n  relativeTo?: string;\n  align: 'left' | 'right' | 'top' | 'bottom';\n  ratio?: number;\n  views?: WorkbenchPerspectiveViewV1[];\n}\n\ninterface WorkbenchPerspectiveViewV1 {\n  qualifier: Qualifier;\n  params?: {[name: string]: unknown};\n  active?: boolean;\n  cssClass?: string | string[];\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform';\nimport {Injectable} from '@angular/core';\nimport {RelativeTo, WorkbenchCapabilities, WorkbenchPartRef, WorkbenchPerspectiveCapability} from '@scion/workbench-client';\nimport {Objects} from '@scion/toolkit/util';\n\n/**\n * Asserts perspective capabilities to have required properties.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendPerspectiveCapabilityValidator implements CapabilityInterceptor {\n\n  public async intercept(capability: Capability): Promise<Capability> {\n    if (capability.type !== WorkbenchCapabilities.Perspective) {\n      return capability;\n    }\n\n    const perspectiveCapability = capability as Partial<WorkbenchPerspectiveCapability>;\n    // Assert the perspective capability to have a qualifier.\n    if (!Object.keys(perspectiveCapability.qualifier ?? {}).length) {\n      throw Error(`[PerspectiveDefinitionError] Perspective capability requires a qualifier [app=${app(perspectiveCapability)}, perspective=${JSON.stringify(perspectiveCapability)}]`);\n    }\n\n    // Assert the perspective capability to have properties.\n    if (!perspectiveCapability.properties) {\n      throw Error(`[PerspectiveDefinitionError] Perspective capability requires properties [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n    }\n\n    // Assert the perspective capability to have parts.\n    if (!perspectiveCapability.properties.parts as unknown) {\n      throw Error(`[PerspectiveDefinitionError] Perspective capability requires the 'parts' property [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n    }\n\n    // Assert parts to have an id.\n    const parts = perspectiveCapability.properties.parts as Partial<WorkbenchPartRef>[];\n    parts.forEach((part, index) => {\n      if (!part.id) {\n        throw Error(`[PerspectiveDefinitionError] Missing required 'id' property of part at index '${index}' [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n      }\n    });\n\n    // Assert unique part ids.\n    if (new Set(parts.map(part => part.id)).size !== parts.length) {\n      throw Error(`[PerspectiveDefinitionError] Parts of perspective must have a unique id [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n    }\n\n    // Assert the perspective capability to have an initial part.\n    const [initialPart, ...otherParts] = parts;\n    if (!initialPart) {\n      throw Error(`[PerspectiveDefinitionError] Perspective capability requires an initial part [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n    }\n\n    // Assert initial part not to be positioned.\n    if (initialPart.position) {\n      throw Error(`[PerspectiveDefinitionError] Initial part '${initialPart.id}' of perspective must not have the 'position' property [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n    }\n\n    // Assert other parts to be positioned.\n    otherParts.forEach(part => {\n      if (!part.position) {\n        throw Error(`[PerspectiveDefinitionError] Missing required 'position' property in part '${part.id}' [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n      }\n      if (typeof part.position === 'string' && !dockingAreas.has(part.position)) {\n        throw Error(`[PerspectiveDefinitionError] Illegal position in docked part '${part.id}': '${part.position}'. Must be one of [${[...dockingAreas].join(',')}] [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n      }\n      if (typeof part.position === 'object' && !(part.position as Partial<RelativeTo>).align) {\n        throw Error(`[PerspectiveDefinitionError] Missing required 'align' property in part '${part.id}': { position: { align: 'left|right|top|bottom' } } [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n      }\n      if (typeof part.position === 'object' && !align.has(part.position.align)) {\n        throw Error(`[PerspectiveDefinitionError] Illegal alignment of part '${part.id}': '${part.position.align}'. Must be one of [${[...align].join(',')}] [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n      }\n      if (typeof part.position === 'object' && part.position.relativeTo && !parts.some(otherPart => otherPart.id === (part.position as RelativeTo).relativeTo)) {\n        throw Error(`[PerspectiveDefinitionError] Illegal part '${part.position.relativeTo}' referenced in 'relativeTo' of part '${part.id}'. Part not found. [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n      }\n    });\n\n    // Assert parts to have a qualifier.\n    parts.forEach(part => {\n      if (!Object.keys(part.qualifier ?? {}).length) {\n        throw Error(`[PerspectiveDefinitionError] Missing required qualifier for part '${part.id}' [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n      }\n      if (Object.entries(part.qualifier!).some(([key, value]) => key === '*' || value === '*')) {\n        throw Error(`[PerspectiveDefinitionError] Qualifier for part '${part.id}' must be explicit and not contain wildcards: '${Objects.toMatrixNotation(part.qualifier)}' [app=${app(perspectiveCapability)}, perspective=${qualifier(perspectiveCapability)}]`);\n      }\n    });\n\n    return capability;\n  }\n}\n\n/**\n * Returns the qualifier as string.\n */\nfunction qualifier(capability: Partial<Capability>): string {\n  return Objects.toMatrixNotation(capability.qualifier);\n}\n\n/**\n * Returns the app symbolic name.\n */\nfunction app(capability: Partial<Capability>): string {\n  return capability.metadata!.appSymbolicName;\n}\n\nconst dockingAreas = new Set()\n  .add('left-top')\n  .add('left-bottom')\n  .add('right-top')\n  .add('right-bottom')\n  .add('bottom-left')\n  .add('bottom-right');\n\nconst align = new Set()\n  .add('left')\n  .add('right')\n  .add('top')\n  .add('bottom');\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform';\nimport {Microfrontends} from './common/microfrontend.util';\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\nimport {WorkbenchCapabilities} from '@scion/workbench-client';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {MicrofrontendPlatformStartupPhase, provideMicrofrontendPlatformInitializer} from './microfrontend-platform-initializer';\n\n/**\n * Provides a set of DI providers to assign capabilities of the specified type a stable identifer.\n */\nexport function provideStableCapabilityId(capabilityType: WorkbenchCapabilities): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    provideMicrofrontendPlatformInitializer(onPreStartup, {phase: MicrofrontendPlatformStartupPhase.PreStartup}),\n  ]);\n\n  function onPreStartup(): void {\n    // Register capability interceptor to assign capabilities of the specified type a stable identifer.\n    Beans.register(CapabilityInterceptor, {useValue: new StableCapabilityIdAssigner(capabilityType), multi: true});\n  }\n}\n\n/**\n * Assigns capabilities of the specified type a stable identifer.\n */\nclass StableCapabilityIdAssigner implements CapabilityInterceptor {\n\n  constructor(private _capabilityType: WorkbenchCapabilities) {\n  }\n\n  public async intercept(capability: Capability): Promise<Capability> {\n    if (this._capabilityType === capability.type) {\n      return {\n        ...capability,\n        metadata: {\n          ...capability.metadata!,\n          id: await Microfrontends.createStableIdentifier(capability),\n        },\n      };\n    }\n\n    return capability;\n  }\n}\n","import {Injectable} from '@angular/core';\nimport {HostManifestInterceptor, Manifest} from '@scion/microfrontend-platform';\nimport {WorkbenchCapabilities} from '@scion/workbench-client';\n\n/**\n * Adds a wildcard perspective intention to the host manifest for the workbench to read perspective capabilities.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendPerspectiveIntentionProvider implements HostManifestInterceptor {\n\n  public intercept(hostManifest: Manifest): void {\n    hostManifest.intentions = [\n      ...hostManifest.intentions ?? [],\n      {\n        type: WorkbenchCapabilities.Perspective,\n        qualifier: {'*': '*'},\n      },\n    ];\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, inject, makeEnvironmentProviders} from '@angular/core';\nimport {MicrofrontendPerspectiveInstaller} from './microfrontend-perspective-installer.service';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {CapabilityInterceptor, HostManifestInterceptor, IntentInterceptor} from '@scion/microfrontend-platform';\nimport {MicrofrontendPerspectiveIntentHandler} from './microfrontend-perspective-intent-handler.interceptor';\nimport {MicrofrontendPerspectiveCapabilityMigrator} from './microfrontend-perspective-capability-migrator.interceptor';\nimport {MicrofrontendPerspectiveCapabilityValidator} from './microfrontend-perspective-capability-validator.interceptor';\nimport {WorkbenchCapabilities} from '@scion/workbench-client';\nimport {provideStableCapabilityId} from '../stable-capability-id-assigner.provider';\nimport {MicrofrontendPlatformStartupPhase, provideMicrofrontendPlatformInitializer} from '../microfrontend-platform-initializer';\nimport {MicrofrontendPerspectiveIntentionProvider} from './microfrontend-perspective-intention-provider.interceptor';\n\n/**\n * Provides a set of DI providers enabling microfrontend perspective support.\n *\n * @see WorkbenchPerspectiveCapability\n */\nexport function provideMicrofrontendPerspective(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    MicrofrontendPerspectiveIntentionProvider,\n    MicrofrontendPerspectiveInstaller,\n    MicrofrontendPerspectiveCapabilityMigrator,\n    MicrofrontendPerspectiveCapabilityValidator,\n    MicrofrontendPerspectiveIntentHandler,\n    provideStableCapabilityId(WorkbenchCapabilities.Perspective),\n    provideMicrofrontendPlatformInitializer(onPreStartup, {phase: MicrofrontendPlatformStartupPhase.PreStartup}),\n    provideMicrofrontendPlatformInitializer(onPostStartup, {phase: MicrofrontendPlatformStartupPhase.PostStartup}),\n  ]);\n\n  function onPreStartup(): void {\n    // Add perspective intention to the host manifest for the workbench to read perspective capabilities.\n    Beans.register(HostManifestInterceptor, {useValue: inject(MicrofrontendPerspectiveIntentionProvider), multi: true});\n    // Migrate deprecated perspective capabilities to the new perspective capability model.\n    Beans.register(CapabilityInterceptor, {useValue: inject(MicrofrontendPerspectiveCapabilityMigrator), multi: true});\n    // Register perspective capability validator.\n    Beans.register(CapabilityInterceptor, {useValue: inject(MicrofrontendPerspectiveCapabilityValidator), multi: true});\n    // Register perspective intent handler.\n    Beans.register(IntentInterceptor, {useValue: inject(MicrofrontendPerspectiveIntentHandler), multi: true});\n  }\n\n  function onPostStartup(): void {\n    inject(MicrofrontendPerspectiveInstaller);\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform';\nimport {Injectable} from '@angular/core';\nimport {WorkbenchCapabilities, WorkbenchPartCapability, WorkbenchViewRef} from '@scion/workbench-client';\nimport {Objects} from '@scion/toolkit/util';\nimport {Microfrontends} from '../common/microfrontend.util';\n\n/**\n * Asserts part capabilities to have required properties.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendPartCapabilityValidator implements CapabilityInterceptor {\n\n  public async intercept(capability: Capability): Promise<Capability> {\n    if (capability.type !== WorkbenchCapabilities.Part) {\n      return capability;\n    }\n\n    const partCapability = capability as Partial<WorkbenchPartCapability>;\n    // Assert the part capability to have a qualifier.\n    if (!Object.keys(partCapability.qualifier ?? {}).length) {\n      throw Error(`[PartDefinitionError] Part capability requires a qualifier [app=${app(partCapability)}, part=${JSON.stringify(partCapability)}]`);\n    }\n\n    // Assert docked part extras, if set.\n    if (partCapability.properties?.extras) {\n      if (!partCapability.properties.extras.icon) {\n        throw Error(`[PartDefinitionError] Missing required 'icon' property in docked part extras [app=${app(partCapability)}, part=${qualifier(partCapability)}]`);\n      }\n      if (!partCapability.properties.extras.label) {\n        throw Error(`[PartDefinitionError] Missing required 'label' property in docked part extras [app=${app(partCapability)}, part=${qualifier(partCapability)}]`);\n      }\n    }\n\n    // Assert referenced views to have a qualifier.\n    partCapability.properties?.views?.forEach((view: Partial<WorkbenchViewRef>) => {\n      if (!Object.keys(view.qualifier ?? {}).length) {\n        throw Error(`[PartDefinitionError] Missing required qualifier for view [app=${app(partCapability)}, part=${qualifier(partCapability)}]`);\n      }\n      if (Object.entries(view.qualifier!).some(([key, value]) => key === '*' || value === '*')) {\n        throw Error(`[PartDefinitionError] View qualifier must be explicit and not contain wildcards: '${Objects.toMatrixNotation(view.qualifier)}' [app=${app(partCapability)}, part=${qualifier(partCapability)}]`);\n      }\n    });\n\n    // Assert the path of the part capability.\n    if (partCapability.properties?.path !== undefined) {\n      this.assertPath(partCapability);\n    }\n\n    // Assert host part capabilities not to define the \"showSplash\" property.\n    if (Microfrontends.isHostProvider(capability) && partCapability.properties?.showSplash !== undefined) {\n      throw Error(`[PartDefinitionError] Property \"showSplash\" not supported for part capabilities of the host application [app=${app(partCapability)}, part=${qualifier(partCapability)}]`);\n    }\n\n    // Assert \"showSplash\" property not to be defined if part has no path.\n    if (partCapability.properties?.path === undefined && partCapability.properties?.showSplash !== undefined) {\n      throw Error(`[PartDefinitionError] Property \"showSplash\" only supported for part capabilities with a path [app=${app(partCapability)}, part=${qualifier(partCapability)}]`);\n    }\n\n    return capability;\n  }\n\n  private assertPath(capability: Partial<WorkbenchPartCapability>): void {\n    const path = capability.properties?.path as string | null;\n\n    if (Microfrontends.isHostProvider(capability)) {\n      if (path === null || path.length) {\n        throw Error(`[PartDefinitionError] Part capabilities of the host application require an empty path. [app=${app(capability)}, part=${qualifier(capability)}]. Change the path '${path}' to empty and add 'canMatchWorkbenchPartCapability(${JSON.stringify(capability.qualifier)})' guard to the route.\\n\\nExample:\\nCapability: { type: 'part', qualifier: ${JSON.stringify(capability.qualifier)}, properties: {path: ''} }\\nRoute: { path: '', canMatch: [canMatchWorkbenchPartCapability(${JSON.stringify(capability.qualifier)})], component: PartComponent }`);\n      }\n    }\n    else {\n      if (path === null) {\n        throw Error(`[PartDefinitionError] Part capabilities require a path. [app=${app(capability)}, part=${qualifier(capability)}]`);\n      }\n    }\n  }\n}\n\n/**\n * Returns the qualifier as string.\n */\nfunction qualifier(capability: Partial<Capability>): string {\n  return Objects.toMatrixNotation(capability.qualifier);\n}\n\n/**\n * Returns the app symbolic name.\n */\nfunction app(capability: Partial<Capability>): string {\n  return capability.metadata!.appSymbolicName;\n}\n","import {Injectable} from '@angular/core';\nimport {HostManifestInterceptor, Manifest} from '@scion/microfrontend-platform';\nimport {WorkbenchCapabilities} from '@scion/workbench-client';\n\n/**\n * Adds a wildcard part intention to the host manifest for the workbench to read part capabilities.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendPartIntentionProvider implements HostManifestInterceptor {\n\n  public intercept(hostManifest: Manifest): void {\n    hostManifest.intentions = [\n      ...hostManifest.intentions ?? [],\n      {\n        type: WorkbenchCapabilities.Part,\n        qualifier: {'*': '*'},\n      },\n    ];\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, EnvironmentProviders, inject, makeEnvironmentProviders} from '@angular/core';\nimport {WorkbenchRouter} from '../../routing/workbench-router.service';\nimport {ManifestObjectCache} from '../manifest-object-cache.service';\nimport {WorkbenchPart} from '../../part/workbench-part.model';\nimport {MicrofrontendPartNavigationData} from './microfrontend-part-navigation-data';\nimport {MICROFRONTEND_PART_NAVIGATION_HINT} from './microfrontend-part-routes';\nimport {CanMatchFn, Route} from '@angular/router';\nimport {WORKBENCH_ROUTE} from '../../workbench.constants';\nimport {Capability, MicrofrontendPlatform, PlatformState} from '@scion/microfrontend-platform';\nimport {Crypto} from '@scion/toolkit/crypto';\nimport {WORKBENCH_OUTLET} from '../../routing/workbench-auxiliary-route-installer.service';\nimport {ɵWorkbenchRouter} from '../../routing/ɵworkbench-router.service';\nimport {canMatchWorkbenchPart} from '../../routing/workbench-route-guards';\nimport {PartId} from '../../workbench.identifiers';\n\n/**\n * Provides the route for migrating legacy microfrontend part navigations.\n *\n * Navigates the part to migrate the capability id to the new format (including capability type in the hash).\n *\n * @deprecated since version 21.0.0-beta.2. Marked for removal in version 23.\n */\nexport function provideLegacyMicrofrontendPartRoute(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    {\n      provide: WORKBENCH_ROUTE,\n      useFactory: (): Route => ({\n        path: '',\n        component: MicrofrontendPartNavigationMigrationComponent,\n        canMatch: [canMatchLegacyMicrofrontendPartNavigation()],\n      }),\n      multi: true,\n    },\n  ]);\n}\n\n/**\n * Matches if a legacy microfrontend part navigation.\n */\nfunction canMatchLegacyMicrofrontendPartNavigation(): CanMatchFn {\n  return async (route, segments): Promise<boolean> => {\n    if (!canMatchWorkbenchPart(MICROFRONTEND_PART_NAVIGATION_HINT)(route, segments)) {\n      return false;\n    }\n\n    // Guards cannot block waiting for platform startup, as the platform may start later in the bootstrapping, causing a deadlock.\n    // Guards are re-evaluated after startup. See `runCanMatchGuardsAfterStartup`.\n    if (MicrofrontendPlatform.state !== PlatformState.Started) {\n      return false;\n    }\n\n    const partId = inject(WORKBENCH_OUTLET) as PartId;\n    const layout = inject(ɵWorkbenchRouter).getCurrentNavigationContext().layout;\n    const part = layout.part({partId});\n    const {capabilityId: mayBeLegacyCapabilityId} = part.navigation!.data as unknown as MicrofrontendPartNavigationData;\n\n    // Test if a legacy capability id.\n    return await findCapabilityByLegacyCapabilityId(mayBeLegacyCapabilityId) !== null;\n  };\n}\n\n/**\n * Migrates a legacy microfrontend part capability id to the new format (added capability type to hash).\n */\n@Component({\n  selector: 'wb-microfrontend-part-navigation-migration',\n  template: 'Migrating Part...',\n})\nclass MicrofrontendPartNavigationMigrationComponent {\n\n  constructor() {\n    void this.migratePart();\n  }\n\n  private async migratePart(): Promise<void> {\n    const part = inject(WorkbenchPart);\n    const router = inject(WorkbenchRouter);\n\n    const navigationData = part.navigation()!.data as unknown as MicrofrontendPartNavigationData;\n    const capability = (await findCapabilityByLegacyCapabilityId(navigationData.capabilityId))!;\n\n    await router.navigate(layout => layout.navigatePart(part.id, [], {\n      hint: MICROFRONTEND_PART_NAVIGATION_HINT,\n      data: {\n        capabilityId: capability.metadata!.id,\n        params: navigationData.params,\n        referrer: '',\n      } satisfies MicrofrontendPartNavigationData,\n    }), {skipLocationChange: true, replaceUrl: true});\n  }\n}\n\n/**\n * Finds a capability by its legacy capability identifier.\n */\nasync function findCapabilityByLegacyCapabilityId(legacyCapabilityId: string): Promise<Capability | null> {\n  const capabilities = inject(ManifestObjectCache).capabilities();\n  for (const capability of capabilities.values()) {\n    if (legacyCapabilityId === await generateLegacyCapabilityIdentifier(capability)) {\n      return capability;\n    }\n  }\n  return null;\n}\n\n/**\n * Generates the legacy identifier for given capability.\n */\nasync function generateLegacyCapabilityIdentifier(capability: Capability): Promise<string> {\n  const qualifier = capability.qualifier!;\n  const application = capability.metadata!.appSymbolicName;\n\n  // Create identifier consisting of vendor and sorted qualifier entries.\n  const identifier = Object.entries(qualifier)\n    .sort(([key1], [key2]) => key1.localeCompare(key2))\n    .reduce(\n      (acc, [key, value]) => acc.concat(key).concat(`${value}`),\n      [application],\n    )\n    .join(';');\n\n  // Hash the identifier.\n  const identifierHash = await Crypto.digest(identifier);\n  // Use the first 7 digits of the hash.\n  return identifierHash.substring(0, 7);\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, inject, makeEnvironmentProviders, Provider} from '@angular/core';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {CapabilityInterceptor, HostManifestInterceptor} from '@scion/microfrontend-platform';\nimport {WorkbenchCapabilities, WorkbenchDialogService, WorkbenchMessageBoxService, WorkbenchPopupService, ɵWorkbenchDialogService, ɵWorkbenchMessageBoxService, ɵWorkbenchPopupService} from '@scion/workbench-client';\nimport {provideStableCapabilityId} from '../stable-capability-id-assigner.provider';\nimport {MicrofrontendPartCapabilityValidator} from './microfrontend-part-capability-validator.interceptor';\nimport {provideMicrofrontendPartRoute} from './microfrontend-part-routes';\nimport {MicrofrontendPlatformStartupPhase, provideMicrofrontendPlatformInitializer} from '../microfrontend-platform-initializer';\nimport {MicrofrontendPartIntentionProvider} from './microfrontend-part-intention-provider.interceptor';\nimport {WORKBENCH_PART_CONTEXT} from '../../part/workbench-part-context.provider';\nimport {WorkbenchPart} from '../../part/workbench-part.model';\nimport {provideLegacyMicrofrontendPartRoute} from './legacy-microfrontend-part-navigation-migration';\n\n/**\n * Provides a set of DI providers enabling microfrontend part support.\n *\n * @see WorkbenchPartCapability\n */\nexport function provideMicrofrontendPart(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    MicrofrontendPartIntentionProvider,\n    MicrofrontendPartCapabilityValidator,\n    provideMicrofrontendPartRoute(),\n    provideLegacyMicrofrontendPartRoute(),\n    provideStableCapabilityId(WorkbenchCapabilities.Part),\n    provideWorkbenchPartContext(),\n    provideMicrofrontendPlatformInitializer(onPreStartup, {phase: MicrofrontendPlatformStartupPhase.PreStartup}),\n  ]);\n\n  function onPreStartup(): void {\n    // Add part intention to the host manifest for the workbench to read part capabilities.\n    Beans.register(HostManifestInterceptor, {useValue: inject(MicrofrontendPartIntentionProvider), multi: true});\n    // Register part capability validator.\n    Beans.register(CapabilityInterceptor, {useValue: inject(MicrofrontendPartCapabilityValidator), multi: true});\n  }\n\n  /**\n   * Provides beans of @scion/workbench-client available for DI if in the context of a workbench part.\n   */\n  function provideWorkbenchPartContext(): Provider {\n    return {\n      provide: WORKBENCH_PART_CONTEXT,\n      useFactory: (): Provider[] => [\n        {provide: WorkbenchDialogService, useFactory: () => new ɵWorkbenchDialogService(inject(WorkbenchPart).id)},\n        {provide: WorkbenchMessageBoxService, useFactory: () => new ɵWorkbenchMessageBoxService(inject(WorkbenchPart).id)},\n        {provide: WorkbenchPopupService, useFactory: () => new ɵWorkbenchPopupService(inject(WorkbenchPart).id)},\n      ],\n      multi: true,\n    };\n  }\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, inject, Injectable, makeEnvironmentProviders, OnDestroy} from '@angular/core';\nimport {Message, MessageClient, MessageHeaders} from '@scion/microfrontend-platform';\nimport {Logger} from '../../logging';\nimport {ViewId} from '../../workbench.identifiers';\nimport {WorkbenchView} from '../../view/workbench-view.model';\nimport {WorkbenchViewRegistry} from '../../view/workbench-view.registry';\nimport {Translatable, ɵWorkbenchCommands} from '@scion/workbench-client';\nimport {Subscription} from 'rxjs';\nimport {provideMicrofrontendPlatformInitializer} from '../microfrontend-platform-initializer';\nimport {createRemoteTranslatable} from '../microfrontend-text/remote-text-provider';\nimport {MICROFRONTEND_VIEW_NAVIGATION_HINT} from './microfrontend-view-routes';\nimport {ManifestObjectCache} from '../manifest-object-cache.service';\nimport {MicrofrontendViewNavigationData} from './microfrontend-view-navigation-data';\nimport {throwError} from '../../common/throw-error.util';\n\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nclass MicrofrontendViewCommandHandler implements OnDestroy {\n\n  private readonly _messageClient = inject(MessageClient);\n  private readonly _viewRegistry = inject(WorkbenchViewRegistry);\n  private readonly _manifestObjectCache = inject(ManifestObjectCache);\n  private readonly _logger = inject(Logger);\n  private readonly _subscriptions = new Set<Subscription>();\n\n  constructor() {\n    this._subscriptions.add(this.installViewTitleCommandHandler());\n    this._subscriptions.add(this.installViewHeadingCommandHandler());\n    this._subscriptions.add(this.installViewDirtyCommandHandler());\n    this._subscriptions.add(this.installViewClosableCommandHandler());\n    this._subscriptions.add(this.installViewCloseCommandHandler());\n  }\n\n  /**\n   * Handles commands to update the title of a view.\n   */\n  private installViewTitleCommandHandler(): Subscription {\n    return this._messageClient.onMessage<Translatable>(ɵWorkbenchCommands.viewTitleTopic(':viewId'), message => {\n      const viewId = message.params!.get('viewId') as ViewId;\n      this.runIfPrivileged(viewId, message, view => {\n        const referrer = message.headers.get(MessageHeaders.AppSymbolicName) as string;\n        view.title = createRemoteTranslatable(message.body, {appSymbolicName: referrer}) ?? null;\n      });\n    });\n  }\n\n  /**\n   * Handles commands to update the heading of a view.\n   */\n  private installViewHeadingCommandHandler(): Subscription {\n    return this._messageClient.onMessage<Translatable>(ɵWorkbenchCommands.viewHeadingTopic(':viewId'), message => {\n      const viewId = message.params!.get('viewId') as ViewId;\n      this.runIfPrivileged(viewId, message, view => {\n        const referrer = message.headers.get(MessageHeaders.AppSymbolicName) as string;\n        view.heading = createRemoteTranslatable(message.body, {appSymbolicName: referrer}) ?? null;\n      });\n    });\n  }\n\n  /**\n   * Handles commands to update the dirty state of a view.\n   */\n  private installViewDirtyCommandHandler(): Subscription {\n    return this._messageClient.onMessage<boolean>(ɵWorkbenchCommands.viewDirtyTopic(':viewId'), message => {\n      const viewId = message.params!.get('viewId') as ViewId;\n      this.runIfPrivileged(viewId, message, view => {\n        view.dirty = message.body!;\n      });\n    });\n  }\n\n  /**\n   * Handles commands to update the closable property of a view.\n   */\n  private installViewClosableCommandHandler(): Subscription {\n    return this._messageClient.onMessage<boolean>(ɵWorkbenchCommands.viewClosableTopic(':viewId'), message => {\n      const viewId = message.params!.get('viewId') as ViewId;\n      this.runIfPrivileged(viewId, message, view => {\n        view.closable = message.body!;\n      });\n    });\n  }\n\n  /**\n   * Handles commands to close a view.\n   */\n  private installViewCloseCommandHandler(): Subscription {\n    return this._messageClient.onMessage(ɵWorkbenchCommands.viewCloseTopic(':viewId'), message => {\n      const viewId = message.params!.get('viewId') as ViewId;\n      this.runIfPrivileged(viewId, message, view => {\n        void view.close();\n      });\n    });\n  }\n\n  /**\n   * Runs the given runnable only if the microfrontend displayed in the view is actually provided by the sender,\n   * thus preventing other apps from updating other apps' views.\n   */\n  private runIfPrivileged(viewId: ViewId, message: Message, runnable: (view: WorkbenchView) => void): void {\n    const sender = message.headers.get(MessageHeaders.AppSymbolicName) as string;\n    const view = this._viewRegistry.get(viewId);\n\n    // Test if a microfrontend view.\n    if (view.navigation()?.hint !== MICROFRONTEND_VIEW_NAVIGATION_HINT) {\n      return;\n    }\n\n    // Test if provided by the requesting application.\n    const {capabilityId} = view.navigation()!.data as unknown as MicrofrontendViewNavigationData;\n    const capability = this._manifestObjectCache.capability(capabilityId)() ?? throwError(`[NullCapabilityError] No capability found with id '${capabilityId}'.`);\n    if (capability.metadata!.appSymbolicName === sender) {\n      runnable(view);\n    }\n    else {\n      this._logger.warn('[NotPrivilegedError] Microfrontend not allowed to update views of other apps.');\n    }\n  }\n\n  public ngOnDestroy(): void {\n    this._subscriptions.forEach(subscription => subscription.unsubscribe());\n  }\n}\n\n/**\n * Provides a set of DI providers registering message handlers for view microfrontends to interact with a workbench view.\n */\nexport function provideViewCommandHandlers(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    MicrofrontendViewCommandHandler,\n    provideMicrofrontendPlatformInitializer(() => void inject(MicrofrontendViewCommandHandler)),\n  ]);\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Handler, IntentInterceptor, IntentMessage, MessageClient, MessageHeaders, ResponseStatusCodes} from '@scion/microfrontend-platform';\nimport {inject, Injectable} from '@angular/core';\nimport {WorkbenchCapabilities, WorkbenchViewCapability, ɵWorkbenchNavigateCommand} from '@scion/workbench-client';\nimport {WorkbenchRouter} from '../../routing/workbench-router.service';\nimport {MICROFRONTEND_VIEW_NAVIGATION_HINT, MICROFRONTEND_VIEW_STATE_TRANSIENT_PARAMS, splitMicrofrontendViewParams} from './microfrontend-view-routes';\nimport {Logger, LoggerNames} from '../../logging';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {Dictionaries} from '@scion/toolkit/util';\nimport {WorkbenchLayoutService} from '../../layout/workbench-layout.service';\nimport {prune} from '../../common/prune.util';\nimport {MicrofrontendViewNavigationData} from './microfrontend-view-navigation-data';\n\n/**\n * Handles view intents, opening or activating views based on resolved capability and passed parameters.\n *\n * View intents are handled in this interceptor and are not transported to the providing application to support applications not connected to the SCION Workbench.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendViewIntentHandler implements IntentInterceptor {\n\n  private readonly _workbenchRouter = inject(WorkbenchRouter);\n  private readonly _layout = inject(WorkbenchLayoutService).layout;\n  private readonly _logger = inject(Logger);\n\n  /**\n   * View intents are handled in this interceptor and then swallowed.\n   */\n  public intercept(intentMessage: IntentMessage, next: Handler<IntentMessage>): Promise<void> {\n    if (intentMessage.intent.type === WorkbenchCapabilities.View) {\n      return this.consumeViewIntent(intentMessage as IntentMessage<ɵWorkbenchNavigateCommand | undefined>);\n    }\n    else {\n      return next.handle(intentMessage);\n    }\n  }\n\n  private async consumeViewIntent(message: IntentMessage<ɵWorkbenchNavigateCommand | undefined>): Promise<void> {\n    const replyTo = message.headers.get(MessageHeaders.ReplyTo) as string;\n    const success = await this.navigate(message);\n    await Beans.get(MessageClient).publish(replyTo, success, {headers: new Map().set(MessageHeaders.Status, ResponseStatusCodes.TERMINAL)});\n  }\n\n  private async navigate(message: IntentMessage<ɵWorkbenchNavigateCommand | undefined>): Promise<boolean> {\n    const capability = message.capability as WorkbenchViewCapability;\n    const command: ɵWorkbenchNavigateCommand = message.body ?? {};\n\n    const intentParams = prune(Dictionaries.coerce(message.intent.params));\n    const {params, transientParams} = splitMicrofrontendViewParams(intentParams, capability);\n    const targets = this.resolveTargets(message, command);\n\n    this._logger.debug(() => `Navigating to: ${capability.properties.path}`, LoggerNames.MICROFRONTEND_ROUTING, capability, params, transientParams);\n    const navigations = await Promise.all(targets.map(target => {\n      return this._workbenchRouter.navigate([], prune({\n        target,\n        partId: command.close ? undefined : command.partId,\n        activate: command.activate,\n        close: command.close,\n        position: command.position,\n        cssClass: command.cssClass,\n        hint: command.close ? undefined : MICROFRONTEND_VIEW_NAVIGATION_HINT,\n        data: command.close ? undefined : {\n          capabilityId: capability.metadata!.id,\n          params,\n          referrer: message.headers.get(MessageHeaders.AppSymbolicName) as string,\n        } satisfies MicrofrontendViewNavigationData,\n        state: {\n          [MICROFRONTEND_VIEW_STATE_TRANSIENT_PARAMS]: Object.keys(transientParams).length ? transientParams : undefined,\n        },\n      }));\n    }));\n    return navigations.every(Boolean);\n  }\n\n  /**\n   * Resolves the target(s) for this navigation.\n   */\n  private resolveTargets(intentMessage: IntentMessage, command: ɵWorkbenchNavigateCommand): string[] {\n    // Closing a microfrontend view by viewId is not allowed, as this would violate the concept of intent-based view navigation.\n    if (command.close && command.target) {\n      throw Error(`[NavigateError] The target must be empty if closing a view [target=${(command.target)}]`);\n    }\n    if (command.close) {\n      return this.findViews(intentMessage, command, {matchWildcardParams: true}) ?? [];\n    }\n    if (!command.target || command.target === 'auto') {\n      return this.findViews(intentMessage, command, {matchWildcardParams: false}) ?? ['blank'];\n    }\n    return [command.target];\n  }\n\n  /**\n   * Finds views matching the given view intent.\n   *\n   * A view matches if its view capability and all its required parameters are equal.\n   *\n   * Allows matching wildcard parameters by setting the option `matchWildcardParams` to `true`.\n   */\n  private findViews(intentMessage: IntentMessage, command: ɵWorkbenchNavigateCommand, options: {matchWildcardParams: boolean}): string[] | null {\n    const requiredParams = intentMessage.capability.params?.filter(param => param.required) ?? [];\n\n    const viewIds = this._layout()\n      .views({\n        peripheral: command.partId ? undefined : false,\n        partId: command.partId,\n      })\n      .filter(mView => {\n        // Test if a microfrontend view.\n        if (mView.navigation?.hint !== MICROFRONTEND_VIEW_NAVIGATION_HINT) {\n          return;\n        }\n\n        // Test if the capability matches.\n        const navigation = mView.navigation.data as unknown as MicrofrontendViewNavigationData;\n        if (navigation.capabilityId !== intentMessage.capability.metadata!.id) {\n          return false;\n        }\n\n        // Test whether all \"navigational\" params match.\n        return requiredParams.every(({name}) => {\n          const intentParamValue = intentMessage.intent.params!.get(name);\n          return (options.matchWildcardParams && intentParamValue === '*') || intentParamValue === navigation.params[name];\n        });\n\n      })\n      .map(view => view.id);\n\n    return viewIds.length ? viewIds : null;\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform';\nimport {inject, Injectable} from '@angular/core';\nimport {WorkbenchCapabilities, WorkbenchViewCapability} from '@scion/workbench-client';\nimport {Logger, LoggerNames} from '../../logging';\nimport {Objects} from '@scion/toolkit/util';\n\n/**\n * Logs usage of deprecated transient parameters.\n *\n * TODO [Angular 22] Remove with Angular 22.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendViewTransientParameterDeprecationLogger implements CapabilityInterceptor {\n\n  private readonly _logger = inject(Logger);\n\n  public async intercept(capability: Capability): Promise<Capability> {\n    if (capability.type === WorkbenchCapabilities.View) {\n      this.logWarningForTransientParams(capability as WorkbenchViewCapability);\n    }\n    return capability;\n  }\n\n  private logWarningForTransientParams(capability: WorkbenchViewCapability): void {\n    if (!capability.params) {\n      return;\n    }\n\n    capability.params\n      .filter(param => param.transient !== undefined)\n      .forEach(param => {\n        this._logger.warn(`[Deprecation][${capability.metadata!.appSymbolicName}] Transient view parameter '${param.name}' in view capability '${Objects.toMatrixNotation(capability.qualifier)}' detected. Transient parameters are deprecated and will be removed in SCION Workbench version 22. No replacement. Instead, send large data as retained message to a random topic and pass the topic as parameter. After receiving the data, the view should delete the retained message to free resources.`, LoggerNames.MICROFRONTEND);\n      });\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform';\nimport {inject, Injectable} from '@angular/core';\nimport {WorkbenchCapabilities, WorkbenchViewCapability} from '@scion/workbench-client';\nimport '../microfrontend-platform.config';\nimport {Logger} from '../../logging';\nimport {Microfrontends} from '../common/microfrontend.util';\n\n/**\n * Configures view capabilities not defining {@link WorkbenchViewCapability.properties.lazy} to preload views to maintain compatibility with applications setting view titles and headings in view microfrontends.\n *\n * @see MicrofrontendPlatformConfig.preloadInactiveViews\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class ViewCapabilityPreloadCapabilityInterceptor implements CapabilityInterceptor {\n\n  private readonly _logger = inject(Logger);\n\n  public async intercept(capability: Capability): Promise<Capability> {\n    if (capability.type !== WorkbenchCapabilities.View) {\n      return capability;\n    }\n\n    const viewCapability = capability as WorkbenchViewCapability;\n\n    // Lazy is not supported for host view capabilities.\n    if (Microfrontends.isHostProvider(capability)) {\n      return viewCapability;\n    }\n\n    if (viewCapability.properties.lazy === undefined) {\n      viewCapability.properties.lazy = false;\n      const appSymbolicName = viewCapability.metadata?.appSymbolicName;\n      const qualifier = Object.entries(viewCapability.qualifier).reduce((qualifier, [key, value]) => `${qualifier};${key}=${value}`, '').substring(1);\n      this._logger.warn(`[Deprecation] Application '${appSymbolicName}' provides a \"non-lazy\" view capability: {${qualifier}}. Change to lazy by setting 'lazy' in capability properties. Lazy views require a title and heading in the manifest. Title and heading can be localized with optional interpolation parameters using resolvers. See documentation for details: https://workbench-client-api.scion.vercel.app/interfaces/WorkbenchViewCapability.html`);\n    }\n\n    return viewCapability;\n  }\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform';\nimport {Injectable} from '@angular/core';\nimport {WorkbenchCapabilities, WorkbenchViewCapability} from '@scion/workbench-client';\nimport {Objects} from '@scion/toolkit/util';\nimport {Microfrontends} from '../common/microfrontend.util';\n\n/**\n * Asserts view capabilities to have required properties.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendViewCapabilityValidator implements CapabilityInterceptor {\n\n  public async intercept(capability: Capability): Promise<Capability> {\n    if (capability.type !== WorkbenchCapabilities.View) {\n      return capability;\n    }\n\n    const viewCapability = capability as Partial<WorkbenchViewCapability>;\n    // Assert the view capability to have a qualifier.\n    if (!Object.keys(viewCapability.qualifier ?? {}).length) {\n      throw Error(`[ViewDefinitionError] View capability requires a qualifier [app=${app(viewCapability)}, view=${qualifier(viewCapability)}]`);\n    }\n\n    // Assert the view capability to have properties.\n    if (!viewCapability.properties) {\n      throw Error(`[ViewDefinitionError] View capability requires properties [app=${app(viewCapability)}, view=${qualifier(viewCapability)}]`);\n    }\n\n    // Assert the view capability to have a path, unless provided by the host application.\n    this.assertPath(viewCapability);\n\n    // Assert host view capabilities not to define the \"lazy\" property.\n    if (Microfrontends.isHostProvider(capability) && viewCapability.properties.lazy !== undefined) {\n      throw Error(`[ViewDefinitionError] Property \"lazy\" not supported for view capabilities of the host application [app=${app(viewCapability)}, view=${qualifier(viewCapability)}]`);\n    }\n\n    // Assert host view capabilities not to define the \"showSplash\" property.\n    if (Microfrontends.isHostProvider(capability) && viewCapability.properties.showSplash !== undefined) {\n      throw Error(`[ViewDefinitionError] Property \"showSplash\" not supported for view capabilities of the host application [app=${app(viewCapability)}, view=${qualifier(viewCapability)}]`);\n    }\n\n    return capability;\n  }\n\n  private assertPath(capability: Partial<WorkbenchViewCapability>): void {\n    const path = capability.properties?.path as string | undefined | null;\n\n    if (Microfrontends.isHostProvider(capability)) {\n      if (path !== '') {\n        throw Error(`[ViewDefinitionError] View capabilities of the host application require an empty path. [app=${app(capability)}, view=${qualifier(capability)}]. Change the path '${path}' to empty and add 'canMatchWorkbenchViewCapability(${JSON.stringify(capability.qualifier)})' guard to the route.\\n\\nExample:\\nCapability: { type: 'view', qualifier: ${JSON.stringify(capability.qualifier)}, properties: {path: ''} }\\nRoute: { path: '', canMatch: [canMatchWorkbenchViewCapability(${JSON.stringify(capability.qualifier)})], component: ViewComponent }`);\n      }\n    }\n    else {\n      if (path === null || path == undefined) {\n        throw Error(`[ViewDefinitionError] View capabilities require a path. [app=${app(capability)}, view=${qualifier(capability)}]`);\n      }\n    }\n  }\n}\n\n/**\n * Returns the qualifier as string.\n */\nfunction qualifier(capability: Partial<Capability>): string {\n  return Objects.toMatrixNotation(capability.qualifier);\n}\n\n/**\n * Returns the app symbolic name.\n */\nfunction app(capability: Partial<Capability>): string {\n  return capability.metadata!.appSymbolicName;\n}\n","import {Injectable} from '@angular/core';\nimport {HostManifestInterceptor, Manifest} from '@scion/microfrontend-platform';\nimport {WorkbenchCapabilities} from '@scion/workbench-client';\n\n/**\n * Adds a wildcard view intention to the host manifest for the workbench to read view capabilities.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendViewIntentionProvider implements HostManifestInterceptor {\n\n  public intercept(hostManifest: Manifest): void {\n    hostManifest.intentions = [\n      ...hostManifest.intentions ?? [],\n      {\n        type: WorkbenchCapabilities.View,\n        qualifier: {'*': '*'},\n      },\n    ];\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, EnvironmentProviders, inject, makeEnvironmentProviders} from '@angular/core';\nimport {WorkbenchRouter} from '../../routing/workbench-router.service';\nimport {ManifestObjectCache} from '../manifest-object-cache.service';\nimport {WorkbenchView} from '../../view/workbench-view.model';\nimport {CanMatchFn, Params, Route, UrlSegment} from '@angular/router';\nimport {WORKBENCH_ROUTE} from '../../workbench.constants';\nimport {Capability, MicrofrontendPlatform, PlatformState} from '@scion/microfrontend-platform';\nimport {Crypto} from '@scion/toolkit/crypto';\nimport {MICROFRONTEND_VIEW_NAVIGATION_HINT} from './microfrontend-view-routes';\nimport {MicrofrontendViewNavigationData} from './microfrontend-view-navigation-data';\nimport {canMatchWorkbenchView} from '../../routing/workbench-route-guards';\n\n/**\n * Provides the route for migrating legacy microfrontend view navigations.\n *\n * Navigates the view to migrate:\n * - path-based navigation (~/capabilityId) to empty-path, hint-based navigation\n * - capability id to the new format (including capability type in the hash)\n *\n * @deprecated since version 21.0.0-beta.2. Marked for removal in version 23.\n */\nexport function provideLegacyMicrofrontendViewRoute(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    {\n      provide: WORKBENCH_ROUTE,\n      useFactory: (): Route => ({\n        path: '~/:viewCapabilityId',\n        component: MicrofrontendViewNavigationMigrationComponent,\n        canMatch: [canMatchLegacyMicrofrontendViewNavigation()],\n      }),\n      multi: true,\n    },\n  ]);\n}\n\n/**\n * Matches if a legacy microfrontend view navigation.\n */\nfunction canMatchLegacyMicrofrontendViewNavigation(): CanMatchFn {\n  return async (route, segments): Promise<boolean> => {\n    if (!canMatchWorkbenchView(true)(route, segments)) {\n      return false;\n    }\n\n    // Guards cannot block waiting for platform startup, as the platform may start later in the bootstrapping, causing a deadlock.\n    // Guards are re-evaluated after startup. See `runCanMatchGuardsAfterStartup`.\n    if (MicrofrontendPlatform.state !== PlatformState.Started) {\n      return false;\n    }\n\n    // Test if a legacy capability id.\n    const legacyMicrofrontendViewUrl = parseLegacyMicrofrontendViewUrl(segments);\n    return await findCapabilityByLegacyCapabilityId(legacyMicrofrontendViewUrl.legacyCapabilityId) !== null;\n  };\n}\n\n/**\n * Migrates a legacy microfrontend view path and capability id to the new format.\n */\n@Component({\n  selector: 'wb-microfrontend-view-navigation-migration',\n  template: 'Migrating View...',\n})\nclass MicrofrontendViewNavigationMigrationComponent {\n\n  constructor() {\n    void this.migrateView();\n  }\n\n  private async migrateView(): Promise<void> {\n    const view = inject(WorkbenchView);\n    const router = inject(WorkbenchRouter);\n\n    const microfrontendUrl = parseLegacyMicrofrontendViewUrl(view.navigation()!.path);\n    const capability = (await findCapabilityByLegacyCapabilityId(microfrontendUrl.legacyCapabilityId))!;\n\n    await router.navigate(layout => layout.navigateView(view.id, [], {\n      hint: MICROFRONTEND_VIEW_NAVIGATION_HINT,\n      data: {\n        capabilityId: capability.metadata!.id,\n        params: microfrontendUrl.params,\n        referrer: '',\n      } satisfies MicrofrontendViewNavigationData,\n    }), {skipLocationChange: true, replaceUrl: true});\n  }\n}\n\n/**\n * Finds a capability by its legacy capability identifier.\n */\nasync function findCapabilityByLegacyCapabilityId(legacyCapabilityId: string): Promise<Capability | null> {\n  const capabilities = inject(ManifestObjectCache).capabilities();\n  for (const capability of capabilities.values()) {\n    if (legacyCapabilityId === await generateLegacyCapabilityIdentifier(capability)) {\n      return capability;\n    }\n  }\n  return null;\n}\n\n/**\n * Generates the legacy identifier for given capability.\n */\nasync function generateLegacyCapabilityIdentifier(capability: Capability): Promise<string> {\n  const qualifier = capability.qualifier!;\n  const application = capability.metadata!.appSymbolicName;\n\n  // Create identifier consisting of vendor and sorted qualifier entries.\n  const identifier = Object.entries(qualifier)\n    .sort(([key1], [key2]) => key1.localeCompare(key2))\n    .reduce(\n      (acc, [key, value]) => acc.concat(key).concat(`${value}`),\n      [application],\n    )\n    .join(';');\n\n  // Hash the identifier.\n  const identifierHash = await Crypto.digest(identifier);\n  // Use the first 7 digits of the hash.\n  return identifierHash.substring(0, 7);\n}\n\n/**\n * Parses given URL segments, returning capability id and parameters if a legacy microfrontend view URL.\n */\nfunction parseLegacyMicrofrontendViewUrl(segments: UrlSegment[]): {legacyCapabilityId: string; params: Params} {\n  return {\n    legacyCapabilityId: segments[1]!.path,\n    params: segments[1]!.parameters,\n  };\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, inject, makeEnvironmentProviders, Provider} from '@angular/core';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {CapabilityInterceptor, HostManifestInterceptor, IntentInterceptor, MicrofrontendPlatformConfig} from '@scion/microfrontend-platform';\nimport {WorkbenchCapabilities, WorkbenchDialogService, WorkbenchMessageBoxService, WorkbenchPopupService, ɵWorkbenchDialogService, ɵWorkbenchMessageBoxService, ɵWorkbenchPopupService} from '@scion/workbench-client';\nimport {provideStableCapabilityId} from '../stable-capability-id-assigner.provider';\nimport {MicrofrontendPlatformStartupPhase, provideMicrofrontendPlatformInitializer} from '../microfrontend-platform-initializer';\nimport {provideViewCommandHandlers} from './microfrontend-view-command-handler.service';\nimport {MicrofrontendViewIntentHandler} from './microfrontend-view-intent-handler.interceptor';\nimport {MicrofrontendViewTransientParameterDeprecationLogger} from './microfrontend-view-transient-parameter-deprecation-logger.interceptor';\nimport {ViewCapabilityPreloadCapabilityInterceptor} from './view-capability-preload-capability-interceptor.service';\nimport {MicrofrontendViewCapabilityValidator} from './microfrontend-view-capability-validator.interceptor';\nimport {provideMicrofrontendViewRoute} from './microfrontend-view-routes';\nimport {MicrofrontendViewIntentionProvider} from './microfrontend-view-intention-provider.interceptor';\nimport {WORKBENCH_VIEW_CONTEXT} from '../../view/workbench-view-context.provider';\nimport {WorkbenchView} from '../../view/workbench-view.model';\nimport {provideLegacyMicrofrontendViewRoute} from './legacy-microfrontend-view-navigation-migration';\n\n/**\n * Provides a set of DI providers enabling microfrontend view support.\n *\n * @see WorkbenchViewCapability\n */\nexport function provideMicrofrontendView(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    MicrofrontendViewIntentHandler,\n    MicrofrontendViewCapabilityValidator,\n    MicrofrontendViewIntentionProvider,\n    ViewCapabilityPreloadCapabilityInterceptor,\n    MicrofrontendViewTransientParameterDeprecationLogger,\n    provideMicrofrontendViewRoute(),\n    provideLegacyMicrofrontendViewRoute(),\n    provideViewCommandHandlers(),\n    provideStableCapabilityId(WorkbenchCapabilities.View),\n    provideWorkbenchViewContext(),\n    provideMicrofrontendPlatformInitializer(onPreStartup, {phase: MicrofrontendPlatformStartupPhase.PreStartup}),\n  ]);\n\n  function onPreStartup(): void {\n    // Add view intention to the host manifest for the workbench to read view capabilities.\n    Beans.register(HostManifestInterceptor, {useValue: inject(MicrofrontendViewIntentionProvider), multi: true});\n    // Register view capability validator.\n    Beans.register(CapabilityInterceptor, {useValue: inject(MicrofrontendViewCapabilityValidator), multi: true});\n    // Register view intent handler.\n    Beans.register(IntentInterceptor, {useValue: inject(MicrofrontendViewIntentHandler), multi: true});\n    // Register logger to inform about deprecated transient view parameters.\n    Beans.register(CapabilityInterceptor, {useValue: inject(MicrofrontendViewTransientParameterDeprecationLogger), multi: true});\n    // Mark views not defining the `lazy` property as 'non-lazy' to maintain compatibility with applications setting view titles in the microfrontend.\n    if (inject(MicrofrontendPlatformConfig).preloadInactiveViews) {\n      Beans.register(CapabilityInterceptor, {useValue: inject(ViewCapabilityPreloadCapabilityInterceptor), multi: true});\n    }\n  }\n\n  /**\n   * Provides beans of @scion/workbench-client available for DI if in the context of a workbench view.\n   */\n  function provideWorkbenchViewContext(): Provider {\n    return {\n      provide: WORKBENCH_VIEW_CONTEXT,\n      useFactory: (): Provider[] => [\n        {provide: WorkbenchDialogService, useFactory: () => new ɵWorkbenchDialogService(inject(WorkbenchView).id)},\n        {provide: WorkbenchMessageBoxService, useFactory: () => new ɵWorkbenchMessageBoxService(inject(WorkbenchView).id)},\n        {provide: WorkbenchPopupService, useFactory: () => new ɵWorkbenchPopupService(inject(WorkbenchView).id)},\n      ],\n      multi: true,\n    };\n  }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, inject} from '@angular/core';\nimport {eNOTIFICATION_MESSAGE_PARAM} from '@scion/workbench-client';\nimport {UUID} from '@scion/toolkit/uuid';\nimport {Translatable} from '../../../text/workbench-text-provider.model';\nimport {TextPipe} from '../../../text/text.pipe';\nimport {createRemoteTranslatable} from '../../microfrontend-text/remote-text-provider';\nimport {ActivatedMicrofrontend} from '../../microfrontend-host/microfrontend-host.model';\n\n/**\n * Displays the notification for the built-in notification capability.\n *\n * This component is designed to be displayed in {@link MicrofrontendHostComponent}.\n */\n@Component({\n  selector: 'wb-notification-text-message',\n  styleUrls: ['./notification-text-message.component.scss'],\n  templateUrl: './notification-text-message.component.html',\n  imports: [\n    TextPipe,\n  ],\n  host: {\n    '[class.empty]': '!message?.length',\n  },\n})\nexport default class NotificationTextMessageComponent {\n\n  protected message: Translatable | undefined;\n\n  constructor() {\n    const {params, referrer} = inject(ActivatedMicrofrontend);\n    const translatable = params().get(eNOTIFICATION_MESSAGE_PARAM) as Translatable | undefined;\n    this.message = createRemoteTranslatable(translatable, {appSymbolicName: referrer()});\n  }\n}\n\n/**\n * Property to identify the built-in text notification capability.\n */\nexport const TEXT_NOTIFICATION_CAPABILITY_IDENTITY_PROPERTY = 'ɵidentity';\n/**\n * Value to identify the built-in text notification capability.\n */\nexport const TEXT_NOTIFICATION_CAPABILITY_IDENTITY = UUID.randomUUID();\n","{{(message | wbText)()}}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {HostManifestInterceptor, Manifest} from '@scion/microfrontend-platform';\nimport {eNOTIFICATION_MESSAGE_PARAM, WorkbenchCapabilities, WorkbenchNotificationCapability} from '@scion/workbench-client';\nimport {TEXT_NOTIFICATION_CAPABILITY_IDENTITY, TEXT_NOTIFICATION_CAPABILITY_IDENTITY_PROPERTY} from '../microfrontend-host-notification/notification-text-message/notification-text-message.component';\n\n/**\n * Intercepts the host manifest, registering the built-in text notification capability.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendTextNotificationCapabilityProvider implements HostManifestInterceptor {\n\n  public intercept(hostManifest: Manifest): void {\n    hostManifest.capabilities = [\n      ...hostManifest.capabilities ?? [],\n      provideBuiltInTextNotificationCapability(),\n    ];\n  }\n}\n\n/**\n * Provides the built-in notification capability to display text.\n *\n * @see MicrofrontendNotificationIntentHandler\n */\nfunction provideBuiltInTextNotificationCapability(): WorkbenchNotificationCapability {\n  return {\n    type: WorkbenchCapabilities.Notification,\n    qualifier: {},\n    params: [\n      {\n        name: eNOTIFICATION_MESSAGE_PARAM,\n        required: false,\n        description: 'Text to display in the notification.',\n      },\n    ],\n    properties: {\n      path: '',\n      [TEXT_NOTIFICATION_CAPABILITY_IDENTITY_PROPERTY]: TEXT_NOTIFICATION_CAPABILITY_IDENTITY,\n    },\n    private: false,\n    description: 'Displays a text notification.',\n  };\n}\n","import {Signal} from '@angular/core';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {NotificationId} from '../workbench.identifiers';\n\n/**\n * A notification is a closable message displayed in the upper-right corner that disappears after a few seconds unless hovered or focused.\n * It informs about system events, task completion, or errors. Severity indicates importance or urgency.\n *\n * The notification component can inject this handle to interact with the notification.\n *\n * Notification inputs are available as input properties in the notification component.\n *\n * @see WorkbenchNotificationService\n */\nexport abstract class WorkbenchNotification {\n  /**\n   * Identity of this notification.\n   */\n  public abstract readonly id: NotificationId;\n\n  /**\n   * Sets the title of the notification.\n   *\n   * Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   */\n  public abstract get title(): Signal<Translatable | undefined>;\n  public abstract set title(title: Translatable | undefined);\n\n  /**\n   * Sets the preferred notification size. Defaults to the content's intrinsic size, constrained by min and max size, if set.\n   */\n  public abstract readonly size: WorkbenchNotificationSize;\n\n  /**\n   * Sets the severity of the notification to indicate importance or urgency.\n   */\n  public abstract get severity(): Signal<'info' | 'warn' | 'error'>;\n  public abstract set severity(severity: 'info' | 'warn' | 'error');\n\n  /**\n   * Controls how long to display the notification.\n   *\n   * Can be a duration alias, or milliseconds.\n   */\n  public abstract get duration(): Signal<'short' | 'medium' | 'long' | 'infinite' | number>;\n  public abstract set duration(duration: 'short' | 'medium' | 'long' | 'infinite' | number);\n\n  /**\n   * Specifies CSS class(es) to add to the notification, e.g., to locate the notification in tests.\n   */\n  public abstract get cssClass(): Signal<string[]>;\n  public abstract set cssClass(cssClass: string | string[]);\n\n  /**\n   * Indicates whether this notification has the focus.\n   */\n  public abstract readonly focused: Signal<boolean>;\n\n  /**\n   * Gets size and position of this notification, or `undefined` if not constructed.\n   */\n  public abstract readonly bounds: Signal<DOMRect | undefined>;\n\n  /**\n   * Closes the notification.\n   */\n  public abstract close(): void;\n}\n\n/**\n * Represents the preferred notification size.\n */\nexport interface WorkbenchNotificationSize {\n  /**\n   * Specifies the height of the notification, constrained by {@link minHeight} and {@link maxHeight}, if any.\n   */\n  get height(): Signal<string | undefined>;\n\n  set height(height: string | undefined);\n\n  /**\n   * Specifies the minimum height of the notification.\n   */\n  get minHeight(): Signal<string | undefined>;\n\n  set minHeight(minHeight: string | undefined);\n\n  /**\n   * Specifies the maximum height of the notification.\n   */\n  get maxHeight(): Signal<string | undefined>;\n\n  set maxHeight(maxHeight: string | undefined);\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {Notification} from './notification';\nimport {ɵWorkbenchNotification} from './ɵworkbench-notification.model';\nimport {inject} from '@angular/core';\nimport {UID} from '../common/uid.util';\n\n/**\n * @inheritDoc\n *\n * TODO [Angular 22] Remove with Angular 22. Used for backward compatiblity.\n */\nexport class ɵNotification<T = any> implements Notification<T> {\n\n  private readonly _notification = inject(ɵWorkbenchNotification);\n\n  public readonly input: T | undefined;\n\n  constructor() {\n    this.input = this._notification.inputs?.[LEGACY_NOTIFICATION_INPUT] as T | undefined;\n  }\n\n  /** @inheritDoc */\n  public setTitle(title: Translatable | undefined): void {\n    this._notification.title = title;\n  }\n\n  /** @inheritDoc */\n  public setSeverity(severity: 'info' | 'warn' | 'error'): void {\n    this._notification.severity = severity;\n  }\n\n  /** @inheritDoc */\n  public setDuration(duration: 'short' | 'medium' | 'long' | 'infinite' | number): void {\n    if (typeof duration === 'number') {\n      this._notification.duration = duration * 1000;\n    }\n    else {\n      this._notification.duration = duration;\n    }\n  }\n\n  /** @inheritDoc */\n  public setCssClass(cssClass: string | string[]): void {\n    this._notification.cssClass = cssClass;\n  }\n\n  /** @inheritDoc */\n  public close(): void {\n    this._notification.close();\n  }\n}\n\n/**\n * TODO [Angular 22] Remove with Angular 22. Used for backward compatiblity.\n */\nexport const LEGACY_NOTIFICATION_INPUT = `${UID.randomUID()}-auto-generated`;\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Translatable} from '../text/workbench-text-provider.model';\n\n/**\n * Represents a handle that a notification component can inject to interact with the notification, for example,\n * to read input data or to configure the notification.\n *\n * A notification is a closable message that appears in the upper-right corner and disappears automatically after a few seconds.\n * It informs the user of a system event, e.g., that a task has been completed or an error has occurred.\n *\n * @deprecated since version 21.0.0-beta.1. Replaced by `WorkbenchNotification`. Marked for removal in version 22.\n */\nexport abstract class Notification<T = any> {\n\n  /**\n   * Input data as passed by the notification opener, or `undefined` if not passed.\n   */\n  public readonly input: T | undefined;\n\n  /**\n   * Sets the title of the notification.\n   *\n   * Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   */\n  public abstract setTitle(title: Translatable | undefined): void;\n\n  /**\n   * Sets the severity of the notification.\n   */\n  public abstract setSeverity(severity: 'info' | 'warn' | 'error'): void;\n\n  /**\n   * Sets the timeout upon which to close the notification automatically.\n   * Can be either a duration alias, or a number in seconds.\n   */\n  public abstract setDuration(duration: 'short' | 'medium' | 'long' | 'infinite' | number): void;\n\n  /**\n   * Specifies CSS class(es) to add to the notification, e.g., to locate the notification in tests.\n   */\n  public abstract setCssClass(cssClass: string | string[]): void;\n\n  /**\n   * Closes the notification.\n   */\n  public abstract close(): void;\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\nimport {LEGACY_NOTIFICATION_INPUT} from './ɵnotification';\n\n/**\n * TODO [Angular 22] Remove with Angular 22. Used for backward compatiblity.\n */\n@Pipe({name: 'wbRemoveLegacyInput'})\nexport class RemoveLegacyInputPipe implements PipeTransform {\n\n  public transform(inputs: {[name: string]: unknown} | undefined): {[name: string]: unknown} | undefined {\n    const inputsCopy = {...inputs ?? {}};\n    delete inputsCopy[LEGACY_NOTIFICATION_INPUT]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n    return inputsCopy;\n  }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, DOCUMENT, effect, ElementRef, inject, NgZone, Provider, signal, untracked, viewChild} from '@angular/core';\nimport {fromEvent, NEVER, Observable, timer} from 'rxjs';\nimport {NgComponentOutlet} from '@angular/common';\nimport {TextPipe} from '../text/text.pipe';\nimport {IconComponent} from '../icon/icon.component';\nimport {ɵWorkbenchNotification} from './ɵworkbench-notification.model';\nimport {RemoveLegacyInputPipe} from './remove-legacy-input.pipe';\nimport {trackFocus} from '../focus/workbench-focus-tracker.service';\nimport {SciViewportComponent} from '@scion/components/viewport';\nimport {observeIn, subscribeIn} from '@scion/toolkit/operators';\nimport {filter} from 'rxjs/operators';\nimport {GLASS_PANE_BLOCKABLE, GLASS_PANE_OPTIONS, GlassPaneDirective, GlassPaneOptions} from '../glass-pane/glass-pane.directive';\n\n/**\n * Renders the content of a workbench notification.\n */\n@Component({\n  selector: 'wb-notification',\n  templateUrl: './workbench-notification.component.html',\n  styleUrl: './workbench-notification.component.scss',\n  imports: [\n    TextPipe,\n    IconComponent,\n    NgComponentOutlet,\n    RemoveLegacyInputPipe,\n    SciViewportComponent,\n  ],\n  hostDirectives: [\n    GlassPaneDirective,\n  ],\n  providers: [\n    configureNotificationGlassPane(),\n  ],\n  host: {\n    '[attr.data-notificationid]': 'notification.id',\n    '[attr.data-severity]': 'notification.severity()',\n    '[style.min-height]': 'notification.size.minHeight()',\n    '[style.height]': 'notification.size.height()',\n    '[style.max-height]': 'notification.size.maxHeight()',\n    '[style.--ɵslot-anchor]': '`--${slotAnchorName}`',\n    '[attr.tabindex]': '-1',\n    '[class]': 'notification.cssClass()',\n    '(mouseenter)': 'hover.set(true)',\n    '(mouseleave)': 'hover.set(false)',\n    '(auxclick)': 'onAuxClick($event)',\n    '(keydown.escape)': 'onEscape($event)',\n  },\n})\nexport class WorkbenchNotificationComponent {\n\n  protected readonly notification = inject(ɵWorkbenchNotification);\n  protected readonly hover = signal(false);\n  protected readonly slotAnchorName = this.notification.id.replace('.', '_'); // Anchor must not contain a dot.\n\n  public readonly notificationSlotBounds = viewChild('slot_bounds', {read: ElementRef<HTMLElement>});\n\n  constructor() {\n    this.installAutoCloseTimer();\n    this.closeOnEscapeIfOnTop();\n\n    trackFocus(inject(ElementRef).nativeElement as HTMLElement, this.notification);\n  }\n\n  protected onClose(): void {\n    this.notification.close();\n  }\n\n  protected onEscape(event: Event): void {\n    if (this.notification.focused()) {\n      event.stopPropagation(); // stop propagation to prevent closing the most recently displayed notification\n      this.notification.close();\n    }\n  }\n\n  protected onAuxClick(event: MouseEvent): void {\n    if (event.button === 1) { // primary aux button\n      event.preventDefault(); // prevent user-agent default action\n      this.notification.close();\n    }\n  }\n\n  /**\n   * Closes this notification when pressing escape if it is the most recently displayed notification.\n   */\n  private closeOnEscapeIfOnTop(): void {\n    const zone = inject(NgZone);\n    const document = inject(DOCUMENT);\n\n    effect(onCleanup => {\n      if (!this.notification.top()) {\n        return;\n      }\n\n      const subscription = fromEvent<KeyboardEvent>(document, 'keydown')\n        .pipe(\n          subscribeIn(fn => zone.runOutsideAngular(fn)),\n          filter((event: KeyboardEvent) => event.key === 'Escape'),\n          observeIn(fn => zone.run(fn)),\n        )\n        .subscribe(() => this.notification.close());\n      onCleanup(() => subscription.unsubscribe());\n    });\n  }\n\n  /**\n   * Installs a timer to close the notification.\n   */\n  private installAutoCloseTimer(): void {\n    effect(onCleanup => {\n      const duration = this.notification.duration();\n      const focus = this.notification.focused();\n      const blockedBy = this.notification.blockedBy();\n      const hover = this.hover();\n\n      if (hover || focus || blockedBy) {\n        return;\n      }\n\n      untracked(() => {\n        const subscription = fromDuration$(duration).subscribe(() => this.notification.close());\n        onCleanup(() => subscription.unsubscribe());\n      });\n    });\n\n    function fromDuration$(duration: 'short' | 'medium' | 'long' | 'infinite' | number): Observable<unknown> {\n      switch (duration) {\n        case 'short':\n          return timer(7000);\n        case 'medium':\n          return timer(15000);\n        case 'long':\n          return timer(30000);\n        default:\n          if (typeof duration === 'number') {\n            return timer(duration);\n          }\n          return NEVER;\n      }\n    }\n  }\n}\n\n/**\n * Blocks this notification when dialog(s) overlay it.\n */\nfunction configureNotificationGlassPane(): Provider[] {\n  return [\n    {\n      provide: GLASS_PANE_BLOCKABLE,\n      useFactory: () => inject(ɵWorkbenchNotification),\n    },\n    {\n      provide: GLASS_PANE_OPTIONS,\n      useFactory: (): GlassPaneOptions => ({attributes: {'data-notificationid': inject(ɵWorkbenchNotification).id}}),\n    },\n  ];\n}\n","<!-- Title -->\n@if (notification.title(); as title) {\n  <header class=\"e2e-title\">{{(title | wbText)()}}</header>\n}\n\n<!-- Message -->\n<div class=\"slot e2e-slot\" [class.text]=\"!!notification.slot.text?.length\">\n  @if (notification.slot.text?.length) {\n    {{(notification.slot.text | wbText)()}}\n  } @else if (notification.slot.component) {\n    <sci-viewport class=\"e2e-notification-slot\">\n      <ng-container *ngComponentOutlet=\"notification.slot.component; inputs: notification.inputs | wbRemoveLegacyInput;\"/>\n    </sci-viewport>\n\n    <!-- Extra DIV to capture bounds available to slotted content, excluding viewport content padding. May differ from the actual content size if content overflows or does not fill the slot. -->\n    <div class=\"slot-bounds e2e-notification-slot-bounds\" #slot_bounds></div>\n  }\n</div>\n\n<button (click)=\"onClose()\"\n        [title]=\"('%workbench.close.tooltip' | wbText)()\"\n        class=\"close e2e-close\">\n  <wb-icon icon=\"workbench.close\"/>\n</button>\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {InjectionToken, Provider} from '@angular/core';\nimport {provideWorkbenchDialogService} from '../dialog/ɵworkbench-dialog.service';\nimport {provideWorkbenchMessageBoxService} from '../message-box/ɵworkbench-message-box.service';\nimport {provideWorkbenchPopupService} from '../popup/ɵworkbench-popup.service';\n\n/**\n * DI token to register providers available for DI if in the context of a workbench notification.\n */\nexport const WORKBENCH_NOTIFICATION_CONTEXT = new InjectionToken<Provider[]>('WORKBENCH_NOTIFICATION_CONTEXT');\n\n/**\n * Provides providers available for DI if in the context of a workbench notification.\n */\nexport function provideWorkbenchNotificationContext(): Provider {\n  return {\n    provide: WORKBENCH_NOTIFICATION_CONTEXT,\n    useFactory: (): Provider[] => [\n      provideWorkbenchDialogService(),\n      provideWorkbenchMessageBoxService(),\n      provideWorkbenchPopupService(),\n    ],\n    multi: true,\n  };\n}\n","import {computed, DestroyableInjector, DestroyRef, inject, Injector, Signal, signal, untracked, WritableSignal} from '@angular/core';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {Arrays} from '@scion/toolkit/util';\nimport {NotificationId} from '../workbench.identifiers';\nimport {WorkbenchNotification, WorkbenchNotificationSize} from './workbench-notification.model';\nimport {WorkbenchNotificationOptions} from './workbench-notification.options';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {ɵNotification} from './ɵnotification';\nimport {Notification} from './notification';\nimport {WorkbenchNotificationRegistry} from './workbench-notification.registry';\nimport {WORKBENCH_ELEMENT} from '../workbench-element-references';\nimport {WorkbenchFocusMonitor} from '../focus/workbench-focus-tracker.service';\nimport {ɵWorkbenchDialog} from '../dialog/ɵworkbench-dialog.model';\nimport {WorkbenchDialogRegistry} from '../dialog/workbench-dialog.registry';\nimport {Blockable} from '../glass-pane/blockable';\nimport {boundingClientRect} from '@scion/components/dimension';\nimport {WorkbenchNotificationComponent} from './workbench-notification.component';\nimport {WbComponentPortal} from '../portal/wb-component-portal';\nimport {WORKBENCH_NOTIFICATION_CONTEXT} from './workbench-notification-context.provider';\n\n/** @inheritDoc */\nexport class ɵWorkbenchNotification implements WorkbenchNotification, Blockable {\n\n  /** Injector for the notification; destroyed when the notification is closed. */\n  public readonly injector = inject(Injector) as DestroyableInjector;\n\n  public readonly slot: {\n    component: ComponentType<unknown> | undefined;\n    text: Translatable | undefined;\n  };\n\n  private readonly _notificationRegistry = inject(WorkbenchNotificationRegistry);\n  private readonly _focusMonitor = inject(WorkbenchFocusMonitor);\n  private readonly _title: WritableSignal<Translatable | undefined>;\n  private readonly _severity: WritableSignal<'info' | 'warn' | 'error'>;\n  private readonly _duration: WritableSignal<'short' | 'medium' | 'long' | 'infinite' | number>;\n  private readonly _cssClass: WritableSignal<string[]>;\n\n  public readonly portal: WbComponentPortal<WorkbenchNotificationComponent>;\n  public readonly size: WorkbenchNotificationSize = new ɵWorkbenchNotificationSize();\n  public readonly focused = computed(() => this._focusMonitor.activeElement()?.id === this.id);\n  /** Checks if this notification is the most recently displayed notification. */\n  public readonly top = computed(() => this._notificationRegistry.top() === this);\n  public readonly destroyed = signal<boolean>(false);\n  public readonly bounds: Signal<DOMRect | undefined>;\n  public readonly blockedBy: Signal<ɵWorkbenchDialog | null>;\n  public readonly group: string | undefined;\n\n  constructor(public id: NotificationId,\n              content: Translatable | null | ComponentType<unknown>,\n              private _options: WorkbenchNotificationOptions) {\n    this.portal = this.createPortal();\n    this.slot = {\n      component: typeof content === 'function' ? content : undefined,\n      text: typeof content === 'string' ? content : undefined,\n    };\n    this._title = signal(this._options.title);\n    this._severity = signal(this._options.severity ?? 'info');\n    this._duration = signal(this._options.duration ?? 'medium');\n    this._cssClass = signal(Arrays.coerce(this._options.cssClass));\n\n    this.group = this._options.group;\n    this.blockedBy = inject(WorkbenchDialogRegistry).top(this.id);\n    this.bounds = boundingClientRect(computed(() => this.portal.componentRef()?.instance.notificationSlotBounds()));\n\n    inject(DestroyRef).onDestroy(() => this.destroyed.set(true));\n  }\n\n  /**\n   * Creates a portal to render {@link WorkbenchNotificationComponent} in the notification's injection context.\n   */\n  private createPortal(): WbComponentPortal<WorkbenchNotificationComponent> {\n    return new WbComponentPortal(WorkbenchNotificationComponent, {\n      injector: this._options.injector,\n      providers: [\n        {provide: ɵWorkbenchNotification, useValue: this},\n        {provide: WorkbenchNotification, useExisting: ɵWorkbenchNotification},\n        {provide: Notification, useClass: ɵNotification},\n        {provide: WORKBENCH_ELEMENT, useExisting: ɵWorkbenchNotification},\n        inject(WORKBENCH_NOTIFICATION_CONTEXT, {optional: true}) ?? [],\n        ...this._options.providers ?? [],\n      ],\n    });\n  }\n\n  /** @inheritDoc */\n  public get title(): Signal<Translatable | undefined> {\n    return this._title;\n  }\n\n  /** @inheritDoc */\n  public set title(title: Translatable | undefined) {\n    untracked(() => this._title.set(title));\n  }\n\n  /** @inheritDoc */\n  public get severity(): Signal<'info' | 'warn' | 'error'> {\n    return this._severity;\n  }\n\n  /** @inheritDoc */\n  public set severity(severity: 'info' | 'warn' | 'error') {\n    untracked(() => this._severity.set(severity));\n  }\n\n  /** @inheritDoc */\n  public get duration(): Signal<'short' | 'medium' | 'long' | 'infinite' | number> {\n    return this._duration;\n  }\n\n  /** @inheritDoc */\n  public set duration(duration: 'short' | 'medium' | 'long' | 'infinite' | number) {\n    untracked(() => this._duration.set(duration));\n  }\n\n  /** @inheritDoc */\n  public get cssClass(): Signal<string[]> {\n    return this._cssClass;\n  }\n\n  /** @inheritDoc */\n  public set cssClass(cssClass: string | string[]) {\n    untracked(() => this._cssClass.set(new Array<string>().concat(this._options.cssClass ?? []).concat(cssClass)));\n  }\n\n  /** @inheritDoc */\n  public close(): void {\n    if (this.blockedBy()) {\n      return;\n    }\n\n    this.destroy();\n  }\n\n  /**\n   * Inputs passed to the notification.\n   */\n  public get inputs(): {[name: string]: unknown} | undefined {\n    return this._options.inputs;\n  }\n\n  /**\n   * Destroys this dialog and associated resources.\n   */\n  public destroy(): void {\n    if (!this.destroyed()) {\n      this.injector.destroy();\n      this._notificationRegistry.unregister(this.id);\n    }\n  }\n}\n\n/** @inheritDoc */\nclass ɵWorkbenchNotificationSize implements WorkbenchNotificationSize {\n\n  private readonly _height = signal<string | undefined>(undefined);\n  private readonly _minHeight = signal<string | undefined>(undefined);\n  private readonly _maxHeight = signal<string | undefined>(undefined);\n\n  /** @inheritDoc */\n  public get height(): Signal<string | undefined> {\n    return this._height;\n  }\n\n  /** @inheritDoc */\n  public set height(height: string | undefined) {\n    untracked(() => this._height.set(height));\n  }\n\n  /** @inheritDoc */\n  public get minHeight(): Signal<string | undefined> {\n    return this._minHeight;\n  }\n\n  /** @inheritDoc */\n  public set minHeight(minHeight: string | undefined) {\n    untracked(() => this._minHeight.set(minHeight));\n  }\n\n  /** @inheritDoc */\n  public get maxHeight(): Signal<string | undefined> {\n    return this._maxHeight;\n  }\n\n  /** @inheritDoc */\n  public set maxHeight(maxHeight: string | undefined) {\n    untracked(() => this._maxHeight.set(maxHeight));\n  }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, effect, ElementRef, inject, Injector, input, signal, untracked, viewChild} from '@angular/core';\nimport {ManifestService, MessageClient, MicrofrontendPlatformConfig, OutletRouter, SciRouterOutletElement} from '@scion/microfrontend-platform';\nimport {Logger, LoggerNames} from '../../logging';\nimport {WorkbenchNotificationCapability, ɵNOTIFICATION_CONTEXT, ɵNotificationContext, ɵWorkbenchCommands} from '@scion/workbench-client';\nimport {NgComponentOutlet} from '@angular/common';\nimport {WorkbenchLayoutService} from '../../layout/workbench-layout.service';\nimport {MicrofrontendSplashComponent} from '../microfrontend-splash/microfrontend-splash.component';\nimport {Microfrontends} from '../common/microfrontend.util';\nimport {ɵWorkbenchNotification} from '../../notification/ɵworkbench-notification.model';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\n\n/**\n * Displays the microfrontend of a given {@link WorkbenchNotficationCapability}.\n *\n * This component is designed to be displayed in a workbench notification.\n */\n@Component({\n  selector: 'wb-microfrontend-notification',\n  styleUrls: ['./microfrontend-notification.component.scss'],\n  templateUrl: './microfrontend-notification.component.html',\n  imports: [\n    NgComponentOutlet,\n  ],\n  schemas: [CUSTOM_ELEMENTS_SCHEMA], // required because <sci-router-outlet> is a custom element\n  host: {\n    '[class.workbench-drag]': 'workbenchLayoutService.dragging()',\n  },\n})\nexport class MicrofrontendNotificationComponent {\n\n  public readonly capability = input.required<WorkbenchNotificationCapability>();\n  public readonly params = input.required<Map<string, unknown>>();\n  public readonly referrer = input.required<string>();\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _outletRouter = inject(OutletRouter);\n  private readonly _messageClient = inject(MessageClient);\n  private readonly _logger = inject(Logger);\n  private readonly _routerOutletElement = viewChild.required<ElementRef<SciRouterOutletElement>>('router_outlet');\n\n  /** Splash to display until the microfrontend signals readiness. */\n  protected readonly splash = inject(MicrofrontendPlatformConfig).splash ?? MicrofrontendSplashComponent;\n  protected readonly workbenchLayoutService = inject(WorkbenchLayoutService);\n  protected readonly notification = inject(ɵWorkbenchNotification);\n  protected readonly focusWithin = signal(false);\n\n  constructor() {\n    this._logger.debug(() => 'Constructing MicrofrontendNotificationComponent.', LoggerNames.MICROFRONTEND);\n    this.installNavigator();\n    this.installNotificationCloseListener();\n    this.installNotificationFocusedPublisher();\n    this.setNotificationProperties();\n    this.propagateNotificationContext();\n    this.propagateWorkbenchTheme();\n\n    inject(DestroyRef).onDestroy(() => {\n      // Clear the outlet.\n      void this._outletRouter.navigate(null, {outlet: this.notification.id});\n      // Delete retained messages to free resources.\n      void this._messageClient.publish(ɵWorkbenchCommands.notificationFocusedTopic(this.notification.id), undefined, {retain: true});\n    });\n  }\n\n  private installNavigator(): void {\n    const manifestService = inject(ManifestService);\n    const injector = inject(Injector);\n\n    effect(() => {\n      const capability = this.capability();\n      const params = this.params();\n\n      void untracked(async () => {\n        const application = manifestService.getApplication(capability.metadata!.appSymbolicName);\n        this._logger.debug(() => `Loading microfrontend into workbench notification [app=${capability.metadata!.appSymbolicName}, baseUrl=${application.baseUrl}, path=${capability.properties.path}].`, LoggerNames.MICROFRONTEND, params, capability);\n\n        // Wait for the context to be set on the router outlet, as @scion/workbench-client expects it to be available on startup.\n        await Microfrontends.waitForContext(this._routerOutletElement, ɵNOTIFICATION_CONTEXT, {injector});\n\n        void this._outletRouter.navigate(capability.properties.path, {\n          outlet: this.notification.id,\n          relativeTo: application.baseUrl,\n          params: params,\n          pushStateToSessionHistoryStack: false,\n          showSplash: capability.properties.showSplash,\n        });\n      });\n    });\n  }\n\n  private installNotificationCloseListener(): void {\n    this._messageClient.observe$<unknown>(ɵWorkbenchCommands.notificationCloseTopic(this.notification.id))\n      .pipe(takeUntilDestroyed())\n      .subscribe(() => {\n        this.notification.close();\n      });\n  }\n\n  private installNotificationFocusedPublisher(): void {\n    effect(() => {\n      const focused = this.notification.focused();\n\n      untracked(() => {\n        const commandTopic = ɵWorkbenchCommands.notificationFocusedTopic(this.notification.id);\n        void this._messageClient.publish(commandTopic, focused, {retain: true});\n      });\n    });\n  }\n\n  private setNotificationProperties(): void {\n    effect(() => {\n      const properties = this.capability().properties;\n\n      untracked(() => {\n        this.notification.size.height = properties.size?.height;\n        this.notification.size.minHeight = properties.size?.minHeight;\n        this.notification.size.maxHeight = properties.size?.maxHeight;\n      });\n    });\n  }\n\n  protected onFocusWithin(event: Event): void {\n    const {detail: focusWithin} = event as CustomEvent<boolean>;\n    this.focusWithin.set(focusWithin);\n\n    if (focusWithin) {\n      this._host.dispatchEvent(new CustomEvent('sci-microfrontend-focusin', {bubbles: true}));\n    }\n  }\n\n  /**\n   * Provides the notification context to embedded content.\n   */\n  private propagateNotificationContext(): void {\n    effect(() => {\n      const context: ɵNotificationContext = {\n        notificationId: this.notification.id,\n        capability: this.capability(),\n        params: this.params(),\n        referrer: {\n          appSymbolicName: this.referrer(),\n        },\n      };\n      const routerOutletElement = this._routerOutletElement().nativeElement;\n\n      untracked(() => routerOutletElement.setContextValue(ɵNOTIFICATION_CONTEXT, context));\n    });\n  }\n\n  private propagateWorkbenchTheme(): void {\n    Microfrontends.propagateTheme(this._routerOutletElement);\n  }\n}\n","<sci-router-outlet #router_outlet\n                   [name]=\"notification.id\"\n                   [attr.data-capabilityid]=\"capability().metadata!.id\"\n                   [attr.data-app]=\"capability().metadata!.appSymbolicName\"\n                   [attr.data-focus]=\"focusWithin() ? '' : null\"\n                   keystrokes=\"keydown.escape\"\n                   [class]=\"notification.cssClass()\"\n                   (focuswithin)=\"onFocusWithin($event)\">\n  <ng-container *ngComponentOutlet=\"splash\"/>\n</sci-router-outlet>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ApplicationRef, assertNotInReactiveContext, inject, Injectable, Injector, NgZone, runInInjectionContext} from '@angular/core';\nimport {computeNotificationId} from '../workbench.identifiers';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {WorkbenchNotificationService} from './workbench-notification.service';\nimport {WorkbenchNotificationOptions} from './workbench-notification.options';\nimport {ɵWorkbenchNotification} from './ɵworkbench-notification.model';\nimport {WorkbenchNotificationRegistry} from './workbench-notification.registry';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {SingleTaskExecutor} from '../executor/single-task-executor';\n\n/** @inheritDoc */\n@Injectable({providedIn: 'root'})\nexport class ɵWorkbenchNotificationService implements WorkbenchNotificationService {\n\n  private readonly _rootInjector = inject(ApplicationRef).injector;\n  private readonly _notificationRegistry = inject(WorkbenchNotificationRegistry);\n  private readonly _mutex = new SingleTaskExecutor();\n  private readonly _zone = inject(NgZone);\n\n  /** @inheritDoc */\n  public show(message: Translatable | null | ComponentType<unknown>, options?: WorkbenchNotificationOptions): void {\n    assertNotInReactiveContext(this.show, 'Call WorkbenchNotificationService.show() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n    // Ensure to run in Angular zone to show the notification even when called from outside the Angular zone.\n    if (!NgZone.isInAngularZone()) {\n      this._zone.run(() => this.show(message, options));\n      return;\n    }\n\n    // Prevent race conditions with asynchronous group reducer, ensuring to not have a \"stale\" previous notification.\n    void this._mutex.submit(async () => {\n      const previousNotification = options?.group ? this._notificationRegistry.elements().find(element => element.group === options.group) : undefined;\n\n      // Replace previous notification of the same group, or add it otherwise.\n      if (previousNotification) {\n        const reducedInputs = options?.groupInputReduceFn ? await options.groupInputReduceFn(previousNotification.inputs ?? {}, options.inputs ?? {}) : options?.inputs;\n        const notification = this.createNotification(message, {...options, inputs: reducedInputs});\n        this._notificationRegistry.replace(previousNotification.id, {key: notification.id, element: notification});\n      }\n      else {\n        const notification = this.createNotification(message, options);\n        this._notificationRegistry.register(notification.id, notification);\n      }\n    });\n  }\n\n  /**\n   * Creates the notification handle.\n   */\n  private createNotification(message: Translatable | null | ComponentType<unknown>, options?: WorkbenchNotificationOptions): ɵWorkbenchNotification {\n    // Construct the handle in an injection context that shares the notification's lifecycle, allowing for automatic cleanup of effects and RxJS interop functions.\n    const notificationId = computeNotificationId();\n    const notificationInjector = Injector.create({\n      parent: this._rootInjector, // use root injector to be independent of service construction context\n      providers: [],\n      name: `Workbench Notification ${notificationId}`,\n    });\n\n    return runInInjectionContext(notificationInjector, () => new ɵWorkbenchNotification(notificationId, message, options ?? {}));\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {WorkbenchNotificationOptions} from './workbench-notification.options';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {ɵWorkbenchNotificationService} from './ɵworkbench-notification.service';\n\n/**\n * Shows a notification.\n *\n * A notification is a closable message displayed in the upper-right corner that disappears after a few seconds unless hovered or focused.\n * It informs about system events, task completion, or errors. Severity indicates importance or urgency.\n *\n * Notifications can be grouped. Only the most recent notification within a group is displayed.\n *\n * Content can be plain text or structured. Pressing Escape closes the notification.\n */\n@Injectable({providedIn: 'root', useExisting: ɵWorkbenchNotificationService})\nexport abstract class WorkbenchNotificationService {\n\n  /**\n   * Displays the specified message as workbench notification.\n   *\n   * @param message - Specifies the text to display, if any.\n   *                  Can be text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.\n   * @param options - Controls the appearance and behavior of the notification.\n   */\n  public abstract show(message: Translatable | null, options?: WorkbenchNotificationOptions): void;\n\n  /**\n   * Displays the specified component as workbench notification.\n   *\n   * Data can be passed to the component as inputs via {@link WorkbenchNotificationOptions.inputs} option. Inputs are available as input\n   * properties in the component. Alternatively, data can be passed for injection via a custom injector ({@link WorkbenchNotificationOptions.injector})\n   * or providers ({@link WorkbenchNotificationOptions.providers}).\n   *\n   * @param component - Specifies the component to render as the notification.\n   * @param options - Controls the appearance and behavior of the notification.\n   */\n  public abstract show(component: ComponentType<unknown>, options?: WorkbenchNotificationOptions): void;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {signal, Signal} from '@angular/core';\nimport {WorkbenchNotificationCapability} from '@scion/workbench-client';\nimport {WorkbenchNotification} from '../../notification/workbench-notification.model';\n\n/** @inheritDoc */\nexport class MicrofrontendHostNotification implements ActivatedMicrofrontend {\n\n  public readonly capability: Signal<WorkbenchNotificationCapability>;\n  public readonly params: Signal<Map<string, unknown>>;\n  public readonly referrer: Signal<string>;\n\n  constructor(private _notification: WorkbenchNotification, capability: WorkbenchNotificationCapability, params: Map<string, unknown>, referrer: string) {\n    this.capability = signal(capability).asReadonly();\n    this.params = signal(params).asReadonly();\n    this.referrer = signal(referrer).asReadonly();\n    this.setNotificationProperties();\n  }\n\n  private setNotificationProperties(): void {\n    const properties = this.capability().properties;\n    this._notification.size.height = properties.size?.height;\n    this._notification.size.minHeight = properties.size?.minHeight;\n    this._notification.size.maxHeight = properties.size?.maxHeight;\n  }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, runInInjectionContext, StaticProvider} from '@angular/core';\nimport {Handler, IntentInterceptor, IntentMessage, MessageClient, MessageHeaders, ResponseStatusCodes} from '@scion/microfrontend-platform';\nimport {eNOTIFICATION_MESSAGE_PARAM, WorkbenchCapabilities, WorkbenchNotificationCapability, WorkbenchNotificationConfig, ɵWorkbenchNotificationCommand} from '@scion/workbench-client';\nimport {Logger, LoggerNames} from '../../logging';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {Arrays} from '@scion/toolkit/util';\nimport {MicrofrontendNotificationComponent} from './microfrontend-notification.component';\nimport {createRemoteTranslatable} from '../microfrontend-text/remote-text-provider';\nimport {MicrofrontendHostComponent} from '../microfrontend-host/microfrontend-host.component';\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {prune} from '../../common/prune.util';\nimport {Microfrontends} from '../common/microfrontend.util';\nimport {WorkbenchNotificationService} from '../../notification/workbench-notification.service';\nimport {MicrofrontendHostNotification} from '../microfrontend-host-notification/microfrontend-host-notification.model';\nimport {ɵWorkbenchNotification} from '../../notification/ɵworkbench-notification.model';\nimport {TEXT_NOTIFICATION_CAPABILITY_IDENTITY, TEXT_NOTIFICATION_CAPABILITY_IDENTITY_PROPERTY} from '../microfrontend-host-notification/notification-text-message/notification-text-message.component';\nimport {firstValueFrom} from 'rxjs';\n\n/**\n * Handles notification intents, opening a notification based on resolved capability.\n *\n * Microfrontends of the host are displayed in {@link MicrofrontendHostComponent}, microfrontends of other applications in {@link MicrofrontendNotificationComponent}.\n *\n * Notification intents are handled in this interceptor and are not transported to the providing application to support applications not connected to the SCION Workbench.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendNotificationIntentHandler implements IntentInterceptor {\n\n  private readonly _notificationService = inject(WorkbenchNotificationService);\n  private readonly _logger = inject(Logger);\n\n  /**\n   * Notification intents are handled in this interceptor and then swallowed.\n   */\n  public async intercept(intentMessage: IntentMessage, next: Handler<IntentMessage>): Promise<void> {\n    if (intentMessage.intent.type === WorkbenchCapabilities.Notification) {\n      const replyTo = intentMessage.headers.get(MessageHeaders.ReplyTo) as string;\n\n      await this.showNotification(intentMessage as IntentMessage<ɵWorkbenchNotificationCommand | WorkbenchNotificationConfig>);\n      void Beans.get(MessageClient).publish(replyTo, undefined, {headers: new Map().set(MessageHeaders.Status, ResponseStatusCodes.TERMINAL)});\n\n      // Do not continue the handler chain to swallow the intent.\n    }\n    else {\n      return next.handle(intentMessage);\n    }\n  }\n\n  /**\n   * Displays the microfrontend declared by the resolved capability in a notification.\n   */\n  private async showNotification(intentMessage: IntentMessage<ɵWorkbenchNotificationCommand | WorkbenchNotificationConfig>): Promise<void> {\n    const command: ɵWorkbenchNotificationCommand | WorkbenchNotificationConfig = intentMessage.body!;\n    const capability = intentMessage.capability as WorkbenchNotificationCapability;\n    const capabilityId = capability.metadata!.id;\n    const groupParamsReducer = capability.properties.groupParamsReducer;\n    const params = intentMessage.intent.params ?? new Map<string, unknown>();\n    const referrer = intentMessage.headers.get(MessageHeaders.AppSymbolicName) as string;\n    const isHostProvider = Microfrontends.isHostProvider(capability);\n    const legacyTextNotification = isLegacyTextNotification(capability, intentMessage);\n\n    if (legacyTextNotification) {\n      params.set(eNOTIFICATION_MESSAGE_PARAM, (command as WorkbenchNotificationConfig).content);\n    }\n\n    this._logger.debug(() => 'Handling microfrontend notification intent', LoggerNames.MICROFRONTEND, command);\n    this._notificationService.show(isHostProvider ? MicrofrontendHostComponent : MicrofrontendNotificationComponent, prune({\n      inputs: isHostProvider ? {params} : {capability, params, referrer},\n      providers: isHostProvider ? [provideActivatedMicrofrontend(capability, params, referrer)] : undefined,\n      title: createRemoteTranslatable(command.title, {appSymbolicName: referrer}),\n      severity: command.severity,\n      duration: legacyTextNotification && typeof command.duration === 'number' ? command.duration * 1000 : command.duration,\n      group: command.group ? `${command.group}_${capabilityId}_${referrer}` : undefined, // Use distinct group name for different referrers and capabilities not to overwrite each other\n      groupInputReduceFn: groupParamsReducer ? createParamsReducerFn(groupParamsReducer) : undefined,\n      cssClass: Arrays.coerce(capability.properties.cssClass).concat(Arrays.coerce(command.cssClass)),\n    }));\n  }\n}\n\n/**\n * Returns a function to reduce inputs by sending a request to passed topic.\n */\nfunction createParamsReducerFn(reducerTopic: string): (prevInput: {[name: string]: unknown}, currInput: {[name: string]: unknown}) => Promise<{[name: string]: unknown}> {\n  return async (prevInput: {[name: string]: unknown}, currInput: {[name: string]: unknown}) => {\n    const currParams = Object.fromEntries(currInput['params'] as Map<string, unknown>);\n    const prevParams = Object.fromEntries(prevInput['params'] as Map<string, unknown>);\n    const reducedParams = await firstValueFrom(Beans.get(MessageClient).request$<{[name: string]: unknown}>(reducerTopic, {prevParams, currParams}, {retain: true}));\n    return {...currInput, params: new Map(Object.entries(reducedParams.body ?? currParams))};\n  };\n}\n\n/**\n * Indicates whether the notification is opened by a legacy client.\n *\n * TODO [Angular 22] Remove with Angular 22. Used for backward compatiblity.\n */\nfunction isLegacyTextNotification(capability: WorkbenchNotificationCapability, intentMessage: IntentMessage): boolean {\n  const isTextMessage = capability.properties[TEXT_NOTIFICATION_CAPABILITY_IDENTITY_PROPERTY] === TEXT_NOTIFICATION_CAPABILITY_IDENTITY;\n  return isTextMessage && !intentMessage.intent.params?.has(eNOTIFICATION_MESSAGE_PARAM);\n}\n\n/**\n * Provides {@link ActivatedMicrofrontend} for injection in the host microfrontend.\n */\nfunction provideActivatedMicrofrontend(capability: WorkbenchNotificationCapability, params: Map<string, unknown>, referrer: string): StaticProvider {\n  return {\n    provide: ActivatedMicrofrontend,\n    useFactory: () => {\n      const notification = inject(ɵWorkbenchNotification);\n      const reducedParams = notification.inputs?.['params'] as Map<string, unknown> | undefined;\n      // Create in notification's injection context to bind 'MicrofrontendNotification' to the notification's lifecycle.\n      return runInInjectionContext(notification.injector, () => new MicrofrontendHostNotification(notification, capability, reducedParams ?? params, referrer));\n    },\n  };\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Route} from '@angular/router';\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\nimport {WORKBENCH_ROUTE} from '../../workbench.constants';\nimport {canMatchWorkbenchNotificationCapability} from '../microfrontend-host/microfrontend-host-routes';\n\n/**\n * Provides the route for the built-in {@link WorkbenchNotificationCapability}.\n */\nexport function provideMicrofrontendTextNotificationRoute(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    {\n      provide: WORKBENCH_ROUTE,\n      useFactory: (): Route => ({\n        path: '',\n        loadComponent: () => import('../microfrontend-host-notification/notification-text-message/notification-text-message.component'),\n        canMatch: [canMatchWorkbenchNotificationCapability({})],\n      }),\n      multi: true,\n    },\n  ]);\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform';\nimport {Injectable} from '@angular/core';\nimport {WorkbenchCapabilities, WorkbenchNotificationCapability} from '@scion/workbench-client';\nimport {Microfrontends} from '../common/microfrontend.util';\nimport {TEXT_NOTIFICATION_CAPABILITY_IDENTITY, TEXT_NOTIFICATION_CAPABILITY_IDENTITY_PROPERTY} from '../microfrontend-host-notification/notification-text-message/notification-text-message.component';\nimport {WorkbenchNotificationSize} from '../../notification/workbench-notification.model';\nimport {Objects} from '@scion/toolkit/util';\n\n/**\n * Asserts notification capabilities to have required properties.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendNotificationCapabilityValidator implements CapabilityInterceptor {\n\n  public async intercept(capability: Capability): Promise<Capability> {\n    if (capability.type !== WorkbenchCapabilities.Notification) {\n      return capability;\n    }\n\n    const notificationCapability = capability as Partial<WorkbenchNotificationCapability>;\n\n    // Assert capability other than the built-in text notification capability to have a qualifier.\n    if (!isBuiltinNotificationCapability(notificationCapability) && !Object.keys(notificationCapability.qualifier ?? {}).length) {\n      throw Error(`[NotificationDefinitionError] Notification capability requires a qualifier [app=${app(notificationCapability)}, notification=${qualifier(notificationCapability)}]`);\n    }\n\n    // Assert capability to have properties.\n    if (!notificationCapability.properties) {\n      throw Error(`[NotificationDefinitionError] Notification capability requires properties [app=${app(notificationCapability)}, notification=${qualifier(notificationCapability)}]`);\n    }\n\n    // Assert the notification capability to have a path, unless provided by the host application.\n    this.assertPath(notificationCapability);\n\n    // Assert the notification capability to have a height, unless provided by the host application.\n    this.assertSize(notificationCapability);\n\n    // Assert host notification capabilities not to define the \"showSplash\" property.\n    if (Microfrontends.isHostProvider(capability) && notificationCapability.properties.showSplash !== undefined) {\n      throw Error(`[NotificationDefinitionError] Property \"showSplash\" not supported for notification capabilities of the host application [app=${app(notificationCapability)}, notification=${qualifier(notificationCapability)}]`);\n    }\n\n    return capability;\n  }\n\n  private assertPath(capability: Partial<WorkbenchNotificationCapability>): void {\n    const path = capability.properties?.path as string | undefined | null;\n\n    if (Microfrontends.isHostProvider(capability)) {\n      if (path !== '') {\n        throw Error(`[NotificationDefinitionError] Notification capabilities of the host application require an empty path. [app=${app(capability)}, notification=${qualifier(capability)}]. Change the path '${path}' to empty and add 'canMatchWorkbenchNotificationCapability(${JSON.stringify(capability.qualifier)})' guard to the route.\\n\\nExample:\\nCapability: { type: 'notification', qualifier: ${JSON.stringify(capability.qualifier)}, properties: {path: ''} }\\nRoute: { path: '', canMatch: [canMatchWorkbenchNotificationCapability(${JSON.stringify(capability.qualifier)})], component: NotificationComponent }`);\n      }\n    }\n    else {\n      if (path === null || path == undefined) {\n        throw Error(`[NotificationDefinitionError] Notification capabilities require a path. [app=${app(capability)}, notification=${qualifier(capability)}]`);\n      }\n    }\n  }\n\n  private assertSize(capability: Partial<WorkbenchNotificationCapability>): void {\n    if (Microfrontends.isHostProvider(capability)) {\n      return;\n    }\n\n    const size = capability.properties?.size as Partial<WorkbenchNotificationSize> | undefined;\n    if (!size?.height) {\n      throw Error(`[NotificationDefinitionError] Notification capability requires the 'size' property with a height [app=${app(capability)}, notification=${qualifier(capability)}]`);\n    }\n  }\n}\n\nfunction isBuiltinNotificationCapability(capability: Partial<WorkbenchNotificationCapability>): boolean {\n  return capability.properties?.[TEXT_NOTIFICATION_CAPABILITY_IDENTITY_PROPERTY] === TEXT_NOTIFICATION_CAPABILITY_IDENTITY;\n}\n\n/**\n * Returns the qualifier as string.\n */\nfunction qualifier(capability: Partial<Capability>): string {\n  return Objects.toMatrixNotation(capability.qualifier);\n}\n\n/**\n * Returns the app symbolic name.\n */\nfunction app(capability: Partial<Capability>): string {\n  return capability.metadata!.appSymbolicName;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, inject, makeEnvironmentProviders, Provider} from '@angular/core';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {CapabilityInterceptor, HostManifestInterceptor, IntentInterceptor} from '@scion/microfrontend-platform';\nimport {MicrofrontendTextNotificationCapabilityProvider} from './microfrontend-text-notification-capability-provider.interceptor';\nimport {MicrofrontendPlatformStartupPhase, provideMicrofrontendPlatformInitializer} from '../microfrontend-platform-initializer';\nimport {MicrofrontendNotificationIntentHandler} from './microfrontend-notification-intent-handler.interceptor';\nimport {provideMicrofrontendTextNotificationRoute} from './microfrontend-notification-routes';\nimport {MicrofrontendNotificationCapabilityValidator} from './microfrontend-notification-capability-validator.interceptor';\nimport {WORKBENCH_NOTIFICATION_CONTEXT} from '../../notification/workbench-notification-context.provider';\nimport {WorkbenchDialogService, WorkbenchMessageBoxService, WorkbenchPopupService, ɵWorkbenchDialogService, ɵWorkbenchMessageBoxService, ɵWorkbenchPopupService} from '@scion/workbench-client';\nimport {WorkbenchNotification} from '../../notification/workbench-notification.model';\n\n/**\n * Provides a set of DI providers enabling microfrontend notification support.\n *\n * @see WorkbenchNotificationCapability\n */\nexport function provideMicrofrontendNotification(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    MicrofrontendNotificationCapabilityValidator,\n    MicrofrontendTextNotificationCapabilityProvider,\n    MicrofrontendNotificationIntentHandler,\n    provideWorkbenchNotificationContext(),\n    provideMicrofrontendTextNotificationRoute(),\n    provideMicrofrontendPlatformInitializer(onPreStartup, {phase: MicrofrontendPlatformStartupPhase.PreStartup}),\n  ]);\n\n  function onPreStartup(): void {\n    // Register built-in text notification capability in the host manifest.\n    Beans.register(HostManifestInterceptor, {useValue: inject(MicrofrontendTextNotificationCapabilityProvider), multi: true});\n    // Register notification capability validator.\n    Beans.register(CapabilityInterceptor, {useValue: inject(MicrofrontendNotificationCapabilityValidator), multi: true});\n    // Register notification intent handler.\n    Beans.register(IntentInterceptor, {useValue: inject(MicrofrontendNotificationIntentHandler), multi: true});\n  }\n\n  /**\n   * Provides beans of @scion/workbench-client available for DI if in the context of a workbench notification.\n   */\n  function provideWorkbenchNotificationContext(): Provider {\n    return {\n      provide: WORKBENCH_NOTIFICATION_CONTEXT,\n      useFactory: (): Provider[] => [\n        {provide: WorkbenchDialogService, useFactory: () => new ɵWorkbenchDialogService(inject(WorkbenchNotification).id)},\n        {provide: WorkbenchMessageBoxService, useFactory: () => new ɵWorkbenchMessageBoxService(inject(WorkbenchNotification).id)},\n        {provide: WorkbenchPopupService, useFactory: () => new ɵWorkbenchPopupService(inject(WorkbenchNotification).id)},\n      ],\n      multi: true,\n    };\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, effect, ElementRef, inject, Injector, input, signal, untracked, viewChild} from '@angular/core';\nimport {ManifestService, MessageClient, MessageHeaders, MicrofrontendPlatformConfig, OutletRouter, SciRouterOutletElement} from '@scion/microfrontend-platform';\nimport {Logger, LoggerNames} from '../../logging';\nimport {Translatable, WorkbenchDialogCapability, ɵDIALOG_CONTEXT, ɵDialogContext, ɵWorkbenchCommands, ɵWorkbenchDialogMessageHeaders} from '@scion/workbench-client';\nimport {NgComponentOutlet} from '@angular/common';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {WorkbenchLayoutService} from '../../layout/workbench-layout.service';\nimport {MicrofrontendSplashComponent} from '../microfrontend-splash/microfrontend-splash.component';\nimport {ɵWorkbenchDialog} from '../../dialog/ɵworkbench-dialog.model';\nimport {Microfrontends} from '../common/microfrontend.util';\nimport {createRemoteTranslatable} from '../microfrontend-text/remote-text-provider';\n\n/**\n * Displays the microfrontend of a given {@link WorkbenchDialogCapability}.\n *\n * This component is designed to be displayed in a workbench dialog.\n */\n@Component({\n  selector: 'wb-microfrontend-dialog',\n  styleUrls: ['./microfrontend-dialog.component.scss'],\n  templateUrl: './microfrontend-dialog.component.html',\n  imports: [\n    NgComponentOutlet,\n  ],\n  schemas: [CUSTOM_ELEMENTS_SCHEMA], // required because <sci-router-outlet> is a custom element\n  host: {\n    '[class.workbench-drag]': 'workbenchLayoutService.dragging()',\n  },\n})\nexport class MicrofrontendDialogComponent {\n\n  public readonly capability = input.required<WorkbenchDialogCapability>();\n  public readonly params = input.required<Map<string, unknown>>();\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _outletRouter = inject(OutletRouter);\n  private readonly _messageClient = inject(MessageClient);\n  private readonly _logger = inject(Logger);\n  private readonly _routerOutletElement = viewChild.required<ElementRef<SciRouterOutletElement>>('router_outlet');\n\n  protected readonly dialog = inject(ɵWorkbenchDialog);\n  /** Splash to display until the microfrontend signals readiness. */\n  protected readonly splash = inject(MicrofrontendPlatformConfig).splash ?? MicrofrontendSplashComponent;\n  protected readonly workbenchLayoutService = inject(WorkbenchLayoutService);\n  protected readonly focusWithin = signal(false);\n\n  constructor() {\n    this._logger.debug(() => 'Constructing MicrofrontendDialogComponent.', LoggerNames.MICROFRONTEND);\n\n    this.installDialogTitleListener();\n    this.installDialogCloseListener();\n    this.setDialogProperties();\n    this.propagateDialogContext();\n    this.propagateWorkbenchTheme();\n    this.installDialogFocusedPublisher();\n    this.installNavigator();\n\n    inject(DestroyRef).onDestroy(() => {\n      // Clear the outlet.\n      void this._outletRouter.navigate(null, {outlet: this.dialog.id});\n      // Delete retained messages to free resources.\n      void this._messageClient.publish(ɵWorkbenchCommands.dialogFocusedTopic(this.dialog.id), undefined, {retain: true});\n    });\n  }\n\n  private installNavigator(): void {\n    const manifestService = inject(ManifestService);\n    const injector = inject(Injector);\n\n    effect(() => {\n      const capability = this.capability();\n      const params = this.params();\n\n      void untracked(async () => {\n        const application = manifestService.getApplication(capability.metadata!.appSymbolicName);\n        this._logger.debug(() => `Loading microfrontend into workbench dialog [app=${capability.metadata!.appSymbolicName}, baseUrl=${application.baseUrl}, path=${capability.properties.path}].`, LoggerNames.MICROFRONTEND, params, capability);\n\n        // Wait for the context to be set on the router outlet, as @scion/workbench-client expects it to be available on startup.\n        await Microfrontends.waitForContext(this._routerOutletElement, ɵDIALOG_CONTEXT, {injector});\n\n        void this._outletRouter.navigate(capability.properties.path, {\n          outlet: this.dialog.id,\n          relativeTo: application.baseUrl,\n          params: params,\n          pushStateToSessionHistoryStack: false,\n          showSplash: capability.properties.showSplash,\n        });\n      });\n    });\n  }\n\n  /**\n   * Provides the dialog context to embedded content.\n   */\n  private propagateDialogContext(): void {\n    effect(() => {\n      const context: ɵDialogContext = {\n        dialogId: this.dialog.id,\n        capability: this.capability(),\n        params: this.params(),\n      };\n      const routerOutletElement = this._routerOutletElement().nativeElement;\n\n      untracked(() => routerOutletElement.setContextValue(ɵDIALOG_CONTEXT, context));\n    });\n  }\n\n  private installDialogFocusedPublisher(): void {\n    effect(() => {\n      const focused = this.dialog.focused();\n      untracked(() => {\n        const commandTopic = ɵWorkbenchCommands.dialogFocusedTopic(this.dialog.id);\n        void this._messageClient.publish(commandTopic, focused, {retain: true});\n      });\n    });\n  }\n\n  private setDialogProperties(): void {\n    effect(() => {\n      const properties = this.capability().properties;\n      const params = this.params();\n      const appSymbolicName = this.capability().metadata!.appSymbolicName;\n\n      untracked(() => {\n        this.dialog.size.width = properties.size!.width;\n        this.dialog.size.height = properties.size!.height;\n        this.dialog.size.minWidth = properties.size!.minWidth;\n        this.dialog.size.maxWidth = properties.size!.maxWidth;\n        this.dialog.size.minHeight = properties.size!.minHeight;\n        this.dialog.size.maxHeight = properties.size!.maxHeight;\n        this.dialog.title = createRemoteTranslatable(properties.title, {appSymbolicName, valueParams: params, topicParams: properties.resolve});\n        this.dialog.closable = properties.closable ?? true;\n        this.dialog.resizable = properties.resizable ?? true;\n        this.dialog.padding = properties.padding ?? false;\n      });\n    });\n  }\n\n  protected onFocusWithin(event: Event): void {\n    const {detail: focusWithin} = event as CustomEvent<boolean>;\n    this.focusWithin.set(focusWithin);\n\n    if (focusWithin) {\n      this._host.dispatchEvent(new CustomEvent('sci-microfrontend-focusin', {bubbles: true}));\n    }\n  }\n\n  private propagateWorkbenchTheme(): void {\n    Microfrontends.propagateTheme(this._routerOutletElement);\n  }\n\n  private installDialogCloseListener(): void {\n    inject(MessageClient).observe$<unknown>(ɵWorkbenchCommands.dialogCloseTopic(this.dialog.id))\n      .pipe(takeUntilDestroyed())\n      .subscribe(closeRequest => {\n        this.dialog.close(closeRequest.headers.get(ɵWorkbenchDialogMessageHeaders.CLOSE_WITH_ERROR) ? new Error(closeRequest.body as string) : closeRequest.body);\n      });\n  }\n\n  private installDialogTitleListener(): void {\n    inject(MessageClient).observe$<Translatable>(ɵWorkbenchCommands.dialogTitleTopic(this.dialog.id))\n      .pipe(takeUntilDestroyed())\n      .subscribe(message => {\n        const sender = message.headers.get(MessageHeaders.AppSymbolicName) as string;\n        this.dialog.title = createRemoteTranslatable(message.body, {appSymbolicName: sender});\n      });\n  }\n}\n","<sci-router-outlet #router_outlet\n                   [name]=\"dialog.id\"\n                   [attr.data-capabilityid]=\"capability().metadata!.id\"\n                   [attr.data-app]=\"capability().metadata!.appSymbolicName\"\n                   [attr.data-focus]=\"focusWithin() ? '' : null\"\n                   keystrokes=\"keydown.escape\"\n                   [class]=\"dialog.cssClass()\"\n                   (focuswithin)=\"onFocusWithin($event)\">\n  <ng-container *ngComponentOutlet=\"splash\"/>\n</sci-router-outlet>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {signal, Signal} from '@angular/core';\nimport {WorkbenchDialogCapability} from '@scion/workbench-client';\nimport {createRemoteTranslatable} from '../microfrontend-text/remote-text-provider';\nimport {WorkbenchDialog} from '../../dialog/workbench-dialog.model';\n\n/** @inheritDoc */\nexport class MicrofrontendHostDialog implements ActivatedMicrofrontend {\n\n  public readonly capability: Signal<WorkbenchDialogCapability>;\n  public readonly params: Signal<Map<string, unknown>>;\n  public readonly referrer: Signal<string>;\n\n  constructor(private _dialog: WorkbenchDialog, capability: WorkbenchDialogCapability, params: Map<string, unknown>, referrer: string) {\n    this.capability = signal(capability).asReadonly();\n    this.params = signal(params).asReadonly();\n    this.referrer = signal(referrer).asReadonly();\n    this.setDialogProperties();\n  }\n\n  private setDialogProperties(): void {\n    const properties = this.capability().properties;\n    const params = this.params();\n    const appSymbolicName = this.capability().metadata!.appSymbolicName;\n\n    this._dialog.size.width = properties.size?.width;\n    this._dialog.size.height = properties.size?.height;\n    this._dialog.size.minWidth = properties.size?.minWidth;\n    this._dialog.size.maxWidth = properties.size?.maxWidth;\n    this._dialog.size.minHeight = properties.size?.minHeight;\n    this._dialog.size.maxHeight = properties.size?.maxHeight;\n\n    this._dialog.title = createRemoteTranslatable(properties.title, {appSymbolicName, valueParams: params, topicParams: properties.resolve});\n    this._dialog.closable = properties.closable ?? true;\n    this._dialog.resizable = properties.resizable ?? true;\n    this._dialog.padding = properties.padding ?? true;\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, runInInjectionContext, StaticProvider} from '@angular/core';\nimport {Handler, IntentInterceptor, IntentMessage, MessageClient, MessageHeaders, ResponseStatusCodes} from '@scion/microfrontend-platform';\nimport {WorkbenchCapabilities, WorkbenchDialogCapability, ɵWorkbenchDialogCommand} from '@scion/workbench-client';\nimport {Logger, LoggerNames} from '../../logging';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {stringifyError} from '../../common/stringify-error.util';\nimport {Arrays} from '@scion/toolkit/util';\nimport {WorkbenchDialogService} from '../../dialog/workbench-dialog.service';\nimport {MicrofrontendDialogComponent} from './microfrontend-dialog.component';\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {ɵWorkbenchDialog} from '../../dialog/ɵworkbench-dialog.model';\nimport {MicrofrontendHostDialog} from '../microfrontend-host-dialog/microfrontend-host-dialog.model';\nimport {MicrofrontendHostComponent} from '../microfrontend-host/microfrontend-host.component';\nimport {prune} from '../../common/prune.util';\nimport {Microfrontends} from '../common/microfrontend.util';\n\n/**\n * Handles dialog intents, opening a dialog based on resolved capability.\n *\n * Microfrontends of the host are displayed in {@link ActivatedMicrofrontendComponent}, microfrontends of other applications in {@link MicrofrontendDialogComponent}.\n *\n * Dialog intents are handled in this interceptor and are not transported to the providing application to support applications not connected to the SCION Workbench.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendDialogIntentHandler implements IntentInterceptor {\n\n  private readonly _dialogService = inject(WorkbenchDialogService);\n  private readonly _logger = inject(Logger);\n\n  /**\n   * Dialog intents are handled in this interceptor and then swallowed.\n   */\n  public intercept(intentMessage: IntentMessage, next: Handler<IntentMessage>): Promise<void> {\n    if (intentMessage.intent.type === WorkbenchCapabilities.Dialog) {\n      const dialogIntentMessage = intentMessage as IntentMessage<ɵWorkbenchDialogCommand>;\n      // Do not block the call until the dialog is closed.\n      // Otherwise, the caller may receive a timeout error if not closing the dialog before delivery confirmation expires.\n      this.consumeDialogIntent(dialogIntentMessage).catch((error: unknown) => this._logger.error('[DialogOpenError] Failed to open dialog.', LoggerNames.MICROFRONTEND, intentMessage, error));\n      // Swallow the intent and do not pass it to other interceptors or handlers down the chain.\n      return Promise.resolve();\n    }\n    else {\n      return next.handle(intentMessage);\n    }\n  }\n\n  private async consumeDialogIntent(message: IntentMessage<ɵWorkbenchDialogCommand>): Promise<void> {\n    const replyTo = message.headers.get(MessageHeaders.ReplyTo) as string;\n\n    try {\n      const result = await this.openDialog(message);\n      // Use 'Beans.opt' to not error if the platform is destroyed, e.g., in tests if not closing dialogs.\n      await Beans.opt(MessageClient)?.publish(replyTo, result, {headers: new Map().set(MessageHeaders.Status, ResponseStatusCodes.TERMINAL)});\n    }\n    catch (error) {\n      // Use 'Beans.opt' to not error if the platform is destroyed, e.g., in tests if not closing dialogs.\n      await Beans.opt(MessageClient)?.publish(replyTo, stringifyError(error), {headers: new Map().set(MessageHeaders.Status, ResponseStatusCodes.ERROR)});\n    }\n  }\n\n  /**\n   * Opens the microfrontend declared by the resolved capability in a dialog.\n   */\n  private async openDialog(message: IntentMessage<ɵWorkbenchDialogCommand>): Promise<unknown> {\n    const command = message.body ?? {};\n    const capability = message.capability as WorkbenchDialogCapability;\n    const params = message.intent.params ?? new Map<string, unknown>();\n    const isHostProvider = Microfrontends.isHostProvider(capability);\n    const referrer = message.headers.get(MessageHeaders.AppSymbolicName) as string;\n    this._logger.debug(() => 'Handling microfrontend dialog intent', LoggerNames.MICROFRONTEND, command);\n\n    return this._dialogService.open(isHostProvider ? MicrofrontendHostComponent : MicrofrontendDialogComponent, prune({\n      inputs: isHostProvider ? {} : {capability, params},\n      providers: isHostProvider ? [provideActivatedMicrofrontend(capability, params, referrer)] : undefined,\n      modality: command.modality,\n      context: command.context,\n      animate: command.animate,\n      cssClass: Arrays.coerce(capability.properties.cssClass).concat(Arrays.coerce(command.cssClass)),\n    }));\n  }\n}\n\n/**\n * Provides {@link ActivatedMicrofrontend} for injection in the host microfrontend.\n */\nfunction provideActivatedMicrofrontend(capability: WorkbenchDialogCapability, params: Map<string, unknown>, referrer: string): StaticProvider {\n  return {\n    provide: ActivatedMicrofrontend,\n    useFactory: () => {\n      const dialog = inject(ɵWorkbenchDialog);\n      // Create in dialog's injection context to bind 'MicrofrontendDialog' to the dialog's lifecycle.\n      return runInInjectionContext(dialog.injector, () => new MicrofrontendHostDialog(dialog, capability, params, referrer));\n    },\n  };\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform';\nimport {Injectable} from '@angular/core';\nimport {WorkbenchCapabilities, WorkbenchDialogCapability, WorkbenchDialogSize} from '@scion/workbench-client';\nimport {Objects} from '@scion/toolkit/util';\nimport {Microfrontends} from '../common/microfrontend.util';\n\n/**\n * Asserts dialog capabilities to have required properties.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendDialogCapabilityValidator implements CapabilityInterceptor {\n\n  public async intercept(capability: Capability): Promise<Capability> {\n    if (capability.type !== WorkbenchCapabilities.Dialog) {\n      return capability;\n    }\n\n    const dialogCapability = capability as Partial<WorkbenchDialogCapability>;\n    // Assert the dialog capability to have a qualifier.\n    if (!Object.keys(dialogCapability.qualifier ?? {}).length) {\n      throw Error(`[DialogDefinitionError] Dialog capability requires a qualifier [app=${app(dialogCapability)}, dialog=${qualifier(dialogCapability)}]`);\n    }\n\n    // Assert the dialog capability to have properties.\n    if (!dialogCapability.properties) {\n      throw Error(`[DialogDefinitionError] Dialog capability requires properties [app=${app(dialogCapability)}, dialog=${qualifier(dialogCapability)}]`);\n    }\n\n    // Assert the dialog capability to have a path, unless provided by the host application.\n    this.assertPath(dialogCapability);\n\n    // Assert the dialog capability to have a height and width, unless provided by the host application.\n    this.assertSize(dialogCapability);\n\n    // Assert host dialog capabilities not to define the \"showSplash\" property.\n    if (Microfrontends.isHostProvider(capability) && dialogCapability.properties.showSplash !== undefined) {\n      throw Error(`[DialogDefinitionError] Property \"showSplash\" not supported for dialog capabilities of the host application [app=${app(dialogCapability)}, dialog=${qualifier(dialogCapability)}]`);\n    }\n\n    return capability;\n  }\n\n  private assertPath(capability: Partial<WorkbenchDialogCapability>): void {\n    const path = capability.properties?.path as string | undefined | null;\n\n    if (Microfrontends.isHostProvider(capability)) {\n      if (path !== '') {\n        throw Error(`[DialogDefinitionError] Dialog capabilities of the host application require an empty path. [app=${app(capability)}, dialog=${qualifier(capability)}]. Change the path '${path}' to empty and add 'canMatchWorkbenchDialogCapability(${JSON.stringify(capability.qualifier)})' guard to the route.\\n\\nExample:\\nCapability: { type: 'dialog', qualifier: ${JSON.stringify(capability.qualifier)}, properties: {path: ''} }\\nRoute: { path: '', canMatch: [canMatchWorkbenchDialogCapability(${JSON.stringify(capability.qualifier)})], component: DialogComponent }`);\n      }\n    }\n    else {\n      if (path === null || path == undefined) {\n        throw Error(`[DialogDefinitionError] Dialog capabilities require a path. [app=${app(capability)}, dialog=${qualifier(capability)}]`);\n      }\n    }\n  }\n\n  private assertSize(capability: Partial<WorkbenchDialogCapability>): void {\n    if (Microfrontends.isHostProvider(capability)) {\n      return;\n    }\n\n    const size = capability.properties?.size as Partial<WorkbenchDialogSize> | undefined;\n    if (!size?.width || !size.height) {\n      throw Error(`[DialogDefinitionError] Dialog capability requires the 'size' property with a width and a height [app=${app(capability)}, dialog=${qualifier(capability)}]`);\n    }\n  }\n}\n\n/**\n * Returns the qualifier as string.\n */\nfunction qualifier(capability: Partial<Capability>): string {\n  return Objects.toMatrixNotation(capability.qualifier);\n}\n\n/**\n * Returns the app symbolic name.\n */\nfunction app(capability: Partial<Capability>): string {\n  return capability.metadata!.appSymbolicName;\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, inject, makeEnvironmentProviders, Provider} from '@angular/core';\nimport {MicrofrontendDialogIntentHandler} from './microfrontend-dialog-intent-handler.interceptor';\nimport {MicrofrontendDialogCapabilityValidator} from './microfrontend-dialog-capability-validator.interceptor';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {CapabilityInterceptor, IntentInterceptor} from '@scion/microfrontend-platform';\nimport {MicrofrontendPlatformStartupPhase, provideMicrofrontendPlatformInitializer} from '../microfrontend-platform-initializer';\nimport {WorkbenchDialogService, WorkbenchMessageBoxService, WorkbenchPopupService, ɵWorkbenchDialogService, ɵWorkbenchMessageBoxService, ɵWorkbenchPopupService} from '@scion/workbench-client';\nimport {WORKBENCH_DIALOG_CONTEXT} from '../../dialog/workbench-dialog-context.provider';\nimport {WorkbenchDialog} from '../../dialog/workbench-dialog.model';\n\n/**\n * Provides a set of DI providers enabling microfrontend dialog support.\n *\n * @see WorkbenchDialogCapability\n */\nexport function provideMicrofrontendDialog(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    MicrofrontendDialogCapabilityValidator,\n    MicrofrontendDialogIntentHandler,\n    provideWorkbenchDialogContext(),\n    provideMicrofrontendPlatformInitializer(onPreStartup, {phase: MicrofrontendPlatformStartupPhase.PreStartup}),\n  ]);\n\n  function onPreStartup(): void {\n    // Register dialog capability validator.\n    Beans.register(CapabilityInterceptor, {useValue: inject(MicrofrontendDialogCapabilityValidator), multi: true});\n    // Register dialog intent handler.\n    Beans.register(IntentInterceptor, {useValue: inject(MicrofrontendDialogIntentHandler), multi: true});\n  }\n\n  /**\n   * Provides beans of @scion/workbench-client available for DI if in the context of a workbench dialog.\n   */\n  function provideWorkbenchDialogContext(): Provider {\n    return {\n      provide: WORKBENCH_DIALOG_CONTEXT,\n      useFactory: (): Provider[] => [\n        {provide: WorkbenchDialogService, useFactory: () => new ɵWorkbenchDialogService(inject(WorkbenchDialog).id)},\n        {provide: WorkbenchMessageBoxService, useFactory: () => new ɵWorkbenchMessageBoxService(inject(WorkbenchDialog).id)},\n        {provide: WorkbenchPopupService, useFactory: () => new ɵWorkbenchPopupService(inject(WorkbenchDialog).id)},\n      ],\n      multi: true,\n    };\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, effect, ElementRef, inject, Injector, input, signal, untracked, viewChild} from '@angular/core';\nimport {ManifestService, MessageClient, MicrofrontendPlatformConfig, OutletRouter, SciRouterOutletElement} from '@scion/microfrontend-platform';\nimport {Logger, LoggerNames} from '../../logging';\nimport {WorkbenchMessageBoxCapability, ɵMESSAGE_BOX_CONTEXT, ɵMessageBoxContext, ɵWorkbenchCommands} from '@scion/workbench-client';\nimport {NgComponentOutlet} from '@angular/common';\nimport {WorkbenchLayoutService} from '../../layout/workbench-layout.service';\nimport {MicrofrontendSplashComponent} from '../microfrontend-splash/microfrontend-splash.component';\nimport {Microfrontends} from '../common/microfrontend.util';\nimport {ɵWorkbenchDialog} from '../../dialog/ɵworkbench-dialog.model';\n\n/**\n * Displays the microfrontend of a given {@link WorkbenchMessageBoxCapability}.\n *\n * This component is designed to be displayed in a workbench message box.\n */\n@Component({\n  selector: 'wb-microfrontend-message-box',\n  styleUrls: ['./microfrontend-message-box.component.scss'],\n  templateUrl: './microfrontend-message-box.component.html',\n  imports: [\n    NgComponentOutlet,\n  ],\n  schemas: [CUSTOM_ELEMENTS_SCHEMA], // required because <sci-router-outlet> is a custom element\n  host: {\n    '[class.workbench-drag]': 'workbenchLayoutService.dragging()',\n  },\n})\nexport class MicrofrontendMessageBoxComponent {\n\n  public readonly capability = input.required<WorkbenchMessageBoxCapability>();\n  public readonly params = input.required<Map<string, unknown>>();\n  public readonly referrer = input.required<string>();\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _outletRouter = inject(OutletRouter);\n  private readonly _messageClient = inject(MessageClient);\n  private readonly _logger = inject(Logger);\n  private readonly _routerOutletElement = viewChild.required<ElementRef<SciRouterOutletElement>>('router_outlet');\n\n  /** Splash to display until the microfrontend signals readiness. */\n  protected readonly splash = inject(MicrofrontendPlatformConfig).splash ?? MicrofrontendSplashComponent;\n  protected readonly workbenchLayoutService = inject(WorkbenchLayoutService);\n  protected readonly dialog = inject(ɵWorkbenchDialog);\n  protected readonly focusWithin = signal(false);\n\n  constructor() {\n    this._logger.debug(() => 'Constructing MicrofrontendMessageBoxComponent.', LoggerNames.MICROFRONTEND);\n    this.setMessageBoxProperties();\n    this.propagateMessageBoxContext();\n    this.propagateWorkbenchTheme();\n    this.installDialogFocusedPublisher();\n    this.installNavigator();\n\n    inject(DestroyRef).onDestroy(() => {\n      // Clear the outlet.\n      void this._outletRouter.navigate(null, {outlet: this.dialog.id});\n      // Delete retained messages to free resources.\n      void this._messageClient.publish(ɵWorkbenchCommands.dialogFocusedTopic(this.dialog.id), undefined, {retain: true});\n    });\n  }\n\n  private installNavigator(): void {\n    const manifestService = inject(ManifestService);\n    const injector = inject(Injector);\n\n    effect(() => {\n      const capability = this.capability();\n      const params = this.params();\n\n      void untracked(async () => {\n        const application = manifestService.getApplication(capability.metadata!.appSymbolicName);\n        this._logger.debug(() => `Loading microfrontend into workbench message box [app=${capability.metadata!.appSymbolicName}, baseUrl=${application.baseUrl}, path=${capability.properties.path}].`, LoggerNames.MICROFRONTEND, params, capability);\n\n        // Wait for the context to be set on the router outlet, as @scion/workbench-client expects it to be available on startup.\n        await Microfrontends.waitForContext(this._routerOutletElement, ɵMESSAGE_BOX_CONTEXT, {injector});\n\n        void this._outletRouter.navigate(capability.properties.path, {\n          outlet: this.dialog.id,\n          relativeTo: application.baseUrl,\n          params: params,\n          pushStateToSessionHistoryStack: false,\n          showSplash: capability.properties.showSplash,\n        });\n      });\n    });\n  }\n\n  protected onFocusWithin(event: Event): void {\n    const {detail: focusWithin} = event as CustomEvent<boolean>;\n    this.focusWithin.set(focusWithin);\n\n    if (focusWithin) {\n      this._host.dispatchEvent(new CustomEvent('sci-microfrontend-focusin', {bubbles: true}));\n    }\n  }\n\n  /**\n   * Provides the message box context to embedded content.\n   */\n  private propagateMessageBoxContext(): void {\n    effect(() => {\n      const context: ɵMessageBoxContext = {\n        dialogId: this.dialog.id,\n        capability: this.capability(),\n        params: this.params(),\n        referrer: {\n          appSymbolicName: this.referrer(),\n        },\n      };\n      const routerOutletElement = this._routerOutletElement().nativeElement;\n\n      untracked(() => routerOutletElement.setContextValue(ɵMESSAGE_BOX_CONTEXT, context));\n    });\n  }\n\n  private installDialogFocusedPublisher(): void {\n    effect(() => {\n      const focused = this.dialog.focused();\n      untracked(() => {\n        const commandTopic = ɵWorkbenchCommands.dialogFocusedTopic(this.dialog.id);\n        void this._messageClient.publish(commandTopic, focused, {retain: true});\n      });\n    });\n  }\n\n  private setMessageBoxProperties(): void {\n    effect(() => {\n      const properties = this.capability().properties;\n\n      untracked(() => {\n        this.dialog.size.width = properties.size?.width;\n        this.dialog.size.height = properties.size?.height;\n        this.dialog.size.minWidth = properties.size?.minWidth;\n        this.dialog.size.maxWidth = properties.size?.maxWidth;\n        this.dialog.size.minHeight = properties.size?.minHeight;\n        this.dialog.size.maxHeight = properties.size?.maxHeight;\n      });\n    });\n  }\n\n  private propagateWorkbenchTheme(): void {\n    Microfrontends.propagateTheme(this._routerOutletElement);\n  }\n}\n","<sci-router-outlet #router_outlet\n                   [name]=\"dialog.id\"\n                   [attr.data-capabilityid]=\"capability().metadata!.id\"\n                   [attr.data-app]=\"capability().metadata!.appSymbolicName\"\n                   [attr.data-focus]=\"focusWithin() ? '' : null\"\n                   keystrokes=\"keydown.escape\"\n                   [class]=\"dialog.cssClass()\"\n                   (focuswithin)=\"onFocusWithin($event)\">\n  <ng-container *ngComponentOutlet=\"splash\"/>\n</sci-router-outlet>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {signal, Signal} from '@angular/core';\nimport {WorkbenchMessageBoxCapability} from '@scion/workbench-client';\nimport {WorkbenchDialog} from '../../dialog/workbench-dialog.model';\n\n/** @inheritDoc */\nexport class MicrofrontendHostMessageBox implements ActivatedMicrofrontend {\n\n  public readonly capability: Signal<WorkbenchMessageBoxCapability>;\n  public readonly params: Signal<Map<string, unknown>>;\n  public readonly referrer: Signal<string>;\n\n  constructor(private _dialog: WorkbenchDialog, capability: WorkbenchMessageBoxCapability, params: Map<string, unknown>, referrer: string) {\n    this.capability = signal(capability).asReadonly();\n    this.params = signal(params).asReadonly();\n    this.referrer = signal(referrer).asReadonly();\n    this.setMessageBoxProperties();\n  }\n\n  private setMessageBoxProperties(): void {\n    const properties = this.capability().properties;\n\n    this._dialog.size.width = properties.size?.width;\n    this._dialog.size.height = properties.size?.height;\n    this._dialog.size.minWidth = properties.size?.minWidth;\n    this._dialog.size.maxWidth = properties.size?.maxWidth;\n    this._dialog.size.minHeight = properties.size?.minHeight;\n    this._dialog.size.maxHeight = properties.size?.maxHeight;\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, runInInjectionContext, StaticProvider} from '@angular/core';\nimport {Handler, IntentInterceptor, IntentMessage, MessageClient, MessageHeaders, ResponseStatusCodes} from '@scion/microfrontend-platform';\nimport {WorkbenchCapabilities, WorkbenchMessageBoxCapability, ɵWorkbenchMessageBoxCommand} from '@scion/workbench-client';\nimport {Logger, LoggerNames} from '../../logging';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {stringifyError} from '../../common/stringify-error.util';\nimport {WorkbenchMessageBoxService} from '../../message-box/workbench-message-box.service';\nimport {Arrays} from '@scion/toolkit/util';\nimport {MicrofrontendMessageBoxComponent} from './microfrontend-message-box.component';\nimport {createRemoteTranslatable} from '../microfrontend-text/remote-text-provider';\nimport {MicrofrontendHostComponent} from '../microfrontend-host/microfrontend-host.component';\nimport {ɵWorkbenchDialog} from '../../dialog/ɵworkbench-dialog.model';\nimport {MicrofrontendHostMessageBox} from '../microfrontend-host-message-box/microfrontend-host-message-box.model';\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {prune} from '../../common/prune.util';\nimport {Microfrontends} from '../common/microfrontend.util';\n\n/**\n * Handles messagebox intents, opening a message box based on resolved capability.\n *\n * Microfrontends of the host are displayed in {@link ActivatedMicrofrontendComponent}, microfrontends of other applications in {@link MicrofrontendMessageBoxComponent}.\n *\n * Messagebox intents are handled in this interceptor and are not transported to the providing application to support applications not connected to the SCION Workbench.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendMessageBoxIntentHandler implements IntentInterceptor {\n\n  private readonly _messageBoxService = inject(WorkbenchMessageBoxService);\n  private readonly _logger = inject(Logger);\n\n  /**\n   * Message box intents are handled in this interceptor and then swallowed.\n   */\n  public intercept(intentMessage: IntentMessage, next: Handler<IntentMessage>): Promise<void> {\n    if (intentMessage.intent.type === WorkbenchCapabilities.MessageBox) {\n      const messageBoxIntentMessage = intentMessage as IntentMessage<ɵWorkbenchMessageBoxCommand>;\n      // Do not block the call until the message box is closed.\n      // Otherwise, the caller may receive a timeout error if not closing the message box before delivery confirmation expires.\n      this.consumeMessageBoxIntent(messageBoxIntentMessage).catch((error: unknown) => this._logger.error('[MessageBoxOpenError] Failed to open message box.', LoggerNames.MICROFRONTEND, intentMessage, error));\n      // Swallow the intent and do not pass it to other interceptors or handlers down the chain.\n      return Promise.resolve();\n    }\n    else {\n      return next.handle(intentMessage);\n    }\n  }\n\n  private async consumeMessageBoxIntent(message: IntentMessage<ɵWorkbenchMessageBoxCommand>): Promise<void> {\n    const replyTo = message.headers.get(MessageHeaders.ReplyTo) as string;\n\n    try {\n      const result = await this.openMessageBox(message);\n      // Use 'Beans.opt' to not error if the platform is destroyed, e.g., in tests if not closing message boxes.\n      await Beans.opt(MessageClient)?.publish(replyTo, result, {headers: new Map().set(MessageHeaders.Status, ResponseStatusCodes.TERMINAL)});\n    }\n    catch (error) {\n      // Use 'Beans.opt' to not error if the platform is destroyed, e.g., in tests if not closing message boxes.\n      await Beans.opt(MessageClient)?.publish(replyTo, stringifyError(error), {headers: new Map().set(MessageHeaders.Status, ResponseStatusCodes.ERROR)});\n    }\n  }\n\n  /**\n   * Opens the microfrontend declared by the resolved capability in a message box.\n   */\n  private async openMessageBox(message: IntentMessage<ɵWorkbenchMessageBoxCommand>): Promise<unknown> {\n    const command = message.body ?? {};\n    const capability = message.capability as WorkbenchMessageBoxCapability;\n    const params = message.intent.params ?? new Map<string, unknown>();\n    const referrer = message.headers.get(MessageHeaders.AppSymbolicName) as string;\n    const isHostProvider = Microfrontends.isHostProvider(capability);\n\n    this._logger.debug(() => 'Handling microfrontend messagebox intent', LoggerNames.MICROFRONTEND, command);\n    return this._messageBoxService.open(isHostProvider ? MicrofrontendHostComponent : MicrofrontendMessageBoxComponent, prune({\n      inputs: isHostProvider ? {} : {capability, params, referrer},\n      providers: isHostProvider ? [provideActivatedMicrofrontend(capability, params, referrer)] : undefined,\n      title: createRemoteTranslatable(command.title, {appSymbolicName: referrer}),\n      actions: command.actions && Object.fromEntries(Object.entries(command.actions).map(([key, label]) => [key, createRemoteTranslatable(label, {appSymbolicName: referrer})])),\n      severity: command.severity,\n      modality: command.modality,\n      contentSelectable: command.contentSelectable,\n      cssClass: Arrays.coerce(capability.properties.cssClass).concat(Arrays.coerce(command.cssClass)),\n      context: command.context,\n    }));\n  }\n}\n\n/**\n * Provides {@link ActivatedMicrofrontend} for injection in the host microfrontend.\n */\nfunction provideActivatedMicrofrontend(capability: WorkbenchMessageBoxCapability, params: Map<string, unknown>, referrer: string): StaticProvider {\n  return {\n    provide: ActivatedMicrofrontend,\n    useFactory: () => {\n      const dialog = inject(ɵWorkbenchDialog);\n      // Create in dialog's injection context to bind 'MicrofrontendMessageBox' to the dialog's lifecycle.\n      return runInInjectionContext(dialog.injector, () => new MicrofrontendHostMessageBox(dialog, capability, params, referrer));\n    },\n  };\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, inject} from '@angular/core';\nimport {eMESSAGE_BOX_MESSAGE_PARAM} from '@scion/workbench-client';\nimport {UUID} from '@scion/toolkit/uuid';\nimport {Translatable} from '../../../text/workbench-text-provider.model';\nimport {TextPipe} from '../../../text/text.pipe';\nimport {createRemoteTranslatable} from '../../microfrontend-text/remote-text-provider';\nimport {ActivatedMicrofrontend} from '../../microfrontend-host/microfrontend-host.model';\nimport {WorkbenchDialog} from '../../../dialog/workbench-dialog.model';\n\n/**\n * Displays the text message for the built-in message box capability.\n *\n * This component is designed to be displayed in {@link MicrofrontendHostMessageBoxComponent}.\n */\n@Component({\n  selector: 'wb-text-message',\n  styleUrls: ['./text-message.component.scss'],\n  templateUrl: './text-message.component.html',\n  imports: [\n    TextPipe,\n  ],\n  host: {\n    '[class.empty]': '!message?.length',\n  },\n})\nexport default class TextMessageComponent {\n\n  protected message: Translatable | undefined;\n\n  constructor() {\n    const {params, referrer} = inject(ActivatedMicrofrontend);\n    const translatable = params().get(eMESSAGE_BOX_MESSAGE_PARAM) as Translatable | undefined;\n    this.message = createRemoteTranslatable(translatable, {appSymbolicName: referrer()});\n\n    // Limit the maximum messagebox width to break the message.\n    inject(WorkbenchDialog).size.maxWidth = 'var(--sci-workbench-messagebox-max-width)';\n  }\n}\n\n/**\n * Property to identify the built-in text message box capability.\n */\nexport const TEXT_MESSAGE_BOX_CAPABILITY_IDENTITY_PROPERTY = 'ɵidentity';\n/**\n * Value to identify the built-in text message box capability.\n */\nexport const TEXT_MESSAGE_BOX_CAPABILITY_IDENTITY = UUID.randomUUID();\n","{{(message | wbText)()}}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform';\nimport {Injectable} from '@angular/core';\nimport {WorkbenchCapabilities, WorkbenchMessageBoxCapability} from '@scion/workbench-client';\nimport {TEXT_MESSAGE_BOX_CAPABILITY_IDENTITY, TEXT_MESSAGE_BOX_CAPABILITY_IDENTITY_PROPERTY} from '../microfrontend-host-message-box/text-message/text-message.component';\nimport {Objects} from '@scion/toolkit/util';\nimport {Microfrontends} from '../common/microfrontend.util';\n\n/**\n * Asserts message box capabilities to have required properties.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendMessageBoxCapabilityValidator implements CapabilityInterceptor {\n\n  public async intercept(capability: Capability): Promise<Capability> {\n    if (capability.type !== WorkbenchCapabilities.MessageBox) {\n      return capability;\n    }\n\n    const messageBoxCapability = capability as Partial<WorkbenchMessageBoxCapability>;\n\n    // Assert capability other than the built-in text messsage box capability to have a qualifier.\n    if (!isBuiltInTextMessageBoxCapability(messageBoxCapability) && !Object.keys(messageBoxCapability.qualifier ?? {}).length) {\n      throw Error(`[MessageBoxDefinitionError] MessageBox capability requires a qualifier [app=${app(messageBoxCapability)}, messagebox=${qualifier(messageBoxCapability)}]`);\n    }\n\n    // Assert capability to have properties.\n    if (!messageBoxCapability.properties) {\n      throw Error(`[MessageBoxDefinitionError] MessageBox capability requires properties [app=${app(messageBoxCapability)}, messagebox=${qualifier(messageBoxCapability)}]`);\n    }\n\n    // Assert the messagebox capability to have a path, unless provided by the host application.\n    this.assertPath(messageBoxCapability);\n\n    // Assert host dialog capabilities not to define the \"showSplash\" property.\n    if (Microfrontends.isHostProvider(capability) && messageBoxCapability.properties.showSplash !== undefined) {\n      throw Error(`[MessageBoxDefinitionError] Property \"showSplash\" not supported for messagebox capabilities of the host application [app=${app(messageBoxCapability)}, messagebox=${qualifier(messageBoxCapability)}]`);\n    }\n\n    return capability;\n  }\n\n  private assertPath(capability: Partial<WorkbenchMessageBoxCapability>): void {\n    const path = capability.properties?.path as string | undefined | null;\n\n    if (Microfrontends.isHostProvider(capability)) {\n      if (path !== '') {\n        throw Error(`[MessageBoxDefinitionError] Messagebox capabilities of the host application require an empty path. [app=${app(capability)}, messagebox=${qualifier(capability)}]. Change the path '${path}' to empty and add 'canMatchWorkbenchMessageBoxCapability(${JSON.stringify(capability.qualifier)})' guard to the route.\\n\\nExample:\\nCapability: { type: 'messagebox', qualifier: ${JSON.stringify(capability.qualifier)}, properties: {path: ''} }\\nRoute: { path: '', canMatch: [canMatchWorkbenchMessageBoxCapability(${JSON.stringify(capability.qualifier)})], component: MessageComponent }`);\n      }\n    }\n    else {\n      if (path === null || path == undefined) {\n        throw Error(`[MessageBoxDefinitionError] MessageBox capabilities require a path. [app=${app(capability)}, messagebox=${qualifier(capability)}]`);\n      }\n    }\n  }\n}\n\nfunction isBuiltInTextMessageBoxCapability(capability: Partial<WorkbenchMessageBoxCapability>): boolean {\n  return capability.properties?.[TEXT_MESSAGE_BOX_CAPABILITY_IDENTITY_PROPERTY] === TEXT_MESSAGE_BOX_CAPABILITY_IDENTITY;\n}\n\n/**\n * Returns the qualifier as string.\n */\nfunction qualifier(capability: Partial<Capability>): string {\n  return Objects.toMatrixNotation(capability.qualifier);\n}\n\n/**\n * Returns the app symbolic name.\n */\nfunction app(capability: Partial<Capability>): string {\n  return capability.metadata!.appSymbolicName;\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Route} from '@angular/router';\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\nimport {WORKBENCH_ROUTE} from '../../workbench.constants';\nimport {canMatchWorkbenchMessageBoxCapability} from '../microfrontend-host/microfrontend-host-routes';\n\n/**\n * Provides the route for the built-in {@link WorkbenchMessageBoxCapability}.\n */\nexport function provideMicrofrontendTextMessageBoxRoute(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    {\n      provide: WORKBENCH_ROUTE,\n      useFactory: (): Route => ({\n        path: '',\n        loadComponent: () => import('../microfrontend-host-message-box/text-message/text-message.component'),\n        canMatch: [canMatchWorkbenchMessageBoxCapability({})],\n      }),\n      multi: true,\n    },\n  ]);\n}\n","import {Injectable} from '@angular/core';\nimport {HostManifestInterceptor, Manifest} from '@scion/microfrontend-platform';\nimport {eMESSAGE_BOX_MESSAGE_PARAM, WorkbenchCapabilities, WorkbenchMessageBoxCapability} from '@scion/workbench-client';\nimport {TEXT_MESSAGE_BOX_CAPABILITY_IDENTITY, TEXT_MESSAGE_BOX_CAPABILITY_IDENTITY_PROPERTY} from '../microfrontend-host-message-box/text-message/text-message.component';\n\n/**\n * Adds the built-in {@link WorkbenchMessageBoxCapability} to the host manifest.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendTextMessageBoxCapabilityProvider implements HostManifestInterceptor {\n\n  public intercept(hostManifest: Manifest): void {\n    hostManifest.capabilities = [\n      ...hostManifest.capabilities ?? [],\n      {\n        type: WorkbenchCapabilities.MessageBox,\n        qualifier: {},\n        params: [\n          {\n            name: eMESSAGE_BOX_MESSAGE_PARAM,\n            required: false,\n            description: 'Text to display in the message box.',\n          },\n        ],\n        properties: {\n          path: '',\n          [TEXT_MESSAGE_BOX_CAPABILITY_IDENTITY_PROPERTY]: TEXT_MESSAGE_BOX_CAPABILITY_IDENTITY,\n        },\n        private: false,\n        description: 'Displays a text message.',\n      } satisfies WorkbenchMessageBoxCapability,\n    ];\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, inject, makeEnvironmentProviders} from '@angular/core';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {CapabilityInterceptor, HostManifestInterceptor, IntentInterceptor} from '@scion/microfrontend-platform';\nimport {MicrofrontendPlatformStartupPhase, provideMicrofrontendPlatformInitializer} from '../microfrontend-platform-initializer';\nimport {MicrofrontendMessageBoxIntentHandler} from './microfrontend-message-box-intent-handler.interceptor';\nimport {MicrofrontendMessageBoxCapabilityValidator} from './microfrontend-message-box-capability-validator.interceptor';\nimport {provideMicrofrontendTextMessageBoxRoute} from './microfrontend-message-box-routes';\nimport {MicrofrontendTextMessageBoxCapabilityProvider} from './microfrontend-text-message-box-capability-provider.interceptor';\n\n/**\n * Provides a set of DI providers enabling microfrontend message box support.\n *\n * @see WorkbenchMessageBoxCapability\n */\nexport function provideMicrofrontendMessageBox(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    MicrofrontendMessageBoxCapabilityValidator,\n    MicrofrontendMessageBoxIntentHandler,\n    MicrofrontendTextMessageBoxCapabilityProvider,\n    provideMicrofrontendTextMessageBoxRoute(),\n    provideMicrofrontendPlatformInitializer(onPreStartup, {phase: MicrofrontendPlatformStartupPhase.PreStartup}),\n  ]);\n\n  function onPreStartup(): void {\n    // Add built-in text message box capability to the host manifest.\n    Beans.register(HostManifestInterceptor, {useValue: inject(MicrofrontendTextMessageBoxCapabilityProvider), multi: true});\n    // Register message box capability validator.\n    Beans.register(CapabilityInterceptor, {useValue: inject(MicrofrontendMessageBoxCapabilityValidator), multi: true});\n    // Register messagebox intent handler.\n    Beans.register(IntentInterceptor, {useValue: inject(MicrofrontendMessageBoxIntentHandler), multi: true});\n  }\n}\n","import {Injectable} from '@angular/core';\nimport {HostManifestInterceptor, Manifest} from '@scion/microfrontend-platform';\nimport {WorkbenchCapabilities} from '@scion/workbench-client';\n\n/**\n * Adds a wildcard text-provider intention to the host manifest for the workbench to request texts from any application.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendTextIntentionProvider implements HostManifestInterceptor {\n\n  public intercept(hostManifest: Manifest): void {\n    hostManifest.intentions = [\n      ...hostManifest.intentions ?? [],\n      {\n        type: WorkbenchCapabilities.TextProvider,\n        qualifier: {provider: '*'},\n      },\n    ];\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {createEnvironmentInjector, EnvironmentInjector, EnvironmentProviders, inject, Injector, makeEnvironmentProviders} from '@angular/core';\nimport {map} from 'rxjs';\nimport {provideMicrofrontendPlatformInitializer} from '../microfrontend-platform-initializer';\nimport {WorkbenchClient} from '@scion/workbench-client';\nimport {toObservable} from '@angular/core/rxjs-interop';\nimport {text} from '../../text/text';\nimport {finalize} from 'rxjs/operators';\n\n/**\n * Registers a text provider for micro apps to request texts from the host app.\n */\nexport function provideHostTextProvider(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    provideMicrofrontendPlatformInitializer(() => {\n      const injector = inject(Injector);\n\n      WorkbenchClient.registerTextProvider((key, params) => {\n        const translatable = Object.entries(params).reduce((translatable, [name, value]) => `${translatable};${name}=${encodeSemicolons(value)}`, `%${key}`);\n        const environmentInjector = createEnvironmentInjector([], injector.get(EnvironmentInjector));\n\n        return toObservable(text(translatable, {injector: environmentInjector}), {injector: environmentInjector})\n          .pipe(\n            map(text => text !== '' && text !== key ? text : undefined), // emit `undefined` if not found the text\n            finalize(() => environmentInjector.destroy()), // free resources when the communication terminates\n          );\n      });\n    }),\n  ]);\n}\n\n/**\n * Encodes semicolons (`;`) as `\\\\;` to prevent interpretation as interpolation parameter separators.\n *\n * @see Translatable\n */\nfunction encodeSemicolons(value: string): string {\n  return value.replaceAll(';', '\\\\;');\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, inject, makeEnvironmentProviders} from '@angular/core';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {HostManifestInterceptor} from '@scion/microfrontend-platform';\nimport {MicrofrontendPlatformStartupPhase, provideMicrofrontendPlatformInitializer} from '../microfrontend-platform-initializer';\nimport {MicrofrontendTextIntentionProvider} from './microfrontend-text-intention-provider.interceptor';\nimport {provideRemoteTextProvider} from './remote-text-provider';\nimport {provideHostTextProvider} from './host-text-provider';\n\n/**\n * Provides a set of DI providers enabling microfrontend localization support.\n *\n * @see WorkbenchTextProviderCapability\n */\nexport function provideMicrofrontendText(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    MicrofrontendTextIntentionProvider,\n    provideRemoteTextProvider(),\n    provideHostTextProvider(),\n    provideMicrofrontendPlatformInitializer(onPreStartup, {phase: MicrofrontendPlatformStartupPhase.PreStartup}),\n  ]);\n\n  function onPreStartup(): void {\n    // Add intention to the host manifest for the workbench to request texts from any application.\n    Beans.register(HostManifestInterceptor, {useValue: inject(MicrofrontendTextIntentionProvider), multi: true});\n  }\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, effect, ElementRef, inject, Injector, input, signal, untracked, viewChild} from '@angular/core';\nimport {ManifestService, MessageClient, MicrofrontendPlatformConfig, OutletRouter, SciRouterOutletElement} from '@scion/microfrontend-platform';\nimport {Logger, LoggerNames} from '../../logging';\nimport {WorkbenchPopupCapability, WorkbenchPopupReferrer, ɵPOPUP_CONTEXT, ɵPopupContext, ɵWorkbenchCommands, ɵWorkbenchPopupMessageHeaders} from '@scion/workbench-client';\nimport {NgComponentOutlet} from '@angular/common';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {WorkbenchLayoutService} from '../../layout/workbench-layout.service';\nimport {MicrofrontendSplashComponent} from '../microfrontend-splash/microfrontend-splash.component';\nimport {Microfrontends} from '../common/microfrontend.util';\nimport {ɵWorkbenchPopup} from '../../popup/ɵworkbench-popup.model';\n\n/**\n * Displays the microfrontend of a given {@link WorkbenchPopupCapability}.\n *\n * This component is designed to be displayed in a workbench popup.\n */\n@Component({\n  selector: 'wb-microfrontend-popup',\n  styleUrls: ['./microfrontend-popup.component.scss'],\n  templateUrl: './microfrontend-popup.component.html',\n  imports: [NgComponentOutlet],\n  schemas: [CUSTOM_ELEMENTS_SCHEMA], // required because <sci-router-outlet> is a custom element\n  host: {\n    '[class.workbench-drag]': 'workbenchLayoutService.dragging()',\n  },\n})\nexport class MicrofrontendPopupComponent {\n\n  public readonly capability = input.required<WorkbenchPopupCapability>();\n  public readonly params = input.required<Map<string, unknown>>();\n  public readonly closeOnFocusLost = input.required<boolean>();\n  public readonly referrer = input.required<WorkbenchPopupReferrer>();\n\n  private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n  private readonly _outletRouter = inject(OutletRouter);\n  private readonly _messageClient = inject(MessageClient);\n  private readonly _logger = inject(Logger);\n  private readonly _routerOutletElement = viewChild.required<ElementRef<SciRouterOutletElement>>('router_outlet');\n\n  /** Splash to display until the microfrontend signals readiness. */\n  protected readonly splash = inject(MicrofrontendPlatformConfig).splash ?? MicrofrontendSplashComponent;\n  protected readonly popup = inject(ɵWorkbenchPopup);\n  protected readonly workbenchLayoutService = inject(WorkbenchLayoutService);\n  protected readonly focusWithin = signal(false);\n\n  constructor() {\n    this._logger.debug(() => 'Constructing MicrofrontendPopupComponent.', LoggerNames.MICROFRONTEND);\n\n    this.installPopupResultListener();\n    this.installPopupCloseListener();\n    this.propagatePopupContext();\n    this.propagateWorkbenchTheme();\n    this.installPopupFocusedPublisher();\n    this.setPopupSize();\n    this.installNavigator();\n\n    inject(DestroyRef).onDestroy(() => {\n      // Clear the outlet.\n      void this._outletRouter.navigate(null, {outlet: this.popup.id});\n      // Delete retained messages to free resources.\n      void this._messageClient.publish(ɵWorkbenchCommands.popupFocusedTopic(this.popup.id), undefined, {retain: true});\n    });\n  }\n\n  private installNavigator(): void {\n    const manifestService = inject(ManifestService);\n    const injector = inject(Injector);\n\n    effect(() => {\n      const capability = this.capability();\n      const params = this.params();\n\n      void untracked(async () => {\n        const application = manifestService.getApplication(capability.metadata!.appSymbolicName);\n        this._logger.debug(() => `Loading microfrontend into workbench popup [app=${capability.metadata!.appSymbolicName}, baseUrl=${application.baseUrl}, path=${capability.properties.path}].`, LoggerNames.MICROFRONTEND, params, capability);\n\n        // Wait for the context to be set on the router outlet, as @scion/workbench-client expects it to be available on startup.\n        await Microfrontends.waitForContext(this._routerOutletElement, ɵPOPUP_CONTEXT, {injector});\n\n        void this._outletRouter.navigate(capability.properties.path, {\n          outlet: this.popup.id,\n          relativeTo: application.baseUrl,\n          params: params,\n          pushStateToSessionHistoryStack: false,\n          showSplash: capability.properties.showSplash,\n        });\n      });\n    });\n  }\n\n  /**\n   * Provides the popup context to embedded content.\n   */\n  private propagatePopupContext(): void {\n    effect(() => {\n      const context: ɵPopupContext = {\n        popupId: this.popup.id,\n        capability: this.capability(),\n        params: this.params(),\n        referrer: this.referrer(),\n      };\n      const routerOutletElement = this._routerOutletElement().nativeElement;\n\n      untracked(() => routerOutletElement.setContextValue(ɵPOPUP_CONTEXT, context));\n    });\n  }\n\n  private setPopupSize(): void {\n    effect(() => {\n      const size = this.capability().properties.size;\n      untracked(() => {\n        this.popup.size.width = size?.width;\n        this.popup.size.height = size?.height;\n        this.popup.size.minWidth = size?.minWidth;\n        this.popup.size.maxWidth = size?.maxWidth;\n        this.popup.size.minHeight = size?.minHeight;\n        this.popup.size.maxHeight = size?.maxHeight;\n      });\n    });\n  }\n\n  private installPopupFocusedPublisher(): void {\n    effect(() => {\n      const focused = this.popup.focused();\n      untracked(() => {\n        const commandTopic = ɵWorkbenchCommands.popupFocusedTopic(this.popup.id);\n        void this._messageClient.publish(commandTopic, focused, {retain: true});\n      });\n    });\n  }\n\n  private installPopupResultListener(): void {\n    inject(MessageClient).observe$<unknown>(ɵWorkbenchCommands.popupResultTopic(this.popup.id))\n      .pipe(takeUntilDestroyed())\n      .subscribe(result => this.popup.setResult(result.body));\n  }\n\n  private installPopupCloseListener(): void {\n    inject(MessageClient).observe$<unknown>(ɵWorkbenchCommands.popupCloseTopic(this.popup.id))\n      .pipe(takeUntilDestroyed())\n      .subscribe(closeRequest => {\n        this.popup.close(closeRequest.headers.get(ɵWorkbenchPopupMessageHeaders.CLOSE_WITH_ERROR) ? new Error(closeRequest.body as string) : closeRequest.body);\n      });\n  }\n\n  protected onFocusWithin(event: Event): void {\n    const {detail: focusWithin} = event as CustomEvent<boolean>;\n    this.focusWithin.set(focusWithin);\n\n    // Close the popup on focus loss.\n    if (this.closeOnFocusLost() && !focusWithin) {\n      this.popup.close(this.popup.result);\n    }\n\n    if (focusWithin) {\n      this._host.dispatchEvent(new CustomEvent('sci-microfrontend-focusin', {bubbles: true}));\n    }\n  }\n\n  private propagateWorkbenchTheme(): void {\n    Microfrontends.propagateTheme(this._routerOutletElement);\n  }\n}\n","<sci-router-outlet #router_outlet\n                   [name]=\"popup.id\"\n                   [attr.data-capabilityid]=\"capability().metadata!.id\"\n                   [attr.data-app]=\"capability().metadata!.appSymbolicName\"\n                   [attr.data-focus]=\"focusWithin() ? '' : null\"\n                   keystrokes=\"keydown.escape\"\n                   [class]=\"popup.cssClass()\"\n                   (focuswithin)=\"onFocusWithin($event)\">\n  <ng-container *ngComponentOutlet=\"splash\"/>\n</sci-router-outlet>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {signal, Signal} from '@angular/core';\nimport {WorkbenchPopupCapability} from '@scion/workbench-client';\nimport {WorkbenchPopup} from '../../popup/workbench-popup.model';\n\n/** @inheritDoc */\nexport class MicrofrontendHostPopup implements ActivatedMicrofrontend {\n\n  public readonly capability: Signal<WorkbenchPopupCapability>;\n  public readonly params: Signal<Map<string, unknown>>;\n  public readonly referrer: Signal<string>;\n\n  constructor(private _popup: WorkbenchPopup, capability: WorkbenchPopupCapability, params: Map<string, unknown>, referrer: string) {\n    this.capability = signal(capability).asReadonly();\n    this.params = signal(params).asReadonly();\n    this.referrer = signal(referrer).asReadonly();\n    this.setPopupProperties();\n  }\n\n  private setPopupProperties(): void {\n    const properties = this.capability().properties;\n\n    this._popup.size.width = properties.size?.width;\n    this._popup.size.height = properties.size?.height;\n    this._popup.size.minWidth = properties.size?.minWidth;\n    this._popup.size.maxWidth = properties.size?.maxWidth;\n    this._popup.size.minHeight = properties.size?.minHeight;\n    this._popup.size.maxHeight = properties.size?.maxHeight;\n  }\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, InjectionToken, runInInjectionContext, StaticProvider} from '@angular/core';\nimport {Handler, IntentInterceptor, IntentMessage, mapToBody, MessageClient, MessageHeaders, ResponseStatusCodes} from '@scion/microfrontend-platform';\nimport {WorkbenchCapabilities, WorkbenchPopupCapability, WorkbenchPopupReferrer, ɵWorkbenchCommands, ɵWorkbenchPopupCommand} from '@scion/workbench-client';\nimport {MicrofrontendPopupComponent} from './microfrontend-popup.component';\nimport {Observable} from 'rxjs';\nimport {Logger, LoggerNames} from '../../logging';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {stringifyError} from '../../common/stringify-error.util';\nimport {Arrays} from '@scion/toolkit/util';\nimport {WorkbenchPopupService} from '../../popup/workbench-popup.service';\nimport {PopupOrigin} from '../../popup/popup.origin';\nimport {isViewId, PopupId} from '../../workbench.identifiers';\nimport {WorkbenchViewRegistry} from '../../view/workbench-view.registry';\nimport {prune} from '../../common/prune.util';\nimport {MICROFRONTEND_VIEW_NAVIGATION_HINT} from '../microfrontend-view/microfrontend-view-routes';\nimport {MicrofrontendViewNavigationData} from '../microfrontend-view/microfrontend-view-navigation-data';\nimport {MicrofrontendHostComponent} from '../microfrontend-host/microfrontend-host.component';\nimport {ɵWorkbenchPopup} from '../../popup/ɵworkbench-popup.model';\nimport {MicrofrontendHostPopup} from '../microfrontend-host-popup/microfrontend-host-popup.model';\nimport {ActivatedMicrofrontend} from '../microfrontend-host/microfrontend-host.model';\nimport {Microfrontends} from '../common/microfrontend.util';\n\n/**\n * Handles popup intents, opening a popup based on resolved capability.\n *\n * Microfrontends of the host are displayed in {@link ActivatedMicrofrontendComponent}, microfrontends of other applications in {@link MicrofrontendPopupComponent}.\n *\n * Popup intents are handled in this interceptor and are not transported to the providing application to support applications not connected to the SCION Workbench.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendPopupIntentHandler implements IntentInterceptor {\n\n  private readonly _popupService = inject(WorkbenchPopupService);\n  private readonly _viewRegistry = inject(WorkbenchViewRegistry);\n  private readonly _logger = inject(Logger);\n  private readonly _openedPopups = new Set<PopupId>();\n\n  /**\n   * Popup intents are handled in this interceptor and then swallowed.\n   */\n  public intercept(intentMessage: IntentMessage, next: Handler<IntentMessage>): Promise<void> {\n    if (intentMessage.intent.type === WorkbenchCapabilities.Popup) {\n      const popupIntentMessage = intentMessage as IntentMessage<ɵWorkbenchPopupCommand>;\n      // Do not block the call until the popup is closed.\n      // Otherwise, the caller may receive a timeout error if not closing the popup before delivery confirmation expires.\n      this.consumePopupIntent(popupIntentMessage).catch((error: unknown) => this._logger.error('[PopupOpenError] Failed to open popup.', LoggerNames.MICROFRONTEND, intentMessage, error));\n      return Promise.resolve();\n    }\n    else {\n      return next.handle(intentMessage);\n    }\n  }\n\n  private async consumePopupIntent(message: IntentMessage<ɵWorkbenchPopupCommand>): Promise<void> {\n    const popupId = message.body!.popupId;\n    const replyTo = message.headers.get(MessageHeaders.ReplyTo) as string;\n\n    // Ignore subsequent intents if a popup is already open, as it would lead to the first popup being closed.\n    if (this._openedPopups.has(popupId)) {\n      this._logger.warn('Ignoring popup intent because multiple popup providers found that match the popup intent. Most likely this is not intended and may indicate an incorrect manifest configuration.', message.intent);\n      return;\n    }\n\n    this._openedPopups.add(popupId);\n    try {\n      const result = await this.openPopup(message);\n      // Use 'Beans.opt' to not error if the platform is destroyed, e.g., in tests if not closing popups.\n      await Beans.opt(MessageClient)?.publish(replyTo, result, {headers: new Map().set(MessageHeaders.Status, ResponseStatusCodes.TERMINAL)});\n    }\n    catch (error) {\n      // Use 'Beans.opt' to not error if the platform is destroyed, e.g., in tests if not closing popups.\n      await Beans.opt(MessageClient)?.publish(replyTo, stringifyError(error), {headers: new Map().set(MessageHeaders.Status, ResponseStatusCodes.ERROR)});\n    }\n    finally {\n      this._openedPopups.delete(popupId);\n    }\n  }\n\n  /**\n   * Opens the microfrontend declared by the resolved capability in a popup.\n   */\n  private async openPopup(message: IntentMessage<ɵWorkbenchPopupCommand>): Promise<unknown> {\n    const command = message.body!;\n    const capability = message.capability as WorkbenchPopupCapability;\n    const params = message.intent.params ?? new Map<string, unknown>();\n    const referrer = message.headers.get(MessageHeaders.AppSymbolicName) as string;\n    const closeOnFocusLost = command.closeStrategy?.onFocusLost ?? true;\n    const isHostProvider = Microfrontends.isHostProvider(capability);\n    this._logger.debug(() => 'Handling microfrontend popup command', LoggerNames.MICROFRONTEND, command);\n\n    return this._popupService.open(isHostProvider ? MicrofrontendHostComponent : MicrofrontendPopupComponent, prune({\n      id: command.popupId,\n      inputs: isHostProvider ? {} : {capability, params, referrer: this.getReferrer(command), closeOnFocusLost},\n      providers: isHostProvider ? [\n        provideActivatedMicrofrontend(capability, params, referrer),\n        {provide: WORKBENCH_POPUP_REFERRER, useValue: this.getReferrer(command)},\n      ] : undefined,\n      anchor: this.observePopupOrigin$(command),\n      context: command.context,\n      align: command.align,\n      closeStrategy: isHostProvider ? command.closeStrategy : {\n        ...command.closeStrategy,\n        onFocusLost: false, // Closing the popup on focus loss is handled in {MicrofrontendPopupComponent}\n      },\n      cssClass: Arrays.coerce(capability.properties.cssClass).concat(Arrays.coerce(command.cssClass)),\n    }));\n  }\n\n  /**\n   * Constructs an Observable that, upon subscription, emits the position of the popup anchor, and then each time it is repositioned.\n   */\n  private observePopupOrigin$(command: ɵWorkbenchPopupCommand): Observable<PopupOrigin> {\n    return Beans.get(MessageClient).observe$<PopupOrigin>(ɵWorkbenchCommands.popupOriginTopic(command.popupId)).pipe(mapToBody());\n  }\n\n  /**\n   * Returns information about the context in which a popup was opened.\n   */\n  private getReferrer(command: ɵWorkbenchPopupCommand): WorkbenchPopupReferrer {\n    const context = command.context && (typeof command.context === 'object' ? command.context.viewId : command.context);\n    if (!isViewId(context)) {\n      return {};\n    }\n\n    const view = this._viewRegistry.get(context);\n    return {\n      viewId: view.id,\n      viewCapabilityId: (() => {\n        const navigation = view.navigation();\n        if (navigation?.hint === MICROFRONTEND_VIEW_NAVIGATION_HINT) {\n          return (navigation.data as unknown as MicrofrontendViewNavigationData).capabilityId;\n        }\n        return undefined;\n      })(),\n    };\n  }\n}\n\n/**\n * Provides {@link ActivatedMicrofrontend} for injection in the host microfrontend.\n */\nfunction provideActivatedMicrofrontend(capability: WorkbenchPopupCapability, params: Map<string, unknown>, referrer: string): StaticProvider {\n  return {\n    provide: ActivatedMicrofrontend,\n    useFactory: () => {\n      const popup = inject(ɵWorkbenchPopup);\n      // Create in popup's injection context to bind 'MicrofrontendPopup' to the popup's lifecycle.\n      return runInInjectionContext(popup.injector, () => new MicrofrontendHostPopup(popup, capability, params, referrer));\n    },\n  };\n}\n\n/**\n * DI token to inject the deprecated referrer previously available on the removed `WorkbenchPopup.referrer`.\n *\n * @deprecated since version 21.0.0-beta.2. Marked for removal. No replacement. Instead, add a parameter to the popup capability for the popup opener to pass required referrer information.\n */\nexport const WORKBENCH_POPUP_REFERRER = new InjectionToken<WorkbenchPopupReferrer>('WORKBENCH_POPUP_REFERRER');\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform';\nimport {Injectable} from '@angular/core';\nimport {WorkbenchCapabilities, WorkbenchPopupCapability} from '@scion/workbench-client';\nimport {Objects} from '@scion/toolkit/util';\nimport {Microfrontends} from '../common/microfrontend.util';\n\n/**\n * Asserts popup capabilities to have required properties.\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as only registered if microfrontend support is enabled. */)\nexport class MicrofrontendPopupCapabilityValidator implements CapabilityInterceptor {\n\n  public async intercept(capability: Capability): Promise<Capability> {\n    if (capability.type !== WorkbenchCapabilities.Popup) {\n      return capability;\n    }\n\n    const popupCapability = capability as Partial<WorkbenchPopupCapability>;\n    // Assert the popup capability to have a qualifier.\n    if (!Object.keys(popupCapability.qualifier ?? {}).length) {\n      throw Error(`[PopupDefinitionError] Popup capability requires a qualifier [app=${app(popupCapability)}, popup=${qualifier(popupCapability)}]`);\n    }\n\n    // Assert the popup capability to have properties.\n    if (!popupCapability.properties) {\n      throw Error(`[PopupDefinitionError] Popup capability requires properties [app=${app(popupCapability)}, popup=${qualifier(popupCapability)}]`);\n    }\n\n    // Assert the popup capability to have a path, unless provided by the host application.\n    this.assertPath(popupCapability);\n\n    // Assert host popup capabilities not to define the \"showSplash\" property.\n    if (Microfrontends.isHostProvider(capability) && popupCapability.properties.showSplash !== undefined) {\n      throw Error(`[PopupDefinitionError] Property \"showSplash\" not supported for popup capabilities of the host application [app=${app(popupCapability)}, popup=${qualifier(popupCapability)}]`);\n    }\n\n    return capability;\n  }\n\n  private assertPath(capability: Partial<WorkbenchPopupCapability>): void {\n    const path = capability.properties?.path as string | undefined | null;\n\n    if (Microfrontends.isHostProvider(capability)) {\n      if (path !== '') {\n        throw Error(`[PopupDefinitionError] Popup capabilities of the host application require an empty path. [app=${app(capability)}, popup=${qualifier(capability)}]. Change the path '${path}' to empty and add 'canMatchWorkbenchPopupCapability(${JSON.stringify(capability.qualifier)})' guard to the route.\\n\\nExample:\\nCapability: { type: 'popup', qualifier: ${JSON.stringify(capability.qualifier)}, properties: {path: ''} }\\nRoute: { path: '', canMatch: [canMatchWorkbenchPopupCapability(${JSON.stringify(capability.qualifier)})], component: PopupComponent }`);\n      }\n    }\n    else {\n      if (path === null || path == undefined) {\n        throw Error(`[PopupDefinitionError] Popup capabilities require a path. [app=${app(capability)}, popup=${qualifier(capability)}]`);\n      }\n    }\n  }\n}\n\n/**\n * Returns the qualifier as string.\n */\nfunction qualifier(capability: Partial<Capability>): string {\n  return Objects.toMatrixNotation(capability.qualifier);\n}\n\n/**\n * Returns the app symbolic name.\n */\nfunction app(capability: Partial<Capability>): string {\n  return capability.metadata!.appSymbolicName;\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, inject, makeEnvironmentProviders, Provider} from '@angular/core';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {CapabilityInterceptor, IntentInterceptor} from '@scion/microfrontend-platform';\nimport {MicrofrontendPlatformStartupPhase, provideMicrofrontendPlatformInitializer} from '../microfrontend-platform-initializer';\nimport {MicrofrontendPopupIntentHandler} from './microfrontend-popup-intent-handler.interceptor';\nimport {MicrofrontendPopupCapabilityValidator} from './microfrontend-popup-capability-validator.interceptor';\nimport {WorkbenchDialogService, WorkbenchMessageBoxService, WorkbenchPopupService, ɵWorkbenchDialogService, ɵWorkbenchMessageBoxService, ɵWorkbenchPopupService} from '@scion/workbench-client';\nimport {WorkbenchPopup} from '../../popup/workbench-popup.model';\nimport {WORKBENCH_POPUP_CONTEXT} from '../../popup/workbench-popup-context.provider';\n\n/**\n * Provides a set of DI providers enabling microfrontend popup support.\n *\n * @see WorkbenchPopupCapability\n */\nexport function provideMicrofrontendPopup(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    MicrofrontendPopupIntentHandler,\n    MicrofrontendPopupCapabilityValidator,\n    provideWorkbenchPopupContext(),\n    provideMicrofrontendPlatformInitializer(onPreStartup, {phase: MicrofrontendPlatformStartupPhase.PreStartup}),\n  ]);\n\n  function onPreStartup(): void {\n    // Register popup intent handler.\n    Beans.register(IntentInterceptor, {useValue: inject(MicrofrontendPopupIntentHandler), multi: true});\n    // Register popup capability validator.\n    Beans.register(CapabilityInterceptor, {useValue: inject(MicrofrontendPopupCapabilityValidator), multi: true});\n  }\n\n  /**\n   * Provides beans of @scion/workbench-client available for DI if in the context of a workbench popup.\n   */\n  function provideWorkbenchPopupContext(): Provider {\n    return {\n      provide: WORKBENCH_POPUP_CONTEXT,\n      useFactory: (): Provider[] => [\n        {provide: WorkbenchDialogService, useFactory: () => new ɵWorkbenchDialogService(inject(WorkbenchPopup).id)},\n        {provide: WorkbenchMessageBoxService, useFactory: () => new ɵWorkbenchMessageBoxService(inject(WorkbenchPopup).id)},\n        {provide: WorkbenchPopupService, useFactory: () => new ɵWorkbenchPopupService(inject(WorkbenchPopup).id)},\n      ],\n      multi: true,\n    };\n  }\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport './microfrontend-platform.config'; // DO NOT remove to augment `MicrofrontendPlatformConfig` with `splash` property.\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\nimport {provideMicrofrontendPlatform} from './microfrontend-platform.provider';\nimport {IntentClient, ManifestService, MessageClient, MicrofrontendPlatformConfig, OutletRouter, PlatformPropertyService} from '@scion/microfrontend-platform';\nimport {Beans} from '@scion/toolkit/bean-manager';\nimport {WorkbenchDialogService, WorkbenchMessageBoxService, WorkbenchNotificationService, WorkbenchPopupService, WorkbenchRouter, WorkbenchTextService} from '@scion/workbench-client';\nimport {WorkbenchConfig} from '../workbench-config';\nimport {provideManifestObjectCache} from './manifest-object-cache.service';\nimport {provideMicrofrontendPerspective} from './microfrontend-perspective/microfrontend-perspective.provider';\nimport {provideMicrofrontendPart} from './microfrontend-part/microfrontend-part.provider';\nimport {provideMicrofrontendView} from './microfrontend-view/microfrontend-view.provider';\nimport {provideMicrofrontendNotification} from './microfrontend-notification/microfrontend-notification.provider';\nimport {provideMicrofrontendDialog} from './microfrontend-dialog/microfrontend-dialog.provider';\nimport {provideMicrofrontendMessageBox} from './microfrontend-message-box/microfrontend-message-box.provider';\nimport {provideMicrofrontendText} from './microfrontend-text/microfrontend-text.provider';\nimport {provideMicrofrontendPopup} from './microfrontend-popup/microfrontend-popup.provider';\nimport {Routing} from '../routing/routing.util';\nimport {provideWorkbenchInitializer, WorkbenchStartupPhase} from '../startup/workbench-initializer';\n\n/**\n * Provides a set of DI providers to set up microfrontend support in the workbench.\n */\nexport function provideWorkbenchMicrofrontendSupport(workbenchConfig: WorkbenchConfig): EnvironmentProviders | [] {\n  if (!workbenchConfig.microfrontendPlatform) {\n    return [];\n  }\n\n  return makeEnvironmentProviders([\n    provideMicrofrontendPlatform(workbenchConfig),\n    provideMicrofrontendPerspective(),\n    provideMicrofrontendPart(),\n    provideMicrofrontendView(),\n    provideMicrofrontendDialog(),\n    provideMicrofrontendMessageBox(),\n    provideMicrofrontendPopup(),\n    provideMicrofrontendNotification(),\n    provideMicrofrontendText(),\n    provideManifestObjectCache(),\n    provideMicrofrontendPlatformBeans(),\n    provideWorkbenchClientBeans(),\n    runCanMatchGuardsAfterStartup(),\n  ]);\n}\n\n/**\n * Provides beans of @scion/microfrontend-platform for DI.\n */\nfunction provideMicrofrontendPlatformBeans(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    {provide: MicrofrontendPlatformConfig, useFactory: () => Beans.get(MicrofrontendPlatformConfig)},\n    {provide: MessageClient, useFactory: () => Beans.get(MessageClient)},\n    {provide: IntentClient, useFactory: () => Beans.get(IntentClient)},\n    {provide: OutletRouter, useFactory: () => Beans.get(OutletRouter)},\n    {provide: ManifestService, useFactory: () => Beans.get(ManifestService)},\n    {provide: PlatformPropertyService, useFactory: () => Beans.get(PlatformPropertyService)},\n  ]);\n}\n\n/**\n * Provides beans of @scion/workbench-client for DI.\n */\nfunction provideWorkbenchClientBeans(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    {provide: WorkbenchRouter, useFactory: () => Beans.get(WorkbenchRouter)},\n    {provide: WorkbenchPopupService, useFactory: () => Beans.get(WorkbenchPopupService)},\n    {provide: WorkbenchDialogService, useFactory: () => Beans.get(WorkbenchDialogService)},\n    {provide: WorkbenchMessageBoxService, useFactory: () => Beans.get(WorkbenchMessageBoxService)},\n    {provide: WorkbenchNotificationService, useFactory: () => Beans.get(WorkbenchNotificationService)},\n    {provide: WorkbenchTextService, useFactory: () => Beans.get(WorkbenchTextService)},\n  ]);\n}\n\n/**\n * Instructs Angular to evaluate `CanMatch` route guards, required for guards that depend on data not available during initial navigation,\n * such as the completed startup of the SCION Microfrontend Platform to lookup capabilities. Otherwise, microfrontends would display a\n * \"Not Found\" page until the next Angular navigation.\n */\nfunction runCanMatchGuardsAfterStartup(): EnvironmentProviders {\n  return provideWorkbenchInitializer(() => Routing.runCanMatchGuards(), {phase: WorkbenchStartupPhase.PostStartup});\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Location, LocationStrategy} from '@angular/common';\nimport {ApplicationRef, EnvironmentProviders, inject, Injectable, makeEnvironmentProviders} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {WorkbenchNavigationalStates} from './workbench-navigational-states';\n\n/**\n * Provides a set of DI providers to patch {@link Location} for the Angular router to always add workbench navigations\n * to the browsing history stack.\n *\n * @see ɵLocation\n */\nexport function provideLocationPatch(): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    {\n      provide: Location,\n      useClass: ɵLocation,\n    },\n  ]);\n}\n\n/**\n * Patches {@link Location} for the Angular router to always add workbench navigations to the browsing history stack,\n * even if the URL does not change.\n *\n * Rationale:\n * If only the layout of the main grid is changed, the URL does not change because the layout is passed to the\n * navigation as state and not as a query parameter. By default, an unchanged URL does not create a new entry in the\n * browsing history stack, but replaces the current entry. See Angular router.ts#setBrowserUrl\n */\n@Injectable(/* DO NOT provide via 'providedIn' metadata as registered under `Location` DI token. */)\nclass ɵLocation extends Location {\n\n  private _appRef = inject(ApplicationRef);\n  private _router: Router | undefined;\n\n  constructor() {\n    super(inject(LocationStrategy));\n  }\n\n  public override isCurrentPathEqualTo(path: string, query?: string): boolean {\n    return super.isCurrentPathEqualTo(path, query) ? !this.isWorkbenchNavigation() : false;\n  }\n\n  /**\n   * Indicates whether the current navigation is a workbench navigation performed through the workbench router.\n   */\n  private isWorkbenchNavigation(): boolean {\n    const currentNavigation = this.router?.currentNavigation() ?? null;\n    return currentNavigation !== null && WorkbenchNavigationalStates.fromNavigation(currentNavigation) !== null;\n  }\n\n  /**\n   * Reference to the Angular router.\n   */\n  private get router(): Router | undefined {\n    // Note that we cannot inject the `Router` in the constructor because the `Router` depends on `Location`,\n    // which would cause a circular dependency at construction time. Instead, we inject the router lazy.\n    // However, injecting the router will fail if the platform has already been destroyed, which happens\n    // in tests that tear down before the initial navigation has finished. To avoid this error, we inject\n    // the router only if the platform is still running.\n    return (this._router ??= !this._appRef.destroyed ? this._appRef.injector.get(Router) : undefined);\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {WorkbenchTextProviderFn} from './workbench-text-provider.model';\n\n/**\n * Texts used in the SCION Workbench.\n *\n * To express the usage of a translation, add a suffix to the key:\n *\n * ```md\n * | Suffix   | Usage                    | Conventions                                 | Examples           |\n * |----------|--------------------------|---------------------------------------------|--------------------|\n * | .title   | - view title             | - Starts with a capital letter.             | - Settings         |\n * |          | - dialog title           | - No punctuation.                           | - Page Not Found   |\n * |          | - popup title            | - Words in capital letter.                  | - Confirm Deletion |\n * |          | - tab name               | - Verbs in the imperative form.             |                    |\n * |          | - column header in table |                                             |                    |\n * |          |                          |                                             |                    |\n * | .label   | - field label            | - Starts with a capital letter.             |                    |\n * |          |                          | - No punctuation.                           |                    |\n * |          |                          |                                             |                    |\n * | .action  | - button                 | - Starts with a capital letter.             | - Cancel           |\n * |          | - menu item              | - No punctuation.                           | - Close            |\n * |          |                          | - Verbs in the imperative form.             | - Delete...        |\n * |          |                          | - Suffix the action with an ellipsis        |                    |\n * |          |                          |   if there are additional options to enter. |                    |\n * |          |                          |                                             |                    |\n * | .tooltip | - tooltip                | - Starts with a capital letter.             | - Show Open Tabs   |\n * |          |                          | - No punctuation.                           | - Close            |\n * |          |                          | - Words in capital letter, unless a full    |                    |\n * |          |                          |   sentence.                                 |                    |\n * |          |                          |                                             |                    |\n * | .value   | - table cell             | - No punctuation.                           |                    |\n * |          | - drop down proposal     |                                             |                    |\n * |          | - list content           |                                             |                    |\n * |          |                          |                                             |                    |\n * | .message | - message                | - Full sentences.                           |                    |\n * |          | - warning                | - Punctuation.                              |                    |\n * |          | - error                  |                                             |                    |\n * |          | - info                   |                                             |                    |\n * ```\n */\nconst workbenchTexts: Record<string, string> = {\n  'workbench.clear.tooltip': 'Clear',\n  'workbench.close.action': 'Close',\n  'workbench.close_all_tabs.action': 'Close All Tabs',\n  'workbench.close_other_tabs.action': 'Close Other Tabs',\n  'workbench.close_tab.action': 'Close',\n  'workbench.close_tab.tooltip': 'Close. {{close_others_modifier}}+Click to Close Others.',\n  'workbench.close_tabs_to_the_left.action': 'Close Tabs to the Left',\n  'workbench.close_tabs_to_the_right.action': 'Close Tabs to the Right',\n  'workbench.close.tooltip': 'Close',\n  'workbench.dev_mode_only_hint.tooltip': 'This hint is only displayed in dev mode.',\n  'workbench.minimize.tooltip': 'Minimize',\n  'workbench.move_tab_down.action': 'Move Down',\n  'workbench.move_tab_to_new_window.action': 'Move to New Window',\n  'workbench.move_tab_to_the_left.action': 'Move Left',\n  'workbench.move_tab_to_the_right.action': 'Move Right',\n  'workbench.move_tab_up.action': 'Move Up',\n  'workbench.null_content.message': 'Nothing to show.',\n  'workbench.null_view_developer_hint.message': 'This view has not been navigated.<br>Navigate the view \"{{view}}\" to display content.',\n  'workbench.ok.action': 'OK',\n  'workbench.page_not_found.message': 'The requested page <strong>{{path}}</strong> was not found.<br>The URL may have changed.',\n  'workbench.page_not_found.title': 'Page Not Found',\n  'workbench.page_not_found_developer_hint.message': 'You can create a custom \"Not Found\" page component and register it in the workbench configuration to personalize this page.',\n  'workbench.page_not_found_part.message': 'The requested page <strong>{{path}}</strong> was not found.<br>The URL may have changed. Try resetting the perspective.',\n  'workbench.page_not_found_view.message': 'The requested page <strong>{{path}}</strong> was not found.<br>The URL may have changed. Try opening the view again or resetting the perspective.',\n  'workbench.reset_perspective.action': 'Reset Perspective',\n  'workbench.show_open_tabs.tooltip': 'Show Open Tabs',\n};\n\n/**\n * Provides texts used in the SCION Workbench.\n *\n * Register this provider as the last text provider, enabling change or translation of built-in workbench texts.\n */\nexport const workbenchTextProvider: WorkbenchTextProviderFn = (key: string, params: {[name: string]: string}): string | undefined => {\n  // Get the text.\n  const text = workbenchTexts[key];\n  if (text === undefined) {\n    return undefined;\n  }\n\n  // Replace params, if any.\n  if (Object.keys(params).length) {\n    return text.replace(/{{(?<param>[^}]+)}}/g, (match: string, param: string) => params[param] ?? match);\n  }\n\n  return text;\n};\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, makeEnvironmentProviders, Signal} from '@angular/core';\nimport {WorkbenchConfig} from '../workbench-config';\nimport {WORKBENCH_TEXT_PROVIDER, WorkbenchTextProviderFn} from './workbench-text-provider.model';\nimport {workbenchTextProvider} from './workbench-text-provider';\n\n/**\n * Provides a set of DI providers to register text providers.\n */\nexport function provideTextProviders(config: WorkbenchConfig): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    // Provide app-specific texts.\n    {\n      provide: WORKBENCH_TEXT_PROVIDER,\n      useValue: applicationTextProvider(config),\n      multi: true,\n    },\n    // Provide built-in texts.\n    {\n      provide: WORKBENCH_TEXT_PROVIDER,\n      useValue: workbenchTextProvider,\n      multi: true,\n    },\n  ]);\n}\n\n/**\n * Provides application-specifc texts and translated workbench texts.\n *\n * Register this provider as the first text provider, enabling change or translation of built-in workbench texts.\n */\nfunction applicationTextProvider(config: WorkbenchConfig): WorkbenchTextProviderFn {\n  const appTextProvider = config.textProvider;\n  if (!appTextProvider) {\n    return () => undefined;\n  }\n\n  return (key: string, params: {[name: string]: string}): Signal<string> | string | undefined => {\n    // Translation keys starting with the `workbench.external.` prefix are external and must not\n    // be localized by the workbench application, such as remote keys to resolve texts from micro apps.\n    if (key.startsWith('workbench.external.')) {\n      return undefined;\n    }\n    return appTextProvider(key, params);\n  };\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {WorkbenchIconDescriptor, WorkbenchIconProviderFn} from './workbench-icon-provider.model';\nimport {Component, input} from '@angular/core';\n\n/**\n * Provides Material icons for non-workbench icons.\n */\nexport const materialIconProvider: WorkbenchIconProviderFn = (ligature: string): WorkbenchIconDescriptor | undefined => {\n  if (ligature.startsWith('workbench.')) {\n    return undefined; // use default workbench icon\n  }\n\n  return {component: MaterialIconComponent, inputs: {ligature}};\n};\n\n/**\n * Renders a Material icon based on its ligature.\n *\n * This component requires a Material icon font to be included in the HTML.\n *\n * Supported fonts:\n * - https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded\n * - https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined\n * - https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp\n * - https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Icons+Sharp\n */\n@Component({\n  selector: 'wb-material-icon',\n  template: '{{ligature()}}',\n  host: {\n    '[class.material-icons]': 'true',\n    '[class.material-icons-outlined]': 'true',\n    '[class.material-icons-round]': 'true',\n    '[class.material-icons-sharp]': 'true',\n    '[class.material-symbols-sharp]': 'true',\n    '[class.material-symbols-outlined]': 'true',\n    '[class.material-symbols-rounded]': 'true',\n  },\n})\nexport class MaterialIconComponent {\n  /**\n   * Specifies the ligature of the Material icon.\n   */\n  public readonly ligature = input.required<string>();\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {WorkbenchIconDescriptor, WorkbenchIconProviderFn} from './workbench-icon-provider.model';\nimport {Component, input} from '@angular/core';\n\n/**\n * Provides icons used by the SCION Workbench.\n *\n * Register this provider as the last icon provider, enabling replacement of built-in workbench icons.\n */\nexport const workbenchIconProvider: WorkbenchIconProviderFn = (icon: string): WorkbenchIconDescriptor | undefined => {\n  const ligature = workbenchIcons[icon];\n  if (ligature) {\n    return {component: WorkbenchIconComponent, inputs: {ligature}};\n  }\n  return undefined;\n};\n\n/**\n * Maps icons to ligatures of the SCION Workbench icon font.\n */\nconst workbenchIcons: {[icon: string]: string} = {\n  'workbench.clear': 'clear',\n  'workbench.close': 'close',\n  'workbench.dirty': 'dirty',\n  'workbench.menu_down': 'chevron_down',\n  'workbench.minimize': 'minimize',\n  'workbench.pin': 'pin',\n  'workbench.search': 'search',\n};\n\n/**\n * Renders a workbench icon based on its ligature.\n *\n * This component requires the workbench icon font 'scion-workbench-icons' to be included in the HTML.\n *\n * Supported ligatures:\n * - `chevron_down`: Menu button of drop down menus\n * - `clear`: Clear button in input fields\n * - `close`: Close button in views, dialogs and notifications\n * - `dirty`: Visual indicator for view with unsaved content\n * - `minimize`: Minimize button in docked parts\n * - `pin`: Visual indicator for a pinned view\n * - `search`: Visual indicator in search or filter fields\n */\n@Component({\n  selector: 'wb-workbench-icon',\n  template: '{{ligature()}}',\n  host: {\n    '[class.scion-workbench-icons]': 'true',\n  },\n})\nexport class WorkbenchIconComponent {\n\n  /**\n   * Specifies the ligature of the icon.\n   */\n  public readonly ligature = input.required<string>();\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\nimport {WORKBENCH_ICON_PROVIDER} from './workbench-icon-provider.model';\nimport {materialIconProvider} from './material-icon-provider';\nimport {workbenchIconProvider} from './workbench-icon-provider';\nimport {WorkbenchConfig} from '../workbench-config';\n\n/**\n * Provides a set of DI providers to register icon providers.\n */\nexport function provideIconProviders(config: WorkbenchConfig): EnvironmentProviders {\n  return makeEnvironmentProviders([\n    // Provide app-specific icons, or fall back to Material icons.\n    {\n      provide: WORKBENCH_ICON_PROVIDER,\n      useValue: config.iconProvider ?? materialIconProvider,\n      multi: true,\n    },\n    // Provide built-in icons.\n    {\n      provide: WORKBENCH_ICON_PROVIDER,\n      useValue: workbenchIconProvider,\n      multi: true,\n    },\n  ]);\n}\n","/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, inject, makeEnvironmentProviders, provideEnvironmentInitializer} from '@angular/core';\nimport {WorkbenchService} from './workbench.service';\nimport {WorkbenchUrlObserver} from './routing/workbench-url-observer.service';\nimport {WorkbenchConfig} from './workbench-config';\nimport {ViewMenuService} from './part/view-context-menu/view-menu.service';\nimport {ViewMoveHandler} from './view/view-move-handler.service';\nimport {provideWorkbenchMicrofrontendSupport} from './microfrontend-platform/workbench-microfrontend-support';\nimport {provideLogging} from './logging';\nimport {provideWorkbenchInitializer, WorkbenchStartupPhase} from './startup/workbench-initializer';\nimport {WorkbenchPerspectiveService} from './perspective/workbench-perspective.service';\nimport {DefaultWorkbenchStorage, WorkbenchStorage} from './storage/workbench-storage';\nimport {provideLocationPatch} from './routing/ɵlocation';\nimport {WorkbenchThemeSwitcher} from './theme/workbench-theme-switcher.service';\nimport {ViewTabDragImageRenderer} from './view-dnd/view-tab-drag-image-renderer.service';\nimport {provideTextProviders} from './text/text-providers';\nimport {provideIconProviders} from './icon/icon-providers';\nimport {provideWorkbenchViewContext} from './view/workbench-view-context.provider';\nimport {provideWorkbenchPartContext} from './part/workbench-part-context.provider';\nimport {provideWorkbenchDialogContext} from './dialog/workbench-dialog-context.provider';\nimport {provideWorkbenchPopupContext} from './popup/workbench-popup-context.provider';\nimport {provideWorkbenchNotificationContext} from './notification/workbench-notification-context.provider';\n\n/**\n * Enables and configures the SCION Workbench, returning a set of dependency-injection providers to be registered in Angular.\n *\n * ### About\n * SCION Workbench enables the creation of Angular web applications that require a flexible layout to display content side-by-side\n * or stacked, all personalizable by the user via drag & drop. This type of layout is ideal for applications with non-linear workflows,\n * enabling users to work on content in parallel.\n *\n * An application can have multiple layouts, called perspectives. A perspective defines an arrangement of parts and views.\n * Parts can be docked to the side or positioned relative to each other. Views are stacked in parts and can be dragged to other parts.\n * Content can be displayed in both parts and views.\n *\n * Users can personalize the layout of a perspective and switch between perspectives. The workbench remembers the layout of a perspective,\n * restoring it the next time it is activated.\n *\n * A perspective typically has a main area part and parts docked to the side, providing navigation and context-sensitive assistance to support\n * the user's workflow. Initially empty or displaying a welcome page, the main area is where the workbench opens views by default. Users can split\n * the main area (or any other part) by dragging views side-by-side, vertically and horizontally, even across windows.\n *\n * Unlike any other part, the main area is shared between perspectives, and its layout is not reset when resetting perspectives. Having a main area and\n * multiple perspectives is optional.\n *\n * ### Usage\n * ```ts\n * import {MAIN_AREA, provideWorkbench, WorkbenchLayoutFactory} from '@scion/workbench';\n * import {provideRouter} from '@angular/router';\n * import {provideAnimations} from '@angular/platform-browser/animations';\n * import {bootstrapApplication} from '@angular/platform-browser';\n *\n * bootstrapApplication(AppComponent, {\n *   providers: [\n *     provideWorkbench({\n *       layout: (factory: WorkbenchLayoutFactory) => factory\n *         .addPart(MAIN_AREA)\n *         .addPart('todos', {dockTo: 'left-top'}, {label: 'Todos', icon: 'checklist'})\n *         .navigatePart(MAIN_AREA, ['overview'])\n *         .navigatePart('todos', ['todos'])\n *         .activatePart('todos'),\n *     }),\n *     provideRouter([\n *       {path: 'overview', loadComponent: () => import('./overview/overview.component')},\n *       {path: 'todos', loadComponent: () => import('./todos/todos.component')},\n *     ]),\n *     provideAnimations(),\n *   ],\n * });\n * ```\n *\n * ### Startup\n * The SCION Workbench starts automatically when the `<wb-workbench>` component is added to the DOM. Alternatively, the workbench can be\n * started manually using the {@link WorkbenchLauncher}, such as in an app initializer or a route guard.\n *\n * Example of starting the workbench in an app initializer:\n *\n * ```ts\n * import {provideWorkbench, WorkbenchLauncher} from '@scion/workbench';\n * import {bootstrapApplication} from '@angular/platform-browser';\n * import {inject, provideAppInitializer} from '@angular/core';\n *\n * bootstrapApplication(AppComponent, {\n *   providers: [\n *     provideWorkbench(),\n *     provideAppInitializer(() => inject(WorkbenchLauncher).launch())\n *   ]\n * });\n * ```\n *\n * Starting the workbench in an app initializer will block Angular's app startup until the workbench is ready.\n *\n * ### Startup Hooks\n * The application can hook into the startup process of the SCION Workbench by providing one or more initializers to the `provideWorkbenchInitializer()` function.\n * Initializers execute at defined points during startup, enabling the application's controlled initialization.\n *\n * ```ts\n * import {provideWorkbench, provideWorkbenchInitializer} from '@scion/workbench';\n * import {bootstrapApplication} from '@angular/platform-browser';\n * import {inject} from '@angular/core';\n *\n * bootstrapApplication(AppComponent, {\n *   providers: [\n *     provideWorkbench(),\n *     provideWorkbenchInitializer(() => inject(SomeService).init()),\n *   ],\n * });\n * ```\n */\nexport function provideWorkbench(config?: WorkbenchConfig): EnvironmentProviders {\n  config ??= {};\n\n  return makeEnvironmentProviders([\n    {\n      provide: WorkbenchConfig,\n      useValue: config,\n    },\n    {\n      provide: WorkbenchStorage,\n      useClass: config.storage ?? DefaultWorkbenchStorage,\n    },\n    provideWorkbenchInitializer(() => void inject(WorkbenchThemeSwitcher), {phase: WorkbenchStartupPhase.PreStartup}),\n    provideWorkbenchInitializer(() => void inject(ViewMenuService)),\n    provideWorkbenchInitializer(() => void inject(ViewMoveHandler)),\n    provideWorkbenchInitializer(() => void inject(ViewTabDragImageRenderer)),\n    provideWorkbenchInitializer(() => inject(WorkbenchPerspectiveService).init(), {phase: WorkbenchStartupPhase.PostStartup}),\n    provideEnvironmentInitializer(() => inject(WorkbenchUrlObserver)),\n    provideEnvironmentInitializer(() => rejectIfNotRootEnvironment()),\n    provideTextProviders(config),\n    provideIconProviders(config),\n    provideLogging(config),\n    provideLocationPatch(),\n    provideWorkbenchPartContext(),\n    provideWorkbenchViewContext(),\n    provideWorkbenchDialogContext(),\n    provideWorkbenchPopupContext(),\n    provideWorkbenchNotificationContext(),\n    provideWorkbenchMicrofrontendSupport(config),\n  ]);\n}\n\nfunction rejectIfNotRootEnvironment(): string {\n  if (inject(WorkbenchService, {optional: true, skipSelf: true})) {\n    throw Error('[ProvideWorkbenchError] SCION Workbench must be provided in root environment.');\n  }\n  return 'root';\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {ɵWorkbenchLauncher} from './ɵworkbench-launcher.service';\n\n/**\n * Provides the main entry point to start the SCION Workbench.\n *\n * The SCION Workbench starts automatically when the `<wb-workbench>` component is added to the DOM. Alternatively,\n * the workbench can be started manually using the `WorkbenchLauncher`, such as in an app initializer or a route guard.\n *\n * **Example of starting the workbench in an app initializer:**\n * ```ts\n * import {provideWorkbench, WorkbenchLauncher} from '@scion/workbench';\n * import {bootstrapApplication} from '@angular/platform-browser';\n * import {inject, provideAppInitializer} from '@angular/core';\n *\n * bootstrapApplication(AppComponent, {\n *   providers: [\n *     provideWorkbench(),\n *     provideAppInitializer(() => inject(WorkbenchLauncher).launch())\n *   ]\n * });\n * ```\n *\n * The application can hook into the startup process of the SCION Workbench by providing one or more initializers to {@link provideWorkbenchInitializer}.\n * Initializers execute at defined points during startup, enabling the application's controlled initialization. The workbench is fully started once\n * all initializers have completed.\n *\n * **Example of registering an initializer:**\n * ```ts\n * import {provideWorkbench, provideWorkbenchInitializer} from '@scion/workbench';\n * import {bootstrapApplication} from '@angular/platform-browser';\n * import {inject} from '@angular/core';\n *\n * bootstrapApplication(AppComponent, {\n *   providers: [\n *     provideWorkbench(),\n *     provideWorkbenchInitializer(() => inject(SomeService).init()),\n *   ],\n * });\n * ```\n *\n * The application can inject {@link WorkbenchStartup} to check if the workbench has completed startup.\n *\n * @see WorkbenchConfig.startup\n * @see provideWorkbench\n * @see provideWorkbenchInitializer\n */\n@Injectable({providedIn: 'root', useExisting: ɵWorkbenchLauncher})\nexport abstract class WorkbenchLauncher {\n\n  /**\n   * Starts the SCION Workbench.\n   *\n   * Calling this method has no effect if the workbench is already starting or has started.\n   *\n   * @return A Promise that resolves when the workbench has completed the startup or that rejects if the startup failed.\n   */\n  public abstract launch(): Promise<true>;\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {SciThrobberComponent} from '@scion/components/throbber';\n\n/**\n * Default splash displayed while starting the workbench.\n */\n@Component({\n  selector: 'wb-splash',\n  templateUrl: './splash.component.html',\n  styleUrls: ['./splash.component.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  imports: [SciThrobberComponent],\n})\nexport class SplashComponent {\n}\n","<sci-throbber type=\"ellipsis\"/>\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, inject, Signal} from '@angular/core';\nimport {WorkbenchNotificationRegistry} from './workbench-notification.registry';\nimport {ɵWorkbenchNotification} from './ɵworkbench-notification.model';\nimport {WorkbenchPortalOutletDirective} from '../portal/workbench-portal-outlet.directive';\n\n/**\n * Displays notifications on the right side, stacked vertically.\n */\n@Component({\n  selector: 'wb-notification-list',\n  templateUrl: './notification-list.component.html',\n  styleUrl: './notification-list.component.scss',\n  imports: [\n    WorkbenchPortalOutletDirective,\n  ],\n})\nexport class NotificationListComponent {\n\n  protected readonly notifications: Signal<ɵWorkbenchNotification[]> = inject(WorkbenchNotificationRegistry).elements;\n}\n","@for (notification of notifications(); track notification.group || notification.id) {\n  <div class=\"notification\">\n    <ng-container *wbPortalOutlet=\"notification.portal; destroyOnDetach: true\"/>\n  </div>\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, inject, input, Signal, untracked} from '@angular/core';\nimport {MActivity} from '../../workbench-activity.model';\nimport {ɵWorkbenchRouter} from '../../../routing/ɵworkbench-router.service';\nimport {IconComponent} from '../../../icon/icon.component';\nimport {text} from '../../../text/text';\nimport {WorkbenchLayoutService} from '../../../layout/workbench-layout.service';\nimport {isPartId, isViewId} from '../../../workbench.identifiers';\nimport {WorkbenchFocusMonitor} from '../../../focus/workbench-focus-tracker.service';\n\n/**\n * Renders a button to toggle the visibility of an activity.\n */\n@Component({\n  selector: 'wb-activity-item',\n  templateUrl: './activity-item.component.html',\n  styleUrls: ['./activity-item.component.scss'],\n  imports: [\n    IconComponent,\n  ],\n  host: {\n    '[attr.data-active]': `active() ? '' : null`,\n    '[attr.data-focus-within-activity]': `focusWithinActivity() ? '' : null`,\n    '[attr.data-activityid]': 'activity().id',\n    '[attr.title]': 'tooltip()',\n    '[class]': 'activity().cssClass',\n  },\n})\nexport class ActivityItemComponent {\n\n  public readonly activity = input.required<MActivity>();\n  public readonly active = input.required<boolean>();\n\n  protected readonly tooltip = text(computed(() => this.activity().tooltip ?? this.activity().label));\n  protected readonly focusWithinActivity = this.computeFocusWithinActivity();\n\n  private readonly _workbenchRouter = inject(ɵWorkbenchRouter);\n\n  protected onToggle(): void {\n    void this._workbenchRouter.navigate(layout => layout.toggleActivity(this.activity().id));\n  }\n\n  private computeFocusWithinActivity(): Signal<boolean> {\n    const focusMonitor = inject(WorkbenchFocusMonitor);\n    const layout = inject(WorkbenchLayoutService).layout;\n\n    return computed(() => {\n      const activeElement = focusMonitor.activeElement();\n      const activity = this.activity();\n\n      return untracked(() => {\n        if (!activeElement) {\n          return false;\n        }\n        if (isPartId(activeElement.id)) {\n          return layout().activity({partId: activeElement.id}, {orElse: null})?.id === activity.id;\n        }\n        if (isViewId(activeElement.id)) {\n          return layout().activity({viewId: activeElement.id}, {orElse: null})?.id === activity.id;\n        }\n        return false;\n      });\n    });\n  }\n}\n","<button (click)=\"onToggle()\"\n        [class.focus-within-activity]=\"focusWithinActivity()\"\n        [class.active]=\"active()\">\n  <wb-icon [icon]=\"activity().icon\"/>\n</button>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, input} from '@angular/core';\nimport {MActivityStack} from '../../workbench-activity.model';\nimport {ActivityItemComponent} from '../activity-item/activity-item.component';\n\n/**\n * Represents the stack of activities in a docking area.\n */\n@Component({\n  selector: 'wb-activity-stack',\n  templateUrl: './activity-stack.component.html',\n  styleUrls: ['./activity-stack.component.scss'],\n  imports: [\n    ActivityItemComponent,\n  ],\n})\nexport class ActivityStackComponent {\n\n  public readonly stack = input.required<MActivityStack>();\n}\n","@for (activity of stack().activities; track activity.id) {\n  <wb-activity-item [activity]=\"activity\" [active]=\"stack().activeActivityId === activity.id\"/>\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, inject, input} from '@angular/core';\nimport {ActivityStackComponent} from './activity-stack/activity-stack.component';\nimport {ɵWorkbenchService} from '../../ɵworkbench.service';\n\n/**\n * Renders the activity bar of a given workbench side.\n */\n@Component({\n  selector: 'wb-activity-bar',\n  templateUrl: './activity-bar.component.html',\n  styleUrls: ['./activity-bar.component.scss'],\n  imports: [\n    ActivityStackComponent,\n  ],\n  host: {\n    '[attr.data-align]': 'align()',\n  },\n})\nexport class ActivityBarComponent {\n\n  public readonly align = input.required<'left' | 'right'>();\n\n  protected readonly layout = inject(ɵWorkbenchService).layout;\n}\n","@let activityLayout = layout().activityLayout;\n\n@switch (align()) {\n  @case ('left') {\n    @if (activityLayout.toolbars.leftTop.activities.length) {\n      <wb-activity-stack [stack]=\"activityLayout.toolbars.leftTop\" data-docking-area=\"left-top\"/>\n    }\n\n    @if (activityLayout.toolbars.leftTop.activities.length && activityLayout.toolbars.leftBottom.activities.length) {\n      <hr/>\n    }\n\n    @if (activityLayout.toolbars.leftBottom.activities.length) {\n      <wb-activity-stack [stack]=\"activityLayout.toolbars.leftBottom\" data-docking-area=\"left-bottom\"/>\n    }\n    <div class=\"filler\"></div>\n    @if (activityLayout.toolbars.bottomLeft.activities.length) {\n      <wb-activity-stack [stack]=\"activityLayout.toolbars.bottomLeft\" data-docking-area=\"bottom-left\"/>\n    }\n  }\n  @case ('right') {\n    @if (activityLayout.toolbars.rightTop.activities.length) {\n      <wb-activity-stack [stack]=\"activityLayout.toolbars.rightTop\" data-docking-area=\"right-top\"/>\n    }\n\n    @if (activityLayout.toolbars.rightTop.activities.length && activityLayout.toolbars.rightBottom.activities.length) {\n      <hr>\n    }\n\n    @if (activityLayout.toolbars.rightBottom.activities.length) {\n      <wb-activity-stack [stack]=\"activityLayout.toolbars.rightBottom\" data-docking-area=\"right-bottom\"/>\n    }\n    <div class=\"filler\"></div>\n    @if (activityLayout.toolbars.bottomRight.activities.length) {\n      <wb-activity-stack [stack]=\"activityLayout.toolbars.bottomRight\" data-docking-area=\"bottom-right\"/>\n    }\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, inject, input, Signal} from '@angular/core';\nimport {ɵWorkbenchRouter} from '../../routing/ɵworkbench-router.service';\nimport {GridComponent} from '../../layout/grid/grid.component';\nimport {WorkbenchLayoutService} from '../../layout/workbench-layout.service';\nimport {ActivityId} from '../../workbench.identifiers';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {SciSashboxComponent, SciSashDirective} from '@scion/components/sashbox';\nimport {Objects} from '@scion/toolkit/util';\n\n/**\n * Displays two activities, split vertically or horizontally based on the panel's alignment.\n */\n@Component({\n  selector: 'wb-activity-panel',\n  templateUrl: './activity-panel.component.html',\n  styleUrls: ['./activity-panel.component.scss'],\n  imports: [\n    NgTemplateOutlet,\n    SciSashboxComponent,\n    SciSashDirective,\n    GridComponent,\n  ],\n  host: {\n    '[attr.data-panel]': 'panel()',\n  },\n})\nexport class ActivityPanelComponent {\n\n  /**\n   * Specifies the location of the panel.\n   */\n  public readonly panel = input.required<'left' | 'right' | 'bottom'>();\n\n  /**\n   * Specifies the first activity to display in the panel.\n   */\n  public readonly activityId1 = input.required<ActivityId | undefined>();\n\n  /**\n   * Specifies the second activity to display in the panel.\n   */\n  public readonly activityId2 = input.required<ActivityId | undefined>();\n\n  private readonly _workbenchLayoutService = inject(WorkbenchLayoutService);\n  private readonly _workbenchRouter = inject(ɵWorkbenchRouter);\n\n  protected readonly layout = this._workbenchLayoutService.layout;\n  protected readonly direction = this.computeDirection();\n  protected readonly sashSizes = this.computeSashSizes();\n\n  protected onSashStart(): void {\n    this._workbenchLayoutService.signalResizing(true);\n  }\n\n  protected onSashEnd({sash1, sash2}: {[sashKey: string]: number}): void {\n    this._workbenchLayoutService.signalResizing(false);\n\n    const ratio = sash1! / (sash1! + sash2!);\n    void this._workbenchRouter.navigate(layout => layout.setActivityPanelSplitRatio(this.panel(), ratio));\n  }\n\n  /**\n   * Computes the direction of the sashbox.\n   */\n  private computeDirection(): Signal<'row' | 'column'> {\n    return computed(() => this.panel() === 'bottom' ? 'row' : 'column');\n  }\n\n  /**\n   * Calculates the size of two sashes based on the given ratio.\n   */\n  private computeSashSizes(): Signal<{sash1: string; sash2: string}> {\n    return computed(() => {\n      const ratio = this.layout().activityLayout.panels[this.panel()].ratio;\n      // Important: `SciSashboxComponent` requires proportions to be >= 1. For this reason we cannot simply calculate [ratio, 1 - ratio].\n      if (ratio === 0) {\n        return {sash1: '0px', sash2: '1'};\n      }\n      if (ratio === 1) {\n        return {sash1: '1', sash2: '0px'};\n      }\n\n      return {\n        sash1: `${1 / (1 - ratio)}`,\n        sash2: `${1 / ratio}`,\n      };\n    }, {equal: Objects.isEqual});\n  }\n}\n","@if (activityId1() && activityId2()) {\n  <sci-sashbox [direction]=\"direction()\" (sashStart)=\"onSashStart()\" (sashEnd)=\"onSashEnd($event)\">\n    <ng-template sciSash [size]=\"sashSizes().sash1\" key=\"sash1\">\n      <ng-container *ngTemplateOutlet=\"activity_template; context: {$implicit: activityId1()}\"/>\n    </ng-template>\n\n    <ng-template sciSash [size]=\"sashSizes().sash2\" key=\"sash2\">\n      <ng-container *ngTemplateOutlet=\"activity_template; context: {$implicit: activityId2()}\"/>\n    </ng-template>\n  </sci-sashbox>\n} @else if (activityId1()) {\n  <ng-container *ngTemplateOutlet=\"activity_template; context: {$implicit: activityId1()}\"/>\n} @else if (activityId2()) {\n  <ng-container *ngTemplateOutlet=\"activity_template; context: {$implicit: activityId2()}\"/>\n}\n\n<ng-template #activity_template let-activityId>\n  <wb-grid [grid]=\"layout().grids[activityId]!\"\n           [attr.data-grid]=\"activityId\"\n           [gridDropZone]=\"{\n             dropRegionSize: .15,\n             dropPlaceholderSize: .15,\n             dropZoneAttributes: {'data-grid': activityId},\n           }\"/>\n</ng-template>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, inject, input} from '@angular/core';\nimport {ActivityBarComponent} from '../activity/activity-bar/activity-bar.component';\nimport {WorkbenchLayoutService} from './workbench-layout.service';\nimport {SciSashboxComponent, SciSashDirective} from '@scion/components/sashbox';\nimport {ActivityPanelComponent} from '../activity/activity-panel/activity-panel.component';\nimport {GridComponent} from './grid/grid.component';\nimport {ɵWorkbenchRouter} from '../routing/ɵworkbench-router.service';\nimport {ɵWorkbenchLayout} from './ɵworkbench-layout';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {WorkbenchService} from '../workbench.service';\nimport {ViewDropZoneDirective, WbViewDropEvent} from '../view-dnd/view-drop-zone.directive';\nimport {GridDropTargets} from '../view-dnd/grid-drop-targets.util';\nimport {ViewDragService} from '../view-dnd/view-drag.service';\nimport {WORKBENCH_ID} from '../workbench.identifiers';\nimport {WorkbenchPerspectiveService} from '../perspective/workbench-perspective.service';\nimport {MAIN_AREA} from './workbench-layout';\nimport {WorkbenchPortalOutletDirective} from '../portal/workbench-portal-outlet.directive';\nimport {WorkbenchDesktop} from '../desktop/workbench-desktop.model';\n\n@Component({\n  selector: 'wb-layout',\n  templateUrl: './layout.component.html',\n  styleUrls: ['./layout.component.scss'],\n  imports: [\n    ActivityBarComponent,\n    SciSashDirective,\n    SciSashboxComponent,\n    ActivityPanelComponent,\n    GridComponent,\n    NgTemplateOutlet,\n    ViewDropZoneDirective,\n    WorkbenchPortalOutletDirective,\n  ],\n  host: {\n    '[@.disabled]': 'perspectiveService.switchingPerspective() || perspectiveService.resettingPerspective()',\n  },\n})\nexport class LayoutComponent {\n\n  public readonly layout = input.required<ɵWorkbenchLayout>();\n\n  private readonly _workbenchLayoutService = inject(WorkbenchLayoutService);\n  private readonly _workbenchRouter = inject(ɵWorkbenchRouter);\n  private readonly _workbenchId = inject(WORKBENCH_ID);\n  private readonly _viewDragService = inject(ViewDragService);\n  private readonly _panels = computed(() => this.layout().activityLayout.panels);\n\n  protected readonly desktop = inject(WorkbenchDesktop);\n  protected readonly toolbars = computed(() => this.layout().activityLayout.toolbars);\n\n  protected readonly leftActivityPanel = computed(() => this.toolbars().leftTop.activeActivityId || this.toolbars().leftBottom.activeActivityId ? this._panels().left : null);\n  protected readonly rightActivityPanel = computed(() => this.toolbars().rightTop.activeActivityId || this.toolbars().rightBottom.activeActivityId ? this._panels().right : null);\n  protected readonly bottomActivityPanel = computed(() => this.toolbars().bottomLeft.activeActivityId || this.toolbars().bottomRight.activeActivityId ? this._panels().bottom : null);\n\n  protected readonly leftActivityBarVisible = computed(() => this.toolbars().leftTop.activities.length || this.toolbars().leftBottom.activities.length || this.toolbars().bottomLeft.activities.length);\n  protected readonly rightActivityBarVisible = computed(() => this.toolbars().rightTop.activities.length || this.toolbars().rightBottom.activities.length || this.toolbars().bottomRight.activities.length);\n\n  protected readonly panelAlignment = inject(WorkbenchService).settings.panelAlignment;\n  protected readonly panelAnimation = inject(WorkbenchService).settings.panelAnimation;\n\n  protected readonly perspectiveService = inject(WorkbenchPerspectiveService);\n\n  /**\n   * Determines if a view can be dropped to the main grid.\n   */\n  protected readonly canDrop = inject(ViewDragService).canDrop(computed(() => this.layout().grids.main));\n\n  /**\n   * Determines if dropping at the boundaries of the main grid is enabled.\n   *\n   * Enabled for layouts without activities or layouts with activities but no main area.\n   */\n  protected readonly canDropInMainGrid = computed(() => {\n    return !this.layout().hasActivities() || this.layout().parts({grid: 'main'}).some(part => part.id !== MAIN_AREA);\n  });\n\n  protected onSashStart(): void {\n    this._workbenchLayoutService.signalResizing(true);\n  }\n\n  protected onHorizontalSashEnd({left, right}: {[sashKey: string]: number}): void {\n    this._workbenchLayoutService.signalResizing(false);\n    void this._workbenchRouter.navigate(layout => layout\n      .modify(layout => left !== undefined ? layout.setActivityPanelSize('left', left) : layout)\n      .modify(layout => right !== undefined ? layout.setActivityPanelSize('right', right) : layout),\n    );\n  }\n\n  protected onVerticalSashEnd({bottom}: {[sashKey: string]: number}): void {\n    this._workbenchLayoutService.signalResizing(false);\n    void this._workbenchRouter.navigate(layout => layout.setActivityPanelSize('bottom', bottom!));\n  }\n\n  protected onDesktopViewDrop(event: WbViewDropEvent): void {\n    this._viewDragService.dispatchViewMoveEvent({\n      source: {\n        workbenchId: event.dragData.workbenchId,\n        partId: event.dragData.partId,\n        viewId: event.dragData.viewId,\n        alternativeViewId: event.dragData.alternativeViewId,\n        navigation: event.dragData.navigation,\n        classList: event.dragData.classList,\n      },\n      target: GridDropTargets.resolve({\n        grid: this.layout().grids.main,\n        workbenchId: this._workbenchId,\n        dropRegion: event.dropRegion,\n      }),\n      dragData: event.dragData,\n    });\n  }\n}\n","<!-- Left Activity Bar -->\n@if (leftActivityBarVisible()) {\n  <wb-activity-bar [align]=\"'left'\"/>\n}\n\n<main>\n  @switch (panelAlignment()) {\n    @case ('left') {\n      <ng-container *ngTemplateOutlet=\"layout_align_left\"/>\n    }\n    @case ('right') {\n      <ng-container *ngTemplateOutlet=\"layout_align_right\"/>\n    }\n    @case ('center') {\n      <ng-container *ngTemplateOutlet=\"layout_center\"/>\n    }\n    @case ('justify') {\n      <ng-container *ngTemplateOutlet=\"layout_justify\"/>\n    }\n  }\n</main>\n\n<!-- Right Activity Bar -->\n@if (rightActivityBarVisible()) {\n  <wb-activity-bar [align]=\"'right'\"/>\n}\n\n<!-- Layout with bottom panel alignment left -->\n<ng-template #layout_align_left>\n  <!-- @formatter:off -->\n  <!-- +---+------------+---+ -->\n  <!-- | L |            | R | -->\n  <!-- | E |    MAIN    | I | -->\n  <!-- | F |    GRID    | G | -->\n  <!-- | T |            | H | -->\n  <!-- +---+------------+ T | -->\n  <!-- |       BOTTOM   |   | -->\n  <!-- +----------------+---+ -->\n  <!-- @formatter:on -->\n  <sci-sashbox [direction]=\"'row'\" (sashStart)=\"onSashStart()\" (sashEnd)=\"onHorizontalSashEnd($event)\">\n    <ng-template sciSash>\n      <sci-sashbox [direction]=\"'column'\" (sashStart)=\"onSashStart()\" (sashEnd)=\"onVerticalSashEnd($event)\">\n        <ng-template sciSash>\n          <sci-sashbox [direction]=\"'row'\" (sashStart)=\"onSashStart()\" (sashEnd)=\"onHorizontalSashEnd($event)\">\n            <!-- Left Activity Panel -->\n            @if (leftActivityPanel(); as panel) {\n              <ng-template sciSash [size]=\"`${panel.width}px`\" key=\"left\" [animate]=\"panelAnimation()\">\n                <wb-activity-panel [panel]=\"'left'\" [activityId1]=\"toolbars().leftTop.activeActivityId\" [activityId2]=\"toolbars().leftBottom.activeActivityId\"/>\n              </ng-template>\n            }\n            <!-- Main Grid -->\n            <ng-template sciSash>\n              <ng-container *ngTemplateOutlet=\"main_grid\"/>\n            </ng-template>\n          </sci-sashbox>\n        </ng-template>\n        <!-- Bottom Activity Panel -->\n        @if (bottomActivityPanel(); as panel) {\n          <ng-template sciSash [size]=\"`${panel.height}px`\" key=\"bottom\" [animate]=\"panelAnimation()\">\n            <wb-activity-panel [panel]=\"'bottom'\" [activityId1]=\"toolbars().bottomLeft.activeActivityId\" [activityId2]=\"toolbars().bottomRight.activeActivityId\"/>\n          </ng-template>\n        }\n      </sci-sashbox>\n    </ng-template>\n    <!-- Right Activity Panel -->\n    @if (rightActivityPanel(); as panel) {\n      <ng-template sciSash [size]=\"`${panel.width}px`\" key=\"right\" [animate]=\"panelAnimation()\">\n        <wb-activity-panel [panel]=\"'right'\" [activityId1]=\"toolbars().rightTop.activeActivityId\" [activityId2]=\"toolbars().rightBottom.activeActivityId\"/>\n      </ng-template>\n    }\n  </sci-sashbox>\n</ng-template>\n\n<!-- Layout with bottom panel alignment right -->\n<ng-template #layout_align_right>\n  <!-- @formatter:off -->\n  <!-- +---+------------+---+ -->\n  <!-- | L |            | R | -->\n  <!-- | E |    MAIN    | I | -->\n  <!-- | F |    GRID    | G | -->\n  <!-- | T |            | H | -->\n  <!-- |   |            | T | -->\n  <!-- |   +------------+---| -->\n  <!-- |   |    BOTTOM      | -->\n  <!-- +---+----------------+ -->\n  <!-- @formatter:on -->\n  <sci-sashbox [direction]=\"'row'\" (sashStart)=\"onSashStart()\" (sashEnd)=\"onHorizontalSashEnd($event)\">\n    <!-- Left Activity Panel -->\n    @if (leftActivityPanel(); as panel) {\n      <ng-template sciSash [size]=\"`${panel.width}px`\" key=\"left\" [animate]=\"panelAnimation()\">\n        <wb-activity-panel [panel]=\"'left'\" [activityId1]=\"toolbars().leftTop.activeActivityId\" [activityId2]=\"toolbars().leftBottom.activeActivityId\"/>\n      </ng-template>\n    }\n    <ng-template sciSash>\n      <sci-sashbox [direction]=\"'column'\" (sashStart)=\"onSashStart()\" (sashEnd)=\"onVerticalSashEnd($event)\">\n        <ng-template sciSash>\n          <sci-sashbox [direction]=\"'row'\" (sashStart)=\"onSashStart()\" (sashEnd)=\"onHorizontalSashEnd($event)\">\n            <!-- Main Grid -->\n            <ng-template sciSash>\n              <ng-container *ngTemplateOutlet=\"main_grid\"/>\n            </ng-template>\n            <!-- Right Activity Panel -->\n            @if (rightActivityPanel(); as panel) {\n              <ng-template sciSash [size]=\"`${panel.width}px`\" key=\"right\" [animate]=\"panelAnimation()\">\n                <wb-activity-panel [panel]=\"'right'\" [activityId1]=\"toolbars().rightTop.activeActivityId\" [activityId2]=\"toolbars().rightBottom.activeActivityId\"/>\n              </ng-template>\n            }\n          </sci-sashbox>\n        </ng-template>\n        <!-- Bottom Activity Panel -->\n        @if (bottomActivityPanel(); as panel) {\n          <ng-template sciSash [size]=\"`${panel.height}px`\" key=\"bottom\" [animate]=\"panelAnimation()\">\n            <wb-activity-panel [panel]=\"'bottom'\" [activityId1]=\"toolbars().bottomLeft.activeActivityId\" [activityId2]=\"toolbars().bottomRight.activeActivityId\"/>\n          </ng-template>\n        }\n      </sci-sashbox>\n    </ng-template>\n  </sci-sashbox>\n</ng-template>\n\n<!-- Layout with bottom panel alignment center -->\n<ng-template #layout_center>\n  <!-- @formatter:off -->\n  <!-- +---+------------+---+ -->\n  <!-- | L |    MAIN    | R | -->\n  <!-- | E |    GRID    | I | -->\n  <!-- | F |            | G | -->\n  <!-- | T +------------+ H | -->\n  <!-- |   |   BOTTOM   | T | -->\n  <!-- +---+------------+---+ -->\n  <!-- @formatter:on -->\n  <sci-sashbox [direction]=\"'row'\" (sashStart)=\"onSashStart()\" (sashEnd)=\"onHorizontalSashEnd($event)\">\n    <!-- Left Activity Panel -->\n    @if (leftActivityPanel(); as panel) {\n      <ng-template sciSash [size]=\"`${panel.width}px`\" key=\"left\" [animate]=\"panelAnimation()\">\n        <wb-activity-panel [panel]=\"'left'\" [activityId1]=\"toolbars().leftTop.activeActivityId\" [activityId2]=\"toolbars().leftBottom.activeActivityId\"/>\n      </ng-template>\n    }\n    <ng-template sciSash>\n      <sci-sashbox [direction]=\"'column'\" (sashStart)=\"onSashStart()\" (sashEnd)=\"onVerticalSashEnd($event)\">\n        <!-- Main Grid -->\n        <ng-template sciSash>\n          <ng-container *ngTemplateOutlet=\"main_grid\"/>\n        </ng-template>\n        <!-- Bottom Activity Panel -->\n        @if (bottomActivityPanel(); as panel) {\n          <ng-template sciSash [size]=\"`${panel.height}px`\" key=\"bottom\" [animate]=\"panelAnimation()\">\n            <wb-activity-panel [panel]=\"'bottom'\" [activityId1]=\"toolbars().bottomLeft.activeActivityId\" [activityId2]=\"toolbars().bottomRight.activeActivityId\"/>\n          </ng-template>\n        }\n      </sci-sashbox>\n    </ng-template>\n    <!-- Right Activity Panel -->\n    @if (rightActivityPanel(); as panel) {\n      <ng-template sciSash [size]=\"`${panel.width}px`\" key=\"right\" [animate]=\"panelAnimation()\">\n        <wb-activity-panel [panel]=\"'right'\" [activityId1]=\"toolbars().rightTop.activeActivityId\" [activityId2]=\"toolbars().rightBottom.activeActivityId\"/>\n      </ng-template>\n    }\n  </sci-sashbox>\n</ng-template>\n\n<!-- Layout with bottom panel alignment justify -->\n<ng-template #layout_justify>\n  <!-- @formatter:off -->\n  <!-- +---+------------+---+ -->\n  <!-- | L |            | R | -->\n  <!-- | E |    MAIN    | I | -->\n  <!-- | F |    GRID    | G | -->\n  <!-- | T |            | H | -->\n  <!-- |   |            | T | -->\n  <!-- +---+------------+---+ -->\n  <!-- |       BOTTOM       | -->\n  <!-- +--------------------+ -->\n  <!-- @formatter:on -->\n  <sci-sashbox [direction]=\"'column'\" (sashStart)=\"onSashStart()\" (sashEnd)=\"onVerticalSashEnd($event)\">\n    <ng-template sciSash>\n      <sci-sashbox [direction]=\"'row'\" (sashStart)=\"onSashStart()\" (sashEnd)=\"onHorizontalSashEnd($event)\">\n        <!-- Left Activity Panel -->\n        @if (leftActivityPanel(); as panel) {\n          <ng-template sciSash [size]=\"`${panel.width}px`\" key=\"left\" [animate]=\"panelAnimation()\">\n            <wb-activity-panel [panel]=\"'left'\" [activityId1]=\"toolbars().leftTop.activeActivityId\" [activityId2]=\"toolbars().leftBottom.activeActivityId\"/>\n          </ng-template>\n        }\n        <!-- Main Grid -->\n        <ng-template sciSash>\n          <ng-container *ngTemplateOutlet=\"main_grid\"/>\n        </ng-template>\n        <!-- Right Activity Panel -->\n        @if (rightActivityPanel(); as panel) {\n          <ng-template sciSash [size]=\"`${panel.width}px`\" key=\"right\" [animate]=\"panelAnimation()\">\n            <wb-activity-panel [panel]=\"'right'\" [activityId1]=\"toolbars().rightTop.activeActivityId\" [activityId2]=\"toolbars().rightBottom.activeActivityId\"/>\n          </ng-template>\n        }\n      </sci-sashbox>\n    </ng-template>\n    <!-- Bottom Activity Panel -->\n    @if (bottomActivityPanel(); as panel) {\n      <ng-template sciSash [size]=\"`${panel.height}px`\" key=\"bottom\" [animate]=\"panelAnimation()\">\n        <wb-activity-panel [panel]=\"'bottom'\" [activityId1]=\"toolbars().bottomLeft.activeActivityId\" [activityId2]=\"toolbars().bottomRight.activeActivityId\"/>\n      </ng-template>\n    }\n  </sci-sashbox>\n</ng-template>\n\n<!-- Main Grid -->\n<ng-template #main_grid>\n  @if (layout().grids.main.root.visible) {\n    <wb-grid [grid]=\"layout().grids.main\"\n             [gridDropZone]=\"canDropInMainGrid() && {\n               dropRegionSize: 50,\n               dropPlaceholderSize: 50,\n               dropZoneAttributes: {'data-grid': 'main'}\n             }\"\n             [attr.data-grid]=\"'main'\"/>\n  } @else {\n    <div wbViewDropZone\n         [wbViewDropZoneRegions]=\"canDrop() && {center: true, north: false, south: false, west: false, east: false}\"\n         [wbViewDropZoneAttributes]=\"{'data-desktop': ''}\"\n         (wbViewDropZoneDrop)=\"onDesktopViewDrop($event)\"\n         class=\"desktop\">\n      <ng-container *wbPortalOutlet=\"desktop.slot.portal; destroyOnDetach: false\"/>\n    </div>\n  }\n</ng-template>\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectorRef, Component, DestroyRef, DOCUMENT, effect, ElementRef, inject, NgZone, Provider, viewChild, ViewContainerRef} from '@angular/core';\nimport {IFRAME_OVERLAY_HOST, VIEW_DROP_ZONE_OVERLAY_HOST, WORKBENCH_COMPONENT_REF} from './workbench-element-references';\nimport {WorkbenchLauncher} from './startup/workbench-launcher.service';\nimport {WorkbenchStartup} from './startup/workbench-startup.service';\nimport {WorkbenchConfig} from './workbench-config';\nimport {SplashComponent} from './startup/splash/splash.component';\nimport {Logger, LoggerNames} from './logging';\nimport {NgComponentOutlet} from '@angular/common';\nimport {NotificationListComponent} from './notification/notification-list.component';\nimport {GLASS_PANE_BLOCKABLE, GLASS_PANE_OPTIONS, GLASS_PANE_TARGET_ELEMENT, GlassPaneDirective, GlassPaneOptions} from './glass-pane/glass-pane.directive';\nimport {WorkbenchDialogRegistry} from './dialog/workbench-dialog.registry';\nimport {Blockable} from './glass-pane/blockable';\nimport {WORKBENCH_OUTLET} from './routing/workbench-auxiliary-route-installer.service';\nimport {NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router} from '@angular/router';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {LayoutComponent} from './layout/layout.component';\nimport {ɵWorkbenchService} from './ɵworkbench.service';\nimport {fromEvent} from 'rxjs';\nimport {ɵWorkbenchRouter} from './routing/ɵworkbench-router.service';\nimport {subscribeIn} from '@scion/toolkit/operators';\nimport {filter} from 'rxjs/operators';\n\n/**\n * Main entry point component of the SCION Workbench.\n */\n@Component({\n  selector: 'wb-workbench',\n  templateUrl: './workbench.component.html',\n  styleUrls: ['./workbench.component.scss'],\n  imports: [\n    NgComponentOutlet,\n    NotificationListComponent,\n    GlassPaneDirective,\n    LayoutComponent,\n  ],\n  viewProviders: [\n    configureWorkbenchGlassPane(),\n  ],\n})\nexport class WorkbenchComponent {\n\n  private readonly _workbenchLauncher = inject(WorkbenchLauncher);\n  private readonly _logger = inject(Logger);\n  private readonly _workbenchRouter = inject(ɵWorkbenchRouter);\n\n  private readonly _iframeOverlayHost = viewChild('iframe_overlay_host', {read: ViewContainerRef});\n  private readonly _viewDropZoneOverlayHost = viewChild('view_drop_zone_overlay_host', {read: ViewContainerRef});\n\n  /** Splash to display during workbench startup. */\n  protected readonly splash = inject(WorkbenchConfig).splashComponent ?? SplashComponent;\n  protected readonly workbenchStartup = inject(WorkbenchStartup);\n  protected readonly workbenchService = inject(ɵWorkbenchService);\n\n  constructor() {\n    this._logger.debug(() => 'Constructing WorkbenchComponent.', LoggerNames.LIFECYCLE);\n    this.throwOnCircularLoad();\n    this.startWorkbench();\n    this.disableChangeDetectionDuringNavigation();\n    this.provideWorkbenchElementReferences();\n    this.installMaximizeShortcutListener();\n  }\n\n  /**\n   * Toggles layout maximization by pressing Ctrl+Shift+F12.\n   */\n  private installMaximizeShortcutListener(): void {\n    const zone = inject(NgZone);\n    fromEvent<KeyboardEvent>(window, 'keydown', {capture: true}) // capturing phase for a higher precedence\n      .pipe(\n        subscribeIn(fn => zone.runOutsideAngular(fn)),\n        filter(event => event.ctrlKey && event.shiftKey && event.key === 'F12'),\n        takeUntilDestroyed(),\n      )\n      .subscribe(event => {\n        event.preventDefault();\n        void this._workbenchRouter.navigate(layout => layout.toggleMaximized());\n      });\n  }\n\n  /**\n   * Starts the SCION Workbench. Has no effect if already started, e.g., in an app initializer or route guard.\n   */\n  private startWorkbench(): void {\n    if (!this.workbenchStartup.done()) {\n      this._workbenchLauncher.launch().catch((error: unknown) => this._logger.error('Failed to start SCION Workbench', error));\n    }\n  }\n\n  /**\n   * Disables change detection during navigation to avoid partial DOM updates of the workbench layout\n   * if the navigation is asynchronous (e.g., because of lazy loading, async guards, or resolvers).\n   */\n  private disableChangeDetectionDuringNavigation(): void {\n    const changeDetector = inject(ChangeDetectorRef);\n\n    inject(Router).events\n      .pipe(takeUntilDestroyed())\n      .subscribe(event => {\n        if (event instanceof NavigationStart) {\n          changeDetector.detach();\n        }\n        else if (event instanceof NavigationEnd || event instanceof NavigationError || event instanceof NavigationCancel) {\n          changeDetector.reattach();\n        }\n      });\n  }\n\n  /**\n   * Initializes tokens to inject references to workbench elements.\n   */\n  private provideWorkbenchElementReferences(): void {\n    // Provide reference to the workbench element.\n    const workbenchComponentRef = inject(WORKBENCH_COMPONENT_REF);\n    workbenchComponentRef.set(inject(ViewContainerRef));\n    inject(DestroyRef).onDestroy(() => workbenchComponentRef.set(undefined));\n\n    // Provide reference to the iframe overlay host.\n    const iframeOverlayHost = inject(IFRAME_OVERLAY_HOST);\n    effect(() => iframeOverlayHost.set(this._iframeOverlayHost()));\n    inject(DestroyRef).onDestroy(() => iframeOverlayHost.set(undefined));\n\n    // Provide reference to the view drop zone overlay host.\n    const viewDropZoneOverlayHost = inject(VIEW_DROP_ZONE_OVERLAY_HOST);\n    effect(() => viewDropZoneOverlayHost.set(this._viewDropZoneOverlayHost()));\n    inject(DestroyRef).onDestroy(() => viewDropZoneOverlayHost.set(undefined));\n  }\n\n  /**\n   * Throws if loading the workbench recursively.\n   */\n  private throwOnCircularLoad(): void {\n    const outlet = inject(WORKBENCH_OUTLET, {optional: true});\n    if (!outlet) {\n      return;\n    }\n\n    throw Error(`[WorkbenchError] Circular loading of the workbench component detected in workbench outlet '${outlet}'. Did you forget to add the CanMatch guard 'canMatchWorkbenchOutlet(false)' to the application's empty-path default route?`);\n  }\n}\n\n/**\n * Blocks the workbench or the browser's viewport when opening an application-modal dialog.\n */\nfunction configureWorkbenchGlassPane(): Provider[] {\n  return [\n    {\n      provide: GLASS_PANE_BLOCKABLE,\n      useFactory: (): Blockable => ({\n        blockedBy: inject(WorkbenchDialogRegistry).top(),\n      }),\n    },\n    {\n      provide: GLASS_PANE_TARGET_ELEMENT,\n      useFactory: () => {\n        if (inject(WorkbenchConfig).dialog?.modalityScope === 'viewport') {\n          return inject(DOCUMENT).body;\n        }\n        else {\n          return inject(ElementRef);\n        }\n      },\n    },\n    {\n      provide: GLASS_PANE_OPTIONS,\n      useFactory: (): GlassPaneOptions => ({cssClass: 'e2e-workbench'}),\n    },\n  ];\n}\n","@if (workbenchStartup.done()) {\n  <div class=\"stacking-context-barrier\" wbGlassPane>\n    <wb-layout [layout]=\"workbenchService.layout()\"/>\n\n    <!-- Achor to attach iframes of embedded microfrontends -->\n    <ng-container #iframe_overlay_host/>\n  </div>\n\n  <!-- Anchor to attach the visual placeholder when dragging a view over a valid drop zone -->\n  <div #view_drop_zone_overlay_host class=\"view-drop-zone-overlay-host\"></div>\n\n  <!-- Notifications -->\n  <wb-notification-list/>\n} @else {\n  <ng-container *ngComponentOutlet=\"splash\"/>\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\nimport {ɵWorkbenchLayoutFactory} from './ɵworkbench-layout.factory';\nimport {MAIN_AREA, PartExtras, WorkbenchLayout} from './workbench-layout';\n\n/**\n * Factory for creating a {@link WorkbenchLayout}.\n */\n@Injectable({providedIn: 'root', useExisting: ɵWorkbenchLayoutFactory})\nexport abstract class WorkbenchLayoutFactory {\n\n  /**\n   * Creates a layout with given part.\n   *\n   * @param id - The id of the part. Use {@link MAIN_AREA} to add the main area.\n   * @param extras - Controls how to add the part to the layout.\n   * @param extras.activate - Controls whether to activate the part. If not set, defaults to `false`.\n   * @return layout with the part added.\n   */\n  public abstract addPart(id: string | MAIN_AREA, extras?: PartExtras): WorkbenchLayout;\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {type WorkbenchLayout, type ReferencePart, MAIN_AREA, type DockingArea, type PartExtras, type DockedPartExtras, type WorkbenchLayoutFn} from './workbench-layout';\nexport {MAIN_AREA_INITIAL_PART_ID} from './ɵworkbench-layout';\nexport {WorkbenchLayoutFactory} from './workbench-layout.factory';\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {DestroyRef, Directive, inject, TemplateRef} from '@angular/core';\nimport {WorkbenchDesktop} from './workbench-desktop.model';\n\n/**\n * Directive to add a desktop to the workbench.\n *\n * The desktop is displayed when no view is open and the layout does not contain a navigated part.\n *\n * A desktop can provide instructions for working with the application, display a welcome page, or provide links to open views.\n *\n * Usage:\n * Add this directive to an `<ng-template>` child of the `<wb-workbench>` component. The template content is used as desktop content.\n *\n * ```html\n * <wb-workbench>\n *   <ng-template wbDesktop>\n *     Welcome\n *   </ng-template>\n * </wb-workbench>\n * ```\n *\n * > Using `@if` allows displaying the desktop based on a condition, e.g. the active perspective.\n *\n * For layouts with a main area, it is recommended to navigate the main area part instead:\n * ```ts\n * import {MAIN_AREA, provideWorkbench} from '@scion/workbench';\n *\n * provideWorkbench({\n *   layout: factory => factory\n *     .addPart(MAIN_AREA)\n *     .navigatePart(MAIN_AREA, ['path/to/desktop'])\n * });\n * ```\n */\n@Directive({selector: 'ng-template[wbDesktop]'})\nexport class WorkbenchDesktopDirective {\n\n  constructor() {\n    const template = inject(TemplateRef) as TemplateRef<void>;\n    const desktop = inject(WorkbenchDesktop);\n\n    // Register the desktop template.\n    desktop.template.set(template);\n\n    // Unregister the desktop template when destroyed, but only if no other template has been registered in the meantime.\n    inject(DestroyRef).onDestroy(() => {\n      if (desktop.template() === template) {\n        desktop.template.set(undefined);\n      }\n    });\n  }\n}\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {WorkbenchDesktopDirective} from './desktop.directive';\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {type WorkbenchPerspective, type WorkbenchPerspectives, type WorkbenchPerspectiveDefinition, type WorkbenchPerspectiveSelectionFn} from './workbench-perspective.model';\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {DestroyRef, Directive, inject, input, output, TemplateRef} from '@angular/core';\nimport {WorkbenchService} from '../../workbench.service';\nimport {WorkbenchView} from '../../view/workbench-view.model';\n\n/**\n * Directive to add a menu item to the context menu of a view.\n *\n * Right-clicking on a view tab opens a context menu to interact with the view and its content.\n *\n * Usage:\n * Add this directive to an `<ng-template>`. The template content is used as the menu item content. The menu item shares the lifecycle of its embedding context.\n *\n * ```html\n * <ng-template wbViewMenuItem [accelerator]=\"['ctrl', 'alt', '1']\" (action)=\"...\">\n *   ...\n * </ng-template>\n * ```\n *\n * The {@link WorkbenchView} is available as the default template variable (`let-view`).\n *\n * ```html\n * <ng-template wbViewMenuItem let-view>\n *   ...\n * </ng-template>\n * ```\n *\n * Menu items are context-sensitive:\n * - Declaring the menu item in a view's template displays it only in the context menu of that view.\n * - Declaring the menu item outside a view context, such as within `<wb-workbench>`, displays it in the context menu of every view.\n *\n * A predicate can be used to match a specific context, such as a particular view or condition.\n *\n * ```html\n * <ng-template wbViewMenuItem [canMatch]=\"...\">\n *   ...\n * </ng-template>\n * ```\n *\n * Alternatively, menu items can be added using a factory function and registered via {@link WorkbenchService.registerViewMenuItem}.\n */\n@Directive({selector: 'ng-template[wbViewMenuItem]'})\nexport class WorkbenchViewMenuItemDirective {\n\n  /**\n   * Binds keyboard accelerator(s) to the menu item, e.g., ['ctrl', 'alt', 1].\n   *\n   * Supported modifiers are 'ctrl', 'shift', 'alt' and 'meta'.\n   */\n  public readonly accelerator = input<string[] | undefined>();\n\n  /**\n   * Enables grouping of menu items.\n   */\n  public readonly group = input<string | undefined>();\n\n  /**\n   * Controls if the menu item is disabled. Defaults to `false`.\n   */\n  public readonly disabled = input<boolean>();\n\n  /**\n   * Predicate to match a specific context, such as a particular view or condition. Defaults to any context.\n   *\n   * The function:\n   * - Can call `inject` to get any required dependencies.\n   * - Runs in a reactive context and is called again when tracked signals change.\n   *   Use Angular's `untracked` function to execute code outside this reactive context.\n   */\n  public readonly canMatch = input<(view: WorkbenchView) => boolean>();\n\n  /**\n   * Specifies CSS class(es) to add to the menu item, e.g., to locate the menu item in tests.\n   */\n  public readonly cssClass = input<string | string[] | undefined>();\n\n  /**\n   * Emits when the menu item is clicked.\n   *\n   * The function can call `inject` to get any required dependencies.\n   */\n  public readonly action = output<WorkbenchView>();\n\n  constructor() {\n    this.registerMenuItem();\n  }\n\n  private registerMenuItem(): void {\n    const template = inject(TemplateRef) as TemplateRef<void>;\n    const workbenchService = inject(WorkbenchService);\n    const context = {\n      view: inject(WorkbenchView, {optional: true}),\n    };\n\n    const action = workbenchService.registerViewMenuItem((view: WorkbenchView) => {\n      if (context.view && context.view.id !== view.id) {\n        return null;\n      }\n      if (this.canMatch() && !this.canMatch()!(view)) {\n        return null;\n      }\n\n      return {\n        content: template,\n        accelerator: this.accelerator(),\n        group: this.group(),\n        cssClass: this.cssClass(),\n        disabled: this.disabled(),\n        onAction: () => this.action.emit(view),\n      };\n    });\n\n    inject(DestroyRef).onDestroy(() => action.dispose());\n  }\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {DestroyRef, Directive, inject, Injector, input, TemplateRef} from '@angular/core';\nimport {WorkbenchService} from '../../workbench.service';\nimport {WorkbenchPart} from '../workbench-part.model';\nimport {ɵWorkbenchView} from '../../view/ɵworkbench-view.model';\nimport {ɵWorkbenchPart} from '../ɵworkbench-part.model';\n\n/**\n * Directive to add an action to a part.\n *\n * Part actions are displayed in the part bar, enabling interaction with the part and its content. Actions can be aligned to the left or right.\n *\n * Usage:\n * Add this directive to an `<ng-template>`. The template content is used as the action content. The action shares the lifecycle of its embedding context.\n *\n * ```html\n * <ng-template wbPartAction>\n *   ...\n * </ng-template>\n * ```\n *\n * The {@link WorkbenchPart} is available as the default template variable (`let-part`).\n *\n * ```html\n * <ng-template wbPartAction let-part>\n *   ...\n * </ng-template>\n * ```\n *\n * Part actions are context-sensitive:\n * - Declaring the action in a part's template displays it only in that part.\n * - Declaring the action in a view's template displays it only when that view is active.\n * - Declaring the action outside a part and view context, such as within `<wb-workbench>`, displays it in every part.\n *\n * A predicate can be used to match a specific context, such as a particular part or condition.\n *\n * ```html\n * <ng-template wbPartAction [canMatch]=\"...\">\n *   ...\n * </ng-template>\n * ```\n *\n * Alternatively, actions can be added using a factory function and registered via {@link WorkbenchService.registerPartAction}.\n */\n@Directive({selector: 'ng-template[wbPartAction]'})\nexport class WorkbenchPartActionDirective {\n\n  private readonly _injector = inject(Injector);\n\n  /**\n   * Specifies where to place this action in the part bar. Defaults to `end`.\n   */\n  public readonly align = input<'start' | 'end' | undefined>();\n\n  /**\n   * Predicate to match a specific context, such as a particular part or condition. Defaults to any context.\n   *\n   * The function:\n   * - Can call `inject` to get any required dependencies.\n   * - Runs in a reactive context and is called again when tracked signals change.\n   *   Use Angular's `untracked` function to execute code outside this reactive context.\n   */\n  public readonly canMatch = input<(part: WorkbenchPart) => boolean>();\n\n  /**\n   * Specifies CSS class(es) to add to the action, e.g., to locate the action in tests.\n   */\n  public readonly cssClass = input<string | string[] | undefined>();\n\n  constructor() {\n    this.registerPartAction();\n  }\n\n  private registerPartAction(): void {\n    const template = inject(TemplateRef) as TemplateRef<void>;\n    const workbenchService = inject(WorkbenchService);\n    const context = {\n      view: inject(ɵWorkbenchView, {optional: true}),\n      part: inject(ɵWorkbenchPart, {optional: true}),\n    };\n\n    const action = workbenchService.registerPartAction((part: WorkbenchPart) => {\n      if (context.part && context.part !== part) {\n        return null;\n      }\n      if (context.part && !context.part.slot.portal.attached()) {\n        return null;\n      }\n      if (context.view && context.view !== part.activeView()) {\n        return null;\n      }\n      if (this.canMatch() && !this.canMatch()!(part)) {\n        return null;\n      }\n\n      return {\n        content: template,\n        align: this.align(),\n        cssClass: this.cssClass(),\n        injector: this._injector,\n      };\n    });\n\n    inject(DestroyRef).onDestroy(() => action.dispose());\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {WorkbenchViewMenuItemDirective} from './view-context-menu/view-menu-item.directive';\nexport {WorkbenchPartActionDirective} from './part-action-bar/part-action.directive';\nexport {WorkbenchPart, type WorkbenchPartNavigation} from './workbench-part.model';\nexport {WORKBENCH_PART_CONTEXT} from './workbench-part-context.provider';\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {WorkbenchView, type WorkbenchViewNavigation} from './workbench-view.model';\nexport {WORKBENCH_VIEW_CONTEXT} from './workbench-view-context.provider';\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Directive, ElementRef, HostListener, inject, input, signal, Signal} from '@angular/core';\nimport {WorkbenchRouter} from './workbench-router.service';\nimport {LocationStrategy} from '@angular/common';\nimport {ActivatedRoute, NavigationEnd, Router} from '@angular/router';\nimport {WorkbenchView} from '../view/workbench-view.model';\nimport {combineLatestWith, filter, map, startWith, switchMap} from 'rxjs/operators';\nimport {Commands, WorkbenchNavigationExtras} from './routing.model';\nimport {Arrays, Defined} from '@scion/toolkit/util';\nimport {toObservable, toSignal} from '@angular/core/rxjs-interop';\nimport {createNavigationFromCommands, ɵWorkbenchRouter} from './ɵworkbench-router.service';\n\n/**\n * Like the Angular 'RouterLink' directive but with functionality to navigate a view.\n *\n * Use this directive to navigate the current view. If the user presses the CTRL key (Mac: ⌘, Windows: ⊞), this directive will open a new view.\n *\n * ```html\n * <a [wbRouterLink]=\"['../path/to/view']\">Link</a>\n * ```\n *\n * You can override the default behavior by setting an explicit navigation target in navigation extras.\n *\n * ```html\n * <a [wbRouterLink]=\"['../path/to/view']\" [wbRouterLinkExtras]=\"{target: 'blank'}\">Link</a>\n * ```\n *\n * By default, navigation is relative to the currently activated route, if any.\n *\n * Prepend the path with a forward slash '/' to navigate absolutely, or set `relativeTo` property in navigational extras to `null`.\n *\n * ```html\n * <a [wbRouterLink]=\"['/path/to/view']\">Link</a>\n * ```\n */\n@Directive({\n  selector: '[wbRouterLink]',\n  host: {\n    '[attr.href]': 'href()',\n  },\n})\nexport class WorkbenchRouterLinkDirective {\n\n  public readonly commands = input.required({alias: 'wbRouterLink', transform: (commands: Commands | string | undefined | null) => Arrays.coerce(commands)});\n  public readonly extras = input({}, {alias: 'wbRouterLinkExtras', transform: (extras: Omit<WorkbenchNavigationExtras, 'close'> | undefined) => extras ?? {}});\n\n  private readonly _workbenchRouter = inject(WorkbenchRouter);\n  private readonly _router = inject(Router);\n  private readonly _route = inject(ActivatedRoute);\n  private readonly _view = inject(WorkbenchView, {optional: true});\n\n  protected readonly href = this.computeHrefIfLink();\n\n  @HostListener('click', ['$event.button', '$event.ctrlKey', '$event.metaKey'])\n  protected onClick(button: number, ctrlKey: boolean, metaKey: boolean): boolean {\n    if (button !== 0) { // not primary mouse button pressed\n      return true;\n    }\n\n    const extras = this.computeNavigationExtras(ctrlKey, metaKey);\n    void this._workbenchRouter.navigate(this.commands(), extras);\n    return false;\n  }\n\n  /**\n   * Computes navigation extras based on the given extras and contextual route.\n   */\n  private computeNavigationExtras(ctrlKey: boolean = false, metaKey: boolean = false): WorkbenchNavigationExtras {\n    const controlPressed = ctrlKey || metaKey;\n    const extras = this.extras();\n\n    return {\n      ...extras,\n      relativeTo: Defined.orElse(extras.relativeTo, this._route), // `null` is a valid `relativeTo` for absolute navigation\n      target: controlPressed ? 'blank' : extras.target ?? this._view?.id,\n      activate: extras.activate ?? !controlPressed, // by default, the view is not activated if CTRL or META modifier key is pressed (same behavior as for browser links)\n      close: false, // do not support closing a view using this directive.\n    };\n  }\n\n  /**\n   * Computes the link's href based on given array of commands and navigation extras.\n   */\n  private computeHrefIfLink(): Signal<string | null> {\n    // Compute href only if the host is a link (anchor tag).\n    const host = inject(ElementRef).nativeElement as Element;\n    if (host.tagName !== 'A') {\n      return signal(null);\n    }\n\n    const workbenchRouter = inject(ɵWorkbenchRouter);\n    const locationStrategy = inject(LocationStrategy);\n\n    // Compute href when commands, extras or the application URL change.\n    const commands$ = toObservable(this.commands).pipe(filter(commands => !!commands.length));\n    const extras$ = toObservable(this.extras).pipe(map(() => this.computeNavigationExtras()));\n    const navigationEnd$ = this._router.events.pipe(filter(event => event instanceof NavigationEnd), startWith(undefined));\n\n    const href$ = commands$\n      .pipe(\n        combineLatestWith(extras$, navigationEnd$),\n        switchMap(([commands, extras]) => workbenchRouter.createUrlTree(createNavigationFromCommands(commands, extras), extras)),\n        map(urlTree => urlTree && locationStrategy.prepareExternalUrl(this._router.serializeUrl(urlTree))),\n      );\n    return toSignal(href$, {initialValue: null});\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {WorkbenchRouter} from './workbench-router.service';\nexport {WorkbenchRouterLinkDirective} from './workbench-router-link.directive';\nexport {WorkbenchRouteData} from './workbench-route-data';\nexport {type Commands, type NavigationData, type NavigationState, type WorkbenchNavigationExtras, type NavigateFn} from './routing.model';\nexport {canMatchWorkbenchView, canMatchWorkbenchPerspective, canMatchWorkbenchPart, canMatchWorkbenchOutlet} from './workbench-route-guards';\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {WorkbenchMessageBoxService} from './workbench-message-box.service';\nexport {type WorkbenchMessageBoxOptions} from './workbench-message-box.options';\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {DestroyRef, Directive, inject, input, TemplateRef} from '@angular/core';\nimport {ɵWorkbenchDialog} from '../ɵworkbench-dialog.model';\nimport {Disposable} from '../../common/disposable';\nimport {asapScheduler} from 'rxjs';\n\n/**\n * Use this directive to contribute an action to the dialog footer (only applicable if not using a custom dialog footer).\n *\n * Actions are displayed in the order as modeled in the template and can be placed either on the left or right.\n *\n * The host element of this modeling directive must be a <ng-template>. The action shares the lifecycle of the host element.\n *\n * **Example:**\n * ```html\n * <ng-template wbDialogAction>\n *   <button (click)=\"dialog.close()\">Close</button>\n * </ng-template>\n * ```\n */\n@Directive({selector: 'ng-template[wbDialogAction]'})\nexport class WorkbenchDialogActionDirective {\n\n  /**\n   * Specifies where to place this action in the dialog footer. Defaults to `end`.\n   */\n  public readonly align = input<'start' | 'end'>('end');\n  public readonly template = inject(TemplateRef) as TemplateRef<void>;\n\n  private _action: Disposable | undefined;\n\n  constructor() {\n    const dialog = inject(ɵWorkbenchDialog);\n\n    // Defer registering action to avoid `ExpressionChangedAfterItHasBeenCheckedError`.\n    asapScheduler.schedule(() => this._action = dialog.registerAction(this));\n\n    // Defer disposing action to avoid `ExpressionChangedAfterItHasBeenCheckedError`.\n    inject(DestroyRef).onDestroy(() => asapScheduler.schedule(() => this._action?.dispose()));\n  }\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {WorkbenchDialog, type WorkbenchDialogSize} from './workbench-dialog.model';\nexport {type WorkbenchDialogOptions} from './workbench-dialog.options';\nexport {WorkbenchDialogService} from './workbench-dialog.service';\nexport {WorkbenchDialogActionDirective} from './dialog-footer/workbench-dialog-action.directive';\nexport {WorkbenchDialogFooterDirective} from './dialog-footer/workbench-dialog-footer.directive';\nexport {WorkbenchDialogHeaderDirective} from './dialog-header/workbench-dialog-header.directive';\nexport {WORKBENCH_DIALOG_CONTEXT} from './workbench-dialog-context.provider';\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable} from '@angular/core';\nimport {NotificationConfig} from './notification.config';\nimport {Translatable} from '../text/workbench-text-provider.model';\nimport {LEGACY_NOTIFICATION_INPUT} from './ɵnotification';\nimport {ɵWorkbenchNotificationService} from './ɵworkbench-notification.service';\nimport {prune} from '../common/prune.util';\n\n/**\n * Shows a notification.\n *\n * A notification is a closable message displayed in the upper-right corner that disappears after a few seconds unless hovered or focused.\n * It informs about system events, task completion, or errors. Severity indicates importance or urgency.\n *\n * Notifications can be grouped. Only the most recent notification within a group is displayed.\n *\n * Content can be plain text or structured. Pressing Escape closes the notification.\n *\n * @deprecated since version 21.0.0-beta.1. Use `WorkbenchNotificationService` to show notifications. Marked for removal in version 22.\n */\n@Injectable({providedIn: 'root'})\nexport class NotificationService {\n\n  private readonly _notificationService = inject(ɵWorkbenchNotificationService);\n\n  /**\n   * Displays the specified text or component as workbench notification.\n   *\n   * @param notification - Configures content and appearance of the notification.\n   *\n   * @deprecated since version 21.0.0-beta.1. Use `WorkbenchNotificationService` to show notifications. Marked for removal in version 22.\n   */\n  public notify(notification: Translatable | NotificationConfig): void {\n    if (typeof notification === 'string') {\n      this._notificationService.show(notification);\n    }\n    else {\n      this._notificationService.show(notification.content, prune({\n        title: notification.title,\n        injector: notification.componentConstructOptions?.injector,\n        inputs: {[LEGACY_NOTIFICATION_INPUT]: notification.componentInput},\n        severity: notification.severity,\n        duration: migrateDuration(notification),\n        group: notification.group,\n        groupInputReduceFn: migrateGroupInputReduceFn(notification),\n        cssClass: notification.cssClass,\n      }));\n    }\n  }\n}\n\nfunction migrateDuration(config: NotificationConfig): 'short' | 'medium' | 'long' | 'infinite' | number | undefined {\n  if (typeof config.duration === 'number') {\n    return config.duration * 1000;\n  }\n  return config.duration;\n}\n\nfunction migrateGroupInputReduceFn(config: NotificationConfig): ((prevInput: {[name: string]: unknown}, currInput: {[name: string]: unknown}) => {[name: string]: unknown}) | undefined {\n  if (!config.groupInputReduceFn) {\n    return undefined;\n  }\n\n  return (prevInput, currInput) => {\n    const result = config.groupInputReduceFn!(prevInput[LEGACY_NOTIFICATION_INPUT], currInput[LEGACY_NOTIFICATION_INPUT]) as unknown;\n    return {[LEGACY_NOTIFICATION_INPUT]: result};\n  };\n}\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {Notification} from './notification';\nexport {type NotificationConfig} from './notification.config';\nexport {NotificationService} from './notification.service';\nexport {WorkbenchNotification} from './workbench-notification.model';\nexport {type WorkbenchNotificationOptions} from './workbench-notification.options';\nexport {WorkbenchNotificationService} from './workbench-notification.service';\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ElementRef, Injector, StaticProvider, Type, ViewContainerRef} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {PopupOrigin} from './popup.origin';\nimport {DialogId, NotificationId, PartId, PopupId, ViewId} from '../workbench.identifiers';\n\n/**\n * Controls the appearance and behavior of a popup.\n *\n * @deprecated since version 21.0.0-beta.1. Replaced by `WorkbenchPopupOptions`. Use `WorkbenchPopupService` to open popups. Marked for removal in version 22.\n */\nexport abstract class PopupConfig {\n  /**\n   * Specifies the unique identity of the popup. Defaults to a UUID.\n   *\n   * @internal\n   */\n  public abstract readonly id?: PopupId;\n  /**\n   * Controls where to open the popup.\n   *\n   * Can be an HTML element or a coordinate. The coordinate is relative to the {@link context}, defaulting to the calling context.\n   *\n   * Supported coordinate pairs:\n   * - x/y: Relative to the top/left corner of the context.\n   * - top/left: Same as x/y.\n   * - top/right: Relative to the top/right corner of the context.\n   * - bottom/left: Relative to the bottom/left corner of the context.\n   * - bottom/right: Relative to the bottom/right corner of the context.\n   *\n   * Passing an Observable allows for updating the coordinate.\n   */\n  public abstract readonly anchor: ElementRef<Element> | Element | PopupOrigin | Observable<PopupOrigin>;\n  /**\n   * Specifies the component to display in the popup.\n   *\n   * In the component, you can inject the popup handle {@link WorkbenchPopup} to interact with the popup, such as to close it\n   * or obtain its input data.\n   */\n  public abstract readonly component: Type<any>;\n  /**\n   * Instructs Angular how to construct the component. In most cases, construct options need not to be set.\n   */\n  public readonly componentConstructOptions?: {\n    /**\n     * Sets the injector for the instantiation of the popup component, giving you control over the objects available\n     * for injection into the popup component. If not specified, uses the application's root injector, or the view's\n     * injector if opened in the context of a view.\n     *\n     * ```ts\n     * Injector.create({\n     *   parent: ...,\n     *   providers: [\n     *    {provide: <DiToken>, useValue: <value>}\n     *   ],\n     * })\n     * ```\n     */\n    injector?: Injector;\n    /**\n     * Specifies providers to be registered with the popup injector. Unlike providers that are registered via a separate {@link injector},\n     * passed providers are registered in the same injector as the popup handle itself, allowing for dependency injection of the popup handle.\n     */\n    providers?: StaticProvider[];\n    /**\n     * Sets the component's attachment point in Angular's logical component tree (not the DOM tree used for rendering), effecting when\n     * Angular checks the component for changes during a change detection cycle. If not set, inserts the component at the top level\n     * in the component tree.\n     *\n     * @deprecated since version 21.0.0-beta.1. Marked for removal. No replacement as not required anymore.\n     */\n    viewContainerRef?: ViewContainerRef;\n  };\n  /**\n   * Controls where to align the popup relative to the popup anchor, unless there is not enough space available in that area. By default,\n   * if not specified, the popup opens north of the anchor.\n   */\n  public readonly align?: 'east' | 'west' | 'north' | 'south';\n  /**\n   * Specifies data to pass to the popup component. In the component, you can inject the popup handle {@link WorkbenchPopup} to read input data.\n   */\n  public readonly input?: any;\n  /**\n   * Controls when to close the popup.\n   */\n  public readonly closeStrategy?: CloseStrategy;\n  /**\n   * Specifies the preferred popup size. If not specified, the popup adjusts its size to the content size.\n   */\n  public readonly size?: {\n    minHeight?: string;\n    height?: string;\n    maxHeight?: string;\n    minWidth?: string;\n    width?: string;\n    maxWidth?: string;\n  };\n\n  /**\n   * Specifies CSS class(es) to add to the popup, e.g., to locate the popup in tests.\n   */\n  public readonly cssClass?: string | string[];\n  /**\n   * Binds the popup to a context (e.g., part or view). Defaults to the calling context.\n   *\n   * The popup is displayed only if the context is visible and closes when the context is disposed.\n   *\n   * Set to `null` to open the popup outside a context.\n   */\n  public abstract context?: ViewId | PartId | DialogId | PopupId | NotificationId | Context | null;\n}\n\n/**\n * Specifies when to close the popup.\n */\nexport interface CloseStrategy {\n  /**\n   * Controls if to close the popup on focus loss, returning the result set via {@link WorkbenchPopup#setResult} to the popup opener.\n   * Defaults to `true`.\n   */\n  onFocusLost?: boolean;\n  /**\n   * Controls if to close the popup when pressing escape. Defaults to `true`.\n   * No return value will be passed to the popup opener.\n   */\n  onEscape?: boolean;\n}\n\n/**\n * @deprecated since version 20.0.0-beta.9. Set view id directly. Migrate `{context: {viewId: 'view.x'}}` to `{context: 'view.x'}`. Marked for removal in version 22.\n */\ninterface Context {\n  /**\n   * @deprecated since version 20.0.0-beta.9. Set view id directly. Migrate `{context: {viewId: 'view.x'}}` to `{context: 'view.x'}`. Marked for removal in version 22.\n   */\n  viewId?: ViewId | null;\n}\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {WorkbenchPopupService} from './workbench-popup.service';\nexport {PopupService} from './popup.service';\nexport {PopupConfig} from './popup.config';\nexport {type Point, type TopLeftPoint, type TopRightPoint, type BottomLeftPoint, type BottomRightPoint, type PopupOrigin} from './popup.origin';\nexport {WorkbenchPopup, type WorkbenchPopupSize} from './workbench-popup.model';\nexport {Popup} from './popup';\nexport {type WorkbenchPopupOptions, type CloseStrategy} from './workbench-popup.options';\nexport {WORKBENCH_POPUP_CONTEXT} from './workbench-popup-context.provider';\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {type Disposable} from './disposable';\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {canMatchWorkbenchPartCapability, canMatchWorkbenchViewCapability, canMatchWorkbenchDialogCapability, canMatchWorkbenchMessageBoxCapability, canMatchWorkbenchPopupCapability, canMatchWorkbenchNotificationCapability} from './microfrontend-host-routes';\nexport {ActivatedMicrofrontend} from './microfrontend-host.model';\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {MicrofrontendPlatformConfigLoader} from './microfrontend-platform-config-loader';\nexport {WorkbenchPerspectiveData} from './microfrontend-perspective/workbench-perspective-data';\nexport {provideMicrofrontendPlatformInitializer, type MicrofrontendPlatformInitializerOptions, MicrofrontendPlatformStartupPhase} from './microfrontend-platform-initializer';\nexport {WORKBENCH_POPUP_REFERRER} from './microfrontend-popup/microfrontend-popup-intent-handler.interceptor';\nexport * from './microfrontend-platform.config';\nexport * from './microfrontend-host/public_api';\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {WorkbenchLauncher} from './workbench-launcher.service';\nexport {WorkbenchStartup} from './workbench-startup.service';\nexport {type WorkbenchInitializerFn, provideWorkbenchInitializer, type WorkbenchInitializerOptions, WorkbenchStartupPhase} from './workbench-initializer';\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {LogAppender, type LogEvent, LogLevel, LoggerName} from './logging.model';\nexport {Logger} from './logger';\n","/*\n * Copyright (c) 2018-2023 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {WorkbenchStorage} from './workbench-storage';\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {} from '';\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {type WorkbenchTextProviderFn, type Translatable} from './workbench-text-provider.model';\nexport {TextPipe} from './text.pipe';\nexport {text} from './text';\n","/*\n * Copyright (c) 2018-2025 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {type WorkbenchIconDescriptor, type WorkbenchIconProviderFn} from './workbench-icon-provider.model';\nexport {IconComponent} from './icon.component';\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {WorkbenchConfig, type MenuItemConfig, type ViewMenuItemsConfig} from './workbench-config';\nexport {provideWorkbench} from './workbench.provider';\nexport {WorkbenchService} from './workbench.service';\nexport {WORKBENCH_ID, type ViewId, type PartId, type ActivityId, type DialogId, type PopupId, type NotificationId} from './workbench.identifiers';\nexport {type WorkbenchPartAction, type WorkbenchPartActionFn, type WorkbenchMenuItem, type WorkbenchViewMenuItemFn, type CanCloseFn, type CanCloseRef, type WorkbenchElement} from './workbench.model';\nexport {WorkbenchComponent} from './workbench.component';\nexport {VIEW_TAB_RENDERING_CONTEXT, type ViewTabRenderingContext} from './workbench.constants';\n\nexport * from './layout/public_api';\nexport * from './desktop/public_api';\nexport * from './perspective/public_api';\nexport * from './part/public_api';\nexport * from './view/public_api';\nexport * from './routing/public_api';\nexport * from './message-box/public_api';\nexport * from './dialog/public_api';\nexport * from './notification/public_api';\nexport * from './popup/public_api';\nexport * from './common/public_api';\nexport * from './microfrontend-platform/public_api';\nexport * from './startup/public_api';\nexport * from './logging/public_api';\nexport * from './storage/public_api';\nexport * from './activity/public_api';\nexport * from './text/public_api';\nexport * from './icon/public_api';\n","/*\n * Copyright (c) 2018-2022 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/**\n * Entry point for all public APIs of this package.\n */\nexport * from './lib/public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["isViewId","ɵZONELESS_ENABLED","switchMap","mergeMap","transform","i1.GlassPaneDirective","WorkbenchRouter","ɵWorkbenchRouter","WorkbenchDialogService","ɵWorkbenchDialogService","WorkbenchMessageBoxService","ɵWorkbenchMessageBoxService","WorkbenchPopupService","ɵWorkbenchPopupService","WorkbenchNotificationService","ɵWorkbenchNotificationService","ɵWorkbenchTextService","ɵTHEME_CONTEXT_KEY","map","encodeSemicolons","ɵVIEW_ID_CONTEXT_KEY","ɵWorkbenchCommands","ɵVIEW_CAPABILITY_ID_PARAM_NAME","configureMicrofrontendGlassPane","provideActivatedMicrofrontend","ɵWORKBENCH_PART_CONTEXT","qualifier","app","findCapabilityByLegacyCapabilityId","generateLegacyCapabilityIdentifier","ɵNOTIFICATION_CONTEXT","ɵDIALOG_CONTEXT","ɵWorkbenchDialogMessageHeaders","ɵMESSAGE_BOX_CONTEXT","ɵPOPUP_CONTEXT","ɵWorkbenchPopupMessageHeaders"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;AAQG;AAaH;;AAEG;MACmB,eAAe,CAAA;AAqLpC;;AC7MD;;;;;;;;AAQG;AAEH;;AAEG;AACG,SAAU,UAAU,CAAC,KAAa,EAAA;AACtC,IAAA,MAAM,KAAK,CAAC,KAAK,CAAC;AACpB;;ACfA;;;;;;;;AAQG;AAIH;;;;AAIG;AACG,SAAU,WAAW,CAAC,SAA0B,EAAE,OAA+B,EAAA;AACrF,IAAA,OAAO,IAAI,OAAO,CAAO,OAAO,IAAG;AACjC,QAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAK;YAC5B,IAAI,SAAS,EAAE,EAAE;AACf,gBAAA,SAAS,CAAC,MAAM,OAAO,EAAE,CAAC;gBAC1B,SAAS,CAAC,OAAO,EAAE;YACrB;AACF,QAAA,CAAC,sDAAG,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAE;AACnC,IAAA,CAAC,CAAC;AACJ;;AC1BA;;;;;;;;AAQG;AAIH;;AAEG;MACmB,gBAAgB,CAAA;AAcrC;AAED;;;;;;AAMG;MAEU,uBAAuB,CAAA;AAE3B,IAAA,IAAI,CAAC,GAAW,EAAA;AACrB,QAAA,OAAO,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC;IAClC;IAEO,KAAK,CAAC,GAAW,EAAE,KAAa,EAAA;AACrC,QAAA,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC;IAClC;uGARW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,e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