@c8y/ngx-components 1009.0.34 → 1009.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/bundles/c8y-ngx-components-repository.umd.js +8 -4
  2. package/bundles/c8y-ngx-components-repository.umd.js.map +1 -1
  3. package/bundles/c8y-ngx-components-repository.umd.min.js +1 -1
  4. package/bundles/c8y-ngx-components-repository.umd.min.js.map +1 -1
  5. package/bundles/c8y-ngx-components.umd.js +14 -8
  6. package/bundles/c8y-ngx-components.umd.js.map +1 -1
  7. package/bundles/c8y-ngx-components.umd.min.js +1 -1
  8. package/bundles/c8y-ngx-components.umd.min.js.map +1 -1
  9. package/c8y-ngx-components.metadata.json +1 -1
  10. package/core/file-picker/file-picker.component.d.ts +8 -0
  11. package/esm2015/core/file-picker/file-picker.component.js +12 -2
  12. package/esm2015/core/file-picker/file-picker.module.js +6 -8
  13. package/esm2015/repository/configuration/configuration-detail.component.js +7 -2
  14. package/esm2015/repository/firmware/add-firmware-modal.component.js +7 -2
  15. package/esm2015/repository/firmware/add-firmware-patch-modal.component.js +7 -2
  16. package/esm2015/repository/software/add-software-modal.component.js +7 -2
  17. package/esm5/core/file-picker/file-picker.component.js +12 -2
  18. package/esm5/core/file-picker/file-picker.module.js +6 -8
  19. package/esm5/repository/configuration/configuration-detail.component.js +3 -2
  20. package/esm5/repository/firmware/add-firmware-modal.component.js +3 -2
  21. package/esm5/repository/firmware/add-firmware-patch-modal.component.js +3 -2
  22. package/esm5/repository/software/add-software-modal.component.js +3 -2
  23. package/fesm2015/c8y-ngx-components-repository.js +24 -4
  24. package/fesm2015/c8y-ngx-components-repository.js.map +1 -1
  25. package/fesm2015/c8y-ngx-components.js +14 -8
  26. package/fesm2015/c8y-ngx-components.js.map +1 -1
  27. package/fesm5/c8y-ngx-components-repository.js +8 -4
  28. package/fesm5/c8y-ngx-components-repository.js.map +1 -1
  29. package/fesm5/c8y-ngx-components.js +14 -8
  30. package/fesm5/c8y-ngx-components.js.map +1 -1
  31. package/locales/locales.pot +24 -3
  32. package/package.json +2 -2
  33. package/repository/c8y-ngx-components-repository.metadata.json +1 -1
  34. package/repository/configuration/configuration-detail.component.d.ts +1 -0
  35. package/repository/firmware/add-firmware-modal.component.d.ts +1 -0
  36. package/repository/firmware/add-firmware-patch-modal.component.d.ts +1 -0
  37. package/repository/software/add-software-modal.component.d.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../node_modules/tslib/tslib.es6.js","ng://@c8y/ngx-components/core/common/extension-hooks.ts","ng://@c8y/ngx-components/core/common/state-service.abstract.ts","ng://@c8y/ngx-components/core/action-bar/action-bar.service.ts","ng://@c8y/ngx-components/core/action-bar/action-bar-item.component.ts","ng://@c8y/ngx-components/core/common/ApplicationOptions.ts","ng://@c8y/ngx-components/core/common/options.service.ts","ng://@c8y/ngx-components/core/common/throttle.decorator.ts","ng://@c8y/ngx-components/core/common/ui-state.service.ts","ng://@c8y/ngx-components/core/i18n/languages.ts","ng://@c8y/ngx-components/core/i18n/locale.path.ts","ng://@c8y/ngx-components/core/i18n/patterns-message.hook.ts","ng://@c8y/ngx-components/core/i18n/pattern-messages.service.ts","ng://@c8y/ngx-components/core/i18n/missing-translation-custom.handler.ts","ng://@c8y/ngx-components/core/i18n/gettext.ts","ng://@c8y/ngx-components/core/i18n/pattern-messages.data.ts","ng://@c8y/ngx-components/core/i18n/cached-locale-dictionary.service.ts","ng://@c8y/ngx-components/core/i18n/translate.loader.ts","ng://@c8y/ngx-components/core/i18n/translate.parser.ts","ng://@c8y/ngx-components/core/i18n/force-html-translate.directive.ts","ng://@c8y/ngx-components/core/i18n/i18n.module.ts","ng://@c8y/ngx-components/core/i18n/parse-module.ts","ng://@c8y/ngx-components/core/i18n/load-locale.ts","ng://@c8y/ngx-components/core/i18n/translate.service.ts","ng://@c8y/ngx-components/core/common/date.pipe.ts","ng://@c8y/ngx-components/core/common/load-more.component.ts","ng://@c8y/ngx-components/core/common/forOf.directive.ts","ng://@c8y/ngx-components/core/common/humanize-app-name.pipe.ts","ng://@c8y/ngx-components/core/common/humanize.pipe.ts","ng://@c8y/ngx-components/core/common/icon.directive.ts","ng://@c8y/ngx-components/core/common/memoize.decorator.ts","ng://@c8y/ngx-components/core/common/permissions.service.ts","ng://@c8y/ngx-components/core/common/if-allowed.directive.ts","ng://@c8y/ngx-components/core/common/loading.component.ts","ng://@c8y/ngx-components/core/common/map-function.pipe.ts","ng://@c8y/ngx-components/core/common/outlet.directive.ts","ng://@c8y/ngx-components/core/common/progress-bar.component.ts","ng://@c8y/ngx-components/core/common/shorten-user-name.pipe.ts","ng://@c8y/ngx-components/core/common/tenant-ui.service.ts","ng://@c8y/ngx-components/core/common/user-preferences/user-preferences-storage-local.ts","ng://@c8y/ngx-components/core/common/user-preferences/user-preferences-store-inventory.ts","ng://@c8y/ngx-components/core/common/user-preferences/user-preferences.service.ts","ng://@c8y/ngx-components/core/common/common.module.ts","ng://@c8y/ngx-components/core/common/status.model.ts","ng://@c8y/ngx-components/core/action-bar/action-bar.component.ts","ng://@c8y/ngx-components/core/action-bar/action-bar.module.ts","ng://@c8y/ngx-components/core/action/action.service.ts","ng://@c8y/ngx-components/core/action/action-outlet.component.ts","ng://@c8y/ngx-components/core/action/action.component.ts","ng://@c8y/ngx-components/core/action/action.module.ts","ng://@c8y/ngx-components/core/alert/alert.service.ts","ng://@c8y/ngx-components/core/alert/alert-details.component.ts","ng://@c8y/ngx-components/core/alert/alert.component.ts","ng://@c8y/ngx-components/core/alert/alert-outlet.component.ts","ng://@c8y/ngx-components/core/alert/alert-text.component.ts","ng://@c8y/ngx-components/core/alert/alert.module.ts","ng://@c8y/ngx-components/core/navigator/navigator-node.ts","ng://@c8y/ngx-components/core/navigator/navigator-node-root.ts","ng://@c8y/ngx-components/core/navigator/navigator.service.ts","ng://@c8y/ngx-components/core/header/header.service.ts","ng://@c8y/ngx-components/core/tabs/tabs.service.ts","ng://@c8y/ngx-components/core/bootstrap/bootstrap.component.ts","ng://@c8y/ngx-components/core/breadcrumb/breadcrumb-item.component.ts","ng://@c8y/ngx-components/core/breadcrumb/breadcrumb-outlet.component.ts","ng://@c8y/ngx-components/core/breadcrumb/breadcrumb.service.ts","ng://@c8y/ngx-components/core/breadcrumb/breadcrumb.component.ts","ng://@c8y/ngx-components/core/breadcrumb/breadcrumb.module.ts","ng://@c8y/ngx-components/core/navigator/navigator-entry.component.ts","ng://@c8y/ngx-components/core/navigator/navigator-icon.component.ts","ng://@c8y/ngx-components/core/modal/popover-confirm.component.ts","ng://@c8y/ngx-components/core/navigator/navigator-node.component.ts","ng://@c8y/ngx-components/core/header/right-drawer/right-drawer.component.ts","ng://@c8y/ngx-components/core/header/title/title-outlet.component.ts","ng://@c8y/ngx-components/core/header/title/title.component.ts","ng://@c8y/ngx-components/core/search/search.service.ts","ng://@c8y/ngx-components/core/user/user-menu.service.ts","ng://@c8y/ngx-components/core/docs/defaults.items.ts","ng://@c8y/ngx-components/core/docs/docs.models.ts","ng://@c8y/ngx-components/core/docs/docs.service.ts","ng://@c8y/ngx-components/core/header/header-bar/header-bar.component.ts","ng://@c8y/ngx-components/core/header/application/app-switcher.component.ts","ng://@c8y/ngx-components/core/header/application/app-icon.component.ts","ng://@c8y/ngx-components/core/navigator/navigator-outlet.component.ts","ng://@c8y/ngx-components/core/login/login.model.ts","ng://@c8y/ngx-components/core/modal/modal-confirm.component.ts","ng://@c8y/ngx-components/core/modal/modal.component.ts","ng://@c8y/ngx-components/core/modal/modal.service.ts","ng://@c8y/ngx-components/core/modal/modal.module.ts","ng://@c8y/ngx-components/core/navigator/navigator.module.ts","ng://@c8y/ngx-components/core/bootstrap/cookie-banner/cookie-banner.service.ts","ng://@c8y/ngx-components/core/product-experience/gainsight.service.ts","ng://@c8y/ngx-components/core/product-experience/product-experience.directive.ts","ng://@c8y/ngx-components/core/product-experience/product-experience.module.ts","ng://@c8y/ngx-components/core/search/search-outlet.component.ts","ng://@c8y/ngx-components/core/search/search.component.ts","ng://@c8y/ngx-components/core/search/highlight.component.ts","ng://@c8y/ngx-components/core/search/search-result-empty.component.ts","ng://@c8y/ngx-components/core/search/search.module.ts","ng://@c8y/ngx-components/core/user/user-menu-item.component.ts","ng://@c8y/ngx-components/core/user/user-edit-modal.component.ts","ng://@c8y/ngx-components/core/login/login.service.ts","ng://@c8y/ngx-components/core/authentication/password-confirm-modal.component.ts","ng://@c8y/ngx-components/core/authentication/password.service.ts","ng://@c8y/ngx-components/core/user/user-totp-setup.component.ts","ng://@c8y/ngx-components/core/user/user-edit.component.ts","ng://@c8y/ngx-components/core/user/user-menu-outlet.component.ts","ng://@c8y/ngx-components/core/authentication/password-check-list.component.ts","ng://@c8y/ngx-components/core/authentication/password-confirm.directive.ts","ng://@c8y/ngx-components/core/authentication/password-strength-checker.service.ts","ng://@c8y/ngx-components/core/authentication/password-strength.component.ts","ng://@c8y/ngx-components/core/authentication/new-password.component.ts","ng://@c8y/ngx-components/core/forms/phone-validation.directive.ts","ng://@c8y/ngx-components/core/forms/validation-pattern.ts","ng://@c8y/ngx-components/core/forms/default-validation.directive.ts","ng://@c8y/ngx-components/core/forms/min-validation.directive.ts","ng://@c8y/ngx-components/core/forms/max-validation.directive.ts","ng://@c8y/ngx-components/core/forms/message.directive.ts","ng://@c8y/ngx-components/core/forms/messages.component.ts","ng://@c8y/ngx-components/core/forms/form-group.component.ts","ng://@c8y/ngx-components/core/forms/input-group-list.component.ts","ng://@c8y/ngx-components/core/forms/input-group-list-container.directive.ts","ng://@c8y/ngx-components/core/forms/json-validation-prettifier.directive.ts","ng://@c8y/ngx-components/core/forms/text-area-row-height.directive.ts","ng://@c8y/ngx-components/core/forms/required-input-placeholder.directive.ts","ng://@c8y/ngx-components/core/forms/ip-range-input-list.component.ts","ng://@c8y/ngx-components/core/forms/filter-input.component.ts","ng://@c8y/ngx-components/core/forms/forms.module.ts","ng://@c8y/ngx-components/core/authentication/totp-challenge.component.ts","ng://@c8y/ngx-components/core/authentication/sms-challenge.component.ts","ng://@c8y/ngx-components/core/authentication/totp-setup.component.ts","ng://@c8y/ngx-components/core/drop-area/drop-area.component.ts","ng://@c8y/ngx-components/core/authentication/provide-phone-number.component.ts","ng://@c8y/ngx-components/core/authentication/authentication.module.ts","ng://@c8y/ngx-components/core/user/user-totp-revoke.component.ts","ng://@c8y/ngx-components/core/user/user.module.ts","ng://@c8y/ngx-components/core/header/header.module.ts","ng://@c8y/ngx-components/core/login/change-password.component.ts","ng://@c8y/ngx-components/core/login/credentials.component.ts","ng://@c8y/ngx-components/core/login/login.component.ts","ng://@c8y/ngx-components/core/login/recover-password.component.ts","ng://@c8y/ngx-components/core/login/totp-auth.component.ts","ng://@c8y/ngx-components/core/login/strength-validator-service.ts","ng://@c8y/ngx-components/core/login/password-strength-validator.directive.ts","ng://@c8y/ngx-components/core/login/login.module.ts","ng://@c8y/ngx-components/core/tabs/tab.component.ts","ng://@c8y/ngx-components/core/tabs/tabs-outlet.component.ts","ng://@c8y/ngx-components/core/tabs/tabs.module.ts","ng://@c8y/ngx-components/core/bootstrap/cookie-banner/cookie-banner-preferences-modal/cookie-banner-preferences-modal.component.ts","ng://@c8y/ngx-components/core/bootstrap/cookie-banner/cookie-banner.component.ts","ng://@c8y/ngx-components/core/bootstrap/bootstrap.module.ts","ng://@c8y/ngx-components/core/drop-area/drop-area.module.ts","ng://@c8y/ngx-components/core/router/router.models.ts","ng://@c8y/ngx-components/core/file-picker/file-picker.component.ts","ng://@c8y/ngx-components/core/file-picker/file-picker.module.ts","ng://@c8y/ngx-components/core/date-picker/date-picker.component.ts","ng://@c8y/ngx-components/core/date-picker/date-picker.module.ts","ng://@c8y/ngx-components/core/router/router-tabs.resolver.ts","ng://@c8y/ngx-components/core/router/view-context.service.ts","ng://@c8y/ngx-components/core/router/context-route.service.ts","ng://@c8y/ngx-components/core/router/router.service.ts","ng://@c8y/ngx-components/core/router/context-route.component.ts","ng://@c8y/ngx-components/api/api.service.ts","ng://@c8y/ngx-components/api/data.module.ts","ng://@c8y/ngx-components/core/router/context-route.guard.ts","ng://@c8y/ngx-components/core/router/empty.component.ts","ng://@c8y/ngx-components/core/router/router.module.ts","ng://@c8y/ngx-components/core/device-status/device-availability.ts","ng://@c8y/ngx-components/core/device-status/device-status.component.ts","ng://@c8y/ngx-components/core/device-status/device-status.module.ts","ng://@c8y/ngx-components/core/docs/guide-href.directive.ts","ng://@c8y/ngx-components/core/docs/guide-docs.component.ts","ng://@c8y/ngx-components/core/docs/docs.module.ts","ng://@c8y/ngx-components/core/dynamic-forms/array/array.type.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/checkbox/checkbox.type.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/form-field/form-field.wrapper.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/input/input.type.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/object/object.type.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/radio/radio.type.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/dynamic-forms-ui-theme.module.ts","ng://@c8y/ngx-components/core/dynamic-forms/i18n/translate.extension.ts","ng://@c8y/ngx-components/core/dynamic-forms/i18n/i18n.module.ts","ng://@c8y/ngx-components/core/dynamic-forms/json-schema/c8y-json-schema.service.ts","ng://@c8y/ngx-components/core/dynamic-forms/validation/validation-config.factory.ts","ng://@c8y/ngx-components/core/data-grid/data-grid.model.ts","ng://@c8y/ngx-components/core/dynamic-forms/validation/validation.module.ts","ng://@c8y/ngx-components/core/dynamic-forms/dynamic-forms.module.ts","ng://@c8y/ngx-components/core/dynamic-component/dynamic-component.model.ts","ng://@c8y/ngx-components/core/dynamic-component/dynamic-component.service.ts","ng://@c8y/ngx-components/core/dynamic-component/dynamic-component.component.ts","ng://@c8y/ngx-components/core/dynamic-component/dynamic-component.module.ts","ng://@c8y/ngx-components/core/dashboard/dashboard-child-action.component.ts","ng://@c8y/ngx-components/core/dashboard/dashboard-child-title.component.ts","ng://@c8y/ngx-components/core/dashboard/dashboard.component.ts","ng://@c8y/ngx-components/core/dashboard/dashboard-child-change.ts","ng://@c8y/ngx-components/core/dashboard/dashboard-child.component.ts","ng://@c8y/ngx-components/core/dashboard/widgets-dashboard.component.ts","ng://@c8y/ngx-components/core/dashboard/dashboard.module.ts","ng://@c8y/ngx-components/core/stepper/stepper-icon.directive.ts","ng://@c8y/ngx-components/core/stepper/stepper.component.ts","ng://@c8y/ngx-components/core/stepper/stepper-progress.component.ts","ng://@c8y/ngx-components/core/stepper/stepper-buttons.component.ts","ng://@c8y/ngx-components/core/stepper/stepper.module.ts","ng://@c8y/ngx-components/core/list-group/list-item-action.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-collapse.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-footer.component.ts","ng://@c8y/ngx-components/core/list-group/list-item.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-body.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-radio.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-timeline.component.ts","ng://@c8y/ngx-components/core/list-group/list-group.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-icon.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-checkbox.component.ts","ng://@c8y/ngx-components/core/list-group/list-group.module.ts","ng://@c8y/ngx-components/core/audit-log/audit-log.component.ts","ng://@c8y/ngx-components/core/audit-log/audit-log.module.ts","ng://@c8y/ngx-components/core/data-grid/column/cell-renderer.ts","ng://@c8y/ngx-components/core/data-grid/column/filtering-form-renderer.ts","ng://@c8y/ngx-components/core/data-grid/column/column.directive.ts","ng://@c8y/ngx-components/core/data-grid/grid-data-source.ts","ng://@c8y/ngx-components/core/select-modal/select-modal.model.ts","ng://@c8y/ngx-components/core/data-grid/data-grid.component.ts","ng://@c8y/ngx-components/core/data-grid/column/cell-renderer.component.ts","ng://@c8y/ngx-components/core/data-grid/column/filtering-form-renderer.component.ts","ng://@c8y/ngx-components/core/data-grid/data-grid.module.ts","ng://@c8y/ngx-components/core/help/help.component.ts","ng://@c8y/ngx-components/core/help/help.module.ts","ng://@c8y/ngx-components/core/realtime/realtime-button.component.ts","ng://@c8y/ngx-components/core/realtime/realtime.module.ts","ng://@c8y/ngx-components/core/select-modal/select-modal.component.ts","ng://@c8y/ngx-components/core/select-modal/select-modal-filter.pipe.ts","ng://@c8y/ngx-components/core/select-modal/select-modal.module.ts","ng://@c8y/ngx-components/core/select/select.component.ts","ng://@c8y/ngx-components/core/select/typeahead.component.ts","ng://@c8y/ngx-components/core/select/select.module.ts","ng://@c8y/ngx-components/core/core.module.ts","ng://@c8y/ngx-components/core/quicklink/quick-link.component.ts","ng://@c8y/ngx-components/core/quicklink/quick-link.module.ts","ng://@c8y/ngx-components/core/provider-configuration/provider-configuration-hook.ts","ng://@c8y/ngx-components/core/provider-configuration/provider-configuration-node.factory.ts","ng://@c8y/ngx-components/core/provider-configuration/service/provider-configuration.service.ts","ng://@c8y/ngx-components/core/provider-configuration/service/provider-definitions.service.ts","ng://@c8y/ngx-components/core/provider-configuration/provider-configuration.component.ts","ng://@c8y/ngx-components/core/provider-configuration/provider-configuration-route.factory.ts","ng://@c8y/ngx-components/core/provider-configuration/provider-configuration.module.ts","ng://@c8y/ngx-components/core/realtime/realtime.model.ts","ng://@c8y/ngx-components/core/realtime/realtime.service.ts","ng://@c8y/ngx-components/core/realtime/operation-bulk-realtime.service.ts","ng://@c8y/ngx-components/core/realtime/managed-object-realtime.service.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__decorate","decorators","target","key","desc","c","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__param","paramIndex","decorator","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","TypeError","pop","push","__values","o","m","__read","ar","error","__spread","concat","fromTrigger","router","refresh","factories","events","pipe","filter","evt","NavigationEnd","merge","startWith","switchMap","fromFactories","withFirstEmpty","isArray","of","defer","factoryObservables","resolveInjectedFactories","map","factoryResult","observable","isObservable","forceObservable","from","withEmptyFirst","race","item","toObservable","isFunction","get","getActivatedRoute","combineLatest","results","sortByPriority","flatten","stateToFactory","componentsState","components$","componentSet","items","sortBy","routerState","root","route","firstChild","StateService","mappedProperty","state$","distinctUntilChanged","emitNewState","state","HOOK_ACTION_BAR","InjectionToken","ActionBarService","_super","injector","_this","refreshTrigger","Subject","BehaviorSubject","Set","items$","shareReplay","tslib_1.__extends","add","remove","delete","Injector","Router","Injectable","providedIn","ActionBarItemComponent","actionBarService","placement","priority","itemClass","ngAfterViewInit","viewInitTimeout","setTimeout","ngOnDestroy","clearTimeout","tslib_1.__decorate","Input","ViewChild","static","Component","selector","template","ApplicationOptions","HOOK_OPTIONS","OptionsService","options","systemOptionsService","tenantOptionService","setupOptions","optionKey","defaultValue","camelCase","set","getSupportUrl","getTenantOption","url","_c","isUndefined","supportUrl","_a","getSystemOption","_b","getActivateSupportUser","category","getOptionFromService","forEach","optionMap","keys","service","detail","data","parseOptionRawValue","rawValue","JSON","parse","Optional","type","Inject","args","SystemOptionsService","TenantOptionsService","tslib_1.__param","throttle","wait","fnName","descriptor","fn","_i","throttledFnName","_throttle","AppStateService","applicationService","apiService","fetchClient","tenantLoginOptionsService","app","name","contextPath","getCurrentContextPath","lang","langs","getLangs","langsDetail","languages","loginOptions","activateSupportUserAvailable","undefined","versions","backend","ui","ngx","hidePowered","isLoading","showRightDrawer","rightDrawer","loginExtraLink","newsletter","currentSupportUserName","currentUser","currentTenant","calls","test","phase","scan","count","subscribe","assignApplicationKeyToDefaultHeaders","isDevMode","defaultHeaders","X-Cumulocity-Application-Key","k","version","ng1","loadManifest","application","manifest","loadDefaultOptions","refreshLoginOptions","isApplicationAvailable","listByUser","pageSize","some","setUser","userInfo","supportUserName","user","match","window","location","pathname","_d","showIncompatibleVersionsError","ex","uiVersion","backendVersion","uiVersionArray","replace","split","Number","beVersionArray","multiplier","Math","pow","ceil","log10","max","sumReducer","acc","cur","calculateVersionMapper","curr","idx","reduce","errorContent","console","log","ApplicationService","ApiService","FetchClient","TenantLoginOptionsService","trailing","LANGUAGES","LOCALE_PATH","HOOK_PATTERN_MESSAGES","PatternMessagesService","patterns","pipes","absoluteDate","date","formatDate","translateService","currentLang","translate","instant","each","pattern","message","translation","translateWithPatterns","translatedMessage","patternCfg","globalMatch","globalRegExp","RegExp","exec","localMatch","placeholderValues","mapValues","placeholders","placeholder","expr","capture","replacement","translateWithParams","params","defaultLang","compiler","translations","store","defaultTranslations","originalKey","gettext","originalValue","interpolateParams","noPatternMessages","pipeRegex","paramName","pipeName","compile","MissingTranslationCustomHandler","parser","patternMessagesService","cache","handle","messageKey","getFromCache","patternMessageTranslation","getPatternMessageTranslation","interpolate","addToCache","getCacheKey","stringify","TranslateParser","str","bulkOperationAuditLogTextPlaceholders","updatesList","status='(.+?)'","status","generalStatus='(.+?)'","generalStatus","progress='(.+?)'","progress","note=(.+?)","note","MESSAGES","^Access is denied$","^Alarm created$","^Alarm updated$","^API is not available with the new domain$","^Application with given name already exist$","^Application with id (.+?) is already assigned to the tenant (.+?)$","tenant","^Apply software changes: (.+?)\\.?$","softwareChanges","install \"(.+?)\" \\(version: (.+?)\\)","softwareName","softwareVersion","install \"([^\"]+)\"(?! \\(version: .+?\\))","delete \"(.+?)\" \\(version: (.+?)\\)","delete \"([^\"]+)\"(?! \\(version: .+?\\))","^Assign device profile (.+?) to device (.+?)$","profileName","deviceName","^(.+)pplication for tenant (.+) with properties \\( (.+?) \\) already exists$","valuesList","^Authentication failed! : User account is locked$","^Availability monitoring record$","^Can not activate a certificate which is either expired or not yet valid$","^Cannot add certificate - certificate with (.+?) fingerprint already exists. : Certificate with (.+?) fingerprint already exists.","fingerprint","^Cannot change password. : Provided token does not exist.$","^Cannot deploy module (.*)$","errorMessage","^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) \\[([\\S\\s]+?)\\]$","moduleName","expression","incorrectExpression","line","column","^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$","keyword","^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+), please check the where clause \\[([\\S\\s]+?)\\]$","^Cannot deploy module (.+?)! : Deployment failed in module '(.+?)' in expression '(.+?)' : Exception compiling script '(.+?)' of dialect '(.+?)': missing (.+?) before statement \\((.+?)\\) \\[([\\S\\s]+?)\\]$","scriptName","scriptDialect","missingSyntax","affectedStatement","^Cannot execute bulk operation on empty group. Group with id='(\\d+?)' doesn't have child assets.$","groupId","^Cannot execute bulk operation on empty group. DynamicGroup with id='(\\d+?)' doesn't have child assets$","^Cannot parse X509 certificate. : Could not parse certificate: (.+?)$","failureReason","^Cannot reschedule bulk operation. All its operations are successful$","^Cannot reset user password : Cannot find user with such email.$","^Cannot update/delete application binary via this endpoint$","^Can't delete user because it is used by another managed object$","^Cep module created$","^Cep module updated$","^Cep module deleted$","^Cep module \"(.+?)\" created$","^Cep module \"(.+?)\" updated$","^Cep module \"(.+?)\" deleted$","^Command state is invalid: (.+)$","violations","(\\w+?) - may not be null","field","^Could not connect to endpoint (.+)\\. Could not verify `(.+)` host key with fingerprint `(.+)` for `(.+)` on port (.+)\\. If you expected that key, please remove the previous one from configuration to allow for connection\\.$","endpointName","keyType","host","port","^Could not login to ssh server on endpoint \"(.+)\"\\. Provided credential for user \"(.+)\" is incorrect\\.$","userName","^Could not save object remoteAccessUpdate: (.+)$","errorMessages","Could not recognize host-key format","Could not recognize key-pair format","^Could not update user. : Error persisting user (.+?)!$","username","ˆCreate bulk operation$","^Create bulk operation: (.+)$","^Creation ramp must be greater than (\\d+?)$","minSeconds","^Created container$","^Created pod: (.+)$","imageName","^CSV file contained empty dataset$","^Cycle detected for route (.+?)!$","^Data broker processing is currently overloaded and may stop forwarding your data\\. Please contact support\\.$","^Data broker processing is not able to connect do destination tenant, thus data forwarding is not working\\. Please contact support\\.$","^Delete bulk operation$","^Delete bulk operation: (.+)$","^Device id '(.+?)' contains '(.+?)' character which is not permitted.$","deviceId","invalidCharacter","^Device name: '(.+?)', alarm text: '(.+?)'$","alarmText","^Display name$","^Domain name in uploaded certificate differs from the one in use$","^Domain name is already in use by another tenant!$","^Duplicated connector for instanceUrl (.+?)!$","targetUrl","^Duplicated connector for name (.+?)!$","^Entry is outside of the target dir: (.+)$","path","^Error during password validation. : Password must have at least (\\d+?) characters and no more than (\\d+?) and must contain only Latin1 characters.$","minCharactersCount","maxCharactersCount","^Error during password validation. : Your password has been used already. Choose another.$","^Error in statement (.+?):(.+?)! : Incorrect syntax near '(.+?)' near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$","statementNumber","^External id not found; external id = ID \\[type=(.+?), value=(.+?)\\]$","^Error occurred when trying to find an Application for id ID (.+) : Could not find application by ID (\\d+)$","applicationId","^Http status code: 404\n{error=\"options/Not Found\",message=\"Unable to find option by given key: sigfox-agent/provider.token\",info=\"https://www.cumulocity.com/guides/reference-guide/#error_reporting\",details=\"null\"}","^Failed to delete application. : Cannot remove application assigned to other tenants.$","^Failed to extract certificate from PKCS12$","^Failed to update domain at the platform$","^Finding device data from database failed : No managedObject for id '(.+?)'!$","^Following mandatory fields should be included: (.+?)$","fields","^Global Role updated$","^Global Role (.+?) updated$","^Global Role (.+?) updated: (.+)$","applications \\[([^\\]]+?)\\] added","list","applications \\[([^\\]]+?)\\] removed","roles \\[([^\\]]+?)\\] added","roles \\[([^\\]]+?)\\] removed","^Global Roles$","^Operation updated: (.+)$","description='(.+?)'","description","device name='(.+?)'","failure reason='(.+?)'","^ID \\[type=(.+?), value=(.+?)\\] was already bound to different Global ID.$","^Invalid credentials! : Bad credentials$","^Invalid credentials! : No phone number provided$","^Inventory Role removed$","^Inventory Role (.+?) removed","^Inventory Role updated$","^Inventory Role (.+?) updated","^I/O error: Connection refused; nested exception is Connection refused : Connection refused","^I/O error: Read timed out; nested exception is Read timed out : Read timed out","^Log file requested$","^Managed object deleted$","^Managed object \"(.+?)\" deleted$","^Maximum file size exceeded$","^Message with ID (.+?) doesn't exist in smart rest template (.+?)$","messageId","templateId","^NewDeviceRequest for id = (.+?) already exists.$","id","^No communication with device since (.+?)$","timestamp","^No data received from device within required interval.$","^No LoRa provider settings are found. Please configure the connectivity settings.$","^Not within any context!$","^Maximum age cannot be bigger than 10 years.$","^Microservice application name incorrect. Please use only lower-case letters, digits and dashes. Maximum length is (\\d+) characters.$","maxLength","^Microservice not available.*$","^Operation created$","^Operation updated$","^Operation created: status='(.+?)'.","^Option created$","^Option \"(.+?)\" created$","option","^Option deleted$","^Option \"(.+?)\" deleted$","^Owner field error. : Cannot introduce cyclic dependency.","^Password change is temporary blocked.$","^Password cipher does not match","^Platform application cannot be added to, nor removed from any tenant.$","^Private key must be provided in KEY_PAIR credentials$","^Private key cipher does not match","^Protocol \"(.+?)\" does not support \"(.+?)\" credentials type$","protocol","credentialsType","^pulling image \"(.+)\"$","^Real-time event processing is currently overloaded and may stop processing your events\\. Please contact support\\.$","^Resource ID \\[type=com_cumulocity_model_idtype_GId, value=(.+?)\\] for this request not found.$","^Retrieve configuration snapshot from device (.+?)","^Retrieve (.+?) configuration snapshot from device (.+?)","configurationType","^Scaled up replica set (.+) to (\\d+)$","replicaSetName","scaleNumber","^Send configuration snapshot (.+?) of configuration type (.+?) to device (.+?)","snapshotName","^Send configuration snapshot (.+?) to device (.+?)","^Simulator state is invalid: (.+)$","(\\w+?) - must be less than or equal to (\\d+)","maxValue","(\\w+?) - should not contain null values","^Smart rest template (.+?) doesn't exist$","^Smart rule created$","^Smart rule updated$","^Smart rule enabled$","^Smart rule disabled$","^Smart rule deleted$","^Smart rule \"(.+?)\" created$","^Smart rule \"(.+?)\" updated$","^Smart rule \"(.+?)\" enabled$","^Smart rule \"(.+?)\" disabled$","^Smart rule \"(.+?)\" deleted$","^Started container$","^Successfully assigned (.+) to (.+)$","address","^Successfully pulled image \"(.+)\"$","^Tenant creation failed. : Tenant with given id already exists.$","^Tenant id cannot be a reserved sql keyword \"(.+?)\".$","tenantId","^Tenant \"(.+?)\" activated$","^Tenant (.+?) has sub-tenants, please remove them first!$","^Tenant activated$","^Tenant \"(.+?)\" created$","^Tenant created$","^Tenant \"(.+?)\" deleted$","^Tenant deleted$","^Tenant \"(.+?)\" suspended$","^Tenant suspended$","^Tenant \"(.+?)\" updated: (.+?)$","properties","^Tenant updated$","^Too Many Requests$","^User alias equals username '(.+)'$","^User created$","^User (.+?) created$","^User deleted$","^User (.+?) deleted$","^User updated$","^User (.+?) updated: (.+)$","delegatedBy='(.+?)'","delegate","owner='(.+?)'","owner","inventory assignment \\[(.+?)\\] added","inventoryAssignment","inventory assignment \\[(.+?)\\] removed","applications \\[(.+?)\\] added$","applicationsList","applications \\[(.+?)\\] removed$","global roles \\[(.+?)\\] added$","globalRolesList","global roles \\[(.+?)\\] removed$","^User with username '(.+?)' already exists! : Duplicated: (.+?)$","^User with username or alias '(.+)' already exists! : Duplicated: (.+)$","usernameOrAlias","^User with email '(.+?)' already exists! : Duplicated: (.+?)$","email","^unable to find option with given key (.+?) : Could not find entity Option by ID (.+?)!$","^unable to find option with given key (.+?) : There is no system property for key (.+?)$","^Write failed with error code 16733 and error message 'trying to index text where term list is too big, max is 4mb _id: \"(.+?)\"'$","^Write failed with error code 17280 and error message 'WiredTigerIndex::insert: key too large to index, failing (.+?) { : \"(.+?)\" }'$","^You have reached devices limit. No more devices can be registered.$","^(.+) succeeded for volume \"(.+)\"","operation","volume","^Exception on tenant (.+) in statement '(.+)': Invocation exception when invoking method '(.+)' of class '(.+)' passing parameters \\[(.+)\\] for statement '(.+)': (.+) : (.+)$","methodName","classPath","parameters","statement","exceptionType","exceptionMessage","^No nodes are available that match all of the predicates: (.+).$","predicates","^Readiness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$","requestMethod","uri","^Liveness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$","^Error syncing pod$","^Failed create pod sandbox.$","^Exception on tenant (.+) in statement '(.+)': Http status code: (\\d+) \\{error=\"alarm/Unprocessable Entity\",message=\"(.+)\",info=\"https://www.cumulocity.com/guides/reference-guide/#error_reporting\",details=\"null\"\\}$","httpStatusCode","^User '(.+)' is managed by a remote identity management service defined by an administrator, direct update is forbidden$","^Added new child device to \"(.+)\" \\(ID: (.+)\\).$","parentDeviceName","parentDeviceId","^Updated child device of \"(.+)\" \\(ID: (.+)\\).$","^Added child device \"(.+)\" \\(ID: (.+)\\).$","^Removed child device \"(.+)\" \\(ID: (.+)\\).$","^Change value of \"(.+)\" to (.+) (.+).$","unit","^Change value of \"(.+)\" to (.+).$","^Change status of \"(.+)\" to \"(.+)\".$","^Send message \"(.+)\".$","^Close relay (.+).$","number","^Open relay (.+).$","^Change trace status to (.+).$","^Change relay status to (.+).$","^Closing relay (.+).$","^Opening relay (.+).$","^Update bulk operation$","^Update bulk operation: (.+)$","^Update firmware to: \"?(.+?)\"? \\(version: (.+)\\)\\.?$","^Update firmware to: \"?(.+?)\"?\\.?$","^Update configuration to (.+).$","^Apply device profile: (.+).?$","^Execute generic command: (.+).?$","command","^Failed to refresh application. : Cannot refresh non local-hosted application.$","^Failed to refresh application. : Cannot refresh application without active version id.$","^Scaled down replica set (.+) to (\\d+)$","^Deleted pod: (.+)$","^Container image \"(.+)\" already present on machine$","^Error updating tenant! Cannot insert second configuration for Password code grant internal/Bad Request$","CachedLocaleDictionaryService","cachedDictionary","TranslateCustomLoader","http","optionsService","cachedLocaleDictionaryService","getTranslation","langsDetails","tap","dictionary","getDictionaryWithTrimmedKeys","catchError","mapKeys","trimTranslationKey","HttpClient","trim","TranslateParserCustom","getValue","trimmedKey","translated","TranslateDefaultParser","ForceHtmlTranslateDirective","element","_ref","htmlUpdateEvent","EventEmitter","onTranslationChangeSub","onTranslationChange","event","checkNodes","onLangChangeSub","onLangChange","onDefaultLangChangeSub","onDefaultLangChange","isEqual","currentParams","ngAfterViewChecked","isLookupKeyMissing","nativeElement","lookupKey","getLookupKey","translateAndUpdateHtmlContent","emit","unsubscribe","complete","innerHTML","lookupKeyExist","TranslateService","ElementRef","ChangeDetectorRef","Directive","require","angularLocalesLanguageMap","en","en-EN","translateLoaderFactory","httpClient","localePath","localePathFactory","languagesFactory","localeId","appStateService","getAngularLocalesLanguageString","toLowerCase","toString","language","I18nModule","providers","provide","LOCALE_ID","useFactory","deps","useValue","multi","TranslateLoader","TranslateCompiler","useClass","TranslateFakeCompiler","MissingTranslationHandler","TranslateStore","NgxTranslateService","USE_STORE","USE_DEFAULT_LANG","USE_EXTEND","DEFAULT_LANGUAGE","forRoot","ngModule","I18nModule_1","NgModule","exports","TranslateModule","imports","HttpClientModule","declarations","moduleSrc","src","l","Boolean","join","Function","Map","loadLocale","moduleLang","has","fetch","res","text","module","catch","ngxTranslate","DEFAULT_SEPARATOR","queryStringLang","saveInLocalStorage","localStorage","getItem","TranslateService_1","SAVE_LANGUAGE_KEY","switchToLanguage","loadLocales","lessSpecificModuleLang","shift","e_1","setLanguage","registerLocaleData","default","setDefaultLang","use","firstSupportedLanguage","preferredLanguage","localStorageLang","browserLangs","find","getSupported","convertToLanguageCodePO","sep","indexOf","langMain","langSpecific","getNativeLanguage","nativeName","setItem","startsWith","getQueryParameter","navigator","property","propertyLanguages","queryKey","search","substring","pair","DatePipe","locale","transform","format","timezone","valueInBounds","valueBefore","valueBeyond","isNaN","min","Pipe","NgDatePipe","LoadMoreComponent","useIntersection","hidden","class","maxIterations","onLoad","counter","showNoMoreDataHint","LOAD_SAME_PAGE_THRESHOLD","hasMore","paging","totalPages","currentPage","nextPage","ngAfterContentInit","intersectionObserver","IntersectionObserver","buttonInView","container","observe","shouldShowNoMoreDataHint","disconnect","loadMore","stopPropagation","intersectionLoading","loadUntilIntersected","getLoadingThreshold","shouldSwitchMode","noMoreDataHint","isIntersecting","Output","HostBinding","ForOfDirective","tpl","vcr","componentFactoryResolver","cachedData","loadMoreMode","dataPipe","unsubscribe$","fetchData","obs$","notFoundTemplate","source","realtime","comparator","ngOnInit","handleRealtime","ngOnChanges","changes","c8yForPipe","c8yForOf","unsubscribePaging","reRender_1","hasMoreData","pagingSub","render","onCreate$","takeUntil","insert","onUpdate$","update","onDelete$","coerceNumberProperty","reRender","clear","index","context","$implicit","createEmbeddedView","shouldUseLoadMoreButton","createLoadMoreButtonComponent","append","loadMoreData","componentFactory","resolveComponentFactory","instance","createComponent","checkForDuplicates","comparisionResult","view","itemB","splice","viewRef","updatedItem","forMatchingEmbeddedViewRef","markForCheck","idToRemove","NaN","destroy","callback","cached","TemplateRef","ViewContainerRef","ComponentFactoryResolver","HumanizeAppNamePipe","internalApps","administration","cockpit","devicemanagement","appNameOrApp","appName","getAppName","isPublicApp","stream","getFirstDefined","values","negate","HumanizePipe","humanize","upperFirst","HumanizePipe_1","IconDirective","el","renderer","c8yMatch","klasses","currentClasses","icon","updateIcon","isC8y","getClasses","classes","_icon","newClasses","klass","removeClass","addClass","Renderer2","ICONS","memoize","resolver","memoizedFnName","_memoize","Permissions","appState","inventory","canEdit","roleIds","mo","checkIfCanEdit","hasRole","roleId","Error","hasAllRoles","hasAnyRole","checkIfOwner","currentUserName","checkWithRequest","moName","partialUpdateObject","success","err","InventoryService","UserService","IfAllowedDirective","permissions","allowAny","rolesIds","LoadingComponent","MapFunctionPipe","mappingFunction","OutletDirective","viewContainer","_element","Element","removeChild","parentElement","parent_1","parentNode","insertBefore","factory","component","_parent","ProgressBarComponent","ShortenUserNamePipe","firstName","lastName","parsedFirstName","substr","parsedLastName","TenantUiService","tenantService","isManagementTenant","current","isEnterpriseTenant","hasApp","hasBranding","hasSslManagement","hasUserHierarchy","hasDataBroker","isAvailable","TenantService","UserPreferencesStorageLocal","LOCAL_STORAGE_KEY","jsonStore","saveJsonStore","UserPreferencesStorageInventory","TYPE","fragmentType","updateMo","out","UserPreferencesService","storage","local","first","getForUser","setForUser","rawKey","getRawKey","getStorage","initializeServices","userPreferences","queryStringLanguage","firstLanguage","u","Status","ICON_LIST","CommonModule","DataModule","C8Y_APP","APP_INITIALIZER","CommonModule_1","NgCommonModule","TooltipModule","entryComponents","ActionBarComponent","navigatorOpen","hasTabs","isTabsHorizontal","isPageToolbarExpanded","uiActionBar","getSortedItems","byPriority","ActionBarModule","BsDropdownModule","CollapseModule","RouterModule","forChild","HOOK_ACTION","ActionService","ActionOutletComponent","getByPriority","invoke","action","ActionComponent","actionService","disabled","ActionModule","AlertService","MAX_ALERTS","ALERT_TIMEOUT","alert","addAlert","addByText","txt","detailedData","changeAlerts","areSame","fieldsToUpdate","removeLastDanger","firstDangerAlert","reverse","saveSuccess","savedObject","createSuccess","createdObject","clearAll","danger","info","warning","addServerFailure","hasRelevantMessage","statusText","alert1","alert2","onClose","onDetail","newAlerts","hideAutomaticallyIfNeeded","removeOldestIfMax","isSuccess","noDetails","alertTimeout","timeout","firstRemoved","slice","AlertDetailsComponent","AlertComponent","alertService","containDetailsComponent","ContentChild","AlertOutletComponent","position","detailDisplayedAlert","isStatic","getClass","close","showDetails","mode","setDetailsContent","hasDetails","closeDetails","isDetailsShow","isTemplateRef","content","contents","Attribute","AlertTextComponent","AlertModule","NavigatorNode","children","parents","routerLinkExact","open","draggable","droppable","dragged","draggedHover","confirm","_priority","snakeCase","childrenPriorities","openOnStart","node","updateChildren","ix","pix","updateHidden","predicate","compareLabel_1","toLocaleLowerCase","matches","found","child","empty","click","drop","$event","expandDragTimeout","dragStart","dataTransfer","setData","dragEnd","clearData","dragEnter","preventDefault","expand","dragLeave","expander","traverse","sort","a","NavigatorNodeRoot","addRoot","nodeData","localParent","parent","createNode","HOOK_NAVIGATOR_NODES","NavigatorService","firstUrl","rootNode","nodes","noParent","withParent","sortedNodes","openOnFirstUrl","isActive","HeaderService","navigatorService","DELAY_TO_AVOID_FLICKERING_ON_ASYNC_NODES","hasItemsInNavigator$","delay","title","nav","header$","header","navigatorOpen$","hasItems","titleReference","document","querySelector","elementRef","innerText","hideNavigator","documentElement","clientWidth","largeWidth","navigatorHiddenOnStartup","toggleNavigator","closeNavigator","configNavigator","config","changeTitle","newTitle","pageTitleUpdate","changePageTitle","verifyIfNavOpen","debounceTime","shouldToggle","shouldShowBreadcrumbs","breadcrumbs","HOOK_TABS","TabsService","tabs","prepareTabs","orientation$","firstTabWithDefinedOrientation","tab","orientation","tabsHorizontal","sortTabs","self","findIndex","priorityOrder","aTranslatedLabel","bTranslatedLabel","translatedLabelOrder","localeCompare","BootstrapComponent","actionBar","headerService","showPoweredBy","noAppsMargin$","hiddenOnStartup","tabsOrientation","BreadcrumbItemComponent","BreadcrumbOutletComponent","showAll","normalizePath","HOOK_BREADCRUMB","BreadcrumbService","sortByPreferredPath","selectPreferredByPath","preferredPath","bc","BreadcrumbComponent","breadcrumbService","contentChildItems","toArray","ContentChildren","BreadcrumbModule","NavigatorItemComponent","iconTemplate","NavigatorIconComponent","PopoverConfirmComponent","buttons","isOpen","containerClass","outsideClick","show","buttonStatus","handleOutsideClick","PopoverDirective","NavigatorNodeComponent","nodeClick","childrenNodes","expandParentIfActive","expandCollapse","routerLinkActive","recursive","forNode","updateIconTemplate","updateIconComponent","componentType","iconComponent","iconSlot","iconComponentFactory","read","RouterLinkActive","ViewChildren","NavigatorNodeComponent_1","RightDrawerComponent","quickLinks","helpAndSupport","TitleOutletComponent","zone","runOutsideAngular","NgZone","TitleComponent","HOOK_SEARCH","SearchService","UserMenuService","userMenuItems","documentationItems","HOOK_DOCS","DocsService","getBaseUrl","getUserGuideLink","link","getLink","templateStr","toPromise","links","noDefault","excludeDefault","staticLinks","lnk","partialLink","prefixWithSlash","HeaderBarComponent","searchService","userMenuService","docs","canToggle$","appState$","drawerOpen","headerOpen","toggle","AppSwitcherComponent","applications","listAppsForUser","getHref","apps","orderApps","filterApps","filterVisible","filterCloud","filterDuplicates","visibleApplicationTypes","includes","noAppSwitcher","hideCloudApps","filterFn","cloud","oneCloudApps","otherApp","orderBy","AppIconComponent","model","appIcon","showIcon","iconClass","appNameAbbr","iconStyle","c8yAppIconsList","analyticsbuilder","analytics-builder","apamaepl","white","defaultIconStyle","background-repeat","background-size","height","width","iconFromAppDefinition","findStaticIcon","iconUrl","iconUrlFromAppDefinition","background-image","isEmpty","appContextPathNormalized","cp","iconClassProperty","iconUrlProperty","NavigatorOutletComponent","isShown$","collapseNavigator","trackByPathOrLabel","LoginViews","statusIcons","SUCCESS","WARNING","DANGER","INFO","statusClasses","statusAlert","operationStatusIcons","OperationStatus","PENDING","EXECUTING","SUCCESSFUL","FAILED","operationStatusClasses","_e","ConfirmModalComponent","modal","_labels","ok","cancel","dismiss","hide","labels","BsModalRef","ModalComponent","onDismiss","customFooter","_dismiss","_close","onEnterKeyDown","hasOnlyOneButton","isCancelClickable","isOkClickable","HostListener","ModalService","modalService","modalLabels","initialState","acknowledge","acknowledgeLabel","BsModalService","ModalModule","BsModalModule","PopoverModule","NavigatorModule","CookieBannerService","STORAGE_KEY","COOKIE_BANNER","isCookieBannerShowed$","cookieDescriptions","required","functional","marketing","getCookiePreferencesConfig","settings","getCookieBannerSettings","configuration","setCookies","cookiePreferences","shouldShowCookieBanner","cookieBannerText","getUserCookiePreferences","isConfigCookiePreferencesDefined","isFunctionalCookieDisabled","getCookieDescription","cookieType","transformCookiePreferencesToList","entries","isReadonly","transformCookiePreferencesListToCookiePreferences","cookiePreferencesList","cookiePref","cookie","GainsightService","cookieBannerService","tagFunction$","GAINSIGHT_URL","GAINSIGHT_GLOBAL_SCOPE","SCRIPT_EXECUTION_WAIT_TIME","OPTIONS_KEY_CATEGORY","OPTIONS_KEY_NAME","loadTag","accountId","identify","scriptTag","createElement","gainsightKey","loadScriptTag","fromEvent","take","instanceId","getInstanceIdFromUrl","tagFunction","versionUI","versionBE","windowRef","userId","phone","userLanguage","triggerEvent","eventName","props","shouldLoadGainsightTag","customProperties","isGainsightDisabled","gainsightEnabled","windowRef_1","firstTag","getElementsByTagName","gainsightGlobalScope_1","q","async","warn","hostName","hostname","ProductExperienceDirective","gainsightService","onClick","actionName","actionData","ProductExperienceModule","SearchOutletComponent","openSearch","focusInputBox","closeDropdown","dropdown","verifyNotEmpty","term","elementToFocus","focus","SearchComponent","onSearch","HighlightComponent","elementClass","highlightedText","textNoHtml","escape","patternNoHtml","patternForRegex","escapeRegExp","SearchResultEmptyComponent","NO_RESULT_FOUND","msg","SearchModule","FormsModule","UserMenuItemComponent","userService","UserEditModalComponent","auth","client","loading","onHide","reason","changedLang","updateUserInAppState","onLanguage","updateAndClose","updateCurrent","password","updateCredentials","persistLanguage","currentUserResult","newCredentials","BasicAuth","LoginService","basicAuth","cookieAuth","api","rememberMe","TOKEN_KEY","TFATOKEN_KEY","OAUTH2_INTERNAL_TYPE","isFirstLogin","GREEN_MIN_LENGTH_DEFAULT","ERROR_MESSAGES","minlength","password_missmatch","maxlength","password_strength","remote_error","password_change","password_reset_token_expired","tfa_pin_invalid","pattern_phonenumber","pattern_newPassword","international_number_required","phone_number_error","pinAlreadySent","passwordConfirm","tfaExpired","SUCCESS_MESSAGES","password_changed","password_reset_requested","resend_sms","send_sms","passwordStrengthSetting","enforcePasswordStrength","greenMinLength","passwordStrengthValidity","localhostRegExp","localhostIpRegExp","showTenantRegExp","autoLogout","initLoginOptions","getTenant","isOAuth2","grantType","loginMode","oauthOptions","redirectToOauth","initRequest","fullPath","_platformLocation","href","redirectUrl","encodeURIComponent","originUriParam","errorPattern","isTfaExpired","hookResponse","response","EMPTY","apiCall","willLogout","json","clone","logout","getGreenMinLength","getBasicAuthLoginOption","getEnforcePasswordStrength","loginOption","isString","getPasswordStrengthValidity","strengthValidity","getPasswordStrengthEnforced","all","cleanMessages","addSuccessMessage","successKey","successMessage","getAuthStrategy","authStrategy","token","getStoredToken","tfa","getStoredTfaToken","setCredentials","useBasicAuth","credentials","login","setAuth","tenantRes","switchLoginMode","userRes","verifyAppAccess","getSupportUserName","storeBasicAuthToken","authFulfilled","isPasswordGrantLogin","URLSearchParams","grant_type","tfa_code","urlParams","method","headers","content-type","cleanLocalStorage","isSupportUser","showTenant","isLocal","isShowTenant","reload","resData","reset","tslib_1.__read","redirect","replaceState","cleanSessionStorage","saveTFAToken","tfaToken","ex_3","saveToken","sessionStorage","removeItem","basicAuthLoginOption","getStoredCredentials","decodeToken","decodeURIComponent","atob","CookieAuth","Realtime","LocationStrategy","PasswordConfirmModalComponent","loginService","passwordConfirmedEmitter","strategy","createNewClient","baseUrl","emitSuccessAndClose","Client","PasswordService","DEFAULT_PASSWORD_MIN_LENGTH","GREEN","colorName","color","passwordStrength","PasswordStrength","YELLOW","RED","confirmPassword","hasLowerCase","hasUpperCase","hasNumbers","hasSpecialChars","getStrengthColor","getDefaultPasswordMinLength","UserTotpSetupComponent","totpSetupVerified","activateTotp","UserEditComponent","passwordService","modalConfirmService","bsModalService","onUser","onCancel","userHasActiveTotp","userCanSetupTotp","isPhoneRequired","_user","userIsExternal","userOrigin","twoFactorAuthenticationEnabled","getTfaSettings","enabledOnSystemLevel","enabledOnTenantLevel","isTfaEnabled","initializeTotpSettings","setupTotp","save","saveAfterPasswordConfirmation","onNewPasswordChanged","newPassword","canUserSetupTotp","getActivityTotp","totpActivity","tfaStrategy","confirmed","UserMenuOutletComponent","copyIt","copied","handler","handleEvent","clipboardData","addEventListener","execCommand","removeEventListener","editUser","activateSupportAccess","companyName","successMsg","enableSupportUser","refreshCurrentUser","deactivateSupportAccess","textWithCompany","textWithoutCompany","isTenantAdmin","disableSupportUser","PasswordCheckListComponent","passwordStrengthChecker","minGreenLength","checklist","check","contextualColor","onPasswordChange","requirement","checked","PasswordConfirm","validate","abControl","controlToCompareWith","PasswordConfirm_1","NG_VALIDATORS","useExisting","PasswordStrengthCheckerService","PasswordStrengthComponent","passwordStrengthCheckerService","strength","NewPasswordComponent","changePassword","passwordEnforced","loadPasswordStrengthSettings","newPasswordChanged","showPasswordStrength","toggleChangePassword","viewProviders","ControlContainer","NgForm","PhoneValidationDirective","control","validateInternationalPhoneNumber","internationalPhoneNumber","numberValid","phoneNumber","parsePhoneNumberFromString","isValid","setValue","emitEvent","emitModelToViewChange","PhoneValidationDirective_1","ValidationPattern","rules","messages","domain","loginAlias","opcuaBrowsePath","urlSegment","groupName","ip","DefaultValidationDirective","c8yDefaultValidation","validation","valid","minLength","DefaultValidationDirective_1","MinValidationDirective","parsedMin","parseInt","MinValidationDirective_1","MaxValidationDirective","parsedMax","MaxValidationDirective_1","MessageDirective","MessagesComponent","defaults","messageMap","customMessages","directive","changVisibility","toMessage","FormGroupComponent","hasError","hasWarning","hasSuccess","novalidation","VALIDATION_DEBOUNCE_MS","initNgModel","valueAccessor","registerOnTouched","dirty","markAsDirty","updateValueAndValidity","onlySelf","subscription","valueChanges","statusChanges","debounce","timer","customErrorMessage","errors","NgModel","InputGroupListComponent","plus","minus","onRemove","onAdd","InputGroupListContainerDirective","listProjections","last","elements","JsonValidationPrettifierDirective","ngCtrl","invalidJSON","debounceTimeInMs","abstractCtrl","clearValidationMessage","validateInputAndPrettify","closed","validJsonObject","pretty","setErrorAndValidationMessage","setErrors","invalidBodyTemplate","NgControl","TextAreaRowHeightDirective","elem","rows","minHeightPerRow","convertedValue","heightPerRow","setHeight","setStyle","RequiredInputPlaceholderDirective","translationService","shouldSkipRequiredHint","closest","req","updatePlaceholder","getTextForPlaceholder","requiredText","requiredTextIndex","lastIndexOf","setAttribute","IpRangeInputListComponent","ipRangeList","cidr","FilterInputComponent","filterChange$","filterTerm","CARRIAGE_RETURN_KEY","CARRIAGE_RETURN_CODE","code","keyCode","NgFormsModule","TotpChallengeComponent","users","verify","onSuccess","verifyCode","verifyTotpCode","SmsChallengeComponent","smsToken","resendTfa","verifyTFACode","useOAuthInternal","verifyCodeWithOauth","verifyCodeWithBasicAuth","resendTFASms","e_2","loginWithTFA","e_3","e_4","TotpSetupComponent","totpSecret","secretQrUrl","rawSecret","otpAuth","qrCodeImage","generateTotpSecret","ex_1","ReadAsType","ProvidePhoneNumberComponent","onChangeView","requestInProgress","sendTfa","savePhoneNumber","sendTFASms","SmsChallenge","AuthenticationModule","QRCodeModule","UserTotpRevokeComponent","revokeEmitter","revoke","totpRevokeSecret","UserModule","HeaderModule","ChangePasswordComponent","passwordPattern","newPasswordConfirm","emailReadOnly","passwordStrengthEnforced","TOKEN_PARAM","EMAIL_PARAM","passwordStrengthColor","resetPassword","Credentials","CredentialsComponent","LOGIN_VIEWS","showLoginForm","showBasicAuth","PASSWORD_RESET_HEADER_NAME","NO_PHONE_HEADER_NAME","visibleOnLoginPage","handlePasswordReset","handleSmsChallenge","handleTotpChallenge","handleNoPhoneNumberProvided","ChangePassword","TotpSetup","TotpChallenge","ProvidePhoneNumber","LoginComponent","currentView","None","displayAlerts","getResetPasswordToken","loginAutomatically","handleLoginTemplate","onkeyup","setView","RecoverPasswordComponent","sendPasswordResetMail","TotpAuthComponent","isSetup","onTotpSuccess","StrengthValidatorService","isStrong","isPasswordGreen","PasswordStrengthValidatorDirective","forced","strengthFulfilled","PasswordStrengthValidatorDirective_1","LoginModule","LoginModule_1","C8yFormsModule","TabComponent","TabsOutletComponent","showLeft","showRight","visibleTabs","scrollSubscription","scrollSubscribe","navigateTo","navigate","scroll","direction","getDimensions","widthScroll","targetScroll","scrollLeft","unlisten","fromEventPattern","listen","updateScroll","elTabs","tabsContainer","scrollWidth","TabsModule","CookieBannerPreferencesModalComponent","closeSubject","configCookiePreferencesList","configCookiePreferences","modalRef","CookieBannerComponent","shouldDisable","onConfigurePreferences","disableButtons","userCookiePreferences","setCookieBannerVisibility","acceptCookies","shouldShow","showBanner","BootstrapModule","DropAreaComponent","loadingMessage","alwaysShow","clickToOpen","dropped","maxAllowedFiles","Infinity","isOver","area","files","onFilesSelected","style","offsetHeight","onOver","showPicker","picker","onPick","onDrop","stopDragging","shouldShowFilesList","isFilesArrayEmpty","hasEmptyFiles","isTooManyFiles","onDelete","filesNameString","clearErrors","getFilesNamesAsString","compose","isAnyFileEmpty","file","readAsJson","TEXT","readAsText","readAsArrayBuffer","ARRAY_BUFFER","readAsBinaryString","BINARY_STRING","readAsDataURL","DATA_URL","reader","FileReader","onload","readyState","ViewContext","DropAreaModule","FilePickerComponent","onFilesPicked","uploadChoice","fileBinary","droppedFiles","onFileDropped","clearInputFromUrl","fileUrl","fileToSave","clearSelectedFiles","dropArea","onFileUrlChange","urlStr","FilePickerModule","C8yCommonModule","DatePickerComponent","onDateSelected","fgDatePicker","FormGroup","dateFrom","FormControl","dateTo","clearFilter","DatePickerModule","ReactiveFormsModule","BsDatepickerModule","RouterTabsResolver","snapshot","latestChildren","routeConfig","mergeMap","getGuards","guard","canActivate","routerStateSnapshot","every","guards","showIf","ViewContextServices","contextToService","services","Device","Group","User","Application","SubscribedApplications","Tenant","Report","ContextRouteService","tabsResolver","tabsService","lastAddedTabs","init","routerSubscription","redirectToFirstTab","dataSubscription","updatedContext","updateTabs","refreshContext","serviceInstance","detailsUrlRegex","getDetailUrl","contextData","contextRegex_1","childrenRegex_1","contextChanged","childrenAffected","NEVER","needsRedirect","firstTab$","navigateByUrl","replaceUrl","parseUrl","PRIMARY_OUTLET","segments","HOOK_ONCE_ROUTE","RouterService","contextRouteService","routes","addRoute","addRoutes","emptyRoute","resetConfig","tslib_1.__spread","convertRoute","initialConfig","ContextRouteComponent","refreshTabs","ActivatedRoute","callsSubject","asObservable","hookIntoClientFetch","hookFilter","hookRequest","onFinish","onStart","resolveData","cb","bind","fetchPromise","responseInterceptor","DataModule_1","ContextRouteGuard","caches","paramMap","clearDetailCached","detailCached","getCache","withChildren","EmptyComponent","SendStatus","PushStatus","SendStatusLabels","PushStatusLabels","routerService","RouterModule_1","NgRouterModule","deviceAvailabilityIconMap","sendData","_a$1","AVAILABLE","UNAVAILABLE","UNKNOWN","NOT_MONITORED","_b$1","CONNECTED","DISCONNECTED","MAINTENANCE","device","lastMessage","Date","tooltips","sendStatusConnected","ɵ0$1","sendStatusDisconnected","pushStatusConnected","pushStatusDisconnected","maintenance","DeviceStatusComponent","_mo","setStatusProperites","requiredAvailability","availabilityStatus","pushStatus","sendStatus","getMaintenanceStatus","getSendPushStatus","maintenanceStatus","tooltip","getSendStatusTooltip","getPushStatusTooltip","availability","c8y_Availability","DeviceStatusModule","GuideHrefDirective","htmlAnchor","hasAttribute","c8yGuideHref","GuideDocsComponent","destroyed$","ReplaySubject","translateDirective","replaceAnchorAttributes","findGuideAnchors","guideHref","getAttribute","nodeName","attributes","getNamedItem","childNodes","searchResult","guide","baseHref","descendants","DocsModule","ArrayTypeComponent","to","fieldGroup","CONFIG","types","ArrayTypeComponent_1","FieldArrayType","FieldCheckbox","defaultOptions","templateOptions","indeterminate","formCheck","FieldCheckbox_1","extends","changeDetection","ChangeDetectionStrategy","OnPush","FieldType","WrapperFormField","maxHelpBlockLength","showDescriptionAsPopup","wrappers","WrapperFormField_1","FieldWrapper","FieldInput","FieldInput_1","ObjectTypeComponent","ObjectTypeComponent_1","FieldRadio","FieldRadio_1","FIELD_TYPES","fieldTypeFactory","formlyConfig","typeConfig","tslib_1.__assign","DynamicFormsUIThemeModule","FormlyModule","FormlySelectModule","FORMLY_CONFIG","TranslateExtension","prePopulate","_translated","expressionProperties","templateOptions.label","templateOptions.description","templateOptions.placeholder","example","templateOptions.options","registerTranslateExtension","extensions","extension","I18nModule$1","ɵ0$2","C8yJSONSchema","toFieldConfig","schema","c8yOptions","mappedField","mapSource","const","writeOnly","autocomplete","examples","enum","FormlyJsonschema","c8yValidationConfigFactory","validationMessages","FilteringActionType","ValidationModule","ɵ0$3","DynamicFormsModule","HOOK_COMPONENTS","HOOK_COMPONENT","DynamicComponentService","getComponentsViaDeprecatedHook","cmps","cmp","componentsViaDeprecatedHook","__MODE__","getById$","size","DynamicComponentComponent","dynamicComponentService","notFoundError","expandErrorDetails","callLifeCycleHooks","callOnBeforeSaveHook","componentId","loadComponent","dynamicComponent","configComponent","componentRef","hook","onBeforeSave","DynamicComponentModule","DashboardChildActionComponent","DashboardChildTitleComponent","DashboardComponent","sanitizer","columns","gap","dashboardChange","lastRow","DEFAULT_ROW_SIZE","dashboardRect","calculateRowSize","bypassSecurityTrustStyle","rowSize","onResize","getLastRow","updateRectSize","widget","ele","getBoundingClientRect","emitChange","DomSanitizer","forwardRef","DashboardChildComponent","DashboardChildChange","childToChange","MIN_WIDTH","MIN_HEIGHT","PIXEL_SIZE_THRESHOLD","diffX","diffY","dashboard","dragSource","moved","move","getPixelSize","resizeDimension","setPixelSize","getDimensionSize","prev","dimension","setDimension","arrangePipe","getDimensionPosition","x","findFreeDimension","getCollided","collapseUpAll","w","ds","newPosition","collapseUp","arrangeAll","arrange","spacing","origin","dimensions","notIfColliding","columnSize","pxWidth","pxHeight","moveEvent","draggedElement","rect","left","top","pointerPosition","round","pointer","resizePosition","row","nextElementSibling","doesCollide","currentDimension","actions","isResize","isDragging","_pxWidth","_pxHeight","margin","isFrozen","changeStart","changeEnd","intersected","getOrder","card","card-dashboard","on-resize","setDynamicDimension","intersectionObserver_1","childInView","resizeStarted","positioning","changeSubscription","resize$","dragStarted","drag$","observer","unobserve","WidgetsDashboardComponent","isDisabled","widgetMargin","translateWidgetTitle","defaultHeight","defaultWidth","allowFullscreen","canDelete","onAddWidget","onEditWidget","onDeleteWidget","onChangeDashboard","onEditDashboard","onDeleteDashboard","onFreeze","onChangeStart","onChangeEnd","toggleFullscreen","doc","fullScreen","exitFullscreen","msExitFullscreen","mozCancelFullScreen","webkitExitFullscreen","requestFullscreen","msRequestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","ALLOW_KEYBOARD_INPUT","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","msFullscreenElement","DashboardModule","DragDropModule","C8yStepperIcon","templateRef","C8yStepper","disableDefaultIcons","edit","onStepChange","_iconOverrides","_stepIndex","_icons","_stepIndexSubscription","getIndicatorType","_state","_getIndicatorType","STEP_STATE","EDIT","DONE","setIndex","C8yStepper_1","CdkStepper","C8yStepperProgress","onStepClicked","stepSelected","C8yStepperButtons","stepper","pending","onNext","onBack","onCustom","showBtns","back","custom","observers","steps","stepControl","invalid","statusChangeSubscription","currentValue","selected","completed","previous","Host","CdkStep","displayDefaultIndicatorType","StepperModule","CdkStepperModule","STEPPER_GLOBAL_OPTIONS","ɵ0$4","ListItemActionComponent","ListItemCollapseComponent","collapseWay","ListItemFooterComponent","ListItemComponent","active","collapsed","collapsedChange","showFooter","showActions","showCollapse","dropdownUp","pulse$","destroy$","ACTION_ITEM_HEIGHT","classList","ngAfterContentChecked","itemActions","itemFooter","itemCollapse","showDropdownUp","dropdownDownFits","innerHeight","toggleCollapsed","pulse","ListItemBodyComponent","ListItemRadioComponent","onSelect","radio","firstChange","change","onChange","onTouched","registerOnChange","writeValue","ListItemRadioComponent_1","NG_VALUE_ACCESSOR","ListItemTimelineComponent","ListGroupComponent","timeline","timelineComponent","ListItemIconComponent","ListItemCheckboxComponent","select","ListItemCheckboxComponent_1","CheckboxControlValueAccessor","ListGroupModule","AuditLogComponent","audit","withTotalPages","records","AuditService","AuditLogModule","CellRendererDefDirective","HeaderCellRendererDefDirective","FilteringFormRendererDefDirective","ColumnDirective","ratiosByColumnTypes","numeric","text-short","text-long","GridDataSource","loadingSubject","dataSourceSubject","dataStatsSubject","filteredSize","currentPageSize","firstPageSize","dataSelectionSubject","filteredDataIds","resultListSubject","loading$","data$","stats$","selection$","resultList$","connect","collectionViewer","loadData","pagination","searchText","serverSideDataCallback","selectable","selectionPrimaryKey","infiniteScroll","clientSideData$","initialData","transformedData","flow","doClientSideSearch","doClientSideFiltering","doClientSideSorting","doClientSidePagination","serverSideData$","selection","enabled","primaryKey","finalize","resolveValue","resolveFunction","normalizeNil","isNil","filterPredicate","propPaths","regexSearch","createRegexSearch","itemWithResolvedValues","pick","omitBy","cellValue","actives","sortOrder","sortingState","paths","orders","chunk","filterValue","escapeRegExpPattern","ModalSelectionMode","DataGridComponent","hostRef","cd","cfr","loadMoreItemsLabel","loadingItemsLabel","noMatchingItemsLabel","dataSource","filteringLabelsParams","filteredItemsCount","allItemsCount","paginationLabelParams","pageFirstItemIdx","pageLastItemIdx","itemsTotal","possiblePageSizes","minPossiblePageSize","displayOptions","striped","bordered","gridHeader","rowMouseOver","rowMouseLeave","rowClick","onConfigChange","itemsSelect","columnNames","styles","tableCursor","gridTemplateColumns","gridInfiniteScrollColumn","searchText$","filteringApplied","totalPagesCount","selectedItemIds","currentPageSelectionState","allSelected","allDeselected","builtInActionType","Edit","Delete","Export","resizeHandleMouseDown$","resizeHandleContainerMouseMove$","resizeHandleContainerMouseUp$","possiblePageSize","actionControls","bulkActionControls","currentPageEmpty","isItemSelected","stats","createLoadMoreComponent","updateFilteringLabelsParams","updatePaginationLabelParams","updateColumns","updateGridColumnsSize","thEls","thRefs","setupResizeHandle","trackByName","resolveCellValue","changeSortOrder","columnName","updateSorting","emitConfigChange","applyFilter","filteringModifier","updateFiltering","ApplyFilter","payload","resetFilter","ResetFilter","clearFilters","externalFilterQuery","updateFilteringApplied","isColumnFilteringApplied","filterable","updatePagination","itemsPerPage","page","recreateLoadMoreComponent","scrollToTop","loadNextPage","getCellRendererSpec","_getCellRendererSpec","getHeaderCellRendererSpec","getFilteringFormRendererSpec","getColumnRenderer","filteringFormRendererComponent","setAllItemsSelected","setItemsSelected","setAllItemsInCurrentPageSelected","itemIds","union","without","onColumnDrop","previousIndex","currentIndex","updateColumnNames","visible","gridTrackSize","specialColumn","sortable","positionFixed","withColumnDefaults","dataType","headerCSSClassName","cellCSSClassName","clearMouseHighlights","targetColumnName","headerBeingResized","requestAnimationFrame","wrapper","horizontalOffset","clientX","offsetLeft","_parseInt","getSelection","removeAllRanges","columnRenderer","rendererTemplate","cellRendererComponent","headerCellRendererComponent","columnRenderers","loadMoreComponent","infiniteScrollContainer","loadNextLabel","loadingLabel","scrollContainer","scrollTop","CdkHeaderCell","CellRendererComponent","spec","prevSpec","rendererType","Type","rendererInjector","CellRendererContext","ngDoCheck","FilteringFormRendererComponent","defaultRendererFilterText","FilteringFormRendererContext","DataGridModule","CdkTableModule","C8YCommonModule","PaginationModule","HelpComponent","docsService","isCollapsed","SUPPORTED_LANGUAGES","getUrl","parseVersion","endsWith","clean","requestContent","resolveIcon","helpContent","XMLHttpRequest","onreadystatechange","responseType","setRequestHeader","send","majorNumber","floor","sectionSplit","sectionQuery","sectionNode","allPossibleElementsToAttach","allPossibleElementsToAttach_1","tslib_1.__values","allPossibleElementsToAttach_1_1","tagName","HelpModule","RealtimeButtonComponent","stop","start","RealtimeModule","SelectModalComponent","bsModalRef","subTitle","MULTI","disableSelected","showFilter","areMoreEntries","listItems","debouncer","itemsPromise","selectedId","obj","updatePipe","updateChoice","getOutput","selectedOption","SelectModalFilterPipe","extractValues","filterContainString","SelectModalModule","SelectComponent","applyLabel","textFilter","labelText","filteredItems","searchFilter","sizeToShowFilter","labelsForSelectAll","allFiltered","showAllLabel","itemsSelected","stopClicks","preventClick","isOpenChange","updateSelected","outterSelected","isSelected","isAllItemsSelected","isAllFilteredSelected","applyChanges","selectAll","onChangeItem","updateFiltered","search_1","getSelectAllToggleStatus","getLabel","isAllSelected","updateLabel","selectedLabel","BsDropdownDirective","TypeaheadComponent","allowFreeEntries","displayProperty","selectedChange","KEYCODE_UP","KEYCODE_DOWN","KEYCODE_TAB","KEYCODE_ENTER","KEYCODE_ESC","doBlur","getDisplayProperty","onShown","searchControl","handleKeyboard","blur","upOrDown","ctrl","notExisting","TypeaheadComponent_1","SelectModule","CoreModule","CoreModule_1","c8yFormsModule","c8yStepperModule","QuickLinkComponent","kebabCase","QuickLinkModule","HOOK_DYNAMIC_PROVIDER_CONFIG","ProviderConfigurationNodeFactory","navigation","ca","checkCanActivate","forkJoin","canActivateResult","wrapIntoObservable","caResult","isPromise","ProviderConfigurationService","activatedRoute","listUrl","ProviderConfigurationService_1","NO_DETAIL_ID","entity","Service","ProviderDefinitionsService","ProviderConfigurationComponent","providerDefinitionsService","providerConfigurationService","jsonschema","layout$","layout","formState","saveRoles","changeProvider$","providerInput$","form","reload$","updatedConfiguration$","allProviders$","providers$","input","displayName","configuration$","removeEncryptedValues","selectedProvider$","newProvider","provider","fieldConfig","ɵdefineHiddenProp","templateOptions.disabled","saveProviderConfiguration","configurationUpdatedSuccessMsg","markAsPristine","err_1","deleteProviderConfiguration","deleteConfigurationModalTitle","deleteConfigurationModalBody","deleteConfigurationModalOkBtnLabel","deleteConfigurationModalCancelBtnLabel","configurationDeletedSuccessMsg","err_2","ProviderConfigurationRouteFactory","endpoint","ProviderConfigurationModule","ProviderConfigurationModule_1","RealtimeService","subjects$","onAll$","entityOrId","subject$","getSubjectForChannel","channel","realtimeAction","getIdString","reference","String","getChannel","RealtimeSubject","realtimeChannel","realtimeSubscription","OperationBulkRealtimeService","ManagedObjectRealtimeService"],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAIA,GAAgB,SAASC,EAAGC,GAI5B,OAHAF,GAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,IAGrB,SAASO,GAAUR,EAAGC,GAEzB,SAASQ,IAAOC,KAAKC,YAAcX,EADnCD,GAAcC,EAAGC,GAEjBD,EAAEY,UAAkB,OAANX,EAAaC,OAAOW,OAAOZ,IAAMQ,EAAGG,UAAYX,EAAEW,UAAW,IAAIH,GAG5E,IAAIK,GAAW,WAQlB,OAPAA,GAAWZ,OAAOa,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAIZ,KADTW,EAAIG,UAAUF,GACOhB,OAAOU,UAAUL,eAAee,KAAKL,EAAGX,KAAIU,EAAEV,GAAKW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B,EAAKyzB,SAASa,SAASt0B,EAAKwzB,GAAG7O,cAAeyP,MAEhDt8B,KAAK87B,eAAiBO,6CA5BZ9O,EAAAA,kBACMkP,EAAAA,aARpB9yB,GAAAA,CADCC,EAAAA,qCAFU6xB,EAAa36B,GAAA,CAHzB2sB,EAAAA,UAAU,CACTzjB,SAAU,eAECyxB,GAAb,GA2CaiB,GAAQ,CACZ,OACA,KACA,cACA,QACA,aACA,OACA,eACA,aACA,iBACA,QACA,YACA,UACA,SACA,SACA,SACA,SACA,OACA,YACA,SACA,cACA,UACA,QACA,OACA,WACA,MACA,OACA,SACA,QACA,OACA,OACA,SACA,MACA,OACA,SACA,MACA,OACA,QACA,UACA,WACA,SACA,WACA,eACA,iBACA,QACA,UACA,UACA,SACA,OACA,OACA,SACA,OACA,WACA,cACA,MACA,WACA,SACA,WACA,MACA,OACA,eACA,gBACA,YACA,UACA,WACA,QACA,cACA,QACA,UACA,WACA,YACA,aACA,WACA,OACA,YACA,SACA,WACA,QACA,QACA,QACA,YACA,cACA,QACA,OACA,SACA,WACA,SACA,WACA,aACA,aACA,cACA,UACA,OACA,QACA,UACA,SACA,OACA,UACA,YACA,aACA,aACA,MACA,QACA,UACA,UACA,SCxJT,SAAgBC,GAAQC,GACtB,OAAO,SAAC57B,EAAQ4L,EAAQC,GACtB,IAAMC,EAAKD,EAAWxK,MACtBwK,EAAWxK,MAAQ,eAAS,IAAAiK,EAAA,GAAAS,EAAA,EAAAA,EAAArM,UAAAC,OAAAoM,IAAAT,EAAAS,GAAArM,UAAAqM,GAC1B,IAAM8vB,EAAiB,IAAIjwB,EAAM,WAIjC,OAHK5M,KAAK68B,KACR78B,KAAK68B,GAAkBC,EAAAA,QAAShwB,EAAI8vB,IAE/B58B,KAAK68B,GAAgBh8B,MAAMb,KAAMsM,uBCL5C,SAAAywB,EACUC,EACAC,EACAxsB,GAFAzQ,KAAAg9B,SAAAA,EACAh9B,KAAAi9B,UAAAA,EACAj9B,KAAAyQ,KAAAA,EA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3F,KAAKuJ,QAKhBwuF,EAAAp6F,UAAA8wF,KAAA,WACMhxF,KAAKw6F,uBACPx6F,KAAKq3B,SAASnK,YAAYltB,KAAKw6F,sBAC/Bx6F,KAAKw6F,qBAAuB,OAGlCF,EA/BA,CAAiClyF,EAAAA,SClIjCqyF,GAAA,SAAAzyF,GACE,SAAAyyF,EAAYpjE,UACVrvB,EAAApH,KAAAZ,KAAMq3B,IAASr3B,KAMnB,OARkDyI,GAAAA,EAAAA,GAKtCgyF,EAAAv6F,UAAA85F,QAAV,WACE,MAAO,8DALapwC,EAAAA,YADX6wC,EAA4B35F,GAAA,CADxCiI,EAAAA,cACY0xF,GAAb,CAAkDf,mBCFhD,SAAAgB,EAAYrjE,UACVrvB,EAAApH,KAAAZ,KAAMq3B,IAASr3B,KAMnB,OARkDyI,GAAAA,EAAAA,GAKtCiyF,EAAAx6F,UAAA85F,QAAV,WACE,MAAO,8DALapwC,EAAAA,YADX8wC,EAA4B55F,GAAA,CADxCiI,EAAAA,cACY2xF,IAAqChB,umD/NIF,m7HVP/B,SAAC/iF,GAAQ,OAAAA,wRyKqJY","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';\nimport { flatten, isFunction, sortBy } from 'lodash-es';\nimport { combineLatest, defer, from, isObservable, Observable, of, race } from 'rxjs';\nimport { filter, map, merge, startWith, switchMap } from 'rxjs/operators';\n\nexport function fromTrigger(router, refresh, factories) {\n return router.events.pipe(\n filter(evt => evt instanceof NavigationEnd),\n merge(refresh),\n startWith(1),\n switchMap(() => fromFactories(factories, router))\n );\n}\nexport function fromFactories<T>(\n factories?,\n router?: Router,\n withFirstEmpty = true\n): Observable<T[]> {\n return !Array.isArray(factories) || factories.length < 1\n ? of([])\n : defer(() => {\n const factoryObservables = resolveInjectedFactories(factories).map(f => {\n return toObservable(\n Array.isArray(f) ? f : f && isFunction(f.get) ? f.get(getActivatedRoute(router)) : [f],\n withFirstEmpty\n );\n });\n return combineLatest(...factoryObservables);\n }).pipe(map(results => sortByPriority([].concat(...results))));\n}\n\nexport function resolveInjectedFactories(factories) {\n return flatten(factories.map(f => (isFunction(f) ? f() : [f])));\n}\n\nexport function stateToFactory<T>(componentsState): ExtensionFactory<T> {\n const components$ = componentsState.pipe(map((componentSet: Set<T>) => Array.from(componentSet)));\n return { get: () => components$ };\n}\n\nexport function sortByPriority(items) {\n return sortBy(items, 'priority');\n}\n\nfunction toObservable(factoryResult, withFirstEmpty) {\n let observable;\n if (!factoryResult) {\n return of([]);\n } else if (typeof factoryResult.then === 'function' || isObservable(factoryResult)) {\n if (withFirstEmpty) {\n const forceObservable = from(factoryResult);\n const withEmptyFirst = forceObservable.pipe(startWith([]));\n observable = race(forceObservable, withEmptyFirst);\n } else {\n observable = from(factoryResult);\n }\n } else {\n observable = of(factoryResult);\n }\n return observable.pipe(\n map(result => (Array.isArray(result) ? result : [result]).filter(item => !!item))\n );\n}\n\n/**\n * Allows to extend the existing applications from a module.\n */\nexport interface ExtensionFactory<T> {\n /**\n * Allows to resolve the data of an extension point.\n * The return value can be a Promise or Observable\n * (allowing for asynchronous data resolution).\n *\n * @param activatedRoute The current activated route (if possible to resolve).\n */\n get(activatedRoute?: ActivatedRoute): Observable<T[] | T> | Promise<T[] | T> | T[] | T;\n}\n\n/**\n * Extension points allow to extend the application from\n * any module\n */\nexport interface ExtensionPoint<T> {\n /**\n * Observable that emits of array of extensions active at any give time\n */\n readonly items$: Observable<T[]>;\n /**\n * Call the extension factories to refresh them.\n */\n refresh();\n}\n\n/**\n * Helper function to get the activated route in\n * a service (as ActivatedRoute injection only\n * works in components). Works as long as we only use\n * a tree and no child is active at the same time.\n *\n * @param router The current router\n */\nexport function getActivatedRoute(router: Router) {\n if (router && router.routerState && router.routerState.root) {\n let route = router.routerState.root;\n while (route.firstChild) {\n route = route.firstChild;\n }\n return route;\n }\n}\n","import { Observable, BehaviorSubject } from 'rxjs';\nimport { distinctUntilChanged, map } from 'rxjs/operators';\n\n/**\n * A abstract state which should be included in each state.\n * @abstract\n */\nexport abstract class StateService {\n /**\n * Saves the state. Should not be accessible directly. Use map or the getter to access\n * the state. Use functions in the implementation to change the state.\n */\n protected abstract state$: BehaviorSubject<any> | any;\n\n /**\n * Should return the current state of this StateService\n */\n abstract get state();\n\n /**\n * Maps to a property and just returns that property.\n * @param mappedProperty The property to map to.\n */\n map(mappedProperty: (stateProperty) => any): Observable<any> {\n return this.state$.pipe(map(mappedProperty), distinctUntilChanged());\n }\n\n /**\n * Emits a new state.\n */\n protected emitNewState() {\n this.state$.next(this.state);\n }\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport {\n ExtensionPoint,\n fromTrigger,\n sortByPriority,\n stateToFactory\n} from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport { ActionBarItem } from './action-bar.model';\n\n/**\n * A hook to add ActionBarItems using the multi provider extension concept.\n *\n * @example\n * ```typescript\n * providers: [\n * {\n * provide: HOOK_ACTION_BAR,\n * useValue: [{ template: SomeComponent, priority: 10, placement: 'left' } as ActionBarItem],\n * multi: true\n * }\n * ]\n * ```\n *\n */\nexport const HOOK_ACTION_BAR = new InjectionToken('ActionBarFactory');\n\n/**\n * A service which defines action-bar items via the multi provider concept.\n *\n * @example\n * ```typescript\n * // preferred way, multi provider concept:\n * providers: [\n * {\n * provide: HOOK_ACTION_BAR,\n * useValue: [{ template: SomeComponent, priority: 10, placement: 'left' } as ActionBarItem],\n * multi: true\n * }\n * ]\n *\n * // use services:\n * this.actionBarService.add({ template: SomeComponent, priority: 10, placement: 'left' });\n * ```\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ActionBarService extends StateService implements ExtensionPoint<ActionBarItem> {\n items$: Observable<ActionBarItem[]>;\n readonly refreshTrigger = new Subject();\n protected state$ = new BehaviorSubject<Set<ActionBarItem>>(new Set<ActionBarItem>());\n\n /**\n * @ignore\n */\n constructor(private injector: Injector, router: Router) {\n super();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_ACTION_BAR, []),\n stateToFactory(this.state$)\n ]).pipe(\n map((items: ActionBarItem[]) => sortByPriority(items)),\n shareReplay(1)\n );\n }\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state(): Set<ActionBarItem> {\n return this.state$.value;\n }\n\n /**\n * Refreshes the current store.\n */\n refresh() {\n this.refreshTrigger.next();\n }\n\n /**\n * Adds a new item to the action bar in the header and emits a state change.\n * @param item The item to add.\n */\n add(item: ActionBarItem) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes an action bar item from the header and emits a state change.\n * @param item The item to remove.\n */\n remove(item: ActionBarItem) {\n this.state.delete(item);\n this.emitNewState();\n }\n}\n","import { Component, Input, ViewChild } from '@angular/core';\nimport { ActionBarItem } from './action-bar.model';\nimport { ActionBarService } from './action-bar.service';\n\n/**\n * A <c8y-action-bar-item> can be added with content projection.\n * It allows to show items in three positions (left, right\n * or more).\n *\n * @example\n * ```html\n * <c8y-action-bar-item [placement]=\"'right'\">\n * <button class=\"btn btn-link\" (click)=\"addRandom()\"><i class=\"fa fa-plus\"></i> Add random</button>\n * </c8y-action-bar-item>\n * ```\n */\n@Component({\n selector: 'c8y-action-bar-item',\n templateUrl: './action-bar-item.component.html'\n})\nexport class ActionBarItemComponent implements ActionBarItem {\n /**\n * Where the item should be shown. Use \"more\" to place\n * it in a dropdown on the right.\n */\n @Input() placement: 'left' | 'right' | 'more' = 'left';\n\n /**\n * Priority for sorting the list. Higher priority means\n * an earlier position in the list.\n */\n @Input() priority: number = 0;\n\n /**\n * Adds additional classes to the item.\n */\n @Input() itemClass = '';\n\n /**\n * @ignore\n */\n @ViewChild('template', { static: false }) template: any;\n\n private viewInitTimeout;\n\n /**\n * @ignore\n */\n constructor(private actionBarService: ActionBarService) {}\n\n /**\n * @ignore\n */\n ngAfterViewInit() {\n this.viewInitTimeout = setTimeout(() => this.actionBarService.add(this as ActionBarItem));\n }\n\n /**\n * @ignore\n */\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.actionBarService.remove(this as ActionBarItem);\n }\n}\n","/*\n * -----------------------------WARNING---------------------------------\n * This file has an *exact* copy in packages/cli/src/webpack.\n * Any changes to this file must be reflected there, too.\n */\nexport class ApplicationOptions {\n /** Application name (saved to the server). */\n name: string;\n /** Application context path (saved to the server). */\n contextPath: string;\n /** Application key (saved to the server). */\n key: string;\n /** Set to `true` if the application is hybrid and uses Angular and AngularJS simultaneously. */\n upgrade?: boolean;\n /** Path to the branding entry file. */\n brandingEntry?: string;\n /** Path to tsccnfig.json file if TypeScript is used (default: ./tsconfig.json). */\n tsConfigPath?: string;\n /** Entry module for Angular compiler (only used with lazy loaded routes), e.g. `'app.module.ts#AppModule'`. */\n entryModule?: string;\n /** Path to custom index.html (otherwise default one will be used). */\n indexTemplate?: string;\n /** URL to dynamically fetched options. */\n dynamicOptionsUrl?: string;\n /** URL to favicon. */\n faviconUrl?: string;\n /** URL to *.css file which will replace default branding. */\n brandingUrl?: string;\n /** Object with properties that will be converted to CSS custom variables. */\n brandingCssVars?: {\n [key: string]: string;\n };\n /**\n * Allows for adding or overriding languages available in the application.\n *\n * Its keys are language codes and its values are objects with the following properties:\n *\n * - `name`: English name of the language,\n * - `nativeName`: native name of the language,\n * - `url`: full URL to JSON file with compiled translations;\n * if not defined, translations will be loaded from `${localePath}/${langCode}.json`.\n *\n * Example:\n * ```json\n * \"languages\": {\n * \"de\": {\n * \"name\": \"German\",\n * \"nativeName\": \"Deutsch\",\n * \"url\": \"/apps/public/ui-assets/de.json\"\n * }\n * }\n * ```\n */\n languages?: {\n [langCode: string]: {\n name: string;\n nativeName: string;\n url: string;\n };\n };\n /**\n * Allows for adding custom translations. It is an optional property.\n *\n * Its keys are language codes (https://cumulocity.com/guides/users-guide/getting-started/#a-name-languages-a-available-languages)\n * and its values are objects with key-value pairs, where the key is the original string in English and the value - its translation.\n *\n * - `Home`: \"Startseite\"\n *\n * For example you can add the translation of your custom cookie banner configured in the branding settings:\n * ```json\n * \"i18nExtra\": {\n * \"de\": {\n * \"About cookies on Cumulocity IoT\": \"Informationen zu Cookies in Cumulocity IoT\",\n * \"Click Agree and Proceed to accept cookies and go directly to the platform or click on Privacy Policy to see detailed descriptions of the used cookies.\": \"Klicken Sie auf Zustimmen und fortfahren, um Cookies zu akzeptieren und direkt zur Plattform zu gelangen, oder klicken Sie auf Datenschutzrichtlinie, um detaillierte Beschreibungen der verwendeten Cookies anzuzeigen.\"\n * }\n * }\n * ```\n */\n i18nExtra?: {\n [langCode: string]: {\n [key: string]: string;\n };\n };\n /** Path to the folder from which *.po files will be loaded. */\n localePath?: string;\n /** Array of URLs to additional *.css files to be loaded at runtime. */\n extraCssUrls?: string[];\n /** Documentation links settings. */\n docs?: {\n /** Hide default links to documentation. */\n noDefault: boolean;\n /** List of regex strings. Matching default docs URLs will be hidden. */\n excludeDefault: string[];\n /** Additional links to be displayed. */\n links: Array<{\n /** Icon classes with `c8y-icon`, e.g. `c8y-icon c8y-icon-add-user` or `c8y-icon c8y-icon-device-connect`. */\n icon: string;\n label: string;\n url: string;\n type: 'doc' | 'quicklink';\n }>;\n };\n /** Application icon to be displayed in app switcher and header bar. */\n icon?: {\n class?: string;\n url?: string;\n };\n\n // These are the old options\n /** Hide application in app switcher (saved to the server). */\n noAppSwitcher?: boolean;\n /** HTML page title. */\n globalTitle?: string;\n /** Hide \"powered by\" and version info at the bottom of the navigator and in the user menu. */\n hidePowered?: boolean;\n /** URL to support page (set to `false` to hide the link). */\n supportUrl?: boolean | string;\n /**\n * Replacement string for `user` field in audit logs for actions performed by a support user\n * (available placeholders: `{{support_user}}`, `{{supported_user}}`).\n */\n supportUserString?: string;\n /** Enable or disable the right drawer. */\n rightDrawer?: boolean;\n /** Enable or disable breadcrumbs in the header for groups and devices (default: false). */\n breadcrumbs?: boolean;\n /** Collapse navigator on initial load. */\n hideNavigator?: boolean;\n /** Show tabs horizontally or vertically. */\n tabsHorizontal?: boolean;\n /** Additional link to display on login screen. */\n loginExtraLink?: {\n url: string;\n label: string;\n };\n /** Enable or disable storage limitation feature. */\n storageLimitationFeatureEnabled?: boolean;\n /** Name of company handling support requests from app users (displayed in notification message). */\n companyName?: string;\n /** URL template for documentation links (default: `'${docsBaseUrl}${partialUrl}'`). */\n guideHrefTemplate?: string;\n /** Base URL for documentation links. */\n docsBaseUrl?: string;\n /** CSP string to be applied to `index.html` by replacing default values. */\n contentSecurityPolicy?: string;\n /** Enables cloud sensor wizard */\n sensorPhone?: boolean;\n /** Legacy list of imported plugins. */\n imports?: string[];\n /** Show or hide a newsletter subscription checkbox in edit user modal. */\n newsletter?: boolean;\n /** Indicates whether the entry point is traversed from legacy cumulocity*.json app manifest. */\n legacy?: boolean;\n /** Path to the root node_modules dir (useful when working in monorepo setup, e.g. yarn workspaces). */\n rootNodeModulesPath?: string;\n /** Cookie Banner configuration */\n cookieBanner?: {\n cookieBannerTitle?: string;\n cookieBannerText?: string;\n policyUrl?: string;\n /** Cookie preferences configuration. Here you can enable or disable cookie categories */\n configuration?: {\n /** This category includes e.g. cookies related to logging in */\n required?: boolean;\n /** This category includes e.g. tracking cookies */\n functional?: boolean;\n /** This category includes e.g. cookies related to advertising */\n marketing?: boolean;\n };\n };\n /** A key for the product experience software Gainsight. */\n gainsightKey?: string;\n}\n","import { InjectionToken, Optional, Inject, Injectable } from '@angular/core';\nimport { camelCase, isUndefined } from 'lodash-es';\nimport { ApplicationOptions } from './ApplicationOptions';\nimport { ExtensionFactory } from './extension-hooks';\nimport { SystemOptionsService, TenantOptionsService } from '@c8y/ngx-components/api';\n\nexport const HOOK_OPTIONS = new InjectionToken<ExtensionFactory<ApplicationOptions>>('App options');\n\n/**\n * A service that allows to set or get application options\n * which configure the default behavior of the UI.\n */\n@Injectable()\nexport class OptionsService extends ApplicationOptions {\n [key: string]: any;\n constructor(\n @Optional() @Inject(HOOK_OPTIONS) options,\n private systemOptionsService: SystemOptionsService,\n private tenantOptionService: TenantOptionsService\n ) {\n super();\n this.setupOptions(options);\n }\n\n /**\n * Returns an application option used to configure the UI.\n * @param optionKey The application options key.\n * @param defaultValue A value to return if non is set.\n */\n get(optionKey: keyof OptionsService, defaultValue?: any) {\n let value = this[optionKey];\n if (typeof value === 'undefined') {\n value = this[camelCase(optionKey)];\n }\n return typeof value !== 'undefined' ? value : defaultValue;\n }\n\n /**\n * Sets an application option.\n * @param key The key to set.\n * @param value The value to set.\n */\n set(key: string, value: any) {\n this[camelCase(key)] = value;\n }\n\n /**\n * Gets support url from tenant options.\n * If response returns '404 not found' it gets the support url from application options.\n * If the support link within application options is not provided the UI will use the system options.\n * Is the support link explicitly set to false it will be hidden.\n *\n * @returns Returns support url or false.\n */\n async getSupportUrl() {\n let url = await this.getTenantOption('configuration', 'system.support.url');\n if (isUndefined(url)) {\n url = this.supportUrl;\n }\n this.supportUrl = isUndefined(url) ? (await this.getSystemOption('support', 'url')) || false : url;\n return this.supportUrl;\n }\n\n /**\n * Returns if the tenant allows to show the activate-support user menu entry.\n * Note: Only if system-level support-user/enabled is false we can activate it at tenant level.\n */\n async getActivateSupportUser() {\n const option = await this.getSystemOption('support-user', 'enabled', true);\n return !option;\n }\n\n /**\n * Gets a value from the system service and parses it.\n *\n * @param category The category for this option.\n * @param key The key for that option.\n * @param defaultValue The default if the option was not found.\n */\n async getSystemOption(category: string, key: string, defaultValue?: any) {\n return this.getOptionFromService(category, key, this.systemOptionsService, defaultValue);\n }\n\n /**\n * Gets a value from the tenant service and parses it.\n *\n * @param category The category for this option.\n * @param key The key for that option.\n * @param defaultValue The default if the option was not found.\n */\n async getTenantOption(category: string, key: string, defaultValue?: any) {\n return this.getOptionFromService(category, key, this.tenantOptionService, defaultValue);\n }\n\n private setupOptions(options: any[] | null) {\n if (options) {\n if (!Array.isArray(options)) {\n options = [options];\n }\n options.forEach(optionMap => {\n if (optionMap) {\n Object.keys(optionMap).forEach(key => {\n this[camelCase(key)] = optionMap[key];\n });\n }\n });\n }\n }\n\n private async getOptionFromService(category, key, service, defaultValue) {\n try {\n const { data } = await service.detail({ category, key });\n return this.parseOptionRawValue(data.value, defaultValue);\n } catch (ex) {\n return defaultValue;\n }\n }\n\n private parseOptionRawValue(rawValue, defaultValue) {\n let value;\n try {\n value = JSON.parse(rawValue);\n } catch (e) {\n value = isUndefined(rawValue) ? defaultValue : rawValue;\n }\n return value;\n }\n}\n","import { throttle as _throttle } from 'lodash-es';\n\n/**\n * Decorator to throttle functions call.\n * @param wait throttle time.\n * @param options set triggers, eg on trailing edge or falling edge,\n * see lodash documentation for details\n */\nexport function throttle(wait?, options?) {\n return (target, fnName, descriptor) => {\n const fn = descriptor.value;\n descriptor.value = function(...args) {\n const throttledFnName = `_${fnName}Throttled`;\n if (!this[throttledFnName]) {\n this[throttledFnName] = _throttle(fn, wait, options);\n }\n return this[throttledFnName].apply(this, args);\n };\n };\n}\n","import { Injectable, isDevMode } from '@angular/core';\nimport { keys } from 'lodash-es';\nimport { BehaviorSubject } from 'rxjs';\nimport { scan, distinctUntilChanged, map, filter } from 'rxjs/operators';\nimport { StateService } from './state-service.abstract';\nimport { OptionsService } from './options.service';\nimport { FetchClient, TenantLoginOptionsService } from '@c8y/client';\n\nimport { ApplicationService, IUser, ICurrentTenant } from '@c8y/client';\nimport { ApiService } from '@c8y/ngx-components/api';\nimport { throttle } from './throttle.decorator';\n\n@Injectable()\nexport class AppStateService extends StateService {\n state$: BehaviorSubject<any> = new BehaviorSubject<any>({\n app: {\n name: this.options.name,\n contextPath: this.getCurrentContextPath() || this.options.contextPath\n },\n supportUrl: this.options.supportUrl,\n lang: this.options.get('defaultLanguage', 'en'),\n langs: this.getLangs(),\n langsDetail: this.options.languages,\n loginOptions: this.options.loginOptions,\n activateSupportUserAvailable: undefined,\n versions: {\n backend: undefined,\n ui: this.options.versions || { ngx: undefined }\n },\n hidePowered: this.options.hidePowered,\n isLoading: false,\n showRightDrawer: this.options.rightDrawer,\n loginExtraLink: this.options.get('login_extra_link'),\n newsletter: this.options.newsletter\n });\n currentSupportUserName: BehaviorSubject<string | null> = new BehaviorSubject(null);\n currentUser: BehaviorSubject<IUser | null> = new BehaviorSubject(null);\n currentTenant: BehaviorSubject<ICurrentTenant | null> = new BehaviorSubject(null);\n\n constructor(\n private applicationService: ApplicationService,\n public apiService: ApiService,\n private options: OptionsService,\n private fetchClient: FetchClient,\n private tenantLoginOptionsService: TenantLoginOptionsService\n ) {\n super();\n this.apiService.calls\n .pipe(\n filter(({ url }) => !/notification\\/realtime/.test(url)),\n map(({ phase }) => (phase === 'start' ? 1 : -1)),\n scan((count, item) => count + item, 0),\n map(count => count > 0),\n distinctUntilChanged()\n )\n .subscribe(isLoading => (this.state.isLoading = isLoading));\n\n this.assignApplicationKeyToDefaultHeaders();\n }\n\n assignApplicationKeyToDefaultHeaders() {\n if (!isDevMode()) {\n this.fetchClient.defaultHeaders = {\n ...(this.fetchClient.defaultHeaders || {}),\n 'X-Cumulocity-Application-Key': this.options.key\n };\n }\n }\n\n /**\n * Returns the current state.\n */\n get state() {\n return this.state$.value;\n }\n\n getLangs() {\n const { languages } = this.options;\n return languages ? keys(languages).filter(k => languages[k]) : [];\n }\n\n /**\n * Returns the correct UI version. In hybrid mode for angular and ngx.\n */\n get uiVersion() {\n const version = this.state.versions.ui;\n return version.ngx || version.ng1;\n }\n\n /**\n * Loads the app manifest. If no access -> throw an error to verify app access.\n */\n async loadManifest() {\n try {\n const { application } = (await this.applicationService.detail(\n `${this.state.app.contextPath}/manifest`\n )).data as any;\n this.state.app.manifest = application;\n this.loadDefaultOptions();\n } catch (ex) {\n throw ex;\n }\n }\n\n /**\n * When this function called, it refreshes the values of loginOptions stored within ui state object.\n * Function is throttled to execute the refresh once in a time specified by params of @throttled decorator,\n * it should be called on leading edge of the timeout.\n */\n @throttle(600, { trailing: false })\n async refreshLoginOptions() {\n const { data: { loginOptions } } = await this.tenantLoginOptionsService.detail();\n this.state$.next({ ...this.state, loginOptions });\n }\n\n /**\n * Checks current users application list and matches it against given application name.\n * Returns true if application is in the list.\n * @param name application name\n */\n async isApplicationAvailable(name: string) {\n const { data } = await this.applicationService.listByUser(undefined, { pageSize: 100 });\n return data.some(app => app.name === name);\n }\n\n /**\n * Sets current user (including support user).\n * @param userInfo Info about current user and support user to be set.\n */\n setUser(userInfo: { user: IUser; supportUserName: string }) {\n this.currentSupportUserName.next(userInfo.supportUserName || null);\n this.currentUser.next(userInfo.user);\n }\n\n private getCurrentContextPath() {\n const match = window.location.pathname.match(/\\/apps\\/(public\\/){0,1}(.+?)(\\/|\\?|#|$)/);\n return match && match[2];\n }\n\n private async loadDefaultOptions() {\n this.state.supportUrl = await this.options.getSupportUrl();\n this.state.activateSupportUserAvailable = await this.options.getActivateSupportUser();\n this.state.versions.backend = await this.options.getSystemOption('system', 'version');\n try {\n this.showIncompatibleVersionsError();\n } catch (ex) {\n // ignore this\n }\n this.emitNewState();\n }\n\n private showIncompatibleVersionsError() {\n const uiVersion = this.state.versions.ui.ngx;\n const backendVersion = this.state.versions.backend;\n const uiVersionArray = uiVersion\n .replace(/[^\\d.]/g, '')\n .split('.')\n .map(Number);\n const beVersionArray = backendVersion\n .replace(/[^\\d.]/g, '')\n .split('.')\n .map(Number);\n const multiplier = Math.pow(\n 10,\n Math.ceil(Math.log10(Math.max(...uiVersionArray, ...beVersionArray) + 1))\n );\n const sumReducer = (acc, cur) => acc + cur;\n const calculateVersionMapper = (curr, idx) => curr * (multiplier / Math.pow(10, idx));\n const uiVersionNumber = uiVersionArray.map(calculateVersionMapper).reduce(sumReducer);\n const beVersionNumber = beVersionArray.map(calculateVersionMapper).reduce(sumReducer);\n const showError = uiVersionNumber > beVersionNumber;\n if (showError) {\n const errorContent = `You are running version ${uiVersion} of the UI and version ${backendVersion} of backend!`;\n console.log('%c ' + errorContent, 'font-weight: bold; font-size: 30px; color: red;');\n }\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const LANGUAGES = new InjectionToken('Languages');\n","import { InjectionToken } from '@angular/core';\n\nexport const LOCALE_PATH = new InjectionToken('Locale path');\n","import { InjectionToken } from '@angular/core';\n\nexport const HOOK_PATTERN_MESSAGES = new InjectionToken('Pattern Messages');\n","import { Injectable, Inject } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { mapValues, each } from 'lodash-es';\nimport { HOOK_PATTERN_MESSAGES } from './patterns-message.hook';\nimport { formatDate } from '@angular/common';\n\n/**\n * A service to translate messages by using regexp patterns.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class PatternMessagesService {\n translateService: TranslateService;\n patterns: any = {};\n pipes = {\n absoluteDate: (date: string|number|Date) =>\n formatDate(date, 'medium', this.translateService.currentLang),\n translate: (key) =>\n this.translateService.instant(key)\n };\n\n constructor(\n @Inject(HOOK_PATTERN_MESSAGES) patterns\n ) {\n each(patterns, (pattern) => {\n Object.assign(this.patterns, pattern);\n });\n }\n\n translate(message: string) {\n const translation = this.translateWithPatterns(message);\n return (translation !== message) ? translation : '';\n }\n\n private translateWithPatterns(message, patterns = this.patterns) {\n let translatedMessage = message;\n\n each(patterns, (patternCfg, pattern) => {\n const globalRegExp = new RegExp(pattern, 'g');\n let globalMatch;\n\n if (!globalRegExp.test(translatedMessage)) {\n return;\n }\n globalRegExp.test(''); // reset the regexp\n globalMatch = globalRegExp.exec(translatedMessage);\n while (globalMatch !== null) {\n const [ localMatch ] = globalMatch;\n\n const placeholderValues = mapValues(patternCfg.placeholders, (placeholder) => {\n const expr = placeholder.capture || placeholder;\n let replacement = localMatch.replace(new RegExp(pattern, 'g'), expr);\n\n if (placeholder.translate) {\n replacement = this.translateWithPatterns(replacement, placeholder.translate);\n }\n\n return replacement;\n });\n translatedMessage = translatedMessage.replace(\n localMatch,\n this.translateWithParams(patternCfg, placeholderValues)\n );\n\n globalMatch = globalRegExp.exec(translatedMessage);\n }\n });\n return translatedMessage;\n }\n\n private translateWithParams(patternCfg: any, params: any = {}) {\n const { defaultLang, currentLang, compiler } = this.translateService;\n const translations = this.translateService.store.translations[currentLang];\n const defaultTranslations = this.translateService.store.translations[defaultLang];\n const originalKey = patternCfg.gettext;\n\n let originalValue = originalKey;\n if (translations) {\n if (translations[originalKey]) {\n originalValue = translations[originalKey];\n } else if (defaultTranslations) {\n if (defaultTranslations[originalKey]) {\n originalValue = defaultTranslations[originalKey];\n }\n }\n }\n\n let key = originalKey;\n let value = originalValue;\n const interpolateParams = {\n ...params,\n noPatternMessages: true\n };\n\n let match;\n const pipeRegex = RegExp('{{\\\\s*([^\\\\s]+)\\\\s*\\\\|\\\\s*([^\\\\s]+)\\\\s*}}', 'g');\n // tslint:disable-next-line:no-conditional-assignment\n while ((match = pipeRegex.exec(originalKey)) !== null) {\n const [placeholder, paramName, pipeName] = match;\n if (this.pipes[pipeName]) {\n key = key.replace(placeholder, `{{${paramName}}}`);\n value = value.replace(placeholder, `{{${paramName}}}`);\n interpolateParams[paramName] = this.pipes[pipeName](params[paramName]);\n }\n }\n\n if (translations) {\n translations[key] = compiler.compile(value, currentLang);\n }\n return this.translateService.instant(key, interpolateParams);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PatternMessagesService } from './pattern-messages.service';\nimport {\n MissingTranslationHandler,\n MissingTranslationHandlerParams,\n TranslateParser,\n TranslateService\n} from '@ngx-translate/core';\n\n@Injectable()\nexport class MissingTranslationCustomHandler implements MissingTranslationHandler {\n translateService: TranslateService;\n cache: any = {};\n\n constructor(\n private parser: TranslateParser,\n private patternMessagesService: PatternMessagesService\n ) {}\n\n handle(params: MissingTranslationHandlerParams) {\n const { key: messageKey, interpolateParams, translateService } = params;\n this.translateService = translateService;\n\n let translation = this.getFromCache(messageKey, interpolateParams);\n\n if (!translation) {\n const patternMessageTranslation = this.getPatternMessageTranslation(messageKey, interpolateParams);\n if (patternMessageTranslation) {\n translation = patternMessageTranslation;\n } else {\n translation = this.parser.interpolate(messageKey, interpolateParams);\n }\n\n this.addToCache(messageKey, interpolateParams, translation);\n }\n\n return translation;\n }\n\n private getFromCache(messageKey: string, interpolateParams: object): string {\n const { currentLang } = this.translateService;\n const currentCache = this.cache[currentLang] || {};\n const cacheKey = this.getCacheKey(messageKey, interpolateParams);\n return currentCache[cacheKey];\n }\n\n private addToCache(messageKey: string, interpolateParams: object, translation: string) {\n const { currentLang } = this.translateService;\n const currentCache = this.cache[currentLang] = this.cache[currentLang] || {};\n const cacheKey = this.getCacheKey(messageKey, interpolateParams);\n currentCache[cacheKey] = translation;\n }\n\n private getCacheKey(messageKey: string, interpolateParams: object): string {\n return interpolateParams ? `${messageKey} ${JSON.stringify(interpolateParams)}` : messageKey;\n }\n\n private getPatternMessageTranslation(messageKey: string, interpolateParams: object): string {\n const shouldTryPatternMessages = !interpolateParams || !((interpolateParams as any).noPatternMessages);\n\n if (shouldTryPatternMessages) {\n if (!this.patternMessagesService.translateService) {\n this.patternMessagesService.translateService = this.translateService;\n }\n return this.patternMessagesService.translate(messageKey);\n }\n\n return undefined;\n }\n}\n","// Just for translation annotation\n// Note: Own file because of conflicts if put in barrel directly.\nexport const _ = (str) => str;\nexport function gettext(str) {\n return str;\n}\n","/* tslint:disable:max-line-length */\nimport { gettext } from './gettext';\n\nconst bulkOperationAuditLogTextPlaceholders = {\n updatesList: {\n capture: '$1',\n translate: {\n \"status='(.+?)'\": {\n gettext: gettext('status=\"{{status | translate}}\"'),\n placeholders: {\n status: '$1'\n }\n },\n \"generalStatus='(.+?)'\": {\n gettext: gettext('generalStatus=\"{{generalStatus | translate}}\"'),\n placeholders: {\n generalStatus: '$1'\n }\n },\n \"progress='(.+?)'\": {\n gettext: gettext('progress=\"{{progress}}\"'),\n placeholders: {\n progress: '$1'\n }\n },\n 'note=(.+?)': {\n gettext: gettext('note=\"{{note}}\"'),\n placeholders: {\n note: '$1'\n }\n }\n }\n }\n};\n\nexport const MESSAGES = {\n '^Access is denied$': {\n gettext: gettext('Access denied.')\n },\n '^Alarm created$': {\n gettext: gettext('Alarm created')\n },\n '^Alarm updated$': {\n gettext: gettext('Alarm updated')\n },\n '^API is not available with the new domain$': {\n gettext: gettext('Could not activate custom domain. DNS setup is incorrect.')\n },\n '^Application with given name already exist$': {\n gettext: gettext('Application with given name already exists.')\n },\n '^Application with id (.+?) is already assigned to the tenant (.+?)$': {\n gettext: gettext('This application is already assigned to tenant \"{{tenant}}\".'),\n placeholders: {\n tenant: '$2'\n }\n },\n '^Apply software changes: (.+?)\\\\.?$': {\n gettext: gettext('Apply software changes: {{ softwareChanges }}'),\n placeholders: {\n softwareChanges: {\n capture: '$1',\n translate: {\n 'install \"(.+?)\" \\\\(version: (.+?)\\\\)': {\n gettext: gettext('install \"{{ softwareName }}\" (version: {{ softwareVersion }})'),\n placeholders: {\n softwareName: '$1',\n softwareVersion: '$2'\n }\n },\n 'install \"([^\"]+)\"(?! \\\\(version: .+?\\\\))': {\n gettext: gettext('install \"{{ softwareName }}\"'),\n placeholders: {\n softwareName: '$1'\n }\n },\n 'delete \"(.+?)\" \\\\(version: (.+?)\\\\)': {\n gettext: gettext('delete \"{{ softwareName }}\" (version: {{ softwareVersion }})'),\n placeholders: {\n softwareName: '$1',\n softwareVersion: '$2'\n }\n },\n 'delete \"([^\"]+)\"(?! \\\\(version: .+?\\\\))': {\n gettext: gettext('delete \"{{ softwareName }}\"'),\n placeholders: {\n softwareName: '$1'\n }\n }\n }\n }\n }\n },\n '^Assign device profile (.+?) to device (.+?)$': {\n gettext: gettext('Assign device profile {{profileName}} to device {{deviceName}}'),\n placeholders: {\n profileName: '$1',\n deviceName: '$2'\n }\n },\n '^(.+)pplication for tenant (.+) with properties \\\\( (.+?) \\\\) already exists$': {\n gettext: gettext(\n 'Application for tenant \"{{tenant}}\" with the following values ({{valuesList}}) already exists.'\n ),\n placeholders: {\n tenant: '$2',\n valuesList: '$3'\n }\n },\n '^Authentication failed! : User account is locked$': {\n gettext: gettext('Authentication failed due to: user account is locked.')\n },\n '^Availability monitoring record$': {\n gettext: gettext('Availability monitoring record')\n },\n '^Can not activate a certificate which is either expired or not yet valid$': {\n gettext: gettext('Cannot activate a certificate which is either expired or not yet valid.')\n },\n '^Cannot add certificate - certificate with (.+?) fingerprint already exists. : Certificate with (.+?) fingerprint already exists.': {\n gettext: gettext(\n 'Could not add certificate. Certificate with {{fingerprint}} fingerprint already exists.'\n ),\n placeholders: {\n fingerprint: '$1'\n }\n },\n '^Cannot change password. : Provided token does not exist.$': {\n gettext: gettext('Cannot change password: provided token is invalid.')\n },\n '^Cannot deploy module (.*)$': {\n gettext: gettext('Cannot deploy module due to error: \"{{ errorMessage | translate }}\".'),\n placeholders: {\n errorMessage: '$1'\n }\n },\n \"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\\\d+) column (\\\\d+) \\\\[([\\\\S\\\\s]+?)\\\\]$\": {\n gettext: gettext(\n 'Could not deploy module \"{{moduleName}}\". Compilation failed in expression \"{{expression}}\": incorrect syntax near \"{{incorrectExpression}}\" at line {{line}} column {{column}}.'\n ),\n placeholders: {\n moduleName: '$1',\n expression: '$3',\n incorrectExpression: '$4',\n line: '$5',\n column: '$6'\n }\n },\n \"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\\\d+) column (\\\\d+) near reserved keyword '(.+?)' \\\\[([\\\\S\\\\s]+?)\\\\]$\": {\n gettext: gettext(\n 'Could not deploy module \"{{moduleName}}\". Compilation failed in expression \"{{expression}}\": incorrect syntax near \"{{incorrectExpression}}\" at line {{line}} column {{column}} near reserved keyword \"{{keyword}}\".'\n ),\n placeholders: {\n moduleName: '$1',\n expression: '$3',\n incorrectExpression: '$4',\n line: '$5',\n column: '$6',\n keyword: '$7'\n }\n },\n \"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\\\d+) column (\\\\d+), please check the where clause \\\\[([\\\\S\\\\s]+?)\\\\]$\": {\n gettext: gettext(\n 'Could not deploy module \"{{moduleName}}\". Compilation failed in expression \"{{expression}}\": incorrect syntax near \"{{incorrectExpression}}\" at line {{line}} column {{column}}, check \"where\" clause.'\n ),\n placeholders: {\n moduleName: '$1',\n expression: '$3',\n incorrectExpression: '$4',\n line: '$5',\n column: '$6'\n }\n },\n \"^Cannot deploy module (.+?)! : Deployment failed in module '(.+?)' in expression '(.+?)' : Exception compiling script '(.+?)' of dialect '(.+?)': missing (.+?) before statement \\\\((.+?)\\\\) \\\\[([\\\\S\\\\s]+?)\\\\]$\": {\n gettext: gettext(\n 'Could not deploy module \"{{moduleName}}\". Compilation failed in expression \"{{expression}}\": exception compiling script \"{{scriptName}}\" of dialect \"{{scriptDialect}}\": missing \"{{missingSyntax}}\" before statement \"{{affectedStatement}}\".'\n ),\n placeholders: {\n moduleName: '$1',\n expression: '$3',\n scriptName: '$4',\n scriptDialect: '$5',\n missingSyntax: '$6',\n affectedStatement: '$7'\n }\n },\n \"^Cannot execute bulk operation on empty group. Group with id='(\\\\d+?)' doesn't have child assets.$\": {\n gettext: gettext(\n 'Could not execute bulk operation on an empty group. Group with ID \"{{groupId}}\" has no child assets.'\n ),\n placeholders: {\n groupId: '$1'\n }\n },\n \"^Cannot execute bulk operation on empty group. DynamicGroup with id='(\\\\d+?)' doesn't have child assets$\": {\n gettext: gettext(\n 'Could not execute bulk operation on an empty group. Smart group with ID \"{{groupId}}\" has no child assets.'\n ),\n placeholders: {\n groupId: '$1'\n }\n },\n '^Cannot parse X509 certificate. : Could not parse certificate: (.+?)$': {\n gettext: gettext('Could not parse X.509 certificate: {{ failureReason | translate }}.'),\n placeholders: {\n failureReason: '$1'\n }\n },\n '^Cannot reschedule bulk operation. All its operations are successful$': {\n gettext: gettext('Cannot reschedule bulk operation. All its operations are already successful.')\n },\n '^Cannot reset user password : Cannot find user with such email.$': {\n gettext: gettext('Cannot reset password for user with such email: email not found.')\n },\n '^Cannot update/delete application binary via this endpoint$': {\n gettext: gettext('Cannot update/delete application binary via this endpoint')\n },\n \"^Can't delete user because it is used by another managed object$\": {\n gettext: gettext(\n 'Cannot delete device with associated device owner because this owner is still assigned to other device(s). Try to remove only the device.'\n )\n },\n '^Cep module created$': {\n gettext: gettext('CEP module created')\n },\n '^Cep module updated$': {\n gettext: gettext('CEP module updated')\n },\n '^Cep module deleted$': {\n gettext: gettext('CEP module deleted')\n },\n '^Cep module \"(.+?)\" created$': {\n gettext: gettext('CEP module \"{{name}}\" created'),\n placeholders: {\n name: '$1'\n }\n },\n '^Cep module \"(.+?)\" updated$': {\n gettext: gettext('CEP module \"{{name}}\" updated'),\n placeholders: {\n name: '$1'\n }\n },\n '^Cep module \"(.+?)\" deleted$': {\n gettext: gettext('CEP module \"{{name}}\" deleted'),\n placeholders: {\n name: '$1'\n }\n },\n '^Command state is invalid: (.+)$': {\n gettext: gettext('Command state is invalid: {{violations}}'),\n placeholders: {\n violations: {\n capture: '$1',\n translate: {\n '(\\\\w+?) - may not be null': {\n gettext: gettext('\"{{field}}\" must not be null'),\n placeholders: {\n field: '$1'\n }\n }\n }\n }\n }\n },\n '^Could not connect to endpoint (.+)\\\\. Could not verify `(.+)` host key with fingerprint `(.+)` for `(.+)` on port (.+)\\\\. If you expected that key, please remove the previous one from configuration to allow for connection\\\\.$': {\n gettext: gettext(\n 'Could not connect to endpoint \"{{endpointName}}\". Could not verify {{keyType}} host key with fingerprint {{fingerprint}} for host {{host}} on port {{port}}. If you expected this key, please remove the previous one from configuration to allow for connection.'\n ),\n placeholders: {\n endpointName: '$1',\n keyType: '$2',\n fingerprint: '$3',\n host: '$4',\n port: '$5'\n }\n },\n '^Could not login to ssh server on endpoint \"(.+)\"\\\\. Provided credential for user \"(.+)\" is incorrect\\\\.$': {\n gettext: gettext(\n 'Could not access SSH server on endpoint \"{{endpointName}}\". Provided credentials for user \"{{userName}}\" are incorrect.'\n ),\n placeholders: {\n endpointName: '$1',\n userName: '$2'\n }\n },\n '^Could not save object remoteAccessUpdate: (.+)$': {\n gettext: '{{errorMessages}}',\n placeholders: {\n errorMessages: {\n capture: '$1',\n translate: {\n 'Could not recognize host-key format': {\n gettext: gettext('Could not recognize \"Host key\" format')\n },\n 'Could not recognize key-pair format': {\n gettext: gettext('Could not recognize the format of \"Public key\" or \"Private key\"')\n }\n }\n }\n }\n },\n '^Could not update user. : Error persisting user (.+?)!$': {\n gettext: gettext('Could not update user \"{{username}}\".'),\n placeholders: {\n username: '$1'\n }\n },\n 'ˆCreate bulk operation$': {\n gettext: gettext('Create bulk operation')\n },\n '^Create bulk operation: (.+)$': {\n gettext: gettext('Create bulk operation: {{updatesList}}'),\n placeholders: bulkOperationAuditLogTextPlaceholders\n },\n '^Creation ramp must be greater than (\\\\d+?)$': {\n gettext: gettext('Bulk operation delay must be greater than {{minSeconds}} seconds.'),\n placeholders: {\n minSeconds: '$1'\n }\n },\n '^Created container$': {\n gettext: gettext('Container created.')\n },\n '^Created pod: (.+)$': {\n gettext: gettext('Pod \"{{imageName}}\" created.'),\n placeholders: {\n imageName: '$1'\n }\n },\n '^CSV file contained empty dataset$': {\n gettext: gettext('No entries found in uploaded CSV file.')\n },\n '^Cycle detected for route (.+?)!$': {\n gettext: gettext('Cycle detected for route {{route}}.'),\n placeholders: {\n route: '$1'\n }\n },\n '^Data broker processing is currently overloaded and may stop forwarding your data\\\\. Please contact support\\\\.$': {\n gettext: gettext(\n 'Data broker processing is currently overloaded and may stop forwarding your data. Please contact support.'\n )\n },\n '^Data broker processing is not able to connect do destination tenant, thus data forwarding is not working\\\\. Please contact support\\\\.$': {\n gettext: gettext(\n 'Data broker processing is not able to connect to destination tenant, thus data forwarding is not working. Please contact support.'\n )\n },\n '^Delete bulk operation$': {\n gettext: gettext('Delete bulk operation')\n },\n '^Delete bulk operation: (.+)$': {\n gettext: gettext('Delete bulk operation: {{updatesList}}'),\n placeholders: bulkOperationAuditLogTextPlaceholders\n },\n \"^Device id '(.+?)' contains '(.+?)' character which is not permitted.$\": {\n gettext: gettext('ID \"{{deviceId}}\" contains invalid character: \"{{invalidCharacter}}\".'),\n placeholders: {\n deviceId: '$1',\n invalidCharacter: '$2'\n }\n },\n \"^Device name: '(.+?)', alarm text: '(.+?)'$\": {\n gettext: gettext('Device name: \"{{deviceName}}\", alarm text: \"{{alarmText | translate}}\"'),\n placeholders: {\n deviceName: '$1',\n alarmText: '$2'\n }\n },\n '^Display name$': {\n gettext: gettext('Login alias')\n },\n '^Domain name in uploaded certificate differs from the one in use$': {\n gettext: gettext(\n 'Domain name in uploaded certificate differs from the one in use. Please deactivate the custom domain before uploading new certificate.'\n )\n },\n '^Domain name is already in use by another tenant!$': {\n gettext: gettext('Domain name is already used by another tenant.')\n },\n '^Duplicated connector for instanceUrl (.+?)!$': {\n gettext: gettext('Target URL {{targetUrl}} already used by another connector.'),\n placeholders: {\n targetUrl: '$1'\n }\n },\n '^Duplicated connector for name (.+?)!$': {\n gettext: gettext('Connector name \"{{name}}\" already used by another connector.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Entry is outside of the target dir: (.+)$': {\n gettext: gettext('File entry outside of the target directory: \"{{path}}\".'),\n placeholders: {\n path: '$1'\n }\n },\n '^Error during password validation. : Password must have at least (\\\\d+?) characters and no more than (\\\\d+?) and must contain only Latin1 characters.$': {\n gettext: gettext(\n 'Password is invalid. It must have at least {{minCharactersCount}} and no more than {{maxCharactersCount}} characters.'\n ),\n placeholders: {\n minCharactersCount: '$1',\n maxCharactersCount: '$2'\n }\n },\n '^Error during password validation. : Your password has been used already. Choose another.$': {\n gettext: gettext('This password has already been used earlier. Use a different one.')\n },\n \"^Error in statement (.+?):(.+?)! : Incorrect syntax near '(.+?)' near reserved keyword '(.+?)' \\\\[([\\\\S\\\\s]+?)\\\\]$\": {\n gettext: gettext(\n 'Error in statement {{moduleName}}:{{statementNumber}}. Incorrect syntax near expression \"{{expression}}\" near reserved keyword \"{{keyword}}\".'\n ),\n placeholders: {\n moduleName: '$1',\n statementNumber: '$2',\n expression: '$3',\n keyword: '$4'\n }\n },\n '^External id not found; external id = ID \\\\[type=(.+?), value=(.+?)\\\\]$': {\n gettext: gettext('External ID not found for type \"{{type}}\" and value \"{{value}}\".'),\n placeholders: {\n type: '$1',\n value: '$2'\n }\n },\n '^Error occurred when trying to find an Application for id ID (.+) : Could not find application by ID (\\\\d+)$': {\n gettext: gettext('Could not find application by ID {{applicationId}}.'),\n placeholders: {\n applicationId: '$2'\n }\n },\n '^Http status code: 404\\n{error=\"options/Not Found\",message=\"Unable to find option by given key: sigfox-agent/provider.token\",info=\"https://www.cumulocity.com/guides/reference-guide/#error_reporting\",details=\"null\"}': {\n gettext: gettext('Unable to find option by given key: sigfox-agent/provider.token')\n },\n '^Failed to delete application. : Cannot remove application assigned to other tenants.$': {\n gettext: gettext('Could not delete application assigned to other tenants.')\n },\n '^Failed to extract certificate from PKCS12$': {\n gettext: gettext('Failed to extract certificate from PKCS12.')\n },\n '^Failed to update domain at the platform$': {\n gettext: gettext('Failed to update domain at the platform.')\n },\n \"^Finding device data from database failed : No managedObject for id '(.+?)'!$\": {\n gettext: gettext('Could not find managed object with ID \"{{deviceId}}\".'),\n placeholders: {\n deviceId: '$1'\n }\n },\n '^Following mandatory fields should be included: (.+?)$': {\n gettext: gettext('Following mandatory fields should be included: {{fields}}'),\n placeholders: {\n fields: '$1'\n }\n },\n '^Global Role updated$': {\n gettext: gettext('Global role updated')\n },\n '^Global Role (.+?) updated$': {\n gettext: gettext('Global role \"{{name}}\" updated'),\n placeholders: {\n name: '$1'\n }\n },\n '^Global Role (.+?) updated: (.+)$': {\n gettext: gettext('Global role \"{{name}}\" updated: {{updatesList}}'),\n placeholders: {\n name: '$1',\n updatesList: {\n capture: '$2',\n translate: {\n 'applications \\\\[([^\\\\]]+?)\\\\] added': {\n gettext: gettext('applications {{list}} added'),\n placeholders: {\n list: '$1'\n }\n },\n 'applications \\\\[([^\\\\]]+?)\\\\] removed': {\n gettext: gettext('applications {{list}} removed'),\n placeholders: {\n list: '$1'\n }\n },\n 'roles \\\\[([^\\\\]]+?)\\\\] added': {\n gettext: gettext('roles {{list}} added'),\n placeholders: {\n list: '$1'\n }\n },\n 'roles \\\\[([^\\\\]]+?)\\\\] removed': {\n gettext: gettext('roles {{list}} removed'),\n placeholders: {\n list: '$1'\n }\n }\n }\n }\n }\n },\n '^Global Roles$': {\n gettext: gettext('Global roles')\n },\n '^Operation updated: (.+)$': {\n gettext: gettext('Operation updated: {{updatesList}}'),\n placeholders: {\n updatesList: {\n capture: '$1',\n translate: {\n \"status='(.+?)'\": {\n gettext: gettext('status=\"{{status | translate}}\"'),\n placeholders: {\n status: '$1'\n }\n },\n \"description='(.+?)'\": {\n gettext: gettext('description=\"{{description | translate}}\"'),\n placeholders: {\n description: '$1'\n }\n },\n \"device name='(.+?)'\": {\n gettext: gettext('device name=\"{{deviceName}}\"'),\n placeholders: {\n deviceName: '$1'\n }\n },\n \"failure reason='(.+?)'\": {\n gettext: gettext('failure reason=\"{{failureReason | translate}}\"'),\n placeholders: {\n failureReason: '$1'\n }\n }\n }\n }\n }\n },\n '^ID \\\\[type=(.+?), value=(.+?)\\\\] was already bound to different Global ID.$': {\n gettext: gettext('External ID \"{{value}}\" of the type \"{{type}}\" already exists.'),\n placeholders: {\n type: '$1',\n value: '$2'\n }\n },\n '^Invalid credentials! : Bad credentials$': {\n gettext: gettext('Invalid credentials.')\n },\n '^Invalid credentials! : No phone number provided$': {\n gettext: gettext('Log into the management tenant first and enter your phone number.')\n },\n '^Inventory Role removed$': {\n gettext: gettext('Inventory role removed')\n },\n '^Inventory Role (.+?) removed': {\n gettext: gettext('Inventory role \"{{name}}\" deleted.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Inventory Role updated$': {\n gettext: gettext('Inventory role updated')\n },\n '^Inventory Role (.+?) updated': {\n gettext: gettext('Inventory role \"{{name}}\" updated.'),\n placeholders: {\n name: '$1'\n }\n },\n '^I/O error: Connection refused; nested exception is Connection refused : Connection refused': {\n gettext: gettext('Connection refused')\n },\n '^I/O error: Read timed out; nested exception is Read timed out : Read timed out': {\n gettext: gettext('Read timed out')\n },\n '^Log file requested$': {\n gettext: gettext('Log file requested.')\n },\n '^Managed object deleted$': {\n gettext: gettext('Managed object deleted')\n },\n '^Managed object \"(.+?)\" deleted$': {\n gettext: gettext('Managed object \"{{name}}\" deleted'),\n placeholders: {\n name: '$1'\n }\n },\n '^Maximum file size exceeded$': {\n gettext: gettext('Maximum file size exceeded.')\n },\n \"^Message with ID (.+?) doesn't exist in smart rest template (.+?)$\": {\n gettext: gettext(\n 'Message with ID \"{{messageId}}\" doesn\\'t exist in SmartREST template with ID \"{{templateId}}\"'\n ),\n placeholders: {\n messageId: '$1',\n templateId: '$2'\n }\n },\n '^NewDeviceRequest for id = (.+?) already exists.$': {\n gettext: gettext('Device registration request with ID {{id}} already exists.'),\n placeholders: {\n id: '$1'\n }\n },\n '^No communication with device since (.+?)$': {\n gettext: gettext('No communication with device since {{timestamp | absoluteDate}}.'),\n placeholders: {\n timestamp: '$1'\n }\n },\n '^No data received from device within required interval.$': {\n gettext: gettext('No data received from device within required interval.')\n },\n '^No LoRa provider settings are found. Please configure the connectivity settings.$': {\n gettext: gettext(\n 'No LoRa provider settings are found. Please configure the connectivity settings.'\n )\n },\n '^Not within any context!$': {\n gettext: gettext('A problem occurred with microservice subscription.')\n },\n '^Maximum age cannot be bigger than 10 years.$': {\n gettext: gettext('Maximum age cannot be bigger than 10 years.')\n },\n '^Microservice application name incorrect. Please use only lower-case letters, digits and dashes. Maximum length is (\\\\d+) characters.$': {\n gettext: gettext(\n 'Microservice application name is incorrect: only lower case letters, digits and dashes allowed. Maximum length: {{maxLength}}.'\n ),\n placeholders: {\n maxLength: '$1'\n }\n },\n '^Microservice not available.*$': {\n gettext: gettext('Microservice is not available.')\n },\n '^Operation created$': {\n gettext: gettext('Operation created.')\n },\n '^Operation updated$': {\n gettext: gettext('Operation updated.')\n },\n \"^Operation created: status='(.+?)'.\": {\n gettext: gettext('Operation created: status=\"{{status | translate}}\".'),\n placeholders: {\n status: '$1'\n }\n },\n '^Option created$': {\n gettext: gettext('Option created.')\n },\n '^Option \"(.+?)\" created$': {\n gettext: gettext('Option \"{{option}}\" created.'),\n placeholders: {\n option: '$1'\n }\n },\n '^Option deleted$': {\n gettext: gettext('Option deleted.')\n },\n '^Option \"(.+?)\" deleted$': {\n gettext: gettext('Option \"{{option}}\" deleted.'),\n placeholders: {\n option: '$1'\n }\n },\n '^Owner field error. : Cannot introduce cyclic dependency.': {\n gettext: gettext('Could not introduce cyclic ownership dependency.')\n },\n '^Password change is temporary blocked.$': {\n gettext: gettext('Password change is temporarily blocked.')\n },\n '^Password cipher does not match': {\n gettext: gettext('Password cipher does not match.')\n },\n '^Platform application cannot be added to, nor removed from any tenant.$': {\n gettext: gettext('Platform application cannot be added to, nor removed from any tenant.')\n },\n '^Private key must be provided in KEY_PAIR credentials$': {\n gettext: gettext(\n 'Private key must be provided when \"Public/private keys\" option is selected.'\n )\n },\n '^Private key cipher does not match': {\n gettext: gettext('Private key cipher does not match')\n },\n '^Protocol \"(.+?)\" does not support \"(.+?)\" credentials type$': {\n gettext: gettext(\n 'Protocol \"{{protocol}}\" does not support \"{{credentialsType}}\" credentials type.'\n ),\n placeholders: {\n protocol: '$1',\n credentialsType: '$2'\n }\n },\n '^pulling image \"(.+)\"$': {\n gettext: gettext('Pulling image: \"{{imageName}}\".'),\n placeholders: {\n imageName: '$1'\n }\n },\n '^Real-time event processing is currently overloaded and may stop processing your events\\\\. Please contact support\\\\.$': {\n gettext: gettext(\n 'Real-time event processing is currently overloaded and may stop processing your events. Please contact support.'\n )\n },\n '^Resource ID \\\\[type=com_cumulocity_model_idtype_GId, value=(.+?)\\\\] for this request not found.$': {\n gettext: gettext('Could not find the resource with ID \"{{id}}\".'),\n placeholders: {\n id: '$1'\n }\n },\n '^Retrieve configuration snapshot from device (.+?)': {\n gettext: gettext('Retrieve configuration snapshot from device {{deviceName}}'),\n placeholders: {\n deviceName: '$1'\n }\n },\n '^Retrieve (.+?) configuration snapshot from device (.+?)': {\n gettext: gettext(\n 'Retrieve {{configurationType}} configuration snapshot from device {{deviceName}}'\n ),\n placeholders: {\n configurationType: '$1',\n deviceName: '$2'\n }\n },\n '^Scaled up replica set (.+) to (\\\\d+)$': {\n gettext: gettext('Replica set \"{{replicaSetName}}\" scaled up to \"{{scaleNumber}}\".'),\n placeholders: {\n replicaSetName: '$1',\n scaleNumber: '$2'\n }\n },\n '^Send configuration snapshot (.+?) of configuration type (.+?) to device (.+?)': {\n gettext: gettext(\n 'Send configuration snapshot {{snapshotName}} of configuration type {{configurationType}} to device {{deviceName}}'\n ),\n placeholders: {\n snapshotName: '$1',\n configurationType: '$2',\n deviceName: '$3'\n }\n },\n '^Send configuration snapshot (.+?) to device (.+?)': {\n gettext: gettext('Send configuration snapshot {{snapshotName}} to device {{deviceName}}'),\n placeholders: {\n snapshotName: '$1',\n deviceName: '$2'\n }\n },\n '^Simulator state is invalid: (.+)$': {\n gettext: gettext('Simulator state is invalid: {{violations}}'),\n placeholders: {\n violations: {\n capture: '$1',\n translate: {\n '(\\\\w+?) - may not be null': {\n gettext: gettext('\"{{field}}\" should not be null'),\n placeholders: {\n field: '$1'\n }\n },\n '(\\\\w+?) - must be less than or equal to (\\\\d+)': {\n gettext: gettext('\"{{field}}\" must be less than or equal to {{maxValue}}'),\n placeholders: {\n field: '$1',\n maxValue: '$2'\n }\n },\n '(\\\\w+?) - should not contain null values': {\n gettext: gettext('\"{{field}}\" should not contain null values'),\n placeholders: {\n field: '$1'\n }\n }\n }\n }\n }\n },\n \"^Smart rest template (.+?) doesn't exist$\": {\n gettext: gettext('SmartREST template with id \"{{templateId}}\" doesn\\'t exist'),\n placeholders: {\n templateId: '$1'\n }\n },\n '^Smart rule created$': {\n gettext: gettext('Smart rule created.')\n },\n '^Smart rule updated$': {\n gettext: gettext('Smart rule updated.')\n },\n '^Smart rule enabled$': {\n gettext: gettext('Smart rule activated.')\n },\n '^Smart rule disabled$': {\n gettext: gettext('Smart rule deactivated.')\n },\n '^Smart rule deleted$': {\n gettext: gettext('Smart rule deleted.')\n },\n '^Smart rule \"(.+?)\" created$': {\n gettext: gettext('Smart rule \"{{name}}\" created.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Smart rule \"(.+?)\" updated$': {\n gettext: gettext('Smart rule \"{{name}}\" updated.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Smart rule \"(.+?)\" enabled$': {\n gettext: gettext('Smart rule \"{{name}}\" activated.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Smart rule \"(.+?)\" disabled$': {\n gettext: gettext('Smart rule \"{{name}}\" deactivated.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Smart rule \"(.+?)\" deleted$': {\n gettext: gettext('Smart rule \"{{name}}\" deleted.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Started container$': {\n gettext: gettext('Container started.')\n },\n '^Successfully assigned (.+) to (.+)$': {\n gettext: gettext('\"{{imageName}}\" assigned to \"{{address}}\".'),\n placeholders: {\n imageName: '$1',\n address: '$2'\n }\n },\n '^Successfully pulled image \"(.+)\"$': {\n gettext: gettext('Image \"{{imageName}}\" pulled.'),\n placeholders: {\n imageName: '$1'\n }\n },\n '^Tenant creation failed. : Tenant with given id already exists.$': {\n gettext: gettext('Could not create a tenant. Tenant with given domain/URL already exists.')\n },\n '^Tenant id cannot be a reserved sql keyword \"(.+?)\".$': {\n gettext: gettext('Could not use a reserved SQL keyword \"{{tenantId}}\" as a domain name.'),\n placeholders: {\n tenantId: '$1'\n }\n },\n '^Tenant \"(.+?)\" activated$': {\n gettext: gettext('Tenant \"{{tenant}}\" activated.'),\n placeholders: {\n tenant: '$1'\n }\n },\n '^Tenant (.+?) has sub-tenants, please remove them first!$': {\n gettext: gettext('Could not remove tenant \"{{tenant}}\". Remove its subtenants first.'),\n placeholders: {\n tenant: '$1'\n }\n },\n '^Tenant activated$': {\n gettext: gettext('Tenant activated')\n },\n '^Tenant \"(.+?)\" created$': {\n gettext: gettext('Tenant \"{{tenant}}\" created.'),\n placeholders: {\n tenant: '$1'\n }\n },\n '^Tenant created$': {\n gettext: gettext('Tenant created')\n },\n '^Tenant \"(.+?)\" deleted$': {\n gettext: gettext('Tenant \"{{tenant}}\" deleted.'),\n placeholders: {\n tenant: '$1'\n }\n },\n '^Tenant deleted$': {\n gettext: gettext('Tenant deleted')\n },\n '^Tenant \"(.+?)\" suspended$': {\n gettext: gettext('Tenant \"{{tenant}}\" suspended.'),\n placeholders: {\n tenant: '$1'\n }\n },\n '^Tenant suspended$': {\n gettext: gettext('Tenant suspended')\n },\n '^Tenant \"(.+?)\" updated: (.+?)$': {\n gettext: gettext('Tenant \"{{tenant}}\" updated: {{properties}}.'),\n placeholders: {\n tenant: '$1',\n properties: '$2'\n }\n },\n '^Tenant updated$': {\n gettext: gettext('Tenant updated')\n },\n '^Too Many Requests$': {\n gettext: gettext('Too many requests. Try again later.')\n },\n \"^User alias equals username '(.+)'$\": {\n gettext: gettext('Username and login alias must be different.')\n },\n '^User created$': {\n gettext: gettext('User created')\n },\n '^User (.+?) created$': {\n gettext: gettext('User \"{{name}}\" created'),\n placeholders: {\n name: '$1'\n }\n },\n '^User deleted$': {\n gettext: gettext('User deleted')\n },\n '^User (.+?) deleted$': {\n gettext: gettext('User \"{{name}}\" deleted'),\n placeholders: {\n name: '$1'\n }\n },\n '^User updated$': {\n gettext: gettext('User updated')\n },\n '^User (.+?) updated: (.+)$': {\n gettext: gettext('User \"{{name}}\" updated: {{updatesList}}'),\n placeholders: {\n name: '$1',\n updatesList: {\n capture: '$2',\n translate: {\n \"delegatedBy='(.+?)'\": {\n gettext: gettext('delegated by: \"{{delegate}}\"'),\n placeholders: {\n delegate: '$1'\n }\n },\n \"owner='(.+?)'\": {\n gettext: gettext('owner: \"{{owner}}\"'),\n placeholders: {\n owner: '$1'\n }\n },\n 'inventory assignment \\\\[(.+?)\\\\] added': {\n gettext: gettext('inventory assignment [{{inventoryAssignment}}] added'),\n placeholders: {\n inventoryAssignment: '$1'\n }\n },\n 'inventory assignment \\\\[(.+?)\\\\] removed': {\n gettext: gettext('inventory assignment [{{inventoryAssignment}}] removed'),\n placeholders: {\n inventoryAssignment: '$1'\n }\n },\n 'applications \\\\[(.+?)\\\\] added$': {\n gettext: gettext('applications [{{applicationsList}}] added'),\n placeholders: {\n applicationsList: '$1'\n }\n },\n 'applications \\\\[(.+?)\\\\] removed$': {\n gettext: gettext('applications [{{applicationsList}}] removed'),\n placeholders: {\n applicationsList: '$1'\n }\n },\n 'global roles \\\\[(.+?)\\\\] added$': {\n gettext: gettext('global roles [{{globalRolesList}}] added'),\n placeholders: {\n globalRolesList: '$1'\n }\n },\n 'global roles \\\\[(.+?)\\\\] removed$': {\n gettext: gettext('global roles [{{globalRolesList}}] removed'),\n placeholders: {\n globalRolesList: '$1'\n }\n }\n }\n }\n }\n },\n \"^User with username '(.+?)' already exists! : Duplicated: (.+?)$\": {\n gettext: gettext('User \"{{username}}\" already exists.'),\n placeholders: {\n username: '$1'\n }\n },\n \"^User with username or alias '(.+)' already exists! : Duplicated: (.+)$\": {\n gettext: gettext('User with username or login alias \"{{usernameOrAlias}}\" already exists.'),\n placeholders: {\n usernameOrAlias: '$1'\n }\n },\n \"^User with email '(.+?)' already exists! : Duplicated: (.+?)$\": {\n gettext: gettext('User with email \"{{email}}\" already exists.'),\n placeholders: {\n email: '$1'\n }\n },\n '^unable to find option with given key (.+?) : Could not find entity Option by ID (.+?)!$': {\n gettext: gettext('Unable to get tenant option: \"{{option}}\".'),\n placeholders: {\n option: '$2'\n }\n },\n '^unable to find option with given key (.+?) : There is no system property for key (.+?)$': {\n gettext: gettext('Unable to get system option: \"{{option}}\".'),\n placeholders: {\n option: '$2'\n }\n },\n '^Write failed with error code 16733 and error message \\'trying to index text where term list is too big, max is 4mb _id: \"(.+?)\"\\'$': {\n gettext: gettext('The uploaded image cannot be bigger than 4 MB. Please upload a smaller one.')\n },\n '^Write failed with error code 17280 and error message \\'WiredTigerIndex::insert: key too large to index, failing (.+?) { : \"(.+?)\" }\\'$': {\n gettext: gettext('The chosen name is too long. Please try a shorter one.')\n },\n '^You have reached devices limit. No more devices can be registered.$': {\n gettext: gettext('You reached devices limit. No more devices can be registered.')\n },\n '^(.+) succeeded for volume \"(.+)\"': {\n gettext: gettext('Operation \"{{operation}}\" succeeded for volume \"{{volume}}\".'),\n placeholders: {\n operation: '$1',\n volume: '$2'\n }\n },\n \"^Exception on tenant (.+) in statement '(.+)': Invocation exception when invoking method '(.+)' of class '(.+)' passing parameters \\\\[(.+)\\\\] for statement '(.+)': (.+) : (.+)$\": {\n gettext: gettext(\n 'Exception on tenant {{tenantId}} in statement \"{{moduleName}}\": Invocation exception when invoking method \"{{methodName}}\" of class \"{{classPath}}\" passing parameters [{{parameters}}] for statement \"{{statement}}\": {{exceptionType}} : {{exceptionMessage}}.'\n ),\n placeholders: {\n tenantId: '$1',\n moduleName: '$2',\n methodName: '$3',\n classPath: '$4',\n parameters: '$5',\n statement: '$6',\n exceptionType: '$7',\n exceptionMessage: '$8'\n }\n },\n '^No nodes are available that match all of the predicates: (.+).$': {\n gettext: gettext('No nodes are available that match all of the predicates: [{{predicates}}].'),\n placeholders: {\n predicates: '$1'\n }\n },\n '^Readiness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\\\(Client.Timeout exceeded while awaiting headers\\\\)$': {\n gettext: gettext(\n 'Readiness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).'\n ),\n placeholders: {\n requestMethod: '$1',\n uri: '$2',\n protocol: '$3'\n }\n },\n '^Liveness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\\\(Client.Timeout exceeded while awaiting headers\\\\)$': {\n gettext: gettext(\n 'Liveness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).'\n ),\n placeholders: {\n requestMethod: '$1',\n uri: '$2',\n protocol: '$3'\n }\n },\n '^Error syncing pod$': {\n gettext: gettext('Pod synchronization error.')\n },\n '^Failed create pod sandbox.$': {\n gettext: gettext('Pod sandbox creation failed.')\n },\n '^Exception on tenant (.+) in statement \\'(.+)\\': Http status code: (\\\\d+) \\\\{error=\"alarm/Unprocessable Entity\",message=\"(.+)\",info=\"https://www.cumulocity.com/guides/reference-guide/#error_reporting\",details=\"null\"\\\\}$': {\n gettext: gettext(\n 'Exception on tenant {{tenantId}} in statement \"{{statement}}\": HTTP status code: {{httpStatusCode}} : {{message | translate}}'\n ),\n placeholders: {\n tenantId: '$1',\n statement: '$2',\n httpStatusCode: '$3',\n message: '$4'\n }\n },\n \"^User '(.+)' is managed by a remote identity management service defined by an administrator, direct update is forbidden$\": {\n gettext: gettext(\n 'User \"{{userName}}\" is managed by a remote identity management service defined by an administrator, direct update is forbidden.'\n ),\n placeholders: {\n userName: '$1'\n }\n },\n '^Added new child device to \"(.+)\" \\\\(ID: (.+)\\\\).$': {\n gettext: gettext('Added new child device to \"{{parentDeviceName}}\" (ID: {{parentDeviceId}}).'),\n placeholders: {\n parentDeviceName: '$1',\n parentDeviceId: '$2'\n }\n },\n '^Updated child device of \"(.+)\" \\\\(ID: (.+)\\\\).$': {\n gettext: gettext('Updated child device of \"{{parentDeviceName}}\" (ID: {{parentDeviceId}}).'),\n placeholders: {\n parentDeviceName: '$1',\n parentDeviceId: '$2'\n }\n },\n '^Added child device \"(.+)\" \\\\(ID: (.+)\\\\).$': {\n gettext: gettext('Added child device \"{{name}}\" (ID: {{id}}).'),\n placeholders: {\n name: '$1',\n id: '$2'\n }\n },\n '^Removed child device \"(.+)\" \\\\(ID: (.+)\\\\).$': {\n gettext: gettext('Removed child device \"{{name}}\" (ID: {{id}}).'),\n placeholders: {\n name: '$1',\n id: '$2'\n }\n },\n '^Change value of \"(.+)\" to (.+) (.+).$': {\n gettext: gettext('Change value of \"{{name}}\" to {{value}}{{unit}}.'),\n placeholders: {\n name: '$1',\n value: '$2',\n unit: '$3'\n }\n },\n '^Change value of \"(.+)\" to (.+).$': {\n gettext: gettext('Change value of \"{{name}}\" to {{value}}.'),\n placeholders: {\n name: '$1',\n value: '$2'\n }\n },\n '^Change status of \"(.+)\" to \"(.+)\".$': {\n gettext: gettext('Change status of \"{{name}}\" to \"{{label}}\".'),\n placeholders: {\n name: '$1',\n label: '$2'\n }\n },\n '^Send message \"(.+)\".$': {\n gettext: gettext('Send message \"{{str}}\".'),\n placeholders: {\n str: '$1'\n }\n },\n '^Close relay (.+).$': {\n gettext: gettext('Close relay {{number}}.'),\n placeholders: {\n number: '$1'\n }\n },\n '^Open relay (.+).$': {\n gettext: gettext('Open relay {{number}}.'),\n placeholders: {\n number: '$1'\n }\n },\n '^Change trace status to (.+).$': {\n gettext: gettext('Change trace status to {{state | translate}}.'),\n placeholders: {\n state: '$1'\n }\n },\n '^Change relay status to (.+).$': {\n gettext: gettext('Change relay status to {{status | translate}}.'),\n placeholders: {\n status: '$1'\n }\n },\n '^Closing relay (.+).$': {\n gettext: gettext('Closing relay {{number}}.'),\n placeholders: {\n number: '$1'\n }\n },\n '^Opening relay (.+).$': {\n gettext: gettext('Opening relay {{number}}.'),\n placeholders: {\n number: '$1'\n }\n },\n '^Update bulk operation$': {\n gettext: gettext('Update bulk operation')\n },\n '^Update bulk operation: (.+)$': {\n gettext: gettext('Update bulk operation: {{updatesList}}'),\n placeholders: bulkOperationAuditLogTextPlaceholders\n },\n '^Update firmware to: \"?(.+?)\"? \\\\(version: (.+)\\\\)\\\\.?$': {\n gettext: gettext('Update firmware to: \"{{ name }}\" (version: {{ version }})'),\n placeholders: {\n name: '$1',\n version: '$2'\n }\n },\n '^Update firmware to: \"?(.+?)\"?\\\\.?$': {\n gettext: gettext('Update firmware to: \"{{ name }}\"'),\n placeholders: {\n name: '$1'\n }\n },\n '^Update configuration to (.+).$': {\n gettext: gettext('Update configuration to: {{ name }}.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Apply device profile: (.+).?$': {\n gettext: gettext('Apply device profile: {{ name }}'),\n placeholders: {\n name: '$1'\n }\n },\n '^Execute generic command: (.+).?$': {\n gettext: gettext('Execute generic command: {{command}}'),\n placeholders: {\n command: '$1'\n }\n },\n '^Failed to refresh application. : Cannot refresh non local-hosted application.$': {\n gettext: gettext('Could not reactivate the application as it is not hosted locally.')\n },\n '^Failed to refresh application. : Cannot refresh application without active version id.$': {\n gettext: gettext('Could not reactivate the application as it has no active version.')\n },\n // TODO: remove if we decide not to translate such messages:\n // '^Killing container with id (.+):Need to kill Pod$': {\n // gettext: gettext('Killing container with ID \"{{containerId}}\". Need to kill Pod.'),\n // placeholders: {\n // containerId: '$1'\n // }\n // },\n '^Scaled down replica set (.+) to (\\\\d+)$': {\n gettext: gettext('Replica set \"{{replicaSetName}}\" scaled down to \"{{scaleNumber}}\".'),\n placeholders: {\n replicaSetName: '$1',\n scaleNumber: '$2'\n }\n },\n '^Deleted pod: (.+)$': {\n gettext: gettext('Pod \"{{imageName}}\" deleted.'),\n placeholders: {\n imageName: '$1'\n }\n },\n '^Container image \"(.+)\" already present on machine$': {\n gettext: gettext('Container image \"{{imageName}}\" already exists.'),\n placeholders: {\n imageName: '$1'\n }\n },\n '^Error updating tenant! Cannot insert second configuration for Password code grant internal/Bad Request$': {\n gettext: gettext(\n 'This login mode was already set by another administrator. Refresh the page to update the data.'\n )\n }\n};\n","import { Injectable } from '@angular/core';\n\n/**\n * A service to provide unmodified, cached translations for angular.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CachedLocaleDictionaryService {\n cachedDictionary = {};\n}\n","import { HttpClient } from '@angular/common/http';\nimport { TranslateLoader } from '@ngx-translate/core';\nimport { Observable, of } from 'rxjs';\nimport { map, catchError, tap } from 'rxjs/operators';\nimport { Inject, Injectable } from '@angular/core';\nimport { LOCALE_PATH } from './locale.path';\nimport { LANGUAGES } from './languages';\nimport { OptionsService } from '../common/options.service';\nimport { mapKeys } from 'lodash-es';\nimport { CachedLocaleDictionaryService } from './cached-locale-dictionary.service';\n\n@Injectable()\nexport class TranslateCustomLoader implements TranslateLoader {\n constructor(\n private http: HttpClient,\n private optionsService: OptionsService,\n private cachedLocaleDictionaryService: CachedLocaleDictionaryService,\n @Inject(LOCALE_PATH) private path: string = null,\n @Inject(LANGUAGES) private languages: any = null\n ) {}\n\n getTranslation(lang: string): Observable<any> {\n const path = this.path || '';\n let url = `${path}${lang}.json`;\n if (this.languages && this.languages[lang] && this.languages[lang].url) {\n url = this.languages[lang].url;\n }\n\n return this.http.get(url).pipe(\n map(d => {\n if (this.optionsService.langsDetails && this.optionsService.langsDetails[lang]) {\n return { ...d[lang], ...this.optionsService.langsDetails[lang] };\n }\n return d[lang];\n }),\n tap(dictionary => {\n this.cachedLocaleDictionaryService.cachedDictionary[lang] = dictionary;\n }),\n map(dictionary => this.getDictionaryWithTrimmedKeys(dictionary)),\n catchError(() => of({}))\n );\n }\n\n /**\n * We want to have translation keys unified, so they don't contain unnecessary spaces and line breaks.\n * This way we can dynamically build keys from HTML, and match them to extracted string, that might be HTML as well.\n */\n getDictionaryWithTrimmedKeys(dictionary: object) {\n return mapKeys(dictionary, (value, key) =>\n trimTranslationKey(key)\n );\n }\n\n}\n\nexport function trimTranslationKey(key) {\n return key.replace(/(\\r\\n|\\n|\\r)/gm, '').replace(/\\s{2,}/g, ' ').trim();\n}\n","import { Injectable } from '@angular/core';\nimport { TranslateDefaultParser } from '@ngx-translate/core';\nimport { get } from 'lodash-es';\nimport { trimTranslationKey } from './translate.loader';\n\n@Injectable()\nexport class TranslateParserCustom extends TranslateDefaultParser {\n\n getValue(target: any, key: string): any {\n const trimmedKey = trimTranslationKey(key);\n let translated = get(target, [trimmedKey]);\n if (!translated) {\n const keys = key.split('.');\n if (keys.length > 1) {\n translated = get(target, key);\n }\n }\n return translated;\n }\n}\n","import {\n DefaultLangChangeEvent,\n LangChangeEvent,\n TranslateService,\n TranslationChangeEvent\n} from '@ngx-translate/core';\nimport {\n AfterViewChecked,\n ChangeDetectorRef,\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { isEqual } from 'lodash-es';\n\n/**\n * This is temporary fallback directive that is used to handle HTML blocks translation on maintenance versions\n * in version 10.9.4 and later, this is replaced by default translate directive.\n */\n@Directive({\n selector: '[forceHtmlTranslate]'\n})\nexport class ForceHtmlTranslateDirective implements AfterViewChecked, OnDestroy {\n currentParams: any;\n onLangChangeSub: Subscription;\n onDefaultLangChangeSub: Subscription;\n onTranslationChangeSub: Subscription;\n\n /**\n * Used to trigger events when html is replaced by directive.\n */\n htmlUpdateEvent: EventEmitter<void> = new EventEmitter<void>();\n\n @Input() set translateParams(params: any) {\n if (!isEqual(this.currentParams, params)) {\n this.currentParams = params;\n this.checkNodes();\n }\n }\n\n constructor(\n private translateService: TranslateService,\n private element: ElementRef,\n private _ref: ChangeDetectorRef\n ) {\n // subscribe to onTranslationChange event, in case the translations of the current lang change\n if (!this.onTranslationChangeSub) {\n this.onTranslationChangeSub = this.translateService.onTranslationChange.subscribe(\n (event: TranslationChangeEvent) => {\n if (event.lang === this.translateService.currentLang) {\n this.checkNodes();\n }\n }\n );\n }\n\n // subscribe to onLangChange event, in case the language changes\n if (!this.onLangChangeSub) {\n this.onLangChangeSub = this.translateService.onLangChange.subscribe(\n (event: LangChangeEvent) => {\n this.checkNodes();\n }\n );\n }\n\n // subscribe to onDefaultLangChange event, in case the default language changes\n if (!this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub = this.translateService.onDefaultLangChange.subscribe(\n (event: DefaultLangChangeEvent) => {\n this.checkNodes();\n }\n );\n }\n }\n\n ngAfterViewChecked() {\n this.checkNodes();\n }\n\n checkNodes() {\n if (this.isLookupKeyMissing()) {\n this.element.nativeElement.lookupKey = this.getLookupKey();\n }\n this.translateAndUpdateHtmlContent();\n this.htmlUpdateEvent.emit();\n }\n\n ngOnDestroy() {\n if (this.onLangChangeSub) {\n this.onLangChangeSub.unsubscribe();\n }\n\n if (this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub.unsubscribe();\n }\n\n if (this.onTranslationChangeSub) {\n this.onTranslationChangeSub.unsubscribe();\n }\n this.htmlUpdateEvent.complete();\n }\n\n /**\n * Builds lookup key from innerHTML, removes comments (that might be added by Angular) and trims it.\n */\n private getLookupKey() {\n return this.element.nativeElement.innerHTML.replace(/<!--.*?-->/gs, '').trim();\n }\n\n private isLookupKeyMissing(): boolean {\n return !this.element.nativeElement.lookupKey;\n }\n\n private lookupKeyExist(): boolean {\n return this.element.nativeElement.lookupKey;\n }\n\n private translateAndUpdateHtmlContent(): void {\n if (this.lookupKeyExist()) {\n this.element.nativeElement.innerHTML = this.translateService.instant(\n this.element.nativeElement.lookupKey,\n this.currentParams || {}\n );\n }\n }\n}\n","import { HttpClient, HttpClientModule } from '@angular/common/http';\nimport { LOCALE_ID, NgModule } from '@angular/core';\nimport {\n MissingTranslationHandler,\n TranslateService as NgxTranslateService,\n TranslateCompiler,\n TranslateFakeCompiler,\n TranslateLoader,\n TranslateModule,\n TranslateParser,\n TranslateStore,\n USE_DEFAULT_LANG,\n USE_STORE,\n USE_EXTEND,\n DEFAULT_LANGUAGE\n} from '@ngx-translate/core';\nimport { OptionsService } from '../common/options.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { LANGUAGES } from './languages';\nimport { LOCALE_PATH } from './locale.path';\nimport { MissingTranslationCustomHandler } from './missing-translation-custom.handler';\nimport { MESSAGES } from './pattern-messages.data';\nimport { HOOK_PATTERN_MESSAGES } from './patterns-message.hook';\nimport { TranslateCustomLoader } from './translate.loader';\nimport { TranslateParserCustom } from './translate.parser';\nimport { CachedLocaleDictionaryService } from './cached-locale-dictionary.service';\nimport { ForceHtmlTranslateDirective } from './force-html-translate.directive';\n\n// Load these as a side effect\ntry {\n // tslint:disable:no-var-requires\n require('@c8y/ngx-components/locales/de.po');\n require('@c8y/ngx-components/locales/en.po');\n require('@c8y/ngx-components/locales/es.po');\n require('@c8y/ngx-components/locales/fr.po');\n require('@c8y/ngx-components/locales/ja_JP.po');\n // tslint:enable:no-var-requires\n} catch (e) {\n // empty block\n}\n\nconst angularLocalesLanguageMap = { en: 'en-GB', 'en-EN': 'en-GB' };\n\n// AoT requires an exported function for factories\nexport function translateLoaderFactory(\n httpClient: HttpClient,\n optionsService: OptionsService,\n cachedLocaleDictionaryService: CachedLocaleDictionaryService,\n localePath: string,\n languages: any\n) {\n return new TranslateCustomLoader(httpClient, optionsService, cachedLocaleDictionaryService, localePath, languages);\n}\n\nexport function localePathFactory(options: OptionsService) {\n return options.localePath;\n}\n\nexport function languagesFactory(options: OptionsService) {\n return options.languages;\n}\n\nexport function localeId(appStateService: AppStateService) {\n return {\n get lang() {\n return getAngularLocalesLanguageString(appStateService.state.lang || 'en');\n },\n toLowerCase() {\n return this.lang.toLowerCase();\n },\n toString() {\n return this.lang;\n }\n };\n}\n\nexport function getAngularLocalesLanguageString(language) {\n return angularLocalesLanguageMap[language] || language;\n}\n\n/**\n * The angular module definition for i18n (translation).\n * @exports I18nModule\n */\n@NgModule({\n exports: [TranslateModule, ForceHtmlTranslateDirective],\n imports: [HttpClientModule],\n declarations: [ForceHtmlTranslateDirective]\n})\nexport class I18nModule {\n static providers() {\n return [\n { provide: LOCALE_ID, useFactory: localeId, deps: [AppStateService] },\n { provide: HOOK_PATTERN_MESSAGES, useValue: MESSAGES, multi: true },\n { provide: LOCALE_PATH, useFactory: localePathFactory, deps: [OptionsService] },\n { provide: LANGUAGES, useFactory: languagesFactory, deps: [OptionsService] },\n\n // Extracted from projects/ngx-translate/core/src/public_api.ts\n {\n provide: TranslateLoader,\n useFactory: translateLoaderFactory,\n deps: [HttpClient, OptionsService, CachedLocaleDictionaryService, LOCALE_PATH, LANGUAGES]\n },\n { provide: TranslateCompiler, useClass: TranslateFakeCompiler },\n { provide: TranslateParser, useClass: TranslateParserCustom },\n { provide: MissingTranslationHandler, useClass: MissingTranslationCustomHandler },\n TranslateStore,\n NgxTranslateService,\n { provide: USE_STORE, useValue: undefined },\n { provide: USE_DEFAULT_LANG, useValue: undefined },\n { provide: USE_EXTEND, useValue: false },\n { provide: DEFAULT_LANGUAGE, useValue: undefined }\n ];\n }\n static forRoot() {\n return {\n ngModule: I18nModule,\n providers: I18nModule.providers()\n };\n }\n}\n","export function parse(moduleSrc) {\n const src = moduleSrc.split(/\\n/)\n .map((l) => l.trim())\n .filter(Boolean)\n .filter((l) => !l.match(/^\\/?\\*/) && !l.match(/^\\/\\//))\n .join('\\n');\n const fn = new Function(`var exports = {};\nvar module = { exports: exports };\n${src}\nreturn exports;`);\n return fn();\n}\n","import './import-locales';\nimport { parse } from './parse-module';\nconst cache = new Map();\n/**\n * @ignore\n */\nexport function loadLocale(moduleLang) {\n return new Promise((resolve, reject) => {\n if (cache.has(moduleLang)) {\n resolve(cache.get(moduleLang));\n } else {\n fetch(`assets/locales/angular/${moduleLang}.js`)\n .then((res) => res.text())\n .then((src) => {\n const module = parse(src);\n cache.set(moduleLang, module);\n resolve(module);\n })\n .catch(reject);\n }\n });\n}\n","import { registerLocaleData } from '@angular/common';\nimport { Injectable } from '@angular/core';\nimport { TranslateService as NgxTranslateService } from '@ngx-translate/core';\nimport { keys } from 'lodash-es';\nimport { OptionsService } from '../common/options.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { getAngularLocalesLanguageString } from './i18n.module';\nimport { loadLocale } from './load-locale';\n\n/**\n * A service to manage the language of the application.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class TranslateService {\n static SAVE_LANGUAGE_KEY = 'c8y_language';\n static defaultLang() {\n return window.localStorage.getItem(TranslateService.SAVE_LANGUAGE_KEY);\n }\n langsDetail: any = this.options.get('languages', {});\n langs: any = keys(this.langsDetail).filter(k => this.langsDetail[k]);\n private DEFAULT_SEPARATOR = '_';\n constructor(\n private ngxTranslate: NgxTranslateService,\n private ui: AppStateService,\n private options: OptionsService\n ) {\n const queryStringLang = this.queryStringLang();\n if (queryStringLang) {\n this.saveInLocalStorage(queryStringLang);\n }\n }\n\n /**\n * Switches to given language.\n * @param lang The language as two-letter code.\n */\n async switchToLanguage(lang: string) {\n const moduleLang = lang.replace('_', '-');\n\n try {\n await this.loadLocales(moduleLang);\n } catch (e) {\n const lessSpecificModuleLang = moduleLang.split('-').shift();\n if (lessSpecificModuleLang !== moduleLang) {\n await this.loadLocales(lessSpecificModuleLang);\n } else {\n throw e;\n }\n }\n\n this.setLanguage(lang);\n }\n\n async loadLocales(moduleLang) {\n const module: any = await loadLocale(getAngularLocalesLanguageString(moduleLang));\n registerLocaleData(module.default);\n }\n\n setLanguage(lang: string) {\n this.ngxTranslate.setDefaultLang(this.options.get('defaultLanguage', 'en'));\n this.ngxTranslate.use(lang).subscribe(() => {\n this.ui.state$.next({ ...this.ui.state, lang });\n });\n }\n\n /**\n * Finds the first supported language\n */\n firstSupportedLanguage() {\n const languages = [this.queryStringLang(), this.localStorageLang()]\n .concat([this.options.get('defaultLanguage')])\n .concat(this.browserLangs())\n .concat(['en'])\n .filter(Boolean);\n const preferredLanguage = languages.find(lang => this.getSupported(lang));\n return this.getSupported(preferredLanguage);\n }\n\n /**\n * Converts a iso language code to a PO language code (e.g. de-de gets de_de).\n * @param lang The iso language code.\n */\n convertToLanguageCodePO(lang: string): string {\n const sep = lang.indexOf('-') > -1 ? '-' : this.DEFAULT_SEPARATOR;\n const [langMain, langSpecific] = lang.split(sep);\n const langLast = langSpecific ? `${this.DEFAULT_SEPARATOR}${langSpecific}` : '';\n return `${langMain}${langLast}`;\n }\n\n /**\n * Returns the language in the native language.\n * @param lang The language two-letter code.\n * @return The native name.\n */\n getNativeLanguage(lang: string): string {\n const langData = (this.langsDetail || {})[lang] || {};\n return langData.nativeName || lang;\n }\n\n saveInLocalStorage(lang: string) {\n window.localStorage.setItem(TranslateService.SAVE_LANGUAGE_KEY, lang);\n }\n\n getSupported(lang: string) {\n return this.langs.find(l => l === lang) || this.langs.find(l => l.startsWith(lang));\n }\n\n /**\n * Gets the language from the query parameter.\n * @return The language two-letter code.\n */\n queryStringLang() {\n return this.getQueryParameter('lang');\n }\n\n /**\n * Gets the language from local storage.\n * @return The language two-letter code.\n */\n private localStorageLang() {\n return window.localStorage.getItem(TranslateService.SAVE_LANGUAGE_KEY);\n }\n\n /**\n * Determines which language is set in the browser.\n * @return The languages the browser supports as string array.\n */\n private browserLangs() {\n const { navigator } = window;\n const browserLanguagePropertyKeys = [\n 'languages',\n 'language',\n 'browserLanguage',\n 'systemLanguage',\n 'userLanguage'\n ];\n return browserLanguagePropertyKeys.reduce((languages, property) => {\n const propertyLanguages = navigator[property];\n if (typeof propertyLanguages === 'string') {\n languages.push(propertyLanguages);\n } else if (Array.isArray(propertyLanguages)) {\n languages = languages.concat(propertyLanguages);\n }\n return languages;\n }, []);\n }\n\n private getQueryParameter(queryKey) {\n // TODO: replace this with URLSearchParams, ie 11 still doesn't support :()\n const query = window.location.search.substring(1);\n let result;\n query.split('&').find(pair => {\n const [key, value] = pair.split('=');\n if (key === queryKey) {\n result = value;\n }\n return result;\n });\n return result;\n }\n}\n","import { DatePipe as NgDatePipe } from '@angular/common';\nimport { Inject, LOCALE_ID, Pipe } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { gettext } from '../i18n/gettext';\n\n/**\n * The range of times supported by ECMAScript Date objects in milliseconds.\n * @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.1\n */\nexport const ES_MAX_TIME_MILLISECONDS: number = 8640000000000000;\n\n/**\n * Formats a date value according to locale rules. If no other format specified it defaults to `medium`\n * used as standard date/time format.\n *\n * Extends Angular's DatePipe in a way so that date values exceeding the range supported by ECMAScript\n * are displayed as earliest/latest supported point in time printed in the desired format pre- or postfixed\n * by the word `before` or `after`, respectively.\n * In all other cases the pipe behaves as the standard [DatePipe]{@link https://angular.io/api/common/DatePipe}.\n *\n * ```html\n * <span class=\"highlight\">{{ deadline | c8yDate }}</span> <!-- e.g. 7 May 2020, 17:45:19 (en-GB) or 07.05.2020, 17:45:19 (de) -->\n * <span>{{ lastUpdated | c8yDate: 'a h:MM:ss' }}</span> <!-- e.g. pm 5:45:19 -->\n * <span>{{ 8640000000000000 + 1 | c8yDate }}</span> <!-- e.g. after 13 Sep 275760, 03:00:00 --> ```\n */\n@Pipe({ name: 'c8yDate' })\nexport class DatePipe extends NgDatePipe {\n constructor(@Inject(LOCALE_ID) locale: string, private translateService: TranslateService) {\n super(locale);\n }\n\n transform(\n value: any,\n format: string = 'medium',\n timezone?: string,\n locale?: string\n ): string | null {\n let valueInBounds = value;\n let valueBefore: boolean = false;\n let valueBeyond: boolean = false;\n\n if (typeof value === 'number' && !isNaN(value)) {\n valueInBounds = Math.min(value, ES_MAX_TIME_MILLISECONDS);\n valueInBounds = Math.max(valueInBounds, -ES_MAX_TIME_MILLISECONDS);\n\n valueBefore = value < -ES_MAX_TIME_MILLISECONDS;\n valueBeyond = value > ES_MAX_TIME_MILLISECONDS;\n }\n let result: string = super.transform(valueInBounds, format, timezone, locale);\n\n if (valueBefore) {\n result = this.translateService.instant(gettext(`before {{date}}`), { date: result });\n } else if (valueBeyond) {\n result = this.translateService.instant(gettext(`after {{date}}`), { date: result });\n }\n\n return result;\n }\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n Output,\n TemplateRef\n} from '@angular/core';\nimport { IIdentified, Paging } from '@c8y/client';\n\n@Component({\n selector: 'c8y-load-more',\n templateUrl: './load-more.component.html'\n})\nexport class LoadMoreComponent {\n @Input()\n paging: Paging<any>;\n @Input()\n useIntersection = true;\n @Input()\n hidden = false;\n @Input()\n container: ElementRef;\n @Input()\n class: string = 'c8y-list__item p-0';\n @Input()\n maxIterations = 10;\n @Input()\n noMoreDataHint: TemplateRef<any>;\n @Input()\n loadNextLabel: string;\n @Input()\n loadingLabel: string;\n @Output()\n onLoad = new EventEmitter<IIdentified>();\n\n isLoading = false;\n counter = 0;\n showNoMoreDataHint = false;\n private loadUntilIntersected;\n private readonly LOAD_SAME_PAGE_THRESHOLD = 50;\n private intersectionObserver: IntersectionObserver;\n\n @HostBinding('class')\n get hostClass() {\n return this.hidden || (!this.hasMore && !this.showNoMoreDataHint) ? '' : this.class;\n }\n\n get hasMore() {\n return (\n this.paging && (this.paging.totalPages > this.paging.currentPage || !!this.paging.nextPage)\n );\n }\n\n constructor(private element: ElementRef) {}\n\n ngAfterContentInit(): void {\n if (this.useIntersection && 'IntersectionObserver' in window) {\n this.intersectionObserver = new IntersectionObserver(event => this.buttonInView(event[0]), {\n root: this.container ? this.container.nativeElement : null\n });\n this.intersectionObserver.observe(this.element.nativeElement);\n }\n this.showNoMoreDataHint = this.shouldShowNoMoreDataHint();\n }\n\n ngOnDestroy(): void {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n }\n }\n\n async loadMore(event?) {\n this.isLoading = true;\n if (event) {\n event.stopPropagation();\n }\n if (this.hasMore) {\n const result = await this.paging.next();\n this.counter++;\n this.paging = result.paging;\n this.onLoad.emit(result.data);\n this.intersectionLoading();\n this.showNoMoreDataHint = this.shouldShowNoMoreDataHint();\n } else {\n this.counter = 0;\n this.isLoading = false;\n }\n }\n\n private intersectionLoading() {\n if (this.useIntersection && this.hasMore && this.loadUntilIntersected !== null) {\n this.loadUntilIntersected = setTimeout(() => this.loadMore(), this.getLoadingThreshold());\n this.useIntersection = this.shouldSwitchMode();\n } else {\n this.isLoading = false;\n this.loadUntilIntersected = undefined;\n }\n }\n\n private getLoadingThreshold(): number {\n return this.LOAD_SAME_PAGE_THRESHOLD * this.counter;\n }\n\n private shouldShowNoMoreDataHint() {\n return (this.counter !== 0 || this.noMoreDataHint) && !this.hasMore && !this.hidden;\n }\n\n private shouldSwitchMode() {\n return this.counter < this.maxIterations || this.hidden;\n }\n\n private buttonInView(event) {\n if (event.isIntersecting) {\n this.loadMore();\n } else if (this.loadUntilIntersected) {\n clearTimeout(this.loadUntilIntersected);\n this.loadUntilIntersected = null;\n this.isLoading = false;\n } else {\n // avoiding a race condition when timeout is faster\n // cleared then set\n this.loadUntilIntersected = null;\n }\n }\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n ComponentFactory,\n ComponentFactoryResolver,\n Directive,\n EmbeddedViewRef,\n Input,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n ViewRef\n} from '@angular/core';\nimport { IIdentified, IResultList, Paging } from '@c8y/client';\nimport { assign, get } from 'lodash-es';\nimport { isObservable, Observable, of, pipe, Subject, Subscription } from 'rxjs';\nimport { map, takeUntil, tap } from 'rxjs/operators';\nimport { RealtimeService } from '../realtime/realtime.service';\nimport { LoadMoreComponent } from './load-more.component';\nimport { LoadMoreMode } from './load-more.model';\n\n/**\n * A directive to iterate over IResultList<T> data from @c8y/client.\n * Depending on the [c8yForLoadMore] a load more button is:\n * - auto: Tries to automatically load more data (default maximum 10 iterations; can be\n * change with maxIterations settings).\n * - show: Shows a load more button for the user to decide\n * - none: Doesn't perform any load more action.\n * - hidden: Loads more data automatically but with no visible button for the user.\n *\n * Additional, any rxjs operator pipe can be applied to the [c8yForPipe] input, e.g. to\n * filter the data displayed currently as well as the data loaded by subsequent requests.\n *\n * Example:\n * ```html\n * <div *c8yFor=\"let device of devices; loadMore: 'auto'; let i = index; pipe: filterPipe;\">\n * {{ i + 1 }}. {{device.name}}\n * </div>\n * ```\n * The above example will list all entities that are applied to `devices`:\n * ```typescript\n * this.devices = this.inventoryService.list({ pageSize: 10, fragmentType: 'c8y_IsDevice' })\n * ```\n * It will display the first 10 items, if there is more space left on the screen, and there are more\n * than 10 devices, it will automatically load up to 10 pages more. If it still can't fit the screen\n * it will stop and switch to `show` mode.\n *\n * A pipe can be applied e.g. for filtering or grouping. This pipe is attached to every follow up\n * request done by the load more component:\n * ```typescript\n * this.filterPipe = pipe(\n * map((data: []) => {\n * return data.filter(\n * (mo: any) => mo.name && mo.name.toLowerCase().indexOf(value.toLowerCase()) > -1\n * );\n * })\n * );\n * ```\n * The pipe must be an rxjs pipe and can take any operator.\n */\n@Directive({\n selector: '[c8yFor]'\n})\nexport class ForOfDirective {\n private cachedData: IIdentified[] = [];\n private paging: Paging<IIdentified>;\n private loadMoreMode: LoadMoreMode = 'auto';\n private dataPipe = pipe(tap());\n private pagingSub: Subscription;\n private obs$: Observable<IIdentified[]>;\n private loadMore: LoadMoreComponent;\n private maxIterations = 10;\n private notFoundTemplate: TemplateRef<any>;\n private realtime: RealtimeService<any>;\n private comparator: (itemA: object, itemB: object) => number;\n private unsubscribe$: Subject<void> = new Subject();\n\n private get shouldUseLoadMoreButton() {\n return (\n this.loadMoreMode === 'auto' || this.loadMoreMode === 'show' || this.loadMoreMode === 'hidden'\n );\n }\n\n private get hasMoreData() {\n return this.loadMore && this.loadMore.hasMore;\n }\n\n private get length() {\n return this.cachedData.length;\n }\n\n /**\n * The data setter. Must be a response from @c8y/data or an observable.\n * You can pass an observable with null to explicitly clear the list.\n */\n @Input()\n set c8yForOf(fetchData: IResultList<IIdentified> | Observable<IResultList<IIdentified>>) {\n if (fetchData) {\n this.obs$ = (isObservable(fetchData) ? fetchData : of(fetchData)).pipe(\n map(result => {\n if (result === null) {\n this.paging = null;\n return [];\n }\n const { paging, data } = result;\n this.paging = paging;\n return data;\n })\n );\n }\n }\n\n /**\n * The mode setter:\n * - auto: Tries to automatically load more data (default maximum 10 iterations; can be\n * change with maxIterations settings).\n * - show: Shows a load more button for the user to decide\n * - none: Doesn't perform any load more action.\n * - hidden: Loads more data automatically but with no visible button for the user.\n */\n @Input()\n set c8yForLoadMore(type: LoadMoreMode) {\n this.loadMoreMode = type;\n }\n\n /**\n * The pipe setter to attach any rxjs pipe to the current and more loaded data.\n */\n @Input()\n set c8yForPipe(dataPipe) {\n if (dataPipe) {\n this.dataPipe = dataPipe;\n }\n }\n\n /**\n * A template to use if no data is found at all (e.g. if you apply a filter pipe).\n */\n @Input()\n set c8yForNotFound(notFoundTemplate: TemplateRef<any>) {\n this.notFoundTemplate = notFoundTemplate;\n if (this.loadMore) {\n this.loadMore.noMoreDataHint = notFoundTemplate;\n }\n }\n\n /**\n * The maximum numbers of iterations to call data from the api.\n */\n @Input()\n set c8yForMaxIterations(maxIterations: number) {\n this.maxIterations = maxIterations;\n }\n\n /**\n * A RealtimeService instance.\n */\n @Input()\n set c8yForRealtime(source: RealtimeService<any>) {\n this.realtime = source;\n }\n\n /**\n * A comparator function for comparing list items. Used to determine\n * the position at which a new element should be added to the list.\n */\n @Input()\n set c8yForComparator(comparator: (itemA: object, itemB: object) => number) {\n this.comparator = comparator;\n }\n\n constructor(\n private tpl: TemplateRef<any>,\n private vcr: ViewContainerRef,\n private componentFactoryResolver: ComponentFactoryResolver\n ) {}\n\n ngOnInit(): void {\n this.handleRealtime();\n }\n\n private ngOnChanges(changes: SimpleChanges): void {\n if (this.obs$ && (changes.c8yForPipe || changes.c8yForOf)) {\n this.unsubscribePaging();\n\n // only re-rendering on filtering if all data is already loaded\n // from the backend\n const reRender = !this.hasMoreData && !!changes.c8yForPipe && !changes.c8yForOf;\n\n if (reRender) {\n this.obs$ = of(this.cachedData);\n }\n this.pagingSub = this.obs$\n .pipe(\n tap(data => {\n if (!reRender) {\n this.cachedData = data;\n }\n })\n )\n .pipe(src => this.dataPipe(src))\n .subscribe((data: []) => {\n this.render(data, reRender);\n });\n }\n }\n\n private ngOnDestroy(): void {\n this.unsubscribePaging();\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n\n private handleRealtime() {\n if (this.realtime) {\n this.realtime\n .onCreate$()\n .pipe(takeUntil(this.unsubscribe$))\n .subscribe(item => this.insert(item));\n this.realtime\n .onUpdate$()\n .pipe(takeUntil(this.unsubscribe$))\n .subscribe(item => this.update(item));\n this.realtime\n .onDelete$()\n .pipe(takeUntil(this.unsubscribe$))\n .subscribe(id => this.remove(coerceNumberProperty(id)));\n }\n }\n\n private render(data, reRender = false): void {\n this.vcr.clear();\n\n data.forEach((item, index) => {\n const context = {\n $implicit: item,\n index,\n length: this.length,\n hasMore: this.hasMoreData\n };\n this.vcr.createEmbeddedView(this.tpl, context);\n });\n\n if (this.shouldUseLoadMoreButton) {\n this.loadMore = this.createLoadMoreButtonComponent(reRender);\n }\n }\n\n private append(data) {\n data.forEach(item => {\n const index = this.shouldUseLoadMoreButton ? this.vcr.length - 1 : this.vcr.length;\n const context = {\n $implicit: item,\n index,\n length: this.length,\n hasMore: this.hasMoreData\n };\n this.vcr.createEmbeddedView(this.tpl, context, index);\n });\n }\n\n private loadMoreData(data) {\n if (data.length > 0) {\n this.append(data);\n }\n }\n\n private createLoadMoreButtonComponent(reRender) {\n const componentFactory: ComponentFactory<\n any\n > = this.componentFactoryResolver.resolveComponentFactory(LoadMoreComponent);\n const componentRef = this.vcr.createComponent(componentFactory);\n const instance = componentRef.instance as LoadMoreComponent;\n instance.paging = this.paging;\n instance.useIntersection = this.loadMoreMode === 'auto' || this.loadMoreMode === 'hidden';\n instance.hidden = this.loadMoreMode === 'hidden';\n instance.maxIterations = this.maxIterations;\n instance.noMoreDataHint = this.notFoundTemplate;\n this.pagingSub = instance.onLoad\n .pipe(\n map((data: []) => this.checkForDuplicates(data)),\n tap((data: []) => {\n this.cachedData = this.cachedData.concat(data);\n })\n )\n .pipe(src => this.dataPipe(src))\n .subscribe(data => this.loadMoreData(data));\n if (reRender) {\n assign(instance, this.loadMore);\n }\n return instance;\n }\n\n private insert(item) {\n let index: number = 0;\n\n if (this.comparator && this.cachedData.length) {\n let comparisionResult: number;\n do {\n const view: EmbeddedViewRef<any> = this.vcr.get(index) as EmbeddedViewRef<any>;\n const itemB = get(view, 'context.$implicit');\n comparisionResult = item && itemB ? this.comparator(item, itemB) : 0;\n if (comparisionResult <= 0) {\n index++;\n }\n } while (comparisionResult <= 0 && index < this.cachedData.length);\n }\n\n // Do not append elements after the last one currently loaded,\n // as it may belong further down there on the list and will\n // be eventually loaded with one of the next pages.\n if (index < this.cachedData.length || this.cachedData.length === 0) {\n const context = {\n $implicit: item,\n index,\n length: this.length,\n hasMore: this.hasMoreData\n };\n\n this.cachedData.splice(index, 0, item);\n const viewRef: ViewRef = this.tpl.createEmbeddedView(context);\n this.vcr.insert(viewRef, index);\n }\n }\n\n private update(updatedItem) {\n this.forMatchingEmbeddedViewRef(\n (item: IIdentified) => item && updatedItem && item.id === updatedItem.id,\n (view: EmbeddedViewRef<any>) => {\n view.context.$implicit = updatedItem;\n view.markForCheck();\n }\n );\n }\n\n private remove(idToRemove) {\n this.forMatchingEmbeddedViewRef(\n (item: IIdentified) => item && coerceNumberProperty(item.id, NaN) === idToRemove,\n (view: EmbeddedViewRef<any>) => view.destroy()\n );\n }\n\n private forMatchingEmbeddedViewRef(\n filter: (item: IIdentified) => boolean,\n callback: (view: EmbeddedViewRef<any>) => void\n ) {\n for (let i = 0; i < this.vcr.length; i++) {\n const view: EmbeddedViewRef<any> = this.vcr.get(i) as EmbeddedViewRef<any>;\n const item: IIdentified = get(view, 'context.$implicit');\n if (filter(item)) {\n callback(view);\n }\n }\n }\n\n private checkForDuplicates(data: IIdentified[]): IIdentified[] {\n return this.realtime\n ? data.filter(item => !this.cachedData.some(cached => cached.id === item.id))\n : data;\n }\n\n private unsubscribePaging() {\n if (this.pagingSub) {\n this.pagingSub.unsubscribe();\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { Observable } from 'rxjs';\nimport { gettext } from '../i18n/gettext';\nimport { get, find, negate, isUndefined } from 'lodash';\nimport { HumanizePipe } from './humanize.pipe';\n\n/*\n * Humanize an application name and translates it.\n * Usage:\n * appNameOrApp | humanizeAppName | async\n*/\n@Pipe({ name: 'humanizeAppName' })\nexport class HumanizeAppNamePipe implements PipeTransform {\n\n private internalApps = {\n administration: 'Administration',\n cockpit: 'Cockpit',\n devicemanagement: 'Device management'\n };\n\n constructor(private translateService: TranslateService) {}\n\n transform(appNameOrApp: any = 'Cumulocity'): Observable<string> {\n const appName = this.getAppName(appNameOrApp);\n\n let text;\n if (this.isPublicApp(appNameOrApp)) {\n text = gettext('{{ appName | translate }} (public)');\n } else {\n text = appName;\n }\n return this.translateService.stream(text, { appName });\n }\n\n private getAppName(appNameOrApp) {\n const appName = this.getFirstDefined([\n get(appNameOrApp, 'name'),\n get(appNameOrApp, 'contextPath'),\n appNameOrApp\n ]) || '';\n return this.internalApps[appName] || appName;\n }\n\n private getFirstDefined(values) {\n return find(values, negate(isUndefined));\n }\n\n private isPublicApp(appNameOrApp) {\n return Boolean(get(appNameOrApp, 'public'));\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { upperFirst } from 'lodash-es';\n\n/*\n * Humanize any string\n * Usage:\n * 'something' | humanize\n*/\n@Pipe({ name: 'humanize' })\nexport class HumanizePipe implements PipeTransform {\n static humanize(str: string = ''): string {\n str = str\n .replace(/\\./g, ' ')\n .replace(/c8y[\\s,_]*/gi, '')\n .replace(/_/g, ' ')\n .replace(/([A-Z][a-z])/g, ' $1')\n .replace(/^\\$\\.?/, '')\n .replace(/^\\s*/, '')\n .replace(/\\s*$/, '')\n .replace(/\\s+/g, ' ');\n\n return upperFirst(str);\n }\n\n transform(str: string): string {\n return HumanizePipe.humanize(str);\n }\n}\n","import { Directive, Renderer2, Input, ElementRef } from '@angular/core';\n\n/**\n * Allows to set a icon. Switches between c8y default icons\n * and font awesome icons\n * @example <i [c8yIcon]=\"'rocket'\">\n */\n@Directive({\n selector: '[c8yIcon]',\n})\nexport class IconDirective {\n\n @Input()\n set c8yIcon(icon: string) {\n this.updateIcon(icon);\n }\n private c8yMatch = /^c8y-/;\n private klasses = [];\n private currentClasses = '';\n constructor(\n private el: ElementRef,\n private renderer: Renderer2\n ) {}\n\n private isC8y(icon) {\n return this.c8yMatch.test(icon);\n }\n\n private getClasses(icon: string = '') {\n let classes = '';\n if (icon) {\n const _icon = icon.trim();\n const isC8y = this.isC8y(_icon);\n const iconClass = isC8y ? _icon.replace(this.c8yMatch, 'c8y-icon-') : `fa-${_icon}`;\n classes = `${isC8y ? 'c8y-icon' : 'fa fw'} ${iconClass}`;\n }\n return classes;\n }\n\n private updateIcon(icon: string) {\n const newClasses = this.getClasses(icon);\n if (newClasses !== this.currentClasses) {\n this.currentClasses.split(/\\s/).filter((c) => c).forEach((klass) => {\n this.renderer.removeClass(this.el.nativeElement, klass);\n });\n newClasses.split(/\\s/).filter((c) => c).forEach((klass) => {\n this.renderer.addClass(this.el.nativeElement, klass);\n });\n this.currentClasses = newClasses;\n }\n }\n}\n\nexport const ICONS = [\n 'home',\n 'th',\n 'bar-chart-o',\n 'tasks',\n 'tachometer',\n 'bell',\n 'puzzle-piece',\n 'map-marker',\n 'location-arrow',\n 'globe',\n 'power-off',\n 'desktop',\n 'laptop',\n 'mobile',\n 'signal',\n 'qrcode',\n 'file',\n 'file-text',\n 'folder',\n 'folder-open',\n 'archive',\n 'hdd-o',\n 'book',\n 'bookmark',\n 'tag',\n 'flag',\n 'search',\n 'heart',\n 'star',\n 'bolt',\n 'rocket',\n 'cog',\n 'cogs',\n 'wrench',\n 'ban',\n 'user',\n 'users',\n 'sign-in',\n 'sign-out',\n 'upload',\n 'download',\n 'cloud-upload',\n 'cloud-download',\n 'cloud',\n 'spinner',\n 'refresh',\n 'repeat',\n 'undo',\n 'lock',\n 'unlock',\n 'info',\n 'question',\n 'exclamation',\n 'bug',\n 'calendar',\n 'random',\n 'asterisk',\n 'key',\n 'link',\n 'chain-broken',\n 'external-link',\n 'picture-o',\n 'comment',\n 'bullhorn',\n 'phone',\n 'lightbulb-o',\n 'flask',\n 'sitemap',\n 'exchange',\n 'code-fork',\n 'keyboard-o',\n 'terminal',\n 'code',\n 'clipboard',\n 'pencil',\n 'envelope',\n 'inbox',\n 'reply',\n 'share',\n 'thumbs-up',\n 'thumbs-down',\n 'check',\n 'plus',\n 'expand',\n 'compress',\n 'arrows',\n 'arrow-up',\n 'arrow-down',\n 'arrow-left',\n 'arrow-right',\n 'th-list',\n 'bars',\n 'table',\n 'columns',\n 'filter',\n 'sort',\n 'sort-up',\n 'sort-down',\n 'ellipsis-h',\n 'ellipsis-v',\n 'rss',\n 'apple',\n 'windows',\n 'android',\n 'linux'\n ];\n","import { memoize as _memoize } from 'lodash-es';\n\n/**\n * Decorator to memoize function results.\n * @param resolver Cache key resolver function, used by memoize from lodash.\n */\nexport function memoize(resolver?) {\n return (target, fnName, descriptor) => {\n const fn = descriptor.value;\n descriptor.value = function(...args) {\n const memoizedFnName = `_${fnName}Memoized`;\n if (!this[memoizedFnName]) {\n this[memoizedFnName] = _memoize(fn, resolver);\n }\n return this[memoizedFnName].apply(this, args);\n };\n };\n}\n","import { Injectable } from '@angular/core';\nimport { AppStateService } from './ui-state.service';\nimport { IManagedObject, InventoryService } from '@c8y/client';\nimport { property } from 'lodash-es';\nimport { memoize } from './memoize.decorator';\nimport { IUser, UserService } from '@c8y/client';\n\n@Injectable()\nexport class Permissions {\n constructor(\n private appState: AppStateService,\n private inventory: InventoryService,\n private user: UserService\n ) {}\n\n /**\n * Checks if the current user has write permissions for the given mo.\n * (either through global role, individual device permissions or via inventory roles).\n *\n * @param {array} roleIds Array of roles which the current user should have.\n * @param {object} mo The managed object for which we are checking whether the user has access.\n */\n canEdit(roleIds, mo) {\n return this.checkIfCanEdit(roleIds, mo);\n }\n\n hasRole(roleId: string) {\n const currentUser = this.appState.currentUser.value;\n if (!currentUser) {\n throw new Error('Roles can only be requested if the user is logged in.');\n }\n return this.user.hasRole(currentUser, roleId);\n }\n\n hasAllRoles(roleIds: string[]) {\n const currentUser = this.appState.currentUser.value;\n if (!currentUser) {\n throw new Error('Roles can only be requested if the user is logged in.');\n }\n return this.user.hasAllRoles(currentUser, roleIds);\n }\n\n hasAnyRole(roleIds: string[]) {\n const currentUser = this.appState.currentUser.value;\n if (!currentUser) {\n throw new Error('Roles can only be requested if the user is logged in.');\n }\n return this.user.hasAnyRole(currentUser, roleIds);\n }\n\n @memoize(property('id'))\n protected async checkIfOwner(mo) {\n const currentUserName = await this.appState.currentUser.value.userName;\n const { data, res } = await this.inventory.detail(mo.id);\n return currentUserName === data.owner;\n }\n\n @memoize(property('id'))\n protected checkWithRequest(mo) {\n const moName = mo.name;\n const moId = mo.id;\n const partialUpdateObject: Partial<IManagedObject> = {\n id: moId,\n name: moName\n };\n return this.inventory\n .update(partialUpdateObject)\n .then(success => {\n return true;\n })\n .catch(err => {\n return false;\n });\n }\n\n private async checkIfCanEdit(roleIds, mo) {\n if (await this.hasAnyRole(roleIds)) {\n return true;\n } else if (await this.checkIfOwner(mo)) {\n return true;\n } else if (await this.checkWithRequest(mo)) {\n return true;\n }\n return false;\n }\n}\n","import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { Permissions } from './permissions.service';\n\n/**\n * A structural directive that conditionally includes a template only if the user has\n * all or any of the roles passed as an input. By default the directive checks all roles:\n *\n * ```\n * <button *c8yIfAllowed=\"['ROLE_RECORD_DELETE', 'ROLE_ENTRY_DELETE']\" (click)=\"delete()\" title=\"Delete\">\n * Delete\n * </button>\n * ```\n *\n * To check if the user has any of the required roles to view the element you need to use the `allowAny` input:\n *\n * ```\n * <button *c8yIfAllowed=\"['ROLE_RECORD_DELETE', 'ROLE_ENTRY_DELETE']; allowAny: true\" (click)=\"delete()\" title=\"Delete\">\n * Delete\n * </button>\n * ```\n *\n * or use the shorter version\n *\n * ```\n * <button *c8yIfAllowed=\"['ROLE_RECORD_DELETE', 'ROLE_ENTRY_DELETE']; allowAny\" (click)=\"delete()\" title=\"Delete\">\n * Delete\n * </button>\n * ```\n */\n@Directive({\n selector: '[c8yIfAllowed]'\n})\nexport class IfAllowedDirective {\n /**\n * One or many roles required for the element to be rendered\n */\n @Input()\n set c8yIfAllowed(roleIds: string | string[]) {\n this.rolesIds = Array.isArray(roleIds) ? roleIds : !!roleIds ? [roleIds] : [];\n }\n\n /**\n * Switches to the mode where at least one of the provided roles is sufficient for the element to be rendered\n */\n @Input()\n set c8yIfAllowedAllowAny(allowAny: boolean) {\n this.allowAny = allowAny === null || allowAny;\n }\n\n private rolesIds: string[];\n private allowAny: boolean = false;\n\n constructor(\n private template: TemplateRef<any>,\n private container: ViewContainerRef,\n private permissions: Permissions\n ) {}\n\n ngOnInit() {\n if (\n !this.rolesIds ||\n !this.rolesIds.length ||\n (this.allowAny\n ? this.permissions.hasAnyRole(this.rolesIds)\n : this.permissions.hasAllRoles(this.rolesIds))\n ) {\n this.container.createEmbeddedView(this.template);\n }\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'c8y-loading',\n template: `\n <div class=\"p-24 p-relative d-inline-block\" >\n <div class=\"spinner\">\n <div class=\"rect1\"></div>\n <div class=\"rect2\"></div>\n <div class=\"rect3\"></div>\n <div class=\"rect4\"></div>\n <div class=\"rect5\"></div>\n </div>\n </div>\n `\n})\nexport class LoadingComponent {}\n","/*\n * Implementation of pure \"Mapping\" pipe based on\n * https://codeburst.io/angular-bad-practices-eab0e594ce92#389b\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'map'\n})\nexport class MapFunctionPipe implements PipeTransform {\n /*\n * This will be a universal pipe for array mappings. You may add more\n * type checkings and runtime checkings to make sure it works correctly everywhere.\n */\n transform(value, mappingFunction: (arg: any) => any, thisArg?: any) {\n return mappingFunction.apply(thisArg || this, Array.isArray(value) ? value : [value]);\n }\n}\n","import { assign } from 'lodash-es';\nimport {\n ComponentFactory,\n ComponentFactoryResolver,\n Directive,\n ElementRef,\n Input,\n Renderer2,\n TemplateRef,\n Type,\n ViewContainerRef\n } from '@angular/core';\n\n/**\n * Directive to set a DOM node, a TemplateRef or any Component to a container or any node.\n * @example\n * <div *c8yOutlet=\"template\"></div>\n * <div *c8yOutlet=\"DeviceStatusComponent; properties: { node }\"></div>\n * <div *c8yOutlet=\"nodes\"></div>\n */\n@Directive({\n selector: '[c8yOutlet]',\n})\nexport class OutletDirective {\n private properties = {};\n private _element;\n\n constructor(\n private viewContainer: ViewContainerRef,\n private resolver: ComponentFactoryResolver,\n private renderer: Renderer2,\n private el: ElementRef\n ) { }\n\n /**\n * Directive to set a DOM node, a TemplateRef or any Component to a container or any node.\n * @example\n * <div *c8yOutlet=\"template\"></div>\n * <div *c8yOutlet=\"DeviceStatusComponent; properties: { node }\"></div>\n * <div *c8yOutlet=\"nodes\"></div>\n */\n @Input() set c8yOutlet(template: TemplateRef<any> | Type<any> | Element) {\n if (!template) {\n return;\n }\n if (this._element instanceof Element) {\n this.renderer.removeChild(this._element.parentElement, this._element);\n }\n this.viewContainer.clear();\n\n // case TemplateRef -> <div *c8yOutlet=\"template\"></div>\n if (template instanceof TemplateRef) {\n this.viewContainer.createEmbeddedView(template);\n\n // case DOM Element -> <div *c8yOutlet=\"nodes\"></div>\n } else if (template instanceof Element) {\n const parent = this.renderer.parentNode(this.el.nativeElement);\n this.destroy();\n this._element = template;\n this.renderer.insertBefore(parent, this._element, this.el.nativeElement);\n\n // case Component -> <div *c8yOutlet=\"DeviceStatusComponent; properties: { node }\"></div>\n } else {\n const factory: ComponentFactory<any> = this.resolver.resolveComponentFactory(template);\n const component = this.viewContainer.createComponent(factory);\n assign(component.instance, this.properties);\n }\n }\n\n @Input() set c8yOutletProperties(value) {\n this.properties = value;\n }\n\n ngOnDestroy(): void {\n this.destroy();\n }\n\n private destroy() {\n if (this._element) {\n const _parent = this.renderer.parentNode(this._element);\n this.renderer.removeChild(_parent, this._element);\n }\n }\n}\n","import { Component, Input } from '@angular/core';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-progress-bar',\n templateUrl: './progress-bar.component.html'\n})\nexport class ProgressBarComponent {\n @Input() message: string = gettext('Loading…');\n @Input() progress: number = null;\n}\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({ name: 'shortenUserName' })\r\nexport class ShortenUserNamePipe implements PipeTransform {\r\n\r\n transform({ firstName = '', lastName = '', userName = ''}: any): string {\r\n let parsedFirstName = firstName.trim().split(/\\s+/).shift().substr(0, 1);\r\n const parsedLastName = lastName.trim().split(/\\s+/).pop();\r\n\r\n if (!parsedLastName) {\r\n parsedFirstName = firstName.split(/\\s+/).shift();\r\n } else {\r\n parsedFirstName = parsedFirstName ? `${parsedFirstName}. ` : '';\r\n }\r\n\r\n return parsedFirstName || parsedLastName ? parsedFirstName + parsedLastName : userName;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\nimport { ApplicationService, TenantService, IApplication } from '@c8y/client';\n\n/** The helper UI service for tenant related methods built upon client services. */\n@Injectable()\nexport class TenantUiService {\n constructor(\n private tenantService: TenantService,\n private applicationService: ApplicationService\n ) {}\n\n /**\n * Checks whether current tenant is the management tenant.\n * @returns True if current tenant is the management tenant.\n */\n async isManagementTenant(): Promise<boolean> {\n const currentTenant = (await this.tenantService.current()).data;\n return currentTenant.name === 'management';\n }\n\n /**\n * Checks whether current tenant is an enterprise tenant.\n * An enterprise tenant is a tenant which has subscribed:\n * - `branding` microservice or `feature-branding` feature app,\n * - `sslmanagement` microservice,\n * - `feature-user-hierarchy` feature app,\n * - `feature-broker` feature app.\n *\n * See https://cumulocity.com/guides/users-guide/enterprise-edition/ for details about such tenants.\n *\n * @returns True, if current tenant is an enterprise tenant.\n */\n async isEnterpriseTenant(): Promise<boolean> {\n const hasBranding =\n (await this.hasApp({ name: 'branding' })) ||\n (await this.hasApp({ name: 'feature-branding' }));\n const hasSslManagement = await this.hasApp({ name: 'sslmanagement' });\n const hasUserHierarchy = await this.hasApp({ name: 'feature-user-hierarchy' });\n const hasDataBroker = await this.hasApp({ name: 'feature-broker' });\n\n return hasBranding && hasSslManagement && hasUserHierarchy && hasDataBroker;\n }\n\n private async hasApp(app: Partial<IApplication>): Promise<boolean> {\n return (await this.applicationService.isAvailable(app)).data;\n }\n}\n","import { Observable, of } from 'rxjs';\n\nexport class UserPreferencesStorageLocal {\n private LOCAL_STORAGE_KEY = 'userPreferences';\n private store: any = {};\n constructor() {\n try {\n const jsonStore = window.localStorage.getItem(this.LOCAL_STORAGE_KEY);\n if (jsonStore) {\n this.store = JSON.parse(jsonStore) || {};\n }\n } catch (e) {\n // do nothing\n }\n }\n\n get(key) {\n return of(this.store[key]);\n }\n\n set(key, value) {\n this.store[key] = value;\n return this.saveJsonStore();\n }\n\n private saveJsonStore() {\n return window.localStorage.setItem(this.LOCAL_STORAGE_KEY, JSON.stringify(this.store));\n }\n}\n","import { InventoryService } from '@c8y/client';\n\nexport class UserPreferencesStorageInventory {\n TYPE = 'c8y_UserPreference';\n\n constructor(\n private inventory: InventoryService\n ) {}\n\n async get(key) {\n const { data } = await this.inventory.list({fragmentType: key});\n return data.length ? data[0][key] : undefined;\n }\n\n async set(key, value) {\n const { data } = await this.inventory.list({fragmentType: key});\n const updateMo: any = {[key]: value, type: this.TYPE};\n let out;\n\n if (data.length) {\n updateMo.id = data[0].id;\n out = this.inventory.update(updateMo);\n } else {\n out = this.inventory.create(updateMo);\n }\n return out;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { InventoryService, UserService } from '@c8y/client';\nimport { IUser } from '@c8y/client';\nimport { Observable, from, never } from 'rxjs';\nimport { switchMap, first } from 'rxjs/operators';\nimport { UserPreferencesStorageLocal } from './user-preferences-storage-local';\nimport { UserPreferencesStorageInventory } from './user-preferences-store-inventory';\nimport { AppStateService } from '../ui-state.service';\n\n@Injectable()\nexport class UserPreferencesService {\n currentUser: Observable<IUser>;\n private LOCAL_STORAGE_KEY = 'userPreferences';\n private storage: {\n local: UserPreferencesStorageLocal,\n inventory: UserPreferencesStorageInventory\n };\n constructor(\n private user: UserService,\n private inventory: InventoryService,\n private appState: AppStateService\n ) {\n this.storage = {\n local: new UserPreferencesStorageLocal(),\n inventory: new UserPreferencesStorageInventory(this.inventory)\n };\n this.currentUser = this.appState.currentUser;\n }\n\n get(key): Observable<any> {\n return this.currentUser.pipe(\n first(),\n switchMap((user) => this.getForUser(key, user))\n );\n }\n\n set(key, value): Promise<any> {\n return new Promise((resolve, reject) => {\n this.currentUser.pipe(\n first()\n ).subscribe((user) => {\n resolve(this.setForUser(key, value, user));\n }, reject);\n });\n }\n\n getForUser(key, user): Observable<any> {\n const rawKey = this.getRawKey(key, user);\n const storage = this.getStorage(user);\n return from(storage.get(rawKey));\n }\n\n setForUser(key, value, user): Promise<any> {\n const rawKey = this.getRawKey(key, user);\n const storage = this.getStorage(user);\n return Promise.resolve(storage.set(rawKey, value));\n }\n\n private getRawKey(key, user) {\n const username = user.userName.replace(/\\./g, '__');\n return `${key}${username}`;\n }\n\n private getStorage(user) {\n return this.user.hasAllRoles(user, ['ROLE_INVENTORY_READ', 'ROLE_INVENTORY_ADMIN']) ?\n this.storage.inventory : this.storage.local;\n }\n\n}\n","import { CommonModule as NgCommonModule } from '@angular/common';\nimport { APP_INITIALIZER, InjectionToken, NgModule } from '@angular/core';\nimport { DataModule } from '@c8y/ngx-components/api';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { distinctUntilChanged, filter, map, startWith, switchMap } from 'rxjs/operators';\nimport { I18nModule } from '../i18n/i18n.module';\nimport { TranslateService } from '../i18n/translate.service';\nimport { DatePipe } from './date.pipe';\nimport { ForOfDirective } from './forOf.directive';\nimport { HumanizeAppNamePipe } from './humanize-app-name.pipe';\nimport { HumanizePipe } from './humanize.pipe';\nimport { IconDirective, ICONS } from './icon.directive';\nimport { IfAllowedDirective } from './if-allowed.directive';\nimport { LoadMoreComponent } from './load-more.component';\nimport { LoadingComponent } from './loading.component';\nimport { MapFunctionPipe } from './map-function.pipe';\nimport { HOOK_OPTIONS, OptionsService } from './options.service';\nimport { OutletDirective } from './outlet.directive';\nimport { Permissions } from './permissions.service';\nimport { ProgressBarComponent } from './progress-bar.component';\nimport { ShortenUserNamePipe } from './shorten-user-name.pipe';\nimport { TenantUiService } from './tenant-ui.service';\nimport { AppStateService } from './ui-state.service';\nimport { UserPreferencesService } from './user-preferences/user-preferences.service';\n\nexport function initializeServices(\n translateService: TranslateService,\n state: AppStateService,\n userPreferences: UserPreferencesService\n) {\n const initialize = () => {\n const queryStringLanguage = translateService.queryStringLang();\n const firstLanguage = translateService.firstSupportedLanguage();\n\n /*\n The ?lang parameter will prevent the user preference language from being activated\n */\n if (queryStringLanguage && translateService.getSupported(queryStringLanguage)) {\n translateService.switchToLanguage(queryStringLanguage);\n } else {\n state.currentUser\n .pipe(\n map(user => user && user.userName),\n filter(u => !!u),\n distinctUntilChanged(),\n switchMap(() => userPreferences.get('language')),\n startWith(firstLanguage),\n filter(lang => !!lang),\n distinctUntilChanged()\n )\n .subscribe(lang => {\n translateService.switchToLanguage(lang);\n });\n }\n };\n return initialize;\n}\n\nexport const ICON_LIST = new InjectionToken('iconList');\n\n/**\n * Commonly used directives, data access and translation. This module is the shared\n * module across all core components. It should be imported by default.\n *\n * @exports IconDirective A directive to set a c8y icon with [c8yIcon]=\"'rocket'\".\n * @exports OutletDirective A directive which allows to set DOM or Angular templates (used for upgrade).\n * @exports I18nModule Translation module.\n * @exports NgCommonModule Angular common module.\n * @exports DataModule The data layer to allow DI with @c8y/client\n * @exports HumanizeAppNamePipe Humanize an application name (e.g. in the app switcher)\n * @exports HumanizePipe Humanize a word. E.g. `device management` gets `Device management`\n * @exports ShortenUserNamePipe Allows a short name. E.g. `Foo Bar` gets `F. Bar`\n * @exports ForOfDirective A forOf directive like ngFor but with load-more function\n * @exports LoadMoreComponent A component to load more data from a certain data-source\n * @exports ProgressBarComponent Displays either defined or undefined progress.\n */\n@NgModule({\n imports: [NgCommonModule, I18nModule, TooltipModule],\n exports: [\n IconDirective,\n OutletDirective,\n I18nModule,\n NgCommonModule,\n HumanizeAppNamePipe,\n HumanizePipe,\n IfAllowedDirective,\n ShortenUserNamePipe,\n ForOfDirective,\n LoadMoreComponent,\n MapFunctionPipe,\n ProgressBarComponent,\n DatePipe,\n LoadingComponent\n ],\n declarations: [\n IconDirective,\n OutletDirective,\n HumanizePipe,\n HumanizeAppNamePipe,\n IfAllowedDirective,\n ShortenUserNamePipe,\n ForOfDirective,\n LoadMoreComponent,\n MapFunctionPipe,\n ProgressBarComponent,\n DatePipe,\n LoadingComponent\n ],\n entryComponents: [LoadMoreComponent]\n})\nexport class CommonModule {\n static providers() {\n return [\n ...DataModule.providers(),\n // TODO: maybe we can think of a way to remove this C8Y_APP global\n { provide: HOOK_OPTIONS, useValue: (window as any).C8Y_APP || {}, multi: true },\n {\n provide: APP_INITIALIZER,\n useFactory: initializeServices,\n deps: [TranslateService, AppStateService, UserPreferencesService],\n multi: true\n },\n { provide: ICON_LIST, useValue: ICONS, multi: false },\n ...I18nModule.providers(),\n UserPreferencesService,\n OptionsService,\n AppStateService,\n Permissions,\n TenantUiService,\n HumanizePipe,\n HumanizeAppNamePipe,\n ShortenUserNamePipe,\n MapFunctionPipe,\n DatePipe\n ];\n }\n\n static forRoot() {\n return {\n ngModule: CommonModule,\n providers: CommonModule.providers()\n };\n }\n}\n","import { OperationStatus } from '@c8y/client';\n\nexport enum Status {\n SUCCESS = 'success',\n WARNING = 'warning',\n DANGER = 'danger',\n INFO = 'info'\n}\n\nexport type StatusType = Status | 'success' | 'warning' | 'danger' | 'info';\n\nexport const statusIcons = {\n [Status.SUCCESS]: 'check-circle',\n [Status.WARNING]: 'exclamation-triangle',\n [Status.DANGER]: 'exclamation-circle',\n [Status.INFO]: 'info-circle'\n};\n\nexport const statusClasses = {\n [Status.SUCCESS]: `text-${Status.SUCCESS}`,\n [Status.WARNING]: `text-${Status.WARNING}`,\n [Status.DANGER]: `text-${Status.DANGER}`,\n [Status.INFO]: `text-${Status.INFO}`\n};\n\nexport const statusAlert = {\n [Status.SUCCESS]: `alert-${Status.SUCCESS}`,\n [Status.WARNING]: `alert-${Status.WARNING}`,\n [Status.DANGER]: `alert-${Status.DANGER}`,\n [Status.INFO]: `alert-${Status.INFO}`\n};\n\nexport const operationStatusIcons = {\n [OperationStatus.PENDING]: 'clock-o',\n [OperationStatus.EXECUTING]: 'refresh',\n [OperationStatus.SUCCESSFUL]: 'check-circle',\n [OperationStatus.FAILED]: 'exclamation-circle'\n};\n\nexport const operationStatusClasses = {\n [OperationStatus.PENDING]: 'text-info',\n [OperationStatus.EXECUTING]: 'text-info',\n [OperationStatus.SUCCESSFUL]: 'text-success',\n [OperationStatus.FAILED]: 'text-danger'\n};\n","import { Component, HostBinding, Input, AfterContentInit } from '@angular/core';\nimport { filter, sortBy } from 'lodash-es';\nimport { ActionBarItem } from './action-bar.model';\n\n/**\n * This component is used as the outlet to show the action bars.\n * In a c8ycli app it is by default placed on the bootstrap component.\n */\n@Component({\n selector: 'c8y-action-bar',\n templateUrl: './action-bar.component.html',\n host: { class: 'c8y-ui-action-bar' }\n})\nexport class ActionBarComponent {\n /**\n * Identifies if the navigator is opened. If yes, the action-bar\n * needs to move to the right.\n */\n @Input() @HostBinding('class.navigator-open') navigatorOpen = false;\n\n /**\n * Identifies if the current view has tabs. If yes, the action bar needs\n * to move down.\n */\n @Input() @HostBinding('class.has-tabs') hasTabs = false;\n\n /**\n * Identifies if the tabs are aligned horizontally. If yes, the tabs don't\n * need to move to the left.\n */\n @Input() @HostBinding('class.horizontal-tabs') isTabsHorizontal = false;\n\n /**\n * Identifies if in a mobile view the toolbar is expanded or not.\n */\n isPageToolbarExpanded = false;\n\n /**\n * Adds the default `c8y-ui-action-bar` class.\n */\n @HostBinding('class.c8y-ui-action-bar') uiActionBar = true;\n\n /**\n * The current items to display in the ActionBar.\n */\n @Input() items: ActionBarItem[] = [];\n\n /**\n * Returns true if no items are present and hides the action bar.\n */\n @HostBinding() get hidden() {\n return !(this.items && this.items.length);\n }\n\n /**\n * Returns the items sorted by priority and grouped by the placement passed.\n * @param {placement} Which placement should be returned sorted.\n */\n getSortedItems(placement: 'left' | 'right' | 'more') {\n return sortBy(filter(this.items, { placement }), this.byPriority);\n }\n\n private byPriority(item) {\n return -item.priority;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CollapseModule } from 'ngx-bootstrap/collapse';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { CommonModule } from '../common/common.module';\nimport { ActionBarItemComponent } from './action-bar-item.component';\nimport { ActionBarComponent } from './action-bar.component';\n\n/**\n * An action bar can be added with content projection or multi provider\n * extension. It allows to show them in three positions (left, right\n * or more). The actions placed here are always local actions to the\n * current route like \"add device\" or \"lock dashboard\".\n *\n * @example\n * ```html\n * <c8y-action-bar-item [placement]=\"'right'\">\n * <button class=\"btn btn-link\" (click)=\"addRandom()\"><i class=\"fa fa-plus\"></i> Add random</button>\n * </c8y-action-bar-item>\n * ```\n * @exports ActionBarComponent The outlet component\n * @exports ActionBarItemComponent The items to add with cp.\n */\n@NgModule({\n declarations: [ActionBarComponent, ActionBarItemComponent],\n imports: [BsDropdownModule, CommonModule, CollapseModule, RouterModule.forChild([])],\n exports: [ActionBarComponent, ActionBarItemComponent]\n})\nexport class ActionBarModule {}\n","import { Injector, Injectable, InjectionToken } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { StateService } from '../common/state-service.abstract';\nimport { Action, ActionFactory } from './action.model';\nimport {\n fromTrigger,\n ExtensionPoint,\n stateToFactory,\n sortByPriority\n} from '../common/extension-hooks';\nimport { map, shareReplay } from 'rxjs/operators';\n\n/**\n * A hook to use for Multi Provider extension.\n */\nexport const HOOK_ACTION = new InjectionToken('ActionFactory');\n\n/**\n * A service which defines global actions.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ActionService extends StateService implements ExtensionPoint<Action> {\n items$: Observable<Action[]>;\n readonly refreshTrigger = new Subject();\n readonly state$ = new BehaviorSubject<Set<Action>>(new Set<Action>());\n\n constructor(private injector: Injector, router: Router) {\n super();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_ACTION, []),\n stateToFactory(this.state$)\n ]).pipe(\n map((items: Action[]) => sortByPriority(items)),\n shareReplay(1)\n );\n }\n\n /**\n * Refresh the extension factories\n */\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state(): Set<Action> {\n return this.state$.value;\n }\n\n /**\n * Adds a new item to the actions in the header and emits a state change.\n * @param item The item to add.\n */\n add(item: Action) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes an action from the header and emits a state change.\n * @param item The item to remove.\n */\n remove(item: Action) {\n this.state.delete(item);\n this.emitNewState();\n }\n}\n","import { Component, Input } from '@angular/core';\nimport { Action } from './action.model';\nimport { sortBy } from 'lodash-es';\n\n@Component({\n selector: 'c8y-action-outlet',\n templateUrl: './action-outlet.component.html'\n})\n\nexport class ActionOutletComponent {\n isPageToolbarExpanded = false;\n @Input() items: Action[] = [];\n\n getByPriority() {\n return sortBy(this.items, this.byPriority);\n }\n\n invoke(action) {\n if (action.action) {\n action.action.call();\n }\n }\n\n private byPriority(item) {\n return -item.priority;\n }\n}\n","import { Component, Input, ViewChild } from '@angular/core';\nimport { Action } from './action.model';\nimport { ActionService } from './action.service';\n\n@Component({\n selector: 'c8y-action',\n templateUrl: './action.component.html'\n})\nexport class ActionComponent implements Action {\n @Input() disabled: boolean = false;\n @Input() label: string;\n @Input() priority: number = 0;\n @Input() icon: string;\n @ViewChild('template', {static: false}) template: any;\n action: () => void;\n private viewInitTimeout;\n\n constructor(private actionService: ActionService) {}\n\n ngAfterViewInit() {\n this.viewInitTimeout = setTimeout(() =>\n this.actionService.add(this as Action)\n );\n }\n\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.actionService.remove(this as Action);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { CommonModule } from '../common/common.module';\nimport { ActionOutletComponent } from './action-outlet.component';\nimport { ActionComponent } from './action.component';\nimport { ActionService } from './action.service';\n\n/**\n * The angular module definition for actions.\n * @exports ActionComponent\n * @exports ActionOutletComponent\n */\n@NgModule({\n declarations: [\n ActionOutletComponent,\n ActionComponent\n ],\n imports: [\n CommonModule,\n BsDropdownModule,\n RouterModule.forChild([])\n ],\n exports: [\n ActionOutletComponent,\n ActionComponent\n ]\n})\nexport class ActionModule { }\n","import { Alert } from './alert.model';\nimport { BehaviorSubject } from 'rxjs';\nimport { Injectable } from '@angular/core';\nimport { StateService } from '../common/state-service.abstract';\nimport { gettext } from '../i18n/gettext';\nimport {IResult} from '@c8y/client';\n\ntype alertType = 'success' | 'warning' | 'danger' | 'info' | 'system';\n/**\n * A service which allows to display alerts.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class AlertService extends StateService {\n /**\n * Returns all alerts.\n * @readonly\n */\n get state() {\n return this.state$.value;\n }\n /**\n * @ignore\n */\n state$ = new BehaviorSubject<Alert[]>([]);\n\n private MAX_ALERTS = 3;\n private ALERT_TIMEOUT = 3000;\n\n /**\n * Adds a new alert to the current state.\n */\n add(alert: Alert) {\n this.addAlert(alert);\n }\n\n /**\n * Adds a alert by text.\n */\n addByText(type: alertType, txt: string, detailedData?: string): void {\n this.addAlert({ text: txt, type, detailedData });\n }\n\n /**\n * Returns all alerts.\n * @deprecated Use alertService.alerts instead.\n */\n list(): Alert[] {\n return this.state;\n }\n\n /**\n * Remove an alert from the current state.\n */\n remove(alert: Alert) {\n this.changeAlerts(this.state.filter(item => !this.areSame(alert, item)));\n }\n\n /**\n * Updates matching alert with provided values.\n */\n update(alert: Alert, fieldsToUpdate: Partial<Alert>) {\n this.changeAlerts(\n this.state.map(item => {\n if (this.areSame(alert, item)) {\n Object.assign(item, fieldsToUpdate);\n }\n return item;\n })\n );\n }\n\n /**\n * Removes last danger alert.\n * It can be used e.g. in the case of a failed request which triggered an alert, to hide it from user.\n *\n * ```js\n * try {\n * // something that might throw a danger server msg\n * } catch (ex) {\n * this.alertService.removeLastDanger();\n * }\n * ```\n */\n removeLastDanger() {\n const firstDangerAlert = this.state.reverse().find(({ type }) => type === 'danger');\n this.changeAlerts(this.state.filter(alert => alert !== firstDangerAlert));\n }\n\n /**\n * Shorthand for a save successful alert.\n * @param savedObject The object which was saved.\n * @return A function that can be executed to show the msg.\n */\n saveSuccess(savedObject: string) {\n return () => {\n const text = `${savedObject} saved successfully`;\n this.addByText('success', text);\n };\n }\n\n /**\n * Shorthand for a create successful alert.\n * @param createdObject The object which was created.\n * @return A function that can be executed to show the msg.\n */\n createSuccess(createdObject) {\n return () => {\n const text = `${createdObject} created successfully`;\n this.addByText('success', text);\n };\n }\n\n /**\n * Clears all alerts.\n */\n clearAll() {\n this.changeAlerts([]);\n }\n\n /**\n * A shorthand to display a simple success message.\n * @param text The success text.\n * @param detailedData The text with additional information.\n */\n success(text: string, detailedData?: string) {\n this.addByText('success', text, detailedData);\n }\n\n /**\n * A shorthand to display a simple danger message.\n * @param text The danger text.\n * @param detailedData The text with additional information.\n */\n danger(text: string, detailedData?: string) {\n this.addByText('danger', text, detailedData);\n }\n\n /**\n * A shorthand to display a simple info message.\n * @param text The info text.\n * @param detailedData The text with additional information.\n */\n info(text: string, detailedData?: string) {\n this.addByText('info', text, detailedData);\n }\n\n /**\n * A shorthand to display a simple warning message.\n * @param text The warning text.\n * @param detailedData The text with additional information.\n */\n warning(text: string, detailedData?: string) {\n this.addByText('warning', text, detailedData);\n }\n\n /**\n * Creates alert from standard api errors.\n * Should be used for errors generated by @c8y/client services.\n * @param {IResult} error The error from server.\n * @param {alertType} type The type of alert.\n */\n addServerFailure(error: any, type: alertType = 'danger') {\n const { data, res } = error;\n let text = data && data.message ? data.message : null;\n let detailedData;\n if (data) {\n if (typeof data === 'object') {\n detailedData = data.exceptionMessage;\n } else if (typeof data === 'string') {\n detailedData = data;\n }\n }\n const hasRelevantMessage = !!(text || detailedData);\n if (!text) {\n text = gettext('A server error occurred.');\n }\n if (!hasRelevantMessage) {\n detailedData = {\n status: res.status,\n statusText: res.statusText,\n url: res.url\n };\n }\n\n this.addAlert({\n type,\n text,\n detailedData\n });\n }\n\n /**\n * Compares two alert objects. Alerts are same if text, type, detailed data and callbacks are same.\n * Callbacks are same if they refer to the same function.\n */\n areSame(alert1: Alert, alert2: Alert): boolean {\n return (\n alert1.text === alert2.text &&\n alert1.type === alert2.type &&\n alert1.detailedData === alert2.detailedData &&\n alert1.onClose === alert2.onClose &&\n alert1.onDetail === alert2.onDetail\n );\n }\n\n private changeAlerts(newAlerts: Alert[]) {\n this.state$.next(newAlerts);\n }\n\n private addAlert(alert: Alert): void {\n if (!alert.text && !alert.type) {\n throw new Error('Cannot add empty alert');\n }\n\n const alertAlreadyAdded = this.state.find(item => this.areSame(alert, item));\n if (alertAlreadyAdded) {\n return;\n }\n\n this.changeAlerts([...this.state, alert]);\n this.hideAutomaticallyIfNeeded(alert);\n this.removeOldestIfMax();\n }\n\n private hideAutomaticallyIfNeeded(alert: Alert) {\n const isSuccess = alert.type === 'success';\n const noDetails = !alert.detailedData;\n let alertTimeout = isSuccess && noDetails ? this.ALERT_TIMEOUT : 0;\n if (typeof alert.timeout !== 'undefined') {\n alertTimeout = alert.timeout;\n }\n if (alertTimeout) {\n setTimeout(() => this.remove(alert), alertTimeout);\n }\n }\n\n private removeOldestIfMax() {\n if (this.state.length > this.MAX_ALERTS) {\n const [, ...firstRemoved] = this.state;\n this.changeAlerts(firstRemoved);\n }\n }\n}\n","import { Component } from '@angular/core';\n\n/**\n * The content of `c8y-alert-details` component will be displayed as alert's details.\n * This component must be placed inside `c8y-alert` component.\n */\n@Component({\n selector: 'c8y-alert-details',\n template: `<ng-content></ng-content>`\n})\n\nexport class AlertDetailsComponent {}\n","import { Component, OnDestroy, Input, ViewChild, ContentChild } from '@angular/core';\nimport { Alert } from './alert.model';\nimport { AlertService } from './alert.service';\nimport { AlertDetailsComponent } from './alert-details.component';\n\n/**\n * Alert component allows creating alert with complex view.\n */\n\n@Component({\n selector: 'c8y-alert',\n templateUrl: './alert.component.html'\n})\n\nexport class AlertComponent implements OnDestroy, Alert {\n\n /**\n * The type of the alert.\n */\n @Input() type: 'success' | 'warning' | 'danger' | 'info' | 'system';\n /**\n * Function to call if user clicks on the detail button.\n */\n @Input() onDetail: () => void;\n /**\n * Function to call if user clicks on the close button.\n */\n @Input() onClose: () => void;\n /**\n * Detailed information to display.\n */\n @ViewChild('detailedData', {static: false}) detailedData;\n /**\n * The text templateRef to display message.\n */\n @ViewChild('text', {static: false}) text;\n /**\n * Content of AlertDetailsComponent is displayed as alertDetails.\n */\n @ContentChild(AlertDetailsComponent, {static: false}) containDetailsComponent: AlertDetailsComponent;\n /**\n * @ignore\n */\n private viewInitTimeout;\n\n /**\n * @ignore\n */\n constructor(public alertService: AlertService) {}\n\n /**\n * AlertComponent adds new alert to collection stored in alertService after view init.\n */\n ngAfterViewInit() {\n if (!this.containDetailsComponent) {\n this.detailedData = null;\n }\n this.viewInitTimeout = setTimeout(() =>\n this.alertService.add(this)\n );\n }\n\n /**\n * AlertComponent removes alert from collection stored in alertService on destroy component.\n */\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.alertService.remove(this);\n }\n}\n","import { Component, TemplateRef, Attribute, HostBinding } from '@angular/core';\nimport { Alert } from './alert.model';\nimport { AlertService } from './alert.service';\nimport { BehaviorSubject } from 'rxjs';\n\n/**\n * Alert outlet component shows all added alerts. It is used in the application's `c8y-bootstrap` component.\n *\n * For applications which don’t use `c8y-bootstrap` component but want to display alerts via AlertService, a c8y-alert-outlet component needs to be added explicitly in the template.\n *\n * ## Example:\n * ```html\n * <div class=\"alerts\">\n * <c8y-alert-outlet></c8y-alert-outlet>\n * </div>\n * ```\n */\n@Component({\n selector: 'c8y-alert-outlet',\n templateUrl: './alert-outlet.component.html'\n})\nexport class AlertOutletComponent {\n /**\n * Currently displayed details of an alert. Only one alert’s details can be displayed at a time.”\n */\n detailDisplayedAlert: any = {};\n /**\n * @ignore\n */\n @HostBinding('class.static') isStatic = false;\n /**\n * The array of current alerts.\n */\n get alerts(): BehaviorSubject<Alert[]> {\n return this.alertService.state$;\n }\n /**\n * @ignore\n */\n constructor(\n @Attribute('position') private position: string,\n public alertService: AlertService\n ) {\n this.isStatic = this.position === 'static';\n }\n /**\n * Returns a CSS class for an alert depending on its type to style the corresponding alert component.\n */\n getClass(alert: Alert) {\n const classes = [];\n if (alert.type !== 'danger') {\n classes.push('interact');\n }\n classes.push(`alert-${alert.type}`);\n return classes.join(' ');\n }\n /**\n * Executes alert’s onClose method, if provided, and closes the alert.\n * @param alert The alert which will be closed.\n */\n close(alert: Alert) {\n if (alert.onClose) {\n alert.onClose();\n }\n this.alertService.remove(alert);\n }\n /**\n * Expands details part of particular alert, and collapses details for another alerts.\n * @param alert The alert which details should be expanded.\n */\n showDetails(alert: Alert) {\n if (alert.onDetail) {\n return alert.onDetail();\n }\n this.detailDisplayedAlert = Object.assign({}, alert);\n this.detailDisplayedAlert.mode = 'raw';\n this.setDetailsContent(alert);\n }\n /**\n * Returns true if alert has extra detailedData or defines custom onDetail method.\n */\n hasDetails(alert: Alert) {\n return (alert.detailedData || alert.onDetail);\n }\n /**\n * Collapses alert's details.\n */\n closeDetails() {\n this.detailDisplayedAlert = {};\n }\n /**\n * Returns true if details part of alert is expanded.\n */\n isDetailsShow(alert: Alert) {\n return this.alertService.areSame(alert, this.detailDisplayedAlert);\n }\n /**\n * @ignore\n */\n isTemplateRef(value): boolean {\n return value instanceof TemplateRef;\n }\n /**\n * @ignore\n */\n template(content): any {\n return this.isTemplateRef(content) ? content : undefined;\n }\n private setDetailsContent(alert: Alert) {\n if ( this.isTemplateRef(alert.detailedData) || typeof alert.detailedData === 'string' ) {\n this.detailDisplayedAlert.contents = alert.detailedData;\n } else {\n this.detailDisplayedAlert.contents = JSON.stringify(alert.detailedData, null, 2);\n }\n }\n}\n","import { Component } from '@angular/core';\n\n/**\n * The content of `c8y-alert-text` component will be displayed as alert's text.\n * This component must be placed inside `c8y-alert` component.\n */\n@Component({\n selector: 'c8y-alert-text',\n template: `<ng-content></ng-content>`\n})\n\nexport class AlertTextComponent {}\n","import { NgModule } from '@angular/core';\nimport { AlertDetailsComponent } from './alert-details.component';\nimport { AlertOutletComponent } from './alert-outlet.component';\nimport { AlertTextComponent } from './alert-text.component';\nimport { AlertComponent } from './alert.component';\nimport { CommonModule } from '../common/common.module';\n\n/**\n * Alert module is used for displaying status messages to the user e.g. danger, success, warning and info alerts.\n */\n@NgModule({\n imports: [\n CommonModule\n ],\n exports: [\n AlertOutletComponent,\n AlertComponent,\n AlertDetailsComponent,\n AlertTextComponent\n ],\n declarations: [\n AlertOutletComponent,\n AlertComponent,\n AlertDetailsComponent,\n AlertTextComponent\n ]\n})\nexport class AlertModule { }\n","import { TemplateRef, Type } from '@angular/core';\nimport { matches, snakeCase } from 'lodash-es';\nimport { NavigatorNodeData } from './navigator-node-data';\nimport { PopoverConfirmComponent } from '../modal/popover-confirm.component';\n\nexport interface ClickOptions {\n icon?: boolean;\n expander?: boolean;\n open?: boolean;\n $event?: any; // TODO: add proper type\n}\n\nexport class NavigatorNode {\n icon: string;\n iconTemplate?: TemplateRef<any>;\n iconComponent?: Type<any>;\n children: NavigatorNode[] = [];\n label;\n path: string;\n parents: NavigatorNode[] = [];\n loading?: boolean;\n routerLinkExact: boolean = true;\n open: boolean = false;\n hidden: boolean = false;\n draggable: boolean = false;\n droppable: boolean = false;\n dragged = false;\n draggedHover = false;\n confirm: PopoverConfirmComponent = undefined;\n private _priority: number = 0;\n private expandDragTimeout;\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n get id() {\n return 'navigator_node_' + snakeCase(this.label);\n }\n\n get priority() {\n if (this._priority) {\n return this._priority;\n } else {\n const childrenPriorities = this.children.map(({ priority }) => priority || 0);\n if (childrenPriorities.length) {\n return childrenPriorities.length ? Math.max(...childrenPriorities) : 0;\n }\n return 0;\n }\n }\n\n set priority(priority) {\n this._priority = priority;\n }\n\n constructor(data?: NavigatorNodeData) {\n this.update(data);\n }\n\n openOnStart(url: string) {\n return false;\n }\n\n add(node: NavigatorNode) {\n if (node === this) {\n throw new Error('Adding node to itself');\n }\n if (this.children.indexOf(node) === -1) {\n this.children.push(node);\n }\n if (node.parents.indexOf(this) === -1) {\n node.parents.push(this);\n }\n this.updateChildren();\n }\n\n remove(node: NavigatorNode) {\n const ix = this.children.indexOf(node);\n const pix = node.parents.indexOf(this);\n if (ix > -1) {\n this.children.splice(ix, 1);\n }\n if (pix > -1) {\n node.parents.splice(pix, 1);\n }\n this.updateChildren();\n }\n\n update(data?: NavigatorNodeData) {\n if (data) {\n Object.assign(this, data);\n if (data.hidden !== undefined) {\n this.parents.forEach(p => {\n p.updateHidden();\n });\n }\n }\n }\n\n find(predicate) {\n if (typeof predicate === 'string') {\n const compareLabel = predicate.toLocaleLowerCase();\n predicate = ({ label }) => compareLabel === label.toLowerCase();\n }\n if (typeof predicate === 'object') {\n predicate = matches(predicate);\n }\n if (typeof predicate !== 'function') {\n throw new Error('Invalid search predicate');\n }\n return this.children.reduce(\n (found, child) => found || child.find(predicate),\n this.children.find(predicate)\n );\n }\n\n empty() {\n this.children.length = 0;\n }\n\n click(options: ClickOptions = {}) {\n // do nothing\n }\n\n drop($event) {\n $event.stopPropagation();\n clearTimeout(this.expandDragTimeout);\n }\n\n dragStart($event) {\n $event.stopPropagation();\n // we can't pass a object to setData, so we do it via service\n // set data is still needed, to make the drag&drop work\n $event.dataTransfer.setData('node', 'node');\n this.dragged = true;\n }\n\n dragEnd($event) {\n $event.stopPropagation();\n this.dragged = false;\n $event.dataTransfer.clearData();\n }\n\n get canDrop() {\n return this.droppable;\n }\n\n get canNavigate() {\n return typeof this.path !== 'undefined';\n }\n\n dragEnter($event) {\n $event.preventDefault();\n $event.stopPropagation();\n this.draggedHover = true;\n if (!this.open) {\n this.expandDragTimeout = setTimeout(() => this.expand(), 1000);\n }\n }\n\n dragLeave($event) {\n $event.preventDefault();\n $event.stopPropagation();\n this.draggedHover = false;\n clearTimeout(this.expandDragTimeout);\n }\n\n expand() {\n if (!this.open) {\n this.open = true;\n this.click({ open: true, expander: true });\n }\n }\n\n traverse(callback) {\n if (this.children) {\n this.children.forEach(child => {\n callback(child);\n child.traverse(callback);\n });\n }\n }\n\n destroy() {\n // nothing todo here\n }\n\n protected updateChildren() {\n this.sort();\n this.updateHidden();\n }\n\n protected sort() {\n this.children.sort((a, b) => {\n if (a.priority > b.priority) {\n return -1;\n } else if (a.priority < b.priority) {\n return 1;\n } else if ((a.label || '').toLowerCase() < (b.label || '').toLowerCase()) {\n return -1;\n } else if ((a.label || '').toLowerCase() > (b.label || '').toLowerCase()) {\n return 1;\n } else {\n return 0;\n }\n });\n }\n\n protected updateHidden() {\n if (typeof this.path === 'undefined') {\n this.hidden = !this.children.some(({ hidden }) => !hidden);\n }\n }\n}\n","import { NavigatorNode } from './navigator-node';\nimport { NavigatorNodeData } from './navigator-node-data';\nimport { assign } from 'lodash-es';\n\nexport class NavigatorNodeRoot extends NavigatorNode {\n addRoot(nodeData: Partial<NavigatorNodeData>) {\n const { parent } = nodeData;\n const node = this.createNode(nodeData);\n let localParent;\n\n if (parent) {\n if (typeof parent === 'object') {\n localParent = this.find(parent.label);\n if (localParent) {\n localParent.update(parent);\n }\n } else if (typeof parent === 'string' || typeof parent === 'function') {\n localParent = this.find(parent);\n }\n\n if (!localParent) {\n localParent = this.createNode(parent);\n if (!this.find((n) => localParent === n)) {\n this.add(localParent);\n }\n }\n }\n\n (localParent || this).add(node);\n return node;\n }\n\n createNode(nodeData) {\n if (nodeData instanceof NavigatorNode) {\n return nodeData;\n }\n if (typeof nodeData === 'string') {\n return new NavigatorNode({ label: nodeData });\n }\n if (typeof nodeData === 'object') {\n return new NavigatorNode({ ...nodeData, parent: undefined });\n }\n throw new Error('Wrong type of node data');\n }\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport { ExtensionPoint, fromTrigger, sortByPriority, stateToFactory } from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport { NavigatorNode } from './navigator-node';\nimport { NavigatorNodeData } from './navigator-node-data';\nimport { NavigatorNodeRoot } from './navigator-node-root';\n\n/**\n * A hook to use for Multi Provider extension.\n */\nexport const HOOK_NAVIGATOR_NODES = new InjectionToken('NavigatorNodesFactory');\n\n/**\n * A service which defines the navigator.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class NavigatorService extends StateService implements ExtensionPoint<NavigatorNode> {\n items$: Observable<NavigatorNode[]>;\n readonly refreshTrigger = new Subject();\n readonly state$ = new BehaviorSubject<Set<NavigatorNode>>(new Set<NavigatorNode>());\n firstUrl = true;\n\n constructor(\n private injector: Injector,\n private router: Router\n ) {\n super();\n const rootNode = new NavigatorNodeRoot();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_NAVIGATOR_NODES, []),\n stateToFactory(this.state$),\n ]).pipe(\n map((nodes: Partial<NavigatorNodeData[]>) => {\n const noParent = nodes.filter(node => !node.parent);\n const withParent = nodes.filter(node => node.parent);\n\n // Based on the sortedNodes array, the nodes are sequentially created.\n // Nodes sorting is done in two steps to have the top-level nodes first.\n // This way, by the time we are adding a child node, the parent node is already present.\n const sortedNodes = sortByPriority(noParent).concat(sortByPriority(withParent));\n rootNode.empty();\n sortedNodes.forEach((node) => rootNode.addRoot(node));\n return rootNode.children;\n }),\n shareReplay(1)\n );\n }\n\n openOnFirstUrl(node: NavigatorNode) {\n if (this.firstUrl && !!node.path) {\n return this.router.isActive(node.path, node.routerLinkExact) || node.openOnStart(this.router.url);\n }\n return false;\n }\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state(): Set<NavigatorNode> {\n return this.state$.value;\n }\n\n /**\n * Refresh the extension factories\n */\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n /**\n * Adds a new node to the navigator.\n * @param nav The node to add.\n */\n add(item: NavigatorNode) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes a node from the navigator.\n * @param nav The node ro remove.\n */\n remove(item: NavigatorNode) {\n this.state.delete(item);\n this.emitNewState();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable, of } from 'rxjs';\nimport { distinctUntilChanged, map, combineLatest, delay, debounceTime } from 'rxjs/operators';\nimport { OptionsService } from '../common/options.service';\nimport { StateService } from '../common/state-service.abstract';\nimport { NavigatorService } from '../navigator/navigator.service';\nimport { Header } from './header.model';\n\n/**\n * A service which defines header functions.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class HeaderService extends StateService {\n header$: Observable<Header>;\n navigatorOpen$: Observable<boolean>;\n readonly DELAY_TO_AVOID_FLICKERING_ON_ASYNC_NODES = 1000;\n\n hasItemsInNavigator$ = this.navigatorService.items$.pipe(\n delay(this.DELAY_TO_AVOID_FLICKERING_ON_ASYNC_NODES),\n map(({ length }) => !!length),\n distinctUntilChanged()\n );\n\n state$: BehaviorSubject<Header> = new BehaviorSubject<Header>({\n title: undefined,\n nav: {\n open: false\n }\n });\n\n title = undefined;\n\n constructor(private navigatorService: NavigatorService, private options: OptionsService) {\n super();\n this.header$ = this.map((header: Header) => header);\n this.navigatorOpen$ = this.map(({ nav }) => nav.open).pipe(\n combineLatest(this.hasItemsInNavigator$),\n map(([open, hasItems]) => open && hasItems)\n );\n const titleReference = document.querySelector('title');\n this.title = {\n elementRef: titleReference,\n originalValue: titleReference && titleReference.innerText\n };\n }\n\n get state() {\n return this.state$.value;\n }\n\n get navigatorHiddenOnStartup() {\n return this.options.hideNavigator;\n }\n\n get largeWidth() {\n return document.documentElement.clientWidth > 1200;\n }\n\n get shouldToggle() {\n return this.largeWidth && !this.navigatorHiddenOnStartup && !this.state.nav.open;\n }\n\n /**\n * Toggles the navigator open status.\n */\n toggleNavigator() {\n this.state.nav.open = !this.state.nav.open;\n this.emitNewState();\n }\n\n /**\n * Force to close the navigator.\n */\n closeNavigator() {\n this.state.nav.open = false;\n this.emitNewState();\n }\n\n /**\n * Configures navigation options.\n * @param config Object with the properties:\n * - open: Boolean\n */\n configNavigator(config: any = {}) {\n this.state.nav = Object.assign(this.state.nav, config);\n this.emitNewState();\n }\n\n /**\n * Change the application title.\n * @param newTitle The new title of the application.\n */\n changeTitle(newTitle?: any, pageTitleUpdate: boolean = true) {\n this.state.title = newTitle;\n this.state.pageTitleUpdate = pageTitleUpdate;\n\n this.emitNewState();\n }\n\n /**\n * Change the page title.\n * @param newTitle The new title of the page.\n */\n changePageTitle(newTitle?: string) {\n this.title.elementRef.innerText = newTitle\n ? `${newTitle} / ${this.title.originalValue}`\n : `${this.title.originalValue}`;\n }\n\n /**\n * This methods checks if the navigator toggles on startup\n * or if an item is added to the navigator node.\n * Delay of 300ms is intended for animation purpose.\n */\n verifyIfNavOpen() {\n this.hasItemsInNavigator$\n .pipe(debounceTime(300))\n .subscribe(hasItems => hasItems && this.shouldToggle && this.toggleNavigator());\n }\n\n shouldShowBreadcrumbs() {\n return this.options.breadcrumbs;\n }\n}\n","import { Injectable, InjectionToken, Injector, ViewContainerRef } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { TranslateService } from '@ngx-translate/core';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { distinctUntilChanged, filter, first, map, shareReplay } from 'rxjs/operators';\nimport { ExtensionPoint, fromTrigger, stateToFactory } from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport { Tab } from './tab.model';\nimport { OptionsService } from '../common/options.service';\n\nexport const HOOK_TABS = new InjectionToken('TabsFactory');\n\n@Injectable({\n providedIn: 'root'\n})\nexport class TabsService extends StateService implements ExtensionPoint<Tab> {\n items$: Observable<Tab[]>;\n orientation$: Observable<string>;\n readonly refreshTrigger = new Subject();\n readonly state$ = new BehaviorSubject<Set<Tab>>(new Set<Tab>());\n\n constructor(\n private injector: Injector,\n router: Router,\n private translateService: TranslateService,\n private options: OptionsService\n ) {\n super();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_TABS, []),\n stateToFactory(this.state$)\n ]).pipe(\n map(tabs => this.prepareTabs(tabs)),\n shareReplay(1),\n distinctUntilChanged()\n );\n\n this.orientation$ = this.items$.pipe(\n map((tabs: Tab[]) => {\n const firstTabWithDefinedOrientation = tabs.find(tab => tab.orientation);\n if (firstTabWithDefinedOrientation) {\n return firstTabWithDefinedOrientation.orientation;\n }\n return this.options.tabsHorizontal ? 'horizontal' : 'vertical';\n }),\n distinctUntilChanged()\n );\n }\n\n prepareTabs(tabs) {\n return this.sortTabs(\n tabs\n .map(tab => ({\n ...tab,\n template: tab.template instanceof ViewContainerRef ? tab.template : undefined\n }))\n .filter((tab, index, self) => index === self.findIndex(t => t.path === tab.path))\n );\n }\n\n sortTabs(tabs) {\n return tabs.sort((a, b) => {\n const priorityOrder = (b.priority || 0) - (a.priority || 0);\n\n const aTranslatedLabel = this.translateService.instant(a.label);\n const bTranslatedLabel = this.translateService.instant(b.label);\n const translatedLabelOrder = aTranslatedLabel.localeCompare(bTranslatedLabel);\n\n return priorityOrder || translatedLabelOrder;\n });\n }\n\n /**\n * Refresh the extension factories\n */\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state(): Set<Tab> {\n return this.state$.value;\n }\n\n /**\n * Adds a new item to tabs and emits state change\n * @param item The item to add.\n */\n add(item: Tab) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes a tab and emits a state change.\n * @param item The item to remove.\n */\n remove(item: Tab) {\n this.state.delete(item);\n this.emitNewState();\n }\n\n get firstTab$() {\n return this.items$.pipe(\n map(tabs => tabs[0]),\n filter(Boolean),\n first()\n );\n }\n}\n","import { Component } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\nimport { ActionBarService } from '../action-bar/action-bar.service';\nimport { OptionsService } from '../common/options.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { HeaderService } from '../header/header.service';\nimport { NavigatorService } from '../navigator/navigator.service';\nimport { TabsService } from '../tabs/tabs.service';\n\n@Component({\n selector: 'c8y-bootstrap',\n templateUrl: './bootstrap.template.html'\n})\nexport class BootstrapComponent {\n navigatorOpen$: Observable<boolean>;\n noAppsMargin$: Observable<boolean>;\n tabsOrientation: string;\n showPoweredBy: boolean = true;\n\n constructor(\n public tabs: TabsService,\n public ui: AppStateService,\n public navigator: NavigatorService,\n public actionBar: ActionBarService,\n private options: OptionsService,\n public headerService: HeaderService\n ) {\n this.noAppsMargin$ = this.headerService.map(({ nav }) => !nav.open && nav.hiddenOnStartup);\n this.tabsOrientation = this.options.tabsHorizontal ? 'horizontal' : 'vertical';\n this.ui\n .map(({ lang }) => lang)\n .pipe(distinctUntilChanged())\n .subscribe(() => {\n this.actionBar.refresh();\n });\n this.showPoweredBy = !this.options.get('hidePowered');\n }\n}\n","import { Component, Input, ViewChild } from '@angular/core';\nimport { BreadcrumbItem } from './breadcrumb.model';\n\n@Component({\n selector: 'c8y-breadcrumb-item',\n templateUrl: './breadcrumb-item.component.html'\n})\nexport class BreadcrumbItemComponent implements BreadcrumbItem {\n @Input() icon: string;\n @Input() translate: boolean;\n @Input() label: string;\n @Input() path: string;\n @ViewChild('template', {static: false}) template: any;\n}\n","import { Component, Input } from '@angular/core';\nimport { Breadcrumb } from './breadcrumb.model';\n\n@Component({\n selector: 'c8y-breadcrumb-outlet',\n templateUrl: './breadcrumb-outlet.component.html'\n})\nexport class BreadcrumbOutletComponent {\n showAll = false;\n @Input() breadcrumbs: Breadcrumb[] = [];\n\n /**\n * For upgrade only. Old angularjs routes start with hash, new ones not.\n */\n normalizePath(path) {\n return path.replace(/^#\\/?/, '');\n }\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport { fromTrigger, stateToFactory } from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport { Breadcrumb, BreadcrumbItem } from './breadcrumb.model';\n\nexport const HOOK_BREADCRUMB = new InjectionToken('BreadcrumbFactory');\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BreadcrumbService extends StateService {\n items$: Observable<Breadcrumb[]>;\n readonly refreshTrigger = new Subject();\n readonly state$ = new BehaviorSubject<Set<Breadcrumb>>(new Set<Breadcrumb>());\n private preferredPath: string;\n\n constructor(private injector: Injector, router: Router) {\n super();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_BREADCRUMB, []),\n stateToFactory(this.state$)\n ]).pipe(\n map(breadcrumbs => this.sortByPreferredPath(breadcrumbs)),\n shareReplay(1)\n );\n }\n\n get state() {\n return this.state$.value;\n }\n\n /**\n * Adds a new item to the action bar in the header.\n * @param item The item to add.\n */\n add(item: Breadcrumb) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes an action bar item from the header.\n * @param item The item to remove.\n */\n remove(item: Breadcrumb) {\n this.state.delete(item);\n this.emitNewState();\n }\n\n /**\n * Refresh the extension factories\n */\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n /**\n * Sets the crumb that contains that path to the top.\n * @param path The path to prefer.\n */\n selectPreferredByPath(path: string) {\n this.preferredPath = path;\n this.refresh();\n }\n\n sortByPreferredPath(breadcrumbs) {\n if (this.preferredPath) {\n return breadcrumbs.sort(bc =>\n bc.items.find((item: BreadcrumbItem) => !!item.path.match(this.preferredPath)) ? -1 : 1\n );\n }\n return breadcrumbs;\n }\n}\n","import { Component, ContentChildren, QueryList } from '@angular/core';\nimport { Breadcrumb, BreadcrumbItem } from './breadcrumb.model';\nimport { BreadcrumbService } from './breadcrumb.service';\nimport { BreadcrumbItemComponent } from './breadcrumb-item.component';\n\n@Component({\n selector: 'c8y-breadcrumb',\n templateUrl: './breadcrumb.component.html'\n})\nexport class BreadcrumbComponent implements Breadcrumb {\n items: BreadcrumbItem[];\n @ContentChildren(BreadcrumbItemComponent) private contentChildItems: QueryList<BreadcrumbItem>;\n private viewInitTimeout;\n\n constructor(private breadcrumbService: BreadcrumbService) {}\n\n ngAfterViewInit() {\n this.items = this.contentChildItems.toArray();\n this.viewInitTimeout = setTimeout(() =>\n this.breadcrumbService.add(this as Breadcrumb)\n );\n }\n\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.breadcrumbService.remove(this as Breadcrumb);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { CommonModule } from '../common/common.module';\nimport { BreadcrumbItemComponent } from './breadcrumb-item.component';\nimport { BreadcrumbOutletComponent } from './breadcrumb-outlet.component';\nimport { BreadcrumbComponent } from './breadcrumb.component';\nimport { BreadcrumbService } from './breadcrumb.service';\n\n/**\n * The angular module definition for breadcrumbs.\n * @exports BreadcrumbComponent\n * @exports BreadcrumbItemComponent\n * @exports BreadcrumbOutletComponent\n */\n@NgModule({\n declarations: [\n BreadcrumbComponent,\n BreadcrumbItemComponent,\n BreadcrumbOutletComponent\n ],\n imports: [\n RouterModule.forChild([]),\n CommonModule,\n TooltipModule.forRoot()\n ],\n exports: [\n BreadcrumbComponent,\n BreadcrumbItemComponent,\n BreadcrumbOutletComponent\n ]\n})\nexport class BreadcrumbModule { }\n","import { Component, TemplateRef, ViewChild, Input} from '@angular/core';\nimport { NavigatorNode } from './navigator-node';\nimport { NavigatorService } from './navigator.service';\n\n@Component({\n selector: 'c8y-navigator-item',\n template: '<ng-template #iconTpl><ng-content></ng-content></ng-template>',\n})\nexport class NavigatorItemComponent {\n @ViewChild('iconTpl', {static: true}) template: TemplateRef<any>;\n @Input() label: string;\n @Input() icon: string;\n @Input() path: string;\n @Input() priority = 0;\n nodeData: NavigatorNode;\n constructor(\n private service: NavigatorService\n ) {\n this.nodeData = new NavigatorNode();\n }\n\n ngOnInit(): void {\n this.ngOnChanges();\n setTimeout(() => this.service.add(this.nodeData));\n }\n\n ngOnChanges(): void {\n this.nodeData.icon = this.icon;\n this.nodeData.label = this.label;\n this.nodeData.path = this.path;\n this.nodeData.priority = this.priority;\n this.nodeData.iconTemplate = !this.icon ? this.template : undefined;\n this.nodeData.icon = this.icon;\n }\n\n ngOnDestroy(): void {\n this.service.remove(this.nodeData);\n }\n}\n","import { Component, Input } from '@angular/core';\nimport { NavigatorNode } from './navigator-node';\n\n@Component({\n selector: 'c8y-navigator-icon',\n template: `<i class=\"icon\" [c8yIcon]=\"icon\"></i>`\n})\nexport class NavigatorIconComponent {\n @Input() node: NavigatorNode;\n get icon() {\n const DEFAULT_ICON = 'cog';\n return this.node.icon || DEFAULT_ICON;\n }\n\n get iconClass() {\n return `fa-${this.icon}`;\n }\n}\n","import { Component, Input, ViewChild, OnDestroy } from '@angular/core';\nimport { PopoverDirective } from 'ngx-bootstrap/popover';\nimport { StatusType } from '../common/status.model';\nimport { gettext } from '../i18n/gettext';\n\nexport interface PopoverConfirmButtons {\n /**\n * The label of the button\n */\n label: string;\n /**\n * Which action to perform.\n */\n action: () => Promise<any>;\n /**\n * The status class attached to the button.\n */\n status?: StatusType | 'primary';\n}\n\n/**\n * A component to show a popover right next to the\n * user action. Add this component where the confirm modal\n * should be shown and toggle isOpen to display it. You\n * can use `await isShow()` to wait for a result on the\n * click action.\n */\n@Component({\n selector: 'c8y-popover-confirm',\n templateUrl: './popover-confirm.component.html'\n})\nexport class PopoverConfirmComponent {\n @ViewChild(PopoverDirective, {static: false}) popover: PopoverDirective;\n @Input() buttons: PopoverConfirmButtons[] = [{ label: gettext('cancel'), action: () => Promise.reject()}];\n @Input() message: string;\n @Input() title: string;\n @Input() isOpen = false;\n @Input() containerClass = '';\n @Input() placement = 'right';\n @Input() outsideClick = false;\n\n click: (action: () => Promise<any>) => void;\n\n /**\n * Show the popover. Wait until an action is performed on it.\n */\n async show(buttons?: PopoverConfirmButtons[]) {\n this.buttons = buttons || this.buttons;\n this.isOpen = true;\n let result;\n try {\n result = await new Promise((resolve, reject) => {\n return this.click = (action: () => Promise<any>) => action().then(resolve).catch(reject);\n });\n } catch (ex) {\n throw(ex);\n } finally {\n this.isOpen = false;\n }\n return result;\n }\n\n buttonStatus(status) {\n if (status) {\n return `btn-${status}`;\n }\n return 'btn-link btn-clean';\n }\n\n handleOutsideClick() {\n this.click(() => Promise.reject());\n }\n}\n","// tslint:disable-next-line:max-line-length\nimport { Component, ComponentFactoryResolver, Input, QueryList, ViewChild, ViewChildren, ViewContainerRef, Output, EventEmitter, OnDestroy, HostListener } from '@angular/core';\nimport { RouterLinkActive, Router } from '@angular/router';\nimport { NavigatorIconComponent } from './navigator-icon.component';\nimport { NavigatorNode, ClickOptions } from './navigator-node';\nimport { NavigatorService } from './navigator.service';\nimport { PopoverConfirmComponent } from '../modal/popover-confirm.component';\n\n@Component({\n selector: 'c8y-navigator-node-display',\n templateUrl: './navigator-node.component.html'\n})\nexport class NavigatorNodeComponent implements OnDestroy {\n @ViewChild('icon', { read: ViewContainerRef, static: false }) iconSlot: ViewContainerRef;\n @Input() node: NavigatorNode;\n @Input() isRoot: boolean;\n @ViewChild(RouterLinkActive, {static: false}) routerLinkActive: RouterLinkActive;\n @ViewChildren(NavigatorNodeComponent) childrenNodes: QueryList<NavigatorNodeComponent>;\n @Output() nodeClick: EventEmitter<string> = new EventEmitter();\n @ViewChild(PopoverConfirmComponent, {static: false}) confirm: PopoverConfirmComponent;\n\n parentNode: NavigatorNodeComponent;\n\n private viewInitTimeout;\n\n constructor(\n private componentFactoryResolver: ComponentFactoryResolver,\n private navigator: NavigatorService\n ) {}\n\n ngAfterViewInit() {\n this.childrenNodes.forEach((n) => n.parentNode = this);\n this.viewInitTimeout = setTimeout(() => {\n this.updateIcon();\n this.openOnFirstUrl();\n this.expandParentIfActive();\n this.node.confirm = this.confirm;\n });\n }\n\n openOnFirstUrl() {\n if (this.navigator.openOnFirstUrl(this.node) && !this.node.open) {\n this.expandCollapse(true);\n }\n }\n\n get expandTitle() {\n return !this.node.open ? 'Expand' : 'Collapse';\n }\n\n click(from: 'icon' | 'expander' | 'link' = 'link', $event?) {\n let open;\n if (from === 'expander') {\n if ($event) {\n $event.stopPropagation();\n $event.preventDefault();\n }\n open = !this.node.open;\n } else {\n open = this.routerLinkActive && this.routerLinkActive.isActive ? true : !this.node.open;\n }\n if (open !== this.node.open) {\n this.expandCollapse(open, false, { [from]: true, $event });\n }\n this.nodeClick.emit(from);\n }\n\n expandCollapse(open, recursive?, forNode: ClickOptions = {}) {\n this.node.open = open;\n // Also close children\n if (recursive) {\n this.childrenNodes.forEach((n) => n.expandCollapse(open, recursive));\n }\n forNode.open = open;\n this.node.click(forNode);\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.viewInitTimeout);\n this.node.destroy();\n }\n\n private expandParentIfActive() {\n if (this.routerLinkActive && this.routerLinkActive.isActive && this.parentNode) {\n this.parentNode.expandCollapse(true);\n }\n }\n\n private updateIcon() {\n if (this.node.iconTemplate) {\n this.updateIconTemplate();\n } else {\n this.updateIconComponent();\n }\n }\n\n private updateIconComponent() {\n let componentType = NavigatorIconComponent;\n if (this.node && this.node.iconComponent) {\n componentType = this.node.iconComponent;\n }\n this.iconSlot.clear();\n const iconComponentFactory = this.componentFactoryResolver.resolveComponentFactory(componentType);\n const componentRef = this.iconSlot.createComponent(iconComponentFactory);\n componentRef.instance.node = this.node;\n }\n\n private updateIconTemplate() {\n this.iconSlot.clear();\n this.iconSlot.createEmbeddedView(this.node.iconTemplate);\n }\n}\n","import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'c8y-right-drawer',\n templateUrl: './right-drawer.component.html'\n})\nexport class RightDrawerComponent {\n @Input('quickLinks') set _quickLinks(data: any[]) {\n if (data) {\n this.quickLinks = data.filter(d => d.type === 'quicklink');\n }\n }\n @Input('helpAndSupport') set _helpAndSupport(data: any[]) {\n if (data) {\n this.helpAndSupport = data.filter(d => d.type === 'doc');\n }\n }\n @Input() app: any;\n quickLinks: any[] = [];\n helpAndSupport: any[] = [];\n}\n","import { Component, ElementRef, NgZone } from '@angular/core';\nimport { HeaderService } from '../header.service';\nimport { debounceTime, map, filter } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-title-outlet',\n templateUrl: './title-outlet.component.html'\n})\nexport class TitleOutletComponent {\n title = undefined;\n pageTitleUpdate: boolean = true;\n\n constructor(\n private headerService: HeaderService,\n private element: ElementRef,\n private zone: NgZone\n ) {\n const title$ = this.headerService.map(state => state.title);\n title$.subscribe(title => (this.title = title));\n\n const pageTitleUpdate$ = this.headerService.map(state => state.pageTitleUpdate);\n pageTitleUpdate$.subscribe(pageTitleUpdate => (this.pageTitleUpdate = pageTitleUpdate));\n\n this.zone.runOutsideAngular(() => {\n this.headerService.state$.pipe(\n debounceTime(100),\n filter(state => state.pageTitleUpdate),\n debounceTime(100),\n map(() => this.element.nativeElement.querySelector('h1')),\n filter(el => el !== null),\n map(el => el.innerText),\n filter(Boolean))\n .subscribe((title: string) => headerService.changePageTitle(title));\n });\n }\n}\n","import { AfterViewInit, Component, OnDestroy, ViewChild, Input } from '@angular/core';\nimport { HeaderService } from '../header.service';\n\n@Component({\n selector: 'c8y-title',\n templateUrl: './title.component.html'\n})\nexport class TitleComponent implements AfterViewInit, OnDestroy {\n @Input() pageTitleUpdate: boolean = true;\n @ViewChild('template', {static: true}) template;\n private viewInitTimeout;\n\n constructor(\n private headerService: HeaderService\n ) {}\n\n ngAfterViewInit() {\n this.viewInitTimeout = setTimeout(() => this.headerService.changeTitle(this.template, this.pageTitleUpdate));\n }\n\n ngOnDestroy() {\n if (this.headerService.state.title === this.template) {\n clearTimeout(this.viewInitTimeout);\n this.headerService.changeTitle();\n }\n }\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport { ExtensionPoint, fromTrigger, sortByPriority, stateToFactory } from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport { Search } from './search.model';\n\n/**\n * A hook to use for Multi Provider extension.\n */\nexport const HOOK_SEARCH = new InjectionToken('SearchFactory');\n\n/**\n * A service which defines the dearch function.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class SearchService extends StateService implements ExtensionPoint<Search> {\n items$: Observable<Search[]>;\n readonly refreshTrigger = new Subject();\n protected state$ = new BehaviorSubject<Set<Search>>(new Set<Search>());\n\n constructor(\n private injector: Injector,\n router: Router\n ) {\n super();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_SEARCH, []),\n stateToFactory(this.state$)\n ]).pipe(\n map((items: Search[]) => sortByPriority(items)),\n shareReplay(1)\n );\n }\n\n /**\n * Refresh the extension factories\n */\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state() {\n return this.state$.value;\n }\n\n /**\n * Adds a new item to the search in the header.\n * @param item The item to add.\n */\n add(item: Search) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes an search from the header.\n * @param item The item to remove.\n */\n remove(item: Search) {\n this.state.delete(item);\n this.emitNewState();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { StateService } from '../common/state-service.abstract';\nimport { BehaviorSubject } from 'rxjs';\nimport { UserMenuItem } from './user.model';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UserMenuService extends StateService {\n state$: BehaviorSubject<any> = new BehaviorSubject<any>({\n userMenuItems: new Set<UserMenuItem>()\n });\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state() {\n return this.state$.value;\n }\n\n /**\n * Adds a new item to the search in the header.\n * @param item The item to add.\n */\n add(item: UserMenuItem) {\n this.state.userMenuItems.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes an search from the header.\n * @param item The item to remove.\n */\n remove(item: UserMenuItem) {\n this.state.userMenuItems.delete(item);\n this.emitNewState();\n }\n}\n","import { gettext } from '../i18n/gettext';\n\nexport const documentationItems = [\n {\n icon: 'c8y-c8y-data', // double c8y- is correct!\n label: gettext('Concepts guide`KEEP_ORIGINAL`'),\n url: '/concepts/introduction',\n type: 'doc'\n },\n {\n icon: 'c8y-user',\n label: gettext('User guide`KEEP_ORIGINAL`'),\n url: '/users-guide/getting-started',\n type: 'doc'\n },\n {\n icon: 'c8y-device-management',\n label: gettext('Device guides`KEEP_ORIGINAL`'),\n url: '/devices/overview',\n type: 'doc'\n },\n {\n icon: 'c8y-book',\n label: gettext('Cumulocity IoT Edge`KEEP_ORIGINAL`'),\n url: '/edge/overview',\n type: 'doc'\n },\n {\n icon: 'c8y-tools',\n label: gettext('Microservice SDK guide`KEEP_ORIGINAL`'),\n url: '/microservice-sdk/introduction',\n type: 'doc'\n },\n {\n icon: 'c8y-tools',\n label: gettext('Device SDK guide`KEEP_ORIGINAL`'),\n url: '/device-sdk/introduction',\n type: 'doc'\n },\n {\n icon: 'c8y-smart-rest',\n label: gettext('Web SDK guide`KEEP_ORIGINAL`'),\n url: '/web/introduction',\n type: 'doc'\n },\n {\n icon: 'c8y-data-explorer',\n label: gettext('Streaming analytics guide`KEEP_ORIGINAL`'),\n url: '/apama/introduction',\n type: 'doc'\n },\n {\n icon: 'c8y-bookmark',\n label: gettext('Reference guide`KEEP_ORIGINAL`'),\n url: '/reference/rest-implementation',\n type: 'doc'\n },\n {\n icon: 'gavel',\n label: gettext('Legal notices'),\n url: 'https://documentation.softwareag.com/legal/',\n type: 'doc'\n }\n];\n","import { InjectionToken } from '@angular/core';\nimport { ExtensionFactory } from '../common/extension-hooks';\n\nexport interface DocLink {\n icon: string;\n label: string;\n url: string;\n type: 'doc' | 'quicklink';\n click?: any;\n}\n\nexport type DocLinkFactory = ExtensionFactory<DocLink>;\n\nexport const HOOK_DOCS = new InjectionToken<ExtensionFactory<DocLink>>('Hook docs');\n","import { Injectable, Inject, Optional } from '@angular/core';\nimport { OptionsService } from '../common/options.service';\nimport { documentationItems } from './defaults.items';\nimport { AppStateService } from '../common/ui-state.service';\nimport { gettext } from '../i18n/gettext';\nimport { DocLink, HOOK_DOCS, DocLinkFactory } from './docs.models';\nimport { ExtensionPoint, fromTrigger } from '../common/extension-hooks';\nimport { Observable } from 'rxjs';\nimport { Router } from '@angular/router';\nimport { shareReplay, startWith, first, filter } from 'rxjs/operators';\nimport { isUndefined } from 'lodash-es';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DocsService implements ExtensionPoint<DocLink> {\n items$: Observable<DocLink[]>;\n constructor(\n private options: OptionsService,\n private app: AppStateService,\n @Optional() @Inject(HOOK_DOCS) factories: DocLinkFactory[] = [],\n router: Router\n ) {\n if (!factories) {\n factories = [];\n }\n factories.push(this);\n const refreshTrigger = this.app.map(({ supportUrl }) => supportUrl);\n this.items$ = fromTrigger(router, refreshTrigger, factories).pipe(\n startWith([]),\n shareReplay(1)\n );\n }\n\n getBaseUrl(): string {\n return this.options.get('docsBaseUrl', 'https://www.cumulocity.com/guides');\n }\n\n get templateStr(): string {\n return this.options.get('guideHrefTemplate', '${docsBaseUrl}${partialUrl}');\n }\n\n getUserGuideLink(link) {\n if (/^https?:/.test(link)) {\n return link;\n }\n if (this.getBaseUrl === null) {\n return null;\n }\n return this.getLink(this.templateStr, link);\n }\n\n list() {\n return this.items$\n .pipe(\n filter(i => !!i.length),\n first()\n )\n .toPromise();\n }\n\n refresh() {\n // no op\n }\n\n get() {\n // use the function as a factory\n const { links, noDefault, excludeDefault = [] } = this.options.get('docs', {});\n const { supportUrl } = this.app.state;\n let staticLinks = noDefault\n ? []\n : documentationItems\n .map((item: DocLink) => ({ ...item, url: this.getUserGuideLink(item.url) }))\n .filter(({ url }) => !excludeDefault.some(e => new RegExp(e).test(url)));\n\n if (links) {\n // backwards compatibility\n links.map((lnk: DocLink) => {\n if (isUndefined(lnk.type)) {\n lnk.type = 'doc';\n return lnk;\n }\n });\n staticLinks = staticLinks.concat(links);\n }\n if (supportUrl) {\n staticLinks.push({\n icon: 'comments',\n label: gettext('Forum support'),\n url: supportUrl,\n type: 'doc'\n });\n }\n return staticLinks;\n }\n\n private getLink(templateStr, partialLink) {\n if (!templateStr) {\n return undefined;\n }\n return templateStr\n .replace(/\\${docsBaseUrl}/, this.getBaseUrl())\n .replace(/\\${partialUrl}/, this.prefixWithSlash(partialLink));\n }\n\n private prefixWithSlash(partialLink = '') {\n const shouldPrefix = !(partialLink && /^\\//.test(partialLink));\n const prefix = shouldPrefix ? '/' : '';\n return `${prefix}${partialLink}`;\n }\n}\n","import { AfterViewInit, Component } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { ActionService } from '../../action/action.service';\nimport { BreadcrumbService } from '../../breadcrumb/breadcrumb.service';\nimport { SearchService } from '../../search/search.service';\nimport { AppStateService } from '../../common/ui-state.service';\nimport { UserMenuService } from '../../user/user-menu.service';\nimport { HeaderService } from '../header.service';\nimport { DocsService } from '../../docs/docs.service';\n\n@Component({\n selector: 'c8y-header-bar',\n templateUrl: './header-bar.component.html'\n})\nexport class HeaderBarComponent implements AfterViewInit {\n canToggle$: Observable<boolean> = this.headerService.hasItemsInNavigator$;\n appState$: Observable<any> = this.appState.state$;\n drawerOpen = false;\n headerOpen = false;\n\n constructor(\n public headerService: HeaderService,\n public actionService: ActionService,\n public breadcrumbService: BreadcrumbService,\n public searchService: SearchService,\n private appState: AppStateService,\n public userMenuService: UserMenuService,\n public docs: DocsService\n ) {}\n\n ngAfterViewInit() {\n this.headerService.verifyIfNavOpen();\n }\n\n toggle() {\n this.headerOpen = !this.headerOpen;\n }\n}\n","import { Component } from '@angular/core';\nimport { ApplicationService, IApplication, ICurrentTenant, IUser } from '@c8y/client';\nimport { get, includes, orderBy } from 'lodash-es';\nimport { combineLatest } from 'rxjs';\nimport { first } from 'rxjs/operators';\nimport { AppStateService } from '../../common/ui-state.service';\n@Component({\n selector: 'c8y-app-switcher',\n templateUrl: './app-switcher.component.html'\n})\nexport class AppSwitcherComponent {\n oneCloudApps?: Array<IApplication & { [key: string]: any }>;\n apps: Array<IApplication & { [key: string]: any }>;\n open: boolean;\n\n private get hideCloudApps(): boolean {\n return false; // this should be configurable from outside\n }\n private tenant: ICurrentTenant;\n constructor(private ui: AppStateService, private applications: ApplicationService) {\n const { currentUser, currentTenant } = this.ui;\n combineLatest(currentUser, currentTenant)\n .pipe(first())\n .subscribe(([user, tenant]) => {\n this.tenant = tenant;\n this.listAppsForUser(user);\n });\n }\n\n isActive(app: IApplication) {\n return app.contextPath === this.ui.state.app.contextPath;\n }\n\n getHref(app: IApplication) {\n return this.applications.getHref(app);\n }\n\n private async listAppsForUser(user: IUser | null) {\n if (user) {\n const { data } = await this.applications.listByUser(user, { pageSize: 1000 });\n this.apps = this.orderApps(this.filterApps(data));\n }\n }\n\n private filterApps(apps) {\n apps = this.filterVisible(apps);\n apps = this.filterCloud(apps);\n apps = this.filterDuplicates(apps);\n return apps;\n }\n\n private filterVisible(apps) {\n const visibleApplicationTypes = ['HOSTED', 'EXTERNAL'];\n return apps.filter(\n app =>\n includes(visibleApplicationTypes, app.type) &&\n !app.noAppSwitcher &&\n !get(app, 'manifest.noAppSwitcher')\n );\n }\n\n private filterCloud(apps) {\n const { hideCloudApps } = this;\n const filterFn = app => !!app.cloud;\n if (!hideCloudApps) {\n this.oneCloudApps = this.orderApps(apps.filter(filterFn));\n }\n return apps.filter(app => !filterFn(app));\n }\n\n private filterDuplicates(apps) {\n // Filter out apps that have duplicate contextpaths and are not own owned but the current tenant;\n const filterFn = app =>\n !apps.some(\n otherApp =>\n app !== otherApp &&\n (app.contextPath && app.contextPath === otherApp.contextPath) &&\n app.owner.tenant.id !== this.tenant.name\n );\n return apps.filter(filterFn);\n }\n\n private orderApps(apps) {\n return orderBy(apps, ({ name }) => name.toLowerCase());\n }\n}\n","import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';\nimport { find, keys, get, assign, isEmpty } from 'lodash-es';\nimport { OptionsService } from '../../common/options.service';\n\n@Component({\n selector: 'c8y-app-icon',\n templateUrl: './app-icon.component.html',\n host: { class: 'c8y-app-icon' }\n})\nexport class AppIconComponent implements OnChanges {\n @Input() contextPath: string;\n @Input() name: string = '';\n @Input() app: any;\n\n model = {\n appIcon: '',\n showIcon: true,\n iconClass: ['c8y-icon'],\n appNameAbbr: '',\n iconStyle: {}\n };\n\n private c8yAppIconsList = {\n analyticsbuilder: 'analytics-builder',\n 'analytics-builder': 'analytics-builder',\n cockpit: 'cockpit',\n devicemanagement: 'device-management',\n administration: 'administration',\n apamaepl: 'apama-epl'\n };\n\n private white: boolean = false;\n\n private defaultIconStyle = {\n 'background-repeat': 'no-repeat',\n 'background-size': 'contain',\n height: '36px',\n width: '36px'\n };\n\n constructor(private options: OptionsService) {}\n\n ngOnChanges(changes: SimpleChanges) {\n this.model.appIcon = this.iconFromAppDefinition() || this.findStaticIcon();\n const iconUrl = this.iconUrlFromAppDefinition();\n if (iconUrl) {\n this.model.iconStyle = assign(this.defaultIconStyle, {\n 'background-image': iconUrl\n });\n }\n this.model.showIcon = !!this.model.appIcon || !isEmpty(this.model.iconStyle);\n this.model.iconClass = [\n 'c8y-icon',\n this.model.appIcon,\n this.white ? 'c8y-icon-white' : 'c8y-icon-duocolor'\n ].filter(c => !!c);\n this.model.appNameAbbr = this.name.substr(0, 2);\n }\n\n private findStaticIcon() {\n const contextPath = this.contextPath || this.name;\n const appContextPathNormalized = find(keys(this.c8yAppIconsList), cp => {\n return contextPath.indexOf(cp) > -1;\n });\n const appIcon = this.c8yAppIconsList[appContextPathNormalized];\n return appIcon ? `c8y-icon-${appIcon}` : undefined;\n }\n\n private iconFromAppDefinition() {\n const app = this.app || this.options;\n const iconClassProperty = ['icon', 'class'];\n const iconClass = get(app, iconClassProperty) || get(app, ['manifest', ...iconClassProperty]);\n return iconClass;\n }\n\n private iconUrlFromAppDefinition() {\n const app = this.app || this.options;\n const iconUrlProperty = ['icon', 'url'];\n const iconUrl = get(app, iconUrlProperty) || get(app, ['manifest', ...iconUrlProperty]);\n return iconUrl;\n }\n}\n","import { Component, Input, SimpleChanges } from '@angular/core';\nimport { NavigatorNode } from './navigator-node';\nimport { HeaderService } from '../header/index';\nimport { BehaviorSubject, of } from 'rxjs';\nimport { delay } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-navigator-outlet, c8y-ui-navigator',\n templateUrl: './navigator-outlet.template.html',\n})\nexport class NavigatorOutletComponent {\n @Input() nodes: NavigatorNode[];\n @Input() open = true;\n isShown$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);\n\n constructor(private headerService: HeaderService) {}\n\n ngOnChanges(): void {\n this.isShown$.next(this.nodes && this.nodes.length > 0);\n }\n\n /**\n * Closes the navigator on click if the window is small.\n */\n collapseNavigator(from: 'icon' | 'expander' | 'link') {\n if (from === 'link' && !this.headerService.largeWidth) {\n this.headerService.closeNavigator();\n }\n }\n\n trackByPathOrLabel(index, node) {\n return node.path ? node.path : node.label;\n }\n}\n","export interface LoginMessage {\n message: string;\n type: string;\n}\n\nexport enum LoginViews {\n None,\n Credentials,\n RecoverPassword,\n SmsChallenge,\n ChangePassword,\n TotpChallenge,\n TotpSetup,\n ProvidePhoneNumber\n}\n","import { Component, Input, OnDestroy } from '@angular/core';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { StatusType, Status, statusIcons, statusAlert } from '../common/status.model';\nimport { ModalLabels } from '../select-modal/select-modal.model';\n\n/**\n * Labels to be used in the selection modal.\n * @deprecated This is going to be removed after 1007.7.0. Use ModalLabels instead.\n */\n// tslint:disable-next-line: no-empty-interface\nexport interface ILabels extends ModalLabels {}\n\n@Component({\n selector: 'c8y-confirm-modal',\n templateUrl: './modal-confirm.component.html'\n})\nexport class ConfirmModalComponent implements OnDestroy {\n result: Promise<boolean>;\n dismiss: () => void;\n close: () => void;\n @Input() title: string;\n @Input() body: string;\n @Input() status: StatusType = Status.INFO;\n @Input() set labels(labels: ModalLabels) {\n const { ok = 'OK', cancel = 'Cancel' } = labels || {};\n this._labels = { ok, cancel };\n }\n\n get labels(): ModalLabels { return this._labels; }\n\n get classIcon() {\n return `fa-${statusIcons[this.status]}`;\n }\n\n get classAlert() {\n return statusAlert[this.status];\n }\n\n private _labels: ModalLabels;\n\n constructor(private modal: BsModalRef) {\n this._labels = {\n ok: 'OK',\n cancel: 'Cancel'\n };\n this.result = new Promise((resolve, reject) => {\n this.dismiss = () => {\n reject();\n this.modal.hide();\n };\n this.close = () => {\n resolve(true);\n this.modal.hide();\n };\n });\n }\n\n ngOnDestroy() {\n this.dismiss();\n }\n}\n","import { Component, Input, Optional, Output, EventEmitter, HostListener } from '@angular/core';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { gettext } from '../i18n/gettext';\nimport { isEmpty } from 'lodash';\nimport { ModalLabels } from '../select-modal/select-modal.model';\n\n/**\n * C8y modal component.\n * ## Example:\n *\n * Creating custom modal:\n * ```typescript\n * import { Component } from \"@angular/core\";\n * import { Subject } from 'rxjs';\n *\n * @Component({\n * selector: \"my-modal\",\n * template: `\n * <c8y-modal title=\"CustomTitle\"\n * (onClose)=\"onClose($event)\"\n * (onDismiss)=\"onDismiss($event)\"\n * [labels]=\"labels\"\n * [disabled]=\"true\" <- will disable ok button\n * >\n * <span>I am body of modal</span>\n * <span>For simple string use body=\"string\"</span>\n * </c8y-modal>`\n * })\n *\n * export class MyModalComponent {\n *\n * closeSubject: Subject<boolean> = new Subject();\n * labels : ModalLabels = {ok: \"customOK\", cancel: \"customCancel\"};\n *\n * onDismiss(event){\n * this.closeSubject.next(false);\n * }\n *\n * onClose(event) {\n * this.closeSubject.next(true);\n * }\n * }\n * ```\n * Showing modal:\n * ```typescript\n * import { BsModalService } from \"ngx-bootstrap/modal\";\n *\n * constructor(\n * public bsModalService: BsModalService,\n * ) {}\n *\n * showModal() {\n * const modalRef = this.bsModalService.show(MyModalComponent);\n * modalRef.content.closeSubject.subscribe(result => {\n * console.log('results:', result);\n * });\n * }\n * ```\n */\n@Component({\n selector: 'c8y-modal',\n templateUrl: './modal.component.html',\n})\n\nexport class ModalComponent {\n @Output() onDismiss: EventEmitter<boolean> = new EventEmitter();\n @Output() onClose: EventEmitter<boolean> = new EventEmitter();\n @Input() disabled = false;\n @Input() close: () => void;\n @Input() dismiss: () => void;\n @Input() title: string;\n @Input() body: string;\n @Input() customFooter: boolean = false;\n @Input() set labels({ok, cancel}: ModalLabels) {\n this._labels = {ok , cancel};\n }\n\n get labels(): ModalLabels { return this._labels; }\n\n private _labels: ModalLabels = { ok: gettext('OK'), cancel: gettext('Cancel') };\n\n constructor(@Optional() private modal: BsModalRef) {}\n\n _dismiss() {\n let fn = this.dismiss;\n if (!fn && this.modal) { fn = () => this.modal.hide(); }\n if (fn) { fn(); }\n this.onDismiss.emit(true);\n }\n\n _close() {\n let fn = this.close;\n if (!fn && this.modal) { fn = () => this.modal.hide(); }\n if (fn) { fn(); }\n this.onClose.emit(true);\n }\n\n @HostListener('document:keydown.enter', ['$event']) onEnterKeyDown(event: KeyboardEvent) {\n const hasOnlyOneButton = isEmpty(this.labels.ok) !== isEmpty(this.labels.cancel);\n const isCancelClickable = !this.customFooter && this.labels.cancel;\n const isOkClickable = !this.customFooter && !this.disabled && this.labels.ok;\n if (hasOnlyOneButton && isCancelClickable) {\n this._dismiss();\n }\n if (hasOnlyOneButton && isOkClickable) {\n this._close();\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { ConfirmModalComponent } from './modal-confirm.component';\nimport { StatusType, Status } from '../common/status.model';\nimport { gettext } from '../i18n/gettext';\n\n/**\n * Service to shiow a modal.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ModalService {\n\n constructor(private modalService: BsModalService) {}\n\n /**\n * Shows a quick confirm message modal.\n * @param title The title of that modal.\n * @param body The text body to display.\n * @param status The status.\n * @param labels The labels to use. Default: { ok: 'Confirm', cancel: 'Cancel'}\n */\n async confirm(title: string, body: string, status: StatusType = Status.INFO, labels: any = {}) {\n const modalLabels = {ok: labels.ok || gettext('Confirm'), cancel: labels.cancel || gettext('Cancel')};\n const modalRef = this.modalService.show(ConfirmModalComponent, {initialState: {title, body, labels: modalLabels, status}});\n return await modalRef.content.result;\n }\n\n /**\n * Shows a quick acknowledge message modal.\n * @param title The title of that modal.\n * @param body The text body to display.\n * @param status The status.\n * @param acknowledgeLabel The label to use.\n */\n async acknowledge(title: string, body: string, status: StatusType = Status.INFO, acknowledgeLabel: string = gettext('Confirm') ) {\n const labels = {ok: acknowledgeLabel, cancel: null};\n const modalRef = this.modalService.show(ConfirmModalComponent, {initialState: {title, body, labels, status}});\n return await modalRef.content.result;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ModalModule as BsModalModule } from 'ngx-bootstrap/modal';\nimport { ConfirmModalComponent } from './modal-confirm.component';\nimport { ModalComponent } from './modal.component';\nimport { ModalService } from './modal.service';\nimport { CommonModule } from '../common/common.module';\nimport { PopoverConfirmComponent } from './popover-confirm.component';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\n\n/**\n * The angular module definition for modal.\n * @exports ConfirmModalComponent\n * @exports ModalComponent\n * @exports PopoverConfirmComponent\n */\n@NgModule({\n imports: [\n BsModalModule.forRoot(),\n CommonModule,\n PopoverModule.forRoot()\n ],\n exports: [\n ConfirmModalComponent,\n ModalComponent,\n PopoverConfirmComponent\n ],\n declarations: [\n ConfirmModalComponent,\n ModalComponent,\n PopoverConfirmComponent\n ],\n providers: [\n ModalService\n ],\n entryComponents: [\n ConfirmModalComponent\n ]\n})\nexport class ModalModule { }\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CollapseModule } from 'ngx-bootstrap/collapse';\nimport { CommonModule } from '../common/common.module';\nimport { NavigatorItemComponent } from './navigator-entry.component';\nimport { NavigatorIconComponent } from './navigator-icon.component';\nimport { NavigatorNodeComponent } from './navigator-node.component';\nimport { NavigatorOutletComponent } from './navigator-outlet.component';\nimport { NavigatorService } from './navigator.service';\nimport { ModalModule } from '../modal/modal.module';\n\n/**\n * The angular module definition for the navigator.\n * @exports NavigatorOutletComponent\n * @exports NavigatorItemComponent\n */\n@NgModule({\n declarations: [\n NavigatorOutletComponent,\n NavigatorNodeComponent,\n NavigatorItemComponent,\n NavigatorIconComponent\n ],\n imports: [\n RouterModule,\n CollapseModule.forRoot(),\n CommonModule,\n ModalModule\n ],\n exports: [\n NavigatorOutletComponent,\n NavigatorItemComponent\n ],\n entryComponents: [\n NavigatorIconComponent\n ]\n})\nexport class NavigatorModule { }\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { OptionsService } from '../../common/options.service';\nimport { gettext } from '../../i18n/gettext';\nimport { Cookie, CookieBannerSettings, CookiePreferences } from './cookie-banner.model';\n@Injectable({\n providedIn: 'root'\n})\nexport class CookieBannerService {\n readonly STORAGE_KEY: string = 'acceptCookieNotice';\n readonly COOKIE_BANNER = 'cookieBanner';\n isCookieBannerShowed$: Subject<boolean> = new Subject();\n\n private readonly cookieDescriptions = {\n required: gettext(\n \"These cookies are required to enable core site functionality. They perform a task or operation without which a site's functionality would not be possible.\"\n ),\n functional: gettext(\n 'These cookies are used to track site usage and to process my personal data to measure and improve usability and performance. We will neither forward this data to any third party nor use this data for direct marketing purposes. I recognize that I can opt in and out of these cookies at any time.'\n ),\n marketing: gettext('These cookies are used to target advertising to a user.')\n };\n\n constructor(private options: OptionsService) {}\n\n getCookiePreferencesConfig(): CookiePreferences {\n const settings = this.getCookieBannerSettings();\n return settings && settings.configuration;\n }\n\n getCookieBannerSettings(): CookieBannerSettings {\n return this.options.get(this.COOKIE_BANNER) || {};\n }\n\n setCookies(cookiePreferences: CookiePreferences) {\n localStorage.setItem(this.STORAGE_KEY, JSON.stringify(cookiePreferences));\n }\n\n shouldShowCookieBanner(): boolean {\n const settings = this.getCookieBannerSettings();\n return !!settings.cookieBannerText && !this.getUserCookiePreferences();\n }\n\n getUserCookiePreferences(): CookiePreferences {\n return JSON.parse(localStorage.getItem(this.STORAGE_KEY));\n }\n\n isConfigCookiePreferencesDefined() {\n return !!this.getCookiePreferencesConfig();\n }\n\n isFunctionalCookieDisabled() {\n const { functional }: CookiePreferences = this.getUserCookiePreferences() || {};\n /**\n * We want this check, as we should stop loading Gainsight tag only when functional cookie is explicitly set to false.\n * In the USA there is no need for the functional cookies when tracking users.\n * This is why we want to allow undefined to pass the check.\n * @ignore\n */\n return functional === false;\n }\n\n getCookieDescription(cookieType: string): string {\n return this.cookieDescriptions[cookieType];\n }\n\n transformCookiePreferencesToList(cookiePreferences: CookiePreferences): Cookie[] {\n return Object.entries(cookiePreferences).map(([name, value]) => {\n const isReadonly = name === 'required';\n return { name, value, isReadonly };\n });\n }\n\n transformCookiePreferencesListToCookiePreferences(\n cookiePreferencesList: Cookie[]\n ): CookiePreferences {\n return cookiePreferencesList.reduce((cookiePref: CookiePreferences, cookie: Cookie) => {\n const key: string = cookie.name;\n cookiePref[key] = cookie.value;\n\n return cookiePref;\n }, {});\n }\n}\n","import { Injectable } from '@angular/core';\nimport { combineLatest, fromEvent, BehaviorSubject } from 'rxjs';\nimport { ICustomProperties } from '@c8y/client';\nimport { filter, delay, map, take } from 'rxjs/operators';\nimport { AppStateService } from '../common/ui-state.service';\nimport { OptionsService } from '../common/options.service';\nimport { TranslateService } from '../i18n/translate.service';\nimport { CookieBannerService } from '../bootstrap/cookie-banner/cookie-banner.service';\n\n/**\n * A service to manage the Gainsight integration. It allows to load the\n * tag and\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class GainsightService {\n /**\n * A subject that emits the tag function as soon as a new tag is set.\n */\n tagFunction$ = new BehaviorSubject(null);\n\n private readonly GAINSIGHT_URL = 'web-sdk.aptrinsic.com/api/aptrinsic.js?a=';\n private readonly GAINSIGHT_GLOBAL_SCOPE = 'aptrinsic';\n private readonly SCRIPT_EXECUTION_WAIT_TIME = 500;\n private readonly OPTIONS_KEY_CATEGORY = 'gainsight';\n private readonly OPTIONS_KEY_NAME = 'api.key';\n\n constructor(\n private appState: AppStateService,\n private options: OptionsService,\n private cookieBannerService: CookieBannerService\n ) {}\n\n /**\n * Returns the tag global function which can be used to identify user\n * or add special events.\n */\n get tagFunction() {\n return (window as any)[this.GAINSIGHT_GLOBAL_SCOPE];\n }\n\n /**\n * Load the script tag and calls the identify function to start the tracking.\n * @param accountId The account where the user is registered. Could be the name of the tenant.\n * @param identify If set to false, only the tag is loaded.\n */\n async loadTag(accountId, identify = true) {\n const scriptTag = document.createElement('script');\n const key =\n this.options.gainsightKey ||\n (await this.options.getSystemOption(this.OPTIONS_KEY_CATEGORY, this.OPTIONS_KEY_NAME));\n\n if (key) {\n this.loadScriptTag(scriptTag, key);\n combineLatest(\n this.appState.currentUser,\n fromEvent(scriptTag, 'load'),\n this.appState.state$.pipe(\n filter(({ versions }) => versions.backend),\n map(({ versions }) => versions),\n take(1)\n )\n )\n .pipe(\n delay(this.SCRIPT_EXECUTION_WAIT_TIME),\n filter(([user, scriptEvent]) => !!(scriptEvent && user))\n )\n .subscribe(([user, scriptEvent, versions]) => {\n const instanceId = this.getInstanceIdFromUrl();\n if (identify) {\n this.identify(user, accountId, instanceId, versions.ui.ngx, versions.backend);\n }\n this.tagFunction$.next(this.tagFunction);\n });\n }\n }\n\n /**\n * Identifies the user/account at Gainsight.\n * @param userId The user id which is given to Gainsight.\n * @param accountId The account id which is given to Gainsight (e.g. the tenant name)\n * @param versionUI The UI version used.\n * @param versionBE The BE version used.\n */\n identify(user, accountId, instanceId, versionUI?, versionBE?) {\n const windowRef = window as any;\n const { id: userId, email, userName, phone, firstName, lastName } = user;\n windowRef[this.GAINSIGHT_GLOBAL_SCOPE](\n 'identify',\n {\n id: `${userId}_${accountId}_${instanceId}`,\n email,\n userName,\n firstName,\n lastName,\n versionUI,\n versionBE,\n userLanguage: TranslateService.defaultLang(),\n instanceId\n },\n {\n id: `${accountId}_${instanceId}`,\n instanceId\n }\n );\n }\n\n triggerEvent(eventName: string, props?: object) {\n if (this.tagFunction && eventName) {\n eventName = eventName.replace(/ /g, '_');\n this.tagFunction('track', eventName, props);\n }\n }\n\n /**\n * Checks if the Gainsight's tag should be loaded.\n * Where no consent is required from the user. The decision to load Gainsight will depend on custom properties.\n * Where the user's consent is required. The decision to load Gainsight will depend on custom properties and functional cookies.\n * By default, the Gainsight's tag will be loaded.\n * @param customProperties Tenant's customProperties.\n */\n shouldLoadGainsightTag(customProperties: ICustomProperties): boolean {\n return (\n (!this.cookieBannerService.isConfigCookiePreferencesDefined() &&\n !this.isGainsightDisabled(customProperties)) ||\n (!this.cookieBannerService.isFunctionalCookieDisabled() &&\n !this.isGainsightDisabled(customProperties))\n );\n }\n\n private isGainsightDisabled(customProperties: ICustomProperties) {\n const gainsightEnabled = customProperties && customProperties.gainsightEnabled;\n return gainsightEnabled === false;\n }\n\n private loadScriptTag(scriptTag: HTMLScriptElement, key: string) {\n try {\n const windowRef = window as any;\n const firstTag = document.getElementsByTagName('script')[0];\n const protocol = location.protocol;\n const gainsightGlobalScope = this.GAINSIGHT_GLOBAL_SCOPE;\n scriptTag.src = `${protocol}//${this.GAINSIGHT_URL}${key}`;\n (windowRef[this.GAINSIGHT_GLOBAL_SCOPE] =\n windowRef[this.GAINSIGHT_GLOBAL_SCOPE] ||\n // tslint:disable-next-line:only-arrow-functions\n function() {\n (windowRef[gainsightGlobalScope].q = windowRef[gainsightGlobalScope].q || []).push(\n arguments\n );\n }),\n (windowRef[gainsightGlobalScope].p = key);\n scriptTag.async = true;\n firstTag.parentNode.insertBefore(scriptTag, firstTag);\n } catch (ex) {\n console.warn('Failed to load Gainsight PX', ex);\n }\n }\n\n private getInstanceIdFromUrl() {\n const hostName = location.hostname;\n return hostName.substring(hostName.indexOf('.') + 1);\n }\n}\n","import { Directive, HostListener, Input } from '@angular/core';\nimport { GainsightService } from './gainsight.service';\n\n@Directive({\n selector: '[c8yProductExperience]'\n})\nexport class ProductExperienceDirective {\n @Input() actionName: string;\n @Input() actionData: object;\n constructor(private gainsightService: GainsightService) {}\n\n @HostListener('click')\n onClick() {\n if (this.actionName) {\n this.gainsightService.triggerEvent(this.actionName, this.actionData);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ICurrentTenant } from '@c8y/client';\nimport { combineLatest } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport { CookieBannerService } from '../bootstrap/cookie-banner/cookie-banner.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { GainsightService } from './gainsight.service';\nimport { ProductExperienceDirective } from './product-experience.directive';\n/**\n * This module enables an tenant to activate the product experience\n * software [Gainsight](https://www.gainsight.com/product-experience/) to help\n * and track user actions. Gainsight is only activated, if the tenant custom\n * property `gainsightEnabled` is set to true.\n */\n@NgModule({\n declarations: [ProductExperienceDirective],\n exports: [ProductExperienceDirective],\n providers: [GainsightService]\n})\nexport class ProductExperienceModule {\n constructor(\n private appState: AppStateService,\n private gainsightService: GainsightService,\n private cookieBannerService: CookieBannerService\n ) {\n combineLatest([\n this.appState.currentTenant.pipe(filter<ICurrentTenant>(Boolean)),\n this.cookieBannerService.isCookieBannerShowed$\n ]).subscribe(([currentTenant, isCookieBannerShowed]) => {\n if (isCookieBannerShowed) {\n return;\n }\n const { customProperties, name } = currentTenant;\n\n if (this.gainsightService.shouldLoadGainsightTag(customProperties)) {\n this.gainsightService.loadTag(name);\n }\n });\n }\n}\n","import { Component, Input, ViewChild, ElementRef } from '@angular/core';\nimport { Search } from './search.model';\nimport { sortBy } from 'lodash';\nimport { AlertService } from '../alert/alert.service';\nimport { Alert } from '../alert/alert.model';\n\n@Component({\n selector: 'c8y-search-outlet',\n templateUrl: './search-outlet.component.html'\n})\nexport class SearchOutletComponent {\n @Input() search: Search[] = [];\n\n constructor(private alertService: AlertService) {}\n\n openSearch() {\n setTimeout(() => this.focusInputBox(), 100);\n }\n\n getByPriority() {\n return sortBy(this.search, this.byPriority);\n }\n\n closeDropdown(dropdown) {\n dropdown.hide();\n }\n\n verifyNotEmpty(term) {\n if (!term || term === '') {\n this.alertService.add({ text: 'Type something to execute a search.', type: 'warning' });\n }\n }\n\n private byPriority(item) {\n return -item.priority;\n }\n\n private focusInputBox() {\n const elementToFocus: any = document.querySelector('#search-header-menu input');\n if (elementToFocus) {\n elementToFocus.focus();\n }\n }\n}\n","import { Component, Input, Output, ViewChild, EventEmitter } from '@angular/core';\nimport { Search } from './search.model';\nimport { SearchService } from './search.service';\n\n@Component({\n selector: 'c8y-search',\n templateUrl: './search.component.html'\n})\nexport class SearchComponent implements Search {\n @Input() name: string;\n @Input() icon: string = 'search';\n @Input() priority: number = 0;\n @ViewChild('template', {static: false}) template: any;\n @Output() search = new EventEmitter<Search>();\n @Input() term: string = '';\n\n private viewInitTimeout;\n\n constructor(private searchService: SearchService) { }\n\n onSearch() {\n this.search.emit(this);\n }\n\n ngAfterViewInit() {\n this.template = undefined;\n this.viewInitTimeout = setTimeout(() => this.searchService.add(this as Search));\n }\n\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.searchService.remove(this as Search);\n }\n}\n","import {\n Component,\n ElementRef,\n Input,\n ViewChild\n} from '@angular/core';\nimport { escape, escapeRegExp } from 'lodash-es';\n\n@Component({\n selector: 'c8y-highlight',\n template: '<span [innerHTML]=\"highlightedText\"></span>'\n})\nexport class HighlightComponent {\n @ViewChild('text', { read: ElementRef, static: true })\n container: ElementRef;\n\n @Input()\n pattern: string = '';\n\n @Input()\n text: string = '';\n\n @Input()\n elementClass: string = 'text-info';\n\n highlightedText: string = '';\n\n ngOnChanges(): void {\n const textNoHtml = escape(this.text || '');\n const patternNoHtml = escape(this.pattern || '');\n const patternForRegex = escapeRegExp(patternNoHtml).replace(/\\\\\\*/g, '.*');\n this.highlightedText = textNoHtml.replace(\n new RegExp(patternForRegex, 'i'),\n `<strong class=\"${this.elementClass}\">$&</strong>`\n );\n }\n}\n","import { Component, Input} from '@angular/core';\r\nimport { gettext } from '../i18n/gettext';\r\n\r\n@Component({\r\n selector: 'c8y-search-result-empty',\r\n templateUrl: './search-result-empty.component.html'\r\n})\r\nexport class SearchResultEmptyComponent {\r\n private readonly NO_RESULT_FOUND = gettext('No results found.');\r\n private msg: string = this.NO_RESULT_FOUND;\r\n\r\n @Input('message')\r\n set _message(msg: string) {\r\n if (msg && msg.length > 0) {\r\n this.msg = msg;\r\n } else {\r\n this.msg = this.NO_RESULT_FOUND;\r\n }\r\n }\r\n\r\n get message() {\r\n return this.msg;\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { CommonModule } from '../common/common.module';\nimport { SearchOutletComponent } from './search-outlet.component';\nimport { SearchComponent } from './search.component';\nimport { SearchService } from './search.service';\nimport { FormsModule } from '@angular/forms';\nimport { HighlightComponent } from './highlight.component';\nimport { SearchResultEmptyComponent } from './search-result-empty.component';\n\n/**\n * The angular module definition for the search.\n * @exports SearchComponent\n * @exports SearchOutletComponent\n * @exports HighlightComponent A component to highlight search results.\n */\n@NgModule({\n declarations: [\n SearchOutletComponent,\n SearchComponent,\n HighlightComponent,\n SearchResultEmptyComponent\n ],\n imports: [\n FormsModule,\n BsDropdownModule,\n CommonModule,\n RouterModule.forChild([])\n ],\n exports: [\n SearchOutletComponent,\n SearchComponent,\n HighlightComponent,\n SearchResultEmptyComponent\n ]\n})\nexport class SearchModule { }\n","import { Component, Input, ViewChild, EventEmitter, Output } from '@angular/core';\nimport { UserMenuItem } from './user.model';\nimport { UserMenuService } from './user-menu.service';\n\n@Component({\n selector: 'c8y-user-menu-item',\n templateUrl: './user-menu-item.component.html'\n})\nexport class UserMenuItemComponent implements UserMenuItem {\n @Input()\n icon: string;\n @Input()\n label: string;\n @Input()\n link: string;\n @Input()\n target: string;\n @Input()\n priority = 0;\n @ViewChild('template', {static: false}) template: any;\n\n @Output()\n click = new EventEmitter<UserMenuItem>();\n private viewInitTimeout;\n\n constructor(private userService: UserMenuService) { }\n\n ngAfterViewInit() {\n this.viewInitTimeout = setTimeout(() =>\n this.userService.add(this as UserMenuItem)\n );\n }\n\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.userService.remove(this as UserMenuItem);\n }\n\n onClick() {\n this.click.emit(this);\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { BasicAuth, FetchClient, ICredentials, IUser, UserService } from '@c8y/client';\nimport { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';\nimport { AlertService } from '../alert/alert.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { UserPreferencesService } from '../common/user-preferences/user-preferences.service';\nimport { gettext } from '../i18n/gettext';\nimport { TranslateService } from '../i18n/translate.service';\nimport { take } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-user-edit-modal',\n templateUrl: './user-edit-modal.component.html'\n})\nexport class UserEditModalComponent implements OnInit {\n currentUser: IUser;\n lang: string;\n changedLang: string;\n loading = false;\n\n constructor(\n public modal: BsModalRef,\n public user: UserService,\n public ui: AppStateService,\n private auth: BasicAuth,\n private client: FetchClient,\n private alert: AlertService,\n private translate: TranslateService,\n private userPreferences: UserPreferencesService,\n private modalService: BsModalService\n ) {\n this.lang = this.ui.state.lang;\n this.modalService.onHide.pipe(take(1)).subscribe(( reason: string ) => {\n if (reason !== null && this.changedLang !== undefined) {\n this.translate.switchToLanguage(this.lang);\n }\n });\n }\n\n ngOnInit() {\n this.updateUserInAppState();\n }\n\n onDismiss() {\n if (this.changedLang !== undefined) {\n this.translate.switchToLanguage(this.lang);\n }\n this.modal.hide();\n }\n\n onLanguage(lang) {\n this.changedLang = lang;\n this.translate.switchToLanguage(this.changedLang);\n }\n\n async updateAndClose(user) {\n this.loading = true;\n try {\n await this.user.updateCurrent(user);\n if (user.password) {\n this.updateCredentials(user.password);\n }\n await this.updateUserInAppState();\n if (this.changedLang && this.changedLang !== this.lang) {\n await this.persistLanguage(this.changedLang);\n }\n this.modal.hide();\n this.alert.success(gettext('User saved.'));\n } catch (e) {\n this.alert.addServerFailure(e);\n } finally {\n this.loading = false;\n }\n }\n\n async persistLanguage(lang) {\n this.translate.saveInLocalStorage(lang);\n this.userPreferences.set('language', lang);\n }\n\n private async updateUserInAppState() {\n const currentUserResult = await this.user.current();\n this.ui.currentUser.next(currentUserResult.data);\n }\n\n private updateCredentials(password: string) {\n const newCredentials: ICredentials = {\n password,\n user: this.ui.currentUser.value.id,\n tenant: this.client.tenant\n };\n this.auth.updateCredentials(newCredentials);\n }\n}\n","import { Injectable, Optional } from '@angular/core';\nimport {\n BasicAuth,\n CookieAuth,\n FetchClient,\n IAuthentication,\n ICredentials,\n ITenantLoginOption,\n Realtime,\n TenantService,\n UserService\n} from '@c8y/client';\nimport { AppStateService } from '../common/ui-state.service';\nimport { AlertService } from '../alert/alert.service';\nimport { gettext } from '../i18n/gettext';\nimport { ApiService } from '@c8y/ngx-components/api';\nimport { switchMap } from 'rxjs/operators';\nimport { EMPTY } from 'rxjs';\nimport { LocationStrategy } from '@angular/common';\nimport { get, isString } from 'lodash-es';\n\n/**\n * Service to manage the login.\n */\n@Injectable()\nexport class LoginService {\n rememberMe: boolean = false;\n TOKEN_KEY: string = '_tcy8';\n TFATOKEN_KEY: string = 'TFAToken';\n OAUTH2_INTERNAL_TYPE: string = 'OAUTH2_INTERNAL';\n loginMode: any;\n oauthOptions: any;\n isFirstLogin = true;\n GREEN_MIN_LENGTH_DEFAULT = 8;\n\n // tslint:disable:max-line-length\n ERROR_MESSAGES = {\n minlength: gettext('Password must have at least 8 characters and no more than 32.'),\n password_missmatch: gettext('Password confirmation does not match.'),\n maxlength: gettext('Password must have at least 8 characters and no more than 32.'),\n password_strength: gettext(\n 'Your password is not strong enough. Please include numbers, lower and upper case characters'\n ),\n remote_error: gettext('Server error occurred.'),\n email: gettext('Invalid email address.'),\n password_change: gettext('Your password is expired. Please set a new password.'),\n password_reset_token_expired: gettext(\n 'Password reset link expired. Please enter your email address to receive a new one.'\n ),\n tfa_pin_invalid: gettext('The code you entered is invalid. Please try again.'),\n pattern_phonenumber: gettext(\n 'Invalid phone number format. Only digits, spaces, slashes (\"/\") and dashes (\"-\") allowed.'\n ),\n pattern_newPassword: gettext(\n 'Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:\\'\",.<>{}[]\\\\/'\n ),\n international_number_required: gettext(\n 'International phone number required, in the format +49 9 876 543 210.'\n ),\n phone_number_error: gettext('Could not update phone number.'),\n pinAlreadySent: gettext(\n 'The verification code was already sent. For a new verification code, please click on the link above.'\n ),\n passwordConfirm: gettext('Password confirmation does not match.'),\n tfaExpired: gettext('Two-factor authentication token expired.')\n };\n // tslint:enable:max-line-length\n\n private SUCCESS_MESSAGES = {\n password_changed: gettext('Password changed. You can now log in using new password.'),\n password_reset_requested: gettext(\n 'Password reset request has been sent. Please check your email.'\n ),\n resend_sms: gettext('Verification code SMS resent.'),\n send_sms: gettext('Verification code SMS sent.')\n };\n\n private passwordStrengthSetting = {\n enforcePasswordStrength: false,\n greenMinLength: this.GREEN_MIN_LENGTH_DEFAULT,\n passwordStrengthValidity: false\n };\n\n private localhostRegExp = new RegExp('localhost');\n private localhostIpRegExp = new RegExp('127.0.0.1');\n private showTenantRegExp = new RegExp('showTenant');\n\n constructor(\n private client: FetchClient,\n private basicAuth: BasicAuth,\n private cookieAuth: CookieAuth,\n private ui: AppStateService,\n private user: UserService,\n private tenant: TenantService,\n private realtime: Realtime,\n private alert: AlertService,\n private api: ApiService,\n @Optional() private location: LocationStrategy\n ) {\n this.autoLogout();\n this.initLoginOptions();\n }\n\n /**\n * Returns the current tenant.\n * @return The tenant name.\n */\n getTenant() {\n return this.client.tenant;\n }\n\n initLoginOptions() {\n const loginOptions = this.ui.state.loginOptions || [];\n const isOAuth2 = ({ type, grantType }) =>\n type === 'OAUTH2' && grantType === 'AUTHORIZATION_CODE';\n this.loginMode = loginOptions.find(({ type }) => type === 'OAUTH2_INTERNAL') ||\n loginOptions.find(({ type }) => type === 'BASIC') ||\n loginOptions.find(isOAuth2) || { type: 'BASIC' };\n this.oauthOptions = loginOptions.find(isOAuth2) || {};\n }\n\n redirectToOauth() {\n const { initRequest } = this.oauthOptions;\n const fullPath = (this.location ? (this.location as any)._platformLocation : window).location\n .href;\n const redirectUrl = encodeURIComponent(fullPath);\n const originUriParam = `${initRequest.includes('?') ? '&' : '?'}originUri=${redirectUrl}`;\n window.location.href = `${initRequest}${originUriParam}`;\n }\n\n autoLogout() {\n const errorPattern = /invalid\\scredentials.*pin.*generate/i;\n const isTfaExpired = data =>\n data && typeof data.message === 'string' && errorPattern.test(data.message);\n this.ui.currentUser\n .pipe(\n switchMap(u =>\n u ? this.api.hookResponse(({ response }) => response.status === 401) : EMPTY\n )\n )\n .subscribe(async (apiCall: any) => {\n const { response } = apiCall;\n let willLogout = false;\n if (isTfaExpired(response.data)) {\n willLogout = true;\n } else {\n if (typeof response.json === 'function') {\n const data = await response.clone().json();\n if (isTfaExpired(data)) {\n willLogout = true;\n }\n }\n }\n if (willLogout) {\n this.logout(false);\n setTimeout(() => this.alert.danger(this.ERROR_MESSAGES.tfaExpired), 500);\n }\n });\n }\n\n /**\n * Gets the minimal number of characters that a password should have to be considered a “green” strong one.\n * @return The min length for password or default value.\n */\n async getGreenMinLength() {\n const { greenMinLength } = await this.getBasicAuthLoginOption() || { greenMinLength: null };\n this.passwordStrengthSetting.greenMinLength = greenMinLength || this.GREEN_MIN_LENGTH_DEFAULT;\n return this.passwordStrengthSetting.greenMinLength;\n }\n\n /**\n * Checks if password strength is enforced for system\n * by retrieving value of `enforceStrength` property from loginOptions response\n * @param refresh boolean used to refresh the app state where result of loginOptions response is stored.\n * If false, it takes value from memory,\n * if true, it refresh the app state value and then retrives data.\n * @return boolean value, true if enforced, false otherwise.\n */\n async getEnforcePasswordStrength(refresh?) {\n return this.getBasicAuthLoginOption(refresh).then((loginOption) => {\n const enforcePasswordStrength = get(loginOption, 'enforceStrength');\n if (isString(enforcePasswordStrength)) {\n this.passwordStrengthSetting.enforcePasswordStrength = enforcePasswordStrength === 'true' ? true : false;\n } else {\n this.passwordStrengthSetting.enforcePasswordStrength = !!enforcePasswordStrength;\n }\n return this.passwordStrengthSetting.enforcePasswordStrength;\n });\n }\n\n /**\n * Checks if password strength is enforced for particular tenant\n * by retrieving value of `strengthValidity` property from loginOptions response\n * @param refresh boolean used to refresh the app state where result of loginOptions response is stored.\n * If false, it takes value from memory,\n * if true, it refresh the app state value and then retrives data.\n * @return boolean value, true if enforced, false otherwise.\n */\n async getPasswordStrengthValidity(refresh?) {\n return this.getBasicAuthLoginOption(refresh).then((loginOption) => {\n const strengthValidity = get(loginOption, 'strengthValidity');\n if (isString(strengthValidity)) {\n this.passwordStrengthSetting.passwordStrengthValidity = strengthValidity === 'true' ? true : false;\n } else {\n this.passwordStrengthSetting.passwordStrengthValidity = !!strengthValidity;\n }\n return this.passwordStrengthSetting.passwordStrengthValidity;\n });\n }\n\n /**\n * Function determines if enforced strength checks should be enabled for current tenant\n * based on properties retrieved from loginOptions\n * @param options object containing specific options:\n * - {refresh: true} - refreshes values of app state and returns fresh values as result of call\n * @return boolean value, true if strength is enforced for tenant, false otherwise.\n */\n async getPasswordStrengthEnforced(options?) {\n const refresh = options && options.refresh;\n return Promise.all([this.getEnforcePasswordStrength(refresh), this.getPasswordStrengthValidity(refresh)]).then((values) => {\n const [enforcePasswordStrength, passwordStrengthValidity] = values;\n return enforcePasswordStrength || passwordStrengthValidity;\n });\n }\n\n /**\n * Clears all backend errors.\n */\n cleanMessages() {\n this.alert.clearAll();\n }\n\n /**\n * Adds a new success message\n * @param successKey The key of the success message as used in SUCCESS_MESSAGES\n */\n addSuccessMessage(successKey: string) {\n const successMessage = this.SUCCESS_MESSAGES[successKey];\n if (successMessage) {\n this.alert.add({\n text: successMessage,\n type: 'success',\n timeout: 0\n });\n }\n }\n\n /**\n * Returns the current strategy. Defaults to cookie, if a token\n * is found in local or session storage we switch to basic auth.\n * @returns The current auth strategy.\n */\n getAuthStrategy(): IAuthentication {\n let authStrategy = this.cookieAuth as IAuthentication;\n const token = this.getStoredToken();\n const tfa = this.getStoredTfaToken();\n if (token) {\n authStrategy = this.basicAuth;\n this.setCredentials({ token, tfa }, this.basicAuth);\n }\n return authStrategy;\n }\n\n /**\n * Forces the use of basic auth as strategy with this credentials.\n * @param credentials The credentials to use.\n */\n useBasicAuth(credentials: ICredentials) {\n this.setCredentials(credentials, this.basicAuth);\n return this.basicAuth;\n }\n\n /**\n * Tries to login a user with the given credentials.\n * If successful, the current tenant and user is set. If not an error\n * is thrown. It also verifies if the user is allowed to open the\n * current app.\n * @param auth The authentication strategy used.\n * @param credentials The credentials to try to login.\n */\n async login(auth: IAuthentication = this.getAuthStrategy(), credentials?: ICredentials) {\n this.client.setAuth(auth);\n\n const tenantRes = await this.tenant.current();\n const tenant = tenantRes.data;\n\n if (await this.switchLoginMode(credentials)) {\n auth = this.cookieAuth;\n }\n\n const userRes = await this.user.current();\n const user = userRes.data;\n await this.verifyAppAccess();\n\n const supportUserName = this.getSupportUserName(credentials);\n const token = this.setCredentials(\n {\n tenant: tenant.name,\n user: (supportUserName ? `${supportUserName}$` : '') + user.userName\n },\n auth\n );\n\n if (token) {\n this.storeBasicAuthToken(token);\n }\n\n await this.authFulfilled(tenant, user, supportUserName);\n }\n\n /**\n * Saves tenant, user and support user info to the app state.\n * @param tenant The current tenant object.\n * @param user The current user object.\n * @param supportUserName The current support user name.\n */\n async authFulfilled(tenant?, user?, supportUserName?) {\n if (!tenant) {\n const { data } = await this.tenant.current();\n tenant = data;\n this.client.tenant = tenant.name;\n }\n\n if (!user) {\n const { data } = await this.user.current();\n user = data;\n }\n\n if (!supportUserName) {\n supportUserName = null;\n }\n\n this.ui.setUser({ user, supportUserName });\n this.ui.currentTenant.next(tenant);\n }\n\n /**\n * Switch the login mode to CookieAuth if the\n * user has configured to use it in loginOptions.\n * @param credentials The credentials for that login\n */\n async switchLoginMode(credentials?: ICredentials) {\n const isPasswordGrantLogin = this.isPasswordGrantLogin(credentials);\n if (isPasswordGrantLogin && credentials) {\n const params = new URLSearchParams({\n grant_type: 'PASSWORD',\n username: credentials.user,\n password: credentials.password,\n tfa_code: credentials.tfa\n });\n const urlParams = new URLSearchParams(this.loginMode.initRequest.split('?').pop());\n credentials.tenant = urlParams.get('tenant_id');\n const res = await this.client.fetch(`tenant/oauth?${urlParams.toString()}`, {\n method: 'POST',\n body: params.toString(),\n headers: {\n 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8'\n }\n });\n if (!(res as Response).ok) {\n try {\n const data = await res.json();\n throw { res, data };\n } catch (ex) {\n throw ex;\n }\n }\n this.client.setAuth(this.cookieAuth);\n this.cleanLocalStorage();\n this.basicAuth.logout();\n }\n return isPasswordGrantLogin;\n }\n\n isPasswordGrantLogin(credentials?: ICredentials) {\n return !!(\n !this.isSupportUser(credentials) &&\n this.loginMode &&\n this.loginMode.type === this.OAUTH2_INTERNAL_TYPE\n );\n }\n\n /**\n * Verifies if the provided credentials use a support user to log in or not.\n * @param credentials Credentials to check.\n * @returns True if user is a support user.\n */\n isSupportUser(credentials?: ICredentials): boolean {\n return credentials && credentials.user.includes('$');\n }\n\n /**\n * Verifies if the tenant input field should be shown\n * or not.\n * @returns If true, show the tenant input.\n */\n showTenant(): boolean {\n return !this.ui.state.loginOptions || this.isLocal() || this.isShowTenant();\n }\n\n /**\n * Logs the user out\n * @param reload If set to false, the page will not reload\n */\n async logout(reload = true) {\n let resData = null;\n try {\n const [basicRes, cookieRes] = await this.reset();\n resData = await cookieRes.json();\n } catch (ex) {\n this.alert.removeLastDanger();\n } finally {\n if (resData && resData.url) {\n this.redirect(resData.url);\n } else if (reload) {\n this.location.replaceState({}, '', '', '');\n window.location.reload();\n }\n }\n }\n\n /**\n * Resets the stored auth-data\n */\n async reset() {\n this.cleanLocalStorage();\n this.cleanSessionStorage();\n this.realtime.disconnect();\n this.ui.currentUser.next(null);\n return Promise.all([this.basicAuth.logout(), this.cookieAuth.logout()]);\n }\n\n /**\n * Saves the TFA token to local or session storage.\n * @param tfaToken The tfa token to save.\n * @param storage The storage to use (local or session).\n */\n saveTFAToken(tfaToken: string, storage: Storage) {\n storage.setItem(this.TFATOKEN_KEY, tfaToken);\n }\n\n /**\n * Request the manifest -> on 401 user has no access to that application\n * and we throw the error up to the login form.\n */\n async verifyAppAccess() {\n try {\n await this.ui.loadManifest();\n } catch (ex) {\n if (!(ex.res && ex.res.status === 404 && this.isLocal())) {\n throw ex;\n }\n }\n }\n\n /**\n * Sets the tenant to the client and updates the credentials on the\n * auth strategy.\n * @param credentials The name of the tenant.\n * @param authStrategy The authentication strategy used.\n * @return Returns the token if basic auth, otherwise undefined.\n */\n private setCredentials(credentials: ICredentials, authStrategy: IAuthentication) {\n if (credentials.tenant) {\n this.client.tenant = credentials.tenant;\n }\n // Check if a token is already set (case for support user login)\n // if yes -> we just need to update the user, and reuse the token\n // of the support user.\n // Therefore we need to pass user and tenant, to get\n // just the stored token and nothing else (see BasicAuth.ts:31).\n const token = this.basicAuth.updateCredentials({\n tenant: credentials.tenant,\n user: credentials.user\n });\n const newCredentials = { token, ...credentials };\n\n return authStrategy.updateCredentials(newCredentials);\n }\n\n /**\n * Verifies if the current user is a developer or not.\n * Running on localhost means development mode.\n */\n private isLocal(): boolean {\n const hostname = window.location.hostname;\n return this.localhostIpRegExp.test(hostname) || this.localhostRegExp.test(hostname);\n }\n\n /**\n * Save the token to local or session storage.\n * @param token The token to save.\n * @param storage The storage to use (local or session).\n */\n private saveToken(token: string, storage: Storage) {\n storage.setItem(this.TOKEN_KEY, token);\n }\n\n private storeBasicAuthToken(token: string) {\n this.saveToken(token, sessionStorage);\n if (this.rememberMe) {\n this.saveToken(token, localStorage);\n }\n }\n\n private cleanLocalStorage() {\n localStorage.removeItem(this.TOKEN_KEY);\n localStorage.removeItem(this.TFATOKEN_KEY);\n }\n\n private cleanSessionStorage() {\n sessionStorage.removeItem(this.TOKEN_KEY);\n sessionStorage.removeItem(this.TFATOKEN_KEY);\n }\n\n private isShowTenant(): boolean {\n return this.showTenantRegExp.test(window.location.href);\n }\n\n private redirect(url: string) {\n window.location.href = url;\n }\n\n private async getBasicAuthLoginOption(refresh?): Promise<ITenantLoginOption> {\n if (refresh) {\n await this.ui.refreshLoginOptions();\n }\n const loginOptions = this.ui.state.loginOptions || [];\n const basicAuthLoginOption = loginOptions.find(({ type }) => type === 'BASIC');\n return Promise.resolve(basicAuthLoginOption);\n }\n\n /**\n * Gets support user name from credentials.\n * @param credentials Credentials object (defaults to the stored one).\n * @returns Support user name.\n */\n private getSupportUserName(credentials: ICredentials = this.getStoredCredentials()): string {\n if (!credentials) {\n return null;\n }\n const supportUserName = credentials.user.match(/^(.+\\/)?((.+)\\$)?(.+)?$/)[3];\n return supportUserName;\n }\n\n /**\n * Gets credentials object from the stored token.\n * @returns Credentials object.\n */\n private getStoredCredentials(): ICredentials {\n const token = this.getStoredToken();\n if (!token) {\n return null;\n }\n return this.decodeToken(token);\n }\n\n /**\n * Gets stored token from local storage or session storage.\n * @returns Stored token.\n */\n private getStoredToken(): string {\n return localStorage.getItem(this.TOKEN_KEY) || sessionStorage.getItem(this.TOKEN_KEY);\n }\n\n /**\n * Gets stored TFA token from local storage or session storage.\n * @returns Stored TFA token.\n */\n private getStoredTfaToken(): string {\n return localStorage.getItem(this.TFATOKEN_KEY) || sessionStorage.getItem(this.TFATOKEN_KEY);\n }\n\n /**\n * Decodes token to credentials object.\n * @param token Token to decode.\n * @returns Credentials object.\n */\n private decodeToken(token: string): ICredentials {\n const decoded = decodeURIComponent(escape(window.atob(token)));\n const split = decoded.match(/(([^/]*)\\/)?([^/:]+):(.+)/);\n\n return {\n tenant: split[2],\n user: split[3],\n password: split[4]\n };\n }\n}\n","import { Component, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { UserService, ICredentials, FetchClient, Client, IAuthentication } from '@c8y/client';\nimport { AppStateService } from '../common/ui-state.service';\nimport { AlertService } from '../alert/alert.service';\nimport { ModalComponent } from '../modal/modal.component';\nimport { LoginService } from '../login/login.service';\nimport { clone } from 'lodash-es';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-password-confirm-modal',\n templateUrl: './password-confirm-modal.component.html'\n})\nexport class PasswordConfirmModalComponent {\n @Output() passwordConfirmedEmitter = new EventEmitter<boolean>();\n loading = false;\n password: string;\n\n @ViewChild('modal', { static: false }) private modal: ModalComponent;\n\n constructor(\n public user: UserService,\n public ui: AppStateService,\n private client: FetchClient,\n private alert: AlertService,\n private loginService: LoginService\n ) {}\n\n async passwordConfirm() {\n if (this.password) {\n const supportUserName = this.ui.currentSupportUserName.value;\n const userId = this.ui.currentUser.value.id;\n const credentials: ICredentials = {\n password: this.password,\n user: `${supportUserName ? `${supportUserName}$` : ''}${userId}`,\n tenant: this.client.tenant\n };\n try {\n this.loading = true;\n const strategy = clone(this.loginService.useBasicAuth({}));\n delete credentials.tfa;\n strategy.updateCredentials(credentials);\n const newClient = this.createNewClient(strategy, this.client.baseUrl);\n await newClient.user.current();\n this.emitSuccessAndClose();\n } catch (e) {\n if (e.res && e.res.status === 401 && e.data && /pin|totp/i.test(e.data.message)) {\n this.emitSuccessAndClose();\n } else {\n this.alert.danger(gettext(\"Provided password doesn't match your current one.\"));\n }\n } finally {\n this.loading = false;\n }\n }\n }\n\n cancel() {\n this.passwordConfirmedEmitter.emit(false);\n this.modal._dismiss();\n }\n\n createNewClient(strategy: IAuthentication, baseUrl: string) {\n return new Client(strategy, baseUrl);\n }\n\n private emitSuccessAndClose() {\n this.passwordConfirmedEmitter.emit(true);\n this.modal._dismiss();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PasswordStrength } from '@c8y/client';\nimport { filter } from 'lodash-es';\nimport { PasswordStrengthColor } from './password.model';\nimport { gettext } from '../i18n/gettext';\nimport { PasswordConfirmModalComponent } from './password-confirm-modal.component';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { take } from 'rxjs/operators';\n\n@Injectable()\nexport class PasswordService {\n private DEFAULT_PASSWORD_MIN_LENGTH = 8;\n\n private GREEN: PasswordStrengthColor = {\n colorName: 'green',\n color: 'rgb(0, 128, 0)',\n description: gettext('strong'),\n passwordStrength: PasswordStrength.GREEN\n };\n private YELLOW: PasswordStrengthColor = {\n colorName: 'yellow',\n color: 'rgb(255, 204, 51)',\n description: gettext('medium'),\n passwordStrength: PasswordStrength.YELLOW\n };\n private RED: PasswordStrengthColor = {\n colorName: 'red',\n color: 'rgb(170, 0, 51)',\n description: gettext('weak'),\n passwordStrength: PasswordStrength.RED\n };\n\n constructor(private modalService: BsModalService) {}\n\n confirmPassword() {\n const modalInstance: any = this.modalService.show(PasswordConfirmModalComponent);\n return modalInstance.content.passwordConfirmedEmitter.pipe(take(1));\n }\n\n hasLowerCase(password: string) {\n return (password.search(/[a-z]/) !== -1);\n }\n\n hasUpperCase(password: string) {\n return (password.search(/[A-Z]/) !== -1);\n }\n\n hasNumbers(password: string) {\n return (password.search(/[0-9]/) !== -1);\n }\n\n hasSpecialChars(password: string) {\n return (password.search(/[^0-9a-zA-Z]+/) !== -1);\n }\n\n getStrengthColor(password: string): PasswordStrengthColor {\n const passwordStrength = filter([\n this.hasLowerCase(password),\n this.hasUpperCase(password),\n this.hasNumbers(password),\n this.hasSpecialChars(password)\n ]).length;\n\n if (passwordStrength > 3) {\n return this.GREEN;\n } else if (passwordStrength >= 3) {\n return this.YELLOW;\n } else {\n return this.RED;\n }\n }\n\n getDefaultPasswordMinLength() {\n return this.DEFAULT_PASSWORD_MIN_LENGTH;\n }\n}\n","import { Component } from '@angular/core';\nimport { UserService } from '@c8y/client';\nimport { Status } from '../common/status.model';\nimport { gettext } from '../i18n/gettext';\nimport { ModalService } from '../modal/modal.service';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { LoginService } from '../login/login.service';\n\n@Component({\n selector: 'c8y-user-totp-setup',\n templateUrl: './user-totp-setup.component.html'\n})\nexport class UserTotpSetupComponent {\n constructor(\n private user: UserService,\n private modalService: ModalService,\n private modal: BsModalRef,\n private loginService: LoginService) { }\n\n async totpSetupVerified(token) {\n await this.user.activateTotp();\n this.modal.hide();\n try {\n await this.modalService.acknowledge(\n gettext('Logout required'),\n gettext('You must log out in order to apply your changes'),\n Status.WARNING,\n gettext('Log out')\n );\n await this.loginService.logout();\n } catch (ex) {\n // intended empty\n }\n }\n\n close() {\n this.modal.hide();\n }\n}\n","import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\nimport {\n IUser,\n UserService,\n TenantLoginOptionsService,\n TenantService\n} from '@c8y/client';\nimport { clone } from 'lodash-es';\nimport { AppStateService } from '../common/ui-state.service';\nimport { TranslateService } from '../i18n/translate.service';\nimport { NewPassword } from '../authentication/password.model';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { PasswordService } from '../authentication/password.service';\nimport { UserTotpSetupComponent } from './user-totp-setup.component';\nimport { AlertService } from '../alert/alert.service';\nimport { ModalService } from '../modal/modal.service';\n\nexport interface User extends IUser {\n phone: string;\n sendPasswordResetEmail: boolean;\n newsletter?: boolean;\n}\n\n@Component({\n selector: 'c8y-user-edit',\n templateUrl: './user-edit.component.html'\n})\nexport class UserEditComponent implements OnInit {\n @Input() lang: string;\n @Input() loading: boolean = false;\n @Input() set user(u: User) {\n this._user = clone(u);\n this.userIsExternal = u.customProperties.userOrigin === 'OAUTH2';\n this.isPhoneRequired = this.isPhoneRequired && u.twoFactorAuthenticationEnabled;\n }\n get user() { return this._user; }\n @Output() onUser: EventEmitter<User> = new EventEmitter();\n @Output() onLanguage: EventEmitter<string> = new EventEmitter();\n @Output() onCancel: EventEmitter<void> = new EventEmitter();\n userHasActiveTotp = false;\n userCanSetupTotp = false;\n isPhoneRequired = false;\n userIsExternal;\n isTfaEnabled: boolean;\n private _user: User;\n\n constructor(\n public state: AppStateService,\n public translate: TranslateService,\n public passwordService: PasswordService,\n public modalConfirmService: ModalService,\n private bsModalService: BsModalService,\n private alert: AlertService,\n private userService: UserService,\n private tenantLoginOptionsService: TenantLoginOptionsService,\n private tenantService: TenantService,\n ) {}\n\n async ngOnInit() {\n const currentTenant = (await this.tenantService.current()).data;\n const { enabledOnSystemLevel, enabledOnTenantLevel } = await this.tenantService.getTfaSettings(currentTenant);\n this.isTfaEnabled = enabledOnSystemLevel || enabledOnTenantLevel;\n\n await this.initializeTotpSettings();\n if (this.user.twoFactorAuthenticationEnabled && !this.userCanSetupTotp) {\n this.isPhoneRequired = true;\n }\n }\n\n get langs() {\n return this.state.state.langs;\n }\n\n setupTotp() {\n this.bsModalService.show(UserTotpSetupComponent, { class: 'modal-sm' });\n this.cancel(); // to close the user edit modal and prevent console errors on logout\n }\n\n cancel() {\n this.onCancel.emit();\n }\n\n save() {\n if (!this.loading) {\n this._user.password ? this.saveAfterPasswordConfirmation() : this.onUser.emit(this._user);\n }\n }\n\n onNewPasswordChanged(newPassword: NewPassword) {\n this._user.password = newPassword.password;\n }\n\n private async initializeTotpSettings() {\n try {\n this.userCanSetupTotp = await this.canUserSetupTotp();\n if (this.userCanSetupTotp) {\n const { data: totpActivity } = await this.userService.getActivityTotp();\n this.userHasActiveTotp = totpActivity.isActive;\n }\n } catch (ex) {\n this.alert.removeLastDanger();\n }\n }\n\n private async canUserSetupTotp() {\n // we don't check for tenant options here due to permission restrictions on that end-point\n const { loginOptions } = (await this.tenantLoginOptionsService.detail()).data;\n return loginOptions.some(({ tfaStrategy = '' }) => tfaStrategy.toLowerCase() === 'totp');\n }\n\n private saveAfterPasswordConfirmation() {\n this.passwordService.confirmPassword().subscribe((confirmed) => {\n if (confirmed) {\n this.onUser.emit(this._user);\n }\n });\n }\n}\n","import { Component, Input } from '@angular/core';\nimport { TenantService, UserService } from '@c8y/client';\n\nimport { AlertService } from '../alert/alert.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { LoginService } from '../login/login.service';\nimport { ModalService } from '../modal/modal.service';\nimport { Observable } from 'rxjs';\nimport { OptionsService } from '../common/options.service';\nimport { Status } from '../common/status.model';\nimport { TranslateService } from '@ngx-translate/core';\nimport { UserEditModalComponent } from './user-edit-modal.component';\nimport { UserMenuItem } from './user.model';\nimport { gettext } from '../i18n/gettext';\nimport { map } from 'rxjs/operators';\nimport { sortBy } from 'lodash-es';\n\n@Component({\n selector: 'c8y-user-menu-outlet',\n templateUrl: './user-menu-outlet.component.html'\n})\nexport class UserMenuOutletComponent {\n @Input()\n items: UserMenuItem[];\n open: boolean;\n\n constructor(\n public ui: AppStateService,\n private bsModalService: BsModalService,\n private modalService: ModalService,\n private loginService: LoginService,\n private translateService: TranslateService,\n private tenantService: TenantService,\n private alertService: AlertService,\n private user: UserService,\n private optionsService: OptionsService\n ) {}\n\n copyIt(text: string) {\n const handler: EventListenerObject = {\n handleEvent: (e: ClipboardEvent) => {\n e.clipboardData.setData('text/plain', text);\n e.preventDefault();\n }\n };\n document.addEventListener('copy', handler);\n\n let copied;\n try {\n copied = document.execCommand('copy');\n } catch (e) {\n copied = false;\n }\n\n if (copied) {\n this.alertService.addByText('success', gettext('Copied to clipboard.'));\n } else {\n this.alertService.addByText('danger', gettext('Could not copy to clipboard.'));\n }\n\n document.removeEventListener('copy', handler);\n }\n\n async editUser() {\n this.bsModalService.show(UserEditModalComponent);\n }\n\n async logout() {\n await this.loginService.logout();\n }\n\n async activateSupportAccess() {\n const title = gettext('Activate support user access');\n\n const companyName = this.optionsService.get('companyName', 'Cumulocity');\n const textWithCompany = gettext(\n // tslint:disable-next-line:max-line-length\n 'You are about to allow a support user from {{companyName}} to access your tenant to help you with your issue.'\n );\n const textWithoutCompany = gettext(\n // tslint:disable-next-line:max-line-length\n 'You are about to allow a support user to access your tenant to help you with your issue.'\n );\n const finalQuestion = gettext('Do you want to proceed?');\n const body = [\n this.translateService.instant(companyName ? textWithCompany : textWithoutCompany, {\n companyName\n }),\n this.translateService.instant(finalQuestion)\n ].join(' ');\n\n const labels = {\n ok: gettext('Activate access'),\n cancel: gettext('Cancel')\n };\n\n const successMsg = gettext('Support user access activated.');\n\n try {\n await this.modalService.confirm(title, body, Status.DANGER, labels);\n await this.tenantService.enableSupportUser();\n await this.refreshCurrentUser();\n this.alertService.success(successMsg);\n } catch (ex) {\n // intended empty\n }\n }\n\n async deactivateSupportAccess() {\n const title = gettext('Deactivate support user access');\n\n const companyName = this.optionsService.get('companyName', 'Cumulocity');\n const textWithCompany = gettext(\n // tslint:disable-next-line:max-line-length\n 'You are about to block a support user from {{companyName}} from accessing your tenant to help you with your issue.'\n );\n const textWithoutCompany = gettext(\n // tslint:disable-next-line:max-line-length\n 'You are about to block a support user from accessing your tenant to help you with your issue.'\n );\n const { data: currentUser } = await this.user.current();\n const isTenantAdmin = await this.user.hasRole(currentUser, 'ROLE_TENANT_ADMIN');\n const tenantAdminNote = gettext(\n // tslint:disable-next-line:max-line-length\n 'Deactivating support access as tenant admin will disable all other support requests on your tenant.'\n );\n const finalQuestion = gettext('Do you want to proceed?');\n const body = [\n this.translateService.instant(companyName ? textWithCompany : textWithoutCompany, {\n companyName\n }),\n isTenantAdmin ? this.translateService.instant(tenantAdminNote) : '',\n this.translateService.instant(finalQuestion)\n ]\n .filter(Boolean)\n .join(' ');\n\n const labels = {\n ok: gettext('Deactivate access'),\n cancel: gettext('Cancel')\n };\n\n const successMsg = gettext('Support user access deactivated.');\n\n try {\n await this.modalService.confirm(title, body, Status.DANGER, labels);\n await this.tenantService.disableSupportUser();\n await this.refreshCurrentUser();\n this.alertService.success(successMsg);\n } catch (ex) {\n // intended empty\n }\n }\n\n getSortedItems() {\n return sortBy(Array.from(this.items), this.byPriority);\n }\n\n private async refreshCurrentUser() {\n const currentUserResult = await this.user.current();\n this.ui.currentUser.next(currentUserResult.data);\n }\n\n private byPriority(item) {\n return -item.priority;\n }\n}\n","import { Component, OnInit, Input } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { PasswordService } from './password.service';\nimport { LoginService } from '../login/login.service';\nimport { assign, map } from 'lodash-es';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-password-check-list',\n templateUrl: './password-check-list.component.html',\n styles: []\n})\n\nexport class PasswordCheckListComponent implements OnInit {\n\n @Input('password')\n set password(password: string) {\n if (typeof password === 'string') {\n this.onPasswordChange(password);\n }\n }\n\n minGreenLength: number = 0;\n\n checklist = [\n {\n label: gettext('Include lowercase characters (e.g. abcdef)'),\n check: this.passwordStrengthChecker.hasLowerCase,\n icon: '',\n contextualColor: ''\n\n },\n {\n label: gettext('Include uppercase characters (e.g. ABCDEF)'),\n check: this.passwordStrengthChecker.hasUpperCase,\n icon: '',\n contextualColor: ''\n },\n {\n label: gettext('Include numbers (e.g. 123456)'),\n check: this.passwordStrengthChecker.hasNumbers,\n icon: '',\n contextualColor: ''\n },\n {\n label: gettext('Include symbols (e.g. !@#$%^)'),\n check: this.passwordStrengthChecker.hasSpecialChars,\n icon: '',\n contextualColor: ''\n },\n {\n label: gettext('Must have at least {{length}} characters'),\n check: (password) => password.length >= this.minGreenLength,\n icon: '',\n contextualColor: ''\n }\n ];\n\n constructor(\n public loginService: LoginService,\n private passwordStrengthChecker: PasswordService,\n private passwordService: PasswordService\n ) { }\n\n async ngOnInit() {\n this.minGreenLength = await this.loginService.getGreenMinLength();\n if (!this.minGreenLength) {\n this.minGreenLength = this.passwordService.getDefaultPasswordMinLength();\n }\n }\n\n get translateParams() {\n return {\n length: this.minGreenLength\n };\n }\n\n onPasswordChange(password) {\n this.checklist = map(this.checklist, (requirement) => {\n const checked = requirement.check(password);\n assign(requirement, {\n icon: checked ? 'check-circle' : '',\n contextualColor: checked ? '' : 'text-muted'\n });\n return requirement;\n });\n }\n}\n","import { Directive, forwardRef, Attribute } from '@angular/core';\r\nimport { NG_VALIDATORS, Validator, AbstractControl } from '@angular/forms';\r\n\r\n@Directive({\r\n selector: '[passwordConfirm]',\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: PasswordConfirm,\r\n multi: true\r\n }\r\n ]\r\n})\r\n\r\nexport class PasswordConfirm implements Validator {\r\n\r\n constructor(@Attribute('passwordConfirm') public passwordConfirm: string) {\r\n }\r\n\r\n validate(abControl: AbstractControl): { [key: string]: any } {\r\n const value = abControl.value;\r\n const controlToCompareWith = abControl.root.get(this.passwordConfirm);\r\n if (controlToCompareWith && value !== controlToCompareWith.value) {\r\n return { passwordConfirm: true };\r\n }\r\n return null;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\nimport { PasswordStrength } from '@c8y/client';\nimport { filter } from 'lodash-es';\nimport { PasswordStrengthColor } from './password.model';\nimport { gettext } from '../i18n/gettext';\n\n@Injectable()\nexport class PasswordStrengthCheckerService {\n\n private GREEN: PasswordStrengthColor = {\n colorName: 'green',\n color: 'rgb(0, 128, 0)',\n description: gettext('strong'),\n passwordStrength: PasswordStrength.GREEN\n };\n private YELLOW: PasswordStrengthColor = {\n colorName: 'yellow',\n color: 'rgb(255, 204, 51)',\n description: gettext('medium'),\n passwordStrength: PasswordStrength.YELLOW\n };\n private RED: PasswordStrengthColor = {\n colorName: 'red',\n color: 'rgb(170, 0, 51)',\n description: gettext('weak'),\n passwordStrength: PasswordStrength.RED\n };\n\n hasLowerCase(password: string) {\n return (password.search(/[a-z]/) !== -1);\n }\n\n hasUpperCase(password: string) {\n return (password.search(/[A-Z]/) !== -1);\n }\n\n hasNumbers(password: string) {\n return (password.search(/[0-9]/) !== -1);\n }\n\n hasSpecialChars(password: string) {\n return (password.search(/[^0-9a-zA-Z]+/) !== -1);\n }\n\n getStrengthColor(password: string): PasswordStrengthColor {\n const passwordStrength = filter([\n this.hasLowerCase(password),\n this.hasUpperCase(password),\n this.hasNumbers(password),\n this.hasSpecialChars(password)\n ]).length;\n\n if (passwordStrength > 3) {\n return this.GREEN;\n } else if (passwordStrength >= 3) {\n return this.YELLOW;\n } else {\n return this.RED;\n }\n }\n}\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { PasswordService } from './password.service';\n\n@Component({\n selector: 'c8y-password-strength',\n templateUrl: './password-strength.component.html'\n})\n\nexport class PasswordStrengthComponent {\n\n @Input('password')\n set password(password: string) {\n if (typeof password === 'string') {\n this.model = this.passwordStrengthCheckerService.getStrengthColor(password);\n this.strength.emit(this.model);\n }\n }\n @Output()\n strength = new EventEmitter();\n\n model;\n\n constructor(private passwordStrengthCheckerService: PasswordService) {\n this.password = '';\n }\n}\n","import { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { NewPassword } from './password.model';\nimport { ControlContainer, NgForm } from '@angular/forms';\nimport { LoginService } from '../login/login.service';\n\n@Component({\n selector: 'c8y-new-password',\n templateUrl: './new-password.component.html',\n viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]\n})\nexport class NewPasswordComponent implements OnInit {\n @Output() password = new EventEmitter<NewPassword | {}>();\n model: any = {};\n changePassword: boolean = false;\n passwordEnforced: boolean = false;\n minlength: number;\n\n constructor(\n private loginService: LoginService\n ) {\n }\n\n ngOnInit() {\n this.loadPasswordStrengthSettings();\n this.loginService.getGreenMinLength().then(value => {\n this.minlength = value;\n });\n }\n\n newPasswordChanged() {\n this.password.emit({\n password: this.model.newPassword,\n passwordStrength: this.model.strength\n });\n }\n\n async loadPasswordStrengthSettings() {\n this.passwordEnforced = await this.loginService.getPasswordStrengthEnforced({ refresh: true });\n }\n\n showPasswordStrength() {\n return this.model.newPassword && this.model.newPassword.length >= this.minlength;\n }\n\n toggleChangePassword() {\n this.changePassword = !this.changePassword;\n if (!this.changePassword) {\n this.password.emit({});\n this.model = {};\n }\n }\n}\n","import { NG_VALIDATORS, AbstractControl, Validator } from '@angular/forms';\nimport { Directive } from '@angular/core';\nimport { parsePhoneNumberFromString } from 'libphonenumber-js/max';\n\n@Directive({\n selector: '[c8yPhoneValidation]',\n providers: [{provide: NG_VALIDATORS, useExisting: PhoneValidationDirective, multi: true}]\n})\nexport class PhoneValidationDirective implements Validator {\n\n validate(control: AbstractControl): {[key: string]: any} | null {\n const valid = this.validateInternationalPhoneNumber(control);\n return valid ? null : {\n internationalPhoneNumber: true\n };\n }\n\n private validateInternationalPhoneNumber(control: AbstractControl) {\n let numberValid;\n try {\n const phoneNumber = parsePhoneNumberFromString(control.value);\n numberValid = phoneNumber.isValid();\n if (numberValid && control.value !== phoneNumber.format('E.164')) {\n control.setValue(phoneNumber.format('E.164'), { emitEvent: false, emitModelToViewChange: false });\n }\n } catch (e) {\n numberValid = !control.value;\n }\n return numberValid;\n }\n}\n","// tslint:disable: max-line-length\nimport { gettext } from '../i18n/gettext';\n\nexport interface ValidationRules {\n pattern?: RegExp;\n message?: string;\n maxLength?: number;\n minLength?: number;\n}\n\n// @dynamic\nexport class ValidationPattern {\n static readonly messages = {\n deviceId: gettext('Device ID must not contain spaces or slashes (\"/\").'),\n domain: gettext(\n 'Only lowercase letters, digits and hyphens allowed in the first part of the URI. ' +\n 'Must start with a letter; hyphens only allowed in the middle. Must be a valid URI.'\n ),\n email: gettext('Invalid email address.'),\n internationalPhoneNumber: gettext(\n 'International phone number required, in the format +49 9 876 543 210.'\n ),\n loginAlias: gettext(\n 'Login alias must not contain slashes (\"/\", \"\\\\\") nor (\"+\"), (\":\"), (\"$\") signs.'\n ),\n max : gettext('Max value: {{ value }}'),\n min : gettext('Min value: {{ value }}'),\n opcuaBrowsePath: gettext('Invalid OPC UA URI.'),\n password: gettext(\n 'Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:\\'\",.<>{}[]\\\\/'\n ),\n passwordConfirm: gettext('Passwords do not match.'),\n passwordStrength: gettext('Password not good enough, password must be stronger (green).'),\n phoneNumber: gettext(\n 'Invalid phone number format. Only digits, spaces, slashes (\"/\") and dashes (\"-\") allowed.'\n ),\n required: gettext('This field is required.'),\n tenantId: gettext(\n 'May contain lowercase letters, digits, and hyphens. ' +\n 'Must start with a letter; hyphens only allowed in the middle; minimum 2 characters.'\n ),\n urlSegment: gettext('Slash, single or double dots and white space not allowed'),\n user: gettext(\n 'Username must not contain spaces nor slashes (\"/\", \"\\\\\") nor (\"+\"), (\":\"), (\"$\") signs.'\n )\n };\n\n static readonly rules = {\n deviceId: {\n pattern: /^[^\\s/]*$/\n },\n domain: {\n pattern: /^[a-z]+[a-z0-9-]*[a-z0-9]+\\.{1}.+$/\n },\n groupName: {\n maxLength: 254\n },\n hostname: {\n pattern: /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/\n },\n ip: {\n pattern: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/\n },\n opcuaBrowsePath: {\n pattern: /^(opc.tcp|http|https):\\/\\/[^ \"]+$/\n },\n password: {\n pattern: /^[a-zA-Z0-9`~!@#$%^&*()_|+\\-=?;:'\",.<>{}[\\]\\\\/]{8,32}$/\n },\n phoneNumber: {\n pattern: /^$|^(\\+|0{2})[\\d\\s/-]{1,30}$/\n },\n tenantId: {\n pattern: /^[a-z]+[a-z0-9-]*[a-z0-9]+$/\n },\n user: {\n pattern: /^[^\\\\/\\s$:+]*$/\n },\n urlSegment: {\n pattern: /^(([.]{1,2})|([/])+|(([/]*)([.]{1,2})([/]*))|((.*)([/]|[ ]+)(.*))|(\\s+))$/\n },\n loginAlias: {\n pattern: /^[^\\\\/$:+]*$/\n }\n };\n\n static get(key: string) {\n const pattern = this.rules[key];\n return pattern as ValidationRules;\n }\n}\n","import { NG_VALIDATORS, AbstractControl, Validator } from '@angular/forms';\nimport { Directive, Input } from '@angular/core';\nimport { ValidationPattern } from './validation-pattern';\n\n@Directive({\n selector: '[c8yDefaultValidation]',\n providers: [{provide: NG_VALIDATORS, useExisting: DefaultValidationDirective, multi: true}]\n})\nexport class DefaultValidationDirective implements Validator {\n @Input() c8yDefaultValidation: string = '';\n\n validate(control: AbstractControl): {[key: string]: any} | null {\n if (!control.value) {\n return null;\n }\n const validation = ValidationPattern.get(this.c8yDefaultValidation);\n if (!validation) {\n throw new Error(`Pattern ${this.c8yDefaultValidation} not found.`);\n }\n\n let valid = true;\n if (validation.pattern) {\n valid = validation.pattern.test(control.value);\n }\n if (validation.maxLength) {\n valid = control.value.length < validation.maxLength;\n }\n if (validation.minLength) {\n valid = control.value.length >= validation.minLength;\n }\n return valid ? null : {[this.c8yDefaultValidation]: true };\n }\n}\n","import { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\nimport { Directive, ElementRef, Input } from '@angular/core';\n\nimport { isUndefined } from 'lodash-es';\n\n@Directive({\n selector: '[min]',\n providers: [{provide: NG_VALIDATORS, useExisting: MinValidationDirective, multi: true}]\n})\nexport class MinValidationDirective implements Validator {\n @Input() min: string = '';\n\n validate(control: AbstractControl): {[key: string]: any} | null {\n const parsedMin = parseInt(this.min, 10);\n if (isUndefined(control.value) || !this.min) {\n return null;\n }\n\n let valid = true;\n valid = (control.value !== null) ? !(control.value < parsedMin) : true;\n return valid ? null : {min: { value: parsedMin } };\n }\n}\n","import { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\nimport { Directive, Input } from '@angular/core';\n\nimport { isUndefined } from 'lodash-es';\n\n@Directive({\n selector: '[max]',\n providers: [{provide: NG_VALIDATORS, useExisting: MaxValidationDirective, multi: true}]\n})\nexport class MaxValidationDirective implements Validator {\n @Input() max: string = '';\n\n validate(control: AbstractControl): {[key: string]: any} | null {\n const parsedMax = parseInt(this.max, 10);\n if (isUndefined(control.value) || !this.max) {\n return null;\n }\n\n let valid = true;\n valid = !(control.value > parsedMax);\n return valid ? null : {max: { value: parsedMax } };\n }\n}\n","import { Directive, Input } from '@angular/core';\n\n@Directive({\n selector: 'c8y-message',\n})\nexport class MessageDirective {\n @Input() name: string;\n @Input() text: string;\n}\n","import { Component, ContentChildren, Input, QueryList } from '@angular/core';\n\nimport { MessageDirective } from './message.directive';\nimport { ValidationPattern } from './validation-pattern';\nimport { isFunction } from 'lodash-es';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Component({\n selector: 'c8y-messages',\n templateUrl: './messages.component.html'\n})\nexport class MessagesComponent {\n @Input() show: {} = {};\n @Input() defaults: {} = ValidationPattern.messages;\n @ContentChildren(MessageDirective) customMessages: QueryList<MessageDirective>;\n messages = [];\n messageMap: any = {};\n\n constructor(private translateService: TranslateService) {}\n\n ngAfterContentInit(): void {\n this.messageMap = Object.assign({}, this.defaults, this.customMessages.reduce((messages, directive) => {\n messages[directive.name] = directive.text;\n return messages;\n }, {}));\n }\n\n changVisibility(show: {}) {\n this.show = show;\n this.ngOnChanges();\n }\n\n ngOnChanges() {\n if (this.show) {\n this.messages = Object.keys(this.show)\n .map((key) => this.toMessage(key, this.show[key]));\n } else {\n this.messages = [];\n }\n }\n\n private toMessage(key, value) {\n return this.translateService.instant(this.messageMap[key], value);\n }\n}\n","import { Component, ContentChild, HostBinding, Input } from '@angular/core';\nimport { NgModel } from '@angular/forms';\nimport { Subscription, timer, merge } from 'rxjs';\nimport { debounce, filter } from 'rxjs/operators';\nimport { MessagesComponent } from './messages.component';\n/**\n * A form group helps to validate an input of a form element.\n *\n * ## Example:\n *\n * ```html\n * <c8y-form-group [hasWarning]=\"user.email.length === 0\">\n * <label translate for=\"userEmail\">Email</label>\n * <input\n * id=\"userEmail\"\n * class=\"form-control\"\n * type=\"email\"\n * name=\"email\"\n * [maxlength]=\"254\"\n * autocomplete=\"off\"\n * placeholder=\"{{'e.g. joe.doe@example.com' | translate}}\"\n * [(ngModel)]=\"user.email\"\n * email\n * required\n * >\n * <c8y-messages>\n * <c8y-message *ngIf=\"user.email.length === 0\" translate></c8y-message>\n * <c8y-message name=\"required\" text=\"The E-Mail is SUPER required\"></c8y-message>\n * </c8y-messages>\n * </c8y-form-group>\n * ```\n *\n * @param status The current status could be error, warning or success.\n * @param hasError Set this to true to display a error.\n * @param hasWarning Set this to true to display a warning.\n * @param hasSuccess Set this to true to display a success.\n * @param novalidation Set this to true to disable automatic validation by this component.\n */\n@Component({\n selector: 'c8y-form-group',\n templateUrl: './form-group.component.html',\n host: {\n class: 'form-group'\n }\n})\nexport class FormGroupComponent {\n @Input() hasError = false;\n @Input() hasWarning = false;\n @Input() hasSuccess = false;\n @Input() novalidation = false;\n @Input() status: string;\n @HostBinding('class.has-error') get error() {\n return this.status === 'error' || this.hasError;\n }\n @HostBinding('class.has-warning') get warning() {\n return this.status === 'warning' || this.hasWarning;\n }\n @HostBinding('class.has-success') get success() {\n return this.status === 'success' || this.hasSuccess;\n }\n @ContentChild(MessagesComponent, { static: false }) customErrorMessage: MessagesComponent;\n @ContentChild(NgModel, { static: true }) model: NgModel;\n\n errors: {};\n private subscription: Subscription;\n private readonly VALIDATION_DEBOUNCE_MS = 1000;\n\n ngAfterContentInit(): void {\n this.initNgModel();\n }\n\n initNgModel() {\n if (this.model) {\n this.model.valueAccessor.registerOnTouched(() => {\n if (this.model.control && !this.model.control.dirty) {\n this.model.control.markAsDirty();\n this.model.control.updateValueAndValidity({onlySelf: true});\n }\n });\n this.subscription = merge(this.model.valueChanges, this.model.statusChanges)\n .pipe(\n filter(() => this.model.dirty && !this.novalidation),\n debounce(() => (this.hasError ? timer(10) : timer(this.VALIDATION_DEBOUNCE_MS)))\n )\n .subscribe(() => this.update());\n }\n }\n\n update() {\n this.hasError = this.model.status === 'INVALID';\n if (this.customErrorMessage) {\n this.customErrorMessage.changVisibility(this.model.errors);\n } else {\n this.errors = this.model.errors;\n }\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n}\n","import {\n Component,\n Input,\n Output,\n QueryList,\n TemplateRef,\n ContentChild,\n EventEmitter\n} from '@angular/core';\n\n@Component({\n selector: 'c8y-input-group-list',\n templateUrl: 'input-group-list.component.html'\n})\nexport class InputGroupListComponent {\n @Input() plus: boolean = true;\n @Input() minus: boolean = true;\n @Input() index: number;\n\n @Output() onRemove: EventEmitter<number> = new EventEmitter<number>();\n @Output() onAdd: EventEmitter<number> = new EventEmitter<number>();\n add() {\n this.onAdd.emit(this.index);\n }\n\n remove() {\n this.onRemove.emit(this.index);\n }\n}\n","import {\n Directive,\n Input,\n Output,\n QueryList,\n AfterContentInit,\n ContentChildren,\n EventEmitter\n} from '@angular/core';\nimport { map } from 'lodash-es';\nimport { InputGroupListComponent } from './input-group-list.component';\n\n@Directive({\n selector: '[c8yInputGroupListContainer]'\n})\nexport class InputGroupListContainerDirective implements AfterContentInit {\n @ContentChildren(InputGroupListComponent) listProjections: QueryList<InputGroupListComponent>;\n\n ngAfterContentInit() {\n this.listProjections.map(element => {\n if (element !== this.listProjections.last) {\n setTimeout(() => {\n element.plus = false;\n });\n }\n });\n\n this.listProjections.changes.subscribe(elements => {\n if (elements.length === 1) {\n setTimeout(() => {\n elements.first.plus = true;\n elements.first.minus = false;\n });\n\n return;\n }\n elements.map(element => {\n setTimeout(() => {\n element.minus = true;\n });\n\n if (element !== elements.last) {\n setTimeout(() => {\n element.plus = false;\n });\n }\n if (element === elements.last) {\n setTimeout(() => {\n element.plus = true;\n });\n }\n });\n });\n }\n}\n","import { Directive, EventEmitter, Output, OnInit, OnDestroy } from '@angular/core';\nimport { NgControl, AbstractControl } from '@angular/forms';\n\nimport { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators';\nimport { Subscription } from 'rxjs';\nimport { gettext } from '../i18n/index';\n\n@Directive({\n selector: 'textarea[prettyValidJson]'\n})\nexport class JsonValidationPrettifierDirective implements OnInit, OnDestroy {\n @Output() invalidJSON: EventEmitter<string> = new EventEmitter();\n private abstractCtrl: AbstractControl;\n private message: string = gettext('Must be a valid JSON object.');\n private debounceTimeInMs: number = 1000;\n private subscription: Subscription;\n\n constructor(ngCtrl: NgControl) {\n this.abstractCtrl = ngCtrl.control;\n }\n\n ngOnInit() {\n this.subscription = this.abstractCtrl.valueChanges\n .pipe(\n tap(() => this.clearValidationMessage()),\n debounceTime(this.debounceTimeInMs),\n distinctUntilChanged()\n )\n .subscribe(value => {\n this.validateInputAndPrettify(value);\n });\n }\n\n ngOnDestroy() {\n if (this.subscription && !this.subscription.closed) {\n this.subscription.unsubscribe();\n }\n }\n\n validateInputAndPrettify(value) {\n if (value) {\n try {\n const validJsonObject = JSON.parse(value);\n const pretty = JSON.stringify(validJsonObject, undefined, 2);\n this.abstractCtrl.setValue(pretty);\n } catch (ex) {\n this.setErrorAndValidationMessage();\n }\n }\n }\n\n private setErrorAndValidationMessage() {\n this.abstractCtrl.setErrors({ invalidBodyTemplate: true });\n this.invalidJSON.emit(this.message);\n }\n\n private clearValidationMessage() {\n this.invalidJSON.emit(undefined);\n }\n}\n","import { Directive, ElementRef, Input, HostBinding, Renderer2 } from '@angular/core';\n\n@Directive({\n selector: 'textarea[heightPerRow]'\n})\nexport class TextAreaRowHeightDirective {\n @Input()\n @HostBinding('rows')\n rows: number = 1;\n\n @Input('heightPerRow')\n heightPerRow: string;\n\n private minHeightPerRow = 20;\n\n constructor(private elem: ElementRef, private renderer: Renderer2) {}\n\n ngAfterViewInit() {\n const convertedValue = Number(this.heightPerRow);\n if (this.heightPerRow && convertedValue && convertedValue > this.minHeightPerRow) {\n this.setHeight(`${this.rows * convertedValue}px`);\n } else {\n this.setHeight(`${this.rows * this.minHeightPerRow}px`);\n }\n }\n\n private setHeight(value: string) {\n this.renderer.setStyle(this.elem.nativeElement, 'height', value);\n }\n}\n","import { Directive, ElementRef, Renderer2, AfterViewChecked } from '@angular/core';\nimport { gettext } from '../i18n/gettext';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Directive({\n selector: 'input[required]'\n})\nexport class RequiredInputPlaceholderDirective implements AfterViewChecked {\n private shouldSkipRequiredHint: boolean = false;\n private placeholder: string;\n private req: boolean;\n constructor(\n private el: ElementRef,\n private renderer: Renderer2,\n private translationService: TranslateService\n ) {\n this.shouldSkipRequiredHint = !!this.el.nativeElement.closest('[placeholder-no-required-hint]');\n }\n\n ngAfterViewChecked(): void {\n if (this.el && this.el.nativeElement && this.el.nativeElement.required !== undefined) {\n const required = this.el.nativeElement.required && !this.shouldSkipRequiredHint;\n const placeholder = this.el.nativeElement.placeholder;\n\n if (this.placeholder !== placeholder || this.req !== required) {\n this.updatePlaceholder(this.getTextForPlaceholder(placeholder, required));\n }\n }\n }\n\n private getTextForPlaceholder(placeholder = '', required = false) {\n this.req = required;\n const requiredText = `(${this.translationService.instant(gettext('required'))})`;\n const requiredTextIndex = placeholder.lastIndexOf(requiredText);\n if (requiredTextIndex > 0) {\n placeholder = placeholder.slice(0, requiredTextIndex - 1);\n }\n if (requiredTextIndex === 0) {\n placeholder = '';\n }\n if (!required) {\n return placeholder;\n }\n return placeholder.trim() ? `${placeholder} ${requiredText}` : requiredText;\n }\n\n private updatePlaceholder(placeholder) {\n this.renderer.setAttribute(this.el.nativeElement, 'placeholder', placeholder);\n this.placeholder = placeholder;\n }\n}\n","import { Component, Input, OnChanges } from '@angular/core';\nimport { cloneDeep } from 'lodash-es';\nimport { Observable, of } from 'rxjs';\n\n@Component({\n selector: 'c8y-ip-range-input-list',\n templateUrl: './ip-range-input-list.component.html'\n})\nexport class IpRangeInputListComponent {\n @Input()\n set data(list) {\n this.ipRangeList = list;\n if (this.ipRangeList.length === 0) {\n this.add();\n }\n }\n\n get data() {\n return this.ipRangeList;\n }\n\n ipRangeList: Array<{ ip: string; cidr: number }>;\n\n add() {\n this.ipRangeList.push({ ip: '', cidr: undefined });\n }\n\n remove(index) {\n this.ipRangeList.splice(index, 1);\n }\n}\n","import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';\nimport { Subject, timer } from 'rxjs';\nimport { debounce, distinctUntilChanged, map } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-filter',\n templateUrl: './filter-input.component.html'\n})\nexport class FilterInputComponent implements OnInit, OnDestroy {\n @Input() icon: string;\n @Output() onSearch = new EventEmitter<string>();\n filterChange$ = new Subject();\n filterTerm: string = '';\n private readonly CARRIAGE_RETURN_KEY = 13;\n private readonly CARRIAGE_RETURN_CODE = 'Enter';\n\n ngOnInit() {\n this.reset();\n this.filterChange$\n .pipe(\n debounce((event: any) =>\n event.code === this.CARRIAGE_RETURN_CODE || event.keyCode === this.CARRIAGE_RETURN_KEY\n ? timer(10)\n : timer(300)\n ),\n map((e: any) => e.target.value),\n distinctUntilChanged()\n )\n .subscribe(filterTerm => {\n this.filterTerm = filterTerm;\n this.onSearch.emit(filterTerm);\n });\n }\n\n reset() {\n this.filterTerm = '';\n this.onSearch.emit('');\n }\n\n ngOnDestroy(): void {\n this.filterChange$.complete();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PhoneValidationDirective } from './phone-validation.directive';\nimport { DefaultValidationDirective } from './default-validation.directive';\nimport { MinValidationDirective } from './min-validation.directive';\nimport { MaxValidationDirective } from './max-validation.directive';\nimport { CommonModule } from '../common/common.module';\nimport { FormsModule as NgFormsModule } from '@angular/forms';\nimport { FormGroupComponent } from './form-group.component';\nimport { MessageDirective } from './message.directive';\nimport { MessagesComponent } from './messages.component';\nimport { InputGroupListComponent } from './input-group-list.component';\nimport { InputGroupListContainerDirective } from './input-group-list-container.directive';\nimport { JsonValidationPrettifierDirective } from './json-validation-prettifier.directive';\nimport { TextAreaRowHeightDirective } from './text-area-row-height.directive';\nimport { RequiredInputPlaceholderDirective } from './required-input-placeholder.directive';\nimport { IpRangeInputListComponent } from './ip-range-input-list.component';\nimport { FilterInputComponent } from './filter-input.component';\n\n/**\n * @exports FormGroupComponent A component that allows to group an input and can display warnings and errors.\n * @exports PhoneValidationDirective Allows to validate international phone numbers.\n * @exports NewsletterDirective Allows to subscribe to the newsletter.\n * @exports DefaultValidationDirective Allows to validate some predefined patterns.\n * @exports MessageDirective A directive that allows to define messages.\n * @exports MessagesComponent Allows to display error messages.\n */\n@NgModule({\n imports: [CommonModule, NgFormsModule],\n exports: [\n PhoneValidationDirective,\n DefaultValidationDirective,\n MinValidationDirective,\n MaxValidationDirective,\n NgFormsModule,\n FormGroupComponent,\n MessageDirective,\n MessagesComponent,\n InputGroupListComponent,\n InputGroupListContainerDirective,\n JsonValidationPrettifierDirective,\n TextAreaRowHeightDirective,\n RequiredInputPlaceholderDirective,\n IpRangeInputListComponent,\n FilterInputComponent\n ],\n declarations: [\n PhoneValidationDirective,\n DefaultValidationDirective,\n MinValidationDirective,\n MaxValidationDirective,\n FormGroupComponent,\n MessageDirective,\n MessagesComponent,\n InputGroupListComponent,\n InputGroupListContainerDirective,\n JsonValidationPrettifierDirective,\n TextAreaRowHeightDirective,\n RequiredInputPlaceholderDirective,\n IpRangeInputListComponent,\n FilterInputComponent\n ]\n})\nexport class FormsModule {}\n","import { Component, Output, EventEmitter, Input } from '@angular/core';\nimport { NewPassword } from './password.model';\nimport { ControlContainer, NgForm } from '@angular/forms';\nimport { LoginService } from '../login/login.service';\nimport { UserService, ICredentials } from '@c8y/client';\nimport { AlertService } from '../alert/alert.service';\nimport { LoginViews } from '../login/login.model';\n\n@Component({\n selector: 'c8y-totp-challenge',\n templateUrl: './totp-challenge.component.html',\n viewProviders: [ { provide: ControlContainer, useExisting: NgForm } ]\n})\n\nexport class TotpChallengeComponent {\n /**\n * Calls the verify endpoint if set to true (default true)\n */\n @Input() verify = true;\n /**\n * Emits the token on success.\n */\n @Output() onSuccess = new EventEmitter();\n\n model = {\n token: ''\n };\n @Input()\n loading = false;\n @Input()\n hasError = false;\n\n constructor(\n public loginService: LoginService,\n private users: UserService,\n private alert: AlertService\n ) {}\n\n async verifyCode() {\n try {\n this.loading = true;\n this.hasError = false;\n if (this.verify) {\n await this.users.verifyTotpCode(this.model.token);\n }\n this.onSuccess.emit(this.model.token);\n } catch (e) {\n this.hasError = true;\n this.alert.removeLastDanger();\n this.loading = false;\n }\n }\n}\n","import { Component, Output, EventEmitter, Input } from '@angular/core';\nimport { UserService, ICredentials } from '@c8y/client';\nimport { LoginService } from '../login/login.service';\nimport { AlertService } from '../alert/alert.service';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-sms-challenge',\n templateUrl: './sms-challenge.component.html',\n styles: []\n})\n\nexport class SmsChallengeComponent {\n\n @Input() credentials: ICredentials;\n @Output() onCancel = new EventEmitter();\n\n model = {\n smsToken: ''\n };\n isLoading = false;\n\n private resendTfa: string = '0';\n\n constructor(\n public loginService: LoginService,\n private users: UserService,\n private alert: AlertService\n ) {}\n\n async verifyTFACode() {\n this.isLoading = true;\n if (this.useOAuthInternal()) {\n await this.verifyCodeWithOauth();\n } else {\n await this.verifyCodeWithBasicAuth();\n }\n this.isLoading = false;\n }\n\n async resendTFASms() {\n try {\n this.isLoading = true;\n await this.users.verifyTFACode(this.resendTfa);\n } catch (e) {\n if (e.res.status === 403) {\n this.loginService.cleanMessages();\n this.loginService.addSuccessMessage('resend_sms');\n } else {\n this.alert.addServerFailure(e);\n }\n } finally {\n this.isLoading = false;\n }\n }\n\n private useOAuthInternal() {\n return this.loginService.isPasswordGrantLogin(this.credentials);\n }\n\n private async verifyCodeWithOauth() {\n try {\n const { credentials } = this;\n await this.loginService.switchLoginMode({...credentials, tfa: this.model.smsToken});\n await this.loginService.verifyAppAccess();\n await this.loginService.authFulfilled();\n } catch (e) {\n const resStatus = e.res && e.res.status;\n if (resStatus === 401) {\n // it is assumed that the user and password are correct so it must be the tfa code\n this.alert.danger(gettext('Invalid code'));\n } else {\n this.alert.addServerFailure(e);\n }\n }\n }\n\n private async verifyCodeWithBasicAuth() {\n try {\n const { res } = await this.users.verifyTFACode(this.model.smsToken);\n const tfaToken = res.headers.get('tfatoken');\n this.credentials.tfa = tfaToken;\n this.loginWithTFA(tfaToken);\n } catch (e) {\n const resStatus = e.res && e.res.status;\n // BE returns 403 in case of invalid tfa code\n if (resStatus === 403) {\n this.alert.danger(gettext('Invalid code'));\n } else {\n this.alert.addServerFailure(e);\n }\n }\n }\n\n private async loginWithTFA(tfaToken) {\n try {\n await this.loginService.login(this.loginService.useBasicAuth({tfa: tfaToken}), this.credentials);\n this.loginService.saveTFAToken(tfaToken, sessionStorage);\n if (this.loginService.rememberMe) {\n this.loginService.saveTFAToken(tfaToken, localStorage);\n }\n } catch (e) {\n this.alert.addServerFailure(e);\n }\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { ITotp, UserService } from '@c8y/client';\nimport { AlertService } from '../alert/alert.service';\nimport { gettext } from '../i18n';\n\n@Component({\n selector: 'c8y-totp-setup',\n templateUrl: './totp-setup.component.html'\n})\nexport class TotpSetupComponent implements OnInit {\n totpSecret: ITotp;\n\n get qrCodeImage() {\n return this.totpSecret ? this.totpSecret.secretQrUrl : '';\n }\n\n get secret() {\n return this.totpSecret ? this.totpSecret.rawSecret : '';\n }\n\n get qrData() {\n // TODO: waiting for BE:, now we need extract it from secretQrUrl\n // https://cumulocity.atlassian.net/browse/MTM-36387\n // return this.totpSecret ? this.totpSecret.qrData : '';\n const otpAuth = this.qrCodeImage.split('chl=')[1];\n if (!otpAuth) {\n this.alert.danger(gettext('Failed to generate a QR code.'));\n return '';\n }\n return decodeURIComponent(otpAuth);\n }\n\n constructor(private user: UserService, private alert: AlertService) {}\n\n async ngOnInit() {\n try {\n const { data } = await this.user.generateTotpSecret();\n this.totpSecret = data;\n } catch (ex) {\n this.alert.addServerFailure(ex);\n }\n }\n}\n","import {\n Component,\n ViewChild,\n ElementRef,\n Input,\n OnInit,\n Output,\n EventEmitter\n} from '@angular/core';\nimport { some, get, map } from 'lodash-es';\nimport { gettext } from '../i18n/gettext';\n\n/**\n * A drop-zone which is a file selector allowing users to select file(s) from their file system, either natively or by drag and drop.\n *\n * ## Example:\n *\n * ```html\n * <div>\n * <c8y-drop-area\n * (dropped)=\"uploadFile($event)\"\n * [icon]=\"'upload'\">\n * </c8y-drop-area>\n * </div>\n * ```\n */\n\n@Component({\n selector: 'c8y-drop-area',\n templateUrl: './drop-area.component.html'\n})\nexport class DropAreaComponent implements OnInit {\n @Input() title = gettext('Upload file');\n @Input() message = gettext('Drop file here');\n @Input() icon = 'plus-square';\n @Input() loadingMessage = gettext('Uploading…');\n /** Affects displaying both the drop zone and the list of dropped files. */\n @Input() alwaysShow = false;\n @Input() clickToOpen = true;\n @Input() loading = false;\n @Input() progress = -1; // -1 = spinner\n @Output() dropped: EventEmitter<DroppedFile[]> = new EventEmitter();\n @Input() maxAllowedFiles = Infinity;\n @Input() files: FileList;\n isOver: boolean = false;\n errors: boolean = false;\n errorMessage: string;\n filesNameString: string;\n\n @ViewChild('area', { static: true }) area: ElementRef;\n @ViewChild('zone', { static: false }) zone: ElementRef;\n @ViewChild('picker', { static: false }) picker: ElementRef;\n\n ngOnInit(): void {\n this.alwaysShow = this.alwaysShow || this.area.nativeElement.children.length === 0;\n if (this.files && this.files.length > 0) {\n this.onFilesSelected(this.files);\n }\n }\n\n /**\n * Toggles the style of the drop zone element when a file is dragged over the component.\n */\n toggle($event?): void {\n this.zone.nativeElement.style.height = this.area.nativeElement.offsetHeight + 'px';\n this.onOver();\n }\n\n /**\n * Shows computer browser with files to drop into drop-area zone.\n */\n showPicker($event?): void {\n this.preventDefault($event);\n this.picker.nativeElement.value = '';\n this.picker.nativeElement.click();\n }\n\n /**\n * Triggered when file is on over drop area, but not dropped.\n */\n onOver(): void {\n if (!this.isOver) {\n this.isOver = true;\n document.addEventListener('dragover', this.preventDefault);\n document.addEventListener('drop', this.preventDefault);\n }\n }\n\n /**\n * Triggered when file is dropped.\n */\n onPick($event): void {\n this.errors = false;\n this.preventDefault($event);\n this.onFilesSelected($event.target.files);\n }\n\n /**\n * Handle file when it is dropped into drop-area.\n */\n onDrop($event): void {\n this.preventDefault($event);\n this.onFilesSelected($event.dataTransfer.files);\n this.stopDragging();\n }\n\n /**\n * Checks condition what should be displayed: drop-area zone or list of dropped files.\n */\n shouldShowFilesList(): boolean {\n return (\n this.alwaysShow &&\n !this.isFilesArrayEmpty() &&\n !this.hasEmptyFiles() &&\n !this.isTooManyFiles()\n );\n }\n\n /**\n * Triggered when file is picked over web application.\n */\n stopDragging(): void {\n document.removeEventListener('dragover', this.preventDefault);\n document.removeEventListener('drop', this.preventDefault);\n this.isOver = false;\n }\n\n /**\n * Delete files already dropped files.\n */\n onDelete() {\n delete this.files;\n delete this.filesNameString;\n this.clearErrors();\n this.dropped.emit(undefined);\n }\n\n private onFilesSelected(files: FileList) {\n this.files = files;\n this.filesNameString = this.getFilesNamesAsString(files);\n this.errors = false;\n if (!this.isFilesArrayEmpty() && !this.isTooManyFiles()) {\n if (this.hasEmptyFiles()) {\n this.errors = true;\n this.errorMessage = gettext('File must not be empty, select another one.');\n } else {\n this.dropped.emit(this.compose(files));\n }\n } else {\n this.errors = true;\n this.errorMessage = gettext('Too many files selected.');\n }\n }\n\n private getFilesNamesAsString(files: FileList): string {\n return map(files, ({ name }) => name).join(', ');\n }\n\n private isFilesArrayEmpty() {\n return get(this, 'files.length', 0) === 0;\n }\n\n private isTooManyFiles() {\n return get(this, 'files.length', 0) > this.maxAllowedFiles;\n }\n\n private hasEmptyFiles() {\n let result = true;\n if (!this.isFilesArrayEmpty()) {\n result = this.isAnyFileEmpty();\n }\n return result;\n }\n\n private isAnyFileEmpty(): boolean {\n return some(Array.from(this.files), ['size', 0]);\n }\n\n private clearErrors() {\n delete this.errorMessage;\n this.errors = false;\n }\n\n private preventDefault($event?) {\n if ($event) {\n $event.preventDefault();\n }\n }\n\n private compose(files: FileList) {\n return Array.from(files).map(file => ({\n file,\n readAsJson: async () => JSON.parse(await this.read(file, ReadAsType.TEXT)),\n readAsText: async () => this.read(file, ReadAsType.TEXT),\n readAsArrayBuffer: async () => this.read(file, ReadAsType.ARRAY_BUFFER),\n readAsBinaryString: async () => this.read(file, ReadAsType.BINARY_STRING),\n readAsDataURL: async () => this.read(file, ReadAsType.DATA_URL)\n }));\n }\n\n private async read(file, type: ReadAsType): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n switch (type) {\n case ReadAsType.TEXT: {\n reader.readAsText(file);\n break;\n }\n case ReadAsType.ARRAY_BUFFER: {\n reader.readAsArrayBuffer(file);\n break;\n }\n case ReadAsType.BINARY_STRING: {\n reader.readAsBinaryString(file);\n break;\n }\n case ReadAsType.DATA_URL: {\n reader.readAsDataURL(file);\n break;\n }\n }\n reader.onload = () => this.onLoad(reader, resolve, reject);\n });\n }\n\n private onLoad(reader, resolve, reject) {\n if (reader.readyState !== 2) {\n return;\n }\n if (reader.error) {\n reject(reader.error);\n }\n resolve(reader.result);\n }\n}\n\nexport interface DroppedFile {\n file: File;\n readAsText();\n readAsArrayBuffer();\n readAsBinaryString();\n readAsDataURL();\n readAsJson();\n}\n\nenum ReadAsType {\n TEXT,\n DATA_URL,\n ARRAY_BUFFER,\n BINARY_STRING\n}\n","import { Component, Output, EventEmitter, Input } from '@angular/core';\nimport { LoginService } from '../login/login.service';\nimport { AlertService } from '../alert/alert.service';\nimport { LoginViews } from '../login/login.model';\nimport { ICredentials, UserService } from '@c8y/client';\n\n@Component({\n selector: 'c8y-provide-phone-number',\n templateUrl: './provide-phone-number.component.html'\n})\nexport class ProvidePhoneNumberComponent {\n @Input() credentials: ICredentials;\n @Output() onCancel = new EventEmitter();\n @Output() onChangeView = new EventEmitter();\n\n phoneNumber: string;\n requestInProgress = false;\n private readonly sendTfa: string = '0';\n\n constructor(\n public loginService: LoginService,\n public alert: AlertService,\n private userService: UserService\n ) {}\n\n async save() {\n try {\n this.requestInProgress = true;\n await this.userService.savePhoneNumber(this.phoneNumber);\n await this.sendTFASms();\n this.onChangeView.emit({\n view: LoginViews.SmsChallenge,\n credentials: this.credentials\n });\n } catch (e) {\n this.alert.addServerFailure(e);\n } finally {\n this.requestInProgress = false;\n }\n }\n\n private async sendTFASms() {\n try {\n await this.userService.verifyTFACode(this.sendTfa);\n } catch (e) {\n if (e.res.status === 403) {\n this.loginService.cleanMessages();\n this.loginService.addSuccessMessage('send_sms');\n } else {\n throw e;\n }\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { CommonModule } from '../common/common.module';\nimport { PasswordCheckListComponent } from './password-check-list.component';\nimport { PasswordConfirm } from './password-confirm.directive';\nimport { PasswordStrengthCheckerService } from './password-strength-checker.service';\nimport { PasswordStrengthComponent } from './password-strength.component';\nimport { NewPasswordComponent } from './new-password.component';\nimport { PasswordConfirmModalComponent } from './password-confirm-modal.component';\nimport { ModalModule } from '../modal/modal.module';\nimport { FormsModule } from '../forms/forms.module';\nimport { TotpChallengeComponent } from './totp-challenge.component';\nimport { SmsChallengeComponent } from './sms-challenge.component';\nimport { TotpSetupComponent } from './totp-setup.component';\nimport { PasswordService } from './password.service';\nimport { QRCodeModule } from 'angularx-qrcode';\nimport { ProvidePhoneNumberComponent } from './provide-phone-number.component';\n\n/**\n * The angular module definition for new password.\n * @exports PasswordStrengthComponent\n * @exports PasswordCheckListComponent\n * @exports PasswordConfirm\n * @exports NewPasswordComponent\n * @exports PasswordConfirmModalComponent\n */\n@NgModule({\n declarations: [\n TotpChallengeComponent,\n PasswordConfirm,\n PasswordStrengthComponent,\n PasswordCheckListComponent,\n NewPasswordComponent,\n PasswordConfirmModalComponent,\n SmsChallengeComponent,\n TotpSetupComponent,\n ProvidePhoneNumberComponent\n ],\n imports: [FormsModule, TooltipModule, CommonModule, ModalModule, QRCodeModule],\n exports: [\n TotpChallengeComponent,\n PasswordStrengthComponent,\n PasswordCheckListComponent,\n PasswordConfirm,\n NewPasswordComponent,\n PasswordConfirmModalComponent,\n SmsChallengeComponent,\n TotpSetupComponent,\n ProvidePhoneNumberComponent\n ],\n entryComponents: [PasswordConfirmModalComponent],\n providers: [PasswordStrengthCheckerService, PasswordService]\n})\nexport class AuthenticationModule {}\n","import { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { IUser, UserService } from '@c8y/client';\nimport { AlertService } from '../alert/alert.service';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-user-totp-revoke',\n templateUrl: './user-totp.component.html'\n})\nexport class UserTotpRevokeComponent {\n @Input() user: IUser;\n @Output('revoke') revokeEmitter = new EventEmitter<undefined>();\n constructor(\n private users: UserService,\n private alert: AlertService,\n ) { }\n\n async revoke() {\n try {\n await this.users.totpRevokeSecret(this.user);\n this.alert.success(gettext('User TOTP secret revoked.'));\n this.revokeEmitter.next();\n } catch (e) {\n this.alert.addServerFailure(e);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { ModalModule } from '../modal/modal.module';\nimport { UserMenuItemComponent } from './user-menu-item.component';\nimport { UserEditModalComponent } from './user-edit-modal.component';\nimport { UserEditComponent } from './user-edit.component';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { UserMenuOutletComponent } from './user-menu-outlet.component';\nimport { AuthenticationModule } from '../authentication/authentication.module';\nimport { UserMenuService } from './user-menu.service';\nimport { AlertModule } from '../alert/alert.module';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { RouterModule } from '@angular/router';\nimport { FormsModule } from '../forms/forms.module';\nimport { UserTotpSetupComponent } from './user-totp-setup.component';\nimport { UserTotpRevokeComponent } from './user-totp-revoke.component';\n\n/**\n * The angular module definition for the user menu.\n * @exports UserMenuComponent\n * @exports UserMenuItemComponent\n * @exports UserEditComponent\n * @exports UserEditModalComponent\n */\n@NgModule({\n declarations: [\n UserMenuOutletComponent,\n UserEditComponent,\n UserEditModalComponent,\n UserMenuItemComponent,\n UserTotpSetupComponent,\n UserTotpRevokeComponent,\n ],\n imports: [\n FormsModule,\n CommonModule,\n ModalModule,\n BsDropdownModule,\n AuthenticationModule,\n AlertModule,\n RouterModule,\n TooltipModule.forRoot(),\n PopoverModule\n ],\n exports: [\n UserMenuOutletComponent,\n UserMenuItemComponent,\n UserEditComponent,\n UserEditModalComponent,\n UserTotpSetupComponent,\n UserTotpRevokeComponent\n ],\n entryComponents: [\n UserEditModalComponent,\n UserTotpSetupComponent,\n UserTotpRevokeComponent\n ]\n})\nexport class UserModule { }\n","import { NgModule } from '@angular/core';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { ActionModule } from '../action/action.module';\nimport { BreadcrumbModule } from '../breadcrumb/breadcrumb.module';\nimport { CommonModule } from '../common/common.module';\nimport { NavigatorModule } from '../navigator/navigator.module';\nimport { ProductExperienceModule } from '../product-experience/product-experience.module';\nimport { SearchModule } from '../search/search.module';\nimport { UserModule } from '../user/user.module';\nimport { AppIconComponent } from './application/app-icon.component';\nimport { AppSwitcherComponent } from './application/app-switcher.component';\nimport { HeaderBarComponent } from './header-bar/header-bar.component';\nimport { RightDrawerComponent } from './right-drawer/right-drawer.component';\nimport { TitleOutletComponent } from './title/title-outlet.component';\nimport { TitleComponent } from './title/title.component';\n\n/**\n * The angular module definition for the header of the application.\n * @exports HeaderBarComponent\n * @exports TitleComponent\n * @exports TitleOutletComponent\n * @exports AppIconComponent\n * @exports AppSwitcherComponent\n */\n@NgModule({\n declarations: [\n TitleComponent,\n HeaderBarComponent,\n TitleOutletComponent,\n AppIconComponent,\n AppSwitcherComponent,\n RightDrawerComponent\n ],\n imports: [\n BsDropdownModule,\n UserModule,\n SearchModule,\n CommonModule,\n ActionModule,\n BreadcrumbModule,\n NavigatorModule,\n ProductExperienceModule\n ],\n exports: [\n HeaderBarComponent,\n TitleComponent,\n TitleOutletComponent,\n AppIconComponent,\n AppSwitcherComponent,\n RightDrawerComponent\n ]\n})\nexport class HeaderModule {}\n","import { Component, OnInit, Output, Input, EventEmitter } from '@angular/core';\nimport { LoginService } from './login.service';\nimport { PasswordService } from '../authentication/password.service';\nimport { IResetPassword, ICredentials, UserService } from '@c8y/client';\nimport { OptionsService } from '../common/options.service';\nimport { AlertService } from '../alert/alert.service';\nimport { LoginViews } from './login.model';\n\n@Component({\n selector: 'c8y-change-password',\n templateUrl: './change-password.component.html',\n styles: []\n})\nexport class ChangePasswordComponent implements OnInit {\n @Input() credentials: ICredentials;\n @Output() onChangeView = new EventEmitter();\n\n passwordPattern = /^[a-zA-Z0-9`~!@#$%^&*()_|+\\-=?;:'\",.<>{}[\\]\\\\/]{8,32}$/;\n isLoading = false;\n model = {\n tenantId: '',\n email: '',\n newPassword: '',\n newPasswordConfirm: ''\n };\n emailReadOnly = false;\n passwordStrengthEnforced = false;\n\n private TOKEN_PARAM = 'token';\n private EMAIL_PARAM = 'email';\n\n constructor(\n public loginService: LoginService,\n private users: UserService,\n private passwordStrengthCheckerService: PasswordService,\n private options: OptionsService,\n private alert: AlertService\n ) { }\n\n async ngOnInit() {\n this.model.tenantId = this.loginService.getTenant();\n this.model.email = this.options.get(this.EMAIL_PARAM, '');\n this.emailReadOnly = !!this.model.email;\n this.passwordStrengthEnforced = await this.loginService.getPasswordStrengthEnforced();\n }\n\n async changePassword() {\n const passwordStrengthColor: any = this.passwordStrengthCheckerService.getStrengthColor(\n this.model.newPassword\n );\n const resetPassword: IResetPassword = {\n token: this.credentials.token,\n email: this.model.email,\n newPassword: this.model.newPassword,\n passwordStrength: passwordStrengthColor.passwordStrength\n };\n try {\n this.isLoading = true;\n const { res } = await this.users.resetPassword(resetPassword, this.model.tenantId);\n if (res.status === 200) {\n this.loginService.addSuccessMessage('password_changed');\n this.credentials.token = undefined;\n this.options.set(this.TOKEN_PARAM, undefined);\n this.onChangeView.emit({ view: LoginViews.Credentials });\n }\n } catch (e) {\n this.alert.addServerFailure(e);\n } finally {\n this.loginService.reset();\n this.isLoading = false;\n }\n }\n}\n","import { Component, OnInit, Output, EventEmitter } from '@angular/core';\nimport { LoginService } from './login.service';\nimport { ICredentials } from '@c8y/client';\nimport { AlertService } from '../alert/alert.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { gettext } from '../i18n/gettext';\nimport { LoginViews } from './login.model';\n\n@Component({\n selector: 'c8y-credentials',\n templateUrl: './credentials.component.html',\n styles: []\n})\nexport class CredentialsComponent implements OnInit {\n @Output() onChangeView = new EventEmitter();\n\n LOGIN_VIEWS = LoginViews;\n model: ICredentials = {};\n isLoading: boolean = false;\n showLoginForm: boolean = false;\n showBasicAuth: boolean = false;\n oauthOptions: any = {};\n\n private readonly PASSWORD_RESET_HEADER_NAME = 'passwordresettoken';\n private readonly NO_PHONE_HEADER_NAME = 'NoPhoneHeader';\n\n constructor(\n public loginService: LoginService,\n public alert: AlertService,\n public ui: AppStateService\n ) {}\n\n ngOnInit() {\n const { oauthOptions, loginMode } = this.loginService;\n this.model.tenant = this.loginService.getTenant();\n this.showLoginForm =\n typeof loginMode.visibleOnLoginPage === 'undefined' || loginMode.visibleOnLoginPage;\n this.showBasicAuth = loginMode.type === 'BASIC';\n this.oauthOptions = oauthOptions;\n }\n\n redirectToOauth() {\n this.loginService.redirectToOauth();\n }\n\n /**\n * Allows to login into the application using basic auth.\n * If successful logged in the client is set in shared/cumulocity.service.ts\n */\n async login() {\n try {\n this.isLoading = true;\n const basicAuth = this.loginService.useBasicAuth(this.model);\n await this.loginService.login(basicAuth, this.model);\n } catch (e) {\n if (e.res && e.res.headers && e.res.headers.get(this.PASSWORD_RESET_HEADER_NAME)) {\n this.handlePasswordReset(e.res);\n } else if (e.res && e.res.status === 401 && /pin/i.test(e.data.message)) {\n this.handleSmsChallenge(e.data.message);\n } else if (e.res && e.res.status === 401 && /TOTP/i.test(e.data.message)) {\n this.handleTotpChallenge(e.data.message);\n } else if (\n e.res &&\n e.res.headers &&\n e.res.headers.get(this.NO_PHONE_HEADER_NAME) &&\n !this.loginService.isSupportUser(this.model)\n ) {\n this.handleNoPhoneNumberProvided();\n } else {\n this.loginService.reset();\n this.alert.addServerFailure(e);\n }\n } finally {\n this.isLoading = false;\n }\n }\n\n private handlePasswordReset(e: any) {\n this.alert.removeLastDanger();\n this.model.token = e.headers.get(this.PASSWORD_RESET_HEADER_NAME);\n this.onChangeView.emit({ view: LoginViews.ChangePassword, credentials: this.model });\n }\n\n private handleTotpChallenge(message) {\n if (/TOTP setup required/i.test(message)) {\n this.onChangeView.emit({ view: LoginViews.TotpSetup, credentials: this.model });\n } else {\n this.onChangeView.emit({ view: LoginViews.TotpChallenge, credentials: this.model });\n }\n }\n\n private handleSmsChallenge(message: string) {\n if (/pin has already been generated/i.test(message)) {\n this.alert.warning(\n gettext(\n 'The verification code was already sent. For a new verification code, please click on the link above.'\n )\n );\n }\n this.alert.removeLastDanger();\n this.onChangeView.emit({ view: LoginViews.SmsChallenge, credentials: this.model });\n }\n\n private handleNoPhoneNumberProvided() {\n this.onChangeView.emit({ view: LoginViews.ProvidePhoneNumber, credentials: this.model });\n this.alert.warning(\n gettext(\n 'Two-factor authentication has been turned on for this account. Provide your phone number above to save it in your user profile and start receiving verification codes via SMS.'\n )\n );\n }\n}\n","import { Component, Input, OnInit, HostBinding, HostListener, ViewChild } from '@angular/core';\nimport { ICredentials } from '@c8y/client';\nimport { LoginService } from './login.service';\nimport { OptionsService } from '../common/options.service';\nimport { LoginViews } from './login.model';\nimport { AlertService } from '../alert/alert.service';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-login',\n templateUrl: './login.component.html',\n styles: []\n})\nexport class LoginComponent implements OnInit {\n currentView: LoginViews = LoginViews.None;\n LOGIN_VIEWS = LoginViews;\n\n disabled = false;\n\n @Input() name: string;\n\n credentials: ICredentials = {};\n displayAlerts: boolean = false;\n private TOKEN_PARAM = 'token';\n\n /**\n * Just DI.\n */\n constructor(\n public loginService: LoginService,\n private options: OptionsService,\n private alert: AlertService\n ) {}\n\n ngOnInit() {\n const token = this.getResetPasswordToken();\n if (this.loginService.isFirstLogin) {\n if (!token) {\n this.loginAutomatically();\n } else {\n this.credentials.token = token;\n this.reset();\n }\n }\n this.loginService.isFirstLogin = false;\n }\n\n handleLoginTemplate(event) {\n this.currentView = event.view;\n this.credentials = event.credentials || {};\n }\n\n @HostListener('keyup', ['$event']) onkeyup(event: KeyboardEvent) {\n if (event.key !== 'Enter') {\n this.loginService.cleanMessages();\n }\n }\n\n reset() {\n this.loginService.reset();\n this.setView();\n this.loginService.cleanMessages();\n }\n\n private async loginAutomatically() {\n try {\n await this.loginService.login();\n } catch (e) {\n const loginMode = this.loginService.loginMode.type;\n if (loginMode === 'OAUTH2') {\n this.loginService.redirectToOauth();\n } else {\n this.reset();\n if (loginMode === 'OAUTH2_INTERNAL' && window.location.protocol !== 'https:') {\n this.alert.danger(gettext('Current login mode only supports HTTPS.'));\n } else if (e.res && e.res.status === 403) {\n this.alert.addServerFailure(e);\n }\n }\n }\n }\n\n private setView() {\n if (this.credentials && this.credentials.token) {\n this.handleLoginTemplate({ view: LoginViews.ChangePassword, credentials: this.credentials });\n } else {\n this.handleLoginTemplate({ view: LoginViews.Credentials });\n }\n }\n\n private getResetPasswordToken() {\n const token = this.options.get(this.TOKEN_PARAM);\n if (token) {\n this.options.set(this.TOKEN_PARAM, undefined); // only use once\n }\n return token;\n }\n}\n","import { Component, OnInit, Output, EventEmitter } from '@angular/core';\nimport { UserService } from '@c8y/client';\nimport { LoginService } from './login.service';\nimport { LoginViews } from './login.model';\n\n@Component({\n selector: 'c8y-recover-password',\n templateUrl: './recover-password.component.html',\n styles: []\n})\n\nexport class RecoverPasswordComponent implements OnInit {\n\n @Output() onChangeView = new EventEmitter();\n LOGIN_VIEWS = LoginViews;\n isLoading = false;\n model = {\n email: '',\n tenantId: ''\n };\n\n constructor(\n private users: UserService,\n public loginService: LoginService) {\n }\n\n ngOnInit() {\n this.model.tenantId = this.loginService.getTenant();\n }\n\n async resetPassword() {\n try {\n this.isLoading = true;\n const { res } = await this.users.sendPasswordResetMail(this.model.email, this.model.tenantId);\n if (res.status === 200) {\n this.loginService.addSuccessMessage('password_reset_requested');\n }\n } finally {\n this.loginService.reset();\n this.isLoading = false;\n }\n }\n\n}\n","import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';\nimport { ICredentials, UserService } from '@c8y/client';\nimport { AlertService } from '../alert/alert.service';\nimport { LoginService } from './login.service';\nimport { LoginViews } from './login.model';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-totp-auth',\n templateUrl: './totp-auth.component.html'\n})\nexport class TotpAuthComponent implements OnInit {\n @Input() credentials: ICredentials;\n @Input() view: LoginViews;\n @Output() onCancel = new EventEmitter();\n LOGIN_VIEWS = LoginViews;\n loading = false;\n hasError = false;\n isSetup = false;\n\n constructor(\n public loginService: LoginService,\n private userService: UserService,\n private alert: AlertService\n ) {}\n\n /**\n * In case of a setup we need the user to be authorized\n * first.\n */\n async ngOnInit() {\n if (this.view === this.LOGIN_VIEWS.TotpSetup) {\n await this.loginService.switchLoginMode(this.credentials);\n this.isSetup = true;\n }\n }\n\n async onTotpSuccess(code) {\n try {\n this.loading = true;\n this.hasError = false;\n this.credentials.tfa = code;\n if (this.isSetup) {\n await this.userService.activateTotp();\n }\n await this.loginService.switchLoginMode(this.credentials);\n await this.loginService.verifyAppAccess();\n await this.loginService.authFulfilled();\n } catch (e) {\n this.alert.removeLastDanger();\n if (e.data && e.data.message === 'Access is denied') {\n this.alert.addServerFailure(e);\n }\n if (e.data && e.data.message === 'Authentication failed! : User account is locked') {\n this.alert.warning(gettext('Authentication failed due to: user account is locked.'));\n } else {\n this.hasError = true;\n }\n } finally {\n this.loading = false;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PasswordService } from '../authentication';\nimport { PasswordStrength } from '@c8y/client';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class StrengthValidatorService {\n\n constructor(private passwordService: PasswordService) {\n }\n\n isStrong(password: string): boolean {\n return this.isPasswordGreen(this.passwordService.getStrengthColor(password).passwordStrength);\n }\n\n private isPasswordGreen(strength: PasswordStrength) {\n return strength as PasswordStrength === PasswordStrength.GREEN as PasswordStrength;\n }\n}\n","import { Directive, Input } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\nimport { StrengthValidatorService } from './strength-validator-service';\n\n@Directive({\n selector: '[passwordStrengthEnforced]',\n providers: [{ provide: NG_VALIDATORS, useExisting: PasswordStrengthValidatorDirective, multi: true }]\n})\nexport class PasswordStrengthValidatorDirective implements Validator {\n\n private forced: boolean;\n\n @Input() set passwordStrengthEnforced(value) {\n this.forced = value;\n }\n\n constructor(\n public passwordService: StrengthValidatorService) {\n }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const strengthFulfilled = this.passwordService.isStrong(control.value || '');\n const enforcementForcedAndNotFulfilled = this.forced && !strengthFulfilled;\n return enforcementForcedAndNotFulfilled ? { passwordStrength: true } : null;\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { FormsModule as C8yFormsModule } from '../forms/forms.module';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { CommonModule } from '../common/common.module';\nimport { ChangePasswordComponent } from './change-password.component';\nimport { CredentialsComponent } from './credentials.component';\nimport { LoginComponent } from './login.component';\nimport { LoginService } from './login.service';\nimport { RecoverPasswordComponent } from './recover-password.component';\nimport { AuthenticationModule } from '../authentication/authentication.module';\nimport { AlertModule } from '../alert/alert.module';\nimport { TotpAuthComponent } from './totp-auth.component';\nimport { PasswordStrengthValidatorDirective } from './password-strength-validator.directive';\n\n/**\n * The angular module definition for the login.\n * @exports LoginComponent\n */\n@NgModule({\n declarations: [\n LoginComponent,\n RecoverPasswordComponent,\n ChangePasswordComponent,\n CredentialsComponent,\n TotpAuthComponent,\n PasswordStrengthValidatorDirective\n ],\n imports: [\n FormsModule,\n TooltipModule,\n CommonModule,\n AuthenticationModule,\n AlertModule,\n C8yFormsModule\n ],\n exports: [LoginComponent]\n})\nexport class LoginModule {\n static forRoot() {\n return {\n ngModule: LoginModule,\n providers: LoginModule.providers()\n };\n }\n static providers() {\n return [LoginService];\n }\n}\n","import {\n Component,\n ViewChild,\n Input,\n ViewContainerRef,\n AfterContentInit,\n OnDestroy\n} from '@angular/core';\nimport { TabsService } from './tabs.service';\nimport { Tab } from './tab.model';\n\n@Component({\n selector: 'c8y-tab',\n template: '<ng-template #tpl><ng-content></ng-content></ng-template>'\n})\nexport class TabComponent implements AfterContentInit, OnDestroy, Tab {\n @ViewChild('tpl', { static: false }) template: ViewContainerRef;\n @Input() path: string;\n @Input() label: string = '';\n @Input() icon: string;\n @Input() priority: number;\n @Input() orientation: 'horizontal' | 'vertical';\n constructor(private tabs: TabsService) {}\n\n ngAfterContentInit() {\n setTimeout(() => this.tabs.add(this as Tab));\n }\n\n ngOnDestroy() {\n this.tabs.remove(this as Tab);\n }\n}\n","import {\n Component,\n Input,\n HostBinding,\n Renderer2,\n ElementRef,\n OnChanges,\n ViewChild,\n OnDestroy,\n AfterContentInit,\n AfterContentChecked} from '@angular/core';\nimport { debounceTime } from 'rxjs/operators';\nimport { fromEventPattern, fromEvent, merge, Subscription } from 'rxjs';\nimport { Router } from '@angular/router';\nimport { Tab } from './tab.model';\n\n@Component({\n selector: 'c8y-tabs-outlet,c8y-ui-tabs',\n templateUrl: './tabs-outlet.component.html',\n})\nexport class TabsOutletComponent implements OnDestroy, AfterContentInit {\n @Input() tabs: any[] = [];\n @Input() orientation: 'vertical' | 'horizontal' = 'vertical';\n @Input() navigatorOpen = false;\n showLeft: boolean = false;\n showRight: boolean = false;\n @HostBinding('class.navigator-open') get isNavigatorOpen() {\n return this.navigatorOpen;\n }\n @HostBinding('class.page-tabs') get hasTabs() {\n let visibleTabs = [];\n if (this.tabs) {\n visibleTabs = this.tabs.filter(tab => tab.hide !== true);\n }\n return visibleTabs.length;\n }\n @HostBinding('class.page-tabs-horizontal') get isHorizontal() {\n return this.orientation === 'horizontal';\n }\n @HostBinding('class.page-tabs-vertical') get isVertical() {\n return this.orientation !== 'horizontal';\n }\n @ViewChild('container', {read: ElementRef, static: true}) private container: ElementRef;\n @ViewChild('left', {read: ElementRef, static: false}) private leftBtn: ElementRef;\n @ViewChild('right', {read: ElementRef, static: false}) private rightBtn: ElementRef;\n @ViewChild('tabsContainer', {read: ElementRef, static: false}) private tabsContainer: ElementRef;\n private scrollSubscription: Subscription;\n\n constructor(\n private router: Router,\n private renderer: Renderer2,\n private el: ElementRef\n ) {}\n\n ngOnDestroy() {\n if (this.scrollSubscription) {\n this.scrollSubscription.unsubscribe();\n }\n }\n\n ngAfterContentInit() {\n if (this.orientation === 'horizontal') {\n this.scrollSubscribe();\n }\n\n }\n\n isActive(tab: Tab) {\n if (tab && tab.path) {\n return this.router.isActive(tab.path, false);\n } else {\n return false;\n }\n }\n\n navigateTo(path) {\n this.router.navigate([path]);\n }\n\n scroll(direction: 'right' | 'left' = 'right') {\n const { widthScroll, width, scrollLeft } = this.getDimensions();\n const multiplier = direction === 'left' ? -1 : 1;\n\n let targetScroll = scrollLeft + width * multiplier;\n if (targetScroll < 0) {\n targetScroll = 0;\n }\n if (targetScroll > widthScroll - width) {\n targetScroll = widthScroll - width;\n }\n // TODO: we should animate this\n this.container.nativeElement.scrollLeft = targetScroll;\n }\n\n private scrollSubscribe() {\n let unlisten;\n this.scrollSubscription = merge(\n fromEvent(this.container.nativeElement, 'scroll'),\n fromEventPattern(\n (handler: any) => {\n unlisten = this.renderer.listen('window', 'resize', handler);\n },\n () => unlisten()\n )\n ).pipe(\n debounceTime(250)\n ).subscribe(() => this.updateScroll());\n }\n\n private updateScroll() {\n const { widthScroll, width, scrollLeft } = this.getDimensions();\n this.showLeft = !!scrollLeft;\n this.showRight = widthScroll > width + scrollLeft;\n }\n\n private getDimensions() {\n const elTabs = this.tabsContainer.nativeElement;\n const el = this.container.nativeElement;\n const widthScroll = elTabs.scrollWidth;\n const width = el.clientWidth;\n const scrollLeft = el.scrollLeft;\n return { widthScroll, width, scrollLeft };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CommonModule } from '../common/common.module';\nimport { TabComponent } from './tab.component';\nimport { TabsOutletComponent } from './tabs-outlet.component';\nimport { TabsService } from './tabs.service';\n\n@NgModule({\n declarations: [\n TabsOutletComponent,\n TabComponent\n ],\n imports: [\n CommonModule,\n RouterModule.forChild([])\n ],\n exports: [\n TabsOutletComponent,\n TabComponent\n ]\n})\nexport class TabsModule {}\n","import { Component, ViewChild } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { Status, StatusType } from '../../../common/status.model';\nimport { gettext } from '../../../i18n/gettext';\nimport { ConfirmModalComponent } from '../../../modal/modal-confirm.component';\nimport { ModalLabels } from '../../../select-modal/select-modal.model';\nimport { Cookie, CookiePreferences } from '../cookie-banner.model';\nimport { CookieBannerService } from '../cookie-banner.service';\n\n@Component({\n selector: 'c8y-cookie-banner-preferences-modal',\n templateUrl: './cookie-banner-preferences-modal.component.html'\n})\nexport class CookieBannerPreferencesModalComponent {\n @ViewChild('modalRef', { static: false }) modalRef: ConfirmModalComponent;\n closeSubject: Subject<CookiePreferences> = new Subject();\n title = gettext('Cookie preferences');\n labels: ModalLabels = { ok: gettext('Save settings'), cancel: gettext('Cancel') };\n status: StatusType = Status.INFO;\n configCookiePreferences: CookiePreferences;\n configCookiePreferencesList: Cookie[];\n\n constructor(private cookieBannerService: CookieBannerService) {}\n\n ngOnInit() {\n this.configCookiePreferencesList = this.cookieBannerService.transformCookiePreferencesToList(\n this.configCookiePreferences\n );\n }\n\n async ngAfterViewInit() {\n try {\n await this.modalRef.result;\n this.onClose();\n } catch (error) {\n this.onDismiss();\n }\n }\n\n onClose() {\n const cookiePref: CookiePreferences = this.cookieBannerService.transformCookiePreferencesListToCookiePreferences(\n this.configCookiePreferencesList\n );\n\n this.closeSubject.next(cookiePref);\n this.closeSubject.complete();\n }\n\n onDismiss() {\n this.closeSubject.next(undefined);\n this.closeSubject.complete();\n }\n\n getCookieDescription(cookieType: string): string {\n return this.cookieBannerService.getCookieDescription(cookieType);\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { CookieBannerPreferencesModalComponent } from './cookie-banner-preferences-modal/cookie-banner-preferences-modal.component';\nimport { CookieBannerSettings, CookiePreferences } from './cookie-banner.model';\nimport { CookieBannerService } from './cookie-banner.service';\n\n@Component({\n selector: 'c8y-cookie-banner',\n templateUrl: './cookie-banner.component.html'\n})\nexport class CookieBannerComponent implements OnInit {\n settings: CookieBannerSettings;\n showBanner: boolean;\n shouldDisable: boolean = false;\n cookiePreferences: CookiePreferences;\n constructor(\n private bsModalService: BsModalService,\n private cookieBannerService: CookieBannerService\n ) {}\n\n ngOnInit() {\n this.settings = this.cookieBannerService.getCookieBannerSettings();\n this.cookiePreferences = this.cookieBannerService.getCookiePreferencesConfig();\n this.shouldShowCookieBanner();\n }\n\n onConfigurePreferences() {\n this.disableButtons(true);\n\n const initialState = {\n configCookiePreferences: this.cookiePreferences\n };\n\n const modalRef = this.bsModalService.show(CookieBannerPreferencesModalComponent, {\n initialState\n });\n\n modalRef.content.closeSubject.subscribe((userCookiePreferences: CookiePreferences) => {\n this.disableButtons(false);\n if (userCookiePreferences) {\n this.cookieBannerService.setCookies(userCookiePreferences);\n this.setCookieBannerVisibility(false);\n }\n });\n }\n\n acceptCookies() {\n this.cookieBannerService.setCookies(this.cookiePreferences || { required: true });\n this.setCookieBannerVisibility(false);\n }\n\n private shouldShowCookieBanner() {\n this.setCookieBannerVisibility(this.cookieBannerService.shouldShowCookieBanner());\n }\n\n private disableButtons(shouldDisable: boolean) {\n this.shouldDisable = shouldDisable;\n }\n\n private setCookieBannerVisibility(shouldShow: boolean) {\n this.showBanner = shouldShow;\n this.cookieBannerService.isCookieBannerShowed$.next(shouldShow);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { ActionBarModule } from '../action-bar/action-bar.module';\nimport { AlertModule } from '../alert/alert.module';\nimport { CommonModule } from '../common/common.module';\nimport { HeaderModule } from '../header/header.module';\nimport { LoginModule } from '../login/login.module';\nimport { ModalModule } from '../modal/modal.module';\nimport { NavigatorModule } from '../navigator/navigator.module';\nimport { TabsModule } from '../tabs/tabs.module';\nimport { BootstrapComponent } from './bootstrap.component';\nimport { CookieBannerPreferencesModalComponent } from './cookie-banner/cookie-banner-preferences-modal/cookie-banner-preferences-modal.component';\nimport { CookieBannerComponent } from './cookie-banner/cookie-banner.component';\nimport { CookieBannerService } from './cookie-banner/cookie-banner.service';\n\n/**\n * The module which allows to bootstrap a custom application.\n * Use it as `bootstrap: []` component in your main app module\n * or as `<c8y-bootstrap>` in your main app.\n */\n@NgModule({\n declarations: [BootstrapComponent, CookieBannerComponent, CookieBannerPreferencesModalComponent],\n imports: [\n FormsModule,\n CommonModule,\n HeaderModule,\n LoginModule,\n RouterModule,\n TabsModule,\n ActionBarModule,\n AlertModule,\n NavigatorModule,\n TooltipModule,\n ModalModule\n ],\n exports: [BootstrapComponent],\n entryComponents: [BootstrapComponent, CookieBannerPreferencesModalComponent],\n providers: [CookieBannerService]\n})\nexport class BootstrapModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { DropAreaComponent } from './drop-area.component';\n\n/**\n * The angular module definition for a drop-area.\n * @exports DropAreaComponent\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n exports: [\n DropAreaComponent,\n ],\n declarations: [\n DropAreaComponent,\n ]\n})\nexport class DropAreaModule { }\n","import { Route as ngRoute } from '@angular/router';\nimport { ExtensionFactory } from '../common/extension-hooks';\nimport { Tab } from '../tabs/tab.model';\n\nexport enum ViewContext {\n Device = 'device/:id',\n Group = 'group/:id',\n User = 'users/:id',\n Application = 'applications/:id',\n SubscribedApplications = 'subscribedApplications/:id',\n Tenant = 'tenants/:id',\n Report = 'reports/:id'\n}\n\nexport type Route = Partial<ngRoute> & {\n path: string;\n label?: string;\n icon?: string;\n context?: ViewContext;\n priority?: number;\n\n /**\n * Allow to emit multiple tabs on one context route.\n */\n tabs?: Tab[];\n};\n\nexport type RouteFactory = ExtensionFactory<Route>;\n","import { Component, Output, Input, EventEmitter, ViewChild, OnInit } from '@angular/core';\nimport { DroppedFile, DropAreaComponent } from '../drop-area/drop-area.component';\nimport { PickedFiles } from './file-picker.model';\n\n/**\n * User can upload a binary directly or use an URL.\n *\n * ## Usage Example:\n *\n * ```html\n * <div>\n * <c8y-file-picker [maxAllowedFiles]=\"1\" (onFilesPicked)=\"onFile($event)\">\n * </c8y-file-picker>\n * </div>\n * ```\n */\n\n@Component({\n selector: 'c8y-file-picker',\n templateUrl: './file-picker.component.html'\n})\nexport class FilePickerComponent implements OnInit {\n @ViewChild(DropAreaComponent, { static: true }) dropArea: DropAreaComponent;\n @Output() onFilesPicked: EventEmitter<PickedFiles> = new EventEmitter();\n @Input() maxAllowedFiles: number = Infinity;\n @Input() uploadChoice: 'uploadBinary' | 'uploadUrl' = 'uploadBinary';\n @Input() fileUrl: string;\n @Input() fileBinary: DroppedFile;\n\n droppedFiles: DroppedFile[];\n private fileToSave: PickedFiles;\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n if (this.fileBinary) {\n this.droppedFiles = [this.fileBinary];\n }\n }\n\n /**\n * Triggered by dropped file in component and pass it into drop-area component.\n */\n onFileDropped(droppedFiles: DroppedFile[]): void {\n this.onFilesPicked.emit({\n droppedFiles\n });\n }\n\n /**\n * Triggered when user changes upload choice, from upload url to upload binary.\n */\n clearInputFromUrl(): void {\n delete this.fileUrl;\n this.fileToSave = {\n url: undefined\n };\n this.onFilesPicked.emit(this.fileToSave);\n }\n\n /**\n * Triggered when user changes upload choice, to avoid cumulation of droppedFiles.\n */\n clearSelectedFiles(): void {\n this.dropArea.onDelete();\n this.fileToSave = {\n droppedFiles: undefined\n };\n this.onFilesPicked.emit(this.fileToSave);\n }\n\n /**\n * Triggered when user puts binary's url to upload.\n */\n onFileUrlChange(urlStr): void {\n this.fileToSave = {\n url: urlStr\n };\n this.onFilesPicked.emit(this.fileToSave);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule as C8yCommonModule } from '../common/common.module';\nimport { FilePickerComponent } from './file-picker.component';\nimport { DropAreaModule } from '../drop-area/drop-area.module';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule as C8yFormsModule } from '../forms/forms.module';\n\n/**\n * The angular module definition for a drop-area.\n * @exports FilePickerComponent\n */\n@NgModule({\n imports: [\n C8yFormsModule,\n CommonModule,\n DropAreaModule,\n FormsModule,\n C8yCommonModule\n ],\n exports: [\n FilePickerComponent,\n ],\n declarations: [\n FilePickerComponent,\n ]\n})\nexport class FilePickerModule { }\n","import { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { PickedDates } from './date-picker.model';\n\n@Component({\n selector: 'c8y-date-picker',\n templateUrl: './date-picker.component.html'\n})\nexport class DatePickerComponent implements OnInit {\n @Output() onDateSelected: EventEmitter<PickedDates> = new EventEmitter();\n\n fgDatePicker: FormGroup;\n\n ngOnInit() {\n this.fgDatePicker = new FormGroup({\n dateFrom: new FormControl(),\n dateTo: new FormControl()\n });\n }\n\n filter() {\n this.onDateSelected.emit(this.fgDatePicker.value);\n }\n\n clearFilter() {\n this.fgDatePicker.setValue({\n dateFrom: null,\n dateTo: null\n });\n this.onDateSelected.emit(null);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule as C8yCommonModule } from '../common/common.module';\nimport { DatePickerComponent } from './date-picker.component';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule as C8yFormsModule } from '../forms/index';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { BsDatepickerModule } from 'ngx-bootstrap/datepicker';\n\n/**\n * The angular module definition for a date picker - it allows you to pick either one date or a range of two.\n * @exports DatePickerComponent\n */\n@NgModule({\n imports: [\n C8yFormsModule,\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n BsDropdownModule.forRoot(),\n BsDatepickerModule.forRoot(),\n C8yCommonModule\n ],\n exports: [DatePickerComponent],\n declarations: [DatePickerComponent]\n})\nexport class DatePickerModule {}\n","import { Injector, Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router';\nimport { from, isObservable, of, Observable } from 'rxjs';\nimport { every, filter, map, mergeMap, toArray, tap, debounceTime } from 'rxjs/operators';\nimport { Tab } from '../tabs/tab.model';\nimport { Route } from './router.models';\n\n@Injectable()\nexport class RouterTabsResolver {\n constructor(private injector: Injector, private router: Router) {}\n\n get routerStateSnapshot() {\n return this.router.routerState.snapshot;\n }\n\n resolve(route: ActivatedRouteSnapshot) {\n const latestChildren = this.router.config.find(r => route.routeConfig.path === r.path).children;\n return from(latestChildren || []).pipe(\n mergeMap((child: Route) =>\n from(this.getGuards(child)).pipe(\n map((guard: CanActivate) => guard.canActivate(route, this.routerStateSnapshot)),\n mergeMap((result: any) => {\n if (isObservable(result)) {\n return result;\n }\n if (result && typeof result.then === 'function') {\n return from(result);\n }\n return of(result);\n }),\n tap(result => {\n if (Array.isArray(result)) {\n child.tabs = result;\n }\n }),\n every(result => !!result),\n filter(result => result),\n mergeMap(() => (Array.isArray(child.tabs) ? from(child.tabs) : of(child as Tab))),\n map(result =>\n result.label || result.path\n ? ({\n label: result.label,\n icon: result.icon,\n path: `${decodeURIComponent(route.url.join('/'))}/${result.path}`,\n priority: result.priority,\n hide: result.hide\n } as Tab)\n : undefined\n )\n )\n ),\n filter(tabs => !!tabs),\n toArray()\n ) as Observable<Tab[]>;\n }\n\n private getGuards(child: Route) {\n const guards = (child.canActivate || []).map(guard => {\n return this.injector.get(guard);\n });\n if (child.data && child.data.showIf) {\n guards.push({ canActivate: child.data.showIf });\n }\n return guards;\n }\n}\n","import {\n InventoryService,\n UserService,\n ApplicationService,\n TenantService,\n} from '@c8y/client';\nimport { ViewContext } from './router.models';\n\nexport class ViewContextServices {\n static services = new Map<ViewContext, any>([\n [ViewContext.Device, InventoryService],\n [ViewContext.Group, InventoryService],\n [ViewContext.User, UserService],\n [ViewContext.Application, ApplicationService],\n [ViewContext.SubscribedApplications, ApplicationService],\n [ViewContext.Tenant, TenantService],\n [ViewContext.Report, InventoryService]\n ]);\n\n static contextToService(context: ViewContext) {\n return ViewContextServices.services.get(context);\n }\n}\n","import { Injectable, Injector } from '@angular/core';\nimport {\n ActivatedRoute,\n NavigationEnd,\n PRIMARY_OUTLET,\n Router,\n UrlSegmentGroup,\n UrlTree\n} from '@angular/router';\nimport { ApiService, ApiCall } from '@c8y/ngx-components/api';\nimport { NEVER, Observable, Subject, Subscription } from 'rxjs';\nimport { filter, map, merge, switchMap, tap } from 'rxjs/operators';\nimport { Tab } from '../tabs/tab.model';\nimport { TabsService } from '../tabs/tabs.service';\nimport { RouterTabsResolver } from './router-tabs.resolver';\nimport { ViewContextServices } from './view-context.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ContextRouteService {\n private dataSubscription: Subscription;\n private routerSubscription: Subscription;\n private lastAddedTabs = [];\n private refreshTrigger = new Subject();\n\n constructor(\n private tabsResolver: RouterTabsResolver,\n private tabsService: TabsService,\n private router: Router,\n private apiService: ApiService,\n private injector: Injector\n ) {}\n\n init(route: ActivatedRoute): void {\n this.routerSubscription = this.router.events\n .pipe(filter(e => e instanceof NavigationEnd))\n .subscribe(() => this.redirectToFirstTab());\n\n this.dataSubscription = route.data\n .pipe(\n merge(this.updatedContext(route), this.refreshTrigger),\n switchMap(() => this.tabsResolver.resolve(route.snapshot)),\n )\n .subscribe(tabs => this.updateTabs(tabs));\n }\n\n destroy(): void {\n this.dataSubscription.unsubscribe();\n this.routerSubscription.unsubscribe();\n this.lastAddedTabs.forEach(t => this.tabsService.remove(t));\n }\n\n refreshContext() {\n this.refreshTrigger.next();\n }\n\n updatedContext(route: ActivatedRoute): Observable<ApiCall> {\n const { data } = route.snapshot;\n const serviceInstance = ViewContextServices.contextToService(data.context);\n if (serviceInstance) {\n const service = this.injector.get(serviceInstance);\n const detailsUrlRegex = service.getDetailUrl(data.contextData).replace(/\\d+/g, '?\\\\d*');\n const contextRegex = new RegExp(detailsUrlRegex, 'i');\n const childrenRegex = new RegExp(`${detailsUrlRegex}/child`, 'i');\n const filterResponse = ({ url, method }) => {\n const contextChanged = contextRegex.test(url) && ['POST', 'PUT'].includes(method);\n const childrenAffected = childrenRegex.test(url) && ['POST', 'DELETE'].includes(method);\n return contextChanged || childrenAffected;\n };\n return this.apiService.hookResponse(filterResponse);\n }\n return NEVER;\n }\n\n private updateTabs(tabs = []) {\n this.lastAddedTabs.forEach(t => this.tabsService.remove(t));\n this.lastAddedTabs = tabs;\n tabs.forEach(t => this.tabsService.add(t));\n this.redirectToFirstTab();\n }\n\n private redirectToFirstTab() {\n if (this.needsRedirect()) {\n this.tabsService.firstTab$.subscribe((tab: Tab) => {\n if (tab) {\n this.router.navigateByUrl(tab.path, { replaceUrl: true });\n }\n });\n }\n }\n\n private needsRedirect() {\n const tree: UrlTree = this.router.parseUrl(this.router.url);\n const groups: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];\n const isContextRoute = groups.segments.length === 2;\n return isContextRoute;\n }\n}\n","import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { fromFactories } from '../common/extension-hooks';\nimport { RouteFactory, Route } from './router.models';\nimport { TabsService } from '../tabs/tabs.service';\nimport { ContextRouteService } from './context-route.service';\n\n/**\n * A hook to use for Multi Provider extension.\n */\nexport const HOOK_ONCE_ROUTE = new InjectionToken('RouteFactory');\n\n/**\n * A service which defines routes\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class RouterService {\n constructor(\n @Optional() @Inject(HOOK_ONCE_ROUTE) factories: RouteFactory[],\n private router: Router,\n public tabsService: TabsService,\n private contextRouteService: ContextRouteService\n ) {\n fromFactories(factories).subscribe((routes: Route[]) => {\n this.addRoute(routes);\n });\n }\n\n /**\n * Refresh the current context\n */\n refresh() {\n this.contextRouteService.refreshContext();\n }\n\n /**\n * Add a new route to the router configuration or a context.\n * @param route The route to add\n */\n addRoute(route: Route | Route[]) {\n this.addRoutes(Array.isArray(route) ? route : [route]);\n }\n\n private addRoutes(routes) {\n const emptyRoute = this.router.config.find(r => r.path === '**');\n this.router.resetConfig(\n [\n ...this.router.config.filter(r => r.path !== '**'),\n ...routes.map((r: Route) => this.convertRoute(this.router.config, r)),\n emptyRoute\n ].filter(Boolean)\n );\n }\n\n private convertRoute(initialConfig, route: Route) {\n if (route.context) {\n initialConfig.forEach((r: Route) => {\n if (r.data && r.data.context === route.context) {\n r.children = [route, ...(r.children || [])];\n }\n });\n return;\n }\n return route;\n }\n}\n","import { Component } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { ContextRouteService } from './context-route.service';\n\n@Component({\n selector: 'c8y-context-route',\n templateUrl: './context-route.component.html'\n})\nexport class ContextRouteComponent {\n constructor(private route: ActivatedRoute, private contextRouteService: ContextRouteService) {}\n\n ngOnInit(): void {\n this.contextRouteService.init(this.route);\n }\n\n ngOnDestroy(): void {\n this.contextRouteService.destroy();\n }\n\n refreshTabs() {\n this.contextRouteService.refreshContext();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { FetchClient, IFetchOptions } from '@c8y/client';\nimport { Subject, Observable } from 'rxjs';\nimport { ApiCall, ApiCallOptions } from './api.model';\nimport { filter } from 'rxjs/operators';\n\n@Injectable()\nexport class ApiService {\n calls: Observable<ApiCall>;\n private callsSubject = new Subject<ApiCall>();\n\n constructor(private client: FetchClient) {\n this.calls = this.callsSubject.asObservable();\n this.hookIntoClientFetch();\n }\n\n hookResponse(hookFilter: (call: ApiCall) => boolean) {\n return this.callsSubject.pipe(\n filter(({ phase }) => phase === 'finish'),\n filter(hookFilter)\n );\n }\n\n hookRequest(hookFilter: (call: ApiCall) => boolean) {\n return this.callsSubject.pipe(\n filter(({ phase }) => phase === 'start'),\n filter(hookFilter)\n );\n }\n\n async onFinish(call: ApiCall) {\n this.callsSubject.next({ phase: 'finish', ...call });\n }\n\n onStart(call: ApiCall) {\n this.callsSubject.next({ phase: 'start', ...call });\n }\n\n async resolveData(call: ApiCall): Promise<any> {\n const { response, method } = call;\n if ('data' in response) {\n return Promise.resolve({ data: response.data, method });\n } else {\n const cb = (data) => ({ data, method});\n return (response as Response).clone().json().then(cb, cb);\n }\n }\n\n private hookIntoClientFetch() {\n const fetch = this.client.fetch.bind(this.client);\n this.client.fetch = async (url, options: ApiCallOptions & IFetchOptions = { method: 'GET'}) => {\n const { method } = options;\n this.onStart({ options, method, url });\n let fetchPromise = fetch(url, options);\n if (typeof options.responseInterceptor === 'function') {\n fetchPromise = fetchPromise.then(options.responseInterceptor);\n }\n fetchPromise.then(\n (response: Response) => this.onFinish({ response, url, options, method }),\n (response: Response) => this.onFinish({ response, url, options, method })\n );\n return fetchPromise;\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { BasicAuth, FetchClient, Realtime, CookieAuth } from '@c8y/client';\nimport { ApiService } from './api.service';\nimport * as services from './services';\n\nfunction toProvider(provide) {\n let deps: any[] = [FetchClient, Realtime];\n if (provide === FetchClient) {\n deps = [CookieAuth];\n }\n if (provide === BasicAuth || provide === CookieAuth) {\n deps = [];\n }\n if (provide === Realtime) {\n deps = [FetchClient];\n }\n return {provide, useClass: provide, deps};\n}\n\nconst providers: any[] = (Object.keys(services).map((k) => toProvider(services[k])) as any[])\n .concat([\n { provide: ApiService, useClass: ApiService, deps: [FetchClient] }\n ]);\n// @dynamic\n@NgModule()\nexport class DataModule {\n static providers() {\n return providers;\n }\n static forRoot() {\n return {\n ngModule: DataModule,\n providers\n };\n }\n}\n","import { Injectable, Injector } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate } from '@angular/router';\nimport { from, of } from 'rxjs';\nimport { catchError, map, shareReplay, tap } from 'rxjs/operators';\nimport { ViewContextServices } from './view-context.service';\nimport { InventoryService } from '../../api';\n\n@Injectable()\nexport class ContextRouteGuard implements CanActivate {\n private caches = new Map();\n constructor(private injector: Injector) {}\n\n canActivate(route: ActivatedRouteSnapshot) {\n const id = route.paramMap.get('id');\n const service = this.service(route);\n this.clearDetailCached(service, id);\n return this.detailCached(service, id).pipe(\n tap(contextData => (route.data = { ...route.data, contextData })),\n map(() => true),\n catchError(ex => of(false))\n );\n }\n\n private service(route) {\n const serviceInstance = ViewContextServices.contextToService(route.data.context);\n return this.injector.get(serviceInstance);\n }\n\n private detailCached(service, id) {\n const cache = this.getCache(service);\n let cached = cache[id];\n if (!cached) {\n const params = service instanceof InventoryService ? { withChildren: false } : undefined;\n cached = from(service.detail(id, params)).pipe(\n map(({ data }) => data),\n shareReplay(1)\n );\n cache[id] = cached;\n }\n return cached;\n }\n\n private clearDetailCached(service, id) {\n const cache: Map<any, any> = this.getCache(service);\n delete cache[id];\n }\n\n private getCache(service) {\n let cache = this.caches.get(service);\n if (!cache) {\n cache = {};\n this.caches.set(service, cache);\n }\n return cache;\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({selector: 'empty', template: ''})\nexport class EmptyComponent {}\n","import { NgModule } from '@angular/core';\nimport { RouterModule as NgRouterModule } from '@angular/router';\nimport { RouterService } from './router.service';\nimport { ContextRouteComponent } from './context-route.component';\nimport { HeaderModule } from '../header/header.module';\nimport { CommonModule } from '../common/common.module';\nimport { ContextRouteGuard } from './context-route.guard';\nimport { ViewContext, Route } from './router.models';\nimport { RouterTabsResolver } from './router-tabs.resolver';\nimport { EmptyComponent } from './empty.component';\n\nexport const routes: Route[] = [{\n path: 'users/new',\n component: EmptyComponent\n},\n{\n path: 'tenants/new',\n component: EmptyComponent\n}];\n// tslint:disable-next-line: forin\nfor (const key in ViewContext) {\n const context = ViewContext[key];\n routes.push({\n path: context,\n component: ContextRouteComponent,\n canActivate: [ ContextRouteGuard ],\n data: { context, contextData: {} },\n resolve: {\n tabs: RouterTabsResolver,\n }\n });\n}\n\n@NgModule({\n declarations: [ ContextRouteComponent, EmptyComponent],\n imports: [\n NgRouterModule.forRoot(routes),\n HeaderModule,\n CommonModule\n ],\n entryComponents: [ContextRouteComponent, EmptyComponent]\n})\nexport class RouterModule {\n static providers() {\n return [\n ContextRouteGuard,\n RouterTabsResolver,\n RouterService\n ];\n }\n\n static forRoot() {\n return {\n ngModule: RouterModule,\n providers: RouterModule.providers()\n };\n }\n\n constructor(routerService: RouterService) {\n // Declared but never used is intended: to always have a instance of RouterService.\n }\n}\n","import { gettext } from '../i18n/gettext';\nimport { formatDate } from '@angular/common';\n// TODO remove when c8y-icon will works\n\nexport enum SendStatus {\n AVAILABLE = 'AVAILABLE',\n UNAVAILABLE = 'UNAVAILABLE',\n UNKNOWN = 'UNKNOWN',\n MAINTENANCE = 'MAINTENANCE',\n NOT_MONITORED = 'NOT_MONITORED'\n}\n\nexport enum PushStatus {\n CONNECTED = 'CONNECTED',\n DISCONNECTED = 'DISCONNECTED',\n UNKNOWN = 'UNKNOWN',\n MAINTENANCE = 'MAINTENANCE'\n}\n\nexport enum SendStatusLabels {\n AVAILABLE = gettext('Send connection: online'),\n NOT_MONITORED = gettext('Send connection: not monitored'),\n UNAVAILABLE = gettext('Send connection: offline'),\n UNKNOWN = gettext('Send connection status unknown'),\n MAINTENANCE = gettext('Device is under maintenance')\n}\n\nexport enum PushStatusLabels {\n CONNECTED = gettext('Push connection: active'),\n DISCONNECTED = gettext('Push connection: inactive'),\n UNKNOWN = gettext('Push connection: inactive'),\n MAINTENANCE = gettext('Device is under maintenance')\n}\n\nexport const deviceAvailabilityIconMap = {\n sendData: {\n [SendStatus.AVAILABLE]: {\n icon: 'long-arrow-right',\n class: 'statusOk'\n },\n [SendStatus.UNAVAILABLE]: {\n icon: 'long-arrow-right',\n class: 'statusNok'\n },\n [SendStatus.UNKNOWN]: {\n icon: 'long-arrow-right',\n class: 'statusUnknown'\n },\n [SendStatus.NOT_MONITORED]: {\n icon: 'long-arrow-right',\n class: 'statusUnknown'\n }\n },\n push: {\n [PushStatus.CONNECTED]: {\n icon: 'long-arrow-left',\n class: 'statusOk'\n },\n [PushStatus.DISCONNECTED]: {\n icon: 'long-arrow-left',\n class: 'statusUnknown'\n },\n [PushStatus.UNKNOWN]: {\n icon: 'long-arrow-left',\n class: 'statusUnknown'\n },\n [PushStatus.MAINTENANCE]: {\n icon: 'wrench',\n class: 'statusAlert'\n }\n },\n device: {\n MAINTENANCE: {\n icon: 'wrench',\n class: 'statusAlert'\n }\n }\n};\n\nexport const tooltips = {\n sendStatusConnected: (lastMessage, translateService) => {\n const date = formatDate(new Date(lastMessage), 'medium', translateService.currentLang);\n return translateService.instant(gettext('Device last request:\\n{{date}}'), { date });\n },\n sendStatusDisconnected: gettext('Connection not monitored'),\n pushStatusConnected: gettext('Connection to device established'),\n pushStatusDisconnected: gettext(\n 'Connection to device not established (not supported by device or no connectivity)'\n ),\n maintenance: gettext('Device is under maintenance')\n};\n","import { Component, Input, AfterContentInit, OnChanges } from '@angular/core';\nimport {\n deviceAvailabilityIconMap,\n PushStatusLabels,\n SendStatusLabels,\n tooltips\n} from './device-availability';\nimport { TranslateService } from '@ngx-translate/core';\nimport { get } from 'lodash-es';\n\n@Component({\n selector: 'device-status',\n templateUrl: './device-status.component.html'\n})\nexport class DeviceStatusComponent implements AfterContentInit, OnChanges {\n @Input('mo') set node(value) {\n this._mo = value.mo || value;\n }\n\n private _mo;\n private requiredAvailability;\n private availabilityStatus;\n private pushStatus;\n private sendStatus;\n\n constructor(private translateService: TranslateService) {}\n\n get() {\n return this._mo;\n }\n\n ngOnChanges() {\n this.setStatusProperites();\n }\n\n ngAfterContentInit() {\n this.setStatusProperites();\n }\n\n setStatusProperites() {\n this.requiredAvailability = get(this._mo, 'c8y_RequiredAvailability');\n this.availabilityStatus = get(this._mo, 'c8y_Availability.status');\n\n this.pushStatus = get(this._mo, 'c8y_Connection.status') || 'UNKNOWN';\n this.sendStatus =\n this.availabilityStatus || (this.requiredAvailability ? 'UNKNOWN' : 'NOT_MONITORED');\n }\n\n status() {\n let statuses;\n\n if (this.availabilityStatus === 'MAINTENANCE' || this.pushStatus === 'MAINTENANCE') {\n statuses = this.getMaintenanceStatus();\n } else {\n statuses = this.getSendPushStatus();\n }\n\n return statuses;\n }\n\n getMaintenanceStatus() {\n return {\n sendStatus: false,\n pushStatus: false,\n maintenanceStatus: {\n icon: deviceAvailabilityIconMap.device.MAINTENANCE.icon,\n class: deviceAvailabilityIconMap.device.MAINTENANCE.class,\n tooltip: tooltips.maintenance\n }\n };\n }\n\n private getSendPushStatus() {\n return {\n sendStatus: {\n icon: deviceAvailabilityIconMap.sendData[this.sendStatus].icon,\n class: deviceAvailabilityIconMap.sendData[this.sendStatus].class,\n status: this.sendStatus,\n label: SendStatusLabels[this.sendStatus],\n tooltip: this.getSendStatusTooltip(this._mo)\n },\n pushStatus: {\n icon: deviceAvailabilityIconMap.push[this.pushStatus].icon,\n class: deviceAvailabilityIconMap.push[this.pushStatus].class,\n status: this.pushStatus,\n label: PushStatusLabels[this.pushStatus],\n tooltip: this.getPushStatusTooltip(this.pushStatus === 'CONNECTED')\n },\n maintenanceStatus: false\n };\n }\n\n private getSendStatusTooltip(device) {\n const availability = device && device.c8y_Availability;\n const lastMessage = availability && availability.lastMessage;\n if (lastMessage) {\n return tooltips.sendStatusConnected(lastMessage, this.translateService);\n }\n return tooltips.sendStatusDisconnected;\n }\n\n private getPushStatusTooltip(isActive) {\n return isActive ? tooltips.pushStatusConnected : tooltips.pushStatusDisconnected;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DeviceStatusComponent } from './device-status.component';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { CommonModule } from '../common/common.module';\n/**\n * The angular module definition for a device-status.\n * @exports DeviceStatusComponent\n */\n@NgModule({\n imports: [\n CommonModule,\n TooltipModule\n ],\n exports: [\n DeviceStatusComponent\n ],\n declarations: [\n DeviceStatusComponent\n ]\n})\nexport class DeviceStatusModule { }\n","import { Directive, Input, ElementRef } from '@angular/core';\n\n@Directive({\n selector: '[c8y-guide-href]'\n})\nexport class GuideHrefDirective {\n @Input('c8y-guide-href')\n c8yGuideHref;\n\n private htmlAnchor: HTMLAnchorElement;\n\n set baseHref(href) {\n this.htmlAnchor.href = `${href}/${this.c8yGuideHref}`;\n }\n\n constructor(private elementRef: ElementRef) {\n this.htmlAnchor = this.elementRef.nativeElement as HTMLAnchorElement;\n if (!this.htmlAnchor.hasAttribute('target')) {\n this.htmlAnchor.setAttribute('target', '_blank');\n }\n }\n}\n","import {\n Component,\n OnInit,\n ContentChildren,\n QueryList,\n ContentChild,\n AfterContentInit,\n ElementRef,\n Renderer2, OnDestroy\n} from '@angular/core';\nimport { GuideHrefDirective } from './guide-href.directive';\nimport { DocsService } from './docs.service';\nimport { ReplaySubject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { ForceHtmlTranslateDirective } from '../i18n/force-html-translate.directive';\n\n@Component({\n selector: '[c8y-guide-docs]',\n templateUrl: './guide-docs.component.html'\n})\nexport class GuideDocsComponent implements OnInit, AfterContentInit, OnDestroy {\n baseUrl: string;\n @ContentChildren(GuideHrefDirective, { descendants: true }) links: QueryList<GuideHrefDirective>;\n\n /**\n * Provides access to translate directive, so it is possible to adjust anchor html tags, after\n * content is translated.\n */\n @ContentChild(ForceHtmlTranslateDirective, { static: false }) translateDirective;\n\n private destroyed$: ReplaySubject<boolean> = new ReplaySubject(1);\n\n constructor(private docs: DocsService, private el: ElementRef, private renderer: Renderer2) {}\n\n ngOnInit(): void {\n this.baseUrl = this.docs.getBaseUrl();\n }\n\n /**\n * After content is initialized we subscribe for translation events, then we are able to modify\n * anchor just as C8yGuideHrefDirective does.\n */\n ngAfterContentInit() {\n if (this.translateDirective) {\n this.translateDirective.htmlUpdateEvent\n .pipe(takeUntil(this.destroyed$))\n .subscribe(() => {\n this.replaceAnchorAttributes();\n });\n } else {\n this.replaceAnchorAttributes();\n }\n }\n\n /**\n * Find and modify anchor elements\n */\n replaceAnchorAttributes() {\n const anchors = this.findGuideAnchors(this.el.nativeElement);\n anchors.forEach(a => {\n const guideHref = `${this.baseUrl}/${a.getAttribute('c8y-guide-href')}`;\n this.renderer.setAttribute(a, 'href', guideHref);\n if (!a.hasAttribute('target')) {\n this.renderer.setAttribute(a, 'target', '_blank');\n }\n });\n }\n\n /**\n * Recursive function, returns array of Anchor elements inside HTMLElement.\n */\n findGuideAnchors(el: HTMLElement): HTMLElement[] {\n const isAnchor = () => el.nodeName === 'A';\n const hasGuideHrefAttr = () => !!el.attributes.getNamedItem('c8y-guide-href');\n const hasChildren = () => el.childNodes && el.childNodes.length > 0;\n\n let result = [];\n\n if (isAnchor() && hasGuideHrefAttr()) {\n result.push(el);\n } else if (hasChildren()) {\n el.childNodes.forEach((node: HTMLElement) => {\n const searchResult = this.findGuideAnchors(node);\n if (searchResult) {\n result = [...result, ...searchResult];\n }\n });\n }\n return result;\n }\n\n ngAfterViewInit(): void {\n this.links.forEach(guide => {\n guide.baseHref = this.baseUrl;\n });\n }\n\n ngOnDestroy() {\n this.destroyed$.next(true);\n this.destroyed$.complete();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DocsService } from './docs.service';\nimport { GuideHrefDirective } from './guide-href.directive';\nimport { GuideDocsComponent } from './guide-docs.component';\n\n@NgModule({\n declarations: [\n GuideHrefDirective,\n GuideDocsComponent\n ],\n imports: [CommonModule],\n exports: [\n GuideHrefDirective,\n GuideDocsComponent\n ],\n providers: [DocsService],\n})\nexport class DocsModule {}\n","import { Component, OnInit } from '@angular/core';\nimport { ConfigOption, FieldArrayType } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-array-type',\n templateUrl: './array.type.component.html'\n})\nexport class ArrayTypeComponent extends FieldArrayType implements OnInit {\n static readonly CONFIG: ConfigOption = {\n types: [{ name: 'array', component: ArrayTypeComponent }]\n };\n\n ngOnInit(): void {\n if (this.to.required && !this.field.fieldGroup.length) {\n this.add();\n }\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { ConfigOption, FieldType } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-field-checkbox',\n templateUrl: './checkbox.type.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FieldCheckbox extends FieldType {\n static readonly CONFIG: ConfigOption = {\n types: [\n {\n name: 'checkbox',\n component: FieldCheckbox\n },\n {\n name: 'boolean',\n extends: 'checkbox'\n }\n ]\n };\n\n defaultOptions = {\n templateOptions: {\n indeterminate: true,\n formCheck: 'custom' // 'custom' | 'custom-inline' | 'custom-switch' | 'stacked' | 'inline' | 'nolabel'\n }\n };\n}\n","import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';\nimport { ConfigOption, FieldWrapper } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-wrapper-form-field',\n templateUrl: './form-field.wrapper.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class WrapperFormField extends FieldWrapper implements OnInit {\n static readonly CONFIG: ConfigOption = {\n wrappers: [{ name: 'c8y-form-field', component: WrapperFormField }]\n };\n\n maxHelpBlockLength: number = 64;\n showDescriptionAsPopup: boolean;\n\n ngOnInit(): void {\n this.showDescriptionAsPopup =\n this.field.type === 'radio' ||\n (this.to.description && this.to.description.length > this.maxHelpBlockLength);\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { ConfigOption, FieldType } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-field-input',\n templateUrl: './input.type.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FieldInput extends FieldType {\n static readonly CONFIG: ConfigOption = {\n types: [\n {\n name: 'input',\n component: FieldInput,\n wrappers: ['c8y-form-field']\n },\n { name: 'string', extends: 'input' },\n {\n name: 'number',\n extends: 'input',\n defaultOptions: {\n templateOptions: {\n type: 'number'\n }\n }\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n templateOptions: {\n type: 'number'\n }\n }\n }\n ]\n };\n\n get type() {\n return this.to.type || 'text';\n }\n}\n","import { Component } from '@angular/core';\nimport { ConfigOption, FieldType } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-object-type',\n templateUrl: './object.type.component.html'\n})\nexport class ObjectTypeComponent extends FieldType {\n static readonly CONFIG: ConfigOption = {\n types: [{ name: 'object', component: ObjectTypeComponent }]\n };\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { ConfigOption, FieldType } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-field-radio',\n templateUrl: './radio.type.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FieldRadio extends FieldType {\n static readonly CONFIG: ConfigOption = {\n types: [\n {\n name: 'radio',\n component: FieldRadio,\n wrappers: ['c8y-form-field']\n }\n ]\n };\n\n defaultOptions = {\n templateOptions: {\n options: [],\n formCheck: 'custom' // 'custom' | 'custom-inline' | 'stacked' | 'inline'\n }\n };\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule, Type } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { ConfigOption, FieldType, FormlyModule, FORMLY_CONFIG } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { FormsModule } from '../forms/index';\nimport { ArrayTypeComponent } from './array/array.type.component';\nimport { FieldCheckbox } from './checkbox/checkbox.type.component';\nimport { WrapperFormField } from './form-field/form-field.wrapper.component';\nimport { FieldInput } from './input/input.type.component';\nimport { ObjectTypeComponent } from './object/object.type.component';\nimport { FieldRadio } from './radio/radio.type.component';\n\nexport const FIELD_TYPES: Array<Type<FieldType>> = [\n FieldCheckbox,\n ArrayTypeComponent,\n WrapperFormField,\n FieldInput,\n FieldRadio,\n ObjectTypeComponent\n];\n\nexport function fieldTypeFactory() {\n // tslint:disable-next-line:no-string-literal\n return FIELD_TYPES.map(type => type['CONFIG']).reduce(\n (formlyConfig: ConfigOption, typeConfig: ConfigOption) =>\n ({\n ...formlyConfig,\n types: [...formlyConfig.types, ...(typeConfig.types || [])],\n wrappers: [...formlyConfig.wrappers, ...(typeConfig.wrappers || [])]\n } as ConfigOption),\n { types: [], wrappers: [] }\n );\n}\n\n/**\n * This module declares field type components for dynamic forms that match C8Y styleguide.\n *\n * @dynamic\n */\n@NgModule({\n declarations: [...FIELD_TYPES],\n entryComponents: [...FIELD_TYPES],\n imports: [\n CommonModule,\n PopoverModule,\n ReactiveFormsModule,\n TranslateModule,\n FormsModule,\n FormlyModule,\n FormlySelectModule\n ],\n providers: [\n {\n provide: FORMLY_CONFIG,\n useFactory: fieldTypeFactory,\n multi: true\n }\n ]\n})\nexport class DynamicFormsUIThemeModule {}\n","import { FormlyFieldConfig } from '@ngx-formly/core';\nimport { TranslateParser, TranslateService } from '@ngx-translate/core';\nimport { combineLatest, isObservable, of } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { gettext } from '../../i18n';\n\nexport class TranslateExtension {\n constructor(private translate: TranslateService, private parser: TranslateParser) {}\n prePopulate(field: FormlyFieldConfig) {\n const to = field.templateOptions || {};\n if (!to.label || to._translated) {\n return;\n }\n\n to._translated = true;\n field.expressionProperties = {\n ...(field.expressionProperties || {}),\n 'templateOptions.label': to.label ? this.translate.stream(to.label) : to.label,\n 'templateOptions.description': to.description\n ? this.translate.stream(to.description)\n : to.description,\n 'templateOptions.placeholder': to.placeholder\n ? combineLatest([\n this.translate.stream(to.placeholder),\n this.translate.stream(gettext('e.g. {{ example }}'))\n ]).pipe(\n map(([placeholder, expression]) => this.parser.interpolate(expression, { example: placeholder }))\n )\n : to.placeholder,\n 'templateOptions.options': (isObservable(to.options) ? to.options : of(to.options)).pipe(\n map((options: Array<{ label: string }>) =>\n (options || []).map(option => ({\n ...option,\n label: this.translate.instant(option.label)\n }))\n )\n )\n };\n }\n}\n\nexport function registerTranslateExtension(translate: TranslateService, parser: TranslateParser) {\n return {\n extensions: [\n {\n name: 'translate',\n extension: new TranslateExtension(translate, parser)\n }\n ]\n };\n}\n","import { NgModule } from '@angular/core';\nimport { FormlyModule, FORMLY_CONFIG } from '@ngx-formly/core';\nimport { TranslateModule, TranslateParser, TranslateService } from '@ngx-translate/core';\nimport { registerTranslateExtension } from './translate.extension';\n\n@NgModule({\n imports: [FormlyModule, TranslateModule],\n providers: [\n {\n provide: FORMLY_CONFIG,\n multi: true,\n useFactory: registerTranslateExtension,\n deps: [TranslateService, TranslateParser]\n }\n ]\n})\nexport class I18nModule {}\n","import { Injectable } from '@angular/core';\nimport { FormlyFieldConfig } from '@ngx-formly/core';\nimport { FormlyJsonschema } from '@ngx-formly/core/json-schema';\nimport { FormlyJsonschemaOptions } from '@ngx-formly/core/json-schema/formly-json-schema.service';\nimport { JSONSchema7 } from 'json-schema';\n\n@Injectable()\nexport class C8yJSONSchema extends FormlyJsonschema {\n toFieldConfig(schema: JSONSchema7, options?: FormlyJsonschemaOptions): FormlyFieldConfig {\n return super.toFieldConfig(schema, this.c8yOptions((options || {}).map));\n }\n\n private c8yOptions(\n map: (mappedField: FormlyFieldConfig, mapSource: JSONSchema7) => FormlyFieldConfig\n ): FormlyJsonschemaOptions {\n return {\n map(mappedField: FormlyFieldConfig, mapSource: JSONSchema7) {\n let result: FormlyFieldConfig = mappedField;\n\n /** `const` type is represented as hidden input */\n if (mapSource.const) {\n result = {\n ...result,\n defaultValue: mapSource.const,\n templateOptions: { ...result.templateOptions, type: 'hidden' }\n };\n }\n\n /** `writeOnly` field represented as password input */\n if (mapSource.writeOnly) {\n result = {\n ...result,\n templateOptions: { ...result.templateOptions, type: 'password', autocomplete: 'off' }\n };\n }\n\n /** `examples` values used as placeholder */\n if (mapSource.examples) {\n result = {\n ...result,\n templateOptions: {\n ...result.templateOptions,\n placeholder: (mapSource.examples as string[]).join(', ')\n }\n };\n }\n\n /** `enum` field represented as radio button group */\n if (mapSource.enum) {\n result = {\n ...result,\n type: 'radio'\n };\n }\n\n return map ? map(result, mapSource) : result;\n }\n };\n }\n}\n","import { FormlyFieldConfig } from '@ngx-formly/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { gettext } from '../../i18n/gettext';\n\nexport function c8yValidationConfigFactory(translate: TranslateService) {\n return {\n validationMessages: [\n {\n name: 'required',\n message() {\n return translate.stream(gettext('This field is required.'));\n }\n },\n {\n name: 'pattern',\n message(error: any, field: FormlyFieldConfig) {\n return translate.stream(gettext('Does not match pattern {{ requiredPattern }}'), error);\n }\n }\n ]\n };\n}\n","import { Type } from '@angular/core';\nimport { IResultList } from '@c8y/client';\n\n/*\n * For reference: the structure of current device column-related objects.\n * TODO: Can be removed when \"All devices\" is fully migrated.\n *\n * Services involved:\n * - c8yFilteringSortingColumns\n * - c8yFilteringSortingInventoryQueries\n * - c8yDeviceListColumns\n * - c8yFilteringSortingCollections?? -> for other tables in tenant/cell ID usage statistics feature\n *\n * Components involved:\n * - c8yFilteredSortedList -> this needs to be gravely adapted\n *\n * States saved in user preferences:\n * - Columns config (ALL_DEVICES_COLUMNS_CONFIG_USER_PREFERENCES_KEY)\n * - Columns meta (ALL_DEVICES_COLUMNS_META_USER_PREFERENCES_KEY_PREFIX)\n *\n * States saved in dynamic group object:\n * - Columns config (COLUMNS_CONFIG_FRAGMENT)\n * - Columns meta (COLUMNS_META_FRAGMENT)\n * - Query string (QUERY_STRING_FRAGMENT)\n *\n * TO-FUTURE-SELF note:\n * - `col.config.filtering` and `col.config.sorting` (the models) populate\n * `col.filtering` and `col.sorting` (the views).\n * - `getFilter` can return a query object (for server-side filtering) or\n * a filter function (for server-side filtering).\n */\ninterface DeviceColumn {\n name: string;\n header: string;\n config: {\n filtering: object;\n sorting: {\n order: number;\n };\n override: DeviceColumn;\n };\n cell: {\n class: string;\n innerClass: string;\n scopeExtensions: object;\n template: string;\n style: object;\n };\n filtering: {\n form: object[];\n schema: {\n type: string;\n properties: {\n type: string;\n [key: string]: any;\n };\n };\n getFilter(filteringModel: object): object | FilterFunction;\n };\n sorting: {\n path?: string;\n paths?: string;\n };\n meta: {\n custom: boolean;\n key: string;\n headerName: string;\n fragmentPath: string;\n active: boolean;\n filteringMode: 'EQUALITY' | 'EXISTENCE';\n };\n}\n\ntype FilterFunction = (item: object) => boolean;\n\nexport interface DataGrid {\n columns: Column[];\n rows: Row[];\n pagination: Pagination;\n serverSideDataCallback: ServerSideDataCallback;\n selectable: boolean;\n selectionPrimaryKey: string;\n displayOptions: DisplayOptions;\n actionControls: ActionControl[];\n bulkActionControls: BulkActionControl[];\n}\n\n/*\n * Column\n */\nexport interface Column {\n name: string | SpecialColumnName;\n header?: string;\n path?: string;\n visible?: boolean;\n positionFixed?: boolean;\n\n /*\n * Cosmetics\n */\n dataType?: ColumnDataType;\n gridTrackSize?: string;\n headerCSSClassName?: string | string[];\n cellCSSClassName?: string | string[];\n\n /*\n * Sorting-Filtering\n */\n sortable?: boolean;\n sortOrder?: SortOrder;\n\n filterable?: boolean;\n filterPredicate?: string | FilterPredicateFunction;\n externalFilterQuery?: any;\n\n /*\n * Custom renderer\n */\n cellRendererComponent?: Type<any>;\n headerCellRendererComponent?: Type<any>;\n filteringFormRendererComponent?: Type<any>;\n}\n\nexport interface ColumnConfig {\n visible?: boolean;\n sortOrder?: SortOrder;\n}\n\nexport interface GridConfig {\n columns: ColumnConfig[];\n pagination: Pagination;\n}\n\nexport const enum SpecialColumnName {\n Checkbox = 'checkbox',\n Actions = 'actions'\n}\n\nexport const enum ColumnDataType {\n Icon = 'icon',\n Numeric = 'numeric',\n TextShort = 'text-short',\n TextLong = 'text-long'\n}\n\nexport const enum ColumnDataRecordClassName {\n Icon = 'data-record-icon',\n Header = 'data-record-header',\n Default = ''\n}\n\nexport const minColumnGridTrackSize = 80;\n\nexport const ratiosByColumnTypes = {\n icon: 1,\n numeric: 1,\n 'text-short': 1.67,\n 'text-long': 3.33\n};\n\nexport type SortOrder = 'asc' | 'desc' | '';\n\nexport type FilterPredicateFunction = (item: object, path: string) => boolean;\n\nexport enum FilteringActionType {\n ApplyFilter = 'APPLY_FILTER',\n ResetFilter = 'RESET_FILTER'\n}\n\nexport interface Row {\n id: string;\n [key: string]: any;\n}\n\nexport interface Pagination {\n currentPage: number;\n nextPage?: number;\n pageSize: number;\n}\n\nexport type ServerSideDataCallback = (\n dataSourceModifier: DataSourceModifier\n) => ServerSideDataResult;\nexport interface DataSourceModifier {\n columns: Column[];\n searchText: string;\n pagination: Pagination;\n selection: {\n enabled: boolean;\n primaryKey: string;\n };\n}\n\n/**\n * Describes result from server with data and additional statistics.\n */\nexport type ServerSideDataResult = IResultList<object> & {\n /** The real grand total number of items (the whole dataset). */\n size: number;\n\n /** The number of items after filtering applied to the whole dataset (subset). */\n filteredSize: number;\n\n /** The list of ids of all filtered items (subset). */\n filteredDataIds?: string[];\n};\n\nexport interface DataSourceStats {\n /** The real grand total number of items (the whole dataset). */\n size: number;\n\n /** The number of items after filtering applied to the whole dataset (subset). */\n filteredSize: number;\n\n /** The number of the current page. */\n currentPage: number;\n\n /** The number of the next page. */\n nextPage?: number;\n\n /** The number of items currently shown in the list view, a.k.a. current page (what the user sees on screen). */\n currentPageSize: number;\n\n /** The number of items on the first page. */\n firstPageSize: number;\n}\n\nexport interface DisplayOptions {\n striped: boolean;\n bordered: boolean;\n gridHeader: boolean;\n}\n\nexport interface ActionControl {\n type: BuiltInActionType | string;\n text?: string;\n icon?: string;\n // tslint:disable-next-line:ban-types\n callback: ((item: Row, reload: () => void) => void) | Function;\n [key: string]: any;\n}\n\nexport interface BulkActionControl extends ActionControl {\n callback(selectedItemIds: string[], reload: () => void): void;\n}\n\nexport const enum BuiltInActionType {\n Edit = 'EDIT',\n Delete = 'DELETE',\n Export = 'EXPORT'\n}\n","import { NgModule } from '@angular/core';\nimport { FormlyModule, FORMLY_CONFIG } from '@ngx-formly/core';\nimport { TranslateModule, TranslateService } from '@ngx-translate/core';\nimport { c8yValidationConfigFactory } from './validation-config.factory';\n\n@NgModule({\n imports: [TranslateModule, FormlyModule],\n providers: [\n {\n provide: FORMLY_CONFIG,\n multi: true,\n useFactory: c8yValidationConfigFactory,\n deps: [TranslateService]\n }\n ]\n})\nexport class ValidationModule {}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { DynamicFormsUIThemeModule } from './dynamic-forms-ui-theme.module';\nimport { I18nModule } from './i18n/i18n.module';\nimport { C8yJSONSchema } from './json-schema/c8y-json-schema.service';\nimport { ValidationModule } from './validation/validation.module';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n I18nModule,\n ValidationModule,\n DynamicFormsUIThemeModule,\n FormlyModule.forRoot()\n ],\n providers: [C8yJSONSchema],\n exports: [FormlyModule, ReactiveFormsModule]\n})\nexport class DynamicFormsModule {}\n","import { Component, InjectionToken, Type } from '@angular/core';\nimport { Observable } from 'rxjs';\n\n/**\n * A hook to add dynamic components to the UI (e.g. widgets).\n */\nexport const HOOK_COMPONENTS = new InjectionToken('Hook Dynamic Component');\n\n/**\n * A hook to add dynamic components to the UI (e.g. widgets).\n * @deprecated: Use HOOK_COMPONENTS\n */\nexport const HOOK_COMPONENT = new InjectionToken('Hook Dynamic Component @deprecated');\n\n/**\n * A dynamic component can be defined in a the HOOK_COMPONENTS to display any kind\n * of component dynamically just by referencing it's id. The most common use case is on dashboards,\n * where the `configComponent` is used to define what is displayed on the `component`\n * on the dashboard.\n *\n * To use the component you can use the c8y-dynamic-component.\n *\n * ```\n * <c8y-dynamic-component\n * componentId=\"angular.widget.demo\"\n * [config]=\"{ text: 'Hello world' }\"\n * [mode]=\"editComponent ? 'config' : 'component'\"\n * ></c8y-dynamic-component>\n * ```\n */\nexport interface DynamicComponentDefinition {\n /**\n * Unique serializable id\n */\n id: string;\n /**\n * The component which is used when the component should be displayed (e.g. on a dashboard)\n */\n component: Type<Component>;\n /**\n * The configuration component used when a widget is added or edited.\n */\n configComponent?: Type<Component>;\n /**\n * The label shown for this dynamic component on add widgets\n */\n label: string;\n /**\n * The description shown on add widget\n */\n description: string;\n /**\n * Add any random data, specially to angular.js dashboards.\n * Should be searilzabled to allow to save it to the API.\n */\n data?: any;\n /**\n * An url to an preview image.\n */\n previewImage?: string;\n}\n\n/**\n * Use this interface on any component to define the interchange between\n * config and display component.\n */\nexport interface DynamicComponent {\n /**\n * The configuration which is shared between configuration component and display component.\n * Should be searilzabled to allow to save it to the API.\n */\n config: any;\n /**\n * A reference to the ng1Form on angularjs dashboards to disable/enable the save button.\n * @deprecated: Will not work on Angular-Dashboards (1.6.1.0). Use `ContextServiceDashboard.formDisabled` instead.\n */\n ng1FormRef?: any;\n}\n\n/**\n * An lifecycle hook which is called before an configuration is saved.\n */\nexport interface OnBeforeSave {\n /**\n * Called before a configuration object is saved. The function can be used to manipulate the\n * passed config object or to cancel the saving (return false or Observable<boolean>).\n */\n onBeforeSave(config?: any): boolean | Promise<boolean> | Observable<boolean>;\n}\n","import { Injectable, Injector } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, of, Subject } from 'rxjs';\nimport { filter, mergeMap, take } from 'rxjs/operators';\nimport { ExtensionPoint, fromFactories } from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport {\n DynamicComponentDefinition,\n HOOK_COMPONENT,\n HOOK_COMPONENTS\n} from './dynamic-component.model';\n\ndeclare const __MODE__: string;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DynamicComponentService extends StateService\n implements ExtensionPoint<DynamicComponentDefinition> {\n items$: Observable<DynamicComponentDefinition[]>;\n readonly refreshTrigger = new Subject();\n readonly state$ = new BehaviorSubject<Set<DynamicComponentDefinition>>(\n new Set<DynamicComponentDefinition>()\n );\n\n constructor(private injector: Injector, router: Router) {\n super();\n\n this.items$ = fromFactories(\n [() => this.injector.get(HOOK_COMPONENTS, []), () => this.getComponentsViaDeprecatedHook()],\n router,\n false\n );\n this.items$.subscribe(cmps => {\n cmps.forEach(cmp => {\n this.state.add(cmp);\n });\n this.emitNewState();\n });\n }\n\n getComponentsViaDeprecatedHook() {\n const componentsViaDeprecatedHook: DynamicComponentDefinition[] = this.injector.get(\n HOOK_COMPONENT,\n []\n ) as DynamicComponentDefinition[];\n if (\n componentsViaDeprecatedHook &&\n componentsViaDeprecatedHook.length &&\n __MODE__ !== 'production'\n ) {\n console.warn('HOOK_COMPONENT is now deprecated. Use HOOK_COMPONENTS instead.');\n }\n\n return componentsViaDeprecatedHook;\n }\n\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n get state() {\n return this.state$.value;\n }\n\n /**\n * Returns a component by it's id as an observable.\n * @param id The id of the component.\n */\n getById$(id) {\n return this.state$.pipe(\n filter((cmps: Set<DynamicComponentDefinition>) => cmps.size > 0),\n mergeMap((cmps: Set<DynamicComponentDefinition>) =>\n of(Array.from(cmps).find(cmp => cmp.id === id))\n ),\n take(1)\n );\n }\n\n add(component: DynamicComponentDefinition) {\n this.state.add(component);\n this.emitNewState();\n }\n\n remove(component: DynamicComponentDefinition) {\n this.state.delete(component);\n this.emitNewState();\n }\n}\n","import {\n Component,\n Input,\n ViewChild,\n ComponentFactoryResolver,\n ViewContainerRef,\n ComponentRef\n} from '@angular/core';\nimport {\n DynamicComponent,\n DynamicComponentDefinition,\n OnBeforeSave\n} from './dynamic-component.model';\nimport { DynamicComponentService } from './dynamic-component.service';\nimport { of, isObservable, Observable } from 'rxjs';\nimport { isUndefined } from 'lodash-es';\n\n/**\n * C8y dynamic component.\n * ## Example:\n *\n * register component in HOOK in module:\n * ```typescript\n * import { HOOK_COMPONENT } from '@c8y/ngx-components';\n *\n * @NgModule({\n * ...,\n * providers: [{\n * provide: HOOK_COMPONENT,\n * multi: true,\n * useValue: [{\n * id: 'test-component',\n * label: 'My test component',\n * description: 'this is test component',\n * component: TestComponent\n * }],\n * ...\n * }]\n *\n * ```\n * Showing dynamic component:\n * ```html\n * <c8y-dynamic-component [componentId]=\"'test-component'\" [config]=\"config\"></c8y-dynamic-component>\n * ```\n */\n@Component({\n selector: 'c8y-dynamic-component',\n templateUrl: './dynamic-component.component.html'\n})\nexport class DynamicComponentComponent {\n /**\n * The ID of the registered component. It needs to be a component that is hooked\n * with the HOOK_COMPONENTS extension hook.\n */\n @Input() componentId: string;\n /**\n * The configuration to pass.\n */\n @Input() config: any;\n /**\n * DynamicComponents can have two modes, an edit (config) and an view (component) mode.\n * By default it is shown in the component mode.\n */\n @Input() mode: 'config' | 'component' = 'component';\n /**\n * Disable this to hide the error that is shown if the component was not found.\n */\n @Input() notFoundError = true;\n /**\n * @ignore\n */\n @ViewChild('host', { read: ViewContainerRef, static: true }) host: ViewContainerRef;\n /**\n * @ignore\n */\n error: any;\n /**\n * @ignore\n */\n expandErrorDetails = false;\n private componentRef: ComponentRef<Component>;\n\n /**\n * @ignore only DI\n */\n constructor(\n private componentFactoryResolver: ComponentFactoryResolver,\n private dynamicComponentService: DynamicComponentService\n ) {}\n\n /**\n * Calls the dynamic component life cycle hook. Currently only\n * supporting onBeforeSave, a hook which is called before a config component\n * is saved.\n */\n callLifeCycleHooks() {\n return this.callOnBeforeSaveHook();\n }\n\n /**\n * @ignore\n */\n ngOnChanges(): void {\n this.dynamicComponentService\n .getById$(this.componentId)\n .subscribe(cmp => this.loadComponent(cmp));\n }\n\n private loadComponent(dynamicComponent: DynamicComponentDefinition) {\n try {\n this.error = undefined;\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(\n this.mode === 'component' ? dynamicComponent.component : dynamicComponent.configComponent\n );\n this.host.clear();\n this.componentRef = this.host.createComponent(componentFactory);\n (this.componentRef.instance as DynamicComponent).config = this.config;\n } catch (ex) {\n this.error = ex;\n }\n }\n\n private callOnBeforeSaveHook() {\n if (!this.componentRef) {\n return of(true);\n }\n const hook = (this.componentRef.instance as OnBeforeSave).onBeforeSave;\n if (hook) {\n const result = hook.call(this.componentRef.instance, this.config);\n if (isUndefined(result)) {\n return of(true);\n }\n return isObservable(result) ? result : (of(result) as Observable<boolean>);\n }\n return of(true);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CollapseModule } from 'ngx-bootstrap/collapse';\nimport { DynamicComponentComponent } from './dynamic-component.component';\nimport { DynamicComponentService } from './dynamic-component.service';\nimport { I18nModule } from '../i18n/i18n.module';\n\n@NgModule({\n declarations: [DynamicComponentComponent],\n imports: [CommonModule, CollapseModule, RouterModule.forChild([]), I18nModule],\n exports: [DynamicComponentComponent],\n providers: [DynamicComponentService]\n})\nexport class DynamicComponentModule {}\n","import { Component, ViewChild } from '@angular/core';\n\n@Component({\n selector: 'c8y-dashboard-child-action',\n templateUrl: './dashboard-child-action.component.html'\n})\nexport class DashboardChildActionComponent {\n @ViewChild('template', { static: false }) template: any;\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'c8y-dashboard-child-title',\n templateUrl: './dashboard-child-title.component.html'\n})\nexport class DashboardChildTitleComponent {}\n","import {\n Component,\n ContentChildren,\n ElementRef,\n HostBinding,\n Input,\n AfterContentInit,\n QueryList,\n forwardRef,\n Output,\n EventEmitter,\n HostListener,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { DashboardChildComponent } from './dashboard-child.component';\nimport { DashboardChange } from './dashboard.model';\n\n/**\n * Displays a CSS grid which is customizable by the customer. You can set\n * `c8y-dashboard-child`-components on it or position any element on it by\n * setting the grid CSS properties. On change (resize, or rearrange) the\n * component emits an change event.\n *\n * ## Example:\n *\n * ```html\n * <c8y-title>Hello from outlet</c8y-title>\n *\n * <c8y-action-bar-item [placement]=\"'right'\">\n * <button class=\"btn btn-link\" (click)=\"addRandom()\"><i class=\"fa fa-plus\"></i> Add random</button>\n * </c8y-action-bar-item>\n * <c8y-action-bar-item [placement]=\"'right'\">\n * <button class=\"btn btn-link\" (click)=\"isFrozen = !isFrozen\">\n * <i [c8yIcon]=\"isFrozen ? 'lock' : 'unlock'\"></i> Toggle freeze\n * </button>\n * </c8y-action-bar-item>\n *\n * <c8y-dashboard (dashboardChange)=\"dashboardChange($event)\">\n * <c8y-dashboard-child\n * [isFrozen]=\"isFrozen\"\n * title=\"dynamic\"\n * *ngFor=\"let widget of widgets\"\n * #current\n * >\n * x: {{ current.x }}<br />\n * y: {{ current.y }}<br />\n * width: {{ current.width }}<br />\n * height: {{ current.height }}<br />\n * </c8y-dashboard-child>\n * <c8y-dashboard-child\n * #cpWidget\n * [isFrozen]=\"isFrozen\"\n * [x]=\"0\"\n * [y]=\"1\"\n * [width]=\"3\"\n * [height]=\"2\"\n * [data]=\"widget\"\n * [class]=\"'card card-dashboard panel-title-regular panel-content-branded panel-title-overlay'\"\n * >\n * <c8y-dashboard-child-title>\n * <span>World!</span>\n * </c8y-dashboard-child-title>\n * x: {{ cpWidget.x }}<br />\n * y: {{ cpWidget.y }}<br />\n * width: {{ cpWidget.width }}<br />\n * height: {{ cpWidget.height }}<br />\n * </c8y-dashboard-child>\n * <c8y-dashboard-child\n * #cpWidget2\n * [isFrozen]=\"isFrozen\"\n * [x]=\"8\"\n * [y]=\"1\"\n * [width]=\"4\"\n * [height]=\"4\"\n * [class]=\"'card card-dashboard panel-content-dark'\"\n * >\n * <c8y-dashboard-child-title>\n * <span>Hello!</span>\n * </c8y-dashboard-child-title>\n * <c8y-dashboard-child-action>\n * <a href=\"\" (click)=\"cpWidget2.isFrozen = !cpWidget2.isFrozen; (false)\">\n * <i [c8yIcon]=\"cpWidget2.isFrozen ? 'lock' : 'unlock'\"></i> Toggle freeze\n * </a>\n * </c8y-dashboard-child-action>\n * x: {{ cpWidget2.x }}<br />\n * y: {{ cpWidget2.y }}<br />\n * width: {{ cpWidget2.width }}<br />\n * height: {{ cpWidget2.height }}<br />\n * </c8y-dashboard-child>\n *\n * <c8y-dashboard-child\n * #cpWidget3\n * [isFrozen]=\"isFrozen\"\n * [x]=\"0\"\n * [y]=\"3\"\n * [width]=\"4\"\n * [height]=\"4\"\n * [class]=\"'card-dashboard panel-content-transparent'\"\n * >\n * <c8y-dashboard-child-title *ngIf=\"showTitle\">\n * <span>Transparent!</span>\n * </c8y-dashboard-child-title>\n * <c8y-dashboard-child-action>\n * <a href=\"\" (click)=\"showTitle = !showTitle; (false)\">\n * <i [c8yIcon]=\"'heading'\"></i> Hide/show title\n * </a>\n * </c8y-dashboard-child-action>\n * <c8y-dashboard-child-action>\n * <a href=\"\" (click)=\"cpWidget3.isFrozen = !cpWidget3.isFrozen; (false)\">\n * <i [c8yIcon]=\"cpWidget3.isFrozen ? 'lock' : 'unlock'\"></i> Toggle freeze\n * </a>\n * </c8y-dashboard-child-action>\n * x: {{ cpWidget3.x }}<br />\n * y: {{ cpWidget3.y }}<br />\n * width: {{ cpWidget3.width }}<br />\n * height: {{ cpWidget3.height }}<br />\n * </c8y-dashboard-child>\n * </c8y-dashboard>\n * ```\n */\n@Component({\n selector: 'c8y-dashboard',\n templateUrl: './dashboard.component.html',\n host: {\n class: 'c8y-grid-dashboard dashboard-grid'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DashboardComponent implements AfterContentInit {\n /**\n * All children in that dashboard.\n */\n @ContentChildren(forwardRef(() => DashboardChildComponent)) children: QueryList<\n DashboardChildComponent\n >;\n\n /**\n * The amount of columns on that dashboard.\n */\n @Input() columns = 12;\n\n /**\n * The spacing between each children in pixel.\n */\n @Input() gap = 12;\n\n /**\n * The amount of rows to dusplay. Set to auto to\n * auto extend the rows.\n */\n @Input() rows: number | 'auto' = 'auto';\n\n /**\n * An event fired if the dashboard was changed.\n */\n @Output() dashboardChange = new EventEmitter<DashboardChange>();\n\n dashboardRect;\n private lastRow = 1;\n private readonly DEFAULT_ROW_SIZE = 68;\n\n /**\n * The current column size.\n */\n get columnSize() {\n return this.dashboardRect.width / this.columns;\n }\n\n /**\n * The current row size.\n */\n get rowSize() {\n return this.rows === 'auto' ? this.DEFAULT_ROW_SIZE : this.calculateRowSize();\n }\n\n /**\n * Returns all positioning styles. Nasty workaround for that issue:\n * https://github.com/angular/angular/issues/9343\n */\n @HostBinding('attr.style')\n get inlineStyle() {\n return this.sanitizer.bypassSecurityTrustStyle(\n `\n -ms-grid-columns: (1fr)[${this.columns}];\n grid-template-columns: repeat(${this.columns}, 1fr);\n ${this.rows !== 'auto' ? `grid-template-rows: repeat(${this.rows}, 1fr);` : ''}\n grid-auto-rows: ${this.rowSize + this.gap}px;\n -ms-grid-rows: (${this.rowSize + this.gap}px)[${\n this.rows === 'auto' ? this.lastRow : this.rows\n }];\n margin: -${this.gap}px;\n `\n );\n }\n\n constructor(private element: ElementRef, private sanitizer: DomSanitizer) {}\n\n ngAfterContentInit(): void {\n this.onResize();\n this.getLastRow();\n }\n\n @HostListener('window:resize')\n onResize() {\n this.updateRectSize();\n }\n\n /**\n * Gets the last row\n * (mainly for IE11 which doesn't support grid-auto-rows CSS property)\n */\n getLastRow() {\n let lastRow = 1;\n this.children.forEach(widget => {\n if (lastRow < widget.y + widget.width) {\n lastRow = widget.y + widget.width;\n }\n });\n this.lastRow = lastRow + 1;\n }\n\n /**\n * Updates the current rect size of the dashboard.\n */\n updateRectSize() {\n const ele = this.element.nativeElement as HTMLElement;\n this.dashboardRect = ele.getBoundingClientRect();\n }\n\n emitChange(widget: DashboardChildComponent) {\n this.dashboardChange.emit({ source: widget, children: this.children.toArray() });\n }\n\n private calculateRowSize() {\n return this.dashboardRect.height / (this.rows as number);\n }\n}\n","import { CdkDragMove } from '@angular/cdk/drag-drop';\nimport { sortBy } from 'lodash-es';\nimport { pipe } from 'rxjs';\nimport { distinctUntilChanged, expand, filter, map, tap } from 'rxjs/operators';\nimport { DashboardComponent } from './dashboard.component';\nimport {\n DashboardChildDimension,\n DashboardChildResizeDimension,\n DashboardChildArrangement\n} from './dashboard.model';\nimport { DashboardChildComponent } from './dashboard-child.component';\n\nexport class DashboardChildChange {\n child: DashboardChildComponent;\n children: DashboardChildComponent[];\n private dashboard: DashboardComponent;\n\n private readonly MIN_WIDTH = 2;\n private MIN_HEIGHT = 1;\n private readonly PIXEL_SIZE_THRESHOLD = 10;\n\n private diffX = 0;\n private diffY = 0;\n\n constructor(childToChange: DashboardChildComponent) {\n this.dashboard = childToChange.dashboard;\n this.children = childToChange.dashboard.children\n ? childToChange.dashboard.children.filter(child => childToChange !== child)\n : [];\n this.child = childToChange;\n }\n\n get resize$() {\n return this.child.dragSource.moved.pipe(\n map(move => this.getPixelSize(move)),\n tap(resizeDimension => this.setPixelSize(resizeDimension)),\n map(resizeDimension => this.getDimensionSize(resizeDimension)),\n distinctUntilChanged(\n (prev, next) => prev.width === next.width && prev.height === next.height\n ),\n map(dimension => this.setDimension(dimension)),\n this.arrangePipe()\n );\n }\n\n get drag$() {\n return this.child.dragSource.moved.pipe(\n map(move => this.getDimensionPosition(move)),\n filter(\n dimension =>\n dimension.x >= 0 &&\n dimension.x <= this.dashboard.columns - this.child.width &&\n dimension.y >= 0\n ),\n distinctUntilChanged((prev, next) => prev.x === next.x && prev.y === next.y),\n this.arrangePipe()\n );\n }\n\n findFreeDimension() {\n let y = -1;\n let x = 0;\n let found = false;\n const { width, height } = this.child;\n if (width > this.dashboard.columns) {\n throw new Error('The child does not fit on the current dashboard.');\n }\n do {\n x = 0;\n y++;\n while (x + width <= this.dashboard.columns) {\n if (this.getCollided({ x, y, width, height }).length === 0) {\n found = true;\n break;\n }\n x++;\n }\n } while (!found);\n return { x, y, width, height } as DashboardChildDimension;\n }\n\n collapseUpAll(): void {\n return sortBy([this.child, ...this.children], ['y']).forEach(w => {\n const ds = new DashboardChildChange(w);\n const newPosition = ds.collapseUp(w);\n ds.setDimension(newPosition);\n });\n }\n\n arrangeAll(arrange: DashboardChildArrangement) {\n const { current, scan, spacing, origin } = arrange;\n const collided = this.getCollided(current, sortBy(scan, ['y']));\n return collided.map(child => {\n const ds = new DashboardChildChange(child);\n ds.setDimension({ ...child, y: spacing });\n return {\n current: child,\n scan: scan.filter(w => w !== child),\n spacing: child.y + child.height,\n origin\n };\n });\n }\n\n private arrangePipe() {\n return pipe(\n map(\n (dimension: DashboardChildDimension) =>\n ({\n current: dimension,\n scan: this.children,\n spacing: dimension.y + dimension.height,\n origin: { ...dimension }\n } as DashboardChildArrangement)\n ),\n expand((dimensions: DashboardChildArrangement) => this.arrangeAll(dimensions)),\n map(({ origin }) => origin),\n map(dimension => this.setDimension(dimension, true)),\n tap(() => this.collapseUpAll()),\n tap(() => this.dashboard.getLastRow())\n );\n }\n\n private collapseUp(dimension: DashboardChildDimension) {\n let { y } = dimension;\n while (y > 0) {\n if (this.getCollided({ ...dimension, y: y - 1 }).length !== 0) {\n break;\n }\n y--;\n }\n return { ...dimension, y };\n }\n\n private setDimension(dimension: DashboardChildDimension, notIfColliding = false) {\n if (notIfColliding && this.getCollided(dimension).length > 0) {\n return;\n }\n\n this.child.x = dimension.x;\n this.child.y = dimension.y;\n if (\n dimension.width >= this.MIN_WIDTH &&\n dimension.x + dimension.width <= this.dashboard.columns\n ) {\n this.child.width = dimension.width;\n } else if (dimension.width < this.MIN_WIDTH) {\n dimension.width = this.MIN_WIDTH;\n } else {\n dimension.width = this.dashboard.columns - dimension.x;\n }\n if (dimension.height >= this.MIN_HEIGHT) {\n this.child.height = dimension.height;\n } else {\n dimension.height = this.MIN_WIDTH;\n }\n return dimension;\n }\n\n private setPixelSize({ width, height }) {\n if (width >= this.dashboard.columnSize * this.MIN_WIDTH - this.dashboard.gap) {\n this.child.pxWidth = width + this.PIXEL_SIZE_THRESHOLD;\n }\n if (height >= this.dashboard.rowSize * this.MIN_HEIGHT - this.dashboard.gap) {\n this.child.pxHeight = height + this.PIXEL_SIZE_THRESHOLD;\n }\n }\n\n private getPixelSize(moveEvent: CdkDragMove) {\n const draggedElement = moveEvent.source.element.nativeElement.parentNode as HTMLElement;\n if (!this.diffX) {\n const rect = draggedElement.getBoundingClientRect();\n this.diffX = rect.left;\n this.diffY = rect.top;\n }\n const { x, y } = moveEvent.pointerPosition;\n const width = Math.round(x - this.diffX);\n const height = Math.round(y - this.diffY);\n return { width, height, pointer: { x, y } } as DashboardChildResizeDimension;\n }\n\n private getDimensionSize(resizePosition: DashboardChildResizeDimension) {\n const { x, y } = this.child;\n const ds = this.dashboard.dashboardRect;\n const column = this.dashboard.columnSize;\n const row = this.dashboard.rowSize + this.dashboard.gap;\n const width =\n Math.round((resizePosition.pointer.x - ds.left + this.dashboard.gap) / column) - x;\n const height = Math.round((resizePosition.pointer.y - ds.top + this.dashboard.gap) / row) - y;\n return { x, y, width, height } as DashboardChildDimension;\n }\n\n private getDimensionPosition(moveEvent: CdkDragMove) {\n const draggedElement = moveEvent.source.element.nativeElement.nextElementSibling;\n if (!this.diffX) {\n const rect = draggedElement.getBoundingClientRect();\n this.diffX = moveEvent.pointerPosition.x - rect.left;\n this.diffY = moveEvent.pointerPosition.y - rect.top;\n }\n\n const left = moveEvent.pointerPosition.x - this.diffX;\n const top = moveEvent.pointerPosition.y - this.diffY;\n const { width, height } = this.child;\n const ds = this.dashboard.dashboardRect;\n const column = this.dashboard.columnSize;\n const row = this.dashboard.rowSize + this.dashboard.gap / 2;\n const x = Math.round((left - ds.left) / column);\n const y = Math.round((top - ds.top) / row);\n return { x, y, width, height } as DashboardChildDimension;\n }\n\n private doesCollide(a: DashboardChildDimension, b: DashboardChildDimension) {\n if (b.x === undefined) {\n return false;\n }\n return !(\n a.y + a.height - 1 < b.y ||\n a.y > b.y + b.height - 1 ||\n a.x + a.width - 1 < b.x ||\n a.x > b.x + b.width - 1\n );\n }\n\n private getCollided(currentDimension: DashboardChildDimension, dimensions = this.children) {\n const collided = dimensions.filter(dimension => this.doesCollide(currentDimension, dimension));\n return collided;\n }\n}\n","import { CdkDrag, CdkDragEnd, CdkDragStart } from '@angular/cdk/drag-drop';\nimport {\n Component,\n forwardRef,\n HostBinding,\n Inject,\n Input,\n ContentChildren,\n Output,\n EventEmitter,\n ElementRef\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { Subscription } from 'rxjs';\nimport { DashboardComponent } from './dashboard.component';\nimport { DashboardChildDimension, Widget } from './dashboard.model';\nimport { DashboardChildChange } from './dashboard-child-change';\nimport { DashboardChildActionComponent } from './dashboard-child-action.component';\n\n/**\n * A dashboard child allows to position elements\n * correctly on a grid. The user can then resize and\n * rearrange the elements, as long as they are not `frozen`.\n *\n * By setting `c8y-dashboard-child-actions` and\n * `c8y-dashboard-child-title` on the element you can add\n * custom actions or a custom title to the current child.\n *\n * By adding the correct branded classes, you can define\n * the look and feel of the child. By default it is displayed\n * as a card.\n *\n * Example:\n *\n * ```html\n * <c8y-dashboard-child\n * #cpWidget3\n * [isFrozen]=\"isFrozen\"\n * [x]=\"0\"\n * [y]=\"3\"\n * [width]=\"4\"\n * [height]=\"4\"\n * [class]=\"'card-dashboard panel-content-transparent'\"\n * >\n * <c8y-dashboard-child-title *ngIf=\"showTitle\">\n * <span>Transparent!</span>\n * </c8y-dashboard-child-title>\n * <c8y-dashboard-child-action>\n * <a href=\"\" (click)=\"showTitle = !showTitle; (false)\">\n * <i [c8yIcon]=\"'heading'\"></i> Hide/show title\n * </a>\n * </c8y-dashboard-child-action>\n * <c8y-dashboard-child-action>\n * <a href=\"\" (click)=\"cpWidget3.isFrozen = !cpWidget3.isFrozen; (false)\">\n * <i [c8yIcon]=\"cpWidget3.isFrozen ? 'lock' : 'unlock'\"></i> Toggle freeze\n * </a>\n * </c8y-dashboard-child-action>\n * x: {{ cpWidget3.x }}<br />\n * y: {{ cpWidget3.y }}<br />\n * width: {{ cpWidget3.width }}<br />\n * height: {{ cpWidget3.height }}<br />\n * </c8y-dashboard-child>\n * ```\n */\n@Component({\n selector: 'c8y-dashboard-child',\n templateUrl: './dashboard-child.component.html',\n host: {\n class: 'dashboard-grid-child'\n }\n})\nexport class DashboardChildComponent implements DashboardChildDimension {\n @ContentChildren(DashboardChildActionComponent) actions = [];\n dragSource: CdkDrag;\n isResize = false;\n isDragging = false;\n klasses = {};\n\n _pxWidth = '100%';\n _pxHeight = '100%';\n\n /**\n * The x position of the child.\n */\n @Input() x;\n\n /**\n * The y position of the child.\n */\n @Input() y;\n\n /**\n * The width of the component in grid-columns.\n */\n @Input() width = 1;\n\n /**\n * The height of the component in grid-rows.\n */\n @Input() height = 1;\n\n /**\n * The data object can be used as a dataTransfer object for events of the child.\n */\n @Input() data: Widget | any;\n\n /**\n * The margin of the child in pixel.\n */\n @Input() margin = 12;\n\n /**\n * If a dashboard is frozen, all children cannot be moved\n * or resized.\n */\n @Input() isFrozen = false;\n\n /**\n * The child content is initialized, as soon it is scrolled into viewport\n */\n @Input() useIntersection = false;\n\n /**\n * An event fired if a child change is started (dragging or resizing)\n */\n @Output() changeStart = new EventEmitter<DashboardChildComponent>();\n\n /**\n * An event fired if a child change is ended\n */\n @Output() changeEnd = new EventEmitter<DashboardChildComponent>();\n\n /**\n * All classes added to this child\n */\n @Input()\n class: string[] | { [key: string]: boolean } = {};\n\n /**\n * Updates the pixel width of the child (used for resizing)\n */\n set pxWidth(value) {\n this._pxWidth = `${value}px`;\n }\n\n /**\n * Updates the pixel height of the child (used for resizing)\n */\n set pxHeight(value) {\n this._pxHeight = `${value}px`;\n }\n\n /**\n * An indicator if the child is intersected (that mean visible for the user)\n */\n intersected = false;\n\n /**\n * nasty workaround for that issue:\n * https://github.com/angular/angular/issues/9343\n */\n @HostBinding('attr.style')\n get inlineStyle() {\n return this.sanitizer.bypassSecurityTrustStyle(`\n grid-column-start: ${this.x + 1};\n -ms-grid-column: ${this.x + 1};\n grid-row-start: ${this.y + 1};\n -ms-grid-row: ${this.y + 1};\n grid-column-end: span ${this.width};\n -ms-grid-column-span: ${this.width};\n grid-row-end: span ${this.height};\n -ms-grid-row-span: ${this.height};\n display: block;\n margin: ${this.margin || 12}px;\n order: ${this.getOrder()};\n `);\n }\n\n /**\n * The observable subscription which is listen to\n * on changes (drag or resize).\n */\n changeSubscription: Subscription;\n\n constructor(\n @Inject(forwardRef(() => DashboardComponent)) public dashboard: DashboardComponent,\n private sanitizer: DomSanitizer,\n private element: ElementRef\n ) {}\n\n ngOnChanges(): void {\n this.klasses = {\n card: true,\n 'card-dashboard': true,\n disabled: this.isFrozen,\n 'on-resize': this.isResize,\n ...this.class\n };\n }\n\n ngOnInit(): void {\n if (this.x === undefined || this.y === undefined) {\n setTimeout(() => this.setDynamicDimension());\n }\n if (this.useIntersection && 'IntersectionObserver' in window) {\n const intersectionObserver = new IntersectionObserver(\n event => (this.intersected = this.childInView(event[0], intersectionObserver))\n );\n intersectionObserver.observe(this.element.nativeElement);\n } else {\n this.intersected = true;\n }\n }\n\n setDynamicDimension() {\n const ds = new DashboardChildChange(this);\n const { x, y } = ds.findFreeDimension();\n this.x = x;\n this.y = y;\n }\n\n resizeStarted($event: CdkDragStart) {\n this.isResize = true;\n this.dashboard.updateRectSize();\n this.dragSource = $event.source;\n const positioning = new DashboardChildChange(this);\n this.changeSubscription = positioning.resize$.subscribe();\n this.changeStart.emit(this);\n this.ngOnChanges();\n }\n\n dragStarted($event: CdkDragStart) {\n this.isDragging = true;\n this.dashboard.updateRectSize();\n this.dragSource = $event.source;\n const positioning = new DashboardChildChange(this);\n this.changeSubscription = positioning.drag$.subscribe();\n this.changeStart.emit(this);\n }\n\n reset($event?: CdkDragEnd) {\n this.isResize = false;\n this.isDragging = false;\n this._pxWidth = '100%';\n this._pxHeight = '100%';\n this.ngOnChanges();\n if ($event) {\n $event.source.reset();\n }\n if (this.changeSubscription) {\n this.changeSubscription.unsubscribe();\n this.dashboard.emitChange(this);\n this.changeEnd.emit(this);\n }\n }\n\n private getOrder() {\n return `${Math.round((this.y + (this.x + 1) / 100) * 100)}`;\n }\n\n private childInView(event, observer) {\n if (event.isIntersecting) {\n observer.unobserve(event.target);\n return true;\n }\n return false;\n }\n}\n","import { Component, EventEmitter, Input, Output, SimpleChanges } from '@angular/core';\nimport { DashboardSettings, Widget, WidgetChange, DashboardChange } from './dashboard.model';\nimport { DashboardComponent } from './dashboard.component';\nimport { BreadcrumbItem } from '../..';\n\n@Component({\n selector: 'c8y-widgets-dashboard',\n templateUrl: './widgets-dashboard.component.html',\n host: {\n style: `\n display: block;\n `,\n class: 'dashboard c8y-grid-dashboard'\n }\n})\nexport class WidgetsDashboardComponent {\n @Input()\n widgets: Widget[];\n\n @Input()\n context: any;\n\n @Input()\n contextDashboard: any;\n\n @Input('settings')\n set _settings(settings: Partial<DashboardSettings>) {\n this.settings = { ...this.settings, ...settings };\n }\n\n @Input()\n breadcrumb: BreadcrumbItem;\n\n settings: DashboardSettings = {\n isFrozen: false,\n isDisabled: false,\n widgetMargin: 12,\n translateWidgetTitle: false,\n defaultHeight: 4,\n defaultWidth: 4,\n allowFullscreen: false,\n canDelete: true,\n isLoading: false,\n };\n\n @Output()\n onAddWidget: EventEmitter<DashboardComponent> = new EventEmitter();\n\n @Output()\n onEditWidget: EventEmitter<WidgetChange> = new EventEmitter();\n\n @Output()\n onDeleteWidget: EventEmitter<WidgetChange> = new EventEmitter();\n\n @Output()\n onChangeDashboard: EventEmitter<DashboardChange> = new EventEmitter();\n\n @Output()\n onEditDashboard: EventEmitter<DashboardComponent> = new EventEmitter();\n\n @Output()\n onDeleteDashboard: EventEmitter<DashboardComponent> = new EventEmitter();\n\n @Output()\n onFreeze: EventEmitter<DashboardSettings> = new EventEmitter();\n\n @Output()\n onChangeStart: EventEmitter<WidgetChange> = new EventEmitter();\n\n @Output()\n onChangeEnd: EventEmitter<WidgetChange> = new EventEmitter();\n\n toggleFullscreen() {\n const elem = document.body as any;\n const doc = document as any;\n if (!this.fullScreen()) {\n if (elem.requestFullscreen) {\n elem.requestFullscreen();\n } else if (elem.msRequestFullscreen) {\n elem.msRequestFullscreen();\n } else if (elem.mozRequestFullScreen) {\n elem.mozRequestFullScreen();\n } else if (elem.webkitRequestFullscreen) {\n elem.webkitRequestFullscreen((Element as any).ALLOW_KEYBOARD_INPUT);\n }\n } else if (doc.exitFullscreen) {\n doc.exitFullscreen();\n } else if (doc.msExitFullscreen) {\n doc.msExitFullscreen();\n } else if (doc.mozCancelFullScreen) {\n doc.mozCancelFullScreen();\n } else if (doc.webkitExitFullscreen) {\n doc.webkitExitFullscreen();\n }\n }\n\n fullScreen() {\n const doc: any = document;\n return !!(\n doc.fullscreenElement ||\n doc.mozFullScreenElement ||\n doc.webkitFullscreenElement ||\n doc.msFullscreenElement\n );\n }\n}\n","import { DragDropModule } from '@angular/cdk/drag-drop';\nimport { NgModule } from '@angular/core';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { ActionBarModule } from '../action-bar/action-bar.module';\nimport { CommonModule } from '../common/common.module';\nimport { DynamicComponentModule } from '../dynamic-component/dynamic-component.module';\nimport { DashboardChildActionComponent } from './dashboard-child-action.component';\nimport { DashboardChildTitleComponent } from './dashboard-child-title.component';\nimport { DashboardChildComponent } from './dashboard-child.component';\nimport { DashboardComponent } from './dashboard.component';\nimport { WidgetsDashboardComponent } from './widgets-dashboard.component';\nimport { HeaderModule } from '../header/header.module';\nimport { DocsModule } from '../docs/docs.module';\nimport { BreadcrumbModule } from '../breadcrumb/breadcrumb.module';\n\n@NgModule({\n declarations: [\n DashboardChildComponent,\n DashboardComponent,\n DashboardChildTitleComponent,\n DashboardChildActionComponent,\n WidgetsDashboardComponent\n ],\n imports: [\n CommonModule,\n ActionBarModule,\n DynamicComponentModule,\n DragDropModule,\n BsDropdownModule.forRoot(),\n HeaderModule,\n DocsModule,\n BreadcrumbModule,\n ],\n exports: [\n DashboardComponent,\n DashboardChildComponent,\n DashboardChildTitleComponent,\n DashboardChildActionComponent,\n WidgetsDashboardComponent\n ]\n})\nexport class DashboardModule {}\n","import { Directive, Input, TemplateRef } from '@angular/core';\nimport { StepState } from '@angular/cdk/stepper';\n\n/**\n * Template to be used to override the icons inside the step header.\n */\n@Directive({\n selector: 'ng-template[c8yStepperIcon]'\n})\nexport class C8yStepperIcon {\n /** Name of the icon to be overridden. */\n @Input('c8yStepperIcon') name: StepState;\n\n constructor(public templateRef: TemplateRef<any>) {}\n}\n","import {\n Component,\n TemplateRef,\n Input,\n Output,\n ContentChildren,\n QueryList,\n AfterContentInit,\n OnDestroy,\n EventEmitter\n} from '@angular/core';\nimport { CdkStepper, StepState, STEP_STATE } from '@angular/cdk/stepper';\nimport { C8yStepperIcon } from './stepper-icon.directive';\nimport { Subject, Subscription } from 'rxjs';\n\n/**\n * C8yStepper extends the CdkStepper. You can use cdk based functionality and inputs.\n * Additional to that you are able to modify the behavior and also the look and feel when\n * using the C8yStepper.\n *\n * The C8yStepper is used to present any step-based process to the user.\n * A stepper, C8yStepper and/or CdkStepper is the parent of cdk-steps.\n * Each cdk-step represents one step in the whole process that you want to provide to the user.\n *\n * The C8yStepper will create, based on the given cdk-steps, a kind of stepper-progress which looks like this:\n * (1)---(2)---(3)---(n)\n * The stepper will handle the state of each step and provides styles for active steps, done-steps or in edit-mode.\n * You are able to override icons for each step in the stepper-progress with a template. You are also able to activate\n * default-icons for states like 'edit' and 'done'.\n *\n * To force users through every provided step, set the stepper to 'linear'.\n * This will disable the possibility to move for example from step one to step three.\n *\n * Whenever it comes to validation try to use formGroups. It is possible to\n * assign a formGroup to a cdk-step input called [stepControl], which automatically respects the\n * validation-rules that you created for this formGroup. If fields are required but not filled or\n * any other validation, like a pattern, is not matched the formGroup will be invalid. In this case\n * stepping in a linear stepper to the next step gets impossible.\n *\n * If there is the need to execute asynchronous code you have at least two possibilities.\n * First: As you learned, a cdk-step works with formGroups and Validators, so you are able to use\n * asyncValidators as well.\n * Second: The C8yStepper provides an event-emitter onStepChange which is called whenever a step-button (1)--(2)--(n)\n * in the stepper-progress is clicked. The event of this emitter holds the index of the step as number. You can\n * use this EventEmitter to call for example a custom navigate-method which performs first any async-call and then moves\n * on to the given step.\n *\n * @example\n * ```\n * <c8y-stepper\n * (onStepChange)=\"navigate($event)\"\n * [disableDefaultIcons]=\"{ edit: true, done: false }\"\n * [customClasses]=\"['m-l-40', 'm-r-40', 'm-t-32']\"\n * linear\n * >\n * <!-- override icons -->\n * <ng-template c8yStepperIcon=\"final\">\n * <span [c8yIcon]=\"'hand-peace-o'\"></span>\n * </ng-template>\n *\n * <cdk-step [stepControl]=\"formGroupStepOne\" label=\"Name of the hero\">\n * <div class=\"m-l-40 m-r-40 m-t-32\">\n * <h4 class=\"p-b-8\" translate>What is the name of your hero?</h4>\n * <c8y-form-group>\n * <div [formGroup]=\"formGroupStepOne\">\n * <input\n * class=\"form-control\"\n * type=\"text\"\n * formControlName=\"name\"\n * placeholder=\"Mister X\"\n * #nameRef\n * required\n * />\n * <c8y-messages>\n * <c8y-message *ngIf=\"!formGroupStepOne.untouched && !nameRef.value\" translate\n * >Enter the name of the Superhero</c8y-message\n * >\n * </c8y-messages>\n * </div>\n * </c8y-form-group>\n * </div>\n * <c8y-stepper-buttons></c8y-stepper-buttons>\n * </cdk-step>\n * <cdk-step>\n * ...\n * </cdk-step state=\"final\">\n * </c8y-stepper>\n * ```\n */\n@Component({\n selector: 'c8y-stepper',\n templateUrl: './stepper.component.html',\n providers: [{ provide: CdkStepper, useExisting: C8yStepper }]\n})\nexport class C8yStepper extends CdkStepper implements AfterContentInit, OnDestroy {\n /**\n * Optional\n * Indicator if icons for edit and done state should be shown in step-header buttons\n */\n @Input() disableDefaultIcons?: { edit: boolean; done: boolean } = { edit: true, done: true };\n /**\n * Optional\n * Possibility to add any kind of custom css classes to the step-header\n */\n @Input() customClasses?: [string];\n /**\n * Will emit the step index number whenever a step-header button was clicked\n * It listens to the stepIndex Subject.\n */\n @Output() onStepChange = new EventEmitter<number>();\n\n /**\n * Holding a QueryList of C8yStepperIcons\n * These are templateRefs which overrides any step-header button icon with matching state of cdk-step\n *\n * @example:\n * ```\n * <!-- override icons -->\n * <ng-template c8yStepperIcon=\"final\">\n * <span [c8yIcon]=\"'hand-peace-o'\"></span>\n * </ng-template>\n *\n * <cdk-step state=\"final\" label=\"Job done!\">\n * <div class=\"m-l-40 m-r-40 m-t-32\">\n * <h4 class=\"p-b-32\" style=\"text-align: center;\" translate>\n * Your Superhero is now ready to save the world!\n * </h4>\n * </div>\n * <c8y-stepper-buttons\n * [hidden]=\"!isModal\"\n * (onBack)=\"close()\"\n * [labels]=\"{ back: 'Got it!' }\"\n * ></c8y-stepper-buttons>\n * <c8y-stepper-buttons [hidden]=\"isModal\"></c8y-stepper-buttons>\n * </cdk-step>\n * ```\n */\n @ContentChildren(C8yStepperIcon, { descendants: true }) _icons: QueryList<C8yStepperIcon>;\n\n /** Consumer-specified template-refs to be used to override the header icons. */\n _iconOverrides: { [key: string]: TemplateRef<any> } = {};\n\n private _stepIndex: Subject<number> = new Subject();\n private _stepIndexSubscription: Subscription;\n\n ngAfterContentInit() {\n this._icons.forEach(({ name, templateRef }) => (this._iconOverrides[name] = templateRef));\n this._stepIndexSubscription = this._stepIndex.subscribe(index => this.onStepChange.emit(index));\n }\n\n ngOnDestroy() {\n if (this._stepIndexSubscription && !this._stepIndexSubscription.closed) {\n this._stepIndexSubscription.unsubscribe();\n }\n }\n\n /**\n * Manipulates the state based on the disabledDefaultIcons Input()\n * Changing edit or done to false will change the icons within step-header buttons\n * @param index step index\n * @param state step state, like 'done', 'edit', 'error'\n */\n getIndicatorType(index: number, state: StepState) {\n const stepState = this._getIndicatorType(index, state);\n let _state = state;\n switch (stepState) {\n case STEP_STATE.EDIT:\n if (!this.disableDefaultIcons.edit) {\n _state = STEP_STATE.EDIT;\n }\n break;\n\n case STEP_STATE.DONE:\n if (!this.disableDefaultIcons.done) {\n _state = STEP_STATE.DONE;\n } else {\n _state = '_done';\n }\n break;\n }\n return _state;\n }\n\n /**\n * Pushs the step index to the subject\n * @param index step index\n */\n setIndex(index: number) {\n this._stepIndex.next(index);\n }\n}\n","import { Component, Input, Output, TemplateRef, EventEmitter } from '@angular/core';\nimport { StepState } from '@angular/cdk/stepper';\n\n@Component({\n selector: 'c8y-stepper-progress',\n templateUrl: './stepper-progress.component.html'\n})\nexport class C8yStepperProgress {\n /** List of overriden icons as TemplateRef. Also default icons could be overriden.\n * The given overriden icons will replace an icon with matching state: StepState\n *\n * <ng-container\n * *ngSwitchCase=\"true\"\n * [ngTemplateOutlet]=\"iconOverrides[state]\"\n * ></ng-container>\n *\n */\n @Input() iconOverrides: { [key: string]: TemplateRef<any> };\n /** The index of the current step */\n @Input() index: number;\n /** Whether the step is cuurently selected or not */\n @Input() selected: boolean;\n /** The current state of the step */\n @Input() state: StepState;\n\n /** Emits the index: number of the step which was clicked */\n @Output() onStepClicked = new EventEmitter<number>();\n\n /** Called on click and emits the step index */\n stepSelected() {\n this.onStepClicked.emit(this.index);\n }\n}\n","import { CdkStep } from '@angular/cdk/stepper';\nimport {\n AfterContentInit,\n Component,\n EventEmitter,\n Host,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { C8yStepper } from './stepper.component';\n\n/**\n * C8yStepperButtons provides a convinient way to have, according to\n * the C8yStepper and each cdk-step, buttons to navigate between steps or to cancel the whole\n * step-process. Buttons rendered with the help of this component will use the branding css.\n *\n * By default all steps with this component in use will render a next button, expect the last step.\n * The other way around, every step using this component will render a back button, expect the first step.\n * To get a cancel button rendered you need to handle the onCancel event.\n * For next and back button you don't need to handle the available events onNext and onBack because default behavior\n * is implemented. The default will just call, according to the button, the stepper.next() or stepper.previous()\n * methods and moves the stepper forth or back. Using the EventEmitter onNext and onBack will emit for you the following\n * object: {stepper: C8yStepper, step: CdkStep}. This is useful if you need to implement custom logic before moving\n * to the next step or sending data to a backend. In this case you need to tell the stepper to move forward or back\n * on your own.\n *\n * With the component input [labels] you can change the label of each button in each step. It takes an object like this:\n * {next?: string, back?: string, cancel?: string}\n *\n * The [pending] input is of type boolean and will enable css animation for the next button when true.\n *\n * If the cdk-step provides a stepControl the component will set the next button disabled when the formGroup\n * behind it is invalid. As long as the [pending] input is true the back and next button is also disabled.\n * This will prevent multiple clicks while running a request or stepping back while a request is ongoing.\n *\n * @example\n * ```\n * <c8y-stepper>\n * <cdk-step>\n * <!--\n * your html code\n * ...\n * ... -->\n * <c8y-stepper-buttons\n * (onNext)=\"save()\"\n * [labels]=\"{ next: 'Save' }\"\n * [pending]=\"pendingStatus\"\n * ></c8y-stepper-buttons>\n * </cdk-step>\n * </c8y-stepper>\n *\n * // in your component:\n * async save() {\n * this.pendingStatus = true;\n * // your async request goes here ...\n * // await something();\n * this.pendingStatus = false;\n * this.stepper.next();\n * }\n * ```\n */\n@Component({\n selector: 'c8y-stepper-buttons',\n templateUrl: './stepper-buttons.component.html'\n})\nexport class C8yStepperButtons implements AfterContentInit, OnDestroy, OnChanges {\n /**\n * Optional\n * Specify custom labels for each button (cancel, back or next)\n */\n @Input() labels?: { cancel?: string; back?: string; next?: string; custom?: string };\n /**\n * Optional\n * Indicates if a request is pending and sets the next button\n * to disabled when true\n */\n @Input() pending?: boolean = false;\n\n /**\n * Disabled state of a button\n */\n @Input() disabled?: boolean = false;\n\n /**\n * EventEmitter which emits when cancel button is clicked\n */\n @Output() onCancel = new EventEmitter();\n /**\n * EventEmitter which emits {stepper: C8yStepper; step: CdkStep} when next button is clicked.\n */\n @Output() onNext = new EventEmitter<{ stepper: C8yStepper; step: CdkStep }>();\n\n /**\n * EventEmitter which emits {stepper: C8yStepper; step: CdkStep} when back button is clicked.\n */\n @Output() onBack = new EventEmitter<{ stepper: C8yStepper; step: CdkStep }>();\n\n /**\n * EventEmitter which emits when the optional custom button is clicked\n */\n @Output() onCustom = new EventEmitter();\n\n /**\n * Indicator which button should be shown.\n * Based on the cdk-steps within the c8y-stepper\n * next and back buttons are rendered.\n */\n showBtns = {\n cancel: false,\n back: false,\n next: false,\n custom: false\n };\n\n private statusChangeSubscription: Subscription;\n\n constructor(@Host() private stepper: C8yStepper, @Host() private step: CdkStep) {}\n\n ngAfterContentInit() {\n this.showBtns.cancel = this.onCancel.observers.length > 0;\n this.showBtns.custom = this.onCustom.observers.length > 0;\n\n if (this.stepper && this.stepper.steps && this.step) {\n this.showBtns.back = this.stepper.steps.first !== this.step;\n this.showBtns.next = this.stepper.steps.last !== this.step;\n }\n\n if (this.step && this.step.stepControl) {\n this.disabled = this.step.stepControl.invalid;\n\n this.statusChangeSubscription = this.step.stepControl.statusChanges.subscribe(status => {\n this.disabled = this.step.stepControl.invalid;\n });\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n /**\n * Disable save/next button while the status is pending\n * This will prevent multiple clicks and therefore multiple requests\n */\n if (changes && changes.pending) {\n this.disabled = changes.pending.currentValue;\n }\n }\n\n ngOnDestroy() {\n if (this.statusChangeSubscription && !this.statusChangeSubscription.closed) {\n this.statusChangeSubscription.unsubscribe();\n }\n }\n\n /**\n * Gets called when cancel button is clicked.\n * It will emit immediate.\n */\n cancel() {\n this.onCancel.emit();\n }\n\n /**\n * Gets called when next button is clicked. When onNext EventEmitter has an observer registered\n * it will emit the following object {stepper: C8yStepper; step: CdkStep}.\n * Otherwise it will call stepper.next() as default.\n */\n next() {\n if (this.onNext.observers.length > 0) {\n this.onNext.emit({ stepper: this.stepper, step: this.step });\n } else {\n this.stepper.next();\n }\n }\n\n /**\n * Gets called when back button is clicked. When onBack EventEmitter has an observer registered\n * it will emit the following object {stepper: C8yStepper; step: CdkStep}.\n * Otherwise it will call stepper.previous() as default.\n */\n back() {\n this.stepper.selected.completed = false;\n if (this.onBack.observers.length > 0) {\n this.onBack.emit({ stepper: this.stepper, step: this.step });\n } else {\n this.stepper.previous();\n }\n }\n\n /**\n * Gets called when the custom button is clicked.\n * It will emit immediately.\n */\n custom() {\n this.onCustom.emit();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CdkStepperModule, CdkStep, STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';\nimport { C8yStepper } from './stepper.component';\nimport { CommonModule } from '../common/common.module';\nimport { C8yStepperIcon } from './stepper-icon.directive';\nimport { C8yStepperProgress } from './stepper-progress.component';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { C8yStepperButtons } from './stepper-buttons.component';\n\n/**\n * The angular module definition for c8y-stepper (Wizard).\n * @exports C8yStepper\n * @exports C8yStepperIcon\n * @exports C8yStepperButtons\n * @exports CdkStep\n */\n@NgModule({\n imports: [CommonModule, CdkStepperModule, TooltipModule],\n declarations: [C8yStepper, C8yStepperIcon, C8yStepperProgress, C8yStepperButtons],\n exports: [C8yStepper, CdkStep, C8yStepperIcon, C8yStepperButtons],\n providers: [\n {\n /**\n * This emables additional states, like: edit, done and error\n * These states are used to display custom icons, if needed.\n * Any change in here will most probably result in not showing custom icons anymore\n */\n provide: STEPPER_GLOBAL_OPTIONS,\n useValue: { displayDefaultIndicatorType: false }\n }\n ]\n})\nexport class StepperModule {}\n","import { Component, Output, Input, ViewChild, EventEmitter } from '@angular/core';\n\n/**\n * Actions are functions that can be executed on the\n * current list item. They are displayed next to the\n * item and can be grouped in a dropdown.\n *\n * @example\n * ```html\n * <c8y-li>\n * <c8y-li-action (click)=\"deleteDevice(device.id)\" icon=\"times\">\n * Delete\n * </c8y-li-action>\n * <c8y-li-action (click)=\"(false)\" icon=\"rocket\">\n * Launch to space\n * </c8y-li-action>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-action, c8y-li-action',\n templateUrl: './list-item-action.component.html'\n})\nexport class ListItemActionComponent {\n /**\n * @ignore\n */\n @ViewChild('template', { static: false })\n template: any;\n /**\n * The label to display (you can alternatively use\n * content projection to display the label).\n */\n @Input()\n label: string;\n /**\n * The name of the icon to use\n */\n @Input()\n icon: string;\n /**\n * An EventEmitter to determine what to do if the\n * action is triggered.\n */\n @Output()\n click = new EventEmitter<any>();\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * Display collapsed content on a list item. Can be\n * used for more detailed information. Use it with\n * content projection.\n *\n * @example\n * ```html\n * <c8y-li>\n * <c8y-collapsed>\n * <strong>I am only visible if extended</strong>\n * </c8y-collapsed>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-collapse, c8y-li-collapse',\n templateUrl: './list-item-collapse.component.html'\n})\nexport class ListItemCollapseComponent {\n /**\n * The way how to toggle collapse state.\n * button (default) - additional button for toggle collapse state\n * row - toggling collapse state by clicking to entire row.\n */\n @Input()\n collapseWay: 'button' | 'row' = 'button';\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * The footer can be used with either content projection\n * or a simple string as an input.\n *\n * @example\n * ```html\n * <c8y-li>\n * Content\n * <c8y-li-footer>I am a footer</c8y-li-footer>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-footer, c8y-li-footer',\n templateUrl: './list-item-footer.component.html'\n})\nexport class ListItemFooterComponent {\n /**\n * A simple string that can be used instead\n * of content projection.\n */\n @Input()\n footer: string;\n}\n","import {\n Component,\n ContentChild,\n ElementRef,\n ContentChildren,\n HostBinding,\n Input,\n Output,\n EventEmitter,\n QueryList\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil, filter, tap, delay } from 'rxjs/operators';\nimport { ListItemActionComponent } from './list-item-action.component';\nimport { ListItemCollapseComponent } from './list-item-collapse.component';\nimport { ListItemFooterComponent } from './list-item-footer.component';\n\n/**\n * A list item is a representation of an item inside a list and\n * can be used to compose different styles in a list (mainly in a\n * <c8y-group-list>-component but also in others like the\n * <c8y-typeahead>-component):\n * - a list with a footer\n * - a list with one or multiple actions\n * - an icon\n * - a checkbox or radio input\n *\n * The item can be composed via content projection. The following\n * example shows a radio list with an icon, two actions\n * and a footer:\n * ```html\n * <c8y-list-group>\n * <c8y-li\n * *c8yFor=\"\n * let device of devices;\n * let i = index;\n * \"\n * >\n * <c8y-li-radio (onSelect)=\"updateSelected($event, device)\"></c8y-li-radio>\n * <c8y-li-icon [icon]=\"'rocket'\"></c8y-li-icon>\n * {{ i + 1 }}. {{ device.name || '-' }}\n * <c8y-li-footer>\n * Device id: <a [routerLink]=\"['/device', device.id]\">{{ device.id }}</a>\n * </c8y-li-footer>\n * <c8y-li-action (click)=\"deleteDevice(device.id)\" icon=\"times\">\n * Delete\n * </c8y-li-action>\n * <c8y-li-action (click)=\"(false)\" icon=\"rocket\">\n * Launch to space\n * </c8y-li-action>\n * </c8y-li>\n * </c8y-list-group>\n * ```\n */\n@Component({\n selector: 'c8y-list-item, c8y-li',\n templateUrl: './list-item.component.html',\n host: {\n class: 'c8y-list__item'\n }\n})\nexport class ListItemComponent {\n /**\n * If set to true, the class \"active\" is added which\n * indicates that the current row is active.\n */\n @Input()\n @HostBinding('class.active')\n active: boolean = false;\n\n /**\n * Indicates if the current list item is collapsed. You can trigger the collapsing from\n * any element event by toggling this value.\n *\n * @example\n * ```html\n * <c8y-li #li (click)=\"li.collapsed = !li.collapsed\">\n * Toggle\n * <c8y-li-collapse>\n * I can be toggled by clicking on the row.\n * </c8y-li-collapse\n * </c8y-li>\n * ``\n */\n @Input()\n collapsed: boolean = true;\n\n /**\n * An event emitter which is triggered when the user collapses the content\n * via the chevron on the right.\n */\n @Output()\n collapsedChange = new EventEmitter<boolean>();\n\n /**\n * A [[ListItemFooterComponent]] element which can be used to show a footer.\n * @example\n * ```html\n * <c8y-li>\n * I am the main content\n * <c8y-li-footer>\n * I am the footer content\n * </c8y-li-footer>\n * </c8y-li>\n * ```\n */\n @ContentChild(ListItemFooterComponent, { static: false })\n itemFooter: ListItemFooterComponent;\n\n /**\n * [[ListItemActionComponent]] elements which can be used to show an action.\n * An action is displayed on the right in the dropdown and usually consists of an\n * icon and a label.\n * @example\n * ```html\n * <c8y-li>\n * I am the main content\n * <c8y-li-action (click)=\"launchToSpace(device.id)\" icon=\"rocket\">\n * Launch\n * </c8y-li-action>\n * <c8y-li-action (click)=\"deleteDevice(device.id)\" icon=\"times\">\n * Delete\n * </c8y-li-action>\n * </c8y-li>\n * ```\n */\n @ContentChildren(ListItemActionComponent)\n itemActions: QueryList<ListItemActionComponent>;\n\n /**\n * [[ListItemCollapseComponent]] elements which can be used to show detail views.\n * @example\n * ```html\n * <c8y-li>\n * I am the main content\n * <c8y-li-collapse>\n * I am detailed content\n * </c8y-li-collapse>\n * </c8y-li>\n * ```\n */\n @ContentChild(ListItemCollapseComponent, { static: false })\n itemCollapse: ListItemCollapseComponent;\n\n /**\n * @ignore\n */\n showFooter: boolean = false;\n /**\n * @ignore\n */\n showActions: boolean = false;\n /**\n * @ignore\n */\n showCollapse: boolean = false;\n /**\n * @ignore\n */\n actions: ListItemActionComponent[];\n /**\n * @ignore\n */\n dropdownUp: boolean = false;\n\n private pulse$: Subject<boolean> = new Subject<boolean>();\n private destroy$: Subject<any> = new Subject();\n private readonly ACTION_ITEM_HEIGHT = 40;\n\n /**\n * @ignore\n */\n constructor(public element: ElementRef) {}\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.pulse$\n .pipe(\n filter(apply => !!apply),\n tap(() => this.element.nativeElement.classList.remove('c8y-list--pulse')),\n delay(100),\n tap(() => this.element.nativeElement.classList.add('c8y-list--pulse')),\n takeUntil(this.destroy$)\n )\n .subscribe();\n }\n\n /**\n * @ignore\n */\n ngAfterContentChecked(): void {\n this.actions = this.itemActions.toArray();\n this.showFooter = this.itemFooter != null;\n this.showActions = this.itemActions.length > 0;\n this.showCollapse = this.itemCollapse != null;\n }\n\n /**\n * @ignore\n */\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /**\n * A helper function which helps to determine if the dropdown\n * should toggle up.\n */\n showDropdownUp() {\n const listItemRect: DOMRect = this.element.nativeElement.getBoundingClientRect();\n const dropdownTop = listItemRect.top;\n const dropdownHeightWithToggle = (1 + this.itemActions.length) * this.ACTION_ITEM_HEIGHT;\n const availableHeight = window.innerHeight;\n const dropdownDownFits = dropdownTop + dropdownHeightWithToggle <= availableHeight;\n this.dropdownUp = !dropdownDownFits;\n }\n\n /**\n * Toggles the collapse state and emits this state as\n * collapsedChange output as boolean.\n * @param $event Pass optional an event to stop propagation.\n */\n toggleCollapsed($event?: Event) {\n if ($event) {\n $event.stopPropagation();\n }\n this.collapsed = !this.collapsed;\n this.collapsedChange.emit(this.collapsed);\n }\n\n /**\n * Highlights the list-item. This method should be used to show the\n * user that something within this item was changed.\n */\n pulse() {\n this.pulse$.next(true);\n }\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * The li-body component can be used to define the body.\n * Usually it doesn't need to be used, as it is the default\n * content projected to a <c8y-li>.\n */\n@Component({\n selector: 'c8y-list-item-body, c8y-li-body',\n templateUrl: './list-item-body.component.html'\n})\nexport class ListItemBodyComponent {\n /**\n * An optional string content.\n */\n @Input()\n body: string;\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n SimpleChanges,\n ViewChild,\n forwardRef\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * A component to display a radio button in a c8y-li. Use it with content projection. It\n * can be used standalone or with an ngModel.\n *\n * @example\n * ```html\n * <c8y-li>\n * <c8y-li-radio></c8y-li-radio>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-radio, c8y-li-radio',\n templateUrl: './list-item-radio.component.html',\n host: {\n class: 'c8y-list__item__radio'\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n multi: true,\n useExisting: forwardRef(() => ListItemRadioComponent)\n }\n ]\n})\nexport class ListItemRadioComponent implements ControlValueAccessor {\n /**\n * @ignore\n */\n @ViewChild('radio', { static: true }) radio: ElementRef;\n /**\n * Indicates if the radio is selected.\n */\n @Input()\n selected = false;\n /**\n * The name of the radio (use different names for different radio groups).\n */\n @Input()\n name = 'list_item_radio';\n /**\n * Indicates if the radio is disabled.\n */\n @Input()\n disabled: boolean = false;\n /**\n * An event emitted as soon as the radio is selected.\n */\n @Output()\n onSelect = new EventEmitter<boolean>();\n /**\n * The current value.\n */\n @Input() value: any;\n /**\n * @ignore\n */\n model: any;\n /**\n * @ignore\n */\n onChange: (value: any) => void;\n /**\n * @ignore\n */\n onTouched: () => void;\n\n /**\n * Resets the native radio element.\n */\n reset() {\n this.radio.nativeElement.checked = false;\n }\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.selected && !changes.selected.firstChange) {\n this.onSelect.emit(changes.selected.currentValue);\n }\n }\n\n /**\n * Triggered when the radio is changed.\n * @param checked Should it be checked or not?\n */\n change(checked) {\n this.onSelect.emit(checked);\n this.model = this.value;\n if (this.onChange) {\n this.onChange(this.model);\n }\n if (this.onTouched) {\n this.onTouched();\n }\n }\n\n /**\n * Registers an onChange event.\n */\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n /**\n * Registers an onTouch event.\n */\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n /**\n * @ignore\n */\n writeValue(value: boolean): void {\n this.model = value;\n }\n}\n","import { Component } from '@angular/core';\n\n/**\n * Allows to display a timeline. Should be used with\n * content projection.\n *\n * @example\n * ```html\n * <c8y-list-group>\n * <c8y-li-timeline>\n * 24.April 2020\n * <c8y-li>\n * Hello\n * </c8y-li>\n * </c8y-li-timeline>\n * </c8y-list-group>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-timeline, c8y-li-timeline',\n templateUrl: './list-item-timeline.component.html',\n host: {\n class: 'c8y-list--timeline__item'\n }\n})\nexport class ListItemTimelineComponent {}\n","import { Component, HostBinding, ContentChild } from '@angular/core';\nimport { ListItemTimelineComponent } from './list-item-timeline.component';\n\n/**\n * List groups are flexible and powerful components for displaying\n * both simple lists of elements and complex ones with custom content.\n *\n * @example\n * ```html\n * <c8y-list-group>\n * <c8y-li>\n * Plain <strong>Text</strong>\n * </c8y-li>\n * <c8y-li>\n * <c8y-li-icon [icon]=\"'rocket'\"></c8y-li-icon>\n * Icon\n * </c8y-li>\n * <c8y-li>\n * <c8y-li-radio></c8y-li-radio>\n * Radio\n * </c8y-li>\n * <c8y-li>\n * <c8y-li-checkbox></c8y-li-checkbox>\n * Checkbox\n * </c8y-li>\n * <c8y-li>\n * Content\n * <c8y-li-footer>\n * Footer\n * </c8y-li-footer>\n * </c8y-li>\n * <c8y-li>\n * Content\n * <c8y-li-action icon=\"rocket\">\n * Launch\n * </c8y-li-action>\n * </c8y-li>\n * <c8y-li>\n * Content\n * <c8y-li-collapse>\n * Collapsed content\n * </c8y-li-collapse>\n * </c8y-li>\n * </c8y-list-group>\n * ```\n */\n@Component({\n selector: 'c8y-list-group',\n templateUrl: './list-group.component.html',\n host: {\n class: 'c8y-list__group'\n }\n})\nexport class ListGroupComponent {\n /**\n * @ignore\n */\n @HostBinding('class.c8y-list--timeline')\n timeline: boolean = false;\n\n /**\n * Displays the current list as a timeline. Best used\n * with content projection.\n *\n * @example\n * ```html\n * <c8y-list-group>\n * <c8y-li-timeline>\n * 24.April 2020\n * <c8y-li>\n * Hello\n * </c8y-li>\n * </c8y-li-timeline>\n * </c8y-list-group>\n * ```\n */\n @ContentChild(ListItemTimelineComponent, { static: false })\n timelineComponent: ListItemTimelineComponent;\n\n /**\n * @ignore\n */\n ngAfterContentChecked(): void {\n this.timeline = !!this.timelineComponent;\n }\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * An icon to display on a list item. Use it with content projection.\n *\n * @example\n * ```html\n * <c8y-li>\n * <c8y-li-icon=\"rocket\"></c8y-li-icon>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-icon, c8y-li-icon',\n templateUrl: './list-item-icon.component.html',\n host: {\n class: 'c8y-list__item__icon'\n }\n})\nexport class ListItemIconComponent {\n /**\n * The icon name passed to the `c8yIcon` directive.\n */\n @Input()\n icon: string;\n\n /**\n * A status to change the color of the icon.\n */\n @Input()\n status?:\n | 'statusOk'\n | 'statusUnknown'\n | 'statusAlert'\n | 'statusNok'\n | 'status critical'\n | 'status warning'\n | 'status minor'\n | 'status major';\n}\n","import { Output, EventEmitter, Component, Input, SimpleChanges, forwardRef } from '@angular/core';\nimport { CheckboxControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * A component to display checkboxes in a c8y-li. Use it with content projection. It\n * can be used standalone or with an ngModel.\n *\n * @example\n * ```html\n * <c8y-li>\n * <c8y-li-checkbox></c8y-li-checkbox>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-checkbox, c8y-li-checkbox',\n templateUrl: './list-item-checkbox.component.html',\n host: {\n class: 'c8y-list__item__check'\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n multi: true,\n useExisting: forwardRef(() => ListItemCheckboxComponent)\n }\n ]\n})\nexport class ListItemCheckboxComponent extends CheckboxControlValueAccessor {\n /**\n * Indicates if the checkbox is selected.\n */\n @Input()\n selected = false;\n /**\n * Indicates if the checkbox is disabled.\n */\n @Input()\n disabled = false;\n /**\n * An event emitted as soon as the checkbox is selected.\n */\n @Output()\n onSelect = new EventEmitter<boolean>();\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.selected && !changes.selected.firstChange) {\n this.onSelect.emit(changes.selected.currentValue);\n }\n }\n\n /**\n * Selects the checkbox.\n * @param value The value to pass.\n */\n select(value) {\n this.onSelect.emit(value);\n this.onChange(value);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ListGroupComponent } from './list-group.component';\nimport { ListItemComponent } from './list-item.component';\nimport { CommonModule } from '../common/common.module';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { CollapseModule } from 'ngx-bootstrap/collapse';\nimport { ListItemIconComponent } from './list-item-icon.component';\nimport { ListItemBodyComponent } from './list-item-body.component';\nimport { ListItemFooterComponent } from './list-item-footer.component';\nimport { ListItemActionComponent } from './list-item-action.component';\nimport { ListItemCollapseComponent } from './list-item-collapse.component';\nimport { ListItemCheckboxComponent } from './list-item-checkbox.component';\nimport { ListItemRadioComponent } from './list-item-radio.component';\nimport { ListItemTimelineComponent } from './list-item-timeline.component';\n\n/**\n * The list-group module allows you to compose different styles\n * of lists used in Cumulocity IoT. They can consist of plain\n * text, actions, icons and more.\n *\n * @example\n * ```html\n * <c8y-list-group>\n * <c8y-li>Item 1<c8y-li>\n * <c8y-li>Item 2<c8y-li>\n * </c8y-list-group>\n * ```\n */\n@NgModule({\n imports: [CommonModule, CollapseModule.forRoot(), BsDropdownModule],\n declarations: [\n ListGroupComponent,\n ListItemComponent,\n ListItemIconComponent,\n ListItemBodyComponent,\n ListItemFooterComponent,\n ListItemActionComponent,\n ListItemCollapseComponent,\n ListItemCheckboxComponent,\n ListItemRadioComponent,\n ListItemTimelineComponent\n ],\n exports: [\n ListGroupComponent,\n ListItemComponent,\n ListItemIconComponent,\n ListItemBodyComponent,\n ListItemFooterComponent,\n ListItemActionComponent,\n ListItemCollapseComponent,\n ListItemCheckboxComponent,\n ListItemRadioComponent,\n ListItemTimelineComponent\n ]\n})\nexport class ListGroupModule {}\n","import { Component, Input, OnInit } from '@angular/core';\nimport { AuditService, IAuditRecord, IResultList } from '@c8y/client';\n\n@Component({\n selector: 'c8y-audit-log',\n templateUrl: './audit-log.component.html'\n})\nexport class AuditLogComponent implements OnInit {\n @Input()\n source: string | number;\n\n records: IResultList<IAuditRecord>;\n\n constructor(private audit: AuditService) {}\n\n async ngOnInit() {\n if (this.source) {\n this.records = await this.audit.list({\n withTotalPages: true,\n source: this.source\n });\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { AuditLogComponent } from './audit-log.component';\n\n/** The angular module definition for audit log. */\n@NgModule({\n declarations: [AuditLogComponent],\n imports: [CommonModule],\n exports: [AuditLogComponent]\n})\nexport class AuditLogModule {}\n","/* tslint:disable:max-classes-per-file */\n\nimport { Directive, TemplateRef, Type } from '@angular/core';\n\nimport { Column } from '../data-grid.model';\n\nexport interface CellRendererDef {\n template: TemplateRef<any>;\n}\n\nexport interface CellRendererSpec {\n renderer: TemplateRef<CellRendererContext> | Type<any>;\n context: CellRendererContext;\n}\n\nexport class CellRendererContext {\n value: any;\n item?: any;\n property: Column;\n}\n\n@Directive({ selector: '[c8yCellRendererDef]' })\nexport class CellRendererDefDirective implements CellRendererDef {\n constructor(public template: TemplateRef<any>) {}\n}\n\n@Directive({ selector: '[c8yHeaderCellRendererDef]' })\nexport class HeaderCellRendererDefDirective implements CellRendererDef {\n constructor(public template: TemplateRef<any>) {}\n}\n","/* tslint:disable:max-classes-per-file */\n\nimport { Directive, TemplateRef, Type } from '@angular/core';\nimport { Column, FilterPredicateFunction } from '../data-grid.model';\n\nexport interface FilteringFormRendererSpec {\n renderer: TemplateRef<FilteringFormRendererContext> | Type<any>;\n context: FilteringFormRendererContext;\n}\n\nexport class FilteringFormRendererContext {\n property: Column;\n applyFilter: (filteringModifier: FilteringModifier) => void;\n resetFilter: () => void;\n}\n\nexport interface FilteringModifier {\n filterPredicate?: string | FilterPredicateFunction;\n externalFilterQuery?: string | object;\n}\n\n@Directive({ selector: '[c8yFilteringFormRendererDef]' })\nexport class FilteringFormRendererDefDirective {\n constructor(public template: TemplateRef<any>) {}\n}\n","import { ContentChild, Directive, Input } from '@angular/core';\n\nimport { CellRendererDefDirective, HeaderCellRendererDefDirective } from './cell-renderer';\nimport { FilteringFormRendererDefDirective } from './filtering-form-renderer';\n\n@Directive({ selector: 'c8y-column' })\nexport class ColumnDirective {\n @Input() name: string;\n\n @ContentChild(CellRendererDefDirective, { static: false })\n cellRendererDef: CellRendererDefDirective;\n\n @ContentChild(HeaderCellRendererDefDirective, { static: false })\n headerCellRendererDef: HeaderCellRendererDefDirective;\n\n @ContentChild(FilteringFormRendererDefDirective, { static: false })\n filteringFormRendererDef: FilteringFormRendererDefDirective;\n}\n","import { CollectionViewer, DataSource } from '@angular/cdk/collections';\nimport { IResultList } from '@c8y/client';\nimport { chunk, flow, get, isNil, mapValues, omitBy, orderBy, pick } from 'lodash-es';\nimport { BehaviorSubject, defer, from, isObservable, Observable, of, Subject } from 'rxjs';\nimport { catchError, finalize, map, switchMap, tap } from 'rxjs/operators';\nimport { Column, DataSourceStats, ServerSideDataResult } from './data-grid.model';\n\nexport class GridDataSource implements DataSource<object> {\n loading$: Observable<boolean>;\n data$: Observable<object[]>;\n stats$: Observable<DataSourceStats>;\n selection$: Observable<any>;\n resultList$: Observable<IResultList<object>>;\n\n private loadingSubject = new BehaviorSubject<boolean>(false);\n private dataSourceSubject = new BehaviorSubject<object[]>([]);\n private dataStatsSubject = new BehaviorSubject<DataSourceStats>({\n size: 0,\n filteredSize: 0,\n currentPage: 0,\n currentPageSize: 0,\n firstPageSize: 0\n });\n private dataSelectionSubject = new BehaviorSubject<any>({\n filteredDataIds: []\n });\n private resultListSubject = new Subject<IResultList<object>>();\n\n constructor() {\n this.loading$ = this.loadingSubject.asObservable();\n this.data$ = this.dataSourceSubject.asObservable();\n this.stats$ = this.dataStatsSubject.asObservable();\n this.selection$ = this.dataSelectionSubject.asObservable();\n this.resultList$ = this.resultListSubject.asObservable();\n }\n\n connect(collectionViewer: CollectionViewer): Observable<object[]> {\n return this.data$;\n }\n\n disconnect(collectionViewer: CollectionViewer): void {\n this.loadingSubject.complete();\n this.dataSourceSubject.complete();\n this.dataStatsSubject.complete();\n this.dataSelectionSubject.complete();\n }\n\n loadData({\n rows,\n columns,\n pagination,\n searchText,\n serverSideDataCallback,\n selectable,\n selectionPrimaryKey,\n infiniteScroll,\n reload = false\n }) {\n const clientSideData$ = this.toObservable(rows).pipe(\n map(initialData => {\n let filteredSize = 0;\n let filteredDataIds = [];\n\n const transformedData = flow(\n data => this.doClientSideSearch({ data, columns, searchText }),\n data => this.doClientSideFiltering({ data, columns }),\n data => this.doClientSideSorting({ data, columns }),\n data => {\n filteredSize = data.length;\n filteredDataIds = selectable\n ? data.map(item => item[selectionPrimaryKey])\n : filteredDataIds;\n\n return data;\n },\n data => this.doClientSidePagination({ data, pagination })\n )(initialData);\n\n this.dataStatsSubject.next({\n size: initialData.length,\n filteredSize,\n currentPage: pagination.currentPage,\n currentPageSize: transformedData.length,\n firstPageSize: pagination.pageSize\n });\n this.dataSelectionSubject.next({ filteredDataIds });\n\n return transformedData;\n })\n );\n\n const serverSideData$ = defer(() =>\n this.toObservable(\n serverSideDataCallback({\n columns,\n searchText,\n pagination,\n selection: { enabled: selectable, primaryKey: selectionPrimaryKey }\n })\n )\n ).pipe(\n map((result: ServerSideDataResult) => {\n const { data, paging, size, filteredSize, filteredDataIds } = result;\n\n this.dataStatsSubject.next({\n size,\n filteredSize,\n currentPage: paging.currentPage,\n currentPageSize: data.length,\n nextPage: paging.nextPage,\n firstPageSize: paging.pageSize\n });\n this.dataSelectionSubject.next({ filteredDataIds: filteredDataIds || [] });\n this.resultListSubject.next(result);\n\n return data;\n })\n );\n\n const data$ = typeof serverSideDataCallback === 'function' ? serverSideData$ : clientSideData$;\n\n of([])\n .pipe(\n tap(() => this.loadingSubject.next(true)),\n switchMap(() => data$),\n catchError(err => {\n this.dataStatsSubject.next({\n size: 0,\n filteredSize: 0,\n currentPage: 0,\n currentPageSize: 0,\n firstPageSize: 0\n });\n this.dataSelectionSubject.next({ filteredDataIds: [] });\n return of([]);\n }),\n finalize(() => this.loadingSubject.next(false))\n )\n .subscribe(result => {\n const data =\n infiniteScroll && !reload ? [...this.dataSourceSubject.value, ...result] : result;\n this.dataSourceSubject.next(data);\n });\n }\n\n resolveValue(x, path) {\n return get(x, path);\n }\n\n resolveFunction(x) {\n return typeof x === 'function' ? x() : x;\n }\n\n normalizeNil(x) {\n return isNil(x) ? '' : x;\n }\n\n private doClientSideFiltering({ data, columns }) {\n return columns.reduce((result, column) => {\n const { filterPredicate } = column;\n\n if (typeof filterPredicate === 'string') {\n return this.doClientSideSearch({\n data: result,\n columns: [column],\n searchText: filterPredicate\n });\n }\n\n if (typeof filterPredicate === 'function') {\n return result.filter(item => filterPredicate(item, column.path));\n }\n\n return result;\n }, data);\n }\n\n private doClientSideSearch({ data, columns, searchText }) {\n const propPaths = columns.map(({ path }) => path).filter(column => !isNil(column));\n\n const regexSearch = this.createRegexSearch(searchText);\n\n return data.filter(item => {\n const itemWithResolvedValues = flow(\n x => pick(x, propPaths),\n x => mapValues(x, this.resolveFunction),\n x => omitBy(x, isNil)\n )(item);\n\n const cellValues = Object.values(itemWithResolvedValues);\n\n return cellValues.some(cellValue => regexSearch.test(cellValue.toString()));\n });\n }\n\n private doClientSideSorting({ data, columns }) {\n const actives: Column[] = columns.filter(({ sortOrder }: Column) => !!sortOrder);\n\n const sortingState = {\n paths: actives.map(({ path }) => path),\n orders: actives.map(({ sortOrder }) => sortOrder)\n };\n\n return orderBy(data, sortingState.paths, sortingState.orders);\n }\n\n private doClientSidePagination({ data, pagination }) {\n return pagination\n ? get(chunk(data, pagination.pageSize), pagination.currentPage - 1, [])\n : data;\n }\n\n private createRegexSearch(filterValue) {\n return RegExp(escapeRegExpPattern(filterValue), 'i');\n }\n\n private toObservable(x): Observable<any> {\n return isObservable(x) ? x : x instanceof Promise ? from(x) : of(x);\n }\n}\n\n/**\n *\n * @param string pattern Regex pattern.\n * @return string The escaped regex.\n * @see https://stackoverflow.com/a/3561711/2013891\n */\nfunction escapeRegExpPattern(pattern = '') {\n return pattern.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n","import { IIdentified } from '@c8y/client';\n\nexport interface ISelectModalObject {\n groupId: string | number;\n body: ISelectModalBodyPart[];\n options: ISelectModalOption[];\n additionalInformation?: ISelectModalBodyPart;\n}\n\nexport interface ISelectModalOption {\n body: ISelectModalBodyPart[];\n obj: IIdentified;\n selected?: boolean;\n}\n\nexport interface ISelectModalBodyPart {\n value: string;\n class?: string;\n}\n\nexport interface ModalLabels {\n ok?: string;\n cancel?: string;\n}\n\nexport enum ModalSelectionMode {\n SINGLE = 'single',\n MULTI = 'multi'\n}\n","import { CdkHeaderCell } from '@angular/cdk/table';\nimport {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ComponentFactory,\n ComponentFactoryResolver,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n QueryList,\n ViewChild,\n ViewChildren,\n ViewContainerRef\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { IResultList, Paging } from '@c8y/client';\nimport { flow, get, parseInt as _parseInt, union, without } from 'lodash-es';\nimport { combineLatest, Subject } from 'rxjs';\nimport {\n debounceTime,\n distinctUntilChanged,\n first,\n mergeMap,\n take,\n takeUntil,\n tap\n} from 'rxjs/operators';\nimport { LoadMoreComponent } from '../common/load-more.component';\nimport { LoadMoreMode } from '../common/load-more.model';\nimport { gettext } from '../i18n/gettext';\nimport { CellRendererSpec } from './column/cell-renderer';\nimport { ColumnDirective } from './column/column.directive';\nimport { FilteringFormRendererSpec, FilteringModifier } from './column/filtering-form-renderer';\nimport {\n ActionControl,\n BuiltInActionType,\n BulkActionControl,\n Column,\n ColumnDataType,\n DataGrid,\n DataSourceStats,\n DisplayOptions,\n FilteringActionType,\n minColumnGridTrackSize,\n Pagination,\n ratiosByColumnTypes,\n Row,\n ServerSideDataCallback,\n SortOrder,\n SpecialColumnName,\n GridConfig\n} from './data-grid.model';\nimport { GridDataSource } from './grid-data-source';\n\n@Component({\n selector: 'c8y-data-grid',\n templateUrl: './data-grid.component.html'\n})\nexport class DataGridComponent implements DataGrid, OnChanges, AfterViewInit {\n @Input() title: string = gettext('Items');\n @Input() loadMoreItemsLabel: string = gettext('Load more items');\n @Input() loadingItemsLabel: string = gettext('Loading items…');\n @Input() noMatchingItemsLabel: string = gettext('No matching items.');\n @Input() refresh: EventEmitter<any>;\n\n columns: Column[];\n @Input('columns')\n set _columns(columns) {\n this.columns = columns || [];\n }\n\n dataSource = new GridDataSource();\n rows: Row[];\n @Input('rows')\n set _rows(rows) {\n this.rows = rows || [];\n }\n\n filteringLabelsParams = {\n filteredItemsCount: 0,\n allItemsCount: 0\n };\n\n pagination: Pagination;\n paginationLabelParams = {\n pageFirstItemIdx: 0,\n pageLastItemIdx: 0,\n itemsTotal: 0\n };\n readonly possiblePageSizes: number[] = [10, 15, 20, 30, 50];\n readonly minPossiblePageSize = Math.min(...this.possiblePageSizes);\n @Input('pagination')\n set _pagination(pagination) {\n this.pagination = pagination;\n const pageSize = get(this.pagination, 'pageSize');\n\n if (\n pageSize &&\n !this.possiblePageSizes.find(possiblePageSize => possiblePageSize === pageSize)\n ) {\n this.pagination = { ...this.pagination, pageSize: 10 };\n }\n }\n\n infiniteScroll: LoadMoreMode;\n @Input('infiniteScroll')\n set _infiniteScroll(infiniteScroll: LoadMoreMode) {\n this.infiniteScroll = infiniteScroll;\n }\n\n serverSideDataCallback: ServerSideDataCallback;\n @Input('serverSideDataCallback')\n set _serverSideDataCallback(serverSideDataCallback) {\n this.serverSideDataCallback = serverSideDataCallback;\n }\n\n selectable = false;\n @Input('selectable')\n set _selectable(selectable) {\n this.selectable = selectable;\n }\n\n selectionPrimaryKey = 'id';\n @Input('selectionPrimaryKey')\n set _selectionPrimaryKey(selectionPrimaryKey) {\n this.selectionPrimaryKey = selectionPrimaryKey;\n }\n\n displayOptions: DisplayOptions = {\n striped: true,\n bordered: false,\n gridHeader: true\n };\n @Input('displayOptions')\n set _displayOptions(displayOptions) {\n this.displayOptions = { ...this.displayOptions, ...displayOptions };\n }\n\n actionControls: ActionControl[];\n @Input('actionControls')\n set _actionControls(actionControls) {\n this.actionControls = actionControls || [];\n }\n\n bulkActionControls: BulkActionControl[];\n @Input('bulkActionControls')\n set _bulkActionControls(bulkActionControls) {\n this.bulkActionControls = bulkActionControls || [];\n }\n @Input() itemsSelectLimit: number;\n\n @Output() rowMouseOver = new EventEmitter<object>();\n @Output() rowMouseLeave = new EventEmitter<object>();\n @Output() rowClick = new EventEmitter<object>();\n @Output() onConfigChange = new EventEmitter<GridConfig>();\n\n @Output() itemsSelect = new EventEmitter<string[]>();\n\n @ContentChildren(ColumnDirective) columnRenderers: QueryList<ColumnDirective>;\n\n @ViewChild('scroll', { static: true }) scrollContainer: ElementRef;\n\n @ViewChild('infiniteScrollContainer', { static: false, read: ViewContainerRef })\n infiniteScrollContainer: ViewContainerRef;\n\n loadMoreComponent: LoadMoreComponent;\n\n columnNames = [];\n\n styles = {\n tableCursor: 'auto',\n gridTemplateColumns: undefined,\n gridInfiniteScrollColumn: undefined\n };\n\n searchText$ = new EventEmitter<string>();\n searchText = '';\n filteringApplied = false;\n totalPagesCount = Infinity;\n\n selectedItemIds: string[] = [];\n currentPageSelectionState = {\n allSelected: false,\n allDeselected: true\n };\n\n builtInActionType = {\n Edit: BuiltInActionType.Edit,\n Delete: BuiltInActionType.Delete,\n Export: BuiltInActionType.Export\n };\n\n resizeHandleMouseDown$ = new EventEmitter<any>();\n resizeHandleContainerMouseMove$ = new EventEmitter<any>();\n resizeHandleContainerMouseUp$ = new EventEmitter<any>();\n private headerBeingResized: {\n columnName: string;\n el: HTMLElement;\n };\n @ViewChildren(CdkHeaderCell, { read: ElementRef }) private thRefs: QueryList<ElementRef>;\n private thEls;\n\n private recreateLoadMoreComponent: boolean;\n\n private unsubscribe$ = new Subject<any>();\n\n constructor(\n private sanitizer: DomSanitizer,\n private hostRef: ElementRef,\n private cd: ChangeDetectorRef,\n private cfr: ComponentFactoryResolver\n ) {}\n\n ngOnInit() {\n this.searchText$\n .pipe(\n takeUntil(this.unsubscribe$),\n debounceTime(300),\n distinctUntilChanged(),\n tap(searchText => {\n this.searchText = searchText;\n })\n )\n .subscribe(() => {\n this.reload();\n });\n\n if (this.selectable) {\n combineLatest(this.dataSource.data$, this.itemsSelect.asObservable())\n .pipe(takeUntil(this.unsubscribe$))\n .subscribe(([data]) => {\n const currentPageEmpty = data.length === 0;\n\n this.currentPageSelectionState = {\n allSelected: currentPageEmpty ? false : data.every(item => this.isItemSelected(item)),\n allDeselected: currentPageEmpty ? true : data.every(item => !this.isItemSelected(item))\n };\n });\n }\n this.dataSource.stats$.pipe(takeUntil(this.unsubscribe$)).subscribe(stats => {\n this.createLoadMoreComponent(stats);\n this.updateFilteringLabelsParams(stats);\n this.updatePaginationLabelParams(stats);\n });\n\n if (this.refresh) {\n this.refresh.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {\n this.cancel();\n this.reload();\n });\n }\n }\n\n ngOnChanges() {\n this.updateColumns();\n this.loadData();\n }\n\n ngAfterViewInit() {\n this.updateGridColumnsSize();\n this.thEls = this.thRefs.toArray().map(({ nativeElement }) => nativeElement);\n this.setupResizeHandle();\n }\n\n ngOnDestroy() {\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n\n trackByName(index, item) {\n return item.name;\n }\n\n resolveCellValue(row, path) {\n return flow([\n x => this.dataSource.resolveValue(x, path),\n this.dataSource.resolveFunction,\n this.dataSource.normalizeNil\n ])(row);\n }\n\n changeSortOrder(columnName) {\n const column = this.columns.find(({ name }) => name === columnName);\n\n if (column) {\n const { sortOrder } = column;\n\n if (!sortOrder) {\n this.updateSorting([columnName], 'asc');\n } else if (sortOrder === 'asc') {\n this.updateSorting([columnName], 'desc');\n } else {\n this.updateSorting([columnName], '');\n }\n }\n }\n\n updateSorting(columnNames: string[], sortOrder: SortOrder) {\n this.columns = this.columns.map(\n (column): Column => {\n if (columnNames.includes(column.name)) {\n return { ...column, sortOrder };\n }\n\n return column;\n }\n );\n this.emitConfigChange();\n this.reload();\n }\n\n applyFilter(columnName, dropdown, filteringModifier) {\n this.updateFiltering([columnName], {\n type: FilteringActionType.ApplyFilter,\n payload: { filteringModifier }\n });\n dropdown.hide();\n }\n\n resetFilter(columnName, dropdown) {\n this.updateFiltering([columnName], { type: FilteringActionType.ResetFilter });\n dropdown.hide();\n }\n\n clearFilters() {\n this.updateFiltering(this.columns.map(({ name }) => name), {\n type: FilteringActionType.ResetFilter\n });\n }\n\n updateFiltering(\n columnNames: string[],\n action: {\n type: FilteringActionType;\n payload?: { filteringModifier: FilteringModifier };\n }\n ) {\n this.columns = this.columns.map(column => {\n if (columnNames.includes(column.name)) {\n return {\n ...column,\n ...(action.type === FilteringActionType.ApplyFilter\n ? action.payload.filteringModifier\n : { filterPredicate: undefined, externalFilterQuery: undefined })\n };\n }\n\n return column;\n });\n\n this.updateFilteringApplied();\n this.reload();\n }\n\n updateFilteringApplied() {\n this.filteringApplied = this.columns.some(this.isColumnFilteringApplied);\n }\n\n isColumnFilteringApplied(column: Column): boolean {\n const { filterable, filterPredicate, externalFilterQuery } = column;\n\n return !!(filterable && (filterPredicate || externalFilterQuery));\n }\n\n updatePagination({ itemsPerPage, page }) {\n this.pagination = { ...this.pagination, pageSize: itemsPerPage, currentPage: page };\n this.loadData();\n this.emitConfigChange();\n }\n\n reload() {\n this.pagination = { ...this.pagination, currentPage: 1 };\n this.recreateLoadMoreComponent = true;\n this.loadData(true);\n this.scrollToTop();\n }\n\n loadNextPage(): Promise<IResultList<object>> {\n this.pagination = { ...this.pagination, currentPage: this.pagination.nextPage };\n\n this.loadData();\n\n return this.dataSource.resultList$\n .pipe(take(1)) // in order for `toPromise` to work, the observable needs to complete\n .toPromise()\n .then(result => {\n return {\n ...result,\n paging: {\n ...result.paging,\n next: this.loadNextPage.bind(this)\n }\n } as IResultList<object>;\n });\n }\n\n getCellRendererSpec({ value, row, columnName }): CellRendererSpec {\n return this._getCellRendererSpec({ type: 'CELL', value, row, columnName });\n }\n\n getHeaderCellRendererSpec({ value, columnName }): CellRendererSpec {\n return this._getCellRendererSpec({ type: 'HEADER', value, row: undefined, columnName });\n }\n\n getFilteringFormRendererSpec({ column, dropdown }): FilteringFormRendererSpec {\n return {\n renderer:\n get(this.getColumnRenderer(column), 'filteringFormRendererDef.template') ||\n column.filteringFormRendererComponent,\n context: {\n property: column,\n applyFilter: this.applyFilter.bind(this, column.name, dropdown),\n resetFilter: this.resetFilter.bind(this, column.name, dropdown)\n }\n };\n }\n\n setAllItemsSelected(selected) {\n this.dataSource.selection$\n .pipe(first())\n .subscribe(({ filteredDataIds }) => this.setItemsSelected(filteredDataIds, selected));\n }\n\n setAllItemsInCurrentPageSelected(selected) {\n this.dataSource.data$.pipe(first()).subscribe(data => this.setItemsSelected(data, selected));\n }\n\n setItemsSelected(items: any[], selected) {\n const itemIds = items.map((item: object | string) =>\n typeof item === 'object' ? item[this.selectionPrimaryKey] : item\n );\n\n this.selectedItemIds = selected\n ? union(this.selectedItemIds, itemIds)\n : without(this.selectedItemIds, ...itemIds);\n\n this.itemsSelect.emit(this.selectedItemIds);\n }\n\n cancel() {\n this.selectedItemIds = [];\n this.itemsSelect.emit(this.selectedItemIds);\n }\n\n isItemSelected(item) {\n return this.selectedItemIds.includes(item[this.selectionPrimaryKey]);\n }\n\n onColumnDrop({ previousIndex, currentIndex }) {\n const differentIndex = previousIndex !== currentIndex;\n\n if (differentIndex) {\n const column = this.columns.splice(previousIndex, 1);\n this.columns.splice(currentIndex, 0, column[0]);\n }\n\n this.updateColumnNames();\n this.updateGridColumnsSize();\n }\n\n updateGridColumnsSize() {\n this.styles = {\n ...this.styles,\n gridTemplateColumns: this.sanitizer.bypassSecurityTrustStyle(\n this.columns\n .filter(column => column.visible)\n .map(({ gridTrackSize }) => gridTrackSize)\n .join(' ')\n ),\n gridInfiniteScrollColumn: this.sanitizer.bypassSecurityTrustStyle(\n `1 / span ${this.columns.filter(column => column.visible).length}`\n )\n };\n\n this.emitConfigChange();\n }\n\n private emitConfigChange() {\n const columns = this.columns.map(({ visible, sortOrder }) => ({ visible, sortOrder }));\n this.onConfigChange.emit({ columns, pagination: this.pagination });\n }\n\n private updateColumns() {\n const specialColumn = {\n gridTrackSize: '42px',\n sortable: false,\n positionFixed: true\n };\n\n this.columns = [\n this.selectable ? { ...specialColumn, name: SpecialColumnName.Checkbox } : undefined,\n ...this.columns,\n this.actionControls.length > 0\n ? { ...specialColumn, name: SpecialColumnName.Actions }\n : undefined\n ]\n .filter(Boolean)\n .map(this.withColumnDefaults);\n\n this.updateColumnNames();\n this.updateGridColumnsSize();\n this.updateFilteringApplied();\n }\n\n private withColumnDefaults(column): Column {\n const dataType = column.dataType || ColumnDataType.TextShort;\n const { headerCSSClassName, cellCSSClassName } = column;\n\n return {\n visible: true,\n positionFixed: false,\n sortable: true,\n sortOrder: '',\n filterable: false,\n ...column,\n dataType,\n gridTrackSize:\n column.gridTrackSize ||\n `minmax(${minColumnGridTrackSize}px, ${ratiosByColumnTypes[dataType]}fr)`,\n headerCSSClassName:\n (typeof headerCSSClassName === 'string'\n ? headerCSSClassName.split(' ')\n : headerCSSClassName) || [],\n cellCSSClassName:\n (typeof cellCSSClassName === 'string' ? cellCSSClassName.split(' ') : cellCSSClassName) ||\n []\n };\n }\n\n private updateColumnNames() {\n this.columnNames = this.columns.map(({ name }) => name);\n }\n\n private setupResizeHandle() {\n const resizeHandleDrag$ = this.resizeHandleMouseDown$.pipe(\n takeUntil(this.unsubscribe$),\n tap(() => this.clearMouseHighlights()),\n mergeMap(({ event, targetColumnName }) => {\n this.columns = this.columns.map(column => {\n if (column.name === targetColumnName) {\n return {\n ...column,\n headerCSSClassName: union(column.headerCSSClassName, ['header--being-resized'])\n };\n }\n\n return column;\n });\n\n this.headerBeingResized = {\n columnName: targetColumnName,\n el: event.target.parentNode\n };\n\n this.styles = {\n ...this.styles,\n tableCursor: 'col-resize'\n };\n\n return this.resizeHandleContainerMouseMove$.pipe(\n tap(() => this.clearMouseHighlights()),\n takeUntil(this.resizeHandleContainerMouseUp$)\n );\n })\n );\n\n resizeHandleDrag$.subscribe(event => {\n requestAnimationFrame(() => {\n this.columns = this.columns.map((column, i) => {\n if (column.name === this.headerBeingResized.columnName) {\n const wrapper = this.hostRef.nativeElement;\n\n // Read wrapper's offset left relative to the document.\n const horizontalOffset = wrapper.getBoundingClientRect().left;\n\n // Adjust with the wrapper horizontal scroll position.\n const horizontalScrollOffset = wrapper.scrollLeft - horizontalOffset;\n\n // Calculate the desired width.\n const width =\n horizontalScrollOffset + event.clientX - (this.headerBeingResized.el.offsetLeft || 0);\n\n return {\n ...column,\n // Update the column object with the new size value, enforce our minimum size.\n gridTrackSize: `${Math.max(minColumnGridTrackSize, width)}px`\n };\n }\n\n // For the other headers which don't have a set width, fix it to their computed width.\n if (column.gridTrackSize.startsWith('minmax')) {\n return {\n ...column,\n // isn't fixed yet (it would be a px value)\n gridTrackSize: `${_parseInt(this.thEls[i].clientWidth)}px`\n };\n }\n\n return column;\n });\n\n /*\n * Update the column sizes.\n * Note: grid-template-columns sets the width for all columns in one value.\n */\n this.updateGridColumnsSize();\n });\n });\n\n this.resizeHandleContainerMouseUp$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {\n if (this.headerBeingResized) {\n this.columns = this.columns.map(column => {\n if (column.name === this.headerBeingResized.columnName) {\n return {\n ...column,\n headerCSSClassName: without(column.headerCSSClassName, 'header--being-resized')\n };\n }\n\n return column;\n });\n this.headerBeingResized = undefined;\n\n this.styles = {\n ...this.styles,\n tableCursor: 'auto'\n };\n }\n });\n }\n\n private clearMouseHighlights() {\n if (window.getSelection) {\n window.getSelection().removeAllRanges();\n }\n }\n\n private _getCellRendererSpec({ type, value, row, columnName }): CellRendererSpec {\n const column = this.columns.find(({ name }) => name === columnName);\n const columnRenderer = this.getColumnRenderer(column);\n const rendererTemplate = get(\n columnRenderer,\n `${type === 'HEADER' ? 'headerCellRendererDef' : 'cellRendererDef'}.template`\n );\n\n const { cellRendererComponent, headerCellRendererComponent } = column;\n const rendererComponent =\n type === 'HEADER' ? headerCellRendererComponent : cellRendererComponent;\n\n return {\n renderer: rendererTemplate || rendererComponent,\n context: {\n value,\n item: row,\n property: column\n }\n };\n }\n\n private getColumnRenderer(column): ColumnDirective {\n return this.columnRenderers.toArray().find(({ name }) => name === column.name);\n }\n\n private loadData(reload: boolean = false) {\n const {\n rows,\n columns,\n pagination,\n searchText,\n serverSideDataCallback,\n selectable,\n selectionPrimaryKey,\n infiniteScroll\n } = this;\n\n this.dataSource.loadData({\n rows,\n columns,\n pagination,\n searchText,\n serverSideDataCallback,\n selectable,\n selectionPrimaryKey,\n infiniteScroll,\n reload\n });\n }\n\n private updateFilteringLabelsParams(stats: DataSourceStats) {\n this.filteringLabelsParams = {\n filteredItemsCount: stats.filteredSize,\n allItemsCount: stats.size\n };\n }\n\n private updatePaginationLabelParams(stats: DataSourceStats) {\n this.pagination.nextPage = stats.nextPage;\n const pageFirstItemIdx = (stats.currentPage - 1) * stats.firstPageSize + 1;\n this.paginationLabelParams = {\n pageFirstItemIdx,\n pageLastItemIdx: pageFirstItemIdx + (stats.currentPageSize - 1),\n itemsTotal: stats.filteredSize\n };\n }\n\n private createLoadMoreComponent(stats: DataSourceStats) {\n if (\n this.infiniteScroll &&\n stats &&\n stats.nextPage &&\n (!this.loadMoreComponent || this.recreateLoadMoreComponent)\n ) {\n this.recreateLoadMoreComponent = false;\n this.infiniteScrollContainer.clear();\n const componentFactory: ComponentFactory<any> = this.cfr.resolveComponentFactory(\n LoadMoreComponent\n );\n const componentRef = this.infiniteScrollContainer.createComponent(componentFactory);\n const instance = componentRef.instance as LoadMoreComponent;\n instance.useIntersection = this.infiniteScroll === 'auto' || this.infiniteScroll === 'hidden';\n instance.hidden = this.infiniteScroll === 'hidden';\n instance.paging = {\n nextPage: stats.nextPage,\n next: this.loadNextPage.bind(this)\n } as Paging<any>;\n instance.loadNextLabel = this.loadMoreItemsLabel;\n instance.loadingLabel = this.loadingItemsLabel;\n this.loadMoreComponent = instance;\n } else if (this.loadMoreComponent && !stats.nextPage) {\n this.loadMoreComponent.paging = {\n nextPage: null\n } as Paging<any>;\n }\n }\n\n private scrollToTop() {\n if (this.infiniteScroll) {\n this.scrollContainer.nativeElement.scrollTop = 0;\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DoCheck,\n Injector,\n Input,\n OnChanges,\n TemplateRef,\n Type\n} from '@angular/core';\n\nimport { CellRendererContext, CellRendererSpec } from './cell-renderer';\n\n@Component({\n selector: 'c8y-cell-renderer',\n templateUrl: './cell-renderer.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CellRendererComponent implements OnChanges, DoCheck {\n spec: CellRendererSpec;\n @Input('spec')\n set _spec(spec: CellRendererSpec) {\n this.spec = spec;\n }\n prevSpec: CellRendererSpec;\n\n rendererType: 'TEMPLATE' | 'COMPONENT';\n rendererInjector: Injector;\n\n constructor(private injector: Injector, private cd: ChangeDetectorRef) {}\n\n ngOnChanges() {\n if (!this.prevSpec) {\n this.prevSpec = this.spec;\n }\n\n const { renderer } = this.spec;\n\n if (renderer instanceof TemplateRef) {\n this.rendererType = 'TEMPLATE';\n } else if (renderer instanceof Type) {\n this.rendererType = 'COMPONENT';\n\n this.rendererInjector = Injector.create({\n providers: [{ provide: CellRendererContext, useValue: this.spec.context }],\n parent: this.injector\n });\n }\n }\n\n ngDoCheck() {\n if (!this.spec.context.value === this.prevSpec.context.value) {\n this.prevSpec = this.spec;\n this.cd.markForCheck();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DoCheck,\n Injector,\n Input,\n OnChanges,\n TemplateRef,\n Type\n} from '@angular/core';\nimport { isEqual } from 'lodash-es';\n\nimport { FilteringFormRendererContext, FilteringFormRendererSpec } from './filtering-form-renderer';\n\n@Component({\n selector: 'c8y-filtering-form-renderer',\n templateUrl: './filtering-form-renderer.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FilteringFormRendererComponent implements OnChanges {\n spec: FilteringFormRendererSpec;\n @Input('spec')\n set _spec(spec: FilteringFormRendererSpec) {\n this.spec = spec;\n }\n\n rendererType: 'TEMPLATE' | 'COMPONENT';\n rendererInjector: Injector;\n defaultRendererFilterText = '';\n\n constructor(private injector: Injector, private cd: ChangeDetectorRef) {}\n\n ngOnChanges() {\n const { renderer, context } = this.spec;\n\n if (renderer instanceof TemplateRef) {\n this.rendererType = 'TEMPLATE';\n } else if (renderer instanceof Type) {\n this.rendererType = 'COMPONENT';\n\n this.rendererInjector = Injector.create({\n providers: [{ provide: FilteringFormRendererContext, useValue: this.spec.context }],\n parent: this.injector\n });\n }\n\n const { filterPredicate } = context.property;\n if (typeof filterPredicate === 'string') {\n this.defaultRendererFilterText = filterPredicate;\n }\n }\n}\n","import { CdkTableModule } from '@angular/cdk/table';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { PaginationModule } from 'ngx-bootstrap/pagination';\nimport { CommonModule as C8YCommonModule } from '../common/common.module';\nimport { DataGridComponent } from './data-grid.component';\nimport { ColumnDirective } from './column/column.directive';\nimport { CellRendererDefDirective, HeaderCellRendererDefDirective } from './column/cell-renderer';\nimport { CellRendererComponent } from './column/cell-renderer.component';\nimport { FilteringFormRendererDefDirective } from './column/filtering-form-renderer';\nimport { FilteringFormRendererComponent } from './column/filtering-form-renderer.component';\n\n@NgModule({\n imports: [\n CommonModule,\n CdkTableModule,\n DragDropModule,\n FormsModule,\n ReactiveFormsModule,\n C8YCommonModule,\n BsDropdownModule.forRoot(),\n PopoverModule.forRoot(),\n PaginationModule.forRoot()\n ],\n declarations: [\n CellRendererDefDirective,\n HeaderCellRendererDefDirective,\n CellRendererComponent,\n FilteringFormRendererDefDirective,\n FilteringFormRendererComponent,\n ColumnDirective,\n DataGridComponent\n ],\n exports: [\n CellRendererDefDirective,\n HeaderCellRendererDefDirective,\n FilteringFormRendererDefDirective,\n ColumnDirective,\n DataGridComponent\n ],\n entryComponents: [DataGridComponent]\n})\nexport class DataGridModule {}\n","import { Component, ElementRef, Input, ViewChild } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { AppStateService } from '../common/ui-state.service';\nimport { DocsService } from '../docs/docs.service';\n\n/**\n * A component which shows a context help in\n * the action bar.\n *\n * @example\n * ```html\n * <c8y-help src=\"/users-guide/cockpit/#dashboards\"></c8y-help>\n * ```\n */\n@Component({\n selector: 'c8y-help',\n templateUrl: './help.component.html'\n})\nexport class HelpComponent {\n /**\n * The source of the documentation. Used to link to the documentation as well as\n * to parse the source to display.\n */\n @Input()\n src: string = '';\n\n /**\n * Indicates if the help dialog is collapsed.\n */\n @Input()\n isCollapsed = true;\n\n /**\n * The priority where the help icon should be shown in the action bar\n */\n @Input()\n priority = Infinity;\n\n /**\n * An custom icon. If not set, the navigator icon is resolved\n */\n @Input()\n icon;\n\n /**\n * An title. Set in open by passing the source.\n */\n title = '';\n\n /**\n * The content. Set in open by passing the source.\n */\n content = [];\n\n /**\n * Indicates if the component is loading.\n */\n isLoading = true;\n\n /**\n * Indicates if the component failed loading the source.\n */\n hasError = false;\n\n /**\n * An view child to which the parsed content is appended.\n */\n @ViewChild('helpContent', { static: false, read: ElementRef })\n helpContent: ElementRef;\n\n private readonly SUPPORTED_LANGUAGES = ['en'];\n\n /**\n * Identifies if the current user language is supported\n * Currently only English is supported.\n */\n get isSupportedLanguage() {\n return this.SUPPORTED_LANGUAGES.indexOf(this.translateService.currentLang) > -1;\n }\n\n /**\n * @ignore Only private DI\n */\n constructor(\n private docsService: DocsService,\n private appState: AppStateService,\n private translateService: TranslateService\n ) {}\n\n /**\n * Builds the URL based on the src. The Base URL can be set in the application options docBaseUrl.\n * @param src The source of the help on the guide.\n */\n getUrl(src = '') {\n const version = this.parseVersion(this.appState.uiVersion);\n const url = this.docsService.getBaseUrl();\n return `${url}${url.endsWith('/') ? '' : '/'}${version}${\n src.startsWith('/') ? src : `/${src}`\n }`;\n }\n\n /**\n * Toggles the visibility of the help dialog.\n */\n toggle() {\n if (this.isCollapsed) {\n this.open();\n return;\n }\n this.close();\n }\n\n /**\n * Closes the help dialog.\n */\n close() {\n this.isCollapsed = true;\n this.clean();\n }\n\n /**\n * Opens the help dialog.\n */\n open() {\n this.isCollapsed = false;\n this.isLoading = true;\n this.requestContent();\n if (!this.icon) {\n this.icon = this.resolveIcon();\n }\n }\n\n /**\n * @ignore\n */\n ngAfterContentChecked(): void {\n if (this.content.length > 0 && this.helpContent) {\n this.content.forEach(ele => {\n this.helpContent.nativeElement.append(ele);\n });\n }\n }\n\n private requestContent() {\n const req = new XMLHttpRequest();\n req.onreadystatechange = () => this.render(req);\n req.addEventListener('load', () => this.render(req));\n req.open('GET', this.getUrl(this.src));\n req.responseType = 'document';\n req.setRequestHeader('Accept', 'text/html');\n req.send();\n }\n\n private clean() {\n this.title = '';\n this.isLoading = true;\n this.hasError = false;\n this.content = [];\n if (this.helpContent) {\n (this.helpContent.nativeElement as HTMLElement).innerHTML = '';\n }\n }\n\n private parseVersion(uiVersion) {\n const version = uiVersion.split('.')[0];\n const majorNumber = Math.floor(parseInt(version, 10) / 100);\n const minorNumber = parseInt(version, 10) - majorNumber * 100;\n return `${majorNumber}.${minorNumber}.0`;\n }\n\n private resolveIcon() {\n try {\n const icon = Array.from(document.querySelector('nav .active i').classList).find(\n classes => classes.startsWith('c8y-') || classes.startsWith('fa-')\n );\n return icon.replace('fa-', '');\n } catch (ex) {\n return 'question-circle-o';\n }\n }\n\n private render(req: XMLHttpRequest) {\n if (req.readyState === 4) {\n this.isLoading = false;\n if (req.status === 200) {\n const sectionSplit = this.src.split('#');\n\n // TODO: change here the selectors when DOC team defined the section element\n const sectionQuery = `#${sectionSplit[sectionSplit.length - 1]} h2`;\n const sectionNode = req.response.querySelector(sectionQuery) as HTMLElement;\n const allPossibleElementsToAttach = Array.from(sectionNode.parentElement.children).slice(1);\n this.title = sectionNode.innerText.trim();\n\n for (const ele of allPossibleElementsToAttach) {\n if (ele.tagName.toLowerCase() === 'h3') {\n break;\n }\n this.content.push(ele);\n }\n } else {\n this.hasError = true;\n }\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { CollapseModule } from 'ngx-bootstrap/collapse';\nimport { HelpComponent } from './help.component';\nimport { ActionBarModule } from '../action-bar/action-bar.module';\n\n/**\n * Provides components which allow to display help elements\n * inside the app.\n * @exports HelpComponent A component which shows a context help in\n * the action bar.\n */\n@NgModule({\n declarations: [HelpComponent],\n imports: [CommonModule, CollapseModule.forRoot(), ActionBarModule],\n exports: [HelpComponent],\n providers: []\n})\nexport class HelpModule {}\n","import { Component, Input } from '@angular/core';\nimport { RealtimeService } from './realtime.service';\n\n@Component({\n selector: 'c8y-realtime-btn',\n templateUrl: './realtime-button.component.html'\n})\nexport class RealtimeButtonComponent {\n @Input()\n service: RealtimeService<any>;\n\n get active(): boolean {\n return !!this.service && this.service.active;\n }\n\n toggle() {\n if (this.service) {\n this.active ? this.service.stop() : this.service.start();\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { RealtimeButtonComponent } from './realtime-button.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [RealtimeButtonComponent],\n exports: [RealtimeButtonComponent]\n})\nexport class RealtimeModule {}\n","import { Component, Input, EventEmitter, SimpleChanges, Output } from '@angular/core';\nimport { gettext } from '../i18n/gettext';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport {\n ISelectModalObject,\n ModalSelectionMode,\n ModalLabels\n} from './select-modal.model';\nimport { assign } from 'lodash-es';\nimport { Subject } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { IIdentified } from '@c8y/client';\n\ninterface ISelectModalInternalObject extends ISelectModalObject {\n selectedId: string | number;\n}\n\n@Component({\n selector: 'c8y-select-modal',\n templateUrl: './select-modal.component.html'\n})\nexport class SelectModalComponent {\n @Input() icon: string;\n @Input() title: string;\n @Input() subTitle: string = gettext('Select from the list of items matching the device type');\n @Input() items: ISelectModalInternalObject[];\n @Input() mode: ModalSelectionMode = ModalSelectionMode.MULTI;\n @Input() disableSelected: boolean = true;\n @Input() showFilter: boolean = true;\n @Input() areMoreEntries: boolean = false;\n @Input() set labels(labels: ModalLabels) {\n const { ok = this.labels.ok, cancel = this.labels.cancel } = labels || {};\n this._labels = { ok, cancel };\n }\n get labels(): ModalLabels {\n return this._labels;\n }\n @Output() result: EventEmitter<IIdentified[]> = new EventEmitter<IIdentified[]>();\n @Output() search: EventEmitter<string> = new EventEmitter<string>();\n selected = false;\n filterTerm: string = '';\n listItems = [];\n private debouncer: Subject<string> = new Subject<string>();\n private _labels: ModalLabels = { ok: gettext('Confirm'), cancel: gettext('Cancel') };\n\n constructor(private bsModalRef: BsModalRef) {\n this.debouncer.pipe(debounceTime(500)).subscribe(value => {\n this.search.emit(value);\n });\n }\n\n async ngOnChanges(changes: SimpleChanges) {\n if (changes.items && changes.items.currentValue) {\n const itemsPromise = changes.items.currentValue.map(async item => {\n item.options = await item.options;\n const selected = item.options.find(option => option.selected);\n if (selected) {\n item.selectedId = selected.obj.id;\n if (this.disableSelected) {\n item.options.map(option => assign(option, { disabled: true }));\n }\n }\n return item;\n });\n this.listItems = await Promise.all(itemsPromise);\n }\n }\n\n updatePipe(filterTerm: string) {\n this.debouncer.next(filterTerm);\n this.filterTerm = filterTerm;\n }\n\n updateChoice({ item, id }) {\n if (this.mode === 'single') {\n this.listItems.map(value => (value.selectedId = undefined));\n }\n item.selectedId = id;\n this.selected = true;\n }\n\n dismiss() {\n this.bsModalRef.hide();\n }\n\n select() {\n this.result.emit(this.getOutput());\n this.bsModalRef.hide();\n }\n\n ngOnDestroy() {\n this.debouncer.complete();\n this.result.complete();\n this.search.complete();\n }\n\n private getOutput(): IIdentified[] {\n return this.listItems\n .filter(item => item.selectedId)\n .map(item => item.options.find(option => item.selectedId === option.obj.id))\n .filter(option => !option.selected)\n .map(selectedOption => selectedOption.obj);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { ISelectModalObject } from './select-modal.model';\n\n@Pipe({\n name: 'selectModalFilterPipe',\n})\nexport class SelectModalFilterPipe implements PipeTransform {\n transform(items: ISelectModalObject[], filterTerm: string): any {\n return filterTerm.trim().length === 0\n ? items\n : items.filter((item: ISelectModalObject) => {\n const allValues = this.extractValues(item);\n const filteredValues = allValues.filter((value) => this.filterContainString(value, filterTerm));\n return filteredValues.length > 0;\n });\n }\n\n private filterContainString(value: string, filterTerm: string) {\n const term = filterTerm.toLowerCase().trim();\n return value && value.toLowerCase().indexOf(term) > -1;\n }\n\n private extractValues(item) {\n let values = [];\n if ( item.value ) {\n values.push(item.value);\n }\n Object.keys(item).forEach((key) => {\n if (Array.isArray(item[key])) {\n item[key].forEach( obj => values.concat(this.extractValues(obj)) );\n }\n if (item[key] instanceof Object) {\n values = values.concat(this.extractValues(item[key]));\n }\n });\n return values;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { CommonModule } from '../common/common.module';\nimport { ListGroupModule } from '../list-group/list-group.module';\nimport { FormsModule } from '../forms/forms.module';\nimport { SelectModalComponent } from './select-modal.component';\nimport { SelectModalFilterPipe } from './select-modal-filter.pipe';\nimport { SearchModule } from '../search/search.module';\n\n@NgModule({\n imports: [\n BsDropdownModule.forRoot(),\n CommonModule,\n ListGroupModule,\n SearchModule,\n FormsModule\n ],\n exports: [\n SelectModalComponent,\n SelectModalFilterPipe\n ],\n declarations: [\n SelectModalComponent,\n SelectModalFilterPipe\n ]\n})\nexport class SelectModalModule { }\n","import { BsDropdownDirective } from 'ngx-bootstrap/dropdown';\nimport { gettext } from '../i18n/gettext';\nimport {\n Component,\n EventEmitter,\n HostListener,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\n\nexport interface Item {\n name: string;\n _selected?: boolean;\n [key: string]: any;\n}\n\nexport type selectedFunction = (item: Item) => boolean;\nexport type selectedLabelFunction = (items: Item[]) => string;\n\n@Component({\n selector: 'c8y-select',\n templateUrl: './select.component.html'\n})\nexport class SelectComponent implements OnChanges {\n @Input() placeholder: string = gettext('Select item');\n @Input() selectedLabel: string | selectedLabelFunction;\n @Input() applyLabel: string = gettext('Apply');\n @Input() items: Item[];\n @Input() selected: Item[] | selectedFunction;\n @Output() onChange: EventEmitter<Item[]> = new EventEmitter();\n @ViewChild(BsDropdownDirective, { static: false }) dropdown: BsDropdownDirective;\n textFilter = '';\n labelText = '';\n isOpen = false;\n filteredItems: Item[] = [];\n searchFilter = null;\n readonly sizeToShowFilter: number = 5;\n labelsForSelectAll: any = {\n all: gettext('All'),\n allFiltered: gettext('All filtered')\n };\n showAllLabel = false;\n private itemsSelected: Set<Item> = new Set();\n private stopClicks = false;\n\n @HostListener('click', ['$event'])\n preventClick(evt) {\n if (this.stopClicks) {\n evt.stopPropagation();\n }\n this.stopClicks = this.isOpen;\n }\n\n isOpenChange(isOpen: boolean) {\n this.isOpen = isOpen;\n if (isOpen) {\n this.updateSelected();\n this.searchFilter = null;\n } else {\n this.stopClicks = false;\n }\n }\n\n outterSelected(item: Item) {\n const { selected } = this;\n let isSelected: any = () => false;\n if (typeof selected === 'function') {\n isSelected = selected;\n } else if (Array.isArray(selected)) {\n isSelected = (i: Item) => selected.indexOf(i) > -1;\n }\n return isSelected(item);\n }\n\n isSelected(item: Item) {\n return this.itemsSelected.has(item);\n }\n\n isAllItemsSelected() {\n return this.itemsSelected.size === this.items.length;\n }\n\n isAllFilteredSelected() {\n return this.itemsSelected.size === this.filteredItems.length;\n }\n\n applyChanges() {\n const selected = Array.from(this.itemsSelected.values());\n this.onChange.emit(selected);\n this.dropdown.hide();\n }\n\n selectAll(checked: boolean) {\n this.filteredItems.forEach(item => this.onChangeItem(checked, item));\n }\n\n onChangeItem(checked: boolean, item: Item) {\n if (checked) {\n this.itemsSelected.add(item);\n } else {\n this.itemsSelected.delete(item);\n }\n }\n\n updateFiltered(term: string) {\n if (term) {\n const search = new RegExp(term, 'i');\n this.filteredItems = this.items.filter(({ name }) => search.test(name));\n } else {\n this.filteredItems = this.items;\n }\n }\n\n getSelectAllToggleStatus() {\n const label = this.getLabel();\n const checked = this.isAllSelected();\n const indeterminate = !checked && this.itemsSelected.size > 0;\n\n return { label, checked, indeterminate};\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (this.isOpen) {\n return;\n }\n if (changes.items || changes.selected || changes.applyLabel) {\n this.updateSelected();\n this.updateLabel();\n this.showAllLabel = this.isAllItemsSelected();\n }\n }\n\n private updateLabel() {\n const outterSelected = this.items.filter(i => this.outterSelected(i));\n if (typeof this.selectedLabel === 'string') {\n this.labelText = this.selectedLabel;\n } else if (typeof this.selectedLabel === 'function') {\n this.labelText = this.selectedLabel(outterSelected);\n } else {\n this.labelText = outterSelected.map(({ name }) => name).join(', ');\n }\n }\n\n private updateSelected() {\n const { itemsSelected, items } = this;\n itemsSelected.clear();\n items.forEach(item => {\n if (this.outterSelected(item)) {\n itemsSelected.add(item);\n }\n });\n this.filteredItems = items;\n }\n\n private isAllSelected() {\n if (this.getLabel() === this.labelsForSelectAll.allFiltered) {\n return this.isAllFilteredSelected();\n } else {\n return this.isAllItemsSelected();\n }\n }\n\n private getLabel() {\n return this.searchFilter ? this.labelsForSelectAll.allFiltered : this.labelsForSelectAll.all;\n }\n}\n","import {\n ContentChildren,\n Input,\n Output,\n EventEmitter,\n Component,\n ViewChild,\n ElementRef,\n QueryList,\n forwardRef\n} from '@angular/core';\nimport { NG_VALIDATORS, Validator, AbstractControl } from '@angular/forms';\nimport { fromEvent, Subscription } from 'rxjs';\nimport { debounceTime, map, distinctUntilChanged, filter } from 'rxjs/operators';\nimport { IIdentified } from '@c8y/client';\nimport { BsDropdownDirective } from 'ngx-bootstrap/dropdown';\nimport { ListItemComponent } from '../list-group/list-item.component';\nimport { findIndex, get, set } from 'lodash-es';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'c8y-typeahead',\n templateUrl: './typeahead.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n multi: true,\n useExisting: forwardRef(() => TypeaheadComponent)\n },\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => TypeaheadComponent),\n multi: true\n }\n ]\n})\nexport class TypeaheadComponent implements ControlValueAccessor, Validator {\n @ViewChild('searchControl', { static: false }) searchControl: ElementRef;\n @ViewChild('dropdown', { static: false }) dropdown: BsDropdownDirective;\n @ContentChildren(ListItemComponent) list: QueryList<ListItemComponent>;\n\n @Input()\n required: boolean = false;\n\n @Input()\n disabled: boolean = false;\n\n @Input()\n allowFreeEntries: boolean = true;\n\n @Input()\n placeholder: string;\n\n @Input()\n displayProperty: string = 'name';\n\n @Input()\n name: string = this.displayProperty;\n\n @Input()\n container: '' | 'body' = '';\n\n @Input()\n selected: IIdentified = {\n id: null\n };\n\n @Output()\n selectedChange = new EventEmitter<IIdentified>();\n\n @Output()\n onSearch = new EventEmitter<string>();\n\n private subscription: Subscription;\n private onChange: (name) => void;\n private onTouched: () => void;\n\n private readonly KEYCODE_UP = 38;\n private readonly KEYCODE_DOWN = 40;\n private readonly KEYCODE_TAB = 9;\n private readonly KEYCODE_ENTER = 13;\n private readonly KEYCODE_ESC = 27;\n\n writeValue(value) {\n this.selected = value;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n doBlur() {\n if (this.onTouched) {\n this.onTouched();\n }\n }\n\n getDisplayProperty() {\n return get(this.selected, this.displayProperty, '');\n }\n\n onShown() {\n this.searchControl.nativeElement.focus();\n }\n\n ngOnDestroy(): void {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n\n ngAfterViewInit(): void {\n this.subscription = fromEvent(this.searchControl.nativeElement, 'keydown')\n .pipe(\n map((e: any) => this.handleKeyboard(e)),\n filter((e: any) => e),\n debounceTime(200),\n map((e: any) => e.target.value),\n distinctUntilChanged()\n )\n .subscribe(value => {\n this.selected = {\n id: null\n };\n set(this.selected, this.displayProperty, value || '');\n\n this.onChange(this.selected);\n this.selectedChange.emit(this.selected);\n this.onSearch.emit(value);\n });\n }\n\n handleKeyboard(event): void {\n const keyCode = event.keyCode;\n if (\n [this.KEYCODE_ENTER, this.KEYCODE_DOWN, this.KEYCODE_TAB, this.KEYCODE_UP].includes(keyCode)\n ) {\n const items = this.list.toArray();\n const index = findIndex(items, item => item.active);\n if (keyCode === this.KEYCODE_ENTER || keyCode === this.KEYCODE_TAB) {\n if (index > -1) {\n event.preventDefault();\n items[index].element.nativeElement.click();\n }\n this.dropdown.hide();\n this.searchControl.nativeElement.blur();\n } else {\n this.dropdown.show();\n const upOrDown = keyCode === this.KEYCODE_DOWN ? 1 : -1;\n if (index > -1) {\n items[index].active = false;\n }\n if (items[index + upOrDown]) {\n items[index + upOrDown].active = true;\n }\n }\n return;\n } else if (keyCode === this.KEYCODE_ESC) {\n event.stopPropagation();\n this.dropdown.hide();\n this.searchControl.nativeElement.blur();\n return;\n } else {\n this.dropdown.show();\n }\n return event;\n }\n\n validate(ctrl: AbstractControl): { [key: string]: any } {\n if (this.required && !this.getDisplayProperty()) {\n return { required: true };\n }\n\n if (!this.allowFreeEntries && this.selected && this.selected.id === null) {\n return { notExisting: true };\n }\n\n return null;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { SelectComponent } from './select.component';\nimport { CommonModule } from '../common/common.module';\nimport { TypeaheadComponent } from './typeahead.component';\nimport { ListGroupModule } from '../list-group/list-group.module';\nimport { FormsModule } from '../forms/forms.module';\n\n/**\n * The angular module definition for a select.\n * @exports SelectComponent\n */\n@NgModule({\n imports: [\n BsDropdownModule.forRoot(),\n CommonModule,\n ListGroupModule,\n FormsModule\n ],\n exports: [\n SelectComponent,\n TypeaheadComponent\n ],\n declarations: [\n SelectComponent,\n TypeaheadComponent\n ]\n})\nexport class SelectModule { }\n","import { NgModule } from '@angular/core';\nimport { ActionBarModule } from './action-bar/action-bar.module';\nimport { ActionModule } from './action/action.module';\nimport { AlertModule } from './alert/alert.module';\nimport { AuditLogModule } from './audit-log/audit-log.module';\nimport { AuthenticationModule } from './authentication/authentication.module';\nimport { BootstrapModule } from './bootstrap/bootstrap.module';\nimport { BreadcrumbModule } from './breadcrumb/breadcrumb.module';\nimport { CommonModule } from './common/common.module';\nimport { DashboardModule } from './dashboard/dashboard.module';\nimport { DataGridModule } from './data-grid/data-grid.module';\nimport { DeviceStatusModule } from './device-status/device-status.module';\nimport { DocsModule } from './docs/docs.module';\nimport { DropAreaModule } from './drop-area/drop-area.module';\nimport { DynamicComponentModule } from './dynamic-component/dynamic-component.module';\nimport { FilePickerModule } from './file-picker/file-picker.module';\nimport { DatePickerModule } from './date-picker/date-picker.module';\nimport { FormsModule as c8yFormsModule } from './forms/forms.module';\nimport { HeaderModule } from './header/header.module';\nimport { HelpModule } from './help/help.module';\nimport { ListGroupModule } from './list-group/list-group.module';\nimport { LoginModule } from './login/login.module';\nimport { ModalModule } from './modal/modal.module';\nimport { NavigatorModule } from './navigator/navigator.module';\nimport { ProductExperienceModule } from './product-experience/product-experience.module';\nimport { RealtimeModule } from './realtime/realtime.module';\nimport { SearchModule } from './search/search.module';\nimport { SelectModalModule } from './select-modal/select-modal.module';\nimport { SelectModule } from './select/select.module';\nimport { StepperModule as c8yStepperModule } from './stepper/stepper.module';\nimport { TabsModule } from './tabs/tabs.module';\nimport { UserModule } from './user/user.module';\n\n@NgModule({\n exports: [\n ActionBarModule,\n ActionModule,\n AlertModule,\n AuditLogModule,\n BootstrapModule,\n BreadcrumbModule,\n CommonModule,\n DataGridModule,\n DropAreaModule,\n HeaderModule,\n LoginModule,\n ModalModule,\n NavigatorModule,\n AuthenticationModule,\n SearchModule,\n SelectModule,\n TabsModule,\n UserModule,\n c8yFormsModule,\n DeviceStatusModule,\n DocsModule,\n c8yStepperModule,\n DynamicComponentModule,\n DashboardModule,\n ListGroupModule,\n SelectModalModule,\n FilePickerModule,\n DatePickerModule,\n ProductExperienceModule,\n HelpModule,\n RealtimeModule\n ]\n})\nexport class CoreModule {\n static forRoot() {\n return {\n ngModule: CoreModule,\n providers: [...CommonModule.providers(), ...LoginModule.providers()]\n };\n }\n}\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport { kebabCase } from 'lodash-es';\r\n\r\n@Component({\r\n selector: 'c8y-quick-link',\r\n templateUrl: './quick-link.component.html'\r\n})\r\nexport class QuickLinkComponent implements OnInit {\r\n @Input() icon;\r\n @Input() label;\r\n classes = '';\r\n\r\n ngOnInit(): void {\r\n this.classes = `card-block text-center ${kebabCase(this.label)}`;\r\n }\r\n}\r\n","import { CoreModule } from '../core.module';\r\nimport { NgModule } from '@angular/core';\r\nimport { QuickLinkComponent } from './quick-link.component';\r\n\r\n@NgModule({\r\n declarations: [QuickLinkComponent],\r\n imports: [CoreModule],\r\n exports: [QuickLinkComponent],\r\n providers: []\r\n})\r\nexport class QuickLinkModule {}\r\n","import { InjectionToken } from '@angular/core';\n\nexport const HOOK_DYNAMIC_PROVIDER_CONFIG = new InjectionToken('Dynamic Provider Config');\n","import { Inject, Injectable, Injector, Optional } from '@angular/core';\nimport { CanActivate } from '@angular/router';\nimport { flatten } from 'lodash-es';\nimport { forkJoin, from, isObservable, Observable, of } from 'rxjs';\nimport { map, tap } from 'rxjs/operators';\nimport { NavigatorNode, NavigatorNodeFactory } from '../navigator';\nimport { DynamicProviderConfig } from './model/dynamic-provider-config.model';\nimport { HOOK_DYNAMIC_PROVIDER_CONFIG } from './provider-configuration-hook';\n\n@Injectable()\nexport class ProviderConfigurationNodeFactory implements NavigatorNodeFactory {\n private config: DynamicProviderConfig[];\n private nodes: NavigatorNode[];\n\n constructor(\n @Optional()\n @Inject(HOOK_DYNAMIC_PROVIDER_CONFIG)\n config: DynamicProviderConfig[][],\n private injector: Injector\n ) {\n this.config = flatten(config);\n }\n\n get() {\n if (!this.config || !this.config.length) {\n return;\n }\n\n if (!this.nodes) {\n const canActivate: Array<Observable<boolean>> = this.config\n .map(c =>\n c.navigation.canActivate && c.navigation.canActivate.length\n ? c.navigation.canActivate.map(ca => this.injector.get(ca))\n : undefined\n )\n .map(this.checkCanActivate.bind(this));\n\n return forkJoin(canActivate).pipe(\n map((canActivateResult: boolean[]) =>\n this.config\n .map((c, index) =>\n canActivateResult[index] ? new NavigatorNode(c.navigation) : undefined\n )\n .filter(el => !!el)\n ),\n tap(nodes => (this.nodes = nodes))\n );\n }\n\n return this.nodes;\n }\n\n private checkCanActivate(ca: CanActivate[]): Observable<boolean> {\n if (!!ca && ca.length) {\n const canActivateResult: Array<Observable<boolean>> = ca\n .map((canActivate: CanActivate) => canActivate.canActivate(undefined, undefined))\n .map(this.wrapIntoObservable.bind(this));\n\n return forkJoin(canActivateResult).pipe(\n map((caResult: boolean[]) => caResult.reduce((acc, curr) => acc && curr))\n );\n }\n return of(true);\n }\n\n private isPromise<T = any>(obj: any): obj is Promise<T> {\n return !!obj && typeof obj.then === 'function';\n }\n\n private wrapIntoObservable<T>(value: T | Promise<T> | Observable<T>): Observable<T> {\n if (isObservable(value)) {\n return value;\n }\n\n if (this.isPromise(value)) {\n return from(value);\n }\n\n return of(value);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { FetchClient, IIdentified, IResult, Service } from '@c8y/client';\nimport { get } from 'lodash-es';\nimport { ProviderProperties } from '../model/provider-properties.model';\n\n@Injectable()\nexport class ProviderConfigurationService extends Service<ProviderProperties> {\n private static readonly NO_DETAIL_ID: string = null;\n\n protected baseUrl: string;\n protected listUrl: string;\n\n constructor(client: FetchClient, activatedRoute: ActivatedRoute) {\n super(client);\n this.baseUrl = get(activatedRoute, 'snapshot.data.endpoint.configurationEndpoint.baseUrl');\n this.listUrl = get(activatedRoute, 'snapshot.data.endpoint.configurationEndpoint.listUrl');\n }\n\n async detail(): Promise<IResult<ProviderProperties>> {\n return super.detail(ProviderConfigurationService.NO_DETAIL_ID);\n }\n\n async update(entity: Partial<ProviderProperties>): Promise<IResult<ProviderProperties>> {\n return super.update(entity);\n }\n\n async delete(): Promise<IResult<null>> {\n return super.delete(ProviderConfigurationService.NO_DETAIL_ID);\n }\n\n /** There is a single provider configuration per tenant and detail URL is not needed */\n protected getDetailUrl(_: string | number | IIdentified): string {\n return this.listUrl;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { FetchClient, IResultList, Service } from '@c8y/client';\nimport { get } from 'lodash-es';\nimport { ProviderDefinition } from '../model/provider-definition.model';\n\n@Injectable()\nexport class ProviderDefinitionsService extends Service<ProviderDefinition> {\n protected baseUrl: string;\n protected listUrl: string;\n\n constructor(client: FetchClient, activatedRoute: ActivatedRoute) {\n super(client);\n this.baseUrl = get(activatedRoute, 'snapshot.data.endpoint.definitionsEndpoint.baseUrl');\n this.listUrl = get(activatedRoute, 'snapshot.data.endpoint.definitionsEndpoint.listUrl');\n }\n\n async list(): Promise<IResultList<ProviderDefinition>> {\n return super.list();\n }\n}\n","import { Component } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { ActivatedRoute } from '@angular/router';\nimport { IResult } from '@c8y/client';\nimport { FormlyFieldConfig, FormlyFormOptions, ɵdefineHiddenProp } from '@ngx-formly/core';\nimport { find, get, mapValues, pick } from 'lodash-es';\nimport { BehaviorSubject, combineLatest, from, merge, Observable, of, Subject } from 'rxjs';\nimport { catchError, map, shareReplay, switchMap, tap } from 'rxjs/operators';\nimport { AlertService } from '../alert/alert.service';\nimport { Permissions, Status } from '../common/index';\nimport { C8yJSONSchema } from '../dynamic-forms/json-schema/c8y-json-schema.service';\nimport { ModalService } from '../modal/modal.service';\nimport {\n DynamicProviderConfig,\n DynamicProviderLayoutConfig\n} from './model/dynamic-provider-config.model';\nimport { ProviderDefinition } from './model/provider-definition.model';\nimport { ProviderProperties } from './model/provider-properties.model';\nimport { ProviderConfigurationService } from './service/provider-configuration.service';\nimport { ProviderDefinitionsService } from './service/provider-definitions.service';\n\n@Component({\n selector: 'c8y-sms-gateway',\n templateUrl: './provider-configuration.component.html',\n providers: [ProviderConfigurationService, ProviderDefinitionsService]\n})\nexport class ProviderConfigurationComponent {\n layout$: Observable<DynamicProviderLayoutConfig> = this.activatedRoute.data.pipe(\n map((config: DynamicProviderConfig) => config.layout),\n tap((layout: DynamicProviderLayoutConfig) => (this.layout = layout)),\n tap(\n (layout: DynamicProviderLayoutConfig) =>\n (this.options.formState.disabled = !this.permissions.hasAllRoles(layout.saveRoles))\n )\n );\n\n providers$: Observable<ProviderDefinition[]>;\n selectedProvider$: Observable<ProviderDefinition>;\n changeProvider$: Subject<ProviderDefinition> = new BehaviorSubject(null);\n configuration$: Observable<ProviderProperties>;\n providerInput$ = new BehaviorSubject<string>('');\n\n form = new FormGroup({});\n model: ProviderProperties;\n fields: FormlyFieldConfig[] = [];\n options: FormlyFormOptions = {\n formState: {\n disabled: false\n }\n };\n\n private reload$ = new BehaviorSubject<void>(null);\n private updatedConfiguration$ = new Subject<ProviderProperties>();\n private layout: DynamicProviderLayoutConfig;\n\n constructor(\n public permissions: Permissions,\n private activatedRoute: ActivatedRoute,\n private modalService: ModalService,\n private alertService: AlertService,\n private providerDefinitionsService: ProviderDefinitionsService,\n private providerConfigurationService: ProviderConfigurationService,\n private jsonschema: C8yJSONSchema\n ) {}\n\n ngOnInit() {\n const allProviders$: Observable<ProviderDefinition[]> = from(\n this.providerDefinitionsService.list()\n ).pipe(\n map(result => result.data),\n shareReplay(1)\n );\n\n this.providers$ = combineLatest(allProviders$, this.providerInput$).pipe(\n map(([providers, input]: [ProviderDefinition[], string]) =>\n input\n ? providers.filter(el => el.displayName.toLowerCase().indexOf(input.toLowerCase()) >= 0)\n : providers\n ),\n shareReplay(1)\n );\n\n this.configuration$ = merge(\n this.updatedConfiguration$,\n this.reload$.pipe(\n switchMap(() =>\n from(this.providerConfigurationService.detail()).pipe(catchError(() => of({} as any)))\n ),\n map(result => result.data)\n )\n ).pipe(\n map(this.removeEncryptedValues),\n shareReplay(1)\n );\n\n this.selectedProvider$ = combineLatest(\n allProviders$,\n this.configuration$,\n this.changeProvider$\n ).pipe(\n tap(\n ([_, configuration, newProvider]: [\n ProviderDefinition[],\n ProviderProperties,\n ProviderDefinition\n ]) =>\n (this.model = newProvider\n ? pick(this.model, 'sms.senderName', 'sms.senderAddress')\n : configuration)\n ),\n map(\n ([providers, configuration, newProvider]: [\n ProviderDefinition[],\n ProviderProperties,\n ProviderDefinition\n ]) =>\n newProvider ||\n find(\n providers,\n (provider: ProviderDefinition) => get(configuration, 'provider') === provider.id\n )\n ),\n tap((provider: ProviderDefinition) => {\n if (provider) {\n const config: FormlyFieldConfig = this.jsonschema.toFieldConfig(get(provider, 'schema'));\n if (config.fieldGroup) {\n config.fieldGroup.forEach((fieldConfig: FormlyFieldConfig) => {\n ɵdefineHiddenProp(fieldConfig, '_keyPath', {\n key: fieldConfig.key,\n path: [fieldConfig.key]\n });\n\n fieldConfig.expressionProperties = {\n 'templateOptions.disabled': 'formState.disabled'\n };\n });\n }\n this.fields = [config];\n this.form = new FormGroup({});\n }\n }),\n shareReplay(1)\n );\n }\n\n async saveProviderConfiguration() {\n try {\n const res: IResult<ProviderProperties> = await this.providerConfigurationService.update(\n this.model\n );\n this.changeProvider$.next(null);\n this.updatedConfiguration$.next(res.data);\n this.alertService.success(this.layout.configurationUpdatedSuccessMsg);\n this.form.markAsPristine();\n } catch (err) {\n this.alertService.addServerFailure(err);\n }\n }\n\n async deleteProviderConfiguration() {\n try {\n await this.modalService.confirm(\n this.layout.deleteConfigurationModalTitle,\n this.layout.deleteConfigurationModalBody,\n Status.DANGER,\n {\n ok: this.layout.deleteConfigurationModalOkBtnLabel,\n cancel: this.layout.deleteConfigurationModalCancelBtnLabel\n }\n );\n await this.providerConfigurationService.delete();\n this.reload$.next();\n this.alertService.success(this.layout.configurationDeletedSuccessMsg);\n } catch (err) {\n if (err) {\n this.alertService.addServerFailure(err);\n }\n }\n }\n\n private removeEncryptedValues(configuration: ProviderProperties): ProviderProperties {\n return mapValues(configuration, value => (value === '<<Encrypted>>' ? undefined : value));\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { flatten } from 'lodash-es';\nimport { RouteFactory } from '../router';\nimport { DynamicProviderConfig } from './model/dynamic-provider-config.model';\nimport { HOOK_DYNAMIC_PROVIDER_CONFIG } from './provider-configuration-hook';\nimport { ProviderConfigurationComponent } from './provider-configuration.component';\n\n@Injectable()\nexport class ProviderConfigurationRouteFactory implements RouteFactory {\n private config: DynamicProviderConfig[];\n\n constructor(@Optional() @Inject(HOOK_DYNAMIC_PROVIDER_CONFIG) config: DynamicProviderConfig[][]) {\n this.config = flatten(config);\n }\n\n get() {\n return this.config.map(c => ({\n path: c.navigation.path,\n component: ProviderConfigurationComponent,\n canActivate: c.navigation.canActivate,\n data: {\n layout: c.layout,\n endpoint: c.endpoint\n }\n }));\n }\n}\n","import { forwardRef, ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { CoreModule } from '../core.module';\nimport { DynamicFormsModule } from '../dynamic-forms/dynamic-forms.module';\nimport { HOOK_NAVIGATOR_NODES } from '../navigator';\nimport { HOOK_ONCE_ROUTE } from '../router';\nimport { DynamicProviderConfig } from './model/dynamic-provider-config.model';\nimport { HOOK_DYNAMIC_PROVIDER_CONFIG } from './provider-configuration-hook';\nimport { ProviderConfigurationNodeFactory } from './provider-configuration-node.factory';\nimport { ProviderConfigurationRouteFactory } from './provider-configuration-route.factory';\nimport { ProviderConfigurationComponent } from './provider-configuration.component';\n\n@NgModule({\n declarations: [ProviderConfigurationComponent],\n exports: [ProviderConfigurationComponent],\n imports: [CoreModule, CommonModule, DynamicFormsModule],\n entryComponents: [ProviderConfigurationComponent],\n providers: [\n {\n provide: HOOK_ONCE_ROUTE,\n useClass: forwardRef(() => ProviderConfigurationRouteFactory),\n multi: true\n },\n {\n provide: HOOK_NAVIGATOR_NODES,\n useClass: forwardRef(() => ProviderConfigurationNodeFactory),\n multi: true\n }\n ]\n})\nexport class ProviderConfigurationModule {\n static config(config: DynamicProviderConfig[]): ModuleWithProviders {\n return {\n ngModule: ProviderConfigurationModule,\n providers: [{ provide: HOOK_DYNAMIC_PROVIDER_CONFIG, useValue: config, multi: true }]\n };\n }\n}\n","export class RealtimeMessage<T> {\n id: string;\n channel: string;\n realtimeAction: RealtimeAction;\n data: T | number;\n}\n\nexport type RealtimeAction = 'UPDATE' | 'DELETE' | 'CREATE';\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { IIdentified, Realtime } from '@c8y/client';\nimport { Observable, Subject } from 'rxjs';\nimport { filter, finalize, map } from 'rxjs/operators';\nimport { RealtimeMessage } from './realtime.model';\n\n/**\n * A wrapper class for handling realtime notifications in RxJS fashion.\n */\nexport abstract class RealtimeService<T> {\n /**\n * A flag displaying if realtime notifications are currently active.\n */\n get active(): boolean {\n return this.isActive;\n }\n\n private subjects$: Map<string, RealtimeSubject<T>> = new Map<string, RealtimeSubject<T>>();\n private isActive: boolean = true;\n\n constructor(protected realtime: Realtime) {}\n\n /**\n * Get an Observable of all realtime notifications.\n *\n * @param {string | number | IIdentified} entityOrId Entity object or id\n *\n * @returns An [[Observable]] of notifications wrapped as [[RealtimeMessage]]\n */\n onAll$(entityOrId?: string | number | IIdentified): Observable<RealtimeMessage<T>> {\n const subject$: RealtimeSubject<T> = this.getSubjectForChannel(entityOrId);\n\n return subject$.pipe(\n finalize(() => {\n if (subject$.observers.length === 1 && subject$.observers[0].closed) {\n subject$.stop();\n this.subjects$.delete(subject$.channel);\n }\n })\n );\n }\n\n /**\n * Subscribes again all realtime channels with active observers.\n */\n start() {\n if (!this.isActive) {\n this.subjects$.forEach(subject$ => {\n subject$.start();\n });\n this.isActive = true;\n }\n }\n\n /**\n * Stops realtime notifications and unsubscribes all realtime channels.\n */\n stop() {\n if (this.isActive) {\n this.subjects$.forEach(subject$ => {\n subject$.stop();\n });\n\n this.isActive = false;\n }\n }\n\n /**\n * Get an Observable of all CREATE realtime notifications.\n *\n * @returns An [[Observable]] of newly created entity objects.\n */\n onCreate$(): Observable<T> {\n return this.onAll$().pipe(\n filter(msg => msg.realtimeAction === 'CREATE'),\n map(msg => msg.data as T)\n );\n }\n\n /**\n * Get an Observable of all UPDATE realtime notifications.\n *\n * @param {string | number | IIdentified} entityOrId Entity object or id\n *\n * @returns An [[Observable]] of updated entity objects.\n */\n onUpdate$(entityOrId?: string | number | IIdentified): Observable<T> {\n return this.onAll$(entityOrId).pipe(\n filter(msg => msg.realtimeAction === 'UPDATE'),\n map(msg => msg.data as T)\n );\n }\n\n /**\n * Get an Observable of all DELETE realtime notifications.\n *\n * @param {string | number | IIdentified} entityOrId Entity object or id\n *\n * @returns An [[Observable]] of deleted entity objects.\n */\n onDelete$(entityOrId?: string | number | IIdentified): Observable<number> {\n return this.onAll$(entityOrId).pipe(\n filter(msg => msg.realtimeAction === 'DELETE'),\n map(msg => coerceNumberProperty(msg.data))\n );\n }\n\n protected getIdString(reference: number | string | IIdentified): string {\n let id: string | number;\n if (typeof reference === 'object') {\n id = reference.id;\n } else {\n id = reference;\n }\n return String(id);\n }\n\n protected getChannel(entityOrId?: string | number | IIdentified) {\n return entityOrId ? this.channel().replace('*', this.getIdString(entityOrId)) : this.channel();\n }\n\n protected abstract channel(): string;\n\n private getSubjectForChannel(entityOrId?: string | number | IIdentified): RealtimeSubject<T> {\n const channel: string = this.getChannel(entityOrId);\n let subject$: RealtimeSubject<T>;\n if (this.subjects$.has(channel)) {\n subject$ = this.subjects$.get(channel);\n } else {\n subject$ = new RealtimeSubject(channel, this.realtime);\n this.subjects$.set(channel, subject$);\n }\n\n return subject$;\n }\n}\n\n// tslint:disable-next-line: max-classes-per-file\nclass RealtimeSubject<T> extends Subject<RealtimeMessage<T>> {\n realtimeSubscription: object;\n get channel(): string {\n return this.realtimeChannel;\n }\n\n constructor(private realtimeChannel: string, private realtime: Realtime) {\n super();\n this.start();\n }\n\n start() {\n if (!this.realtimeSubscription) {\n this.realtimeSubscription = this.realtime.subscribe(this.realtimeChannel, msg => {\n const data: RealtimeMessage<T> = {\n channel: msg.channel,\n data: msg.data.data,\n id: msg.id,\n realtimeAction: msg.data.realtimeAction\n };\n this.next(data);\n });\n }\n }\n\n stop() {\n if (this.realtimeSubscription) {\n this.realtime.unsubscribe(this.realtimeSubscription);\n this.realtimeSubscription = null;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { IOperationBulk, Realtime } from '@c8y/client';\nimport { RealtimeService } from './realtime.service';\n\n/**\n * A service for handling bulk operation realtime notifications in RxJS fashion.\n */\n@Injectable()\nexport class OperationBulkRealtimeService extends RealtimeService<IOperationBulk> {\n constructor(realtime: Realtime) {\n super(realtime);\n }\n\n protected channel(): string {\n return '/bulkOperations/*';\n }\n}\n","import { Injectable } from '@angular/core';\nimport { RealtimeService } from './realtime.service';\nimport { IManagedObject, Realtime } from '@c8y/client';\n\n@Injectable()\nexport class ManagedObjectRealtimeService extends RealtimeService<IManagedObject> {\n constructor(realtime: Realtime) {\n super(realtime);\n }\n\n protected channel(): string {\n return '/managedobjects/*';\n }\n}\n"]}
1
+ {"version":3,"sources":["../../../../node_modules/tslib/tslib.es6.js","ng://@c8y/ngx-components/core/common/extension-hooks.ts","ng://@c8y/ngx-components/core/common/state-service.abstract.ts","ng://@c8y/ngx-components/core/action-bar/action-bar.service.ts","ng://@c8y/ngx-components/core/action-bar/action-bar-item.component.ts","ng://@c8y/ngx-components/core/common/ApplicationOptions.ts","ng://@c8y/ngx-components/core/common/options.service.ts","ng://@c8y/ngx-components/core/common/throttle.decorator.ts","ng://@c8y/ngx-components/core/common/ui-state.service.ts","ng://@c8y/ngx-components/core/i18n/languages.ts","ng://@c8y/ngx-components/core/i18n/locale.path.ts","ng://@c8y/ngx-components/core/i18n/patterns-message.hook.ts","ng://@c8y/ngx-components/core/i18n/pattern-messages.service.ts","ng://@c8y/ngx-components/core/i18n/missing-translation-custom.handler.ts","ng://@c8y/ngx-components/core/i18n/gettext.ts","ng://@c8y/ngx-components/core/i18n/pattern-messages.data.ts","ng://@c8y/ngx-components/core/i18n/cached-locale-dictionary.service.ts","ng://@c8y/ngx-components/core/i18n/translate.loader.ts","ng://@c8y/ngx-components/core/i18n/translate.parser.ts","ng://@c8y/ngx-components/core/i18n/force-html-translate.directive.ts","ng://@c8y/ngx-components/core/i18n/i18n.module.ts","ng://@c8y/ngx-components/core/i18n/parse-module.ts","ng://@c8y/ngx-components/core/i18n/load-locale.ts","ng://@c8y/ngx-components/core/i18n/translate.service.ts","ng://@c8y/ngx-components/core/common/date.pipe.ts","ng://@c8y/ngx-components/core/common/load-more.component.ts","ng://@c8y/ngx-components/core/common/forOf.directive.ts","ng://@c8y/ngx-components/core/common/humanize-app-name.pipe.ts","ng://@c8y/ngx-components/core/common/humanize.pipe.ts","ng://@c8y/ngx-components/core/common/icon.directive.ts","ng://@c8y/ngx-components/core/common/memoize.decorator.ts","ng://@c8y/ngx-components/core/common/permissions.service.ts","ng://@c8y/ngx-components/core/common/if-allowed.directive.ts","ng://@c8y/ngx-components/core/common/loading.component.ts","ng://@c8y/ngx-components/core/common/map-function.pipe.ts","ng://@c8y/ngx-components/core/common/outlet.directive.ts","ng://@c8y/ngx-components/core/common/progress-bar.component.ts","ng://@c8y/ngx-components/core/common/shorten-user-name.pipe.ts","ng://@c8y/ngx-components/core/common/tenant-ui.service.ts","ng://@c8y/ngx-components/core/common/user-preferences/user-preferences-storage-local.ts","ng://@c8y/ngx-components/core/common/user-preferences/user-preferences-store-inventory.ts","ng://@c8y/ngx-components/core/common/user-preferences/user-preferences.service.ts","ng://@c8y/ngx-components/core/common/common.module.ts","ng://@c8y/ngx-components/core/common/status.model.ts","ng://@c8y/ngx-components/core/action-bar/action-bar.component.ts","ng://@c8y/ngx-components/core/action-bar/action-bar.module.ts","ng://@c8y/ngx-components/core/action/action.service.ts","ng://@c8y/ngx-components/core/action/action-outlet.component.ts","ng://@c8y/ngx-components/core/action/action.component.ts","ng://@c8y/ngx-components/core/action/action.module.ts","ng://@c8y/ngx-components/core/alert/alert.service.ts","ng://@c8y/ngx-components/core/alert/alert-details.component.ts","ng://@c8y/ngx-components/core/alert/alert.component.ts","ng://@c8y/ngx-components/core/alert/alert-outlet.component.ts","ng://@c8y/ngx-components/core/alert/alert-text.component.ts","ng://@c8y/ngx-components/core/alert/alert.module.ts","ng://@c8y/ngx-components/core/navigator/navigator-node.ts","ng://@c8y/ngx-components/core/navigator/navigator-node-root.ts","ng://@c8y/ngx-components/core/navigator/navigator.service.ts","ng://@c8y/ngx-components/core/header/header.service.ts","ng://@c8y/ngx-components/core/tabs/tabs.service.ts","ng://@c8y/ngx-components/core/bootstrap/bootstrap.component.ts","ng://@c8y/ngx-components/core/breadcrumb/breadcrumb-item.component.ts","ng://@c8y/ngx-components/core/breadcrumb/breadcrumb-outlet.component.ts","ng://@c8y/ngx-components/core/breadcrumb/breadcrumb.service.ts","ng://@c8y/ngx-components/core/breadcrumb/breadcrumb.component.ts","ng://@c8y/ngx-components/core/breadcrumb/breadcrumb.module.ts","ng://@c8y/ngx-components/core/navigator/navigator-entry.component.ts","ng://@c8y/ngx-components/core/navigator/navigator-icon.component.ts","ng://@c8y/ngx-components/core/modal/popover-confirm.component.ts","ng://@c8y/ngx-components/core/navigator/navigator-node.component.ts","ng://@c8y/ngx-components/core/header/right-drawer/right-drawer.component.ts","ng://@c8y/ngx-components/core/header/title/title-outlet.component.ts","ng://@c8y/ngx-components/core/header/title/title.component.ts","ng://@c8y/ngx-components/core/search/search.service.ts","ng://@c8y/ngx-components/core/user/user-menu.service.ts","ng://@c8y/ngx-components/core/docs/defaults.items.ts","ng://@c8y/ngx-components/core/docs/docs.models.ts","ng://@c8y/ngx-components/core/docs/docs.service.ts","ng://@c8y/ngx-components/core/header/header-bar/header-bar.component.ts","ng://@c8y/ngx-components/core/header/application/app-switcher.component.ts","ng://@c8y/ngx-components/core/header/application/app-icon.component.ts","ng://@c8y/ngx-components/core/navigator/navigator-outlet.component.ts","ng://@c8y/ngx-components/core/login/login.model.ts","ng://@c8y/ngx-components/core/modal/modal-confirm.component.ts","ng://@c8y/ngx-components/core/modal/modal.component.ts","ng://@c8y/ngx-components/core/modal/modal.service.ts","ng://@c8y/ngx-components/core/modal/modal.module.ts","ng://@c8y/ngx-components/core/navigator/navigator.module.ts","ng://@c8y/ngx-components/core/bootstrap/cookie-banner/cookie-banner.service.ts","ng://@c8y/ngx-components/core/product-experience/gainsight.service.ts","ng://@c8y/ngx-components/core/product-experience/product-experience.directive.ts","ng://@c8y/ngx-components/core/product-experience/product-experience.module.ts","ng://@c8y/ngx-components/core/search/search-outlet.component.ts","ng://@c8y/ngx-components/core/search/search.component.ts","ng://@c8y/ngx-components/core/search/highlight.component.ts","ng://@c8y/ngx-components/core/search/search-result-empty.component.ts","ng://@c8y/ngx-components/core/search/search.module.ts","ng://@c8y/ngx-components/core/user/user-menu-item.component.ts","ng://@c8y/ngx-components/core/user/user-edit-modal.component.ts","ng://@c8y/ngx-components/core/login/login.service.ts","ng://@c8y/ngx-components/core/authentication/password-confirm-modal.component.ts","ng://@c8y/ngx-components/core/authentication/password.service.ts","ng://@c8y/ngx-components/core/user/user-totp-setup.component.ts","ng://@c8y/ngx-components/core/user/user-edit.component.ts","ng://@c8y/ngx-components/core/user/user-menu-outlet.component.ts","ng://@c8y/ngx-components/core/authentication/password-check-list.component.ts","ng://@c8y/ngx-components/core/authentication/password-confirm.directive.ts","ng://@c8y/ngx-components/core/authentication/password-strength-checker.service.ts","ng://@c8y/ngx-components/core/authentication/password-strength.component.ts","ng://@c8y/ngx-components/core/authentication/new-password.component.ts","ng://@c8y/ngx-components/core/forms/phone-validation.directive.ts","ng://@c8y/ngx-components/core/forms/validation-pattern.ts","ng://@c8y/ngx-components/core/forms/default-validation.directive.ts","ng://@c8y/ngx-components/core/forms/min-validation.directive.ts","ng://@c8y/ngx-components/core/forms/max-validation.directive.ts","ng://@c8y/ngx-components/core/forms/message.directive.ts","ng://@c8y/ngx-components/core/forms/messages.component.ts","ng://@c8y/ngx-components/core/forms/form-group.component.ts","ng://@c8y/ngx-components/core/forms/input-group-list.component.ts","ng://@c8y/ngx-components/core/forms/input-group-list-container.directive.ts","ng://@c8y/ngx-components/core/forms/json-validation-prettifier.directive.ts","ng://@c8y/ngx-components/core/forms/text-area-row-height.directive.ts","ng://@c8y/ngx-components/core/forms/required-input-placeholder.directive.ts","ng://@c8y/ngx-components/core/forms/ip-range-input-list.component.ts","ng://@c8y/ngx-components/core/forms/filter-input.component.ts","ng://@c8y/ngx-components/core/forms/forms.module.ts","ng://@c8y/ngx-components/core/authentication/totp-challenge.component.ts","ng://@c8y/ngx-components/core/authentication/sms-challenge.component.ts","ng://@c8y/ngx-components/core/authentication/totp-setup.component.ts","ng://@c8y/ngx-components/core/drop-area/drop-area.component.ts","ng://@c8y/ngx-components/core/authentication/provide-phone-number.component.ts","ng://@c8y/ngx-components/core/authentication/authentication.module.ts","ng://@c8y/ngx-components/core/user/user-totp-revoke.component.ts","ng://@c8y/ngx-components/core/user/user.module.ts","ng://@c8y/ngx-components/core/header/header.module.ts","ng://@c8y/ngx-components/core/login/change-password.component.ts","ng://@c8y/ngx-components/core/login/credentials.component.ts","ng://@c8y/ngx-components/core/login/login.component.ts","ng://@c8y/ngx-components/core/login/recover-password.component.ts","ng://@c8y/ngx-components/core/login/totp-auth.component.ts","ng://@c8y/ngx-components/core/login/strength-validator-service.ts","ng://@c8y/ngx-components/core/login/password-strength-validator.directive.ts","ng://@c8y/ngx-components/core/login/login.module.ts","ng://@c8y/ngx-components/core/tabs/tab.component.ts","ng://@c8y/ngx-components/core/tabs/tabs-outlet.component.ts","ng://@c8y/ngx-components/core/tabs/tabs.module.ts","ng://@c8y/ngx-components/core/bootstrap/cookie-banner/cookie-banner-preferences-modal/cookie-banner-preferences-modal.component.ts","ng://@c8y/ngx-components/core/bootstrap/cookie-banner/cookie-banner.component.ts","ng://@c8y/ngx-components/core/bootstrap/bootstrap.module.ts","ng://@c8y/ngx-components/core/drop-area/drop-area.module.ts","ng://@c8y/ngx-components/core/router/router.models.ts","ng://@c8y/ngx-components/core/file-picker/file-picker.component.ts","ng://@c8y/ngx-components/core/file-picker/file-picker.module.ts","ng://@c8y/ngx-components/core/date-picker/date-picker.component.ts","ng://@c8y/ngx-components/core/date-picker/date-picker.module.ts","ng://@c8y/ngx-components/core/router/router-tabs.resolver.ts","ng://@c8y/ngx-components/core/router/view-context.service.ts","ng://@c8y/ngx-components/core/router/context-route.service.ts","ng://@c8y/ngx-components/core/router/router.service.ts","ng://@c8y/ngx-components/core/router/context-route.component.ts","ng://@c8y/ngx-components/api/api.service.ts","ng://@c8y/ngx-components/api/data.module.ts","ng://@c8y/ngx-components/core/router/context-route.guard.ts","ng://@c8y/ngx-components/core/router/empty.component.ts","ng://@c8y/ngx-components/core/router/router.module.ts","ng://@c8y/ngx-components/core/device-status/device-availability.ts","ng://@c8y/ngx-components/core/device-status/device-status.component.ts","ng://@c8y/ngx-components/core/device-status/device-status.module.ts","ng://@c8y/ngx-components/core/docs/guide-href.directive.ts","ng://@c8y/ngx-components/core/docs/guide-docs.component.ts","ng://@c8y/ngx-components/core/docs/docs.module.ts","ng://@c8y/ngx-components/core/dynamic-forms/array/array.type.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/checkbox/checkbox.type.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/form-field/form-field.wrapper.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/input/input.type.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/object/object.type.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/radio/radio.type.component.ts","ng://@c8y/ngx-components/core/dynamic-forms/dynamic-forms-ui-theme.module.ts","ng://@c8y/ngx-components/core/dynamic-forms/i18n/translate.extension.ts","ng://@c8y/ngx-components/core/dynamic-forms/i18n/i18n.module.ts","ng://@c8y/ngx-components/core/dynamic-forms/json-schema/c8y-json-schema.service.ts","ng://@c8y/ngx-components/core/dynamic-forms/validation/validation-config.factory.ts","ng://@c8y/ngx-components/core/data-grid/data-grid.model.ts","ng://@c8y/ngx-components/core/dynamic-forms/validation/validation.module.ts","ng://@c8y/ngx-components/core/dynamic-forms/dynamic-forms.module.ts","ng://@c8y/ngx-components/core/dynamic-component/dynamic-component.model.ts","ng://@c8y/ngx-components/core/dynamic-component/dynamic-component.service.ts","ng://@c8y/ngx-components/core/dynamic-component/dynamic-component.component.ts","ng://@c8y/ngx-components/core/dynamic-component/dynamic-component.module.ts","ng://@c8y/ngx-components/core/dashboard/dashboard-child-action.component.ts","ng://@c8y/ngx-components/core/dashboard/dashboard-child-title.component.ts","ng://@c8y/ngx-components/core/dashboard/dashboard.component.ts","ng://@c8y/ngx-components/core/dashboard/dashboard-child-change.ts","ng://@c8y/ngx-components/core/dashboard/dashboard-child.component.ts","ng://@c8y/ngx-components/core/dashboard/widgets-dashboard.component.ts","ng://@c8y/ngx-components/core/dashboard/dashboard.module.ts","ng://@c8y/ngx-components/core/stepper/stepper-icon.directive.ts","ng://@c8y/ngx-components/core/stepper/stepper.component.ts","ng://@c8y/ngx-components/core/stepper/stepper-progress.component.ts","ng://@c8y/ngx-components/core/stepper/stepper-buttons.component.ts","ng://@c8y/ngx-components/core/stepper/stepper.module.ts","ng://@c8y/ngx-components/core/list-group/list-item-action.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-collapse.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-footer.component.ts","ng://@c8y/ngx-components/core/list-group/list-item.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-body.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-radio.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-timeline.component.ts","ng://@c8y/ngx-components/core/list-group/list-group.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-icon.component.ts","ng://@c8y/ngx-components/core/list-group/list-item-checkbox.component.ts","ng://@c8y/ngx-components/core/list-group/list-group.module.ts","ng://@c8y/ngx-components/core/audit-log/audit-log.component.ts","ng://@c8y/ngx-components/core/audit-log/audit-log.module.ts","ng://@c8y/ngx-components/core/data-grid/column/cell-renderer.ts","ng://@c8y/ngx-components/core/data-grid/column/filtering-form-renderer.ts","ng://@c8y/ngx-components/core/data-grid/column/column.directive.ts","ng://@c8y/ngx-components/core/data-grid/grid-data-source.ts","ng://@c8y/ngx-components/core/select-modal/select-modal.model.ts","ng://@c8y/ngx-components/core/data-grid/data-grid.component.ts","ng://@c8y/ngx-components/core/data-grid/column/cell-renderer.component.ts","ng://@c8y/ngx-components/core/data-grid/column/filtering-form-renderer.component.ts","ng://@c8y/ngx-components/core/data-grid/data-grid.module.ts","ng://@c8y/ngx-components/core/help/help.component.ts","ng://@c8y/ngx-components/core/help/help.module.ts","ng://@c8y/ngx-components/core/realtime/realtime-button.component.ts","ng://@c8y/ngx-components/core/realtime/realtime.module.ts","ng://@c8y/ngx-components/core/select-modal/select-modal.component.ts","ng://@c8y/ngx-components/core/select-modal/select-modal-filter.pipe.ts","ng://@c8y/ngx-components/core/select-modal/select-modal.module.ts","ng://@c8y/ngx-components/core/select/select.component.ts","ng://@c8y/ngx-components/core/select/typeahead.component.ts","ng://@c8y/ngx-components/core/select/select.module.ts","ng://@c8y/ngx-components/core/core.module.ts","ng://@c8y/ngx-components/core/quicklink/quick-link.component.ts","ng://@c8y/ngx-components/core/quicklink/quick-link.module.ts","ng://@c8y/ngx-components/core/provider-configuration/provider-configuration-hook.ts","ng://@c8y/ngx-components/core/provider-configuration/provider-configuration-node.factory.ts","ng://@c8y/ngx-components/core/provider-configuration/service/provider-configuration.service.ts","ng://@c8y/ngx-components/core/provider-configuration/service/provider-definitions.service.ts","ng://@c8y/ngx-components/core/provider-configuration/provider-configuration.component.ts","ng://@c8y/ngx-components/core/provider-configuration/provider-configuration-route.factory.ts","ng://@c8y/ngx-components/core/provider-configuration/provider-configuration.module.ts","ng://@c8y/ngx-components/core/realtime/realtime.model.ts","ng://@c8y/ngx-components/core/realtime/realtime.service.ts","ng://@c8y/ngx-components/core/realtime/operation-bulk-realtime.service.ts","ng://@c8y/ngx-components/core/realtime/managed-object-realtime.service.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__decorate","decorators","target","key","desc","c","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__param","paramIndex","decorator","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","TypeError","pop","push","__values","o","m","__read","ar","error","__spread","concat","fromTrigger","router","refresh","factories","events","pipe","filter","evt","NavigationEnd","merge","startWith","switchMap","fromFactories","withFirstEmpty","isArray","of","defer","factoryObservables","resolveInjectedFactories","map","factoryResult","observable","isObservable","forceObservable","from","withEmptyFirst","race","item","toObservable","isFunction","get","getActivatedRoute","combineLatest","results","sortByPriority","flatten","stateToFactory","componentsState","components$","componentSet","items","sortBy","routerState","root","route","firstChild","StateService","mappedProperty","state$","distinctUntilChanged","emitNewState","state","HOOK_ACTION_BAR","InjectionToken","ActionBarService","_super","injector","_this","refreshTrigger","Subject","BehaviorSubject","Set","items$","shareReplay","tslib_1.__extends","add","remove","delete","Injector","Router","Injectable","providedIn","ActionBarItemComponent","actionBarService","placement","priority","itemClass","ngAfterViewInit","viewInitTimeout","setTimeout","ngOnDestroy","clearTimeout","tslib_1.__decorate","Input","ViewChild","static","Component","selector","template","ApplicationOptions","HOOK_OPTIONS","OptionsService","options","systemOptionsService","tenantOptionService","setupOptions","optionKey","defaultValue","camelCase","set","getSupportUrl","getTenantOption","url","_c","isUndefined","supportUrl","_a","getSystemOption","_b","getActivateSupportUser","category","getOptionFromService","forEach","optionMap","keys","service","detail","data","parseOptionRawValue","rawValue","JSON","parse","Optional","type","Inject","args","SystemOptionsService","TenantOptionsService","tslib_1.__param","throttle","wait","fnName","descriptor","fn","_i","throttledFnName","_throttle","AppStateService","applicationService","apiService","fetchClient","tenantLoginOptionsService","app","name","contextPath","getCurrentContextPath","lang","langs","getLangs","langsDetail","languages","loginOptions","activateSupportUserAvailable","undefined","versions","backend","ui","ngx","hidePowered","isLoading","showRightDrawer","rightDrawer","loginExtraLink","newsletter","currentSupportUserName","currentUser","currentTenant","calls","test","phase","scan","count","subscribe","assignApplicationKeyToDefaultHeaders","isDevMode","defaultHeaders","X-Cumulocity-Application-Key","k","version","ng1","loadManifest","application","manifest","loadDefaultOptions","refreshLoginOptions","isApplicationAvailable","listByUser","pageSize","some","setUser","userInfo","supportUserName","user","match","window","location","pathname","_d","showIncompatibleVersionsError","ex","uiVersion","backendVersion","uiVersionArray","replace","split","Number","beVersionArray","multiplier","Math","pow","ceil","log10","max","sumReducer","acc","cur","calculateVersionMapper","curr","idx","reduce","errorContent","console","log","ApplicationService","ApiService","FetchClient","TenantLoginOptionsService","trailing","LANGUAGES","LOCALE_PATH","HOOK_PATTERN_MESSAGES","PatternMessagesService","patterns","pipes","absoluteDate","date","formatDate","translateService","currentLang","translate","instant","each","pattern","message","translation","translateWithPatterns","translatedMessage","patternCfg","globalMatch","globalRegExp","RegExp","exec","localMatch","placeholderValues","mapValues","placeholders","placeholder","expr","capture","replacement","translateWithParams","params","defaultLang","compiler","translations","store","defaultTranslations","originalKey","gettext","originalValue","interpolateParams","noPatternMessages","pipeRegex","paramName","pipeName","compile","MissingTranslationCustomHandler","parser","patternMessagesService","cache","handle","messageKey","getFromCache","patternMessageTranslation","getPatternMessageTranslation","interpolate","addToCache","getCacheKey","stringify","TranslateParser","str","bulkOperationAuditLogTextPlaceholders","updatesList","status='(.+?)'","status","generalStatus='(.+?)'","generalStatus","progress='(.+?)'","progress","note=(.+?)","note","MESSAGES","^Access is denied$","^Alarm created$","^Alarm updated$","^API is not available with the new domain$","^Application with given name already exist$","^Application with id (.+?) is already assigned to the tenant (.+?)$","tenant","^Apply software changes: (.+?)\\.?$","softwareChanges","install \"(.+?)\" \\(version: (.+?)\\)","softwareName","softwareVersion","install \"([^\"]+)\"(?! \\(version: .+?\\))","delete \"(.+?)\" \\(version: (.+?)\\)","delete \"([^\"]+)\"(?! \\(version: .+?\\))","^Assign device profile (.+?) to device (.+?)$","profileName","deviceName","^(.+)pplication for tenant (.+) with properties \\( (.+?) \\) already exists$","valuesList","^Authentication failed! : User account is locked$","^Availability monitoring record$","^Can not activate a certificate which is either expired or not yet valid$","^Cannot add certificate - certificate with (.+?) fingerprint already exists. : Certificate with (.+?) fingerprint already exists.","fingerprint","^Cannot change password. : Provided token does not exist.$","^Cannot deploy module (.*)$","errorMessage","^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) \\[([\\S\\s]+?)\\]$","moduleName","expression","incorrectExpression","line","column","^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$","keyword","^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+), please check the where clause \\[([\\S\\s]+?)\\]$","^Cannot deploy module (.+?)! : Deployment failed in module '(.+?)' in expression '(.+?)' : Exception compiling script '(.+?)' of dialect '(.+?)': missing (.+?) before statement \\((.+?)\\) \\[([\\S\\s]+?)\\]$","scriptName","scriptDialect","missingSyntax","affectedStatement","^Cannot execute bulk operation on empty group. Group with id='(\\d+?)' doesn't have child assets.$","groupId","^Cannot execute bulk operation on empty group. DynamicGroup with id='(\\d+?)' doesn't have child assets$","^Cannot parse X509 certificate. : Could not parse certificate: (.+?)$","failureReason","^Cannot reschedule bulk operation. All its operations are successful$","^Cannot reset user password : Cannot find user with such email.$","^Cannot update/delete application binary via this endpoint$","^Can't delete user because it is used by another managed object$","^Cep module created$","^Cep module updated$","^Cep module deleted$","^Cep module \"(.+?)\" created$","^Cep module \"(.+?)\" updated$","^Cep module \"(.+?)\" deleted$","^Command state is invalid: (.+)$","violations","(\\w+?) - may not be null","field","^Could not connect to endpoint (.+)\\. Could not verify `(.+)` host key with fingerprint `(.+)` for `(.+)` on port (.+)\\. If you expected that key, please remove the previous one from configuration to allow for connection\\.$","endpointName","keyType","host","port","^Could not login to ssh server on endpoint \"(.+)\"\\. Provided credential for user \"(.+)\" is incorrect\\.$","userName","^Could not save object remoteAccessUpdate: (.+)$","errorMessages","Could not recognize host-key format","Could not recognize key-pair format","^Could not update user. : Error persisting user (.+?)!$","username","ˆCreate bulk operation$","^Create bulk operation: (.+)$","^Creation ramp must be greater than (\\d+?)$","minSeconds","^Created container$","^Created pod: (.+)$","imageName","^CSV file contained empty dataset$","^Cycle detected for route (.+?)!$","^Data broker processing is currently overloaded and may stop forwarding your data\\. Please contact support\\.$","^Data broker processing is not able to connect do destination tenant, thus data forwarding is not working\\. Please contact support\\.$","^Delete bulk operation$","^Delete bulk operation: (.+)$","^Device id '(.+?)' contains '(.+?)' character which is not permitted.$","deviceId","invalidCharacter","^Device name: '(.+?)', alarm text: '(.+?)'$","alarmText","^Display name$","^Domain name in uploaded certificate differs from the one in use$","^Domain name is already in use by another tenant!$","^Duplicated connector for instanceUrl (.+?)!$","targetUrl","^Duplicated connector for name (.+?)!$","^Entry is outside of the target dir: (.+)$","path","^Error during password validation. : Password must have at least (\\d+?) characters and no more than (\\d+?) and must contain only Latin1 characters.$","minCharactersCount","maxCharactersCount","^Error during password validation. : Your password has been used already. Choose another.$","^Error in statement (.+?):(.+?)! : Incorrect syntax near '(.+?)' near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$","statementNumber","^External id not found; external id = ID \\[type=(.+?), value=(.+?)\\]$","^Error occurred when trying to find an Application for id ID (.+) : Could not find application by ID (\\d+)$","applicationId","^Http status code: 404\n{error=\"options/Not Found\",message=\"Unable to find option by given key: sigfox-agent/provider.token\",info=\"https://www.cumulocity.com/guides/reference-guide/#error_reporting\",details=\"null\"}","^Failed to delete application. : Cannot remove application assigned to other tenants.$","^Failed to extract certificate from PKCS12$","^Failed to update domain at the platform$","^Finding device data from database failed : No managedObject for id '(.+?)'!$","^Following mandatory fields should be included: (.+?)$","fields","^Global Role updated$","^Global Role (.+?) updated$","^Global Role (.+?) updated: (.+)$","applications \\[([^\\]]+?)\\] added","list","applications \\[([^\\]]+?)\\] removed","roles \\[([^\\]]+?)\\] added","roles \\[([^\\]]+?)\\] removed","^Global Roles$","^Operation updated: (.+)$","description='(.+?)'","description","device name='(.+?)'","failure reason='(.+?)'","^ID \\[type=(.+?), value=(.+?)\\] was already bound to different Global ID.$","^Invalid credentials! : Bad credentials$","^Invalid credentials! : No phone number provided$","^Inventory Role removed$","^Inventory Role (.+?) removed","^Inventory Role updated$","^Inventory Role (.+?) updated","^I/O error: Connection refused; nested exception is Connection refused : Connection refused","^I/O error: Read timed out; nested exception is Read timed out : Read timed out","^Log file requested$","^Managed object deleted$","^Managed object \"(.+?)\" deleted$","^Maximum file size exceeded$","^Message with ID (.+?) doesn't exist in smart rest template (.+?)$","messageId","templateId","^NewDeviceRequest for id = (.+?) already exists.$","id","^No communication with device since (.+?)$","timestamp","^No data received from device within required interval.$","^No LoRa provider settings are found. Please configure the connectivity settings.$","^Not within any context!$","^Maximum age cannot be bigger than 10 years.$","^Microservice application name incorrect. Please use only lower-case letters, digits and dashes. Maximum length is (\\d+) characters.$","maxLength","^Microservice not available.*$","^Operation created$","^Operation updated$","^Operation created: status='(.+?)'.","^Option created$","^Option \"(.+?)\" created$","option","^Option deleted$","^Option \"(.+?)\" deleted$","^Owner field error. : Cannot introduce cyclic dependency.","^Password change is temporary blocked.$","^Password cipher does not match","^Platform application cannot be added to, nor removed from any tenant.$","^Private key must be provided in KEY_PAIR credentials$","^Private key cipher does not match","^Protocol \"(.+?)\" does not support \"(.+?)\" credentials type$","protocol","credentialsType","^pulling image \"(.+)\"$","^Real-time event processing is currently overloaded and may stop processing your events\\. Please contact support\\.$","^Resource ID \\[type=com_cumulocity_model_idtype_GId, value=(.+?)\\] for this request not found.$","^Retrieve configuration snapshot from device (.+?)","^Retrieve (.+?) configuration snapshot from device (.+?)","configurationType","^Scaled up replica set (.+) to (\\d+)$","replicaSetName","scaleNumber","^Send configuration snapshot (.+?) of configuration type (.+?) to device (.+?)","snapshotName","^Send configuration snapshot (.+?) to device (.+?)","^Simulator state is invalid: (.+)$","(\\w+?) - must be less than or equal to (\\d+)","maxValue","(\\w+?) - should not contain null values","^Smart rest template (.+?) doesn't exist$","^Smart rule created$","^Smart rule updated$","^Smart rule enabled$","^Smart rule disabled$","^Smart rule deleted$","^Smart rule \"(.+?)\" created$","^Smart rule \"(.+?)\" updated$","^Smart rule \"(.+?)\" enabled$","^Smart rule \"(.+?)\" disabled$","^Smart rule \"(.+?)\" deleted$","^Started container$","^Successfully assigned (.+) to (.+)$","address","^Successfully pulled image \"(.+)\"$","^Tenant creation failed. : Tenant with given id already exists.$","^Tenant id cannot be a reserved sql keyword \"(.+?)\".$","tenantId","^Tenant \"(.+?)\" activated$","^Tenant (.+?) has sub-tenants, please remove them first!$","^Tenant activated$","^Tenant \"(.+?)\" created$","^Tenant created$","^Tenant \"(.+?)\" deleted$","^Tenant deleted$","^Tenant \"(.+?)\" suspended$","^Tenant suspended$","^Tenant \"(.+?)\" updated: (.+?)$","properties","^Tenant updated$","^Too Many Requests$","^User alias equals username '(.+)'$","^User created$","^User (.+?) created$","^User deleted$","^User (.+?) deleted$","^User updated$","^User (.+?) updated: (.+)$","delegatedBy='(.+?)'","delegate","owner='(.+?)'","owner","inventory assignment \\[(.+?)\\] added","inventoryAssignment","inventory assignment \\[(.+?)\\] removed","applications \\[(.+?)\\] added$","applicationsList","applications \\[(.+?)\\] removed$","global roles \\[(.+?)\\] added$","globalRolesList","global roles \\[(.+?)\\] removed$","^User with username '(.+?)' already exists! : Duplicated: (.+?)$","^User with username or alias '(.+)' already exists! : Duplicated: (.+)$","usernameOrAlias","^User with email '(.+?)' already exists! : Duplicated: (.+?)$","email","^unable to find option with given key (.+?) : Could not find entity Option by ID (.+?)!$","^unable to find option with given key (.+?) : There is no system property for key (.+?)$","^Write failed with error code 16733 and error message 'trying to index text where term list is too big, max is 4mb _id: \"(.+?)\"'$","^Write failed with error code 17280 and error message 'WiredTigerIndex::insert: key too large to index, failing (.+?) { : \"(.+?)\" }'$","^You have reached devices limit. No more devices can be registered.$","^(.+) succeeded for volume \"(.+)\"","operation","volume","^Exception on tenant (.+) in statement '(.+)': Invocation exception when invoking method '(.+)' of class '(.+)' passing parameters \\[(.+)\\] for statement '(.+)': (.+) : (.+)$","methodName","classPath","parameters","statement","exceptionType","exceptionMessage","^No nodes are available that match all of the predicates: (.+).$","predicates","^Readiness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$","requestMethod","uri","^Liveness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$","^Error syncing pod$","^Failed create pod sandbox.$","^Exception on tenant (.+) in statement '(.+)': Http status code: (\\d+) \\{error=\"alarm/Unprocessable Entity\",message=\"(.+)\",info=\"https://www.cumulocity.com/guides/reference-guide/#error_reporting\",details=\"null\"\\}$","httpStatusCode","^User '(.+)' is managed by a remote identity management service defined by an administrator, direct update is forbidden$","^Added new child device to \"(.+)\" \\(ID: (.+)\\).$","parentDeviceName","parentDeviceId","^Updated child device of \"(.+)\" \\(ID: (.+)\\).$","^Added child device \"(.+)\" \\(ID: (.+)\\).$","^Removed child device \"(.+)\" \\(ID: (.+)\\).$","^Change value of \"(.+)\" to (.+) (.+).$","unit","^Change value of \"(.+)\" to (.+).$","^Change status of \"(.+)\" to \"(.+)\".$","^Send message \"(.+)\".$","^Close relay (.+).$","number","^Open relay (.+).$","^Change trace status to (.+).$","^Change relay status to (.+).$","^Closing relay (.+).$","^Opening relay (.+).$","^Update bulk operation$","^Update bulk operation: (.+)$","^Update firmware to: \"?(.+?)\"? \\(version: (.+)\\)\\.?$","^Update firmware to: \"?(.+?)\"?\\.?$","^Update configuration to (.+).$","^Apply device profile: (.+).?$","^Execute generic command: (.+).?$","command","^Failed to refresh application. : Cannot refresh non local-hosted application.$","^Failed to refresh application. : Cannot refresh application without active version id.$","^Scaled down replica set (.+) to (\\d+)$","^Deleted pod: (.+)$","^Container image \"(.+)\" already present on machine$","^Error updating tenant! Cannot insert second configuration for Password code grant internal/Bad Request$","CachedLocaleDictionaryService","cachedDictionary","TranslateCustomLoader","http","optionsService","cachedLocaleDictionaryService","getTranslation","langsDetails","tap","dictionary","getDictionaryWithTrimmedKeys","catchError","mapKeys","trimTranslationKey","HttpClient","trim","TranslateParserCustom","getValue","trimmedKey","translated","TranslateDefaultParser","ForceHtmlTranslateDirective","element","_ref","htmlUpdateEvent","EventEmitter","onTranslationChangeSub","onTranslationChange","event","checkNodes","onLangChangeSub","onLangChange","onDefaultLangChangeSub","onDefaultLangChange","isEqual","currentParams","ngAfterViewChecked","isLookupKeyMissing","nativeElement","lookupKey","getLookupKey","translateAndUpdateHtmlContent","emit","unsubscribe","complete","innerHTML","lookupKeyExist","TranslateService","ElementRef","ChangeDetectorRef","Directive","require","angularLocalesLanguageMap","en","en-EN","translateLoaderFactory","httpClient","localePath","localePathFactory","languagesFactory","localeId","appStateService","getAngularLocalesLanguageString","toLowerCase","toString","language","I18nModule","providers","provide","LOCALE_ID","useFactory","deps","useValue","multi","TranslateLoader","TranslateCompiler","useClass","TranslateFakeCompiler","MissingTranslationHandler","TranslateStore","NgxTranslateService","USE_STORE","USE_DEFAULT_LANG","USE_EXTEND","DEFAULT_LANGUAGE","forRoot","ngModule","I18nModule_1","NgModule","exports","TranslateModule","imports","HttpClientModule","declarations","moduleSrc","src","l","Boolean","join","Function","Map","loadLocale","moduleLang","has","fetch","res","text","module","catch","ngxTranslate","DEFAULT_SEPARATOR","queryStringLang","saveInLocalStorage","localStorage","getItem","TranslateService_1","SAVE_LANGUAGE_KEY","switchToLanguage","loadLocales","lessSpecificModuleLang","shift","e_1","setLanguage","registerLocaleData","default","setDefaultLang","use","firstSupportedLanguage","preferredLanguage","localStorageLang","browserLangs","find","getSupported","convertToLanguageCodePO","sep","indexOf","langMain","langSpecific","getNativeLanguage","nativeName","setItem","startsWith","getQueryParameter","navigator","property","propertyLanguages","queryKey","search","substring","pair","DatePipe","locale","transform","format","timezone","valueInBounds","valueBefore","valueBeyond","isNaN","min","Pipe","NgDatePipe","LoadMoreComponent","useIntersection","hidden","class","maxIterations","onLoad","counter","showNoMoreDataHint","LOAD_SAME_PAGE_THRESHOLD","hasMore","paging","totalPages","currentPage","nextPage","ngAfterContentInit","intersectionObserver","IntersectionObserver","buttonInView","container","observe","shouldShowNoMoreDataHint","disconnect","loadMore","stopPropagation","intersectionLoading","loadUntilIntersected","getLoadingThreshold","shouldSwitchMode","noMoreDataHint","isIntersecting","Output","HostBinding","ForOfDirective","tpl","vcr","componentFactoryResolver","cachedData","loadMoreMode","dataPipe","unsubscribe$","fetchData","obs$","notFoundTemplate","source","realtime","comparator","ngOnInit","handleRealtime","ngOnChanges","changes","c8yForPipe","c8yForOf","unsubscribePaging","reRender_1","hasMoreData","pagingSub","render","onCreate$","takeUntil","insert","onUpdate$","update","onDelete$","coerceNumberProperty","reRender","clear","index","context","$implicit","createEmbeddedView","shouldUseLoadMoreButton","createLoadMoreButtonComponent","append","loadMoreData","componentFactory","resolveComponentFactory","instance","createComponent","checkForDuplicates","comparisionResult","view","itemB","splice","viewRef","updatedItem","forMatchingEmbeddedViewRef","markForCheck","idToRemove","NaN","destroy","callback","cached","TemplateRef","ViewContainerRef","ComponentFactoryResolver","HumanizeAppNamePipe","internalApps","administration","cockpit","devicemanagement","appNameOrApp","appName","getAppName","isPublicApp","stream","getFirstDefined","values","negate","HumanizePipe","humanize","upperFirst","HumanizePipe_1","IconDirective","el","renderer","c8yMatch","klasses","currentClasses","icon","updateIcon","isC8y","getClasses","classes","_icon","newClasses","klass","removeClass","addClass","Renderer2","ICONS","memoize","resolver","memoizedFnName","_memoize","Permissions","appState","inventory","canEdit","roleIds","mo","checkIfCanEdit","hasRole","roleId","Error","hasAllRoles","hasAnyRole","checkIfOwner","currentUserName","checkWithRequest","moName","partialUpdateObject","success","err","InventoryService","UserService","IfAllowedDirective","permissions","allowAny","rolesIds","LoadingComponent","MapFunctionPipe","mappingFunction","OutletDirective","viewContainer","_element","Element","removeChild","parentElement","parent_1","parentNode","insertBefore","factory","component","_parent","ProgressBarComponent","ShortenUserNamePipe","firstName","lastName","parsedFirstName","substr","parsedLastName","TenantUiService","tenantService","isManagementTenant","current","isEnterpriseTenant","hasApp","hasBranding","hasSslManagement","hasUserHierarchy","hasDataBroker","isAvailable","TenantService","UserPreferencesStorageLocal","LOCAL_STORAGE_KEY","jsonStore","saveJsonStore","UserPreferencesStorageInventory","TYPE","fragmentType","updateMo","out","UserPreferencesService","storage","local","first","getForUser","setForUser","rawKey","getRawKey","getStorage","initializeServices","userPreferences","queryStringLanguage","firstLanguage","u","Status","ICON_LIST","CommonModule","DataModule","C8Y_APP","APP_INITIALIZER","CommonModule_1","NgCommonModule","TooltipModule","entryComponents","ActionBarComponent","navigatorOpen","hasTabs","isTabsHorizontal","isPageToolbarExpanded","uiActionBar","getSortedItems","byPriority","ActionBarModule","BsDropdownModule","CollapseModule","RouterModule","forChild","HOOK_ACTION","ActionService","ActionOutletComponent","getByPriority","invoke","action","ActionComponent","actionService","disabled","ActionModule","AlertService","MAX_ALERTS","ALERT_TIMEOUT","alert","addAlert","addByText","txt","detailedData","changeAlerts","areSame","fieldsToUpdate","removeLastDanger","firstDangerAlert","reverse","saveSuccess","savedObject","createSuccess","createdObject","clearAll","danger","info","warning","addServerFailure","hasRelevantMessage","statusText","alert1","alert2","onClose","onDetail","newAlerts","hideAutomaticallyIfNeeded","removeOldestIfMax","isSuccess","noDetails","alertTimeout","timeout","firstRemoved","slice","AlertDetailsComponent","AlertComponent","alertService","containDetailsComponent","ContentChild","AlertOutletComponent","position","detailDisplayedAlert","isStatic","getClass","close","showDetails","mode","setDetailsContent","hasDetails","closeDetails","isDetailsShow","isTemplateRef","content","contents","Attribute","AlertTextComponent","AlertModule","NavigatorNode","children","parents","routerLinkExact","open","draggable","droppable","dragged","draggedHover","confirm","_priority","snakeCase","childrenPriorities","openOnStart","node","updateChildren","ix","pix","updateHidden","predicate","compareLabel_1","toLocaleLowerCase","matches","found","child","empty","click","drop","$event","expandDragTimeout","dragStart","dataTransfer","setData","dragEnd","clearData","dragEnter","preventDefault","expand","dragLeave","expander","traverse","sort","a","NavigatorNodeRoot","addRoot","nodeData","localParent","parent","createNode","HOOK_NAVIGATOR_NODES","NavigatorService","firstUrl","rootNode","nodes","noParent","withParent","sortedNodes","openOnFirstUrl","isActive","HeaderService","navigatorService","DELAY_TO_AVOID_FLICKERING_ON_ASYNC_NODES","hasItemsInNavigator$","delay","title","nav","header$","header","navigatorOpen$","hasItems","titleReference","document","querySelector","elementRef","innerText","hideNavigator","documentElement","clientWidth","largeWidth","navigatorHiddenOnStartup","toggleNavigator","closeNavigator","configNavigator","config","changeTitle","newTitle","pageTitleUpdate","changePageTitle","verifyIfNavOpen","debounceTime","shouldToggle","shouldShowBreadcrumbs","breadcrumbs","HOOK_TABS","TabsService","tabs","prepareTabs","orientation$","firstTabWithDefinedOrientation","tab","orientation","tabsHorizontal","sortTabs","self","findIndex","priorityOrder","aTranslatedLabel","bTranslatedLabel","translatedLabelOrder","localeCompare","BootstrapComponent","actionBar","headerService","showPoweredBy","noAppsMargin$","hiddenOnStartup","tabsOrientation","BreadcrumbItemComponent","BreadcrumbOutletComponent","showAll","normalizePath","HOOK_BREADCRUMB","BreadcrumbService","sortByPreferredPath","selectPreferredByPath","preferredPath","bc","BreadcrumbComponent","breadcrumbService","contentChildItems","toArray","ContentChildren","BreadcrumbModule","NavigatorItemComponent","iconTemplate","NavigatorIconComponent","PopoverConfirmComponent","buttons","isOpen","containerClass","outsideClick","show","buttonStatus","handleOutsideClick","PopoverDirective","NavigatorNodeComponent","nodeClick","childrenNodes","expandParentIfActive","expandCollapse","routerLinkActive","recursive","forNode","updateIconTemplate","updateIconComponent","componentType","iconComponent","iconSlot","iconComponentFactory","read","RouterLinkActive","ViewChildren","NavigatorNodeComponent_1","RightDrawerComponent","quickLinks","helpAndSupport","TitleOutletComponent","zone","runOutsideAngular","NgZone","TitleComponent","HOOK_SEARCH","SearchService","UserMenuService","userMenuItems","documentationItems","HOOK_DOCS","DocsService","getBaseUrl","getUserGuideLink","link","getLink","templateStr","toPromise","links","noDefault","excludeDefault","staticLinks","lnk","partialLink","prefixWithSlash","HeaderBarComponent","searchService","userMenuService","docs","canToggle$","appState$","drawerOpen","headerOpen","toggle","AppSwitcherComponent","applications","listAppsForUser","getHref","apps","orderApps","filterApps","filterVisible","filterCloud","filterDuplicates","visibleApplicationTypes","includes","noAppSwitcher","hideCloudApps","filterFn","cloud","oneCloudApps","otherApp","orderBy","AppIconComponent","model","appIcon","showIcon","iconClass","appNameAbbr","iconStyle","c8yAppIconsList","analyticsbuilder","analytics-builder","apamaepl","white","defaultIconStyle","background-repeat","background-size","height","width","iconFromAppDefinition","findStaticIcon","iconUrl","iconUrlFromAppDefinition","background-image","isEmpty","appContextPathNormalized","cp","iconClassProperty","iconUrlProperty","NavigatorOutletComponent","isShown$","collapseNavigator","trackByPathOrLabel","LoginViews","statusIcons","SUCCESS","WARNING","DANGER","INFO","statusClasses","statusAlert","operationStatusIcons","OperationStatus","PENDING","EXECUTING","SUCCESSFUL","FAILED","operationStatusClasses","_e","ConfirmModalComponent","modal","_labels","ok","cancel","dismiss","hide","labels","BsModalRef","ModalComponent","onDismiss","customFooter","_dismiss","_close","onEnterKeyDown","hasOnlyOneButton","isCancelClickable","isOkClickable","HostListener","ModalService","modalService","modalLabels","initialState","acknowledge","acknowledgeLabel","BsModalService","ModalModule","BsModalModule","PopoverModule","NavigatorModule","CookieBannerService","STORAGE_KEY","COOKIE_BANNER","isCookieBannerShowed$","cookieDescriptions","required","functional","marketing","getCookiePreferencesConfig","settings","getCookieBannerSettings","configuration","setCookies","cookiePreferences","shouldShowCookieBanner","cookieBannerText","getUserCookiePreferences","isConfigCookiePreferencesDefined","isFunctionalCookieDisabled","getCookieDescription","cookieType","transformCookiePreferencesToList","entries","isReadonly","transformCookiePreferencesListToCookiePreferences","cookiePreferencesList","cookiePref","cookie","GainsightService","cookieBannerService","tagFunction$","GAINSIGHT_URL","GAINSIGHT_GLOBAL_SCOPE","SCRIPT_EXECUTION_WAIT_TIME","OPTIONS_KEY_CATEGORY","OPTIONS_KEY_NAME","loadTag","accountId","identify","scriptTag","createElement","gainsightKey","loadScriptTag","fromEvent","take","instanceId","getInstanceIdFromUrl","tagFunction","versionUI","versionBE","windowRef","userId","phone","userLanguage","triggerEvent","eventName","props","shouldLoadGainsightTag","customProperties","isGainsightDisabled","gainsightEnabled","windowRef_1","firstTag","getElementsByTagName","gainsightGlobalScope_1","q","async","warn","hostName","hostname","ProductExperienceDirective","gainsightService","onClick","actionName","actionData","ProductExperienceModule","SearchOutletComponent","openSearch","focusInputBox","closeDropdown","dropdown","verifyNotEmpty","term","elementToFocus","focus","SearchComponent","onSearch","HighlightComponent","elementClass","highlightedText","textNoHtml","escape","patternNoHtml","patternForRegex","escapeRegExp","SearchResultEmptyComponent","NO_RESULT_FOUND","msg","SearchModule","FormsModule","UserMenuItemComponent","userService","UserEditModalComponent","auth","client","loading","onHide","reason","changedLang","updateUserInAppState","onLanguage","updateAndClose","updateCurrent","password","updateCredentials","persistLanguage","currentUserResult","newCredentials","BasicAuth","LoginService","basicAuth","cookieAuth","api","rememberMe","TOKEN_KEY","TFATOKEN_KEY","OAUTH2_INTERNAL_TYPE","isFirstLogin","GREEN_MIN_LENGTH_DEFAULT","ERROR_MESSAGES","minlength","password_missmatch","maxlength","password_strength","remote_error","password_change","password_reset_token_expired","tfa_pin_invalid","pattern_phonenumber","pattern_newPassword","international_number_required","phone_number_error","pinAlreadySent","passwordConfirm","tfaExpired","SUCCESS_MESSAGES","password_changed","password_reset_requested","resend_sms","send_sms","passwordStrengthSetting","enforcePasswordStrength","greenMinLength","passwordStrengthValidity","localhostRegExp","localhostIpRegExp","showTenantRegExp","autoLogout","initLoginOptions","getTenant","isOAuth2","grantType","loginMode","oauthOptions","redirectToOauth","initRequest","fullPath","_platformLocation","href","redirectUrl","encodeURIComponent","originUriParam","errorPattern","isTfaExpired","hookResponse","response","EMPTY","apiCall","willLogout","json","clone","logout","getGreenMinLength","getBasicAuthLoginOption","getEnforcePasswordStrength","loginOption","isString","getPasswordStrengthValidity","strengthValidity","getPasswordStrengthEnforced","all","cleanMessages","addSuccessMessage","successKey","successMessage","getAuthStrategy","authStrategy","token","getStoredToken","tfa","getStoredTfaToken","setCredentials","useBasicAuth","credentials","login","setAuth","tenantRes","switchLoginMode","userRes","verifyAppAccess","getSupportUserName","storeBasicAuthToken","authFulfilled","isPasswordGrantLogin","URLSearchParams","grant_type","tfa_code","urlParams","method","headers","content-type","cleanLocalStorage","isSupportUser","showTenant","isLocal","isShowTenant","reload","resData","reset","tslib_1.__read","redirect","replaceState","cleanSessionStorage","saveTFAToken","tfaToken","ex_3","saveToken","sessionStorage","removeItem","basicAuthLoginOption","getStoredCredentials","decodeToken","decodeURIComponent","atob","CookieAuth","Realtime","LocationStrategy","PasswordConfirmModalComponent","loginService","passwordConfirmedEmitter","strategy","createNewClient","baseUrl","emitSuccessAndClose","Client","PasswordService","DEFAULT_PASSWORD_MIN_LENGTH","GREEN","colorName","color","passwordStrength","PasswordStrength","YELLOW","RED","confirmPassword","hasLowerCase","hasUpperCase","hasNumbers","hasSpecialChars","getStrengthColor","getDefaultPasswordMinLength","UserTotpSetupComponent","totpSetupVerified","activateTotp","UserEditComponent","passwordService","modalConfirmService","bsModalService","onUser","onCancel","userHasActiveTotp","userCanSetupTotp","isPhoneRequired","_user","userIsExternal","userOrigin","twoFactorAuthenticationEnabled","getTfaSettings","enabledOnSystemLevel","enabledOnTenantLevel","isTfaEnabled","initializeTotpSettings","setupTotp","save","saveAfterPasswordConfirmation","onNewPasswordChanged","newPassword","canUserSetupTotp","getActivityTotp","totpActivity","tfaStrategy","confirmed","UserMenuOutletComponent","copyIt","copied","handler","handleEvent","clipboardData","addEventListener","execCommand","removeEventListener","editUser","activateSupportAccess","companyName","successMsg","enableSupportUser","refreshCurrentUser","deactivateSupportAccess","textWithCompany","textWithoutCompany","isTenantAdmin","disableSupportUser","PasswordCheckListComponent","passwordStrengthChecker","minGreenLength","checklist","check","contextualColor","onPasswordChange","requirement","checked","PasswordConfirm","validate","abControl","controlToCompareWith","PasswordConfirm_1","NG_VALIDATORS","useExisting","PasswordStrengthCheckerService","PasswordStrengthComponent","passwordStrengthCheckerService","strength","NewPasswordComponent","changePassword","passwordEnforced","loadPasswordStrengthSettings","newPasswordChanged","showPasswordStrength","toggleChangePassword","viewProviders","ControlContainer","NgForm","PhoneValidationDirective","control","validateInternationalPhoneNumber","internationalPhoneNumber","numberValid","phoneNumber","parsePhoneNumberFromString","isValid","setValue","emitEvent","emitModelToViewChange","PhoneValidationDirective_1","ValidationPattern","rules","messages","domain","loginAlias","opcuaBrowsePath","urlSegment","groupName","ip","DefaultValidationDirective","c8yDefaultValidation","validation","valid","minLength","DefaultValidationDirective_1","MinValidationDirective","parsedMin","parseInt","MinValidationDirective_1","MaxValidationDirective","parsedMax","MaxValidationDirective_1","MessageDirective","MessagesComponent","defaults","messageMap","customMessages","directive","changVisibility","toMessage","FormGroupComponent","hasError","hasWarning","hasSuccess","novalidation","VALIDATION_DEBOUNCE_MS","initNgModel","valueAccessor","registerOnTouched","dirty","markAsDirty","updateValueAndValidity","onlySelf","subscription","valueChanges","statusChanges","debounce","timer","customErrorMessage","errors","NgModel","InputGroupListComponent","plus","minus","onRemove","onAdd","InputGroupListContainerDirective","listProjections","last","elements","JsonValidationPrettifierDirective","ngCtrl","invalidJSON","debounceTimeInMs","abstractCtrl","clearValidationMessage","validateInputAndPrettify","closed","validJsonObject","pretty","setErrorAndValidationMessage","setErrors","invalidBodyTemplate","NgControl","TextAreaRowHeightDirective","elem","rows","minHeightPerRow","convertedValue","heightPerRow","setHeight","setStyle","RequiredInputPlaceholderDirective","translationService","shouldSkipRequiredHint","closest","req","updatePlaceholder","getTextForPlaceholder","requiredText","requiredTextIndex","lastIndexOf","setAttribute","IpRangeInputListComponent","ipRangeList","cidr","FilterInputComponent","filterChange$","filterTerm","CARRIAGE_RETURN_KEY","CARRIAGE_RETURN_CODE","code","keyCode","NgFormsModule","TotpChallengeComponent","users","verify","onSuccess","verifyCode","verifyTotpCode","SmsChallengeComponent","smsToken","resendTfa","verifyTFACode","useOAuthInternal","verifyCodeWithOauth","verifyCodeWithBasicAuth","resendTFASms","e_2","loginWithTFA","e_3","e_4","TotpSetupComponent","totpSecret","secretQrUrl","rawSecret","otpAuth","qrCodeImage","generateTotpSecret","ex_1","ReadAsType","ProvidePhoneNumberComponent","onChangeView","requestInProgress","sendTfa","savePhoneNumber","sendTFASms","SmsChallenge","AuthenticationModule","QRCodeModule","UserTotpRevokeComponent","revokeEmitter","revoke","totpRevokeSecret","UserModule","HeaderModule","ChangePasswordComponent","passwordPattern","newPasswordConfirm","emailReadOnly","passwordStrengthEnforced","TOKEN_PARAM","EMAIL_PARAM","passwordStrengthColor","resetPassword","Credentials","CredentialsComponent","LOGIN_VIEWS","showLoginForm","showBasicAuth","PASSWORD_RESET_HEADER_NAME","NO_PHONE_HEADER_NAME","visibleOnLoginPage","handlePasswordReset","handleSmsChallenge","handleTotpChallenge","handleNoPhoneNumberProvided","ChangePassword","TotpSetup","TotpChallenge","ProvidePhoneNumber","LoginComponent","currentView","None","displayAlerts","getResetPasswordToken","loginAutomatically","handleLoginTemplate","onkeyup","setView","RecoverPasswordComponent","sendPasswordResetMail","TotpAuthComponent","isSetup","onTotpSuccess","StrengthValidatorService","isStrong","isPasswordGreen","PasswordStrengthValidatorDirective","forced","strengthFulfilled","PasswordStrengthValidatorDirective_1","LoginModule","LoginModule_1","C8yFormsModule","TabComponent","TabsOutletComponent","showLeft","showRight","visibleTabs","scrollSubscription","scrollSubscribe","navigateTo","navigate","scroll","direction","getDimensions","widthScroll","targetScroll","scrollLeft","unlisten","fromEventPattern","listen","updateScroll","elTabs","tabsContainer","scrollWidth","TabsModule","CookieBannerPreferencesModalComponent","closeSubject","configCookiePreferencesList","configCookiePreferences","modalRef","CookieBannerComponent","shouldDisable","onConfigurePreferences","disableButtons","userCookiePreferences","setCookieBannerVisibility","acceptCookies","shouldShow","showBanner","BootstrapModule","DropAreaComponent","loadingMessage","alwaysShow","clickToOpen","dropped","maxAllowedFiles","Infinity","isOver","area","files","onFilesSelected","style","offsetHeight","onOver","showPicker","picker","onPick","onDrop","stopDragging","shouldShowFilesList","isFilesArrayEmpty","hasEmptyFiles","isTooManyFiles","onDelete","filesNameString","clearErrors","getFilesNamesAsString","compose","isAnyFileEmpty","file","readAsJson","TEXT","readAsText","readAsArrayBuffer","ARRAY_BUFFER","readAsBinaryString","BINARY_STRING","readAsDataURL","DATA_URL","reader","FileReader","onload","readyState","ViewContext","DropAreaModule","FilePickerComponent","onFilesPicked","uploadChoice","fileBinary","droppedFiles","onFileDropped","clearInputFromUrl","fileUrl","fileToSave","clearSelectedFiles","dropArea","onFileUrlChange","urlStr","isPopoverUsed","fileUrlPopover","FilePickerModule","C8yCommonModule","DatePickerComponent","onDateSelected","fgDatePicker","FormGroup","dateFrom","FormControl","dateTo","clearFilter","DatePickerModule","ReactiveFormsModule","BsDatepickerModule","RouterTabsResolver","snapshot","latestChildren","routeConfig","mergeMap","getGuards","guard","canActivate","routerStateSnapshot","every","guards","showIf","ViewContextServices","contextToService","services","Device","Group","User","Application","SubscribedApplications","Tenant","Report","ContextRouteService","tabsResolver","tabsService","lastAddedTabs","init","routerSubscription","redirectToFirstTab","dataSubscription","updatedContext","updateTabs","refreshContext","serviceInstance","detailsUrlRegex","getDetailUrl","contextData","contextRegex_1","childrenRegex_1","contextChanged","childrenAffected","NEVER","needsRedirect","firstTab$","navigateByUrl","replaceUrl","parseUrl","PRIMARY_OUTLET","segments","HOOK_ONCE_ROUTE","RouterService","contextRouteService","routes","addRoute","addRoutes","emptyRoute","resetConfig","tslib_1.__spread","convertRoute","initialConfig","ContextRouteComponent","refreshTabs","ActivatedRoute","callsSubject","asObservable","hookIntoClientFetch","hookFilter","hookRequest","onFinish","onStart","resolveData","cb","bind","fetchPromise","responseInterceptor","DataModule_1","ContextRouteGuard","caches","paramMap","clearDetailCached","detailCached","getCache","withChildren","EmptyComponent","SendStatus","PushStatus","SendStatusLabels","PushStatusLabels","routerService","RouterModule_1","NgRouterModule","deviceAvailabilityIconMap","sendData","_a$1","AVAILABLE","UNAVAILABLE","UNKNOWN","NOT_MONITORED","_b$1","CONNECTED","DISCONNECTED","MAINTENANCE","device","lastMessage","Date","tooltips","sendStatusConnected","ɵ0$1","sendStatusDisconnected","pushStatusConnected","pushStatusDisconnected","maintenance","DeviceStatusComponent","_mo","setStatusProperites","requiredAvailability","availabilityStatus","pushStatus","sendStatus","getMaintenanceStatus","getSendPushStatus","maintenanceStatus","tooltip","getSendStatusTooltip","getPushStatusTooltip","availability","c8y_Availability","DeviceStatusModule","GuideHrefDirective","htmlAnchor","hasAttribute","c8yGuideHref","GuideDocsComponent","destroyed$","ReplaySubject","translateDirective","replaceAnchorAttributes","findGuideAnchors","guideHref","getAttribute","nodeName","attributes","getNamedItem","childNodes","searchResult","guide","baseHref","descendants","DocsModule","ArrayTypeComponent","to","fieldGroup","CONFIG","types","ArrayTypeComponent_1","FieldArrayType","FieldCheckbox","defaultOptions","templateOptions","indeterminate","formCheck","FieldCheckbox_1","extends","changeDetection","ChangeDetectionStrategy","OnPush","FieldType","WrapperFormField","maxHelpBlockLength","showDescriptionAsPopup","wrappers","WrapperFormField_1","FieldWrapper","FieldInput","FieldInput_1","ObjectTypeComponent","ObjectTypeComponent_1","FieldRadio","FieldRadio_1","FIELD_TYPES","fieldTypeFactory","formlyConfig","typeConfig","tslib_1.__assign","DynamicFormsUIThemeModule","FormlyModule","FormlySelectModule","FORMLY_CONFIG","TranslateExtension","prePopulate","_translated","expressionProperties","templateOptions.label","templateOptions.description","templateOptions.placeholder","example","templateOptions.options","registerTranslateExtension","extensions","extension","I18nModule$1","ɵ0$2","C8yJSONSchema","toFieldConfig","schema","c8yOptions","mappedField","mapSource","const","writeOnly","autocomplete","examples","enum","FormlyJsonschema","c8yValidationConfigFactory","validationMessages","FilteringActionType","ValidationModule","ɵ0$3","DynamicFormsModule","HOOK_COMPONENTS","HOOK_COMPONENT","DynamicComponentService","getComponentsViaDeprecatedHook","cmps","cmp","componentsViaDeprecatedHook","__MODE__","getById$","size","DynamicComponentComponent","dynamicComponentService","notFoundError","expandErrorDetails","callLifeCycleHooks","callOnBeforeSaveHook","componentId","loadComponent","dynamicComponent","configComponent","componentRef","hook","onBeforeSave","DynamicComponentModule","DashboardChildActionComponent","DashboardChildTitleComponent","DashboardComponent","sanitizer","columns","gap","dashboardChange","lastRow","DEFAULT_ROW_SIZE","dashboardRect","calculateRowSize","bypassSecurityTrustStyle","rowSize","onResize","getLastRow","updateRectSize","widget","ele","getBoundingClientRect","emitChange","DomSanitizer","forwardRef","DashboardChildComponent","DashboardChildChange","childToChange","MIN_WIDTH","MIN_HEIGHT","PIXEL_SIZE_THRESHOLD","diffX","diffY","dashboard","dragSource","moved","move","getPixelSize","resizeDimension","setPixelSize","getDimensionSize","prev","dimension","setDimension","arrangePipe","getDimensionPosition","x","findFreeDimension","getCollided","collapseUpAll","w","ds","newPosition","collapseUp","arrangeAll","arrange","spacing","origin","dimensions","notIfColliding","columnSize","pxWidth","pxHeight","moveEvent","draggedElement","rect","left","top","pointerPosition","round","pointer","resizePosition","row","nextElementSibling","doesCollide","currentDimension","actions","isResize","isDragging","_pxWidth","_pxHeight","margin","isFrozen","changeStart","changeEnd","intersected","getOrder","card","card-dashboard","on-resize","setDynamicDimension","intersectionObserver_1","childInView","resizeStarted","positioning","changeSubscription","resize$","dragStarted","drag$","observer","unobserve","WidgetsDashboardComponent","isDisabled","widgetMargin","translateWidgetTitle","defaultHeight","defaultWidth","allowFullscreen","canDelete","onAddWidget","onEditWidget","onDeleteWidget","onChangeDashboard","onEditDashboard","onDeleteDashboard","onFreeze","onChangeStart","onChangeEnd","toggleFullscreen","doc","fullScreen","exitFullscreen","msExitFullscreen","mozCancelFullScreen","webkitExitFullscreen","requestFullscreen","msRequestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","ALLOW_KEYBOARD_INPUT","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","msFullscreenElement","DashboardModule","DragDropModule","C8yStepperIcon","templateRef","C8yStepper","disableDefaultIcons","edit","onStepChange","_iconOverrides","_stepIndex","_icons","_stepIndexSubscription","getIndicatorType","_state","_getIndicatorType","STEP_STATE","EDIT","DONE","setIndex","C8yStepper_1","CdkStepper","C8yStepperProgress","onStepClicked","stepSelected","C8yStepperButtons","stepper","pending","onNext","onBack","onCustom","showBtns","back","custom","observers","steps","stepControl","invalid","statusChangeSubscription","currentValue","selected","completed","previous","Host","CdkStep","displayDefaultIndicatorType","StepperModule","CdkStepperModule","STEPPER_GLOBAL_OPTIONS","ɵ0$4","ListItemActionComponent","ListItemCollapseComponent","collapseWay","ListItemFooterComponent","ListItemComponent","active","collapsed","collapsedChange","showFooter","showActions","showCollapse","dropdownUp","pulse$","destroy$","ACTION_ITEM_HEIGHT","classList","ngAfterContentChecked","itemActions","itemFooter","itemCollapse","showDropdownUp","dropdownDownFits","innerHeight","toggleCollapsed","pulse","ListItemBodyComponent","ListItemRadioComponent","onSelect","radio","firstChange","change","onChange","onTouched","registerOnChange","writeValue","ListItemRadioComponent_1","NG_VALUE_ACCESSOR","ListItemTimelineComponent","ListGroupComponent","timeline","timelineComponent","ListItemIconComponent","ListItemCheckboxComponent","select","ListItemCheckboxComponent_1","CheckboxControlValueAccessor","ListGroupModule","AuditLogComponent","audit","withTotalPages","records","AuditService","AuditLogModule","CellRendererDefDirective","HeaderCellRendererDefDirective","FilteringFormRendererDefDirective","ColumnDirective","ratiosByColumnTypes","numeric","text-short","text-long","GridDataSource","loadingSubject","dataSourceSubject","dataStatsSubject","filteredSize","currentPageSize","firstPageSize","dataSelectionSubject","filteredDataIds","resultListSubject","loading$","data$","stats$","selection$","resultList$","connect","collectionViewer","loadData","pagination","searchText","serverSideDataCallback","selectable","selectionPrimaryKey","infiniteScroll","clientSideData$","initialData","transformedData","flow","doClientSideSearch","doClientSideFiltering","doClientSideSorting","doClientSidePagination","serverSideData$","selection","enabled","primaryKey","finalize","resolveValue","resolveFunction","normalizeNil","isNil","filterPredicate","propPaths","regexSearch","createRegexSearch","itemWithResolvedValues","pick","omitBy","cellValue","actives","sortOrder","sortingState","paths","orders","chunk","filterValue","escapeRegExpPattern","ModalSelectionMode","DataGridComponent","hostRef","cd","cfr","loadMoreItemsLabel","loadingItemsLabel","noMatchingItemsLabel","dataSource","filteringLabelsParams","filteredItemsCount","allItemsCount","paginationLabelParams","pageFirstItemIdx","pageLastItemIdx","itemsTotal","possiblePageSizes","minPossiblePageSize","displayOptions","striped","bordered","gridHeader","rowMouseOver","rowMouseLeave","rowClick","onConfigChange","itemsSelect","columnNames","styles","tableCursor","gridTemplateColumns","gridInfiniteScrollColumn","searchText$","filteringApplied","totalPagesCount","selectedItemIds","currentPageSelectionState","allSelected","allDeselected","builtInActionType","Edit","Delete","Export","resizeHandleMouseDown$","resizeHandleContainerMouseMove$","resizeHandleContainerMouseUp$","possiblePageSize","actionControls","bulkActionControls","currentPageEmpty","isItemSelected","stats","createLoadMoreComponent","updateFilteringLabelsParams","updatePaginationLabelParams","updateColumns","updateGridColumnsSize","thEls","thRefs","setupResizeHandle","trackByName","resolveCellValue","changeSortOrder","columnName","updateSorting","emitConfigChange","applyFilter","filteringModifier","updateFiltering","ApplyFilter","payload","resetFilter","ResetFilter","clearFilters","externalFilterQuery","updateFilteringApplied","isColumnFilteringApplied","filterable","updatePagination","itemsPerPage","page","recreateLoadMoreComponent","scrollToTop","loadNextPage","getCellRendererSpec","_getCellRendererSpec","getHeaderCellRendererSpec","getFilteringFormRendererSpec","getColumnRenderer","filteringFormRendererComponent","setAllItemsSelected","setItemsSelected","setAllItemsInCurrentPageSelected","itemIds","union","without","onColumnDrop","previousIndex","currentIndex","updateColumnNames","visible","gridTrackSize","specialColumn","sortable","positionFixed","withColumnDefaults","dataType","headerCSSClassName","cellCSSClassName","clearMouseHighlights","targetColumnName","headerBeingResized","requestAnimationFrame","wrapper","horizontalOffset","clientX","offsetLeft","_parseInt","getSelection","removeAllRanges","columnRenderer","rendererTemplate","cellRendererComponent","headerCellRendererComponent","columnRenderers","loadMoreComponent","infiniteScrollContainer","loadNextLabel","loadingLabel","scrollContainer","scrollTop","CdkHeaderCell","CellRendererComponent","spec","prevSpec","rendererType","Type","rendererInjector","CellRendererContext","ngDoCheck","FilteringFormRendererComponent","defaultRendererFilterText","FilteringFormRendererContext","DataGridModule","CdkTableModule","C8YCommonModule","PaginationModule","HelpComponent","docsService","isCollapsed","SUPPORTED_LANGUAGES","getUrl","parseVersion","endsWith","clean","requestContent","resolveIcon","helpContent","XMLHttpRequest","onreadystatechange","responseType","setRequestHeader","send","majorNumber","floor","sectionSplit","sectionQuery","sectionNode","allPossibleElementsToAttach","allPossibleElementsToAttach_1","tslib_1.__values","allPossibleElementsToAttach_1_1","tagName","HelpModule","RealtimeButtonComponent","stop","start","RealtimeModule","SelectModalComponent","bsModalRef","subTitle","MULTI","disableSelected","showFilter","areMoreEntries","listItems","debouncer","itemsPromise","selectedId","obj","updatePipe","updateChoice","getOutput","selectedOption","SelectModalFilterPipe","extractValues","filterContainString","SelectModalModule","SelectComponent","applyLabel","textFilter","labelText","filteredItems","searchFilter","sizeToShowFilter","labelsForSelectAll","allFiltered","showAllLabel","itemsSelected","stopClicks","preventClick","isOpenChange","updateSelected","outterSelected","isSelected","isAllItemsSelected","isAllFilteredSelected","applyChanges","selectAll","onChangeItem","updateFiltered","search_1","getSelectAllToggleStatus","getLabel","isAllSelected","updateLabel","selectedLabel","BsDropdownDirective","TypeaheadComponent","allowFreeEntries","displayProperty","selectedChange","KEYCODE_UP","KEYCODE_DOWN","KEYCODE_TAB","KEYCODE_ENTER","KEYCODE_ESC","doBlur","getDisplayProperty","onShown","searchControl","handleKeyboard","blur","upOrDown","ctrl","notExisting","TypeaheadComponent_1","SelectModule","CoreModule","CoreModule_1","c8yFormsModule","c8yStepperModule","QuickLinkComponent","kebabCase","QuickLinkModule","HOOK_DYNAMIC_PROVIDER_CONFIG","ProviderConfigurationNodeFactory","navigation","ca","checkCanActivate","forkJoin","canActivateResult","wrapIntoObservable","caResult","isPromise","ProviderConfigurationService","activatedRoute","listUrl","ProviderConfigurationService_1","NO_DETAIL_ID","entity","Service","ProviderDefinitionsService","ProviderConfigurationComponent","providerDefinitionsService","providerConfigurationService","jsonschema","layout$","layout","formState","saveRoles","changeProvider$","providerInput$","form","reload$","updatedConfiguration$","allProviders$","providers$","input","displayName","configuration$","removeEncryptedValues","selectedProvider$","newProvider","provider","fieldConfig","ɵdefineHiddenProp","templateOptions.disabled","saveProviderConfiguration","configurationUpdatedSuccessMsg","markAsPristine","err_1","deleteProviderConfiguration","deleteConfigurationModalTitle","deleteConfigurationModalBody","deleteConfigurationModalOkBtnLabel","deleteConfigurationModalCancelBtnLabel","configurationDeletedSuccessMsg","err_2","ProviderConfigurationRouteFactory","endpoint","ProviderConfigurationModule","ProviderConfigurationModule_1","RealtimeService","subjects$","onAll$","entityOrId","subject$","getSubjectForChannel","channel","realtimeAction","getIdString","reference","String","getChannel","RealtimeSubject","realtimeChannel","realtimeSubscription","OperationBulkRealtimeService","ManagedObjectRealtimeService"],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAIA,GAAgB,SAASC,EAAGC,GAI5B,OAHAF,GAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,IAGrB,SAASO,GAAUR,EAAGC,GAEzB,SAASQ,IAAOC,KAAKC,YAAcX,EADnCD,GAAcC,EAAGC,GAEjBD,EAAEY,UAAkB,OAANX,EAAaC,OAAOW,OAAOZ,IAAMQ,EAAGG,UAAYX,EAAEW,UAAW,IAAIH,GAG5E,IAAIK,GAAW,WAQlB,OAPAA,GAAWZ,OAAOa,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAA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AKyzB,SAASY,YAAYr0B,EAAKwzB,GAAG7O,cAAeyP,MAEnDD,EAAWhrB,MAAM,MAAMtM,QAAO,SAAC5D,GAAM,OAAAA,KAAGsK,SAAQ,SAAC6wB,GAC/Cp0B,EAAKyzB,SAASa,SAASt0B,EAAKwzB,GAAG7O,cAAeyP,MAEhDt8B,KAAK87B,eAAiBO,6CA5BZ9O,EAAAA,kBACMkP,EAAAA,aARpB9yB,GAAAA,CADCC,EAAAA,qCAFU6xB,EAAa36B,GAAA,CAHzB2sB,EAAAA,UAAU,CACTzjB,SAAU,eAECyxB,GAAb,GA2CaiB,GAAQ,CACZ,OACA,KACA,cACA,QACA,aACA,OACA,eACA,aACA,iBACA,QACA,YACA,UACA,SACA,SACA,SACA,SACA,OACA,YACA,SACA,cACA,UACA,QACA,OACA,WACA,MACA,OACA,SACA,QACA,OACA,OACA,SACA,MACA,OACA,SACA,MACA,OACA,QACA,UACA,WACA,SACA,WACA,eACA,iBACA,QACA,UACA,UACA,SACA,OACA,OACA,SACA,OACA,WACA,cACA,MACA,WACA,SACA,WACA,MACA,OACA,eACA,gBACA,YACA,UACA,WACA,QACA,cACA,QACA,UACA,WACA,YACA,aACA,WACA,OACA,YACA,SACA,WACA,QACA,QACA,QACA,YACA,cACA,QACA,OACA,SACA,WACA,SACA,WACA,aACA,aACA,cACA,UACA,OACA,QACA,UACA,SACA,OACA,UACA,YACA,aACA,aACA,MACA,QACA,UACA,UACA,SCxJT,SAAgBC,GAAQC,GACtB,OAAO,SAAC57B,EAAQ4L,EAAQC,GACtB,IAAMC,EAAKD,EAAWxK,MACtBwK,EAAWxK,MAAQ,eAAS,IAAAiK,EAAA,GAAAS,EAAA,EAAAA,EAAArM,UAAAC,OAAAoM,IAAAT,EAAAS,GAAArM,UAAAqM,GAC1B,IAAM8vB,EAAiB,IAAIjwB,EAAM,WAIjC,OAHK5M,KAAK68B,KACR78B,KAAK68B,GAAkBC,EAAAA,QAAShwB,EAAI8vB,IAE/B58B,KAAK68B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B16F,KAAKq3B,SAAShoB,UAAUrP,KAAKy6F,iBAAiB,SAAAj6C,GACxE,IAAM10C,EAA2B,CAC/BouF,QAAS15C,EAAI05C,QACbpuF,KAAM00C,EAAI10C,KAAKA,KACf4U,GAAI8/B,EAAI9/B,GACRy5E,eAAgB35C,EAAI10C,KAAKquF,gBAE3BjyF,EAAK3F,KAAKuJ,QAKhB0uF,EAAAt6F,UAAAgxF,KAAA,WACMlxF,KAAK06F,uBACP16F,KAAKq3B,SAASnK,YAAYltB,KAAK06F,sBAC/B16F,KAAK06F,qBAAuB,OAGlCF,EA/BA,CAAiCpyF,EAAAA,SClIjCuyF,GAAA,SAAA3yF,GACE,SAAA2yF,EAAYtjE,UACVrvB,EAAApH,KAAAZ,KAAMq3B,IAASr3B,KAMnB,OARkDyI,GAAAA,EAAAA,GAKtCkyF,EAAAz6F,UAAAg6F,QAAV,WACE,MAAO,8DALatwC,EAAAA,YADX+wC,EAA4B75F,GAAA,CADxCiI,EAAAA,cACY4xF,GAAb,CAAkDf,mBCFhD,SAAAgB,EAAYvjE,UACVrvB,EAAApH,KAAAZ,KAAMq3B,IAASr3B,KAMnB,OARkDyI,GAAAA,EAAAA,GAKtCmyF,EAAA16F,UAAAg6F,QAAV,WACE,MAAO,8DALatwC,EAAAA,YADXgxC,EAA4B95F,GAAA,CADxCiI,EAAAA,cACY6xF,IAAqChB,umD/NIF,m7HVP/B,SAACjjF,GAAQ,OAAAA,wRyKqJY","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';\nimport { flatten, isFunction, sortBy } from 'lodash-es';\nimport { combineLatest, defer, from, isObservable, Observable, of, race } from 'rxjs';\nimport { filter, map, merge, startWith, switchMap } from 'rxjs/operators';\n\nexport function fromTrigger(router, refresh, factories) {\n return router.events.pipe(\n filter(evt => evt instanceof NavigationEnd),\n merge(refresh),\n startWith(1),\n switchMap(() => fromFactories(factories, router))\n );\n}\nexport function fromFactories<T>(\n factories?,\n router?: Router,\n withFirstEmpty = true\n): Observable<T[]> {\n return !Array.isArray(factories) || factories.length < 1\n ? of([])\n : defer(() => {\n const factoryObservables = resolveInjectedFactories(factories).map(f => {\n return toObservable(\n Array.isArray(f) ? f : f && isFunction(f.get) ? f.get(getActivatedRoute(router)) : [f],\n withFirstEmpty\n );\n });\n return combineLatest(...factoryObservables);\n }).pipe(map(results => sortByPriority([].concat(...results))));\n}\n\nexport function resolveInjectedFactories(factories) {\n return flatten(factories.map(f => (isFunction(f) ? f() : [f])));\n}\n\nexport function stateToFactory<T>(componentsState): ExtensionFactory<T> {\n const components$ = componentsState.pipe(map((componentSet: Set<T>) => Array.from(componentSet)));\n return { get: () => components$ };\n}\n\nexport function sortByPriority(items) {\n return sortBy(items, 'priority');\n}\n\nfunction toObservable(factoryResult, withFirstEmpty) {\n let observable;\n if (!factoryResult) {\n return of([]);\n } else if (typeof factoryResult.then === 'function' || isObservable(factoryResult)) {\n if (withFirstEmpty) {\n const forceObservable = from(factoryResult);\n const withEmptyFirst = forceObservable.pipe(startWith([]));\n observable = race(forceObservable, withEmptyFirst);\n } else {\n observable = from(factoryResult);\n }\n } else {\n observable = of(factoryResult);\n }\n return observable.pipe(\n map(result => (Array.isArray(result) ? result : [result]).filter(item => !!item))\n );\n}\n\n/**\n * Allows to extend the existing applications from a module.\n */\nexport interface ExtensionFactory<T> {\n /**\n * Allows to resolve the data of an extension point.\n * The return value can be a Promise or Observable\n * (allowing for asynchronous data resolution).\n *\n * @param activatedRoute The current activated route (if possible to resolve).\n */\n get(activatedRoute?: ActivatedRoute): Observable<T[] | T> | Promise<T[] | T> | T[] | T;\n}\n\n/**\n * Extension points allow to extend the application from\n * any module\n */\nexport interface ExtensionPoint<T> {\n /**\n * Observable that emits of array of extensions active at any give time\n */\n readonly items$: Observable<T[]>;\n /**\n * Call the extension factories to refresh them.\n */\n refresh();\n}\n\n/**\n * Helper function to get the activated route in\n * a service (as ActivatedRoute injection only\n * works in components). Works as long as we only use\n * a tree and no child is active at the same time.\n *\n * @param router The current router\n */\nexport function getActivatedRoute(router: Router) {\n if (router && router.routerState && router.routerState.root) {\n let route = router.routerState.root;\n while (route.firstChild) {\n route = route.firstChild;\n }\n return route;\n }\n}\n","import { Observable, BehaviorSubject } from 'rxjs';\nimport { distinctUntilChanged, map } from 'rxjs/operators';\n\n/**\n * A abstract state which should be included in each state.\n * @abstract\n */\nexport abstract class StateService {\n /**\n * Saves the state. Should not be accessible directly. Use map or the getter to access\n * the state. Use functions in the implementation to change the state.\n */\n protected abstract state$: BehaviorSubject<any> | any;\n\n /**\n * Should return the current state of this StateService\n */\n abstract get state();\n\n /**\n * Maps to a property and just returns that property.\n * @param mappedProperty The property to map to.\n */\n map(mappedProperty: (stateProperty) => any): Observable<any> {\n return this.state$.pipe(map(mappedProperty), distinctUntilChanged());\n }\n\n /**\n * Emits a new state.\n */\n protected emitNewState() {\n this.state$.next(this.state);\n }\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport {\n ExtensionPoint,\n fromTrigger,\n sortByPriority,\n stateToFactory\n} from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport { ActionBarItem } from './action-bar.model';\n\n/**\n * A hook to add ActionBarItems using the multi provider extension concept.\n *\n * @example\n * ```typescript\n * providers: [\n * {\n * provide: HOOK_ACTION_BAR,\n * useValue: [{ template: SomeComponent, priority: 10, placement: 'left' } as ActionBarItem],\n * multi: true\n * }\n * ]\n * ```\n *\n */\nexport const HOOK_ACTION_BAR = new InjectionToken('ActionBarFactory');\n\n/**\n * A service which defines action-bar items via the multi provider concept.\n *\n * @example\n * ```typescript\n * // preferred way, multi provider concept:\n * providers: [\n * {\n * provide: HOOK_ACTION_BAR,\n * useValue: [{ template: SomeComponent, priority: 10, placement: 'left' } as ActionBarItem],\n * multi: true\n * }\n * ]\n *\n * // use services:\n * this.actionBarService.add({ template: SomeComponent, priority: 10, placement: 'left' });\n * ```\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ActionBarService extends StateService implements ExtensionPoint<ActionBarItem> {\n items$: Observable<ActionBarItem[]>;\n readonly refreshTrigger = new Subject();\n protected state$ = new BehaviorSubject<Set<ActionBarItem>>(new Set<ActionBarItem>());\n\n /**\n * @ignore\n */\n constructor(private injector: Injector, router: Router) {\n super();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_ACTION_BAR, []),\n stateToFactory(this.state$)\n ]).pipe(\n map((items: ActionBarItem[]) => sortByPriority(items)),\n shareReplay(1)\n );\n }\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state(): Set<ActionBarItem> {\n return this.state$.value;\n }\n\n /**\n * Refreshes the current store.\n */\n refresh() {\n this.refreshTrigger.next();\n }\n\n /**\n * Adds a new item to the action bar in the header and emits a state change.\n * @param item The item to add.\n */\n add(item: ActionBarItem) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes an action bar item from the header and emits a state change.\n * @param item The item to remove.\n */\n remove(item: ActionBarItem) {\n this.state.delete(item);\n this.emitNewState();\n }\n}\n","import { Component, Input, ViewChild } from '@angular/core';\nimport { ActionBarItem } from './action-bar.model';\nimport { ActionBarService } from './action-bar.service';\n\n/**\n * A <c8y-action-bar-item> can be added with content projection.\n * It allows to show items in three positions (left, right\n * or more).\n *\n * @example\n * ```html\n * <c8y-action-bar-item [placement]=\"'right'\">\n * <button class=\"btn btn-link\" (click)=\"addRandom()\"><i class=\"fa fa-plus\"></i> Add random</button>\n * </c8y-action-bar-item>\n * ```\n */\n@Component({\n selector: 'c8y-action-bar-item',\n templateUrl: './action-bar-item.component.html'\n})\nexport class ActionBarItemComponent implements ActionBarItem {\n /**\n * Where the item should be shown. Use \"more\" to place\n * it in a dropdown on the right.\n */\n @Input() placement: 'left' | 'right' | 'more' = 'left';\n\n /**\n * Priority for sorting the list. Higher priority means\n * an earlier position in the list.\n */\n @Input() priority: number = 0;\n\n /**\n * Adds additional classes to the item.\n */\n @Input() itemClass = '';\n\n /**\n * @ignore\n */\n @ViewChild('template', { static: false }) template: any;\n\n private viewInitTimeout;\n\n /**\n * @ignore\n */\n constructor(private actionBarService: ActionBarService) {}\n\n /**\n * @ignore\n */\n ngAfterViewInit() {\n this.viewInitTimeout = setTimeout(() => this.actionBarService.add(this as ActionBarItem));\n }\n\n /**\n * @ignore\n */\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.actionBarService.remove(this as ActionBarItem);\n }\n}\n","/*\n * -----------------------------WARNING---------------------------------\n * This file has an *exact* copy in packages/cli/src/webpack.\n * Any changes to this file must be reflected there, too.\n */\nexport class ApplicationOptions {\n /** Application name (saved to the server). */\n name: string;\n /** Application context path (saved to the server). */\n contextPath: string;\n /** Application key (saved to the server). */\n key: string;\n /** Set to `true` if the application is hybrid and uses Angular and AngularJS simultaneously. */\n upgrade?: boolean;\n /** Path to the branding entry file. */\n brandingEntry?: string;\n /** Path to tsccnfig.json file if TypeScript is used (default: ./tsconfig.json). */\n tsConfigPath?: string;\n /** Entry module for Angular compiler (only used with lazy loaded routes), e.g. `'app.module.ts#AppModule'`. */\n entryModule?: string;\n /** Path to custom index.html (otherwise default one will be used). */\n indexTemplate?: string;\n /** URL to dynamically fetched options. */\n dynamicOptionsUrl?: string;\n /** URL to favicon. */\n faviconUrl?: string;\n /** URL to *.css file which will replace default branding. */\n brandingUrl?: string;\n /** Object with properties that will be converted to CSS custom variables. */\n brandingCssVars?: {\n [key: string]: string;\n };\n /**\n * Allows for adding or overriding languages available in the application.\n *\n * Its keys are language codes and its values are objects with the following properties:\n *\n * - `name`: English name of the language,\n * - `nativeName`: native name of the language,\n * - `url`: full URL to JSON file with compiled translations;\n * if not defined, translations will be loaded from `${localePath}/${langCode}.json`.\n *\n * Example:\n * ```json\n * \"languages\": {\n * \"de\": {\n * \"name\": \"German\",\n * \"nativeName\": \"Deutsch\",\n * \"url\": \"/apps/public/ui-assets/de.json\"\n * }\n * }\n * ```\n */\n languages?: {\n [langCode: string]: {\n name: string;\n nativeName: string;\n url: string;\n };\n };\n /**\n * Allows for adding custom translations. It is an optional property.\n *\n * Its keys are language codes (https://cumulocity.com/guides/users-guide/getting-started/#a-name-languages-a-available-languages)\n * and its values are objects with key-value pairs, where the key is the original string in English and the value - its translation.\n *\n * - `Home`: \"Startseite\"\n *\n * For example you can add the translation of your custom cookie banner configured in the branding settings:\n * ```json\n * \"i18nExtra\": {\n * \"de\": {\n * \"About cookies on Cumulocity IoT\": \"Informationen zu Cookies in Cumulocity IoT\",\n * \"Click Agree and Proceed to accept cookies and go directly to the platform or click on Privacy Policy to see detailed descriptions of the used cookies.\": \"Klicken Sie auf Zustimmen und fortfahren, um Cookies zu akzeptieren und direkt zur Plattform zu gelangen, oder klicken Sie auf Datenschutzrichtlinie, um detaillierte Beschreibungen der verwendeten Cookies anzuzeigen.\"\n * }\n * }\n * ```\n */\n i18nExtra?: {\n [langCode: string]: {\n [key: string]: string;\n };\n };\n /** Path to the folder from which *.po files will be loaded. */\n localePath?: string;\n /** Array of URLs to additional *.css files to be loaded at runtime. */\n extraCssUrls?: string[];\n /** Documentation links settings. */\n docs?: {\n /** Hide default links to documentation. */\n noDefault: boolean;\n /** List of regex strings. Matching default docs URLs will be hidden. */\n excludeDefault: string[];\n /** Additional links to be displayed. */\n links: Array<{\n /** Icon classes with `c8y-icon`, e.g. `c8y-icon c8y-icon-add-user` or `c8y-icon c8y-icon-device-connect`. */\n icon: string;\n label: string;\n url: string;\n type: 'doc' | 'quicklink';\n }>;\n };\n /** Application icon to be displayed in app switcher and header bar. */\n icon?: {\n class?: string;\n url?: string;\n };\n\n // These are the old options\n /** Hide application in app switcher (saved to the server). */\n noAppSwitcher?: boolean;\n /** HTML page title. */\n globalTitle?: string;\n /** Hide \"powered by\" and version info at the bottom of the navigator and in the user menu. */\n hidePowered?: boolean;\n /** URL to support page (set to `false` to hide the link). */\n supportUrl?: boolean | string;\n /**\n * Replacement string for `user` field in audit logs for actions performed by a support user\n * (available placeholders: `{{support_user}}`, `{{supported_user}}`).\n */\n supportUserString?: string;\n /** Enable or disable the right drawer. */\n rightDrawer?: boolean;\n /** Enable or disable breadcrumbs in the header for groups and devices (default: false). */\n breadcrumbs?: boolean;\n /** Collapse navigator on initial load. */\n hideNavigator?: boolean;\n /** Show tabs horizontally or vertically. */\n tabsHorizontal?: boolean;\n /** Additional link to display on login screen. */\n loginExtraLink?: {\n url: string;\n label: string;\n };\n /** Enable or disable storage limitation feature. */\n storageLimitationFeatureEnabled?: boolean;\n /** Name of company handling support requests from app users (displayed in notification message). */\n companyName?: string;\n /** URL template for documentation links (default: `'${docsBaseUrl}${partialUrl}'`). */\n guideHrefTemplate?: string;\n /** Base URL for documentation links. */\n docsBaseUrl?: string;\n /** CSP string to be applied to `index.html` by replacing default values. */\n contentSecurityPolicy?: string;\n /** Enables cloud sensor wizard */\n sensorPhone?: boolean;\n /** Legacy list of imported plugins. */\n imports?: string[];\n /** Show or hide a newsletter subscription checkbox in edit user modal. */\n newsletter?: boolean;\n /** Indicates whether the entry point is traversed from legacy cumulocity*.json app manifest. */\n legacy?: boolean;\n /** Path to the root node_modules dir (useful when working in monorepo setup, e.g. yarn workspaces). */\n rootNodeModulesPath?: string;\n /** Cookie Banner configuration */\n cookieBanner?: {\n cookieBannerTitle?: string;\n cookieBannerText?: string;\n policyUrl?: string;\n /** Cookie preferences configuration. Here you can enable or disable cookie categories */\n configuration?: {\n /** This category includes e.g. cookies related to logging in */\n required?: boolean;\n /** This category includes e.g. tracking cookies */\n functional?: boolean;\n /** This category includes e.g. cookies related to advertising */\n marketing?: boolean;\n };\n };\n /** A key for the product experience software Gainsight. */\n gainsightKey?: string;\n}\n","import { InjectionToken, Optional, Inject, Injectable } from '@angular/core';\nimport { camelCase, isUndefined } from 'lodash-es';\nimport { ApplicationOptions } from './ApplicationOptions';\nimport { ExtensionFactory } from './extension-hooks';\nimport { SystemOptionsService, TenantOptionsService } from '@c8y/ngx-components/api';\n\nexport const HOOK_OPTIONS = new InjectionToken<ExtensionFactory<ApplicationOptions>>('App options');\n\n/**\n * A service that allows to set or get application options\n * which configure the default behavior of the UI.\n */\n@Injectable()\nexport class OptionsService extends ApplicationOptions {\n [key: string]: any;\n constructor(\n @Optional() @Inject(HOOK_OPTIONS) options,\n private systemOptionsService: SystemOptionsService,\n private tenantOptionService: TenantOptionsService\n ) {\n super();\n this.setupOptions(options);\n }\n\n /**\n * Returns an application option used to configure the UI.\n * @param optionKey The application options key.\n * @param defaultValue A value to return if non is set.\n */\n get(optionKey: keyof OptionsService, defaultValue?: any) {\n let value = this[optionKey];\n if (typeof value === 'undefined') {\n value = this[camelCase(optionKey)];\n }\n return typeof value !== 'undefined' ? value : defaultValue;\n }\n\n /**\n * Sets an application option.\n * @param key The key to set.\n * @param value The value to set.\n */\n set(key: string, value: any) {\n this[camelCase(key)] = value;\n }\n\n /**\n * Gets support url from tenant options.\n * If response returns '404 not found' it gets the support url from application options.\n * If the support link within application options is not provided the UI will use the system options.\n * Is the support link explicitly set to false it will be hidden.\n *\n * @returns Returns support url or false.\n */\n async getSupportUrl() {\n let url = await this.getTenantOption('configuration', 'system.support.url');\n if (isUndefined(url)) {\n url = this.supportUrl;\n }\n this.supportUrl = isUndefined(url) ? (await this.getSystemOption('support', 'url')) || false : url;\n return this.supportUrl;\n }\n\n /**\n * Returns if the tenant allows to show the activate-support user menu entry.\n * Note: Only if system-level support-user/enabled is false we can activate it at tenant level.\n */\n async getActivateSupportUser() {\n const option = await this.getSystemOption('support-user', 'enabled', true);\n return !option;\n }\n\n /**\n * Gets a value from the system service and parses it.\n *\n * @param category The category for this option.\n * @param key The key for that option.\n * @param defaultValue The default if the option was not found.\n */\n async getSystemOption(category: string, key: string, defaultValue?: any) {\n return this.getOptionFromService(category, key, this.systemOptionsService, defaultValue);\n }\n\n /**\n * Gets a value from the tenant service and parses it.\n *\n * @param category The category for this option.\n * @param key The key for that option.\n * @param defaultValue The default if the option was not found.\n */\n async getTenantOption(category: string, key: string, defaultValue?: any) {\n return this.getOptionFromService(category, key, this.tenantOptionService, defaultValue);\n }\n\n private setupOptions(options: any[] | null) {\n if (options) {\n if (!Array.isArray(options)) {\n options = [options];\n }\n options.forEach(optionMap => {\n if (optionMap) {\n Object.keys(optionMap).forEach(key => {\n this[camelCase(key)] = optionMap[key];\n });\n }\n });\n }\n }\n\n private async getOptionFromService(category, key, service, defaultValue) {\n try {\n const { data } = await service.detail({ category, key });\n return this.parseOptionRawValue(data.value, defaultValue);\n } catch (ex) {\n return defaultValue;\n }\n }\n\n private parseOptionRawValue(rawValue, defaultValue) {\n let value;\n try {\n value = JSON.parse(rawValue);\n } catch (e) {\n value = isUndefined(rawValue) ? defaultValue : rawValue;\n }\n return value;\n }\n}\n","import { throttle as _throttle } from 'lodash-es';\n\n/**\n * Decorator to throttle functions call.\n * @param wait throttle time.\n * @param options set triggers, eg on trailing edge or falling edge,\n * see lodash documentation for details\n */\nexport function throttle(wait?, options?) {\n return (target, fnName, descriptor) => {\n const fn = descriptor.value;\n descriptor.value = function(...args) {\n const throttledFnName = `_${fnName}Throttled`;\n if (!this[throttledFnName]) {\n this[throttledFnName] = _throttle(fn, wait, options);\n }\n return this[throttledFnName].apply(this, args);\n };\n };\n}\n","import { Injectable, isDevMode } from '@angular/core';\nimport { keys } from 'lodash-es';\nimport { BehaviorSubject } from 'rxjs';\nimport { scan, distinctUntilChanged, map, filter } from 'rxjs/operators';\nimport { StateService } from './state-service.abstract';\nimport { OptionsService } from './options.service';\nimport { FetchClient, TenantLoginOptionsService } from '@c8y/client';\n\nimport { ApplicationService, IUser, ICurrentTenant } from '@c8y/client';\nimport { ApiService } from '@c8y/ngx-components/api';\nimport { throttle } from './throttle.decorator';\n\n@Injectable()\nexport class AppStateService extends StateService {\n state$: BehaviorSubject<any> = new BehaviorSubject<any>({\n app: {\n name: this.options.name,\n contextPath: this.getCurrentContextPath() || this.options.contextPath\n },\n supportUrl: this.options.supportUrl,\n lang: this.options.get('defaultLanguage', 'en'),\n langs: this.getLangs(),\n langsDetail: this.options.languages,\n loginOptions: this.options.loginOptions,\n activateSupportUserAvailable: undefined,\n versions: {\n backend: undefined,\n ui: this.options.versions || { ngx: undefined }\n },\n hidePowered: this.options.hidePowered,\n isLoading: false,\n showRightDrawer: this.options.rightDrawer,\n loginExtraLink: this.options.get('login_extra_link'),\n newsletter: this.options.newsletter\n });\n currentSupportUserName: BehaviorSubject<string | null> = new BehaviorSubject(null);\n currentUser: BehaviorSubject<IUser | null> = new BehaviorSubject(null);\n currentTenant: BehaviorSubject<ICurrentTenant | null> = new BehaviorSubject(null);\n\n constructor(\n private applicationService: ApplicationService,\n public apiService: ApiService,\n private options: OptionsService,\n private fetchClient: FetchClient,\n private tenantLoginOptionsService: TenantLoginOptionsService\n ) {\n super();\n this.apiService.calls\n .pipe(\n filter(({ url }) => !/notification\\/realtime/.test(url)),\n map(({ phase }) => (phase === 'start' ? 1 : -1)),\n scan((count, item) => count + item, 0),\n map(count => count > 0),\n distinctUntilChanged()\n )\n .subscribe(isLoading => (this.state.isLoading = isLoading));\n\n this.assignApplicationKeyToDefaultHeaders();\n }\n\n assignApplicationKeyToDefaultHeaders() {\n if (!isDevMode()) {\n this.fetchClient.defaultHeaders = {\n ...(this.fetchClient.defaultHeaders || {}),\n 'X-Cumulocity-Application-Key': this.options.key\n };\n }\n }\n\n /**\n * Returns the current state.\n */\n get state() {\n return this.state$.value;\n }\n\n getLangs() {\n const { languages } = this.options;\n return languages ? keys(languages).filter(k => languages[k]) : [];\n }\n\n /**\n * Returns the correct UI version. In hybrid mode for angular and ngx.\n */\n get uiVersion() {\n const version = this.state.versions.ui;\n return version.ngx || version.ng1;\n }\n\n /**\n * Loads the app manifest. If no access -> throw an error to verify app access.\n */\n async loadManifest() {\n try {\n const { application } = (await this.applicationService.detail(\n `${this.state.app.contextPath}/manifest`\n )).data as any;\n this.state.app.manifest = application;\n this.loadDefaultOptions();\n } catch (ex) {\n throw ex;\n }\n }\n\n /**\n * When this function called, it refreshes the values of loginOptions stored within ui state object.\n * Function is throttled to execute the refresh once in a time specified by params of @throttled decorator,\n * it should be called on leading edge of the timeout.\n */\n @throttle(600, { trailing: false })\n async refreshLoginOptions() {\n const { data: { loginOptions } } = await this.tenantLoginOptionsService.detail();\n this.state$.next({ ...this.state, loginOptions });\n }\n\n /**\n * Checks current users application list and matches it against given application name.\n * Returns true if application is in the list.\n * @param name application name\n */\n async isApplicationAvailable(name: string) {\n const { data } = await this.applicationService.listByUser(undefined, { pageSize: 100 });\n return data.some(app => app.name === name);\n }\n\n /**\n * Sets current user (including support user).\n * @param userInfo Info about current user and support user to be set.\n */\n setUser(userInfo: { user: IUser; supportUserName: string }) {\n this.currentSupportUserName.next(userInfo.supportUserName || null);\n this.currentUser.next(userInfo.user);\n }\n\n private getCurrentContextPath() {\n const match = window.location.pathname.match(/\\/apps\\/(public\\/){0,1}(.+?)(\\/|\\?|#|$)/);\n return match && match[2];\n }\n\n private async loadDefaultOptions() {\n this.state.supportUrl = await this.options.getSupportUrl();\n this.state.activateSupportUserAvailable = await this.options.getActivateSupportUser();\n this.state.versions.backend = await this.options.getSystemOption('system', 'version');\n try {\n this.showIncompatibleVersionsError();\n } catch (ex) {\n // ignore this\n }\n this.emitNewState();\n }\n\n private showIncompatibleVersionsError() {\n const uiVersion = this.state.versions.ui.ngx;\n const backendVersion = this.state.versions.backend;\n const uiVersionArray = uiVersion\n .replace(/[^\\d.]/g, '')\n .split('.')\n .map(Number);\n const beVersionArray = backendVersion\n .replace(/[^\\d.]/g, '')\n .split('.')\n .map(Number);\n const multiplier = Math.pow(\n 10,\n Math.ceil(Math.log10(Math.max(...uiVersionArray, ...beVersionArray) + 1))\n );\n const sumReducer = (acc, cur) => acc + cur;\n const calculateVersionMapper = (curr, idx) => curr * (multiplier / Math.pow(10, idx));\n const uiVersionNumber = uiVersionArray.map(calculateVersionMapper).reduce(sumReducer);\n const beVersionNumber = beVersionArray.map(calculateVersionMapper).reduce(sumReducer);\n const showError = uiVersionNumber > beVersionNumber;\n if (showError) {\n const errorContent = `You are running version ${uiVersion} of the UI and version ${backendVersion} of backend!`;\n console.log('%c ' + errorContent, 'font-weight: bold; font-size: 30px; color: red;');\n }\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const LANGUAGES = new InjectionToken('Languages');\n","import { InjectionToken } from '@angular/core';\n\nexport const LOCALE_PATH = new InjectionToken('Locale path');\n","import { InjectionToken } from '@angular/core';\n\nexport const HOOK_PATTERN_MESSAGES = new InjectionToken('Pattern Messages');\n","import { Injectable, Inject } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { mapValues, each } from 'lodash-es';\nimport { HOOK_PATTERN_MESSAGES } from './patterns-message.hook';\nimport { formatDate } from '@angular/common';\n\n/**\n * A service to translate messages by using regexp patterns.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class PatternMessagesService {\n translateService: TranslateService;\n patterns: any = {};\n pipes = {\n absoluteDate: (date: string|number|Date) =>\n formatDate(date, 'medium', this.translateService.currentLang),\n translate: (key) =>\n this.translateService.instant(key)\n };\n\n constructor(\n @Inject(HOOK_PATTERN_MESSAGES) patterns\n ) {\n each(patterns, (pattern) => {\n Object.assign(this.patterns, pattern);\n });\n }\n\n translate(message: string) {\n const translation = this.translateWithPatterns(message);\n return (translation !== message) ? translation : '';\n }\n\n private translateWithPatterns(message, patterns = this.patterns) {\n let translatedMessage = message;\n\n each(patterns, (patternCfg, pattern) => {\n const globalRegExp = new RegExp(pattern, 'g');\n let globalMatch;\n\n if (!globalRegExp.test(translatedMessage)) {\n return;\n }\n globalRegExp.test(''); // reset the regexp\n globalMatch = globalRegExp.exec(translatedMessage);\n while (globalMatch !== null) {\n const [ localMatch ] = globalMatch;\n\n const placeholderValues = mapValues(patternCfg.placeholders, (placeholder) => {\n const expr = placeholder.capture || placeholder;\n let replacement = localMatch.replace(new RegExp(pattern, 'g'), expr);\n\n if (placeholder.translate) {\n replacement = this.translateWithPatterns(replacement, placeholder.translate);\n }\n\n return replacement;\n });\n translatedMessage = translatedMessage.replace(\n localMatch,\n this.translateWithParams(patternCfg, placeholderValues)\n );\n\n globalMatch = globalRegExp.exec(translatedMessage);\n }\n });\n return translatedMessage;\n }\n\n private translateWithParams(patternCfg: any, params: any = {}) {\n const { defaultLang, currentLang, compiler } = this.translateService;\n const translations = this.translateService.store.translations[currentLang];\n const defaultTranslations = this.translateService.store.translations[defaultLang];\n const originalKey = patternCfg.gettext;\n\n let originalValue = originalKey;\n if (translations) {\n if (translations[originalKey]) {\n originalValue = translations[originalKey];\n } else if (defaultTranslations) {\n if (defaultTranslations[originalKey]) {\n originalValue = defaultTranslations[originalKey];\n }\n }\n }\n\n let key = originalKey;\n let value = originalValue;\n const interpolateParams = {\n ...params,\n noPatternMessages: true\n };\n\n let match;\n const pipeRegex = RegExp('{{\\\\s*([^\\\\s]+)\\\\s*\\\\|\\\\s*([^\\\\s]+)\\\\s*}}', 'g');\n // tslint:disable-next-line:no-conditional-assignment\n while ((match = pipeRegex.exec(originalKey)) !== null) {\n const [placeholder, paramName, pipeName] = match;\n if (this.pipes[pipeName]) {\n key = key.replace(placeholder, `{{${paramName}}}`);\n value = value.replace(placeholder, `{{${paramName}}}`);\n interpolateParams[paramName] = this.pipes[pipeName](params[paramName]);\n }\n }\n\n if (translations) {\n translations[key] = compiler.compile(value, currentLang);\n }\n return this.translateService.instant(key, interpolateParams);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PatternMessagesService } from './pattern-messages.service';\nimport {\n MissingTranslationHandler,\n MissingTranslationHandlerParams,\n TranslateParser,\n TranslateService\n} from '@ngx-translate/core';\n\n@Injectable()\nexport class MissingTranslationCustomHandler implements MissingTranslationHandler {\n translateService: TranslateService;\n cache: any = {};\n\n constructor(\n private parser: TranslateParser,\n private patternMessagesService: PatternMessagesService\n ) {}\n\n handle(params: MissingTranslationHandlerParams) {\n const { key: messageKey, interpolateParams, translateService } = params;\n this.translateService = translateService;\n\n let translation = this.getFromCache(messageKey, interpolateParams);\n\n if (!translation) {\n const patternMessageTranslation = this.getPatternMessageTranslation(messageKey, interpolateParams);\n if (patternMessageTranslation) {\n translation = patternMessageTranslation;\n } else {\n translation = this.parser.interpolate(messageKey, interpolateParams);\n }\n\n this.addToCache(messageKey, interpolateParams, translation);\n }\n\n return translation;\n }\n\n private getFromCache(messageKey: string, interpolateParams: object): string {\n const { currentLang } = this.translateService;\n const currentCache = this.cache[currentLang] || {};\n const cacheKey = this.getCacheKey(messageKey, interpolateParams);\n return currentCache[cacheKey];\n }\n\n private addToCache(messageKey: string, interpolateParams: object, translation: string) {\n const { currentLang } = this.translateService;\n const currentCache = this.cache[currentLang] = this.cache[currentLang] || {};\n const cacheKey = this.getCacheKey(messageKey, interpolateParams);\n currentCache[cacheKey] = translation;\n }\n\n private getCacheKey(messageKey: string, interpolateParams: object): string {\n return interpolateParams ? `${messageKey} ${JSON.stringify(interpolateParams)}` : messageKey;\n }\n\n private getPatternMessageTranslation(messageKey: string, interpolateParams: object): string {\n const shouldTryPatternMessages = !interpolateParams || !((interpolateParams as any).noPatternMessages);\n\n if (shouldTryPatternMessages) {\n if (!this.patternMessagesService.translateService) {\n this.patternMessagesService.translateService = this.translateService;\n }\n return this.patternMessagesService.translate(messageKey);\n }\n\n return undefined;\n }\n}\n","// Just for translation annotation\n// Note: Own file because of conflicts if put in barrel directly.\nexport const _ = (str) => str;\nexport function gettext(str) {\n return str;\n}\n","/* tslint:disable:max-line-length */\nimport { gettext } from './gettext';\n\nconst bulkOperationAuditLogTextPlaceholders = {\n updatesList: {\n capture: '$1',\n translate: {\n \"status='(.+?)'\": {\n gettext: gettext('status=\"{{status | translate}}\"'),\n placeholders: {\n status: '$1'\n }\n },\n \"generalStatus='(.+?)'\": {\n gettext: gettext('generalStatus=\"{{generalStatus | translate}}\"'),\n placeholders: {\n generalStatus: '$1'\n }\n },\n \"progress='(.+?)'\": {\n gettext: gettext('progress=\"{{progress}}\"'),\n placeholders: {\n progress: '$1'\n }\n },\n 'note=(.+?)': {\n gettext: gettext('note=\"{{note}}\"'),\n placeholders: {\n note: '$1'\n }\n }\n }\n }\n};\n\nexport const MESSAGES = {\n '^Access is denied$': {\n gettext: gettext('Access denied.')\n },\n '^Alarm created$': {\n gettext: gettext('Alarm created')\n },\n '^Alarm updated$': {\n gettext: gettext('Alarm updated')\n },\n '^API is not available with the new domain$': {\n gettext: gettext('Could not activate custom domain. DNS setup is incorrect.')\n },\n '^Application with given name already exist$': {\n gettext: gettext('Application with given name already exists.')\n },\n '^Application with id (.+?) is already assigned to the tenant (.+?)$': {\n gettext: gettext('This application is already assigned to tenant \"{{tenant}}\".'),\n placeholders: {\n tenant: '$2'\n }\n },\n '^Apply software changes: (.+?)\\\\.?$': {\n gettext: gettext('Apply software changes: {{ softwareChanges }}'),\n placeholders: {\n softwareChanges: {\n capture: '$1',\n translate: {\n 'install \"(.+?)\" \\\\(version: (.+?)\\\\)': {\n gettext: gettext('install \"{{ softwareName }}\" (version: {{ softwareVersion }})'),\n placeholders: {\n softwareName: '$1',\n softwareVersion: '$2'\n }\n },\n 'install \"([^\"]+)\"(?! \\\\(version: .+?\\\\))': {\n gettext: gettext('install \"{{ softwareName }}\"'),\n placeholders: {\n softwareName: '$1'\n }\n },\n 'delete \"(.+?)\" \\\\(version: (.+?)\\\\)': {\n gettext: gettext('delete \"{{ softwareName }}\" (version: {{ softwareVersion }})'),\n placeholders: {\n softwareName: '$1',\n softwareVersion: '$2'\n }\n },\n 'delete \"([^\"]+)\"(?! \\\\(version: .+?\\\\))': {\n gettext: gettext('delete \"{{ softwareName }}\"'),\n placeholders: {\n softwareName: '$1'\n }\n }\n }\n }\n }\n },\n '^Assign device profile (.+?) to device (.+?)$': {\n gettext: gettext('Assign device profile {{profileName}} to device {{deviceName}}'),\n placeholders: {\n profileName: '$1',\n deviceName: '$2'\n }\n },\n '^(.+)pplication for tenant (.+) with properties \\\\( (.+?) \\\\) already exists$': {\n gettext: gettext(\n 'Application for tenant \"{{tenant}}\" with the following values ({{valuesList}}) already exists.'\n ),\n placeholders: {\n tenant: '$2',\n valuesList: '$3'\n }\n },\n '^Authentication failed! : User account is locked$': {\n gettext: gettext('Authentication failed due to: user account is locked.')\n },\n '^Availability monitoring record$': {\n gettext: gettext('Availability monitoring record')\n },\n '^Can not activate a certificate which is either expired or not yet valid$': {\n gettext: gettext('Cannot activate a certificate which is either expired or not yet valid.')\n },\n '^Cannot add certificate - certificate with (.+?) fingerprint already exists. : Certificate with (.+?) fingerprint already exists.': {\n gettext: gettext(\n 'Could not add certificate. Certificate with {{fingerprint}} fingerprint already exists.'\n ),\n placeholders: {\n fingerprint: '$1'\n }\n },\n '^Cannot change password. : Provided token does not exist.$': {\n gettext: gettext('Cannot change password: provided token is invalid.')\n },\n '^Cannot deploy module (.*)$': {\n gettext: gettext('Cannot deploy module due to error: \"{{ errorMessage | translate }}\".'),\n placeholders: {\n errorMessage: '$1'\n }\n },\n \"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\\\d+) column (\\\\d+) \\\\[([\\\\S\\\\s]+?)\\\\]$\": {\n gettext: gettext(\n 'Could not deploy module \"{{moduleName}}\". Compilation failed in expression \"{{expression}}\": incorrect syntax near \"{{incorrectExpression}}\" at line {{line}} column {{column}}.'\n ),\n placeholders: {\n moduleName: '$1',\n expression: '$3',\n incorrectExpression: '$4',\n line: '$5',\n column: '$6'\n }\n },\n \"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\\\d+) column (\\\\d+) near reserved keyword '(.+?)' \\\\[([\\\\S\\\\s]+?)\\\\]$\": {\n gettext: gettext(\n 'Could not deploy module \"{{moduleName}}\". Compilation failed in expression \"{{expression}}\": incorrect syntax near \"{{incorrectExpression}}\" at line {{line}} column {{column}} near reserved keyword \"{{keyword}}\".'\n ),\n placeholders: {\n moduleName: '$1',\n expression: '$3',\n incorrectExpression: '$4',\n line: '$5',\n column: '$6',\n keyword: '$7'\n }\n },\n \"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\\\d+) column (\\\\d+), please check the where clause \\\\[([\\\\S\\\\s]+?)\\\\]$\": {\n gettext: gettext(\n 'Could not deploy module \"{{moduleName}}\". Compilation failed in expression \"{{expression}}\": incorrect syntax near \"{{incorrectExpression}}\" at line {{line}} column {{column}}, check \"where\" clause.'\n ),\n placeholders: {\n moduleName: '$1',\n expression: '$3',\n incorrectExpression: '$4',\n line: '$5',\n column: '$6'\n }\n },\n \"^Cannot deploy module (.+?)! : Deployment failed in module '(.+?)' in expression '(.+?)' : Exception compiling script '(.+?)' of dialect '(.+?)': missing (.+?) before statement \\\\((.+?)\\\\) \\\\[([\\\\S\\\\s]+?)\\\\]$\": {\n gettext: gettext(\n 'Could not deploy module \"{{moduleName}}\". Compilation failed in expression \"{{expression}}\": exception compiling script \"{{scriptName}}\" of dialect \"{{scriptDialect}}\": missing \"{{missingSyntax}}\" before statement \"{{affectedStatement}}\".'\n ),\n placeholders: {\n moduleName: '$1',\n expression: '$3',\n scriptName: '$4',\n scriptDialect: '$5',\n missingSyntax: '$6',\n affectedStatement: '$7'\n }\n },\n \"^Cannot execute bulk operation on empty group. Group with id='(\\\\d+?)' doesn't have child assets.$\": {\n gettext: gettext(\n 'Could not execute bulk operation on an empty group. Group with ID \"{{groupId}}\" has no child assets.'\n ),\n placeholders: {\n groupId: '$1'\n }\n },\n \"^Cannot execute bulk operation on empty group. DynamicGroup with id='(\\\\d+?)' doesn't have child assets$\": {\n gettext: gettext(\n 'Could not execute bulk operation on an empty group. Smart group with ID \"{{groupId}}\" has no child assets.'\n ),\n placeholders: {\n groupId: '$1'\n }\n },\n '^Cannot parse X509 certificate. : Could not parse certificate: (.+?)$': {\n gettext: gettext('Could not parse X.509 certificate: {{ failureReason | translate }}.'),\n placeholders: {\n failureReason: '$1'\n }\n },\n '^Cannot reschedule bulk operation. All its operations are successful$': {\n gettext: gettext('Cannot reschedule bulk operation. All its operations are already successful.')\n },\n '^Cannot reset user password : Cannot find user with such email.$': {\n gettext: gettext('Cannot reset password for user with such email: email not found.')\n },\n '^Cannot update/delete application binary via this endpoint$': {\n gettext: gettext('Cannot update/delete application binary via this endpoint')\n },\n \"^Can't delete user because it is used by another managed object$\": {\n gettext: gettext(\n 'Cannot delete device with associated device owner because this owner is still assigned to other device(s). Try to remove only the device.'\n )\n },\n '^Cep module created$': {\n gettext: gettext('CEP module created')\n },\n '^Cep module updated$': {\n gettext: gettext('CEP module updated')\n },\n '^Cep module deleted$': {\n gettext: gettext('CEP module deleted')\n },\n '^Cep module \"(.+?)\" created$': {\n gettext: gettext('CEP module \"{{name}}\" created'),\n placeholders: {\n name: '$1'\n }\n },\n '^Cep module \"(.+?)\" updated$': {\n gettext: gettext('CEP module \"{{name}}\" updated'),\n placeholders: {\n name: '$1'\n }\n },\n '^Cep module \"(.+?)\" deleted$': {\n gettext: gettext('CEP module \"{{name}}\" deleted'),\n placeholders: {\n name: '$1'\n }\n },\n '^Command state is invalid: (.+)$': {\n gettext: gettext('Command state is invalid: {{violations}}'),\n placeholders: {\n violations: {\n capture: '$1',\n translate: {\n '(\\\\w+?) - may not be null': {\n gettext: gettext('\"{{field}}\" must not be null'),\n placeholders: {\n field: '$1'\n }\n }\n }\n }\n }\n },\n '^Could not connect to endpoint (.+)\\\\. Could not verify `(.+)` host key with fingerprint `(.+)` for `(.+)` on port (.+)\\\\. If you expected that key, please remove the previous one from configuration to allow for connection\\\\.$': {\n gettext: gettext(\n 'Could not connect to endpoint \"{{endpointName}}\". Could not verify {{keyType}} host key with fingerprint {{fingerprint}} for host {{host}} on port {{port}}. If you expected this key, please remove the previous one from configuration to allow for connection.'\n ),\n placeholders: {\n endpointName: '$1',\n keyType: '$2',\n fingerprint: '$3',\n host: '$4',\n port: '$5'\n }\n },\n '^Could not login to ssh server on endpoint \"(.+)\"\\\\. Provided credential for user \"(.+)\" is incorrect\\\\.$': {\n gettext: gettext(\n 'Could not access SSH server on endpoint \"{{endpointName}}\". Provided credentials for user \"{{userName}}\" are incorrect.'\n ),\n placeholders: {\n endpointName: '$1',\n userName: '$2'\n }\n },\n '^Could not save object remoteAccessUpdate: (.+)$': {\n gettext: '{{errorMessages}}',\n placeholders: {\n errorMessages: {\n capture: '$1',\n translate: {\n 'Could not recognize host-key format': {\n gettext: gettext('Could not recognize \"Host key\" format')\n },\n 'Could not recognize key-pair format': {\n gettext: gettext('Could not recognize the format of \"Public key\" or \"Private key\"')\n }\n }\n }\n }\n },\n '^Could not update user. : Error persisting user (.+?)!$': {\n gettext: gettext('Could not update user \"{{username}}\".'),\n placeholders: {\n username: '$1'\n }\n },\n 'ˆCreate bulk operation$': {\n gettext: gettext('Create bulk operation')\n },\n '^Create bulk operation: (.+)$': {\n gettext: gettext('Create bulk operation: {{updatesList}}'),\n placeholders: bulkOperationAuditLogTextPlaceholders\n },\n '^Creation ramp must be greater than (\\\\d+?)$': {\n gettext: gettext('Bulk operation delay must be greater than {{minSeconds}} seconds.'),\n placeholders: {\n minSeconds: '$1'\n }\n },\n '^Created container$': {\n gettext: gettext('Container created.')\n },\n '^Created pod: (.+)$': {\n gettext: gettext('Pod \"{{imageName}}\" created.'),\n placeholders: {\n imageName: '$1'\n }\n },\n '^CSV file contained empty dataset$': {\n gettext: gettext('No entries found in uploaded CSV file.')\n },\n '^Cycle detected for route (.+?)!$': {\n gettext: gettext('Cycle detected for route {{route}}.'),\n placeholders: {\n route: '$1'\n }\n },\n '^Data broker processing is currently overloaded and may stop forwarding your data\\\\. Please contact support\\\\.$': {\n gettext: gettext(\n 'Data broker processing is currently overloaded and may stop forwarding your data. Please contact support.'\n )\n },\n '^Data broker processing is not able to connect do destination tenant, thus data forwarding is not working\\\\. Please contact support\\\\.$': {\n gettext: gettext(\n 'Data broker processing is not able to connect to destination tenant, thus data forwarding is not working. Please contact support.'\n )\n },\n '^Delete bulk operation$': {\n gettext: gettext('Delete bulk operation')\n },\n '^Delete bulk operation: (.+)$': {\n gettext: gettext('Delete bulk operation: {{updatesList}}'),\n placeholders: bulkOperationAuditLogTextPlaceholders\n },\n \"^Device id '(.+?)' contains '(.+?)' character which is not permitted.$\": {\n gettext: gettext('ID \"{{deviceId}}\" contains invalid character: \"{{invalidCharacter}}\".'),\n placeholders: {\n deviceId: '$1',\n invalidCharacter: '$2'\n }\n },\n \"^Device name: '(.+?)', alarm text: '(.+?)'$\": {\n gettext: gettext('Device name: \"{{deviceName}}\", alarm text: \"{{alarmText | translate}}\"'),\n placeholders: {\n deviceName: '$1',\n alarmText: '$2'\n }\n },\n '^Display name$': {\n gettext: gettext('Login alias')\n },\n '^Domain name in uploaded certificate differs from the one in use$': {\n gettext: gettext(\n 'Domain name in uploaded certificate differs from the one in use. Please deactivate the custom domain before uploading new certificate.'\n )\n },\n '^Domain name is already in use by another tenant!$': {\n gettext: gettext('Domain name is already used by another tenant.')\n },\n '^Duplicated connector for instanceUrl (.+?)!$': {\n gettext: gettext('Target URL {{targetUrl}} already used by another connector.'),\n placeholders: {\n targetUrl: '$1'\n }\n },\n '^Duplicated connector for name (.+?)!$': {\n gettext: gettext('Connector name \"{{name}}\" already used by another connector.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Entry is outside of the target dir: (.+)$': {\n gettext: gettext('File entry outside of the target directory: \"{{path}}\".'),\n placeholders: {\n path: '$1'\n }\n },\n '^Error during password validation. : Password must have at least (\\\\d+?) characters and no more than (\\\\d+?) and must contain only Latin1 characters.$': {\n gettext: gettext(\n 'Password is invalid. It must have at least {{minCharactersCount}} and no more than {{maxCharactersCount}} characters.'\n ),\n placeholders: {\n minCharactersCount: '$1',\n maxCharactersCount: '$2'\n }\n },\n '^Error during password validation. : Your password has been used already. Choose another.$': {\n gettext: gettext('This password has already been used earlier. Use a different one.')\n },\n \"^Error in statement (.+?):(.+?)! : Incorrect syntax near '(.+?)' near reserved keyword '(.+?)' \\\\[([\\\\S\\\\s]+?)\\\\]$\": {\n gettext: gettext(\n 'Error in statement {{moduleName}}:{{statementNumber}}. Incorrect syntax near expression \"{{expression}}\" near reserved keyword \"{{keyword}}\".'\n ),\n placeholders: {\n moduleName: '$1',\n statementNumber: '$2',\n expression: '$3',\n keyword: '$4'\n }\n },\n '^External id not found; external id = ID \\\\[type=(.+?), value=(.+?)\\\\]$': {\n gettext: gettext('External ID not found for type \"{{type}}\" and value \"{{value}}\".'),\n placeholders: {\n type: '$1',\n value: '$2'\n }\n },\n '^Error occurred when trying to find an Application for id ID (.+) : Could not find application by ID (\\\\d+)$': {\n gettext: gettext('Could not find application by ID {{applicationId}}.'),\n placeholders: {\n applicationId: '$2'\n }\n },\n '^Http status code: 404\\n{error=\"options/Not Found\",message=\"Unable to find option by given key: sigfox-agent/provider.token\",info=\"https://www.cumulocity.com/guides/reference-guide/#error_reporting\",details=\"null\"}': {\n gettext: gettext('Unable to find option by given key: sigfox-agent/provider.token')\n },\n '^Failed to delete application. : Cannot remove application assigned to other tenants.$': {\n gettext: gettext('Could not delete application assigned to other tenants.')\n },\n '^Failed to extract certificate from PKCS12$': {\n gettext: gettext('Failed to extract certificate from PKCS12.')\n },\n '^Failed to update domain at the platform$': {\n gettext: gettext('Failed to update domain at the platform.')\n },\n \"^Finding device data from database failed : No managedObject for id '(.+?)'!$\": {\n gettext: gettext('Could not find managed object with ID \"{{deviceId}}\".'),\n placeholders: {\n deviceId: '$1'\n }\n },\n '^Following mandatory fields should be included: (.+?)$': {\n gettext: gettext('Following mandatory fields should be included: {{fields}}'),\n placeholders: {\n fields: '$1'\n }\n },\n '^Global Role updated$': {\n gettext: gettext('Global role updated')\n },\n '^Global Role (.+?) updated$': {\n gettext: gettext('Global role \"{{name}}\" updated'),\n placeholders: {\n name: '$1'\n }\n },\n '^Global Role (.+?) updated: (.+)$': {\n gettext: gettext('Global role \"{{name}}\" updated: {{updatesList}}'),\n placeholders: {\n name: '$1',\n updatesList: {\n capture: '$2',\n translate: {\n 'applications \\\\[([^\\\\]]+?)\\\\] added': {\n gettext: gettext('applications {{list}} added'),\n placeholders: {\n list: '$1'\n }\n },\n 'applications \\\\[([^\\\\]]+?)\\\\] removed': {\n gettext: gettext('applications {{list}} removed'),\n placeholders: {\n list: '$1'\n }\n },\n 'roles \\\\[([^\\\\]]+?)\\\\] added': {\n gettext: gettext('roles {{list}} added'),\n placeholders: {\n list: '$1'\n }\n },\n 'roles \\\\[([^\\\\]]+?)\\\\] removed': {\n gettext: gettext('roles {{list}} removed'),\n placeholders: {\n list: '$1'\n }\n }\n }\n }\n }\n },\n '^Global Roles$': {\n gettext: gettext('Global roles')\n },\n '^Operation updated: (.+)$': {\n gettext: gettext('Operation updated: {{updatesList}}'),\n placeholders: {\n updatesList: {\n capture: '$1',\n translate: {\n \"status='(.+?)'\": {\n gettext: gettext('status=\"{{status | translate}}\"'),\n placeholders: {\n status: '$1'\n }\n },\n \"description='(.+?)'\": {\n gettext: gettext('description=\"{{description | translate}}\"'),\n placeholders: {\n description: '$1'\n }\n },\n \"device name='(.+?)'\": {\n gettext: gettext('device name=\"{{deviceName}}\"'),\n placeholders: {\n deviceName: '$1'\n }\n },\n \"failure reason='(.+?)'\": {\n gettext: gettext('failure reason=\"{{failureReason | translate}}\"'),\n placeholders: {\n failureReason: '$1'\n }\n }\n }\n }\n }\n },\n '^ID \\\\[type=(.+?), value=(.+?)\\\\] was already bound to different Global ID.$': {\n gettext: gettext('External ID \"{{value}}\" of the type \"{{type}}\" already exists.'),\n placeholders: {\n type: '$1',\n value: '$2'\n }\n },\n '^Invalid credentials! : Bad credentials$': {\n gettext: gettext('Invalid credentials.')\n },\n '^Invalid credentials! : No phone number provided$': {\n gettext: gettext('Log into the management tenant first and enter your phone number.')\n },\n '^Inventory Role removed$': {\n gettext: gettext('Inventory role removed')\n },\n '^Inventory Role (.+?) removed': {\n gettext: gettext('Inventory role \"{{name}}\" deleted.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Inventory Role updated$': {\n gettext: gettext('Inventory role updated')\n },\n '^Inventory Role (.+?) updated': {\n gettext: gettext('Inventory role \"{{name}}\" updated.'),\n placeholders: {\n name: '$1'\n }\n },\n '^I/O error: Connection refused; nested exception is Connection refused : Connection refused': {\n gettext: gettext('Connection refused')\n },\n '^I/O error: Read timed out; nested exception is Read timed out : Read timed out': {\n gettext: gettext('Read timed out')\n },\n '^Log file requested$': {\n gettext: gettext('Log file requested.')\n },\n '^Managed object deleted$': {\n gettext: gettext('Managed object deleted')\n },\n '^Managed object \"(.+?)\" deleted$': {\n gettext: gettext('Managed object \"{{name}}\" deleted'),\n placeholders: {\n name: '$1'\n }\n },\n '^Maximum file size exceeded$': {\n gettext: gettext('Maximum file size exceeded.')\n },\n \"^Message with ID (.+?) doesn't exist in smart rest template (.+?)$\": {\n gettext: gettext(\n 'Message with ID \"{{messageId}}\" doesn\\'t exist in SmartREST template with ID \"{{templateId}}\"'\n ),\n placeholders: {\n messageId: '$1',\n templateId: '$2'\n }\n },\n '^NewDeviceRequest for id = (.+?) already exists.$': {\n gettext: gettext('Device registration request with ID {{id}} already exists.'),\n placeholders: {\n id: '$1'\n }\n },\n '^No communication with device since (.+?)$': {\n gettext: gettext('No communication with device since {{timestamp | absoluteDate}}.'),\n placeholders: {\n timestamp: '$1'\n }\n },\n '^No data received from device within required interval.$': {\n gettext: gettext('No data received from device within required interval.')\n },\n '^No LoRa provider settings are found. Please configure the connectivity settings.$': {\n gettext: gettext(\n 'No LoRa provider settings are found. Please configure the connectivity settings.'\n )\n },\n '^Not within any context!$': {\n gettext: gettext('A problem occurred with microservice subscription.')\n },\n '^Maximum age cannot be bigger than 10 years.$': {\n gettext: gettext('Maximum age cannot be bigger than 10 years.')\n },\n '^Microservice application name incorrect. Please use only lower-case letters, digits and dashes. Maximum length is (\\\\d+) characters.$': {\n gettext: gettext(\n 'Microservice application name is incorrect: only lower case letters, digits and dashes allowed. Maximum length: {{maxLength}}.'\n ),\n placeholders: {\n maxLength: '$1'\n }\n },\n '^Microservice not available.*$': {\n gettext: gettext('Microservice is not available.')\n },\n '^Operation created$': {\n gettext: gettext('Operation created.')\n },\n '^Operation updated$': {\n gettext: gettext('Operation updated.')\n },\n \"^Operation created: status='(.+?)'.\": {\n gettext: gettext('Operation created: status=\"{{status | translate}}\".'),\n placeholders: {\n status: '$1'\n }\n },\n '^Option created$': {\n gettext: gettext('Option created.')\n },\n '^Option \"(.+?)\" created$': {\n gettext: gettext('Option \"{{option}}\" created.'),\n placeholders: {\n option: '$1'\n }\n },\n '^Option deleted$': {\n gettext: gettext('Option deleted.')\n },\n '^Option \"(.+?)\" deleted$': {\n gettext: gettext('Option \"{{option}}\" deleted.'),\n placeholders: {\n option: '$1'\n }\n },\n '^Owner field error. : Cannot introduce cyclic dependency.': {\n gettext: gettext('Could not introduce cyclic ownership dependency.')\n },\n '^Password change is temporary blocked.$': {\n gettext: gettext('Password change is temporarily blocked.')\n },\n '^Password cipher does not match': {\n gettext: gettext('Password cipher does not match.')\n },\n '^Platform application cannot be added to, nor removed from any tenant.$': {\n gettext: gettext('Platform application cannot be added to, nor removed from any tenant.')\n },\n '^Private key must be provided in KEY_PAIR credentials$': {\n gettext: gettext(\n 'Private key must be provided when \"Public/private keys\" option is selected.'\n )\n },\n '^Private key cipher does not match': {\n gettext: gettext('Private key cipher does not match')\n },\n '^Protocol \"(.+?)\" does not support \"(.+?)\" credentials type$': {\n gettext: gettext(\n 'Protocol \"{{protocol}}\" does not support \"{{credentialsType}}\" credentials type.'\n ),\n placeholders: {\n protocol: '$1',\n credentialsType: '$2'\n }\n },\n '^pulling image \"(.+)\"$': {\n gettext: gettext('Pulling image: \"{{imageName}}\".'),\n placeholders: {\n imageName: '$1'\n }\n },\n '^Real-time event processing is currently overloaded and may stop processing your events\\\\. Please contact support\\\\.$': {\n gettext: gettext(\n 'Real-time event processing is currently overloaded and may stop processing your events. Please contact support.'\n )\n },\n '^Resource ID \\\\[type=com_cumulocity_model_idtype_GId, value=(.+?)\\\\] for this request not found.$': {\n gettext: gettext('Could not find the resource with ID \"{{id}}\".'),\n placeholders: {\n id: '$1'\n }\n },\n '^Retrieve configuration snapshot from device (.+?)': {\n gettext: gettext('Retrieve configuration snapshot from device {{deviceName}}'),\n placeholders: {\n deviceName: '$1'\n }\n },\n '^Retrieve (.+?) configuration snapshot from device (.+?)': {\n gettext: gettext(\n 'Retrieve {{configurationType}} configuration snapshot from device {{deviceName}}'\n ),\n placeholders: {\n configurationType: '$1',\n deviceName: '$2'\n }\n },\n '^Scaled up replica set (.+) to (\\\\d+)$': {\n gettext: gettext('Replica set \"{{replicaSetName}}\" scaled up to \"{{scaleNumber}}\".'),\n placeholders: {\n replicaSetName: '$1',\n scaleNumber: '$2'\n }\n },\n '^Send configuration snapshot (.+?) of configuration type (.+?) to device (.+?)': {\n gettext: gettext(\n 'Send configuration snapshot {{snapshotName}} of configuration type {{configurationType}} to device {{deviceName}}'\n ),\n placeholders: {\n snapshotName: '$1',\n configurationType: '$2',\n deviceName: '$3'\n }\n },\n '^Send configuration snapshot (.+?) to device (.+?)': {\n gettext: gettext('Send configuration snapshot {{snapshotName}} to device {{deviceName}}'),\n placeholders: {\n snapshotName: '$1',\n deviceName: '$2'\n }\n },\n '^Simulator state is invalid: (.+)$': {\n gettext: gettext('Simulator state is invalid: {{violations}}'),\n placeholders: {\n violations: {\n capture: '$1',\n translate: {\n '(\\\\w+?) - may not be null': {\n gettext: gettext('\"{{field}}\" should not be null'),\n placeholders: {\n field: '$1'\n }\n },\n '(\\\\w+?) - must be less than or equal to (\\\\d+)': {\n gettext: gettext('\"{{field}}\" must be less than or equal to {{maxValue}}'),\n placeholders: {\n field: '$1',\n maxValue: '$2'\n }\n },\n '(\\\\w+?) - should not contain null values': {\n gettext: gettext('\"{{field}}\" should not contain null values'),\n placeholders: {\n field: '$1'\n }\n }\n }\n }\n }\n },\n \"^Smart rest template (.+?) doesn't exist$\": {\n gettext: gettext('SmartREST template with id \"{{templateId}}\" doesn\\'t exist'),\n placeholders: {\n templateId: '$1'\n }\n },\n '^Smart rule created$': {\n gettext: gettext('Smart rule created.')\n },\n '^Smart rule updated$': {\n gettext: gettext('Smart rule updated.')\n },\n '^Smart rule enabled$': {\n gettext: gettext('Smart rule activated.')\n },\n '^Smart rule disabled$': {\n gettext: gettext('Smart rule deactivated.')\n },\n '^Smart rule deleted$': {\n gettext: gettext('Smart rule deleted.')\n },\n '^Smart rule \"(.+?)\" created$': {\n gettext: gettext('Smart rule \"{{name}}\" created.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Smart rule \"(.+?)\" updated$': {\n gettext: gettext('Smart rule \"{{name}}\" updated.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Smart rule \"(.+?)\" enabled$': {\n gettext: gettext('Smart rule \"{{name}}\" activated.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Smart rule \"(.+?)\" disabled$': {\n gettext: gettext('Smart rule \"{{name}}\" deactivated.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Smart rule \"(.+?)\" deleted$': {\n gettext: gettext('Smart rule \"{{name}}\" deleted.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Started container$': {\n gettext: gettext('Container started.')\n },\n '^Successfully assigned (.+) to (.+)$': {\n gettext: gettext('\"{{imageName}}\" assigned to \"{{address}}\".'),\n placeholders: {\n imageName: '$1',\n address: '$2'\n }\n },\n '^Successfully pulled image \"(.+)\"$': {\n gettext: gettext('Image \"{{imageName}}\" pulled.'),\n placeholders: {\n imageName: '$1'\n }\n },\n '^Tenant creation failed. : Tenant with given id already exists.$': {\n gettext: gettext('Could not create a tenant. Tenant with given domain/URL already exists.')\n },\n '^Tenant id cannot be a reserved sql keyword \"(.+?)\".$': {\n gettext: gettext('Could not use a reserved SQL keyword \"{{tenantId}}\" as a domain name.'),\n placeholders: {\n tenantId: '$1'\n }\n },\n '^Tenant \"(.+?)\" activated$': {\n gettext: gettext('Tenant \"{{tenant}}\" activated.'),\n placeholders: {\n tenant: '$1'\n }\n },\n '^Tenant (.+?) has sub-tenants, please remove them first!$': {\n gettext: gettext('Could not remove tenant \"{{tenant}}\". Remove its subtenants first.'),\n placeholders: {\n tenant: '$1'\n }\n },\n '^Tenant activated$': {\n gettext: gettext('Tenant activated')\n },\n '^Tenant \"(.+?)\" created$': {\n gettext: gettext('Tenant \"{{tenant}}\" created.'),\n placeholders: {\n tenant: '$1'\n }\n },\n '^Tenant created$': {\n gettext: gettext('Tenant created')\n },\n '^Tenant \"(.+?)\" deleted$': {\n gettext: gettext('Tenant \"{{tenant}}\" deleted.'),\n placeholders: {\n tenant: '$1'\n }\n },\n '^Tenant deleted$': {\n gettext: gettext('Tenant deleted')\n },\n '^Tenant \"(.+?)\" suspended$': {\n gettext: gettext('Tenant \"{{tenant}}\" suspended.'),\n placeholders: {\n tenant: '$1'\n }\n },\n '^Tenant suspended$': {\n gettext: gettext('Tenant suspended')\n },\n '^Tenant \"(.+?)\" updated: (.+?)$': {\n gettext: gettext('Tenant \"{{tenant}}\" updated: {{properties}}.'),\n placeholders: {\n tenant: '$1',\n properties: '$2'\n }\n },\n '^Tenant updated$': {\n gettext: gettext('Tenant updated')\n },\n '^Too Many Requests$': {\n gettext: gettext('Too many requests. Try again later.')\n },\n \"^User alias equals username '(.+)'$\": {\n gettext: gettext('Username and login alias must be different.')\n },\n '^User created$': {\n gettext: gettext('User created')\n },\n '^User (.+?) created$': {\n gettext: gettext('User \"{{name}}\" created'),\n placeholders: {\n name: '$1'\n }\n },\n '^User deleted$': {\n gettext: gettext('User deleted')\n },\n '^User (.+?) deleted$': {\n gettext: gettext('User \"{{name}}\" deleted'),\n placeholders: {\n name: '$1'\n }\n },\n '^User updated$': {\n gettext: gettext('User updated')\n },\n '^User (.+?) updated: (.+)$': {\n gettext: gettext('User \"{{name}}\" updated: {{updatesList}}'),\n placeholders: {\n name: '$1',\n updatesList: {\n capture: '$2',\n translate: {\n \"delegatedBy='(.+?)'\": {\n gettext: gettext('delegated by: \"{{delegate}}\"'),\n placeholders: {\n delegate: '$1'\n }\n },\n \"owner='(.+?)'\": {\n gettext: gettext('owner: \"{{owner}}\"'),\n placeholders: {\n owner: '$1'\n }\n },\n 'inventory assignment \\\\[(.+?)\\\\] added': {\n gettext: gettext('inventory assignment [{{inventoryAssignment}}] added'),\n placeholders: {\n inventoryAssignment: '$1'\n }\n },\n 'inventory assignment \\\\[(.+?)\\\\] removed': {\n gettext: gettext('inventory assignment [{{inventoryAssignment}}] removed'),\n placeholders: {\n inventoryAssignment: '$1'\n }\n },\n 'applications \\\\[(.+?)\\\\] added$': {\n gettext: gettext('applications [{{applicationsList}}] added'),\n placeholders: {\n applicationsList: '$1'\n }\n },\n 'applications \\\\[(.+?)\\\\] removed$': {\n gettext: gettext('applications [{{applicationsList}}] removed'),\n placeholders: {\n applicationsList: '$1'\n }\n },\n 'global roles \\\\[(.+?)\\\\] added$': {\n gettext: gettext('global roles [{{globalRolesList}}] added'),\n placeholders: {\n globalRolesList: '$1'\n }\n },\n 'global roles \\\\[(.+?)\\\\] removed$': {\n gettext: gettext('global roles [{{globalRolesList}}] removed'),\n placeholders: {\n globalRolesList: '$1'\n }\n }\n }\n }\n }\n },\n \"^User with username '(.+?)' already exists! : Duplicated: (.+?)$\": {\n gettext: gettext('User \"{{username}}\" already exists.'),\n placeholders: {\n username: '$1'\n }\n },\n \"^User with username or alias '(.+)' already exists! : Duplicated: (.+)$\": {\n gettext: gettext('User with username or login alias \"{{usernameOrAlias}}\" already exists.'),\n placeholders: {\n usernameOrAlias: '$1'\n }\n },\n \"^User with email '(.+?)' already exists! : Duplicated: (.+?)$\": {\n gettext: gettext('User with email \"{{email}}\" already exists.'),\n placeholders: {\n email: '$1'\n }\n },\n '^unable to find option with given key (.+?) : Could not find entity Option by ID (.+?)!$': {\n gettext: gettext('Unable to get tenant option: \"{{option}}\".'),\n placeholders: {\n option: '$2'\n }\n },\n '^unable to find option with given key (.+?) : There is no system property for key (.+?)$': {\n gettext: gettext('Unable to get system option: \"{{option}}\".'),\n placeholders: {\n option: '$2'\n }\n },\n '^Write failed with error code 16733 and error message \\'trying to index text where term list is too big, max is 4mb _id: \"(.+?)\"\\'$': {\n gettext: gettext('The uploaded image cannot be bigger than 4 MB. Please upload a smaller one.')\n },\n '^Write failed with error code 17280 and error message \\'WiredTigerIndex::insert: key too large to index, failing (.+?) { : \"(.+?)\" }\\'$': {\n gettext: gettext('The chosen name is too long. Please try a shorter one.')\n },\n '^You have reached devices limit. No more devices can be registered.$': {\n gettext: gettext('You reached devices limit. No more devices can be registered.')\n },\n '^(.+) succeeded for volume \"(.+)\"': {\n gettext: gettext('Operation \"{{operation}}\" succeeded for volume \"{{volume}}\".'),\n placeholders: {\n operation: '$1',\n volume: '$2'\n }\n },\n \"^Exception on tenant (.+) in statement '(.+)': Invocation exception when invoking method '(.+)' of class '(.+)' passing parameters \\\\[(.+)\\\\] for statement '(.+)': (.+) : (.+)$\": {\n gettext: gettext(\n 'Exception on tenant {{tenantId}} in statement \"{{moduleName}}\": Invocation exception when invoking method \"{{methodName}}\" of class \"{{classPath}}\" passing parameters [{{parameters}}] for statement \"{{statement}}\": {{exceptionType}} : {{exceptionMessage}}.'\n ),\n placeholders: {\n tenantId: '$1',\n moduleName: '$2',\n methodName: '$3',\n classPath: '$4',\n parameters: '$5',\n statement: '$6',\n exceptionType: '$7',\n exceptionMessage: '$8'\n }\n },\n '^No nodes are available that match all of the predicates: (.+).$': {\n gettext: gettext('No nodes are available that match all of the predicates: [{{predicates}}].'),\n placeholders: {\n predicates: '$1'\n }\n },\n '^Readiness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\\\(Client.Timeout exceeded while awaiting headers\\\\)$': {\n gettext: gettext(\n 'Readiness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).'\n ),\n placeholders: {\n requestMethod: '$1',\n uri: '$2',\n protocol: '$3'\n }\n },\n '^Liveness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\\\(Client.Timeout exceeded while awaiting headers\\\\)$': {\n gettext: gettext(\n 'Liveness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).'\n ),\n placeholders: {\n requestMethod: '$1',\n uri: '$2',\n protocol: '$3'\n }\n },\n '^Error syncing pod$': {\n gettext: gettext('Pod synchronization error.')\n },\n '^Failed create pod sandbox.$': {\n gettext: gettext('Pod sandbox creation failed.')\n },\n '^Exception on tenant (.+) in statement \\'(.+)\\': Http status code: (\\\\d+) \\\\{error=\"alarm/Unprocessable Entity\",message=\"(.+)\",info=\"https://www.cumulocity.com/guides/reference-guide/#error_reporting\",details=\"null\"\\\\}$': {\n gettext: gettext(\n 'Exception on tenant {{tenantId}} in statement \"{{statement}}\": HTTP status code: {{httpStatusCode}} : {{message | translate}}'\n ),\n placeholders: {\n tenantId: '$1',\n statement: '$2',\n httpStatusCode: '$3',\n message: '$4'\n }\n },\n \"^User '(.+)' is managed by a remote identity management service defined by an administrator, direct update is forbidden$\": {\n gettext: gettext(\n 'User \"{{userName}}\" is managed by a remote identity management service defined by an administrator, direct update is forbidden.'\n ),\n placeholders: {\n userName: '$1'\n }\n },\n '^Added new child device to \"(.+)\" \\\\(ID: (.+)\\\\).$': {\n gettext: gettext('Added new child device to \"{{parentDeviceName}}\" (ID: {{parentDeviceId}}).'),\n placeholders: {\n parentDeviceName: '$1',\n parentDeviceId: '$2'\n }\n },\n '^Updated child device of \"(.+)\" \\\\(ID: (.+)\\\\).$': {\n gettext: gettext('Updated child device of \"{{parentDeviceName}}\" (ID: {{parentDeviceId}}).'),\n placeholders: {\n parentDeviceName: '$1',\n parentDeviceId: '$2'\n }\n },\n '^Added child device \"(.+)\" \\\\(ID: (.+)\\\\).$': {\n gettext: gettext('Added child device \"{{name}}\" (ID: {{id}}).'),\n placeholders: {\n name: '$1',\n id: '$2'\n }\n },\n '^Removed child device \"(.+)\" \\\\(ID: (.+)\\\\).$': {\n gettext: gettext('Removed child device \"{{name}}\" (ID: {{id}}).'),\n placeholders: {\n name: '$1',\n id: '$2'\n }\n },\n '^Change value of \"(.+)\" to (.+) (.+).$': {\n gettext: gettext('Change value of \"{{name}}\" to {{value}}{{unit}}.'),\n placeholders: {\n name: '$1',\n value: '$2',\n unit: '$3'\n }\n },\n '^Change value of \"(.+)\" to (.+).$': {\n gettext: gettext('Change value of \"{{name}}\" to {{value}}.'),\n placeholders: {\n name: '$1',\n value: '$2'\n }\n },\n '^Change status of \"(.+)\" to \"(.+)\".$': {\n gettext: gettext('Change status of \"{{name}}\" to \"{{label}}\".'),\n placeholders: {\n name: '$1',\n label: '$2'\n }\n },\n '^Send message \"(.+)\".$': {\n gettext: gettext('Send message \"{{str}}\".'),\n placeholders: {\n str: '$1'\n }\n },\n '^Close relay (.+).$': {\n gettext: gettext('Close relay {{number}}.'),\n placeholders: {\n number: '$1'\n }\n },\n '^Open relay (.+).$': {\n gettext: gettext('Open relay {{number}}.'),\n placeholders: {\n number: '$1'\n }\n },\n '^Change trace status to (.+).$': {\n gettext: gettext('Change trace status to {{state | translate}}.'),\n placeholders: {\n state: '$1'\n }\n },\n '^Change relay status to (.+).$': {\n gettext: gettext('Change relay status to {{status | translate}}.'),\n placeholders: {\n status: '$1'\n }\n },\n '^Closing relay (.+).$': {\n gettext: gettext('Closing relay {{number}}.'),\n placeholders: {\n number: '$1'\n }\n },\n '^Opening relay (.+).$': {\n gettext: gettext('Opening relay {{number}}.'),\n placeholders: {\n number: '$1'\n }\n },\n '^Update bulk operation$': {\n gettext: gettext('Update bulk operation')\n },\n '^Update bulk operation: (.+)$': {\n gettext: gettext('Update bulk operation: {{updatesList}}'),\n placeholders: bulkOperationAuditLogTextPlaceholders\n },\n '^Update firmware to: \"?(.+?)\"? \\\\(version: (.+)\\\\)\\\\.?$': {\n gettext: gettext('Update firmware to: \"{{ name }}\" (version: {{ version }})'),\n placeholders: {\n name: '$1',\n version: '$2'\n }\n },\n '^Update firmware to: \"?(.+?)\"?\\\\.?$': {\n gettext: gettext('Update firmware to: \"{{ name }}\"'),\n placeholders: {\n name: '$1'\n }\n },\n '^Update configuration to (.+).$': {\n gettext: gettext('Update configuration to: {{ name }}.'),\n placeholders: {\n name: '$1'\n }\n },\n '^Apply device profile: (.+).?$': {\n gettext: gettext('Apply device profile: {{ name }}'),\n placeholders: {\n name: '$1'\n }\n },\n '^Execute generic command: (.+).?$': {\n gettext: gettext('Execute generic command: {{command}}'),\n placeholders: {\n command: '$1'\n }\n },\n '^Failed to refresh application. : Cannot refresh non local-hosted application.$': {\n gettext: gettext('Could not reactivate the application as it is not hosted locally.')\n },\n '^Failed to refresh application. : Cannot refresh application without active version id.$': {\n gettext: gettext('Could not reactivate the application as it has no active version.')\n },\n // TODO: remove if we decide not to translate such messages:\n // '^Killing container with id (.+):Need to kill Pod$': {\n // gettext: gettext('Killing container with ID \"{{containerId}}\". Need to kill Pod.'),\n // placeholders: {\n // containerId: '$1'\n // }\n // },\n '^Scaled down replica set (.+) to (\\\\d+)$': {\n gettext: gettext('Replica set \"{{replicaSetName}}\" scaled down to \"{{scaleNumber}}\".'),\n placeholders: {\n replicaSetName: '$1',\n scaleNumber: '$2'\n }\n },\n '^Deleted pod: (.+)$': {\n gettext: gettext('Pod \"{{imageName}}\" deleted.'),\n placeholders: {\n imageName: '$1'\n }\n },\n '^Container image \"(.+)\" already present on machine$': {\n gettext: gettext('Container image \"{{imageName}}\" already exists.'),\n placeholders: {\n imageName: '$1'\n }\n },\n '^Error updating tenant! Cannot insert second configuration for Password code grant internal/Bad Request$': {\n gettext: gettext(\n 'This login mode was already set by another administrator. Refresh the page to update the data.'\n )\n }\n};\n","import { Injectable } from '@angular/core';\n\n/**\n * A service to provide unmodified, cached translations for angular.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CachedLocaleDictionaryService {\n cachedDictionary = {};\n}\n","import { HttpClient } from '@angular/common/http';\nimport { TranslateLoader } from '@ngx-translate/core';\nimport { Observable, of } from 'rxjs';\nimport { map, catchError, tap } from 'rxjs/operators';\nimport { Inject, Injectable } from '@angular/core';\nimport { LOCALE_PATH } from './locale.path';\nimport { LANGUAGES } from './languages';\nimport { OptionsService } from '../common/options.service';\nimport { mapKeys } from 'lodash-es';\nimport { CachedLocaleDictionaryService } from './cached-locale-dictionary.service';\n\n@Injectable()\nexport class TranslateCustomLoader implements TranslateLoader {\n constructor(\n private http: HttpClient,\n private optionsService: OptionsService,\n private cachedLocaleDictionaryService: CachedLocaleDictionaryService,\n @Inject(LOCALE_PATH) private path: string = null,\n @Inject(LANGUAGES) private languages: any = null\n ) {}\n\n getTranslation(lang: string): Observable<any> {\n const path = this.path || '';\n let url = `${path}${lang}.json`;\n if (this.languages && this.languages[lang] && this.languages[lang].url) {\n url = this.languages[lang].url;\n }\n\n return this.http.get(url).pipe(\n map(d => {\n if (this.optionsService.langsDetails && this.optionsService.langsDetails[lang]) {\n return { ...d[lang], ...this.optionsService.langsDetails[lang] };\n }\n return d[lang];\n }),\n tap(dictionary => {\n this.cachedLocaleDictionaryService.cachedDictionary[lang] = dictionary;\n }),\n map(dictionary => this.getDictionaryWithTrimmedKeys(dictionary)),\n catchError(() => of({}))\n );\n }\n\n /**\n * We want to have translation keys unified, so they don't contain unnecessary spaces and line breaks.\n * This way we can dynamically build keys from HTML, and match them to extracted string, that might be HTML as well.\n */\n getDictionaryWithTrimmedKeys(dictionary: object) {\n return mapKeys(dictionary, (value, key) =>\n trimTranslationKey(key)\n );\n }\n\n}\n\nexport function trimTranslationKey(key) {\n return key.replace(/(\\r\\n|\\n|\\r)/gm, '').replace(/\\s{2,}/g, ' ').trim();\n}\n","import { Injectable } from '@angular/core';\nimport { TranslateDefaultParser } from '@ngx-translate/core';\nimport { get } from 'lodash-es';\nimport { trimTranslationKey } from './translate.loader';\n\n@Injectable()\nexport class TranslateParserCustom extends TranslateDefaultParser {\n\n getValue(target: any, key: string): any {\n const trimmedKey = trimTranslationKey(key);\n let translated = get(target, [trimmedKey]);\n if (!translated) {\n const keys = key.split('.');\n if (keys.length > 1) {\n translated = get(target, key);\n }\n }\n return translated;\n }\n}\n","import {\n DefaultLangChangeEvent,\n LangChangeEvent,\n TranslateService,\n TranslationChangeEvent\n} from '@ngx-translate/core';\nimport {\n AfterViewChecked,\n ChangeDetectorRef,\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { isEqual } from 'lodash-es';\n\n/**\n * This is temporary fallback directive that is used to handle HTML blocks translation on maintenance versions\n * in version 10.9.4 and later, this is replaced by default translate directive.\n */\n@Directive({\n selector: '[forceHtmlTranslate]'\n})\nexport class ForceHtmlTranslateDirective implements AfterViewChecked, OnDestroy {\n currentParams: any;\n onLangChangeSub: Subscription;\n onDefaultLangChangeSub: Subscription;\n onTranslationChangeSub: Subscription;\n\n /**\n * Used to trigger events when html is replaced by directive.\n */\n htmlUpdateEvent: EventEmitter<void> = new EventEmitter<void>();\n\n @Input() set translateParams(params: any) {\n if (!isEqual(this.currentParams, params)) {\n this.currentParams = params;\n this.checkNodes();\n }\n }\n\n constructor(\n private translateService: TranslateService,\n private element: ElementRef,\n private _ref: ChangeDetectorRef\n ) {\n // subscribe to onTranslationChange event, in case the translations of the current lang change\n if (!this.onTranslationChangeSub) {\n this.onTranslationChangeSub = this.translateService.onTranslationChange.subscribe(\n (event: TranslationChangeEvent) => {\n if (event.lang === this.translateService.currentLang) {\n this.checkNodes();\n }\n }\n );\n }\n\n // subscribe to onLangChange event, in case the language changes\n if (!this.onLangChangeSub) {\n this.onLangChangeSub = this.translateService.onLangChange.subscribe(\n (event: LangChangeEvent) => {\n this.checkNodes();\n }\n );\n }\n\n // subscribe to onDefaultLangChange event, in case the default language changes\n if (!this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub = this.translateService.onDefaultLangChange.subscribe(\n (event: DefaultLangChangeEvent) => {\n this.checkNodes();\n }\n );\n }\n }\n\n ngAfterViewChecked() {\n this.checkNodes();\n }\n\n checkNodes() {\n if (this.isLookupKeyMissing()) {\n this.element.nativeElement.lookupKey = this.getLookupKey();\n }\n this.translateAndUpdateHtmlContent();\n this.htmlUpdateEvent.emit();\n }\n\n ngOnDestroy() {\n if (this.onLangChangeSub) {\n this.onLangChangeSub.unsubscribe();\n }\n\n if (this.onDefaultLangChangeSub) {\n this.onDefaultLangChangeSub.unsubscribe();\n }\n\n if (this.onTranslationChangeSub) {\n this.onTranslationChangeSub.unsubscribe();\n }\n this.htmlUpdateEvent.complete();\n }\n\n /**\n * Builds lookup key from innerHTML, removes comments (that might be added by Angular) and trims it.\n */\n private getLookupKey() {\n return this.element.nativeElement.innerHTML.replace(/<!--.*?-->/gs, '').trim();\n }\n\n private isLookupKeyMissing(): boolean {\n return !this.element.nativeElement.lookupKey;\n }\n\n private lookupKeyExist(): boolean {\n return this.element.nativeElement.lookupKey;\n }\n\n private translateAndUpdateHtmlContent(): void {\n if (this.lookupKeyExist()) {\n this.element.nativeElement.innerHTML = this.translateService.instant(\n this.element.nativeElement.lookupKey,\n this.currentParams || {}\n );\n }\n }\n}\n","import { HttpClient, HttpClientModule } from '@angular/common/http';\nimport { LOCALE_ID, NgModule } from '@angular/core';\nimport {\n MissingTranslationHandler,\n TranslateService as NgxTranslateService,\n TranslateCompiler,\n TranslateFakeCompiler,\n TranslateLoader,\n TranslateModule,\n TranslateParser,\n TranslateStore,\n USE_DEFAULT_LANG,\n USE_STORE,\n USE_EXTEND,\n DEFAULT_LANGUAGE\n} from '@ngx-translate/core';\nimport { OptionsService } from '../common/options.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { LANGUAGES } from './languages';\nimport { LOCALE_PATH } from './locale.path';\nimport { MissingTranslationCustomHandler } from './missing-translation-custom.handler';\nimport { MESSAGES } from './pattern-messages.data';\nimport { HOOK_PATTERN_MESSAGES } from './patterns-message.hook';\nimport { TranslateCustomLoader } from './translate.loader';\nimport { TranslateParserCustom } from './translate.parser';\nimport { CachedLocaleDictionaryService } from './cached-locale-dictionary.service';\nimport { ForceHtmlTranslateDirective } from './force-html-translate.directive';\n\n// Load these as a side effect\ntry {\n // tslint:disable:no-var-requires\n require('@c8y/ngx-components/locales/de.po');\n require('@c8y/ngx-components/locales/en.po');\n require('@c8y/ngx-components/locales/es.po');\n require('@c8y/ngx-components/locales/fr.po');\n require('@c8y/ngx-components/locales/ja_JP.po');\n // tslint:enable:no-var-requires\n} catch (e) {\n // empty block\n}\n\nconst angularLocalesLanguageMap = { en: 'en-GB', 'en-EN': 'en-GB' };\n\n// AoT requires an exported function for factories\nexport function translateLoaderFactory(\n httpClient: HttpClient,\n optionsService: OptionsService,\n cachedLocaleDictionaryService: CachedLocaleDictionaryService,\n localePath: string,\n languages: any\n) {\n return new TranslateCustomLoader(httpClient, optionsService, cachedLocaleDictionaryService, localePath, languages);\n}\n\nexport function localePathFactory(options: OptionsService) {\n return options.localePath;\n}\n\nexport function languagesFactory(options: OptionsService) {\n return options.languages;\n}\n\nexport function localeId(appStateService: AppStateService) {\n return {\n get lang() {\n return getAngularLocalesLanguageString(appStateService.state.lang || 'en');\n },\n toLowerCase() {\n return this.lang.toLowerCase();\n },\n toString() {\n return this.lang;\n }\n };\n}\n\nexport function getAngularLocalesLanguageString(language) {\n return angularLocalesLanguageMap[language] || language;\n}\n\n/**\n * The angular module definition for i18n (translation).\n * @exports I18nModule\n */\n@NgModule({\n exports: [TranslateModule, ForceHtmlTranslateDirective],\n imports: [HttpClientModule],\n declarations: [ForceHtmlTranslateDirective]\n})\nexport class I18nModule {\n static providers() {\n return [\n { provide: LOCALE_ID, useFactory: localeId, deps: [AppStateService] },\n { provide: HOOK_PATTERN_MESSAGES, useValue: MESSAGES, multi: true },\n { provide: LOCALE_PATH, useFactory: localePathFactory, deps: [OptionsService] },\n { provide: LANGUAGES, useFactory: languagesFactory, deps: [OptionsService] },\n\n // Extracted from projects/ngx-translate/core/src/public_api.ts\n {\n provide: TranslateLoader,\n useFactory: translateLoaderFactory,\n deps: [HttpClient, OptionsService, CachedLocaleDictionaryService, LOCALE_PATH, LANGUAGES]\n },\n { provide: TranslateCompiler, useClass: TranslateFakeCompiler },\n { provide: TranslateParser, useClass: TranslateParserCustom },\n { provide: MissingTranslationHandler, useClass: MissingTranslationCustomHandler },\n TranslateStore,\n NgxTranslateService,\n { provide: USE_STORE, useValue: undefined },\n { provide: USE_DEFAULT_LANG, useValue: undefined },\n { provide: USE_EXTEND, useValue: false },\n { provide: DEFAULT_LANGUAGE, useValue: undefined }\n ];\n }\n static forRoot() {\n return {\n ngModule: I18nModule,\n providers: I18nModule.providers()\n };\n }\n}\n","export function parse(moduleSrc) {\n const src = moduleSrc.split(/\\n/)\n .map((l) => l.trim())\n .filter(Boolean)\n .filter((l) => !l.match(/^\\/?\\*/) && !l.match(/^\\/\\//))\n .join('\\n');\n const fn = new Function(`var exports = {};\nvar module = { exports: exports };\n${src}\nreturn exports;`);\n return fn();\n}\n","import './import-locales';\nimport { parse } from './parse-module';\nconst cache = new Map();\n/**\n * @ignore\n */\nexport function loadLocale(moduleLang) {\n return new Promise((resolve, reject) => {\n if (cache.has(moduleLang)) {\n resolve(cache.get(moduleLang));\n } else {\n fetch(`assets/locales/angular/${moduleLang}.js`)\n .then((res) => res.text())\n .then((src) => {\n const module = parse(src);\n cache.set(moduleLang, module);\n resolve(module);\n })\n .catch(reject);\n }\n });\n}\n","import { registerLocaleData } from '@angular/common';\nimport { Injectable } from '@angular/core';\nimport { TranslateService as NgxTranslateService } from '@ngx-translate/core';\nimport { keys } from 'lodash-es';\nimport { OptionsService } from '../common/options.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { getAngularLocalesLanguageString } from './i18n.module';\nimport { loadLocale } from './load-locale';\n\n/**\n * A service to manage the language of the application.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class TranslateService {\n static SAVE_LANGUAGE_KEY = 'c8y_language';\n static defaultLang() {\n return window.localStorage.getItem(TranslateService.SAVE_LANGUAGE_KEY);\n }\n langsDetail: any = this.options.get('languages', {});\n langs: any = keys(this.langsDetail).filter(k => this.langsDetail[k]);\n private DEFAULT_SEPARATOR = '_';\n constructor(\n private ngxTranslate: NgxTranslateService,\n private ui: AppStateService,\n private options: OptionsService\n ) {\n const queryStringLang = this.queryStringLang();\n if (queryStringLang) {\n this.saveInLocalStorage(queryStringLang);\n }\n }\n\n /**\n * Switches to given language.\n * @param lang The language as two-letter code.\n */\n async switchToLanguage(lang: string) {\n const moduleLang = lang.replace('_', '-');\n\n try {\n await this.loadLocales(moduleLang);\n } catch (e) {\n const lessSpecificModuleLang = moduleLang.split('-').shift();\n if (lessSpecificModuleLang !== moduleLang) {\n await this.loadLocales(lessSpecificModuleLang);\n } else {\n throw e;\n }\n }\n\n this.setLanguage(lang);\n }\n\n async loadLocales(moduleLang) {\n const module: any = await loadLocale(getAngularLocalesLanguageString(moduleLang));\n registerLocaleData(module.default);\n }\n\n setLanguage(lang: string) {\n this.ngxTranslate.setDefaultLang(this.options.get('defaultLanguage', 'en'));\n this.ngxTranslate.use(lang).subscribe(() => {\n this.ui.state$.next({ ...this.ui.state, lang });\n });\n }\n\n /**\n * Finds the first supported language\n */\n firstSupportedLanguage() {\n const languages = [this.queryStringLang(), this.localStorageLang()]\n .concat([this.options.get('defaultLanguage')])\n .concat(this.browserLangs())\n .concat(['en'])\n .filter(Boolean);\n const preferredLanguage = languages.find(lang => this.getSupported(lang));\n return this.getSupported(preferredLanguage);\n }\n\n /**\n * Converts a iso language code to a PO language code (e.g. de-de gets de_de).\n * @param lang The iso language code.\n */\n convertToLanguageCodePO(lang: string): string {\n const sep = lang.indexOf('-') > -1 ? '-' : this.DEFAULT_SEPARATOR;\n const [langMain, langSpecific] = lang.split(sep);\n const langLast = langSpecific ? `${this.DEFAULT_SEPARATOR}${langSpecific}` : '';\n return `${langMain}${langLast}`;\n }\n\n /**\n * Returns the language in the native language.\n * @param lang The language two-letter code.\n * @return The native name.\n */\n getNativeLanguage(lang: string): string {\n const langData = (this.langsDetail || {})[lang] || {};\n return langData.nativeName || lang;\n }\n\n saveInLocalStorage(lang: string) {\n window.localStorage.setItem(TranslateService.SAVE_LANGUAGE_KEY, lang);\n }\n\n getSupported(lang: string) {\n return this.langs.find(l => l === lang) || this.langs.find(l => l.startsWith(lang));\n }\n\n /**\n * Gets the language from the query parameter.\n * @return The language two-letter code.\n */\n queryStringLang() {\n return this.getQueryParameter('lang');\n }\n\n /**\n * Gets the language from local storage.\n * @return The language two-letter code.\n */\n private localStorageLang() {\n return window.localStorage.getItem(TranslateService.SAVE_LANGUAGE_KEY);\n }\n\n /**\n * Determines which language is set in the browser.\n * @return The languages the browser supports as string array.\n */\n private browserLangs() {\n const { navigator } = window;\n const browserLanguagePropertyKeys = [\n 'languages',\n 'language',\n 'browserLanguage',\n 'systemLanguage',\n 'userLanguage'\n ];\n return browserLanguagePropertyKeys.reduce((languages, property) => {\n const propertyLanguages = navigator[property];\n if (typeof propertyLanguages === 'string') {\n languages.push(propertyLanguages);\n } else if (Array.isArray(propertyLanguages)) {\n languages = languages.concat(propertyLanguages);\n }\n return languages;\n }, []);\n }\n\n private getQueryParameter(queryKey) {\n // TODO: replace this with URLSearchParams, ie 11 still doesn't support :()\n const query = window.location.search.substring(1);\n let result;\n query.split('&').find(pair => {\n const [key, value] = pair.split('=');\n if (key === queryKey) {\n result = value;\n }\n return result;\n });\n return result;\n }\n}\n","import { DatePipe as NgDatePipe } from '@angular/common';\nimport { Inject, LOCALE_ID, Pipe } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { gettext } from '../i18n/gettext';\n\n/**\n * The range of times supported by ECMAScript Date objects in milliseconds.\n * @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.1\n */\nexport const ES_MAX_TIME_MILLISECONDS: number = 8640000000000000;\n\n/**\n * Formats a date value according to locale rules. If no other format specified it defaults to `medium`\n * used as standard date/time format.\n *\n * Extends Angular's DatePipe in a way so that date values exceeding the range supported by ECMAScript\n * are displayed as earliest/latest supported point in time printed in the desired format pre- or postfixed\n * by the word `before` or `after`, respectively.\n * In all other cases the pipe behaves as the standard [DatePipe]{@link https://angular.io/api/common/DatePipe}.\n *\n * ```html\n * <span class=\"highlight\">{{ deadline | c8yDate }}</span> <!-- e.g. 7 May 2020, 17:45:19 (en-GB) or 07.05.2020, 17:45:19 (de) -->\n * <span>{{ lastUpdated | c8yDate: 'a h:MM:ss' }}</span> <!-- e.g. pm 5:45:19 -->\n * <span>{{ 8640000000000000 + 1 | c8yDate }}</span> <!-- e.g. after 13 Sep 275760, 03:00:00 --> ```\n */\n@Pipe({ name: 'c8yDate' })\nexport class DatePipe extends NgDatePipe {\n constructor(@Inject(LOCALE_ID) locale: string, private translateService: TranslateService) {\n super(locale);\n }\n\n transform(\n value: any,\n format: string = 'medium',\n timezone?: string,\n locale?: string\n ): string | null {\n let valueInBounds = value;\n let valueBefore: boolean = false;\n let valueBeyond: boolean = false;\n\n if (typeof value === 'number' && !isNaN(value)) {\n valueInBounds = Math.min(value, ES_MAX_TIME_MILLISECONDS);\n valueInBounds = Math.max(valueInBounds, -ES_MAX_TIME_MILLISECONDS);\n\n valueBefore = value < -ES_MAX_TIME_MILLISECONDS;\n valueBeyond = value > ES_MAX_TIME_MILLISECONDS;\n }\n let result: string = super.transform(valueInBounds, format, timezone, locale);\n\n if (valueBefore) {\n result = this.translateService.instant(gettext(`before {{date}}`), { date: result });\n } else if (valueBeyond) {\n result = this.translateService.instant(gettext(`after {{date}}`), { date: result });\n }\n\n return result;\n }\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n Output,\n TemplateRef\n} from '@angular/core';\nimport { IIdentified, Paging } from '@c8y/client';\n\n@Component({\n selector: 'c8y-load-more',\n templateUrl: './load-more.component.html'\n})\nexport class LoadMoreComponent {\n @Input()\n paging: Paging<any>;\n @Input()\n useIntersection = true;\n @Input()\n hidden = false;\n @Input()\n container: ElementRef;\n @Input()\n class: string = 'c8y-list__item p-0';\n @Input()\n maxIterations = 10;\n @Input()\n noMoreDataHint: TemplateRef<any>;\n @Input()\n loadNextLabel: string;\n @Input()\n loadingLabel: string;\n @Output()\n onLoad = new EventEmitter<IIdentified>();\n\n isLoading = false;\n counter = 0;\n showNoMoreDataHint = false;\n private loadUntilIntersected;\n private readonly LOAD_SAME_PAGE_THRESHOLD = 50;\n private intersectionObserver: IntersectionObserver;\n\n @HostBinding('class')\n get hostClass() {\n return this.hidden || (!this.hasMore && !this.showNoMoreDataHint) ? '' : this.class;\n }\n\n get hasMore() {\n return (\n this.paging && (this.paging.totalPages > this.paging.currentPage || !!this.paging.nextPage)\n );\n }\n\n constructor(private element: ElementRef) {}\n\n ngAfterContentInit(): void {\n if (this.useIntersection && 'IntersectionObserver' in window) {\n this.intersectionObserver = new IntersectionObserver(event => this.buttonInView(event[0]), {\n root: this.container ? this.container.nativeElement : null\n });\n this.intersectionObserver.observe(this.element.nativeElement);\n }\n this.showNoMoreDataHint = this.shouldShowNoMoreDataHint();\n }\n\n ngOnDestroy(): void {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n }\n }\n\n async loadMore(event?) {\n this.isLoading = true;\n if (event) {\n event.stopPropagation();\n }\n if (this.hasMore) {\n const result = await this.paging.next();\n this.counter++;\n this.paging = result.paging;\n this.onLoad.emit(result.data);\n this.intersectionLoading();\n this.showNoMoreDataHint = this.shouldShowNoMoreDataHint();\n } else {\n this.counter = 0;\n this.isLoading = false;\n }\n }\n\n private intersectionLoading() {\n if (this.useIntersection && this.hasMore && this.loadUntilIntersected !== null) {\n this.loadUntilIntersected = setTimeout(() => this.loadMore(), this.getLoadingThreshold());\n this.useIntersection = this.shouldSwitchMode();\n } else {\n this.isLoading = false;\n this.loadUntilIntersected = undefined;\n }\n }\n\n private getLoadingThreshold(): number {\n return this.LOAD_SAME_PAGE_THRESHOLD * this.counter;\n }\n\n private shouldShowNoMoreDataHint() {\n return (this.counter !== 0 || this.noMoreDataHint) && !this.hasMore && !this.hidden;\n }\n\n private shouldSwitchMode() {\n return this.counter < this.maxIterations || this.hidden;\n }\n\n private buttonInView(event) {\n if (event.isIntersecting) {\n this.loadMore();\n } else if (this.loadUntilIntersected) {\n clearTimeout(this.loadUntilIntersected);\n this.loadUntilIntersected = null;\n this.isLoading = false;\n } else {\n // avoiding a race condition when timeout is faster\n // cleared then set\n this.loadUntilIntersected = null;\n }\n }\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n ComponentFactory,\n ComponentFactoryResolver,\n Directive,\n EmbeddedViewRef,\n Input,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n ViewRef\n} from '@angular/core';\nimport { IIdentified, IResultList, Paging } from '@c8y/client';\nimport { assign, get } from 'lodash-es';\nimport { isObservable, Observable, of, pipe, Subject, Subscription } from 'rxjs';\nimport { map, takeUntil, tap } from 'rxjs/operators';\nimport { RealtimeService } from '../realtime/realtime.service';\nimport { LoadMoreComponent } from './load-more.component';\nimport { LoadMoreMode } from './load-more.model';\n\n/**\n * A directive to iterate over IResultList<T> data from @c8y/client.\n * Depending on the [c8yForLoadMore] a load more button is:\n * - auto: Tries to automatically load more data (default maximum 10 iterations; can be\n * change with maxIterations settings).\n * - show: Shows a load more button for the user to decide\n * - none: Doesn't perform any load more action.\n * - hidden: Loads more data automatically but with no visible button for the user.\n *\n * Additional, any rxjs operator pipe can be applied to the [c8yForPipe] input, e.g. to\n * filter the data displayed currently as well as the data loaded by subsequent requests.\n *\n * Example:\n * ```html\n * <div *c8yFor=\"let device of devices; loadMore: 'auto'; let i = index; pipe: filterPipe;\">\n * {{ i + 1 }}. {{device.name}}\n * </div>\n * ```\n * The above example will list all entities that are applied to `devices`:\n * ```typescript\n * this.devices = this.inventoryService.list({ pageSize: 10, fragmentType: 'c8y_IsDevice' })\n * ```\n * It will display the first 10 items, if there is more space left on the screen, and there are more\n * than 10 devices, it will automatically load up to 10 pages more. If it still can't fit the screen\n * it will stop and switch to `show` mode.\n *\n * A pipe can be applied e.g. for filtering or grouping. This pipe is attached to every follow up\n * request done by the load more component:\n * ```typescript\n * this.filterPipe = pipe(\n * map((data: []) => {\n * return data.filter(\n * (mo: any) => mo.name && mo.name.toLowerCase().indexOf(value.toLowerCase()) > -1\n * );\n * })\n * );\n * ```\n * The pipe must be an rxjs pipe and can take any operator.\n */\n@Directive({\n selector: '[c8yFor]'\n})\nexport class ForOfDirective {\n private cachedData: IIdentified[] = [];\n private paging: Paging<IIdentified>;\n private loadMoreMode: LoadMoreMode = 'auto';\n private dataPipe = pipe(tap());\n private pagingSub: Subscription;\n private obs$: Observable<IIdentified[]>;\n private loadMore: LoadMoreComponent;\n private maxIterations = 10;\n private notFoundTemplate: TemplateRef<any>;\n private realtime: RealtimeService<any>;\n private comparator: (itemA: object, itemB: object) => number;\n private unsubscribe$: Subject<void> = new Subject();\n\n private get shouldUseLoadMoreButton() {\n return (\n this.loadMoreMode === 'auto' || this.loadMoreMode === 'show' || this.loadMoreMode === 'hidden'\n );\n }\n\n private get hasMoreData() {\n return this.loadMore && this.loadMore.hasMore;\n }\n\n private get length() {\n return this.cachedData.length;\n }\n\n /**\n * The data setter. Must be a response from @c8y/data or an observable.\n * You can pass an observable with null to explicitly clear the list.\n */\n @Input()\n set c8yForOf(fetchData: IResultList<IIdentified> | Observable<IResultList<IIdentified>>) {\n if (fetchData) {\n this.obs$ = (isObservable(fetchData) ? fetchData : of(fetchData)).pipe(\n map(result => {\n if (result === null) {\n this.paging = null;\n return [];\n }\n const { paging, data } = result;\n this.paging = paging;\n return data;\n })\n );\n }\n }\n\n /**\n * The mode setter:\n * - auto: Tries to automatically load more data (default maximum 10 iterations; can be\n * change with maxIterations settings).\n * - show: Shows a load more button for the user to decide\n * - none: Doesn't perform any load more action.\n * - hidden: Loads more data automatically but with no visible button for the user.\n */\n @Input()\n set c8yForLoadMore(type: LoadMoreMode) {\n this.loadMoreMode = type;\n }\n\n /**\n * The pipe setter to attach any rxjs pipe to the current and more loaded data.\n */\n @Input()\n set c8yForPipe(dataPipe) {\n if (dataPipe) {\n this.dataPipe = dataPipe;\n }\n }\n\n /**\n * A template to use if no data is found at all (e.g. if you apply a filter pipe).\n */\n @Input()\n set c8yForNotFound(notFoundTemplate: TemplateRef<any>) {\n this.notFoundTemplate = notFoundTemplate;\n if (this.loadMore) {\n this.loadMore.noMoreDataHint = notFoundTemplate;\n }\n }\n\n /**\n * The maximum numbers of iterations to call data from the api.\n */\n @Input()\n set c8yForMaxIterations(maxIterations: number) {\n this.maxIterations = maxIterations;\n }\n\n /**\n * A RealtimeService instance.\n */\n @Input()\n set c8yForRealtime(source: RealtimeService<any>) {\n this.realtime = source;\n }\n\n /**\n * A comparator function for comparing list items. Used to determine\n * the position at which a new element should be added to the list.\n */\n @Input()\n set c8yForComparator(comparator: (itemA: object, itemB: object) => number) {\n this.comparator = comparator;\n }\n\n constructor(\n private tpl: TemplateRef<any>,\n private vcr: ViewContainerRef,\n private componentFactoryResolver: ComponentFactoryResolver\n ) {}\n\n ngOnInit(): void {\n this.handleRealtime();\n }\n\n private ngOnChanges(changes: SimpleChanges): void {\n if (this.obs$ && (changes.c8yForPipe || changes.c8yForOf)) {\n this.unsubscribePaging();\n\n // only re-rendering on filtering if all data is already loaded\n // from the backend\n const reRender = !this.hasMoreData && !!changes.c8yForPipe && !changes.c8yForOf;\n\n if (reRender) {\n this.obs$ = of(this.cachedData);\n }\n this.pagingSub = this.obs$\n .pipe(\n tap(data => {\n if (!reRender) {\n this.cachedData = data;\n }\n })\n )\n .pipe(src => this.dataPipe(src))\n .subscribe((data: []) => {\n this.render(data, reRender);\n });\n }\n }\n\n private ngOnDestroy(): void {\n this.unsubscribePaging();\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n\n private handleRealtime() {\n if (this.realtime) {\n this.realtime\n .onCreate$()\n .pipe(takeUntil(this.unsubscribe$))\n .subscribe(item => this.insert(item));\n this.realtime\n .onUpdate$()\n .pipe(takeUntil(this.unsubscribe$))\n .subscribe(item => this.update(item));\n this.realtime\n .onDelete$()\n .pipe(takeUntil(this.unsubscribe$))\n .subscribe(id => this.remove(coerceNumberProperty(id)));\n }\n }\n\n private render(data, reRender = false): void {\n this.vcr.clear();\n\n data.forEach((item, index) => {\n const context = {\n $implicit: item,\n index,\n length: this.length,\n hasMore: this.hasMoreData\n };\n this.vcr.createEmbeddedView(this.tpl, context);\n });\n\n if (this.shouldUseLoadMoreButton) {\n this.loadMore = this.createLoadMoreButtonComponent(reRender);\n }\n }\n\n private append(data) {\n data.forEach(item => {\n const index = this.shouldUseLoadMoreButton ? this.vcr.length - 1 : this.vcr.length;\n const context = {\n $implicit: item,\n index,\n length: this.length,\n hasMore: this.hasMoreData\n };\n this.vcr.createEmbeddedView(this.tpl, context, index);\n });\n }\n\n private loadMoreData(data) {\n if (data.length > 0) {\n this.append(data);\n }\n }\n\n private createLoadMoreButtonComponent(reRender) {\n const componentFactory: ComponentFactory<\n any\n > = this.componentFactoryResolver.resolveComponentFactory(LoadMoreComponent);\n const componentRef = this.vcr.createComponent(componentFactory);\n const instance = componentRef.instance as LoadMoreComponent;\n instance.paging = this.paging;\n instance.useIntersection = this.loadMoreMode === 'auto' || this.loadMoreMode === 'hidden';\n instance.hidden = this.loadMoreMode === 'hidden';\n instance.maxIterations = this.maxIterations;\n instance.noMoreDataHint = this.notFoundTemplate;\n this.pagingSub = instance.onLoad\n .pipe(\n map((data: []) => this.checkForDuplicates(data)),\n tap((data: []) => {\n this.cachedData = this.cachedData.concat(data);\n })\n )\n .pipe(src => this.dataPipe(src))\n .subscribe(data => this.loadMoreData(data));\n if (reRender) {\n assign(instance, this.loadMore);\n }\n return instance;\n }\n\n private insert(item) {\n let index: number = 0;\n\n if (this.comparator && this.cachedData.length) {\n let comparisionResult: number;\n do {\n const view: EmbeddedViewRef<any> = this.vcr.get(index) as EmbeddedViewRef<any>;\n const itemB = get(view, 'context.$implicit');\n comparisionResult = item && itemB ? this.comparator(item, itemB) : 0;\n if (comparisionResult <= 0) {\n index++;\n }\n } while (comparisionResult <= 0 && index < this.cachedData.length);\n }\n\n // Do not append elements after the last one currently loaded,\n // as it may belong further down there on the list and will\n // be eventually loaded with one of the next pages.\n if (index < this.cachedData.length || this.cachedData.length === 0) {\n const context = {\n $implicit: item,\n index,\n length: this.length,\n hasMore: this.hasMoreData\n };\n\n this.cachedData.splice(index, 0, item);\n const viewRef: ViewRef = this.tpl.createEmbeddedView(context);\n this.vcr.insert(viewRef, index);\n }\n }\n\n private update(updatedItem) {\n this.forMatchingEmbeddedViewRef(\n (item: IIdentified) => item && updatedItem && item.id === updatedItem.id,\n (view: EmbeddedViewRef<any>) => {\n view.context.$implicit = updatedItem;\n view.markForCheck();\n }\n );\n }\n\n private remove(idToRemove) {\n this.forMatchingEmbeddedViewRef(\n (item: IIdentified) => item && coerceNumberProperty(item.id, NaN) === idToRemove,\n (view: EmbeddedViewRef<any>) => view.destroy()\n );\n }\n\n private forMatchingEmbeddedViewRef(\n filter: (item: IIdentified) => boolean,\n callback: (view: EmbeddedViewRef<any>) => void\n ) {\n for (let i = 0; i < this.vcr.length; i++) {\n const view: EmbeddedViewRef<any> = this.vcr.get(i) as EmbeddedViewRef<any>;\n const item: IIdentified = get(view, 'context.$implicit');\n if (filter(item)) {\n callback(view);\n }\n }\n }\n\n private checkForDuplicates(data: IIdentified[]): IIdentified[] {\n return this.realtime\n ? data.filter(item => !this.cachedData.some(cached => cached.id === item.id))\n : data;\n }\n\n private unsubscribePaging() {\n if (this.pagingSub) {\n this.pagingSub.unsubscribe();\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { Observable } from 'rxjs';\nimport { gettext } from '../i18n/gettext';\nimport { get, find, negate, isUndefined } from 'lodash';\nimport { HumanizePipe } from './humanize.pipe';\n\n/*\n * Humanize an application name and translates it.\n * Usage:\n * appNameOrApp | humanizeAppName | async\n*/\n@Pipe({ name: 'humanizeAppName' })\nexport class HumanizeAppNamePipe implements PipeTransform {\n\n private internalApps = {\n administration: 'Administration',\n cockpit: 'Cockpit',\n devicemanagement: 'Device management'\n };\n\n constructor(private translateService: TranslateService) {}\n\n transform(appNameOrApp: any = 'Cumulocity'): Observable<string> {\n const appName = this.getAppName(appNameOrApp);\n\n let text;\n if (this.isPublicApp(appNameOrApp)) {\n text = gettext('{{ appName | translate }} (public)');\n } else {\n text = appName;\n }\n return this.translateService.stream(text, { appName });\n }\n\n private getAppName(appNameOrApp) {\n const appName = this.getFirstDefined([\n get(appNameOrApp, 'name'),\n get(appNameOrApp, 'contextPath'),\n appNameOrApp\n ]) || '';\n return this.internalApps[appName] || appName;\n }\n\n private getFirstDefined(values) {\n return find(values, negate(isUndefined));\n }\n\n private isPublicApp(appNameOrApp) {\n return Boolean(get(appNameOrApp, 'public'));\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { upperFirst } from 'lodash-es';\n\n/*\n * Humanize any string\n * Usage:\n * 'something' | humanize\n*/\n@Pipe({ name: 'humanize' })\nexport class HumanizePipe implements PipeTransform {\n static humanize(str: string = ''): string {\n str = str\n .replace(/\\./g, ' ')\n .replace(/c8y[\\s,_]*/gi, '')\n .replace(/_/g, ' ')\n .replace(/([A-Z][a-z])/g, ' $1')\n .replace(/^\\$\\.?/, '')\n .replace(/^\\s*/, '')\n .replace(/\\s*$/, '')\n .replace(/\\s+/g, ' ');\n\n return upperFirst(str);\n }\n\n transform(str: string): string {\n return HumanizePipe.humanize(str);\n }\n}\n","import { Directive, Renderer2, Input, ElementRef } from '@angular/core';\n\n/**\n * Allows to set a icon. Switches between c8y default icons\n * and font awesome icons\n * @example <i [c8yIcon]=\"'rocket'\">\n */\n@Directive({\n selector: '[c8yIcon]',\n})\nexport class IconDirective {\n\n @Input()\n set c8yIcon(icon: string) {\n this.updateIcon(icon);\n }\n private c8yMatch = /^c8y-/;\n private klasses = [];\n private currentClasses = '';\n constructor(\n private el: ElementRef,\n private renderer: Renderer2\n ) {}\n\n private isC8y(icon) {\n return this.c8yMatch.test(icon);\n }\n\n private getClasses(icon: string = '') {\n let classes = '';\n if (icon) {\n const _icon = icon.trim();\n const isC8y = this.isC8y(_icon);\n const iconClass = isC8y ? _icon.replace(this.c8yMatch, 'c8y-icon-') : `fa-${_icon}`;\n classes = `${isC8y ? 'c8y-icon' : 'fa fw'} ${iconClass}`;\n }\n return classes;\n }\n\n private updateIcon(icon: string) {\n const newClasses = this.getClasses(icon);\n if (newClasses !== this.currentClasses) {\n this.currentClasses.split(/\\s/).filter((c) => c).forEach((klass) => {\n this.renderer.removeClass(this.el.nativeElement, klass);\n });\n newClasses.split(/\\s/).filter((c) => c).forEach((klass) => {\n this.renderer.addClass(this.el.nativeElement, klass);\n });\n this.currentClasses = newClasses;\n }\n }\n}\n\nexport const ICONS = [\n 'home',\n 'th',\n 'bar-chart-o',\n 'tasks',\n 'tachometer',\n 'bell',\n 'puzzle-piece',\n 'map-marker',\n 'location-arrow',\n 'globe',\n 'power-off',\n 'desktop',\n 'laptop',\n 'mobile',\n 'signal',\n 'qrcode',\n 'file',\n 'file-text',\n 'folder',\n 'folder-open',\n 'archive',\n 'hdd-o',\n 'book',\n 'bookmark',\n 'tag',\n 'flag',\n 'search',\n 'heart',\n 'star',\n 'bolt',\n 'rocket',\n 'cog',\n 'cogs',\n 'wrench',\n 'ban',\n 'user',\n 'users',\n 'sign-in',\n 'sign-out',\n 'upload',\n 'download',\n 'cloud-upload',\n 'cloud-download',\n 'cloud',\n 'spinner',\n 'refresh',\n 'repeat',\n 'undo',\n 'lock',\n 'unlock',\n 'info',\n 'question',\n 'exclamation',\n 'bug',\n 'calendar',\n 'random',\n 'asterisk',\n 'key',\n 'link',\n 'chain-broken',\n 'external-link',\n 'picture-o',\n 'comment',\n 'bullhorn',\n 'phone',\n 'lightbulb-o',\n 'flask',\n 'sitemap',\n 'exchange',\n 'code-fork',\n 'keyboard-o',\n 'terminal',\n 'code',\n 'clipboard',\n 'pencil',\n 'envelope',\n 'inbox',\n 'reply',\n 'share',\n 'thumbs-up',\n 'thumbs-down',\n 'check',\n 'plus',\n 'expand',\n 'compress',\n 'arrows',\n 'arrow-up',\n 'arrow-down',\n 'arrow-left',\n 'arrow-right',\n 'th-list',\n 'bars',\n 'table',\n 'columns',\n 'filter',\n 'sort',\n 'sort-up',\n 'sort-down',\n 'ellipsis-h',\n 'ellipsis-v',\n 'rss',\n 'apple',\n 'windows',\n 'android',\n 'linux'\n ];\n","import { memoize as _memoize } from 'lodash-es';\n\n/**\n * Decorator to memoize function results.\n * @param resolver Cache key resolver function, used by memoize from lodash.\n */\nexport function memoize(resolver?) {\n return (target, fnName, descriptor) => {\n const fn = descriptor.value;\n descriptor.value = function(...args) {\n const memoizedFnName = `_${fnName}Memoized`;\n if (!this[memoizedFnName]) {\n this[memoizedFnName] = _memoize(fn, resolver);\n }\n return this[memoizedFnName].apply(this, args);\n };\n };\n}\n","import { Injectable } from '@angular/core';\nimport { AppStateService } from './ui-state.service';\nimport { IManagedObject, InventoryService } from '@c8y/client';\nimport { property } from 'lodash-es';\nimport { memoize } from './memoize.decorator';\nimport { IUser, UserService } from '@c8y/client';\n\n@Injectable()\nexport class Permissions {\n constructor(\n private appState: AppStateService,\n private inventory: InventoryService,\n private user: UserService\n ) {}\n\n /**\n * Checks if the current user has write permissions for the given mo.\n * (either through global role, individual device permissions or via inventory roles).\n *\n * @param {array} roleIds Array of roles which the current user should have.\n * @param {object} mo The managed object for which we are checking whether the user has access.\n */\n canEdit(roleIds, mo) {\n return this.checkIfCanEdit(roleIds, mo);\n }\n\n hasRole(roleId: string) {\n const currentUser = this.appState.currentUser.value;\n if (!currentUser) {\n throw new Error('Roles can only be requested if the user is logged in.');\n }\n return this.user.hasRole(currentUser, roleId);\n }\n\n hasAllRoles(roleIds: string[]) {\n const currentUser = this.appState.currentUser.value;\n if (!currentUser) {\n throw new Error('Roles can only be requested if the user is logged in.');\n }\n return this.user.hasAllRoles(currentUser, roleIds);\n }\n\n hasAnyRole(roleIds: string[]) {\n const currentUser = this.appState.currentUser.value;\n if (!currentUser) {\n throw new Error('Roles can only be requested if the user is logged in.');\n }\n return this.user.hasAnyRole(currentUser, roleIds);\n }\n\n @memoize(property('id'))\n protected async checkIfOwner(mo) {\n const currentUserName = await this.appState.currentUser.value.userName;\n const { data, res } = await this.inventory.detail(mo.id);\n return currentUserName === data.owner;\n }\n\n @memoize(property('id'))\n protected checkWithRequest(mo) {\n const moName = mo.name;\n const moId = mo.id;\n const partialUpdateObject: Partial<IManagedObject> = {\n id: moId,\n name: moName\n };\n return this.inventory\n .update(partialUpdateObject)\n .then(success => {\n return true;\n })\n .catch(err => {\n return false;\n });\n }\n\n private async checkIfCanEdit(roleIds, mo) {\n if (await this.hasAnyRole(roleIds)) {\n return true;\n } else if (await this.checkIfOwner(mo)) {\n return true;\n } else if (await this.checkWithRequest(mo)) {\n return true;\n }\n return false;\n }\n}\n","import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { Permissions } from './permissions.service';\n\n/**\n * A structural directive that conditionally includes a template only if the user has\n * all or any of the roles passed as an input. By default the directive checks all roles:\n *\n * ```\n * <button *c8yIfAllowed=\"['ROLE_RECORD_DELETE', 'ROLE_ENTRY_DELETE']\" (click)=\"delete()\" title=\"Delete\">\n * Delete\n * </button>\n * ```\n *\n * To check if the user has any of the required roles to view the element you need to use the `allowAny` input:\n *\n * ```\n * <button *c8yIfAllowed=\"['ROLE_RECORD_DELETE', 'ROLE_ENTRY_DELETE']; allowAny: true\" (click)=\"delete()\" title=\"Delete\">\n * Delete\n * </button>\n * ```\n *\n * or use the shorter version\n *\n * ```\n * <button *c8yIfAllowed=\"['ROLE_RECORD_DELETE', 'ROLE_ENTRY_DELETE']; allowAny\" (click)=\"delete()\" title=\"Delete\">\n * Delete\n * </button>\n * ```\n */\n@Directive({\n selector: '[c8yIfAllowed]'\n})\nexport class IfAllowedDirective {\n /**\n * One or many roles required for the element to be rendered\n */\n @Input()\n set c8yIfAllowed(roleIds: string | string[]) {\n this.rolesIds = Array.isArray(roleIds) ? roleIds : !!roleIds ? [roleIds] : [];\n }\n\n /**\n * Switches to the mode where at least one of the provided roles is sufficient for the element to be rendered\n */\n @Input()\n set c8yIfAllowedAllowAny(allowAny: boolean) {\n this.allowAny = allowAny === null || allowAny;\n }\n\n private rolesIds: string[];\n private allowAny: boolean = false;\n\n constructor(\n private template: TemplateRef<any>,\n private container: ViewContainerRef,\n private permissions: Permissions\n ) {}\n\n ngOnInit() {\n if (\n !this.rolesIds ||\n !this.rolesIds.length ||\n (this.allowAny\n ? this.permissions.hasAnyRole(this.rolesIds)\n : this.permissions.hasAllRoles(this.rolesIds))\n ) {\n this.container.createEmbeddedView(this.template);\n }\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'c8y-loading',\n template: `\n <div class=\"p-24 p-relative d-inline-block\" >\n <div class=\"spinner\">\n <div class=\"rect1\"></div>\n <div class=\"rect2\"></div>\n <div class=\"rect3\"></div>\n <div class=\"rect4\"></div>\n <div class=\"rect5\"></div>\n </div>\n </div>\n `\n})\nexport class LoadingComponent {}\n","/*\n * Implementation of pure \"Mapping\" pipe based on\n * https://codeburst.io/angular-bad-practices-eab0e594ce92#389b\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'map'\n})\nexport class MapFunctionPipe implements PipeTransform {\n /*\n * This will be a universal pipe for array mappings. You may add more\n * type checkings and runtime checkings to make sure it works correctly everywhere.\n */\n transform(value, mappingFunction: (arg: any) => any, thisArg?: any) {\n return mappingFunction.apply(thisArg || this, Array.isArray(value) ? value : [value]);\n }\n}\n","import { assign } from 'lodash-es';\nimport {\n ComponentFactory,\n ComponentFactoryResolver,\n Directive,\n ElementRef,\n Input,\n Renderer2,\n TemplateRef,\n Type,\n ViewContainerRef\n } from '@angular/core';\n\n/**\n * Directive to set a DOM node, a TemplateRef or any Component to a container or any node.\n * @example\n * <div *c8yOutlet=\"template\"></div>\n * <div *c8yOutlet=\"DeviceStatusComponent; properties: { node }\"></div>\n * <div *c8yOutlet=\"nodes\"></div>\n */\n@Directive({\n selector: '[c8yOutlet]',\n})\nexport class OutletDirective {\n private properties = {};\n private _element;\n\n constructor(\n private viewContainer: ViewContainerRef,\n private resolver: ComponentFactoryResolver,\n private renderer: Renderer2,\n private el: ElementRef\n ) { }\n\n /**\n * Directive to set a DOM node, a TemplateRef or any Component to a container or any node.\n * @example\n * <div *c8yOutlet=\"template\"></div>\n * <div *c8yOutlet=\"DeviceStatusComponent; properties: { node }\"></div>\n * <div *c8yOutlet=\"nodes\"></div>\n */\n @Input() set c8yOutlet(template: TemplateRef<any> | Type<any> | Element) {\n if (!template) {\n return;\n }\n if (this._element instanceof Element) {\n this.renderer.removeChild(this._element.parentElement, this._element);\n }\n this.viewContainer.clear();\n\n // case TemplateRef -> <div *c8yOutlet=\"template\"></div>\n if (template instanceof TemplateRef) {\n this.viewContainer.createEmbeddedView(template);\n\n // case DOM Element -> <div *c8yOutlet=\"nodes\"></div>\n } else if (template instanceof Element) {\n const parent = this.renderer.parentNode(this.el.nativeElement);\n this.destroy();\n this._element = template;\n this.renderer.insertBefore(parent, this._element, this.el.nativeElement);\n\n // case Component -> <div *c8yOutlet=\"DeviceStatusComponent; properties: { node }\"></div>\n } else {\n const factory: ComponentFactory<any> = this.resolver.resolveComponentFactory(template);\n const component = this.viewContainer.createComponent(factory);\n assign(component.instance, this.properties);\n }\n }\n\n @Input() set c8yOutletProperties(value) {\n this.properties = value;\n }\n\n ngOnDestroy(): void {\n this.destroy();\n }\n\n private destroy() {\n if (this._element) {\n const _parent = this.renderer.parentNode(this._element);\n this.renderer.removeChild(_parent, this._element);\n }\n }\n}\n","import { Component, Input } from '@angular/core';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-progress-bar',\n templateUrl: './progress-bar.component.html'\n})\nexport class ProgressBarComponent {\n @Input() message: string = gettext('Loading…');\n @Input() progress: number = null;\n}\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({ name: 'shortenUserName' })\r\nexport class ShortenUserNamePipe implements PipeTransform {\r\n\r\n transform({ firstName = '', lastName = '', userName = ''}: any): string {\r\n let parsedFirstName = firstName.trim().split(/\\s+/).shift().substr(0, 1);\r\n const parsedLastName = lastName.trim().split(/\\s+/).pop();\r\n\r\n if (!parsedLastName) {\r\n parsedFirstName = firstName.split(/\\s+/).shift();\r\n } else {\r\n parsedFirstName = parsedFirstName ? `${parsedFirstName}. ` : '';\r\n }\r\n\r\n return parsedFirstName || parsedLastName ? parsedFirstName + parsedLastName : userName;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\nimport { ApplicationService, TenantService, IApplication } from '@c8y/client';\n\n/** The helper UI service for tenant related methods built upon client services. */\n@Injectable()\nexport class TenantUiService {\n constructor(\n private tenantService: TenantService,\n private applicationService: ApplicationService\n ) {}\n\n /**\n * Checks whether current tenant is the management tenant.\n * @returns True if current tenant is the management tenant.\n */\n async isManagementTenant(): Promise<boolean> {\n const currentTenant = (await this.tenantService.current()).data;\n return currentTenant.name === 'management';\n }\n\n /**\n * Checks whether current tenant is an enterprise tenant.\n * An enterprise tenant is a tenant which has subscribed:\n * - `branding` microservice or `feature-branding` feature app,\n * - `sslmanagement` microservice,\n * - `feature-user-hierarchy` feature app,\n * - `feature-broker` feature app.\n *\n * See https://cumulocity.com/guides/users-guide/enterprise-edition/ for details about such tenants.\n *\n * @returns True, if current tenant is an enterprise tenant.\n */\n async isEnterpriseTenant(): Promise<boolean> {\n const hasBranding =\n (await this.hasApp({ name: 'branding' })) ||\n (await this.hasApp({ name: 'feature-branding' }));\n const hasSslManagement = await this.hasApp({ name: 'sslmanagement' });\n const hasUserHierarchy = await this.hasApp({ name: 'feature-user-hierarchy' });\n const hasDataBroker = await this.hasApp({ name: 'feature-broker' });\n\n return hasBranding && hasSslManagement && hasUserHierarchy && hasDataBroker;\n }\n\n private async hasApp(app: Partial<IApplication>): Promise<boolean> {\n return (await this.applicationService.isAvailable(app)).data;\n }\n}\n","import { Observable, of } from 'rxjs';\n\nexport class UserPreferencesStorageLocal {\n private LOCAL_STORAGE_KEY = 'userPreferences';\n private store: any = {};\n constructor() {\n try {\n const jsonStore = window.localStorage.getItem(this.LOCAL_STORAGE_KEY);\n if (jsonStore) {\n this.store = JSON.parse(jsonStore) || {};\n }\n } catch (e) {\n // do nothing\n }\n }\n\n get(key) {\n return of(this.store[key]);\n }\n\n set(key, value) {\n this.store[key] = value;\n return this.saveJsonStore();\n }\n\n private saveJsonStore() {\n return window.localStorage.setItem(this.LOCAL_STORAGE_KEY, JSON.stringify(this.store));\n }\n}\n","import { InventoryService } from '@c8y/client';\n\nexport class UserPreferencesStorageInventory {\n TYPE = 'c8y_UserPreference';\n\n constructor(\n private inventory: InventoryService\n ) {}\n\n async get(key) {\n const { data } = await this.inventory.list({fragmentType: key});\n return data.length ? data[0][key] : undefined;\n }\n\n async set(key, value) {\n const { data } = await this.inventory.list({fragmentType: key});\n const updateMo: any = {[key]: value, type: this.TYPE};\n let out;\n\n if (data.length) {\n updateMo.id = data[0].id;\n out = this.inventory.update(updateMo);\n } else {\n out = this.inventory.create(updateMo);\n }\n return out;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { InventoryService, UserService } from '@c8y/client';\nimport { IUser } from '@c8y/client';\nimport { Observable, from, never } from 'rxjs';\nimport { switchMap, first } from 'rxjs/operators';\nimport { UserPreferencesStorageLocal } from './user-preferences-storage-local';\nimport { UserPreferencesStorageInventory } from './user-preferences-store-inventory';\nimport { AppStateService } from '../ui-state.service';\n\n@Injectable()\nexport class UserPreferencesService {\n currentUser: Observable<IUser>;\n private LOCAL_STORAGE_KEY = 'userPreferences';\n private storage: {\n local: UserPreferencesStorageLocal,\n inventory: UserPreferencesStorageInventory\n };\n constructor(\n private user: UserService,\n private inventory: InventoryService,\n private appState: AppStateService\n ) {\n this.storage = {\n local: new UserPreferencesStorageLocal(),\n inventory: new UserPreferencesStorageInventory(this.inventory)\n };\n this.currentUser = this.appState.currentUser;\n }\n\n get(key): Observable<any> {\n return this.currentUser.pipe(\n first(),\n switchMap((user) => this.getForUser(key, user))\n );\n }\n\n set(key, value): Promise<any> {\n return new Promise((resolve, reject) => {\n this.currentUser.pipe(\n first()\n ).subscribe((user) => {\n resolve(this.setForUser(key, value, user));\n }, reject);\n });\n }\n\n getForUser(key, user): Observable<any> {\n const rawKey = this.getRawKey(key, user);\n const storage = this.getStorage(user);\n return from(storage.get(rawKey));\n }\n\n setForUser(key, value, user): Promise<any> {\n const rawKey = this.getRawKey(key, user);\n const storage = this.getStorage(user);\n return Promise.resolve(storage.set(rawKey, value));\n }\n\n private getRawKey(key, user) {\n const username = user.userName.replace(/\\./g, '__');\n return `${key}${username}`;\n }\n\n private getStorage(user) {\n return this.user.hasAllRoles(user, ['ROLE_INVENTORY_READ', 'ROLE_INVENTORY_ADMIN']) ?\n this.storage.inventory : this.storage.local;\n }\n\n}\n","import { CommonModule as NgCommonModule } from '@angular/common';\nimport { APP_INITIALIZER, InjectionToken, NgModule } from '@angular/core';\nimport { DataModule } from '@c8y/ngx-components/api';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { distinctUntilChanged, filter, map, startWith, switchMap } from 'rxjs/operators';\nimport { I18nModule } from '../i18n/i18n.module';\nimport { TranslateService } from '../i18n/translate.service';\nimport { DatePipe } from './date.pipe';\nimport { ForOfDirective } from './forOf.directive';\nimport { HumanizeAppNamePipe } from './humanize-app-name.pipe';\nimport { HumanizePipe } from './humanize.pipe';\nimport { IconDirective, ICONS } from './icon.directive';\nimport { IfAllowedDirective } from './if-allowed.directive';\nimport { LoadMoreComponent } from './load-more.component';\nimport { LoadingComponent } from './loading.component';\nimport { MapFunctionPipe } from './map-function.pipe';\nimport { HOOK_OPTIONS, OptionsService } from './options.service';\nimport { OutletDirective } from './outlet.directive';\nimport { Permissions } from './permissions.service';\nimport { ProgressBarComponent } from './progress-bar.component';\nimport { ShortenUserNamePipe } from './shorten-user-name.pipe';\nimport { TenantUiService } from './tenant-ui.service';\nimport { AppStateService } from './ui-state.service';\nimport { UserPreferencesService } from './user-preferences/user-preferences.service';\n\nexport function initializeServices(\n translateService: TranslateService,\n state: AppStateService,\n userPreferences: UserPreferencesService\n) {\n const initialize = () => {\n const queryStringLanguage = translateService.queryStringLang();\n const firstLanguage = translateService.firstSupportedLanguage();\n\n /*\n The ?lang parameter will prevent the user preference language from being activated\n */\n if (queryStringLanguage && translateService.getSupported(queryStringLanguage)) {\n translateService.switchToLanguage(queryStringLanguage);\n } else {\n state.currentUser\n .pipe(\n map(user => user && user.userName),\n filter(u => !!u),\n distinctUntilChanged(),\n switchMap(() => userPreferences.get('language')),\n startWith(firstLanguage),\n filter(lang => !!lang),\n distinctUntilChanged()\n )\n .subscribe(lang => {\n translateService.switchToLanguage(lang);\n });\n }\n };\n return initialize;\n}\n\nexport const ICON_LIST = new InjectionToken('iconList');\n\n/**\n * Commonly used directives, data access and translation. This module is the shared\n * module across all core components. It should be imported by default.\n *\n * @exports IconDirective A directive to set a c8y icon with [c8yIcon]=\"'rocket'\".\n * @exports OutletDirective A directive which allows to set DOM or Angular templates (used for upgrade).\n * @exports I18nModule Translation module.\n * @exports NgCommonModule Angular common module.\n * @exports DataModule The data layer to allow DI with @c8y/client\n * @exports HumanizeAppNamePipe Humanize an application name (e.g. in the app switcher)\n * @exports HumanizePipe Humanize a word. E.g. `device management` gets `Device management`\n * @exports ShortenUserNamePipe Allows a short name. E.g. `Foo Bar` gets `F. Bar`\n * @exports ForOfDirective A forOf directive like ngFor but with load-more function\n * @exports LoadMoreComponent A component to load more data from a certain data-source\n * @exports ProgressBarComponent Displays either defined or undefined progress.\n */\n@NgModule({\n imports: [NgCommonModule, I18nModule, TooltipModule],\n exports: [\n IconDirective,\n OutletDirective,\n I18nModule,\n NgCommonModule,\n HumanizeAppNamePipe,\n HumanizePipe,\n IfAllowedDirective,\n ShortenUserNamePipe,\n ForOfDirective,\n LoadMoreComponent,\n MapFunctionPipe,\n ProgressBarComponent,\n DatePipe,\n LoadingComponent\n ],\n declarations: [\n IconDirective,\n OutletDirective,\n HumanizePipe,\n HumanizeAppNamePipe,\n IfAllowedDirective,\n ShortenUserNamePipe,\n ForOfDirective,\n LoadMoreComponent,\n MapFunctionPipe,\n ProgressBarComponent,\n DatePipe,\n LoadingComponent\n ],\n entryComponents: [LoadMoreComponent]\n})\nexport class CommonModule {\n static providers() {\n return [\n ...DataModule.providers(),\n // TODO: maybe we can think of a way to remove this C8Y_APP global\n { provide: HOOK_OPTIONS, useValue: (window as any).C8Y_APP || {}, multi: true },\n {\n provide: APP_INITIALIZER,\n useFactory: initializeServices,\n deps: [TranslateService, AppStateService, UserPreferencesService],\n multi: true\n },\n { provide: ICON_LIST, useValue: ICONS, multi: false },\n ...I18nModule.providers(),\n UserPreferencesService,\n OptionsService,\n AppStateService,\n Permissions,\n TenantUiService,\n HumanizePipe,\n HumanizeAppNamePipe,\n ShortenUserNamePipe,\n MapFunctionPipe,\n DatePipe\n ];\n }\n\n static forRoot() {\n return {\n ngModule: CommonModule,\n providers: CommonModule.providers()\n };\n }\n}\n","import { OperationStatus } from '@c8y/client';\n\nexport enum Status {\n SUCCESS = 'success',\n WARNING = 'warning',\n DANGER = 'danger',\n INFO = 'info'\n}\n\nexport type StatusType = Status | 'success' | 'warning' | 'danger' | 'info';\n\nexport const statusIcons = {\n [Status.SUCCESS]: 'check-circle',\n [Status.WARNING]: 'exclamation-triangle',\n [Status.DANGER]: 'exclamation-circle',\n [Status.INFO]: 'info-circle'\n};\n\nexport const statusClasses = {\n [Status.SUCCESS]: `text-${Status.SUCCESS}`,\n [Status.WARNING]: `text-${Status.WARNING}`,\n [Status.DANGER]: `text-${Status.DANGER}`,\n [Status.INFO]: `text-${Status.INFO}`\n};\n\nexport const statusAlert = {\n [Status.SUCCESS]: `alert-${Status.SUCCESS}`,\n [Status.WARNING]: `alert-${Status.WARNING}`,\n [Status.DANGER]: `alert-${Status.DANGER}`,\n [Status.INFO]: `alert-${Status.INFO}`\n};\n\nexport const operationStatusIcons = {\n [OperationStatus.PENDING]: 'clock-o',\n [OperationStatus.EXECUTING]: 'refresh',\n [OperationStatus.SUCCESSFUL]: 'check-circle',\n [OperationStatus.FAILED]: 'exclamation-circle'\n};\n\nexport const operationStatusClasses = {\n [OperationStatus.PENDING]: 'text-info',\n [OperationStatus.EXECUTING]: 'text-info',\n [OperationStatus.SUCCESSFUL]: 'text-success',\n [OperationStatus.FAILED]: 'text-danger'\n};\n","import { Component, HostBinding, Input, AfterContentInit } from '@angular/core';\nimport { filter, sortBy } from 'lodash-es';\nimport { ActionBarItem } from './action-bar.model';\n\n/**\n * This component is used as the outlet to show the action bars.\n * In a c8ycli app it is by default placed on the bootstrap component.\n */\n@Component({\n selector: 'c8y-action-bar',\n templateUrl: './action-bar.component.html',\n host: { class: 'c8y-ui-action-bar' }\n})\nexport class ActionBarComponent {\n /**\n * Identifies if the navigator is opened. If yes, the action-bar\n * needs to move to the right.\n */\n @Input() @HostBinding('class.navigator-open') navigatorOpen = false;\n\n /**\n * Identifies if the current view has tabs. If yes, the action bar needs\n * to move down.\n */\n @Input() @HostBinding('class.has-tabs') hasTabs = false;\n\n /**\n * Identifies if the tabs are aligned horizontally. If yes, the tabs don't\n * need to move to the left.\n */\n @Input() @HostBinding('class.horizontal-tabs') isTabsHorizontal = false;\n\n /**\n * Identifies if in a mobile view the toolbar is expanded or not.\n */\n isPageToolbarExpanded = false;\n\n /**\n * Adds the default `c8y-ui-action-bar` class.\n */\n @HostBinding('class.c8y-ui-action-bar') uiActionBar = true;\n\n /**\n * The current items to display in the ActionBar.\n */\n @Input() items: ActionBarItem[] = [];\n\n /**\n * Returns true if no items are present and hides the action bar.\n */\n @HostBinding() get hidden() {\n return !(this.items && this.items.length);\n }\n\n /**\n * Returns the items sorted by priority and grouped by the placement passed.\n * @param {placement} Which placement should be returned sorted.\n */\n getSortedItems(placement: 'left' | 'right' | 'more') {\n return sortBy(filter(this.items, { placement }), this.byPriority);\n }\n\n private byPriority(item) {\n return -item.priority;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CollapseModule } from 'ngx-bootstrap/collapse';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { CommonModule } from '../common/common.module';\nimport { ActionBarItemComponent } from './action-bar-item.component';\nimport { ActionBarComponent } from './action-bar.component';\n\n/**\n * An action bar can be added with content projection or multi provider\n * extension. It allows to show them in three positions (left, right\n * or more). The actions placed here are always local actions to the\n * current route like \"add device\" or \"lock dashboard\".\n *\n * @example\n * ```html\n * <c8y-action-bar-item [placement]=\"'right'\">\n * <button class=\"btn btn-link\" (click)=\"addRandom()\"><i class=\"fa fa-plus\"></i> Add random</button>\n * </c8y-action-bar-item>\n * ```\n * @exports ActionBarComponent The outlet component\n * @exports ActionBarItemComponent The items to add with cp.\n */\n@NgModule({\n declarations: [ActionBarComponent, ActionBarItemComponent],\n imports: [BsDropdownModule, CommonModule, CollapseModule, RouterModule.forChild([])],\n exports: [ActionBarComponent, ActionBarItemComponent]\n})\nexport class ActionBarModule {}\n","import { Injector, Injectable, InjectionToken } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { StateService } from '../common/state-service.abstract';\nimport { Action, ActionFactory } from './action.model';\nimport {\n fromTrigger,\n ExtensionPoint,\n stateToFactory,\n sortByPriority\n} from '../common/extension-hooks';\nimport { map, shareReplay } from 'rxjs/operators';\n\n/**\n * A hook to use for Multi Provider extension.\n */\nexport const HOOK_ACTION = new InjectionToken('ActionFactory');\n\n/**\n * A service which defines global actions.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ActionService extends StateService implements ExtensionPoint<Action> {\n items$: Observable<Action[]>;\n readonly refreshTrigger = new Subject();\n readonly state$ = new BehaviorSubject<Set<Action>>(new Set<Action>());\n\n constructor(private injector: Injector, router: Router) {\n super();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_ACTION, []),\n stateToFactory(this.state$)\n ]).pipe(\n map((items: Action[]) => sortByPriority(items)),\n shareReplay(1)\n );\n }\n\n /**\n * Refresh the extension factories\n */\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state(): Set<Action> {\n return this.state$.value;\n }\n\n /**\n * Adds a new item to the actions in the header and emits a state change.\n * @param item The item to add.\n */\n add(item: Action) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes an action from the header and emits a state change.\n * @param item The item to remove.\n */\n remove(item: Action) {\n this.state.delete(item);\n this.emitNewState();\n }\n}\n","import { Component, Input } from '@angular/core';\nimport { Action } from './action.model';\nimport { sortBy } from 'lodash-es';\n\n@Component({\n selector: 'c8y-action-outlet',\n templateUrl: './action-outlet.component.html'\n})\n\nexport class ActionOutletComponent {\n isPageToolbarExpanded = false;\n @Input() items: Action[] = [];\n\n getByPriority() {\n return sortBy(this.items, this.byPriority);\n }\n\n invoke(action) {\n if (action.action) {\n action.action.call();\n }\n }\n\n private byPriority(item) {\n return -item.priority;\n }\n}\n","import { Component, Input, ViewChild } from '@angular/core';\nimport { Action } from './action.model';\nimport { ActionService } from './action.service';\n\n@Component({\n selector: 'c8y-action',\n templateUrl: './action.component.html'\n})\nexport class ActionComponent implements Action {\n @Input() disabled: boolean = false;\n @Input() label: string;\n @Input() priority: number = 0;\n @Input() icon: string;\n @ViewChild('template', {static: false}) template: any;\n action: () => void;\n private viewInitTimeout;\n\n constructor(private actionService: ActionService) {}\n\n ngAfterViewInit() {\n this.viewInitTimeout = setTimeout(() =>\n this.actionService.add(this as Action)\n );\n }\n\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.actionService.remove(this as Action);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { CommonModule } from '../common/common.module';\nimport { ActionOutletComponent } from './action-outlet.component';\nimport { ActionComponent } from './action.component';\nimport { ActionService } from './action.service';\n\n/**\n * The angular module definition for actions.\n * @exports ActionComponent\n * @exports ActionOutletComponent\n */\n@NgModule({\n declarations: [\n ActionOutletComponent,\n ActionComponent\n ],\n imports: [\n CommonModule,\n BsDropdownModule,\n RouterModule.forChild([])\n ],\n exports: [\n ActionOutletComponent,\n ActionComponent\n ]\n})\nexport class ActionModule { }\n","import { Alert } from './alert.model';\nimport { BehaviorSubject } from 'rxjs';\nimport { Injectable } from '@angular/core';\nimport { StateService } from '../common/state-service.abstract';\nimport { gettext } from '../i18n/gettext';\nimport {IResult} from '@c8y/client';\n\ntype alertType = 'success' | 'warning' | 'danger' | 'info' | 'system';\n/**\n * A service which allows to display alerts.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class AlertService extends StateService {\n /**\n * Returns all alerts.\n * @readonly\n */\n get state() {\n return this.state$.value;\n }\n /**\n * @ignore\n */\n state$ = new BehaviorSubject<Alert[]>([]);\n\n private MAX_ALERTS = 3;\n private ALERT_TIMEOUT = 3000;\n\n /**\n * Adds a new alert to the current state.\n */\n add(alert: Alert) {\n this.addAlert(alert);\n }\n\n /**\n * Adds a alert by text.\n */\n addByText(type: alertType, txt: string, detailedData?: string): void {\n this.addAlert({ text: txt, type, detailedData });\n }\n\n /**\n * Returns all alerts.\n * @deprecated Use alertService.alerts instead.\n */\n list(): Alert[] {\n return this.state;\n }\n\n /**\n * Remove an alert from the current state.\n */\n remove(alert: Alert) {\n this.changeAlerts(this.state.filter(item => !this.areSame(alert, item)));\n }\n\n /**\n * Updates matching alert with provided values.\n */\n update(alert: Alert, fieldsToUpdate: Partial<Alert>) {\n this.changeAlerts(\n this.state.map(item => {\n if (this.areSame(alert, item)) {\n Object.assign(item, fieldsToUpdate);\n }\n return item;\n })\n );\n }\n\n /**\n * Removes last danger alert.\n * It can be used e.g. in the case of a failed request which triggered an alert, to hide it from user.\n *\n * ```js\n * try {\n * // something that might throw a danger server msg\n * } catch (ex) {\n * this.alertService.removeLastDanger();\n * }\n * ```\n */\n removeLastDanger() {\n const firstDangerAlert = this.state.reverse().find(({ type }) => type === 'danger');\n this.changeAlerts(this.state.filter(alert => alert !== firstDangerAlert));\n }\n\n /**\n * Shorthand for a save successful alert.\n * @param savedObject The object which was saved.\n * @return A function that can be executed to show the msg.\n */\n saveSuccess(savedObject: string) {\n return () => {\n const text = `${savedObject} saved successfully`;\n this.addByText('success', text);\n };\n }\n\n /**\n * Shorthand for a create successful alert.\n * @param createdObject The object which was created.\n * @return A function that can be executed to show the msg.\n */\n createSuccess(createdObject) {\n return () => {\n const text = `${createdObject} created successfully`;\n this.addByText('success', text);\n };\n }\n\n /**\n * Clears all alerts.\n */\n clearAll() {\n this.changeAlerts([]);\n }\n\n /**\n * A shorthand to display a simple success message.\n * @param text The success text.\n * @param detailedData The text with additional information.\n */\n success(text: string, detailedData?: string) {\n this.addByText('success', text, detailedData);\n }\n\n /**\n * A shorthand to display a simple danger message.\n * @param text The danger text.\n * @param detailedData The text with additional information.\n */\n danger(text: string, detailedData?: string) {\n this.addByText('danger', text, detailedData);\n }\n\n /**\n * A shorthand to display a simple info message.\n * @param text The info text.\n * @param detailedData The text with additional information.\n */\n info(text: string, detailedData?: string) {\n this.addByText('info', text, detailedData);\n }\n\n /**\n * A shorthand to display a simple warning message.\n * @param text The warning text.\n * @param detailedData The text with additional information.\n */\n warning(text: string, detailedData?: string) {\n this.addByText('warning', text, detailedData);\n }\n\n /**\n * Creates alert from standard api errors.\n * Should be used for errors generated by @c8y/client services.\n * @param {IResult} error The error from server.\n * @param {alertType} type The type of alert.\n */\n addServerFailure(error: any, type: alertType = 'danger') {\n const { data, res } = error;\n let text = data && data.message ? data.message : null;\n let detailedData;\n if (data) {\n if (typeof data === 'object') {\n detailedData = data.exceptionMessage;\n } else if (typeof data === 'string') {\n detailedData = data;\n }\n }\n const hasRelevantMessage = !!(text || detailedData);\n if (!text) {\n text = gettext('A server error occurred.');\n }\n if (!hasRelevantMessage) {\n detailedData = {\n status: res.status,\n statusText: res.statusText,\n url: res.url\n };\n }\n\n this.addAlert({\n type,\n text,\n detailedData\n });\n }\n\n /**\n * Compares two alert objects. Alerts are same if text, type, detailed data and callbacks are same.\n * Callbacks are same if they refer to the same function.\n */\n areSame(alert1: Alert, alert2: Alert): boolean {\n return (\n alert1.text === alert2.text &&\n alert1.type === alert2.type &&\n alert1.detailedData === alert2.detailedData &&\n alert1.onClose === alert2.onClose &&\n alert1.onDetail === alert2.onDetail\n );\n }\n\n private changeAlerts(newAlerts: Alert[]) {\n this.state$.next(newAlerts);\n }\n\n private addAlert(alert: Alert): void {\n if (!alert.text && !alert.type) {\n throw new Error('Cannot add empty alert');\n }\n\n const alertAlreadyAdded = this.state.find(item => this.areSame(alert, item));\n if (alertAlreadyAdded) {\n return;\n }\n\n this.changeAlerts([...this.state, alert]);\n this.hideAutomaticallyIfNeeded(alert);\n this.removeOldestIfMax();\n }\n\n private hideAutomaticallyIfNeeded(alert: Alert) {\n const isSuccess = alert.type === 'success';\n const noDetails = !alert.detailedData;\n let alertTimeout = isSuccess && noDetails ? this.ALERT_TIMEOUT : 0;\n if (typeof alert.timeout !== 'undefined') {\n alertTimeout = alert.timeout;\n }\n if (alertTimeout) {\n setTimeout(() => this.remove(alert), alertTimeout);\n }\n }\n\n private removeOldestIfMax() {\n if (this.state.length > this.MAX_ALERTS) {\n const [, ...firstRemoved] = this.state;\n this.changeAlerts(firstRemoved);\n }\n }\n}\n","import { Component } from '@angular/core';\n\n/**\n * The content of `c8y-alert-details` component will be displayed as alert's details.\n * This component must be placed inside `c8y-alert` component.\n */\n@Component({\n selector: 'c8y-alert-details',\n template: `<ng-content></ng-content>`\n})\n\nexport class AlertDetailsComponent {}\n","import { Component, OnDestroy, Input, ViewChild, ContentChild } from '@angular/core';\nimport { Alert } from './alert.model';\nimport { AlertService } from './alert.service';\nimport { AlertDetailsComponent } from './alert-details.component';\n\n/**\n * Alert component allows creating alert with complex view.\n */\n\n@Component({\n selector: 'c8y-alert',\n templateUrl: './alert.component.html'\n})\n\nexport class AlertComponent implements OnDestroy, Alert {\n\n /**\n * The type of the alert.\n */\n @Input() type: 'success' | 'warning' | 'danger' | 'info' | 'system';\n /**\n * Function to call if user clicks on the detail button.\n */\n @Input() onDetail: () => void;\n /**\n * Function to call if user clicks on the close button.\n */\n @Input() onClose: () => void;\n /**\n * Detailed information to display.\n */\n @ViewChild('detailedData', {static: false}) detailedData;\n /**\n * The text templateRef to display message.\n */\n @ViewChild('text', {static: false}) text;\n /**\n * Content of AlertDetailsComponent is displayed as alertDetails.\n */\n @ContentChild(AlertDetailsComponent, {static: false}) containDetailsComponent: AlertDetailsComponent;\n /**\n * @ignore\n */\n private viewInitTimeout;\n\n /**\n * @ignore\n */\n constructor(public alertService: AlertService) {}\n\n /**\n * AlertComponent adds new alert to collection stored in alertService after view init.\n */\n ngAfterViewInit() {\n if (!this.containDetailsComponent) {\n this.detailedData = null;\n }\n this.viewInitTimeout = setTimeout(() =>\n this.alertService.add(this)\n );\n }\n\n /**\n * AlertComponent removes alert from collection stored in alertService on destroy component.\n */\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.alertService.remove(this);\n }\n}\n","import { Component, TemplateRef, Attribute, HostBinding } from '@angular/core';\nimport { Alert } from './alert.model';\nimport { AlertService } from './alert.service';\nimport { BehaviorSubject } from 'rxjs';\n\n/**\n * Alert outlet component shows all added alerts. It is used in the application's `c8y-bootstrap` component.\n *\n * For applications which don’t use `c8y-bootstrap` component but want to display alerts via AlertService, a c8y-alert-outlet component needs to be added explicitly in the template.\n *\n * ## Example:\n * ```html\n * <div class=\"alerts\">\n * <c8y-alert-outlet></c8y-alert-outlet>\n * </div>\n * ```\n */\n@Component({\n selector: 'c8y-alert-outlet',\n templateUrl: './alert-outlet.component.html'\n})\nexport class AlertOutletComponent {\n /**\n * Currently displayed details of an alert. Only one alert’s details can be displayed at a time.”\n */\n detailDisplayedAlert: any = {};\n /**\n * @ignore\n */\n @HostBinding('class.static') isStatic = false;\n /**\n * The array of current alerts.\n */\n get alerts(): BehaviorSubject<Alert[]> {\n return this.alertService.state$;\n }\n /**\n * @ignore\n */\n constructor(\n @Attribute('position') private position: string,\n public alertService: AlertService\n ) {\n this.isStatic = this.position === 'static';\n }\n /**\n * Returns a CSS class for an alert depending on its type to style the corresponding alert component.\n */\n getClass(alert: Alert) {\n const classes = [];\n if (alert.type !== 'danger') {\n classes.push('interact');\n }\n classes.push(`alert-${alert.type}`);\n return classes.join(' ');\n }\n /**\n * Executes alert’s onClose method, if provided, and closes the alert.\n * @param alert The alert which will be closed.\n */\n close(alert: Alert) {\n if (alert.onClose) {\n alert.onClose();\n }\n this.alertService.remove(alert);\n }\n /**\n * Expands details part of particular alert, and collapses details for another alerts.\n * @param alert The alert which details should be expanded.\n */\n showDetails(alert: Alert) {\n if (alert.onDetail) {\n return alert.onDetail();\n }\n this.detailDisplayedAlert = Object.assign({}, alert);\n this.detailDisplayedAlert.mode = 'raw';\n this.setDetailsContent(alert);\n }\n /**\n * Returns true if alert has extra detailedData or defines custom onDetail method.\n */\n hasDetails(alert: Alert) {\n return (alert.detailedData || alert.onDetail);\n }\n /**\n * Collapses alert's details.\n */\n closeDetails() {\n this.detailDisplayedAlert = {};\n }\n /**\n * Returns true if details part of alert is expanded.\n */\n isDetailsShow(alert: Alert) {\n return this.alertService.areSame(alert, this.detailDisplayedAlert);\n }\n /**\n * @ignore\n */\n isTemplateRef(value): boolean {\n return value instanceof TemplateRef;\n }\n /**\n * @ignore\n */\n template(content): any {\n return this.isTemplateRef(content) ? content : undefined;\n }\n private setDetailsContent(alert: Alert) {\n if ( this.isTemplateRef(alert.detailedData) || typeof alert.detailedData === 'string' ) {\n this.detailDisplayedAlert.contents = alert.detailedData;\n } else {\n this.detailDisplayedAlert.contents = JSON.stringify(alert.detailedData, null, 2);\n }\n }\n}\n","import { Component } from '@angular/core';\n\n/**\n * The content of `c8y-alert-text` component will be displayed as alert's text.\n * This component must be placed inside `c8y-alert` component.\n */\n@Component({\n selector: 'c8y-alert-text',\n template: `<ng-content></ng-content>`\n})\n\nexport class AlertTextComponent {}\n","import { NgModule } from '@angular/core';\nimport { AlertDetailsComponent } from './alert-details.component';\nimport { AlertOutletComponent } from './alert-outlet.component';\nimport { AlertTextComponent } from './alert-text.component';\nimport { AlertComponent } from './alert.component';\nimport { CommonModule } from '../common/common.module';\n\n/**\n * Alert module is used for displaying status messages to the user e.g. danger, success, warning and info alerts.\n */\n@NgModule({\n imports: [\n CommonModule\n ],\n exports: [\n AlertOutletComponent,\n AlertComponent,\n AlertDetailsComponent,\n AlertTextComponent\n ],\n declarations: [\n AlertOutletComponent,\n AlertComponent,\n AlertDetailsComponent,\n AlertTextComponent\n ]\n})\nexport class AlertModule { }\n","import { TemplateRef, Type } from '@angular/core';\nimport { matches, snakeCase } from 'lodash-es';\nimport { NavigatorNodeData } from './navigator-node-data';\nimport { PopoverConfirmComponent } from '../modal/popover-confirm.component';\n\nexport interface ClickOptions {\n icon?: boolean;\n expander?: boolean;\n open?: boolean;\n $event?: any; // TODO: add proper type\n}\n\nexport class NavigatorNode {\n icon: string;\n iconTemplate?: TemplateRef<any>;\n iconComponent?: Type<any>;\n children: NavigatorNode[] = [];\n label;\n path: string;\n parents: NavigatorNode[] = [];\n loading?: boolean;\n routerLinkExact: boolean = true;\n open: boolean = false;\n hidden: boolean = false;\n draggable: boolean = false;\n droppable: boolean = false;\n dragged = false;\n draggedHover = false;\n confirm: PopoverConfirmComponent = undefined;\n private _priority: number = 0;\n private expandDragTimeout;\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n get id() {\n return 'navigator_node_' + snakeCase(this.label);\n }\n\n get priority() {\n if (this._priority) {\n return this._priority;\n } else {\n const childrenPriorities = this.children.map(({ priority }) => priority || 0);\n if (childrenPriorities.length) {\n return childrenPriorities.length ? Math.max(...childrenPriorities) : 0;\n }\n return 0;\n }\n }\n\n set priority(priority) {\n this._priority = priority;\n }\n\n constructor(data?: NavigatorNodeData) {\n this.update(data);\n }\n\n openOnStart(url: string) {\n return false;\n }\n\n add(node: NavigatorNode) {\n if (node === this) {\n throw new Error('Adding node to itself');\n }\n if (this.children.indexOf(node) === -1) {\n this.children.push(node);\n }\n if (node.parents.indexOf(this) === -1) {\n node.parents.push(this);\n }\n this.updateChildren();\n }\n\n remove(node: NavigatorNode) {\n const ix = this.children.indexOf(node);\n const pix = node.parents.indexOf(this);\n if (ix > -1) {\n this.children.splice(ix, 1);\n }\n if (pix > -1) {\n node.parents.splice(pix, 1);\n }\n this.updateChildren();\n }\n\n update(data?: NavigatorNodeData) {\n if (data) {\n Object.assign(this, data);\n if (data.hidden !== undefined) {\n this.parents.forEach(p => {\n p.updateHidden();\n });\n }\n }\n }\n\n find(predicate) {\n if (typeof predicate === 'string') {\n const compareLabel = predicate.toLocaleLowerCase();\n predicate = ({ label }) => compareLabel === label.toLowerCase();\n }\n if (typeof predicate === 'object') {\n predicate = matches(predicate);\n }\n if (typeof predicate !== 'function') {\n throw new Error('Invalid search predicate');\n }\n return this.children.reduce(\n (found, child) => found || child.find(predicate),\n this.children.find(predicate)\n );\n }\n\n empty() {\n this.children.length = 0;\n }\n\n click(options: ClickOptions = {}) {\n // do nothing\n }\n\n drop($event) {\n $event.stopPropagation();\n clearTimeout(this.expandDragTimeout);\n }\n\n dragStart($event) {\n $event.stopPropagation();\n // we can't pass a object to setData, so we do it via service\n // set data is still needed, to make the drag&drop work\n $event.dataTransfer.setData('node', 'node');\n this.dragged = true;\n }\n\n dragEnd($event) {\n $event.stopPropagation();\n this.dragged = false;\n $event.dataTransfer.clearData();\n }\n\n get canDrop() {\n return this.droppable;\n }\n\n get canNavigate() {\n return typeof this.path !== 'undefined';\n }\n\n dragEnter($event) {\n $event.preventDefault();\n $event.stopPropagation();\n this.draggedHover = true;\n if (!this.open) {\n this.expandDragTimeout = setTimeout(() => this.expand(), 1000);\n }\n }\n\n dragLeave($event) {\n $event.preventDefault();\n $event.stopPropagation();\n this.draggedHover = false;\n clearTimeout(this.expandDragTimeout);\n }\n\n expand() {\n if (!this.open) {\n this.open = true;\n this.click({ open: true, expander: true });\n }\n }\n\n traverse(callback) {\n if (this.children) {\n this.children.forEach(child => {\n callback(child);\n child.traverse(callback);\n });\n }\n }\n\n destroy() {\n // nothing todo here\n }\n\n protected updateChildren() {\n this.sort();\n this.updateHidden();\n }\n\n protected sort() {\n this.children.sort((a, b) => {\n if (a.priority > b.priority) {\n return -1;\n } else if (a.priority < b.priority) {\n return 1;\n } else if ((a.label || '').toLowerCase() < (b.label || '').toLowerCase()) {\n return -1;\n } else if ((a.label || '').toLowerCase() > (b.label || '').toLowerCase()) {\n return 1;\n } else {\n return 0;\n }\n });\n }\n\n protected updateHidden() {\n if (typeof this.path === 'undefined') {\n this.hidden = !this.children.some(({ hidden }) => !hidden);\n }\n }\n}\n","import { NavigatorNode } from './navigator-node';\nimport { NavigatorNodeData } from './navigator-node-data';\nimport { assign } from 'lodash-es';\n\nexport class NavigatorNodeRoot extends NavigatorNode {\n addRoot(nodeData: Partial<NavigatorNodeData>) {\n const { parent } = nodeData;\n const node = this.createNode(nodeData);\n let localParent;\n\n if (parent) {\n if (typeof parent === 'object') {\n localParent = this.find(parent.label);\n if (localParent) {\n localParent.update(parent);\n }\n } else if (typeof parent === 'string' || typeof parent === 'function') {\n localParent = this.find(parent);\n }\n\n if (!localParent) {\n localParent = this.createNode(parent);\n if (!this.find((n) => localParent === n)) {\n this.add(localParent);\n }\n }\n }\n\n (localParent || this).add(node);\n return node;\n }\n\n createNode(nodeData) {\n if (nodeData instanceof NavigatorNode) {\n return nodeData;\n }\n if (typeof nodeData === 'string') {\n return new NavigatorNode({ label: nodeData });\n }\n if (typeof nodeData === 'object') {\n return new NavigatorNode({ ...nodeData, parent: undefined });\n }\n throw new Error('Wrong type of node data');\n }\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport { ExtensionPoint, fromTrigger, sortByPriority, stateToFactory } from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport { NavigatorNode } from './navigator-node';\nimport { NavigatorNodeData } from './navigator-node-data';\nimport { NavigatorNodeRoot } from './navigator-node-root';\n\n/**\n * A hook to use for Multi Provider extension.\n */\nexport const HOOK_NAVIGATOR_NODES = new InjectionToken('NavigatorNodesFactory');\n\n/**\n * A service which defines the navigator.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class NavigatorService extends StateService implements ExtensionPoint<NavigatorNode> {\n items$: Observable<NavigatorNode[]>;\n readonly refreshTrigger = new Subject();\n readonly state$ = new BehaviorSubject<Set<NavigatorNode>>(new Set<NavigatorNode>());\n firstUrl = true;\n\n constructor(\n private injector: Injector,\n private router: Router\n ) {\n super();\n const rootNode = new NavigatorNodeRoot();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_NAVIGATOR_NODES, []),\n stateToFactory(this.state$),\n ]).pipe(\n map((nodes: Partial<NavigatorNodeData[]>) => {\n const noParent = nodes.filter(node => !node.parent);\n const withParent = nodes.filter(node => node.parent);\n\n // Based on the sortedNodes array, the nodes are sequentially created.\n // Nodes sorting is done in two steps to have the top-level nodes first.\n // This way, by the time we are adding a child node, the parent node is already present.\n const sortedNodes = sortByPriority(noParent).concat(sortByPriority(withParent));\n rootNode.empty();\n sortedNodes.forEach((node) => rootNode.addRoot(node));\n return rootNode.children;\n }),\n shareReplay(1)\n );\n }\n\n openOnFirstUrl(node: NavigatorNode) {\n if (this.firstUrl && !!node.path) {\n return this.router.isActive(node.path, node.routerLinkExact) || node.openOnStart(this.router.url);\n }\n return false;\n }\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state(): Set<NavigatorNode> {\n return this.state$.value;\n }\n\n /**\n * Refresh the extension factories\n */\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n /**\n * Adds a new node to the navigator.\n * @param nav The node to add.\n */\n add(item: NavigatorNode) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes a node from the navigator.\n * @param nav The node ro remove.\n */\n remove(item: NavigatorNode) {\n this.state.delete(item);\n this.emitNewState();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable, of } from 'rxjs';\nimport { distinctUntilChanged, map, combineLatest, delay, debounceTime } from 'rxjs/operators';\nimport { OptionsService } from '../common/options.service';\nimport { StateService } from '../common/state-service.abstract';\nimport { NavigatorService } from '../navigator/navigator.service';\nimport { Header } from './header.model';\n\n/**\n * A service which defines header functions.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class HeaderService extends StateService {\n header$: Observable<Header>;\n navigatorOpen$: Observable<boolean>;\n readonly DELAY_TO_AVOID_FLICKERING_ON_ASYNC_NODES = 1000;\n\n hasItemsInNavigator$ = this.navigatorService.items$.pipe(\n delay(this.DELAY_TO_AVOID_FLICKERING_ON_ASYNC_NODES),\n map(({ length }) => !!length),\n distinctUntilChanged()\n );\n\n state$: BehaviorSubject<Header> = new BehaviorSubject<Header>({\n title: undefined,\n nav: {\n open: false\n }\n });\n\n title = undefined;\n\n constructor(private navigatorService: NavigatorService, private options: OptionsService) {\n super();\n this.header$ = this.map((header: Header) => header);\n this.navigatorOpen$ = this.map(({ nav }) => nav.open).pipe(\n combineLatest(this.hasItemsInNavigator$),\n map(([open, hasItems]) => open && hasItems)\n );\n const titleReference = document.querySelector('title');\n this.title = {\n elementRef: titleReference,\n originalValue: titleReference && titleReference.innerText\n };\n }\n\n get state() {\n return this.state$.value;\n }\n\n get navigatorHiddenOnStartup() {\n return this.options.hideNavigator;\n }\n\n get largeWidth() {\n return document.documentElement.clientWidth > 1200;\n }\n\n get shouldToggle() {\n return this.largeWidth && !this.navigatorHiddenOnStartup && !this.state.nav.open;\n }\n\n /**\n * Toggles the navigator open status.\n */\n toggleNavigator() {\n this.state.nav.open = !this.state.nav.open;\n this.emitNewState();\n }\n\n /**\n * Force to close the navigator.\n */\n closeNavigator() {\n this.state.nav.open = false;\n this.emitNewState();\n }\n\n /**\n * Configures navigation options.\n * @param config Object with the properties:\n * - open: Boolean\n */\n configNavigator(config: any = {}) {\n this.state.nav = Object.assign(this.state.nav, config);\n this.emitNewState();\n }\n\n /**\n * Change the application title.\n * @param newTitle The new title of the application.\n */\n changeTitle(newTitle?: any, pageTitleUpdate: boolean = true) {\n this.state.title = newTitle;\n this.state.pageTitleUpdate = pageTitleUpdate;\n\n this.emitNewState();\n }\n\n /**\n * Change the page title.\n * @param newTitle The new title of the page.\n */\n changePageTitle(newTitle?: string) {\n this.title.elementRef.innerText = newTitle\n ? `${newTitle} / ${this.title.originalValue}`\n : `${this.title.originalValue}`;\n }\n\n /**\n * This methods checks if the navigator toggles on startup\n * or if an item is added to the navigator node.\n * Delay of 300ms is intended for animation purpose.\n */\n verifyIfNavOpen() {\n this.hasItemsInNavigator$\n .pipe(debounceTime(300))\n .subscribe(hasItems => hasItems && this.shouldToggle && this.toggleNavigator());\n }\n\n shouldShowBreadcrumbs() {\n return this.options.breadcrumbs;\n }\n}\n","import { Injectable, InjectionToken, Injector, ViewContainerRef } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { TranslateService } from '@ngx-translate/core';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { distinctUntilChanged, filter, first, map, shareReplay } from 'rxjs/operators';\nimport { ExtensionPoint, fromTrigger, stateToFactory } from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport { Tab } from './tab.model';\nimport { OptionsService } from '../common/options.service';\n\nexport const HOOK_TABS = new InjectionToken('TabsFactory');\n\n@Injectable({\n providedIn: 'root'\n})\nexport class TabsService extends StateService implements ExtensionPoint<Tab> {\n items$: Observable<Tab[]>;\n orientation$: Observable<string>;\n readonly refreshTrigger = new Subject();\n readonly state$ = new BehaviorSubject<Set<Tab>>(new Set<Tab>());\n\n constructor(\n private injector: Injector,\n router: Router,\n private translateService: TranslateService,\n private options: OptionsService\n ) {\n super();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_TABS, []),\n stateToFactory(this.state$)\n ]).pipe(\n map(tabs => this.prepareTabs(tabs)),\n shareReplay(1),\n distinctUntilChanged()\n );\n\n this.orientation$ = this.items$.pipe(\n map((tabs: Tab[]) => {\n const firstTabWithDefinedOrientation = tabs.find(tab => tab.orientation);\n if (firstTabWithDefinedOrientation) {\n return firstTabWithDefinedOrientation.orientation;\n }\n return this.options.tabsHorizontal ? 'horizontal' : 'vertical';\n }),\n distinctUntilChanged()\n );\n }\n\n prepareTabs(tabs) {\n return this.sortTabs(\n tabs\n .map(tab => ({\n ...tab,\n template: tab.template instanceof ViewContainerRef ? tab.template : undefined\n }))\n .filter((tab, index, self) => index === self.findIndex(t => t.path === tab.path))\n );\n }\n\n sortTabs(tabs) {\n return tabs.sort((a, b) => {\n const priorityOrder = (b.priority || 0) - (a.priority || 0);\n\n const aTranslatedLabel = this.translateService.instant(a.label);\n const bTranslatedLabel = this.translateService.instant(b.label);\n const translatedLabelOrder = aTranslatedLabel.localeCompare(bTranslatedLabel);\n\n return priorityOrder || translatedLabelOrder;\n });\n }\n\n /**\n * Refresh the extension factories\n */\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state(): Set<Tab> {\n return this.state$.value;\n }\n\n /**\n * Adds a new item to tabs and emits state change\n * @param item The item to add.\n */\n add(item: Tab) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes a tab and emits a state change.\n * @param item The item to remove.\n */\n remove(item: Tab) {\n this.state.delete(item);\n this.emitNewState();\n }\n\n get firstTab$() {\n return this.items$.pipe(\n map(tabs => tabs[0]),\n filter(Boolean),\n first()\n );\n }\n}\n","import { Component } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\nimport { ActionBarService } from '../action-bar/action-bar.service';\nimport { OptionsService } from '../common/options.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { HeaderService } from '../header/header.service';\nimport { NavigatorService } from '../navigator/navigator.service';\nimport { TabsService } from '../tabs/tabs.service';\n\n@Component({\n selector: 'c8y-bootstrap',\n templateUrl: './bootstrap.template.html'\n})\nexport class BootstrapComponent {\n navigatorOpen$: Observable<boolean>;\n noAppsMargin$: Observable<boolean>;\n tabsOrientation: string;\n showPoweredBy: boolean = true;\n\n constructor(\n public tabs: TabsService,\n public ui: AppStateService,\n public navigator: NavigatorService,\n public actionBar: ActionBarService,\n private options: OptionsService,\n public headerService: HeaderService\n ) {\n this.noAppsMargin$ = this.headerService.map(({ nav }) => !nav.open && nav.hiddenOnStartup);\n this.tabsOrientation = this.options.tabsHorizontal ? 'horizontal' : 'vertical';\n this.ui\n .map(({ lang }) => lang)\n .pipe(distinctUntilChanged())\n .subscribe(() => {\n this.actionBar.refresh();\n });\n this.showPoweredBy = !this.options.get('hidePowered');\n }\n}\n","import { Component, Input, ViewChild } from '@angular/core';\nimport { BreadcrumbItem } from './breadcrumb.model';\n\n@Component({\n selector: 'c8y-breadcrumb-item',\n templateUrl: './breadcrumb-item.component.html'\n})\nexport class BreadcrumbItemComponent implements BreadcrumbItem {\n @Input() icon: string;\n @Input() translate: boolean;\n @Input() label: string;\n @Input() path: string;\n @ViewChild('template', {static: false}) template: any;\n}\n","import { Component, Input } from '@angular/core';\nimport { Breadcrumb } from './breadcrumb.model';\n\n@Component({\n selector: 'c8y-breadcrumb-outlet',\n templateUrl: './breadcrumb-outlet.component.html'\n})\nexport class BreadcrumbOutletComponent {\n showAll = false;\n @Input() breadcrumbs: Breadcrumb[] = [];\n\n /**\n * For upgrade only. Old angularjs routes start with hash, new ones not.\n */\n normalizePath(path) {\n return path.replace(/^#\\/?/, '');\n }\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport { fromTrigger, stateToFactory } from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport { Breadcrumb, BreadcrumbItem } from './breadcrumb.model';\n\nexport const HOOK_BREADCRUMB = new InjectionToken('BreadcrumbFactory');\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BreadcrumbService extends StateService {\n items$: Observable<Breadcrumb[]>;\n readonly refreshTrigger = new Subject();\n readonly state$ = new BehaviorSubject<Set<Breadcrumb>>(new Set<Breadcrumb>());\n private preferredPath: string;\n\n constructor(private injector: Injector, router: Router) {\n super();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_BREADCRUMB, []),\n stateToFactory(this.state$)\n ]).pipe(\n map(breadcrumbs => this.sortByPreferredPath(breadcrumbs)),\n shareReplay(1)\n );\n }\n\n get state() {\n return this.state$.value;\n }\n\n /**\n * Adds a new item to the action bar in the header.\n * @param item The item to add.\n */\n add(item: Breadcrumb) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes an action bar item from the header.\n * @param item The item to remove.\n */\n remove(item: Breadcrumb) {\n this.state.delete(item);\n this.emitNewState();\n }\n\n /**\n * Refresh the extension factories\n */\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n /**\n * Sets the crumb that contains that path to the top.\n * @param path The path to prefer.\n */\n selectPreferredByPath(path: string) {\n this.preferredPath = path;\n this.refresh();\n }\n\n sortByPreferredPath(breadcrumbs) {\n if (this.preferredPath) {\n return breadcrumbs.sort(bc =>\n bc.items.find((item: BreadcrumbItem) => !!item.path.match(this.preferredPath)) ? -1 : 1\n );\n }\n return breadcrumbs;\n }\n}\n","import { Component, ContentChildren, QueryList } from '@angular/core';\nimport { Breadcrumb, BreadcrumbItem } from './breadcrumb.model';\nimport { BreadcrumbService } from './breadcrumb.service';\nimport { BreadcrumbItemComponent } from './breadcrumb-item.component';\n\n@Component({\n selector: 'c8y-breadcrumb',\n templateUrl: './breadcrumb.component.html'\n})\nexport class BreadcrumbComponent implements Breadcrumb {\n items: BreadcrumbItem[];\n @ContentChildren(BreadcrumbItemComponent) private contentChildItems: QueryList<BreadcrumbItem>;\n private viewInitTimeout;\n\n constructor(private breadcrumbService: BreadcrumbService) {}\n\n ngAfterViewInit() {\n this.items = this.contentChildItems.toArray();\n this.viewInitTimeout = setTimeout(() =>\n this.breadcrumbService.add(this as Breadcrumb)\n );\n }\n\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.breadcrumbService.remove(this as Breadcrumb);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { CommonModule } from '../common/common.module';\nimport { BreadcrumbItemComponent } from './breadcrumb-item.component';\nimport { BreadcrumbOutletComponent } from './breadcrumb-outlet.component';\nimport { BreadcrumbComponent } from './breadcrumb.component';\nimport { BreadcrumbService } from './breadcrumb.service';\n\n/**\n * The angular module definition for breadcrumbs.\n * @exports BreadcrumbComponent\n * @exports BreadcrumbItemComponent\n * @exports BreadcrumbOutletComponent\n */\n@NgModule({\n declarations: [\n BreadcrumbComponent,\n BreadcrumbItemComponent,\n BreadcrumbOutletComponent\n ],\n imports: [\n RouterModule.forChild([]),\n CommonModule,\n TooltipModule.forRoot()\n ],\n exports: [\n BreadcrumbComponent,\n BreadcrumbItemComponent,\n BreadcrumbOutletComponent\n ]\n})\nexport class BreadcrumbModule { }\n","import { Component, TemplateRef, ViewChild, Input} from '@angular/core';\nimport { NavigatorNode } from './navigator-node';\nimport { NavigatorService } from './navigator.service';\n\n@Component({\n selector: 'c8y-navigator-item',\n template: '<ng-template #iconTpl><ng-content></ng-content></ng-template>',\n})\nexport class NavigatorItemComponent {\n @ViewChild('iconTpl', {static: true}) template: TemplateRef<any>;\n @Input() label: string;\n @Input() icon: string;\n @Input() path: string;\n @Input() priority = 0;\n nodeData: NavigatorNode;\n constructor(\n private service: NavigatorService\n ) {\n this.nodeData = new NavigatorNode();\n }\n\n ngOnInit(): void {\n this.ngOnChanges();\n setTimeout(() => this.service.add(this.nodeData));\n }\n\n ngOnChanges(): void {\n this.nodeData.icon = this.icon;\n this.nodeData.label = this.label;\n this.nodeData.path = this.path;\n this.nodeData.priority = this.priority;\n this.nodeData.iconTemplate = !this.icon ? this.template : undefined;\n this.nodeData.icon = this.icon;\n }\n\n ngOnDestroy(): void {\n this.service.remove(this.nodeData);\n }\n}\n","import { Component, Input } from '@angular/core';\nimport { NavigatorNode } from './navigator-node';\n\n@Component({\n selector: 'c8y-navigator-icon',\n template: `<i class=\"icon\" [c8yIcon]=\"icon\"></i>`\n})\nexport class NavigatorIconComponent {\n @Input() node: NavigatorNode;\n get icon() {\n const DEFAULT_ICON = 'cog';\n return this.node.icon || DEFAULT_ICON;\n }\n\n get iconClass() {\n return `fa-${this.icon}`;\n }\n}\n","import { Component, Input, ViewChild, OnDestroy } from '@angular/core';\nimport { PopoverDirective } from 'ngx-bootstrap/popover';\nimport { StatusType } from '../common/status.model';\nimport { gettext } from '../i18n/gettext';\n\nexport interface PopoverConfirmButtons {\n /**\n * The label of the button\n */\n label: string;\n /**\n * Which action to perform.\n */\n action: () => Promise<any>;\n /**\n * The status class attached to the button.\n */\n status?: StatusType | 'primary';\n}\n\n/**\n * A component to show a popover right next to the\n * user action. Add this component where the confirm modal\n * should be shown and toggle isOpen to display it. You\n * can use `await isShow()` to wait for a result on the\n * click action.\n */\n@Component({\n selector: 'c8y-popover-confirm',\n templateUrl: './popover-confirm.component.html'\n})\nexport class PopoverConfirmComponent {\n @ViewChild(PopoverDirective, {static: false}) popover: PopoverDirective;\n @Input() buttons: PopoverConfirmButtons[] = [{ label: gettext('cancel'), action: () => Promise.reject()}];\n @Input() message: string;\n @Input() title: string;\n @Input() isOpen = false;\n @Input() containerClass = '';\n @Input() placement = 'right';\n @Input() outsideClick = false;\n\n click: (action: () => Promise<any>) => void;\n\n /**\n * Show the popover. Wait until an action is performed on it.\n */\n async show(buttons?: PopoverConfirmButtons[]) {\n this.buttons = buttons || this.buttons;\n this.isOpen = true;\n let result;\n try {\n result = await new Promise((resolve, reject) => {\n return this.click = (action: () => Promise<any>) => action().then(resolve).catch(reject);\n });\n } catch (ex) {\n throw(ex);\n } finally {\n this.isOpen = false;\n }\n return result;\n }\n\n buttonStatus(status) {\n if (status) {\n return `btn-${status}`;\n }\n return 'btn-link btn-clean';\n }\n\n handleOutsideClick() {\n this.click(() => Promise.reject());\n }\n}\n","// tslint:disable-next-line:max-line-length\nimport { Component, ComponentFactoryResolver, Input, QueryList, ViewChild, ViewChildren, ViewContainerRef, Output, EventEmitter, OnDestroy, HostListener } from '@angular/core';\nimport { RouterLinkActive, Router } from '@angular/router';\nimport { NavigatorIconComponent } from './navigator-icon.component';\nimport { NavigatorNode, ClickOptions } from './navigator-node';\nimport { NavigatorService } from './navigator.service';\nimport { PopoverConfirmComponent } from '../modal/popover-confirm.component';\n\n@Component({\n selector: 'c8y-navigator-node-display',\n templateUrl: './navigator-node.component.html'\n})\nexport class NavigatorNodeComponent implements OnDestroy {\n @ViewChild('icon', { read: ViewContainerRef, static: false }) iconSlot: ViewContainerRef;\n @Input() node: NavigatorNode;\n @Input() isRoot: boolean;\n @ViewChild(RouterLinkActive, {static: false}) routerLinkActive: RouterLinkActive;\n @ViewChildren(NavigatorNodeComponent) childrenNodes: QueryList<NavigatorNodeComponent>;\n @Output() nodeClick: EventEmitter<string> = new EventEmitter();\n @ViewChild(PopoverConfirmComponent, {static: false}) confirm: PopoverConfirmComponent;\n\n parentNode: NavigatorNodeComponent;\n\n private viewInitTimeout;\n\n constructor(\n private componentFactoryResolver: ComponentFactoryResolver,\n private navigator: NavigatorService\n ) {}\n\n ngAfterViewInit() {\n this.childrenNodes.forEach((n) => n.parentNode = this);\n this.viewInitTimeout = setTimeout(() => {\n this.updateIcon();\n this.openOnFirstUrl();\n this.expandParentIfActive();\n this.node.confirm = this.confirm;\n });\n }\n\n openOnFirstUrl() {\n if (this.navigator.openOnFirstUrl(this.node) && !this.node.open) {\n this.expandCollapse(true);\n }\n }\n\n get expandTitle() {\n return !this.node.open ? 'Expand' : 'Collapse';\n }\n\n click(from: 'icon' | 'expander' | 'link' = 'link', $event?) {\n let open;\n if (from === 'expander') {\n if ($event) {\n $event.stopPropagation();\n $event.preventDefault();\n }\n open = !this.node.open;\n } else {\n open = this.routerLinkActive && this.routerLinkActive.isActive ? true : !this.node.open;\n }\n if (open !== this.node.open) {\n this.expandCollapse(open, false, { [from]: true, $event });\n }\n this.nodeClick.emit(from);\n }\n\n expandCollapse(open, recursive?, forNode: ClickOptions = {}) {\n this.node.open = open;\n // Also close children\n if (recursive) {\n this.childrenNodes.forEach((n) => n.expandCollapse(open, recursive));\n }\n forNode.open = open;\n this.node.click(forNode);\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.viewInitTimeout);\n this.node.destroy();\n }\n\n private expandParentIfActive() {\n if (this.routerLinkActive && this.routerLinkActive.isActive && this.parentNode) {\n this.parentNode.expandCollapse(true);\n }\n }\n\n private updateIcon() {\n if (this.node.iconTemplate) {\n this.updateIconTemplate();\n } else {\n this.updateIconComponent();\n }\n }\n\n private updateIconComponent() {\n let componentType = NavigatorIconComponent;\n if (this.node && this.node.iconComponent) {\n componentType = this.node.iconComponent;\n }\n this.iconSlot.clear();\n const iconComponentFactory = this.componentFactoryResolver.resolveComponentFactory(componentType);\n const componentRef = this.iconSlot.createComponent(iconComponentFactory);\n componentRef.instance.node = this.node;\n }\n\n private updateIconTemplate() {\n this.iconSlot.clear();\n this.iconSlot.createEmbeddedView(this.node.iconTemplate);\n }\n}\n","import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'c8y-right-drawer',\n templateUrl: './right-drawer.component.html'\n})\nexport class RightDrawerComponent {\n @Input('quickLinks') set _quickLinks(data: any[]) {\n if (data) {\n this.quickLinks = data.filter(d => d.type === 'quicklink');\n }\n }\n @Input('helpAndSupport') set _helpAndSupport(data: any[]) {\n if (data) {\n this.helpAndSupport = data.filter(d => d.type === 'doc');\n }\n }\n @Input() app: any;\n quickLinks: any[] = [];\n helpAndSupport: any[] = [];\n}\n","import { Component, ElementRef, NgZone } from '@angular/core';\nimport { HeaderService } from '../header.service';\nimport { debounceTime, map, filter } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-title-outlet',\n templateUrl: './title-outlet.component.html'\n})\nexport class TitleOutletComponent {\n title = undefined;\n pageTitleUpdate: boolean = true;\n\n constructor(\n private headerService: HeaderService,\n private element: ElementRef,\n private zone: NgZone\n ) {\n const title$ = this.headerService.map(state => state.title);\n title$.subscribe(title => (this.title = title));\n\n const pageTitleUpdate$ = this.headerService.map(state => state.pageTitleUpdate);\n pageTitleUpdate$.subscribe(pageTitleUpdate => (this.pageTitleUpdate = pageTitleUpdate));\n\n this.zone.runOutsideAngular(() => {\n this.headerService.state$.pipe(\n debounceTime(100),\n filter(state => state.pageTitleUpdate),\n debounceTime(100),\n map(() => this.element.nativeElement.querySelector('h1')),\n filter(el => el !== null),\n map(el => el.innerText),\n filter(Boolean))\n .subscribe((title: string) => headerService.changePageTitle(title));\n });\n }\n}\n","import { AfterViewInit, Component, OnDestroy, ViewChild, Input } from '@angular/core';\nimport { HeaderService } from '../header.service';\n\n@Component({\n selector: 'c8y-title',\n templateUrl: './title.component.html'\n})\nexport class TitleComponent implements AfterViewInit, OnDestroy {\n @Input() pageTitleUpdate: boolean = true;\n @ViewChild('template', {static: true}) template;\n private viewInitTimeout;\n\n constructor(\n private headerService: HeaderService\n ) {}\n\n ngAfterViewInit() {\n this.viewInitTimeout = setTimeout(() => this.headerService.changeTitle(this.template, this.pageTitleUpdate));\n }\n\n ngOnDestroy() {\n if (this.headerService.state.title === this.template) {\n clearTimeout(this.viewInitTimeout);\n this.headerService.changeTitle();\n }\n }\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport { ExtensionPoint, fromTrigger, sortByPriority, stateToFactory } from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport { Search } from './search.model';\n\n/**\n * A hook to use for Multi Provider extension.\n */\nexport const HOOK_SEARCH = new InjectionToken('SearchFactory');\n\n/**\n * A service which defines the dearch function.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class SearchService extends StateService implements ExtensionPoint<Search> {\n items$: Observable<Search[]>;\n readonly refreshTrigger = new Subject();\n protected state$ = new BehaviorSubject<Set<Search>>(new Set<Search>());\n\n constructor(\n private injector: Injector,\n router: Router\n ) {\n super();\n this.items$ = fromTrigger(router, this.refreshTrigger, [\n () => this.injector.get(HOOK_SEARCH, []),\n stateToFactory(this.state$)\n ]).pipe(\n map((items: Search[]) => sortByPriority(items)),\n shareReplay(1)\n );\n }\n\n /**\n * Refresh the extension factories\n */\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state() {\n return this.state$.value;\n }\n\n /**\n * Adds a new item to the search in the header.\n * @param item The item to add.\n */\n add(item: Search) {\n this.state.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes an search from the header.\n * @param item The item to remove.\n */\n remove(item: Search) {\n this.state.delete(item);\n this.emitNewState();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { StateService } from '../common/state-service.abstract';\nimport { BehaviorSubject } from 'rxjs';\nimport { UserMenuItem } from './user.model';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UserMenuService extends StateService {\n state$: BehaviorSubject<any> = new BehaviorSubject<any>({\n userMenuItems: new Set<UserMenuItem>()\n });\n\n /**\n * Returns the current state.\n * @readonly\n * @returns The current set of actions.\n */\n get state() {\n return this.state$.value;\n }\n\n /**\n * Adds a new item to the search in the header.\n * @param item The item to add.\n */\n add(item: UserMenuItem) {\n this.state.userMenuItems.add(item);\n this.emitNewState();\n }\n\n /**\n * Removes an search from the header.\n * @param item The item to remove.\n */\n remove(item: UserMenuItem) {\n this.state.userMenuItems.delete(item);\n this.emitNewState();\n }\n}\n","import { gettext } from '../i18n/gettext';\n\nexport const documentationItems = [\n {\n icon: 'c8y-c8y-data', // double c8y- is correct!\n label: gettext('Concepts guide`KEEP_ORIGINAL`'),\n url: '/concepts/introduction',\n type: 'doc'\n },\n {\n icon: 'c8y-user',\n label: gettext('User guide`KEEP_ORIGINAL`'),\n url: '/users-guide/getting-started',\n type: 'doc'\n },\n {\n icon: 'c8y-device-management',\n label: gettext('Device guides`KEEP_ORIGINAL`'),\n url: '/devices/overview',\n type: 'doc'\n },\n {\n icon: 'c8y-book',\n label: gettext('Cumulocity IoT Edge`KEEP_ORIGINAL`'),\n url: '/edge/overview',\n type: 'doc'\n },\n {\n icon: 'c8y-tools',\n label: gettext('Microservice SDK guide`KEEP_ORIGINAL`'),\n url: '/microservice-sdk/introduction',\n type: 'doc'\n },\n {\n icon: 'c8y-tools',\n label: gettext('Device SDK guide`KEEP_ORIGINAL`'),\n url: '/device-sdk/introduction',\n type: 'doc'\n },\n {\n icon: 'c8y-smart-rest',\n label: gettext('Web SDK guide`KEEP_ORIGINAL`'),\n url: '/web/introduction',\n type: 'doc'\n },\n {\n icon: 'c8y-data-explorer',\n label: gettext('Streaming analytics guide`KEEP_ORIGINAL`'),\n url: '/apama/introduction',\n type: 'doc'\n },\n {\n icon: 'c8y-bookmark',\n label: gettext('Reference guide`KEEP_ORIGINAL`'),\n url: '/reference/rest-implementation',\n type: 'doc'\n },\n {\n icon: 'gavel',\n label: gettext('Legal notices'),\n url: 'https://documentation.softwareag.com/legal/',\n type: 'doc'\n }\n];\n","import { InjectionToken } from '@angular/core';\nimport { ExtensionFactory } from '../common/extension-hooks';\n\nexport interface DocLink {\n icon: string;\n label: string;\n url: string;\n type: 'doc' | 'quicklink';\n click?: any;\n}\n\nexport type DocLinkFactory = ExtensionFactory<DocLink>;\n\nexport const HOOK_DOCS = new InjectionToken<ExtensionFactory<DocLink>>('Hook docs');\n","import { Injectable, Inject, Optional } from '@angular/core';\nimport { OptionsService } from '../common/options.service';\nimport { documentationItems } from './defaults.items';\nimport { AppStateService } from '../common/ui-state.service';\nimport { gettext } from '../i18n/gettext';\nimport { DocLink, HOOK_DOCS, DocLinkFactory } from './docs.models';\nimport { ExtensionPoint, fromTrigger } from '../common/extension-hooks';\nimport { Observable } from 'rxjs';\nimport { Router } from '@angular/router';\nimport { shareReplay, startWith, first, filter } from 'rxjs/operators';\nimport { isUndefined } from 'lodash-es';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DocsService implements ExtensionPoint<DocLink> {\n items$: Observable<DocLink[]>;\n constructor(\n private options: OptionsService,\n private app: AppStateService,\n @Optional() @Inject(HOOK_DOCS) factories: DocLinkFactory[] = [],\n router: Router\n ) {\n if (!factories) {\n factories = [];\n }\n factories.push(this);\n const refreshTrigger = this.app.map(({ supportUrl }) => supportUrl);\n this.items$ = fromTrigger(router, refreshTrigger, factories).pipe(\n startWith([]),\n shareReplay(1)\n );\n }\n\n getBaseUrl(): string {\n return this.options.get('docsBaseUrl', 'https://www.cumulocity.com/guides');\n }\n\n get templateStr(): string {\n return this.options.get('guideHrefTemplate', '${docsBaseUrl}${partialUrl}');\n }\n\n getUserGuideLink(link) {\n if (/^https?:/.test(link)) {\n return link;\n }\n if (this.getBaseUrl === null) {\n return null;\n }\n return this.getLink(this.templateStr, link);\n }\n\n list() {\n return this.items$\n .pipe(\n filter(i => !!i.length),\n first()\n )\n .toPromise();\n }\n\n refresh() {\n // no op\n }\n\n get() {\n // use the function as a factory\n const { links, noDefault, excludeDefault = [] } = this.options.get('docs', {});\n const { supportUrl } = this.app.state;\n let staticLinks = noDefault\n ? []\n : documentationItems\n .map((item: DocLink) => ({ ...item, url: this.getUserGuideLink(item.url) }))\n .filter(({ url }) => !excludeDefault.some(e => new RegExp(e).test(url)));\n\n if (links) {\n // backwards compatibility\n links.map((lnk: DocLink) => {\n if (isUndefined(lnk.type)) {\n lnk.type = 'doc';\n return lnk;\n }\n });\n staticLinks = staticLinks.concat(links);\n }\n if (supportUrl) {\n staticLinks.push({\n icon: 'comments',\n label: gettext('Forum support'),\n url: supportUrl,\n type: 'doc'\n });\n }\n return staticLinks;\n }\n\n private getLink(templateStr, partialLink) {\n if (!templateStr) {\n return undefined;\n }\n return templateStr\n .replace(/\\${docsBaseUrl}/, this.getBaseUrl())\n .replace(/\\${partialUrl}/, this.prefixWithSlash(partialLink));\n }\n\n private prefixWithSlash(partialLink = '') {\n const shouldPrefix = !(partialLink && /^\\//.test(partialLink));\n const prefix = shouldPrefix ? '/' : '';\n return `${prefix}${partialLink}`;\n }\n}\n","import { AfterViewInit, Component } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { ActionService } from '../../action/action.service';\nimport { BreadcrumbService } from '../../breadcrumb/breadcrumb.service';\nimport { SearchService } from '../../search/search.service';\nimport { AppStateService } from '../../common/ui-state.service';\nimport { UserMenuService } from '../../user/user-menu.service';\nimport { HeaderService } from '../header.service';\nimport { DocsService } from '../../docs/docs.service';\n\n@Component({\n selector: 'c8y-header-bar',\n templateUrl: './header-bar.component.html'\n})\nexport class HeaderBarComponent implements AfterViewInit {\n canToggle$: Observable<boolean> = this.headerService.hasItemsInNavigator$;\n appState$: Observable<any> = this.appState.state$;\n drawerOpen = false;\n headerOpen = false;\n\n constructor(\n public headerService: HeaderService,\n public actionService: ActionService,\n public breadcrumbService: BreadcrumbService,\n public searchService: SearchService,\n private appState: AppStateService,\n public userMenuService: UserMenuService,\n public docs: DocsService\n ) {}\n\n ngAfterViewInit() {\n this.headerService.verifyIfNavOpen();\n }\n\n toggle() {\n this.headerOpen = !this.headerOpen;\n }\n}\n","import { Component } from '@angular/core';\nimport { ApplicationService, IApplication, ICurrentTenant, IUser } from '@c8y/client';\nimport { get, includes, orderBy } from 'lodash-es';\nimport { combineLatest } from 'rxjs';\nimport { first } from 'rxjs/operators';\nimport { AppStateService } from '../../common/ui-state.service';\n@Component({\n selector: 'c8y-app-switcher',\n templateUrl: './app-switcher.component.html'\n})\nexport class AppSwitcherComponent {\n oneCloudApps?: Array<IApplication & { [key: string]: any }>;\n apps: Array<IApplication & { [key: string]: any }>;\n open: boolean;\n\n private get hideCloudApps(): boolean {\n return false; // this should be configurable from outside\n }\n private tenant: ICurrentTenant;\n constructor(private ui: AppStateService, private applications: ApplicationService) {\n const { currentUser, currentTenant } = this.ui;\n combineLatest(currentUser, currentTenant)\n .pipe(first())\n .subscribe(([user, tenant]) => {\n this.tenant = tenant;\n this.listAppsForUser(user);\n });\n }\n\n isActive(app: IApplication) {\n return app.contextPath === this.ui.state.app.contextPath;\n }\n\n getHref(app: IApplication) {\n return this.applications.getHref(app);\n }\n\n private async listAppsForUser(user: IUser | null) {\n if (user) {\n const { data } = await this.applications.listByUser(user, { pageSize: 1000 });\n this.apps = this.orderApps(this.filterApps(data));\n }\n }\n\n private filterApps(apps) {\n apps = this.filterVisible(apps);\n apps = this.filterCloud(apps);\n apps = this.filterDuplicates(apps);\n return apps;\n }\n\n private filterVisible(apps) {\n const visibleApplicationTypes = ['HOSTED', 'EXTERNAL'];\n return apps.filter(\n app =>\n includes(visibleApplicationTypes, app.type) &&\n !app.noAppSwitcher &&\n !get(app, 'manifest.noAppSwitcher')\n );\n }\n\n private filterCloud(apps) {\n const { hideCloudApps } = this;\n const filterFn = app => !!app.cloud;\n if (!hideCloudApps) {\n this.oneCloudApps = this.orderApps(apps.filter(filterFn));\n }\n return apps.filter(app => !filterFn(app));\n }\n\n private filterDuplicates(apps) {\n // Filter out apps that have duplicate contextpaths and are not own owned but the current tenant;\n const filterFn = app =>\n !apps.some(\n otherApp =>\n app !== otherApp &&\n (app.contextPath && app.contextPath === otherApp.contextPath) &&\n app.owner.tenant.id !== this.tenant.name\n );\n return apps.filter(filterFn);\n }\n\n private orderApps(apps) {\n return orderBy(apps, ({ name }) => name.toLowerCase());\n }\n}\n","import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';\nimport { find, keys, get, assign, isEmpty } from 'lodash-es';\nimport { OptionsService } from '../../common/options.service';\n\n@Component({\n selector: 'c8y-app-icon',\n templateUrl: './app-icon.component.html',\n host: { class: 'c8y-app-icon' }\n})\nexport class AppIconComponent implements OnChanges {\n @Input() contextPath: string;\n @Input() name: string = '';\n @Input() app: any;\n\n model = {\n appIcon: '',\n showIcon: true,\n iconClass: ['c8y-icon'],\n appNameAbbr: '',\n iconStyle: {}\n };\n\n private c8yAppIconsList = {\n analyticsbuilder: 'analytics-builder',\n 'analytics-builder': 'analytics-builder',\n cockpit: 'cockpit',\n devicemanagement: 'device-management',\n administration: 'administration',\n apamaepl: 'apama-epl'\n };\n\n private white: boolean = false;\n\n private defaultIconStyle = {\n 'background-repeat': 'no-repeat',\n 'background-size': 'contain',\n height: '36px',\n width: '36px'\n };\n\n constructor(private options: OptionsService) {}\n\n ngOnChanges(changes: SimpleChanges) {\n this.model.appIcon = this.iconFromAppDefinition() || this.findStaticIcon();\n const iconUrl = this.iconUrlFromAppDefinition();\n if (iconUrl) {\n this.model.iconStyle = assign(this.defaultIconStyle, {\n 'background-image': iconUrl\n });\n }\n this.model.showIcon = !!this.model.appIcon || !isEmpty(this.model.iconStyle);\n this.model.iconClass = [\n 'c8y-icon',\n this.model.appIcon,\n this.white ? 'c8y-icon-white' : 'c8y-icon-duocolor'\n ].filter(c => !!c);\n this.model.appNameAbbr = this.name.substr(0, 2);\n }\n\n private findStaticIcon() {\n const contextPath = this.contextPath || this.name;\n const appContextPathNormalized = find(keys(this.c8yAppIconsList), cp => {\n return contextPath.indexOf(cp) > -1;\n });\n const appIcon = this.c8yAppIconsList[appContextPathNormalized];\n return appIcon ? `c8y-icon-${appIcon}` : undefined;\n }\n\n private iconFromAppDefinition() {\n const app = this.app || this.options;\n const iconClassProperty = ['icon', 'class'];\n const iconClass = get(app, iconClassProperty) || get(app, ['manifest', ...iconClassProperty]);\n return iconClass;\n }\n\n private iconUrlFromAppDefinition() {\n const app = this.app || this.options;\n const iconUrlProperty = ['icon', 'url'];\n const iconUrl = get(app, iconUrlProperty) || get(app, ['manifest', ...iconUrlProperty]);\n return iconUrl;\n }\n}\n","import { Component, Input, SimpleChanges } from '@angular/core';\nimport { NavigatorNode } from './navigator-node';\nimport { HeaderService } from '../header/index';\nimport { BehaviorSubject, of } from 'rxjs';\nimport { delay } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-navigator-outlet, c8y-ui-navigator',\n templateUrl: './navigator-outlet.template.html',\n})\nexport class NavigatorOutletComponent {\n @Input() nodes: NavigatorNode[];\n @Input() open = true;\n isShown$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);\n\n constructor(private headerService: HeaderService) {}\n\n ngOnChanges(): void {\n this.isShown$.next(this.nodes && this.nodes.length > 0);\n }\n\n /**\n * Closes the navigator on click if the window is small.\n */\n collapseNavigator(from: 'icon' | 'expander' | 'link') {\n if (from === 'link' && !this.headerService.largeWidth) {\n this.headerService.closeNavigator();\n }\n }\n\n trackByPathOrLabel(index, node) {\n return node.path ? node.path : node.label;\n }\n}\n","export interface LoginMessage {\n message: string;\n type: string;\n}\n\nexport enum LoginViews {\n None,\n Credentials,\n RecoverPassword,\n SmsChallenge,\n ChangePassword,\n TotpChallenge,\n TotpSetup,\n ProvidePhoneNumber\n}\n","import { Component, Input, OnDestroy } from '@angular/core';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { StatusType, Status, statusIcons, statusAlert } from '../common/status.model';\nimport { ModalLabels } from '../select-modal/select-modal.model';\n\n/**\n * Labels to be used in the selection modal.\n * @deprecated This is going to be removed after 1007.7.0. Use ModalLabels instead.\n */\n// tslint:disable-next-line: no-empty-interface\nexport interface ILabels extends ModalLabels {}\n\n@Component({\n selector: 'c8y-confirm-modal',\n templateUrl: './modal-confirm.component.html'\n})\nexport class ConfirmModalComponent implements OnDestroy {\n result: Promise<boolean>;\n dismiss: () => void;\n close: () => void;\n @Input() title: string;\n @Input() body: string;\n @Input() status: StatusType = Status.INFO;\n @Input() set labels(labels: ModalLabels) {\n const { ok = 'OK', cancel = 'Cancel' } = labels || {};\n this._labels = { ok, cancel };\n }\n\n get labels(): ModalLabels { return this._labels; }\n\n get classIcon() {\n return `fa-${statusIcons[this.status]}`;\n }\n\n get classAlert() {\n return statusAlert[this.status];\n }\n\n private _labels: ModalLabels;\n\n constructor(private modal: BsModalRef) {\n this._labels = {\n ok: 'OK',\n cancel: 'Cancel'\n };\n this.result = new Promise((resolve, reject) => {\n this.dismiss = () => {\n reject();\n this.modal.hide();\n };\n this.close = () => {\n resolve(true);\n this.modal.hide();\n };\n });\n }\n\n ngOnDestroy() {\n this.dismiss();\n }\n}\n","import { Component, Input, Optional, Output, EventEmitter, HostListener } from '@angular/core';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { gettext } from '../i18n/gettext';\nimport { isEmpty } from 'lodash';\nimport { ModalLabels } from '../select-modal/select-modal.model';\n\n/**\n * C8y modal component.\n * ## Example:\n *\n * Creating custom modal:\n * ```typescript\n * import { Component } from \"@angular/core\";\n * import { Subject } from 'rxjs';\n *\n * @Component({\n * selector: \"my-modal\",\n * template: `\n * <c8y-modal title=\"CustomTitle\"\n * (onClose)=\"onClose($event)\"\n * (onDismiss)=\"onDismiss($event)\"\n * [labels]=\"labels\"\n * [disabled]=\"true\" <- will disable ok button\n * >\n * <span>I am body of modal</span>\n * <span>For simple string use body=\"string\"</span>\n * </c8y-modal>`\n * })\n *\n * export class MyModalComponent {\n *\n * closeSubject: Subject<boolean> = new Subject();\n * labels : ModalLabels = {ok: \"customOK\", cancel: \"customCancel\"};\n *\n * onDismiss(event){\n * this.closeSubject.next(false);\n * }\n *\n * onClose(event) {\n * this.closeSubject.next(true);\n * }\n * }\n * ```\n * Showing modal:\n * ```typescript\n * import { BsModalService } from \"ngx-bootstrap/modal\";\n *\n * constructor(\n * public bsModalService: BsModalService,\n * ) {}\n *\n * showModal() {\n * const modalRef = this.bsModalService.show(MyModalComponent);\n * modalRef.content.closeSubject.subscribe(result => {\n * console.log('results:', result);\n * });\n * }\n * ```\n */\n@Component({\n selector: 'c8y-modal',\n templateUrl: './modal.component.html',\n})\n\nexport class ModalComponent {\n @Output() onDismiss: EventEmitter<boolean> = new EventEmitter();\n @Output() onClose: EventEmitter<boolean> = new EventEmitter();\n @Input() disabled = false;\n @Input() close: () => void;\n @Input() dismiss: () => void;\n @Input() title: string;\n @Input() body: string;\n @Input() customFooter: boolean = false;\n @Input() set labels({ok, cancel}: ModalLabels) {\n this._labels = {ok , cancel};\n }\n\n get labels(): ModalLabels { return this._labels; }\n\n private _labels: ModalLabels = { ok: gettext('OK'), cancel: gettext('Cancel') };\n\n constructor(@Optional() private modal: BsModalRef) {}\n\n _dismiss() {\n let fn = this.dismiss;\n if (!fn && this.modal) { fn = () => this.modal.hide(); }\n if (fn) { fn(); }\n this.onDismiss.emit(true);\n }\n\n _close() {\n let fn = this.close;\n if (!fn && this.modal) { fn = () => this.modal.hide(); }\n if (fn) { fn(); }\n this.onClose.emit(true);\n }\n\n @HostListener('document:keydown.enter', ['$event']) onEnterKeyDown(event: KeyboardEvent) {\n const hasOnlyOneButton = isEmpty(this.labels.ok) !== isEmpty(this.labels.cancel);\n const isCancelClickable = !this.customFooter && this.labels.cancel;\n const isOkClickable = !this.customFooter && !this.disabled && this.labels.ok;\n if (hasOnlyOneButton && isCancelClickable) {\n this._dismiss();\n }\n if (hasOnlyOneButton && isOkClickable) {\n this._close();\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { ConfirmModalComponent } from './modal-confirm.component';\nimport { StatusType, Status } from '../common/status.model';\nimport { gettext } from '../i18n/gettext';\n\n/**\n * Service to shiow a modal.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ModalService {\n\n constructor(private modalService: BsModalService) {}\n\n /**\n * Shows a quick confirm message modal.\n * @param title The title of that modal.\n * @param body The text body to display.\n * @param status The status.\n * @param labels The labels to use. Default: { ok: 'Confirm', cancel: 'Cancel'}\n */\n async confirm(title: string, body: string, status: StatusType = Status.INFO, labels: any = {}) {\n const modalLabels = {ok: labels.ok || gettext('Confirm'), cancel: labels.cancel || gettext('Cancel')};\n const modalRef = this.modalService.show(ConfirmModalComponent, {initialState: {title, body, labels: modalLabels, status}});\n return await modalRef.content.result;\n }\n\n /**\n * Shows a quick acknowledge message modal.\n * @param title The title of that modal.\n * @param body The text body to display.\n * @param status The status.\n * @param acknowledgeLabel The label to use.\n */\n async acknowledge(title: string, body: string, status: StatusType = Status.INFO, acknowledgeLabel: string = gettext('Confirm') ) {\n const labels = {ok: acknowledgeLabel, cancel: null};\n const modalRef = this.modalService.show(ConfirmModalComponent, {initialState: {title, body, labels, status}});\n return await modalRef.content.result;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ModalModule as BsModalModule } from 'ngx-bootstrap/modal';\nimport { ConfirmModalComponent } from './modal-confirm.component';\nimport { ModalComponent } from './modal.component';\nimport { ModalService } from './modal.service';\nimport { CommonModule } from '../common/common.module';\nimport { PopoverConfirmComponent } from './popover-confirm.component';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\n\n/**\n * The angular module definition for modal.\n * @exports ConfirmModalComponent\n * @exports ModalComponent\n * @exports PopoverConfirmComponent\n */\n@NgModule({\n imports: [\n BsModalModule.forRoot(),\n CommonModule,\n PopoverModule.forRoot()\n ],\n exports: [\n ConfirmModalComponent,\n ModalComponent,\n PopoverConfirmComponent\n ],\n declarations: [\n ConfirmModalComponent,\n ModalComponent,\n PopoverConfirmComponent\n ],\n providers: [\n ModalService\n ],\n entryComponents: [\n ConfirmModalComponent\n ]\n})\nexport class ModalModule { }\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CollapseModule } from 'ngx-bootstrap/collapse';\nimport { CommonModule } from '../common/common.module';\nimport { NavigatorItemComponent } from './navigator-entry.component';\nimport { NavigatorIconComponent } from './navigator-icon.component';\nimport { NavigatorNodeComponent } from './navigator-node.component';\nimport { NavigatorOutletComponent } from './navigator-outlet.component';\nimport { NavigatorService } from './navigator.service';\nimport { ModalModule } from '../modal/modal.module';\n\n/**\n * The angular module definition for the navigator.\n * @exports NavigatorOutletComponent\n * @exports NavigatorItemComponent\n */\n@NgModule({\n declarations: [\n NavigatorOutletComponent,\n NavigatorNodeComponent,\n NavigatorItemComponent,\n NavigatorIconComponent\n ],\n imports: [\n RouterModule,\n CollapseModule.forRoot(),\n CommonModule,\n ModalModule\n ],\n exports: [\n NavigatorOutletComponent,\n NavigatorItemComponent\n ],\n entryComponents: [\n NavigatorIconComponent\n ]\n})\nexport class NavigatorModule { }\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { OptionsService } from '../../common/options.service';\nimport { gettext } from '../../i18n/gettext';\nimport { Cookie, CookieBannerSettings, CookiePreferences } from './cookie-banner.model';\n@Injectable({\n providedIn: 'root'\n})\nexport class CookieBannerService {\n readonly STORAGE_KEY: string = 'acceptCookieNotice';\n readonly COOKIE_BANNER = 'cookieBanner';\n isCookieBannerShowed$: Subject<boolean> = new Subject();\n\n private readonly cookieDescriptions = {\n required: gettext(\n \"These cookies are required to enable core site functionality. They perform a task or operation without which a site's functionality would not be possible.\"\n ),\n functional: gettext(\n 'These cookies are used to track site usage and to process my personal data to measure and improve usability and performance. We will neither forward this data to any third party nor use this data for direct marketing purposes. I recognize that I can opt in and out of these cookies at any time.'\n ),\n marketing: gettext('These cookies are used to target advertising to a user.')\n };\n\n constructor(private options: OptionsService) {}\n\n getCookiePreferencesConfig(): CookiePreferences {\n const settings = this.getCookieBannerSettings();\n return settings && settings.configuration;\n }\n\n getCookieBannerSettings(): CookieBannerSettings {\n return this.options.get(this.COOKIE_BANNER) || {};\n }\n\n setCookies(cookiePreferences: CookiePreferences) {\n localStorage.setItem(this.STORAGE_KEY, JSON.stringify(cookiePreferences));\n }\n\n shouldShowCookieBanner(): boolean {\n const settings = this.getCookieBannerSettings();\n return !!settings.cookieBannerText && !this.getUserCookiePreferences();\n }\n\n getUserCookiePreferences(): CookiePreferences {\n return JSON.parse(localStorage.getItem(this.STORAGE_KEY));\n }\n\n isConfigCookiePreferencesDefined() {\n return !!this.getCookiePreferencesConfig();\n }\n\n isFunctionalCookieDisabled() {\n const { functional }: CookiePreferences = this.getUserCookiePreferences() || {};\n /**\n * We want this check, as we should stop loading Gainsight tag only when functional cookie is explicitly set to false.\n * In the USA there is no need for the functional cookies when tracking users.\n * This is why we want to allow undefined to pass the check.\n * @ignore\n */\n return functional === false;\n }\n\n getCookieDescription(cookieType: string): string {\n return this.cookieDescriptions[cookieType];\n }\n\n transformCookiePreferencesToList(cookiePreferences: CookiePreferences): Cookie[] {\n return Object.entries(cookiePreferences).map(([name, value]) => {\n const isReadonly = name === 'required';\n return { name, value, isReadonly };\n });\n }\n\n transformCookiePreferencesListToCookiePreferences(\n cookiePreferencesList: Cookie[]\n ): CookiePreferences {\n return cookiePreferencesList.reduce((cookiePref: CookiePreferences, cookie: Cookie) => {\n const key: string = cookie.name;\n cookiePref[key] = cookie.value;\n\n return cookiePref;\n }, {});\n }\n}\n","import { Injectable } from '@angular/core';\nimport { combineLatest, fromEvent, BehaviorSubject } from 'rxjs';\nimport { ICustomProperties } from '@c8y/client';\nimport { filter, delay, map, take } from 'rxjs/operators';\nimport { AppStateService } from '../common/ui-state.service';\nimport { OptionsService } from '../common/options.service';\nimport { TranslateService } from '../i18n/translate.service';\nimport { CookieBannerService } from '../bootstrap/cookie-banner/cookie-banner.service';\n\n/**\n * A service to manage the Gainsight integration. It allows to load the\n * tag and\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class GainsightService {\n /**\n * A subject that emits the tag function as soon as a new tag is set.\n */\n tagFunction$ = new BehaviorSubject(null);\n\n private readonly GAINSIGHT_URL = 'web-sdk.aptrinsic.com/api/aptrinsic.js?a=';\n private readonly GAINSIGHT_GLOBAL_SCOPE = 'aptrinsic';\n private readonly SCRIPT_EXECUTION_WAIT_TIME = 500;\n private readonly OPTIONS_KEY_CATEGORY = 'gainsight';\n private readonly OPTIONS_KEY_NAME = 'api.key';\n\n constructor(\n private appState: AppStateService,\n private options: OptionsService,\n private cookieBannerService: CookieBannerService\n ) {}\n\n /**\n * Returns the tag global function which can be used to identify user\n * or add special events.\n */\n get tagFunction() {\n return (window as any)[this.GAINSIGHT_GLOBAL_SCOPE];\n }\n\n /**\n * Load the script tag and calls the identify function to start the tracking.\n * @param accountId The account where the user is registered. Could be the name of the tenant.\n * @param identify If set to false, only the tag is loaded.\n */\n async loadTag(accountId, identify = true) {\n const scriptTag = document.createElement('script');\n const key =\n this.options.gainsightKey ||\n (await this.options.getSystemOption(this.OPTIONS_KEY_CATEGORY, this.OPTIONS_KEY_NAME));\n\n if (key) {\n this.loadScriptTag(scriptTag, key);\n combineLatest(\n this.appState.currentUser,\n fromEvent(scriptTag, 'load'),\n this.appState.state$.pipe(\n filter(({ versions }) => versions.backend),\n map(({ versions }) => versions),\n take(1)\n )\n )\n .pipe(\n delay(this.SCRIPT_EXECUTION_WAIT_TIME),\n filter(([user, scriptEvent]) => !!(scriptEvent && user))\n )\n .subscribe(([user, scriptEvent, versions]) => {\n const instanceId = this.getInstanceIdFromUrl();\n if (identify) {\n this.identify(user, accountId, instanceId, versions.ui.ngx, versions.backend);\n }\n this.tagFunction$.next(this.tagFunction);\n });\n }\n }\n\n /**\n * Identifies the user/account at Gainsight.\n * @param userId The user id which is given to Gainsight.\n * @param accountId The account id which is given to Gainsight (e.g. the tenant name)\n * @param versionUI The UI version used.\n * @param versionBE The BE version used.\n */\n identify(user, accountId, instanceId, versionUI?, versionBE?) {\n const windowRef = window as any;\n const { id: userId, email, userName, phone, firstName, lastName } = user;\n windowRef[this.GAINSIGHT_GLOBAL_SCOPE](\n 'identify',\n {\n id: `${userId}_${accountId}_${instanceId}`,\n email,\n userName,\n firstName,\n lastName,\n versionUI,\n versionBE,\n userLanguage: TranslateService.defaultLang(),\n instanceId\n },\n {\n id: `${accountId}_${instanceId}`,\n instanceId\n }\n );\n }\n\n triggerEvent(eventName: string, props?: object) {\n if (this.tagFunction && eventName) {\n eventName = eventName.replace(/ /g, '_');\n this.tagFunction('track', eventName, props);\n }\n }\n\n /**\n * Checks if the Gainsight's tag should be loaded.\n * Where no consent is required from the user. The decision to load Gainsight will depend on custom properties.\n * Where the user's consent is required. The decision to load Gainsight will depend on custom properties and functional cookies.\n * By default, the Gainsight's tag will be loaded.\n * @param customProperties Tenant's customProperties.\n */\n shouldLoadGainsightTag(customProperties: ICustomProperties): boolean {\n return (\n (!this.cookieBannerService.isConfigCookiePreferencesDefined() &&\n !this.isGainsightDisabled(customProperties)) ||\n (!this.cookieBannerService.isFunctionalCookieDisabled() &&\n !this.isGainsightDisabled(customProperties))\n );\n }\n\n private isGainsightDisabled(customProperties: ICustomProperties) {\n const gainsightEnabled = customProperties && customProperties.gainsightEnabled;\n return gainsightEnabled === false;\n }\n\n private loadScriptTag(scriptTag: HTMLScriptElement, key: string) {\n try {\n const windowRef = window as any;\n const firstTag = document.getElementsByTagName('script')[0];\n const protocol = location.protocol;\n const gainsightGlobalScope = this.GAINSIGHT_GLOBAL_SCOPE;\n scriptTag.src = `${protocol}//${this.GAINSIGHT_URL}${key}`;\n (windowRef[this.GAINSIGHT_GLOBAL_SCOPE] =\n windowRef[this.GAINSIGHT_GLOBAL_SCOPE] ||\n // tslint:disable-next-line:only-arrow-functions\n function() {\n (windowRef[gainsightGlobalScope].q = windowRef[gainsightGlobalScope].q || []).push(\n arguments\n );\n }),\n (windowRef[gainsightGlobalScope].p = key);\n scriptTag.async = true;\n firstTag.parentNode.insertBefore(scriptTag, firstTag);\n } catch (ex) {\n console.warn('Failed to load Gainsight PX', ex);\n }\n }\n\n private getInstanceIdFromUrl() {\n const hostName = location.hostname;\n return hostName.substring(hostName.indexOf('.') + 1);\n }\n}\n","import { Directive, HostListener, Input } from '@angular/core';\nimport { GainsightService } from './gainsight.service';\n\n@Directive({\n selector: '[c8yProductExperience]'\n})\nexport class ProductExperienceDirective {\n @Input() actionName: string;\n @Input() actionData: object;\n constructor(private gainsightService: GainsightService) {}\n\n @HostListener('click')\n onClick() {\n if (this.actionName) {\n this.gainsightService.triggerEvent(this.actionName, this.actionData);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ICurrentTenant } from '@c8y/client';\nimport { combineLatest } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport { CookieBannerService } from '../bootstrap/cookie-banner/cookie-banner.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { GainsightService } from './gainsight.service';\nimport { ProductExperienceDirective } from './product-experience.directive';\n/**\n * This module enables an tenant to activate the product experience\n * software [Gainsight](https://www.gainsight.com/product-experience/) to help\n * and track user actions. Gainsight is only activated, if the tenant custom\n * property `gainsightEnabled` is set to true.\n */\n@NgModule({\n declarations: [ProductExperienceDirective],\n exports: [ProductExperienceDirective],\n providers: [GainsightService]\n})\nexport class ProductExperienceModule {\n constructor(\n private appState: AppStateService,\n private gainsightService: GainsightService,\n private cookieBannerService: CookieBannerService\n ) {\n combineLatest([\n this.appState.currentTenant.pipe(filter<ICurrentTenant>(Boolean)),\n this.cookieBannerService.isCookieBannerShowed$\n ]).subscribe(([currentTenant, isCookieBannerShowed]) => {\n if (isCookieBannerShowed) {\n return;\n }\n const { customProperties, name } = currentTenant;\n\n if (this.gainsightService.shouldLoadGainsightTag(customProperties)) {\n this.gainsightService.loadTag(name);\n }\n });\n }\n}\n","import { Component, Input, ViewChild, ElementRef } from '@angular/core';\nimport { Search } from './search.model';\nimport { sortBy } from 'lodash';\nimport { AlertService } from '../alert/alert.service';\nimport { Alert } from '../alert/alert.model';\n\n@Component({\n selector: 'c8y-search-outlet',\n templateUrl: './search-outlet.component.html'\n})\nexport class SearchOutletComponent {\n @Input() search: Search[] = [];\n\n constructor(private alertService: AlertService) {}\n\n openSearch() {\n setTimeout(() => this.focusInputBox(), 100);\n }\n\n getByPriority() {\n return sortBy(this.search, this.byPriority);\n }\n\n closeDropdown(dropdown) {\n dropdown.hide();\n }\n\n verifyNotEmpty(term) {\n if (!term || term === '') {\n this.alertService.add({ text: 'Type something to execute a search.', type: 'warning' });\n }\n }\n\n private byPriority(item) {\n return -item.priority;\n }\n\n private focusInputBox() {\n const elementToFocus: any = document.querySelector('#search-header-menu input');\n if (elementToFocus) {\n elementToFocus.focus();\n }\n }\n}\n","import { Component, Input, Output, ViewChild, EventEmitter } from '@angular/core';\nimport { Search } from './search.model';\nimport { SearchService } from './search.service';\n\n@Component({\n selector: 'c8y-search',\n templateUrl: './search.component.html'\n})\nexport class SearchComponent implements Search {\n @Input() name: string;\n @Input() icon: string = 'search';\n @Input() priority: number = 0;\n @ViewChild('template', {static: false}) template: any;\n @Output() search = new EventEmitter<Search>();\n @Input() term: string = '';\n\n private viewInitTimeout;\n\n constructor(private searchService: SearchService) { }\n\n onSearch() {\n this.search.emit(this);\n }\n\n ngAfterViewInit() {\n this.template = undefined;\n this.viewInitTimeout = setTimeout(() => this.searchService.add(this as Search));\n }\n\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.searchService.remove(this as Search);\n }\n}\n","import {\n Component,\n ElementRef,\n Input,\n ViewChild\n} from '@angular/core';\nimport { escape, escapeRegExp } from 'lodash-es';\n\n@Component({\n selector: 'c8y-highlight',\n template: '<span [innerHTML]=\"highlightedText\"></span>'\n})\nexport class HighlightComponent {\n @ViewChild('text', { read: ElementRef, static: true })\n container: ElementRef;\n\n @Input()\n pattern: string = '';\n\n @Input()\n text: string = '';\n\n @Input()\n elementClass: string = 'text-info';\n\n highlightedText: string = '';\n\n ngOnChanges(): void {\n const textNoHtml = escape(this.text || '');\n const patternNoHtml = escape(this.pattern || '');\n const patternForRegex = escapeRegExp(patternNoHtml).replace(/\\\\\\*/g, '.*');\n this.highlightedText = textNoHtml.replace(\n new RegExp(patternForRegex, 'i'),\n `<strong class=\"${this.elementClass}\">$&</strong>`\n );\n }\n}\n","import { Component, Input} from '@angular/core';\r\nimport { gettext } from '../i18n/gettext';\r\n\r\n@Component({\r\n selector: 'c8y-search-result-empty',\r\n templateUrl: './search-result-empty.component.html'\r\n})\r\nexport class SearchResultEmptyComponent {\r\n private readonly NO_RESULT_FOUND = gettext('No results found.');\r\n private msg: string = this.NO_RESULT_FOUND;\r\n\r\n @Input('message')\r\n set _message(msg: string) {\r\n if (msg && msg.length > 0) {\r\n this.msg = msg;\r\n } else {\r\n this.msg = this.NO_RESULT_FOUND;\r\n }\r\n }\r\n\r\n get message() {\r\n return this.msg;\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { CommonModule } from '../common/common.module';\nimport { SearchOutletComponent } from './search-outlet.component';\nimport { SearchComponent } from './search.component';\nimport { SearchService } from './search.service';\nimport { FormsModule } from '@angular/forms';\nimport { HighlightComponent } from './highlight.component';\nimport { SearchResultEmptyComponent } from './search-result-empty.component';\n\n/**\n * The angular module definition for the search.\n * @exports SearchComponent\n * @exports SearchOutletComponent\n * @exports HighlightComponent A component to highlight search results.\n */\n@NgModule({\n declarations: [\n SearchOutletComponent,\n SearchComponent,\n HighlightComponent,\n SearchResultEmptyComponent\n ],\n imports: [\n FormsModule,\n BsDropdownModule,\n CommonModule,\n RouterModule.forChild([])\n ],\n exports: [\n SearchOutletComponent,\n SearchComponent,\n HighlightComponent,\n SearchResultEmptyComponent\n ]\n})\nexport class SearchModule { }\n","import { Component, Input, ViewChild, EventEmitter, Output } from '@angular/core';\nimport { UserMenuItem } from './user.model';\nimport { UserMenuService } from './user-menu.service';\n\n@Component({\n selector: 'c8y-user-menu-item',\n templateUrl: './user-menu-item.component.html'\n})\nexport class UserMenuItemComponent implements UserMenuItem {\n @Input()\n icon: string;\n @Input()\n label: string;\n @Input()\n link: string;\n @Input()\n target: string;\n @Input()\n priority = 0;\n @ViewChild('template', {static: false}) template: any;\n\n @Output()\n click = new EventEmitter<UserMenuItem>();\n private viewInitTimeout;\n\n constructor(private userService: UserMenuService) { }\n\n ngAfterViewInit() {\n this.viewInitTimeout = setTimeout(() =>\n this.userService.add(this as UserMenuItem)\n );\n }\n\n ngOnDestroy() {\n clearTimeout(this.viewInitTimeout);\n this.userService.remove(this as UserMenuItem);\n }\n\n onClick() {\n this.click.emit(this);\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { BasicAuth, FetchClient, ICredentials, IUser, UserService } from '@c8y/client';\nimport { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';\nimport { AlertService } from '../alert/alert.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { UserPreferencesService } from '../common/user-preferences/user-preferences.service';\nimport { gettext } from '../i18n/gettext';\nimport { TranslateService } from '../i18n/translate.service';\nimport { take } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-user-edit-modal',\n templateUrl: './user-edit-modal.component.html'\n})\nexport class UserEditModalComponent implements OnInit {\n currentUser: IUser;\n lang: string;\n changedLang: string;\n loading = false;\n\n constructor(\n public modal: BsModalRef,\n public user: UserService,\n public ui: AppStateService,\n private auth: BasicAuth,\n private client: FetchClient,\n private alert: AlertService,\n private translate: TranslateService,\n private userPreferences: UserPreferencesService,\n private modalService: BsModalService\n ) {\n this.lang = this.ui.state.lang;\n this.modalService.onHide.pipe(take(1)).subscribe(( reason: string ) => {\n if (reason !== null && this.changedLang !== undefined) {\n this.translate.switchToLanguage(this.lang);\n }\n });\n }\n\n ngOnInit() {\n this.updateUserInAppState();\n }\n\n onDismiss() {\n if (this.changedLang !== undefined) {\n this.translate.switchToLanguage(this.lang);\n }\n this.modal.hide();\n }\n\n onLanguage(lang) {\n this.changedLang = lang;\n this.translate.switchToLanguage(this.changedLang);\n }\n\n async updateAndClose(user) {\n this.loading = true;\n try {\n await this.user.updateCurrent(user);\n if (user.password) {\n this.updateCredentials(user.password);\n }\n await this.updateUserInAppState();\n if (this.changedLang && this.changedLang !== this.lang) {\n await this.persistLanguage(this.changedLang);\n }\n this.modal.hide();\n this.alert.success(gettext('User saved.'));\n } catch (e) {\n this.alert.addServerFailure(e);\n } finally {\n this.loading = false;\n }\n }\n\n async persistLanguage(lang) {\n this.translate.saveInLocalStorage(lang);\n this.userPreferences.set('language', lang);\n }\n\n private async updateUserInAppState() {\n const currentUserResult = await this.user.current();\n this.ui.currentUser.next(currentUserResult.data);\n }\n\n private updateCredentials(password: string) {\n const newCredentials: ICredentials = {\n password,\n user: this.ui.currentUser.value.id,\n tenant: this.client.tenant\n };\n this.auth.updateCredentials(newCredentials);\n }\n}\n","import { Injectable, Optional } from '@angular/core';\nimport {\n BasicAuth,\n CookieAuth,\n FetchClient,\n IAuthentication,\n ICredentials,\n ITenantLoginOption,\n Realtime,\n TenantService,\n UserService\n} from '@c8y/client';\nimport { AppStateService } from '../common/ui-state.service';\nimport { AlertService } from '../alert/alert.service';\nimport { gettext } from '../i18n/gettext';\nimport { ApiService } from '@c8y/ngx-components/api';\nimport { switchMap } from 'rxjs/operators';\nimport { EMPTY } from 'rxjs';\nimport { LocationStrategy } from '@angular/common';\nimport { get, isString } from 'lodash-es';\n\n/**\n * Service to manage the login.\n */\n@Injectable()\nexport class LoginService {\n rememberMe: boolean = false;\n TOKEN_KEY: string = '_tcy8';\n TFATOKEN_KEY: string = 'TFAToken';\n OAUTH2_INTERNAL_TYPE: string = 'OAUTH2_INTERNAL';\n loginMode: any;\n oauthOptions: any;\n isFirstLogin = true;\n GREEN_MIN_LENGTH_DEFAULT = 8;\n\n // tslint:disable:max-line-length\n ERROR_MESSAGES = {\n minlength: gettext('Password must have at least 8 characters and no more than 32.'),\n password_missmatch: gettext('Password confirmation does not match.'),\n maxlength: gettext('Password must have at least 8 characters and no more than 32.'),\n password_strength: gettext(\n 'Your password is not strong enough. Please include numbers, lower and upper case characters'\n ),\n remote_error: gettext('Server error occurred.'),\n email: gettext('Invalid email address.'),\n password_change: gettext('Your password is expired. Please set a new password.'),\n password_reset_token_expired: gettext(\n 'Password reset link expired. Please enter your email address to receive a new one.'\n ),\n tfa_pin_invalid: gettext('The code you entered is invalid. Please try again.'),\n pattern_phonenumber: gettext(\n 'Invalid phone number format. Only digits, spaces, slashes (\"/\") and dashes (\"-\") allowed.'\n ),\n pattern_newPassword: gettext(\n 'Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:\\'\",.<>{}[]\\\\/'\n ),\n international_number_required: gettext(\n 'International phone number required, in the format +49 9 876 543 210.'\n ),\n phone_number_error: gettext('Could not update phone number.'),\n pinAlreadySent: gettext(\n 'The verification code was already sent. For a new verification code, please click on the link above.'\n ),\n passwordConfirm: gettext('Password confirmation does not match.'),\n tfaExpired: gettext('Two-factor authentication token expired.')\n };\n // tslint:enable:max-line-length\n\n private SUCCESS_MESSAGES = {\n password_changed: gettext('Password changed. You can now log in using new password.'),\n password_reset_requested: gettext(\n 'Password reset request has been sent. Please check your email.'\n ),\n resend_sms: gettext('Verification code SMS resent.'),\n send_sms: gettext('Verification code SMS sent.')\n };\n\n private passwordStrengthSetting = {\n enforcePasswordStrength: false,\n greenMinLength: this.GREEN_MIN_LENGTH_DEFAULT,\n passwordStrengthValidity: false\n };\n\n private localhostRegExp = new RegExp('localhost');\n private localhostIpRegExp = new RegExp('127.0.0.1');\n private showTenantRegExp = new RegExp('showTenant');\n\n constructor(\n private client: FetchClient,\n private basicAuth: BasicAuth,\n private cookieAuth: CookieAuth,\n private ui: AppStateService,\n private user: UserService,\n private tenant: TenantService,\n private realtime: Realtime,\n private alert: AlertService,\n private api: ApiService,\n @Optional() private location: LocationStrategy\n ) {\n this.autoLogout();\n this.initLoginOptions();\n }\n\n /**\n * Returns the current tenant.\n * @return The tenant name.\n */\n getTenant() {\n return this.client.tenant;\n }\n\n initLoginOptions() {\n const loginOptions = this.ui.state.loginOptions || [];\n const isOAuth2 = ({ type, grantType }) =>\n type === 'OAUTH2' && grantType === 'AUTHORIZATION_CODE';\n this.loginMode = loginOptions.find(({ type }) => type === 'OAUTH2_INTERNAL') ||\n loginOptions.find(({ type }) => type === 'BASIC') ||\n loginOptions.find(isOAuth2) || { type: 'BASIC' };\n this.oauthOptions = loginOptions.find(isOAuth2) || {};\n }\n\n redirectToOauth() {\n const { initRequest } = this.oauthOptions;\n const fullPath = (this.location ? (this.location as any)._platformLocation : window).location\n .href;\n const redirectUrl = encodeURIComponent(fullPath);\n const originUriParam = `${initRequest.includes('?') ? '&' : '?'}originUri=${redirectUrl}`;\n window.location.href = `${initRequest}${originUriParam}`;\n }\n\n autoLogout() {\n const errorPattern = /invalid\\scredentials.*pin.*generate/i;\n const isTfaExpired = data =>\n data && typeof data.message === 'string' && errorPattern.test(data.message);\n this.ui.currentUser\n .pipe(\n switchMap(u =>\n u ? this.api.hookResponse(({ response }) => response.status === 401) : EMPTY\n )\n )\n .subscribe(async (apiCall: any) => {\n const { response } = apiCall;\n let willLogout = false;\n if (isTfaExpired(response.data)) {\n willLogout = true;\n } else {\n if (typeof response.json === 'function') {\n const data = await response.clone().json();\n if (isTfaExpired(data)) {\n willLogout = true;\n }\n }\n }\n if (willLogout) {\n this.logout(false);\n setTimeout(() => this.alert.danger(this.ERROR_MESSAGES.tfaExpired), 500);\n }\n });\n }\n\n /**\n * Gets the minimal number of characters that a password should have to be considered a “green” strong one.\n * @return The min length for password or default value.\n */\n async getGreenMinLength() {\n const { greenMinLength } = await this.getBasicAuthLoginOption() || { greenMinLength: null };\n this.passwordStrengthSetting.greenMinLength = greenMinLength || this.GREEN_MIN_LENGTH_DEFAULT;\n return this.passwordStrengthSetting.greenMinLength;\n }\n\n /**\n * Checks if password strength is enforced for system\n * by retrieving value of `enforceStrength` property from loginOptions response\n * @param refresh boolean used to refresh the app state where result of loginOptions response is stored.\n * If false, it takes value from memory,\n * if true, it refresh the app state value and then retrives data.\n * @return boolean value, true if enforced, false otherwise.\n */\n async getEnforcePasswordStrength(refresh?) {\n return this.getBasicAuthLoginOption(refresh).then((loginOption) => {\n const enforcePasswordStrength = get(loginOption, 'enforceStrength');\n if (isString(enforcePasswordStrength)) {\n this.passwordStrengthSetting.enforcePasswordStrength = enforcePasswordStrength === 'true' ? true : false;\n } else {\n this.passwordStrengthSetting.enforcePasswordStrength = !!enforcePasswordStrength;\n }\n return this.passwordStrengthSetting.enforcePasswordStrength;\n });\n }\n\n /**\n * Checks if password strength is enforced for particular tenant\n * by retrieving value of `strengthValidity` property from loginOptions response\n * @param refresh boolean used to refresh the app state where result of loginOptions response is stored.\n * If false, it takes value from memory,\n * if true, it refresh the app state value and then retrives data.\n * @return boolean value, true if enforced, false otherwise.\n */\n async getPasswordStrengthValidity(refresh?) {\n return this.getBasicAuthLoginOption(refresh).then((loginOption) => {\n const strengthValidity = get(loginOption, 'strengthValidity');\n if (isString(strengthValidity)) {\n this.passwordStrengthSetting.passwordStrengthValidity = strengthValidity === 'true' ? true : false;\n } else {\n this.passwordStrengthSetting.passwordStrengthValidity = !!strengthValidity;\n }\n return this.passwordStrengthSetting.passwordStrengthValidity;\n });\n }\n\n /**\n * Function determines if enforced strength checks should be enabled for current tenant\n * based on properties retrieved from loginOptions\n * @param options object containing specific options:\n * - {refresh: true} - refreshes values of app state and returns fresh values as result of call\n * @return boolean value, true if strength is enforced for tenant, false otherwise.\n */\n async getPasswordStrengthEnforced(options?) {\n const refresh = options && options.refresh;\n return Promise.all([this.getEnforcePasswordStrength(refresh), this.getPasswordStrengthValidity(refresh)]).then((values) => {\n const [enforcePasswordStrength, passwordStrengthValidity] = values;\n return enforcePasswordStrength || passwordStrengthValidity;\n });\n }\n\n /**\n * Clears all backend errors.\n */\n cleanMessages() {\n this.alert.clearAll();\n }\n\n /**\n * Adds a new success message\n * @param successKey The key of the success message as used in SUCCESS_MESSAGES\n */\n addSuccessMessage(successKey: string) {\n const successMessage = this.SUCCESS_MESSAGES[successKey];\n if (successMessage) {\n this.alert.add({\n text: successMessage,\n type: 'success',\n timeout: 0\n });\n }\n }\n\n /**\n * Returns the current strategy. Defaults to cookie, if a token\n * is found in local or session storage we switch to basic auth.\n * @returns The current auth strategy.\n */\n getAuthStrategy(): IAuthentication {\n let authStrategy = this.cookieAuth as IAuthentication;\n const token = this.getStoredToken();\n const tfa = this.getStoredTfaToken();\n if (token) {\n authStrategy = this.basicAuth;\n this.setCredentials({ token, tfa }, this.basicAuth);\n }\n return authStrategy;\n }\n\n /**\n * Forces the use of basic auth as strategy with this credentials.\n * @param credentials The credentials to use.\n */\n useBasicAuth(credentials: ICredentials) {\n this.setCredentials(credentials, this.basicAuth);\n return this.basicAuth;\n }\n\n /**\n * Tries to login a user with the given credentials.\n * If successful, the current tenant and user is set. If not an error\n * is thrown. It also verifies if the user is allowed to open the\n * current app.\n * @param auth The authentication strategy used.\n * @param credentials The credentials to try to login.\n */\n async login(auth: IAuthentication = this.getAuthStrategy(), credentials?: ICredentials) {\n this.client.setAuth(auth);\n\n const tenantRes = await this.tenant.current();\n const tenant = tenantRes.data;\n\n if (await this.switchLoginMode(credentials)) {\n auth = this.cookieAuth;\n }\n\n const userRes = await this.user.current();\n const user = userRes.data;\n await this.verifyAppAccess();\n\n const supportUserName = this.getSupportUserName(credentials);\n const token = this.setCredentials(\n {\n tenant: tenant.name,\n user: (supportUserName ? `${supportUserName}$` : '') + user.userName\n },\n auth\n );\n\n if (token) {\n this.storeBasicAuthToken(token);\n }\n\n await this.authFulfilled(tenant, user, supportUserName);\n }\n\n /**\n * Saves tenant, user and support user info to the app state.\n * @param tenant The current tenant object.\n * @param user The current user object.\n * @param supportUserName The current support user name.\n */\n async authFulfilled(tenant?, user?, supportUserName?) {\n if (!tenant) {\n const { data } = await this.tenant.current();\n tenant = data;\n this.client.tenant = tenant.name;\n }\n\n if (!user) {\n const { data } = await this.user.current();\n user = data;\n }\n\n if (!supportUserName) {\n supportUserName = null;\n }\n\n this.ui.setUser({ user, supportUserName });\n this.ui.currentTenant.next(tenant);\n }\n\n /**\n * Switch the login mode to CookieAuth if the\n * user has configured to use it in loginOptions.\n * @param credentials The credentials for that login\n */\n async switchLoginMode(credentials?: ICredentials) {\n const isPasswordGrantLogin = this.isPasswordGrantLogin(credentials);\n if (isPasswordGrantLogin && credentials) {\n const params = new URLSearchParams({\n grant_type: 'PASSWORD',\n username: credentials.user,\n password: credentials.password,\n tfa_code: credentials.tfa\n });\n const urlParams = new URLSearchParams(this.loginMode.initRequest.split('?').pop());\n credentials.tenant = urlParams.get('tenant_id');\n const res = await this.client.fetch(`tenant/oauth?${urlParams.toString()}`, {\n method: 'POST',\n body: params.toString(),\n headers: {\n 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8'\n }\n });\n if (!(res as Response).ok) {\n try {\n const data = await res.json();\n throw { res, data };\n } catch (ex) {\n throw ex;\n }\n }\n this.client.setAuth(this.cookieAuth);\n this.cleanLocalStorage();\n this.basicAuth.logout();\n }\n return isPasswordGrantLogin;\n }\n\n isPasswordGrantLogin(credentials?: ICredentials) {\n return !!(\n !this.isSupportUser(credentials) &&\n this.loginMode &&\n this.loginMode.type === this.OAUTH2_INTERNAL_TYPE\n );\n }\n\n /**\n * Verifies if the provided credentials use a support user to log in or not.\n * @param credentials Credentials to check.\n * @returns True if user is a support user.\n */\n isSupportUser(credentials?: ICredentials): boolean {\n return credentials && credentials.user.includes('$');\n }\n\n /**\n * Verifies if the tenant input field should be shown\n * or not.\n * @returns If true, show the tenant input.\n */\n showTenant(): boolean {\n return !this.ui.state.loginOptions || this.isLocal() || this.isShowTenant();\n }\n\n /**\n * Logs the user out\n * @param reload If set to false, the page will not reload\n */\n async logout(reload = true) {\n let resData = null;\n try {\n const [basicRes, cookieRes] = await this.reset();\n resData = await cookieRes.json();\n } catch (ex) {\n this.alert.removeLastDanger();\n } finally {\n if (resData && resData.url) {\n this.redirect(resData.url);\n } else if (reload) {\n this.location.replaceState({}, '', '', '');\n window.location.reload();\n }\n }\n }\n\n /**\n * Resets the stored auth-data\n */\n async reset() {\n this.cleanLocalStorage();\n this.cleanSessionStorage();\n this.realtime.disconnect();\n this.ui.currentUser.next(null);\n return Promise.all([this.basicAuth.logout(), this.cookieAuth.logout()]);\n }\n\n /**\n * Saves the TFA token to local or session storage.\n * @param tfaToken The tfa token to save.\n * @param storage The storage to use (local or session).\n */\n saveTFAToken(tfaToken: string, storage: Storage) {\n storage.setItem(this.TFATOKEN_KEY, tfaToken);\n }\n\n /**\n * Request the manifest -> on 401 user has no access to that application\n * and we throw the error up to the login form.\n */\n async verifyAppAccess() {\n try {\n await this.ui.loadManifest();\n } catch (ex) {\n if (!(ex.res && ex.res.status === 404 && this.isLocal())) {\n throw ex;\n }\n }\n }\n\n /**\n * Sets the tenant to the client and updates the credentials on the\n * auth strategy.\n * @param credentials The name of the tenant.\n * @param authStrategy The authentication strategy used.\n * @return Returns the token if basic auth, otherwise undefined.\n */\n private setCredentials(credentials: ICredentials, authStrategy: IAuthentication) {\n if (credentials.tenant) {\n this.client.tenant = credentials.tenant;\n }\n // Check if a token is already set (case for support user login)\n // if yes -> we just need to update the user, and reuse the token\n // of the support user.\n // Therefore we need to pass user and tenant, to get\n // just the stored token and nothing else (see BasicAuth.ts:31).\n const token = this.basicAuth.updateCredentials({\n tenant: credentials.tenant,\n user: credentials.user\n });\n const newCredentials = { token, ...credentials };\n\n return authStrategy.updateCredentials(newCredentials);\n }\n\n /**\n * Verifies if the current user is a developer or not.\n * Running on localhost means development mode.\n */\n private isLocal(): boolean {\n const hostname = window.location.hostname;\n return this.localhostIpRegExp.test(hostname) || this.localhostRegExp.test(hostname);\n }\n\n /**\n * Save the token to local or session storage.\n * @param token The token to save.\n * @param storage The storage to use (local or session).\n */\n private saveToken(token: string, storage: Storage) {\n storage.setItem(this.TOKEN_KEY, token);\n }\n\n private storeBasicAuthToken(token: string) {\n this.saveToken(token, sessionStorage);\n if (this.rememberMe) {\n this.saveToken(token, localStorage);\n }\n }\n\n private cleanLocalStorage() {\n localStorage.removeItem(this.TOKEN_KEY);\n localStorage.removeItem(this.TFATOKEN_KEY);\n }\n\n private cleanSessionStorage() {\n sessionStorage.removeItem(this.TOKEN_KEY);\n sessionStorage.removeItem(this.TFATOKEN_KEY);\n }\n\n private isShowTenant(): boolean {\n return this.showTenantRegExp.test(window.location.href);\n }\n\n private redirect(url: string) {\n window.location.href = url;\n }\n\n private async getBasicAuthLoginOption(refresh?): Promise<ITenantLoginOption> {\n if (refresh) {\n await this.ui.refreshLoginOptions();\n }\n const loginOptions = this.ui.state.loginOptions || [];\n const basicAuthLoginOption = loginOptions.find(({ type }) => type === 'BASIC');\n return Promise.resolve(basicAuthLoginOption);\n }\n\n /**\n * Gets support user name from credentials.\n * @param credentials Credentials object (defaults to the stored one).\n * @returns Support user name.\n */\n private getSupportUserName(credentials: ICredentials = this.getStoredCredentials()): string {\n if (!credentials) {\n return null;\n }\n const supportUserName = credentials.user.match(/^(.+\\/)?((.+)\\$)?(.+)?$/)[3];\n return supportUserName;\n }\n\n /**\n * Gets credentials object from the stored token.\n * @returns Credentials object.\n */\n private getStoredCredentials(): ICredentials {\n const token = this.getStoredToken();\n if (!token) {\n return null;\n }\n return this.decodeToken(token);\n }\n\n /**\n * Gets stored token from local storage or session storage.\n * @returns Stored token.\n */\n private getStoredToken(): string {\n return localStorage.getItem(this.TOKEN_KEY) || sessionStorage.getItem(this.TOKEN_KEY);\n }\n\n /**\n * Gets stored TFA token from local storage or session storage.\n * @returns Stored TFA token.\n */\n private getStoredTfaToken(): string {\n return localStorage.getItem(this.TFATOKEN_KEY) || sessionStorage.getItem(this.TFATOKEN_KEY);\n }\n\n /**\n * Decodes token to credentials object.\n * @param token Token to decode.\n * @returns Credentials object.\n */\n private decodeToken(token: string): ICredentials {\n const decoded = decodeURIComponent(escape(window.atob(token)));\n const split = decoded.match(/(([^/]*)\\/)?([^/:]+):(.+)/);\n\n return {\n tenant: split[2],\n user: split[3],\n password: split[4]\n };\n }\n}\n","import { Component, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { UserService, ICredentials, FetchClient, Client, IAuthentication } from '@c8y/client';\nimport { AppStateService } from '../common/ui-state.service';\nimport { AlertService } from '../alert/alert.service';\nimport { ModalComponent } from '../modal/modal.component';\nimport { LoginService } from '../login/login.service';\nimport { clone } from 'lodash-es';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-password-confirm-modal',\n templateUrl: './password-confirm-modal.component.html'\n})\nexport class PasswordConfirmModalComponent {\n @Output() passwordConfirmedEmitter = new EventEmitter<boolean>();\n loading = false;\n password: string;\n\n @ViewChild('modal', { static: false }) private modal: ModalComponent;\n\n constructor(\n public user: UserService,\n public ui: AppStateService,\n private client: FetchClient,\n private alert: AlertService,\n private loginService: LoginService\n ) {}\n\n async passwordConfirm() {\n if (this.password) {\n const supportUserName = this.ui.currentSupportUserName.value;\n const userId = this.ui.currentUser.value.id;\n const credentials: ICredentials = {\n password: this.password,\n user: `${supportUserName ? `${supportUserName}$` : ''}${userId}`,\n tenant: this.client.tenant\n };\n try {\n this.loading = true;\n const strategy = clone(this.loginService.useBasicAuth({}));\n delete credentials.tfa;\n strategy.updateCredentials(credentials);\n const newClient = this.createNewClient(strategy, this.client.baseUrl);\n await newClient.user.current();\n this.emitSuccessAndClose();\n } catch (e) {\n if (e.res && e.res.status === 401 && e.data && /pin|totp/i.test(e.data.message)) {\n this.emitSuccessAndClose();\n } else {\n this.alert.danger(gettext(\"Provided password doesn't match your current one.\"));\n }\n } finally {\n this.loading = false;\n }\n }\n }\n\n cancel() {\n this.passwordConfirmedEmitter.emit(false);\n this.modal._dismiss();\n }\n\n createNewClient(strategy: IAuthentication, baseUrl: string) {\n return new Client(strategy, baseUrl);\n }\n\n private emitSuccessAndClose() {\n this.passwordConfirmedEmitter.emit(true);\n this.modal._dismiss();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PasswordStrength } from '@c8y/client';\nimport { filter } from 'lodash-es';\nimport { PasswordStrengthColor } from './password.model';\nimport { gettext } from '../i18n/gettext';\nimport { PasswordConfirmModalComponent } from './password-confirm-modal.component';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { take } from 'rxjs/operators';\n\n@Injectable()\nexport class PasswordService {\n private DEFAULT_PASSWORD_MIN_LENGTH = 8;\n\n private GREEN: PasswordStrengthColor = {\n colorName: 'green',\n color: 'rgb(0, 128, 0)',\n description: gettext('strong'),\n passwordStrength: PasswordStrength.GREEN\n };\n private YELLOW: PasswordStrengthColor = {\n colorName: 'yellow',\n color: 'rgb(255, 204, 51)',\n description: gettext('medium'),\n passwordStrength: PasswordStrength.YELLOW\n };\n private RED: PasswordStrengthColor = {\n colorName: 'red',\n color: 'rgb(170, 0, 51)',\n description: gettext('weak'),\n passwordStrength: PasswordStrength.RED\n };\n\n constructor(private modalService: BsModalService) {}\n\n confirmPassword() {\n const modalInstance: any = this.modalService.show(PasswordConfirmModalComponent);\n return modalInstance.content.passwordConfirmedEmitter.pipe(take(1));\n }\n\n hasLowerCase(password: string) {\n return (password.search(/[a-z]/) !== -1);\n }\n\n hasUpperCase(password: string) {\n return (password.search(/[A-Z]/) !== -1);\n }\n\n hasNumbers(password: string) {\n return (password.search(/[0-9]/) !== -1);\n }\n\n hasSpecialChars(password: string) {\n return (password.search(/[^0-9a-zA-Z]+/) !== -1);\n }\n\n getStrengthColor(password: string): PasswordStrengthColor {\n const passwordStrength = filter([\n this.hasLowerCase(password),\n this.hasUpperCase(password),\n this.hasNumbers(password),\n this.hasSpecialChars(password)\n ]).length;\n\n if (passwordStrength > 3) {\n return this.GREEN;\n } else if (passwordStrength >= 3) {\n return this.YELLOW;\n } else {\n return this.RED;\n }\n }\n\n getDefaultPasswordMinLength() {\n return this.DEFAULT_PASSWORD_MIN_LENGTH;\n }\n}\n","import { Component } from '@angular/core';\nimport { UserService } from '@c8y/client';\nimport { Status } from '../common/status.model';\nimport { gettext } from '../i18n/gettext';\nimport { ModalService } from '../modal/modal.service';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { LoginService } from '../login/login.service';\n\n@Component({\n selector: 'c8y-user-totp-setup',\n templateUrl: './user-totp-setup.component.html'\n})\nexport class UserTotpSetupComponent {\n constructor(\n private user: UserService,\n private modalService: ModalService,\n private modal: BsModalRef,\n private loginService: LoginService) { }\n\n async totpSetupVerified(token) {\n await this.user.activateTotp();\n this.modal.hide();\n try {\n await this.modalService.acknowledge(\n gettext('Logout required'),\n gettext('You must log out in order to apply your changes'),\n Status.WARNING,\n gettext('Log out')\n );\n await this.loginService.logout();\n } catch (ex) {\n // intended empty\n }\n }\n\n close() {\n this.modal.hide();\n }\n}\n","import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\nimport {\n IUser,\n UserService,\n TenantLoginOptionsService,\n TenantService\n} from '@c8y/client';\nimport { clone } from 'lodash-es';\nimport { AppStateService } from '../common/ui-state.service';\nimport { TranslateService } from '../i18n/translate.service';\nimport { NewPassword } from '../authentication/password.model';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { PasswordService } from '../authentication/password.service';\nimport { UserTotpSetupComponent } from './user-totp-setup.component';\nimport { AlertService } from '../alert/alert.service';\nimport { ModalService } from '../modal/modal.service';\n\nexport interface User extends IUser {\n phone: string;\n sendPasswordResetEmail: boolean;\n newsletter?: boolean;\n}\n\n@Component({\n selector: 'c8y-user-edit',\n templateUrl: './user-edit.component.html'\n})\nexport class UserEditComponent implements OnInit {\n @Input() lang: string;\n @Input() loading: boolean = false;\n @Input() set user(u: User) {\n this._user = clone(u);\n this.userIsExternal = u.customProperties.userOrigin === 'OAUTH2';\n this.isPhoneRequired = this.isPhoneRequired && u.twoFactorAuthenticationEnabled;\n }\n get user() { return this._user; }\n @Output() onUser: EventEmitter<User> = new EventEmitter();\n @Output() onLanguage: EventEmitter<string> = new EventEmitter();\n @Output() onCancel: EventEmitter<void> = new EventEmitter();\n userHasActiveTotp = false;\n userCanSetupTotp = false;\n isPhoneRequired = false;\n userIsExternal;\n isTfaEnabled: boolean;\n private _user: User;\n\n constructor(\n public state: AppStateService,\n public translate: TranslateService,\n public passwordService: PasswordService,\n public modalConfirmService: ModalService,\n private bsModalService: BsModalService,\n private alert: AlertService,\n private userService: UserService,\n private tenantLoginOptionsService: TenantLoginOptionsService,\n private tenantService: TenantService,\n ) {}\n\n async ngOnInit() {\n const currentTenant = (await this.tenantService.current()).data;\n const { enabledOnSystemLevel, enabledOnTenantLevel } = await this.tenantService.getTfaSettings(currentTenant);\n this.isTfaEnabled = enabledOnSystemLevel || enabledOnTenantLevel;\n\n await this.initializeTotpSettings();\n if (this.user.twoFactorAuthenticationEnabled && !this.userCanSetupTotp) {\n this.isPhoneRequired = true;\n }\n }\n\n get langs() {\n return this.state.state.langs;\n }\n\n setupTotp() {\n this.bsModalService.show(UserTotpSetupComponent, { class: 'modal-sm' });\n this.cancel(); // to close the user edit modal and prevent console errors on logout\n }\n\n cancel() {\n this.onCancel.emit();\n }\n\n save() {\n if (!this.loading) {\n this._user.password ? this.saveAfterPasswordConfirmation() : this.onUser.emit(this._user);\n }\n }\n\n onNewPasswordChanged(newPassword: NewPassword) {\n this._user.password = newPassword.password;\n }\n\n private async initializeTotpSettings() {\n try {\n this.userCanSetupTotp = await this.canUserSetupTotp();\n if (this.userCanSetupTotp) {\n const { data: totpActivity } = await this.userService.getActivityTotp();\n this.userHasActiveTotp = totpActivity.isActive;\n }\n } catch (ex) {\n this.alert.removeLastDanger();\n }\n }\n\n private async canUserSetupTotp() {\n // we don't check for tenant options here due to permission restrictions on that end-point\n const { loginOptions } = (await this.tenantLoginOptionsService.detail()).data;\n return loginOptions.some(({ tfaStrategy = '' }) => tfaStrategy.toLowerCase() === 'totp');\n }\n\n private saveAfterPasswordConfirmation() {\n this.passwordService.confirmPassword().subscribe((confirmed) => {\n if (confirmed) {\n this.onUser.emit(this._user);\n }\n });\n }\n}\n","import { Component, Input } from '@angular/core';\nimport { TenantService, UserService } from '@c8y/client';\n\nimport { AlertService } from '../alert/alert.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { LoginService } from '../login/login.service';\nimport { ModalService } from '../modal/modal.service';\nimport { Observable } from 'rxjs';\nimport { OptionsService } from '../common/options.service';\nimport { Status } from '../common/status.model';\nimport { TranslateService } from '@ngx-translate/core';\nimport { UserEditModalComponent } from './user-edit-modal.component';\nimport { UserMenuItem } from './user.model';\nimport { gettext } from '../i18n/gettext';\nimport { map } from 'rxjs/operators';\nimport { sortBy } from 'lodash-es';\n\n@Component({\n selector: 'c8y-user-menu-outlet',\n templateUrl: './user-menu-outlet.component.html'\n})\nexport class UserMenuOutletComponent {\n @Input()\n items: UserMenuItem[];\n open: boolean;\n\n constructor(\n public ui: AppStateService,\n private bsModalService: BsModalService,\n private modalService: ModalService,\n private loginService: LoginService,\n private translateService: TranslateService,\n private tenantService: TenantService,\n private alertService: AlertService,\n private user: UserService,\n private optionsService: OptionsService\n ) {}\n\n copyIt(text: string) {\n const handler: EventListenerObject = {\n handleEvent: (e: ClipboardEvent) => {\n e.clipboardData.setData('text/plain', text);\n e.preventDefault();\n }\n };\n document.addEventListener('copy', handler);\n\n let copied;\n try {\n copied = document.execCommand('copy');\n } catch (e) {\n copied = false;\n }\n\n if (copied) {\n this.alertService.addByText('success', gettext('Copied to clipboard.'));\n } else {\n this.alertService.addByText('danger', gettext('Could not copy to clipboard.'));\n }\n\n document.removeEventListener('copy', handler);\n }\n\n async editUser() {\n this.bsModalService.show(UserEditModalComponent);\n }\n\n async logout() {\n await this.loginService.logout();\n }\n\n async activateSupportAccess() {\n const title = gettext('Activate support user access');\n\n const companyName = this.optionsService.get('companyName', 'Cumulocity');\n const textWithCompany = gettext(\n // tslint:disable-next-line:max-line-length\n 'You are about to allow a support user from {{companyName}} to access your tenant to help you with your issue.'\n );\n const textWithoutCompany = gettext(\n // tslint:disable-next-line:max-line-length\n 'You are about to allow a support user to access your tenant to help you with your issue.'\n );\n const finalQuestion = gettext('Do you want to proceed?');\n const body = [\n this.translateService.instant(companyName ? textWithCompany : textWithoutCompany, {\n companyName\n }),\n this.translateService.instant(finalQuestion)\n ].join(' ');\n\n const labels = {\n ok: gettext('Activate access'),\n cancel: gettext('Cancel')\n };\n\n const successMsg = gettext('Support user access activated.');\n\n try {\n await this.modalService.confirm(title, body, Status.DANGER, labels);\n await this.tenantService.enableSupportUser();\n await this.refreshCurrentUser();\n this.alertService.success(successMsg);\n } catch (ex) {\n // intended empty\n }\n }\n\n async deactivateSupportAccess() {\n const title = gettext('Deactivate support user access');\n\n const companyName = this.optionsService.get('companyName', 'Cumulocity');\n const textWithCompany = gettext(\n // tslint:disable-next-line:max-line-length\n 'You are about to block a support user from {{companyName}} from accessing your tenant to help you with your issue.'\n );\n const textWithoutCompany = gettext(\n // tslint:disable-next-line:max-line-length\n 'You are about to block a support user from accessing your tenant to help you with your issue.'\n );\n const { data: currentUser } = await this.user.current();\n const isTenantAdmin = await this.user.hasRole(currentUser, 'ROLE_TENANT_ADMIN');\n const tenantAdminNote = gettext(\n // tslint:disable-next-line:max-line-length\n 'Deactivating support access as tenant admin will disable all other support requests on your tenant.'\n );\n const finalQuestion = gettext('Do you want to proceed?');\n const body = [\n this.translateService.instant(companyName ? textWithCompany : textWithoutCompany, {\n companyName\n }),\n isTenantAdmin ? this.translateService.instant(tenantAdminNote) : '',\n this.translateService.instant(finalQuestion)\n ]\n .filter(Boolean)\n .join(' ');\n\n const labels = {\n ok: gettext('Deactivate access'),\n cancel: gettext('Cancel')\n };\n\n const successMsg = gettext('Support user access deactivated.');\n\n try {\n await this.modalService.confirm(title, body, Status.DANGER, labels);\n await this.tenantService.disableSupportUser();\n await this.refreshCurrentUser();\n this.alertService.success(successMsg);\n } catch (ex) {\n // intended empty\n }\n }\n\n getSortedItems() {\n return sortBy(Array.from(this.items), this.byPriority);\n }\n\n private async refreshCurrentUser() {\n const currentUserResult = await this.user.current();\n this.ui.currentUser.next(currentUserResult.data);\n }\n\n private byPriority(item) {\n return -item.priority;\n }\n}\n","import { Component, OnInit, Input } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { PasswordService } from './password.service';\nimport { LoginService } from '../login/login.service';\nimport { assign, map } from 'lodash-es';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-password-check-list',\n templateUrl: './password-check-list.component.html',\n styles: []\n})\n\nexport class PasswordCheckListComponent implements OnInit {\n\n @Input('password')\n set password(password: string) {\n if (typeof password === 'string') {\n this.onPasswordChange(password);\n }\n }\n\n minGreenLength: number = 0;\n\n checklist = [\n {\n label: gettext('Include lowercase characters (e.g. abcdef)'),\n check: this.passwordStrengthChecker.hasLowerCase,\n icon: '',\n contextualColor: ''\n\n },\n {\n label: gettext('Include uppercase characters (e.g. ABCDEF)'),\n check: this.passwordStrengthChecker.hasUpperCase,\n icon: '',\n contextualColor: ''\n },\n {\n label: gettext('Include numbers (e.g. 123456)'),\n check: this.passwordStrengthChecker.hasNumbers,\n icon: '',\n contextualColor: ''\n },\n {\n label: gettext('Include symbols (e.g. !@#$%^)'),\n check: this.passwordStrengthChecker.hasSpecialChars,\n icon: '',\n contextualColor: ''\n },\n {\n label: gettext('Must have at least {{length}} characters'),\n check: (password) => password.length >= this.minGreenLength,\n icon: '',\n contextualColor: ''\n }\n ];\n\n constructor(\n public loginService: LoginService,\n private passwordStrengthChecker: PasswordService,\n private passwordService: PasswordService\n ) { }\n\n async ngOnInit() {\n this.minGreenLength = await this.loginService.getGreenMinLength();\n if (!this.minGreenLength) {\n this.minGreenLength = this.passwordService.getDefaultPasswordMinLength();\n }\n }\n\n get translateParams() {\n return {\n length: this.minGreenLength\n };\n }\n\n onPasswordChange(password) {\n this.checklist = map(this.checklist, (requirement) => {\n const checked = requirement.check(password);\n assign(requirement, {\n icon: checked ? 'check-circle' : '',\n contextualColor: checked ? '' : 'text-muted'\n });\n return requirement;\n });\n }\n}\n","import { Directive, forwardRef, Attribute } from '@angular/core';\r\nimport { NG_VALIDATORS, Validator, AbstractControl } from '@angular/forms';\r\n\r\n@Directive({\r\n selector: '[passwordConfirm]',\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: PasswordConfirm,\r\n multi: true\r\n }\r\n ]\r\n})\r\n\r\nexport class PasswordConfirm implements Validator {\r\n\r\n constructor(@Attribute('passwordConfirm') public passwordConfirm: string) {\r\n }\r\n\r\n validate(abControl: AbstractControl): { [key: string]: any } {\r\n const value = abControl.value;\r\n const controlToCompareWith = abControl.root.get(this.passwordConfirm);\r\n if (controlToCompareWith && value !== controlToCompareWith.value) {\r\n return { passwordConfirm: true };\r\n }\r\n return null;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\nimport { PasswordStrength } from '@c8y/client';\nimport { filter } from 'lodash-es';\nimport { PasswordStrengthColor } from './password.model';\nimport { gettext } from '../i18n/gettext';\n\n@Injectable()\nexport class PasswordStrengthCheckerService {\n\n private GREEN: PasswordStrengthColor = {\n colorName: 'green',\n color: 'rgb(0, 128, 0)',\n description: gettext('strong'),\n passwordStrength: PasswordStrength.GREEN\n };\n private YELLOW: PasswordStrengthColor = {\n colorName: 'yellow',\n color: 'rgb(255, 204, 51)',\n description: gettext('medium'),\n passwordStrength: PasswordStrength.YELLOW\n };\n private RED: PasswordStrengthColor = {\n colorName: 'red',\n color: 'rgb(170, 0, 51)',\n description: gettext('weak'),\n passwordStrength: PasswordStrength.RED\n };\n\n hasLowerCase(password: string) {\n return (password.search(/[a-z]/) !== -1);\n }\n\n hasUpperCase(password: string) {\n return (password.search(/[A-Z]/) !== -1);\n }\n\n hasNumbers(password: string) {\n return (password.search(/[0-9]/) !== -1);\n }\n\n hasSpecialChars(password: string) {\n return (password.search(/[^0-9a-zA-Z]+/) !== -1);\n }\n\n getStrengthColor(password: string): PasswordStrengthColor {\n const passwordStrength = filter([\n this.hasLowerCase(password),\n this.hasUpperCase(password),\n this.hasNumbers(password),\n this.hasSpecialChars(password)\n ]).length;\n\n if (passwordStrength > 3) {\n return this.GREEN;\n } else if (passwordStrength >= 3) {\n return this.YELLOW;\n } else {\n return this.RED;\n }\n }\n}\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { PasswordService } from './password.service';\n\n@Component({\n selector: 'c8y-password-strength',\n templateUrl: './password-strength.component.html'\n})\n\nexport class PasswordStrengthComponent {\n\n @Input('password')\n set password(password: string) {\n if (typeof password === 'string') {\n this.model = this.passwordStrengthCheckerService.getStrengthColor(password);\n this.strength.emit(this.model);\n }\n }\n @Output()\n strength = new EventEmitter();\n\n model;\n\n constructor(private passwordStrengthCheckerService: PasswordService) {\n this.password = '';\n }\n}\n","import { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { NewPassword } from './password.model';\nimport { ControlContainer, NgForm } from '@angular/forms';\nimport { LoginService } from '../login/login.service';\n\n@Component({\n selector: 'c8y-new-password',\n templateUrl: './new-password.component.html',\n viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]\n})\nexport class NewPasswordComponent implements OnInit {\n @Output() password = new EventEmitter<NewPassword | {}>();\n model: any = {};\n changePassword: boolean = false;\n passwordEnforced: boolean = false;\n minlength: number;\n\n constructor(\n private loginService: LoginService\n ) {\n }\n\n ngOnInit() {\n this.loadPasswordStrengthSettings();\n this.loginService.getGreenMinLength().then(value => {\n this.minlength = value;\n });\n }\n\n newPasswordChanged() {\n this.password.emit({\n password: this.model.newPassword,\n passwordStrength: this.model.strength\n });\n }\n\n async loadPasswordStrengthSettings() {\n this.passwordEnforced = await this.loginService.getPasswordStrengthEnforced({ refresh: true });\n }\n\n showPasswordStrength() {\n return this.model.newPassword && this.model.newPassword.length >= this.minlength;\n }\n\n toggleChangePassword() {\n this.changePassword = !this.changePassword;\n if (!this.changePassword) {\n this.password.emit({});\n this.model = {};\n }\n }\n}\n","import { NG_VALIDATORS, AbstractControl, Validator } from '@angular/forms';\nimport { Directive } from '@angular/core';\nimport { parsePhoneNumberFromString } from 'libphonenumber-js/max';\n\n@Directive({\n selector: '[c8yPhoneValidation]',\n providers: [{provide: NG_VALIDATORS, useExisting: PhoneValidationDirective, multi: true}]\n})\nexport class PhoneValidationDirective implements Validator {\n\n validate(control: AbstractControl): {[key: string]: any} | null {\n const valid = this.validateInternationalPhoneNumber(control);\n return valid ? null : {\n internationalPhoneNumber: true\n };\n }\n\n private validateInternationalPhoneNumber(control: AbstractControl) {\n let numberValid;\n try {\n const phoneNumber = parsePhoneNumberFromString(control.value);\n numberValid = phoneNumber.isValid();\n if (numberValid && control.value !== phoneNumber.format('E.164')) {\n control.setValue(phoneNumber.format('E.164'), { emitEvent: false, emitModelToViewChange: false });\n }\n } catch (e) {\n numberValid = !control.value;\n }\n return numberValid;\n }\n}\n","// tslint:disable: max-line-length\nimport { gettext } from '../i18n/gettext';\n\nexport interface ValidationRules {\n pattern?: RegExp;\n message?: string;\n maxLength?: number;\n minLength?: number;\n}\n\n// @dynamic\nexport class ValidationPattern {\n static readonly messages = {\n deviceId: gettext('Device ID must not contain spaces or slashes (\"/\").'),\n domain: gettext(\n 'Only lowercase letters, digits and hyphens allowed in the first part of the URI. ' +\n 'Must start with a letter; hyphens only allowed in the middle. Must be a valid URI.'\n ),\n email: gettext('Invalid email address.'),\n internationalPhoneNumber: gettext(\n 'International phone number required, in the format +49 9 876 543 210.'\n ),\n loginAlias: gettext(\n 'Login alias must not contain slashes (\"/\", \"\\\\\") nor (\"+\"), (\":\"), (\"$\") signs.'\n ),\n max : gettext('Max value: {{ value }}'),\n min : gettext('Min value: {{ value }}'),\n opcuaBrowsePath: gettext('Invalid OPC UA URI.'),\n password: gettext(\n 'Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:\\'\",.<>{}[]\\\\/'\n ),\n passwordConfirm: gettext('Passwords do not match.'),\n passwordStrength: gettext('Password not good enough, password must be stronger (green).'),\n phoneNumber: gettext(\n 'Invalid phone number format. Only digits, spaces, slashes (\"/\") and dashes (\"-\") allowed.'\n ),\n required: gettext('This field is required.'),\n tenantId: gettext(\n 'May contain lowercase letters, digits, and hyphens. ' +\n 'Must start with a letter; hyphens only allowed in the middle; minimum 2 characters.'\n ),\n urlSegment: gettext('Slash, single or double dots and white space not allowed'),\n user: gettext(\n 'Username must not contain spaces nor slashes (\"/\", \"\\\\\") nor (\"+\"), (\":\"), (\"$\") signs.'\n )\n };\n\n static readonly rules = {\n deviceId: {\n pattern: /^[^\\s/]*$/\n },\n domain: {\n pattern: /^[a-z]+[a-z0-9-]*[a-z0-9]+\\.{1}.+$/\n },\n groupName: {\n maxLength: 254\n },\n hostname: {\n pattern: /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/\n },\n ip: {\n pattern: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/\n },\n opcuaBrowsePath: {\n pattern: /^(opc.tcp|http|https):\\/\\/[^ \"]+$/\n },\n password: {\n pattern: /^[a-zA-Z0-9`~!@#$%^&*()_|+\\-=?;:'\",.<>{}[\\]\\\\/]{8,32}$/\n },\n phoneNumber: {\n pattern: /^$|^(\\+|0{2})[\\d\\s/-]{1,30}$/\n },\n tenantId: {\n pattern: /^[a-z]+[a-z0-9-]*[a-z0-9]+$/\n },\n user: {\n pattern: /^[^\\\\/\\s$:+]*$/\n },\n urlSegment: {\n pattern: /^(([.]{1,2})|([/])+|(([/]*)([.]{1,2})([/]*))|((.*)([/]|[ ]+)(.*))|(\\s+))$/\n },\n loginAlias: {\n pattern: /^[^\\\\/$:+]*$/\n }\n };\n\n static get(key: string) {\n const pattern = this.rules[key];\n return pattern as ValidationRules;\n }\n}\n","import { NG_VALIDATORS, AbstractControl, Validator } from '@angular/forms';\nimport { Directive, Input } from '@angular/core';\nimport { ValidationPattern } from './validation-pattern';\n\n@Directive({\n selector: '[c8yDefaultValidation]',\n providers: [{provide: NG_VALIDATORS, useExisting: DefaultValidationDirective, multi: true}]\n})\nexport class DefaultValidationDirective implements Validator {\n @Input() c8yDefaultValidation: string = '';\n\n validate(control: AbstractControl): {[key: string]: any} | null {\n if (!control.value) {\n return null;\n }\n const validation = ValidationPattern.get(this.c8yDefaultValidation);\n if (!validation) {\n throw new Error(`Pattern ${this.c8yDefaultValidation} not found.`);\n }\n\n let valid = true;\n if (validation.pattern) {\n valid = validation.pattern.test(control.value);\n }\n if (validation.maxLength) {\n valid = control.value.length < validation.maxLength;\n }\n if (validation.minLength) {\n valid = control.value.length >= validation.minLength;\n }\n return valid ? null : {[this.c8yDefaultValidation]: true };\n }\n}\n","import { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\nimport { Directive, ElementRef, Input } from '@angular/core';\n\nimport { isUndefined } from 'lodash-es';\n\n@Directive({\n selector: '[min]',\n providers: [{provide: NG_VALIDATORS, useExisting: MinValidationDirective, multi: true}]\n})\nexport class MinValidationDirective implements Validator {\n @Input() min: string = '';\n\n validate(control: AbstractControl): {[key: string]: any} | null {\n const parsedMin = parseInt(this.min, 10);\n if (isUndefined(control.value) || !this.min) {\n return null;\n }\n\n let valid = true;\n valid = (control.value !== null) ? !(control.value < parsedMin) : true;\n return valid ? null : {min: { value: parsedMin } };\n }\n}\n","import { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\nimport { Directive, Input } from '@angular/core';\n\nimport { isUndefined } from 'lodash-es';\n\n@Directive({\n selector: '[max]',\n providers: [{provide: NG_VALIDATORS, useExisting: MaxValidationDirective, multi: true}]\n})\nexport class MaxValidationDirective implements Validator {\n @Input() max: string = '';\n\n validate(control: AbstractControl): {[key: string]: any} | null {\n const parsedMax = parseInt(this.max, 10);\n if (isUndefined(control.value) || !this.max) {\n return null;\n }\n\n let valid = true;\n valid = !(control.value > parsedMax);\n return valid ? null : {max: { value: parsedMax } };\n }\n}\n","import { Directive, Input } from '@angular/core';\n\n@Directive({\n selector: 'c8y-message',\n})\nexport class MessageDirective {\n @Input() name: string;\n @Input() text: string;\n}\n","import { Component, ContentChildren, Input, QueryList } from '@angular/core';\n\nimport { MessageDirective } from './message.directive';\nimport { ValidationPattern } from './validation-pattern';\nimport { isFunction } from 'lodash-es';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Component({\n selector: 'c8y-messages',\n templateUrl: './messages.component.html'\n})\nexport class MessagesComponent {\n @Input() show: {} = {};\n @Input() defaults: {} = ValidationPattern.messages;\n @ContentChildren(MessageDirective) customMessages: QueryList<MessageDirective>;\n messages = [];\n messageMap: any = {};\n\n constructor(private translateService: TranslateService) {}\n\n ngAfterContentInit(): void {\n this.messageMap = Object.assign({}, this.defaults, this.customMessages.reduce((messages, directive) => {\n messages[directive.name] = directive.text;\n return messages;\n }, {}));\n }\n\n changVisibility(show: {}) {\n this.show = show;\n this.ngOnChanges();\n }\n\n ngOnChanges() {\n if (this.show) {\n this.messages = Object.keys(this.show)\n .map((key) => this.toMessage(key, this.show[key]));\n } else {\n this.messages = [];\n }\n }\n\n private toMessage(key, value) {\n return this.translateService.instant(this.messageMap[key], value);\n }\n}\n","import { Component, ContentChild, HostBinding, Input } from '@angular/core';\nimport { NgModel } from '@angular/forms';\nimport { Subscription, timer, merge } from 'rxjs';\nimport { debounce, filter } from 'rxjs/operators';\nimport { MessagesComponent } from './messages.component';\n/**\n * A form group helps to validate an input of a form element.\n *\n * ## Example:\n *\n * ```html\n * <c8y-form-group [hasWarning]=\"user.email.length === 0\">\n * <label translate for=\"userEmail\">Email</label>\n * <input\n * id=\"userEmail\"\n * class=\"form-control\"\n * type=\"email\"\n * name=\"email\"\n * [maxlength]=\"254\"\n * autocomplete=\"off\"\n * placeholder=\"{{'e.g. joe.doe@example.com' | translate}}\"\n * [(ngModel)]=\"user.email\"\n * email\n * required\n * >\n * <c8y-messages>\n * <c8y-message *ngIf=\"user.email.length === 0\" translate></c8y-message>\n * <c8y-message name=\"required\" text=\"The E-Mail is SUPER required\"></c8y-message>\n * </c8y-messages>\n * </c8y-form-group>\n * ```\n *\n * @param status The current status could be error, warning or success.\n * @param hasError Set this to true to display a error.\n * @param hasWarning Set this to true to display a warning.\n * @param hasSuccess Set this to true to display a success.\n * @param novalidation Set this to true to disable automatic validation by this component.\n */\n@Component({\n selector: 'c8y-form-group',\n templateUrl: './form-group.component.html',\n host: {\n class: 'form-group'\n }\n})\nexport class FormGroupComponent {\n @Input() hasError = false;\n @Input() hasWarning = false;\n @Input() hasSuccess = false;\n @Input() novalidation = false;\n @Input() status: string;\n @HostBinding('class.has-error') get error() {\n return this.status === 'error' || this.hasError;\n }\n @HostBinding('class.has-warning') get warning() {\n return this.status === 'warning' || this.hasWarning;\n }\n @HostBinding('class.has-success') get success() {\n return this.status === 'success' || this.hasSuccess;\n }\n @ContentChild(MessagesComponent, { static: false }) customErrorMessage: MessagesComponent;\n @ContentChild(NgModel, { static: true }) model: NgModel;\n\n errors: {};\n private subscription: Subscription;\n private readonly VALIDATION_DEBOUNCE_MS = 1000;\n\n ngAfterContentInit(): void {\n this.initNgModel();\n }\n\n initNgModel() {\n if (this.model) {\n this.model.valueAccessor.registerOnTouched(() => {\n if (this.model.control && !this.model.control.dirty) {\n this.model.control.markAsDirty();\n this.model.control.updateValueAndValidity({onlySelf: true});\n }\n });\n this.subscription = merge(this.model.valueChanges, this.model.statusChanges)\n .pipe(\n filter(() => this.model.dirty && !this.novalidation),\n debounce(() => (this.hasError ? timer(10) : timer(this.VALIDATION_DEBOUNCE_MS)))\n )\n .subscribe(() => this.update());\n }\n }\n\n update() {\n this.hasError = this.model.status === 'INVALID';\n if (this.customErrorMessage) {\n this.customErrorMessage.changVisibility(this.model.errors);\n } else {\n this.errors = this.model.errors;\n }\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n}\n","import {\n Component,\n Input,\n Output,\n QueryList,\n TemplateRef,\n ContentChild,\n EventEmitter\n} from '@angular/core';\n\n@Component({\n selector: 'c8y-input-group-list',\n templateUrl: 'input-group-list.component.html'\n})\nexport class InputGroupListComponent {\n @Input() plus: boolean = true;\n @Input() minus: boolean = true;\n @Input() index: number;\n\n @Output() onRemove: EventEmitter<number> = new EventEmitter<number>();\n @Output() onAdd: EventEmitter<number> = new EventEmitter<number>();\n add() {\n this.onAdd.emit(this.index);\n }\n\n remove() {\n this.onRemove.emit(this.index);\n }\n}\n","import {\n Directive,\n Input,\n Output,\n QueryList,\n AfterContentInit,\n ContentChildren,\n EventEmitter\n} from '@angular/core';\nimport { map } from 'lodash-es';\nimport { InputGroupListComponent } from './input-group-list.component';\n\n@Directive({\n selector: '[c8yInputGroupListContainer]'\n})\nexport class InputGroupListContainerDirective implements AfterContentInit {\n @ContentChildren(InputGroupListComponent) listProjections: QueryList<InputGroupListComponent>;\n\n ngAfterContentInit() {\n this.listProjections.map(element => {\n if (element !== this.listProjections.last) {\n setTimeout(() => {\n element.plus = false;\n });\n }\n });\n\n this.listProjections.changes.subscribe(elements => {\n if (elements.length === 1) {\n setTimeout(() => {\n elements.first.plus = true;\n elements.first.minus = false;\n });\n\n return;\n }\n elements.map(element => {\n setTimeout(() => {\n element.minus = true;\n });\n\n if (element !== elements.last) {\n setTimeout(() => {\n element.plus = false;\n });\n }\n if (element === elements.last) {\n setTimeout(() => {\n element.plus = true;\n });\n }\n });\n });\n }\n}\n","import { Directive, EventEmitter, Output, OnInit, OnDestroy } from '@angular/core';\nimport { NgControl, AbstractControl } from '@angular/forms';\n\nimport { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators';\nimport { Subscription } from 'rxjs';\nimport { gettext } from '../i18n/index';\n\n@Directive({\n selector: 'textarea[prettyValidJson]'\n})\nexport class JsonValidationPrettifierDirective implements OnInit, OnDestroy {\n @Output() invalidJSON: EventEmitter<string> = new EventEmitter();\n private abstractCtrl: AbstractControl;\n private message: string = gettext('Must be a valid JSON object.');\n private debounceTimeInMs: number = 1000;\n private subscription: Subscription;\n\n constructor(ngCtrl: NgControl) {\n this.abstractCtrl = ngCtrl.control;\n }\n\n ngOnInit() {\n this.subscription = this.abstractCtrl.valueChanges\n .pipe(\n tap(() => this.clearValidationMessage()),\n debounceTime(this.debounceTimeInMs),\n distinctUntilChanged()\n )\n .subscribe(value => {\n this.validateInputAndPrettify(value);\n });\n }\n\n ngOnDestroy() {\n if (this.subscription && !this.subscription.closed) {\n this.subscription.unsubscribe();\n }\n }\n\n validateInputAndPrettify(value) {\n if (value) {\n try {\n const validJsonObject = JSON.parse(value);\n const pretty = JSON.stringify(validJsonObject, undefined, 2);\n this.abstractCtrl.setValue(pretty);\n } catch (ex) {\n this.setErrorAndValidationMessage();\n }\n }\n }\n\n private setErrorAndValidationMessage() {\n this.abstractCtrl.setErrors({ invalidBodyTemplate: true });\n this.invalidJSON.emit(this.message);\n }\n\n private clearValidationMessage() {\n this.invalidJSON.emit(undefined);\n }\n}\n","import { Directive, ElementRef, Input, HostBinding, Renderer2 } from '@angular/core';\n\n@Directive({\n selector: 'textarea[heightPerRow]'\n})\nexport class TextAreaRowHeightDirective {\n @Input()\n @HostBinding('rows')\n rows: number = 1;\n\n @Input('heightPerRow')\n heightPerRow: string;\n\n private minHeightPerRow = 20;\n\n constructor(private elem: ElementRef, private renderer: Renderer2) {}\n\n ngAfterViewInit() {\n const convertedValue = Number(this.heightPerRow);\n if (this.heightPerRow && convertedValue && convertedValue > this.minHeightPerRow) {\n this.setHeight(`${this.rows * convertedValue}px`);\n } else {\n this.setHeight(`${this.rows * this.minHeightPerRow}px`);\n }\n }\n\n private setHeight(value: string) {\n this.renderer.setStyle(this.elem.nativeElement, 'height', value);\n }\n}\n","import { Directive, ElementRef, Renderer2, AfterViewChecked } from '@angular/core';\nimport { gettext } from '../i18n/gettext';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Directive({\n selector: 'input[required]'\n})\nexport class RequiredInputPlaceholderDirective implements AfterViewChecked {\n private shouldSkipRequiredHint: boolean = false;\n private placeholder: string;\n private req: boolean;\n constructor(\n private el: ElementRef,\n private renderer: Renderer2,\n private translationService: TranslateService\n ) {\n this.shouldSkipRequiredHint = !!this.el.nativeElement.closest('[placeholder-no-required-hint]');\n }\n\n ngAfterViewChecked(): void {\n if (this.el && this.el.nativeElement && this.el.nativeElement.required !== undefined) {\n const required = this.el.nativeElement.required && !this.shouldSkipRequiredHint;\n const placeholder = this.el.nativeElement.placeholder;\n\n if (this.placeholder !== placeholder || this.req !== required) {\n this.updatePlaceholder(this.getTextForPlaceholder(placeholder, required));\n }\n }\n }\n\n private getTextForPlaceholder(placeholder = '', required = false) {\n this.req = required;\n const requiredText = `(${this.translationService.instant(gettext('required'))})`;\n const requiredTextIndex = placeholder.lastIndexOf(requiredText);\n if (requiredTextIndex > 0) {\n placeholder = placeholder.slice(0, requiredTextIndex - 1);\n }\n if (requiredTextIndex === 0) {\n placeholder = '';\n }\n if (!required) {\n return placeholder;\n }\n return placeholder.trim() ? `${placeholder} ${requiredText}` : requiredText;\n }\n\n private updatePlaceholder(placeholder) {\n this.renderer.setAttribute(this.el.nativeElement, 'placeholder', placeholder);\n this.placeholder = placeholder;\n }\n}\n","import { Component, Input, OnChanges } from '@angular/core';\nimport { cloneDeep } from 'lodash-es';\nimport { Observable, of } from 'rxjs';\n\n@Component({\n selector: 'c8y-ip-range-input-list',\n templateUrl: './ip-range-input-list.component.html'\n})\nexport class IpRangeInputListComponent {\n @Input()\n set data(list) {\n this.ipRangeList = list;\n if (this.ipRangeList.length === 0) {\n this.add();\n }\n }\n\n get data() {\n return this.ipRangeList;\n }\n\n ipRangeList: Array<{ ip: string; cidr: number }>;\n\n add() {\n this.ipRangeList.push({ ip: '', cidr: undefined });\n }\n\n remove(index) {\n this.ipRangeList.splice(index, 1);\n }\n}\n","import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';\nimport { Subject, timer } from 'rxjs';\nimport { debounce, distinctUntilChanged, map } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-filter',\n templateUrl: './filter-input.component.html'\n})\nexport class FilterInputComponent implements OnInit, OnDestroy {\n @Input() icon: string;\n @Output() onSearch = new EventEmitter<string>();\n filterChange$ = new Subject();\n filterTerm: string = '';\n private readonly CARRIAGE_RETURN_KEY = 13;\n private readonly CARRIAGE_RETURN_CODE = 'Enter';\n\n ngOnInit() {\n this.reset();\n this.filterChange$\n .pipe(\n debounce((event: any) =>\n event.code === this.CARRIAGE_RETURN_CODE || event.keyCode === this.CARRIAGE_RETURN_KEY\n ? timer(10)\n : timer(300)\n ),\n map((e: any) => e.target.value),\n distinctUntilChanged()\n )\n .subscribe(filterTerm => {\n this.filterTerm = filterTerm;\n this.onSearch.emit(filterTerm);\n });\n }\n\n reset() {\n this.filterTerm = '';\n this.onSearch.emit('');\n }\n\n ngOnDestroy(): void {\n this.filterChange$.complete();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PhoneValidationDirective } from './phone-validation.directive';\nimport { DefaultValidationDirective } from './default-validation.directive';\nimport { MinValidationDirective } from './min-validation.directive';\nimport { MaxValidationDirective } from './max-validation.directive';\nimport { CommonModule } from '../common/common.module';\nimport { FormsModule as NgFormsModule } from '@angular/forms';\nimport { FormGroupComponent } from './form-group.component';\nimport { MessageDirective } from './message.directive';\nimport { MessagesComponent } from './messages.component';\nimport { InputGroupListComponent } from './input-group-list.component';\nimport { InputGroupListContainerDirective } from './input-group-list-container.directive';\nimport { JsonValidationPrettifierDirective } from './json-validation-prettifier.directive';\nimport { TextAreaRowHeightDirective } from './text-area-row-height.directive';\nimport { RequiredInputPlaceholderDirective } from './required-input-placeholder.directive';\nimport { IpRangeInputListComponent } from './ip-range-input-list.component';\nimport { FilterInputComponent } from './filter-input.component';\n\n/**\n * @exports FormGroupComponent A component that allows to group an input and can display warnings and errors.\n * @exports PhoneValidationDirective Allows to validate international phone numbers.\n * @exports NewsletterDirective Allows to subscribe to the newsletter.\n * @exports DefaultValidationDirective Allows to validate some predefined patterns.\n * @exports MessageDirective A directive that allows to define messages.\n * @exports MessagesComponent Allows to display error messages.\n */\n@NgModule({\n imports: [CommonModule, NgFormsModule],\n exports: [\n PhoneValidationDirective,\n DefaultValidationDirective,\n MinValidationDirective,\n MaxValidationDirective,\n NgFormsModule,\n FormGroupComponent,\n MessageDirective,\n MessagesComponent,\n InputGroupListComponent,\n InputGroupListContainerDirective,\n JsonValidationPrettifierDirective,\n TextAreaRowHeightDirective,\n RequiredInputPlaceholderDirective,\n IpRangeInputListComponent,\n FilterInputComponent\n ],\n declarations: [\n PhoneValidationDirective,\n DefaultValidationDirective,\n MinValidationDirective,\n MaxValidationDirective,\n FormGroupComponent,\n MessageDirective,\n MessagesComponent,\n InputGroupListComponent,\n InputGroupListContainerDirective,\n JsonValidationPrettifierDirective,\n TextAreaRowHeightDirective,\n RequiredInputPlaceholderDirective,\n IpRangeInputListComponent,\n FilterInputComponent\n ]\n})\nexport class FormsModule {}\n","import { Component, Output, EventEmitter, Input } from '@angular/core';\nimport { NewPassword } from './password.model';\nimport { ControlContainer, NgForm } from '@angular/forms';\nimport { LoginService } from '../login/login.service';\nimport { UserService, ICredentials } from '@c8y/client';\nimport { AlertService } from '../alert/alert.service';\nimport { LoginViews } from '../login/login.model';\n\n@Component({\n selector: 'c8y-totp-challenge',\n templateUrl: './totp-challenge.component.html',\n viewProviders: [ { provide: ControlContainer, useExisting: NgForm } ]\n})\n\nexport class TotpChallengeComponent {\n /**\n * Calls the verify endpoint if set to true (default true)\n */\n @Input() verify = true;\n /**\n * Emits the token on success.\n */\n @Output() onSuccess = new EventEmitter();\n\n model = {\n token: ''\n };\n @Input()\n loading = false;\n @Input()\n hasError = false;\n\n constructor(\n public loginService: LoginService,\n private users: UserService,\n private alert: AlertService\n ) {}\n\n async verifyCode() {\n try {\n this.loading = true;\n this.hasError = false;\n if (this.verify) {\n await this.users.verifyTotpCode(this.model.token);\n }\n this.onSuccess.emit(this.model.token);\n } catch (e) {\n this.hasError = true;\n this.alert.removeLastDanger();\n this.loading = false;\n }\n }\n}\n","import { Component, Output, EventEmitter, Input } from '@angular/core';\nimport { UserService, ICredentials } from '@c8y/client';\nimport { LoginService } from '../login/login.service';\nimport { AlertService } from '../alert/alert.service';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-sms-challenge',\n templateUrl: './sms-challenge.component.html',\n styles: []\n})\n\nexport class SmsChallengeComponent {\n\n @Input() credentials: ICredentials;\n @Output() onCancel = new EventEmitter();\n\n model = {\n smsToken: ''\n };\n isLoading = false;\n\n private resendTfa: string = '0';\n\n constructor(\n public loginService: LoginService,\n private users: UserService,\n private alert: AlertService\n ) {}\n\n async verifyTFACode() {\n this.isLoading = true;\n if (this.useOAuthInternal()) {\n await this.verifyCodeWithOauth();\n } else {\n await this.verifyCodeWithBasicAuth();\n }\n this.isLoading = false;\n }\n\n async resendTFASms() {\n try {\n this.isLoading = true;\n await this.users.verifyTFACode(this.resendTfa);\n } catch (e) {\n if (e.res.status === 403) {\n this.loginService.cleanMessages();\n this.loginService.addSuccessMessage('resend_sms');\n } else {\n this.alert.addServerFailure(e);\n }\n } finally {\n this.isLoading = false;\n }\n }\n\n private useOAuthInternal() {\n return this.loginService.isPasswordGrantLogin(this.credentials);\n }\n\n private async verifyCodeWithOauth() {\n try {\n const { credentials } = this;\n await this.loginService.switchLoginMode({...credentials, tfa: this.model.smsToken});\n await this.loginService.verifyAppAccess();\n await this.loginService.authFulfilled();\n } catch (e) {\n const resStatus = e.res && e.res.status;\n if (resStatus === 401) {\n // it is assumed that the user and password are correct so it must be the tfa code\n this.alert.danger(gettext('Invalid code'));\n } else {\n this.alert.addServerFailure(e);\n }\n }\n }\n\n private async verifyCodeWithBasicAuth() {\n try {\n const { res } = await this.users.verifyTFACode(this.model.smsToken);\n const tfaToken = res.headers.get('tfatoken');\n this.credentials.tfa = tfaToken;\n this.loginWithTFA(tfaToken);\n } catch (e) {\n const resStatus = e.res && e.res.status;\n // BE returns 403 in case of invalid tfa code\n if (resStatus === 403) {\n this.alert.danger(gettext('Invalid code'));\n } else {\n this.alert.addServerFailure(e);\n }\n }\n }\n\n private async loginWithTFA(tfaToken) {\n try {\n await this.loginService.login(this.loginService.useBasicAuth({tfa: tfaToken}), this.credentials);\n this.loginService.saveTFAToken(tfaToken, sessionStorage);\n if (this.loginService.rememberMe) {\n this.loginService.saveTFAToken(tfaToken, localStorage);\n }\n } catch (e) {\n this.alert.addServerFailure(e);\n }\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { ITotp, UserService } from '@c8y/client';\nimport { AlertService } from '../alert/alert.service';\nimport { gettext } from '../i18n';\n\n@Component({\n selector: 'c8y-totp-setup',\n templateUrl: './totp-setup.component.html'\n})\nexport class TotpSetupComponent implements OnInit {\n totpSecret: ITotp;\n\n get qrCodeImage() {\n return this.totpSecret ? this.totpSecret.secretQrUrl : '';\n }\n\n get secret() {\n return this.totpSecret ? this.totpSecret.rawSecret : '';\n }\n\n get qrData() {\n // TODO: waiting for BE:, now we need extract it from secretQrUrl\n // https://cumulocity.atlassian.net/browse/MTM-36387\n // return this.totpSecret ? this.totpSecret.qrData : '';\n const otpAuth = this.qrCodeImage.split('chl=')[1];\n if (!otpAuth) {\n this.alert.danger(gettext('Failed to generate a QR code.'));\n return '';\n }\n return decodeURIComponent(otpAuth);\n }\n\n constructor(private user: UserService, private alert: AlertService) {}\n\n async ngOnInit() {\n try {\n const { data } = await this.user.generateTotpSecret();\n this.totpSecret = data;\n } catch (ex) {\n this.alert.addServerFailure(ex);\n }\n }\n}\n","import {\n Component,\n ViewChild,\n ElementRef,\n Input,\n OnInit,\n Output,\n EventEmitter\n} from '@angular/core';\nimport { some, get, map } from 'lodash-es';\nimport { gettext } from '../i18n/gettext';\n\n/**\n * A drop-zone which is a file selector allowing users to select file(s) from their file system, either natively or by drag and drop.\n *\n * ## Example:\n *\n * ```html\n * <div>\n * <c8y-drop-area\n * (dropped)=\"uploadFile($event)\"\n * [icon]=\"'upload'\">\n * </c8y-drop-area>\n * </div>\n * ```\n */\n\n@Component({\n selector: 'c8y-drop-area',\n templateUrl: './drop-area.component.html'\n})\nexport class DropAreaComponent implements OnInit {\n @Input() title = gettext('Upload file');\n @Input() message = gettext('Drop file here');\n @Input() icon = 'plus-square';\n @Input() loadingMessage = gettext('Uploading…');\n /** Affects displaying both the drop zone and the list of dropped files. */\n @Input() alwaysShow = false;\n @Input() clickToOpen = true;\n @Input() loading = false;\n @Input() progress = -1; // -1 = spinner\n @Output() dropped: EventEmitter<DroppedFile[]> = new EventEmitter();\n @Input() maxAllowedFiles = Infinity;\n @Input() files: FileList;\n isOver: boolean = false;\n errors: boolean = false;\n errorMessage: string;\n filesNameString: string;\n\n @ViewChild('area', { static: true }) area: ElementRef;\n @ViewChild('zone', { static: false }) zone: ElementRef;\n @ViewChild('picker', { static: false }) picker: ElementRef;\n\n ngOnInit(): void {\n this.alwaysShow = this.alwaysShow || this.area.nativeElement.children.length === 0;\n if (this.files && this.files.length > 0) {\n this.onFilesSelected(this.files);\n }\n }\n\n /**\n * Toggles the style of the drop zone element when a file is dragged over the component.\n */\n toggle($event?): void {\n this.zone.nativeElement.style.height = this.area.nativeElement.offsetHeight + 'px';\n this.onOver();\n }\n\n /**\n * Shows computer browser with files to drop into drop-area zone.\n */\n showPicker($event?): void {\n this.preventDefault($event);\n this.picker.nativeElement.value = '';\n this.picker.nativeElement.click();\n }\n\n /**\n * Triggered when file is on over drop area, but not dropped.\n */\n onOver(): void {\n if (!this.isOver) {\n this.isOver = true;\n document.addEventListener('dragover', this.preventDefault);\n document.addEventListener('drop', this.preventDefault);\n }\n }\n\n /**\n * Triggered when file is dropped.\n */\n onPick($event): void {\n this.errors = false;\n this.preventDefault($event);\n this.onFilesSelected($event.target.files);\n }\n\n /**\n * Handle file when it is dropped into drop-area.\n */\n onDrop($event): void {\n this.preventDefault($event);\n this.onFilesSelected($event.dataTransfer.files);\n this.stopDragging();\n }\n\n /**\n * Checks condition what should be displayed: drop-area zone or list of dropped files.\n */\n shouldShowFilesList(): boolean {\n return (\n this.alwaysShow &&\n !this.isFilesArrayEmpty() &&\n !this.hasEmptyFiles() &&\n !this.isTooManyFiles()\n );\n }\n\n /**\n * Triggered when file is picked over web application.\n */\n stopDragging(): void {\n document.removeEventListener('dragover', this.preventDefault);\n document.removeEventListener('drop', this.preventDefault);\n this.isOver = false;\n }\n\n /**\n * Delete files already dropped files.\n */\n onDelete() {\n delete this.files;\n delete this.filesNameString;\n this.clearErrors();\n this.dropped.emit(undefined);\n }\n\n private onFilesSelected(files: FileList) {\n this.files = files;\n this.filesNameString = this.getFilesNamesAsString(files);\n this.errors = false;\n if (!this.isFilesArrayEmpty() && !this.isTooManyFiles()) {\n if (this.hasEmptyFiles()) {\n this.errors = true;\n this.errorMessage = gettext('File must not be empty, select another one.');\n } else {\n this.dropped.emit(this.compose(files));\n }\n } else {\n this.errors = true;\n this.errorMessage = gettext('Too many files selected.');\n }\n }\n\n private getFilesNamesAsString(files: FileList): string {\n return map(files, ({ name }) => name).join(', ');\n }\n\n private isFilesArrayEmpty() {\n return get(this, 'files.length', 0) === 0;\n }\n\n private isTooManyFiles() {\n return get(this, 'files.length', 0) > this.maxAllowedFiles;\n }\n\n private hasEmptyFiles() {\n let result = true;\n if (!this.isFilesArrayEmpty()) {\n result = this.isAnyFileEmpty();\n }\n return result;\n }\n\n private isAnyFileEmpty(): boolean {\n return some(Array.from(this.files), ['size', 0]);\n }\n\n private clearErrors() {\n delete this.errorMessage;\n this.errors = false;\n }\n\n private preventDefault($event?) {\n if ($event) {\n $event.preventDefault();\n }\n }\n\n private compose(files: FileList) {\n return Array.from(files).map(file => ({\n file,\n readAsJson: async () => JSON.parse(await this.read(file, ReadAsType.TEXT)),\n readAsText: async () => this.read(file, ReadAsType.TEXT),\n readAsArrayBuffer: async () => this.read(file, ReadAsType.ARRAY_BUFFER),\n readAsBinaryString: async () => this.read(file, ReadAsType.BINARY_STRING),\n readAsDataURL: async () => this.read(file, ReadAsType.DATA_URL)\n }));\n }\n\n private async read(file, type: ReadAsType): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n switch (type) {\n case ReadAsType.TEXT: {\n reader.readAsText(file);\n break;\n }\n case ReadAsType.ARRAY_BUFFER: {\n reader.readAsArrayBuffer(file);\n break;\n }\n case ReadAsType.BINARY_STRING: {\n reader.readAsBinaryString(file);\n break;\n }\n case ReadAsType.DATA_URL: {\n reader.readAsDataURL(file);\n break;\n }\n }\n reader.onload = () => this.onLoad(reader, resolve, reject);\n });\n }\n\n private onLoad(reader, resolve, reject) {\n if (reader.readyState !== 2) {\n return;\n }\n if (reader.error) {\n reject(reader.error);\n }\n resolve(reader.result);\n }\n}\n\nexport interface DroppedFile {\n file: File;\n readAsText();\n readAsArrayBuffer();\n readAsBinaryString();\n readAsDataURL();\n readAsJson();\n}\n\nenum ReadAsType {\n TEXT,\n DATA_URL,\n ARRAY_BUFFER,\n BINARY_STRING\n}\n","import { Component, Output, EventEmitter, Input } from '@angular/core';\nimport { LoginService } from '../login/login.service';\nimport { AlertService } from '../alert/alert.service';\nimport { LoginViews } from '../login/login.model';\nimport { ICredentials, UserService } from '@c8y/client';\n\n@Component({\n selector: 'c8y-provide-phone-number',\n templateUrl: './provide-phone-number.component.html'\n})\nexport class ProvidePhoneNumberComponent {\n @Input() credentials: ICredentials;\n @Output() onCancel = new EventEmitter();\n @Output() onChangeView = new EventEmitter();\n\n phoneNumber: string;\n requestInProgress = false;\n private readonly sendTfa: string = '0';\n\n constructor(\n public loginService: LoginService,\n public alert: AlertService,\n private userService: UserService\n ) {}\n\n async save() {\n try {\n this.requestInProgress = true;\n await this.userService.savePhoneNumber(this.phoneNumber);\n await this.sendTFASms();\n this.onChangeView.emit({\n view: LoginViews.SmsChallenge,\n credentials: this.credentials\n });\n } catch (e) {\n this.alert.addServerFailure(e);\n } finally {\n this.requestInProgress = false;\n }\n }\n\n private async sendTFASms() {\n try {\n await this.userService.verifyTFACode(this.sendTfa);\n } catch (e) {\n if (e.res.status === 403) {\n this.loginService.cleanMessages();\n this.loginService.addSuccessMessage('send_sms');\n } else {\n throw e;\n }\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { CommonModule } from '../common/common.module';\nimport { PasswordCheckListComponent } from './password-check-list.component';\nimport { PasswordConfirm } from './password-confirm.directive';\nimport { PasswordStrengthCheckerService } from './password-strength-checker.service';\nimport { PasswordStrengthComponent } from './password-strength.component';\nimport { NewPasswordComponent } from './new-password.component';\nimport { PasswordConfirmModalComponent } from './password-confirm-modal.component';\nimport { ModalModule } from '../modal/modal.module';\nimport { FormsModule } from '../forms/forms.module';\nimport { TotpChallengeComponent } from './totp-challenge.component';\nimport { SmsChallengeComponent } from './sms-challenge.component';\nimport { TotpSetupComponent } from './totp-setup.component';\nimport { PasswordService } from './password.service';\nimport { QRCodeModule } from 'angularx-qrcode';\nimport { ProvidePhoneNumberComponent } from './provide-phone-number.component';\n\n/**\n * The angular module definition for new password.\n * @exports PasswordStrengthComponent\n * @exports PasswordCheckListComponent\n * @exports PasswordConfirm\n * @exports NewPasswordComponent\n * @exports PasswordConfirmModalComponent\n */\n@NgModule({\n declarations: [\n TotpChallengeComponent,\n PasswordConfirm,\n PasswordStrengthComponent,\n PasswordCheckListComponent,\n NewPasswordComponent,\n PasswordConfirmModalComponent,\n SmsChallengeComponent,\n TotpSetupComponent,\n ProvidePhoneNumberComponent\n ],\n imports: [FormsModule, TooltipModule, CommonModule, ModalModule, QRCodeModule],\n exports: [\n TotpChallengeComponent,\n PasswordStrengthComponent,\n PasswordCheckListComponent,\n PasswordConfirm,\n NewPasswordComponent,\n PasswordConfirmModalComponent,\n SmsChallengeComponent,\n TotpSetupComponent,\n ProvidePhoneNumberComponent\n ],\n entryComponents: [PasswordConfirmModalComponent],\n providers: [PasswordStrengthCheckerService, PasswordService]\n})\nexport class AuthenticationModule {}\n","import { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { IUser, UserService } from '@c8y/client';\nimport { AlertService } from '../alert/alert.service';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-user-totp-revoke',\n templateUrl: './user-totp.component.html'\n})\nexport class UserTotpRevokeComponent {\n @Input() user: IUser;\n @Output('revoke') revokeEmitter = new EventEmitter<undefined>();\n constructor(\n private users: UserService,\n private alert: AlertService,\n ) { }\n\n async revoke() {\n try {\n await this.users.totpRevokeSecret(this.user);\n this.alert.success(gettext('User TOTP secret revoked.'));\n this.revokeEmitter.next();\n } catch (e) {\n this.alert.addServerFailure(e);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { ModalModule } from '../modal/modal.module';\nimport { UserMenuItemComponent } from './user-menu-item.component';\nimport { UserEditModalComponent } from './user-edit-modal.component';\nimport { UserEditComponent } from './user-edit.component';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { UserMenuOutletComponent } from './user-menu-outlet.component';\nimport { AuthenticationModule } from '../authentication/authentication.module';\nimport { UserMenuService } from './user-menu.service';\nimport { AlertModule } from '../alert/alert.module';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { RouterModule } from '@angular/router';\nimport { FormsModule } from '../forms/forms.module';\nimport { UserTotpSetupComponent } from './user-totp-setup.component';\nimport { UserTotpRevokeComponent } from './user-totp-revoke.component';\n\n/**\n * The angular module definition for the user menu.\n * @exports UserMenuComponent\n * @exports UserMenuItemComponent\n * @exports UserEditComponent\n * @exports UserEditModalComponent\n */\n@NgModule({\n declarations: [\n UserMenuOutletComponent,\n UserEditComponent,\n UserEditModalComponent,\n UserMenuItemComponent,\n UserTotpSetupComponent,\n UserTotpRevokeComponent,\n ],\n imports: [\n FormsModule,\n CommonModule,\n ModalModule,\n BsDropdownModule,\n AuthenticationModule,\n AlertModule,\n RouterModule,\n TooltipModule.forRoot(),\n PopoverModule\n ],\n exports: [\n UserMenuOutletComponent,\n UserMenuItemComponent,\n UserEditComponent,\n UserEditModalComponent,\n UserTotpSetupComponent,\n UserTotpRevokeComponent\n ],\n entryComponents: [\n UserEditModalComponent,\n UserTotpSetupComponent,\n UserTotpRevokeComponent\n ]\n})\nexport class UserModule { }\n","import { NgModule } from '@angular/core';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { ActionModule } from '../action/action.module';\nimport { BreadcrumbModule } from '../breadcrumb/breadcrumb.module';\nimport { CommonModule } from '../common/common.module';\nimport { NavigatorModule } from '../navigator/navigator.module';\nimport { ProductExperienceModule } from '../product-experience/product-experience.module';\nimport { SearchModule } from '../search/search.module';\nimport { UserModule } from '../user/user.module';\nimport { AppIconComponent } from './application/app-icon.component';\nimport { AppSwitcherComponent } from './application/app-switcher.component';\nimport { HeaderBarComponent } from './header-bar/header-bar.component';\nimport { RightDrawerComponent } from './right-drawer/right-drawer.component';\nimport { TitleOutletComponent } from './title/title-outlet.component';\nimport { TitleComponent } from './title/title.component';\n\n/**\n * The angular module definition for the header of the application.\n * @exports HeaderBarComponent\n * @exports TitleComponent\n * @exports TitleOutletComponent\n * @exports AppIconComponent\n * @exports AppSwitcherComponent\n */\n@NgModule({\n declarations: [\n TitleComponent,\n HeaderBarComponent,\n TitleOutletComponent,\n AppIconComponent,\n AppSwitcherComponent,\n RightDrawerComponent\n ],\n imports: [\n BsDropdownModule,\n UserModule,\n SearchModule,\n CommonModule,\n ActionModule,\n BreadcrumbModule,\n NavigatorModule,\n ProductExperienceModule\n ],\n exports: [\n HeaderBarComponent,\n TitleComponent,\n TitleOutletComponent,\n AppIconComponent,\n AppSwitcherComponent,\n RightDrawerComponent\n ]\n})\nexport class HeaderModule {}\n","import { Component, OnInit, Output, Input, EventEmitter } from '@angular/core';\nimport { LoginService } from './login.service';\nimport { PasswordService } from '../authentication/password.service';\nimport { IResetPassword, ICredentials, UserService } from '@c8y/client';\nimport { OptionsService } from '../common/options.service';\nimport { AlertService } from '../alert/alert.service';\nimport { LoginViews } from './login.model';\n\n@Component({\n selector: 'c8y-change-password',\n templateUrl: './change-password.component.html',\n styles: []\n})\nexport class ChangePasswordComponent implements OnInit {\n @Input() credentials: ICredentials;\n @Output() onChangeView = new EventEmitter();\n\n passwordPattern = /^[a-zA-Z0-9`~!@#$%^&*()_|+\\-=?;:'\",.<>{}[\\]\\\\/]{8,32}$/;\n isLoading = false;\n model = {\n tenantId: '',\n email: '',\n newPassword: '',\n newPasswordConfirm: ''\n };\n emailReadOnly = false;\n passwordStrengthEnforced = false;\n\n private TOKEN_PARAM = 'token';\n private EMAIL_PARAM = 'email';\n\n constructor(\n public loginService: LoginService,\n private users: UserService,\n private passwordStrengthCheckerService: PasswordService,\n private options: OptionsService,\n private alert: AlertService\n ) { }\n\n async ngOnInit() {\n this.model.tenantId = this.loginService.getTenant();\n this.model.email = this.options.get(this.EMAIL_PARAM, '');\n this.emailReadOnly = !!this.model.email;\n this.passwordStrengthEnforced = await this.loginService.getPasswordStrengthEnforced();\n }\n\n async changePassword() {\n const passwordStrengthColor: any = this.passwordStrengthCheckerService.getStrengthColor(\n this.model.newPassword\n );\n const resetPassword: IResetPassword = {\n token: this.credentials.token,\n email: this.model.email,\n newPassword: this.model.newPassword,\n passwordStrength: passwordStrengthColor.passwordStrength\n };\n try {\n this.isLoading = true;\n const { res } = await this.users.resetPassword(resetPassword, this.model.tenantId);\n if (res.status === 200) {\n this.loginService.addSuccessMessage('password_changed');\n this.credentials.token = undefined;\n this.options.set(this.TOKEN_PARAM, undefined);\n this.onChangeView.emit({ view: LoginViews.Credentials });\n }\n } catch (e) {\n this.alert.addServerFailure(e);\n } finally {\n this.loginService.reset();\n this.isLoading = false;\n }\n }\n}\n","import { Component, OnInit, Output, EventEmitter } from '@angular/core';\nimport { LoginService } from './login.service';\nimport { ICredentials } from '@c8y/client';\nimport { AlertService } from '../alert/alert.service';\nimport { AppStateService } from '../common/ui-state.service';\nimport { gettext } from '../i18n/gettext';\nimport { LoginViews } from './login.model';\n\n@Component({\n selector: 'c8y-credentials',\n templateUrl: './credentials.component.html',\n styles: []\n})\nexport class CredentialsComponent implements OnInit {\n @Output() onChangeView = new EventEmitter();\n\n LOGIN_VIEWS = LoginViews;\n model: ICredentials = {};\n isLoading: boolean = false;\n showLoginForm: boolean = false;\n showBasicAuth: boolean = false;\n oauthOptions: any = {};\n\n private readonly PASSWORD_RESET_HEADER_NAME = 'passwordresettoken';\n private readonly NO_PHONE_HEADER_NAME = 'NoPhoneHeader';\n\n constructor(\n public loginService: LoginService,\n public alert: AlertService,\n public ui: AppStateService\n ) {}\n\n ngOnInit() {\n const { oauthOptions, loginMode } = this.loginService;\n this.model.tenant = this.loginService.getTenant();\n this.showLoginForm =\n typeof loginMode.visibleOnLoginPage === 'undefined' || loginMode.visibleOnLoginPage;\n this.showBasicAuth = loginMode.type === 'BASIC';\n this.oauthOptions = oauthOptions;\n }\n\n redirectToOauth() {\n this.loginService.redirectToOauth();\n }\n\n /**\n * Allows to login into the application using basic auth.\n * If successful logged in the client is set in shared/cumulocity.service.ts\n */\n async login() {\n try {\n this.isLoading = true;\n const basicAuth = this.loginService.useBasicAuth(this.model);\n await this.loginService.login(basicAuth, this.model);\n } catch (e) {\n if (e.res && e.res.headers && e.res.headers.get(this.PASSWORD_RESET_HEADER_NAME)) {\n this.handlePasswordReset(e.res);\n } else if (e.res && e.res.status === 401 && /pin/i.test(e.data.message)) {\n this.handleSmsChallenge(e.data.message);\n } else if (e.res && e.res.status === 401 && /TOTP/i.test(e.data.message)) {\n this.handleTotpChallenge(e.data.message);\n } else if (\n e.res &&\n e.res.headers &&\n e.res.headers.get(this.NO_PHONE_HEADER_NAME) &&\n !this.loginService.isSupportUser(this.model)\n ) {\n this.handleNoPhoneNumberProvided();\n } else {\n this.loginService.reset();\n this.alert.addServerFailure(e);\n }\n } finally {\n this.isLoading = false;\n }\n }\n\n private handlePasswordReset(e: any) {\n this.alert.removeLastDanger();\n this.model.token = e.headers.get(this.PASSWORD_RESET_HEADER_NAME);\n this.onChangeView.emit({ view: LoginViews.ChangePassword, credentials: this.model });\n }\n\n private handleTotpChallenge(message) {\n if (/TOTP setup required/i.test(message)) {\n this.onChangeView.emit({ view: LoginViews.TotpSetup, credentials: this.model });\n } else {\n this.onChangeView.emit({ view: LoginViews.TotpChallenge, credentials: this.model });\n }\n }\n\n private handleSmsChallenge(message: string) {\n if (/pin has already been generated/i.test(message)) {\n this.alert.warning(\n gettext(\n 'The verification code was already sent. For a new verification code, please click on the link above.'\n )\n );\n }\n this.alert.removeLastDanger();\n this.onChangeView.emit({ view: LoginViews.SmsChallenge, credentials: this.model });\n }\n\n private handleNoPhoneNumberProvided() {\n this.onChangeView.emit({ view: LoginViews.ProvidePhoneNumber, credentials: this.model });\n this.alert.warning(\n gettext(\n 'Two-factor authentication has been turned on for this account. Provide your phone number above to save it in your user profile and start receiving verification codes via SMS.'\n )\n );\n }\n}\n","import { Component, Input, OnInit, HostBinding, HostListener, ViewChild } from '@angular/core';\nimport { ICredentials } from '@c8y/client';\nimport { LoginService } from './login.service';\nimport { OptionsService } from '../common/options.service';\nimport { LoginViews } from './login.model';\nimport { AlertService } from '../alert/alert.service';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-login',\n templateUrl: './login.component.html',\n styles: []\n})\nexport class LoginComponent implements OnInit {\n currentView: LoginViews = LoginViews.None;\n LOGIN_VIEWS = LoginViews;\n\n disabled = false;\n\n @Input() name: string;\n\n credentials: ICredentials = {};\n displayAlerts: boolean = false;\n private TOKEN_PARAM = 'token';\n\n /**\n * Just DI.\n */\n constructor(\n public loginService: LoginService,\n private options: OptionsService,\n private alert: AlertService\n ) {}\n\n ngOnInit() {\n const token = this.getResetPasswordToken();\n if (this.loginService.isFirstLogin) {\n if (!token) {\n this.loginAutomatically();\n } else {\n this.credentials.token = token;\n this.reset();\n }\n }\n this.loginService.isFirstLogin = false;\n }\n\n handleLoginTemplate(event) {\n this.currentView = event.view;\n this.credentials = event.credentials || {};\n }\n\n @HostListener('keyup', ['$event']) onkeyup(event: KeyboardEvent) {\n if (event.key !== 'Enter') {\n this.loginService.cleanMessages();\n }\n }\n\n reset() {\n this.loginService.reset();\n this.setView();\n this.loginService.cleanMessages();\n }\n\n private async loginAutomatically() {\n try {\n await this.loginService.login();\n } catch (e) {\n const loginMode = this.loginService.loginMode.type;\n if (loginMode === 'OAUTH2') {\n this.loginService.redirectToOauth();\n } else {\n this.reset();\n if (loginMode === 'OAUTH2_INTERNAL' && window.location.protocol !== 'https:') {\n this.alert.danger(gettext('Current login mode only supports HTTPS.'));\n } else if (e.res && e.res.status === 403) {\n this.alert.addServerFailure(e);\n }\n }\n }\n }\n\n private setView() {\n if (this.credentials && this.credentials.token) {\n this.handleLoginTemplate({ view: LoginViews.ChangePassword, credentials: this.credentials });\n } else {\n this.handleLoginTemplate({ view: LoginViews.Credentials });\n }\n }\n\n private getResetPasswordToken() {\n const token = this.options.get(this.TOKEN_PARAM);\n if (token) {\n this.options.set(this.TOKEN_PARAM, undefined); // only use once\n }\n return token;\n }\n}\n","import { Component, OnInit, Output, EventEmitter } from '@angular/core';\nimport { UserService } from '@c8y/client';\nimport { LoginService } from './login.service';\nimport { LoginViews } from './login.model';\n\n@Component({\n selector: 'c8y-recover-password',\n templateUrl: './recover-password.component.html',\n styles: []\n})\n\nexport class RecoverPasswordComponent implements OnInit {\n\n @Output() onChangeView = new EventEmitter();\n LOGIN_VIEWS = LoginViews;\n isLoading = false;\n model = {\n email: '',\n tenantId: ''\n };\n\n constructor(\n private users: UserService,\n public loginService: LoginService) {\n }\n\n ngOnInit() {\n this.model.tenantId = this.loginService.getTenant();\n }\n\n async resetPassword() {\n try {\n this.isLoading = true;\n const { res } = await this.users.sendPasswordResetMail(this.model.email, this.model.tenantId);\n if (res.status === 200) {\n this.loginService.addSuccessMessage('password_reset_requested');\n }\n } finally {\n this.loginService.reset();\n this.isLoading = false;\n }\n }\n\n}\n","import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';\nimport { ICredentials, UserService } from '@c8y/client';\nimport { AlertService } from '../alert/alert.service';\nimport { LoginService } from './login.service';\nimport { LoginViews } from './login.model';\nimport { gettext } from '../i18n/gettext';\n\n@Component({\n selector: 'c8y-totp-auth',\n templateUrl: './totp-auth.component.html'\n})\nexport class TotpAuthComponent implements OnInit {\n @Input() credentials: ICredentials;\n @Input() view: LoginViews;\n @Output() onCancel = new EventEmitter();\n LOGIN_VIEWS = LoginViews;\n loading = false;\n hasError = false;\n isSetup = false;\n\n constructor(\n public loginService: LoginService,\n private userService: UserService,\n private alert: AlertService\n ) {}\n\n /**\n * In case of a setup we need the user to be authorized\n * first.\n */\n async ngOnInit() {\n if (this.view === this.LOGIN_VIEWS.TotpSetup) {\n await this.loginService.switchLoginMode(this.credentials);\n this.isSetup = true;\n }\n }\n\n async onTotpSuccess(code) {\n try {\n this.loading = true;\n this.hasError = false;\n this.credentials.tfa = code;\n if (this.isSetup) {\n await this.userService.activateTotp();\n }\n await this.loginService.switchLoginMode(this.credentials);\n await this.loginService.verifyAppAccess();\n await this.loginService.authFulfilled();\n } catch (e) {\n this.alert.removeLastDanger();\n if (e.data && e.data.message === 'Access is denied') {\n this.alert.addServerFailure(e);\n }\n if (e.data && e.data.message === 'Authentication failed! : User account is locked') {\n this.alert.warning(gettext('Authentication failed due to: user account is locked.'));\n } else {\n this.hasError = true;\n }\n } finally {\n this.loading = false;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PasswordService } from '../authentication';\nimport { PasswordStrength } from '@c8y/client';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class StrengthValidatorService {\n\n constructor(private passwordService: PasswordService) {\n }\n\n isStrong(password: string): boolean {\n return this.isPasswordGreen(this.passwordService.getStrengthColor(password).passwordStrength);\n }\n\n private isPasswordGreen(strength: PasswordStrength) {\n return strength as PasswordStrength === PasswordStrength.GREEN as PasswordStrength;\n }\n}\n","import { Directive, Input } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\nimport { StrengthValidatorService } from './strength-validator-service';\n\n@Directive({\n selector: '[passwordStrengthEnforced]',\n providers: [{ provide: NG_VALIDATORS, useExisting: PasswordStrengthValidatorDirective, multi: true }]\n})\nexport class PasswordStrengthValidatorDirective implements Validator {\n\n private forced: boolean;\n\n @Input() set passwordStrengthEnforced(value) {\n this.forced = value;\n }\n\n constructor(\n public passwordService: StrengthValidatorService) {\n }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const strengthFulfilled = this.passwordService.isStrong(control.value || '');\n const enforcementForcedAndNotFulfilled = this.forced && !strengthFulfilled;\n return enforcementForcedAndNotFulfilled ? { passwordStrength: true } : null;\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { FormsModule as C8yFormsModule } from '../forms/forms.module';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { CommonModule } from '../common/common.module';\nimport { ChangePasswordComponent } from './change-password.component';\nimport { CredentialsComponent } from './credentials.component';\nimport { LoginComponent } from './login.component';\nimport { LoginService } from './login.service';\nimport { RecoverPasswordComponent } from './recover-password.component';\nimport { AuthenticationModule } from '../authentication/authentication.module';\nimport { AlertModule } from '../alert/alert.module';\nimport { TotpAuthComponent } from './totp-auth.component';\nimport { PasswordStrengthValidatorDirective } from './password-strength-validator.directive';\n\n/**\n * The angular module definition for the login.\n * @exports LoginComponent\n */\n@NgModule({\n declarations: [\n LoginComponent,\n RecoverPasswordComponent,\n ChangePasswordComponent,\n CredentialsComponent,\n TotpAuthComponent,\n PasswordStrengthValidatorDirective\n ],\n imports: [\n FormsModule,\n TooltipModule,\n CommonModule,\n AuthenticationModule,\n AlertModule,\n C8yFormsModule\n ],\n exports: [LoginComponent]\n})\nexport class LoginModule {\n static forRoot() {\n return {\n ngModule: LoginModule,\n providers: LoginModule.providers()\n };\n }\n static providers() {\n return [LoginService];\n }\n}\n","import {\n Component,\n ViewChild,\n Input,\n ViewContainerRef,\n AfterContentInit,\n OnDestroy\n} from '@angular/core';\nimport { TabsService } from './tabs.service';\nimport { Tab } from './tab.model';\n\n@Component({\n selector: 'c8y-tab',\n template: '<ng-template #tpl><ng-content></ng-content></ng-template>'\n})\nexport class TabComponent implements AfterContentInit, OnDestroy, Tab {\n @ViewChild('tpl', { static: false }) template: ViewContainerRef;\n @Input() path: string;\n @Input() label: string = '';\n @Input() icon: string;\n @Input() priority: number;\n @Input() orientation: 'horizontal' | 'vertical';\n constructor(private tabs: TabsService) {}\n\n ngAfterContentInit() {\n setTimeout(() => this.tabs.add(this as Tab));\n }\n\n ngOnDestroy() {\n this.tabs.remove(this as Tab);\n }\n}\n","import {\n Component,\n Input,\n HostBinding,\n Renderer2,\n ElementRef,\n OnChanges,\n ViewChild,\n OnDestroy,\n AfterContentInit,\n AfterContentChecked} from '@angular/core';\nimport { debounceTime } from 'rxjs/operators';\nimport { fromEventPattern, fromEvent, merge, Subscription } from 'rxjs';\nimport { Router } from '@angular/router';\nimport { Tab } from './tab.model';\n\n@Component({\n selector: 'c8y-tabs-outlet,c8y-ui-tabs',\n templateUrl: './tabs-outlet.component.html',\n})\nexport class TabsOutletComponent implements OnDestroy, AfterContentInit {\n @Input() tabs: any[] = [];\n @Input() orientation: 'vertical' | 'horizontal' = 'vertical';\n @Input() navigatorOpen = false;\n showLeft: boolean = false;\n showRight: boolean = false;\n @HostBinding('class.navigator-open') get isNavigatorOpen() {\n return this.navigatorOpen;\n }\n @HostBinding('class.page-tabs') get hasTabs() {\n let visibleTabs = [];\n if (this.tabs) {\n visibleTabs = this.tabs.filter(tab => tab.hide !== true);\n }\n return visibleTabs.length;\n }\n @HostBinding('class.page-tabs-horizontal') get isHorizontal() {\n return this.orientation === 'horizontal';\n }\n @HostBinding('class.page-tabs-vertical') get isVertical() {\n return this.orientation !== 'horizontal';\n }\n @ViewChild('container', {read: ElementRef, static: true}) private container: ElementRef;\n @ViewChild('left', {read: ElementRef, static: false}) private leftBtn: ElementRef;\n @ViewChild('right', {read: ElementRef, static: false}) private rightBtn: ElementRef;\n @ViewChild('tabsContainer', {read: ElementRef, static: false}) private tabsContainer: ElementRef;\n private scrollSubscription: Subscription;\n\n constructor(\n private router: Router,\n private renderer: Renderer2,\n private el: ElementRef\n ) {}\n\n ngOnDestroy() {\n if (this.scrollSubscription) {\n this.scrollSubscription.unsubscribe();\n }\n }\n\n ngAfterContentInit() {\n if (this.orientation === 'horizontal') {\n this.scrollSubscribe();\n }\n\n }\n\n isActive(tab: Tab) {\n if (tab && tab.path) {\n return this.router.isActive(tab.path, false);\n } else {\n return false;\n }\n }\n\n navigateTo(path) {\n this.router.navigate([path]);\n }\n\n scroll(direction: 'right' | 'left' = 'right') {\n const { widthScroll, width, scrollLeft } = this.getDimensions();\n const multiplier = direction === 'left' ? -1 : 1;\n\n let targetScroll = scrollLeft + width * multiplier;\n if (targetScroll < 0) {\n targetScroll = 0;\n }\n if (targetScroll > widthScroll - width) {\n targetScroll = widthScroll - width;\n }\n // TODO: we should animate this\n this.container.nativeElement.scrollLeft = targetScroll;\n }\n\n private scrollSubscribe() {\n let unlisten;\n this.scrollSubscription = merge(\n fromEvent(this.container.nativeElement, 'scroll'),\n fromEventPattern(\n (handler: any) => {\n unlisten = this.renderer.listen('window', 'resize', handler);\n },\n () => unlisten()\n )\n ).pipe(\n debounceTime(250)\n ).subscribe(() => this.updateScroll());\n }\n\n private updateScroll() {\n const { widthScroll, width, scrollLeft } = this.getDimensions();\n this.showLeft = !!scrollLeft;\n this.showRight = widthScroll > width + scrollLeft;\n }\n\n private getDimensions() {\n const elTabs = this.tabsContainer.nativeElement;\n const el = this.container.nativeElement;\n const widthScroll = elTabs.scrollWidth;\n const width = el.clientWidth;\n const scrollLeft = el.scrollLeft;\n return { widthScroll, width, scrollLeft };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CommonModule } from '../common/common.module';\nimport { TabComponent } from './tab.component';\nimport { TabsOutletComponent } from './tabs-outlet.component';\nimport { TabsService } from './tabs.service';\n\n@NgModule({\n declarations: [\n TabsOutletComponent,\n TabComponent\n ],\n imports: [\n CommonModule,\n RouterModule.forChild([])\n ],\n exports: [\n TabsOutletComponent,\n TabComponent\n ]\n})\nexport class TabsModule {}\n","import { Component, ViewChild } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { Status, StatusType } from '../../../common/status.model';\nimport { gettext } from '../../../i18n/gettext';\nimport { ConfirmModalComponent } from '../../../modal/modal-confirm.component';\nimport { ModalLabels } from '../../../select-modal/select-modal.model';\nimport { Cookie, CookiePreferences } from '../cookie-banner.model';\nimport { CookieBannerService } from '../cookie-banner.service';\n\n@Component({\n selector: 'c8y-cookie-banner-preferences-modal',\n templateUrl: './cookie-banner-preferences-modal.component.html'\n})\nexport class CookieBannerPreferencesModalComponent {\n @ViewChild('modalRef', { static: false }) modalRef: ConfirmModalComponent;\n closeSubject: Subject<CookiePreferences> = new Subject();\n title = gettext('Cookie preferences');\n labels: ModalLabels = { ok: gettext('Save settings'), cancel: gettext('Cancel') };\n status: StatusType = Status.INFO;\n configCookiePreferences: CookiePreferences;\n configCookiePreferencesList: Cookie[];\n\n constructor(private cookieBannerService: CookieBannerService) {}\n\n ngOnInit() {\n this.configCookiePreferencesList = this.cookieBannerService.transformCookiePreferencesToList(\n this.configCookiePreferences\n );\n }\n\n async ngAfterViewInit() {\n try {\n await this.modalRef.result;\n this.onClose();\n } catch (error) {\n this.onDismiss();\n }\n }\n\n onClose() {\n const cookiePref: CookiePreferences = this.cookieBannerService.transformCookiePreferencesListToCookiePreferences(\n this.configCookiePreferencesList\n );\n\n this.closeSubject.next(cookiePref);\n this.closeSubject.complete();\n }\n\n onDismiss() {\n this.closeSubject.next(undefined);\n this.closeSubject.complete();\n }\n\n getCookieDescription(cookieType: string): string {\n return this.cookieBannerService.getCookieDescription(cookieType);\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { CookieBannerPreferencesModalComponent } from './cookie-banner-preferences-modal/cookie-banner-preferences-modal.component';\nimport { CookieBannerSettings, CookiePreferences } from './cookie-banner.model';\nimport { CookieBannerService } from './cookie-banner.service';\n\n@Component({\n selector: 'c8y-cookie-banner',\n templateUrl: './cookie-banner.component.html'\n})\nexport class CookieBannerComponent implements OnInit {\n settings: CookieBannerSettings;\n showBanner: boolean;\n shouldDisable: boolean = false;\n cookiePreferences: CookiePreferences;\n constructor(\n private bsModalService: BsModalService,\n private cookieBannerService: CookieBannerService\n ) {}\n\n ngOnInit() {\n this.settings = this.cookieBannerService.getCookieBannerSettings();\n this.cookiePreferences = this.cookieBannerService.getCookiePreferencesConfig();\n this.shouldShowCookieBanner();\n }\n\n onConfigurePreferences() {\n this.disableButtons(true);\n\n const initialState = {\n configCookiePreferences: this.cookiePreferences\n };\n\n const modalRef = this.bsModalService.show(CookieBannerPreferencesModalComponent, {\n initialState\n });\n\n modalRef.content.closeSubject.subscribe((userCookiePreferences: CookiePreferences) => {\n this.disableButtons(false);\n if (userCookiePreferences) {\n this.cookieBannerService.setCookies(userCookiePreferences);\n this.setCookieBannerVisibility(false);\n }\n });\n }\n\n acceptCookies() {\n this.cookieBannerService.setCookies(this.cookiePreferences || { required: true });\n this.setCookieBannerVisibility(false);\n }\n\n private shouldShowCookieBanner() {\n this.setCookieBannerVisibility(this.cookieBannerService.shouldShowCookieBanner());\n }\n\n private disableButtons(shouldDisable: boolean) {\n this.shouldDisable = shouldDisable;\n }\n\n private setCookieBannerVisibility(shouldShow: boolean) {\n this.showBanner = shouldShow;\n this.cookieBannerService.isCookieBannerShowed$.next(shouldShow);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { ActionBarModule } from '../action-bar/action-bar.module';\nimport { AlertModule } from '../alert/alert.module';\nimport { CommonModule } from '../common/common.module';\nimport { HeaderModule } from '../header/header.module';\nimport { LoginModule } from '../login/login.module';\nimport { ModalModule } from '../modal/modal.module';\nimport { NavigatorModule } from '../navigator/navigator.module';\nimport { TabsModule } from '../tabs/tabs.module';\nimport { BootstrapComponent } from './bootstrap.component';\nimport { CookieBannerPreferencesModalComponent } from './cookie-banner/cookie-banner-preferences-modal/cookie-banner-preferences-modal.component';\nimport { CookieBannerComponent } from './cookie-banner/cookie-banner.component';\nimport { CookieBannerService } from './cookie-banner/cookie-banner.service';\n\n/**\n * The module which allows to bootstrap a custom application.\n * Use it as `bootstrap: []` component in your main app module\n * or as `<c8y-bootstrap>` in your main app.\n */\n@NgModule({\n declarations: [BootstrapComponent, CookieBannerComponent, CookieBannerPreferencesModalComponent],\n imports: [\n FormsModule,\n CommonModule,\n HeaderModule,\n LoginModule,\n RouterModule,\n TabsModule,\n ActionBarModule,\n AlertModule,\n NavigatorModule,\n TooltipModule,\n ModalModule\n ],\n exports: [BootstrapComponent],\n entryComponents: [BootstrapComponent, CookieBannerPreferencesModalComponent],\n providers: [CookieBannerService]\n})\nexport class BootstrapModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { DropAreaComponent } from './drop-area.component';\n\n/**\n * The angular module definition for a drop-area.\n * @exports DropAreaComponent\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n exports: [\n DropAreaComponent,\n ],\n declarations: [\n DropAreaComponent,\n ]\n})\nexport class DropAreaModule { }\n","import { Route as ngRoute } from '@angular/router';\nimport { ExtensionFactory } from '../common/extension-hooks';\nimport { Tab } from '../tabs/tab.model';\n\nexport enum ViewContext {\n Device = 'device/:id',\n Group = 'group/:id',\n User = 'users/:id',\n Application = 'applications/:id',\n SubscribedApplications = 'subscribedApplications/:id',\n Tenant = 'tenants/:id',\n Report = 'reports/:id'\n}\n\nexport type Route = Partial<ngRoute> & {\n path: string;\n label?: string;\n icon?: string;\n context?: ViewContext;\n priority?: number;\n\n /**\n * Allow to emit multiple tabs on one context route.\n */\n tabs?: Tab[];\n};\n\nexport type RouteFactory = ExtensionFactory<Route>;\n","import { Component, Output, Input, EventEmitter, ViewChild, OnInit } from '@angular/core';\nimport { DroppedFile, DropAreaComponent } from '../drop-area/drop-area.component';\nimport { PickedFiles } from './file-picker.model';\nimport { isEmpty } from 'lodash-es';\n\n/**\n * User can upload a binary directly or use an URL.\n *\n * ## Usage Example:\n *\n * ```html\n * <div>\n * <c8y-file-picker [maxAllowedFiles]=\"1\" (onFilesPicked)=\"onFile($event)\">\n * </c8y-file-picker>\n * </div>\n * ```\n */\n\n@Component({\n selector: 'c8y-file-picker',\n templateUrl: './file-picker.component.html'\n})\nexport class FilePickerComponent implements OnInit {\n @ViewChild(DropAreaComponent, { static: true }) dropArea: DropAreaComponent;\n @Output() onFilesPicked: EventEmitter<PickedFiles> = new EventEmitter();\n @Input() maxAllowedFiles: number = Infinity;\n @Input() uploadChoice: 'uploadBinary' | 'uploadUrl' = 'uploadBinary';\n @Input() fileUrl: string;\n @Input() fileBinary: DroppedFile;\n /**\n * Additional string to be displayed in a popover.\n */\n @Input() fileUrlPopover: string;\n\n droppedFiles: DroppedFile[];\n private fileToSave: PickedFiles;\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n if (this.fileBinary) {\n this.droppedFiles = [this.fileBinary];\n }\n }\n\n /**\n * Triggered by dropped file in component and pass it into drop-area component.\n */\n onFileDropped(droppedFiles: DroppedFile[]): void {\n this.onFilesPicked.emit({\n droppedFiles\n });\n }\n\n /**\n * Triggered when user changes upload choice, from upload url to upload binary.\n */\n clearInputFromUrl(): void {\n delete this.fileUrl;\n this.fileToSave = {\n url: undefined\n };\n this.onFilesPicked.emit(this.fileToSave);\n }\n\n /**\n * Triggered when user changes upload choice, to avoid cumulation of droppedFiles.\n */\n clearSelectedFiles(): void {\n this.dropArea.onDelete();\n this.fileToSave = {\n droppedFiles: undefined\n };\n this.onFilesPicked.emit(this.fileToSave);\n }\n\n /**\n * Triggered when user puts binary's url to upload.\n */\n onFileUrlChange(urlStr): void {\n this.fileToSave = {\n url: urlStr\n };\n this.onFilesPicked.emit(this.fileToSave);\n }\n\n /**\n * Checks if there is popover to display.\n */\n isPopoverUsed() {\n return !isEmpty(this.fileUrlPopover);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule as C8yCommonModule } from '../common/common.module';\nimport { FilePickerComponent } from './file-picker.component';\nimport { DropAreaModule } from '../drop-area/drop-area.module';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule as C8yFormsModule } from '../forms/forms.module';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\n\n/**\n * The angular module definition for a drop-area.\n * @exports FilePickerComponent\n */\n@NgModule({\n imports: [\n C8yFormsModule,\n CommonModule,\n DropAreaModule,\n FormsModule,\n C8yCommonModule,\n PopoverModule\n ],\n exports: [FilePickerComponent],\n declarations: [FilePickerComponent]\n})\nexport class FilePickerModule {}\n","import { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { PickedDates } from './date-picker.model';\n\n@Component({\n selector: 'c8y-date-picker',\n templateUrl: './date-picker.component.html'\n})\nexport class DatePickerComponent implements OnInit {\n @Output() onDateSelected: EventEmitter<PickedDates> = new EventEmitter();\n\n fgDatePicker: FormGroup;\n\n ngOnInit() {\n this.fgDatePicker = new FormGroup({\n dateFrom: new FormControl(),\n dateTo: new FormControl()\n });\n }\n\n filter() {\n this.onDateSelected.emit(this.fgDatePicker.value);\n }\n\n clearFilter() {\n this.fgDatePicker.setValue({\n dateFrom: null,\n dateTo: null\n });\n this.onDateSelected.emit(null);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule as C8yCommonModule } from '../common/common.module';\nimport { DatePickerComponent } from './date-picker.component';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule as C8yFormsModule } from '../forms/index';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { BsDatepickerModule } from 'ngx-bootstrap/datepicker';\n\n/**\n * The angular module definition for a date picker - it allows you to pick either one date or a range of two.\n * @exports DatePickerComponent\n */\n@NgModule({\n imports: [\n C8yFormsModule,\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n BsDropdownModule.forRoot(),\n BsDatepickerModule.forRoot(),\n C8yCommonModule\n ],\n exports: [DatePickerComponent],\n declarations: [DatePickerComponent]\n})\nexport class DatePickerModule {}\n","import { Injector, Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router';\nimport { from, isObservable, of, Observable } from 'rxjs';\nimport { every, filter, map, mergeMap, toArray, tap, debounceTime } from 'rxjs/operators';\nimport { Tab } from '../tabs/tab.model';\nimport { Route } from './router.models';\n\n@Injectable()\nexport class RouterTabsResolver {\n constructor(private injector: Injector, private router: Router) {}\n\n get routerStateSnapshot() {\n return this.router.routerState.snapshot;\n }\n\n resolve(route: ActivatedRouteSnapshot) {\n const latestChildren = this.router.config.find(r => route.routeConfig.path === r.path).children;\n return from(latestChildren || []).pipe(\n mergeMap((child: Route) =>\n from(this.getGuards(child)).pipe(\n map((guard: CanActivate) => guard.canActivate(route, this.routerStateSnapshot)),\n mergeMap((result: any) => {\n if (isObservable(result)) {\n return result;\n }\n if (result && typeof result.then === 'function') {\n return from(result);\n }\n return of(result);\n }),\n tap(result => {\n if (Array.isArray(result)) {\n child.tabs = result;\n }\n }),\n every(result => !!result),\n filter(result => result),\n mergeMap(() => (Array.isArray(child.tabs) ? from(child.tabs) : of(child as Tab))),\n map(result =>\n result.label || result.path\n ? ({\n label: result.label,\n icon: result.icon,\n path: `${decodeURIComponent(route.url.join('/'))}/${result.path}`,\n priority: result.priority,\n hide: result.hide\n } as Tab)\n : undefined\n )\n )\n ),\n filter(tabs => !!tabs),\n toArray()\n ) as Observable<Tab[]>;\n }\n\n private getGuards(child: Route) {\n const guards = (child.canActivate || []).map(guard => {\n return this.injector.get(guard);\n });\n if (child.data && child.data.showIf) {\n guards.push({ canActivate: child.data.showIf });\n }\n return guards;\n }\n}\n","import {\n InventoryService,\n UserService,\n ApplicationService,\n TenantService,\n} from '@c8y/client';\nimport { ViewContext } from './router.models';\n\nexport class ViewContextServices {\n static services = new Map<ViewContext, any>([\n [ViewContext.Device, InventoryService],\n [ViewContext.Group, InventoryService],\n [ViewContext.User, UserService],\n [ViewContext.Application, ApplicationService],\n [ViewContext.SubscribedApplications, ApplicationService],\n [ViewContext.Tenant, TenantService],\n [ViewContext.Report, InventoryService]\n ]);\n\n static contextToService(context: ViewContext) {\n return ViewContextServices.services.get(context);\n }\n}\n","import { Injectable, Injector } from '@angular/core';\nimport {\n ActivatedRoute,\n NavigationEnd,\n PRIMARY_OUTLET,\n Router,\n UrlSegmentGroup,\n UrlTree\n} from '@angular/router';\nimport { ApiService, ApiCall } from '@c8y/ngx-components/api';\nimport { NEVER, Observable, Subject, Subscription } from 'rxjs';\nimport { filter, map, merge, switchMap, tap } from 'rxjs/operators';\nimport { Tab } from '../tabs/tab.model';\nimport { TabsService } from '../tabs/tabs.service';\nimport { RouterTabsResolver } from './router-tabs.resolver';\nimport { ViewContextServices } from './view-context.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ContextRouteService {\n private dataSubscription: Subscription;\n private routerSubscription: Subscription;\n private lastAddedTabs = [];\n private refreshTrigger = new Subject();\n\n constructor(\n private tabsResolver: RouterTabsResolver,\n private tabsService: TabsService,\n private router: Router,\n private apiService: ApiService,\n private injector: Injector\n ) {}\n\n init(route: ActivatedRoute): void {\n this.routerSubscription = this.router.events\n .pipe(filter(e => e instanceof NavigationEnd))\n .subscribe(() => this.redirectToFirstTab());\n\n this.dataSubscription = route.data\n .pipe(\n merge(this.updatedContext(route), this.refreshTrigger),\n switchMap(() => this.tabsResolver.resolve(route.snapshot)),\n )\n .subscribe(tabs => this.updateTabs(tabs));\n }\n\n destroy(): void {\n this.dataSubscription.unsubscribe();\n this.routerSubscription.unsubscribe();\n this.lastAddedTabs.forEach(t => this.tabsService.remove(t));\n }\n\n refreshContext() {\n this.refreshTrigger.next();\n }\n\n updatedContext(route: ActivatedRoute): Observable<ApiCall> {\n const { data } = route.snapshot;\n const serviceInstance = ViewContextServices.contextToService(data.context);\n if (serviceInstance) {\n const service = this.injector.get(serviceInstance);\n const detailsUrlRegex = service.getDetailUrl(data.contextData).replace(/\\d+/g, '?\\\\d*');\n const contextRegex = new RegExp(detailsUrlRegex, 'i');\n const childrenRegex = new RegExp(`${detailsUrlRegex}/child`, 'i');\n const filterResponse = ({ url, method }) => {\n const contextChanged = contextRegex.test(url) && ['POST', 'PUT'].includes(method);\n const childrenAffected = childrenRegex.test(url) && ['POST', 'DELETE'].includes(method);\n return contextChanged || childrenAffected;\n };\n return this.apiService.hookResponse(filterResponse);\n }\n return NEVER;\n }\n\n private updateTabs(tabs = []) {\n this.lastAddedTabs.forEach(t => this.tabsService.remove(t));\n this.lastAddedTabs = tabs;\n tabs.forEach(t => this.tabsService.add(t));\n this.redirectToFirstTab();\n }\n\n private redirectToFirstTab() {\n if (this.needsRedirect()) {\n this.tabsService.firstTab$.subscribe((tab: Tab) => {\n if (tab) {\n this.router.navigateByUrl(tab.path, { replaceUrl: true });\n }\n });\n }\n }\n\n private needsRedirect() {\n const tree: UrlTree = this.router.parseUrl(this.router.url);\n const groups: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];\n const isContextRoute = groups.segments.length === 2;\n return isContextRoute;\n }\n}\n","import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { fromFactories } from '../common/extension-hooks';\nimport { RouteFactory, Route } from './router.models';\nimport { TabsService } from '../tabs/tabs.service';\nimport { ContextRouteService } from './context-route.service';\n\n/**\n * A hook to use for Multi Provider extension.\n */\nexport const HOOK_ONCE_ROUTE = new InjectionToken('RouteFactory');\n\n/**\n * A service which defines routes\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class RouterService {\n constructor(\n @Optional() @Inject(HOOK_ONCE_ROUTE) factories: RouteFactory[],\n private router: Router,\n public tabsService: TabsService,\n private contextRouteService: ContextRouteService\n ) {\n fromFactories(factories).subscribe((routes: Route[]) => {\n this.addRoute(routes);\n });\n }\n\n /**\n * Refresh the current context\n */\n refresh() {\n this.contextRouteService.refreshContext();\n }\n\n /**\n * Add a new route to the router configuration or a context.\n * @param route The route to add\n */\n addRoute(route: Route | Route[]) {\n this.addRoutes(Array.isArray(route) ? route : [route]);\n }\n\n private addRoutes(routes) {\n const emptyRoute = this.router.config.find(r => r.path === '**');\n this.router.resetConfig(\n [\n ...this.router.config.filter(r => r.path !== '**'),\n ...routes.map((r: Route) => this.convertRoute(this.router.config, r)),\n emptyRoute\n ].filter(Boolean)\n );\n }\n\n private convertRoute(initialConfig, route: Route) {\n if (route.context) {\n initialConfig.forEach((r: Route) => {\n if (r.data && r.data.context === route.context) {\n r.children = [route, ...(r.children || [])];\n }\n });\n return;\n }\n return route;\n }\n}\n","import { Component } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { ContextRouteService } from './context-route.service';\n\n@Component({\n selector: 'c8y-context-route',\n templateUrl: './context-route.component.html'\n})\nexport class ContextRouteComponent {\n constructor(private route: ActivatedRoute, private contextRouteService: ContextRouteService) {}\n\n ngOnInit(): void {\n this.contextRouteService.init(this.route);\n }\n\n ngOnDestroy(): void {\n this.contextRouteService.destroy();\n }\n\n refreshTabs() {\n this.contextRouteService.refreshContext();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { FetchClient, IFetchOptions } from '@c8y/client';\nimport { Subject, Observable } from 'rxjs';\nimport { ApiCall, ApiCallOptions } from './api.model';\nimport { filter } from 'rxjs/operators';\n\n@Injectable()\nexport class ApiService {\n calls: Observable<ApiCall>;\n private callsSubject = new Subject<ApiCall>();\n\n constructor(private client: FetchClient) {\n this.calls = this.callsSubject.asObservable();\n this.hookIntoClientFetch();\n }\n\n hookResponse(hookFilter: (call: ApiCall) => boolean) {\n return this.callsSubject.pipe(\n filter(({ phase }) => phase === 'finish'),\n filter(hookFilter)\n );\n }\n\n hookRequest(hookFilter: (call: ApiCall) => boolean) {\n return this.callsSubject.pipe(\n filter(({ phase }) => phase === 'start'),\n filter(hookFilter)\n );\n }\n\n async onFinish(call: ApiCall) {\n this.callsSubject.next({ phase: 'finish', ...call });\n }\n\n onStart(call: ApiCall) {\n this.callsSubject.next({ phase: 'start', ...call });\n }\n\n async resolveData(call: ApiCall): Promise<any> {\n const { response, method } = call;\n if ('data' in response) {\n return Promise.resolve({ data: response.data, method });\n } else {\n const cb = (data) => ({ data, method});\n return (response as Response).clone().json().then(cb, cb);\n }\n }\n\n private hookIntoClientFetch() {\n const fetch = this.client.fetch.bind(this.client);\n this.client.fetch = async (url, options: ApiCallOptions & IFetchOptions = { method: 'GET'}) => {\n const { method } = options;\n this.onStart({ options, method, url });\n let fetchPromise = fetch(url, options);\n if (typeof options.responseInterceptor === 'function') {\n fetchPromise = fetchPromise.then(options.responseInterceptor);\n }\n fetchPromise.then(\n (response: Response) => this.onFinish({ response, url, options, method }),\n (response: Response) => this.onFinish({ response, url, options, method })\n );\n return fetchPromise;\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { BasicAuth, FetchClient, Realtime, CookieAuth } from '@c8y/client';\nimport { ApiService } from './api.service';\nimport * as services from './services';\n\nfunction toProvider(provide) {\n let deps: any[] = [FetchClient, Realtime];\n if (provide === FetchClient) {\n deps = [CookieAuth];\n }\n if (provide === BasicAuth || provide === CookieAuth) {\n deps = [];\n }\n if (provide === Realtime) {\n deps = [FetchClient];\n }\n return {provide, useClass: provide, deps};\n}\n\nconst providers: any[] = (Object.keys(services).map((k) => toProvider(services[k])) as any[])\n .concat([\n { provide: ApiService, useClass: ApiService, deps: [FetchClient] }\n ]);\n// @dynamic\n@NgModule()\nexport class DataModule {\n static providers() {\n return providers;\n }\n static forRoot() {\n return {\n ngModule: DataModule,\n providers\n };\n }\n}\n","import { Injectable, Injector } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate } from '@angular/router';\nimport { from, of } from 'rxjs';\nimport { catchError, map, shareReplay, tap } from 'rxjs/operators';\nimport { ViewContextServices } from './view-context.service';\nimport { InventoryService } from '../../api';\n\n@Injectable()\nexport class ContextRouteGuard implements CanActivate {\n private caches = new Map();\n constructor(private injector: Injector) {}\n\n canActivate(route: ActivatedRouteSnapshot) {\n const id = route.paramMap.get('id');\n const service = this.service(route);\n this.clearDetailCached(service, id);\n return this.detailCached(service, id).pipe(\n tap(contextData => (route.data = { ...route.data, contextData })),\n map(() => true),\n catchError(ex => of(false))\n );\n }\n\n private service(route) {\n const serviceInstance = ViewContextServices.contextToService(route.data.context);\n return this.injector.get(serviceInstance);\n }\n\n private detailCached(service, id) {\n const cache = this.getCache(service);\n let cached = cache[id];\n if (!cached) {\n const params = service instanceof InventoryService ? { withChildren: false } : undefined;\n cached = from(service.detail(id, params)).pipe(\n map(({ data }) => data),\n shareReplay(1)\n );\n cache[id] = cached;\n }\n return cached;\n }\n\n private clearDetailCached(service, id) {\n const cache: Map<any, any> = this.getCache(service);\n delete cache[id];\n }\n\n private getCache(service) {\n let cache = this.caches.get(service);\n if (!cache) {\n cache = {};\n this.caches.set(service, cache);\n }\n return cache;\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({selector: 'empty', template: ''})\nexport class EmptyComponent {}\n","import { NgModule } from '@angular/core';\nimport { RouterModule as NgRouterModule } from '@angular/router';\nimport { RouterService } from './router.service';\nimport { ContextRouteComponent } from './context-route.component';\nimport { HeaderModule } from '../header/header.module';\nimport { CommonModule } from '../common/common.module';\nimport { ContextRouteGuard } from './context-route.guard';\nimport { ViewContext, Route } from './router.models';\nimport { RouterTabsResolver } from './router-tabs.resolver';\nimport { EmptyComponent } from './empty.component';\n\nexport const routes: Route[] = [{\n path: 'users/new',\n component: EmptyComponent\n},\n{\n path: 'tenants/new',\n component: EmptyComponent\n}];\n// tslint:disable-next-line: forin\nfor (const key in ViewContext) {\n const context = ViewContext[key];\n routes.push({\n path: context,\n component: ContextRouteComponent,\n canActivate: [ ContextRouteGuard ],\n data: { context, contextData: {} },\n resolve: {\n tabs: RouterTabsResolver,\n }\n });\n}\n\n@NgModule({\n declarations: [ ContextRouteComponent, EmptyComponent],\n imports: [\n NgRouterModule.forRoot(routes),\n HeaderModule,\n CommonModule\n ],\n entryComponents: [ContextRouteComponent, EmptyComponent]\n})\nexport class RouterModule {\n static providers() {\n return [\n ContextRouteGuard,\n RouterTabsResolver,\n RouterService\n ];\n }\n\n static forRoot() {\n return {\n ngModule: RouterModule,\n providers: RouterModule.providers()\n };\n }\n\n constructor(routerService: RouterService) {\n // Declared but never used is intended: to always have a instance of RouterService.\n }\n}\n","import { gettext } from '../i18n/gettext';\nimport { formatDate } from '@angular/common';\n// TODO remove when c8y-icon will works\n\nexport enum SendStatus {\n AVAILABLE = 'AVAILABLE',\n UNAVAILABLE = 'UNAVAILABLE',\n UNKNOWN = 'UNKNOWN',\n MAINTENANCE = 'MAINTENANCE',\n NOT_MONITORED = 'NOT_MONITORED'\n}\n\nexport enum PushStatus {\n CONNECTED = 'CONNECTED',\n DISCONNECTED = 'DISCONNECTED',\n UNKNOWN = 'UNKNOWN',\n MAINTENANCE = 'MAINTENANCE'\n}\n\nexport enum SendStatusLabels {\n AVAILABLE = gettext('Send connection: online'),\n NOT_MONITORED = gettext('Send connection: not monitored'),\n UNAVAILABLE = gettext('Send connection: offline'),\n UNKNOWN = gettext('Send connection status unknown'),\n MAINTENANCE = gettext('Device is under maintenance')\n}\n\nexport enum PushStatusLabels {\n CONNECTED = gettext('Push connection: active'),\n DISCONNECTED = gettext('Push connection: inactive'),\n UNKNOWN = gettext('Push connection: inactive'),\n MAINTENANCE = gettext('Device is under maintenance')\n}\n\nexport const deviceAvailabilityIconMap = {\n sendData: {\n [SendStatus.AVAILABLE]: {\n icon: 'long-arrow-right',\n class: 'statusOk'\n },\n [SendStatus.UNAVAILABLE]: {\n icon: 'long-arrow-right',\n class: 'statusNok'\n },\n [SendStatus.UNKNOWN]: {\n icon: 'long-arrow-right',\n class: 'statusUnknown'\n },\n [SendStatus.NOT_MONITORED]: {\n icon: 'long-arrow-right',\n class: 'statusUnknown'\n }\n },\n push: {\n [PushStatus.CONNECTED]: {\n icon: 'long-arrow-left',\n class: 'statusOk'\n },\n [PushStatus.DISCONNECTED]: {\n icon: 'long-arrow-left',\n class: 'statusUnknown'\n },\n [PushStatus.UNKNOWN]: {\n icon: 'long-arrow-left',\n class: 'statusUnknown'\n },\n [PushStatus.MAINTENANCE]: {\n icon: 'wrench',\n class: 'statusAlert'\n }\n },\n device: {\n MAINTENANCE: {\n icon: 'wrench',\n class: 'statusAlert'\n }\n }\n};\n\nexport const tooltips = {\n sendStatusConnected: (lastMessage, translateService) => {\n const date = formatDate(new Date(lastMessage), 'medium', translateService.currentLang);\n return translateService.instant(gettext('Device last request:\\n{{date}}'), { date });\n },\n sendStatusDisconnected: gettext('Connection not monitored'),\n pushStatusConnected: gettext('Connection to device established'),\n pushStatusDisconnected: gettext(\n 'Connection to device not established (not supported by device or no connectivity)'\n ),\n maintenance: gettext('Device is under maintenance')\n};\n","import { Component, Input, AfterContentInit, OnChanges } from '@angular/core';\nimport {\n deviceAvailabilityIconMap,\n PushStatusLabels,\n SendStatusLabels,\n tooltips\n} from './device-availability';\nimport { TranslateService } from '@ngx-translate/core';\nimport { get } from 'lodash-es';\n\n@Component({\n selector: 'device-status',\n templateUrl: './device-status.component.html'\n})\nexport class DeviceStatusComponent implements AfterContentInit, OnChanges {\n @Input('mo') set node(value) {\n this._mo = value.mo || value;\n }\n\n private _mo;\n private requiredAvailability;\n private availabilityStatus;\n private pushStatus;\n private sendStatus;\n\n constructor(private translateService: TranslateService) {}\n\n get() {\n return this._mo;\n }\n\n ngOnChanges() {\n this.setStatusProperites();\n }\n\n ngAfterContentInit() {\n this.setStatusProperites();\n }\n\n setStatusProperites() {\n this.requiredAvailability = get(this._mo, 'c8y_RequiredAvailability');\n this.availabilityStatus = get(this._mo, 'c8y_Availability.status');\n\n this.pushStatus = get(this._mo, 'c8y_Connection.status') || 'UNKNOWN';\n this.sendStatus =\n this.availabilityStatus || (this.requiredAvailability ? 'UNKNOWN' : 'NOT_MONITORED');\n }\n\n status() {\n let statuses;\n\n if (this.availabilityStatus === 'MAINTENANCE' || this.pushStatus === 'MAINTENANCE') {\n statuses = this.getMaintenanceStatus();\n } else {\n statuses = this.getSendPushStatus();\n }\n\n return statuses;\n }\n\n getMaintenanceStatus() {\n return {\n sendStatus: false,\n pushStatus: false,\n maintenanceStatus: {\n icon: deviceAvailabilityIconMap.device.MAINTENANCE.icon,\n class: deviceAvailabilityIconMap.device.MAINTENANCE.class,\n tooltip: tooltips.maintenance\n }\n };\n }\n\n private getSendPushStatus() {\n return {\n sendStatus: {\n icon: deviceAvailabilityIconMap.sendData[this.sendStatus].icon,\n class: deviceAvailabilityIconMap.sendData[this.sendStatus].class,\n status: this.sendStatus,\n label: SendStatusLabels[this.sendStatus],\n tooltip: this.getSendStatusTooltip(this._mo)\n },\n pushStatus: {\n icon: deviceAvailabilityIconMap.push[this.pushStatus].icon,\n class: deviceAvailabilityIconMap.push[this.pushStatus].class,\n status: this.pushStatus,\n label: PushStatusLabels[this.pushStatus],\n tooltip: this.getPushStatusTooltip(this.pushStatus === 'CONNECTED')\n },\n maintenanceStatus: false\n };\n }\n\n private getSendStatusTooltip(device) {\n const availability = device && device.c8y_Availability;\n const lastMessage = availability && availability.lastMessage;\n if (lastMessage) {\n return tooltips.sendStatusConnected(lastMessage, this.translateService);\n }\n return tooltips.sendStatusDisconnected;\n }\n\n private getPushStatusTooltip(isActive) {\n return isActive ? tooltips.pushStatusConnected : tooltips.pushStatusDisconnected;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DeviceStatusComponent } from './device-status.component';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { CommonModule } from '../common/common.module';\n/**\n * The angular module definition for a device-status.\n * @exports DeviceStatusComponent\n */\n@NgModule({\n imports: [\n CommonModule,\n TooltipModule\n ],\n exports: [\n DeviceStatusComponent\n ],\n declarations: [\n DeviceStatusComponent\n ]\n})\nexport class DeviceStatusModule { }\n","import { Directive, Input, ElementRef } from '@angular/core';\n\n@Directive({\n selector: '[c8y-guide-href]'\n})\nexport class GuideHrefDirective {\n @Input('c8y-guide-href')\n c8yGuideHref;\n\n private htmlAnchor: HTMLAnchorElement;\n\n set baseHref(href) {\n this.htmlAnchor.href = `${href}/${this.c8yGuideHref}`;\n }\n\n constructor(private elementRef: ElementRef) {\n this.htmlAnchor = this.elementRef.nativeElement as HTMLAnchorElement;\n if (!this.htmlAnchor.hasAttribute('target')) {\n this.htmlAnchor.setAttribute('target', '_blank');\n }\n }\n}\n","import {\n Component,\n OnInit,\n ContentChildren,\n QueryList,\n ContentChild,\n AfterContentInit,\n ElementRef,\n Renderer2, OnDestroy\n} from '@angular/core';\nimport { GuideHrefDirective } from './guide-href.directive';\nimport { DocsService } from './docs.service';\nimport { ReplaySubject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { ForceHtmlTranslateDirective } from '../i18n/force-html-translate.directive';\n\n@Component({\n selector: '[c8y-guide-docs]',\n templateUrl: './guide-docs.component.html'\n})\nexport class GuideDocsComponent implements OnInit, AfterContentInit, OnDestroy {\n baseUrl: string;\n @ContentChildren(GuideHrefDirective, { descendants: true }) links: QueryList<GuideHrefDirective>;\n\n /**\n * Provides access to translate directive, so it is possible to adjust anchor html tags, after\n * content is translated.\n */\n @ContentChild(ForceHtmlTranslateDirective, { static: false }) translateDirective;\n\n private destroyed$: ReplaySubject<boolean> = new ReplaySubject(1);\n\n constructor(private docs: DocsService, private el: ElementRef, private renderer: Renderer2) {}\n\n ngOnInit(): void {\n this.baseUrl = this.docs.getBaseUrl();\n }\n\n /**\n * After content is initialized we subscribe for translation events, then we are able to modify\n * anchor just as C8yGuideHrefDirective does.\n */\n ngAfterContentInit() {\n if (this.translateDirective) {\n this.translateDirective.htmlUpdateEvent\n .pipe(takeUntil(this.destroyed$))\n .subscribe(() => {\n this.replaceAnchorAttributes();\n });\n } else {\n this.replaceAnchorAttributes();\n }\n }\n\n /**\n * Find and modify anchor elements\n */\n replaceAnchorAttributes() {\n const anchors = this.findGuideAnchors(this.el.nativeElement);\n anchors.forEach(a => {\n const guideHref = `${this.baseUrl}/${a.getAttribute('c8y-guide-href')}`;\n this.renderer.setAttribute(a, 'href', guideHref);\n if (!a.hasAttribute('target')) {\n this.renderer.setAttribute(a, 'target', '_blank');\n }\n });\n }\n\n /**\n * Recursive function, returns array of Anchor elements inside HTMLElement.\n */\n findGuideAnchors(el: HTMLElement): HTMLElement[] {\n const isAnchor = () => el.nodeName === 'A';\n const hasGuideHrefAttr = () => !!el.attributes.getNamedItem('c8y-guide-href');\n const hasChildren = () => el.childNodes && el.childNodes.length > 0;\n\n let result = [];\n\n if (isAnchor() && hasGuideHrefAttr()) {\n result.push(el);\n } else if (hasChildren()) {\n el.childNodes.forEach((node: HTMLElement) => {\n const searchResult = this.findGuideAnchors(node);\n if (searchResult) {\n result = [...result, ...searchResult];\n }\n });\n }\n return result;\n }\n\n ngAfterViewInit(): void {\n this.links.forEach(guide => {\n guide.baseHref = this.baseUrl;\n });\n }\n\n ngOnDestroy() {\n this.destroyed$.next(true);\n this.destroyed$.complete();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DocsService } from './docs.service';\nimport { GuideHrefDirective } from './guide-href.directive';\nimport { GuideDocsComponent } from './guide-docs.component';\n\n@NgModule({\n declarations: [\n GuideHrefDirective,\n GuideDocsComponent\n ],\n imports: [CommonModule],\n exports: [\n GuideHrefDirective,\n GuideDocsComponent\n ],\n providers: [DocsService],\n})\nexport class DocsModule {}\n","import { Component, OnInit } from '@angular/core';\nimport { ConfigOption, FieldArrayType } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-array-type',\n templateUrl: './array.type.component.html'\n})\nexport class ArrayTypeComponent extends FieldArrayType implements OnInit {\n static readonly CONFIG: ConfigOption = {\n types: [{ name: 'array', component: ArrayTypeComponent }]\n };\n\n ngOnInit(): void {\n if (this.to.required && !this.field.fieldGroup.length) {\n this.add();\n }\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { ConfigOption, FieldType } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-field-checkbox',\n templateUrl: './checkbox.type.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FieldCheckbox extends FieldType {\n static readonly CONFIG: ConfigOption = {\n types: [\n {\n name: 'checkbox',\n component: FieldCheckbox\n },\n {\n name: 'boolean',\n extends: 'checkbox'\n }\n ]\n };\n\n defaultOptions = {\n templateOptions: {\n indeterminate: true,\n formCheck: 'custom' // 'custom' | 'custom-inline' | 'custom-switch' | 'stacked' | 'inline' | 'nolabel'\n }\n };\n}\n","import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';\nimport { ConfigOption, FieldWrapper } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-wrapper-form-field',\n templateUrl: './form-field.wrapper.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class WrapperFormField extends FieldWrapper implements OnInit {\n static readonly CONFIG: ConfigOption = {\n wrappers: [{ name: 'c8y-form-field', component: WrapperFormField }]\n };\n\n maxHelpBlockLength: number = 64;\n showDescriptionAsPopup: boolean;\n\n ngOnInit(): void {\n this.showDescriptionAsPopup =\n this.field.type === 'radio' ||\n (this.to.description && this.to.description.length > this.maxHelpBlockLength);\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { ConfigOption, FieldType } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-field-input',\n templateUrl: './input.type.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FieldInput extends FieldType {\n static readonly CONFIG: ConfigOption = {\n types: [\n {\n name: 'input',\n component: FieldInput,\n wrappers: ['c8y-form-field']\n },\n { name: 'string', extends: 'input' },\n {\n name: 'number',\n extends: 'input',\n defaultOptions: {\n templateOptions: {\n type: 'number'\n }\n }\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n templateOptions: {\n type: 'number'\n }\n }\n }\n ]\n };\n\n get type() {\n return this.to.type || 'text';\n }\n}\n","import { Component } from '@angular/core';\nimport { ConfigOption, FieldType } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-object-type',\n templateUrl: './object.type.component.html'\n})\nexport class ObjectTypeComponent extends FieldType {\n static readonly CONFIG: ConfigOption = {\n types: [{ name: 'object', component: ObjectTypeComponent }]\n };\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { ConfigOption, FieldType } from '@ngx-formly/core';\n\n@Component({\n selector: 'c8y-field-radio',\n templateUrl: './radio.type.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FieldRadio extends FieldType {\n static readonly CONFIG: ConfigOption = {\n types: [\n {\n name: 'radio',\n component: FieldRadio,\n wrappers: ['c8y-form-field']\n }\n ]\n };\n\n defaultOptions = {\n templateOptions: {\n options: [],\n formCheck: 'custom' // 'custom' | 'custom-inline' | 'stacked' | 'inline'\n }\n };\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule, Type } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { ConfigOption, FieldType, FormlyModule, FORMLY_CONFIG } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { FormsModule } from '../forms/index';\nimport { ArrayTypeComponent } from './array/array.type.component';\nimport { FieldCheckbox } from './checkbox/checkbox.type.component';\nimport { WrapperFormField } from './form-field/form-field.wrapper.component';\nimport { FieldInput } from './input/input.type.component';\nimport { ObjectTypeComponent } from './object/object.type.component';\nimport { FieldRadio } from './radio/radio.type.component';\n\nexport const FIELD_TYPES: Array<Type<FieldType>> = [\n FieldCheckbox,\n ArrayTypeComponent,\n WrapperFormField,\n FieldInput,\n FieldRadio,\n ObjectTypeComponent\n];\n\nexport function fieldTypeFactory() {\n // tslint:disable-next-line:no-string-literal\n return FIELD_TYPES.map(type => type['CONFIG']).reduce(\n (formlyConfig: ConfigOption, typeConfig: ConfigOption) =>\n ({\n ...formlyConfig,\n types: [...formlyConfig.types, ...(typeConfig.types || [])],\n wrappers: [...formlyConfig.wrappers, ...(typeConfig.wrappers || [])]\n } as ConfigOption),\n { types: [], wrappers: [] }\n );\n}\n\n/**\n * This module declares field type components for dynamic forms that match C8Y styleguide.\n *\n * @dynamic\n */\n@NgModule({\n declarations: [...FIELD_TYPES],\n entryComponents: [...FIELD_TYPES],\n imports: [\n CommonModule,\n PopoverModule,\n ReactiveFormsModule,\n TranslateModule,\n FormsModule,\n FormlyModule,\n FormlySelectModule\n ],\n providers: [\n {\n provide: FORMLY_CONFIG,\n useFactory: fieldTypeFactory,\n multi: true\n }\n ]\n})\nexport class DynamicFormsUIThemeModule {}\n","import { FormlyFieldConfig } from '@ngx-formly/core';\nimport { TranslateParser, TranslateService } from '@ngx-translate/core';\nimport { combineLatest, isObservable, of } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { gettext } from '../../i18n';\n\nexport class TranslateExtension {\n constructor(private translate: TranslateService, private parser: TranslateParser) {}\n prePopulate(field: FormlyFieldConfig) {\n const to = field.templateOptions || {};\n if (!to.label || to._translated) {\n return;\n }\n\n to._translated = true;\n field.expressionProperties = {\n ...(field.expressionProperties || {}),\n 'templateOptions.label': to.label ? this.translate.stream(to.label) : to.label,\n 'templateOptions.description': to.description\n ? this.translate.stream(to.description)\n : to.description,\n 'templateOptions.placeholder': to.placeholder\n ? combineLatest([\n this.translate.stream(to.placeholder),\n this.translate.stream(gettext('e.g. {{ example }}'))\n ]).pipe(\n map(([placeholder, expression]) => this.parser.interpolate(expression, { example: placeholder }))\n )\n : to.placeholder,\n 'templateOptions.options': (isObservable(to.options) ? to.options : of(to.options)).pipe(\n map((options: Array<{ label: string }>) =>\n (options || []).map(option => ({\n ...option,\n label: this.translate.instant(option.label)\n }))\n )\n )\n };\n }\n}\n\nexport function registerTranslateExtension(translate: TranslateService, parser: TranslateParser) {\n return {\n extensions: [\n {\n name: 'translate',\n extension: new TranslateExtension(translate, parser)\n }\n ]\n };\n}\n","import { NgModule } from '@angular/core';\nimport { FormlyModule, FORMLY_CONFIG } from '@ngx-formly/core';\nimport { TranslateModule, TranslateParser, TranslateService } from '@ngx-translate/core';\nimport { registerTranslateExtension } from './translate.extension';\n\n@NgModule({\n imports: [FormlyModule, TranslateModule],\n providers: [\n {\n provide: FORMLY_CONFIG,\n multi: true,\n useFactory: registerTranslateExtension,\n deps: [TranslateService, TranslateParser]\n }\n ]\n})\nexport class I18nModule {}\n","import { Injectable } from '@angular/core';\nimport { FormlyFieldConfig } from '@ngx-formly/core';\nimport { FormlyJsonschema } from '@ngx-formly/core/json-schema';\nimport { FormlyJsonschemaOptions } from '@ngx-formly/core/json-schema/formly-json-schema.service';\nimport { JSONSchema7 } from 'json-schema';\n\n@Injectable()\nexport class C8yJSONSchema extends FormlyJsonschema {\n toFieldConfig(schema: JSONSchema7, options?: FormlyJsonschemaOptions): FormlyFieldConfig {\n return super.toFieldConfig(schema, this.c8yOptions((options || {}).map));\n }\n\n private c8yOptions(\n map: (mappedField: FormlyFieldConfig, mapSource: JSONSchema7) => FormlyFieldConfig\n ): FormlyJsonschemaOptions {\n return {\n map(mappedField: FormlyFieldConfig, mapSource: JSONSchema7) {\n let result: FormlyFieldConfig = mappedField;\n\n /** `const` type is represented as hidden input */\n if (mapSource.const) {\n result = {\n ...result,\n defaultValue: mapSource.const,\n templateOptions: { ...result.templateOptions, type: 'hidden' }\n };\n }\n\n /** `writeOnly` field represented as password input */\n if (mapSource.writeOnly) {\n result = {\n ...result,\n templateOptions: { ...result.templateOptions, type: 'password', autocomplete: 'off' }\n };\n }\n\n /** `examples` values used as placeholder */\n if (mapSource.examples) {\n result = {\n ...result,\n templateOptions: {\n ...result.templateOptions,\n placeholder: (mapSource.examples as string[]).join(', ')\n }\n };\n }\n\n /** `enum` field represented as radio button group */\n if (mapSource.enum) {\n result = {\n ...result,\n type: 'radio'\n };\n }\n\n return map ? map(result, mapSource) : result;\n }\n };\n }\n}\n","import { FormlyFieldConfig } from '@ngx-formly/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { gettext } from '../../i18n/gettext';\n\nexport function c8yValidationConfigFactory(translate: TranslateService) {\n return {\n validationMessages: [\n {\n name: 'required',\n message() {\n return translate.stream(gettext('This field is required.'));\n }\n },\n {\n name: 'pattern',\n message(error: any, field: FormlyFieldConfig) {\n return translate.stream(gettext('Does not match pattern {{ requiredPattern }}'), error);\n }\n }\n ]\n };\n}\n","import { Type } from '@angular/core';\nimport { IResultList } from '@c8y/client';\n\n/*\n * For reference: the structure of current device column-related objects.\n * TODO: Can be removed when \"All devices\" is fully migrated.\n *\n * Services involved:\n * - c8yFilteringSortingColumns\n * - c8yFilteringSortingInventoryQueries\n * - c8yDeviceListColumns\n * - c8yFilteringSortingCollections?? -> for other tables in tenant/cell ID usage statistics feature\n *\n * Components involved:\n * - c8yFilteredSortedList -> this needs to be gravely adapted\n *\n * States saved in user preferences:\n * - Columns config (ALL_DEVICES_COLUMNS_CONFIG_USER_PREFERENCES_KEY)\n * - Columns meta (ALL_DEVICES_COLUMNS_META_USER_PREFERENCES_KEY_PREFIX)\n *\n * States saved in dynamic group object:\n * - Columns config (COLUMNS_CONFIG_FRAGMENT)\n * - Columns meta (COLUMNS_META_FRAGMENT)\n * - Query string (QUERY_STRING_FRAGMENT)\n *\n * TO-FUTURE-SELF note:\n * - `col.config.filtering` and `col.config.sorting` (the models) populate\n * `col.filtering` and `col.sorting` (the views).\n * - `getFilter` can return a query object (for server-side filtering) or\n * a filter function (for server-side filtering).\n */\ninterface DeviceColumn {\n name: string;\n header: string;\n config: {\n filtering: object;\n sorting: {\n order: number;\n };\n override: DeviceColumn;\n };\n cell: {\n class: string;\n innerClass: string;\n scopeExtensions: object;\n template: string;\n style: object;\n };\n filtering: {\n form: object[];\n schema: {\n type: string;\n properties: {\n type: string;\n [key: string]: any;\n };\n };\n getFilter(filteringModel: object): object | FilterFunction;\n };\n sorting: {\n path?: string;\n paths?: string;\n };\n meta: {\n custom: boolean;\n key: string;\n headerName: string;\n fragmentPath: string;\n active: boolean;\n filteringMode: 'EQUALITY' | 'EXISTENCE';\n };\n}\n\ntype FilterFunction = (item: object) => boolean;\n\nexport interface DataGrid {\n columns: Column[];\n rows: Row[];\n pagination: Pagination;\n serverSideDataCallback: ServerSideDataCallback;\n selectable: boolean;\n selectionPrimaryKey: string;\n displayOptions: DisplayOptions;\n actionControls: ActionControl[];\n bulkActionControls: BulkActionControl[];\n}\n\n/*\n * Column\n */\nexport interface Column {\n name: string | SpecialColumnName;\n header?: string;\n path?: string;\n visible?: boolean;\n positionFixed?: boolean;\n\n /*\n * Cosmetics\n */\n dataType?: ColumnDataType;\n gridTrackSize?: string;\n headerCSSClassName?: string | string[];\n cellCSSClassName?: string | string[];\n\n /*\n * Sorting-Filtering\n */\n sortable?: boolean;\n sortOrder?: SortOrder;\n\n filterable?: boolean;\n filterPredicate?: string | FilterPredicateFunction;\n externalFilterQuery?: any;\n\n /*\n * Custom renderer\n */\n cellRendererComponent?: Type<any>;\n headerCellRendererComponent?: Type<any>;\n filteringFormRendererComponent?: Type<any>;\n}\n\nexport interface ColumnConfig {\n visible?: boolean;\n sortOrder?: SortOrder;\n}\n\nexport interface GridConfig {\n columns: ColumnConfig[];\n pagination: Pagination;\n}\n\nexport const enum SpecialColumnName {\n Checkbox = 'checkbox',\n Actions = 'actions'\n}\n\nexport const enum ColumnDataType {\n Icon = 'icon',\n Numeric = 'numeric',\n TextShort = 'text-short',\n TextLong = 'text-long'\n}\n\nexport const enum ColumnDataRecordClassName {\n Icon = 'data-record-icon',\n Header = 'data-record-header',\n Default = ''\n}\n\nexport const minColumnGridTrackSize = 80;\n\nexport const ratiosByColumnTypes = {\n icon: 1,\n numeric: 1,\n 'text-short': 1.67,\n 'text-long': 3.33\n};\n\nexport type SortOrder = 'asc' | 'desc' | '';\n\nexport type FilterPredicateFunction = (item: object, path: string) => boolean;\n\nexport enum FilteringActionType {\n ApplyFilter = 'APPLY_FILTER',\n ResetFilter = 'RESET_FILTER'\n}\n\nexport interface Row {\n id: string;\n [key: string]: any;\n}\n\nexport interface Pagination {\n currentPage: number;\n nextPage?: number;\n pageSize: number;\n}\n\nexport type ServerSideDataCallback = (\n dataSourceModifier: DataSourceModifier\n) => ServerSideDataResult;\nexport interface DataSourceModifier {\n columns: Column[];\n searchText: string;\n pagination: Pagination;\n selection: {\n enabled: boolean;\n primaryKey: string;\n };\n}\n\n/**\n * Describes result from server with data and additional statistics.\n */\nexport type ServerSideDataResult = IResultList<object> & {\n /** The real grand total number of items (the whole dataset). */\n size: number;\n\n /** The number of items after filtering applied to the whole dataset (subset). */\n filteredSize: number;\n\n /** The list of ids of all filtered items (subset). */\n filteredDataIds?: string[];\n};\n\nexport interface DataSourceStats {\n /** The real grand total number of items (the whole dataset). */\n size: number;\n\n /** The number of items after filtering applied to the whole dataset (subset). */\n filteredSize: number;\n\n /** The number of the current page. */\n currentPage: number;\n\n /** The number of the next page. */\n nextPage?: number;\n\n /** The number of items currently shown in the list view, a.k.a. current page (what the user sees on screen). */\n currentPageSize: number;\n\n /** The number of items on the first page. */\n firstPageSize: number;\n}\n\nexport interface DisplayOptions {\n striped: boolean;\n bordered: boolean;\n gridHeader: boolean;\n}\n\nexport interface ActionControl {\n type: BuiltInActionType | string;\n text?: string;\n icon?: string;\n // tslint:disable-next-line:ban-types\n callback: ((item: Row, reload: () => void) => void) | Function;\n [key: string]: any;\n}\n\nexport interface BulkActionControl extends ActionControl {\n callback(selectedItemIds: string[], reload: () => void): void;\n}\n\nexport const enum BuiltInActionType {\n Edit = 'EDIT',\n Delete = 'DELETE',\n Export = 'EXPORT'\n}\n","import { NgModule } from '@angular/core';\nimport { FormlyModule, FORMLY_CONFIG } from '@ngx-formly/core';\nimport { TranslateModule, TranslateService } from '@ngx-translate/core';\nimport { c8yValidationConfigFactory } from './validation-config.factory';\n\n@NgModule({\n imports: [TranslateModule, FormlyModule],\n providers: [\n {\n provide: FORMLY_CONFIG,\n multi: true,\n useFactory: c8yValidationConfigFactory,\n deps: [TranslateService]\n }\n ]\n})\nexport class ValidationModule {}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { DynamicFormsUIThemeModule } from './dynamic-forms-ui-theme.module';\nimport { I18nModule } from './i18n/i18n.module';\nimport { C8yJSONSchema } from './json-schema/c8y-json-schema.service';\nimport { ValidationModule } from './validation/validation.module';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n I18nModule,\n ValidationModule,\n DynamicFormsUIThemeModule,\n FormlyModule.forRoot()\n ],\n providers: [C8yJSONSchema],\n exports: [FormlyModule, ReactiveFormsModule]\n})\nexport class DynamicFormsModule {}\n","import { Component, InjectionToken, Type } from '@angular/core';\nimport { Observable } from 'rxjs';\n\n/**\n * A hook to add dynamic components to the UI (e.g. widgets).\n */\nexport const HOOK_COMPONENTS = new InjectionToken('Hook Dynamic Component');\n\n/**\n * A hook to add dynamic components to the UI (e.g. widgets).\n * @deprecated: Use HOOK_COMPONENTS\n */\nexport const HOOK_COMPONENT = new InjectionToken('Hook Dynamic Component @deprecated');\n\n/**\n * A dynamic component can be defined in a the HOOK_COMPONENTS to display any kind\n * of component dynamically just by referencing it's id. The most common use case is on dashboards,\n * where the `configComponent` is used to define what is displayed on the `component`\n * on the dashboard.\n *\n * To use the component you can use the c8y-dynamic-component.\n *\n * ```\n * <c8y-dynamic-component\n * componentId=\"angular.widget.demo\"\n * [config]=\"{ text: 'Hello world' }\"\n * [mode]=\"editComponent ? 'config' : 'component'\"\n * ></c8y-dynamic-component>\n * ```\n */\nexport interface DynamicComponentDefinition {\n /**\n * Unique serializable id\n */\n id: string;\n /**\n * The component which is used when the component should be displayed (e.g. on a dashboard)\n */\n component: Type<Component>;\n /**\n * The configuration component used when a widget is added or edited.\n */\n configComponent?: Type<Component>;\n /**\n * The label shown for this dynamic component on add widgets\n */\n label: string;\n /**\n * The description shown on add widget\n */\n description: string;\n /**\n * Add any random data, specially to angular.js dashboards.\n * Should be searilzabled to allow to save it to the API.\n */\n data?: any;\n /**\n * An url to an preview image.\n */\n previewImage?: string;\n}\n\n/**\n * Use this interface on any component to define the interchange between\n * config and display component.\n */\nexport interface DynamicComponent {\n /**\n * The configuration which is shared between configuration component and display component.\n * Should be searilzabled to allow to save it to the API.\n */\n config: any;\n /**\n * A reference to the ng1Form on angularjs dashboards to disable/enable the save button.\n * @deprecated: Will not work on Angular-Dashboards (1.6.1.0). Use `ContextServiceDashboard.formDisabled` instead.\n */\n ng1FormRef?: any;\n}\n\n/**\n * An lifecycle hook which is called before an configuration is saved.\n */\nexport interface OnBeforeSave {\n /**\n * Called before a configuration object is saved. The function can be used to manipulate the\n * passed config object or to cancel the saving (return false or Observable<boolean>).\n */\n onBeforeSave(config?: any): boolean | Promise<boolean> | Observable<boolean>;\n}\n","import { Injectable, Injector } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable, of, Subject } from 'rxjs';\nimport { filter, mergeMap, take } from 'rxjs/operators';\nimport { ExtensionPoint, fromFactories } from '../common/extension-hooks';\nimport { StateService } from '../common/state-service.abstract';\nimport {\n DynamicComponentDefinition,\n HOOK_COMPONENT,\n HOOK_COMPONENTS\n} from './dynamic-component.model';\n\ndeclare const __MODE__: string;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DynamicComponentService extends StateService\n implements ExtensionPoint<DynamicComponentDefinition> {\n items$: Observable<DynamicComponentDefinition[]>;\n readonly refreshTrigger = new Subject();\n readonly state$ = new BehaviorSubject<Set<DynamicComponentDefinition>>(\n new Set<DynamicComponentDefinition>()\n );\n\n constructor(private injector: Injector, router: Router) {\n super();\n\n this.items$ = fromFactories(\n [() => this.injector.get(HOOK_COMPONENTS, []), () => this.getComponentsViaDeprecatedHook()],\n router,\n false\n );\n this.items$.subscribe(cmps => {\n cmps.forEach(cmp => {\n this.state.add(cmp);\n });\n this.emitNewState();\n });\n }\n\n getComponentsViaDeprecatedHook() {\n const componentsViaDeprecatedHook: DynamicComponentDefinition[] = this.injector.get(\n HOOK_COMPONENT,\n []\n ) as DynamicComponentDefinition[];\n if (\n componentsViaDeprecatedHook &&\n componentsViaDeprecatedHook.length &&\n __MODE__ !== 'production'\n ) {\n console.warn('HOOK_COMPONENT is now deprecated. Use HOOK_COMPONENTS instead.');\n }\n\n return componentsViaDeprecatedHook;\n }\n\n refresh() {\n this.refreshTrigger.next(1);\n }\n\n get state() {\n return this.state$.value;\n }\n\n /**\n * Returns a component by it's id as an observable.\n * @param id The id of the component.\n */\n getById$(id) {\n return this.state$.pipe(\n filter((cmps: Set<DynamicComponentDefinition>) => cmps.size > 0),\n mergeMap((cmps: Set<DynamicComponentDefinition>) =>\n of(Array.from(cmps).find(cmp => cmp.id === id))\n ),\n take(1)\n );\n }\n\n add(component: DynamicComponentDefinition) {\n this.state.add(component);\n this.emitNewState();\n }\n\n remove(component: DynamicComponentDefinition) {\n this.state.delete(component);\n this.emitNewState();\n }\n}\n","import {\n Component,\n Input,\n ViewChild,\n ComponentFactoryResolver,\n ViewContainerRef,\n ComponentRef\n} from '@angular/core';\nimport {\n DynamicComponent,\n DynamicComponentDefinition,\n OnBeforeSave\n} from './dynamic-component.model';\nimport { DynamicComponentService } from './dynamic-component.service';\nimport { of, isObservable, Observable } from 'rxjs';\nimport { isUndefined } from 'lodash-es';\n\n/**\n * C8y dynamic component.\n * ## Example:\n *\n * register component in HOOK in module:\n * ```typescript\n * import { HOOK_COMPONENT } from '@c8y/ngx-components';\n *\n * @NgModule({\n * ...,\n * providers: [{\n * provide: HOOK_COMPONENT,\n * multi: true,\n * useValue: [{\n * id: 'test-component',\n * label: 'My test component',\n * description: 'this is test component',\n * component: TestComponent\n * }],\n * ...\n * }]\n *\n * ```\n * Showing dynamic component:\n * ```html\n * <c8y-dynamic-component [componentId]=\"'test-component'\" [config]=\"config\"></c8y-dynamic-component>\n * ```\n */\n@Component({\n selector: 'c8y-dynamic-component',\n templateUrl: './dynamic-component.component.html'\n})\nexport class DynamicComponentComponent {\n /**\n * The ID of the registered component. It needs to be a component that is hooked\n * with the HOOK_COMPONENTS extension hook.\n */\n @Input() componentId: string;\n /**\n * The configuration to pass.\n */\n @Input() config: any;\n /**\n * DynamicComponents can have two modes, an edit (config) and an view (component) mode.\n * By default it is shown in the component mode.\n */\n @Input() mode: 'config' | 'component' = 'component';\n /**\n * Disable this to hide the error that is shown if the component was not found.\n */\n @Input() notFoundError = true;\n /**\n * @ignore\n */\n @ViewChild('host', { read: ViewContainerRef, static: true }) host: ViewContainerRef;\n /**\n * @ignore\n */\n error: any;\n /**\n * @ignore\n */\n expandErrorDetails = false;\n private componentRef: ComponentRef<Component>;\n\n /**\n * @ignore only DI\n */\n constructor(\n private componentFactoryResolver: ComponentFactoryResolver,\n private dynamicComponentService: DynamicComponentService\n ) {}\n\n /**\n * Calls the dynamic component life cycle hook. Currently only\n * supporting onBeforeSave, a hook which is called before a config component\n * is saved.\n */\n callLifeCycleHooks() {\n return this.callOnBeforeSaveHook();\n }\n\n /**\n * @ignore\n */\n ngOnChanges(): void {\n this.dynamicComponentService\n .getById$(this.componentId)\n .subscribe(cmp => this.loadComponent(cmp));\n }\n\n private loadComponent(dynamicComponent: DynamicComponentDefinition) {\n try {\n this.error = undefined;\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(\n this.mode === 'component' ? dynamicComponent.component : dynamicComponent.configComponent\n );\n this.host.clear();\n this.componentRef = this.host.createComponent(componentFactory);\n (this.componentRef.instance as DynamicComponent).config = this.config;\n } catch (ex) {\n this.error = ex;\n }\n }\n\n private callOnBeforeSaveHook() {\n if (!this.componentRef) {\n return of(true);\n }\n const hook = (this.componentRef.instance as OnBeforeSave).onBeforeSave;\n if (hook) {\n const result = hook.call(this.componentRef.instance, this.config);\n if (isUndefined(result)) {\n return of(true);\n }\n return isObservable(result) ? result : (of(result) as Observable<boolean>);\n }\n return of(true);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CollapseModule } from 'ngx-bootstrap/collapse';\nimport { DynamicComponentComponent } from './dynamic-component.component';\nimport { DynamicComponentService } from './dynamic-component.service';\nimport { I18nModule } from '../i18n/i18n.module';\n\n@NgModule({\n declarations: [DynamicComponentComponent],\n imports: [CommonModule, CollapseModule, RouterModule.forChild([]), I18nModule],\n exports: [DynamicComponentComponent],\n providers: [DynamicComponentService]\n})\nexport class DynamicComponentModule {}\n","import { Component, ViewChild } from '@angular/core';\n\n@Component({\n selector: 'c8y-dashboard-child-action',\n templateUrl: './dashboard-child-action.component.html'\n})\nexport class DashboardChildActionComponent {\n @ViewChild('template', { static: false }) template: any;\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'c8y-dashboard-child-title',\n templateUrl: './dashboard-child-title.component.html'\n})\nexport class DashboardChildTitleComponent {}\n","import {\n Component,\n ContentChildren,\n ElementRef,\n HostBinding,\n Input,\n AfterContentInit,\n QueryList,\n forwardRef,\n Output,\n EventEmitter,\n HostListener,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { DashboardChildComponent } from './dashboard-child.component';\nimport { DashboardChange } from './dashboard.model';\n\n/**\n * Displays a CSS grid which is customizable by the customer. You can set\n * `c8y-dashboard-child`-components on it or position any element on it by\n * setting the grid CSS properties. On change (resize, or rearrange) the\n * component emits an change event.\n *\n * ## Example:\n *\n * ```html\n * <c8y-title>Hello from outlet</c8y-title>\n *\n * <c8y-action-bar-item [placement]=\"'right'\">\n * <button class=\"btn btn-link\" (click)=\"addRandom()\"><i class=\"fa fa-plus\"></i> Add random</button>\n * </c8y-action-bar-item>\n * <c8y-action-bar-item [placement]=\"'right'\">\n * <button class=\"btn btn-link\" (click)=\"isFrozen = !isFrozen\">\n * <i [c8yIcon]=\"isFrozen ? 'lock' : 'unlock'\"></i> Toggle freeze\n * </button>\n * </c8y-action-bar-item>\n *\n * <c8y-dashboard (dashboardChange)=\"dashboardChange($event)\">\n * <c8y-dashboard-child\n * [isFrozen]=\"isFrozen\"\n * title=\"dynamic\"\n * *ngFor=\"let widget of widgets\"\n * #current\n * >\n * x: {{ current.x }}<br />\n * y: {{ current.y }}<br />\n * width: {{ current.width }}<br />\n * height: {{ current.height }}<br />\n * </c8y-dashboard-child>\n * <c8y-dashboard-child\n * #cpWidget\n * [isFrozen]=\"isFrozen\"\n * [x]=\"0\"\n * [y]=\"1\"\n * [width]=\"3\"\n * [height]=\"2\"\n * [data]=\"widget\"\n * [class]=\"'card card-dashboard panel-title-regular panel-content-branded panel-title-overlay'\"\n * >\n * <c8y-dashboard-child-title>\n * <span>World!</span>\n * </c8y-dashboard-child-title>\n * x: {{ cpWidget.x }}<br />\n * y: {{ cpWidget.y }}<br />\n * width: {{ cpWidget.width }}<br />\n * height: {{ cpWidget.height }}<br />\n * </c8y-dashboard-child>\n * <c8y-dashboard-child\n * #cpWidget2\n * [isFrozen]=\"isFrozen\"\n * [x]=\"8\"\n * [y]=\"1\"\n * [width]=\"4\"\n * [height]=\"4\"\n * [class]=\"'card card-dashboard panel-content-dark'\"\n * >\n * <c8y-dashboard-child-title>\n * <span>Hello!</span>\n * </c8y-dashboard-child-title>\n * <c8y-dashboard-child-action>\n * <a href=\"\" (click)=\"cpWidget2.isFrozen = !cpWidget2.isFrozen; (false)\">\n * <i [c8yIcon]=\"cpWidget2.isFrozen ? 'lock' : 'unlock'\"></i> Toggle freeze\n * </a>\n * </c8y-dashboard-child-action>\n * x: {{ cpWidget2.x }}<br />\n * y: {{ cpWidget2.y }}<br />\n * width: {{ cpWidget2.width }}<br />\n * height: {{ cpWidget2.height }}<br />\n * </c8y-dashboard-child>\n *\n * <c8y-dashboard-child\n * #cpWidget3\n * [isFrozen]=\"isFrozen\"\n * [x]=\"0\"\n * [y]=\"3\"\n * [width]=\"4\"\n * [height]=\"4\"\n * [class]=\"'card-dashboard panel-content-transparent'\"\n * >\n * <c8y-dashboard-child-title *ngIf=\"showTitle\">\n * <span>Transparent!</span>\n * </c8y-dashboard-child-title>\n * <c8y-dashboard-child-action>\n * <a href=\"\" (click)=\"showTitle = !showTitle; (false)\">\n * <i [c8yIcon]=\"'heading'\"></i> Hide/show title\n * </a>\n * </c8y-dashboard-child-action>\n * <c8y-dashboard-child-action>\n * <a href=\"\" (click)=\"cpWidget3.isFrozen = !cpWidget3.isFrozen; (false)\">\n * <i [c8yIcon]=\"cpWidget3.isFrozen ? 'lock' : 'unlock'\"></i> Toggle freeze\n * </a>\n * </c8y-dashboard-child-action>\n * x: {{ cpWidget3.x }}<br />\n * y: {{ cpWidget3.y }}<br />\n * width: {{ cpWidget3.width }}<br />\n * height: {{ cpWidget3.height }}<br />\n * </c8y-dashboard-child>\n * </c8y-dashboard>\n * ```\n */\n@Component({\n selector: 'c8y-dashboard',\n templateUrl: './dashboard.component.html',\n host: {\n class: 'c8y-grid-dashboard dashboard-grid'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DashboardComponent implements AfterContentInit {\n /**\n * All children in that dashboard.\n */\n @ContentChildren(forwardRef(() => DashboardChildComponent)) children: QueryList<\n DashboardChildComponent\n >;\n\n /**\n * The amount of columns on that dashboard.\n */\n @Input() columns = 12;\n\n /**\n * The spacing between each children in pixel.\n */\n @Input() gap = 12;\n\n /**\n * The amount of rows to dusplay. Set to auto to\n * auto extend the rows.\n */\n @Input() rows: number | 'auto' = 'auto';\n\n /**\n * An event fired if the dashboard was changed.\n */\n @Output() dashboardChange = new EventEmitter<DashboardChange>();\n\n dashboardRect;\n private lastRow = 1;\n private readonly DEFAULT_ROW_SIZE = 68;\n\n /**\n * The current column size.\n */\n get columnSize() {\n return this.dashboardRect.width / this.columns;\n }\n\n /**\n * The current row size.\n */\n get rowSize() {\n return this.rows === 'auto' ? this.DEFAULT_ROW_SIZE : this.calculateRowSize();\n }\n\n /**\n * Returns all positioning styles. Nasty workaround for that issue:\n * https://github.com/angular/angular/issues/9343\n */\n @HostBinding('attr.style')\n get inlineStyle() {\n return this.sanitizer.bypassSecurityTrustStyle(\n `\n -ms-grid-columns: (1fr)[${this.columns}];\n grid-template-columns: repeat(${this.columns}, 1fr);\n ${this.rows !== 'auto' ? `grid-template-rows: repeat(${this.rows}, 1fr);` : ''}\n grid-auto-rows: ${this.rowSize + this.gap}px;\n -ms-grid-rows: (${this.rowSize + this.gap}px)[${\n this.rows === 'auto' ? this.lastRow : this.rows\n }];\n margin: -${this.gap}px;\n `\n );\n }\n\n constructor(private element: ElementRef, private sanitizer: DomSanitizer) {}\n\n ngAfterContentInit(): void {\n this.onResize();\n this.getLastRow();\n }\n\n @HostListener('window:resize')\n onResize() {\n this.updateRectSize();\n }\n\n /**\n * Gets the last row\n * (mainly for IE11 which doesn't support grid-auto-rows CSS property)\n */\n getLastRow() {\n let lastRow = 1;\n this.children.forEach(widget => {\n if (lastRow < widget.y + widget.width) {\n lastRow = widget.y + widget.width;\n }\n });\n this.lastRow = lastRow + 1;\n }\n\n /**\n * Updates the current rect size of the dashboard.\n */\n updateRectSize() {\n const ele = this.element.nativeElement as HTMLElement;\n this.dashboardRect = ele.getBoundingClientRect();\n }\n\n emitChange(widget: DashboardChildComponent) {\n this.dashboardChange.emit({ source: widget, children: this.children.toArray() });\n }\n\n private calculateRowSize() {\n return this.dashboardRect.height / (this.rows as number);\n }\n}\n","import { CdkDragMove } from '@angular/cdk/drag-drop';\nimport { sortBy } from 'lodash-es';\nimport { pipe } from 'rxjs';\nimport { distinctUntilChanged, expand, filter, map, tap } from 'rxjs/operators';\nimport { DashboardComponent } from './dashboard.component';\nimport {\n DashboardChildDimension,\n DashboardChildResizeDimension,\n DashboardChildArrangement\n} from './dashboard.model';\nimport { DashboardChildComponent } from './dashboard-child.component';\n\nexport class DashboardChildChange {\n child: DashboardChildComponent;\n children: DashboardChildComponent[];\n private dashboard: DashboardComponent;\n\n private readonly MIN_WIDTH = 2;\n private MIN_HEIGHT = 1;\n private readonly PIXEL_SIZE_THRESHOLD = 10;\n\n private diffX = 0;\n private diffY = 0;\n\n constructor(childToChange: DashboardChildComponent) {\n this.dashboard = childToChange.dashboard;\n this.children = childToChange.dashboard.children\n ? childToChange.dashboard.children.filter(child => childToChange !== child)\n : [];\n this.child = childToChange;\n }\n\n get resize$() {\n return this.child.dragSource.moved.pipe(\n map(move => this.getPixelSize(move)),\n tap(resizeDimension => this.setPixelSize(resizeDimension)),\n map(resizeDimension => this.getDimensionSize(resizeDimension)),\n distinctUntilChanged(\n (prev, next) => prev.width === next.width && prev.height === next.height\n ),\n map(dimension => this.setDimension(dimension)),\n this.arrangePipe()\n );\n }\n\n get drag$() {\n return this.child.dragSource.moved.pipe(\n map(move => this.getDimensionPosition(move)),\n filter(\n dimension =>\n dimension.x >= 0 &&\n dimension.x <= this.dashboard.columns - this.child.width &&\n dimension.y >= 0\n ),\n distinctUntilChanged((prev, next) => prev.x === next.x && prev.y === next.y),\n this.arrangePipe()\n );\n }\n\n findFreeDimension() {\n let y = -1;\n let x = 0;\n let found = false;\n const { width, height } = this.child;\n if (width > this.dashboard.columns) {\n throw new Error('The child does not fit on the current dashboard.');\n }\n do {\n x = 0;\n y++;\n while (x + width <= this.dashboard.columns) {\n if (this.getCollided({ x, y, width, height }).length === 0) {\n found = true;\n break;\n }\n x++;\n }\n } while (!found);\n return { x, y, width, height } as DashboardChildDimension;\n }\n\n collapseUpAll(): void {\n return sortBy([this.child, ...this.children], ['y']).forEach(w => {\n const ds = new DashboardChildChange(w);\n const newPosition = ds.collapseUp(w);\n ds.setDimension(newPosition);\n });\n }\n\n arrangeAll(arrange: DashboardChildArrangement) {\n const { current, scan, spacing, origin } = arrange;\n const collided = this.getCollided(current, sortBy(scan, ['y']));\n return collided.map(child => {\n const ds = new DashboardChildChange(child);\n ds.setDimension({ ...child, y: spacing });\n return {\n current: child,\n scan: scan.filter(w => w !== child),\n spacing: child.y + child.height,\n origin\n };\n });\n }\n\n private arrangePipe() {\n return pipe(\n map(\n (dimension: DashboardChildDimension) =>\n ({\n current: dimension,\n scan: this.children,\n spacing: dimension.y + dimension.height,\n origin: { ...dimension }\n } as DashboardChildArrangement)\n ),\n expand((dimensions: DashboardChildArrangement) => this.arrangeAll(dimensions)),\n map(({ origin }) => origin),\n map(dimension => this.setDimension(dimension, true)),\n tap(() => this.collapseUpAll()),\n tap(() => this.dashboard.getLastRow())\n );\n }\n\n private collapseUp(dimension: DashboardChildDimension) {\n let { y } = dimension;\n while (y > 0) {\n if (this.getCollided({ ...dimension, y: y - 1 }).length !== 0) {\n break;\n }\n y--;\n }\n return { ...dimension, y };\n }\n\n private setDimension(dimension: DashboardChildDimension, notIfColliding = false) {\n if (notIfColliding && this.getCollided(dimension).length > 0) {\n return;\n }\n\n this.child.x = dimension.x;\n this.child.y = dimension.y;\n if (\n dimension.width >= this.MIN_WIDTH &&\n dimension.x + dimension.width <= this.dashboard.columns\n ) {\n this.child.width = dimension.width;\n } else if (dimension.width < this.MIN_WIDTH) {\n dimension.width = this.MIN_WIDTH;\n } else {\n dimension.width = this.dashboard.columns - dimension.x;\n }\n if (dimension.height >= this.MIN_HEIGHT) {\n this.child.height = dimension.height;\n } else {\n dimension.height = this.MIN_WIDTH;\n }\n return dimension;\n }\n\n private setPixelSize({ width, height }) {\n if (width >= this.dashboard.columnSize * this.MIN_WIDTH - this.dashboard.gap) {\n this.child.pxWidth = width + this.PIXEL_SIZE_THRESHOLD;\n }\n if (height >= this.dashboard.rowSize * this.MIN_HEIGHT - this.dashboard.gap) {\n this.child.pxHeight = height + this.PIXEL_SIZE_THRESHOLD;\n }\n }\n\n private getPixelSize(moveEvent: CdkDragMove) {\n const draggedElement = moveEvent.source.element.nativeElement.parentNode as HTMLElement;\n if (!this.diffX) {\n const rect = draggedElement.getBoundingClientRect();\n this.diffX = rect.left;\n this.diffY = rect.top;\n }\n const { x, y } = moveEvent.pointerPosition;\n const width = Math.round(x - this.diffX);\n const height = Math.round(y - this.diffY);\n return { width, height, pointer: { x, y } } as DashboardChildResizeDimension;\n }\n\n private getDimensionSize(resizePosition: DashboardChildResizeDimension) {\n const { x, y } = this.child;\n const ds = this.dashboard.dashboardRect;\n const column = this.dashboard.columnSize;\n const row = this.dashboard.rowSize + this.dashboard.gap;\n const width =\n Math.round((resizePosition.pointer.x - ds.left + this.dashboard.gap) / column) - x;\n const height = Math.round((resizePosition.pointer.y - ds.top + this.dashboard.gap) / row) - y;\n return { x, y, width, height } as DashboardChildDimension;\n }\n\n private getDimensionPosition(moveEvent: CdkDragMove) {\n const draggedElement = moveEvent.source.element.nativeElement.nextElementSibling;\n if (!this.diffX) {\n const rect = draggedElement.getBoundingClientRect();\n this.diffX = moveEvent.pointerPosition.x - rect.left;\n this.diffY = moveEvent.pointerPosition.y - rect.top;\n }\n\n const left = moveEvent.pointerPosition.x - this.diffX;\n const top = moveEvent.pointerPosition.y - this.diffY;\n const { width, height } = this.child;\n const ds = this.dashboard.dashboardRect;\n const column = this.dashboard.columnSize;\n const row = this.dashboard.rowSize + this.dashboard.gap / 2;\n const x = Math.round((left - ds.left) / column);\n const y = Math.round((top - ds.top) / row);\n return { x, y, width, height } as DashboardChildDimension;\n }\n\n private doesCollide(a: DashboardChildDimension, b: DashboardChildDimension) {\n if (b.x === undefined) {\n return false;\n }\n return !(\n a.y + a.height - 1 < b.y ||\n a.y > b.y + b.height - 1 ||\n a.x + a.width - 1 < b.x ||\n a.x > b.x + b.width - 1\n );\n }\n\n private getCollided(currentDimension: DashboardChildDimension, dimensions = this.children) {\n const collided = dimensions.filter(dimension => this.doesCollide(currentDimension, dimension));\n return collided;\n }\n}\n","import { CdkDrag, CdkDragEnd, CdkDragStart } from '@angular/cdk/drag-drop';\nimport {\n Component,\n forwardRef,\n HostBinding,\n Inject,\n Input,\n ContentChildren,\n Output,\n EventEmitter,\n ElementRef\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { Subscription } from 'rxjs';\nimport { DashboardComponent } from './dashboard.component';\nimport { DashboardChildDimension, Widget } from './dashboard.model';\nimport { DashboardChildChange } from './dashboard-child-change';\nimport { DashboardChildActionComponent } from './dashboard-child-action.component';\n\n/**\n * A dashboard child allows to position elements\n * correctly on a grid. The user can then resize and\n * rearrange the elements, as long as they are not `frozen`.\n *\n * By setting `c8y-dashboard-child-actions` and\n * `c8y-dashboard-child-title` on the element you can add\n * custom actions or a custom title to the current child.\n *\n * By adding the correct branded classes, you can define\n * the look and feel of the child. By default it is displayed\n * as a card.\n *\n * Example:\n *\n * ```html\n * <c8y-dashboard-child\n * #cpWidget3\n * [isFrozen]=\"isFrozen\"\n * [x]=\"0\"\n * [y]=\"3\"\n * [width]=\"4\"\n * [height]=\"4\"\n * [class]=\"'card-dashboard panel-content-transparent'\"\n * >\n * <c8y-dashboard-child-title *ngIf=\"showTitle\">\n * <span>Transparent!</span>\n * </c8y-dashboard-child-title>\n * <c8y-dashboard-child-action>\n * <a href=\"\" (click)=\"showTitle = !showTitle; (false)\">\n * <i [c8yIcon]=\"'heading'\"></i> Hide/show title\n * </a>\n * </c8y-dashboard-child-action>\n * <c8y-dashboard-child-action>\n * <a href=\"\" (click)=\"cpWidget3.isFrozen = !cpWidget3.isFrozen; (false)\">\n * <i [c8yIcon]=\"cpWidget3.isFrozen ? 'lock' : 'unlock'\"></i> Toggle freeze\n * </a>\n * </c8y-dashboard-child-action>\n * x: {{ cpWidget3.x }}<br />\n * y: {{ cpWidget3.y }}<br />\n * width: {{ cpWidget3.width }}<br />\n * height: {{ cpWidget3.height }}<br />\n * </c8y-dashboard-child>\n * ```\n */\n@Component({\n selector: 'c8y-dashboard-child',\n templateUrl: './dashboard-child.component.html',\n host: {\n class: 'dashboard-grid-child'\n }\n})\nexport class DashboardChildComponent implements DashboardChildDimension {\n @ContentChildren(DashboardChildActionComponent) actions = [];\n dragSource: CdkDrag;\n isResize = false;\n isDragging = false;\n klasses = {};\n\n _pxWidth = '100%';\n _pxHeight = '100%';\n\n /**\n * The x position of the child.\n */\n @Input() x;\n\n /**\n * The y position of the child.\n */\n @Input() y;\n\n /**\n * The width of the component in grid-columns.\n */\n @Input() width = 1;\n\n /**\n * The height of the component in grid-rows.\n */\n @Input() height = 1;\n\n /**\n * The data object can be used as a dataTransfer object for events of the child.\n */\n @Input() data: Widget | any;\n\n /**\n * The margin of the child in pixel.\n */\n @Input() margin = 12;\n\n /**\n * If a dashboard is frozen, all children cannot be moved\n * or resized.\n */\n @Input() isFrozen = false;\n\n /**\n * The child content is initialized, as soon it is scrolled into viewport\n */\n @Input() useIntersection = false;\n\n /**\n * An event fired if a child change is started (dragging or resizing)\n */\n @Output() changeStart = new EventEmitter<DashboardChildComponent>();\n\n /**\n * An event fired if a child change is ended\n */\n @Output() changeEnd = new EventEmitter<DashboardChildComponent>();\n\n /**\n * All classes added to this child\n */\n @Input()\n class: string[] | { [key: string]: boolean } = {};\n\n /**\n * Updates the pixel width of the child (used for resizing)\n */\n set pxWidth(value) {\n this._pxWidth = `${value}px`;\n }\n\n /**\n * Updates the pixel height of the child (used for resizing)\n */\n set pxHeight(value) {\n this._pxHeight = `${value}px`;\n }\n\n /**\n * An indicator if the child is intersected (that mean visible for the user)\n */\n intersected = false;\n\n /**\n * nasty workaround for that issue:\n * https://github.com/angular/angular/issues/9343\n */\n @HostBinding('attr.style')\n get inlineStyle() {\n return this.sanitizer.bypassSecurityTrustStyle(`\n grid-column-start: ${this.x + 1};\n -ms-grid-column: ${this.x + 1};\n grid-row-start: ${this.y + 1};\n -ms-grid-row: ${this.y + 1};\n grid-column-end: span ${this.width};\n -ms-grid-column-span: ${this.width};\n grid-row-end: span ${this.height};\n -ms-grid-row-span: ${this.height};\n display: block;\n margin: ${this.margin || 12}px;\n order: ${this.getOrder()};\n `);\n }\n\n /**\n * The observable subscription which is listen to\n * on changes (drag or resize).\n */\n changeSubscription: Subscription;\n\n constructor(\n @Inject(forwardRef(() => DashboardComponent)) public dashboard: DashboardComponent,\n private sanitizer: DomSanitizer,\n private element: ElementRef\n ) {}\n\n ngOnChanges(): void {\n this.klasses = {\n card: true,\n 'card-dashboard': true,\n disabled: this.isFrozen,\n 'on-resize': this.isResize,\n ...this.class\n };\n }\n\n ngOnInit(): void {\n if (this.x === undefined || this.y === undefined) {\n setTimeout(() => this.setDynamicDimension());\n }\n if (this.useIntersection && 'IntersectionObserver' in window) {\n const intersectionObserver = new IntersectionObserver(\n event => (this.intersected = this.childInView(event[0], intersectionObserver))\n );\n intersectionObserver.observe(this.element.nativeElement);\n } else {\n this.intersected = true;\n }\n }\n\n setDynamicDimension() {\n const ds = new DashboardChildChange(this);\n const { x, y } = ds.findFreeDimension();\n this.x = x;\n this.y = y;\n }\n\n resizeStarted($event: CdkDragStart) {\n this.isResize = true;\n this.dashboard.updateRectSize();\n this.dragSource = $event.source;\n const positioning = new DashboardChildChange(this);\n this.changeSubscription = positioning.resize$.subscribe();\n this.changeStart.emit(this);\n this.ngOnChanges();\n }\n\n dragStarted($event: CdkDragStart) {\n this.isDragging = true;\n this.dashboard.updateRectSize();\n this.dragSource = $event.source;\n const positioning = new DashboardChildChange(this);\n this.changeSubscription = positioning.drag$.subscribe();\n this.changeStart.emit(this);\n }\n\n reset($event?: CdkDragEnd) {\n this.isResize = false;\n this.isDragging = false;\n this._pxWidth = '100%';\n this._pxHeight = '100%';\n this.ngOnChanges();\n if ($event) {\n $event.source.reset();\n }\n if (this.changeSubscription) {\n this.changeSubscription.unsubscribe();\n this.dashboard.emitChange(this);\n this.changeEnd.emit(this);\n }\n }\n\n private getOrder() {\n return `${Math.round((this.y + (this.x + 1) / 100) * 100)}`;\n }\n\n private childInView(event, observer) {\n if (event.isIntersecting) {\n observer.unobserve(event.target);\n return true;\n }\n return false;\n }\n}\n","import { Component, EventEmitter, Input, Output, SimpleChanges } from '@angular/core';\nimport { DashboardSettings, Widget, WidgetChange, DashboardChange } from './dashboard.model';\nimport { DashboardComponent } from './dashboard.component';\nimport { BreadcrumbItem } from '../..';\n\n@Component({\n selector: 'c8y-widgets-dashboard',\n templateUrl: './widgets-dashboard.component.html',\n host: {\n style: `\n display: block;\n `,\n class: 'dashboard c8y-grid-dashboard'\n }\n})\nexport class WidgetsDashboardComponent {\n @Input()\n widgets: Widget[];\n\n @Input()\n context: any;\n\n @Input()\n contextDashboard: any;\n\n @Input('settings')\n set _settings(settings: Partial<DashboardSettings>) {\n this.settings = { ...this.settings, ...settings };\n }\n\n @Input()\n breadcrumb: BreadcrumbItem;\n\n settings: DashboardSettings = {\n isFrozen: false,\n isDisabled: false,\n widgetMargin: 12,\n translateWidgetTitle: false,\n defaultHeight: 4,\n defaultWidth: 4,\n allowFullscreen: false,\n canDelete: true,\n isLoading: false,\n };\n\n @Output()\n onAddWidget: EventEmitter<DashboardComponent> = new EventEmitter();\n\n @Output()\n onEditWidget: EventEmitter<WidgetChange> = new EventEmitter();\n\n @Output()\n onDeleteWidget: EventEmitter<WidgetChange> = new EventEmitter();\n\n @Output()\n onChangeDashboard: EventEmitter<DashboardChange> = new EventEmitter();\n\n @Output()\n onEditDashboard: EventEmitter<DashboardComponent> = new EventEmitter();\n\n @Output()\n onDeleteDashboard: EventEmitter<DashboardComponent> = new EventEmitter();\n\n @Output()\n onFreeze: EventEmitter<DashboardSettings> = new EventEmitter();\n\n @Output()\n onChangeStart: EventEmitter<WidgetChange> = new EventEmitter();\n\n @Output()\n onChangeEnd: EventEmitter<WidgetChange> = new EventEmitter();\n\n toggleFullscreen() {\n const elem = document.body as any;\n const doc = document as any;\n if (!this.fullScreen()) {\n if (elem.requestFullscreen) {\n elem.requestFullscreen();\n } else if (elem.msRequestFullscreen) {\n elem.msRequestFullscreen();\n } else if (elem.mozRequestFullScreen) {\n elem.mozRequestFullScreen();\n } else if (elem.webkitRequestFullscreen) {\n elem.webkitRequestFullscreen((Element as any).ALLOW_KEYBOARD_INPUT);\n }\n } else if (doc.exitFullscreen) {\n doc.exitFullscreen();\n } else if (doc.msExitFullscreen) {\n doc.msExitFullscreen();\n } else if (doc.mozCancelFullScreen) {\n doc.mozCancelFullScreen();\n } else if (doc.webkitExitFullscreen) {\n doc.webkitExitFullscreen();\n }\n }\n\n fullScreen() {\n const doc: any = document;\n return !!(\n doc.fullscreenElement ||\n doc.mozFullScreenElement ||\n doc.webkitFullscreenElement ||\n doc.msFullscreenElement\n );\n }\n}\n","import { DragDropModule } from '@angular/cdk/drag-drop';\nimport { NgModule } from '@angular/core';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { ActionBarModule } from '../action-bar/action-bar.module';\nimport { CommonModule } from '../common/common.module';\nimport { DynamicComponentModule } from '../dynamic-component/dynamic-component.module';\nimport { DashboardChildActionComponent } from './dashboard-child-action.component';\nimport { DashboardChildTitleComponent } from './dashboard-child-title.component';\nimport { DashboardChildComponent } from './dashboard-child.component';\nimport { DashboardComponent } from './dashboard.component';\nimport { WidgetsDashboardComponent } from './widgets-dashboard.component';\nimport { HeaderModule } from '../header/header.module';\nimport { DocsModule } from '../docs/docs.module';\nimport { BreadcrumbModule } from '../breadcrumb/breadcrumb.module';\n\n@NgModule({\n declarations: [\n DashboardChildComponent,\n DashboardComponent,\n DashboardChildTitleComponent,\n DashboardChildActionComponent,\n WidgetsDashboardComponent\n ],\n imports: [\n CommonModule,\n ActionBarModule,\n DynamicComponentModule,\n DragDropModule,\n BsDropdownModule.forRoot(),\n HeaderModule,\n DocsModule,\n BreadcrumbModule,\n ],\n exports: [\n DashboardComponent,\n DashboardChildComponent,\n DashboardChildTitleComponent,\n DashboardChildActionComponent,\n WidgetsDashboardComponent\n ]\n})\nexport class DashboardModule {}\n","import { Directive, Input, TemplateRef } from '@angular/core';\nimport { StepState } from '@angular/cdk/stepper';\n\n/**\n * Template to be used to override the icons inside the step header.\n */\n@Directive({\n selector: 'ng-template[c8yStepperIcon]'\n})\nexport class C8yStepperIcon {\n /** Name of the icon to be overridden. */\n @Input('c8yStepperIcon') name: StepState;\n\n constructor(public templateRef: TemplateRef<any>) {}\n}\n","import {\n Component,\n TemplateRef,\n Input,\n Output,\n ContentChildren,\n QueryList,\n AfterContentInit,\n OnDestroy,\n EventEmitter\n} from '@angular/core';\nimport { CdkStepper, StepState, STEP_STATE } from '@angular/cdk/stepper';\nimport { C8yStepperIcon } from './stepper-icon.directive';\nimport { Subject, Subscription } from 'rxjs';\n\n/**\n * C8yStepper extends the CdkStepper. You can use cdk based functionality and inputs.\n * Additional to that you are able to modify the behavior and also the look and feel when\n * using the C8yStepper.\n *\n * The C8yStepper is used to present any step-based process to the user.\n * A stepper, C8yStepper and/or CdkStepper is the parent of cdk-steps.\n * Each cdk-step represents one step in the whole process that you want to provide to the user.\n *\n * The C8yStepper will create, based on the given cdk-steps, a kind of stepper-progress which looks like this:\n * (1)---(2)---(3)---(n)\n * The stepper will handle the state of each step and provides styles for active steps, done-steps or in edit-mode.\n * You are able to override icons for each step in the stepper-progress with a template. You are also able to activate\n * default-icons for states like 'edit' and 'done'.\n *\n * To force users through every provided step, set the stepper to 'linear'.\n * This will disable the possibility to move for example from step one to step three.\n *\n * Whenever it comes to validation try to use formGroups. It is possible to\n * assign a formGroup to a cdk-step input called [stepControl], which automatically respects the\n * validation-rules that you created for this formGroup. If fields are required but not filled or\n * any other validation, like a pattern, is not matched the formGroup will be invalid. In this case\n * stepping in a linear stepper to the next step gets impossible.\n *\n * If there is the need to execute asynchronous code you have at least two possibilities.\n * First: As you learned, a cdk-step works with formGroups and Validators, so you are able to use\n * asyncValidators as well.\n * Second: The C8yStepper provides an event-emitter onStepChange which is called whenever a step-button (1)--(2)--(n)\n * in the stepper-progress is clicked. The event of this emitter holds the index of the step as number. You can\n * use this EventEmitter to call for example a custom navigate-method which performs first any async-call and then moves\n * on to the given step.\n *\n * @example\n * ```\n * <c8y-stepper\n * (onStepChange)=\"navigate($event)\"\n * [disableDefaultIcons]=\"{ edit: true, done: false }\"\n * [customClasses]=\"['m-l-40', 'm-r-40', 'm-t-32']\"\n * linear\n * >\n * <!-- override icons -->\n * <ng-template c8yStepperIcon=\"final\">\n * <span [c8yIcon]=\"'hand-peace-o'\"></span>\n * </ng-template>\n *\n * <cdk-step [stepControl]=\"formGroupStepOne\" label=\"Name of the hero\">\n * <div class=\"m-l-40 m-r-40 m-t-32\">\n * <h4 class=\"p-b-8\" translate>What is the name of your hero?</h4>\n * <c8y-form-group>\n * <div [formGroup]=\"formGroupStepOne\">\n * <input\n * class=\"form-control\"\n * type=\"text\"\n * formControlName=\"name\"\n * placeholder=\"Mister X\"\n * #nameRef\n * required\n * />\n * <c8y-messages>\n * <c8y-message *ngIf=\"!formGroupStepOne.untouched && !nameRef.value\" translate\n * >Enter the name of the Superhero</c8y-message\n * >\n * </c8y-messages>\n * </div>\n * </c8y-form-group>\n * </div>\n * <c8y-stepper-buttons></c8y-stepper-buttons>\n * </cdk-step>\n * <cdk-step>\n * ...\n * </cdk-step state=\"final\">\n * </c8y-stepper>\n * ```\n */\n@Component({\n selector: 'c8y-stepper',\n templateUrl: './stepper.component.html',\n providers: [{ provide: CdkStepper, useExisting: C8yStepper }]\n})\nexport class C8yStepper extends CdkStepper implements AfterContentInit, OnDestroy {\n /**\n * Optional\n * Indicator if icons for edit and done state should be shown in step-header buttons\n */\n @Input() disableDefaultIcons?: { edit: boolean; done: boolean } = { edit: true, done: true };\n /**\n * Optional\n * Possibility to add any kind of custom css classes to the step-header\n */\n @Input() customClasses?: [string];\n /**\n * Will emit the step index number whenever a step-header button was clicked\n * It listens to the stepIndex Subject.\n */\n @Output() onStepChange = new EventEmitter<number>();\n\n /**\n * Holding a QueryList of C8yStepperIcons\n * These are templateRefs which overrides any step-header button icon with matching state of cdk-step\n *\n * @example:\n * ```\n * <!-- override icons -->\n * <ng-template c8yStepperIcon=\"final\">\n * <span [c8yIcon]=\"'hand-peace-o'\"></span>\n * </ng-template>\n *\n * <cdk-step state=\"final\" label=\"Job done!\">\n * <div class=\"m-l-40 m-r-40 m-t-32\">\n * <h4 class=\"p-b-32\" style=\"text-align: center;\" translate>\n * Your Superhero is now ready to save the world!\n * </h4>\n * </div>\n * <c8y-stepper-buttons\n * [hidden]=\"!isModal\"\n * (onBack)=\"close()\"\n * [labels]=\"{ back: 'Got it!' }\"\n * ></c8y-stepper-buttons>\n * <c8y-stepper-buttons [hidden]=\"isModal\"></c8y-stepper-buttons>\n * </cdk-step>\n * ```\n */\n @ContentChildren(C8yStepperIcon, { descendants: true }) _icons: QueryList<C8yStepperIcon>;\n\n /** Consumer-specified template-refs to be used to override the header icons. */\n _iconOverrides: { [key: string]: TemplateRef<any> } = {};\n\n private _stepIndex: Subject<number> = new Subject();\n private _stepIndexSubscription: Subscription;\n\n ngAfterContentInit() {\n this._icons.forEach(({ name, templateRef }) => (this._iconOverrides[name] = templateRef));\n this._stepIndexSubscription = this._stepIndex.subscribe(index => this.onStepChange.emit(index));\n }\n\n ngOnDestroy() {\n if (this._stepIndexSubscription && !this._stepIndexSubscription.closed) {\n this._stepIndexSubscription.unsubscribe();\n }\n }\n\n /**\n * Manipulates the state based on the disabledDefaultIcons Input()\n * Changing edit or done to false will change the icons within step-header buttons\n * @param index step index\n * @param state step state, like 'done', 'edit', 'error'\n */\n getIndicatorType(index: number, state: StepState) {\n const stepState = this._getIndicatorType(index, state);\n let _state = state;\n switch (stepState) {\n case STEP_STATE.EDIT:\n if (!this.disableDefaultIcons.edit) {\n _state = STEP_STATE.EDIT;\n }\n break;\n\n case STEP_STATE.DONE:\n if (!this.disableDefaultIcons.done) {\n _state = STEP_STATE.DONE;\n } else {\n _state = '_done';\n }\n break;\n }\n return _state;\n }\n\n /**\n * Pushs the step index to the subject\n * @param index step index\n */\n setIndex(index: number) {\n this._stepIndex.next(index);\n }\n}\n","import { Component, Input, Output, TemplateRef, EventEmitter } from '@angular/core';\nimport { StepState } from '@angular/cdk/stepper';\n\n@Component({\n selector: 'c8y-stepper-progress',\n templateUrl: './stepper-progress.component.html'\n})\nexport class C8yStepperProgress {\n /** List of overriden icons as TemplateRef. Also default icons could be overriden.\n * The given overriden icons will replace an icon with matching state: StepState\n *\n * <ng-container\n * *ngSwitchCase=\"true\"\n * [ngTemplateOutlet]=\"iconOverrides[state]\"\n * ></ng-container>\n *\n */\n @Input() iconOverrides: { [key: string]: TemplateRef<any> };\n /** The index of the current step */\n @Input() index: number;\n /** Whether the step is cuurently selected or not */\n @Input() selected: boolean;\n /** The current state of the step */\n @Input() state: StepState;\n\n /** Emits the index: number of the step which was clicked */\n @Output() onStepClicked = new EventEmitter<number>();\n\n /** Called on click and emits the step index */\n stepSelected() {\n this.onStepClicked.emit(this.index);\n }\n}\n","import { CdkStep } from '@angular/cdk/stepper';\nimport {\n AfterContentInit,\n Component,\n EventEmitter,\n Host,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { C8yStepper } from './stepper.component';\n\n/**\n * C8yStepperButtons provides a convinient way to have, according to\n * the C8yStepper and each cdk-step, buttons to navigate between steps or to cancel the whole\n * step-process. Buttons rendered with the help of this component will use the branding css.\n *\n * By default all steps with this component in use will render a next button, expect the last step.\n * The other way around, every step using this component will render a back button, expect the first step.\n * To get a cancel button rendered you need to handle the onCancel event.\n * For next and back button you don't need to handle the available events onNext and onBack because default behavior\n * is implemented. The default will just call, according to the button, the stepper.next() or stepper.previous()\n * methods and moves the stepper forth or back. Using the EventEmitter onNext and onBack will emit for you the following\n * object: {stepper: C8yStepper, step: CdkStep}. This is useful if you need to implement custom logic before moving\n * to the next step or sending data to a backend. In this case you need to tell the stepper to move forward or back\n * on your own.\n *\n * With the component input [labels] you can change the label of each button in each step. It takes an object like this:\n * {next?: string, back?: string, cancel?: string}\n *\n * The [pending] input is of type boolean and will enable css animation for the next button when true.\n *\n * If the cdk-step provides a stepControl the component will set the next button disabled when the formGroup\n * behind it is invalid. As long as the [pending] input is true the back and next button is also disabled.\n * This will prevent multiple clicks while running a request or stepping back while a request is ongoing.\n *\n * @example\n * ```\n * <c8y-stepper>\n * <cdk-step>\n * <!--\n * your html code\n * ...\n * ... -->\n * <c8y-stepper-buttons\n * (onNext)=\"save()\"\n * [labels]=\"{ next: 'Save' }\"\n * [pending]=\"pendingStatus\"\n * ></c8y-stepper-buttons>\n * </cdk-step>\n * </c8y-stepper>\n *\n * // in your component:\n * async save() {\n * this.pendingStatus = true;\n * // your async request goes here ...\n * // await something();\n * this.pendingStatus = false;\n * this.stepper.next();\n * }\n * ```\n */\n@Component({\n selector: 'c8y-stepper-buttons',\n templateUrl: './stepper-buttons.component.html'\n})\nexport class C8yStepperButtons implements AfterContentInit, OnDestroy, OnChanges {\n /**\n * Optional\n * Specify custom labels for each button (cancel, back or next)\n */\n @Input() labels?: { cancel?: string; back?: string; next?: string; custom?: string };\n /**\n * Optional\n * Indicates if a request is pending and sets the next button\n * to disabled when true\n */\n @Input() pending?: boolean = false;\n\n /**\n * Disabled state of a button\n */\n @Input() disabled?: boolean = false;\n\n /**\n * EventEmitter which emits when cancel button is clicked\n */\n @Output() onCancel = new EventEmitter();\n /**\n * EventEmitter which emits {stepper: C8yStepper; step: CdkStep} when next button is clicked.\n */\n @Output() onNext = new EventEmitter<{ stepper: C8yStepper; step: CdkStep }>();\n\n /**\n * EventEmitter which emits {stepper: C8yStepper; step: CdkStep} when back button is clicked.\n */\n @Output() onBack = new EventEmitter<{ stepper: C8yStepper; step: CdkStep }>();\n\n /**\n * EventEmitter which emits when the optional custom button is clicked\n */\n @Output() onCustom = new EventEmitter();\n\n /**\n * Indicator which button should be shown.\n * Based on the cdk-steps within the c8y-stepper\n * next and back buttons are rendered.\n */\n showBtns = {\n cancel: false,\n back: false,\n next: false,\n custom: false\n };\n\n private statusChangeSubscription: Subscription;\n\n constructor(@Host() private stepper: C8yStepper, @Host() private step: CdkStep) {}\n\n ngAfterContentInit() {\n this.showBtns.cancel = this.onCancel.observers.length > 0;\n this.showBtns.custom = this.onCustom.observers.length > 0;\n\n if (this.stepper && this.stepper.steps && this.step) {\n this.showBtns.back = this.stepper.steps.first !== this.step;\n this.showBtns.next = this.stepper.steps.last !== this.step;\n }\n\n if (this.step && this.step.stepControl) {\n this.disabled = this.step.stepControl.invalid;\n\n this.statusChangeSubscription = this.step.stepControl.statusChanges.subscribe(status => {\n this.disabled = this.step.stepControl.invalid;\n });\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n /**\n * Disable save/next button while the status is pending\n * This will prevent multiple clicks and therefore multiple requests\n */\n if (changes && changes.pending) {\n this.disabled = changes.pending.currentValue;\n }\n }\n\n ngOnDestroy() {\n if (this.statusChangeSubscription && !this.statusChangeSubscription.closed) {\n this.statusChangeSubscription.unsubscribe();\n }\n }\n\n /**\n * Gets called when cancel button is clicked.\n * It will emit immediate.\n */\n cancel() {\n this.onCancel.emit();\n }\n\n /**\n * Gets called when next button is clicked. When onNext EventEmitter has an observer registered\n * it will emit the following object {stepper: C8yStepper; step: CdkStep}.\n * Otherwise it will call stepper.next() as default.\n */\n next() {\n if (this.onNext.observers.length > 0) {\n this.onNext.emit({ stepper: this.stepper, step: this.step });\n } else {\n this.stepper.next();\n }\n }\n\n /**\n * Gets called when back button is clicked. When onBack EventEmitter has an observer registered\n * it will emit the following object {stepper: C8yStepper; step: CdkStep}.\n * Otherwise it will call stepper.previous() as default.\n */\n back() {\n this.stepper.selected.completed = false;\n if (this.onBack.observers.length > 0) {\n this.onBack.emit({ stepper: this.stepper, step: this.step });\n } else {\n this.stepper.previous();\n }\n }\n\n /**\n * Gets called when the custom button is clicked.\n * It will emit immediately.\n */\n custom() {\n this.onCustom.emit();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CdkStepperModule, CdkStep, STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';\nimport { C8yStepper } from './stepper.component';\nimport { CommonModule } from '../common/common.module';\nimport { C8yStepperIcon } from './stepper-icon.directive';\nimport { C8yStepperProgress } from './stepper-progress.component';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { C8yStepperButtons } from './stepper-buttons.component';\n\n/**\n * The angular module definition for c8y-stepper (Wizard).\n * @exports C8yStepper\n * @exports C8yStepperIcon\n * @exports C8yStepperButtons\n * @exports CdkStep\n */\n@NgModule({\n imports: [CommonModule, CdkStepperModule, TooltipModule],\n declarations: [C8yStepper, C8yStepperIcon, C8yStepperProgress, C8yStepperButtons],\n exports: [C8yStepper, CdkStep, C8yStepperIcon, C8yStepperButtons],\n providers: [\n {\n /**\n * This emables additional states, like: edit, done and error\n * These states are used to display custom icons, if needed.\n * Any change in here will most probably result in not showing custom icons anymore\n */\n provide: STEPPER_GLOBAL_OPTIONS,\n useValue: { displayDefaultIndicatorType: false }\n }\n ]\n})\nexport class StepperModule {}\n","import { Component, Output, Input, ViewChild, EventEmitter } from '@angular/core';\n\n/**\n * Actions are functions that can be executed on the\n * current list item. They are displayed next to the\n * item and can be grouped in a dropdown.\n *\n * @example\n * ```html\n * <c8y-li>\n * <c8y-li-action (click)=\"deleteDevice(device.id)\" icon=\"times\">\n * Delete\n * </c8y-li-action>\n * <c8y-li-action (click)=\"(false)\" icon=\"rocket\">\n * Launch to space\n * </c8y-li-action>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-action, c8y-li-action',\n templateUrl: './list-item-action.component.html'\n})\nexport class ListItemActionComponent {\n /**\n * @ignore\n */\n @ViewChild('template', { static: false })\n template: any;\n /**\n * The label to display (you can alternatively use\n * content projection to display the label).\n */\n @Input()\n label: string;\n /**\n * The name of the icon to use\n */\n @Input()\n icon: string;\n /**\n * An EventEmitter to determine what to do if the\n * action is triggered.\n */\n @Output()\n click = new EventEmitter<any>();\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * Display collapsed content on a list item. Can be\n * used for more detailed information. Use it with\n * content projection.\n *\n * @example\n * ```html\n * <c8y-li>\n * <c8y-collapsed>\n * <strong>I am only visible if extended</strong>\n * </c8y-collapsed>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-collapse, c8y-li-collapse',\n templateUrl: './list-item-collapse.component.html'\n})\nexport class ListItemCollapseComponent {\n /**\n * The way how to toggle collapse state.\n * button (default) - additional button for toggle collapse state\n * row - toggling collapse state by clicking to entire row.\n */\n @Input()\n collapseWay: 'button' | 'row' = 'button';\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * The footer can be used with either content projection\n * or a simple string as an input.\n *\n * @example\n * ```html\n * <c8y-li>\n * Content\n * <c8y-li-footer>I am a footer</c8y-li-footer>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-footer, c8y-li-footer',\n templateUrl: './list-item-footer.component.html'\n})\nexport class ListItemFooterComponent {\n /**\n * A simple string that can be used instead\n * of content projection.\n */\n @Input()\n footer: string;\n}\n","import {\n Component,\n ContentChild,\n ElementRef,\n ContentChildren,\n HostBinding,\n Input,\n Output,\n EventEmitter,\n QueryList\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil, filter, tap, delay } from 'rxjs/operators';\nimport { ListItemActionComponent } from './list-item-action.component';\nimport { ListItemCollapseComponent } from './list-item-collapse.component';\nimport { ListItemFooterComponent } from './list-item-footer.component';\n\n/**\n * A list item is a representation of an item inside a list and\n * can be used to compose different styles in a list (mainly in a\n * <c8y-group-list>-component but also in others like the\n * <c8y-typeahead>-component):\n * - a list with a footer\n * - a list with one or multiple actions\n * - an icon\n * - a checkbox or radio input\n *\n * The item can be composed via content projection. The following\n * example shows a radio list with an icon, two actions\n * and a footer:\n * ```html\n * <c8y-list-group>\n * <c8y-li\n * *c8yFor=\"\n * let device of devices;\n * let i = index;\n * \"\n * >\n * <c8y-li-radio (onSelect)=\"updateSelected($event, device)\"></c8y-li-radio>\n * <c8y-li-icon [icon]=\"'rocket'\"></c8y-li-icon>\n * {{ i + 1 }}. {{ device.name || '-' }}\n * <c8y-li-footer>\n * Device id: <a [routerLink]=\"['/device', device.id]\">{{ device.id }}</a>\n * </c8y-li-footer>\n * <c8y-li-action (click)=\"deleteDevice(device.id)\" icon=\"times\">\n * Delete\n * </c8y-li-action>\n * <c8y-li-action (click)=\"(false)\" icon=\"rocket\">\n * Launch to space\n * </c8y-li-action>\n * </c8y-li>\n * </c8y-list-group>\n * ```\n */\n@Component({\n selector: 'c8y-list-item, c8y-li',\n templateUrl: './list-item.component.html',\n host: {\n class: 'c8y-list__item'\n }\n})\nexport class ListItemComponent {\n /**\n * If set to true, the class \"active\" is added which\n * indicates that the current row is active.\n */\n @Input()\n @HostBinding('class.active')\n active: boolean = false;\n\n /**\n * Indicates if the current list item is collapsed. You can trigger the collapsing from\n * any element event by toggling this value.\n *\n * @example\n * ```html\n * <c8y-li #li (click)=\"li.collapsed = !li.collapsed\">\n * Toggle\n * <c8y-li-collapse>\n * I can be toggled by clicking on the row.\n * </c8y-li-collapse\n * </c8y-li>\n * ``\n */\n @Input()\n collapsed: boolean = true;\n\n /**\n * An event emitter which is triggered when the user collapses the content\n * via the chevron on the right.\n */\n @Output()\n collapsedChange = new EventEmitter<boolean>();\n\n /**\n * A [[ListItemFooterComponent]] element which can be used to show a footer.\n * @example\n * ```html\n * <c8y-li>\n * I am the main content\n * <c8y-li-footer>\n * I am the footer content\n * </c8y-li-footer>\n * </c8y-li>\n * ```\n */\n @ContentChild(ListItemFooterComponent, { static: false })\n itemFooter: ListItemFooterComponent;\n\n /**\n * [[ListItemActionComponent]] elements which can be used to show an action.\n * An action is displayed on the right in the dropdown and usually consists of an\n * icon and a label.\n * @example\n * ```html\n * <c8y-li>\n * I am the main content\n * <c8y-li-action (click)=\"launchToSpace(device.id)\" icon=\"rocket\">\n * Launch\n * </c8y-li-action>\n * <c8y-li-action (click)=\"deleteDevice(device.id)\" icon=\"times\">\n * Delete\n * </c8y-li-action>\n * </c8y-li>\n * ```\n */\n @ContentChildren(ListItemActionComponent)\n itemActions: QueryList<ListItemActionComponent>;\n\n /**\n * [[ListItemCollapseComponent]] elements which can be used to show detail views.\n * @example\n * ```html\n * <c8y-li>\n * I am the main content\n * <c8y-li-collapse>\n * I am detailed content\n * </c8y-li-collapse>\n * </c8y-li>\n * ```\n */\n @ContentChild(ListItemCollapseComponent, { static: false })\n itemCollapse: ListItemCollapseComponent;\n\n /**\n * @ignore\n */\n showFooter: boolean = false;\n /**\n * @ignore\n */\n showActions: boolean = false;\n /**\n * @ignore\n */\n showCollapse: boolean = false;\n /**\n * @ignore\n */\n actions: ListItemActionComponent[];\n /**\n * @ignore\n */\n dropdownUp: boolean = false;\n\n private pulse$: Subject<boolean> = new Subject<boolean>();\n private destroy$: Subject<any> = new Subject();\n private readonly ACTION_ITEM_HEIGHT = 40;\n\n /**\n * @ignore\n */\n constructor(public element: ElementRef) {}\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.pulse$\n .pipe(\n filter(apply => !!apply),\n tap(() => this.element.nativeElement.classList.remove('c8y-list--pulse')),\n delay(100),\n tap(() => this.element.nativeElement.classList.add('c8y-list--pulse')),\n takeUntil(this.destroy$)\n )\n .subscribe();\n }\n\n /**\n * @ignore\n */\n ngAfterContentChecked(): void {\n this.actions = this.itemActions.toArray();\n this.showFooter = this.itemFooter != null;\n this.showActions = this.itemActions.length > 0;\n this.showCollapse = this.itemCollapse != null;\n }\n\n /**\n * @ignore\n */\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /**\n * A helper function which helps to determine if the dropdown\n * should toggle up.\n */\n showDropdownUp() {\n const listItemRect: DOMRect = this.element.nativeElement.getBoundingClientRect();\n const dropdownTop = listItemRect.top;\n const dropdownHeightWithToggle = (1 + this.itemActions.length) * this.ACTION_ITEM_HEIGHT;\n const availableHeight = window.innerHeight;\n const dropdownDownFits = dropdownTop + dropdownHeightWithToggle <= availableHeight;\n this.dropdownUp = !dropdownDownFits;\n }\n\n /**\n * Toggles the collapse state and emits this state as\n * collapsedChange output as boolean.\n * @param $event Pass optional an event to stop propagation.\n */\n toggleCollapsed($event?: Event) {\n if ($event) {\n $event.stopPropagation();\n }\n this.collapsed = !this.collapsed;\n this.collapsedChange.emit(this.collapsed);\n }\n\n /**\n * Highlights the list-item. This method should be used to show the\n * user that something within this item was changed.\n */\n pulse() {\n this.pulse$.next(true);\n }\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * The li-body component can be used to define the body.\n * Usually it doesn't need to be used, as it is the default\n * content projected to a <c8y-li>.\n */\n@Component({\n selector: 'c8y-list-item-body, c8y-li-body',\n templateUrl: './list-item-body.component.html'\n})\nexport class ListItemBodyComponent {\n /**\n * An optional string content.\n */\n @Input()\n body: string;\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n SimpleChanges,\n ViewChild,\n forwardRef\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * A component to display a radio button in a c8y-li. Use it with content projection. It\n * can be used standalone or with an ngModel.\n *\n * @example\n * ```html\n * <c8y-li>\n * <c8y-li-radio></c8y-li-radio>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-radio, c8y-li-radio',\n templateUrl: './list-item-radio.component.html',\n host: {\n class: 'c8y-list__item__radio'\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n multi: true,\n useExisting: forwardRef(() => ListItemRadioComponent)\n }\n ]\n})\nexport class ListItemRadioComponent implements ControlValueAccessor {\n /**\n * @ignore\n */\n @ViewChild('radio', { static: true }) radio: ElementRef;\n /**\n * Indicates if the radio is selected.\n */\n @Input()\n selected = false;\n /**\n * The name of the radio (use different names for different radio groups).\n */\n @Input()\n name = 'list_item_radio';\n /**\n * Indicates if the radio is disabled.\n */\n @Input()\n disabled: boolean = false;\n /**\n * An event emitted as soon as the radio is selected.\n */\n @Output()\n onSelect = new EventEmitter<boolean>();\n /**\n * The current value.\n */\n @Input() value: any;\n /**\n * @ignore\n */\n model: any;\n /**\n * @ignore\n */\n onChange: (value: any) => void;\n /**\n * @ignore\n */\n onTouched: () => void;\n\n /**\n * Resets the native radio element.\n */\n reset() {\n this.radio.nativeElement.checked = false;\n }\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.selected && !changes.selected.firstChange) {\n this.onSelect.emit(changes.selected.currentValue);\n }\n }\n\n /**\n * Triggered when the radio is changed.\n * @param checked Should it be checked or not?\n */\n change(checked) {\n this.onSelect.emit(checked);\n this.model = this.value;\n if (this.onChange) {\n this.onChange(this.model);\n }\n if (this.onTouched) {\n this.onTouched();\n }\n }\n\n /**\n * Registers an onChange event.\n */\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n /**\n * Registers an onTouch event.\n */\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n /**\n * @ignore\n */\n writeValue(value: boolean): void {\n this.model = value;\n }\n}\n","import { Component } from '@angular/core';\n\n/**\n * Allows to display a timeline. Should be used with\n * content projection.\n *\n * @example\n * ```html\n * <c8y-list-group>\n * <c8y-li-timeline>\n * 24.April 2020\n * <c8y-li>\n * Hello\n * </c8y-li>\n * </c8y-li-timeline>\n * </c8y-list-group>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-timeline, c8y-li-timeline',\n templateUrl: './list-item-timeline.component.html',\n host: {\n class: 'c8y-list--timeline__item'\n }\n})\nexport class ListItemTimelineComponent {}\n","import { Component, HostBinding, ContentChild } from '@angular/core';\nimport { ListItemTimelineComponent } from './list-item-timeline.component';\n\n/**\n * List groups are flexible and powerful components for displaying\n * both simple lists of elements and complex ones with custom content.\n *\n * @example\n * ```html\n * <c8y-list-group>\n * <c8y-li>\n * Plain <strong>Text</strong>\n * </c8y-li>\n * <c8y-li>\n * <c8y-li-icon [icon]=\"'rocket'\"></c8y-li-icon>\n * Icon\n * </c8y-li>\n * <c8y-li>\n * <c8y-li-radio></c8y-li-radio>\n * Radio\n * </c8y-li>\n * <c8y-li>\n * <c8y-li-checkbox></c8y-li-checkbox>\n * Checkbox\n * </c8y-li>\n * <c8y-li>\n * Content\n * <c8y-li-footer>\n * Footer\n * </c8y-li-footer>\n * </c8y-li>\n * <c8y-li>\n * Content\n * <c8y-li-action icon=\"rocket\">\n * Launch\n * </c8y-li-action>\n * </c8y-li>\n * <c8y-li>\n * Content\n * <c8y-li-collapse>\n * Collapsed content\n * </c8y-li-collapse>\n * </c8y-li>\n * </c8y-list-group>\n * ```\n */\n@Component({\n selector: 'c8y-list-group',\n templateUrl: './list-group.component.html',\n host: {\n class: 'c8y-list__group'\n }\n})\nexport class ListGroupComponent {\n /**\n * @ignore\n */\n @HostBinding('class.c8y-list--timeline')\n timeline: boolean = false;\n\n /**\n * Displays the current list as a timeline. Best used\n * with content projection.\n *\n * @example\n * ```html\n * <c8y-list-group>\n * <c8y-li-timeline>\n * 24.April 2020\n * <c8y-li>\n * Hello\n * </c8y-li>\n * </c8y-li-timeline>\n * </c8y-list-group>\n * ```\n */\n @ContentChild(ListItemTimelineComponent, { static: false })\n timelineComponent: ListItemTimelineComponent;\n\n /**\n * @ignore\n */\n ngAfterContentChecked(): void {\n this.timeline = !!this.timelineComponent;\n }\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * An icon to display on a list item. Use it with content projection.\n *\n * @example\n * ```html\n * <c8y-li>\n * <c8y-li-icon=\"rocket\"></c8y-li-icon>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-icon, c8y-li-icon',\n templateUrl: './list-item-icon.component.html',\n host: {\n class: 'c8y-list__item__icon'\n }\n})\nexport class ListItemIconComponent {\n /**\n * The icon name passed to the `c8yIcon` directive.\n */\n @Input()\n icon: string;\n\n /**\n * A status to change the color of the icon.\n */\n @Input()\n status?:\n | 'statusOk'\n | 'statusUnknown'\n | 'statusAlert'\n | 'statusNok'\n | 'status critical'\n | 'status warning'\n | 'status minor'\n | 'status major';\n}\n","import { Output, EventEmitter, Component, Input, SimpleChanges, forwardRef } from '@angular/core';\nimport { CheckboxControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * A component to display checkboxes in a c8y-li. Use it with content projection. It\n * can be used standalone or with an ngModel.\n *\n * @example\n * ```html\n * <c8y-li>\n * <c8y-li-checkbox></c8y-li-checkbox>\n * </c8y-li>\n * ```\n */\n@Component({\n selector: 'c8y-list-item-checkbox, c8y-li-checkbox',\n templateUrl: './list-item-checkbox.component.html',\n host: {\n class: 'c8y-list__item__check'\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n multi: true,\n useExisting: forwardRef(() => ListItemCheckboxComponent)\n }\n ]\n})\nexport class ListItemCheckboxComponent extends CheckboxControlValueAccessor {\n /**\n * Indicates if the checkbox is selected.\n */\n @Input()\n selected = false;\n /**\n * Indicates if the checkbox is disabled.\n */\n @Input()\n disabled = false;\n /**\n * An event emitted as soon as the checkbox is selected.\n */\n @Output()\n onSelect = new EventEmitter<boolean>();\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.selected && !changes.selected.firstChange) {\n this.onSelect.emit(changes.selected.currentValue);\n }\n }\n\n /**\n * Selects the checkbox.\n * @param value The value to pass.\n */\n select(value) {\n this.onSelect.emit(value);\n this.onChange(value);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ListGroupComponent } from './list-group.component';\nimport { ListItemComponent } from './list-item.component';\nimport { CommonModule } from '../common/common.module';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { CollapseModule } from 'ngx-bootstrap/collapse';\nimport { ListItemIconComponent } from './list-item-icon.component';\nimport { ListItemBodyComponent } from './list-item-body.component';\nimport { ListItemFooterComponent } from './list-item-footer.component';\nimport { ListItemActionComponent } from './list-item-action.component';\nimport { ListItemCollapseComponent } from './list-item-collapse.component';\nimport { ListItemCheckboxComponent } from './list-item-checkbox.component';\nimport { ListItemRadioComponent } from './list-item-radio.component';\nimport { ListItemTimelineComponent } from './list-item-timeline.component';\n\n/**\n * The list-group module allows you to compose different styles\n * of lists used in Cumulocity IoT. They can consist of plain\n * text, actions, icons and more.\n *\n * @example\n * ```html\n * <c8y-list-group>\n * <c8y-li>Item 1<c8y-li>\n * <c8y-li>Item 2<c8y-li>\n * </c8y-list-group>\n * ```\n */\n@NgModule({\n imports: [CommonModule, CollapseModule.forRoot(), BsDropdownModule],\n declarations: [\n ListGroupComponent,\n ListItemComponent,\n ListItemIconComponent,\n ListItemBodyComponent,\n ListItemFooterComponent,\n ListItemActionComponent,\n ListItemCollapseComponent,\n ListItemCheckboxComponent,\n ListItemRadioComponent,\n ListItemTimelineComponent\n ],\n exports: [\n ListGroupComponent,\n ListItemComponent,\n ListItemIconComponent,\n ListItemBodyComponent,\n ListItemFooterComponent,\n ListItemActionComponent,\n ListItemCollapseComponent,\n ListItemCheckboxComponent,\n ListItemRadioComponent,\n ListItemTimelineComponent\n ]\n})\nexport class ListGroupModule {}\n","import { Component, Input, OnInit } from '@angular/core';\nimport { AuditService, IAuditRecord, IResultList } from '@c8y/client';\n\n@Component({\n selector: 'c8y-audit-log',\n templateUrl: './audit-log.component.html'\n})\nexport class AuditLogComponent implements OnInit {\n @Input()\n source: string | number;\n\n records: IResultList<IAuditRecord>;\n\n constructor(private audit: AuditService) {}\n\n async ngOnInit() {\n if (this.source) {\n this.records = await this.audit.list({\n withTotalPages: true,\n source: this.source\n });\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { AuditLogComponent } from './audit-log.component';\n\n/** The angular module definition for audit log. */\n@NgModule({\n declarations: [AuditLogComponent],\n imports: [CommonModule],\n exports: [AuditLogComponent]\n})\nexport class AuditLogModule {}\n","/* tslint:disable:max-classes-per-file */\n\nimport { Directive, TemplateRef, Type } from '@angular/core';\n\nimport { Column } from '../data-grid.model';\n\nexport interface CellRendererDef {\n template: TemplateRef<any>;\n}\n\nexport interface CellRendererSpec {\n renderer: TemplateRef<CellRendererContext> | Type<any>;\n context: CellRendererContext;\n}\n\nexport class CellRendererContext {\n value: any;\n item?: any;\n property: Column;\n}\n\n@Directive({ selector: '[c8yCellRendererDef]' })\nexport class CellRendererDefDirective implements CellRendererDef {\n constructor(public template: TemplateRef<any>) {}\n}\n\n@Directive({ selector: '[c8yHeaderCellRendererDef]' })\nexport class HeaderCellRendererDefDirective implements CellRendererDef {\n constructor(public template: TemplateRef<any>) {}\n}\n","/* tslint:disable:max-classes-per-file */\n\nimport { Directive, TemplateRef, Type } from '@angular/core';\nimport { Column, FilterPredicateFunction } from '../data-grid.model';\n\nexport interface FilteringFormRendererSpec {\n renderer: TemplateRef<FilteringFormRendererContext> | Type<any>;\n context: FilteringFormRendererContext;\n}\n\nexport class FilteringFormRendererContext {\n property: Column;\n applyFilter: (filteringModifier: FilteringModifier) => void;\n resetFilter: () => void;\n}\n\nexport interface FilteringModifier {\n filterPredicate?: string | FilterPredicateFunction;\n externalFilterQuery?: string | object;\n}\n\n@Directive({ selector: '[c8yFilteringFormRendererDef]' })\nexport class FilteringFormRendererDefDirective {\n constructor(public template: TemplateRef<any>) {}\n}\n","import { ContentChild, Directive, Input } from '@angular/core';\n\nimport { CellRendererDefDirective, HeaderCellRendererDefDirective } from './cell-renderer';\nimport { FilteringFormRendererDefDirective } from './filtering-form-renderer';\n\n@Directive({ selector: 'c8y-column' })\nexport class ColumnDirective {\n @Input() name: string;\n\n @ContentChild(CellRendererDefDirective, { static: false })\n cellRendererDef: CellRendererDefDirective;\n\n @ContentChild(HeaderCellRendererDefDirective, { static: false })\n headerCellRendererDef: HeaderCellRendererDefDirective;\n\n @ContentChild(FilteringFormRendererDefDirective, { static: false })\n filteringFormRendererDef: FilteringFormRendererDefDirective;\n}\n","import { CollectionViewer, DataSource } from '@angular/cdk/collections';\nimport { IResultList } from '@c8y/client';\nimport { chunk, flow, get, isNil, mapValues, omitBy, orderBy, pick } from 'lodash-es';\nimport { BehaviorSubject, defer, from, isObservable, Observable, of, Subject } from 'rxjs';\nimport { catchError, finalize, map, switchMap, tap } from 'rxjs/operators';\nimport { Column, DataSourceStats, ServerSideDataResult } from './data-grid.model';\n\nexport class GridDataSource implements DataSource<object> {\n loading$: Observable<boolean>;\n data$: Observable<object[]>;\n stats$: Observable<DataSourceStats>;\n selection$: Observable<any>;\n resultList$: Observable<IResultList<object>>;\n\n private loadingSubject = new BehaviorSubject<boolean>(false);\n private dataSourceSubject = new BehaviorSubject<object[]>([]);\n private dataStatsSubject = new BehaviorSubject<DataSourceStats>({\n size: 0,\n filteredSize: 0,\n currentPage: 0,\n currentPageSize: 0,\n firstPageSize: 0\n });\n private dataSelectionSubject = new BehaviorSubject<any>({\n filteredDataIds: []\n });\n private resultListSubject = new Subject<IResultList<object>>();\n\n constructor() {\n this.loading$ = this.loadingSubject.asObservable();\n this.data$ = this.dataSourceSubject.asObservable();\n this.stats$ = this.dataStatsSubject.asObservable();\n this.selection$ = this.dataSelectionSubject.asObservable();\n this.resultList$ = this.resultListSubject.asObservable();\n }\n\n connect(collectionViewer: CollectionViewer): Observable<object[]> {\n return this.data$;\n }\n\n disconnect(collectionViewer: CollectionViewer): void {\n this.loadingSubject.complete();\n this.dataSourceSubject.complete();\n this.dataStatsSubject.complete();\n this.dataSelectionSubject.complete();\n }\n\n loadData({\n rows,\n columns,\n pagination,\n searchText,\n serverSideDataCallback,\n selectable,\n selectionPrimaryKey,\n infiniteScroll,\n reload = false\n }) {\n const clientSideData$ = this.toObservable(rows).pipe(\n map(initialData => {\n let filteredSize = 0;\n let filteredDataIds = [];\n\n const transformedData = flow(\n data => this.doClientSideSearch({ data, columns, searchText }),\n data => this.doClientSideFiltering({ data, columns }),\n data => this.doClientSideSorting({ data, columns }),\n data => {\n filteredSize = data.length;\n filteredDataIds = selectable\n ? data.map(item => item[selectionPrimaryKey])\n : filteredDataIds;\n\n return data;\n },\n data => this.doClientSidePagination({ data, pagination })\n )(initialData);\n\n this.dataStatsSubject.next({\n size: initialData.length,\n filteredSize,\n currentPage: pagination.currentPage,\n currentPageSize: transformedData.length,\n firstPageSize: pagination.pageSize\n });\n this.dataSelectionSubject.next({ filteredDataIds });\n\n return transformedData;\n })\n );\n\n const serverSideData$ = defer(() =>\n this.toObservable(\n serverSideDataCallback({\n columns,\n searchText,\n pagination,\n selection: { enabled: selectable, primaryKey: selectionPrimaryKey }\n })\n )\n ).pipe(\n map((result: ServerSideDataResult) => {\n const { data, paging, size, filteredSize, filteredDataIds } = result;\n\n this.dataStatsSubject.next({\n size,\n filteredSize,\n currentPage: paging.currentPage,\n currentPageSize: data.length,\n nextPage: paging.nextPage,\n firstPageSize: paging.pageSize\n });\n this.dataSelectionSubject.next({ filteredDataIds: filteredDataIds || [] });\n this.resultListSubject.next(result);\n\n return data;\n })\n );\n\n const data$ = typeof serverSideDataCallback === 'function' ? serverSideData$ : clientSideData$;\n\n of([])\n .pipe(\n tap(() => this.loadingSubject.next(true)),\n switchMap(() => data$),\n catchError(err => {\n this.dataStatsSubject.next({\n size: 0,\n filteredSize: 0,\n currentPage: 0,\n currentPageSize: 0,\n firstPageSize: 0\n });\n this.dataSelectionSubject.next({ filteredDataIds: [] });\n return of([]);\n }),\n finalize(() => this.loadingSubject.next(false))\n )\n .subscribe(result => {\n const data =\n infiniteScroll && !reload ? [...this.dataSourceSubject.value, ...result] : result;\n this.dataSourceSubject.next(data);\n });\n }\n\n resolveValue(x, path) {\n return get(x, path);\n }\n\n resolveFunction(x) {\n return typeof x === 'function' ? x() : x;\n }\n\n normalizeNil(x) {\n return isNil(x) ? '' : x;\n }\n\n private doClientSideFiltering({ data, columns }) {\n return columns.reduce((result, column) => {\n const { filterPredicate } = column;\n\n if (typeof filterPredicate === 'string') {\n return this.doClientSideSearch({\n data: result,\n columns: [column],\n searchText: filterPredicate\n });\n }\n\n if (typeof filterPredicate === 'function') {\n return result.filter(item => filterPredicate(item, column.path));\n }\n\n return result;\n }, data);\n }\n\n private doClientSideSearch({ data, columns, searchText }) {\n const propPaths = columns.map(({ path }) => path).filter(column => !isNil(column));\n\n const regexSearch = this.createRegexSearch(searchText);\n\n return data.filter(item => {\n const itemWithResolvedValues = flow(\n x => pick(x, propPaths),\n x => mapValues(x, this.resolveFunction),\n x => omitBy(x, isNil)\n )(item);\n\n const cellValues = Object.values(itemWithResolvedValues);\n\n return cellValues.some(cellValue => regexSearch.test(cellValue.toString()));\n });\n }\n\n private doClientSideSorting({ data, columns }) {\n const actives: Column[] = columns.filter(({ sortOrder }: Column) => !!sortOrder);\n\n const sortingState = {\n paths: actives.map(({ path }) => path),\n orders: actives.map(({ sortOrder }) => sortOrder)\n };\n\n return orderBy(data, sortingState.paths, sortingState.orders);\n }\n\n private doClientSidePagination({ data, pagination }) {\n return pagination\n ? get(chunk(data, pagination.pageSize), pagination.currentPage - 1, [])\n : data;\n }\n\n private createRegexSearch(filterValue) {\n return RegExp(escapeRegExpPattern(filterValue), 'i');\n }\n\n private toObservable(x): Observable<any> {\n return isObservable(x) ? x : x instanceof Promise ? from(x) : of(x);\n }\n}\n\n/**\n *\n * @param string pattern Regex pattern.\n * @return string The escaped regex.\n * @see https://stackoverflow.com/a/3561711/2013891\n */\nfunction escapeRegExpPattern(pattern = '') {\n return pattern.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n","import { IIdentified } from '@c8y/client';\n\nexport interface ISelectModalObject {\n groupId: string | number;\n body: ISelectModalBodyPart[];\n options: ISelectModalOption[];\n additionalInformation?: ISelectModalBodyPart;\n}\n\nexport interface ISelectModalOption {\n body: ISelectModalBodyPart[];\n obj: IIdentified;\n selected?: boolean;\n}\n\nexport interface ISelectModalBodyPart {\n value: string;\n class?: string;\n}\n\nexport interface ModalLabels {\n ok?: string;\n cancel?: string;\n}\n\nexport enum ModalSelectionMode {\n SINGLE = 'single',\n MULTI = 'multi'\n}\n","import { CdkHeaderCell } from '@angular/cdk/table';\nimport {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ComponentFactory,\n ComponentFactoryResolver,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n QueryList,\n ViewChild,\n ViewChildren,\n ViewContainerRef\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { IResultList, Paging } from '@c8y/client';\nimport { flow, get, parseInt as _parseInt, union, without } from 'lodash-es';\nimport { combineLatest, Subject } from 'rxjs';\nimport {\n debounceTime,\n distinctUntilChanged,\n first,\n mergeMap,\n take,\n takeUntil,\n tap\n} from 'rxjs/operators';\nimport { LoadMoreComponent } from '../common/load-more.component';\nimport { LoadMoreMode } from '../common/load-more.model';\nimport { gettext } from '../i18n/gettext';\nimport { CellRendererSpec } from './column/cell-renderer';\nimport { ColumnDirective } from './column/column.directive';\nimport { FilteringFormRendererSpec, FilteringModifier } from './column/filtering-form-renderer';\nimport {\n ActionControl,\n BuiltInActionType,\n BulkActionControl,\n Column,\n ColumnDataType,\n DataGrid,\n DataSourceStats,\n DisplayOptions,\n FilteringActionType,\n minColumnGridTrackSize,\n Pagination,\n ratiosByColumnTypes,\n Row,\n ServerSideDataCallback,\n SortOrder,\n SpecialColumnName,\n GridConfig\n} from './data-grid.model';\nimport { GridDataSource } from './grid-data-source';\n\n@Component({\n selector: 'c8y-data-grid',\n templateUrl: './data-grid.component.html'\n})\nexport class DataGridComponent implements DataGrid, OnChanges, AfterViewInit {\n @Input() title: string = gettext('Items');\n @Input() loadMoreItemsLabel: string = gettext('Load more items');\n @Input() loadingItemsLabel: string = gettext('Loading items…');\n @Input() noMatchingItemsLabel: string = gettext('No matching items.');\n @Input() refresh: EventEmitter<any>;\n\n columns: Column[];\n @Input('columns')\n set _columns(columns) {\n this.columns = columns || [];\n }\n\n dataSource = new GridDataSource();\n rows: Row[];\n @Input('rows')\n set _rows(rows) {\n this.rows = rows || [];\n }\n\n filteringLabelsParams = {\n filteredItemsCount: 0,\n allItemsCount: 0\n };\n\n pagination: Pagination;\n paginationLabelParams = {\n pageFirstItemIdx: 0,\n pageLastItemIdx: 0,\n itemsTotal: 0\n };\n readonly possiblePageSizes: number[] = [10, 15, 20, 30, 50];\n readonly minPossiblePageSize = Math.min(...this.possiblePageSizes);\n @Input('pagination')\n set _pagination(pagination) {\n this.pagination = pagination;\n const pageSize = get(this.pagination, 'pageSize');\n\n if (\n pageSize &&\n !this.possiblePageSizes.find(possiblePageSize => possiblePageSize === pageSize)\n ) {\n this.pagination = { ...this.pagination, pageSize: 10 };\n }\n }\n\n infiniteScroll: LoadMoreMode;\n @Input('infiniteScroll')\n set _infiniteScroll(infiniteScroll: LoadMoreMode) {\n this.infiniteScroll = infiniteScroll;\n }\n\n serverSideDataCallback: ServerSideDataCallback;\n @Input('serverSideDataCallback')\n set _serverSideDataCallback(serverSideDataCallback) {\n this.serverSideDataCallback = serverSideDataCallback;\n }\n\n selectable = false;\n @Input('selectable')\n set _selectable(selectable) {\n this.selectable = selectable;\n }\n\n selectionPrimaryKey = 'id';\n @Input('selectionPrimaryKey')\n set _selectionPrimaryKey(selectionPrimaryKey) {\n this.selectionPrimaryKey = selectionPrimaryKey;\n }\n\n displayOptions: DisplayOptions = {\n striped: true,\n bordered: false,\n gridHeader: true\n };\n @Input('displayOptions')\n set _displayOptions(displayOptions) {\n this.displayOptions = { ...this.displayOptions, ...displayOptions };\n }\n\n actionControls: ActionControl[];\n @Input('actionControls')\n set _actionControls(actionControls) {\n this.actionControls = actionControls || [];\n }\n\n bulkActionControls: BulkActionControl[];\n @Input('bulkActionControls')\n set _bulkActionControls(bulkActionControls) {\n this.bulkActionControls = bulkActionControls || [];\n }\n @Input() itemsSelectLimit: number;\n\n @Output() rowMouseOver = new EventEmitter<object>();\n @Output() rowMouseLeave = new EventEmitter<object>();\n @Output() rowClick = new EventEmitter<object>();\n @Output() onConfigChange = new EventEmitter<GridConfig>();\n\n @Output() itemsSelect = new EventEmitter<string[]>();\n\n @ContentChildren(ColumnDirective) columnRenderers: QueryList<ColumnDirective>;\n\n @ViewChild('scroll', { static: true }) scrollContainer: ElementRef;\n\n @ViewChild('infiniteScrollContainer', { static: false, read: ViewContainerRef })\n infiniteScrollContainer: ViewContainerRef;\n\n loadMoreComponent: LoadMoreComponent;\n\n columnNames = [];\n\n styles = {\n tableCursor: 'auto',\n gridTemplateColumns: undefined,\n gridInfiniteScrollColumn: undefined\n };\n\n searchText$ = new EventEmitter<string>();\n searchText = '';\n filteringApplied = false;\n totalPagesCount = Infinity;\n\n selectedItemIds: string[] = [];\n currentPageSelectionState = {\n allSelected: false,\n allDeselected: true\n };\n\n builtInActionType = {\n Edit: BuiltInActionType.Edit,\n Delete: BuiltInActionType.Delete,\n Export: BuiltInActionType.Export\n };\n\n resizeHandleMouseDown$ = new EventEmitter<any>();\n resizeHandleContainerMouseMove$ = new EventEmitter<any>();\n resizeHandleContainerMouseUp$ = new EventEmitter<any>();\n private headerBeingResized: {\n columnName: string;\n el: HTMLElement;\n };\n @ViewChildren(CdkHeaderCell, { read: ElementRef }) private thRefs: QueryList<ElementRef>;\n private thEls;\n\n private recreateLoadMoreComponent: boolean;\n\n private unsubscribe$ = new Subject<any>();\n\n constructor(\n private sanitizer: DomSanitizer,\n private hostRef: ElementRef,\n private cd: ChangeDetectorRef,\n private cfr: ComponentFactoryResolver\n ) {}\n\n ngOnInit() {\n this.searchText$\n .pipe(\n takeUntil(this.unsubscribe$),\n debounceTime(300),\n distinctUntilChanged(),\n tap(searchText => {\n this.searchText = searchText;\n })\n )\n .subscribe(() => {\n this.reload();\n });\n\n if (this.selectable) {\n combineLatest(this.dataSource.data$, this.itemsSelect.asObservable())\n .pipe(takeUntil(this.unsubscribe$))\n .subscribe(([data]) => {\n const currentPageEmpty = data.length === 0;\n\n this.currentPageSelectionState = {\n allSelected: currentPageEmpty ? false : data.every(item => this.isItemSelected(item)),\n allDeselected: currentPageEmpty ? true : data.every(item => !this.isItemSelected(item))\n };\n });\n }\n this.dataSource.stats$.pipe(takeUntil(this.unsubscribe$)).subscribe(stats => {\n this.createLoadMoreComponent(stats);\n this.updateFilteringLabelsParams(stats);\n this.updatePaginationLabelParams(stats);\n });\n\n if (this.refresh) {\n this.refresh.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {\n this.cancel();\n this.reload();\n });\n }\n }\n\n ngOnChanges() {\n this.updateColumns();\n this.loadData();\n }\n\n ngAfterViewInit() {\n this.updateGridColumnsSize();\n this.thEls = this.thRefs.toArray().map(({ nativeElement }) => nativeElement);\n this.setupResizeHandle();\n }\n\n ngOnDestroy() {\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n\n trackByName(index, item) {\n return item.name;\n }\n\n resolveCellValue(row, path) {\n return flow([\n x => this.dataSource.resolveValue(x, path),\n this.dataSource.resolveFunction,\n this.dataSource.normalizeNil\n ])(row);\n }\n\n changeSortOrder(columnName) {\n const column = this.columns.find(({ name }) => name === columnName);\n\n if (column) {\n const { sortOrder } = column;\n\n if (!sortOrder) {\n this.updateSorting([columnName], 'asc');\n } else if (sortOrder === 'asc') {\n this.updateSorting([columnName], 'desc');\n } else {\n this.updateSorting([columnName], '');\n }\n }\n }\n\n updateSorting(columnNames: string[], sortOrder: SortOrder) {\n this.columns = this.columns.map(\n (column): Column => {\n if (columnNames.includes(column.name)) {\n return { ...column, sortOrder };\n }\n\n return column;\n }\n );\n this.emitConfigChange();\n this.reload();\n }\n\n applyFilter(columnName, dropdown, filteringModifier) {\n this.updateFiltering([columnName], {\n type: FilteringActionType.ApplyFilter,\n payload: { filteringModifier }\n });\n dropdown.hide();\n }\n\n resetFilter(columnName, dropdown) {\n this.updateFiltering([columnName], { type: FilteringActionType.ResetFilter });\n dropdown.hide();\n }\n\n clearFilters() {\n this.updateFiltering(this.columns.map(({ name }) => name), {\n type: FilteringActionType.ResetFilter\n });\n }\n\n updateFiltering(\n columnNames: string[],\n action: {\n type: FilteringActionType;\n payload?: { filteringModifier: FilteringModifier };\n }\n ) {\n this.columns = this.columns.map(column => {\n if (columnNames.includes(column.name)) {\n return {\n ...column,\n ...(action.type === FilteringActionType.ApplyFilter\n ? action.payload.filteringModifier\n : { filterPredicate: undefined, externalFilterQuery: undefined })\n };\n }\n\n return column;\n });\n\n this.updateFilteringApplied();\n this.reload();\n }\n\n updateFilteringApplied() {\n this.filteringApplied = this.columns.some(this.isColumnFilteringApplied);\n }\n\n isColumnFilteringApplied(column: Column): boolean {\n const { filterable, filterPredicate, externalFilterQuery } = column;\n\n return !!(filterable && (filterPredicate || externalFilterQuery));\n }\n\n updatePagination({ itemsPerPage, page }) {\n this.pagination = { ...this.pagination, pageSize: itemsPerPage, currentPage: page };\n this.loadData();\n this.emitConfigChange();\n }\n\n reload() {\n this.pagination = { ...this.pagination, currentPage: 1 };\n this.recreateLoadMoreComponent = true;\n this.loadData(true);\n this.scrollToTop();\n }\n\n loadNextPage(): Promise<IResultList<object>> {\n this.pagination = { ...this.pagination, currentPage: this.pagination.nextPage };\n\n this.loadData();\n\n return this.dataSource.resultList$\n .pipe(take(1)) // in order for `toPromise` to work, the observable needs to complete\n .toPromise()\n .then(result => {\n return {\n ...result,\n paging: {\n ...result.paging,\n next: this.loadNextPage.bind(this)\n }\n } as IResultList<object>;\n });\n }\n\n getCellRendererSpec({ value, row, columnName }): CellRendererSpec {\n return this._getCellRendererSpec({ type: 'CELL', value, row, columnName });\n }\n\n getHeaderCellRendererSpec({ value, columnName }): CellRendererSpec {\n return this._getCellRendererSpec({ type: 'HEADER', value, row: undefined, columnName });\n }\n\n getFilteringFormRendererSpec({ column, dropdown }): FilteringFormRendererSpec {\n return {\n renderer:\n get(this.getColumnRenderer(column), 'filteringFormRendererDef.template') ||\n column.filteringFormRendererComponent,\n context: {\n property: column,\n applyFilter: this.applyFilter.bind(this, column.name, dropdown),\n resetFilter: this.resetFilter.bind(this, column.name, dropdown)\n }\n };\n }\n\n setAllItemsSelected(selected) {\n this.dataSource.selection$\n .pipe(first())\n .subscribe(({ filteredDataIds }) => this.setItemsSelected(filteredDataIds, selected));\n }\n\n setAllItemsInCurrentPageSelected(selected) {\n this.dataSource.data$.pipe(first()).subscribe(data => this.setItemsSelected(data, selected));\n }\n\n setItemsSelected(items: any[], selected) {\n const itemIds = items.map((item: object | string) =>\n typeof item === 'object' ? item[this.selectionPrimaryKey] : item\n );\n\n this.selectedItemIds = selected\n ? union(this.selectedItemIds, itemIds)\n : without(this.selectedItemIds, ...itemIds);\n\n this.itemsSelect.emit(this.selectedItemIds);\n }\n\n cancel() {\n this.selectedItemIds = [];\n this.itemsSelect.emit(this.selectedItemIds);\n }\n\n isItemSelected(item) {\n return this.selectedItemIds.includes(item[this.selectionPrimaryKey]);\n }\n\n onColumnDrop({ previousIndex, currentIndex }) {\n const differentIndex = previousIndex !== currentIndex;\n\n if (differentIndex) {\n const column = this.columns.splice(previousIndex, 1);\n this.columns.splice(currentIndex, 0, column[0]);\n }\n\n this.updateColumnNames();\n this.updateGridColumnsSize();\n }\n\n updateGridColumnsSize() {\n this.styles = {\n ...this.styles,\n gridTemplateColumns: this.sanitizer.bypassSecurityTrustStyle(\n this.columns\n .filter(column => column.visible)\n .map(({ gridTrackSize }) => gridTrackSize)\n .join(' ')\n ),\n gridInfiniteScrollColumn: this.sanitizer.bypassSecurityTrustStyle(\n `1 / span ${this.columns.filter(column => column.visible).length}`\n )\n };\n\n this.emitConfigChange();\n }\n\n private emitConfigChange() {\n const columns = this.columns.map(({ visible, sortOrder }) => ({ visible, sortOrder }));\n this.onConfigChange.emit({ columns, pagination: this.pagination });\n }\n\n private updateColumns() {\n const specialColumn = {\n gridTrackSize: '42px',\n sortable: false,\n positionFixed: true\n };\n\n this.columns = [\n this.selectable ? { ...specialColumn, name: SpecialColumnName.Checkbox } : undefined,\n ...this.columns,\n this.actionControls.length > 0\n ? { ...specialColumn, name: SpecialColumnName.Actions }\n : undefined\n ]\n .filter(Boolean)\n .map(this.withColumnDefaults);\n\n this.updateColumnNames();\n this.updateGridColumnsSize();\n this.updateFilteringApplied();\n }\n\n private withColumnDefaults(column): Column {\n const dataType = column.dataType || ColumnDataType.TextShort;\n const { headerCSSClassName, cellCSSClassName } = column;\n\n return {\n visible: true,\n positionFixed: false,\n sortable: true,\n sortOrder: '',\n filterable: false,\n ...column,\n dataType,\n gridTrackSize:\n column.gridTrackSize ||\n `minmax(${minColumnGridTrackSize}px, ${ratiosByColumnTypes[dataType]}fr)`,\n headerCSSClassName:\n (typeof headerCSSClassName === 'string'\n ? headerCSSClassName.split(' ')\n : headerCSSClassName) || [],\n cellCSSClassName:\n (typeof cellCSSClassName === 'string' ? cellCSSClassName.split(' ') : cellCSSClassName) ||\n []\n };\n }\n\n private updateColumnNames() {\n this.columnNames = this.columns.map(({ name }) => name);\n }\n\n private setupResizeHandle() {\n const resizeHandleDrag$ = this.resizeHandleMouseDown$.pipe(\n takeUntil(this.unsubscribe$),\n tap(() => this.clearMouseHighlights()),\n mergeMap(({ event, targetColumnName }) => {\n this.columns = this.columns.map(column => {\n if (column.name === targetColumnName) {\n return {\n ...column,\n headerCSSClassName: union(column.headerCSSClassName, ['header--being-resized'])\n };\n }\n\n return column;\n });\n\n this.headerBeingResized = {\n columnName: targetColumnName,\n el: event.target.parentNode\n };\n\n this.styles = {\n ...this.styles,\n tableCursor: 'col-resize'\n };\n\n return this.resizeHandleContainerMouseMove$.pipe(\n tap(() => this.clearMouseHighlights()),\n takeUntil(this.resizeHandleContainerMouseUp$)\n );\n })\n );\n\n resizeHandleDrag$.subscribe(event => {\n requestAnimationFrame(() => {\n this.columns = this.columns.map((column, i) => {\n if (column.name === this.headerBeingResized.columnName) {\n const wrapper = this.hostRef.nativeElement;\n\n // Read wrapper's offset left relative to the document.\n const horizontalOffset = wrapper.getBoundingClientRect().left;\n\n // Adjust with the wrapper horizontal scroll position.\n const horizontalScrollOffset = wrapper.scrollLeft - horizontalOffset;\n\n // Calculate the desired width.\n const width =\n horizontalScrollOffset + event.clientX - (this.headerBeingResized.el.offsetLeft || 0);\n\n return {\n ...column,\n // Update the column object with the new size value, enforce our minimum size.\n gridTrackSize: `${Math.max(minColumnGridTrackSize, width)}px`\n };\n }\n\n // For the other headers which don't have a set width, fix it to their computed width.\n if (column.gridTrackSize.startsWith('minmax')) {\n return {\n ...column,\n // isn't fixed yet (it would be a px value)\n gridTrackSize: `${_parseInt(this.thEls[i].clientWidth)}px`\n };\n }\n\n return column;\n });\n\n /*\n * Update the column sizes.\n * Note: grid-template-columns sets the width for all columns in one value.\n */\n this.updateGridColumnsSize();\n });\n });\n\n this.resizeHandleContainerMouseUp$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {\n if (this.headerBeingResized) {\n this.columns = this.columns.map(column => {\n if (column.name === this.headerBeingResized.columnName) {\n return {\n ...column,\n headerCSSClassName: without(column.headerCSSClassName, 'header--being-resized')\n };\n }\n\n return column;\n });\n this.headerBeingResized = undefined;\n\n this.styles = {\n ...this.styles,\n tableCursor: 'auto'\n };\n }\n });\n }\n\n private clearMouseHighlights() {\n if (window.getSelection) {\n window.getSelection().removeAllRanges();\n }\n }\n\n private _getCellRendererSpec({ type, value, row, columnName }): CellRendererSpec {\n const column = this.columns.find(({ name }) => name === columnName);\n const columnRenderer = this.getColumnRenderer(column);\n const rendererTemplate = get(\n columnRenderer,\n `${type === 'HEADER' ? 'headerCellRendererDef' : 'cellRendererDef'}.template`\n );\n\n const { cellRendererComponent, headerCellRendererComponent } = column;\n const rendererComponent =\n type === 'HEADER' ? headerCellRendererComponent : cellRendererComponent;\n\n return {\n renderer: rendererTemplate || rendererComponent,\n context: {\n value,\n item: row,\n property: column\n }\n };\n }\n\n private getColumnRenderer(column): ColumnDirective {\n return this.columnRenderers.toArray().find(({ name }) => name === column.name);\n }\n\n private loadData(reload: boolean = false) {\n const {\n rows,\n columns,\n pagination,\n searchText,\n serverSideDataCallback,\n selectable,\n selectionPrimaryKey,\n infiniteScroll\n } = this;\n\n this.dataSource.loadData({\n rows,\n columns,\n pagination,\n searchText,\n serverSideDataCallback,\n selectable,\n selectionPrimaryKey,\n infiniteScroll,\n reload\n });\n }\n\n private updateFilteringLabelsParams(stats: DataSourceStats) {\n this.filteringLabelsParams = {\n filteredItemsCount: stats.filteredSize,\n allItemsCount: stats.size\n };\n }\n\n private updatePaginationLabelParams(stats: DataSourceStats) {\n this.pagination.nextPage = stats.nextPage;\n const pageFirstItemIdx = (stats.currentPage - 1) * stats.firstPageSize + 1;\n this.paginationLabelParams = {\n pageFirstItemIdx,\n pageLastItemIdx: pageFirstItemIdx + (stats.currentPageSize - 1),\n itemsTotal: stats.filteredSize\n };\n }\n\n private createLoadMoreComponent(stats: DataSourceStats) {\n if (\n this.infiniteScroll &&\n stats &&\n stats.nextPage &&\n (!this.loadMoreComponent || this.recreateLoadMoreComponent)\n ) {\n this.recreateLoadMoreComponent = false;\n this.infiniteScrollContainer.clear();\n const componentFactory: ComponentFactory<any> = this.cfr.resolveComponentFactory(\n LoadMoreComponent\n );\n const componentRef = this.infiniteScrollContainer.createComponent(componentFactory);\n const instance = componentRef.instance as LoadMoreComponent;\n instance.useIntersection = this.infiniteScroll === 'auto' || this.infiniteScroll === 'hidden';\n instance.hidden = this.infiniteScroll === 'hidden';\n instance.paging = {\n nextPage: stats.nextPage,\n next: this.loadNextPage.bind(this)\n } as Paging<any>;\n instance.loadNextLabel = this.loadMoreItemsLabel;\n instance.loadingLabel = this.loadingItemsLabel;\n this.loadMoreComponent = instance;\n } else if (this.loadMoreComponent && !stats.nextPage) {\n this.loadMoreComponent.paging = {\n nextPage: null\n } as Paging<any>;\n }\n }\n\n private scrollToTop() {\n if (this.infiniteScroll) {\n this.scrollContainer.nativeElement.scrollTop = 0;\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DoCheck,\n Injector,\n Input,\n OnChanges,\n TemplateRef,\n Type\n} from '@angular/core';\n\nimport { CellRendererContext, CellRendererSpec } from './cell-renderer';\n\n@Component({\n selector: 'c8y-cell-renderer',\n templateUrl: './cell-renderer.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CellRendererComponent implements OnChanges, DoCheck {\n spec: CellRendererSpec;\n @Input('spec')\n set _spec(spec: CellRendererSpec) {\n this.spec = spec;\n }\n prevSpec: CellRendererSpec;\n\n rendererType: 'TEMPLATE' | 'COMPONENT';\n rendererInjector: Injector;\n\n constructor(private injector: Injector, private cd: ChangeDetectorRef) {}\n\n ngOnChanges() {\n if (!this.prevSpec) {\n this.prevSpec = this.spec;\n }\n\n const { renderer } = this.spec;\n\n if (renderer instanceof TemplateRef) {\n this.rendererType = 'TEMPLATE';\n } else if (renderer instanceof Type) {\n this.rendererType = 'COMPONENT';\n\n this.rendererInjector = Injector.create({\n providers: [{ provide: CellRendererContext, useValue: this.spec.context }],\n parent: this.injector\n });\n }\n }\n\n ngDoCheck() {\n if (!this.spec.context.value === this.prevSpec.context.value) {\n this.prevSpec = this.spec;\n this.cd.markForCheck();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DoCheck,\n Injector,\n Input,\n OnChanges,\n TemplateRef,\n Type\n} from '@angular/core';\nimport { isEqual } from 'lodash-es';\n\nimport { FilteringFormRendererContext, FilteringFormRendererSpec } from './filtering-form-renderer';\n\n@Component({\n selector: 'c8y-filtering-form-renderer',\n templateUrl: './filtering-form-renderer.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FilteringFormRendererComponent implements OnChanges {\n spec: FilteringFormRendererSpec;\n @Input('spec')\n set _spec(spec: FilteringFormRendererSpec) {\n this.spec = spec;\n }\n\n rendererType: 'TEMPLATE' | 'COMPONENT';\n rendererInjector: Injector;\n defaultRendererFilterText = '';\n\n constructor(private injector: Injector, private cd: ChangeDetectorRef) {}\n\n ngOnChanges() {\n const { renderer, context } = this.spec;\n\n if (renderer instanceof TemplateRef) {\n this.rendererType = 'TEMPLATE';\n } else if (renderer instanceof Type) {\n this.rendererType = 'COMPONENT';\n\n this.rendererInjector = Injector.create({\n providers: [{ provide: FilteringFormRendererContext, useValue: this.spec.context }],\n parent: this.injector\n });\n }\n\n const { filterPredicate } = context.property;\n if (typeof filterPredicate === 'string') {\n this.defaultRendererFilterText = filterPredicate;\n }\n }\n}\n","import { CdkTableModule } from '@angular/cdk/table';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { PaginationModule } from 'ngx-bootstrap/pagination';\nimport { CommonModule as C8YCommonModule } from '../common/common.module';\nimport { DataGridComponent } from './data-grid.component';\nimport { ColumnDirective } from './column/column.directive';\nimport { CellRendererDefDirective, HeaderCellRendererDefDirective } from './column/cell-renderer';\nimport { CellRendererComponent } from './column/cell-renderer.component';\nimport { FilteringFormRendererDefDirective } from './column/filtering-form-renderer';\nimport { FilteringFormRendererComponent } from './column/filtering-form-renderer.component';\n\n@NgModule({\n imports: [\n CommonModule,\n CdkTableModule,\n DragDropModule,\n FormsModule,\n ReactiveFormsModule,\n C8YCommonModule,\n BsDropdownModule.forRoot(),\n PopoverModule.forRoot(),\n PaginationModule.forRoot()\n ],\n declarations: [\n CellRendererDefDirective,\n HeaderCellRendererDefDirective,\n CellRendererComponent,\n FilteringFormRendererDefDirective,\n FilteringFormRendererComponent,\n ColumnDirective,\n DataGridComponent\n ],\n exports: [\n CellRendererDefDirective,\n HeaderCellRendererDefDirective,\n FilteringFormRendererDefDirective,\n ColumnDirective,\n DataGridComponent\n ],\n entryComponents: [DataGridComponent]\n})\nexport class DataGridModule {}\n","import { Component, ElementRef, Input, ViewChild } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { AppStateService } from '../common/ui-state.service';\nimport { DocsService } from '../docs/docs.service';\n\n/**\n * A component which shows a context help in\n * the action bar.\n *\n * @example\n * ```html\n * <c8y-help src=\"/users-guide/cockpit/#dashboards\"></c8y-help>\n * ```\n */\n@Component({\n selector: 'c8y-help',\n templateUrl: './help.component.html'\n})\nexport class HelpComponent {\n /**\n * The source of the documentation. Used to link to the documentation as well as\n * to parse the source to display.\n */\n @Input()\n src: string = '';\n\n /**\n * Indicates if the help dialog is collapsed.\n */\n @Input()\n isCollapsed = true;\n\n /**\n * The priority where the help icon should be shown in the action bar\n */\n @Input()\n priority = Infinity;\n\n /**\n * An custom icon. If not set, the navigator icon is resolved\n */\n @Input()\n icon;\n\n /**\n * An title. Set in open by passing the source.\n */\n title = '';\n\n /**\n * The content. Set in open by passing the source.\n */\n content = [];\n\n /**\n * Indicates if the component is loading.\n */\n isLoading = true;\n\n /**\n * Indicates if the component failed loading the source.\n */\n hasError = false;\n\n /**\n * An view child to which the parsed content is appended.\n */\n @ViewChild('helpContent', { static: false, read: ElementRef })\n helpContent: ElementRef;\n\n private readonly SUPPORTED_LANGUAGES = ['en'];\n\n /**\n * Identifies if the current user language is supported\n * Currently only English is supported.\n */\n get isSupportedLanguage() {\n return this.SUPPORTED_LANGUAGES.indexOf(this.translateService.currentLang) > -1;\n }\n\n /**\n * @ignore Only private DI\n */\n constructor(\n private docsService: DocsService,\n private appState: AppStateService,\n private translateService: TranslateService\n ) {}\n\n /**\n * Builds the URL based on the src. The Base URL can be set in the application options docBaseUrl.\n * @param src The source of the help on the guide.\n */\n getUrl(src = '') {\n const version = this.parseVersion(this.appState.uiVersion);\n const url = this.docsService.getBaseUrl();\n return `${url}${url.endsWith('/') ? '' : '/'}${version}${\n src.startsWith('/') ? src : `/${src}`\n }`;\n }\n\n /**\n * Toggles the visibility of the help dialog.\n */\n toggle() {\n if (this.isCollapsed) {\n this.open();\n return;\n }\n this.close();\n }\n\n /**\n * Closes the help dialog.\n */\n close() {\n this.isCollapsed = true;\n this.clean();\n }\n\n /**\n * Opens the help dialog.\n */\n open() {\n this.isCollapsed = false;\n this.isLoading = true;\n this.requestContent();\n if (!this.icon) {\n this.icon = this.resolveIcon();\n }\n }\n\n /**\n * @ignore\n */\n ngAfterContentChecked(): void {\n if (this.content.length > 0 && this.helpContent) {\n this.content.forEach(ele => {\n this.helpContent.nativeElement.append(ele);\n });\n }\n }\n\n private requestContent() {\n const req = new XMLHttpRequest();\n req.onreadystatechange = () => this.render(req);\n req.addEventListener('load', () => this.render(req));\n req.open('GET', this.getUrl(this.src));\n req.responseType = 'document';\n req.setRequestHeader('Accept', 'text/html');\n req.send();\n }\n\n private clean() {\n this.title = '';\n this.isLoading = true;\n this.hasError = false;\n this.content = [];\n if (this.helpContent) {\n (this.helpContent.nativeElement as HTMLElement).innerHTML = '';\n }\n }\n\n private parseVersion(uiVersion) {\n const version = uiVersion.split('.')[0];\n const majorNumber = Math.floor(parseInt(version, 10) / 100);\n const minorNumber = parseInt(version, 10) - majorNumber * 100;\n return `${majorNumber}.${minorNumber}.0`;\n }\n\n private resolveIcon() {\n try {\n const icon = Array.from(document.querySelector('nav .active i').classList).find(\n classes => classes.startsWith('c8y-') || classes.startsWith('fa-')\n );\n return icon.replace('fa-', '');\n } catch (ex) {\n return 'question-circle-o';\n }\n }\n\n private render(req: XMLHttpRequest) {\n if (req.readyState === 4) {\n this.isLoading = false;\n if (req.status === 200) {\n const sectionSplit = this.src.split('#');\n\n // TODO: change here the selectors when DOC team defined the section element\n const sectionQuery = `#${sectionSplit[sectionSplit.length - 1]} h2`;\n const sectionNode = req.response.querySelector(sectionQuery) as HTMLElement;\n const allPossibleElementsToAttach = Array.from(sectionNode.parentElement.children).slice(1);\n this.title = sectionNode.innerText.trim();\n\n for (const ele of allPossibleElementsToAttach) {\n if (ele.tagName.toLowerCase() === 'h3') {\n break;\n }\n this.content.push(ele);\n }\n } else {\n this.hasError = true;\n }\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { CollapseModule } from 'ngx-bootstrap/collapse';\nimport { HelpComponent } from './help.component';\nimport { ActionBarModule } from '../action-bar/action-bar.module';\n\n/**\n * Provides components which allow to display help elements\n * inside the app.\n * @exports HelpComponent A component which shows a context help in\n * the action bar.\n */\n@NgModule({\n declarations: [HelpComponent],\n imports: [CommonModule, CollapseModule.forRoot(), ActionBarModule],\n exports: [HelpComponent],\n providers: []\n})\nexport class HelpModule {}\n","import { Component, Input } from '@angular/core';\nimport { RealtimeService } from './realtime.service';\n\n@Component({\n selector: 'c8y-realtime-btn',\n templateUrl: './realtime-button.component.html'\n})\nexport class RealtimeButtonComponent {\n @Input()\n service: RealtimeService<any>;\n\n get active(): boolean {\n return !!this.service && this.service.active;\n }\n\n toggle() {\n if (this.service) {\n this.active ? this.service.stop() : this.service.start();\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { RealtimeButtonComponent } from './realtime-button.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [RealtimeButtonComponent],\n exports: [RealtimeButtonComponent]\n})\nexport class RealtimeModule {}\n","import { Component, Input, EventEmitter, SimpleChanges, Output } from '@angular/core';\nimport { gettext } from '../i18n/gettext';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport {\n ISelectModalObject,\n ModalSelectionMode,\n ModalLabels\n} from './select-modal.model';\nimport { assign } from 'lodash-es';\nimport { Subject } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { IIdentified } from '@c8y/client';\n\ninterface ISelectModalInternalObject extends ISelectModalObject {\n selectedId: string | number;\n}\n\n@Component({\n selector: 'c8y-select-modal',\n templateUrl: './select-modal.component.html'\n})\nexport class SelectModalComponent {\n @Input() icon: string;\n @Input() title: string;\n @Input() subTitle: string = gettext('Select from the list of items matching the device type');\n @Input() items: ISelectModalInternalObject[];\n @Input() mode: ModalSelectionMode = ModalSelectionMode.MULTI;\n @Input() disableSelected: boolean = true;\n @Input() showFilter: boolean = true;\n @Input() areMoreEntries: boolean = false;\n @Input() set labels(labels: ModalLabels) {\n const { ok = this.labels.ok, cancel = this.labels.cancel } = labels || {};\n this._labels = { ok, cancel };\n }\n get labels(): ModalLabels {\n return this._labels;\n }\n @Output() result: EventEmitter<IIdentified[]> = new EventEmitter<IIdentified[]>();\n @Output() search: EventEmitter<string> = new EventEmitter<string>();\n selected = false;\n filterTerm: string = '';\n listItems = [];\n private debouncer: Subject<string> = new Subject<string>();\n private _labels: ModalLabels = { ok: gettext('Confirm'), cancel: gettext('Cancel') };\n\n constructor(private bsModalRef: BsModalRef) {\n this.debouncer.pipe(debounceTime(500)).subscribe(value => {\n this.search.emit(value);\n });\n }\n\n async ngOnChanges(changes: SimpleChanges) {\n if (changes.items && changes.items.currentValue) {\n const itemsPromise = changes.items.currentValue.map(async item => {\n item.options = await item.options;\n const selected = item.options.find(option => option.selected);\n if (selected) {\n item.selectedId = selected.obj.id;\n if (this.disableSelected) {\n item.options.map(option => assign(option, { disabled: true }));\n }\n }\n return item;\n });\n this.listItems = await Promise.all(itemsPromise);\n }\n }\n\n updatePipe(filterTerm: string) {\n this.debouncer.next(filterTerm);\n this.filterTerm = filterTerm;\n }\n\n updateChoice({ item, id }) {\n if (this.mode === 'single') {\n this.listItems.map(value => (value.selectedId = undefined));\n }\n item.selectedId = id;\n this.selected = true;\n }\n\n dismiss() {\n this.bsModalRef.hide();\n }\n\n select() {\n this.result.emit(this.getOutput());\n this.bsModalRef.hide();\n }\n\n ngOnDestroy() {\n this.debouncer.complete();\n this.result.complete();\n this.search.complete();\n }\n\n private getOutput(): IIdentified[] {\n return this.listItems\n .filter(item => item.selectedId)\n .map(item => item.options.find(option => item.selectedId === option.obj.id))\n .filter(option => !option.selected)\n .map(selectedOption => selectedOption.obj);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { ISelectModalObject } from './select-modal.model';\n\n@Pipe({\n name: 'selectModalFilterPipe',\n})\nexport class SelectModalFilterPipe implements PipeTransform {\n transform(items: ISelectModalObject[], filterTerm: string): any {\n return filterTerm.trim().length === 0\n ? items\n : items.filter((item: ISelectModalObject) => {\n const allValues = this.extractValues(item);\n const filteredValues = allValues.filter((value) => this.filterContainString(value, filterTerm));\n return filteredValues.length > 0;\n });\n }\n\n private filterContainString(value: string, filterTerm: string) {\n const term = filterTerm.toLowerCase().trim();\n return value && value.toLowerCase().indexOf(term) > -1;\n }\n\n private extractValues(item) {\n let values = [];\n if ( item.value ) {\n values.push(item.value);\n }\n Object.keys(item).forEach((key) => {\n if (Array.isArray(item[key])) {\n item[key].forEach( obj => values.concat(this.extractValues(obj)) );\n }\n if (item[key] instanceof Object) {\n values = values.concat(this.extractValues(item[key]));\n }\n });\n return values;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { CommonModule } from '../common/common.module';\nimport { ListGroupModule } from '../list-group/list-group.module';\nimport { FormsModule } from '../forms/forms.module';\nimport { SelectModalComponent } from './select-modal.component';\nimport { SelectModalFilterPipe } from './select-modal-filter.pipe';\nimport { SearchModule } from '../search/search.module';\n\n@NgModule({\n imports: [\n BsDropdownModule.forRoot(),\n CommonModule,\n ListGroupModule,\n SearchModule,\n FormsModule\n ],\n exports: [\n SelectModalComponent,\n SelectModalFilterPipe\n ],\n declarations: [\n SelectModalComponent,\n SelectModalFilterPipe\n ]\n})\nexport class SelectModalModule { }\n","import { BsDropdownDirective } from 'ngx-bootstrap/dropdown';\nimport { gettext } from '../i18n/gettext';\nimport {\n Component,\n EventEmitter,\n HostListener,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\n\nexport interface Item {\n name: string;\n _selected?: boolean;\n [key: string]: any;\n}\n\nexport type selectedFunction = (item: Item) => boolean;\nexport type selectedLabelFunction = (items: Item[]) => string;\n\n@Component({\n selector: 'c8y-select',\n templateUrl: './select.component.html'\n})\nexport class SelectComponent implements OnChanges {\n @Input() placeholder: string = gettext('Select item');\n @Input() selectedLabel: string | selectedLabelFunction;\n @Input() applyLabel: string = gettext('Apply');\n @Input() items: Item[];\n @Input() selected: Item[] | selectedFunction;\n @Output() onChange: EventEmitter<Item[]> = new EventEmitter();\n @ViewChild(BsDropdownDirective, { static: false }) dropdown: BsDropdownDirective;\n textFilter = '';\n labelText = '';\n isOpen = false;\n filteredItems: Item[] = [];\n searchFilter = null;\n readonly sizeToShowFilter: number = 5;\n labelsForSelectAll: any = {\n all: gettext('All'),\n allFiltered: gettext('All filtered')\n };\n showAllLabel = false;\n private itemsSelected: Set<Item> = new Set();\n private stopClicks = false;\n\n @HostListener('click', ['$event'])\n preventClick(evt) {\n if (this.stopClicks) {\n evt.stopPropagation();\n }\n this.stopClicks = this.isOpen;\n }\n\n isOpenChange(isOpen: boolean) {\n this.isOpen = isOpen;\n if (isOpen) {\n this.updateSelected();\n this.searchFilter = null;\n } else {\n this.stopClicks = false;\n }\n }\n\n outterSelected(item: Item) {\n const { selected } = this;\n let isSelected: any = () => false;\n if (typeof selected === 'function') {\n isSelected = selected;\n } else if (Array.isArray(selected)) {\n isSelected = (i: Item) => selected.indexOf(i) > -1;\n }\n return isSelected(item);\n }\n\n isSelected(item: Item) {\n return this.itemsSelected.has(item);\n }\n\n isAllItemsSelected() {\n return this.itemsSelected.size === this.items.length;\n }\n\n isAllFilteredSelected() {\n return this.itemsSelected.size === this.filteredItems.length;\n }\n\n applyChanges() {\n const selected = Array.from(this.itemsSelected.values());\n this.onChange.emit(selected);\n this.dropdown.hide();\n }\n\n selectAll(checked: boolean) {\n this.filteredItems.forEach(item => this.onChangeItem(checked, item));\n }\n\n onChangeItem(checked: boolean, item: Item) {\n if (checked) {\n this.itemsSelected.add(item);\n } else {\n this.itemsSelected.delete(item);\n }\n }\n\n updateFiltered(term: string) {\n if (term) {\n const search = new RegExp(term, 'i');\n this.filteredItems = this.items.filter(({ name }) => search.test(name));\n } else {\n this.filteredItems = this.items;\n }\n }\n\n getSelectAllToggleStatus() {\n const label = this.getLabel();\n const checked = this.isAllSelected();\n const indeterminate = !checked && this.itemsSelected.size > 0;\n\n return { label, checked, indeterminate};\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (this.isOpen) {\n return;\n }\n if (changes.items || changes.selected || changes.applyLabel) {\n this.updateSelected();\n this.updateLabel();\n this.showAllLabel = this.isAllItemsSelected();\n }\n }\n\n private updateLabel() {\n const outterSelected = this.items.filter(i => this.outterSelected(i));\n if (typeof this.selectedLabel === 'string') {\n this.labelText = this.selectedLabel;\n } else if (typeof this.selectedLabel === 'function') {\n this.labelText = this.selectedLabel(outterSelected);\n } else {\n this.labelText = outterSelected.map(({ name }) => name).join(', ');\n }\n }\n\n private updateSelected() {\n const { itemsSelected, items } = this;\n itemsSelected.clear();\n items.forEach(item => {\n if (this.outterSelected(item)) {\n itemsSelected.add(item);\n }\n });\n this.filteredItems = items;\n }\n\n private isAllSelected() {\n if (this.getLabel() === this.labelsForSelectAll.allFiltered) {\n return this.isAllFilteredSelected();\n } else {\n return this.isAllItemsSelected();\n }\n }\n\n private getLabel() {\n return this.searchFilter ? this.labelsForSelectAll.allFiltered : this.labelsForSelectAll.all;\n }\n}\n","import {\n ContentChildren,\n Input,\n Output,\n EventEmitter,\n Component,\n ViewChild,\n ElementRef,\n QueryList,\n forwardRef\n} from '@angular/core';\nimport { NG_VALIDATORS, Validator, AbstractControl } from '@angular/forms';\nimport { fromEvent, Subscription } from 'rxjs';\nimport { debounceTime, map, distinctUntilChanged, filter } from 'rxjs/operators';\nimport { IIdentified } from '@c8y/client';\nimport { BsDropdownDirective } from 'ngx-bootstrap/dropdown';\nimport { ListItemComponent } from '../list-group/list-item.component';\nimport { findIndex, get, set } from 'lodash-es';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'c8y-typeahead',\n templateUrl: './typeahead.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n multi: true,\n useExisting: forwardRef(() => TypeaheadComponent)\n },\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => TypeaheadComponent),\n multi: true\n }\n ]\n})\nexport class TypeaheadComponent implements ControlValueAccessor, Validator {\n @ViewChild('searchControl', { static: false }) searchControl: ElementRef;\n @ViewChild('dropdown', { static: false }) dropdown: BsDropdownDirective;\n @ContentChildren(ListItemComponent) list: QueryList<ListItemComponent>;\n\n @Input()\n required: boolean = false;\n\n @Input()\n disabled: boolean = false;\n\n @Input()\n allowFreeEntries: boolean = true;\n\n @Input()\n placeholder: string;\n\n @Input()\n displayProperty: string = 'name';\n\n @Input()\n name: string = this.displayProperty;\n\n @Input()\n container: '' | 'body' = '';\n\n @Input()\n selected: IIdentified = {\n id: null\n };\n\n @Output()\n selectedChange = new EventEmitter<IIdentified>();\n\n @Output()\n onSearch = new EventEmitter<string>();\n\n private subscription: Subscription;\n private onChange: (name) => void;\n private onTouched: () => void;\n\n private readonly KEYCODE_UP = 38;\n private readonly KEYCODE_DOWN = 40;\n private readonly KEYCODE_TAB = 9;\n private readonly KEYCODE_ENTER = 13;\n private readonly KEYCODE_ESC = 27;\n\n writeValue(value) {\n this.selected = value;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n doBlur() {\n if (this.onTouched) {\n this.onTouched();\n }\n }\n\n getDisplayProperty() {\n return get(this.selected, this.displayProperty, '');\n }\n\n onShown() {\n this.searchControl.nativeElement.focus();\n }\n\n ngOnDestroy(): void {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n\n ngAfterViewInit(): void {\n this.subscription = fromEvent(this.searchControl.nativeElement, 'keydown')\n .pipe(\n map((e: any) => this.handleKeyboard(e)),\n filter((e: any) => e),\n debounceTime(200),\n map((e: any) => e.target.value),\n distinctUntilChanged()\n )\n .subscribe(value => {\n this.selected = {\n id: null\n };\n set(this.selected, this.displayProperty, value || '');\n\n this.onChange(this.selected);\n this.selectedChange.emit(this.selected);\n this.onSearch.emit(value);\n });\n }\n\n handleKeyboard(event): void {\n const keyCode = event.keyCode;\n if (\n [this.KEYCODE_ENTER, this.KEYCODE_DOWN, this.KEYCODE_TAB, this.KEYCODE_UP].includes(keyCode)\n ) {\n const items = this.list.toArray();\n const index = findIndex(items, item => item.active);\n if (keyCode === this.KEYCODE_ENTER || keyCode === this.KEYCODE_TAB) {\n if (index > -1) {\n event.preventDefault();\n items[index].element.nativeElement.click();\n }\n this.dropdown.hide();\n this.searchControl.nativeElement.blur();\n } else {\n this.dropdown.show();\n const upOrDown = keyCode === this.KEYCODE_DOWN ? 1 : -1;\n if (index > -1) {\n items[index].active = false;\n }\n if (items[index + upOrDown]) {\n items[index + upOrDown].active = true;\n }\n }\n return;\n } else if (keyCode === this.KEYCODE_ESC) {\n event.stopPropagation();\n this.dropdown.hide();\n this.searchControl.nativeElement.blur();\n return;\n } else {\n this.dropdown.show();\n }\n return event;\n }\n\n validate(ctrl: AbstractControl): { [key: string]: any } {\n if (this.required && !this.getDisplayProperty()) {\n return { required: true };\n }\n\n if (!this.allowFreeEntries && this.selected && this.selected.id === null) {\n return { notExisting: true };\n }\n\n return null;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { SelectComponent } from './select.component';\nimport { CommonModule } from '../common/common.module';\nimport { TypeaheadComponent } from './typeahead.component';\nimport { ListGroupModule } from '../list-group/list-group.module';\nimport { FormsModule } from '../forms/forms.module';\n\n/**\n * The angular module definition for a select.\n * @exports SelectComponent\n */\n@NgModule({\n imports: [\n BsDropdownModule.forRoot(),\n CommonModule,\n ListGroupModule,\n FormsModule\n ],\n exports: [\n SelectComponent,\n TypeaheadComponent\n ],\n declarations: [\n SelectComponent,\n TypeaheadComponent\n ]\n})\nexport class SelectModule { }\n","import { NgModule } from '@angular/core';\nimport { ActionBarModule } from './action-bar/action-bar.module';\nimport { ActionModule } from './action/action.module';\nimport { AlertModule } from './alert/alert.module';\nimport { AuditLogModule } from './audit-log/audit-log.module';\nimport { AuthenticationModule } from './authentication/authentication.module';\nimport { BootstrapModule } from './bootstrap/bootstrap.module';\nimport { BreadcrumbModule } from './breadcrumb/breadcrumb.module';\nimport { CommonModule } from './common/common.module';\nimport { DashboardModule } from './dashboard/dashboard.module';\nimport { DataGridModule } from './data-grid/data-grid.module';\nimport { DeviceStatusModule } from './device-status/device-status.module';\nimport { DocsModule } from './docs/docs.module';\nimport { DropAreaModule } from './drop-area/drop-area.module';\nimport { DynamicComponentModule } from './dynamic-component/dynamic-component.module';\nimport { FilePickerModule } from './file-picker/file-picker.module';\nimport { DatePickerModule } from './date-picker/date-picker.module';\nimport { FormsModule as c8yFormsModule } from './forms/forms.module';\nimport { HeaderModule } from './header/header.module';\nimport { HelpModule } from './help/help.module';\nimport { ListGroupModule } from './list-group/list-group.module';\nimport { LoginModule } from './login/login.module';\nimport { ModalModule } from './modal/modal.module';\nimport { NavigatorModule } from './navigator/navigator.module';\nimport { ProductExperienceModule } from './product-experience/product-experience.module';\nimport { RealtimeModule } from './realtime/realtime.module';\nimport { SearchModule } from './search/search.module';\nimport { SelectModalModule } from './select-modal/select-modal.module';\nimport { SelectModule } from './select/select.module';\nimport { StepperModule as c8yStepperModule } from './stepper/stepper.module';\nimport { TabsModule } from './tabs/tabs.module';\nimport { UserModule } from './user/user.module';\n\n@NgModule({\n exports: [\n ActionBarModule,\n ActionModule,\n AlertModule,\n AuditLogModule,\n BootstrapModule,\n BreadcrumbModule,\n CommonModule,\n DataGridModule,\n DropAreaModule,\n HeaderModule,\n LoginModule,\n ModalModule,\n NavigatorModule,\n AuthenticationModule,\n SearchModule,\n SelectModule,\n TabsModule,\n UserModule,\n c8yFormsModule,\n DeviceStatusModule,\n DocsModule,\n c8yStepperModule,\n DynamicComponentModule,\n DashboardModule,\n ListGroupModule,\n SelectModalModule,\n FilePickerModule,\n DatePickerModule,\n ProductExperienceModule,\n HelpModule,\n RealtimeModule\n ]\n})\nexport class CoreModule {\n static forRoot() {\n return {\n ngModule: CoreModule,\n providers: [...CommonModule.providers(), ...LoginModule.providers()]\n };\n }\n}\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport { kebabCase } from 'lodash-es';\r\n\r\n@Component({\r\n selector: 'c8y-quick-link',\r\n templateUrl: './quick-link.component.html'\r\n})\r\nexport class QuickLinkComponent implements OnInit {\r\n @Input() icon;\r\n @Input() label;\r\n classes = '';\r\n\r\n ngOnInit(): void {\r\n this.classes = `card-block text-center ${kebabCase(this.label)}`;\r\n }\r\n}\r\n","import { CoreModule } from '../core.module';\r\nimport { NgModule } from '@angular/core';\r\nimport { QuickLinkComponent } from './quick-link.component';\r\n\r\n@NgModule({\r\n declarations: [QuickLinkComponent],\r\n imports: [CoreModule],\r\n exports: [QuickLinkComponent],\r\n providers: []\r\n})\r\nexport class QuickLinkModule {}\r\n","import { InjectionToken } from '@angular/core';\n\nexport const HOOK_DYNAMIC_PROVIDER_CONFIG = new InjectionToken('Dynamic Provider Config');\n","import { Inject, Injectable, Injector, Optional } from '@angular/core';\nimport { CanActivate } from '@angular/router';\nimport { flatten } from 'lodash-es';\nimport { forkJoin, from, isObservable, Observable, of } from 'rxjs';\nimport { map, tap } from 'rxjs/operators';\nimport { NavigatorNode, NavigatorNodeFactory } from '../navigator';\nimport { DynamicProviderConfig } from './model/dynamic-provider-config.model';\nimport { HOOK_DYNAMIC_PROVIDER_CONFIG } from './provider-configuration-hook';\n\n@Injectable()\nexport class ProviderConfigurationNodeFactory implements NavigatorNodeFactory {\n private config: DynamicProviderConfig[];\n private nodes: NavigatorNode[];\n\n constructor(\n @Optional()\n @Inject(HOOK_DYNAMIC_PROVIDER_CONFIG)\n config: DynamicProviderConfig[][],\n private injector: Injector\n ) {\n this.config = flatten(config);\n }\n\n get() {\n if (!this.config || !this.config.length) {\n return;\n }\n\n if (!this.nodes) {\n const canActivate: Array<Observable<boolean>> = this.config\n .map(c =>\n c.navigation.canActivate && c.navigation.canActivate.length\n ? c.navigation.canActivate.map(ca => this.injector.get(ca))\n : undefined\n )\n .map(this.checkCanActivate.bind(this));\n\n return forkJoin(canActivate).pipe(\n map((canActivateResult: boolean[]) =>\n this.config\n .map((c, index) =>\n canActivateResult[index] ? new NavigatorNode(c.navigation) : undefined\n )\n .filter(el => !!el)\n ),\n tap(nodes => (this.nodes = nodes))\n );\n }\n\n return this.nodes;\n }\n\n private checkCanActivate(ca: CanActivate[]): Observable<boolean> {\n if (!!ca && ca.length) {\n const canActivateResult: Array<Observable<boolean>> = ca\n .map((canActivate: CanActivate) => canActivate.canActivate(undefined, undefined))\n .map(this.wrapIntoObservable.bind(this));\n\n return forkJoin(canActivateResult).pipe(\n map((caResult: boolean[]) => caResult.reduce((acc, curr) => acc && curr))\n );\n }\n return of(true);\n }\n\n private isPromise<T = any>(obj: any): obj is Promise<T> {\n return !!obj && typeof obj.then === 'function';\n }\n\n private wrapIntoObservable<T>(value: T | Promise<T> | Observable<T>): Observable<T> {\n if (isObservable(value)) {\n return value;\n }\n\n if (this.isPromise(value)) {\n return from(value);\n }\n\n return of(value);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { FetchClient, IIdentified, IResult, Service } from '@c8y/client';\nimport { get } from 'lodash-es';\nimport { ProviderProperties } from '../model/provider-properties.model';\n\n@Injectable()\nexport class ProviderConfigurationService extends Service<ProviderProperties> {\n private static readonly NO_DETAIL_ID: string = null;\n\n protected baseUrl: string;\n protected listUrl: string;\n\n constructor(client: FetchClient, activatedRoute: ActivatedRoute) {\n super(client);\n this.baseUrl = get(activatedRoute, 'snapshot.data.endpoint.configurationEndpoint.baseUrl');\n this.listUrl = get(activatedRoute, 'snapshot.data.endpoint.configurationEndpoint.listUrl');\n }\n\n async detail(): Promise<IResult<ProviderProperties>> {\n return super.detail(ProviderConfigurationService.NO_DETAIL_ID);\n }\n\n async update(entity: Partial<ProviderProperties>): Promise<IResult<ProviderProperties>> {\n return super.update(entity);\n }\n\n async delete(): Promise<IResult<null>> {\n return super.delete(ProviderConfigurationService.NO_DETAIL_ID);\n }\n\n /** There is a single provider configuration per tenant and detail URL is not needed */\n protected getDetailUrl(_: string | number | IIdentified): string {\n return this.listUrl;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { FetchClient, IResultList, Service } from '@c8y/client';\nimport { get } from 'lodash-es';\nimport { ProviderDefinition } from '../model/provider-definition.model';\n\n@Injectable()\nexport class ProviderDefinitionsService extends Service<ProviderDefinition> {\n protected baseUrl: string;\n protected listUrl: string;\n\n constructor(client: FetchClient, activatedRoute: ActivatedRoute) {\n super(client);\n this.baseUrl = get(activatedRoute, 'snapshot.data.endpoint.definitionsEndpoint.baseUrl');\n this.listUrl = get(activatedRoute, 'snapshot.data.endpoint.definitionsEndpoint.listUrl');\n }\n\n async list(): Promise<IResultList<ProviderDefinition>> {\n return super.list();\n }\n}\n","import { Component } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { ActivatedRoute } from '@angular/router';\nimport { IResult } from '@c8y/client';\nimport { FormlyFieldConfig, FormlyFormOptions, ɵdefineHiddenProp } from '@ngx-formly/core';\nimport { find, get, mapValues, pick } from 'lodash-es';\nimport { BehaviorSubject, combineLatest, from, merge, Observable, of, Subject } from 'rxjs';\nimport { catchError, map, shareReplay, switchMap, tap } from 'rxjs/operators';\nimport { AlertService } from '../alert/alert.service';\nimport { Permissions, Status } from '../common/index';\nimport { C8yJSONSchema } from '../dynamic-forms/json-schema/c8y-json-schema.service';\nimport { ModalService } from '../modal/modal.service';\nimport {\n DynamicProviderConfig,\n DynamicProviderLayoutConfig\n} from './model/dynamic-provider-config.model';\nimport { ProviderDefinition } from './model/provider-definition.model';\nimport { ProviderProperties } from './model/provider-properties.model';\nimport { ProviderConfigurationService } from './service/provider-configuration.service';\nimport { ProviderDefinitionsService } from './service/provider-definitions.service';\n\n@Component({\n selector: 'c8y-sms-gateway',\n templateUrl: './provider-configuration.component.html',\n providers: [ProviderConfigurationService, ProviderDefinitionsService]\n})\nexport class ProviderConfigurationComponent {\n layout$: Observable<DynamicProviderLayoutConfig> = this.activatedRoute.data.pipe(\n map((config: DynamicProviderConfig) => config.layout),\n tap((layout: DynamicProviderLayoutConfig) => (this.layout = layout)),\n tap(\n (layout: DynamicProviderLayoutConfig) =>\n (this.options.formState.disabled = !this.permissions.hasAllRoles(layout.saveRoles))\n )\n );\n\n providers$: Observable<ProviderDefinition[]>;\n selectedProvider$: Observable<ProviderDefinition>;\n changeProvider$: Subject<ProviderDefinition> = new BehaviorSubject(null);\n configuration$: Observable<ProviderProperties>;\n providerInput$ = new BehaviorSubject<string>('');\n\n form = new FormGroup({});\n model: ProviderProperties;\n fields: FormlyFieldConfig[] = [];\n options: FormlyFormOptions = {\n formState: {\n disabled: false\n }\n };\n\n private reload$ = new BehaviorSubject<void>(null);\n private updatedConfiguration$ = new Subject<ProviderProperties>();\n private layout: DynamicProviderLayoutConfig;\n\n constructor(\n public permissions: Permissions,\n private activatedRoute: ActivatedRoute,\n private modalService: ModalService,\n private alertService: AlertService,\n private providerDefinitionsService: ProviderDefinitionsService,\n private providerConfigurationService: ProviderConfigurationService,\n private jsonschema: C8yJSONSchema\n ) {}\n\n ngOnInit() {\n const allProviders$: Observable<ProviderDefinition[]> = from(\n this.providerDefinitionsService.list()\n ).pipe(\n map(result => result.data),\n shareReplay(1)\n );\n\n this.providers$ = combineLatest(allProviders$, this.providerInput$).pipe(\n map(([providers, input]: [ProviderDefinition[], string]) =>\n input\n ? providers.filter(el => el.displayName.toLowerCase().indexOf(input.toLowerCase()) >= 0)\n : providers\n ),\n shareReplay(1)\n );\n\n this.configuration$ = merge(\n this.updatedConfiguration$,\n this.reload$.pipe(\n switchMap(() =>\n from(this.providerConfigurationService.detail()).pipe(catchError(() => of({} as any)))\n ),\n map(result => result.data)\n )\n ).pipe(\n map(this.removeEncryptedValues),\n shareReplay(1)\n );\n\n this.selectedProvider$ = combineLatest(\n allProviders$,\n this.configuration$,\n this.changeProvider$\n ).pipe(\n tap(\n ([_, configuration, newProvider]: [\n ProviderDefinition[],\n ProviderProperties,\n ProviderDefinition\n ]) =>\n (this.model = newProvider\n ? pick(this.model, 'sms.senderName', 'sms.senderAddress')\n : configuration)\n ),\n map(\n ([providers, configuration, newProvider]: [\n ProviderDefinition[],\n ProviderProperties,\n ProviderDefinition\n ]) =>\n newProvider ||\n find(\n providers,\n (provider: ProviderDefinition) => get(configuration, 'provider') === provider.id\n )\n ),\n tap((provider: ProviderDefinition) => {\n if (provider) {\n const config: FormlyFieldConfig = this.jsonschema.toFieldConfig(get(provider, 'schema'));\n if (config.fieldGroup) {\n config.fieldGroup.forEach((fieldConfig: FormlyFieldConfig) => {\n ɵdefineHiddenProp(fieldConfig, '_keyPath', {\n key: fieldConfig.key,\n path: [fieldConfig.key]\n });\n\n fieldConfig.expressionProperties = {\n 'templateOptions.disabled': 'formState.disabled'\n };\n });\n }\n this.fields = [config];\n this.form = new FormGroup({});\n }\n }),\n shareReplay(1)\n );\n }\n\n async saveProviderConfiguration() {\n try {\n const res: IResult<ProviderProperties> = await this.providerConfigurationService.update(\n this.model\n );\n this.changeProvider$.next(null);\n this.updatedConfiguration$.next(res.data);\n this.alertService.success(this.layout.configurationUpdatedSuccessMsg);\n this.form.markAsPristine();\n } catch (err) {\n this.alertService.addServerFailure(err);\n }\n }\n\n async deleteProviderConfiguration() {\n try {\n await this.modalService.confirm(\n this.layout.deleteConfigurationModalTitle,\n this.layout.deleteConfigurationModalBody,\n Status.DANGER,\n {\n ok: this.layout.deleteConfigurationModalOkBtnLabel,\n cancel: this.layout.deleteConfigurationModalCancelBtnLabel\n }\n );\n await this.providerConfigurationService.delete();\n this.reload$.next();\n this.alertService.success(this.layout.configurationDeletedSuccessMsg);\n } catch (err) {\n if (err) {\n this.alertService.addServerFailure(err);\n }\n }\n }\n\n private removeEncryptedValues(configuration: ProviderProperties): ProviderProperties {\n return mapValues(configuration, value => (value === '<<Encrypted>>' ? undefined : value));\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { flatten } from 'lodash-es';\nimport { RouteFactory } from '../router';\nimport { DynamicProviderConfig } from './model/dynamic-provider-config.model';\nimport { HOOK_DYNAMIC_PROVIDER_CONFIG } from './provider-configuration-hook';\nimport { ProviderConfigurationComponent } from './provider-configuration.component';\n\n@Injectable()\nexport class ProviderConfigurationRouteFactory implements RouteFactory {\n private config: DynamicProviderConfig[];\n\n constructor(@Optional() @Inject(HOOK_DYNAMIC_PROVIDER_CONFIG) config: DynamicProviderConfig[][]) {\n this.config = flatten(config);\n }\n\n get() {\n return this.config.map(c => ({\n path: c.navigation.path,\n component: ProviderConfigurationComponent,\n canActivate: c.navigation.canActivate,\n data: {\n layout: c.layout,\n endpoint: c.endpoint\n }\n }));\n }\n}\n","import { forwardRef, ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '../common/common.module';\nimport { CoreModule } from '../core.module';\nimport { DynamicFormsModule } from '../dynamic-forms/dynamic-forms.module';\nimport { HOOK_NAVIGATOR_NODES } from '../navigator';\nimport { HOOK_ONCE_ROUTE } from '../router';\nimport { DynamicProviderConfig } from './model/dynamic-provider-config.model';\nimport { HOOK_DYNAMIC_PROVIDER_CONFIG } from './provider-configuration-hook';\nimport { ProviderConfigurationNodeFactory } from './provider-configuration-node.factory';\nimport { ProviderConfigurationRouteFactory } from './provider-configuration-route.factory';\nimport { ProviderConfigurationComponent } from './provider-configuration.component';\n\n@NgModule({\n declarations: [ProviderConfigurationComponent],\n exports: [ProviderConfigurationComponent],\n imports: [CoreModule, CommonModule, DynamicFormsModule],\n entryComponents: [ProviderConfigurationComponent],\n providers: [\n {\n provide: HOOK_ONCE_ROUTE,\n useClass: forwardRef(() => ProviderConfigurationRouteFactory),\n multi: true\n },\n {\n provide: HOOK_NAVIGATOR_NODES,\n useClass: forwardRef(() => ProviderConfigurationNodeFactory),\n multi: true\n }\n ]\n})\nexport class ProviderConfigurationModule {\n static config(config: DynamicProviderConfig[]): ModuleWithProviders {\n return {\n ngModule: ProviderConfigurationModule,\n providers: [{ provide: HOOK_DYNAMIC_PROVIDER_CONFIG, useValue: config, multi: true }]\n };\n }\n}\n","export class RealtimeMessage<T> {\n id: string;\n channel: string;\n realtimeAction: RealtimeAction;\n data: T | number;\n}\n\nexport type RealtimeAction = 'UPDATE' | 'DELETE' | 'CREATE';\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { IIdentified, Realtime } from '@c8y/client';\nimport { Observable, Subject } from 'rxjs';\nimport { filter, finalize, map } from 'rxjs/operators';\nimport { RealtimeMessage } from './realtime.model';\n\n/**\n * A wrapper class for handling realtime notifications in RxJS fashion.\n */\nexport abstract class RealtimeService<T> {\n /**\n * A flag displaying if realtime notifications are currently active.\n */\n get active(): boolean {\n return this.isActive;\n }\n\n private subjects$: Map<string, RealtimeSubject<T>> = new Map<string, RealtimeSubject<T>>();\n private isActive: boolean = true;\n\n constructor(protected realtime: Realtime) {}\n\n /**\n * Get an Observable of all realtime notifications.\n *\n * @param {string | number | IIdentified} entityOrId Entity object or id\n *\n * @returns An [[Observable]] of notifications wrapped as [[RealtimeMessage]]\n */\n onAll$(entityOrId?: string | number | IIdentified): Observable<RealtimeMessage<T>> {\n const subject$: RealtimeSubject<T> = this.getSubjectForChannel(entityOrId);\n\n return subject$.pipe(\n finalize(() => {\n if (subject$.observers.length === 1 && subject$.observers[0].closed) {\n subject$.stop();\n this.subjects$.delete(subject$.channel);\n }\n })\n );\n }\n\n /**\n * Subscribes again all realtime channels with active observers.\n */\n start() {\n if (!this.isActive) {\n this.subjects$.forEach(subject$ => {\n subject$.start();\n });\n this.isActive = true;\n }\n }\n\n /**\n * Stops realtime notifications and unsubscribes all realtime channels.\n */\n stop() {\n if (this.isActive) {\n this.subjects$.forEach(subject$ => {\n subject$.stop();\n });\n\n this.isActive = false;\n }\n }\n\n /**\n * Get an Observable of all CREATE realtime notifications.\n *\n * @returns An [[Observable]] of newly created entity objects.\n */\n onCreate$(): Observable<T> {\n return this.onAll$().pipe(\n filter(msg => msg.realtimeAction === 'CREATE'),\n map(msg => msg.data as T)\n );\n }\n\n /**\n * Get an Observable of all UPDATE realtime notifications.\n *\n * @param {string | number | IIdentified} entityOrId Entity object or id\n *\n * @returns An [[Observable]] of updated entity objects.\n */\n onUpdate$(entityOrId?: string | number | IIdentified): Observable<T> {\n return this.onAll$(entityOrId).pipe(\n filter(msg => msg.realtimeAction === 'UPDATE'),\n map(msg => msg.data as T)\n );\n }\n\n /**\n * Get an Observable of all DELETE realtime notifications.\n *\n * @param {string | number | IIdentified} entityOrId Entity object or id\n *\n * @returns An [[Observable]] of deleted entity objects.\n */\n onDelete$(entityOrId?: string | number | IIdentified): Observable<number> {\n return this.onAll$(entityOrId).pipe(\n filter(msg => msg.realtimeAction === 'DELETE'),\n map(msg => coerceNumberProperty(msg.data))\n );\n }\n\n protected getIdString(reference: number | string | IIdentified): string {\n let id: string | number;\n if (typeof reference === 'object') {\n id = reference.id;\n } else {\n id = reference;\n }\n return String(id);\n }\n\n protected getChannel(entityOrId?: string | number | IIdentified) {\n return entityOrId ? this.channel().replace('*', this.getIdString(entityOrId)) : this.channel();\n }\n\n protected abstract channel(): string;\n\n private getSubjectForChannel(entityOrId?: string | number | IIdentified): RealtimeSubject<T> {\n const channel: string = this.getChannel(entityOrId);\n let subject$: RealtimeSubject<T>;\n if (this.subjects$.has(channel)) {\n subject$ = this.subjects$.get(channel);\n } else {\n subject$ = new RealtimeSubject(channel, this.realtime);\n this.subjects$.set(channel, subject$);\n }\n\n return subject$;\n }\n}\n\n// tslint:disable-next-line: max-classes-per-file\nclass RealtimeSubject<T> extends Subject<RealtimeMessage<T>> {\n realtimeSubscription: object;\n get channel(): string {\n return this.realtimeChannel;\n }\n\n constructor(private realtimeChannel: string, private realtime: Realtime) {\n super();\n this.start();\n }\n\n start() {\n if (!this.realtimeSubscription) {\n this.realtimeSubscription = this.realtime.subscribe(this.realtimeChannel, msg => {\n const data: RealtimeMessage<T> = {\n channel: msg.channel,\n data: msg.data.data,\n id: msg.id,\n realtimeAction: msg.data.realtimeAction\n };\n this.next(data);\n });\n }\n }\n\n stop() {\n if (this.realtimeSubscription) {\n this.realtime.unsubscribe(this.realtimeSubscription);\n this.realtimeSubscription = null;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { IOperationBulk, Realtime } from '@c8y/client';\nimport { RealtimeService } from './realtime.service';\n\n/**\n * A service for handling bulk operation realtime notifications in RxJS fashion.\n */\n@Injectable()\nexport class OperationBulkRealtimeService extends RealtimeService<IOperationBulk> {\n constructor(realtime: Realtime) {\n super(realtime);\n }\n\n protected channel(): string {\n return '/bulkOperations/*';\n }\n}\n","import { Injectable } from '@angular/core';\nimport { RealtimeService } from './realtime.service';\nimport { IManagedObject, Realtime } from '@c8y/client';\n\n@Injectable()\nexport class ManagedObjectRealtimeService extends RealtimeService<IManagedObject> {\n constructor(realtime: Realtime) {\n super(realtime);\n }\n\n protected channel(): string {\n return '/managedobjects/*';\n }\n}\n"]}