@c8y/ngx-components 1007.0.43 → 1007.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/c8y-ngx-components.umd.js +5 -2
- package/bundles/c8y-ngx-components.umd.js.map +1 -1
- package/bundles/c8y-ngx-components.umd.min.js +1 -1
- package/bundles/c8y-ngx-components.umd.min.js.map +1 -1
- package/c8y-ngx-components.metadata.json +1 -1
- package/core/dashboard/dashboard-child.component.d.ts +1 -0
- package/esm2015/core/dashboard/dashboard-child.component.js +5 -1
- package/esm2015/core/data-grid/data-grid.component.js +2 -2
- package/esm5/core/dashboard/dashboard-child.component.js +5 -2
- package/esm5/core/data-grid/data-grid.component.js +2 -2
- package/fesm2015/c8y-ngx-components.js +5 -1
- package/fesm2015/c8y-ngx-components.js.map +1 -1
- package/fesm5/c8y-ngx-components.js +5 -2
- package/fesm5/c8y-ngx-components.js.map +1 -1
- package/locales/ja_JP.po +5 -5
- package/package.json +2 -2
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
var gc=function(e,t){return(gc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function hc(e,t){function n(){this.constructor=e}gc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var fc=function(){return(fc=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)};function yc(e,t,n,a){var s,o=arguments.length,r=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,a);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}function vc(e,t){return function(n,a){t(n,a,e)}}function jc(e,t,n,a){return new(n||(n=Promise))((function(s,o){function r(e){try{i(a.next(e))}catch(e){o(e)}}function l(e){try{i(a.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}i((a=a.apply(e,t||[])).next())}))}function bc(e,t){var n,a,s,o,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,a=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(!(s=r.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){r=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){r.label=o[1];break}if(6===o[0]&&r.label<s[1]){r.label=s[1],s=o;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(o);break}s[2]&&r.ops.pop(),r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e],a=0}finally{n=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}function wc(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a,s,o=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(a=o.next()).done;)r.push(a.value)}catch(e){s={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return r}function Sc(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(wc(arguments[t]));return e}function Cc(e,t,a){return e.events.pipe(s.filter((function(e){return e instanceof n.NavigationEnd})),s.merge(t),s.startWith(1),s.switchMap((function(){return Ic(a,e)})))}function Ic(e,t,n){return void 0===n&&(n=!0),!Array.isArray(e)||e.length<1?a.of([]):a.defer((function(){var r=Pc(e).map((function(e){return function(e,t){var n;if(!e)return a.of([]);if("function"==typeof e.then||a.isObservable(e))if(t){var o=a.from(e),r=o.pipe(s.startWith([]));n=a.race(o,r)}else n=a.from(e);else n=a.of(e);return n.pipe(s.map((function(e){return(Array.isArray(e)?e:[e]).filter((function(e){return!!e}))})))}(Array.isArray(e)?e:e&&o.isFunction(e.get)?e.get(Ec(t)):[e],n)}));return a.combineLatest.apply(void 0,Sc(r))})).pipe(s.map((function(e){return xc([].concat.apply([],Sc(e)))})))}function Pc(e){return o.flatten(e.map((function(e){return o.isFunction(e)?e():[e]})))}function Oc(e){var t=e.pipe(s.map((function(e){return Array.from(e)})));return{get:function(){return t}}}function xc(e){return o.sortBy(e,"priority")}function Ec(e){if(e&&e.routerState&&e.routerState.root){for(var t=e.routerState.root;t.firstChild;)t=t.firstChild;return t}}var kc=function(){function e(){}return e.prototype.map=function(e){return this.state$.pipe(s.map(e),s.distinctUntilChanged())},e.prototype.emitNewState=function(){this.state$.next(this.state)},e}(),Tc=new t.InjectionToken("ActionBarFactory"),Ac=function(e){function o(t,n){var o=e.call(this)||this;return o.injector=t,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.items$=Cc(n,o.refreshTrigger,[function(){return o.injector.get(Tc,[])},Oc(o.state$)]).pipe(s.map((function(e){return xc(e)})),s.shareReplay(1)),o}return hc(o,e),Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.refresh=function(){this.refreshTrigger.next()},o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),_c=new t.InjectionToken("ActionFactory"),Nc=function(e){function o(t,n){var o=e.call(this)||this;return o.injector=t,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.items$=Cc(n,o.refreshTrigger,[function(){return o.injector.get(_c,[])},Oc(o.state$)]).pipe(s.map((function(e){return xc(e)})),s.shareReplay(1)),o}return hc(o,e),o.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc);function Dc(e){return e}var Mc=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.state$=new a.BehaviorSubject([]),t.MAX_ALERTS=3,t.ALERT_TIMEOUT=3e3,t}return hc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.add=function(e){this.addAlert(e)},n.prototype.addByText=function(e,t,n){this.addAlert({text:t,type:e,detailedData:n})},n.prototype.list=function(){return this.state},n.prototype.remove=function(e){var t=this;this.changeAlerts(this.state.filter((function(n){return!t.areSame(e,n)})))},n.prototype.update=function(e,t){var n=this;this.changeAlerts(this.state.map((function(a){return n.areSame(e,a)&&Object.assign(a,t),a})))},n.prototype.removeLastDanger=function(){var e=this.state.reverse().find((function(e){return"danger"===e.type}));this.changeAlerts(this.state.filter((function(t){return t!==e})))},n.prototype.saveSuccess=function(e){var t=this;return function(){var n=e+" saved successfully";t.addByText("success",n)}},n.prototype.createSuccess=function(e){var t=this;return function(){var n=e+" created successfully";t.addByText("success",n)}},n.prototype.clearAll=function(){this.changeAlerts([])},n.prototype.success=function(e,t){this.addByText("success",e,t)},n.prototype.danger=function(e,t){this.addByText("danger",e,t)},n.prototype.info=function(e,t){this.addByText("info",e,t)},n.prototype.warning=function(e,t){this.addByText("warning",e,t)},n.prototype.addServerFailure=function(e,t){void 0===t&&(t="danger");var n,a=e.data,s=e.res,o=a&&a.message?a.message:null;a&&("object"==typeof a?n=a.exceptionMessage:"string"==typeof a&&(n=a));var r=!(!o&&!n);o||(o="A server error occurred."),r||(n={status:s.status,statusText:s.statusText,url:s.url}),this.addAlert({type:t,text:o,detailedData:n})},n.prototype.areSame=function(e,t){return e.text===t.text&&e.type===t.type&&e.detailedData===t.detailedData&&e.onClose===t.onClose&&e.onDetail===t.onDetail},n.prototype.changeAlerts=function(e){this.state$.next(e)},n.prototype.addAlert=function(e){var t=this;if(!e.text&&!e.type)throw new Error("Cannot add empty alert");this.state.find((function(n){return t.areSame(e,n)}))||(this.changeAlerts(Sc(this.state,[e])),this.hideAutomaticallyIfNeeded(e),this.removeOldestIfMax())},n.prototype.hideAutomaticallyIfNeeded=function(e){var t=this,n="success"===e.type,a=!e.detailedData,s=n&&a?this.ALERT_TIMEOUT:0;void 0!==e.timeout&&(s=e.timeout),s&&setTimeout((function(){return t.remove(e)}),s)},n.prototype.removeOldestIfMax=function(){if(this.state.length>this.MAX_ALERTS){var e=wc(this.state).slice(1);this.changeAlerts(e)}},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n=yc([t.Injectable({providedIn:"root"})],n)}(kc),Lc=function(){},Rc=new t.InjectionToken("App options"),qc=function(e){function n(t,n,a){var s=e.call(this)||this;return s.systemOptionsService=n,s.tenantOptionService=a,s.setupOptions(t),s}return hc(n,e),n.prototype.get=function(e,t){var n=this[e];return void 0===n&&(n=this[o.camelCase(e)]),void 0!==n?n:t},n.prototype.set=function(e,t){this[o.camelCase(e)]=t},n.prototype.getSupportUrl=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return o.isUndefined(this.supportUrl)?(e=this,[4,this.getTenantOption("configuration","system.support.url")]):[3,2];case 1:e.supportUrl=t.sent(),t.label=2;case 2:return[2,!o.isUndefined(this.supportUrl)&&this.supportUrl]}}))}))},n.prototype.getActivateSupportUser=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return[4,this.getSystemOption("support-user","enabled",!0)];case 1:return[2,!e.sent()]}}))}))},n.prototype.getSystemOption=function(e,t,n){return jc(this,void 0,void 0,(function(){return bc(this,(function(a){return[2,this.getOptionFromService(e,t,this.systemOptionsService,n)]}))}))},n.prototype.getTenantOption=function(e,t,n){return jc(this,void 0,void 0,(function(){return bc(this,(function(a){return[2,this.getOptionFromService(e,t,this.tenantOptionService,n)]}))}))},n.prototype.setupOptions=function(e){var t=this;e&&(Array.isArray(e)||(e=[e]),e.forEach((function(e){e&&Object.keys(e).forEach((function(n){t[o.camelCase(n)]=e[n]}))})))},n.prototype.getOptionFromService=function(e,t,n,a){return jc(this,void 0,void 0,(function(){var s;return bc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,n.detail({category:e,key:t})];case 1:return s=o.sent().data,[2,this.parseOptionRawValue(s.value,a)];case 2:return o.sent(),[2,a];case 3:return[2]}}))}))},n.prototype.parseOptionRawValue=function(e,t){var n;try{n=JSON.parse(e)}catch(a){n=o.isUndefined(e)?t:e}return n},n.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[Rc]}]},{type:r.SystemOptionsService},{type:r.TenantOptionsService}]},n=yc([t.Injectable(),vc(0,t.Optional()),vc(0,t.Inject(Rc))],n)}(Lc),$c=function(e){function n(t,n,o,r){var l=e.call(this)||this;return l.applicationService=t,l.apiService=n,l.options=o,l.fetchClient=r,l.state$=new a.BehaviorSubject({app:{name:l.options.name,contextPath:l.getCurrentContextPath()||l.options.contextPath},supportUrl:l.options.supportUrl,lang:l.options.get("defaultLanguage","en"),langs:l.getLangs(),langsDetail:l.options.languages,loginOptions:l.options.loginOptions,activateSupportUserAvailable:void 0,versions:{backend:void 0,ui:l.options.versions||{ngx:void 0}},hidePowered:l.options.hidePowered,isLoading:!1,showRightDrawer:l.options.rightDrawer,loginExtraLink:l.options.get("login_extra_link"),newsletter:l.options.newsletter}),l.currentSupportUserName=new a.BehaviorSubject(null),l.currentUser=new a.BehaviorSubject(null),l.currentTenant=new a.BehaviorSubject(null),l.apiService.calls.pipe(s.filter((function(e){var t=e.url;return!/cep\/realtime/.test(t)})),s.map((function(e){return"start"===e.phase?1:-1})),s.scan((function(e,t){return e+t}),0),s.map((function(e){return e>0})),s.distinctUntilChanged()).subscribe((function(e){return l.state.isLoading=e})),l.assignApplicationKeyToDefaultHeaders(),l}return hc(n,e),n.prototype.assignApplicationKeyToDefaultHeaders=function(){t.isDevMode()||(this.fetchClient.defaultHeaders=fc({},this.fetchClient.defaultHeaders||{},{"X-Cumulocity-Application-Key":this.options.key}))},Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.getLangs=function(){var e=this.options.languages;return e?o.keys(e).filter((function(t){return e[t]})):[]},Object.defineProperty(n.prototype,"uiVersion",{get:function(){var e=this.state.versions.ui;return e.ngx||e.ng1},enumerable:!0,configurable:!0}),n.prototype.loadManifest=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.applicationService.detail(this.state.app.contextPath+"/manifest")];case 1:return e=t.sent().data.application,this.state.app.manifest=e,this.loadDefaultOptions(),[3,3];case 2:throw t.sent();case 3:return[2]}}))}))},n.prototype.isApplicationAvailable=function(e){return jc(this,void 0,void 0,(function(){return bc(this,(function(t){switch(t.label){case 0:return[4,this.applicationService.listByUser(void 0,{pageSize:100})];case 1:return[2,t.sent().data.some((function(t){return t.name===e}))]}}))}))},n.prototype.setUser=function(e){this.currentSupportUserName.next(e.supportUserName||null),this.currentUser.next(e.user)},n.prototype.getCurrentContextPath=function(){var e=window.location.pathname.match(/\/apps\/(public\/){0,1}(.+?)(\/|\?|#|$)/);return e&&e[2]},n.prototype.loadDefaultOptions=function(){return jc(this,void 0,void 0,(function(){var e,t,n;return bc(this,(function(a){switch(a.label){case 0:return e=this.state,[4,this.options.getSupportUrl()];case 1:return e.supportUrl=a.sent(),t=this.state,[4,this.options.getActivateSupportUser()];case 2:return t.activateSupportUserAvailable=a.sent(),n=this.state.versions,[4,this.options.getSystemOption("system","version")];case 3:n.backend=a.sent();try{this.showIncompatibleVersionsError()}catch(e){}return this.emitNewState(),[2]}}))}))},n.prototype.showIncompatibleVersionsError=function(){var e=this.state.versions.ui.ngx,t=this.state.versions.backend,n=e.replace(/[^\d.]/g,"").split(".").map(Number),a=t.replace(/[^\d.]/g,"").split(".").map(Number),s=Math.pow(10,Math.ceil(Math.log10(Math.max.apply(Math,Sc(n,a))+1))),o=function(e,t){return e+t},r=function(e,t){return e*(s/Math.pow(10,t))};if(n.map(r).reduce(o)>a.map(r).reduce(o)){var l="You are running version "+e+" of the UI and version "+t+" of backend!";console.log("%c "+l,"font-weight: bold; font-size: 30px; color: red;")}},n.ctorParameters=function(){return[{type:l.ApplicationService},{type:r.ApiService},{type:qc},{type:l.FetchClient}]},n=yc([t.Injectable()],n)}(kc),Fc=function(){function e(e){this.children=[],this.parents=[],this.routerLinkExact=!0,this.open=!1,this.hidden=!1,this.draggable=!1,this.droppable=!1,this.dragged=!1,this.draggedHover=!1,this.confirm=void 0,this._priority=0,this.update(e)}return Object.defineProperty(e.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id||"navigator_node_"+o.snakeCase(this.label)},set:function(e){this._id=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"priority",{get:function(){if(this._priority)return this._priority;var e=this.children.map((function(e){return e.priority||0}));return e.length&&e.length?Math.max.apply(Math,Sc(e)):0},set:function(e){this._priority=e},enumerable:!0,configurable:!0}),e.prototype.openOnStart=function(e){return!1},e.prototype.add=function(e){if(e===this)throw new Error("Adding node to itself");-1===this.children.indexOf(e)&&this.children.push(e),-1===e.parents.indexOf(this)&&e.parents.push(this),this.updateChildren()},e.prototype.remove=function(e){var t=this.children.indexOf(e),n=e.parents.indexOf(this);t>-1&&this.children.splice(t,1),n>-1&&e.parents.splice(n,1),this.updateChildren()},e.prototype.update=function(e){e&&(Object.assign(this,e),void 0!==e.hidden&&this.parents.forEach((function(e){e.updateHidden()})))},e.prototype.find=function(e){if("string"==typeof e){var t=e.toLocaleLowerCase();e=function(e){var n=e.label;return t===n.toLowerCase()}}if("object"==typeof e&&(e=o.matches(e)),"function"!=typeof e)throw new Error("Invalid search predicate");return this.children.reduce((function(t,n){return t||n.find(e)}),this.children.find(e))},e.prototype.empty=function(){this.children.length=0},e.prototype.click=function(e){void 0===e&&(e={})},e.prototype.drop=function(e){e.stopPropagation(),clearTimeout(this.expandDragTimeout)},e.prototype.dragStart=function(e){e.stopPropagation(),e.dataTransfer.setData("node","node"),this.dragged=!0},e.prototype.dragEnd=function(e){e.stopPropagation(),this.dragged=!1,e.dataTransfer.clearData()},Object.defineProperty(e.prototype,"canDrop",{get:function(){return this.droppable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canNavigate",{get:function(){return void 0!==this.path},enumerable:!0,configurable:!0}),e.prototype.dragEnter=function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.draggedHover=!0,this.open||(this.expandDragTimeout=setTimeout((function(){return t.expand()}),1e3))},e.prototype.dragLeave=function(e){e.preventDefault(),e.stopPropagation(),this.draggedHover=!1,clearTimeout(this.expandDragTimeout)},e.prototype.expand=function(){this.open||(this.open=!0,this.click({open:!0,expander:!0}))},e.prototype.traverse=function(e){this.children&&this.children.forEach((function(t){e(t),t.traverse(e)}))},e.prototype.destroy=function(){},e.prototype.updateChildren=function(){this.sort(),this.updateHidden()},e.prototype.sort=function(){this.children.sort((function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:(e.label||"").toLowerCase()<(t.label||"").toLowerCase()?-1:(e.label||"").toLowerCase()>(t.label||"").toLowerCase()?1:0}))},e.prototype.updateHidden=function(){void 0===this.path&&(this.hidden=!this.children.some((function(e){return!e.hidden})))},e}(),Uc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return hc(t,e),t.prototype.addRoot=function(e){var t,n=e.parent,a=this.createNode(e);return n&&("object"==typeof n?(t=this.find(n.label))&&t.update(n):"string"!=typeof n&&"function"!=typeof n||(t=this.find(n)),t||(t=this.createNode(n),this.find((function(e){return t===e}))||this.add(t))),(t||this).add(a),a},t.prototype.createNode=function(e){if(e instanceof Fc)return e;if("string"==typeof e)return new Fc({label:e});if("object"==typeof e)return new Fc(fc({},e,{parent:void 0}));throw new Error("Wrong type of node data")},t}(Fc),Bc=new t.InjectionToken("NavigatorNodesFactory"),zc=function(e){function o(t,n){var o=e.call(this)||this;o.injector=t,o.router=n,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.firstUrl=!0;var r=new Uc;return o.items$=Cc(n,o.refreshTrigger,[function(){return o.injector.get(Bc,[])},Oc(o.state$)]).pipe(s.map((function(e){var t=e.filter((function(e){return!e.parent})),n=e.filter((function(e){return e.parent})),a=xc(t).concat(xc(n));return r.empty(),a.forEach((function(e){return r.addRoot(e)})),r.children})),s.shareReplay(1)),o}return hc(o,e),o.prototype.openOnFirstUrl=function(e){return!(!this.firstUrl||!e.path)&&(this.router.isActive(e.path,e.routerLinkExact)||e.openOnStart(this.router.url))},Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.refresh=function(){this.refreshTrigger.next(1)},o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),Gc=function(e){function n(t,n){var o=e.call(this)||this;o.navigatorService=t,o.options=n,o.hasItemsInNavigator$=o.navigatorService.items$.pipe(s.map((function(e){return!!e.length})),s.distinctUntilChanged()),o.state$=new a.BehaviorSubject({title:void 0,nav:{open:!1}}),o.title=void 0,o.header$=o.map((function(e){return e})),o.navigatorOpen$=o.map((function(e){return e.nav.open})).pipe(s.combineLatest(o.hasItemsInNavigator$),s.map((function(e){var t=wc(e,2),n=t[0],a=t[1];return n&&a})));var r=document.querySelector("title");return o.title={elementRef:r,originalValue:r&&r.innerText},o}return hc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"navigatorHiddenOnStartup",{get:function(){return this.options.hideNavigator},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"largeWidth",{get:function(){return document.documentElement.clientWidth>1200},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldToggle",{get:function(){return this.largeWidth&&!this.navigatorHiddenOnStartup&&!this.state.nav.open},enumerable:!0,configurable:!0}),n.prototype.toggleNavigator=function(){this.state.nav.open=!this.state.nav.open,this.emitNewState()},n.prototype.closeNavigator=function(){this.state.nav.open=!1,this.emitNewState()},n.prototype.configNavigator=function(e){void 0===e&&(e={}),this.state.nav=Object.assign(this.state.nav,e),this.emitNewState()},n.prototype.changeTitle=function(e){this.state.title=e,this.emitNewState()},n.prototype.changePageTitle=function(e){this.title.elementRef.innerText=e?e+" / "+this.title.originalValue:""+this.title.originalValue},n.prototype.verifyIfNavOpen=function(){var e=this;this.hasItemsInNavigator$.pipe(s.debounceTime(300)).subscribe((function(t){return t&&e.shouldToggle&&e.toggleNavigator()}))},n.prototype.shouldShowBreadcrumbs=function(){return this.options.breadcrumbs},n.ctorParameters=function(){return[{type:zc},{type:qc}]},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n(t.ɵɵinject(zc),t.ɵɵinject(qc))},token:n,providedIn:"root"}),n=yc([t.Injectable({providedIn:"root"})],n)}(kc),Hc=new t.InjectionToken("TabsFactory"),Vc=function(e){function o(t,n,o,r){var l=e.call(this)||this;return l.injector=t,l.translateService=o,l.options=r,l.refreshTrigger=new a.Subject,l.state$=new a.BehaviorSubject(new Set),l.items$=Cc(n,l.refreshTrigger,[function(){return l.injector.get(Hc,[])},Oc(l.state$)]).pipe(s.map((function(e){return l.prepareTabs(e)})),s.shareReplay(1),s.distinctUntilChanged()),l.orientation$=l.items$.pipe(s.map((function(e){var t=e.find((function(e){return e.orientation}));return t?t.orientation:l.options.tabsHorizontal?"horizontal":"vertical"})),s.distinctUntilChanged()),l}return hc(o,e),o.prototype.prepareTabs=function(e){return this.sortTabs(e.map((function(e){return fc({},e,{template:e.template instanceof t.ViewContainerRef?e.template:void 0})})).filter((function(e,t,n){return t===n.findIndex((function(t){return t.path===e.path}))})))},o.prototype.sortTabs=function(e){var t=this;return e.sort((function(e,n){var a=(n.priority||0)-(e.priority||0),s=t.translateService.instant(e.label),o=t.translateService.instant(n.label),r=s.localeCompare(o);return a||r}))},o.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},Object.defineProperty(o.prototype,"firstTab$",{get:function(){return this.items$.pipe(s.map((function(e){return e[0]})),s.filter(Boolean),s.first())},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router},{type:i.TranslateService},{type:qc}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router),t.ɵɵinject(i.TranslateService),t.ɵɵinject(qc))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),Kc=function(){function e(e,t,n,a,o,r){var l=this;this.tabs=e,this.ui=t,this.navigator=n,this.actionBar=a,this.options=o,this.headerService=r,this.noAppsMargin$=this.headerService.map((function(e){var t=e.nav;return!t.open&&t.hiddenOnStartup})),this.tabsOrientation=this.options.tabsHorizontal?"horizontal":"vertical",this.ui.map((function(e){return e.lang})).pipe(s.distinctUntilChanged()).subscribe((function(){l.actionBar.refresh()}))}return Object.defineProperty(e.prototype,"showPoweredBy",{get:function(){return!this.options.get("hidePowered")},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:Vc},{type:$c},{type:zc},{type:Ac},{type:qc},{type:Gc}]},e=yc([t.Component({selector:"c8y-bootstrap",template:'<c8y-login *ngIf="!(ui.currentUser | async)"></c8y-login>\n\n<div *ngIf="ui.currentUser | async" [class.head-open]="header.headerOpen">\n <c8y-header-bar #header></c8y-header-bar>\n <c8y-navigator-outlet\n [nodes]="navigator.items$ | async"\n [open]="headerService.navigatorOpen$ | async"\n >\n <header class="title navigator-slot-top">\n <div class="tenant-brand"></div>\n <c8y-app-icon\n [name]="(ui.state$ | async).app.name"\n [contextPath]="(ui.state$ | async).app.contextPath"\n ></c8y-app-icon>\n <span>{{ (ui.state$ | async).app | humanizeAppName | async }}</span>\n </header>\n <div style="cursor:default" class="powered-by navigator-slot-bottom" *ngIf="showPoweredBy">\n <p translate>powered by Cumulocity</p>\n </div>\n </c8y-navigator-outlet>\n\n <div class="alerts">\n <c8y-alert-outlet></c8y-alert-outlet>\n </div>\n <c8y-tabs-outlet\n #tabsComponent\n [tabs]="tabs.items$ | async"\n [navigatorOpen]="headerService.navigatorOpen$ | async"\n [orientation]="tabs.orientation$ | async"\n >\n </c8y-tabs-outlet>\n <c8y-action-bar\n #actionBarComponent\n [navigatorOpen]="headerService.navigatorOpen$ | async"\n [hasTabs]="tabsComponent.hasTabs"\n [isTabsHorizontal]="tabsComponent.isHorizontal"\n [items]="actionBar.items$ | async"\n >\n </c8y-action-bar>\n\n <div\n class="mcontainer"\n [ngClass]="{\n open: headerService.navigatorOpen$ | async,\n \'no-apps-margin\': noAppsMargin$ | async,\n \'horizontal-tabs\': tabsComponent.isHorizontal,\n \'vertical-tabs\': !tabsComponent.isHorizontal,\n \'has-tabs\': tabsComponent.hasTabs,\n \'has-action-bar\': !actionBarComponent.hidden\n }"\n >\n <div class="container-fluid">\n <router-outlet></router-outlet>\n <ng-content select="#c8y-legacy-view"></ng-content>\n \x3c!-- legacy ng-view, will not be migrated atm --\x3e\n </div>\n </div>\n</div>\n<c8y-cookie-banner></c8y-cookie-banner>\n'})],e)}(),Wc=new t.InjectionToken("BreadcrumbFactory"),Yc=function(e){function o(t,n){var o=e.call(this)||this;return o.injector=t,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.items$=Cc(n,o.refreshTrigger,[function(){return o.injector.get(Wc,[])},Oc(o.state$)]).pipe(s.map((function(e){return o.sortByPreferredPath(e)})),s.shareReplay(1)),o}return hc(o,e),Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.prototype.refresh=function(){this.refreshTrigger.next(1)},o.prototype.selectPreferredByPath=function(e){this.preferredPath=e,this.refresh()},o.prototype.sortByPreferredPath=function(e){var t=this;return this.preferredPath?e.sort((function(e){return e.items.find((function(e){return!!e.path.match(t.preferredPath)}))?-1:1})):e},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),Zc=new t.InjectionToken("Languages"),Jc=new t.InjectionToken("Locale path"),Xc=new t.InjectionToken("Pattern Messages"),Qc=function(){function e(e){var t=this;this.patterns={},this.pipes={absoluteDate:function(e){return c.formatDate(e,"medium",t.translateService.currentLang)},translate:function(e){return t.translateService.instant(e)}},o.each(e,(function(e){Object.assign(t.patterns,e)}))}return e.prototype.translate=function(e){var t=this.translateWithPatterns(e);return t!==e?t:""},e.prototype.translateWithPatterns=function(e,t){var n=this;void 0===t&&(t=this.patterns);var a=e;return o.each(t,(function(e,t){var s,r=new RegExp(t,"g");if(r.test(a)){r.test(""),s=r.exec(a);for(var l=function(){var l=wc(s,1)[0],i=o.mapValues(e.placeholders,(function(e){var a=e.capture||e,s=l.replace(new RegExp(t,"g"),a);return e.translate&&(s=n.translateWithPatterns(s,e.translate)),s}));a=a.replace(l,n.translateWithParams(e,i)),s=r.exec(a)};null!==s;)l()}})),a},e.prototype.translateWithParams=function(e,t){void 0===t&&(t={});var n=this.translateService,a=n.defaultLang,s=n.currentLang,o=n.compiler,r=this.translateService.store.translations[s],l=this.translateService.store.translations[a],i=e.gettext,c=i;r&&(r[i]?c=r[i]:l&&l[i]&&(c=l[i]));for(var u,d=i,p=c,m=fc({},t,{noPatternMessages:!0}),g=RegExp("{{\\s*([^\\s]+)\\s*\\|\\s*([^\\s]+)\\s*}}","g");null!==(u=g.exec(i));){var h=wc(u,3),f=h[0],y=h[1],v=h[2];this.pipes[v]&&(d=d.replace(f,"{{"+y+"}}"),p=p.replace(f,"{{"+y+"}}"),m[y]=this.pipes[v](t[y]))}return r&&(r[d]=o.compile(p,s)),this.translateService.instant(d,m)},e.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[Xc]}]}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(Xc))},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"}),vc(0,t.Inject(Xc))],e)}(),eu=function(){function e(e,t){this.parser=e,this.patternMessagesService=t,this.cache={}}return e.prototype.handle=function(e){var t=e.key,n=e.interpolateParams,a=e.translateService;this.translateService=a;var s=this.getFromCache(t,n);if(!s){var o=this.getPatternMessageTranslation(t,n);s=o||this.parser.interpolate(t,n),this.addToCache(t,n,s)}return s},e.prototype.getFromCache=function(e,t){var n=this.translateService.currentLang;return(this.cache[n]||{})[this.getCacheKey(e,t)]},e.prototype.addToCache=function(e,t,n){var a=this.translateService.currentLang;(this.cache[a]=this.cache[a]||{})[this.getCacheKey(e,t)]=n},e.prototype.getCacheKey=function(e,t){return t?e+" "+JSON.stringify(t):e},e.prototype.getPatternMessageTranslation=function(e,t){if(!t||!t.noPatternMessages)return this.patternMessagesService.translateService||(this.patternMessagesService.translateService=this.translateService),this.patternMessagesService.translate(e)},e.ctorParameters=function(){return[{type:i.TranslateParser},{type:Qc}]},e=yc([t.Injectable()],e)}(),tu={updatesList:{capture:"$1",translate:{"status='(.+?)'":{gettext:'status="{{status | translate}}"',placeholders:{status:"$1"}},"generalStatus='(.+?)'":{gettext:'generalStatus="{{generalStatus | translate}}"',placeholders:{generalStatus:"$1"}},"progress='(.+?)'":{gettext:'progress="{{progress}}"',placeholders:{progress:"$1"}},"note=(.+?)":{gettext:'note="{{note}}"',placeholders:{note:"$1"}}}}},nu={"^Access is denied$":{gettext:"Access denied."},"^Alarm created$":{gettext:"Alarm created"},"^Alarm updated$":{gettext:"Alarm updated"},"^API is not available with the new domain$":{gettext:"Could not activate custom domain. DNS setup is incorrect."},"^Application with given name already exist$":{gettext:"Application with given name already exists."},"^Application with id (.+?) is already assigned to the tenant (.+?)$":{gettext:'This application is already assigned to tenant "{{tenant}}".',placeholders:{tenant:"$2"}},"^Apply software changes: (.+?)\\.?$":{gettext:"Apply software changes: {{ softwareChanges }}",placeholders:{softwareChanges:{capture:"$1",translate:{'install "(.+?)" \\(version: (.+?)\\)':{gettext:'install "{{ softwareName }}" (version: {{ softwareVersion }})',placeholders:{softwareName:"$1",softwareVersion:"$2"}},'install "([^"]+)"(?! \\(version: .+?\\))':{gettext:'install "{{ softwareName }}"',placeholders:{softwareName:"$1"}},'delete "(.+?)" \\(version: (.+?)\\)':{gettext:'delete "{{ softwareName }}" (version: {{ softwareVersion }})',placeholders:{softwareName:"$1",softwareVersion:"$2"}},'delete "([^"]+)"(?! \\(version: .+?\\))':{gettext:'delete "{{ softwareName }}"',placeholders:{softwareName:"$1"}}}}}},"^Assign device profile (.+?) to device (.+?)$":{gettext:"Assign device profile {{profileName}} to device {{deviceName}}",placeholders:{profileName:"$1",deviceName:"$2"}},"^(.+)pplication for tenant (.+) with properties \\( (.+?) \\) already exists$":{gettext:'Application for tenant "{{tenant}}" with the following values ({{valuesList}}) already exists.',placeholders:{tenant:"$2",valuesList:"$3"}},"^Authentication failed! : User account is locked$":{gettext:"Authentication failed due to: user account is locked."},"^Availability monitoring record$":{gettext:"Availability monitoring record"},"^Can not activate a certificate which is either expired or not yet valid$":{gettext:"Cannot activate a certificate which is either expired or not yet valid."},"^Cannot add certificate - certificate with (.+?) fingerprint already exists. : Certificate with (.+?) fingerprint already exists.":{gettext:"Could not add certificate. Certificate with {{fingerprint}} fingerprint already exists.",placeholders:{fingerprint:"$1"}},"^Cannot change password. : Provided token does not exist.$":{gettext:"Cannot change password: provided token is invalid."},"^Cannot deploy module (.*)$":{gettext:'Cannot deploy module due to error: "{{ errorMessage | translate }}".',placeholders:{errorMessage:"$1"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}}.',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}} near reserved keyword "{{keyword}}".',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6",keyword:"$7"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+), please check the where clause \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}}, check "where" clause.',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6"}},"^Cannot deploy module (.+?)! : Deployment failed in module '(.+?)' in expression '(.+?)' : Exception compiling script '(.+?)' of dialect '(.+?)': missing (.+?) before statement \\((.+?)\\) \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": exception compiling script "{{scriptName}}" of dialect "{{scriptDialect}}": missing "{{missingSyntax}}" before statement "{{affectedStatement}}".',placeholders:{moduleName:"$1",expression:"$3",scriptName:"$4",scriptDialect:"$5",missingSyntax:"$6",affectedStatement:"$7"}},"^Cannot execute bulk operation on empty group. Group with id='(\\d+?)' doesn't have child assets.$":{gettext:'Could not execute bulk operation on an empty group. Group with ID "{{groupId}}" has no child assets.',placeholders:{groupId:"$1"}},"^Cannot execute bulk operation on empty group. DynamicGroup with id='(\\d+?)' doesn't have child assets$":{gettext:'Could not execute bulk operation on an empty group. Smart group with ID "{{groupId}}" has no child assets.',placeholders:{groupId:"$1"}},"^Cannot parse X509 certificate. : Could not parse certificate: (.+?)$":{gettext:"Could not parse X.509 certificate: {{ failureReason | translate }}.",placeholders:{failureReason:"$1"}},"^Cannot reschedule bulk operation. All its operations are successful$":{gettext:"Cannot reschedule bulk operation. All its operations are already successful."},"^Cannot reset user password : Cannot find user with such email.$":{gettext:"Cannot reset password for user with such email: email not found."},"^Cannot update/delete application binary via this endpoint$":{gettext:"Cannot update/delete application binary via this endpoint"},"^Can't delete user because it is used by another managed object$":{gettext:"Cannot delete device with associated device owner because this owner is still assigned to other device(s). Try to remove only the device."},"^Cep module created$":{gettext:"CEP module created"},"^Cep module updated$":{gettext:"CEP module updated"},"^Cep module deleted$":{gettext:"CEP module deleted"},'^Cep module "(.+?)" created$':{gettext:'CEP module "{{name}}" created',placeholders:{name:"$1"}},'^Cep module "(.+?)" updated$':{gettext:'CEP module "{{name}}" updated',placeholders:{name:"$1"}},'^Cep module "(.+?)" deleted$':{gettext:'CEP module "{{name}}" deleted',placeholders:{name:"$1"}},"^Command state is invalid: (.+)$":{gettext:"Command state is invalid: {{violations}}",placeholders:{violations:{capture:"$1",translate:{"(\\w+?) - may not be null":{gettext:'"{{field}}" must not be null',placeholders:{field:"$1"}}}}}},"^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\\.$":{gettext:'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.',placeholders:{endpointName:"$1",keyType:"$2",fingerprint:"$3",host:"$4",port:"$5"}},'^Could not login to ssh server on endpoint "(.+)"\\. Provided credential for user "(.+)" is incorrect\\.$':{gettext:'Could not access SSH server on endpoint "{{endpointName}}". Provided credentials for user "{{userName}}" are incorrect.',placeholders:{endpointName:"$1",userName:"$2"}},"^Could not save object remoteAccessUpdate: (.+)$":{gettext:"{{errorMessages}}",placeholders:{errorMessages:{capture:"$1",translate:{"Could not recognize host-key format":{gettext:'Could not recognize "Host key" format'},"Could not recognize key-pair format":{gettext:'Could not recognize the format of "Public key" or "Private key"'}}}}},"^Could not update user. : Error persisting user (.+?)!$":{gettext:'Could not update user "{{username}}".',placeholders:{username:"$1"}},"ˆCreate bulk operation$":{gettext:"Create bulk operation"},"^Create bulk operation: (.+)$":{gettext:"Create bulk operation: {{updatesList}}",placeholders:tu},"^Creation ramp must be greater than (\\d+?)$":{gettext:"Bulk operation delay must be greater than {{minSeconds}} seconds.",placeholders:{minSeconds:"$1"}},"^Created container$":{gettext:"Container created."},"^Created pod: (.+)$":{gettext:'Pod "{{imageName}}" created.',placeholders:{imageName:"$1"}},"^CSV file contained empty dataset$":{gettext:"No entries found in uploaded CSV file."},"^Cycle detected for route (.+?)!$":{gettext:"Cycle detected for route {{route}}.",placeholders:{route:"$1"}},"^Data broker processing is currently overloaded and may stop forwarding your data\\. Please contact support\\.$":{gettext:"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\\.$":{gettext:"Data broker processing is not able to connect to destination tenant, thus data forwarding is not working. Please contact support."},"^Delete bulk operation$":{gettext:"Delete bulk operation"},"^Delete bulk operation: (.+)$":{gettext:"Delete bulk operation: {{updatesList}}",placeholders:tu},"^Device id '(.+?)' contains '(.+?)' character which is not permitted.$":{gettext:'ID "{{deviceId}}" contains invalid character: "{{invalidCharacter}}".',placeholders:{deviceId:"$1",invalidCharacter:"$2"}},"^Device name: '(.+?)', alarm text: '(.+?)'$":{gettext:'Device name: "{{deviceName}}", alarm text: "{{alarmText | translate}}"',placeholders:{deviceName:"$1",alarmText:"$2"}},"^Display name$":{gettext:"Login alias"},"^Domain name in uploaded certificate differs from the one in use$":{gettext:"Domain name in uploaded certificate differs from the one in use. Please deactivate the custom domain before uploading new certificate."},"^Domain name is already in use by another tenant!$":{gettext:"Domain name is already used by another tenant."},"^Duplicated connector for instanceUrl (.+?)!$":{gettext:"Target URL {{targetUrl}} already used by another connector.",placeholders:{targetUrl:"$1"}},"^Duplicated connector for name (.+?)!$":{gettext:'Connector name "{{name}}" already used by another connector.',placeholders:{name:"$1"}},"^Entry is outside of the target dir: (.+)$":{gettext:'File entry outside of the target directory: "{{path}}".',placeholders:{path:"$1"}},"^Error during password validation. : Password must have at least (\\d+?) characters and no more than (\\d+?) and must contain only Latin1 characters.$":{gettext:"Password is invalid. It must have at least {{minCharactersCount}} and no more than {{maxCharactersCount}} characters.",placeholders:{minCharactersCount:"$1",maxCharactersCount:"$2"}},"^Error during password validation. : Your password has been used already. Choose another.$":{gettext:"This password has already been used earlier. Use a different one."},"^Error in statement (.+?):(.+?)! : Incorrect syntax near '(.+?)' near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$":{gettext:'Error in statement {{moduleName}}:{{statementNumber}}. Incorrect syntax near expression "{{expression}}" near reserved keyword "{{keyword}}".',placeholders:{moduleName:"$1",statementNumber:"$2",expression:"$3",keyword:"$4"}},"^External id not found; external id = ID \\[type=(.+?), value=(.+?)\\]$":{gettext:'External ID not found for type "{{type}}" and value "{{value}}".',placeholders:{type:"$1",value:"$2"}},"^Error occurred when trying to find an Application for id ID (.+) : Could not find application by ID (\\d+)$":{gettext:"Could not find application by ID {{applicationId}}.",placeholders:{applicationId:"$2"}},'^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"}':{gettext:"Unable to find option by given key: sigfox-agent/provider.token"},"^Failed to delete application. : Cannot remove application assigned to other tenants.$":{gettext:"Could not delete application assigned to other tenants."},"^Failed to extract certificate from PKCS12$":{gettext:"Failed to extract certificate from PKCS12."},"^Failed to update domain at the platform$":{gettext:"Failed to update domain at the platform."},"^Finding device data from database failed : No managedObject for id '(.+?)'!$":{gettext:'Could not find managed object with ID "{{deviceId}}".',placeholders:{deviceId:"$1"}},"^Following mandatory fields should be included: (.+?)$":{gettext:"Following mandatory fields should be included: {{fields}}",placeholders:{fields:"$1"}},"^Global Role updated$":{gettext:"Global role updated"},"^Global Role (.+?) updated$":{gettext:'Global role "{{name}}" updated',placeholders:{name:"$1"}},"^Global Role (.+?) updated: (.+)$":{gettext:'Global role "{{name}}" updated: {{updatesList}}',placeholders:{name:"$1",updatesList:{capture:"$2",translate:{"applications \\[([^\\]]+?)\\] added":{gettext:"applications {{list}} added",placeholders:{list:"$1"}},"applications \\[([^\\]]+?)\\] removed":{gettext:"applications {{list}} removed",placeholders:{list:"$1"}},"roles \\[([^\\]]+?)\\] added":{gettext:"roles {{list}} added",placeholders:{list:"$1"}},"roles \\[([^\\]]+?)\\] removed":{gettext:"roles {{list}} removed",placeholders:{list:"$1"}}}}}},"^Global Roles$":{gettext:"Global roles"},"^Operation updated: (.+)$":{gettext:"Operation updated: {{updatesList}}",placeholders:{updatesList:{capture:"$1",translate:{"status='(.+?)'":{gettext:'status="{{status | translate}}"',placeholders:{status:"$1"}},"description='(.+?)'":{gettext:'description="{{description | translate}}"',placeholders:{description:"$1"}},"device name='(.+?)'":{gettext:'device name="{{deviceName}}"',placeholders:{deviceName:"$1"}},"failure reason='(.+?)'":{gettext:'failure reason="{{failureReason | translate}}"',placeholders:{failureReason:"$1"}}}}}},"^ID \\[type=(.+?), value=(.+?)\\] was already bound to different Global ID.$":{gettext:'External ID "{{value}}" of the type "{{type}}" already exists.',placeholders:{type:"$1",value:"$2"}},"^Invalid credentials! : Bad credentials$":{gettext:"Invalid credentials."},"^Invalid credentials! : No phone number provided$":{gettext:"Log into the management tenant first and enter your phone number."},"^Inventory Role removed$":{gettext:"Inventory role removed"},"^Inventory Role (.+?) removed":{gettext:'Inventory role "{{name}}" deleted.',placeholders:{name:"$1"}},"^Inventory Role updated$":{gettext:"Inventory role updated"},"^Inventory Role (.+?) updated":{gettext:'Inventory role "{{name}}" updated.',placeholders:{name:"$1"}},"^I/O error: Connection refused; nested exception is Connection refused : Connection refused":{gettext:"Connection refused"},"^I/O error: Read timed out; nested exception is Read timed out : Read timed out":{gettext:"Read timed out"},"^Log file requested$":{gettext:"Log file requested."},"^Managed object deleted$":{gettext:"Managed object deleted"},'^Managed object "(.+?)" deleted$':{gettext:'Managed object "{{name}}" deleted',placeholders:{name:"$1"}},"^Maximum file size exceeded$":{gettext:"Maximum file size exceeded."},"^Message with ID (.+?) doesn't exist in smart rest template (.+?)$":{gettext:'Message with ID "{{messageId}}" doesn\'t exist in SmartREST template with ID "{{templateId}}"',placeholders:{messageId:"$1",templateId:"$2"}},"^NewDeviceRequest for id = (.+?) already exists.$":{gettext:"Device registration request with ID {{id}} already exists.",placeholders:{id:"$1"}},"^No communication with device since (.+?)$":{gettext:"No communication with device since {{timestamp | absoluteDate}}.",placeholders:{timestamp:"$1"}},"^No data received from device within required interval.$":{gettext:"No data received from device within required interval."},"^No LoRa provider settings are found. Please configure the connectivity settings.$":{gettext:"No LoRa provider settings are found. Please configure the connectivity settings."},"^Not within any context!$":{gettext:"A problem occurred with microservice subscription."},"^Maximum age cannot be bigger than 10 years.$":{gettext:"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.$":{gettext:"Microservice application name is incorrect: only lower case letters, digits and dashes allowed. Maximum length: {{maxLength}}.",placeholders:{maxLength:"$1"}},"^Microservice not available.*$":{gettext:"Microservice is not available."},"^Operation created$":{gettext:"Operation created."},"^Operation updated$":{gettext:"Operation updated."},"^Operation created: status='(.+?)'.":{gettext:'Operation created: status="{{status | translate}}".',placeholders:{status:"$1"}},"^Option created$":{gettext:"Option created."},'^Option "(.+?)" created$':{gettext:'Option "{{option}}" created.',placeholders:{option:"$1"}},"^Option deleted$":{gettext:"Option deleted."},'^Option "(.+?)" deleted$':{gettext:'Option "{{option}}" deleted.',placeholders:{option:"$1"}},"^Owner field error. : Cannot introduce cyclic dependency.":{gettext:"Could not introduce cyclic ownership dependency."},"^Password change is temporary blocked.$":{gettext:"Password change is temporarily blocked."},"^Password cipher does not match":{gettext:"Password cipher does not match."},"^Platform application cannot be added to, nor removed from any tenant.$":{gettext:"Platform application cannot be added to, nor removed from any tenant."},"^Private key must be provided in KEY_PAIR credentials$":{gettext:'Private key must be provided when "Public / private keys" option is selected.'},"^Private key cipher does not match":{gettext:"Private key cipher does not match"},'^Protocol "(.+?)" does not support "(.+?)" credentials type$':{gettext:'Protocol "{{protocol}}" does not support "{{credentialsType}}" credentials type.',placeholders:{protocol:"$1",credentialsType:"$2"}},'^pulling image "(.+)"$':{gettext:'Pulling image: "{{imageName}}".',placeholders:{imageName:"$1"}},"^Real-time event processing is currently overloaded and may stop processing your events\\. Please contact support\\.$":{gettext:"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.$":{gettext:'Could not find the resource with ID "{{id}}".',placeholders:{id:"$1"}},"^Retrieve configuration snapshot from device (.+?)":{gettext:"Retrieve configuration snapshot from device {{deviceName}}",placeholders:{deviceName:"$1"}},"^Retrieve (.+?) configuration snapshot from device (.+?)":{gettext:"Retrieve {{configurationType}} configuration snapshot from device {{deviceName}}",placeholders:{configurationType:"$1",deviceName:"$2"}},"^Scaled up replica set (.+) to (\\d+)$":{gettext:'Replica set "{{replicaSetName}}" scaled up to "{{scaleNumber}}".',placeholders:{replicaSetName:"$1",scaleNumber:"$2"}},"^Send configuration snapshot (.+?) of configuration type (.+?) to device (.+?)":{gettext:"Send configuration snapshot {{snapshotName}} of configuration type {{configurationType}} to device {{deviceName}}",placeholders:{snapshotName:"$1",configurationType:"$2",deviceName:"$3"}},"^Send configuration snapshot (.+?) to device (.+?)":{gettext:"Send configuration snapshot {{snapshotName}} to device {{deviceName}}",placeholders:{snapshotName:"$1",deviceName:"$2"}},"^Simulator state is invalid: (.+)$":{gettext:"Simulator state is invalid: {{violations}}",placeholders:{violations:{capture:"$1",translate:{"(\\w+?) - may not be null":{gettext:'"{{field}}" should not be null',placeholders:{field:"$1"}},"(\\w+?) - must be less than or equal to (\\d+)":{gettext:'"{{field}}" must be less than or equal to {{maxValue}}',placeholders:{field:"$1",maxValue:"$2"}},"(\\w+?) - should not contain null values":{gettext:'"{{field}}" should not contain null values',placeholders:{field:"$1"}}}}}},"^Smart rest template (.+?) doesn't exist$":{gettext:'SmartREST template with id "{{templateId}}" doesn\'t exist',placeholders:{templateId:"$1"}},"^Smart rule created$":{gettext:"Smart rule created."},"^Smart rule updated$":{gettext:"Smart rule updated."},"^Smart rule enabled$":{gettext:"Smart rule activated."},"^Smart rule disabled$":{gettext:"Smart rule deactivated."},"^Smart rule deleted$":{gettext:"Smart rule deleted."},'^Smart rule "(.+?)" created$':{gettext:'Smart rule "{{name}}" created.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" updated$':{gettext:'Smart rule "{{name}}" updated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" enabled$':{gettext:'Smart rule "{{name}}" activated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" disabled$':{gettext:'Smart rule "{{name}}" deactivated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" deleted$':{gettext:'Smart rule "{{name}}" deleted.',placeholders:{name:"$1"}},"^Started container$":{gettext:"Container started."},"^Successfully assigned (.+) to (.+)$":{gettext:'"{{imageName}}" assigned to "{{address}}".',placeholders:{imageName:"$1",address:"$2"}},'^Successfully pulled image "(.+)"$':{gettext:'Image "{{imageName}}" pulled.',placeholders:{imageName:"$1"}},"^Tenant creation failed. : Tenant with given id already exists.$":{gettext:"Could not create a tenant. Tenant with given domain/URL already exists."},'^Tenant id cannot be a reserved sql keyword "(.+?)".$':{gettext:'Could not use a reserved SQL keyword "{{tenantId}}" as a domain name.',placeholders:{tenantId:"$1"}},'^Tenant "(.+?)" activated$':{gettext:'Tenant "{{tenant}}" activated.',placeholders:{tenant:"$1"}},"^Tenant (.+?) has sub-tenants, please remove them first!$":{gettext:'Could not remove tenant "{{tenant}}". Remove its subtenants first.',placeholders:{tenant:"$1"}},"^Tenant activated$":{gettext:"Tenant activated"},'^Tenant "(.+?)" created$':{gettext:'Tenant "{{tenant}}" created.',placeholders:{tenant:"$1"}},"^Tenant created$":{gettext:"Tenant created"},'^Tenant "(.+?)" deleted$':{gettext:'Tenant "{{tenant}}" deleted.',placeholders:{tenant:"$1"}},"^Tenant deleted$":{gettext:"Tenant deleted"},'^Tenant "(.+?)" suspended$':{gettext:'Tenant "{{tenant}}" suspended.',placeholders:{tenant:"$1"}},"^Tenant suspended$":{gettext:"Tenant suspended"},'^Tenant "(.+?)" updated: (.+?)$':{gettext:'Tenant "{{tenant}}" updated: {{properties}}.',placeholders:{tenant:"$1",properties:"$2"}},"^Tenant updated$":{gettext:"Tenant updated"},"^Too Many Requests$":{gettext:"Too many requests. Try again later."},"^User alias equals username '(.+)'$":{gettext:"Username and login alias must be different."},"^User created$":{gettext:"User created"},"^User (.+?) created$":{gettext:'User "{{name}}" created',placeholders:{name:"$1"}},"^User deleted$":{gettext:"User deleted"},"^User (.+?) deleted$":{gettext:'User "{{name}}" deleted',placeholders:{name:"$1"}},"^User updated$":{gettext:"User updated"},"^User (.+?) updated: (.+)$":{gettext:'User "{{name}}" updated: {{updatesList}}',placeholders:{name:"$1",updatesList:{capture:"$2",translate:{"delegatedBy='(.+?)'":{gettext:'delegated by: "{{delegate}}"',placeholders:{delegate:"$1"}},"owner='(.+?)'":{gettext:'owner: "{{owner}}"',placeholders:{owner:"$1"}},"inventory assignment \\[(.+?)\\] added":{gettext:"inventory assignment [{{inventoryAssignment}}] added",placeholders:{inventoryAssignment:"$1"}},"inventory assignment \\[(.+?)\\] removed":{gettext:"inventory assignment [{{inventoryAssignment}}] removed",placeholders:{inventoryAssignment:"$1"}},"applications \\[(.+?)\\] added$":{gettext:"applications [{{applicationsList}}] added",placeholders:{applicationsList:"$1"}},"applications \\[(.+?)\\] removed$":{gettext:"applications [{{applicationsList}}] removed",placeholders:{applicationsList:"$1"}},"global roles \\[(.+?)\\] added$":{gettext:"global roles [{{globalRolesList}}] added",placeholders:{globalRolesList:"$1"}},"global roles \\[(.+?)\\] removed$":{gettext:"global roles [{{globalRolesList}}] removed",placeholders:{globalRolesList:"$1"}}}}}},"^User with username '(.+?)' already exists! : Duplicated: (.+?)$":{gettext:'User "{{username}}" already exists.',placeholders:{username:"$1"}},"^User with username or alias '(.+)' already exists! : Duplicated: (.+)$":{gettext:'User with username or login alias "{{usernameOrAlias}}" already exists.',placeholders:{usernameOrAlias:"$1"}},"^User with email '(.+?)' already exists! : Duplicated: (.+?)$":{gettext:'User with email "{{email}}" already exists.',placeholders:{email:"$1"}},"^unable to find option with given key (.+?) : Could not find entity Option by ID (.+?)!$":{gettext:'Unable to get tenant option: "{{option}}".',placeholders:{option:"$2"}},"^unable to find option with given key (.+?) : There is no system property for key (.+?)$":{gettext:'Unable to get system option: "{{option}}".',placeholders:{option:"$2"}},"^Write failed with error code 16733 and error message 'trying to index text where term list is too big, max is 4mb _id: \"(.+?)\"'$":{gettext:"The uploaded image cannot be bigger than 4 MB. Please upload a smaller one."},"^Write failed with error code 17280 and error message 'WiredTigerIndex::insert: key too large to index, failing (.+?) { : \"(.+?)\" }'$":{gettext:"The chosen name is too long. Please try a shorter one."},"^You have reached devices limit. No more devices can be registered.$":{gettext:"You reached devices limit. No more devices can be registered."},'^(.+) succeeded for volume "(.+)"':{gettext:'Operation "{{operation}}" succeeded for volume "{{volume}}".',placeholders:{operation:"$1",volume:"$2"}},"^Exception on tenant (.+) in statement '(.+)': Invocation exception when invoking method '(.+)' of class '(.+)' passing parameters \\[(.+)\\] for statement '(.+)': (.+) : (.+)$":{gettext:'Exception on tenant {{tenantId}} in statement "{{moduleName}}": Invocation exception when invoking method "{{methodName}}" of class "{{classPath}}" passing parameters [{{parameters}}] for statement "{{statement}}": {{exceptionType}} : {{exceptionMessage}}.',placeholders:{tenantId:"$1",moduleName:"$2",methodName:"$3",classPath:"$4",parameters:"$5",statement:"$6",exceptionType:"$7",exceptionMessage:"$8"}},"^No nodes are available that match all of the predicates: (.+).$":{gettext:"No nodes are available that match all of the predicates: [{{predicates}}].",placeholders:{predicates:"$1"}},"^Readiness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$":{gettext:"Readiness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).",placeholders:{requestMethod:"$1",uri:"$2",protocol:"$3"}},"^Liveness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$":{gettext:"Liveness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).",placeholders:{requestMethod:"$1",uri:"$2",protocol:"$3"}},"^Error syncing pod$":{gettext:"Pod synchronization error."},"^Failed create pod sandbox.$":{gettext:"Pod sandbox creation failed."},'^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"\\}$':{gettext:'Exception on tenant {{tenantId}} in statement "{{statement}}": HTTP status code: {{httpStatusCode}} : {{message | translate}}',placeholders:{tenantId:"$1",statement:"$2",httpStatusCode:"$3",message:"$4"}},"^User '(.+)' is managed by a remote identity management service defined by an administrator, direct update is forbidden$":{gettext:'User "{{userName}}" is managed by a remote identity management service defined by an administrator, direct update is forbidden.',placeholders:{userName:"$1"}},'^Added new child device to "(.+)" \\(ID: (.+)\\).$':{gettext:'Added new child device to "{{parentDeviceName}}" (ID: {{parentDeviceId}}).',placeholders:{parentDeviceName:"$1",parentDeviceId:"$2"}},'^Updated child device of "(.+)" \\(ID: (.+)\\).$':{gettext:'Updated child device of "{{parentDeviceName}}" (ID: {{parentDeviceId}}).',placeholders:{parentDeviceName:"$1",parentDeviceId:"$2"}},'^Added child device "(.+)" \\(ID: (.+)\\).$':{gettext:'Added child device "{{name}}" (ID: {{id}}).',placeholders:{name:"$1",id:"$2"}},'^Removed child device "(.+)" \\(ID: (.+)\\).$':{gettext:'Removed child device "{{name}}" (ID: {{id}}).',placeholders:{name:"$1",id:"$2"}},'^Change value of "(.+)" to (.+) (.+).$':{gettext:'Change value of "{{name}}" to {{value}}{{unit}}.',placeholders:{name:"$1",value:"$2",unit:"$3"}},'^Change value of "(.+)" to (.+).$':{gettext:'Change value of "{{name}}" to {{value}}.',placeholders:{name:"$1",value:"$2"}},'^Change status of "(.+)" to "(.+)".$':{gettext:'Change status of "{{name}}" to "{{label}}".',placeholders:{name:"$1",label:"$2"}},'^Send message "(.+)".$':{gettext:'Send message "{{str}}".',placeholders:{str:"$1"}},"^Close relay (.+).$":{gettext:"Close relay {{number}}.",placeholders:{number:"$1"}},"^Open relay (.+).$":{gettext:"Open relay {{number}}.",placeholders:{number:"$1"}},"^Change trace status to (.+).$":{gettext:"Change trace status to {{state | translate}}.",placeholders:{state:"$1"}},"^Change relay status to (.+).$":{gettext:"Change relay status to {{status | translate}}.",placeholders:{status:"$1"}},"^Closing relay (.+).$":{gettext:"Closing relay {{number}}.",placeholders:{number:"$1"}},"^Opening relay (.+).$":{gettext:"Opening relay {{number}}.",placeholders:{number:"$1"}},"^Update bulk operation$":{gettext:"Update bulk operation"},"^Update bulk operation: (.+)$":{gettext:"Update bulk operation: {{updatesList}}",placeholders:tu},'^Update firmware to: "?(.+?)"? \\(version: (.+)\\)\\.?$':{gettext:'Update firmware to: "{{ name }}" (version: {{ version }})',placeholders:{name:"$1",version:"$2"}},'^Update firmware to: "?(.+?)"?\\.?$':{gettext:'Update firmware to: "{{ name }}"',placeholders:{name:"$1"}},"^Update configuration to (.+).$":{gettext:"Update configuration to: {{ name }}.",placeholders:{name:"$1"}},"^Apply device profile: (.+).?$":{gettext:"Apply device profile: {{ name }}",placeholders:{name:"$1"}},"^Execute generic command: (.+).?$":{gettext:"Execute generic command: {{command}}",placeholders:{command:"$1"}},"^Failed to refresh application. : Cannot refresh non local-hosted application.$":{gettext:"Could not reactivate the application as it is not hosted locally."},"^Failed to refresh application. : Cannot refresh application without active version id.$":{gettext:"Could not reactivate the application as it has no active version."},"^Scaled down replica set (.+) to (\\d+)$":{gettext:'Replica set "{{replicaSetName}}" scaled down to "{{scaleNumber}}".',placeholders:{replicaSetName:"$1",scaleNumber:"$2"}},"^Deleted pod: (.+)$":{gettext:'Pod "{{imageName}}" deleted.',placeholders:{imageName:"$1"}},'^Container image "(.+)" already present on machine$':{gettext:'Container image "{{imageName}}" already exists.',placeholders:{imageName:"$1"}},"^Error updating tenant! Cannot insert second configuration for Password code grant internal/Bad Request$":{gettext:"This login mode was already set by another administrator. Refresh the page to update the data."}},au=function(){function e(){this.cachedDictionary={}}return e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"})],e)}(),su=function(){function e(e,t,n,a,s){void 0===a&&(a=null),void 0===s&&(s=null),this.http=e,this.optionsService=t,this.cachedLocaleDictionaryService=n,this.path=a,this.languages=s}return e.prototype.getTranslation=function(e){var t=this,n=""+(this.path||"")+e+".json";return this.languages&&this.languages[e]&&this.languages[e].url&&(n=this.languages[e].url),this.http.get(n).pipe(s.map((function(n){return t.optionsService.langsDetails&&t.optionsService.langsDetails[e]?fc({},n[e],t.optionsService.langsDetails[e]):n[e]})),s.tap((function(n){t.cachedLocaleDictionaryService.cachedDictionary[e]=n})),s.map((function(e){return t.getDictionaryWithTrimmedKeys(e)})),s.catchError((function(){return a.of({})})))},e.prototype.getDictionaryWithTrimmedKeys=function(e){return o.mapKeys(e,(function(e,t){return ou(t)}))},e.ctorParameters=function(){return[{type:d.HttpClient},{type:qc},{type:au},{type:String,decorators:[{type:t.Inject,args:[Jc]}]},{type:void 0,decorators:[{type:t.Inject,args:[Zc]}]}]},e=yc([t.Injectable(),vc(3,t.Inject(Jc)),vc(4,t.Inject(Zc))],e)}();function ou(e){return e.replace(/(\r\n|\n|\r)/gm,"").replace(/\s{2,}/g," ").trim()}var ru=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return hc(n,e),n.prototype.getValue=function(e,t){var n=ou(t),a=o.get(e,[n]);a||t.split(".").length>1&&(a=o.get(e,t));return a},n=yc([t.Injectable()],n)}(i.TranslateDefaultParser),lu=function(){function e(e,n,a){var s=this;this.translateService=e,this.element=n,this._ref=a,this.htmlUpdateEvent=new t.EventEmitter,this.onTranslationChangeSub||(this.onTranslationChangeSub=this.translateService.onTranslationChange.subscribe((function(e){e.lang===s.translateService.currentLang&&s.checkNodes()}))),this.onLangChangeSub||(this.onLangChangeSub=this.translateService.onLangChange.subscribe((function(e){s.checkNodes()}))),this.onDefaultLangChangeSub||(this.onDefaultLangChangeSub=this.translateService.onDefaultLangChange.subscribe((function(e){s.checkNodes()})))}return Object.defineProperty(e.prototype,"translateParams",{set:function(e){o.isEqual(this.currentParams,e)||(this.currentParams=e,this.checkNodes())},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewChecked=function(){this.checkNodes()},e.prototype.checkNodes=function(){this.isLookupKeyMissing()&&(this.element.nativeElement.lookupKey=this.getLookupKey()),this.translateAndUpdateHtmlContent(),this.htmlUpdateEvent.emit()},e.prototype.ngOnDestroy=function(){this.onLangChangeSub&&this.onLangChangeSub.unsubscribe(),this.onDefaultLangChangeSub&&this.onDefaultLangChangeSub.unsubscribe(),this.onTranslationChangeSub&&this.onTranslationChangeSub.unsubscribe(),this.htmlUpdateEvent.complete()},e.prototype.getLookupKey=function(){return this.element.nativeElement.innerHTML.replace(/<!--.*?-->/gs,"").trim()},e.prototype.isLookupKeyMissing=function(){return!this.element.nativeElement.lookupKey},e.prototype.lookupKeyExist=function(){return this.element.nativeElement.lookupKey},e.prototype.translateAndUpdateHtmlContent=function(){this.lookupKeyExist()&&(this.element.nativeElement.innerHTML=this.translateService.instant(this.element.nativeElement.lookupKey,this.currentParams||{}))},e.ctorParameters=function(){return[{type:i.TranslateService},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},yc([t.Input()],e.prototype,"translateParams",null),e=yc([t.Directive({selector:"[forceHtmlTranslate]"})],e)}();try{require("@c8y/ngx-components/locales/de.po"),require("@c8y/ngx-components/locales/en.po"),require("@c8y/ngx-components/locales/es.po"),require("@c8y/ngx-components/locales/fr.po"),require("@c8y/ngx-components/locales/ja_JP.po")}catch(e){}var iu={en:"en-GB","en-EN":"en-GB"};function cu(e,t,n,a,s){return new su(e,t,n,a,s)}function uu(e){return e.localePath}function du(e){return e.languages}function pu(e){return{get lang(){return mu(e.state.lang||"en")},toLowerCase:function(){return this.lang.toLowerCase()},toString:function(){return this.lang}}}function mu(e){return iu[e]||e}var gu=function(){function e(){}var n;return n=e,e.providers=function(){return[{provide:t.LOCALE_ID,useFactory:pu,deps:[$c]},{provide:Xc,useValue:nu,multi:!0},{provide:Jc,useFactory:uu,deps:[qc]},{provide:Zc,useFactory:du,deps:[qc]},{provide:i.TranslateLoader,useFactory:cu,deps:[d.HttpClient,qc,au,Jc,Zc]},{provide:i.TranslateCompiler,useClass:i.TranslateFakeCompiler},{provide:i.TranslateParser,useClass:ru},{provide:i.MissingTranslationHandler,useClass:eu},i.TranslateStore,i.TranslateService,{provide:i.USE_STORE,useValue:void 0},{provide:i.USE_DEFAULT_LANG,useValue:void 0},{provide:i.USE_EXTEND,useValue:!1},{provide:i.DEFAULT_LANGUAGE,useValue:void 0}]},e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e=n=yc([t.NgModule({exports:[i.TranslateModule,lu],imports:[d.HttpClientModule],declarations:[lu]})],e)}();var hu=new Map;function fu(e){return new Promise((function(t,n){hu.has(e)?t(hu.get(e)):fetch("assets/locales/angular/"+e+".js").then((function(e){return e.text()})).then((function(n){var a=function(e){var t=e.split(/\n/).map((function(e){return e.trim()})).filter(Boolean).filter((function(e){return!e.match(/^\/?\*/)&&!e.match(/^\/\//)})).join("\n");return new Function("var exports = {};\nvar module = { exports: exports };\n"+t+"\nreturn exports;")()}(n);hu.set(e,a),t(a)})).catch(n)}))}var yu,vu,ju,bu,wu,Su,Cu=function(){function e(e,t,n){var a=this;this.ngxTranslate=e,this.ui=t,this.options=n,this.langsDetail=this.options.get("languages",{}),this.langs=o.keys(this.langsDetail).filter((function(e){return a.langsDetail[e]})),this.DEFAULT_SEPARATOR="_";var s=this.queryStringLang();s&&this.saveInLocalStorage(s)}var n;return n=e,e.defaultLang=function(){return window.localStorage.getItem(n.SAVE_LANGUAGE_KEY)},e.prototype.switchToLanguage=function(e){return jc(this,void 0,void 0,(function(){var t,n,a;return bc(this,(function(s){switch(s.label){case 0:t=e.replace("_","-"),s.label=1;case 1:return s.trys.push([1,3,,7]),[4,this.loadLocales(t)];case 2:return s.sent(),[3,7];case 3:return n=s.sent(),(a=t.split("-").shift())===t?[3,5]:[4,this.loadLocales(a)];case 4:return s.sent(),[3,6];case 5:throw n;case 6:return[3,7];case 7:return this.setLanguage(e),[2]}}))}))},e.prototype.loadLocales=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return[4,fu(mu(e))];case 1:return t=n.sent(),c.registerLocaleData(t.default),[2]}}))}))},e.prototype.setLanguage=function(e){var t=this;this.ngxTranslate.setDefaultLang(this.options.get("defaultLanguage","en")),this.ngxTranslate.use(e).subscribe((function(){t.ui.state$.next(fc({},t.ui.state,{lang:e}))}))},e.prototype.firstSupportedLanguage=function(){var e=this,t=[this.queryStringLang(),this.localStorageLang()].concat([this.options.get("defaultLanguage")]).concat(this.browserLangs()).concat(["en"]).filter(Boolean).find((function(t){return e.getSupported(t)}));return this.getSupported(t)},e.prototype.convertToLanguageCodePO=function(e){var t=e.indexOf("-")>-1?"-":this.DEFAULT_SEPARATOR,n=wc(e.split(t),2),a=n[0],s=n[1];return""+a+(s?""+this.DEFAULT_SEPARATOR+s:"")},e.prototype.getNativeLanguage=function(e){return((this.langsDetail||{})[e]||{}).nativeName||e},e.prototype.saveInLocalStorage=function(e){window.localStorage.setItem(n.SAVE_LANGUAGE_KEY,e)},e.prototype.getSupported=function(e){return this.langs.find((function(t){return t===e}))||this.langs.find((function(t){return t.startsWith(e)}))},e.prototype.queryStringLang=function(){return this.getQueryParameter("lang")},e.prototype.localStorageLang=function(){return window.localStorage.getItem(n.SAVE_LANGUAGE_KEY)},e.prototype.browserLangs=function(){var e=window.navigator;return["languages","language","browserLanguage","systemLanguage","userLanguage"].reduce((function(t,n){var a=e[n];return"string"==typeof a?t.push(a):Array.isArray(a)&&(t=t.concat(a)),t}),[])},e.prototype.getQueryParameter=function(e){var t;return window.location.search.substring(1).split("&").find((function(n){var a=wc(n.split("="),2),s=a[0],o=a[1];return s===e&&(t=o),t})),t},e.SAVE_LANGUAGE_KEY="c8y_language",e.ctorParameters=function(){return[{type:i.TranslateService},{type:$c},{type:qc}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(i.TranslateService),t.ɵɵinject($c),t.ɵɵinject(qc))},token:e,providedIn:"root"}),e=n=yc([t.Injectable({providedIn:"root"})],e)}(),Iu=function(e){function n(t,n){var a=e.call(this,t)||this;return a.translateService=n,a}return hc(n,e),n.prototype.transform=function(t,n,a,s){void 0===n&&(n="medium");var o=t,r=!1,l=!1;"number"!=typeof t||isNaN(t)||(o=Math.min(t,864e13),o=Math.max(o,-864e13),r=t<-864e13,l=t>864e13);var i=e.prototype.transform.call(this,o,n,a,s);return r?i=this.translateService.instant("before {{date}}",{date:i}):l&&(i=this.translateService.instant("after {{date}}",{date:i})),i},n.ctorParameters=function(){return[{type:String,decorators:[{type:t.Inject,args:[t.LOCALE_ID]}]},{type:i.TranslateService}]},n=yc([t.Pipe({name:"c8yDate"}),vc(0,t.Inject(t.LOCALE_ID))],n)}(c.DatePipe),Pu=function(){function e(e){this.element=e,this.useIntersection=!0,this.hidden=!1,this.class="c8y-list__item bg-transparent",this.maxIterations=10,this.onLoad=new t.EventEmitter,this.isLoading=!1,this.counter=0,this.showNoMoreDataHint=!1,this.LOAD_SAME_PAGE_THRESHOLD=50}return Object.defineProperty(e.prototype,"hostClass",{get:function(){return this.hidden||!this.hasMore&&!this.showNoMoreDataHint?"":this.class},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasMore",{get:function(){return this.paging&&(this.paging.totalPages>this.paging.currentPage||!!this.paging.nextPage)},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.useIntersection&&"IntersectionObserver"in window&&(this.intersectionObserver=new IntersectionObserver((function(t){return e.buttonInView(t[0])}),{root:this.container?this.container.nativeElement:null}),this.intersectionObserver.observe(this.element.nativeElement)),this.showNoMoreDataHint=this.shouldShowNoMoreDataHint()},e.prototype.ngOnDestroy=function(){this.intersectionObserver&&this.intersectionObserver.disconnect()},e.prototype.loadMore=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return this.isLoading=!0,e&&e.stopPropagation(),this.hasMore?[4,this.paging.next()]:[3,2];case 1:return t=n.sent(),this.counter++,this.paging=t.paging,this.onLoad.emit(t.data),this.intersectionLoading(),this.showNoMoreDataHint=this.shouldShowNoMoreDataHint(),[3,3];case 2:this.counter=0,this.isLoading=!1,n.label=3;case 3:return[2]}}))}))},e.prototype.intersectionLoading=function(){var e=this;this.useIntersection&&this.hasMore&&null!==this.loadUntilIntersected?(this.loadUntilIntersected=setTimeout((function(){return e.loadMore()}),this.getLoadingThreshold()),this.useIntersection=this.shouldSwitchMode()):(this.isLoading=!1,this.loadUntilIntersected=void 0)},e.prototype.getLoadingThreshold=function(){return this.LOAD_SAME_PAGE_THRESHOLD*this.counter},e.prototype.shouldShowNoMoreDataHint=function(){return(0!==this.counter||this.noMoreDataHint)&&!this.hasMore&&!this.hidden},e.prototype.shouldSwitchMode=function(){return this.counter<this.maxIterations||this.hidden},e.prototype.buttonInView=function(e){e.isIntersecting?this.loadMore():this.loadUntilIntersected?(clearTimeout(this.loadUntilIntersected),this.loadUntilIntersected=null,this.isLoading=!1):this.loadUntilIntersected=null},e.ctorParameters=function(){return[{type:t.ElementRef}]},yc([t.Input()],e.prototype,"paging",void 0),yc([t.Input()],e.prototype,"useIntersection",void 0),yc([t.Input()],e.prototype,"hidden",void 0),yc([t.Input()],e.prototype,"container",void 0),yc([t.Input()],e.prototype,"class",void 0),yc([t.Input()],e.prototype,"maxIterations",void 0),yc([t.Input()],e.prototype,"noMoreDataHint",void 0),yc([t.Input()],e.prototype,"loadNextLabel",void 0),yc([t.Input()],e.prototype,"loadingLabel",void 0),yc([t.Output()],e.prototype,"onLoad",void 0),yc([t.HostBinding("class")],e.prototype,"hostClass",null),e=yc([t.Component({selector:"c8y-load-more",template:'<button\n class="btn btn-default btn-block text-center"\n (click)="loadMore($event)"\n [ngClass]="{ \'btn-pending\': isLoading }"\n *ngIf="hasMore"\n [style.visibility]="hidden ? \'hidden\' : \'visible\'"\n [style.height]="hidden ? \'1px\' : null"\n title="{{ \'Load more\' | translate }}"\n>\n <ng-container *ngIf="!isLoading">\n <span *ngIf="loadNextLabel; else loadPage" [innerHTML]="loadNextLabel | translate"></span>\n <ng-template #loadPage>\n <span translate ngNonBindable [translateParams]="{ pageNo: paging.currentPage + 1 }">\n Load page {{ pageNo }}</span\n >\n </ng-template>\n </ng-container>\n <ng-container *ngIf="isLoading">\n <span *ngIf="loadingLabel; else loading" [innerHTML]="loadingLabel | translate"></span>\n <ng-template #loading>\n <span translate ngNonBindable [translateParams]="{ pageNo: paging.currentPage + 1 }">\n Page {{ pageNo }} is loading…\n </span>\n </ng-template>\n </ng-container>\n</button>\n\n<ng-container *ngIf="showNoMoreDataHint">\n <ng-container *ngTemplateOutlet="noMoreDataHint || finishHint"></ng-container>\n</ng-container>\n\n<ng-template #finishHint>\n <div class="legend form-block center">\n <i [c8yIcon]="\'flag-checkered\'" class="m-r-4"></i>\n {{ \'Last record\' | translate }}\n </div>\n</ng-template>\n'})],e)}(),Ou=function(){function e(e,t,n){this.tpl=e,this.vcr=t,this.componentFactoryResolver=n,this.cachedData=[],this.loadMoreMode="auto",this.dataPipe=a.pipe(s.tap()),this.maxIterations=10,this.unsubscribe$=new a.Subject}return Object.defineProperty(e.prototype,"shouldUseLoadMoreButton",{get:function(){return"auto"===this.loadMoreMode||"show"===this.loadMoreMode||"hidden"===this.loadMoreMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasMoreData",{get:function(){return this.loadMore&&this.loadMore.hasMore},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.cachedData.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForOf",{set:function(e){var t=this;e&&(this.obs$=(a.isObservable(e)?e:a.of(e)).pipe(s.map((function(e){if(null===e)return t.paging=null,[];var n=e.paging,a=e.data;return t.paging=n,a}))))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForLoadMore",{set:function(e){this.loadMoreMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForPipe",{set:function(e){e&&(this.dataPipe=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForNotFound",{set:function(e){this.notFoundTemplate=e,this.loadMore&&(this.loadMore.noMoreDataHint=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForMaxIterations",{set:function(e){this.maxIterations=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForRealtime",{set:function(e){this.realtime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForComparator",{set:function(e){this.comparator=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.handleRealtime()},e.prototype.ngOnChanges=function(e){var t=this;if(this.obs$&&(e.c8yForPipe||e.c8yForOf)){this.unsubscribePaging();var n=!this.hasMoreData&&!!e.c8yForPipe&&!e.c8yForOf;n&&(this.obs$=a.of(this.cachedData)),this.pagingSub=this.obs$.pipe(s.tap((function(e){n||(t.cachedData=e)}))).pipe((function(e){return t.dataPipe(e)})).subscribe((function(e){t.render(e,n)}))}},e.prototype.ngOnDestroy=function(){this.unsubscribePaging(),this.unsubscribe$.next(),this.unsubscribe$.complete()},e.prototype.handleRealtime=function(){var e=this;this.realtime&&(this.realtime.onCreate$().pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.insert(t)})),this.realtime.onUpdate$().pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.update(t)})),this.realtime.onDelete$().pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.remove(Xi.coerceNumberProperty(t))})))},e.prototype.render=function(e,t){var n=this;void 0===t&&(t=!1),this.vcr.clear(),e.forEach((function(e,t){var a={$implicit:e,index:t,length:n.length,hasMore:n.hasMoreData};n.vcr.createEmbeddedView(n.tpl,a)})),this.shouldUseLoadMoreButton&&(this.loadMore=this.createLoadMoreButtonComponent(t))},e.prototype.append=function(e){var t=this;e.forEach((function(e){var n=t.shouldUseLoadMoreButton?t.vcr.length-1:t.vcr.length,a={$implicit:e,index:n,length:t.length,hasMore:t.hasMoreData};t.vcr.createEmbeddedView(t.tpl,a,n)}))},e.prototype.loadMoreData=function(e){e.length>0&&this.append(e)},e.prototype.createLoadMoreButtonComponent=function(e){var t=this,n=this.componentFactoryResolver.resolveComponentFactory(Pu),a=this.vcr.createComponent(n).instance;return a.paging=this.paging,a.useIntersection="auto"===this.loadMoreMode||"hidden"===this.loadMoreMode,a.hidden="hidden"===this.loadMoreMode,a.maxIterations=this.maxIterations,a.noMoreDataHint=this.notFoundTemplate,this.pagingSub=a.onLoad.pipe(s.map((function(e){return t.checkForDuplicates(e)})),s.tap((function(e){t.cachedData=t.cachedData.concat(e)}))).pipe((function(e){return t.dataPipe(e)})).subscribe((function(e){return t.loadMoreData(e)})),e&&o.assign(a,this.loadMore),a},e.prototype.insert=function(e){var t=0;if(this.comparator&&this.cachedData.length){var n=void 0;do{var a=this.vcr.get(t),s=o.get(a,"context.$implicit");(n=e&&s?this.comparator(e,s):0)<=0&&t++}while(n<=0&&t<this.cachedData.length)}if(t<this.cachedData.length||0===this.cachedData.length){var r={$implicit:e,index:t,length:this.length,hasMore:this.hasMoreData};this.cachedData.splice(t,0,e);var l=this.tpl.createEmbeddedView(r);this.vcr.insert(l,t)}},e.prototype.update=function(e){this.forMatchingEmbeddedViewRef((function(t){return t&&e&&t.id===e.id}),(function(t){t.context.$implicit=e,t.markForCheck()}))},e.prototype.remove=function(e){this.forMatchingEmbeddedViewRef((function(t){return t&&Xi.coerceNumberProperty(t.id,NaN)===e}),(function(e){return e.destroy()}))},e.prototype.forMatchingEmbeddedViewRef=function(e,t){for(var n=0;n<this.vcr.length;n++){var a=this.vcr.get(n);e(o.get(a,"context.$implicit"))&&t(a)}},e.prototype.checkForDuplicates=function(e){var t=this;return this.realtime?e.filter((function(e){return!t.cachedData.some((function(t){return t.id===e.id}))})):e},e.prototype.unsubscribePaging=function(){this.pagingSub&&this.pagingSub.unsubscribe()},e.ctorParameters=function(){return[{type:t.TemplateRef},{type:t.ViewContainerRef},{type:t.ComponentFactoryResolver}]},yc([t.Input()],e.prototype,"c8yForOf",null),yc([t.Input()],e.prototype,"c8yForLoadMore",null),yc([t.Input()],e.prototype,"c8yForPipe",null),yc([t.Input()],e.prototype,"c8yForNotFound",null),yc([t.Input()],e.prototype,"c8yForMaxIterations",null),yc([t.Input()],e.prototype,"c8yForRealtime",null),yc([t.Input()],e.prototype,"c8yForComparator",null),e=yc([t.Directive({selector:"[c8yFor]"})],e)}(),xu=function(){function e(e){this.translateService=e,this.internalApps={administration:"Administration",cockpit:"Cockpit",devicemanagement:"Device management"}}return e.prototype.transform=function(e){void 0===e&&(e="Cumulocity");var t,n=this.getAppName(e);return t=this.isPublicApp(e)?"{{ appName | translate }} (public)":n,this.translateService.get(t,{appName:n})},e.prototype.getAppName=function(e){var t=this.getFirstDefined([Qi.get(e,"name"),Qi.get(e,"contextPath"),e])||"";return this.internalApps[t]||t},e.prototype.getFirstDefined=function(e){return Qi.find(e,Qi.negate(Qi.isUndefined))},e.prototype.isPublicApp=function(e){return Boolean(Qi.get(e,"public"))},e.ctorParameters=function(){return[{type:i.TranslateService}]},e=yc([t.Pipe({name:"humanizeAppName"})],e)}(),Eu=function(){function e(){}var n;return n=e,e.humanize=function(e){return void 0===e&&(e=""),e=e.replace(/\./g," ").replace(/c8y[\s,_]*/gi,"").replace(/_/g," ").replace(/([A-Z][a-z])/g," $1").replace(/^\$\.?/,"").replace(/^\s*/,"").replace(/\s*$/,"").replace(/\s+/g," "),o.upperFirst(e)},e.prototype.transform=function(e){return n.humanize(e)},e=n=yc([t.Pipe({name:"humanize"})],e)}(),ku=function(){function e(e,t){this.el=e,this.renderer=t,this.c8yMatch=/^c8y-/,this.klasses=[],this.currentClasses=""}return Object.defineProperty(e.prototype,"c8yIcon",{set:function(e){this.updateIcon(e)},enumerable:!0,configurable:!0}),e.prototype.isC8y=function(e){return this.c8yMatch.test(e)},e.prototype.getClasses=function(e){void 0===e&&(e="");var t="";if(e){var n=e.trim(),a=this.isC8y(n);t=(a?"c8y-icon":"fa fw")+" "+(a?n.replace(this.c8yMatch,"c8y-icon-"):"fa-"+n)}return t},e.prototype.updateIcon=function(e){var t=this,n=this.getClasses(e);n!==this.currentClasses&&(this.currentClasses.split(/\s/).filter((function(e){return e})).forEach((function(e){t.renderer.removeClass(t.el.nativeElement,e)})),n.split(/\s/).filter((function(e){return e})).forEach((function(e){t.renderer.addClass(t.el.nativeElement,e)})),this.currentClasses=n)},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},yc([t.Input()],e.prototype,"c8yIcon",null),e=yc([t.Directive({selector:"[c8yIcon]"})],e)}(),Tu=["home","th","bar-chart-o","tasks","tachometer","bell","puzzle-piece","map-marker","location-arrow","globe","power-off","desktop","laptop","mobile","signal","qrcode","file","file-text","folder","folder-open","archive","hdd-o","book","bookmark","tag","flag","search","heart","star","bolt","rocket","cog","cogs","wrench","ban","user","users","sign-in","sign-out","upload","download","cloud-upload","cloud-download","cloud","spinner","refresh","repeat","undo","lock","unlock","info","question","exclamation","bug","calendar","random","asterisk","key","link","chain-broken","external-link","picture-o","comment","bullhorn","phone","lightbulb-o","flask","sitemap","exchange","code-fork","keyboard-o","terminal","code","clipboard","pencil","envelope","inbox","reply","share","thumbs-up","thumbs-down","check","plus","expand","compress","arrows","arrow-up","arrow-down","arrow-left","arrow-right","th-list","bars","table","columns","filter","sort","sort-up","sort-down","ellipsis-h","ellipsis-v","rss","apple","windows","android","linux"],Au=function(){function e(){}return e.prototype.transform=function(e,t,n){return t.apply(n||this,Array.isArray(e)?e:[e])},e=yc([t.Pipe({name:"map"})],e)}(),_u=function(){function e(e,t,n,a){this.viewContainer=e,this.resolver=t,this.renderer=n,this.el=a,this.properties={}}return Object.defineProperty(e.prototype,"c8yOutlet",{set:function(e){if(e)if(this._element instanceof Element&&this.renderer.removeChild(this._element.parentElement,this._element),this.viewContainer.clear(),e instanceof t.TemplateRef)this.viewContainer.createEmbeddedView(e);else if(e instanceof Element){var n=this.renderer.parentNode(this.el.nativeElement);this.destroy(),this._element=e,this.renderer.insertBefore(n,this._element,this.el.nativeElement)}else{var a=this.resolver.resolveComponentFactory(e),s=this.viewContainer.createComponent(a);o.assign(s.instance,this.properties)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yOutletProperties",{set:function(e){this.properties=e},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.destroy()},e.prototype.destroy=function(){if(this._element){var e=this.renderer.parentNode(this._element);this.renderer.removeChild(e,this._element)}},e.ctorParameters=function(){return[{type:t.ViewContainerRef},{type:t.ComponentFactoryResolver},{type:t.Renderer2},{type:t.ElementRef}]},yc([t.Input()],e.prototype,"c8yOutlet",null),yc([t.Input()],e.prototype,"c8yOutletProperties",null),e=yc([t.Directive({selector:"[c8yOutlet]"})],e)}(),Nu=function(){function e(){this.message="Loading…",this.progress=null}return yc([t.Input()],e.prototype,"message",void 0),yc([t.Input()],e.prototype,"progress",void 0),e=yc([t.Component({selector:"c8y-progress-bar",template:'<div>\n <p *ngIf="message">\n {{ message | translate }}\n </p>\n <div class="progress progress-striped active" *ngIf="progress !== null">\n <div\n class="progress-bar"\n role="progressbar"\n [attr.aria-valuenow]="progress"\n aria-valuemin="0"\n aria-valuemax="100"\n [style.width]="progress + \'%\'"\n ></div>\n </div>\n <div class="spinner" *ngIf="progress === null" style="position: relative;">\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'})],e)}(),Du=function(){function e(){}return e.prototype.transform=function(e){var t=e.firstName,n=void 0===t?"":t,a=e.lastName,s=void 0===a?"":a,o=e.userName,r=void 0===o?"":o,l=n.trim().split(/\s+/).shift().substr(0,1),i=s.trim().split(/\s+/).pop();return(l=i?l?l+". ":"":n.split(/\s+/).shift())||i?l+i:r},e=yc([t.Pipe({name:"shortenUserName"})],e)}();(Su=e.Status||(e.Status={})).SUCCESS="success",Su.WARNING="warning",Su.DANGER="danger",Su.INFO="info";var Mu=((yu={})[e.Status.SUCCESS]="check-circle",yu[e.Status.WARNING]="exclamation-triangle",yu[e.Status.DANGER]="exclamation-circle",yu[e.Status.INFO]="info-circle",yu),Lu=((vu={})[e.Status.SUCCESS]="text-"+e.Status.SUCCESS,vu[e.Status.WARNING]="text-"+e.Status.WARNING,vu[e.Status.DANGER]="text-"+e.Status.DANGER,vu[e.Status.INFO]="text-"+e.Status.INFO,vu),Ru=((ju={})[e.Status.SUCCESS]="alert-"+e.Status.SUCCESS,ju[e.Status.WARNING]="alert-"+e.Status.WARNING,ju[e.Status.DANGER]="alert-"+e.Status.DANGER,ju[e.Status.INFO]="alert-"+e.Status.INFO,ju),qu=((bu={})[l.OperationStatus.PENDING]="clock-o",bu[l.OperationStatus.EXECUTING]="refresh",bu[l.OperationStatus.SUCCESSFUL]="check-circle",bu[l.OperationStatus.FAILED]="exclamation-circle",bu),$u=((wu={})[l.OperationStatus.PENDING]="text-info",wu[l.OperationStatus.EXECUTING]="text-info",wu[l.OperationStatus.SUCCESSFUL]="text-success",wu[l.OperationStatus.FAILED]="text-danger",wu),Fu=function(){function e(){}return e.prototype.ngOnInit=function(){this.statusIcons=qu,this.statusClasses=$u},yc([t.Input()],e.prototype,"operation",void 0),e=yc([t.Component({selector:"c8y-single-operation",template:'<div class="c8y-list--group" *ngIf="operation">\n <a href="#/device/{{ operation.deviceId }}/control" class="c8y-list__item">\n <div class="c8y-list__item__block">\n <div class="c8y-list__item__icon">\n <i\n [c8yIcon]="statusIcons[operation.status]"\n [ngClass]="statusClasses[operation.status]"\n [tooltip]="operation.status?.toString() | translate"\n placement="right"\n container="body"\n ></i>\n </div>\n <div class="c8y-list__item__body p-r-16">\n <div class="content-flex-40">\n <div class="col-8 text-break-word">{{ operation.description | translate }}</div>\n <div class="col-4 text-muted">\n <i c8yIcon="calendar" class="m-r-4"></i>\n <small>{{ operation.creationTime | c8yDate }}</small>\n </div>\n </div>\n </div>\n </div>\n </a>\n</div>\n'})],e)}(),Uu=function(){function e(){this.LOCAL_STORAGE_KEY="userPreferences",this.store={};try{var e=window.localStorage.getItem(this.LOCAL_STORAGE_KEY);e&&(this.store=JSON.parse(e)||{})}catch(e){}}return e.prototype.get=function(e){return a.of(this.store[e])},e.prototype.set=function(e,t){return this.store[e]=t,this.saveJsonStore()},e.prototype.saveJsonStore=function(){return window.localStorage.setItem(this.LOCAL_STORAGE_KEY,JSON.stringify(this.store))},e}(),Bu=function(){function e(e){this.inventory=e,this.TYPE="c8y_UserPreference"}return e.prototype.get=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return[4,this.inventory.list({fragmentType:e})];case 1:return[2,(t=n.sent().data).length?t[0][e]:void 0]}}))}))},e.prototype.set=function(e,t){return jc(this,void 0,void 0,(function(){var n,a,s,o;return bc(this,(function(r){switch(r.label){case 0:return[4,this.inventory.list({fragmentType:e})];case 1:return n=r.sent().data,(o={})[e]=t,o.type=this.TYPE,a=o,n.length?(a.id=n[0].id,s=this.inventory.update(a)):s=this.inventory.create(a),[2,s]}}))}))},e}(),zu=function(){function e(e,t,n){this.user=e,this.inventory=t,this.appState=n,this.LOCAL_STORAGE_KEY="userPreferences",this.storage={local:new Uu,inventory:new Bu(this.inventory)},this.currentUser=this.appState.currentUser}return e.prototype.get=function(e){var t=this;return this.currentUser.pipe(s.first(),s.switchMap((function(n){return t.getForUser(e,n)})))},e.prototype.set=function(e,t){var n=this;return new Promise((function(a,o){n.currentUser.pipe(s.first()).subscribe((function(s){a(n.setForUser(e,t,s))}),o)}))},e.prototype.getForUser=function(e,t){var n=this.getRawKey(e,t),s=this.getStorage(t);return a.from(s.get(n))},e.prototype.setForUser=function(e,t,n){var a=this.getRawKey(e,n),s=this.getStorage(n);return Promise.resolve(s.set(a,t))},e.prototype.getRawKey=function(e,t){return""+e+t.userName.replace(/\./g,"__")},e.prototype.getStorage=function(e){return this.user.hasAllRoles(e,["ROLE_INVENTORY_READ","ROLE_INVENTORY_ADMIN"])?this.storage.inventory:this.storage.local},e.ctorParameters=function(){return[{type:l.UserService},{type:l.InventoryService},{type:$c}]},e=yc([t.Injectable()],e)}();function Gu(e){return function(t,n,a){var s=a.value;a.value=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];var r="_"+n+"Memoized";return this[r]||(this[r]=o.memoize(s,e)),this[r].apply(this,t)}}}var Hu=function(){function e(e,t,n){this.appState=e,this.inventory=t,this.user=n}return e.prototype.canEdit=function(e,t){return this.checkIfCanEdit(e,t)},e.prototype.hasRole=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasRole(t,e)},e.prototype.hasAllRoles=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasAllRoles(t,e)},e.prototype.hasAnyRole=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasAnyRole(t,e)},e.prototype.checkIfOwner=function(e){return jc(this,void 0,void 0,(function(){var t,n,a;return bc(this,(function(s){switch(s.label){case 0:return[4,this.appState.currentUser.value.userName];case 1:return t=s.sent(),[4,this.inventory.detail(e.id)];case 2:return n=s.sent(),a=n.data,n.res,[2,t===a.owner]}}))}))},e.prototype.checkWithRequest=function(e){var t=e.name,n={id:e.id,name:t};return this.inventory.update(n).then((function(e){return!0})).catch((function(e){return!1}))},e.prototype.checkIfCanEdit=function(e,t){return jc(this,void 0,void 0,(function(){return bc(this,(function(n){switch(n.label){case 0:return[4,this.hasAnyRole(e)];case 1:return n.sent()?[2,!0]:[3,2];case 2:return[4,this.checkIfOwner(t)];case 3:return n.sent()?[2,!0]:[3,4];case 4:return[4,this.checkWithRequest(t)];case 5:if(n.sent())return[2,!0];n.label=6;case 6:return[2,!1]}}))}))},e.ctorParameters=function(){return[{type:$c},{type:l.InventoryService},{type:l.UserService}]},yc([Gu(o.property("id"))],e.prototype,"checkIfOwner",null),yc([Gu(o.property("id"))],e.prototype,"checkWithRequest",null),e=yc([t.Injectable()],e)}();function Vu(e,t,n){return function(){var a=e.queryStringLang(),o=e.firstSupportedLanguage();a&&e.getSupported(a)?e.switchToLanguage(a):t.currentUser.pipe(s.map((function(e){return e&&e.userName})),s.filter((function(e){return!!e})),s.distinctUntilChanged(),s.switchMap((function(){return n.get("language")})),s.startWith(o),s.filter((function(e){return!!e})),s.distinctUntilChanged()).subscribe((function(t){e.switchToLanguage(t)}))}}var Ku,Wu=new t.InjectionToken("iconList"),Yu=function(){function e(){}var n;return n=e,e.providers=function(){return Sc(r.DataModule.providers(),[{provide:Rc,useValue:window.C8Y_APP||{},multi:!0},{provide:t.APP_INITIALIZER,useFactory:Vu,deps:[Cu,$c,zu],multi:!0},{provide:Wu,useValue:Tu,multi:!1}],gu.providers(),[zu,qc,$c,Hu])},e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e=n=yc([t.NgModule({imports:[c.CommonModule,gu,u.TooltipModule],exports:[ku,_u,gu,c.CommonModule,xu,Eu,Du,Ou,Pu,Au,Nu,Fu,Iu],declarations:[ku,_u,Eu,xu,Du,Ou,Pu,Au,Nu,Fu,Iu],entryComponents:[Pu]})],e)}(),Zu=function(){function e(e){this.actionBarService=e,this.placement="left",this.priority=0,this.itemClass=""}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.actionBarService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.actionBarService.remove(this)},e.ctorParameters=function(){return[{type:Ac}]},yc([t.Input()],e.prototype,"placement",void 0),yc([t.Input()],e.prototype,"priority",void 0),yc([t.Input()],e.prototype,"itemClass",void 0),yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=yc([t.Component({selector:"c8y-action-bar-item",template:'<ng-template #template>\n <li class="{{itemClass}}">\n <ng-content></ng-content>\n </li>\n</ng-template>'})],e)}(),Ju=function(){function e(){this.navigatorOpen=!1,this.hasTabs=!1,this.isTabsHorizontal=!1,this.isPageToolbarExpanded=!1,this.uiActionBar=!0,this.items=[]}return Object.defineProperty(e.prototype,"hidden",{get:function(){return!(this.items&&this.items.length)},enumerable:!0,configurable:!0}),e.prototype.getSortedItems=function(e){return o.sortBy(o.filter(this.items,{placement:e}),this.byPriority)},e.prototype.byPriority=function(e){return-e.priority},yc([t.Input(),t.HostBinding("class.navigator-open")],e.prototype,"navigatorOpen",void 0),yc([t.Input(),t.HostBinding("class.has-tabs")],e.prototype,"hasTabs",void 0),yc([t.Input(),t.HostBinding("class.horizontal-tabs")],e.prototype,"isTabsHorizontal",void 0),yc([t.HostBinding("class.c8y-ui-action-bar")],e.prototype,"uiActionBar",void 0),yc([t.Input()],e.prototype,"items",void 0),yc([t.HostBinding()],e.prototype,"hidden",null),e=yc([t.Component({selector:"c8y-action-bar",template:'<div class="navbar-header">\n <button\n type="button"\n class="navbar-toggle collapsed"\n (click)="isPageToolbarExpanded = !isPageToolbarExpanded"\n >\n <span class="sr-only" translate>Toggle toolbar</span>\n <span class="icon-bar"></span>\n <span class="icon-bar"></span>\n <span class="icon-bar"></span>\n </button>\n</div>\n\n<div id="page-toolbar" class="navbar-collapse" [collapse]="!isPageToolbarExpanded">\n <ul class="nav navbar-nav navbar-left">\n <ng-container *ngFor="let item of getSortedItems(\'left\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n </ul>\n <ul class="nav navbar-nav navbar-right">\n <ng-container *ngFor="let item of getSortedItems(\'right\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n <li class="no-remove more-wrapper" *ngIf="getSortedItems(\'more\').length > 0">\n <div class="dropdown" dropdown>\n <button\n title="{{ \'More\' | translate }}…"\n class="dropdown-toggle c8y-dropdown"\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="false"\n >\n <span translate>More…</span>\n <i [c8yIcon]="\'caret-down\'"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <ng-container *ngFor="let item of getSortedItems(\'more\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n </li>\n </ul>\n</div>\n',host:{class:"c8y-ui-action-bar"}})],e)}(),Xu=function(){function e(){}return e=yc([t.NgModule({declarations:[Ju,Zu],imports:[tc.BsDropdownModule,Yu,ec.CollapseModule,n.RouterModule.forChild([])],exports:[Ju,Zu]})],e)}(),Qu=function(){function e(){this.isPageToolbarExpanded=!1,this.items=[]}return e.prototype.getByPriority=function(){return o.sortBy(this.items,this.byPriority)},e.prototype.invoke=function(e){e.action&&e.action.call()},e.prototype.byPriority=function(e){return-e.priority},yc([t.Input()],e.prototype,"items",void 0),e=yc([t.Component({selector:"c8y-action-outlet",template:'<div class="dropdown" dropdown *ngIf="items && items.length > 0">\n <button\n type="button"\n class="main-header-button dropdown-toggle c8y-dropdown"\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="true">\n <i [c8yIcon]="\'plus-circle\'" class="fa-2x"></i>\n </button>\n\n <ul class="dropdown-menu cog-dropdown" *dropdownMenu>\n <ng-container *ngFor="let item of getByPriority()">\n <ng-container *c8yOutlet="item.template"></ng-container>\n <li *ngIf="item.label">\n <button title="{{ item.label | translate }}" [attr.disabled]="item.disabled ? \'disabled\' : null" (click)="invoke(item)">\n <i *ngIf="item.icon" [c8yIcon]="item.icon"></i>{{item.label | translate}}\n </button>\n </li>\n </ng-container>\n </ul>\n</div>\n'})],e)}(),ed=function(){function e(e){this.actionService=e,this.disabled=!1,this.priority=0}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.actionService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.actionService.remove(this)},e.ctorParameters=function(){return[{type:Nc}]},yc([t.Input()],e.prototype,"disabled",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"priority",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=yc([t.Component({selector:"c8y-action",template:"<ng-template #template>\n <li>\n <ng-content></ng-content>\n </li>\n</ng-template>"})],e)}(),td=function(){function e(){}return e=yc([t.NgModule({declarations:[Qu,ed],imports:[Yu,tc.BsDropdownModule,n.RouterModule.forChild([])],exports:[Qu,ed]})],e)}(),nd=function(){function e(){}return e=yc([t.Component({selector:"c8y-alert-details",template:"<ng-content></ng-content>"})],e)}(),ad=function(){function e(e,t){this.position=e,this.alertService=t,this.detailDisplayedAlert={},this.isStatic=!1,this.isStatic="static"===this.position}return Object.defineProperty(e.prototype,"alerts",{get:function(){return this.alertService.state$},enumerable:!0,configurable:!0}),e.prototype.getClass=function(e){var t=[];return"danger"!==e.type&&t.push("interact"),t.push("alert-"+e.type),t.join(" ")},e.prototype.close=function(e){e.onClose&&e.onClose(),this.alertService.remove(e)},e.prototype.showDetails=function(e){if(e.onDetail)return e.onDetail();this.detailDisplayedAlert=Object.assign({},e),this.detailDisplayedAlert.mode="raw",this.setDetailsContent(e)},e.prototype.setDetailsContent=function(e){this.isTemplateRef(e.detailedData)||"string"==typeof e.detailedData?this.detailDisplayedAlert.contents=e.detailedData:this.detailDisplayedAlert.contents=JSON.stringify(e.detailedData,null,2)},e.prototype.hasDetails=function(e){return e.detailedData||e.onDetail},e.prototype.closeDetails=function(){this.detailDisplayedAlert={}},e.prototype.isDetailsShow=function(e){return this.alertService.areSame(e,this.detailDisplayedAlert)},e.prototype.isTemplateRef=function(e){return e instanceof t.TemplateRef},e.prototype.template=function(e){return this.isTemplateRef(e)?e:void 0},e.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["position"]}]},{type:Mc}]},yc([t.HostBinding("class.static")],e.prototype,"isStatic",void 0),e=yc([t.Component({selector:"c8y-alert-outlet",template:'<div\n class="alert animated fadeInRightBig"\n *ngFor="let alert of alerts | async"\n [ngClass]="[getClass(alert), isDetailsShow(alert) ? \'expanded\' : \'\']"\n>\n <button title="{{ \'Close\' | translate }}" type="button" class="close" (click)="close(alert)">\n <span aria-hidden="true">×</span>\n <span class="sr-only">{{ \'Close\' | translate }}</span>\n </button>\n\n <div *ngIf="!isTemplateRef(alert.text); else template(alert.text)">\n <strong *ngIf="!alert.allowHtml" [innerText]="alert.text | translate" class="message"></strong>\n <strong *ngIf="alert.allowHtml" [innerHTML]="alert.text | translate" class="message"></strong>\n </div>\n <p *ngIf="hasDetails(alert) && !isDetailsShow(alert)" class="text-muted top-m-sm">\n <button\n title="{{ \'Show details\' | translate }}"\n class="btn btn-clean"\n (click)="showDetails(alert)"\n >\n <i class="fa fa-chevron-down"></i>\n {{ \'Show details\' | translate }}\n </button>\n </p>\n <p *ngIf="hasDetails(alert) && isDetailsShow(alert)" class="text-muted top-m-sm">\n <button title="{{ \'Hide details\' | translate }}" class="btn btn-clean" (click)="closeDetails()">\n <i class="fa fa-chevron-up"></i>\n {{ \'Hide details\' | translate }}\n </button>\n </p>\n <div *ngIf="isDetailsShow(alert)">\n <div *ngIf="!isTemplateRef(detailDisplayedAlert.contents); else template(alert.detailedData)">\n <pre><code [innerText]="detailDisplayedAlert.contents | translate"></code></pre>\n </div>\n </div>\n</div>\n'}),vc(0,t.Attribute("position"))],e)}(),sd=function(){function e(){}return e=yc([t.Component({selector:"c8y-alert-text",template:"<ng-content></ng-content>"})],e)}(),od=function(){function e(e){this.alertService=e}return e.prototype.ngAfterViewInit=function(){var e=this;this.containDetailsComponent||(this.detailedData=null),this.viewInitTimeout=setTimeout((function(){return e.alertService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.alertService.remove(this)},e.ctorParameters=function(){return[{type:Mc}]},yc([t.Input()],e.prototype,"type",void 0),yc([t.Input()],e.prototype,"onDetail",void 0),yc([t.Input()],e.prototype,"onClose",void 0),yc([t.ViewChild("detailedData",{static:!1})],e.prototype,"detailedData",void 0),yc([t.ViewChild("text",{static:!1})],e.prototype,"text",void 0),yc([t.ContentChild(nd,{static:!1})],e.prototype,"containDetailsComponent",void 0),e=yc([t.Component({selector:"c8y-alert",template:'<ng-template #text>\r\n <ng-content select="c8y-alert-text"></ng-content>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n<ng-template #detailedData>\r\n <ng-content select="c8y-alert-details"></ng-content>\r\n</ng-template>'})],e)}(),rd=function(){function e(){}return e=yc([t.NgModule({imports:[Yu],exports:[ad,od,nd,sd],declarations:[ad,od,nd,sd]})],e)}(),ld=function(){function e(e){this.audit=e}return e.prototype.ngOnInit=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return this.source?(e=this,[4,this.audit.list({withTotalPages:!0,source:this.source})]):[3,2];case 1:e.records=t.sent(),t.label=2;case 2:return[2]}}))}))},e.ctorParameters=function(){return[{type:l.AuditService}]},yc([t.Input()],e.prototype,"source",void 0),e=yc([t.Component({selector:"c8y-audit-log",template:'<div class="inner-scroll">\n <ul class="timeline-list list-condensed m-t-16">\n <li class="timeline-list-item flex-row" *c8yFor="let record of records">\n <small class="timeline-item-date text-right">\n <span>{{ record.time | c8yDate }}</span>\n </small>\n <div class="timeline-item-content flex-row">\n <div class="list-item-body">\n <div class="row text-break-word">\n <div class="col-md-5">\n <span class="text-truncate">{{ record.activity | translate }}</span>\n <small class="text-muted">{{ record.user }}</small>\n </div>\n <div class="col-md-7">\n <div class="small text-truncate-wrap">{{ record.text | translate }}</div>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n</div>\n'})],e)}(),id=function(){function e(){}return e=yc([t.NgModule({declarations:[ld],imports:[Yu],exports:[ld]})],e)}();(Ku=e.LoginViews||(e.LoginViews={}))[Ku.None=0]="None",Ku[Ku.Credentials=1]="Credentials",Ku[Ku.RecoverPassword=2]="RecoverPassword",Ku[Ku.SmsChallenge=3]="SmsChallenge",Ku[Ku.ChangePassword=4]="ChangePassword",Ku[Ku.TotpChallenge=5]="TotpChallenge",Ku[Ku.TotpSetup=6]="TotpSetup",Ku[Ku.ProvidePhoneNumber=7]="ProvidePhoneNumber";var cd,ud=function(){function e(e,t,n,a,s,o,r,l,i,c,u){this.client=e,this.basicAuth=t,this.cookieAuth=n,this.ui=a,this.user=s,this.tenant=o,this.realtime=r,this.alert=l,this.api=i,this.tenantLoginOptionsService=c,this.location=u,this.rememberMe=!1,this.TOKEN_KEY="_tcy8",this.TFATOKEN_KEY="TFAToken",this.OAUTH2_INTERNAL_TYPE="OAUTH2_INTERNAL",this.isFirstLogin=!0,this.GREEN_MIN_LENGTH_DEFAULT=8,this.ERROR_MESSAGES={minlength:"Password must have at least 8 characters and no more than 32.",password_missmatch:"Password confirmation does not match.",maxlength:"Password must have at least 8 characters and no more than 32.",password_strength:"Your password is not strong enough. Please include numbers, lower and upper case characters",remote_error:"Server error occurred.",email:"Invalid email address.",password_change:"Your password is expired. Please set a new password.",password_reset_token_expired:"Password reset link expired. Please enter your email address to receive a new one.",tfa_pin_invalid:"The code you entered is invalid. Please try again.",pattern_phonenumber:'Invalid phone number format. Only digits, spaces, slashes ("/") and dashes ("-") allowed.',pattern_newPassword:"Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:'\",.<>{}[]\\/",international_number_required:"International phone number required, in the format +49 9 876 543 210.",phone_number_error:"Could not update phone number.",pinAlreadySent:"The verification code was already sent. For a new verification code, please click on the link above.",passwordConfirm:"Password confirmation does not match.",tfaExpired:"Two-factor authentication token expired."},this.SUCCESS_MESSAGES={password_changed:"Password changed. You can now log in using new password.",password_reset_requested:"Password reset request has been sent. Please check your email.",resend_sms:"Verification code SMS resent.",send_sms:"Verification code SMS sent."},this.passwordStrengthSetting={enforcePasswordStrength:!1,passwordStrengthValidity:!1,greenMinLength:this.GREEN_MIN_LENGTH_DEFAULT},this.localhostRegExp=new RegExp("localhost"),this.localhostIpRegExp=new RegExp("127.0.0.1"),this.showTenantRegExp=new RegExp("showTenant"),this.autoLogout(),this.initLoginOptions()}return e.prototype.getTenant=function(){return this.client.tenant},e.prototype.initLoginOptions=function(){var e=this.ui.state.loginOptions||[],t=function(e){var t=e.type,n=e.grantType;return"OAUTH2"===t&&"AUTHORIZATION_CODE"===n};this.loginMode=e.find((function(e){return"OAUTH2_INTERNAL"===e.type}))||e.find((function(e){return"BASIC"===e.type}))||e.find(t)||{type:"BASIC"},this.oauthOptions=e.find(t)||{}},e.prototype.redirectToOauth=function(){var e=this.oauthOptions.initRequest,t=(this.location?this.location._platformLocation:window).location.href,n=encodeURIComponent(t),a=(e.includes("?")?"&":"?")+"originUri="+n;window.location.href=""+e+a},e.prototype.autoLogout=function(){var e=this,t=/invalid\scredentials.*pin.*generate/i,n=function(e){return e&&"string"==typeof e.message&&t.test(e.message)};this.ui.currentUser.pipe(s.switchMap((function(t){return t?e.api.hookResponse((function(e){return 401===e.response.status})):a.EMPTY}))).subscribe((function(t){return jc(e,void 0,void 0,(function(){var e,a,s,o=this;return bc(this,(function(r){switch(r.label){case 0:return e=t.response,a=!1,n(e.data)?(a=!0,[3,3]):[3,1];case 1:return"function"!=typeof e.json?[3,3]:[4,e.clone().json()];case 2:s=r.sent(),n(s)&&(a=!0),r.label=3;case 3:return a&&(this.logout(!1),setTimeout((function(){return o.alert.danger(o.ERROR_MESSAGES.tfaExpired)}),500)),[2]}}))}))}))},e.prototype.getGreenMinLength=function(){var e=this.getLoginOption(),t=Number(o.get(e,"greenMinLength"));return this.passwordStrengthSetting.greenMinLength=isNaN(t)?this.GREEN_MIN_LENGTH_DEFAULT:t,this.passwordStrengthSetting.greenMinLength},e.prototype.getEnforcePasswordStrength=function(){var e=this.getLoginOption(),t=o.get(e,"enforceStrength");return o.isString(t)?this.passwordStrengthSetting.enforcePasswordStrength="true"===t:this.passwordStrengthSetting.enforcePasswordStrength=!!t,this.passwordStrengthSetting.enforcePasswordStrength},e.prototype.getPasswordStrengthValidity=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){return e=this.getLoginOption(),t=o.get(e,"strengthValidity"),o.isString(t)?this.passwordStrengthSetting.passwordStrengthValidity="true"===t:this.passwordStrengthSetting.passwordStrengthValidity=!!t,[2,this.passwordStrengthSetting.passwordStrengthValidity]}))}))},e.prototype.getPasswordStrengthEnforced=function(){return this.getEnforcePasswordStrength()||this.getPasswordStrengthValidity()},e.prototype.cleanMessages=function(){this.alert.clearAll()},e.prototype.addSuccessMessage=function(e){var t=this.SUCCESS_MESSAGES[e];t&&this.alert.add({text:t,type:"success",timeout:0})},e.prototype.getAuthStrategy=function(){var e=this.cookieAuth,t=this.getStoredToken(),n=this.getStoredTfaToken();return t&&(e=this.basicAuth,this.setCredentials({token:t,tfa:n},this.basicAuth)),e},e.prototype.useBasicAuth=function(e){return this.setCredentials(e,this.basicAuth),this.basicAuth},e.prototype.login=function(e,t){return void 0===e&&(e=this.getAuthStrategy()),jc(this,void 0,void 0,(function(){var n,a,s,o,r,l;return bc(this,(function(i){switch(i.label){case 0:return this.client.setAuth(e),[4,this.tenant.current()];case 1:return n=i.sent(),a=n.data,[4,this.switchLoginMode(t)];case 2:return i.sent()&&(e=this.cookieAuth),[4,this.user.current()];case 3:return s=i.sent(),o=s.data,[4,this.verifyAppAccess()];case 4:return i.sent(),r=this.getSupportUserName(t),(l=this.setCredentials({tenant:a.name,user:(r?r+"$":"")+o.userName},e))&&this.storeBasicAuthToken(l),[4,this.authFulfilled(a,o,r)];case 5:return i.sent(),[2]}}))}))},e.prototype.authFulfilled=function(e,t,n){return jc(this,void 0,void 0,(function(){var a;return bc(this,(function(s){switch(s.label){case 0:return e?[3,2]:[4,this.tenant.current()];case 1:a=s.sent().data,e=a,this.client.tenant=e.name,s.label=2;case 2:return t?[3,4]:[4,this.user.current()];case 3:a=s.sent().data,t=a,s.label=4;case 4:return n||(n=null),this.ui.setUser({user:t,supportUserName:n}),this.ui.currentTenant.next(e),[2]}}))}))},e.prototype.switchLoginMode=function(e){return jc(this,void 0,void 0,(function(){var t,n,a,s;return bc(this,(function(o){switch(o.label){case 0:return(t=this.isPasswordGrantLogin(e))&&e?(n=new URLSearchParams({grant_type:"PASSWORD",username:e.user,password:e.password,tfa_code:e.tfa}),a=new URLSearchParams(this.loginMode.initRequest.split("?").pop()),e.tenant=a.get("tenant_id"),[4,this.client.fetch("tenant/oauth?"+a.toString(),{method:"POST",body:n.toString(),headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8"}})]):[3,2];case 1:if(!(s=o.sent()).ok)throw{res:s};this.client.setAuth(this.cookieAuth),this.cleanLocalStorage(),this.basicAuth.logout(),o.label=2;case 2:return[2,t]}}))}))},e.prototype.isPasswordGrantLogin=function(e){return!(e&&e.user.includes("$")||!this.loginMode||this.loginMode.type!==this.OAUTH2_INTERNAL_TYPE)},e.prototype.isSupportUser=function(e){return!(!e||!e.user.includes("$"))},e.prototype.showTenant=function(){return!this.ui.state.loginOptions||this.isLocal()||this.isShowTenant()},e.prototype.logout=function(e){return void 0===e&&(e=!0),jc(this,void 0,void 0,(function(){var t,n;return bc(this,(function(a){switch(a.label){case 0:t=null,a.label=1;case 1:return a.trys.push([1,4,5,6]),[4,this.reset()];case 2:return n=wc.apply(void 0,[a.sent(),2]),n[0],[4,n[1].json()];case 3:return t=a.sent(),[3,6];case 4:return a.sent(),this.alert.removeLastDanger(),[3,6];case 5:return t&&t.url?this.redirect(t.url):e&&window.location.reload(),[7];case 6:return[2]}}))}))},e.prototype.reset=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){return this.cleanLocalStorage(),this.cleanSessionStorage(),this.realtime.disconnect(),this.ui.currentUser.next(null),[2,Promise.all([this.basicAuth.logout(),this.cookieAuth.logout()])]}))}))},e.prototype.saveTFAToken=function(e,t){t.setItem(this.TFATOKEN_KEY,e)},e.prototype.verifyAppAccess=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.ui.loadManifest()];case 1:return t.sent(),[3,3];case 2:if(!(e=t.sent()).res||404!==e.res.status||!this.isLocal())throw e;return[3,3];case 3:return[2]}}))}))},e.prototype.setCredentials=function(e,t){e.tenant&&(this.client.tenant=e.tenant);var n=this.basicAuth.updateCredentials({tenant:e.tenant,user:e.user}),a=fc({token:n},e);return t.updateCredentials(a)},e.prototype.isLocal=function(){var e=window.location.hostname;return this.localhostIpRegExp.test(e)||this.localhostRegExp.test(e)},e.prototype.saveToken=function(e,t){t.setItem(this.TOKEN_KEY,e)},e.prototype.storeBasicAuthToken=function(e){this.saveToken(e,sessionStorage),this.rememberMe&&this.saveToken(e,localStorage)},e.prototype.cleanLocalStorage=function(){localStorage.removeItem(this.TOKEN_KEY),localStorage.removeItem(this.TFATOKEN_KEY)},e.prototype.cleanSessionStorage=function(){sessionStorage.removeItem(this.TOKEN_KEY),sessionStorage.removeItem(this.TFATOKEN_KEY)},e.prototype.isShowTenant=function(){return this.showTenantRegExp.test(window.location.href)},e.prototype.redirect=function(e){window.location.href=e},e.prototype.getLoginOption=function(){return wc(this.ui.state.loginOptions||[],1)[0]},e.prototype.getSupportUserName=function(e){return void 0===e&&(e=this.getStoredCredentials()),e?e.user.match(/^(.+\/)?((.+)\$)?(.+)?$/)[3]:null},e.prototype.getStoredCredentials=function(){var e=this.getStoredToken();return e?this.decodeToken(e):null},e.prototype.getStoredToken=function(){return localStorage.getItem(this.TOKEN_KEY)||sessionStorage.getItem(this.TOKEN_KEY)},e.prototype.getStoredTfaToken=function(){return localStorage.getItem(this.TFATOKEN_KEY)||sessionStorage.getItem(this.TFATOKEN_KEY)},e.prototype.decodeToken=function(e){var t=decodeURIComponent(escape(window.atob(e))).match(/(([^/]*)\/)?([^/:]+):(.+)/);return{tenant:t[2],user:t[3],password:t[4]}},e.ctorParameters=function(){return[{type:l.FetchClient},{type:l.BasicAuth},{type:l.CookieAuth},{type:$c},{type:l.UserService},{type:l.TenantService},{type:l.Realtime},{type:Mc},{type:r.ApiService},{type:l.TenantLoginOptionsService},{type:c.LocationStrategy,decorators:[{type:t.Optional}]}]},e=yc([t.Injectable(),vc(10,t.Optional())],e)}(),dd=function(){function e(e,n,a,s,o){this.user=e,this.ui=n,this.client=a,this.alert=s,this.loginService=o,this.passwordConfirmedEmitter=new t.EventEmitter,this.loading=!1}return e.prototype.passwordConfirm=function(){return jc(this,void 0,void 0,(function(){var e,t,n,a,s;return bc(this,(function(r){switch(r.label){case 0:if(!this.password)return[3,5];e=this.ui.currentSupportUserName.value,t=this.ui.currentUser.value.id,n={password:this.password,user:(e?e+"$":"")+t,tenant:this.client.tenant},r.label=1;case 1:return r.trys.push([1,3,4,5]),this.loading=!0,a=o.clone(this.loginService.useBasicAuth({})),delete n.tfa,a.updateCredentials(n),[4,this.createNewClient(a,this.client.baseUrl).user.current()];case 2:return r.sent(),this.emitSuccessAndClose(),[3,5];case 3:return(s=r.sent()).res&&401===s.res.status&&s.data&&/pin|totp/i.test(s.data.message)?this.emitSuccessAndClose():this.alert.danger("Provided password doesn't match your current one."),[3,5];case 4:return this.loading=!1,[7];case 5:return[2]}}))}))},e.prototype.cancel=function(){this.passwordConfirmedEmitter.emit(!1),this.modal._dismiss()},e.prototype.createNewClient=function(e,t){return new l.Client(e,t)},e.prototype.emitSuccessAndClose=function(){this.passwordConfirmedEmitter.emit(!0),this.modal._dismiss()},e.ctorParameters=function(){return[{type:l.UserService},{type:$c},{type:l.FetchClient},{type:Mc},{type:ud}]},yc([t.Output()],e.prototype,"passwordConfirmedEmitter",void 0),yc([t.ViewChild("modal",{static:!1})],e.prototype,"modal",void 0),e=yc([t.Component({selector:"c8y-password-confirm-modal",template:'<c8y-modal [customFooter]="true" [title]="\'Confirm password\' | translate" #modal>\r\n <form #confirmForm="ngForm" (ngSubmit)="confirmForm.form.valid && passwordConfirm()">\r\n <c8y-form-group>\r\n <label translate for="currentPassword">Current password</label>\r\n <input\r\n id="currentPassword"\r\n [(ngModel)]="password"\r\n type="password"\r\n name="password"\r\n class="form-control"\r\n placeholder="{{ \'Current password\' | translate }}"\r\n required\r\n />\r\n </c8y-form-group>\r\n\r\n <div class="modal-footer">\r\n <button\r\n title="{{ \'Cancel\' | translate }}"\r\n class="btn btn-default"\r\n type="button"\r\n (click)="cancel()"\r\n translate\r\n >\r\n Cancel\r\n </button>\r\n <button\r\n title="{{ \'Save\' | translate }}"\r\n class="btn btn-primary"\r\n type="submit"\r\n [disabled]="!confirmForm.form.valid || loading"\r\n translate\r\n >\r\n Save\r\n </button>\r\n </div>\r\n </form>\r\n</c8y-modal>\r\n'})],e)}(),pd=function(){function e(e){this.modalService=e,this.GREEN={colorName:"green",color:"rgb(0, 128, 0)",description:"strong",passwordStrength:l.PasswordStrength.GREEN},this.YELLOW={colorName:"yellow",color:"rgb(255, 204, 51)",description:"medium",passwordStrength:l.PasswordStrength.YELLOW},this.RED={colorName:"red",color:"rgb(170, 0, 51)",description:"weak",passwordStrength:l.PasswordStrength.RED}}return e.prototype.confirmPassword=function(){return this.modalService.show(dd).content.passwordConfirmedEmitter.pipe(s.take(1))},e.prototype.hasLowerCase=function(e){return-1!==e.search(/[a-z]/)},e.prototype.hasUpperCase=function(e){return-1!==e.search(/[A-Z]/)},e.prototype.hasNumbers=function(e){return-1!==e.search(/[0-9]/)},e.prototype.hasSpecialChars=function(e){return-1!==e.search(/[^0-9a-zA-Z]+/)},e.prototype.getStrengthColor=function(e){var t=o.filter([this.hasLowerCase(e),this.hasUpperCase(e),this.hasNumbers(e),this.hasSpecialChars(e)]).length;return t>2?this.GREEN:t>=2?this.YELLOW:this.RED},e.ctorParameters=function(){return[{type:nc.BsModalService}]},e=yc([t.Injectable()],e)}(),md=function(){function e(e,t){var n=this;this.loginService=e,this.passwordStrengthChecker=t,this.minGreenLength=0,this.checklist=[{label:"Include lowercase characters (e.g. abcdef)",check:this.passwordStrengthChecker.hasLowerCase,icon:"",contextualColor:""},{label:"Include uppercase characters (e.g. ABCDEF)",check:this.passwordStrengthChecker.hasUpperCase,icon:"",contextualColor:""},{label:"Include numbers (e.g. 123456)",check:this.passwordStrengthChecker.hasNumbers,icon:"",contextualColor:""},{label:"Include symbols (e.g. !@#$%^)",check:this.passwordStrengthChecker.hasSpecialChars,icon:"",contextualColor:""},{label:"Must have at least {{length}} characters",check:function(e){return e.length>=n.minGreenLength},icon:"",contextualColor:""}]}return Object.defineProperty(e.prototype,"password",{set:function(e){"string"==typeof e&&this.onPasswordChange(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.minGreenLength=this.loginService.getGreenMinLength()},Object.defineProperty(e.prototype,"translateParams",{get:function(){return{length:this.minGreenLength}},enumerable:!0,configurable:!0}),e.prototype.onPasswordChange=function(e){this.checklist=o.map(this.checklist,(function(t){var n=t.check(e);return o.assign(t,{icon:n?"check":"",contextualColor:n?"":"text-muted"}),t}))},e.ctorParameters=function(){return[{type:ud},{type:pd}]},yc([t.Input("password")],e.prototype,"password",null),e=yc([t.Component({selector:"c8y-password-check-list",template:'<div>\n <span class="small">{{\'Please meet 4 out of 5 the conditions below\' | translate}}:</span>\n <ul class="list-unstyled">\n <li class="small" *ngFor="let requirement of checklist">\n <i style="color:lightgreen;" [c8yIcon]="requirement.icon"></i> \n <span\n [translate]="requirement.label"\n [translateParams]="this.translateParams"\n class="small {{requirement.contextualColor}}"\n ></span>\n </li>\n </ul>\n</div>\n'})],e)}(),gd=function(){function e(e){this.passwordConfirm=e}var n;return n=e,e.prototype.validate=function(e){var t=e.value,n=e.root.get(this.passwordConfirm);return n&&t!==n.value?{passwordConfirm:!0}:null},e.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["passwordConfirm"]}]}]},e=n=yc([t.Directive({selector:"[passwordConfirm]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]}),vc(0,t.Attribute("passwordConfirm"))],e)}(),hd=function(){function e(){this.GREEN={colorName:"green",color:"rgb(0, 128, 0)",description:"strong",passwordStrength:l.PasswordStrength.GREEN},this.YELLOW={colorName:"yellow",color:"rgb(255, 204, 51)",description:"medium",passwordStrength:l.PasswordStrength.YELLOW},this.RED={colorName:"red",color:"rgb(170, 0, 51)",description:"weak",passwordStrength:l.PasswordStrength.RED}}return e.prototype.hasLowerCase=function(e){return-1!==e.search(/[a-z]/)},e.prototype.hasUpperCase=function(e){return-1!==e.search(/[A-Z]/)},e.prototype.hasNumbers=function(e){return-1!==e.search(/[0-9]/)},e.prototype.hasSpecialChars=function(e){return-1!==e.search(/[^0-9a-zA-Z]+/)},e.prototype.getStrengthColor=function(e){var t=o.filter([this.hasLowerCase(e),this.hasUpperCase(e),this.hasNumbers(e),this.hasSpecialChars(e)]).length;return t>2?this.GREEN:t>=2?this.YELLOW:this.RED},e=yc([t.Injectable()],e)}(),fd=function(){function e(e){this.passwordStrengthCheckerService=e,this.strength=new t.EventEmitter,this.password=""}return Object.defineProperty(e.prototype,"password",{set:function(e){"string"==typeof e&&(this.model=this.passwordStrengthCheckerService.getStrengthColor(e),this.strength.emit(this.model))},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:pd}]},yc([t.Input("password")],e.prototype,"password",null),yc([t.Output()],e.prototype,"strength",void 0),e=yc([t.Component({selector:"c8y-password-strength",template:'<div class="password-strength">\r\n <span class="password-strength-label" translate>Password strength</span>\r\n <span class="pull-right ng-binding" [ngStyle]="{\'color\': model.color}">{{model.description | translate}}</span>\r\n <div>\r\n <div class="password-{{model.colorName}}" [ngStyle]="{\'background-color\': model.color}"></div>\r\n </div>\r\n</div>'})],e)}(),yd=function(){function e(e){this.loginService=e,this.password=new t.EventEmitter,this.model={},this.changePassword=!1,this.passwordEnforced=!1}return e.prototype.ngOnInit=function(){this.loadPasswordStrengthSettings(),this.minlength=this.loginService.getGreenMinLength()},e.prototype.newPasswordChanged=function(){this.password.emit({password:this.model.newPassword,passwordStrength:this.model.strength})},e.prototype.loadPasswordStrengthSettings=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return e=this,[4,this.loginService.getEnforcePasswordStrength()];case 1:return e.passwordEnforced=t.sent(),[2]}}))}))},e.prototype.showPasswordStrength=function(){return this.model.newPassword&&this.model.newPassword.length>=this.minlength},e.prototype.toggleChangePassword=function(){this.changePassword=!this.changePassword,this.changePassword||(this.password.emit({}),this.model={})},e.ctorParameters=function(){return[{type:ud}]},yc([t.Output()],e.prototype,"password",void 0),e=yc([t.Component({selector:"c8y-new-password",template:'<div class="form-group">\n <button type="button" class="btn btn-default" (click)="toggleChangePassword()">\n <ng-container *ngIf="!changePassword">\n {{ \'Change password\' | translate }}\n </ng-container>\n <ng-container *ngIf="changePassword">\n {{ \'Cancel password change\' | translate }}\n </ng-container>\n </button>\n</div>\n\n<div *ngIf="changePassword">\n <c8y-form-group>\n <label for="newPassword" translate>Password</label>\n <input\n id="newPassword"\n [(ngModel)]="model.newPassword"\n #newPassword="ngModel"\n (change)="newPasswordChanged()"\n type="password"\n name="newPassword"\n class="form-control"\n placeholder="{{ \'e.g. my_new_password\' | translate }}"\n required\n c8yDefaultValidation="password"\n autocomplete="new-password"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label for="newConfirmPassword" translate>Confirm password</label>\n <input\n id="newConfirmPassword"\n [(ngModel)]="model.newPasswordConfirm"\n #newPasswordConfirm="ngModel"\n type="password"\n name="newPasswordConfirm"\n class="form-control"\n placeholder="{{ \'e.g. my_new_password\' | translate }}"\n required\n passwordConfirm="newPassword"\n autocomplete="new-password"\n />\n </c8y-form-group>\n\n <c8y-password-strength\n [password]="model.newPassword"\n [hidden]="!showPasswordStrength()"\n (strength)="model.strength = $event"\n ></c8y-password-strength>\n\n <c8y-password-check-list\n [password]="model.newPassword"\n [hidden]="!passwordEnforced"\n ></c8y-password-check-list>\n</div>\n',viewProviders:[{provide:ac.ControlContainer,useExisting:ac.NgForm}]})],e)}(),vd=function(){function n(t){var n=this;this.modal=t,this.status=e.Status.INFO,this._labels={ok:"OK",cancel:"Cancel"},this.result=new Promise((function(e,t){n.dismiss=function(){t(),n.modal.hide()},n.close=function(){e(!0),n.modal.hide()}}))}return Object.defineProperty(n.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e||{},n=t.ok,a=void 0===n?"OK":n,s=t.cancel,o=void 0===s?"Cancel":s;this._labels={ok:a,cancel:o}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"classIcon",{get:function(){return"fa-"+Mu[this.status]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"classAlert",{get:function(){return Ru[this.status]},enumerable:!0,configurable:!0}),n.prototype.ngOnDestroy=function(){this.dismiss()},n.ctorParameters=function(){return[{type:nc.BsModalRef}]},yc([t.Input()],n.prototype,"title",void 0),yc([t.Input()],n.prototype,"body",void 0),yc([t.Input()],n.prototype,"status",void 0),yc([t.Input()],n.prototype,"labels",null),n=yc([t.Component({selector:"c8y-confirm-modal",template:'<div class="c8y-prompt alert" [ngClass]="[classAlert]">\n <h3 class="bottom-m-md" *ngIf="title">\n <i class="fa fw" [ngClass]="[classIcon]"></i>\n <span *ngIf="title">{{ title | translate }}</span>\n </h3>\n <p class="text-wrap" style="word-wrap:break-word;">{{ body | translate }}</p>\n <div class="alert-footer">\n <button\n title="{{ labels.cancel | translate }}"\n class="btn btn-default"\n *ngIf="labels.cancel !== null"\n (click)="dismiss()"\n >\n {{ labels.cancel | translate }}\n </button>\n <button title="{{ labels.ok | translate }}" class="btn btn-primary" (click)="close()">\n {{ labels.ok | translate }}\n </button>\n </div>\n</div>\n'})],n)}(),jd=function(){function e(e){this.modal=e,this.onDismiss=new t.EventEmitter,this.onClose=new t.EventEmitter,this.disabled=!1,this.customFooter=!1,this._labels={ok:"OK",cancel:"Cancel"}}return Object.defineProperty(e.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e.ok,n=e.cancel;this._labels={ok:t,cancel:n}},enumerable:!0,configurable:!0}),e.prototype._dismiss=function(){var e=this,t=this.dismiss;!t&&this.modal&&(t=function(){return e.modal.hide()}),t&&t(),this.onDismiss.emit(!0)},e.prototype._close=function(){var e=this,t=this.close;!t&&this.modal&&(t=function(){return e.modal.hide()}),t&&t(),this.onClose.emit(!0)},e.prototype.onEnterKeyDown=function(e){var t=Qi.isEmpty(this.labels.ok)!==Qi.isEmpty(this.labels.cancel),n=!this.customFooter&&this.labels.cancel,a=!this.customFooter&&!this.disabled&&this.labels.ok;t&&n&&this._dismiss(),t&&a&&this._close()},e.ctorParameters=function(){return[{type:nc.BsModalRef,decorators:[{type:t.Optional}]}]},yc([t.Output()],e.prototype,"onDismiss",void 0),yc([t.Output()],e.prototype,"onClose",void 0),yc([t.Input()],e.prototype,"disabled",void 0),yc([t.Input()],e.prototype,"close",void 0),yc([t.Input()],e.prototype,"dismiss",void 0),yc([t.Input()],e.prototype,"title",void 0),yc([t.Input()],e.prototype,"body",void 0),yc([t.Input()],e.prototype,"customFooter",void 0),yc([t.Input()],e.prototype,"labels",null),yc([t.HostListener("document:keydown.enter",["$event"])],e.prototype,"onEnterKeyDown",null),e=yc([t.Component({selector:"c8y-modal",template:'<div class="modal-header">\n <ng-content select="[c8y-modal-title]"></ng-content>\n <h3 [hidden]="!title">{{title | translate}}</h3>\n</div>\n<div class="modal-body">\n <p\n [hidden]="!title"\n class="text-center text-wrap"\n style="word-wrap:break-word;"\n >{{body}}</p>\n <ng-content></ng-content>\n</div>\n<div class="modal-footer" *ngIf="!customFooter">\n <ng-content select="[c8y-modal-footer]"></ng-content>\n <button\n title="{{ labels.cancel | translate }}" \n *ngIf="labels.cancel"\n class="btn btn-default"\n (click)="_dismiss()"\n >{{labels.cancel | translate}}</button>\n <button\n title="{{ labels.ok | translate }}" \n *ngIf="labels.ok"\n class="btn btn-primary"\n (click)="_close()"\n [disabled]="disabled"\n >{{labels.ok | translate}}</button>\n</div>\n'}),vc(0,t.Optional())],e)}(),bd=function(){function n(e){this.modalService=e}return n.prototype.confirm=function(t,n,a,s){return void 0===a&&(a=e.Status.INFO),void 0===s&&(s={}),jc(this,void 0,void 0,(function(){var e;return bc(this,(function(o){switch(o.label){case 0:return e={ok:s.ok||"Confirm",cancel:s.cancel||"Cancel"},[4,this.modalService.show(vd,{initialState:{title:t,body:n,labels:e,status:a}}).content.result];case 1:return[2,o.sent()]}}))}))},n.prototype.acknowledge=function(t,n,a,s){return void 0===a&&(a=e.Status.INFO),void 0===s&&(s="Confirm"),jc(this,void 0,void 0,(function(){var e;return bc(this,(function(o){switch(o.label){case 0:return e={ok:s,cancel:null},[4,this.modalService.show(vd,{initialState:{title:t,body:n,labels:e,status:a}}).content.result];case 1:return[2,o.sent()]}}))}))},n.ctorParameters=function(){return[{type:nc.BsModalService}]},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n(t.ɵɵinject(nc.BsModalService))},token:n,providedIn:"root"}),n=yc([t.Injectable({providedIn:"root"})],n)}(),wd=function(){function e(){this.buttons=[{label:"cancel",action:function(){return Promise.reject()}}],this.isOpen=!1,this.containerClass="",this.placement="right",this.outsideClick=!1}return e.prototype.show=function(e){return jc(this,void 0,void 0,(function(){var t,n=this;return bc(this,(function(a){switch(a.label){case 0:this.buttons=e||this.buttons,this.isOpen=!0,a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,new Promise((function(e,t){return n.click=function(n){return n().then(e).catch(t)}}))];case 2:return t=a.sent(),[3,5];case 3:throw a.sent();case 4:return this.isOpen=!1,[7];case 5:return[2,t]}}))}))},e.prototype.buttonStatus=function(e){return e?"btn-"+e:"btn-link btn-clean"},e.prototype.handleOutsideClick=function(){this.click((function(){return Promise.reject()}))},yc([t.ViewChild(sc.PopoverDirective,{static:!1})],e.prototype,"popover",void 0),yc([t.Input()],e.prototype,"buttons",void 0),yc([t.Input()],e.prototype,"message",void 0),yc([t.Input()],e.prototype,"title",void 0),yc([t.Input()],e.prototype,"isOpen",void 0),yc([t.Input()],e.prototype,"containerClass",void 0),yc([t.Input()],e.prototype,"placement",void 0),yc([t.Input()],e.prototype,"outsideClick",void 0),e=yc([t.Component({selector:"c8y-popover-confirm",template:'<span\n [popover]="popover"\n container="body"\n [isOpen]="isOpen"\n [popoverTitle]="title | translate"\n [placement]="placement"\n [containerClass]="containerClass"\n [outsideClick]="outsideClick"\n (onHidden)="handleOutsideClick()"\n></span>\n<ng-template #popover>\n <p class="bottom-m">\n {{ message | translate }}\n </p>\n <div class="popover-footer">\n <ng-container *ngFor="let button of buttons">\n <button\n title="{{ button.label | translate }}"\n class="btn btn-sm right-m-md"\n [ngClass]="buttonStatus(button.status)"\n (click)="click(button.action)"\n >\n {{ button.label | translate }}\n </button>\n </ng-container>\n </div>\n</ng-template>\n'})],e)}(),Sd=function(){function e(){}return e=yc([t.NgModule({imports:[nc.ModalModule.forRoot(),Yu,sc.PopoverModule.forRoot()],exports:[vd,jd,wd],declarations:[vd,jd,wd],providers:[bd],entryComponents:[vd]})],e)}(),Cd=function(){function e(){}var n;return n=e,e.prototype.validate=function(e){return this.validateInternationalPhoneNumber(e)?null:{internationalPhoneNumber:!0}},e.prototype.validateInternationalPhoneNumber=function(e){var t;try{var n=oc.parsePhoneNumberFromString(e.value);(t=n.isValid())&&e.value!==n.format("E.164")&&e.setValue(n.format("E.164"),{emitEvent:!1,emitModelToViewChange:!1})}catch(n){t=!e.value}return t},e=n=yc([t.Directive({selector:"[c8yPhoneValidation]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),Id=function(){function e(){}return e.get=function(e){return this.rules[e]},e.messages={deviceId:'Device ID must not contain spaces or slashes ("/").',domain:"Only lowercase letters, digits, hyphens and underscores allowed in the first part of the URI. Must start with a letter; hyphens and underscores only allowed in the middle. Must be a valid URI.",email:"Invalid email address.",internationalPhoneNumber:"International phone number required, in the format +49 9 876 543 210.",loginAlias:'Login alias must not contain slashes ("/", "\\") nor ("+"), (":"), ("$") signs.',max:"Max value: {{ value }}",min:"Min value: {{ value }}",opcuaBrowsePath:"Invalid OPC UA URI.",password:"Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:'\",.<>{}[]\\/",passwordConfirm:"Passwords do not match.",passwordStrength:"Password not good enough, password must be stronger (green).",phoneNumber:'Invalid phone number format. Only digits, spaces, slashes ("/") and dashes ("-") allowed.',required:"This field is required.",tenantId:"May contain lowercase letters, digits, hyphens and underscores. Must start with a letter; hyphens and underscores only allowed in the middle; minimum 2 characters.",urlSegment:"Slash, single or double dots and white space not allowed",user:'Username must not contain spaces nor slashes ("/", "\\") nor ("+"), (":"), ("$") signs.'},e.rules={deviceId:{pattern:/^[^\s/]*$/},domain:{pattern:/^[a-z]+[a-z0-9_-]*[a-z0-9]+\.{1}.+$/},groupName:{maxLength:254},hostname:{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])$/},ip:{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]?)$/},opcuaBrowsePath:{pattern:/^(opc.tcp|http|https):\/\/[^ "]+$/},password:{pattern:/^[a-zA-Z0-9`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]{8,32}$/},phoneNumber:{pattern:/^$|^(\+|0{2})[\d\s/-]{1,30}$/},tenantId:{pattern:/^[a-z]+[a-z0-9_-]*[a-z0-9]+$/},user:{pattern:/^[^\\/\s$:+]*$/},urlSegment:{pattern:/^(([.]{1,2})|([/])+|(([/]*)([.]{1,2})([/]*))|((.*)([/]|[ ]+)(.*))|(\s+))$/},loginAlias:{pattern:/^[^\\/$:+]*$/}},e}(),Pd=function(){function e(){this.c8yDefaultValidation=""}var n;return n=e,e.prototype.validate=function(e){var t;if(!e.value)return null;var n=Id.get(this.c8yDefaultValidation);if(!n)throw new Error("Pattern "+this.c8yDefaultValidation+" not found.");var a=!0;return n.pattern&&(a=n.pattern.test(e.value)),n.maxLength&&(a=e.value.length<n.maxLength),n.minLength&&(a=e.value.length>=n.minLength),a?null:((t={})[this.c8yDefaultValidation]=!0,t)},yc([t.Input()],e.prototype,"c8yDefaultValidation",void 0),e=n=yc([t.Directive({selector:"[c8yDefaultValidation]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),Od=function(){function e(){this.min=""}var n;return n=e,e.prototype.validate=function(e){var t=parseInt(this.min,10);if(o.isUndefined(e.value)||!this.min)return null;return null===e.value||!(e.value<t)?null:{min:{value:t}}},yc([t.Input()],e.prototype,"min",void 0),e=n=yc([t.Directive({selector:"[min]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),xd=function(){function e(){this.max=""}var n;return n=e,e.prototype.validate=function(e){var t=parseInt(this.max,10);if(o.isUndefined(e.value)||!this.max)return null;return!(e.value>t)?null:{max:{value:t}}},yc([t.Input()],e.prototype,"max",void 0),e=n=yc([t.Directive({selector:"[max]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),Ed=function(){function e(){}return yc([t.Input()],e.prototype,"name",void 0),yc([t.Input()],e.prototype,"text",void 0),e=yc([t.Directive({selector:"c8y-message"})],e)}(),kd=function(){function e(e){this.translateService=e,this.show={},this.defaults=Id.messages,this.messages=[],this.messageMap={}}return e.prototype.ngAfterContentInit=function(){this.messageMap=Object.assign({},this.defaults,this.customMessages.reduce((function(e,t){return e[t.name]=t.text,e}),{}))},e.prototype.changVisibility=function(e){this.show=e,this.ngOnChanges()},e.prototype.ngOnChanges=function(){var e=this;this.show?this.messages=Object.keys(this.show).map((function(t){return e.toMessage(t,e.show[t])})):this.messages=[]},e.prototype.toMessage=function(e,t){return this.translateService.instant(this.messageMap[e],t)},e.ctorParameters=function(){return[{type:i.TranslateService}]},yc([t.Input()],e.prototype,"show",void 0),yc([t.Input()],e.prototype,"defaults",void 0),yc([t.ContentChildren(Ed)],e.prototype,"customMessages",void 0),e=yc([t.Component({selector:"c8y-messages",template:'<small class="form-control-feedback-message">\n <div style="display:block" *ngFor="let msg of messages">\n {{msg | translate}}\n </div>\n <ng-content></ng-content>\n</small>\n'})],e)}(),Td=function(){function e(){this.hasError=!1,this.hasWarning=!1,this.hasSuccess=!1,this.novalidation=!1,this.VALIDATION_DEBOUNCE_MS=1e3}return Object.defineProperty(e.prototype,"error",{get:function(){return"error"===this.status||this.hasError},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"warning",{get:function(){return"warning"===this.status||this.hasWarning},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"success",{get:function(){return"success"===this.status||this.hasSuccess},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this.initNgModel()},e.prototype.initNgModel=function(){var e=this;this.model&&(this.model.valueAccessor.registerOnTouched((function(){e.model.control&&!e.model.control.dirty&&(e.model.control.markAsDirty(),e.model.control.updateValueAndValidity({onlySelf:!0}))})),this.subscription=a.merge(this.model.valueChanges,this.model.statusChanges).pipe(s.filter((function(){return e.model.dirty&&!e.novalidation})),s.debounce((function(){return e.hasError?a.timer(10):a.timer(e.VALIDATION_DEBOUNCE_MS)}))).subscribe((function(){return e.update()})))},e.prototype.update=function(){this.hasError="INVALID"===this.model.status,this.customErrorMessage?this.customErrorMessage.changVisibility(this.model.errors):this.errors=this.model.errors},e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},yc([t.Input()],e.prototype,"hasError",void 0),yc([t.Input()],e.prototype,"hasWarning",void 0),yc([t.Input()],e.prototype,"hasSuccess",void 0),yc([t.Input()],e.prototype,"novalidation",void 0),yc([t.Input()],e.prototype,"status",void 0),yc([t.HostBinding("class.has-error")],e.prototype,"error",null),yc([t.HostBinding("class.has-warning")],e.prototype,"warning",null),yc([t.HostBinding("class.has-success")],e.prototype,"success",null),yc([t.ContentChild(kd,{static:!1})],e.prototype,"customErrorMessage",void 0),yc([t.ContentChild(ac.NgModel,{static:!0})],e.prototype,"model",void 0),e=yc([t.Component({selector:"c8y-form-group",template:'<ng-content></ng-content>\n<c8y-messages *ngIf="!customErrorMessage" [show]="errors"></c8y-messages>\n',host:{class:"form-group"}})],e)}(),Ad=function(){function e(){this.plus=!0,this.minus=!0,this.onRemove=new t.EventEmitter,this.onAdd=new t.EventEmitter}return e.prototype.add=function(){this.onAdd.emit(this.index)},e.prototype.remove=function(){this.onRemove.emit(this.index)},yc([t.Input()],e.prototype,"plus",void 0),yc([t.Input()],e.prototype,"minus",void 0),yc([t.Input()],e.prototype,"index",void 0),yc([t.Output()],e.prototype,"onRemove",void 0),yc([t.Output()],e.prototype,"onAdd",void 0),e=yc([t.Component({selector:"c8y-input-group-list",template:'<ng-container>\n <div class="input-group">\n <ng-content></ng-content>\n <div class="input-group-btn">\n <button\n *ngIf="minus"\n title="{{ \'Remove\' | translate }}"\n class="btn btn-clean text-primary"\n (click)="remove()"\n >\n <i c8yIcon="minus-circle" class="text-danger"></i>\n </button>\n <button\n *ngIf="plus"\n title="{{ \'Add\' | translate }}"\n class="btn btn-clean text-primary"\n (click)="add()"\n >\n <i class="fa fa-plus-circle"></i>\n </button>\n </div>\n </div>\n</ng-container>\n'})],e)}(),_d=function(){function e(){}return e.prototype.ngAfterContentInit=function(){var e=this;this.listProjections.map((function(t){t!==e.listProjections.last&&setTimeout((function(){t.plus=!1}))})),this.listProjections.changes.subscribe((function(e){1!==e.length?e.map((function(t){setTimeout((function(){t.minus=!0})),t!==e.last&&setTimeout((function(){t.plus=!1})),t===e.last&&setTimeout((function(){t.plus=!0}))})):setTimeout((function(){e.first.plus=!0,e.first.minus=!1}))}))},yc([t.ContentChildren(Ad)],e.prototype,"listProjections",void 0),e=yc([t.Directive({selector:"[c8yInputGroupListContainer]"})],e)}(),Nd=function(){function e(e){this.invalidJSON=new t.EventEmitter,this.message="Must be a valid JSON object.",this.debounceTimeInMs=1e3,this.abstractCtrl=e.control}return e.prototype.ngOnInit=function(){var e=this;this.subscription=this.abstractCtrl.valueChanges.pipe(s.tap((function(){return e.clearValidationMessage()})),s.debounceTime(this.debounceTimeInMs),s.distinctUntilChanged()).subscribe((function(t){e.validateInputAndPrettify(t)}))},e.prototype.ngOnDestroy=function(){this.subscription&&!this.subscription.closed&&this.subscription.unsubscribe()},e.prototype.validateInputAndPrettify=function(e){if(e)try{var t=JSON.parse(e),n=JSON.stringify(t,void 0,2);this.abstractCtrl.setValue(n)}catch(e){this.setErrorAndValidationMessage()}},e.prototype.setErrorAndValidationMessage=function(){this.abstractCtrl.setErrors({invalidBodyTemplate:!0}),this.invalidJSON.emit(this.message)},e.prototype.clearValidationMessage=function(){this.invalidJSON.emit(void 0)},e.ctorParameters=function(){return[{type:ac.NgControl}]},yc([t.Output()],e.prototype,"invalidJSON",void 0),e=yc([t.Directive({selector:"textarea[prettyValidJson]"})],e)}(),Dd=function(){function e(e,t){this.elem=e,this.renderer=t,this.rows=1,this.minHeightPerRow=20}return e.prototype.ngAfterViewInit=function(){var e=Number(this.heightPerRow);this.heightPerRow&&e&&e>this.minHeightPerRow?this.setHeight(this.rows*e+"px"):this.setHeight(this.rows*this.minHeightPerRow+"px")},e.prototype.setHeight=function(e){this.renderer.setStyle(this.elem.nativeElement,"height",e)},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},yc([t.Input(),t.HostBinding("rows")],e.prototype,"rows",void 0),yc([t.Input("heightPerRow")],e.prototype,"heightPerRow",void 0),e=yc([t.Directive({selector:"textarea[heightPerRow]"})],e)}(),Md=function(){function e(e,t,n){this.el=e,this.renderer=t,this.translationService=n,this.shouldSkipRequiredHint=!1,this.shouldSkipRequiredHint=!!this.el.nativeElement.closest("[placeholder-no-required-hint]")}return e.prototype.ngAfterContentChecked=function(){if(this.el&&this.el.nativeElement&&void 0!==this.el.nativeElement.required){var e=this.el.nativeElement.required&&!this.shouldSkipRequiredHint,t=this.el.nativeElement.placeholder;this.placeholder===t&&this.req===e||this.updatePlaceholder(this.getTextForPlaceholder(t,e))}},e.prototype.getTextForPlaceholder=function(e,t){void 0===e&&(e=""),void 0===t&&(t=!1),this.req=t;var n="("+this.translationService.instant("required")+")",a=e.lastIndexOf(n);return a>0&&(e=e.slice(0,a-1)),0===a&&(e=""),t?e.trim()?e+" "+n:n:e},e.prototype.updatePlaceholder=function(e){this.renderer.setAttribute(this.el.nativeElement,"placeholder",e),this.placeholder=e},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:i.TranslateService}]},e=yc([t.Directive({selector:"input[required]"})],e)}(),Ld=function(){function e(){}return Object.defineProperty(e.prototype,"data",{get:function(){return this.ipRangeList},set:function(e){this.ipRangeList=e,0===this.ipRangeList.length&&this.add()},enumerable:!0,configurable:!0}),e.prototype.add=function(){this.ipRangeList.push({ip:"",cidr:void 0})},e.prototype.remove=function(e){this.ipRangeList.splice(e,1)},yc([t.Input()],e.prototype,"data",null),e=yc([t.Component({selector:"c8y-ip-range-input-list",template:'<c8y-form-group class="m-t-8 m-b-8">\n <ul c8yInputGroupListContainer class="list-unstyled">\n <li class="m-b-8" *ngFor="let item of data; let i = index">\n <c8y-input-group-list [index]="i" (onAdd)="add()" (onRemove)="remove($event)">\n <input\n type="text"\n name="ipAddress"\n class="form-control m-r-4"\n placeholder="{{ \'IP range start, e.g.\' | translate }} 192.168.0.1"\n style="flex-grow: 2;"\n [(ngModel)]="item.ip"\n [required]="true"\n #ipAddress\n />\n <input\n type="number"\n name="cidr"\n [min]="0"\n class="form-control"\n placeholder="{{ \'e.g.\' | translate }} 20"\n [(ngModel)]="item.cidr"\n [required]="true"\n #cidr\n />\n </c8y-input-group-list>\n </li>\n </ul>\n</c8y-form-group>\n'})],e)}(),Rd=function(){function e(){this.onSearch=new t.EventEmitter,this.filterChange$=new a.Subject,this.filterTerm="",this.CARRIAGE_RETURN_KEY=13,this.CARRIAGE_RETURN_CODE="Enter"}return e.prototype.ngOnInit=function(){var e=this;this.reset(),this.filterChange$.pipe(s.debounce((function(t){return t.code===e.CARRIAGE_RETURN_CODE||t.keyCode===e.CARRIAGE_RETURN_KEY?a.timer(10):a.timer(300)})),s.map((function(e){return e.target.value})),s.distinctUntilChanged()).subscribe((function(t){e.filterTerm=t,e.onSearch.emit(t)}))},e.prototype.reset=function(){this.filterTerm="",this.onSearch.emit("")},e.prototype.ngOnDestroy=function(){this.filterChange$.complete()},yc([t.Input()],e.prototype,"icon",void 0),yc([t.Output()],e.prototype,"onSearch",void 0),e=yc([t.Component({selector:"c8y-filter",template:'<div class="input-group input-group-search">\n <input\n class="form-control"\n placeholder="{{ \'Filter…\' | translate }}"\n type="text"\n [value]="filterTerm"\n (keyup)="filterChange$.next($event)"\n />\n <span class="input-group-btn">\n <button class="btn btn-clean" (click)="reset()">\n <i [c8yIcon]="filterTerm.length === 0 ? icon : \'close\'"></i>\n </button>\n </span>\n</div>\n'})],e)}(),qd=function(){function e(){}return e=yc([t.NgModule({imports:[Yu,ac.FormsModule],exports:[Cd,Pd,Od,xd,ac.FormsModule,Td,Ed,kd,Ad,_d,Nd,Dd,Md,Ld,Rd],declarations:[Cd,Pd,Od,xd,Td,Ed,kd,Ad,_d,Nd,Dd,Md,Ld,Rd]})],e)}(),$d=function(){function e(e,n,a){this.loginService=e,this.users=n,this.alert=a,this.verify=!0,this.onSuccess=new t.EventEmitter,this.model={token:""},this.loading=!1,this.hasError=!1}return e.prototype.verifyCode=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.loading=!0,this.hasError=!1,this.verify?[4,this.users.verifyTotpCode(this.model.token)]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.onSuccess.emit(this.model.token),[3,4];case 3:return e.sent(),this.hasError=!0,this.alert.removeLastDanger(),this.loading=!1,[3,4];case 4:return[2]}}))}))},e.ctorParameters=function(){return[{type:ud},{type:l.UserService},{type:Mc}]},yc([t.Input()],e.prototype,"verify",void 0),yc([t.Output()],e.prototype,"onSuccess",void 0),yc([t.Input()],e.prototype,"loading",void 0),yc([t.Input()],e.prototype,"hasError",void 0),e=yc([t.Component({selector:"c8y-totp-challenge",template:'<form\n #totpForm="ngForm"\n role="form"\n class="loginForm"\n (ngSubmit)="verifyCode()"\n novalidate\n>\n\n <c8y-form-group\n [hasError]="hasError"\n [novalidation]="true"\n >\n <label\n translate\n for="totpToken"\n >Verification code</label>\n <input\n id="totpToken"\n [(ngModel)]="model.token"\n name="totpToken"\n type="text"\n autocapitalize="off"\n autocorrect="off"\n autocomplete="off"\n class="form-control"\n placeholder="{{\'Verification code\' | translate}}"\n required\n >\n <c8y-messages>\n <c8y-message *ngIf="hasError" translate>\n Invalid verification code. In case of key loss, please contact your platform administrator.\n </c8y-message>\n </c8y-messages>\n <p id="helpinput" *ngIf="!hasError" class="help-block" translate>\n In case of key loss, please contact your platform administrator.\n </p>\n </c8y-form-group>\n\n <button\n title="{{ \'Verify\' | translate }}" \n [disabled]="!totpForm.form.valid || loading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >Verify</button>\n\n</form>\n',viewProviders:[{provide:ac.ControlContainer,useExisting:ac.NgForm}]})],e)}(),Fd=function(){function e(e,n,a){this.loginService=e,this.users=n,this.alert=a,this.onCancel=new t.EventEmitter,this.model={smsToken:""},this.isLoading=!1,this.resendTfa="0"}return e.prototype.verifyTFACode=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return this.isLoading=!0,this.useOAuthInternal()?[4,this.verifyCodeWithOauth()]:[3,2];case 1:return e.sent(),[3,4];case 2:return[4,this.verifyCodeWithBasicAuth()];case 3:e.sent(),e.label=4;case 4:return this.isLoading=!1,[2]}}))}))},e.prototype.resendTFASms=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,3,4]),this.isLoading=!0,[4,this.users.verifyTFACode(this.resendTfa)];case 1:return t.sent(),[3,4];case 2:return 403===(e=t.sent()).res.status?(this.loginService.cleanMessages(),this.loginService.addSuccessMessage("resend_sms")):this.alert.addServerFailure(e),[3,4];case 3:return this.isLoading=!1,[7];case 4:return[2]}}))}))},e.prototype.useOAuthInternal=function(){return this.loginService.isPasswordGrantLogin(this.credentials)},e.prototype.verifyCodeWithOauth=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=this.credentials,[4,this.loginService.switchLoginMode(fc({},e,{tfa:this.model.smsToken}))];case 1:return n.sent(),[4,this.loginService.verifyAppAccess()];case 2:return n.sent(),[4,this.loginService.authFulfilled()];case 3:return n.sent(),[3,5];case 4:return t=n.sent(),401===(t.res&&t.res.status)?this.alert.danger("Invalid code"):this.alert.addServerFailure(t),[3,5];case 5:return[2]}}))}))},e.prototype.verifyCodeWithBasicAuth=function(){return jc(this,void 0,void 0,(function(){var e,t,n;return bc(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.users.verifyTFACode(this.model.smsToken)];case 1:return e=a.sent().res,t=e.headers.get("tfatoken"),this.credentials.tfa=t,this.loginWithTFA(t),[3,3];case 2:return n=a.sent(),403===(n.res&&n.res.status)?this.alert.danger("Invalid code"):this.alert.addServerFailure(n),[3,3];case 3:return[2]}}))}))},e.prototype.loginWithTFA=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.loginService.login(this.loginService.useBasicAuth({tfa:e}),this.credentials)];case 1:return n.sent(),this.loginService.saveTFAToken(e,sessionStorage),this.loginService.rememberMe&&this.loginService.saveTFAToken(e,localStorage),[3,3];case 2:return t=n.sent(),this.alert.addServerFailure(t),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:ud},{type:l.UserService},{type:Mc}]},yc([t.Input()],e.prototype,"credentials",void 0),yc([t.Output()],e.prototype,"onCancel",void 0),e=yc([t.Component({selector:"c8y-sms-challenge",template:'<form #twoFactorForm="ngForm" role="form" class="loginForm" (ngSubmit)="verifyTFACode()" novalidate>\n <div class="legend form-block center" translate>Insert the code received via SMS</div>\n\n <c8y-form-group>\n <label translate>Verification code</label>\n <input\n [(ngModel)]="model.smsToken"\n #sms_token="ngModel"\n type="text"\n name="sms_token"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Verification code\' | translate }}"\n required\n />\n </c8y-form-group>\n\n <button\n title="{{ \'Verify\' | translate }}"\n [disabled]="!twoFactorForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Verify\n </button>\n\n <div class="top-m-sm">\n <a\n title="{{ \'Login\' | translate }}"\n class="btn btn-link btn-sm pull-right"\n (click)="onCancel.emit()"\n translate\n >Login</a\n >\n <a\n title="{{ \'Send new code\' | translate }}"\n [ngClass]="{ disabled: isLoading }"\n class="btn btn-link btn-sm"\n (click)="resendTFASms()"\n translate\n >Send new code</a\n >\n </div>\n</form>\n'})],e)}(),Ud=function(){function e(e,t){this.user=e,this.alert=t}return Object.defineProperty(e.prototype,"qrCodeImage",{get:function(){return this.totpSecret?this.totpSecret.secretQrUrl:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"secret",{get:function(){return this.totpSecret?this.totpSecret.rawSecret:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qrData",{get:function(){var e=this.qrCodeImage.split("chl=")[1];return e?decodeURIComponent(e):(this.alert.danger("Failed to generate a QR code."),"")},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.user.generateTotpSecret()];case 1:return e=n.sent().data,this.totpSecret=e,[3,3];case 2:return t=n.sent(),this.alert.addServerFailure(t),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:l.UserService},{type:Mc}]},e=yc([t.Component({selector:"c8y-totp-setup",template:'<div class="text-center">\n <p\n class="lead bottom-m-md"\n translate\n >\n Scan this QR code with your smartphone using the Google Authenticator app.\n </p>\n\n\n <qrcode\n *ngIf="totpSecret"\n [width]="300"\n [qrdata]="qrData"\n [cssClass]="\'bottom-m-md\'"\n [errorCorrectionLevel]="\'M\'"\n ></qrcode>\n <p class="text-center text-muted">\n {{secret}}\n </p>\n</div>\n'})],e)}(),Bd=function(){function n(e,n,a){this.loginService=e,this.alert=n,this.userService=a,this.onCancel=new t.EventEmitter,this.onChangeView=new t.EventEmitter,this.requestInProgress=!1,this.sendTfa="0"}return n.prototype.sendTFASms=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.userService.verifyTFACode(this.sendTfa)];case 1:return t.sent(),[3,3];case 2:if(403!==(e=t.sent()).res.status)throw e;return this.loginService.cleanMessages(),this.loginService.addSuccessMessage("send_sms"),[3,3];case 3:return[2]}}))}))},n.prototype.save=function(){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),this.requestInProgress=!0,[4,this.userService.savePhoneNumber(this.phoneNumber)];case 1:return n.sent(),[4,this.sendTFASms()];case 2:return n.sent(),this.onChangeView.emit({view:e.LoginViews.SmsChallenge,credentials:this.credentials}),[3,5];case 3:return t=n.sent(),this.alert.addServerFailure(t),[3,5];case 4:return this.requestInProgress=!1,[7];case 5:return[2]}}))}))},n.ctorParameters=function(){return[{type:ud},{type:Mc},{type:l.UserService}]},yc([t.Input()],n.prototype,"credentials",void 0),yc([t.Output()],n.prototype,"onCancel",void 0),yc([t.Output()],n.prototype,"onChangeView",void 0),n=yc([t.Component({selector:"c8y-provide-phone-number",template:'<form\n #twoFactorForm="ngForm"\n role="form"\n class="loginForm"\n (ngSubmit)="save()"\n novalidate\n>\n <c8y-form-group>\n <label translate>Provide your phone number</label>\n\n <input\n class="form-control"\n [(ngModel)]="phoneNumber"\n #contactPhone="ngModel"\n type="text"\n name="phone"\n autocomplete="off"\n placeholder="{{ \'e.g. +49 9 876 543 210`LOCALIZE`\' | translate }}"\n c8yPhoneValidation\n c8yDefaultValidation="phoneNumber"\n required\n />\n </c8y-form-group>\n\n <button\n title="{{ \'Save and continue\' | translate }}"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n [disabled]="requestInProgress || twoFactorForm.invalid"\n >\n {{ \'Save and continue\' | translate }}\n </button>\n\n <div class="”m-t-16”">\n <a\n title="{{ \'Login\' | translate }}"\n class="btn btn-link pull-right"\n href="#"\n (click)="onCancel.emit()"\n >\n {{ \'Login\' | translate }}\n </a>\n </div>\n</form>\n'})],n)}(),zd=function(){function e(){}return e=yc([t.NgModule({declarations:[$d,gd,fd,md,yd,dd,Fd,Ud,Bd],imports:[qd,u.TooltipModule,Yu,Sd,rc.QRCodeModule],exports:[$d,fd,md,gd,yd,dd,Fd,Ud,Bd],entryComponents:[dd],providers:[hd,pd]})],e)}(),Gd=function(){function e(){}return yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"translate",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"path",void 0),yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=yc([t.Component({selector:"c8y-breadcrumb-item",template:"<ng-template #template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),Hd=function(){function e(){this.showAll=!1,this.breadcrumbs=[]}return e.prototype.normalizePath=function(e){return e.replace(/^#\/?/,"")},yc([t.Input()],e.prototype,"breadcrumbs",void 0),e=yc([t.Component({selector:"c8y-breadcrumb-outlet",template:'<div\n class="breadcrumbs-container"\n [ngClass]="{\n multiple: breadcrumbs.length > 1,\n open: showAll\n }"\n *ngIf="breadcrumbs && breadcrumbs.length > 0"\n>\n <button\n *ngIf="breadcrumbs.length > 1"\n class="btn-show-all-breadcrumbs pull-left"\n (click)="showAll = !showAll"\n >\n <i\n *ngIf="!showAll"\n [c8yIcon]="\'caret-right\'"\n tooltip="{{ \'Show all breadcrumbs\' | translate }}"\n container="body"\n placement="top"\n ></i>\n <i\n *ngIf="showAll"\n [c8yIcon]="\'caret-down\'"\n tooltip="{{ \'Collapse breadcrumbs\' | translate }}"\n container="body"\n placement="top"\n ></i>\n </button>\n\n <ul class="breadcrumbs text-muted" *ngFor="let breadcrumb of breadcrumbs; let first = first">\n <ng-container *ngIf="first || showAll">\n <li class="text-muted" *ngFor="let item of breadcrumb.items; let firstItem = first">\n <span *ngIf="!firstItem"> > </span>\n <ng-container *c8yOutlet="item.template"></ng-container>\n <ng-container *ngIf="item.label">\n <a\n [routerLink]="normalizePath(item.path)"\n class="word-break"\n title="{{ item.label | translate }}"\n >\n <i [c8yIcon]="item.icon" *ngIf="firstItem" class="right-m-xs"></i>\n <span>{{ item.label | translate }}</span>\n </a>\n </ng-container>\n </li>\n </ng-container>\n </ul>\n</div>\n'})],e)}(),Vd=function(){function e(e){this.breadcrumbService=e}return e.prototype.ngAfterViewInit=function(){var e=this;this.items=this.contentChildItems.toArray(),this.viewInitTimeout=setTimeout((function(){return e.breadcrumbService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.breadcrumbService.remove(this)},e.ctorParameters=function(){return[{type:Yc}]},yc([t.ContentChildren(Gd)],e.prototype,"contentChildItems",void 0),e=yc([t.Component({selector:"c8y-breadcrumb",template:"<ng-template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),Kd=function(){function e(){}return e=yc([t.NgModule({declarations:[Vd,Gd,Hd],imports:[n.RouterModule.forChild([]),Yu,u.TooltipModule.forRoot()],exports:[Vd,Gd,Hd]})],e)}(),Wd=function(){function e(e){this.alertService=e,this.search=[]}return e.prototype.openSearch=function(){var e=this;setTimeout((function(){return e.focusInputBox()}),100)},e.prototype.getByPriority=function(){return Qi.sortBy(this.search,this.byPriority)},e.prototype.closeDropdown=function(e){e.hide()},e.prototype.verifyNotEmpty=function(e){e&&""!==e||this.alertService.add({text:"Type something to execute a search.",type:"warning"})},e.prototype.byPriority=function(e){return-e.priority},e.prototype.focusInputBox=function(){var e=document.querySelector("#search-header-menu input");e&&e.focus()},e.ctorParameters=function(){return[{type:Mc}]},yc([t.Input()],e.prototype,"search",void 0),e=yc([t.Component({selector:"c8y-search-outlet",template:'<ng-container *ngIf="search">\n <div class="dropdown" dropdown #dropdown="bs-dropdown" *ngFor="let item of getByPriority()">\n <button\n title="{{ \'Search\' | translate }}"\n type="button"\n class="main-header-button dropdown-toggle c8y-dropdown"\n (click)="openSearch()"\n dropdownToggle\n >\n <i [c8yIcon]="item.icon" class="fa-2x"></i>\n </button>\n\n <div\n id="search-header-menu"\n class="search-header-menu dropdown-menu dropdown-menu-center"\n *dropdownMenu\n >\n <form\n (ngSubmit)="verifyNotEmpty(item.term); item.onSearch(); closeDropdown(dropdown)"\n novalidate\n #searchForm="ngForm"\n >\n <div class="input-group input-group-search" *ngIf="!item.template">\n <input\n type="search"\n class="form-control input-lg"\n required="required"\n [placeholder]="\'Search for groups or assets…\'|translate"\n (click)="$event.stopPropagation()"\n [(ngModel)]="item.term"\n name="searchTerm"\n />\n\n <span class="input-group-btn">\n <button type="submit" class="btn btn-link" (click)="$event.stopPropagation()">\n <i [c8yIcon]="\'arrow-right\'"></i>\n </button>\n </span>\n </div>\n\n <ng-container *c8yOutlet="item.template"></ng-container>\n </form>\n </div>\n </div>\n</ng-container>\n'})],e)}(),Yd=new t.InjectionToken("SearchFactory"),Zd=function(e){function o(t,n){var o=e.call(this)||this;return o.injector=t,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.items$=Cc(n,o.refreshTrigger,[function(){return o.injector.get(Yd,[])},Oc(o.state$)]).pipe(s.map((function(e){return xc(e)})),s.shareReplay(1)),o}return hc(o,e),o.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),Jd=function(){function e(e){this.searchService=e,this.icon="search",this.priority=0,this.search=new t.EventEmitter,this.term=""}return e.prototype.onSearch=function(){this.search.emit(this)},e.prototype.ngAfterViewInit=function(){var e=this;this.template=void 0,this.viewInitTimeout=setTimeout((function(){return e.searchService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.searchService.remove(this)},e.ctorParameters=function(){return[{type:Zd}]},yc([t.Input()],e.prototype,"name",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"priority",void 0),yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),yc([t.Output()],e.prototype,"search",void 0),yc([t.Input()],e.prototype,"term",void 0),e=yc([t.Component({selector:"c8y-search",template:"<ng-template #template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),Xd=function(){function e(){this.pattern="",this.text="",this.elementClass="text-info",this.highlightedText=""}return e.prototype.ngOnChanges=function(){var e=o.escape(this.text||""),t=o.escape(this.pattern||""),n=o.escapeRegExp(t).replace(/\\\*/g,".*");this.highlightedText=e.replace(new RegExp(n,"i"),'<strong class="'+this.elementClass+'">$&</strong>')},yc([t.ViewChild("text",{read:t.ElementRef,static:!0})],e.prototype,"container",void 0),yc([t.Input()],e.prototype,"pattern",void 0),yc([t.Input()],e.prototype,"text",void 0),yc([t.Input()],e.prototype,"elementClass",void 0),e=yc([t.Component({selector:"c8y-highlight",template:'<span [innerHTML]="highlightedText"></span>'})],e)}(),Qd=function(){function e(){this.NO_RESULT_FOUND="No results found.",this.msg=this.NO_RESULT_FOUND}return Object.defineProperty(e.prototype,"_message",{set:function(e){e&&e.length>0?this.msg=e:this.msg=this.NO_RESULT_FOUND},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this.msg},enumerable:!0,configurable:!0}),yc([t.Input("message")],e.prototype,"_message",null),e=yc([t.Component({selector:"c8y-search-result-empty",template:'<div class="no-results">\n <div class="c8y-empty-state">\n <h1 c8yIcon="search"></h1>\n <div class="p-t-8">\n <p><strong>{{ message | translate }}</strong></p>\n <small translate>Refine your search terms.</small>\n </div>\n </div>\n</div>\n'})],e)}(),ep=function(){function e(){}return e=yc([t.NgModule({declarations:[Wd,Jd,Xd,Qd],imports:[ac.FormsModule,tc.BsDropdownModule,Yu,n.RouterModule.forChild([])],exports:[Wd,Jd,Xd,Qd]})],e)}(),tp=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.state$=new a.BehaviorSubject({userMenuItems:new Set}),t}return hc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.add=function(e){this.state.userMenuItems.add(e),this.emitNewState()},n.prototype.remove=function(e){this.state.userMenuItems.delete(e),this.emitNewState()},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n=yc([t.Injectable({providedIn:"root"})],n)}(kc),np=function(){function e(e){this.userService=e,this.priority=0,this.click=new t.EventEmitter}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.userService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.userService.remove(this)},e.prototype.onClick=function(){this.click.emit(this)},e.ctorParameters=function(){return[{type:tp}]},yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"link",void 0),yc([t.Input()],e.prototype,"target",void 0),yc([t.Input()],e.prototype,"priority",void 0),yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),yc([t.Output()],e.prototype,"click",void 0),e=yc([t.Component({selector:"c8y-user-menu-item",template:'<ng-template #template>\n <li (click)="onClick()">\n <a style="cursor: pointer" [attr.href]="link" [attr.target]="target">\n <i [c8yIcon]="icon"></i>\n {{label | translate}}\n <ng-content></ng-content>\n </a>\n </li>\n</ng-template>'})],e)}(),ap=function(){function e(e,t,n,a,o,r,l,i,c){var u=this;this.modal=e,this.user=t,this.ui=n,this.auth=a,this.client=o,this.alert=r,this.translate=l,this.userPreferences=i,this.modalService=c,this.loading=!1,this.lang=this.ui.state.lang,this.modalService.onHide.pipe(s.take(1)).subscribe((function(e){null!==e&&void 0!==u.changedLang&&u.translate.switchToLanguage(u.lang)}))}return e.prototype.ngOnInit=function(){this.updateUserInAppState()},e.prototype.onDismiss=function(){void 0!==this.changedLang&&this.translate.switchToLanguage(this.lang),this.modal.hide()},e.prototype.onLanguage=function(e){this.changedLang=e,this.translate.switchToLanguage(this.changedLang)},e.prototype.updateAndClose=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:this.loading=!0,n.label=1;case 1:return n.trys.push([1,6,7,8]),[4,this.user.updateCurrent(e)];case 2:return n.sent(),e.password&&this.updateCredentials(e.password),[4,this.updateUserInAppState()];case 3:return n.sent(),this.changedLang&&this.changedLang!==this.lang?[4,this.persistLanguage(this.changedLang)]:[3,5];case 4:n.sent(),n.label=5;case 5:return this.modal.hide(),this.alert.success("User saved."),[3,8];case 6:return t=n.sent(),this.alert.addServerFailure(t),[3,8];case 7:return this.loading=!1,[7];case 8:return[2]}}))}))},e.prototype.persistLanguage=function(e){return jc(this,void 0,void 0,(function(){return bc(this,(function(t){return this.translate.saveInLocalStorage(e),this.userPreferences.set("language",e),[2]}))}))},e.prototype.updateUserInAppState=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return[4,this.user.current()];case 1:return e=t.sent(),this.ui.currentUser.next(e.data),[2]}}))}))},e.prototype.updateCredentials=function(e){var t={password:e,user:this.ui.currentUser.value.id,tenant:this.client.tenant};this.auth.updateCredentials(t)},e.ctorParameters=function(){return[{type:nc.BsModalRef},{type:l.UserService},{type:$c},{type:l.BasicAuth},{type:l.FetchClient},{type:Mc},{type:Cu},{type:zu},{type:nc.BsModalService}]},e=yc([t.Component({selector:"c8y-user-edit-modal",template:'<c8y-modal\n [customFooter]="true"\n [title]="\'Edit user\' | translate"\n (onDismiss)="onDismiss()"\n>\n <c8y-user-edit\n [lang]="lang"\n [user]="ui.currentUser | async"\n [loading]="loading"\n (onLanguage)="onLanguage($event)"\n (onUser)="updateAndClose($event)"\n (onCancel)="onDismiss()"\n >\n </c8y-user-edit>\n</c8y-modal>'})],e)}(),sp=function(){function n(e,t,n,a){this.user=e,this.modalService=t,this.modal=n,this.loginService=a}return n.prototype.totpSetupVerified=function(t){return jc(this,void 0,void 0,(function(){return bc(this,(function(t){switch(t.label){case 0:return[4,this.user.activateTotp()];case 1:t.sent(),this.modal.hide(),t.label=2;case 2:return t.trys.push([2,5,,6]),[4,this.modalService.acknowledge("Logout required","You must log out in order to apply your changes",e.Status.WARNING,"Log out")];case 3:return t.sent(),[4,this.loginService.logout()];case 4:return t.sent(),[3,6];case 5:return t.sent(),[3,6];case 6:return[2]}}))}))},n.prototype.close=function(){this.modal.hide()},n.ctorParameters=function(){return[{type:l.UserService},{type:bd},{type:nc.BsModalRef},{type:ud}]},n=yc([t.Component({selector:"c8y-user-totp-setup",template:'<c8y-modal [customFooter]="true">\n <ng-container c8y-modal-title>\n <button\n title="{{ \'Close\' | translate }}"\n (click)="close()"\n type="button"\n class="close"\n ><span aria-hidden="true">×</span></button>\n <h3 class="text-center" translate>Set up two-factor authentication</h3>\n </ng-container>\n <c8y-totp-setup></c8y-totp-setup>\n <c8y-totp-challenge (onSuccess)="totpSetupVerified($event)"></c8y-totp-challenge>\n</c8y-modal>\n'})],n)}(),op=function(){function e(e,n,a,s,o,r,l,i,c){this.state=e,this.translate=n,this.passwordService=a,this.modalConfirmService=s,this.bsModalService=o,this.alert=r,this.userService=l,this.tenantLoginOptionsService=i,this.tenantService=c,this.loading=!1,this.onUser=new t.EventEmitter,this.onLanguage=new t.EventEmitter,this.onCancel=new t.EventEmitter,this.userHasActiveTotp=!1,this.userCanSetupTotp=!1,this.isPhoneRequired=!1}return Object.defineProperty(e.prototype,"user",{get:function(){return this._user},set:function(e){this._user=o.clone(e),this.userIsExternal="OAUTH2"===e.customProperties.userOrigin,this.isPhoneRequired=this.isPhoneRequired&&e.twoFactorAuthenticationEnabled},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){return jc(this,void 0,void 0,(function(){var e,t,n,a;return bc(this,(function(s){switch(s.label){case 0:return[4,this.tenantService.current()];case 1:return e=s.sent().data,[4,this.tenantService.getTfaSettings(e)];case 2:return t=s.sent(),n=t.enabledOnSystemLevel,a=t.enabledOnTenantLevel,this.isTfaEnabled=n||a,[4,this.initializeTotpSettings()];case 3:return s.sent(),this.user.twoFactorAuthenticationEnabled&&!this.userCanSetupTotp&&(this.isPhoneRequired=!0),[2]}}))}))},Object.defineProperty(e.prototype,"langs",{get:function(){return this.state.state.langs},enumerable:!0,configurable:!0}),e.prototype.setupTotp=function(){this.bsModalService.show(sp,{class:"modal-sm"}),this.cancel()},e.prototype.cancel=function(){this.onCancel.emit()},e.prototype.save=function(){this.loading||(this._user.password?this.saveAfterPasswordConfirmation():this.onUser.emit(this._user))},e.prototype.onNewPasswordChanged=function(e){this._user.password=e.password},e.prototype.initializeTotpSettings=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=this,[4,this.canUserSetupTotp()];case 1:return e.userCanSetupTotp=n.sent(),this.userCanSetupTotp?[4,this.userService.getActivityTotp()]:[3,3];case 2:t=n.sent().data,this.userHasActiveTotp=t.isActive,n.label=3;case 3:return[3,5];case 4:return n.sent(),this.alert.removeLastDanger(),[3,5];case 5:return[2]}}))}))},e.prototype.canUserSetupTotp=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return[4,this.tenantLoginOptionsService.detail()];case 1:return[2,e.sent().data.loginOptions.some((function(e){var t=e.tfaStrategy;return"totp"===(void 0===t?"":t).toLowerCase()}))]}}))}))},e.prototype.saveAfterPasswordConfirmation=function(){var e=this;this.passwordService.confirmPassword().subscribe((function(t){t&&e.onUser.emit(e._user)}))},e.ctorParameters=function(){return[{type:$c},{type:Cu},{type:pd},{type:bd},{type:nc.BsModalService},{type:Mc},{type:l.UserService},{type:l.TenantLoginOptionsService},{type:l.TenantService}]},yc([t.Input()],e.prototype,"lang",void 0),yc([t.Input()],e.prototype,"loading",void 0),yc([t.Input()],e.prototype,"user",null),yc([t.Output()],e.prototype,"onUser",void 0),yc([t.Output()],e.prototype,"onLanguage",void 0),yc([t.Output()],e.prototype,"onCancel",void 0),e=yc([t.Component({selector:"c8y-user-edit",template:'<form #userForm="ngForm" (ngSubmit)="userForm.form.valid && save()">\n <div class="alert alert-warning" role="alert" *ngIf="userIsExternal" translate>\n You cannot edit the user since it is managed via your authorization server.\n </div>\n <c8y-form-group>\n <label translate for="userName">Username (e.g. email)</label>\n <input\n id="userName"\n class="form-control"\n [(ngModel)]="user.userName"\n name="userName"\n autocomplete="off"\n required\n maxlength="254"\n placeholder="{{ \'e.g. joe.doe@example.com`LOCALIZE`\' | translate }}"\n [disabled]="user.id"\n c8yDefaultValidation="user"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate for="displayName">Login alias</label>\n <input\n id="displayName"\n class="form-control"\n [(ngModel)]="user.displayName"\n name="displayName"\n autocomplete="off"\n maxlength="254"\n placeholder="{{ \'e.g. joe.doe`LOCALIZE`\' | translate }}"\n [disabled]="userIsExternal"\n c8yDefaultValidation="loginAlias"\n />\n </c8y-form-group>\n\n <c8y-form-group [hasWarning]="!user.email">\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`LOCALIZE`\' | translate }}"\n [(ngModel)]="user.email"\n email\n [required]="user.newsletter"\n [disabled]="userIsExternal"\n />\n <c8y-messages>\n <c8y-message *ngIf="!user.email" translate\n >Note that email is required to reset password.</c8y-message\n >\n </c8y-messages>\n </c8y-form-group>\n\n <div class="row" style="margin-left:-15px; margin-right:-15px">\n <div class="col-sm-6">\n <c8y-form-group>\n <label translate for="userFirstName">First name</label>\n <input\n id="userFirstName"\n class="form-control"\n autocomplete="off"\n maxlength="50"\n name="firstName"\n [(ngModel)]="user.firstName"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n </div>\n <div class="col-sm-6">\n <c8y-form-group>\n <label translate for="userLastName">Last name</label>\n <input\n id="userLastName"\n class="form-control"\n autocomplete="off"\n maxlength="50"\n name="lastName"\n [(ngModel)]="user.lastName"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n </div>\n </div>\n\n <c8y-form-group>\n <label translate for="userTelephone">Telephone</label>\n <input\n id="userTelephone"\n class="form-control"\n autocomplete="off"\n name="phone"\n maxlength="254"\n [(ngModel)]="user.phone"\n placeholder="{{ \'e.g. +49 9 876 543 210`LOCALIZE`\' | translate }}"\n c8yPhoneValidation\n c8yDefaultValidation="phoneNumber"\n [required]="isPhoneRequired"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate for="userLang">Language</label>\n <div class="c8y-select-wrapper">\n <select\n id="userLang"\n class="form-control"\n #selectLang\n name="lang"\n [(ngModel)]="lang"\n (change)="onLanguage.emit(selectLang.value)"\n [disabled]="userIsExternal"\n >\n <option *ngFor="let lang of langs" [value]="lang">{{\n translate.getNativeLanguage(lang)\n }}</option>\n </select>\n <span></span>\n </div>\n </c8y-form-group>\n\n <div class="form-group" *ngIf="!userIsExternal">\n <label class="control-label">{{ \'Login options\' | translate }}</label>\n <c8y-new-password (password)="onNewPasswordChanged($event)"></c8y-new-password>\n <button\n title="{{ \'Set up two-factor authentication\' | translate }}"\n class="btn btn-default"\n type="button"\n (click)="setupTotp()"\n translate\n *ngIf="userCanSetupTotp && !userHasActiveTotp && isTfaEnabled"\n >\n Set up two-factor authentication\n </button>\n </div>\n\n <c8y-form-group *ngIf="!!(state.state$ | async).newsletter">\n <label translate>Newsletter</label>\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n name="newsletter"\n [(ngModel)]="user.newsletter"\n [disabled]="userIsExternal"\n />\n <span></span>\n {{ \'Send me information about outages, maintenance or updates.\' | translate }}\n </label>\n </c8y-form-group>\n\n <div class="modal-footer">\n <button\n title="{{ \'Cancel\' | translate }}"\n class="btn btn-default"\n type="button"\n (click)="cancel()"\n translate\n >\n Cancel\n </button>\n <button\n title="{{ \'Save\' | translate }}"\n class="btn btn-primary"\n type="submit"\n [disabled]="!userForm.form.valid || userForm.form.pristine || loading || userIsExternal"\n translate\n >\n Save\n </button>\n </div>\n</form>\n'})],e)}(),rp=function(){function n(e,t,n,a,s,o,r,l,i){this.ui=e,this.bsModalService=t,this.modalService=n,this.loginService=a,this.translateService=s,this.tenantService=o,this.alertService=r,this.user=l,this.optionsService=i}return n.prototype.copyIt=function(e){var t,n={handleEvent:function(t){t.clipboardData.setData("text/plain",e),t.preventDefault()}};document.addEventListener("copy",n);try{t=document.execCommand("copy")}catch(e){t=!1}t?this.alertService.addByText("success","Copied to clipboard."):this.alertService.addByText("danger","Could not copy to clipboard."),document.removeEventListener("copy",n)},n.prototype.editUser=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){return this.bsModalService.show(ap),[2]}))}))},n.prototype.logout=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return[4,this.loginService.logout()];case 1:return e.sent(),[2]}}))}))},n.prototype.activateSupportAccess=function(){return jc(this,void 0,void 0,(function(){var t,n,a,s,o;return bc(this,(function(r){switch(r.label){case 0:t="Activate support user access",n=this.optionsService.get("companyName","Cumulocity"),"You are about to allow a support user from {{companyName}} to access your tenant to help you with your issue.","You are about to allow a support user to access your tenant to help you with your issue.","Do you want to proceed?",a=[this.translateService.instant(n?"You are about to allow a support user from {{companyName}} to access your tenant to help you with your issue.":"You are about to allow a support user to access your tenant to help you with your issue.",{companyName:n}),this.translateService.instant("Do you want to proceed?")].join(" "),s={ok:"Activate access",cancel:"Cancel"},o="Support user access activated.",r.label=1;case 1:return r.trys.push([1,5,,6]),[4,this.modalService.confirm(t,a,e.Status.DANGER,s)];case 2:return r.sent(),[4,this.tenantService.enableSupportUser()];case 3:return r.sent(),[4,this.refreshCurrentUser()];case 4:return r.sent(),this.alertService.success(o),[3,6];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},n.prototype.deactivateSupportAccess=function(){return jc(this,void 0,void 0,(function(){var t,n,a,s,o,r,l,i,c;return bc(this,(function(u){switch(u.label){case 0:return t="Deactivate support user access",n=this.optionsService.get("companyName","Cumulocity"),a="You are about to block a support user from {{companyName}} from accessing your tenant to help you with your issue.",s="You are about to block a support user from accessing your tenant to help you with your issue.",[4,this.user.current()];case 1:return o=u.sent().data,[4,this.user.hasRole(o,"ROLE_TENANT_ADMIN")];case 2:r=u.sent(),"Deactivating support access as tenant admin will disable all other support requests on your tenant.","Do you want to proceed?",l=[this.translateService.instant(n?a:s,{companyName:n}),r?this.translateService.instant("Deactivating support access as tenant admin will disable all other support requests on your tenant."):"",this.translateService.instant("Do you want to proceed?")].filter(Boolean).join(" "),i={ok:"Deactivate access",cancel:"Cancel"},c="Support user access deactivated.",u.label=3;case 3:return u.trys.push([3,7,,8]),[4,this.modalService.confirm(t,l,e.Status.DANGER,i)];case 4:return u.sent(),[4,this.tenantService.disableSupportUser()];case 5:return u.sent(),[4,this.refreshCurrentUser()];case 6:return u.sent(),this.alertService.success(c),[3,8];case 7:return u.sent(),[3,8];case 8:return[2]}}))}))},n.prototype.getSortedItems=function(){return o.sortBy(Array.from(this.items),this.byPriority)},n.prototype.refreshCurrentUser=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return[4,this.user.current()];case 1:return e=t.sent(),this.ui.currentUser.next(e.data),[2]}}))}))},n.prototype.byPriority=function(e){return-e.priority},n.ctorParameters=function(){return[{type:$c},{type:nc.BsModalService},{type:bd},{type:ud},{type:i.TranslateService},{type:l.TenantService},{type:Mc},{type:l.UserService},{type:qc}]},yc([t.Input()],n.prototype,"items",void 0),n=yc([t.Component({selector:"c8y-user-menu-outlet",template:'<div\n dropdown\n class="dropdown"\n>\n <button\n class="main-header-button c8y-dropdown dropdown-toggle"\n dropdownToggle\n style="white-space: nowrap"\n >\n <span\n class="hidden-xs text-truncate right-m"\n style="vertical-align: text-bottom; max-width: 104px; display: inline-block"\n title="{{ui.currentUser | async | shortenUserName}}"\n >\n {{ui.currentUser | async | shortenUserName}}\n </span>\n <i\n [c8yIcon]="\'c8y-user\'"\n class="fa-2x"\n ></i>\n </button>\n <ul\n *dropdownMenu\n class="dropdown-menu dropdown-menu-right"\n style="max-width: 240px;"\n >\n <ng-container *ngFor="let item of getSortedItems()">\n <ng-container *ngIf="item.template">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n <ng-container *ngIf="!item.template">\n <li (click)="item.click()">\n <a style="cursor: pointer" [attr.href]="item.link" [attr.target]="item.target">\n <i [c8yIcon]="item.icon"></i>\n {{item.label | translate}}\n </a>\n </li>\n </ng-container>\n </ng-container>\n <li\n *ngIf="!(ui.state$ | async).hidePowered"\n role="separator"\n class="divider"\n ></li>\n <li\n class="dropdown-header bg-gray-white"\n style="white-space: normal; margin-top: -1px;"\n *ngIf="!(ui.state$ | async).hidePowered"\n >\n <div class="flex-row">\n <i\n [c8yIcon]="\'info-circle\'"\n class="text-info flex-item-v-start"\n style="margin: 1px 6px 0 -3px; font-size: 14px;"\n ></i>\n <span class="text-muted text-truncate">\n {{\'Tenant ID\' | translate}}: <strong>\n <span class="text-primary" (click)="$event.stopPropagation(); copyIt(ui.currentTenant.value.name)"\n style="cursor: pointer">\n {{ui.currentTenant.value.name}} <i [c8yIcon]="\'clipboard\'"></i></span>\n </strong><br>\n {{\'Backend\' | translate}}: <strong>{{(ui.state$ | async).versions.backend}}</strong><br>\n {{\'UI\' | translate }}: <strong>{{ui.uiVersion}}</strong>\n </span>\n </div>\n </li>\n </ul>\n</div>\n\n\x3c!-- the default items --\x3e\n<c8y-user-menu-item\n [icon]="\'user\'"\n [label]="\'User settings\' | translate"\n [priority]="20"\n (click)="editUser()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n [icon]="\'sign-out\'"\n [label]="\'Logout\' | translate"\n (click)="logout()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="!(ui.currentUser | async).supportUserEnabled && ((ui.state$ | async).activateSupportUserAvailable)"\n [icon]="\'phone\'"\n [label]="\'Activate support\' | translate"\n (click)="activateSupportAccess()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="(ui.currentUser | async).supportUserEnabled && ((ui.state$ | async).activateSupportUserAvailable)"\n [icon]="\'phone\'"\n [label]="\'Deactivate support\' | translate"\n (click)="deactivateSupportAccess()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="(ui.state$ | async).supportUrl"\n [icon]="\'question-circle\'"\n [link]="(ui.state$ | async).supportUrl"\n [target]="\'_blank\'"\n [label]="\'Request support\' | translate"\n></c8y-user-menu-item>\n'})],n)}(),lp=function(){function e(e,n){this.users=e,this.alert=n,this.revokeEmitter=new t.EventEmitter}return e.prototype.revoke=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.users.totpRevokeSecret(this.user)];case 1:return t.sent(),this.alert.success("User TOTP secret revoked."),this.revokeEmitter.next(),[3,3];case 2:return e=t.sent(),this.alert.addServerFailure(e),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:l.UserService},{type:Mc}]},yc([t.Input()],e.prototype,"user",void 0),yc([t.Output("revoke")],e.prototype,"revokeEmitter",void 0),e=yc([t.Component({selector:"c8y-user-totp-revoke",template:'<button\n type="button"\n class="btn btn-default"\n [popover]="confirm"\n [popoverTitle]="\'Revoke TOTP secret\' | translate"\n #popover="bs-popover"\n placement="right"\n>\n <i c8yIcon="key"></i> {{ \'Revoke TOTP secret\' | translate }}\n</button>\n\n<ng-template #confirm>\n <p class="m-b-16" translate>\n This action will revoke the user\'s stored TOTP secret which will require a new setup.\n </p>\n <button\n title="{{ \'Revoke\' | translate }}"\n type="button"\n class="btn btn-danger"\n (click)="revoke(); popover.hide()"\n translate\n >\n Revoke\n </button>\n <button\n title="{{ \'Cancel\' | translate }}"\n type="button"\n class="btn btn-default"\n (click)="popover.hide()"\n translate\n >\n Cancel\n </button>\n</ng-template>\n'})],e)}(),ip=function(){function e(){}return e=yc([t.NgModule({declarations:[rp,op,ap,np,sp,lp],imports:[qd,Yu,Sd,tc.BsDropdownModule,zd,rd,n.RouterModule,u.TooltipModule.forRoot(),sc.PopoverModule],exports:[rp,np,op,ap,sp,lp],entryComponents:[ap,sp,lp]})],e)}(),cp=function(){function e(e){this.options=e,this.name="",this.model={appIcon:"",showIcon:!0,iconClass:["c8y-icon"],appNameAbbr:"",iconStyle:{}},this.c8yAppIconsList={analyticsbuilder:"analytics-builder","analytics-builder":"analytics-builder",cockpit:"cockpit",devicemanagement:"device-management",administration:"administration",apamaepl:"apama-epl"},this.white=!1,this.defaultIconStyle={"background-repeat":"no-repeat","background-size":"contain",height:"36px",width:"36px"}}return e.prototype.ngOnChanges=function(e){this.model.appIcon=this.iconFromAppDefinition()||this.findStaticIcon();var t=this.iconUrlFromAppDefinition();t&&(this.model.iconStyle=o.assign(this.defaultIconStyle,{"background-image":t})),this.model.showIcon=!!this.model.appIcon||!o.isEmpty(this.model.iconStyle),this.model.iconClass=["c8y-icon",this.model.appIcon,this.white?"c8y-icon-white":"c8y-icon-duocolor"].filter((function(e){return!!e})),this.model.appNameAbbr=this.name.substr(0,2)},e.prototype.findStaticIcon=function(){var e=this.contextPath||this.name,t=o.find(o.keys(this.c8yAppIconsList),(function(t){return e.indexOf(t)>-1})),n=this.c8yAppIconsList[t];return n?"c8y-icon-"+n:void 0},e.prototype.iconFromAppDefinition=function(){var e=this.app||this.options,t=["icon","class"];return o.get(e,t)||o.get(e,Sc(["manifest"],t))},e.prototype.iconUrlFromAppDefinition=function(){var e=this.app||this.options,t=["icon","url"];return o.get(e,t)||o.get(e,Sc(["manifest"],t))},e.ctorParameters=function(){return[{type:qc}]},yc([t.Input()],e.prototype,"contextPath",void 0),yc([t.Input()],e.prototype,"name",void 0),yc([t.Input()],e.prototype,"app",void 0),e=yc([t.Component({selector:"c8y-app-icon",template:'<i *ngIf="model.showIcon" [ngClass]="model.iconClass" [ngStyle]="model.iconStyle"></i>\n<span *ngIf="!model.showIcon" class="app-noicon"> {{model.appNameAbbr}}</span>\n',host:{class:"c8y-app-icon"}})],e)}(),up=function(){function e(e,t){var n=this;this.ui=e,this.applications=t;var o=this.ui,r=o.currentUser,l=o.currentTenant;a.combineLatest(r,l).pipe(s.first()).subscribe((function(e){var t=wc(e,2),a=t[0],s=t[1];n.tenant=s,n.listAppsForUser(a)}))}return Object.defineProperty(e.prototype,"hideCloudApps",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.isActive=function(e){return e.contextPath===this.ui.state.app.contextPath},e.prototype.getHref=function(e){return this.applications.getHref(e)},e.prototype.listAppsForUser=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return e?[4,this.applications.listByUser(e,{pageSize:1e3})]:[3,2];case 1:t=n.sent().data,this.apps=this.orderApps(this.filterApps(t)),n.label=2;case 2:return[2]}}))}))},e.prototype.filterApps=function(e){return e=this.filterVisible(e),e=this.filterCloud(e),e=this.filterDuplicates(e)},e.prototype.filterVisible=function(e){var t=["HOSTED","EXTERNAL"];return e.filter((function(e){return o.includes(t,e.type)&&!e.noAppSwitcher&&!o.get(e,"manifest.noAppSwitcher")}))},e.prototype.filterCloud=function(e){var t=this.hideCloudApps,n=function(e){return!!e.cloud};return t||(this.oneCloudApps=this.orderApps(e.filter(n))),e.filter((function(e){return!n(e)}))},e.prototype.filterDuplicates=function(e){var t=this;return e.filter((function(n){return!e.some((function(e){return n!==e&&n.contextPath&&n.contextPath===e.contextPath&&n.owner.tenant.id!==t.tenant.name}))}))},e.prototype.orderApps=function(e){return o.orderBy(e,(function(e){return e.name.toLowerCase()}))},e.ctorParameters=function(){return[{type:$c},{type:l.ApplicationService}]},e=yc([t.Component({selector:"c8y-app-switcher",template:'<div class="app-switcher-dropdown" dropdown>\n <button\n class="main-header-button c8y-dropdown dropdown-toggle"\n id="appSwitcherDropdown"\n dropdownToggle\n >\n <i class="fa-2x fa fw fa-th"></i>\n </button>\n <div\n *dropdownMenu\n class="app-switcher-dropdown-menu dropdown-menu"\n aria-labelledby="appSwitcherDropdown"\n >\n <div class="app-switcher-sagcloud" *ngIf="oneCloudApps && oneCloudApps.length > 0">\n <a\n title="{{ app.name | humanizeAppName | async }}"\n class="appLink"\n *ngFor="let app of oneCloudApps"\n [href]="getHref(app)"\n >\n <c8y-app-icon [app]="app" [name]="app.name" [contextPath]="app.contextPath"></c8y-app-icon>\n <span class="text-truncate-wrap">{{ app | humanizeAppName | async }}</span>\n </a>\n </div>\n <div class="app-switcher">\n <a\n title="{{ app.name | humanizeAppName | async }}"\n class="appLink"\n [ngClass]="isActive(app) ? \'active\' : \'\'"\n *ngFor="let app of apps"\n [href]="getHref(app)"\n >\n <c8y-app-icon [app]="app" [name]="app.name" [contextPath]="app.contextPath"></c8y-app-icon>\n <span class="text-truncate-wrap">{{ app | humanizeAppName | async }}</span>\n </a>\n </div>\n </div>\n</div>\n'})],e)}(),dp=[{icon:"c8y-c8y-data",label:"Concepts guide`KEEP_ORIGINAL`",url:"/concepts/introduction",type:"doc"},{icon:"c8y-user",label:"User guide`KEEP_ORIGINAL`",url:"/users-guide/getting-started",type:"doc"},{icon:"c8y-device-management",label:"Device guides`KEEP_ORIGINAL`",url:"/devices/overview",type:"doc"},{icon:"c8y-book",label:"Cumulocity IoT Edge`KEEP_ORIGINAL`",url:"/edge/overview",type:"doc"},{icon:"c8y-tools",label:"Microservice SDK guide`KEEP_ORIGINAL`",url:"/microservice-sdk/introduction",type:"doc"},{icon:"c8y-tools",label:"Device SDK guide`KEEP_ORIGINAL`",url:"/device-sdk/introduction",type:"doc"},{icon:"c8y-smart-rest",label:"Web SDK guide`KEEP_ORIGINAL`",url:"/web/introduction",type:"doc"},{icon:"c8y-data-explorer",label:"Streaming analytics guide`KEEP_ORIGINAL`",url:"/apama/introduction",type:"doc"},{icon:"c8y-bookmark",label:"Reference guide`KEEP_ORIGINAL`",url:"/reference/rest-implementation",type:"doc"},{icon:"gavel",label:"Legal notices",url:"https://documentation.softwareag.com/legal/",type:"doc"}],pp=new t.InjectionToken("Hook docs"),mp=function(){function e(e,t,n,a){void 0===n&&(n=[]),this.options=e,this.app=t,n||(n=[]),n.push(this);var o=this.app.map((function(e){return e.supportUrl}));this.items$=Cc(a,o,n).pipe(s.startWith([]),s.shareReplay(1))}return e.prototype.getBaseUrl=function(){return this.options.get("docsBaseUrl","https://www.cumulocity.com/guides")},Object.defineProperty(e.prototype,"templateStr",{get:function(){return this.options.get("guideHrefTemplate","${docsBaseUrl}${partialUrl}")},enumerable:!0,configurable:!0}),e.prototype.getUserGuideLink=function(e){return/^https?:/.test(e)?e:null===this.getBaseUrl?null:this.getLink(this.templateStr,e)},e.prototype.list=function(){return this.items$.pipe(s.filter((function(e){return!!e.length})),s.first()).toPromise()},e.prototype.refresh=function(){},e.prototype.get=function(){var e=this,t=this.options.get("docs",{}),n=t.links,a=t.noDefault,s=t.excludeDefault,r=void 0===s?[]:s,l=this.app.state.supportUrl,i=a?[]:dp.map((function(t){return fc({},t,{url:e.getUserGuideLink(t.url)})})).filter((function(e){var t=e.url;return!r.some((function(e){return new RegExp(e).test(t)}))}));return n&&(n.map((function(e){if(o.isUndefined(e.type))return e.type="doc",e})),i=i.concat(n)),l&&i.push({icon:"comments",label:"Forum support",url:l,type:"doc"}),i},e.prototype.getLink=function(e,t){if(e)return e.replace(/\${docsBaseUrl}/,this.getBaseUrl()).replace(/\${partialUrl}/,this.prefixWithSlash(t))},e.prototype.prefixWithSlash=function(e){return void 0===e&&(e=""),""+(!(e&&/^\//.test(e))?"/":"")+e},e.ctorParameters=function(){return[{type:qc},{type:$c},{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[pp]}]},{type:n.Router}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(qc),t.ɵɵinject($c),t.ɵɵinject(pp,8),t.ɵɵinject(n.Router))},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"}),vc(2,t.Optional()),vc(2,t.Inject(pp))],e)}(),gp=function(){function e(e,t,n,a,s,o,r){this.headerService=e,this.actionService=t,this.breadcrumbService=n,this.searchService=a,this.appState=s,this.userMenuService=o,this.docs=r,this.canToggle$=this.headerService.hasItemsInNavigator$,this.appState$=this.appState.state$,this.drawerOpen=!1,this.headerOpen=!1}return e.prototype.ngAfterViewInit=function(){this.headerService.verifyIfNavOpen()},e.prototype.toggle=function(){this.headerOpen=!this.headerOpen},e.ctorParameters=function(){return[{type:Gc},{type:Nc},{type:Yc},{type:Zd},{type:$c},{type:tp},{type:mp}]},e=yc([t.Component({selector:"c8y-header-bar",template:'<div\n class="app-main-header"\n [ngClass]="{\n open: headerService.navigatorOpen$ | async,\n drawerOpen: drawerOpen\n }"\n>\n <div class="header-bar">\n <button\n *ngIf="canToggle$ | async"\n type="button"\n class="navigator-toggle main-header-button"\n title="{{ \'Toggle navigator\' | translate }}"\n (click)="headerService.toggleNavigator()"\n >\n <i [c8yIcon]="\'angle-double-right\'"></i>\n </button>\n <div class="app-view">\n <c8y-app-icon\n [name]="(appState$ | async).app.name"\n [contextPath]="(appState$ | async).app.contextPath"\n ></c8y-app-icon>\n\n <span class="page-header">\n <c8y-title-outlet></c8y-title-outlet>\n <c8y-breadcrumb-outlet\n [breadcrumbs]="breadcrumbService.items$ | async"\n class="app-breadcrumbs"\n ></c8y-breadcrumb-outlet>\n </span>\n </div>\n <c8y-search-outlet\n title="{{ \'Search\' | translate }}"\n [search]="searchService.items$ | async"\n class="main-header-item"\n ></c8y-search-outlet>\n <c8y-action-outlet\n title="{{ \'Add\' | translate }}"\n [items]="actionService.items$ | async"\n class="main-header-item"\n ></c8y-action-outlet>\n <c8y-app-switcher\n title="{{ \'Application switcher\' | translate }}"\n class="main-header-item"\n ></c8y-app-switcher>\n <c8y-user-menu-outlet\n [items]="(userMenuService.state$ | async).userMenuItems"\n class="main-header-item"\n ></c8y-user-menu-outlet>\n\n <button\n title="{{ \'Toggle side drawer\' | translate }}"\n class="drawer-toggle main-header-button"\n *ngIf="(appState$ | async).showRightDrawer"\n (click)="drawerOpen = !drawerOpen"\n >\n <i [c8yIcon]="\'angle-double-left\'"></i>\n </button>\n </div>\n <div class="head-toggler">\n <button title="{{ \'Toggle\' | translate }}" type="button" (click)="toggle()">\n <i [c8yIcon]="\'angle-double-right\'"></i>\n </button>\n </div>\n <c8y-right-drawer\n *ngIf="(appState$ | async).showRightDrawer"\n [app]="(appState$ | async).app"\n [quickLinks]="docs.items$ | async"\n [helpAndSupport]="docs.items$ | async"\n >\n </c8y-right-drawer>\n <div class="loading-bar" [ngClass]="{ active: (appState$ | async).isLoading }"></div>\n</div>\n'})],e)}(),hp=function(){function e(e,t,n){var a=this;this.headerService=e,this.element=t,this.zone=n,this.title=void 0;var o=this.headerService.map((function(e){return e.title}));o.subscribe((function(e){return a.title=e})),this.zone.runOutsideAngular((function(){o.pipe(s.debounceTime(100),s.map((function(){return a.element.nativeElement.querySelector("h1")})),s.filter((function(e){return null!==e})),s.map((function(e){return e.innerText})),s.filter(Boolean)).subscribe((function(t){return e.changePageTitle(t)}))}))}return e.ctorParameters=function(){return[{type:Gc},{type:t.ElementRef},{type:t.NgZone}]},e=yc([t.Component({selector:"c8y-title-outlet",template:'<div class="c8y-ui-title">\n <div class="title" *c8yOutlet="title"></div>\n</div>\n'})],e)}(),fp=function(){function e(e){this.headerService=e}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.headerService.changeTitle(e.template)}))},e.prototype.ngOnDestroy=function(){this.headerService.state.title===this.template&&(clearTimeout(this.viewInitTimeout),this.headerService.changeTitle())},e.ctorParameters=function(){return[{type:Gc}]},yc([t.ViewChild("template",{static:!0})],e.prototype,"template",void 0),e=yc([t.Component({selector:"c8y-title",template:'<ng-template #template>\n <h1 class="text-truncate">\n <ng-content></ng-content>\n </h1>\n</ng-template>\n\n'})],e)}(),yp=function(){function e(e){this.service=e,this.priority=0,this.nodeData=new Fc}return e.prototype.ngOnInit=function(){var e=this;this.ngOnChanges(),setTimeout((function(){return e.service.add(e.nodeData)}))},e.prototype.ngOnChanges=function(){this.nodeData.icon=this.icon,this.nodeData.label=this.label,this.nodeData.path=this.path,this.nodeData.priority=this.priority,this.nodeData.iconTemplate=this.icon?void 0:this.template,this.nodeData.icon=this.icon},e.prototype.ngOnDestroy=function(){this.service.remove(this.nodeData)},e.ctorParameters=function(){return[{type:zc}]},yc([t.ViewChild("iconTpl",{static:!0})],e.prototype,"template",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"path",void 0),yc([t.Input()],e.prototype,"priority",void 0),e=yc([t.Component({selector:"c8y-navigator-item",template:"<ng-template #iconTpl><ng-content></ng-content></ng-template>"})],e)}(),vp=function(){function e(){}return Object.defineProperty(e.prototype,"icon",{get:function(){return this.node.icon||"cog"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClass",{get:function(){return"fa-"+this.icon},enumerable:!0,configurable:!0}),yc([t.Input()],e.prototype,"node",void 0),e=yc([t.Component({selector:"c8y-navigator-icon",template:'<i class="icon" [c8yIcon]="icon"></i>'})],e)}(),jp=function(){function e(e,n){this.componentFactoryResolver=e,this.navigator=n,this.nodeClick=new t.EventEmitter}var a;return a=e,e.prototype.ngAfterViewInit=function(){var e=this;this.childrenNodes.forEach((function(t){return t.parentNode=e})),this.viewInitTimeout=setTimeout((function(){e.updateIcon(),e.openOnFirstUrl(),e.expandParentIfActive(),e.node.confirm=e.confirm}))},e.prototype.openOnFirstUrl=function(){this.navigator.openOnFirstUrl(this.node)&&!this.node.open&&this.expandCollapse(!0)},Object.defineProperty(e.prototype,"expandTitle",{get:function(){return this.node.open?"Collapse":"Expand"},enumerable:!0,configurable:!0}),e.prototype.click=function(e,t){var n,a;void 0===e&&(e="link"),"expander"===e?(t&&(t.stopPropagation(),t.preventDefault()),a=!this.node.open):a=!(!this.routerLinkActive||!this.routerLinkActive.isActive)||!this.node.open,a!==this.node.open&&this.expandCollapse(a,!1,((n={})[e]=!0,n.$event=t,n)),this.nodeClick.emit(e)},e.prototype.expandCollapse=function(e,t,n){void 0===n&&(n={}),this.node.open=e,t&&this.childrenNodes.forEach((function(n){return n.expandCollapse(e,t)})),n.open=e,this.node.click(n)},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.node.destroy()},e.prototype.expandParentIfActive=function(){this.routerLinkActive&&this.routerLinkActive.isActive&&this.parentNode&&this.parentNode.expandCollapse(!0)},e.prototype.updateIcon=function(){this.node.iconTemplate?this.updateIconTemplate():this.updateIconComponent()},e.prototype.updateIconComponent=function(){var e=vp;this.node&&this.node.iconComponent&&(e=this.node.iconComponent),this.iconSlot.clear();var t=this.componentFactoryResolver.resolveComponentFactory(e);this.iconSlot.createComponent(t).instance.node=this.node},e.prototype.updateIconTemplate=function(){this.iconSlot.clear(),this.iconSlot.createEmbeddedView(this.node.iconTemplate)},e.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:zc}]},yc([t.ViewChild("icon",{read:t.ViewContainerRef,static:!1})],e.prototype,"iconSlot",void 0),yc([t.Input()],e.prototype,"node",void 0),yc([t.Input()],e.prototype,"isRoot",void 0),yc([t.ViewChild(n.RouterLinkActive,{static:!1})],e.prototype,"routerLinkActive",void 0),yc([t.ViewChildren(a)],e.prototype,"childrenNodes",void 0),yc([t.Output()],e.prototype,"nodeClick",void 0),yc([t.ViewChild(wd,{static:!1})],e.prototype,"confirm",void 0),e=a=yc([t.Component({selector:"c8y-navigator-node-display",template:'<div\n class="slot"\n [hidden]="node.hidden"\n (dragstart)="node.dragStart($event)"\n (dragend)="node.dragEnd($event)"\n (drop)="node.drop($event)"\n [draggable]="node.draggable"\n [ngClass]="{ dragged: node.dragged }"\n>\n <ng-container>\n <a\n class="link"\n draggable="false"\n (dragover)="node.canDrop && $event.preventDefault()"\n (dragenter)="node.canDrop && node.dragEnter($event)"\n (dragleave)="node.canDrop && node.dragLeave($event)"\n title="{{node.label | translate}}"\n [attr.id]="isRoot ? node.id : undefined"\n [routerLink]="node.canNavigate ? node.path : undefined"\n [routerLinkActive]="node.canNavigate ? \'active\' : \'\'"\n [routerLinkActiveOptions]="{exact:node.routerLinkExact}"\n (click)="click(node.canNavigate ? \'link\' : \'expander\', $event)"\n [ngClass]="{\'root-link\':isRoot, open: node.open, parent: node.hasChildren, \'dragged-hover\': node.draggedHover && !node.dragged}"\n >\n <ng-container *ngTemplateOutlet="inner"></ng-container>\n </a>\n </ng-container>\n\n <div\n class="children panel-expand expand"\n *ngIf="node.children.length"\n [collapse]="!node.open"\n [isAnimated]="true"\n >\n <c8y-navigator-node-display\n *ngFor="let childNode of node.children"\n [node]="childNode"\n (nodeClick)="nodeClick.emit($event)"\n >\n </c8y-navigator-node-display>\n </div>\n</div>\n\n<ng-template #inner>\n \x3c!-- loader --\x3e\n <i\n class="fa-spin loadingIndicator"\n [c8yIcon]="\'circle-o-notch\'"\n *ngIf="node.loading && !isRoot"\n >\n </i>\n\n \x3c!-- icon --\x3e\n <div (click)="click(\'icon\', $event)">\n <ng-container #icon></ng-container>\n </div>\n\n \x3c!--title --\x3e\n <span>{{node.label | translate}}</span>\n\n <i\n class="expander"\n [c8yIcon]="\'chevron-down\'"\n *ngIf="node.hasChildren"\n (click)="click(\'expander\', $event)"\n title="{{expandTitle}}"\n >\n </i>\n\n <c8y-popover-confirm\n outsideClick="true"\n containerClass="navigator-popover"\n ></c8y-popover-confirm>\n</ng-template>\n'})],e)}(),bp=function(){function e(e){this.headerService=e,this.open=!0}return e.prototype.collapseNavigator=function(e){"link"!==e||this.headerService.largeWidth||this.headerService.closeNavigator()},e.prototype.trackByPathOrLabel=function(e,t){return t.path?t.path:t.label},e.ctorParameters=function(){return[{type:Gc}]},yc([t.Input()],e.prototype,"nodes",void 0),yc([t.Input()],e.prototype,"open",void 0),e=yc([t.Component({selector:"c8y-navigator-outlet, c8y-ui-navigator",template:'<nav class="navigator" *ngIf="nodes && nodes.length > 0" [ngClass]="{ open: open }">\n <ng-content select=".navigator-slot-top"></ng-content>\n <ul class="navigatorContent">\n <c8y-navigator-node-display (nodeClick)="collapseNavigator($event)" [node]="node" *ngFor="let node of nodes trackBy trackByPathOrLabel" [isRoot]="true"></c8y-navigator-node-display>\n </ul>\n <ng-content select=".navigator-slot-bottom"></ng-content>\n</nav>\n'})],e)}(),wp=function(){function e(){}return e=yc([t.NgModule({declarations:[bp,jp,yp,vp],imports:[n.RouterModule,ec.CollapseModule.forRoot(),Yu,Sd],exports:[bp,yp],entryComponents:[vp]})],e)}(),Sp=function(){function e(){this.quickLinks=[],this.helpAndSupport=[]}return Object.defineProperty(e.prototype,"_quickLinks",{set:function(e){e&&(this.quickLinks=e.filter((function(e){return"quicklink"===e.type})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_helpAndSupport",{set:function(e){e&&(this.helpAndSupport=e.filter((function(e){return"doc"===e.type})))},enumerable:!0,configurable:!0}),yc([t.Input("quickLinks")],e.prototype,"_quickLinks",null),yc([t.Input("helpAndSupport")],e.prototype,"_helpAndSupport",null),yc([t.Input()],e.prototype,"app",void 0),e=yc([t.Component({selector:"c8y-right-drawer",template:'<div class="c8y-right-drawer">\n\n <div class="summary">\n <h4 class="text-light">{{\'Welcome to\' | translate}} {{app | humanizeAppName | async}}</h4>\n </div>\n\n <div *ngIf="quickLinks.length">\n <div class="legend form-block" translate>Quick links</div>\n <div class="quick-links-drawer">\n <ng-container *ngFor="let quickLink of quickLinks">\n <a class="quick-link"\n [href]="quickLink.url || \'#\'"\n (click)="quickLink.click && $event.preventDefault(); quickLink.click();">\n <h2 *ngIf="quickLink.icon"><i class="{{quickLink.icon}}"></i></h2>\n <img \n *ngIf="quickLink.iconSrc" \n [src]="quickLink.iconSrc" \n style="max-width:50px;" \n class="img-responsive center-block"\n onerror="this.style.display = \'none\'">\n {{quickLink.label | translate}}\n </a>\n </ng-container>\n </div>\n </div>\n\n <div *ngIf="helpAndSupport.length">\n <div class="legend form-block top-m-lg" translate>Help & support</div>\n <div class="help-support" *ngFor="let link of helpAndSupport">\n <a class="help-and-support-link text-truncate" target="_blank" rel="noopener noreferrer" [href]="link.url">\n <i [c8yIcon]="link.icon"></i>\n <span title="{{link.label | translate}}" style="display: inline;">{{link.label | translate}}</span>\n </a>\n </div>\n </div>\n\n</div>\n'})],e)}(),Cp=function(){function e(){}return e=yc([t.NgModule({declarations:[fp,gp,hp,cp,up,Sp],imports:[tc.BsDropdownModule,ip,ep,Yu,td,Kd,wp],exports:[gp,fp,hp,cp,up,Sp]})],e)}(),Ip=function(){function n(e,n,a,s,o){this.loginService=e,this.users=n,this.passwordStrengthCheckerService=a,this.options=s,this.alert=o,this.onChangeView=new t.EventEmitter,this.passwordPattern=/^[a-zA-Z0-9`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]{8,32}$/,this.isLoading=!1,this.model={tenantId:"",email:"",newPassword:"",newPasswordConfirm:"",passwordStrengthEnforced:!1},this.emailReadOnly=!1,this.TOKEN_PARAM="token",this.EMAIL_PARAM="email"}return n.prototype.ngOnInit=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){return this.model.tenantId=this.loginService.getTenant(),this.model.email=this.options.get(this.EMAIL_PARAM,""),this.emailReadOnly=!!this.model.email,this.model.passwordStrengthEnforced=this.loginService.getEnforcePasswordStrength(),[2]}))}))},n.prototype.changePassword=function(){return jc(this,void 0,void 0,(function(){var t,n,a;return bc(this,(function(s){switch(s.label){case 0:t=this.passwordStrengthCheckerService.getStrengthColor(this.model.newPassword),n={token:this.credentials.token,email:this.model.email,newPassword:this.model.newPassword,passwordStrength:t.passwordStrength},s.label=1;case 1:return s.trys.push([1,3,4,5]),this.isLoading=!0,[4,this.users.resetPassword(n,this.model.tenantId)];case 2:return 200===s.sent().res.status&&(this.loginService.addSuccessMessage("password_changed"),this.credentials.token=void 0,this.options.set(this.TOKEN_PARAM,void 0),this.onChangeView.emit({view:e.LoginViews.Credentials})),[3,5];case 3:return a=s.sent(),this.alert.addServerFailure(a),[3,5];case 4:return this.loginService.reset(),this.isLoading=!1,[7];case 5:return[2]}}))}))},n.ctorParameters=function(){return[{type:ud},{type:l.UserService},{type:pd},{type:qc},{type:Mc}]},yc([t.Input()],n.prototype,"credentials",void 0),yc([t.Output()],n.prototype,"onChangeView",void 0),n=yc([t.Component({selector:"c8y-change-password",template:'<form\n role="form"\n class="loginForm"\n (ngSubmit)="changePassword()"\n #changePasswordForm="ngForm"\n novalidate\n>\n\n <div\n class="legend form-block center"\n translate\n >\n Change password\n </div>\n\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenantId"\n #tenantId="ngModel"\n type="text"\n name="tenantId"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Tenant ID\' | translate }}"\n required\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Email address</label>\n <input\n [(ngModel)]="model.email"\n #email="ngModel"\n type="text"\n name="email"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Email address\' | translate }}"\n email\n required\n [readonly]="emailReadOnly"\n />\n </c8y-form-group>\n\n <div class="row content-flex-50">\n <div class="col-7">\n <c8y-form-group>\n <label translate>New password</label>\n <input\n [(ngModel)]="model.newPassword"\n #newPassword="ngModel"\n type="password"\n name="newPassword"\n class="form-control"\n placeholder="{{ \'New password\' | translate }}"\n [pattern]="passwordPattern"\n autocomplete="new-password"\n [passwordStrengthEnforced]="model.passwordStrengthEnforced"\n required\n />\n <c8y-messages>\n <c8y-message\n name="pattern"\n [text]="loginService.ERROR_MESSAGES.pattern_newPassword"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Confirm password</label>\n <input\n [(ngModel)]="model.newPasswordConfirm"\n #newPasswordConfirm="ngModel"\n type="password"\n name="newPasswordConfirm"\n class="form-control"\n placeholder="{{ \'Confirm password\' | translate }}"\n passwordConfirm="newPassword"\n autocomplete="new-password"\n required\n />\n <c8y-messages>\n <c8y-message\n name="passwordConfirm"\n [text]="loginService.ERROR_MESSAGES.passwordConfirm"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </div>\n <div class="col-5">\n <c8y-password-strength\n [password]="model.newPassword"\n [hidden]="!model.newPassword"\n ></c8y-password-strength>\n <c8y-password-check-list\n class="m-t-32"\n [password]="model.newPassword"\n [hidden]="!model.newPassword || !model.passwordStrengthEnforced"\n ></c8y-password-check-list>\n </div>\n </div>\n\n <button\n title="{{ \'Set password\' | translate }}"\n [disabled]="!changePasswordForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Set password\n </button>\n</form>\n'})],n)}(),Pp=function(){function n(n,a,s){this.loginService=n,this.alert=a,this.ui=s,this.onChangeView=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.model={},this.isLoading=!1,this.showLoginForm=!1,this.showBasicAuth=!1,this.oauthOptions={},this.PASSWORD_RESET_HEADER_NAME="passwordresettoken",this.NO_PHONE_HEADER_NAME="NoPhoneHeader"}return n.prototype.ngOnInit=function(){var e=this.loginService,t=e.oauthOptions,n=e.loginMode;this.model.tenant=this.loginService.getTenant(),this.showLoginForm=void 0===n.visibleOnLoginPage||n.visibleOnLoginPage,this.showBasicAuth="BASIC"===n.type,this.oauthOptions=t},n.prototype.redirectToOauth=function(){this.loginService.redirectToOauth()},n.prototype.login=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),this.isLoading=!0,e=this.loginService.useBasicAuth(this.model),[4,this.loginService.login(e,this.model)];case 1:return n.sent(),[3,4];case 2:return(t=n.sent()).res&&t.res.headers&&t.res.headers.get(this.PASSWORD_RESET_HEADER_NAME)?this.handlePasswordReset(t.res):t.res&&401===t.res.status&&/pin/i.test(t.data.message)?this.handleSmsChallenge(t.data.message):t.res&&401===t.res.status&&/TOTP/i.test(t.data.message)?this.handleTotpChallenge(t.data.message):t.res&&t.res.headers&&t.res.headers.get(this.NO_PHONE_HEADER_NAME)&&!this.loginService.isSupportUser(this.model)?this.handleNoPhoneNumberProvided():(this.loginService.reset(),this.alert.addServerFailure(t)),[3,4];case 3:return this.isLoading=!1,[7];case 4:return[2]}}))}))},n.prototype.handlePasswordReset=function(t){this.alert.removeLastDanger(),this.model.token=t.headers.get(this.PASSWORD_RESET_HEADER_NAME),this.onChangeView.emit({view:e.LoginViews.ChangePassword,credentials:this.model})},n.prototype.handleTotpChallenge=function(t){/TOTP setup required/i.test(t)?this.onChangeView.emit({view:e.LoginViews.TotpSetup,credentials:this.model}):this.onChangeView.emit({view:e.LoginViews.TotpChallenge,credentials:this.model})},n.prototype.handleSmsChallenge=function(t){/pin has already been generated/i.test(t)&&this.alert.warning("The verification code was already sent. For a new verification code, please click on the link above."),this.alert.removeLastDanger(),this.onChangeView.emit({view:e.LoginViews.SmsChallenge,credentials:this.model})},n.prototype.handleNoPhoneNumberProvided=function(){this.onChangeView.emit({view:e.LoginViews.ProvidePhoneNumber,credentials:this.model}),this.alert.warning("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.ctorParameters=function(){return[{type:ud},{type:Mc},{type:$c}]},yc([t.Output()],n.prototype,"onChangeView",void 0),n=yc([t.Component({selector:"c8y-credentials",template:'<div id="oauth" *ngIf="oauthOptions.initRequest && oauthOptions.visibleOnLoginPage">\n <button\n title="{{ oauthOptions.buttonName | translate }}"\n (click)="redirectToOauth()"\n class="btn btn-block btn-lg form-group"\n >\n <i [c8yIcon]="\'sign-in\'" class="pull-left"></i>\n {{ oauthOptions.buttonName | translate }}\n </button>\n</div>\n\n<form\n role="form"\n class="loginForm"\n (ngSubmit)="login()"\n #loginForm="ngForm"\n *ngIf="showLoginForm"\n novalidate\n>\n <div\n class="legend form-block center"\n *ngIf="!(oauthOptions.initRequest && oauthOptions.visibleOnLoginPage); else orLegend"\n translate\n >\n Login\n </div>\n <ng-template #orLegend>\n <div class="legend form-block center" translate>or</div>\n </ng-template>\n\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label for="tenant" translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenant"\n #tenant="ngModel"\n type="text"\n name="tenant"\n id="tenant"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Tenant ID\' | translate }}"\n required\n />\n </c8y-form-group>\n <c8y-form-group>\n <label for="user" translate>Username</label>\n <input\n [(ngModel)]="model.user"\n #user="ngModel"\n type="text"\n name="user"\n id="user"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Username\' | translate }}"\n required\n />\n </c8y-form-group>\n <c8y-form-group>\n <label for="password" translate>Password</label>\n <input\n [(ngModel)]="model.password"\n #password="ngModel"\n type="password"\n name="password"\n id="password"\n class="form-control"\n placeholder="{{ \'Password\' | translate }}"\n required\n />\n </c8y-form-group>\n <div class="form-group" *ngIf="showBasicAuth">\n <label class="c8y-checkbox">\n <input\n title="{{ \'Remember me\' | translate }}"\n type="checkbox"\n name="remember"\n [(ngModel)]="loginService.rememberMe"\n /><span></span>\n {{ \'Remember me\' | translate }}\n </label>\n </div>\n <button\n title="{{ \'Log in\' | translate }}"\n [disabled]="!loginForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n >\n {{ \'Log in\' | translate }}\n </button>\n <div class="text-center top-m-sm">\n <a\n title="{{ \'Forgot password?\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onChangeView.emit({ view: LOGIN_VIEWS.RecoverPassword })"\n >{{ \'Forgot password?\' | translate }}</a\n >\n </div>\n <div class="text-center top-m-sm" *ngIf="!!(ui.state$ | async).loginExtraLink">\n <a\n title="{{ (ui.state$ | async).loginExtraLink.label }}"\n [href]="(ui.state$ | async).loginExtraLink.url"\n class="btn btn-link btn-sm"\n >\n {{ (ui.state$ | async).loginExtraLink.label }}</a\n >\n </div>\n</form>\n'})],n)}(),Op=function(){function n(t,n,a){this.loginService=t,this.options=n,this.alert=a,this.currentView=e.LoginViews.None,this.LOGIN_VIEWS=e.LoginViews,this.disabled=!1,this.credentials={},this.displayAlerts=!1,this.TOKEN_PARAM="token"}return n.prototype.ngOnInit=function(){var e=this.getResetPasswordToken();this.loginService.isFirstLogin&&(e?(this.credentials.token=e,this.reset()):this.loginAutomatically()),this.loginService.isFirstLogin=!1},n.prototype.handleLoginTemplate=function(e){this.currentView=e.view,this.credentials=e.credentials||{}},n.prototype.onkeyup=function(e){"Enter"!==e.key&&this.loginService.cleanMessages()},n.prototype.reset=function(){this.loginService.reset(),this.setView(),this.loginService.cleanMessages()},n.prototype.loginAutomatically=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.loginService.login()];case 1:return n.sent(),[3,3];case 2:return e=n.sent(),"OAUTH2"===(t=this.loginService.loginMode.type)?this.loginService.redirectToOauth():(this.reset(),"OAUTH2_INTERNAL"===t&&"https:"!==window.location.protocol?this.alert.danger("Current login mode only supports HTTPS."):e.res&&403===e.res.status&&this.alert.addServerFailure(e)),[3,3];case 3:return[2]}}))}))},n.prototype.setView=function(){this.credentials&&this.credentials.token?this.handleLoginTemplate({view:e.LoginViews.ChangePassword,credentials:this.credentials}):this.handleLoginTemplate({view:e.LoginViews.Credentials})},n.prototype.getResetPasswordToken=function(){var e=this.options.get(this.TOKEN_PARAM);return e&&this.options.set(this.TOKEN_PARAM,void 0),e},n.ctorParameters=function(){return[{type:ud},{type:qc},{type:Mc}]},yc([t.Input()],n.prototype,"name",void 0),yc([t.HostListener("keyup",["$event"])],n.prototype,"onkeyup",null),n=yc([t.Component({selector:"c8y-login",template:'<div\n class="loading card fadeInUp animated shadow5"\n *ngIf="currentView !== LOGIN_VIEWS.None"\n [ngSwitch]="currentView"\n>\n <div class="card-block">\n <img class="mainlogo">\n <c8y-credentials\n *ngSwitchCase="LOGIN_VIEWS.Credentials"\n (onChangeView)="handleLoginTemplate($event)"\n ></c8y-credentials>\n <c8y-recover-password\n *ngSwitchCase="LOGIN_VIEWS.RecoverPassword"\n (onChangeView)="handleLoginTemplate($event)"\n ></c8y-recover-password>\n <c8y-change-password\n *ngSwitchCase="LOGIN_VIEWS.ChangePassword"\n (onChangeView)="handleLoginTemplate($event)"\n [credentials]="credentials"\n ></c8y-change-password>\n <c8y-totp-auth\n *ngSwitchCase="LOGIN_VIEWS.TotpChallenge"\n (onCancel)="reset()"\n [view]="currentView"\n [credentials]="credentials"\n >\n </c8y-totp-auth>\n <c8y-totp-auth\n *ngSwitchCase="LOGIN_VIEWS.TotpSetup"\n (onCancel)="reset()"\n [view]="currentView"\n [credentials]="credentials"\n >\n </c8y-totp-auth>\n <c8y-sms-challenge\n *ngSwitchCase="LOGIN_VIEWS.SmsChallenge"\n (onCancel)="reset()"\n [credentials]="credentials"\n ></c8y-sms-challenge>\n\n\n <c8y-provide-phone-number\n *ngSwitchCase="LOGIN_VIEWS.ProvidePhoneNumber"\n (onCancel)="reset()"\n (onChangeView)="handleLoginTemplate($event)"\n [credentials]="credentials"\n ></c8y-provide-phone-number>\n\n <c8y-alert-outlet position="static"></c8y-alert-outlet>\n </div>\n</div>\n'})],n)}(),xp=function(){function n(n,a){this.users=n,this.loginService=a,this.onChangeView=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.isLoading=!1,this.model={email:"",tenantId:""}}return n.prototype.ngOnInit=function(){this.model.tenantId=this.loginService.getTenant()},n.prototype.resetPassword=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return e.trys.push([0,,2,3]),this.isLoading=!0,[4,this.users.sendPasswordResetMail(this.model.email,this.model.tenantId)];case 1:return 200===e.sent().res.status&&this.loginService.addSuccessMessage("password_reset_requested"),[3,3];case 2:return this.loginService.reset(),this.isLoading=!1,[7];case 3:return[2]}}))}))},n.ctorParameters=function(){return[{type:l.UserService},{type:ud}]},yc([t.Output()],n.prototype,"onChangeView",void 0),n=yc([t.Component({selector:"c8y-recover-password",template:'<form #resetForm="ngForm" role="form" class="loginForm" (ngSubmit)="resetPassword()" novalidate>\n <div class="legend form-block center" translate>Forgot password?</div>\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenantId"\n #tenantId="ngModel"\n type="text"\n name="tenantId"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Tenant ID\' | translate }}"\n required\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Email address</label>\n <input\n [(ngModel)]="model.email"\n #email="ngModel"\n type="text"\n name="email"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Email address\' | translate }}"\n email\n required\n />\n </c8y-form-group>\n\n <button\n title="{{ \'Reset password\' | translate }}"\n [disabled]="!resetForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Reset password\n </button>\n <div class="text-center top-m-sm">\n <p>\n <a\n title="{{ \'Login\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onChangeView.emit({ view: LOGIN_VIEWS.Credentials })"\n translate\n >Login</a\n >\n </p>\n </div>\n</form>\n'})],n)}(),Ep=function(){function n(n,a,s){this.loginService=n,this.userService=a,this.alert=s,this.onCancel=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.loading=!1,this.hasError=!1}return Object.defineProperty(n.prototype,"isSetup",{get:function(){return this.view===e.LoginViews.TotpSetup},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return this.view!==this.LOGIN_VIEWS.TotpSetup?[3,2]:[4,this.loginService.switchLoginMode(this.credentials)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},n.prototype.onTotpSuccess=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,6,7,8]),this.loading=!0,this.hasError=!1,this.credentials.tfa=e,this.isSetup?[4,this.userService.activateTotp()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,this.loginService.switchLoginMode(this.credentials)];case 3:return n.sent(),[4,this.loginService.verifyAppAccess()];case 4:return n.sent(),[4,this.loginService.authFulfilled()];case 5:return n.sent(),[3,8];case 6:return t=n.sent(),this.alert.removeLastDanger(),t.data&&"Access is denied"===t.data.message&&this.alert.addServerFailure(t),t.data&&"Authentication failed! : User account is locked"===t.data.message?this.alert.addServerFailure(t):this.hasError=!0,[3,8];case 7:return this.loading=!1,[7];case 8:return[2]}}))}))},n.ctorParameters=function(){return[{type:ud},{type:l.UserService},{type:Mc}]},yc([t.Input()],n.prototype,"credentials",void 0),yc([t.Input()],n.prototype,"view",void 0),yc([t.Output()],n.prototype,"onCancel",void 0),n=yc([t.Component({selector:"c8y-totp-auth",template:'<div\n class="legend form-block center"\n translate\n>Two-factor authentication</div>\n\n<c8y-totp-setup *ngIf="isSetup"></c8y-totp-setup>\n<c8y-totp-challenge\n [loading]="loading"\n [hasError]="hasError"\n [verify]="view === LOGIN_VIEWS.TotpSetup"\n (onSuccess)="onTotpSuccess($event)"\n></c8y-totp-challenge>\n\n<div class="top-m-sm text-center">\n <a\n title="{{ \'Cancel\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onCancel.emit()"\n translate\n >Cancel</a>\n</div>\n'})],n)}(),kp=function(){function e(e){this.passwordService=e}return e.prototype.isStrong=function(e){return this.isPasswordGreen(this.passwordService.getStrengthColor(e).passwordStrength)},e.prototype.isPasswordGreen=function(e){return e===l.PasswordStrength.GREEN},e.ctorParameters=function(){return[{type:pd}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(pd))},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"})],e)}(),Tp=function(){function e(e){this.passwordService=e}var n;return n=e,Object.defineProperty(e.prototype,"passwordStrengthEnforced",{set:function(e){this.forced=e},enumerable:!0,configurable:!0}),e.prototype.validate=function(e){var t=this.passwordService.isStrong(e.value||"");return this.forced&&!t?{passwordStrength:!0}:null},e.ctorParameters=function(){return[{type:kp}]},yc([t.Input()],e.prototype,"passwordStrengthEnforced",null),e=n=yc([t.Directive({selector:"[passwordStrengthEnforced]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),Ap=function(){function e(){}var n;return n=e,e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e.providers=function(){return[ud]},e=n=yc([t.NgModule({declarations:[Op,xp,Ip,Pp,Ep,Tp],imports:[ac.FormsModule,u.TooltipModule,Yu,zd,rd,qd],exports:[Op]})],e)}(),_p=function(){function e(e){this.tabs=e,this.label=""}return e.prototype.ngAfterContentInit=function(){var e=this;setTimeout((function(){return e.tabs.add(e)}))},e.prototype.ngOnDestroy=function(){this.tabs.remove(this)},e.ctorParameters=function(){return[{type:Vc}]},yc([t.ViewChild("tpl",{static:!1})],e.prototype,"template",void 0),yc([t.Input()],e.prototype,"path",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"priority",void 0),yc([t.Input()],e.prototype,"orientation",void 0),e=yc([t.Component({selector:"c8y-tab",template:"<ng-template #tpl><ng-content></ng-content></ng-template>"})],e)}(),Np=function(){function e(e,t,n){this.router=e,this.renderer=t,this.el=n,this.tabs=[],this.orientation="vertical",this.navigatorOpen=!1,this.showLeft=!1,this.showRight=!1}return Object.defineProperty(e.prototype,"isNavigatorOpen",{get:function(){return this.navigatorOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTabs",{get:function(){return this.tabs&&this.tabs.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHorizontal",{get:function(){return"horizontal"===this.orientation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return"horizontal"!==this.orientation},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.scrollSubscription&&this.scrollSubscription.unsubscribe()},e.prototype.ngAfterContentInit=function(){"horizontal"===this.orientation&&this.scrollSubscribe()},e.prototype.isActive=function(e){return!(!e||!e.path)&&this.router.isActive(e.path,!1)},e.prototype.navigateTo=function(e){this.router.navigate([e])},e.prototype.scroll=function(e){void 0===e&&(e="right");var t=this.getDimensions(),n=t.widthScroll,a=t.width,s=t.scrollLeft+a*("left"===e?-1:1);s<0&&(s=0),s>n-a&&(s=n-a),this.container.nativeElement.scrollLeft=s},e.prototype.scrollSubscribe=function(){var e,t=this;this.scrollSubscription=a.merge(a.fromEvent(this.container.nativeElement,"scroll"),a.fromEventPattern((function(n){e=t.renderer.listen("window","resize",n)}),(function(){return e()}))).pipe(s.debounceTime(250)).subscribe((function(){return t.updateScroll()}))},e.prototype.updateScroll=function(){var e=this.getDimensions(),t=e.widthScroll,n=e.width,a=e.scrollLeft;this.showLeft=!!a,this.showRight=t>n+a},e.prototype.getDimensions=function(){var e=this.tabsContainer.nativeElement,t=this.container.nativeElement;return{widthScroll:e.scrollWidth,width:t.clientWidth,scrollLeft:t.scrollLeft}},e.ctorParameters=function(){return[{type:n.Router},{type:t.Renderer2},{type:t.ElementRef}]},yc([t.Input()],e.prototype,"tabs",void 0),yc([t.Input()],e.prototype,"orientation",void 0),yc([t.Input()],e.prototype,"navigatorOpen",void 0),yc([t.HostBinding("class.navigator-open")],e.prototype,"isNavigatorOpen",null),yc([t.HostBinding("class.page-tabs")],e.prototype,"hasTabs",null),yc([t.HostBinding("class.page-tabs-horizontal")],e.prototype,"isHorizontal",null),yc([t.HostBinding("class.page-tabs-vertical")],e.prototype,"isVertical",null),yc([t.ViewChild("container",{read:t.ElementRef,static:!0})],e.prototype,"container",void 0),yc([t.ViewChild("left",{read:t.ElementRef,static:!1})],e.prototype,"leftBtn",void 0),yc([t.ViewChild("right",{read:t.ElementRef,static:!1})],e.prototype,"rightBtn",void 0),yc([t.ViewChild("tabsContainer",{read:t.ElementRef,static:!1})],e.prototype,"tabsContainer",void 0),e=yc([t.Component({selector:"c8y-tabs-outlet,c8y-ui-tabs",template:'<div #container class="tabContainer hidden-xs">\n <button class="tabs-slider tabs-slider-left" #left *ngIf="showLeft" (click)="scroll(\'left\')">\n <i [c8yIcon]="\'chevron-left\'"></i>\n </button>\n <button class="tabs-slider tabs-slider-right" #right *ngIf="showRight" (click)="scroll(\'right\')">\n <i [c8yIcon]="\'chevron-right\'"></i>\n </button>\n <ul class="nav nav-tabs nav-tabsc8y" #tabsContainer>\n <li [ngClass]="{\'active\': rla.isActive}" *ngFor="let tab of tabs">\n <a [routerLink]="tab.path" routerLinkActive #rla="routerLinkActive" title="{{tab?.label | translate}}">\n <i [c8yIcon]="tab?.icon" *ngIf="!tab.template && tab?.icon"></i>\n <span class="txt" *ngIf="!tab.template">{{tab?.label | translate}}</span>\n <ng-container *ngTemplateOutlet="tab.template"></ng-container>\n </a>\n </li>\n </ul>\n</div>\n\n<div class="visible-xs mobile-tabs">\n <div class="c8y-select-wrapper">\n <select (change)="navigateTo($event.target.value)" #select>\n <option *ngFor="let tab of tabs" [value]="tab.path" [selected]="isActive(tab)">\n {{tab?.label | translate}}\n </option>\n </select>\n </div>\n</div>\n'})],e)}(),Dp=function(){function e(){}return e=yc([t.NgModule({declarations:[Np,_p],imports:[Yu,n.RouterModule.forChild([])],exports:[Np,_p]})],e)}(),Mp=function(){function e(e){this.options=e,this.storageKey="acceptCookieNotice",this.acceptValue="1"}return e.prototype.ngOnInit=function(){this.settings=this.options.get("cookieBanner"),this.settings&&this.settings.cookieBannerText&&!localStorage.getItem(this.storageKey)&&(this.showBanner=!0)},e.prototype.acceptCookies=function(){localStorage.setItem(this.storageKey,this.acceptValue),this.showBanner=!1},e.ctorParameters=function(){return[{type:qc}]},e=yc([t.Component({selector:"c8y-cookie-banner",template:'<div class="c8y-cookie-banner">\n <div class="container">\n <div class="row p-t-16 p-b-16" *ngIf="showBanner">\n <div class="col-md-2" *ngIf="settings.cookieBannerTitle">\n <h3>{{ settings.cookieBannerTitle | translate }}</h3>\n <div class="p-b-16 visible-sm visible-xs"></div>\n </div>\n <div class="col-md-7">\n <div class="cookie-banner-content text-pre">\n {{ settings.cookieBannerText | translate }}\n </div>\n </div>\n <div class="col-md-3">\n <div class="row">\n <div class="col-sm-6 col-md-12">\n <div class="p-b-16 visible-sm visible-xs"></div>\n <button class="btn btn-primary btn-block" (click)="acceptCookies()">\n {{ \'Agree and proceed\' | translate }}\n </button>\n </div>\n <div class="col-sm-6 col-md-12">\n <div class="p-b-16"></div>\n <a\n class="btn btn-default btn-block"\n href="{{ settings.policyUrl }}"\n target="_blank"\n *ngIf="settings.policyUrl"\n >\n {{ \'Privacy policy\' | translate }}\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>'})],e)}(),Lp=function(){function e(){}return e=yc([t.NgModule({declarations:[Kc,Mp],imports:[Yu,Cp,Ap,n.RouterModule,Dp,Xu,rd,wp,u.TooltipModule],exports:[Kc],entryComponents:[Kc]})],e)}(),Rp=new t.InjectionToken("Hook Dynamic Component"),qp=new t.InjectionToken("Hook Dynamic Component @deprecated"),$p=function(e){function o(t,n){var s=e.call(this)||this;return s.injector=t,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.items$=Ic([function(){return s.injector.get(Rp,[])},function(){return s.getComponentsViaDeprecatedHook()}],n,!1),s.items$.subscribe((function(e){e.forEach((function(e){s.state.add(e)})),s.emitNewState()})),s}return hc(o,e),o.prototype.getComponentsViaDeprecatedHook=function(){var e=this.injector.get(qp,[]);return e&&e.length&&"production"!==__MODE__&&console.warn("HOOK_COMPONENT is now deprecated. Use HOOK_COMPONENTS instead."),e},o.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.getById$=function(e){return this.state$.pipe(s.filter((function(e){return e.size>0})),s.mergeMap((function(t){return a.of(Array.from(t).find((function(t){return t.id===e})))})),s.take(1))},o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),Fp=function(){function e(e,t){this.componentFactoryResolver=e,this.dynamicComponentService=t,this.mode="component",this.notFoundError=!0,this.expandErrorDetails=!1}return e.prototype.callLifeCycleHooks=function(){return this.callOnBeforeSaveHook()},e.prototype.ngOnChanges=function(){var e=this;this.dynamicComponentService.getById$(this.componentId).subscribe((function(t){return e.loadComponent(t)}))},e.prototype.loadComponent=function(e){try{this.error=void 0;var t=this.componentFactoryResolver.resolveComponentFactory("component"===this.mode?e.component:e.configComponent);this.host.clear(),this.componentRef=this.host.createComponent(t),this.componentRef.instance.config=this.config}catch(e){this.error=e}},e.prototype.callOnBeforeSaveHook=function(){if(!this.componentRef)return a.of(!0);var e=this.componentRef.instance.onBeforeSave;if(e){var t=e(this.config);return o.isUndefined(t)?a.of(!0):a.isObservable(t)?t:a.of(t)}return a.of(!0)},e.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:$p}]},yc([t.Input()],e.prototype,"componentId",void 0),yc([t.Input()],e.prototype,"config",void 0),yc([t.Input()],e.prototype,"mode",void 0),yc([t.Input()],e.prototype,"notFoundError",void 0),yc([t.ViewChild("host",{read:t.ViewContainerRef,static:!0})],e.prototype,"host",void 0),e=yc([t.Component({selector:"c8y-dynamic-component",template:'<ng-template #host></ng-template>\n\n<div class="alert alert-warning m-8" role="alert" *ngIf="notFoundError && error">\n <strong class="message">\n {{\n \'This widget cannot be rendered because the current application does not support the following component:\'\n | translate\n }}\n {{ componentId }}.\n </strong>\n <p class="text-muted top-m-sm">\n <button class="btn btn-clean" (click)="expandErrorDetails = !expandErrorDetails">\n <i class="fa fa-chevron-down"></i>\n <span *ngIf="!expandErrorDetails" translate>Show details</span>\n <span *ngIf="expandErrorDetails" translate>Hide details</span>\n </button>\n </p>\n <div [collapse]="!expandErrorDetails" [isAnimated]="true">\n <pre>\n {{ error }}\n </pre>\n </div>\n</div>\n'})],e)}(),Up=function(){function e(){}return e=yc([t.NgModule({declarations:[Fp],imports:[c.CommonModule,ec.CollapseModule,n.RouterModule.forChild([]),gu],exports:[Fp],providers:[$p]})],e)}(),Bp=function(){function e(){}return yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=yc([t.Component({selector:"c8y-dashboard-child-action",template:"<ng-template #template>\n <li>\n <ng-content></ng-content>\n </li>\n</ng-template>\n"})],e)}(),zp=function(){function e(){}return e=yc([t.Component({selector:"c8y-dashboard-child-title",template:'<div class="card-title">\n <ng-content></ng-content>\n</div>\n'})],e)}(),Gp=function(){function e(e,n){this.element=e,this.sanitizer=n,this.columns=12,this.gap=12,this.rows="auto",this.dashboardChange=new t.EventEmitter,this.lastRow=1,this.DEFAULT_ROW_SIZE=68}return Object.defineProperty(e.prototype,"columnSize",{get:function(){return this.dashboardRect.width/this.columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSize",{get:function(){return"auto"===this.rows?this.DEFAULT_ROW_SIZE:this.calculateRowSize()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inlineStyle",{get:function(){return this.sanitizer.bypassSecurityTrustStyle("\n -ms-grid-columns: (1fr)["+this.columns+"];\n grid-template-columns: repeat("+this.columns+", 1fr);\n "+("auto"!==this.rows?"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)["+("auto"===this.rows?this.lastRow:this.rows)+"];\n margin: -"+this.gap+"px;\n ")},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this.onResize(),this.getLastRow()},e.prototype.onResize=function(){this.updateRectSize()},e.prototype.getLastRow=function(){var e=1;this.children.forEach((function(t){e<t.y+t.width&&(e=t.y+t.width)})),this.lastRow=e+1},e.prototype.updateRectSize=function(){var e=this.element.nativeElement;this.dashboardRect=e.getBoundingClientRect()},e.prototype.emitChange=function(e){this.dashboardChange.emit({source:e,children:this.children.toArray()})},e.prototype.calculateRowSize=function(){return this.dashboardRect.height/this.rows},e.ctorParameters=function(){return[{type:t.ElementRef},{type:ic.DomSanitizer}]},yc([t.ContentChildren(t.forwardRef((function(){return Vp})))],e.prototype,"children",void 0),yc([t.Input()],e.prototype,"columns",void 0),yc([t.Input()],e.prototype,"gap",void 0),yc([t.Input()],e.prototype,"rows",void 0),yc([t.Output()],e.prototype,"dashboardChange",void 0),yc([t.HostBinding("attr.style")],e.prototype,"inlineStyle",null),yc([t.HostListener("window:resize")],e.prototype,"onResize",null),e=yc([t.Component({selector:"c8y-dashboard",template:"<ng-content></ng-content>\n",host:{class:"c8y-grid-dashboard dashboard-grid"},changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),Hp=function(){function e(e){this.MIN_WIDTH=2,this.MIN_HEIGHT=1,this.PIXEL_SIZE_THRESHOLD=10,this.diffX=0,this.diffY=0,this.dashboard=e.dashboard,this.children=e.dashboard.children?e.dashboard.children.filter((function(t){return e!==t})):[],this.child=e}return Object.defineProperty(e.prototype,"resize$",{get:function(){var e=this;return this.child.dragSource.moved.pipe(s.map((function(t){return e.getPixelSize(t)})),s.tap((function(t){return e.setPixelSize(t)})),s.map((function(t){return e.getDimensionSize(t)})),s.distinctUntilChanged((function(e,t){return e.width===t.width&&e.height===t.height})),s.map((function(t){return e.setDimension(t)})),this.arrangePipe())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drag$",{get:function(){var e=this;return this.child.dragSource.moved.pipe(s.map((function(t){return e.getDimensionPosition(t)})),s.filter((function(t){return t.x>=0&&t.x<=e.dashboard.columns-e.child.width&&t.y>=0})),s.distinctUntilChanged((function(e,t){return e.x===t.x&&e.y===t.y})),this.arrangePipe())},enumerable:!0,configurable:!0}),e.prototype.findFreeDimension=function(){var e=-1,t=0,n=!1,a=this.child,s=a.width,o=a.height;if(s>this.dashboard.columns)throw new Error("The child does not fit on the current dashboard.");do{for(t=0,e++;t+s<=this.dashboard.columns;){if(0===this.getCollided({x:t,y:e,width:s,height:o}).length){n=!0;break}t++}}while(!n);return{x:t,y:e,width:s,height:o}},e.prototype.collapseUpAll=function(){return o.sortBy(Sc([this.child],this.children),["y"]).forEach((function(t){var n=new e(t),a=n.collapseUp(t);n.setDimension(a)}))},e.prototype.arrangeAll=function(t){var n=t.current,a=t.scan,s=t.spacing,r=t.origin;return this.getCollided(n,o.sortBy(a,["y"])).map((function(t){return new e(t).setDimension(fc({},t,{y:s})),{current:t,scan:a.filter((function(e){return e!==t})),spacing:t.y+t.height,origin:r}}))},e.prototype.arrangePipe=function(){var e=this;return a.pipe(s.map((function(t){return{current:t,scan:e.children,spacing:t.y+t.height,origin:fc({},t)}})),s.expand((function(t){return e.arrangeAll(t)})),s.map((function(e){return e.origin})),s.map((function(t){return e.setDimension(t,!0)})),s.tap((function(){return e.collapseUpAll()})),s.tap((function(){return e.dashboard.getLastRow()})))},e.prototype.collapseUp=function(e){for(var t=e.y;t>0&&0===this.getCollided(fc({},e,{y:t-1})).length;)t--;return fc({},e,{y:t})},e.prototype.setDimension=function(e,t){if(void 0===t&&(t=!1),!(t&&this.getCollided(e).length>0))return this.child.x=e.x,this.child.y=e.y,e.width>=this.MIN_WIDTH&&e.x+e.width<=this.dashboard.columns?this.child.width=e.width:e.width<this.MIN_WIDTH?e.width=this.MIN_WIDTH:e.width=this.dashboard.columns-e.x,e.height>=this.MIN_HEIGHT?this.child.height=e.height:e.height=this.MIN_WIDTH,e},e.prototype.setPixelSize=function(e){var t=e.width,n=e.height;t>=this.dashboard.columnSize*this.MIN_WIDTH-this.dashboard.gap&&(this.child.pxWidth=t+this.PIXEL_SIZE_THRESHOLD),n>=this.dashboard.rowSize*this.MIN_HEIGHT-this.dashboard.gap&&(this.child.pxHeight=n+this.PIXEL_SIZE_THRESHOLD)},e.prototype.getPixelSize=function(e){var t=e.source.element.nativeElement.parentNode;if(!this.diffX){var n=t.getBoundingClientRect();this.diffX=n.left,this.diffY=n.top}var a=e.pointerPosition,s=a.x,o=a.y;return{width:Math.round(s-this.diffX),height:Math.round(o-this.diffY),pointer:{x:s,y:o}}},e.prototype.getDimensionSize=function(e){var t=this.child,n=t.x,a=t.y,s=this.dashboard.dashboardRect,o=this.dashboard.columnSize,r=this.dashboard.rowSize+this.dashboard.gap;return{x:n,y:a,width:Math.round((e.pointer.x-s.left+this.dashboard.gap)/o)-n,height:Math.round((e.pointer.y-s.top+this.dashboard.gap)/r)-a}},e.prototype.getDimensionPosition=function(e){var t=e.source.element.nativeElement.nextElementSibling;if(!this.diffX){var n=t.getBoundingClientRect();this.diffX=e.pointerPosition.x-n.left,this.diffY=e.pointerPosition.y-n.top}var a=e.pointerPosition.x-this.diffX,s=e.pointerPosition.y-this.diffY,o=this.child,r=o.width,l=o.height,i=this.dashboard.dashboardRect,c=this.dashboard.columnSize,u=this.dashboard.rowSize+this.dashboard.gap/2;return{x:Math.round((a-i.left)/c),y:Math.round((s-i.top)/u),width:r,height:l}},e.prototype.doesCollide=function(e,t){return void 0!==t.x&&!(e.y+e.height-1<t.y||e.y>t.y+t.height-1||e.x+e.width-1<t.x||e.x>t.x+t.width-1)},e.prototype.getCollided=function(e,t){var n=this;return void 0===t&&(t=this.children),t.filter((function(t){return n.doesCollide(e,t)}))},e}(),Vp=function(){function e(e,n,a){this.dashboard=e,this.sanitizer=n,this.element=a,this.actions=[],this.isResize=!1,this.isDragging=!1,this.klasses={},this._pxWidth="100%",this._pxHeight="100%",this.width=1,this.height=1,this.margin=12,this.isFrozen=!1,this.useIntersection=!1,this.changeStart=new t.EventEmitter,this.changeEnd=new t.EventEmitter,this.class={},this.intersected=!1}return Object.defineProperty(e.prototype,"pxWidth",{set:function(e){this._pxWidth=e+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pxHeight",{set:function(e){this._pxHeight=e+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inlineStyle",{get:function(){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 ")},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){this.klasses=fc({card:!0,"card-dashboard":!0,disabled:this.isFrozen,"on-resize":this.isResize},this.class)},e.prototype.ngOnInit=function(){var e=this;if(void 0!==this.x&&void 0!==this.y||setTimeout((function(){return e.setDynamicDimension()})),this.useIntersection&&"IntersectionObserver"in window){var t=new IntersectionObserver((function(n){return e.intersected=e.childInView(n[0],t)}));t.observe(this.element.nativeElement)}else this.intersected=!0},e.prototype.setDynamicDimension=function(){var e=new Hp(this).findFreeDimension(),t=e.x,n=e.y;this.x=t,this.y=n},e.prototype.resizeStarted=function(e){this.isResize=!0,this.dashboard.updateRectSize(),this.dragSource=e.source;var t=new Hp(this);this.changeSubscription=t.resize$.subscribe(),this.changeStart.emit(this),this.ngOnChanges()},e.prototype.dragStarted=function(e){this.isDragging=!0,this.dashboard.updateRectSize(),this.dragSource=e.source;var t=new Hp(this);this.changeSubscription=t.drag$.subscribe(),this.changeStart.emit(this)},e.prototype.reset=function(e){this.isResize=!1,this.isDragging=!1,this._pxWidth="100%",this._pxHeight="100%",this.ngOnChanges(),e&&e.source.reset(),this.changeSubscription&&(this.changeSubscription.unsubscribe(),this.dashboard.emitChange(this),this.changeEnd.emit(this))},e.prototype.childInView=function(e,t){return!!e.isIntersecting&&(t.unobserve(e.target),!0)},e.ctorParameters=function(){return[{type:Gp,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return Gp}))]}]},{type:ic.DomSanitizer},{type:t.ElementRef}]},yc([t.ContentChildren(Bp)],e.prototype,"actions",void 0),yc([t.Input()],e.prototype,"x",void 0),yc([t.Input()],e.prototype,"y",void 0),yc([t.Input()],e.prototype,"width",void 0),yc([t.Input()],e.prototype,"height",void 0),yc([t.Input()],e.prototype,"data",void 0),yc([t.Input()],e.prototype,"margin",void 0),yc([t.Input()],e.prototype,"isFrozen",void 0),yc([t.Input()],e.prototype,"useIntersection",void 0),yc([t.Output()],e.prototype,"changeStart",void 0),yc([t.Output()],e.prototype,"changeEnd",void 0),yc([t.Input()],e.prototype,"class",void 0),yc([t.HostBinding("attr.style")],e.prototype,"inlineStyle",null),e=yc([t.Component({selector:"c8y-dashboard-child",template:'<div cdkDropList>\n <div *ngIf="isResize" class="card-placeholder"></div>\n <div\n [ngClass]="klasses"\n cdkDrag\n [ngStyle]="{ width: _pxWidth, height: _pxHeight }"\n (cdkDragStarted)="dragStarted($event)"\n (cdkDragEnded)="reset($event)"\n [cdkDragDisabled]="isFrozen"\n >\n <div\n class="card-header-actions card-header-grid"\n [ngClass]="{ \'drag-handle\': !isFrozen, draggableCursor: !isFrozen }"\n cdkDragHandle\n >\n <ng-content select="c8y-dashboard-child-title"></ng-content>\n <div class="header-actions" *ngIf="!isFrozen && actions.length > 0">\n <div class="optionsBtn dropdown" dropdown container="body">\n <a\n title="{{ \'Settings\' | translate }}"\n href=""\n class="btnIcon c8y-dropdown"\n (click)="(false)"\n dropdownToggle\n >\n <i [c8yIcon]="\'cog\'"></i>\n </a>\n <ul\n class="dropdown-menu dropdown-menu-right"\n style="right: -41px;top: 3px;"\n *dropdownMenu\n >\n <ng-container *ngFor="let action of actions">\n <ng-container *ngTemplateOutlet="action.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n </div>\n </div>\n <div class="card-inner-scroll">\n <ng-content></ng-content>\n </div>\n <div\n *ngIf="!isFrozen && !isDragging"\n class="resize-handle"\n cdkDrag\n [cdkDragDisabled]="isFrozen"\n (cdkDragStarted)="resizeStarted($event)"\n (cdkDragEnded)="reset($event)"\n ></div>\n <div class="resize-icon" *ngIf="!isFrozen && !isDragging"></div>\n\n <div *cdkDragPlaceholder class="card-placeholder"></div>\n </div>\n</div>\n',host:{class:"dashboard-grid-child"}}),vc(0,t.Inject(t.forwardRef((function(){return Gp}))))],e)}(),Kp=function(){function e(){this.settings={isFrozen:!1,isDisabled:!1,widgetMargin:12,translateWidgetTitle:!1,defaultHeight:4,defaultWidth:4,allowFullscreen:!1,canDelete:!0,isLoading:!1},this.onAddWidget=new t.EventEmitter,this.onEditWidget=new t.EventEmitter,this.onDeleteWidget=new t.EventEmitter,this.onChangeDashboard=new t.EventEmitter,this.onEditDashboard=new t.EventEmitter,this.onDeleteDashboard=new t.EventEmitter,this.onFreeze=new t.EventEmitter,this.onChangeStart=new t.EventEmitter,this.onChangeEnd=new t.EventEmitter}return Object.defineProperty(e.prototype,"_settings",{set:function(e){this.settings=fc({},this.settings,e)},enumerable:!0,configurable:!0}),e.prototype.toggleFullscreen=function(){var e=document.body,t=document;this.fullScreen()?t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitExitFullscreen&&t.webkitExitFullscreen():e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)},e.prototype.fullScreen=function(){var e=document;return!!(e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement)},yc([t.Input()],e.prototype,"widgets",void 0),yc([t.Input()],e.prototype,"context",void 0),yc([t.Input()],e.prototype,"contextDashboard",void 0),yc([t.Input("settings")],e.prototype,"_settings",null),yc([t.Output()],e.prototype,"onAddWidget",void 0),yc([t.Output()],e.prototype,"onEditWidget",void 0),yc([t.Output()],e.prototype,"onDeleteWidget",void 0),yc([t.Output()],e.prototype,"onChangeDashboard",void 0),yc([t.Output()],e.prototype,"onEditDashboard",void 0),yc([t.Output()],e.prototype,"onDeleteDashboard",void 0),yc([t.Output()],e.prototype,"onFreeze",void 0),yc([t.Output()],e.prototype,"onChangeStart",void 0),yc([t.Output()],e.prototype,"onChangeEnd",void 0),e=yc([t.Component({selector:"c8y-widgets-dashboard",template:'<c8y-title *ngIf="!!settings.title">\n {{ settings.title | translate }}\n</c8y-title>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="onAddWidget.observers.length">\n <button\n class="btn btn-link"\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onAddWidget.emit()"\n >\n <i c8yIcon="plus-circle"></i> {{ \'Add widget\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="onEditDashboard.observers.length">\n <button\n class="btn btn-link"\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onEditDashboard.emit()"\n >\n <i c8yIcon="pencil"></i> {{ \'Edit\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="settings.allowFullscreen">\n <button class="btn btn-link" (click)="toggleFullscreen()">\n <i [c8yIcon]="fullScreen() ? \'compress\' : \'expand\'"></i> {{ \'Full screen\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]="\'right\'"\n itemClass="navbar-form"\n *ngIf="onFreeze.observers.length"\n>\n <button\n title="{{ \'Lock/unlock this dashboard\' | translate }}"\n class="btn btn-default"\n [ngClass]="{ active: settings.isFrozen }"\n (click)="onFreeze.emit(settings)"\n [disabled]="settings.isDisabled"\n uib-btn-checkbox\n >\n <i [c8yIcon]="settings.isFrozen ? \'lock\' : \'unlock\'"></i>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]="\'more\'"\n [priority]="-3000"\n *ngIf="settings.canDelete && onDeleteDashboard.observers.length"\n>\n <button (click)="onDeleteDashboard.emit()" [disabled]="settings.isFrozen || settings.isDisabled">\n <i c8yIcon="trash"></i> <span translate>Delete dashboard</span>\n </button>\n</c8y-action-bar-item>\n\n\x3c!-- empty state --\x3e\n<div class="c8y-empty-state text-center" *ngIf="!settings.isLoading && widgets.length === 0">\n <h1 class="c8y-icon c8y-icon-device c8y-icon-duocolor"></h1>\n <h3 translate>No widgets to display.</h3>\n <div *ngIf="!settings.isFrozen && onAddWidget.observers.length">\n <p translate>Add widgets to this dashboard.</p>\n <div>\n <button\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onAddWidget.emit()"\n class="btn btn-primary"\n translate\n >\n Add widget\n </button>\n </div>\n <p c8y-guide-docs>\n <small forceHtmlTranslate ngNonBindable\n >Find out more in the\n <a c8y-guide-href="users-guide/cockpit/#dashboards">User guide`KEEP_ORIGINAL`</a>.</small\n >\n </p>\n </div>\n</div>\n\x3c!-- /.empty settings --\x3e\n\n<div class="col-xs-12 text-center" *ngIf="settings.isLoading">\n <div class="spinner" style="position: relative;">\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<c8y-dashboard\n (dashboardChange)="onChangeDashboard.emit($event)"\n #dashboard\n *ngIf="!settings.isLoading"\n>\n <c8y-dashboard-child\n *ngFor="let widget of widgets"\n [x]="widget._x"\n [y]="widget._y"\n [width]="widget._width || settings.defaultWidth"\n [height]="widget._height || settings.defaultHeight"\n [margin]="settings.widgetMargin"\n [isFrozen]="settings.isFrozen || settings.isDisabled"\n [class]="widget.classes"\n [data]="widget"\n [useIntersection]="true"\n (changeStart)="onChangeStart.emit({ widget: widget, source: child, dashboard: dashboard })"\n (changeEnd)="onChangeEnd.emit({ widget: widget, source: child, dashboard: dashboard })"\n #child\n >\n <c8y-dashboard-child-title>\n <span *ngIf="settings.translateWidgetTitle"> {{ widget.title | translate }}</span>\n <span *ngIf="!settings.translateWidgetTitle">\n {{ widget.title }}\n </span>\n </c8y-dashboard-child-title>\n <c8y-dashboard-child-action *ngIf="onEditWidget.observers.length">\n <button (click)="onEditWidget.emit({ widget: widget, source: child, dashboard: dashboard })">\n <i c8yIcon="pencil"></i> <span translate>Edit</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dashboard-child-action *ngIf="onDeleteWidget.observers.length">\n <button\n (click)="onDeleteWidget.emit({ widget: widget, source: child, dashboard: dashboard })"\n >\n <i c8yIcon="trash"></i> <span translate>Remove</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dynamic-component\n [componentId]="widget.componentId || widget.name"\n [config]="\n widget.templateUrl || widget.widgetComponent\n ? { child: widget, dashboard: contextDashboard, context: context }\n : widget.config\n "\n *ngIf="child.intersected"\n ></c8y-dynamic-component>\n </c8y-dashboard-child>\n</c8y-dashboard>\n',host:{style:"\n display: block;\n ",class:"dashboard c8y-grid-dashboard"}})],e)}(),Wp=function(){function e(e){this.elementRef=e,this.htmlAnchor=this.elementRef.nativeElement,this.htmlAnchor.hasAttribute("target")||this.htmlAnchor.setAttribute("target","_blank")}return Object.defineProperty(e.prototype,"baseHref",{set:function(e){this.htmlAnchor.href=e+"/"+this.c8yGuideHref},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:t.ElementRef}]},yc([t.Input("c8y-guide-href")],e.prototype,"c8yGuideHref",void 0),e=yc([t.Directive({selector:"[c8y-guide-href]"})],e)}(),Yp=function(){function e(e,t,n){this.docs=e,this.el=t,this.renderer=n,this.destroyed$=new a.ReplaySubject(1)}return e.prototype.ngOnInit=function(){this.baseUrl=this.docs.getBaseUrl()},e.prototype.ngAfterContentInit=function(){var e=this;this.translateDirective?this.translateDirective.htmlUpdateEvent.pipe(s.takeUntil(this.destroyed$)).subscribe((function(){e.replaceAnchorAttributes()})):this.replaceAnchorAttributes()},e.prototype.replaceAnchorAttributes=function(){var e=this;this.findGuideAnchors(this.el.nativeElement).forEach((function(t){var n=e.baseUrl+"/"+t.getAttribute("c8y-guide-href");e.renderer.setAttribute(t,"href",n),t.hasAttribute("target")||e.renderer.setAttribute(t,"target","_blank")}))},e.prototype.findGuideAnchors=function(e){var t=this,n=[];return"A"===e.nodeName&&e.attributes.getNamedItem("c8y-guide-href")?n.push(e):e.childNodes&&e.childNodes.length>0&&e.childNodes.forEach((function(e){var a=t.findGuideAnchors(e);a&&(n=Sc(n,a))})),n},e.prototype.ngAfterViewInit=function(){var e=this;this.links.forEach((function(t){t.baseHref=e.baseUrl}))},e.prototype.ngOnDestroy=function(){this.destroyed$.next(!0),this.destroyed$.complete()},e.ctorParameters=function(){return[{type:mp},{type:t.ElementRef},{type:t.Renderer2}]},yc([t.ContentChildren(Wp,{descendants:!0})],e.prototype,"links",void 0),yc([t.ContentChild(lu,{static:!1})],e.prototype,"translateDirective",void 0),e=yc([t.Component({selector:"[c8y-guide-docs]",template:'<ng-container *ngIf="!!baseUrl">\n <ng-content></ng-content>\n</ng-container>\n'})],e)}(),Zp=function(){function e(){}return e=yc([t.NgModule({declarations:[Wp,Yp],imports:[c.CommonModule],exports:[Wp,Yp],providers:[mp]})],e)}(),Jp=function(){function e(){}return e=yc([t.NgModule({declarations:[Vp,Gp,zp,Bp,Kp],imports:[Yu,Xu,Up,lc.DragDropModule,tc.BsDropdownModule.forRoot(),Cp,Zp],exports:[Gp,Vp,zp,Bp,Kp]})],e)}(),Xp=function(){},Qp=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=yc([t.Directive({selector:"[c8yCellRendererDef]"})],e)}(),em=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=yc([t.Directive({selector:"[c8yHeaderCellRendererDef]"})],e)}(),tm=function(){},nm=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=yc([t.Directive({selector:"[c8yFilteringFormRendererDef]"})],e)}(),am=function(){function e(){}return yc([t.Input()],e.prototype,"name",void 0),yc([t.ContentChild(Qp,{static:!1})],e.prototype,"cellRendererDef",void 0),yc([t.ContentChild(em,{static:!1})],e.prototype,"headerCellRendererDef",void 0),yc([t.ContentChild(nm,{static:!1})],e.prototype,"filteringFormRendererDef",void 0),e=yc([t.Directive({selector:"c8y-column"})],e)}(),sm={icon:1,numeric:1,"text-short":1.67,"text-long":3.33};(cd=e.FilteringActionType||(e.FilteringActionType={})).ApplyFilter="APPLY_FILTER",cd.ResetFilter="RESET_FILTER";var om=function(){function e(){this.loadingSubject=new a.BehaviorSubject(!1),this.dataSourceSubject=new a.BehaviorSubject([]),this.dataStatsSubject=new a.BehaviorSubject({size:0,filteredSize:0,currentPage:0,currentPageSize:0,firstPageSize:0}),this.dataSelectionSubject=new a.BehaviorSubject({filteredDataIds:[]}),this.resultListSubject=new a.Subject,this.loading$=this.loadingSubject.asObservable(),this.data$=this.dataSourceSubject.asObservable(),this.stats$=this.dataStatsSubject.asObservable(),this.selection$=this.dataSelectionSubject.asObservable(),this.resultList$=this.resultListSubject.asObservable()}return e.prototype.connect=function(e){return this.data$},e.prototype.disconnect=function(e){this.loadingSubject.complete(),this.dataSourceSubject.complete(),this.dataStatsSubject.complete(),this.dataSelectionSubject.complete()},e.prototype.loadData=function(e){var t=this,n=e.rows,r=e.columns,l=e.pagination,i=e.searchText,c=e.serverSideDataCallback,u=e.selectable,d=e.selectionPrimaryKey,p=e.infiniteScroll,m=e.reload,g=void 0!==m&&m,h=this.toObservable(n).pipe(s.map((function(e){var n=0,a=[],s=o.flow((function(e){return t.doClientSideSearch({data:e,columns:r,searchText:i})}),(function(e){return t.doClientSideFiltering({data:e,columns:r})}),(function(e){return t.doClientSideSorting({data:e,columns:r})}),(function(e){return n=e.length,a=u?e.map((function(e){return e[d]})):a,e}),(function(e){return t.doClientSidePagination({data:e,pagination:l})}))(e);return t.dataStatsSubject.next({size:e.length,filteredSize:n,currentPage:l.currentPage,currentPageSize:s.length,firstPageSize:l.pageSize}),t.dataSelectionSubject.next({filteredDataIds:a}),s}))),f=a.defer((function(){return t.toObservable(c({columns:r,searchText:i,pagination:l,selection:{enabled:u,primaryKey:d}}))})).pipe(s.map((function(e){var n=e.data,a=e.paging,s=e.size,o=e.filteredSize,r=e.filteredDataIds;return t.dataStatsSubject.next({size:s,filteredSize:o,currentPage:a.currentPage,currentPageSize:n.length,nextPage:a.nextPage,firstPageSize:a.pageSize}),t.dataSelectionSubject.next({filteredDataIds:r||[]}),t.resultListSubject.next(e),n}))),y="function"==typeof c?f:h;a.of([]).pipe(s.tap((function(){return t.loadingSubject.next(!0)})),s.switchMap((function(){return y})),s.catchError((function(e){return t.dataStatsSubject.next({size:0,filteredSize:0,currentPage:0,currentPageSize:0,firstPageSize:0}),t.dataSelectionSubject.next({filteredDataIds:[]}),a.of([])})),s.finalize((function(){return t.loadingSubject.next(!1)}))).subscribe((function(e){var n=p&&!g?Sc(t.dataSourceSubject.value,e):e;t.dataSourceSubject.next(n)}))},e.prototype.resolveValue=function(e,t){return o.get(e,t)},e.prototype.resolveFunction=function(e){return"function"==typeof e?e():e},e.prototype.normalizeNil=function(e){return o.isNil(e)?"":e},e.prototype.doClientSideFiltering=function(e){var t=this,n=e.data;return e.columns.reduce((function(e,n){var a=n.filterPredicate;return"string"==typeof a?t.doClientSideSearch({data:e,columns:[n],searchText:a}):"function"==typeof a?e.filter((function(e){return a(e,n.path)})):e}),n)},e.prototype.doClientSideSearch=function(e){var t=this,n=e.data,a=e.columns,s=e.searchText,r=a.map((function(e){return e.path})).filter((function(e){return!o.isNil(e)})),l=this.createRegexSearch(s);return n.filter((function(e){var n=o.flow((function(e){return o.pick(e,r)}),(function(e){return o.mapValues(e,t.resolveFunction)}),(function(e){return o.omitBy(e,o.isNil)}))(e);return Object.values(n).some((function(e){return l.test(e.toString())}))}))},e.prototype.doClientSideSorting=function(e){var t=e.data,n=e.columns.filter((function(e){return!!e.sortOrder})),a={paths:n.map((function(e){return e.path})),orders:n.map((function(e){return e.sortOrder}))};return o.orderBy(t,a.paths,a.orders)},e.prototype.doClientSidePagination=function(e){var t=e.data,n=e.pagination;return n?o.get(o.chunk(t,n.pageSize),n.currentPage-1,[]):t},e.prototype.createRegexSearch=function(e){return RegExp(function(e){void 0===e&&(e="");return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"i")},e.prototype.toObservable=function(e){return a.isObservable(e)?e:e instanceof Promise?a.from(e):a.of(e)},e}();var rm,lm,im=function(){function n(e,n,s,o){this.sanitizer=e,this.hostRef=n,this.cd=s,this.cfr=o,this.title="Items",this.loadMoreItemsLabel="Load more items",this.loadingItemsLabel="Loading items…",this.noMatchingItemsLabel="No matching items.",this.dataSource=new om,this.filteringLabelsParams={filteredItemsCount:0,allItemsCount:0},this.paginationLabelParams={pageFirstItemIdx:0,pageLastItemIdx:0,itemsTotal:0},this.possiblePageSizes=[10,15,20,30,50],this.minPossiblePageSize=Math.min.apply(Math,Sc(this.possiblePageSizes)),this.selectable=!1,this.selectionPrimaryKey="id",this.displayOptions={striped:!0,bordered:!1,gridHeader:!0},this.rowMouseOver=new t.EventEmitter,this.rowMouseLeave=new t.EventEmitter,this.rowClick=new t.EventEmitter,this.itemsSelect=new t.EventEmitter,this.columnNames=[],this.styles={tableCursor:"auto",gridTemplateColumns:void 0,gridInfiniteScrollColumn:void 0},this.searchText$=new t.EventEmitter,this.searchText="",this.filteringApplied=!1,this.totalPagesCount=1/0,this.selectedItemIds=[],this.currentPageSelectionState={allSelected:!1,allDeselected:!0},this.builtInActionType={Edit:"EDIT",Delete:"DELETE",Export:"EXPORT"},this.resizeHandleMouseDown$=new t.EventEmitter,this.resizeHandleContainerMouseMove$=new t.EventEmitter,this.resizeHandleContainerMouseUp$=new t.EventEmitter,this.unsubscribe$=new a.Subject}return Object.defineProperty(n.prototype,"_columns",{set:function(e){this.columns=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_rows",{set:function(e){this.rows=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_pagination",{set:function(e){this.pagination=e;var t=o.get(this.pagination,"pageSize");t&&!this.possiblePageSizes.find((function(e){return e===t}))&&(this.pagination=fc({},this.pagination,{pageSize:10}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_infiniteScroll",{set:function(e){this.infiniteScroll=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_serverSideDataCallback",{set:function(e){this.serverSideDataCallback=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_selectable",{set:function(e){this.selectable=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_selectionPrimaryKey",{set:function(e){this.selectionPrimaryKey=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_displayOptions",{set:function(e){this.displayOptions=fc({},this.displayOptions,e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_actionControls",{set:function(e){this.actionControls=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_bulkActionControls",{set:function(e){this.bulkActionControls=e||[]},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){var e=this;this.searchText$.pipe(s.takeUntil(this.unsubscribe$),s.debounceTime(300),s.distinctUntilChanged(),s.tap((function(t){e.searchText=t}))).subscribe((function(){e.reload()})),this.selectable&&a.combineLatest(this.dataSource.data$,this.itemsSelect.asObservable()).pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(t){var n=wc(t,1)[0],a=0===n.length;e.currentPageSelectionState={allSelected:!a&&n.every((function(t){return e.isItemSelected(t)})),allDeselected:!!a||n.every((function(t){return!e.isItemSelected(t)}))}})),this.dataSource.stats$.pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(t){e.createLoadMoreComponent(t),e.updateFilteringLabelsParams(t),e.updatePaginationLabelParams(t)}))},n.prototype.ngOnChanges=function(){this.updateColumns(),this.loadData()},n.prototype.ngAfterViewInit=function(){this.updateGridColumnsSize(),this.thEls=this.thRefs.toArray().map((function(e){return e.nativeElement})),this.setupResizeHandle()},n.prototype.ngOnDestroy=function(){this.unsubscribe$.next(),this.unsubscribe$.complete()},n.prototype.trackByName=function(e,t){return t.name},n.prototype.resolveCellValue=function(e,t){var n=this;return o.flow([function(e){return n.dataSource.resolveValue(e,t)},this.dataSource.resolveFunction,this.dataSource.normalizeNil])(e)},n.prototype.changeSortOrder=function(e){var t=this.columns.find((function(t){return t.name===e}));if(t){var n=t.sortOrder;n?"asc"===n?this.updateSorting([e],"desc"):this.updateSorting([e],""):this.updateSorting([e],"asc")}},n.prototype.updateSorting=function(e,t){this.columns=this.columns.map((function(n){return e.includes(n.name)?fc({},n,{sortOrder:t}):n})),this.reload()},n.prototype.applyFilter=function(t,n,a){this.updateFiltering([t],{type:e.FilteringActionType.ApplyFilter,payload:{filteringModifier:a}}),n.hide()},n.prototype.resetFilter=function(t,n){this.updateFiltering([t],{type:e.FilteringActionType.ResetFilter}),n.hide()},n.prototype.clearFilters=function(){this.updateFiltering(this.columns.map((function(e){return e.name})),{type:e.FilteringActionType.ResetFilter})},n.prototype.updateFiltering=function(t,n){this.columns=this.columns.map((function(a){return t.includes(a.name)?fc({},a,n.type===e.FilteringActionType.ApplyFilter?n.payload.filteringModifier:{filterPredicate:void 0,externalFilterQuery:void 0}):a})),this.updateFilteringApplied(),this.reload()},n.prototype.updateFilteringApplied=function(){this.filteringApplied=this.columns.some(this.isColumnFilteringApplied)},n.prototype.isColumnFilteringApplied=function(e){var t=e.filterable,n=e.filterPredicate,a=e.externalFilterQuery;return!(!t||!n&&!a)},n.prototype.updatePagination=function(e){var t=e.itemsPerPage,n=e.page;this.pagination=fc({},this.pagination,{pageSize:t,currentPage:n}),this.loadData()},n.prototype.reload=function(){this.pagination=fc({},this.pagination,{currentPage:1}),this.recreateLoadMoreComponent=!0,this.loadData(!0),this.scrollToTop()},n.prototype.loadNextPage=function(){var e=this;return this.pagination=fc({},this.pagination,{currentPage:this.pagination.nextPage}),this.loadData(),this.dataSource.resultList$.pipe(s.take(1)).toPromise().then((function(t){return fc({},t,{paging:fc({},t.paging,{next:e.loadNextPage.bind(e)})})}))},n.prototype.getCellRendererSpec=function(e){var t=e.value,n=e.row,a=e.columnName;return this._getCellRendererSpec({type:"CELL",value:t,row:n,columnName:a})},n.prototype.getHeaderCellRendererSpec=function(e){var t=e.value,n=e.columnName;return this._getCellRendererSpec({type:"HEADER",value:t,row:void 0,columnName:n})},n.prototype.getFilteringFormRendererSpec=function(e){var t=e.column,n=e.dropdown;return{renderer:o.get(this.getColumnRenderer(t),"filteringFormRendererDef.template")||t.filteringFormRendererComponent,context:{property:t,applyFilter:this.applyFilter.bind(this,t.name,n),resetFilter:this.resetFilter.bind(this,t.name,n)}}},n.prototype.setAllItemsSelected=function(e){var t=this;this.dataSource.selection$.pipe(s.first()).subscribe((function(n){var a=n.filteredDataIds;return t.setItemsSelected(a,e)}))},n.prototype.setAllItemsInCurrentPageSelected=function(e){var t=this;this.dataSource.data$.pipe(s.first()).subscribe((function(n){return t.setItemsSelected(n,e)}))},n.prototype.setItemsSelected=function(e,t){var n=this,a=e.map((function(e){return"object"==typeof e?e[n.selectionPrimaryKey]:e}));this.selectedItemIds=t?o.union(this.selectedItemIds,a):o.without.apply(void 0,Sc([this.selectedItemIds],a)),this.itemsSelect.emit(this.selectedItemIds)},n.prototype.isItemSelected=function(e){return this.selectedItemIds.includes(e[this.selectionPrimaryKey])},n.prototype.onColumnDrop=function(e){var t=e.previousIndex,n=e.currentIndex;if(t!==n){var a=this.columns.splice(t,1);this.columns.splice(n,0,a[0])}this.updateColumnNames(),this.updateGridColumnsSize()},n.prototype.updateGridColumnsSize=function(){this.styles=fc({},this.styles,{gridTemplateColumns:this.sanitizer.bypassSecurityTrustStyle(this.columns.filter((function(e){return e.visible})).map((function(e){return e.gridTrackSize})).join(" ")),gridInfiniteScrollColumn:this.sanitizer.bypassSecurityTrustStyle("1 / span "+this.columns.length)})},n.prototype.updateColumns=function(){var e={gridTrackSize:"42px",sortable:!1,positionFixed:!0};this.columns=Sc([this.selectable?fc({},e,{name:"checkbox"}):void 0],this.columns,[this.actionControls.length>0?fc({},e,{name:"actions"}):void 0]).filter(Boolean).map(this.withColumnDefaults),this.updateColumnNames(),this.updateGridColumnsSize(),this.updateFilteringApplied()},n.prototype.withColumnDefaults=function(e){var t=e.dataType||"text-short",n=e.headerCSSClassName,a=e.cellCSSClassName;return fc({visible:!0,positionFixed:!1,sortable:!0,sortOrder:"",filterable:!1},e,{dataType:t,gridTrackSize:e.gridTrackSize||"minmax(80px, "+sm[t]+"fr)",headerCSSClassName:("string"==typeof n?n.split(" "):n)||[],cellCSSClassName:("string"==typeof a?a.split(" "):a)||[]})},n.prototype.updateColumnNames=function(){this.columnNames=this.columns.map((function(e){return e.name}))},n.prototype.setupResizeHandle=function(){var e=this;this.resizeHandleMouseDown$.pipe(s.takeUntil(this.unsubscribe$),s.tap((function(){return e.clearMouseHighlights()})),s.mergeMap((function(t){var n=t.event,a=t.targetColumnName;return e.columns=e.columns.map((function(e){return e.name===a?fc({},e,{headerCSSClassName:o.union(e.headerCSSClassName,["header--being-resized"])}):e})),e.headerBeingResized={columnName:a,el:n.target.parentNode},e.styles=fc({},e.styles,{tableCursor:"col-resize"}),e.resizeHandleContainerMouseMove$.pipe(s.tap((function(){return e.clearMouseHighlights()})),s.takeUntil(e.resizeHandleContainerMouseUp$))}))).subscribe((function(t){requestAnimationFrame((function(){e.columns=e.columns.map((function(n,a){if(n.name===e.headerBeingResized.columnName){var s=e.hostRef.nativeElement,r=s.getBoundingClientRect().left,l=s.scrollLeft-r+t.clientX-(e.headerBeingResized.el.offsetLeft||0);return fc({},n,{gridTrackSize:Math.max(80,l)+"px"})}return n.gridTrackSize.startsWith("minmax")?fc({},n,{gridTrackSize:o.parseInt(e.thEls[a].clientWidth)+"px"}):n})),e.updateGridColumnsSize()}))})),this.resizeHandleContainerMouseUp$.pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(){e.headerBeingResized&&(e.columns=e.columns.map((function(t){return t.name===e.headerBeingResized.columnName?fc({},t,{headerCSSClassName:o.without(t.headerCSSClassName,"header--being-resized")}):t})),e.headerBeingResized=void 0,e.styles=fc({},e.styles,{tableCursor:"auto"}))}))},n.prototype.clearMouseHighlights=function(){window.getSelection&&window.getSelection().removeAllRanges()},n.prototype._getCellRendererSpec=function(e){var t=e.type,n=e.value,a=e.row,s=e.columnName,r=this.columns.find((function(e){return e.name===s})),l=this.getColumnRenderer(r),i=o.get(l,("HEADER"===t?"headerCellRendererDef":"cellRendererDef")+".template"),c=r.cellRendererComponent,u=r.headerCellRendererComponent;return{renderer:i||("HEADER"===t?u:c),context:{value:n,item:a,property:r}}},n.prototype.getColumnRenderer=function(e){return this.columnRenderers.toArray().find((function(t){return t.name===e.name}))},n.prototype.loadData=function(e){void 0===e&&(e=!1);var t=this,n=t.rows,a=t.columns,s=t.pagination,o=t.searchText,r=t.serverSideDataCallback,l=t.selectable,i=t.selectionPrimaryKey,c=t.infiniteScroll;this.dataSource.loadData({rows:n,columns:a,pagination:s,searchText:o,serverSideDataCallback:r,selectable:l,selectionPrimaryKey:i,infiniteScroll:c,reload:e})},n.prototype.updateFilteringLabelsParams=function(e){this.filteringLabelsParams={filteredItemsCount:e.filteredSize,allItemsCount:e.size}},n.prototype.updatePaginationLabelParams=function(e){this.pagination.nextPage=e.nextPage;var t=(e.currentPage-1)*e.firstPageSize+1;this.paginationLabelParams={pageFirstItemIdx:t,pageLastItemIdx:t+(e.currentPageSize-1),itemsTotal:e.filteredSize}},n.prototype.createLoadMoreComponent=function(e){if(this.infiniteScroll&&e&&e.nextPage&&(!this.loadMoreComponent||this.recreateLoadMoreComponent)){this.recreateLoadMoreComponent=!1,this.infiniteScrollContainer.clear();var t=this.cfr.resolveComponentFactory(Pu),n=this.infiniteScrollContainer.createComponent(t).instance;n.useIntersection="auto"===this.infiniteScroll||"hidden"===this.infiniteScroll,n.hidden="hidden"===this.infiniteScroll,n.paging={nextPage:e.nextPage,next:this.loadNextPage.bind(this)},n.loadNextLabel=this.loadMoreItemsLabel,n.loadingLabel=this.loadingItemsLabel,this.loadMoreComponent=n}else this.loadMoreComponent&&!e.nextPage&&(this.loadMoreComponent.paging={nextPage:null})},n.prototype.scrollToTop=function(){this.infiniteScroll&&(this.scrollContainer.nativeElement.scrollTop=0)},n.ctorParameters=function(){return[{type:ic.DomSanitizer},{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:t.ComponentFactoryResolver}]},yc([t.Input()],n.prototype,"title",void 0),yc([t.Input()],n.prototype,"loadMoreItemsLabel",void 0),yc([t.Input()],n.prototype,"loadingItemsLabel",void 0),yc([t.Input()],n.prototype,"noMatchingItemsLabel",void 0),yc([t.Input("columns")],n.prototype,"_columns",null),yc([t.Input("rows")],n.prototype,"_rows",null),yc([t.Input("pagination")],n.prototype,"_pagination",null),yc([t.Input("infiniteScroll")],n.prototype,"_infiniteScroll",null),yc([t.Input("serverSideDataCallback")],n.prototype,"_serverSideDataCallback",null),yc([t.Input("selectable")],n.prototype,"_selectable",null),yc([t.Input("selectionPrimaryKey")],n.prototype,"_selectionPrimaryKey",null),yc([t.Input("displayOptions")],n.prototype,"_displayOptions",null),yc([t.Input("actionControls")],n.prototype,"_actionControls",null),yc([t.Input("bulkActionControls")],n.prototype,"_bulkActionControls",null),yc([t.Output()],n.prototype,"rowMouseOver",void 0),yc([t.Output()],n.prototype,"rowMouseLeave",void 0),yc([t.Output()],n.prototype,"rowClick",void 0),yc([t.Output()],n.prototype,"itemsSelect",void 0),yc([t.ContentChildren(am)],n.prototype,"columnRenderers",void 0),yc([t.ViewChild("scroll",{static:!0})],n.prototype,"scrollContainer",void 0),yc([t.ViewChild("infiniteScrollContainer",{static:!1,read:t.ViewContainerRef})],n.prototype,"infiniteScrollContainer",void 0),yc([t.ViewChildren(cc.CdkHeaderCell,{read:t.ElementRef})],n.prototype,"thRefs",void 0),n=yc([t.Component({selector:"c8y-data-grid",template:'<div class="table-data-grid-scroll" #scroll>\n <div *ngIf="displayOptions.gridHeader" class="table-data-grid-header separator">\n <h4 class="m-r-16">{{ title | translate }}</h4>\n <span *ngIf="!filteringApplied">\n <span class="label label-warning m-r-4" translate>No filters</span>\n <small\n *ngIf="!!filteringLabelsParams.allItemsCount"\n class="m-r-4"\n ngNonBindable\n translate\n [translateParams]="filteringLabelsParams"\n >{{ filteredItemsCount }} of {{ allItemsCount }} items</small\n >\n </span>\n <span *ngIf="filteringApplied">\n <ng-container *ngIf="!!filteringLabelsParams.allItemsCount">\n <span class="badge badge-info m-r-4">\n {{ (dataSource.stats$ | async).filteredSize }}\n </span>\n <small ngNonBindable translate [translateParams]="filteringLabelsParams"\n >of {{ allItemsCount }} items</small\n >\n </ng-container>\n <button class="m-l-8 btn btn-xs btn-default m-r-4" (click)="clearFilters()" translate>\n Clear filters\n </button>\n </span>\n <span class="hidden-xs hidden-sm">\n <button\n class="btn-clean text-primary"\n popover="{{ \'Click the column headers to apply filters.\' | translate }}"\n placement="right"\n triggers="focus"\n >\n <i c8yIcon="question-circle-o"></i>\n </button>\n </span>\n\n <div class="flex-item-right">\n <div class="btnbar flex-row">\n <div class="dropdown" dropdown [insideClick]="true">\n <button class="btnbar-btn c8y-dropdown" dropdownToggle>\n <i c8yIcon="columns" class="m-r-4"></i> <span translate>Configure columns</span>\n </button>\n\n <ul\n *dropdownMenu\n class="dropdown-menu"\n (click)="$event.stopPropagation()"\n >\n <li class="bg-white">\n <div cdkDropList (cdkDropListDropped)="onColumnDrop($event)" class="list-group m-0">\n <div *ngFor="let column of columns" cdkDrag cdkDragLockAxis="y">\n <ng-container *ngIf="!column.positionFixed">\n <div class="list-group-item draggable-after">\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n [(ngModel)]="column.visible"\n (change)="updateGridColumnsSize()"\n />\n <span></span> \n {{ (column.header | translate) || column.name }}\n </label>\n </div>\n </ng-container>\n </div>\n </div>\n </li>\n </ul>\n </div>\n\n <button\n class="btnbar-btn"\n [disabled]="dataSource.loading$ | async"\n (click)="searchText = \'\'; reload()"\n >\n <i c8yIcon="refresh"></i> <span translate> Reload</span>\n </button>\n\n <div *ngIf="!serverSideDataCallback" class="input-group input-group-search">\n <input\n type="search"\n class="form-control"\n placeholder="{{ \'Search…\' | translate }}"\n [ngModel]="searchText"\n (input)="searchText$.emit($event.target.value)"\n />\n <div class="input-group-addon">\n <i c8yIcon="search" *ngIf="searchText.length === 0"></i>\n <i\n c8yIcon="times"\n class="pointer"\n *ngIf="searchText.length > 0"\n (click)="searchText = \'\'; searchText$.emit(\'\')"\n ></i>\n </div>\n </div>\n </div>\n </div>\n <div\n class="table-data-grid-header-bulk-actions animated slideInDown fast"\n *ngIf="selectedItemIds.length !== 0"\n >\n <h4>\n <span ngNonBindable translate [translateParams]="{ count: selectedItemIds.length }">\n {{ count }} selected items.\n </span>\n <br class="visible-xs" />\n <small *ngIf="selectedItemIds.length >= pagination.pageSize">\n <a (click)="setAllItemsSelected(true)" style="cursor: pointer">\n <span\n ngNonBindable\n translate\n [translateParams]="{ count: (dataSource.stats$ | async).filteredSize }"\n >\n Select all {{ count }} items\n </span>\n </a>\n </small>\n </h4>\n <div class="flex-item-right">\n <div class="btnbar flex-row">\n <ng-container\n *ngFor="let bulkActionControl of bulkActionControls"\n [ngSwitch]="bulkActionControl.type"\n >\n <button\n *ngSwitchCase="builtInActionType.Export"\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="sign-out"></i> <span translate>Export</span>\n </button>\n\n <button\n *ngSwitchCase="builtInActionType.Delete"\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="trash"></i> <span translate>Delete</span>\n </button>\n\n <button\n *ngSwitchDefault\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="{{ bulkActionControl.icon }}"></i>\n {{ bulkActionControl.text | translate }}\n </button>\n </ng-container>\n\n <button class="btnbar-btn" (click)="setAllItemsSelected(false)">\n <i c8yIcon="times"></i> <span translate>Cancel</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <table\n class="table table-hover table-filtered-sorted table-data-grid"\n cdk-table\n [dataSource]="dataSource"\n [trackBy]="trackByName"\n [class.table-striped]="displayOptions.striped"\n [class.table-bordered]="displayOptions.bordered"\n [class.table-data-grid-with-checkboxes]="selectable"\n [class.table-data-grid-with-actions]="actionControls.length > 0"\n [style.grid-template-columns]="styles.gridTemplateColumns"\n (mousemove)="resizeHandleContainerMouseMove$.emit($event)"\n (mouseup)="resizeHandleContainerMouseUp$.emit($event)"\n >\n <ng-container *ngFor="let column of columns; trackBy: trackByName" [cdkColumnDef]="column.name">\n <ng-container [ngSwitch]="column.name">\n <ng-container *ngSwitchCase="\'checkbox\'">\n <th cdk-header-cell *cdkHeaderCellDef data-type="icon">\n <div>\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n [checked]="currentPageSelectionState.allSelected"\n [indeterminate]="\n !(\n currentPageSelectionState.allSelected ||\n currentPageSelectionState.allDeselected\n )\n "\n (change)="setAllItemsInCurrentPageSelected($event.target.checked)"\n />\n <span></span>\n </label>\n </div>\n </th>\n\n <td cdk-cell *cdkCellDef="let row">\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n [checked]="isItemSelected(row)"\n (change)="setItemsSelected([row], $event.target.checked)"\n />\n <span></span>\n </label>\n </td>\n </ng-container>\n\n <ng-container *ngSwitchCase="\'actions\'">\n <th cdk-header-cell *cdkHeaderCellDef data-type="icon"></th>\n\n <td cdk-cell *cdkCellDef="let row">\n <ng-container *ngIf="actionControls.length <= 2">\n <ng-container\n *ngFor="let actionControl of actionControls"\n [ngSwitch]="actionControl.type"\n >\n <button\n *ngSwitchCase="builtInActionType.Edit"\n class="btn btn-icon btn-xs btn-primary"\n title="{{ \'Edit\' | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="pencil"></i>\n </button>\n <button\n *ngSwitchCase="builtInActionType.Delete"\n class="btn btn-dot showOnHover"\n title="{{ \'Delete\' | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i class="text-danger" c8yIcon="minus-circle"></i>\n </button>\n <button\n *ngSwitchDefault\n class="btn btn-icon btn-xs btn-primary"\n title="{{ actionControl.text | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="{{ actionControl.icon }}"></i>\n </button>\n </ng-container>\n </ng-container>\n\n <div *ngIf="actionControls.length > 2" class="dropdown" dropdown>\n <button\n class="dropdown-toggle c8y-dropdown"\n title="{{ \'Actions\' | translate }}"\n dropdownToggle\n >\n <i c8yIcon="ellipsis-v"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <li *ngFor="let actionControl of actionControls" [ngSwitch]="actionControl.type">\n <button\n *ngSwitchCase="builtInActionType.Edit"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="pencil"></i> {{ \'Edit\' | translate }}\n </button>\n <button\n *ngSwitchCase="builtInActionType.Delete"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="trash"></i> {{ \'Delete\' | translate }}\n </button>\n <button\n *ngSwitchCase="builtInActionType.Export"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="download"></i> {{ \'Export\' | translate }}\n </button>\n <button *ngSwitchDefault (click)="actionControl.callback(row, reload.bind(this))">\n <i c8yIcon="{{ actionControl.icon }}"></i> {{ actionControl.text | translate }}\n </button>\n </li>\n </ul>\n </div>\n </td>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [ngClass]="column.headerCSSClassName"\n [attr.data-type]="column.dataType"\n [class.sorted]="column.sortOrder"\n [class.filtered]="column | map: isColumnFilteringApplied"\n [class.hidden]="!column.visible"\n >\n <div *ngIf="!column.filterable" [title]="(column.header | translate) || column.name">\n <ng-container\n *ngIf="\n (\n [{\n columnName: column.name,\n value: ((column.header | translate) || column.name)\n }]\n | map:getHeaderCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n </div>\n <div\n *ngIf="column.filterable"\n class="dropdown"\n dropdown\n #dropdown="bs-dropdown"\n [insideClick]="true"\n container="body"\n >\n <button\n class="btn-header c8y-dropdown"\n dropdownToggle\n [title]="(column.header | translate) || column.name"\n >\n <ng-container\n *ngIf="\n (\n [{\n columnName: column.name,\n value: ((column.header | translate) || column.name)\n }]\n | map:getHeaderCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n <i c8yIcon="filter" title="{{ \'Filter\' | translate }}"></i>\n </button>\n\n <ul *dropdownMenu class="dropdown-menu " (click)="$event.stopPropagation()">\n <li class="data-grid__dropdown">\n <ng-container\n *ngIf="\n (\n [{\n column: column,\n dropdown: dropdown\n }]\n | map:getFilteringFormRendererSpec:this\n ) as filteringFormRendererSpec\n "\n >\n <c8y-filtering-form-renderer [spec]="filteringFormRendererSpec">\n </c8y-filtering-form-renderer>\n </ng-container>\n </li>\n </ul>\n </div>\n\n <button\n *ngIf="column.sortable"\n class="btn-sort"\n title="{{ \'Sort\' | translate }}"\n (click)="changeSortOrder(column.name)"\n >\n <ng-container [ngSwitch]="column.sortOrder">\n <i *ngSwitchCase="\'asc\'" c8yIcon="long-arrow-up"></i>\n <i *ngSwitchCase="\'desc\'" c8yIcon="long-arrow-down"></i>\n <i *ngSwitchDefault c8yIcon="exchange"></i>\n </ng-container>\n </button>\n\n <span\n class="resize-handle"\n (mousedown)="\n resizeHandleMouseDown$.emit({ event: $event, targetColumnName: column.name })\n "\n >\n </span>\n </th>\n\n <td\n cdk-cell\n *cdkCellDef="let row"\n [ngClass]="column.cellCSSClassName"\n [attr.data-cell-title]="column.header | translate"\n [class.hidden]="!column.visible"\n >\n <ng-container\n *ngIf="\n (\n [{\n value: resolveCellValue(row, column.path),\n row: row,\n columnName: column.name\n }]\n | map:getCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n </td>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-container cdkColumnDef="infiniteScrollFooter">\n <td cdk-footer-cell *cdkFooterCellDef [style.grid-column]="styles.gridInfiniteScrollColumn">\n <template #infiniteScrollContainer></template>\n </td>\n </ng-container>\n\n <tr cdk-header-row *cdkHeaderRowDef="columnNames"></tr>\n\n <tr\n cdk-row\n *cdkRowDef="let row; columns: columnNames"\n (mouseover)="rowMouseOver.emit(row)"\n (mouseleave)="rowMouseLeave.emit(row)"\n (click)="rowClick.emit(row)"\n ></tr>\n\n <ng-container *ngIf="infiniteScroll">\n <tr cdk-footer-row *cdkFooterRowDef="[\'infiniteScrollFooter\']"></tr>\n </ng-container>\n </table>\n\n <div *ngIf="(dataSource.loading$ | async) && !loadMoreComponent" class="text-center">\n <c8y-progress-bar [message]="loadingItemsLabel"></c8y-progress-bar>\n </div>\n\n <div\n class="row m-0 p-t-40 p-b-40"\n *ngIf="!(dataSource.loading$ | async) && (dataSource.stats$ | async).filteredSize === 0"\n >\n <div class="col-md-4 col-md-offset-4">\n <div class="c8y-empty-state">\n <h1 c8yIcon="search"></h1>\n <div>\n <p>\n <strong>{{ noMatchingItemsLabel | translate }}</strong>\n </p>\n <small>{{ \'Refine your search terms\' | translate }}</small>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngIf="pagination && !infiniteScroll" class="table-data-grid-footer separator">\n <div class="col-sm-4 no-gutter">\n <div *ngIf="(dataSource.stats$ | async).currentPageSize > 0" class="counter">\n <span class="text-muted" ngNonBindable translate [translateParams]="paginationLabelParams"\n >{{ pageFirstItemIdx }} - {{ pageLastItemIdx }} of {{ itemsTotal }}</span\n >\n </div>\n </div>\n\n <div class="col-sm-4 no-gutter text-center">\n <div\n *ngIf="(dataSource.stats$ | async).filteredSize > minPossiblePageSize"\n class="form-group form-inline"\n >\n <label class="m-r-4" translate>Items per page</label>\n <div class="c8y-select-wrapper">\n <select\n class="form-control"\n [ngModel]="pagination.pageSize"\n (ngModelChange)="\n updatePagination({ itemsPerPage: $event, page: pagination.currentPage })\n "\n >\n <option *ngFor="let pageSize of possiblePageSizes" [ngValue]="pageSize">\n {{ pageSize }}\n </option>\n </select>\n </div>\n </div>\n </div>\n\n <div class="col-sm-4 no-gutter text-right">\n <pagination\n [class.hidden]="totalPagesCount <= 1"\n [ngModel]="pagination.currentPage"\n (pageChanged)="updatePagination($event)"\n [totalItems]="(dataSource.stats$ | async).filteredSize"\n [itemsPerPage]="pagination.pageSize"\n (numPages)="totalPagesCount = $event"\n [maxSize]="5"\n [boundaryLinks]="false"\n previousText=" "\n nextText=" "\n ></pagination>\n </div>\n </div>\n</div>\n'})],n)}(),cm=function(){function e(e,t){this.injector=e,this.cd=t}return Object.defineProperty(e.prototype,"_spec",{set:function(e){this.spec=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){this.prevSpec||(this.prevSpec=this.spec);var e=this.spec.renderer;e instanceof t.TemplateRef?this.rendererType="TEMPLATE":e instanceof t.Type&&(this.rendererType="COMPONENT",this.rendererInjector=t.Injector.create({providers:[{provide:Xp,useValue:this.spec.context}],parent:this.injector}))},e.prototype.ngDoCheck=function(){!this.spec.context.value===this.prevSpec.context.value&&(this.prevSpec=this.spec,this.cd.markForCheck())},e.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef}]},yc([t.Input("spec")],e.prototype,"_spec",null),e=yc([t.Component({selector:"c8y-cell-renderer",template:'<ng-container *ngIf="spec.renderer">\n <ng-container\n *ngIf="rendererType === \'TEMPLATE\'"\n [ngTemplateOutlet]="spec.renderer"\n [ngTemplateOutletContext]="{ $implicit: spec.context }"\n >\n </ng-container>\n\n <ng-container\n *ngIf="rendererType === \'COMPONENT\'"\n [ngComponentOutlet]="spec.renderer"\n [ngComponentOutletInjector]="rendererInjector"\n >\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf="!spec.renderer">\n {{ spec.context.value }}\n</ng-container>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),um=function(){function e(e,t){this.injector=e,this.cd=t,this.defaultRendererFilterText=""}return Object.defineProperty(e.prototype,"_spec",{set:function(e){this.spec=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){var e=this.spec,n=e.renderer,a=e.context;n instanceof t.TemplateRef?this.rendererType="TEMPLATE":n instanceof t.Type&&(this.rendererType="COMPONENT",this.rendererInjector=t.Injector.create({providers:[{provide:tm,useValue:this.spec.context}],parent:this.injector}));var s=a.property.filterPredicate;"string"==typeof s&&(this.defaultRendererFilterText=s)},e.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef}]},yc([t.Input("spec")],e.prototype,"_spec",null),e=yc([t.Component({selector:"c8y-filtering-form-renderer",template:'<ng-container *ngIf="spec.renderer">\n <ng-container\n *ngIf="rendererType === \'TEMPLATE\'"\n [ngTemplateOutlet]="spec.renderer"\n [ngTemplateOutletContext]="{ $implicit: spec.context }"\n >\n </ng-container>\n\n <ng-container\n *ngIf="rendererType === \'COMPONENT\'"\n [ngComponentOutlet]="spec.renderer"\n [ngComponentOutletInjector]="rendererInjector"\n >\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf="!spec.renderer">\n <div class="form-group">\n <label translate>Filter text</label>\n <input\n class="form-control"\n [(ngModel)]="defaultRendererFilterText"\n (keyup.enter)="\n spec.context.applyFilter({\n filterPredicate: defaultRendererFilterText\n })\n "\n />\n </div>\n <div class="flex-row">\n <button\n class="btn btn-default btn-sm flex-grow m-r-8"\n (click)="defaultRendererFilterText = \'\'; spec.context.resetFilter()"\n translate\n >\n Reset\n </button>\n <button\n class="btn btn-primary btn-sm flex-grow"\n (click)="\n spec.context.applyFilter({\n filterPredicate: defaultRendererFilterText\n })\n "\n translate\n >\n Apply\n </button>\n </div>\n</ng-container>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),dm=function(){function e(){}return e=yc([t.NgModule({imports:[c.CommonModule,cc.CdkTableModule,lc.DragDropModule,ac.FormsModule,ac.ReactiveFormsModule,Yu,tc.BsDropdownModule.forRoot(),sc.PopoverModule.forRoot(),uc.PaginationModule.forRoot()],declarations:[Qp,em,cm,nm,um,am,im],exports:[Qp,em,nm,am,im],entryComponents:[im]})],e)}(),pm={sendData:{AVAILABLE:{icon:"long-arrow-right",class:"statusOk"},UNAVAILABLE:{icon:"long-arrow-right",class:"statusNok"},UNKNOWN:{icon:"long-arrow-right",class:"statusUnknown"},NOT_MONITORED:{icon:"long-arrow-right",class:"statusUnknown"}},push:{CONNECTED:{icon:"long-arrow-left",class:"statusOk"},DISCONNECTED:{icon:"long-arrow-left",class:"statusUnknown"},UNKNOWN:{icon:"long-arrow-left",class:"statusUnknown"},MAINTENANCE:{icon:"wrench",class:"statusAlert"}},device:{MAINTENANCE:{icon:"wrench",class:"statusAlert"}}},mm=function(e,t){var n=c.formatDate(new Date(e),"medium",t.currentLang);return t.instant("Device last request:\n{{date}}",{date:n})},gm={sendStatusConnected:mm,sendStatusDisconnected:"Connection not monitored",pushStatusConnected:"Connection to device established",pushStatusDisconnected:"Connection to device not established (not supported by device or no connectivity)",maintenance:"Device is under maintenance"};(rm=e.PushStatusLabels||(e.PushStatusLabels={}))[rm.CONNECTED="Push connection: active"]="CONNECTED",rm[rm.DISCONNECTED="Push connection: inactive"]="DISCONNECTED",rm[rm.UNKNOWN="Push connection: inactive"]="UNKNOWN",(lm=e.SendStatusLabels||(e.SendStatusLabels={}))[lm.AVAILABLE="Send connection: online"]="AVAILABLE",lm[lm.NOT_MONITORED="Send connection: not monitored"]="NOT_MONITORED",lm[lm.UNAVAILABLE="Send connection: offline"]="UNAVAILABLE",lm[lm.UNKNOWN="Send connection status unknown"]="UNKNOWN",lm[lm.MAINTENANCE="Device is under maintenance"]="MAINTENANCE";var hm,fm=function(){function n(e){this.translateService=e}return Object.defineProperty(n.prototype,"node",{set:function(e){this._mo=e.mo||e},enumerable:!0,configurable:!0}),n.prototype.get=function(){return this._mo},n.prototype.ngOnChanges=function(){this.setStatusProperites()},n.prototype.ngAfterContentInit=function(){this.setStatusProperites()},n.prototype.setStatusProperites=function(){this.requiredAvailability=o.get(this._mo,"c8y_RequiredAvailability"),this.availabilityStatus=o.get(this._mo,"c8y_Availability.status"),this.pushStatus=o.get(this._mo,"c8y_Connection.status")||"UNKNOWN",this.sendStatus=this.availabilityStatus||(this.requiredAvailability?"UNKNOWN":"NOT_MONITORED")},n.prototype.status=function(){return"MAINTENANCE"===this.availabilityStatus||"MAINTENANCE"===this.pushStatus?this.getMaintenanceStatus():this.getSendPushStatus()},n.prototype.getMaintenanceStatus=function(){return{sendStatus:!1,pushStatus:!1,maintenanceStatus:{icon:pm.device.MAINTENANCE.icon,class:pm.device.MAINTENANCE.class,tooltip:gm.maintenance}}},n.prototype.getSendPushStatus=function(){return{sendStatus:{icon:pm.sendData[this.sendStatus].icon,class:pm.sendData[this.sendStatus].class,status:this.sendStatus,label:e.SendStatusLabels[this.sendStatus],tooltip:this.getSendStatusTooltip(this._mo)},pushStatus:{icon:pm.push[this.pushStatus].icon,class:pm.push[this.pushStatus].class,status:this.pushStatus,label:e.PushStatusLabels[this.pushStatus],tooltip:this.getPushStatusTooltip("CONNECTED"===this.pushStatus)},maintenanceStatus:!1}},n.prototype.getSendStatusTooltip=function(e){var t=e&&e.c8y_Availability,n=t&&t.lastMessage;return n?gm.sendStatusConnected(n,this.translateService):gm.sendStatusDisconnected},n.prototype.getPushStatusTooltip=function(e){return e?gm.pushStatusConnected:gm.pushStatusDisconnected},n.ctorParameters=function(){return[{type:i.TranslateService}]},yc([t.Input("mo")],n.prototype,"node",null),n=yc([t.Component({selector:"device-status",template:'\x3c!-- ATTENTION: keep text format in `tooltip` attribute --\x3e\n<div class="statusContainer"\n title="{{status().sendStatus.tooltip | translate}}\n{{status().pushStatus.tooltip | translate}}"\n placement="left"\n >\n <div\n *ngIf="!!status().sendStatus"\n class="sendStatus"\n [c8yIcon]="status().sendStatus.icon"\n [ngClass]="status().sendStatus.class"\n ></div>\n <div\n *ngIf="!!status().pushStatus"\n class="pushStatus"\n [c8yIcon]="status().pushStatus.icon"\n [ngClass]="status().pushStatus.class"\n >\n </div>\n\n <div *ngIf="!!status().maintenanceStatus"\n class="maintenanceStatus"\n tooltip="{{status().maintenanceStatus.tooltip | translate}}"\n container="body"\n placement="auto"\n [c8yIcon]="status().maintenanceStatus.icon"\n [ngClass]="status().maintenanceStatus.class"></div>\n</div>\n'})],n)}(),ym=function(){function e(){}return e=yc([t.NgModule({imports:[Yu,u.TooltipModule],exports:[fm],declarations:[fm]})],e)}(),vm=function(){function e(){this.title="Upload file",this.message="Drop file here",this.icon="plus-square",this.loadingMessage="Uploading…",this.alwaysShow=!1,this.clickToOpen=!0,this.loading=!1,this.progress=-1,this.dropped=new t.EventEmitter,this.maxAllowedFiles=1/0,this.isOver=!1,this.errors=!1}return e.prototype.ngOnInit=function(){this.alwaysShow=this.alwaysShow||0===this.area.nativeElement.children.length,this.files&&this.files.length>0&&this.onFilesSelected(this.files)},e.prototype.toggle=function(e){this.zone.nativeElement.style.height=this.area.nativeElement.offsetHeight+"px",this.onOver()},e.prototype.showPicker=function(e){this.preventDefault(e),this.picker.nativeElement.value="",this.picker.nativeElement.click()},e.prototype.onOver=function(){this.isOver||(this.isOver=!0,document.addEventListener("dragover",this.preventDefault),document.addEventListener("drop",this.preventDefault))},e.prototype.onPick=function(e){this.errors=!1,this.preventDefault(e),this.onFilesSelected(e.target.files)},e.prototype.onDrop=function(e){this.preventDefault(e),this.onFilesSelected(e.dataTransfer.files),this.stopDragging()},e.prototype.onFilesSelected=function(e){this.files=e,this.filesNameString=this.getFilesNamesAsString(e),this.errors=!1,this.isFilesArrayEmpty()||this.isTooManyFiles()?(this.errors=!0,this.errorMessage="Too many files selected."):this.hasEmptyFiles()?(this.errors=!0,this.errorMessage="File must not be empty, select another one."):this.dropped.emit(this.compose(e))},e.prototype.getFilesNamesAsString=function(e){return o.map(e,(function(e){return e.name})).join(", ")},e.prototype.isFilesArrayEmpty=function(){return 0===o.get(this,"files.length",0)},e.prototype.isTooManyFiles=function(){return o.get(this,"files.length",0)>this.maxAllowedFiles},e.prototype.hasEmptyFiles=function(){var e=!0;return this.isFilesArrayEmpty()||(e=this.isAnyFileEmpty()),e},e.prototype.isAnyFileEmpty=function(){return o.some(Array.from(this.files),["size",0])},e.prototype.shouldShowFilesList=function(){return this.alwaysShow&&!this.isFilesArrayEmpty()&&!this.hasEmptyFiles()&&!this.isTooManyFiles()},e.prototype.stopDragging=function(){document.removeEventListener("dragover",this.preventDefault),document.removeEventListener("drop",this.preventDefault),this.isOver=!1},e.prototype.onDelete=function(){delete this.files,delete this.filesNameString,this.clearErrors(),this.dropped.emit(void 0)},e.prototype.clearErrors=function(){delete this.errorMessage,this.errors=!1},e.prototype.preventDefault=function(e){e&&e.preventDefault()},e.prototype.compose=function(e){var t=this;return Array.from(e).map((function(e){return{file:e,readAsJson:function(){return jc(t,void 0,void 0,(function(){var t,n;return bc(this,(function(a){switch(a.label){case 0:return n=(t=JSON).parse,[4,this.read(e,hm.TEXT)];case 1:return[2,n.apply(t,[a.sent()])]}}))}))},readAsText:function(){return jc(t,void 0,void 0,(function(){return bc(this,(function(t){return[2,this.read(e,hm.TEXT)]}))}))},readAsArrayBuffer:function(){return jc(t,void 0,void 0,(function(){return bc(this,(function(t){return[2,this.read(e,hm.ARRAY_BUFFER)]}))}))},readAsBinaryString:function(){return jc(t,void 0,void 0,(function(){return bc(this,(function(t){return[2,this.read(e,hm.BINARY_STRING)]}))}))},readAsDataURL:function(){return jc(t,void 0,void 0,(function(){return bc(this,(function(t){return[2,this.read(e,hm.DATA_URL)]}))}))}}}))},e.prototype.read=function(e,t){return jc(this,void 0,void 0,(function(){var n=this;return bc(this,(function(a){return[2,new Promise((function(a,s){var o=new FileReader;switch(t){case hm.TEXT:o.readAsText(e);break;case hm.ARRAY_BUFFER:o.readAsArrayBuffer(e);break;case hm.BINARY_STRING:o.readAsBinaryString(e);break;case hm.DATA_URL:o.readAsDataURL(e)}o.onload=function(){return n.onLoad(o,a,s)}}))]}))}))},e.prototype.onLoad=function(e,t,n){2===e.readyState&&(e.error&&n(e.error),t(e.result))},yc([t.Input()],e.prototype,"title",void 0),yc([t.Input()],e.prototype,"message",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"loadingMessage",void 0),yc([t.Input()],e.prototype,"alwaysShow",void 0),yc([t.Input()],e.prototype,"clickToOpen",void 0),yc([t.Input()],e.prototype,"loading",void 0),yc([t.Input()],e.prototype,"progress",void 0),yc([t.Output()],e.prototype,"dropped",void 0),yc([t.Input()],e.prototype,"maxAllowedFiles",void 0),yc([t.Input()],e.prototype,"files",void 0),yc([t.ViewChild("area",{static:!0})],e.prototype,"area",void 0),yc([t.ViewChild("zone",{static:!1})],e.prototype,"zone",void 0),yc([t.ViewChild("picker",{static:!1})],e.prototype,"picker",void 0),e=yc([t.Component({selector:"c8y-drop-area",template:'<div\n class="drop-zone"\n *ngIf="!shouldShowFilesList()"\n [ngClass]="{ \'has-errors\': errors }"\n [style.pointerEvents]="loading ? \'none\' : \'auto\'"\n #zone\n (dragleave)="stopDragging()"\n (drop)="onDrop($event)"\n (dragover)="onOver()"\n [style.display]="isOver || alwaysShow || loading ? \'block\' : \'none\'"\n (click)="showPicker($event)"\n>\n <div class="file-placeholder" [ngClass]="{ \'drag-over\': isOver }">\n <div *ngIf="loading" class="hint-placeholder" style="width: 300px;">\n <p>\n {{ loadingMessage | translate }}\n </p>\n <div class="progress progress-striped active" *ngIf="progress !== -1">\n <div\n class="progress-bar"\n role="progressbar"\n aria-valuenow="0"\n aria-valuemin="0"\n aria-valuemax="100"\n [style.width]="progress + \'%\'"\n ></div>\n </div>\n <div class="spinner" *ngIf="progress === -1" style="position: relative;">\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 <div *ngIf="!loading" class="hint-placeholder pointer">\n <i class="fa fw fa-{{ icon }}"></i>\n <p *ngIf="!errors">\n <b>{{ message | translate }}</b>\n <br />\n <span *ngIf="alwaysShow && clickToOpen" translate>or click to browse your computer.</span>\n </p>\n <div *ngIf="errors" class="has-errors">\n <p class="form-control-feedback-message">\n {{ errorMessage | translate }}\n </p>\n </div>\n </div>\n </div>\n</div>\n\n<div class="drop-zone" *ngIf="shouldShowFilesList()"\n [style.display]="isOver || alwaysShow || loading ? \'block\' : \'none\'">\n <div class="file-placeholder p-4">\n <div class="flex-row p-4">\n <i c8yIcon="file-o" class="m-r-8"></i>\n <span title="{{ filesNameString }}" class="text-truncate">\n {{ filesNameString }}\n </span>\n <button\n title="{{ \'Remove\' | translate }}"\n class="btn btn-clean showOnHover flex-item-right"\n >\n <i c8yIcon="minus-circle" class="text-danger" (click)="onDelete()"></i>\n </button>\n </div>\n </div>\n</div>\n\n<input\n #picker\n *ngIf="clickToOpen"\n (change)="onPick($event)"\n multiple\n type="file"\n style="opacity: 0; filter: alpha(opacity = 0); height: 0px"\n/>\n<div #area [hidden]="isOver || loading" (dragover)="toggle($event)">\n <ng-content></ng-content>\n</div>\n'})],e)}();!function(e){e[e.TEXT=0]="TEXT",e[e.DATA_URL=1]="DATA_URL",e[e.ARRAY_BUFFER=2]="ARRAY_BUFFER",e[e.BINARY_STRING=3]="BINARY_STRING"}(hm||(hm={}));var jm,bm=function(){function e(){}return e=yc([t.NgModule({imports:[Yu],exports:[vm],declarations:[vm]})],e)}(),wm=function(){function e(){this.onFilesPicked=new t.EventEmitter,this.maxAllowedFiles=1/0,this.uploadChoice="uploadBinary"}return e.prototype.ngOnInit=function(){this.fileBinary&&(this.droppedFiles=[this.fileBinary])},e.prototype.onFileDropped=function(e){this.onFilesPicked.emit({droppedFiles:e})},e.prototype.clearInputFromUrl=function(){delete this.fileUrl,this.fileToSave={url:void 0},this.onFilesPicked.emit(this.fileToSave)},e.prototype.clearSelectedFiles=function(){this.dropArea.onDelete(),this.fileToSave={droppedFiles:void 0},this.onFilesPicked.emit(this.fileToSave)},e.prototype.onFileUrlChange=function(e){this.fileToSave={url:e},this.onFilesPicked.emit(this.fileToSave)},yc([t.ViewChild(vm,{static:!0})],e.prototype,"dropArea",void 0),yc([t.Output()],e.prototype,"onFilesPicked",void 0),yc([t.Input()],e.prototype,"maxAllowedFiles",void 0),yc([t.Input()],e.prototype,"uploadChoice",void 0),yc([t.Input()],e.prototype,"fileUrl",void 0),yc([t.Input()],e.prototype,"fileBinary",void 0),e=yc([t.Component({selector:"c8y-file-picker",template:'<div class="form-group">\n <label class="c8y-radio radio-inline">\n <input\n #radio\n type="radio"\n value="uploadBinary"\n name="uploadChoice"\n [(ngModel)]="uploadChoice"\n (click)="clearInputFromUrl()"\n />\n <span></span> <span>{{ \'Upload a binary\' | translate }}</span>\n </label>\n <label class="c8y-radio radio-inline">\n <input\n #radio\n type="radio"\n value="uploadUrl"\n name="uploadChoice"\n [(ngModel)]="uploadChoice"\n (click)="clearSelectedFiles()"\n />\n <span></span> <span>{{ \'Use a URL\' | translate }}</span>\n </label>\n</div>\n\n<div [hidden]="uploadChoice !== \'uploadBinary\'">\n <c8y-form-group class="m-0">\n <c8y-drop-area\n class="drop-area-sm"\n (dropped)="onFileDropped($event)"\n [title]="\'Drop file or click to browse\' | translate"\n [maxAllowedFiles]="maxAllowedFiles"\n [files]="droppedFiles"\n >\n </c8y-drop-area>\n </c8y-form-group>\n</div>\n\n<div [hidden]="uploadChoice !== \'uploadUrl\'">\n <c8y-form-group class="m-0">\n <div class="m-b-4 p-b-8">\n <div class="input-group">\n <span class="input-group-addon">\n <i c8yIcon="globe"></i>\n </span>\n <input\n type="text"\n class="form-control"\n name="fileUrl"\n [(ngModel)]="fileUrl"\n (ngModelChange)="onFileUrlChange($event)"\n placeholder="{{ \'e.g.\' | translate }} http://example.com/binary.zip"\n required\n />\n </div>\n </div>\n </c8y-form-group>\n</div>\n'})],e)}(),Sm=function(){function e(){}return e=yc([t.NgModule({imports:[qd,c.CommonModule,bm,ac.FormsModule,Yu],exports:[wm],declarations:[wm]})],e)}(),Cm=function(){function e(){}return e=yc([t.Component({selector:"c8y-list-group",template:"<ng-content></ng-content>\n\n",host:{class:"c8y-list__group"}})],e)}(),Im=function(){function e(){this.click=new t.EventEmitter}return yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.Output()],e.prototype,"click",void 0),e=yc([t.Component({selector:"c8y-list-item-action, c8y-li-action",template:'<ng-template #template>\n <li>\n <button title="{{ label | translate }}" (click)="click.emit($event)">\n <i [c8yIcon]="icon" *ngIf="icon"></i> \n <span *ngIf="label">{{ label | translate }}</span>\n <ng-content></ng-content>\n </button>\n </li>\n</ng-template>\n'})],e)}(),Pm=function(){function e(){}return yc([t.Input()],e.prototype,"item",void 0),e=yc([t.Component({selector:"c8y-list-item-collapse, c8y-li-collapse",template:"<ng-content></ng-content>\n"})],e)}(),Om=function(){function e(){}return yc([t.Input()],e.prototype,"footer",void 0),e=yc([t.Component({selector:"c8y-list-item-footer, c8y-li-footer",template:'<span *ngIf="footer">{{footer}}</span>\n<ng-content></ng-content>\n'})],e)}(),xm=function(){function e(e){this.element=e,this.active=!1,this.collapsed=!0,this.collapsedChange=new t.EventEmitter,this.showFooter=!1,this.showActions=!1,this.showCollapse=!1,this.dropdownUp=!1,this.pulse$=new a.Subject,this.destroy$=new a.Subject,this.ACTION_ITEM_HEIGHT=40}return e.prototype.ngOnInit=function(){var e=this;this.pulse$.pipe(s.filter((function(e){return!!e})),s.tap((function(){return e.element.nativeElement.classList.remove("c8y-list--pulse")})),s.delay(100),s.tap((function(){return e.element.nativeElement.classList.add("c8y-list--pulse")})),s.takeUntil(this.destroy$)).subscribe()},e.prototype.ngAfterContentChecked=function(){this.actions=this.itemActions.toArray(),this.showFooter=null!=this.itemFooter,this.showActions=this.itemActions.length>0,this.showCollapse=null!=this.itemCollapse},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.prototype.showDropdownUp=function(){var e=this.element.nativeElement.getBoundingClientRect();this.dropdownUp=e.bottom+this.itemActions.length*this.ACTION_ITEM_HEIGHT>window.innerHeight},e.prototype.toggleCollapsed=function(){this.collapsed=!this.collapsed,this.collapsedChange.emit(this.collapsed)},e.prototype.pulse=function(){this.pulse$.next(!0)},e.ctorParameters=function(){return[{type:t.ElementRef}]},yc([t.Input(),t.HostBinding("class.active")],e.prototype,"active",void 0),yc([t.Input()],e.prototype,"collapsed",void 0),yc([t.Output()],e.prototype,"collapsedChange",void 0),yc([t.ContentChild(Om,{static:!1})],e.prototype,"itemFooter",void 0),yc([t.ContentChildren(Im)],e.prototype,"itemActions",void 0),yc([t.ContentChild(Pm,{static:!1})],e.prototype,"itemCollapse",void 0),e=yc([t.Component({selector:"c8y-list-item, c8y-li",template:'<div [ngClass]="{ \'expanded\': !collapsed }">\n <div class="c8y-list__item__block">\n <ng-content select="c8y-list-item-radio, c8y-li-radio"></ng-content>\n <ng-content select="c8y-list-item-checkbox, c8y-li-checkbox"></ng-content>\n\n <ng-content select="c8y-list-item-icon, c8y-li-icon"></ng-content>\n\n <div class="c8y-list__item__body text-truncate-wrap">\n <ng-content select="c8y-list-item-body, c8y-li-body"></ng-content>\n <ng-content></ng-content>\n <div class="c8y-list__item__footer" *ngIf="showFooter">\n <ng-content select="c8y-list-item-footer, c8y-li-footer"></ng-content>\n </div>\n </div>\n\n <div class="c8y-list__item__actions" *ngIf="showCollapse || showActions">\n <button\n class="collapse-btn"\n title="{{ \'Expand\' | translate }}"\n type="button"\n (click)="toggleCollapsed()"\n [attr.aria-expanded]="!collapsed"\n *ngIf="showCollapse"\n >\n <i [c8yIcon]="\'chevron-down\'"></i>\n </button>\n <div\n class="dropdown"\n dropdown\n [dropup]="dropdownUp"\n *ngIf="showActions"\n (onShown)="showDropdownUp()"\n >\n <button\n class="dropdown-toggle c8y-dropdown"\n dropdownToggle\n title="{{ \'Actions\' | translate }}"\n type="button"\n aria-haspopup="true"\n >\n <i [c8yIcon]="\'ellipsis-v\'"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <ng-content select="c8y-list-item-action, c8y-li-action"></ng-content>\n <ng-container *ngFor="let action of actions">\n <ng-container *ngTemplateOutlet="action.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n\n <ng-content select="c8y-list-item-action, c8y-li-action" *ngIf="showActions"></ng-content>\n </div>\n </div>\n\n <div *ngIf="showCollapse" [collapse]="collapsed" [isAnimated]="true">\n <div class="c8y-list__item__collapse--container">\n <ng-content select="c8y-list-item-collapse, c8y-li-collapse"></ng-content>\n </div>\n </div>\n</div>\n',host:{class:"c8y-list__item"}})],e)}(),Em=function(){function e(){}return yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"status",void 0),e=yc([t.Component({selector:"c8y-list-item-icon, c8y-li-icon",template:'<i [c8yIcon]="icon" [ngClass]="status" *ngIf="icon"></i>\n<ng-content></ng-content>',host:{class:"c8y-list__item__icon"}})],e)}(),km=function(){function e(){}return yc([t.Input()],e.prototype,"body",void 0),e=yc([t.Component({selector:"c8y-list-item-body, c8y-li-body",template:'<span *ngIf="body">{{body}}</span>\n<ng-content></ng-content>\n'})],e)}(),Tm=function(){function e(){this.selected=!1,this.onSelect=new t.EventEmitter}return e.prototype.ngOnChanges=function(e){e.selected&&!e.selected.firstChange&&this.onSelect.emit(e.selected.currentValue)},yc([t.Input()],e.prototype,"selected",void 0),yc([t.Output()],e.prototype,"onSelect",void 0),e=yc([t.Component({selector:"c8y-list-item-checkbox, c8y-li-checkbox",template:'<label class="c8y-checkbox">\n <input\n type="checkbox"\n [checked]="selected"\n (change)="onSelect.emit($event.target.checked); (false)"\n />\n <span></span>\n</label>\n<ng-content></ng-content>\n',host:{class:"c8y-list__item__check"}})],e)}(),Am=function(){function e(){this.selected=!1,this.name="list_item_radio",this.disabled=!1,this.onSelect=new t.EventEmitter}return e.prototype.ngOnChanges=function(e){e.selected&&!e.selected.firstChange&&this.onSelect.emit(e.selected.currentValue)},e.prototype.reset=function(){this.radio.nativeElement.checked=!1},yc([t.ViewChild("radio",{static:!0})],e.prototype,"radio",void 0),yc([t.Input()],e.prototype,"selected",void 0),yc([t.Input()],e.prototype,"name",void 0),yc([t.Input()],e.prototype,"disabled",void 0),yc([t.Output()],e.prototype,"onSelect",void 0),e=yc([t.Component({selector:"c8y-list-item-radio, c8y-li-radio",template:'<label class="c8y-radio">\n <input\n #radio\n type="radio"\n [name]="name"\n [checked]="selected"\n (change)="onSelect.emit($event.target.checked); (false)"\n [disabled]="disabled"\n />\n <span></span>\n</label>\n<ng-content></ng-content>\n',host:{class:"c8y-list__item__radio"}})],e)}(),_m=function(){function e(){}return e=yc([t.NgModule({imports:[Yu,ec.CollapseModule.forRoot(),tc.BsDropdownModule],declarations:[Cm,xm,Em,km,Om,Im,Pm,Tm,Am],exports:[Cm,xm,Em,km,Om,Im,Pm,Tm,Am]})],e)}(),Nm=function(){function e(){}return Object.defineProperty(e.prototype,"active",{get:function(){return!!this.service&&this.service.active},enumerable:!0,configurable:!0}),e.prototype.toggle=function(){this.service&&(this.active?this.service.stop():this.service.start())},yc([t.Input()],e.prototype,"service",void 0),e=yc([t.Component({selector:"c8y-realtime-btn",template:'<button\n type="button"\n class="btn btn-link c8y-realtime"\n title="{{ \'Toggle realtime\' | translate }}"\n (click)="toggle()"\n>\n <span class="c8y-pulse" [ngClass]="{ active: active, inactive: !active }"></span>\n <span translate>Realtime</span>\n</button>\n'})],e)}(),Dm=function(){function e(){}return e=yc([t.NgModule({imports:[Yu],declarations:[Nm],exports:[Nm]})],e)}();(jm=e.ModalSelectionMode||(e.ModalSelectionMode={})).SINGLE="single",jm.MULTI="multi";var Mm,Lm=function(){function n(n){var o=this;this.bsModalRef=n,this.subTitle="Select from the list of items matching the device type",this.mode=e.ModalSelectionMode.MULTI,this.disableSelected=!0,this.showFilter=!0,this.areMoreEntries=!1,this.result=new t.EventEmitter,this.search=new t.EventEmitter,this.selected=!1,this.filterTerm="",this.listItems=[],this.debouncer=new a.Subject,this._labels={ok:"Confirm",cancel:"Cancel"},this.debouncer.pipe(s.debounceTime(500)).subscribe((function(e){o.search.emit(e)}))}return Object.defineProperty(n.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e||{},n=t.ok,a=void 0===n?this.labels.ok:n,s=t.cancel,o=void 0===s?this.labels.cancel:s;this._labels={ok:a,cancel:o}},enumerable:!0,configurable:!0}),n.prototype.ngOnChanges=function(e){return jc(this,void 0,void 0,(function(){var t,n,a=this;return bc(this,(function(s){switch(s.label){case 0:return e.items&&e.items.currentValue?(t=e.items.currentValue.map((function(e){return jc(a,void 0,void 0,(function(){var t,n;return bc(this,(function(a){switch(a.label){case 0:return t=e,[4,e.options];case 1:return t.options=a.sent(),(n=e.options.find((function(e){return e.selected})))&&(e.selectedId=n.obj.id,this.disableSelected&&e.options.map((function(e){return o.assign(e,{disabled:!0})}))),[2,e]}}))}))})),n=this,[4,Promise.all(t)]):[3,2];case 1:n.listItems=s.sent(),s.label=2;case 2:return[2]}}))}))},n.prototype.updatePipe=function(e){this.debouncer.next(e),this.filterTerm=e},n.prototype.updateChoice=function(e){var t=e.item,n=e.id;"single"===this.mode&&this.listItems.map((function(e){return e.selectedId=void 0})),t.selectedId=n,this.selected=!0},n.prototype.dismiss=function(){this.bsModalRef.hide()},n.prototype.select=function(){var e=this.getOutput(),t="single"===this.mode?e[0]:e;this.result.emit(t),this.bsModalRef.hide()},n.prototype.ngOnDestroy=function(){this.debouncer.complete(),this.result.complete(),this.search.complete()},n.prototype.getOutput=function(){return this.listItems.filter((function(e){return e.selectedId})).map((function(e){return e.options.find((function(t){return e.selectedId===t.obj.id}))})).map((function(e){return e.obj}))},n.ctorParameters=function(){return[{type:dc.BsModalRef}]},yc([t.Input()],n.prototype,"icon",void 0),yc([t.Input()],n.prototype,"title",void 0),yc([t.Input()],n.prototype,"subTitle",void 0),yc([t.Input()],n.prototype,"items",void 0),yc([t.Input()],n.prototype,"mode",void 0),yc([t.Input()],n.prototype,"disableSelected",void 0),yc([t.Input()],n.prototype,"showFilter",void 0),yc([t.Input()],n.prototype,"areMoreEntries",void 0),yc([t.Input()],n.prototype,"labels",null),yc([t.Output()],n.prototype,"result",void 0),yc([t.Output()],n.prototype,"search",void 0),n=yc([t.Component({selector:"c8y-select-modal",template:'<div class="viewport-modal">\n <div class="modal-header dialog-header">\n <span c8yIcon="{{ icon }}"></span>\n <h4 class="text-uppercase">\n {{ title | translate }}\n </h4>\n </div>\n <div class="p-16 text-center separator-bottom">\n <p class="m-b-8">{{ subTitle | translate }}</p>\n <c8y-filter *ngIf="showFilter" [icon]="\'search\'" (onSearch)="updatePipe($event)"></c8y-filter>\n </div>\n <div class="modal-inner-scroll">\n <div class="p-l-16 p-r-16">\n <div class="panel m-t-8 m-b-8" *ngIf="!items || items.length === 0">\n <div class="c8y-empty-state text-left">\n <h1 c8yIcon="{{ icon }} " class="c8y-icon-duocolor"></h1>\n <p translate>No items to display.</p>\n </div>\n </div>\n </div>\n <c8y-list-group>\n <c8y-li *ngFor="let item of listItems | selectModalFilterPipe: filterTerm">\n <c8y-li-icon>\n <i c8yIcon="{{ icon }}"></i>\n </c8y-li-icon>\n\n <c8y-li-body class="content-flex-30">\n <div class="col-9">\n <div *ngFor="let bodyPart of item.body" [ngClass]="bodyPart.class">\n <c8y-highlight\n [title]="bodyPart.value"\n [pattern]="filterTerm"\n [text]="bodyPart.value"\n ></c8y-highlight>\n </div>\n </div>\n\n <div class="col-3 text-right" *ngIf="item.additionalInformation">\n <div [ngClass]="item.additionalInformation.class">\n {{ item.additionalInformation.value }}\n </div>\n </div>\n </c8y-li-body>\n\n <c8y-li-collapse>\n <c8y-list-group>\n <c8y-li *ngFor="let option of item.options">\n <c8y-li-radio\n [name]="mode === \'single\' ? \'single\' : item.groupId"\n [selected]="option.selected"\n (onSelect)="updateChoice({ item: item, id: option.obj.id })"\n [disabled]="option.disabled"\n >\n </c8y-li-radio>\n <c8y-li-body class="content-flex-50">\n <div\n *ngFor="let optionPart of option.body; let i = index"\n [ngClass]="optionPart.class"\n >\n <c8y-highlight [pattern]="filterTerm" [text]="optionPart.value"></c8y-highlight>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-list-group>\n </c8y-li-collapse>\n </c8y-li>\n <div *ngIf="areMoreEntries">\n <div class="alert alert-info m-t-16 m-r-8 m-l-8" translate>\n Some entries might not be shown. Try narrowing search criteria.\n </div>\n </div>\n </c8y-list-group>\n </div>\n\n <div class="modal-footer">\n <button\n title="{{ labels.cancel | translate }}"\n *ngIf="labels.cancel"\n class="btn btn-default"\n (click)="dismiss()"\n >\n {{ labels.cancel | translate }}\n </button>\n <button\n title="{{ labels.ok | translate }}"\n class="btn btn-primary"\n (click)="select()"\n [disabled]="!selected"\n >\n {{ labels.ok | translate }}\n </button>\n </div>\n</div>\n'})],n)}(),Rm=function(){function e(){}return e.prototype.transform=function(e,t){var n=this;return 0===t.trim().length?e:e.filter((function(e){return n.extractValues(e).filter((function(e){return n.filterContainString(e,t)})).length>0}))},e.prototype.filterContainString=function(e,t){var n=t.toLowerCase().trim();return e&&e.toLowerCase().indexOf(n)>-1},e.prototype.extractValues=function(e){var t=this,n=[];return e.value&&n.push(e.value),Object.keys(e).forEach((function(a){Array.isArray(e[a])&&e[a].forEach((function(e){return n.concat(t.extractValues(e))})),e[a]instanceof Object&&(n=n.concat(t.extractValues(e[a])))})),n},e=yc([t.Pipe({name:"selectModalFilterPipe"})],e)}(),qm=function(){function e(){}return e=yc([t.NgModule({imports:[tc.BsDropdownModule.forRoot(),Yu,_m,ep,qd],exports:[Lm,Rm],declarations:[Lm,Rm]})],e)}(),$m=function(){function e(){this.placeholder="Select item",this.applyLabel="Apply",this.onChange=new t.EventEmitter,this.textFilter="",this.labelText="",this.isOpen=!1,this.filteredItems=[],this.searchFilter=null,this.sizeToShowFilter=5,this.labelsForSelectAll={all:"All",allFiltered:"All filtered"},this.showAllLabel=!1,this.itemsSelected=new Set,this.stopClicks=!1}return e.prototype.preventClick=function(e){this.stopClicks&&e.stopPropagation(),this.stopClicks=this.isOpen},e.prototype.isOpenChange=function(e){this.isOpen=e,e?(this.updateSelected(),this.searchFilter=null):this.stopClicks=!1},e.prototype.outterSelected=function(e){var t=this.selected,n=function(){return!1};return"function"==typeof t?n=t:Array.isArray(t)&&(n=function(e){return t.indexOf(e)>-1}),n(e)},e.prototype.isSelected=function(e){return this.itemsSelected.has(e)},e.prototype.isAllItemsSelected=function(){return this.itemsSelected.size===this.items.length},e.prototype.isAllFilteredSelected=function(){return this.itemsSelected.size===this.filteredItems.length},e.prototype.applyChanges=function(){var e=Array.from(this.itemsSelected.values());this.onChange.emit(e),this.dropdown.hide()},e.prototype.selectAll=function(e){var t=this;this.filteredItems.forEach((function(n){return t.onChangeItem(e,n)}))},e.prototype.onChangeItem=function(e,t){e?this.itemsSelected.add(t):this.itemsSelected.delete(t)},e.prototype.updateFiltered=function(e){if(e){var t=new RegExp(e,"i");this.filteredItems=this.items.filter((function(e){var n=e.name;return t.test(n)}))}else this.filteredItems=this.items},e.prototype.getSelectAllToggleStatus=function(){var e=this.getLabel(),t=this.isAllSelected();return{label:e,checked:t,indeterminate:!t&&this.itemsSelected.size>0}},e.prototype.ngOnChanges=function(e){this.isOpen||(e.items||e.selected||e.applyLabel)&&(this.updateSelected(),this.updateLabel(),this.showAllLabel=this.isAllItemsSelected())},e.prototype.updateLabel=function(){var e=this,t=this.items.filter((function(t){return e.outterSelected(t)}));"string"==typeof this.selectedLabel?this.labelText=this.selectedLabel:"function"==typeof this.selectedLabel?this.labelText=this.selectedLabel(t):this.labelText=t.map((function(e){return e.name})).join(", ")},e.prototype.updateSelected=function(){var e=this,t=this.itemsSelected,n=this.items;t.clear(),n.forEach((function(n){e.outterSelected(n)&&t.add(n)})),this.filteredItems=n},e.prototype.isAllSelected=function(){return this.getLabel()===this.labelsForSelectAll.allFiltered?this.isAllFilteredSelected():this.isAllItemsSelected()},e.prototype.getLabel=function(){return this.searchFilter?this.labelsForSelectAll.allFiltered:this.labelsForSelectAll.all},yc([t.Input()],e.prototype,"placeholder",void 0),yc([t.Input()],e.prototype,"selectedLabel",void 0),yc([t.Input()],e.prototype,"applyLabel",void 0),yc([t.Input()],e.prototype,"items",void 0),yc([t.Input()],e.prototype,"selected",void 0),yc([t.Output()],e.prototype,"onChange",void 0),yc([t.ViewChild(tc.BsDropdownDirective,{static:!1})],e.prototype,"dropdown",void 0),yc([t.HostListener("click",["$event"])],e.prototype,"preventClick",null),e=yc([t.Component({selector:"c8y-select",template:'<div\n class="c8y-child-assets-selector dropdown fit-h"\n (isOpenChange)="isOpenChange($event)"\n dropdown\n #dropdown\n>\n <button\n type="button"\n class="btn dropdown-toggle c8y-dropdown"\n title="{{ labelText || placeholder | translate }}"\n dropdownToggle\n >\n <span class="text-truncate" *ngIf="labelText">\n <ng-container *ngIf="showAllLabel">{{ \'All\' | translate }}</ng-container>\n <ng-container *ngIf="!showAllLabel">{{ labelText | translate }}</ng-container>\n </span>\n <span class="text-truncate text-muted" *ngIf="!labelText">{{ placeholder | translate }}</span>\n </button>\n\n <ul class="dropdown-menu multiselect-container" *dropdownMenu>\n <li *ngIf="items.length > sizeToShowFilter" class="multiselect-item">\n <div class="input-group input-group-search">\n <input\n type="search"\n class="form-control"\n placeholder="{{ \'Filter\' | translate }}…"\n (keyup)="updateFiltered($event.target.value)"\n [(ngModel)]="searchFilter"\n />\n <span class="input-group-addon">\n <i class="fa fa-search" *ngIf="!textFilter"></i>\n <i class="fa fa-times text-muted" *ngIf="textFilter" (click)="textFilter = \'\'"></i>\n </span>\n </div>\n </li>\n\n <li class="multiselect-item">\n <label\n [title]="getSelectAllToggleStatus().label "\n class="c8y-checkbox input-sm"\n ng-click="vm.toggleSelectAll(); $event.preventDefault()"\n >\n <input\n type="checkbox"\n [checked]="getSelectAllToggleStatus().checked"\n (change)="selectAll($event.target.checked)"\n [indeterminate]="getSelectAllToggleStatus().indeterminate"\n style="margin-top:0;"\n /><span></span> <span span class="label-text ">{{ getSelectAllToggleStatus().label }}</span>\n </label>\n </li>\n\n <li class="multiselect-item-container">\n <ul class="list-unstyled">\n <li class="multiselect-item" *ngFor="let item of filteredItems">\n <label class="c8y-checkbox input-sm text-truncate">\n <input\n type="checkbox"\n [checked]="isSelected(item)"\n (change)="onChangeItem($event.target.checked, item)"\n style="margin-top:0"\n />\n <span></span>\n <span class="label-text " title="{{ item.name | translate }}">{{\n item.name | translate\n }}</span>\n </label>\n </li>\n </ul>\n </li>\n <li class="divider"></li>\n <li>\n <button\n title="{{ applyLabel | translate }}"\n class="btn btn-primary btn-block"\n (click)="applyChanges()"\n >\n {{ applyLabel | translate }}\n </button>\n </li>\n </ul>\n</div>\n'})],e)}(),Fm=function(){function e(){this.required=!1,this.disabled=!1,this.allowFreeEntries=!0,this.displayProperty="name",this.name=this.displayProperty,this.selected={id:null},this.selectedChange=new t.EventEmitter,this.onSearch=new t.EventEmitter,this.KEYCODE_UP=38,this.KEYCODE_DOWN=40,this.KEYCODE_TAB=9,this.KEYCODE_ENTER=13,this.KEYCODE_ESC=27}var n;return n=e,e.prototype.writeValue=function(e){this.selected=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.doBlur=function(){this.onTouched&&this.onTouched()},e.prototype.getDisplayProperty=function(){return o.get(this.selected,this.displayProperty,"")},e.prototype.onShown=function(){this.searchControl.nativeElement.focus()},e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},e.prototype.ngAfterViewInit=function(){var e=this;this.subscription=a.fromEvent(this.searchControl.nativeElement,"keydown").pipe(s.map((function(t){return e.handleKeyboard(t)})),s.filter((function(e){return e})),s.debounceTime(200),s.map((function(e){return e.target.value})),s.distinctUntilChanged()).subscribe((function(t){e.selected={id:null},o.set(e.selected,e.displayProperty,t||""),e.onChange(e.selected),e.selectedChange.emit(e.selected),e.onSearch.emit(t)}))},e.prototype.handleKeyboard=function(e){var t=e.keyCode;if(![this.KEYCODE_ENTER,this.KEYCODE_DOWN,this.KEYCODE_TAB,this.KEYCODE_UP].includes(t))return t===this.KEYCODE_ESC?(e.stopPropagation(),this.dropdown.hide(),void this.searchControl.nativeElement.blur()):(this.dropdown.show(),e);var n=this.list.toArray(),a=o.findIndex(n,(function(e){return e.active}));if(t===this.KEYCODE_ENTER||t===this.KEYCODE_TAB)a>-1&&(e.preventDefault(),n[a].element.nativeElement.click()),this.dropdown.hide(),this.searchControl.nativeElement.blur();else{this.dropdown.show();var s=t===this.KEYCODE_DOWN?1:-1;a>-1&&(n[a].active=!1),n[a+s]&&(n[a+s].active=!0)}},e.prototype.validate=function(e){return this.required&&!this.getDisplayProperty()?{required:!0}:!this.allowFreeEntries&&this.selected&&null===this.selected.id?{notExisting:!0}:null},yc([t.ViewChild("searchControl",{static:!1})],e.prototype,"searchControl",void 0),yc([t.ViewChild("dropdown",{static:!1})],e.prototype,"dropdown",void 0),yc([t.ContentChildren(xm)],e.prototype,"list",void 0),yc([t.Input()],e.prototype,"required",void 0),yc([t.Input()],e.prototype,"disabled",void 0),yc([t.Input()],e.prototype,"allowFreeEntries",void 0),yc([t.Input()],e.prototype,"placeholder",void 0),yc([t.Input()],e.prototype,"displayProperty",void 0),yc([t.Input()],e.prototype,"name",void 0),yc([t.Input()],e.prototype,"selected",void 0),yc([t.Output()],e.prototype,"selectedChange",void 0),yc([t.Output()],e.prototype,"onSearch",void 0),e=n=yc([t.Component({selector:"c8y-typeahead",template:'<div\n class="c8y-child-assets-selector dropdown"\n dropdown\n #dropdown="bs-dropdown"\n [autoClose]="true"\n (onShown)="onShown()"\n [isDisabled]="disabled"\n>\n <div class="input-group input-group-dropdown" dropdownToggle>\n <input\n #searchControl\n type="text"\n class="form-control text-truncate p-r-24"\n [required]="required"\n [ngModel]="selected ? getDisplayProperty() : \'\'"\n [placeholder]="placeholder | translate"\n (blur)="doBlur()"\n [name]="name"\n [disabled]="disabled"\n title="{{ placeholder | translate }}"\n />\n\n <span\n class="label label-info"\n style="position: absolute; right: 40px; top: 10px; z-index: 10;"\n translate\n *ngIf="\n selected\n ? selected.id === null && getDisplayProperty()?.length > 0 && allowFreeEntries\n : false\n "\n >New</span\n >\n\n <span class="input-group-btn">\n <button type="button" class="btn btn-clean" [disabled]="disabled">\n <i class="dropdown-caret"></i>\n </button>\n </span>\n </div>\n\n <c8y-list-group class="dropdown-menu" *dropdownMenu>\n <ng-content select="c8y-li, c8y-list-item, button, a"></ng-content>\n </c8y-list-group>\n</div>\n',providers:[{provide:ac.NG_VALUE_ACCESSOR,multi:!0,useExisting:t.forwardRef((function(){return n}))},{provide:ac.NG_VALIDATORS,useExisting:t.forwardRef((function(){return n})),multi:!0}]})],e)}(),Um=function(){function e(){}return e=yc([t.NgModule({imports:[tc.BsDropdownModule.forRoot(),Yu,_m,qd],exports:[$m,Fm],declarations:[$m,Fm]})],e)}(),Bm=function(){function e(e){this.templateRef=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},yc([t.Input("c8yStepperIcon")],e.prototype,"name",void 0),e=yc([t.Directive({selector:"ng-template[c8yStepperIcon]"})],e)}(),zm=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.disableDefaultIcons={edit:!0,done:!0},n.onStepChange=new t.EventEmitter,n._iconOverrides={},n._stepIndex=new a.Subject,n}var s;return hc(n,e),s=n,n.prototype.ngAfterContentInit=function(){var e=this;this._icons.forEach((function(t){var n=t.name,a=t.templateRef;return e._iconOverrides[n]=a})),this._stepIndexSubscription=this._stepIndex.subscribe((function(t){return e.onStepChange.emit(t)}))},n.prototype.ngOnDestroy=function(){this._stepIndexSubscription&&!this._stepIndexSubscription.closed&&this._stepIndexSubscription.unsubscribe()},n.prototype.getIndicatorType=function(e,t){var n=t;switch(this._getIndicatorType(e,t)){case pc.STEP_STATE.EDIT:this.disableDefaultIcons.edit||(n=pc.STEP_STATE.EDIT);break;case pc.STEP_STATE.DONE:n=this.disableDefaultIcons.done?"_done":pc.STEP_STATE.DONE}return n},n.prototype.setIndex=function(e){this._stepIndex.next(e)},yc([t.Input()],n.prototype,"disableDefaultIcons",void 0),yc([t.Input()],n.prototype,"customClasses",void 0),yc([t.Output()],n.prototype,"onStepChange",void 0),yc([t.ContentChildren(Bm,{descendants:!0})],n.prototype,"_icons",void 0),n=s=yc([t.Component({selector:"c8y-stepper",template:'<ul class="c8y-stepper" [ngClass]="customClasses">\n <li *ngFor="let step of steps; let i = index">\n <c8y-stepper-progress\n [iconOverrides]="_iconOverrides"\n [state]="getIndicatorType(i, step.state)"\n [index]="i"\n [selected]="selectedIndex === i"\n (onStepClicked)="setIndex($event)"\n title="{{ step.label | translate }}"\n [ngClass]="{\'active\': selectedIndex === i}"\n >\n </c8y-stepper-progress>\n <div class="c8y-step__label" title="{{ step.label | translate }}">\n {{ step.label | translate }}\n </div>\n </li>\n</ul>\n<ng-container [ngTemplateOutlet]="selected.content"></ng-container>\n',providers:[{provide:pc.CdkStepper,useExisting:s}]})],n)}(pc.CdkStepper),Gm=function(){function e(){this.onStepClicked=new t.EventEmitter}return e.prototype.stepSelected=function(){this.onStepClicked.emit(this.index)},yc([t.Input()],e.prototype,"iconOverrides",void 0),yc([t.Input()],e.prototype,"index",void 0),yc([t.Input()],e.prototype,"selected",void 0),yc([t.Input()],e.prototype,"state",void 0),yc([t.Output()],e.prototype,"onStepClicked",void 0),e=yc([t.Component({selector:"c8y-stepper-progress",template:'<button\n type="button"\n class="c8y-step"\n [ngClass]="{ active: selected, \'step-done\': state === \'done\' || state === \'_done\' }"\n [ngSwitch]="!!(iconOverrides && iconOverrides[state])"\n (click)="stepSelected()"\n>\n <ng-container *ngSwitchCase="true" [ngTemplateOutlet]="iconOverrides[state]"></ng-container>\n <ng-container *ngSwitchDefault [ngSwitch]="state">\n <span *ngSwitchCase="\'edit\'">\n <span [c8yIcon]="\'edit\'"></span>\n </span>\n <span *ngSwitchCase="\'done\'">\n <span [c8yIcon]="\'check\'"></span>\n </span>\n <span *ngSwitchDefault> {{ index + 1 }} </span>\n </ng-container>\n</button>\n'})],e)}(),Hm=function(){function e(e,n){this.stepper=e,this.step=n,this.pending=!1,this.disabled=!1,this.onCancel=new t.EventEmitter,this.onNext=new t.EventEmitter,this.onBack=new t.EventEmitter,this.onCustom=new t.EventEmitter,this.showBtns={cancel:!1,back:!1,next:!1,custom:!1}}return e.prototype.ngAfterContentInit=function(){var e=this;this.showBtns.cancel=this.onCancel.observers.length>0,this.showBtns.custom=this.onCustom.observers.length>0,this.stepper&&this.stepper.steps&&this.step&&(this.showBtns.back=this.stepper.steps.first!==this.step,this.showBtns.next=this.stepper.steps.last!==this.step),this.step&&this.step.stepControl&&(this.disabled=this.step.stepControl.invalid,this.statusChangeSubscription=this.step.stepControl.statusChanges.subscribe((function(t){e.disabled=e.step.stepControl.invalid})))},e.prototype.ngOnChanges=function(e){e&&e.pending&&(this.disabled=e.pending.currentValue)},e.prototype.ngOnDestroy=function(){this.statusChangeSubscription&&!this.statusChangeSubscription.closed&&this.statusChangeSubscription.unsubscribe()},e.prototype.cancel=function(){this.onCancel.emit()},e.prototype.next=function(){this.onNext.observers.length>0?this.onNext.emit({stepper:this.stepper,step:this.step}):this.stepper.next()},e.prototype.back=function(){this.stepper.selected.completed=!1,this.onBack.observers.length>0?this.onBack.emit({stepper:this.stepper,step:this.step}):this.stepper.previous()},e.prototype.custom=function(){this.onCustom.emit()},e.ctorParameters=function(){return[{type:zm,decorators:[{type:t.Host}]},{type:pc.CdkStep,decorators:[{type:t.Host}]}]},yc([t.Input()],e.prototype,"labels",void 0),yc([t.Input()],e.prototype,"pending",void 0),yc([t.Input()],e.prototype,"disabled",void 0),yc([t.Output()],e.prototype,"onCancel",void 0),yc([t.Output()],e.prototype,"onNext",void 0),yc([t.Output()],e.prototype,"onBack",void 0),yc([t.Output()],e.prototype,"onCustom",void 0),e=yc([t.Component({selector:"c8y-stepper-buttons",template:'<div class="text-center">\n <button *ngIf="showBtns.cancel" (click)="cancel()" type="button" class="btn btn-default">\n <span *ngIf="labels?.cancel; else cancelLabel">{{ labels?.cancel | translate }}</span>\n <ng-template #cancelLabel>\n <span>{{ \'Cancel\' | translate }}</span>\n </ng-template>\n </button>\n <button\n *ngIf="showBtns.back"\n type="button"\n (click)="back()"\n class="btn btn-default"\n [disabled]="pending"\n >\n <span *ngIf="labels?.back; else backLabel">{{ labels?.back | translate }}</span>\n <ng-template #backLabel>\n <span>{{ \'Back\' | translate }}</span>\n </ng-template>\n </button>\n <button\n *ngIf="showBtns.custom"\n (click)="custom()"\n type="button"\n class="btn"\n [ngClass]="{\n \'btn-default\': showBtns.next,\n \'btn-primary\': !showBtns.next,\n \'btn-pending\': pending\n }"\n [disabled]="pending || disabled"\n >\n <span *ngIf="labels?.custom; else customLabel">{{ labels?.custom | translate }}</span>\n <ng-template #customLabel>\n <span>{{ \'Complete\' | translate }}</span>\n </ng-template>\n </button>\n <button\n (click)="next()"\n *ngIf="showBtns.next"\n type="button"\n class="btn btn-primary"\n [ngClass]="{ \'btn-pending\': pending }"\n [disabled]="disabled"\n >\n <span *ngIf="labels?.next; else nextLabel">{{ labels?.next | translate }}</span>\n <ng-template #nextLabel>\n <span>{{ \'Next\' | translate }}</span>\n </ng-template>\n </button>\n</div>\n'}),vc(0,t.Host()),vc(1,t.Host())],e)}(),Vm={displayDefaultIndicatorType:!1},Km=function(){function e(){}return e=yc([t.NgModule({imports:[Yu,pc.CdkStepperModule,u.TooltipModule],declarations:[zm,Bm,Gm,Hm],exports:[zm,pc.CdkStep,Bm,Hm],providers:[{provide:pc.STEPPER_GLOBAL_OPTIONS,useValue:Vm}]})],e)}(),Wm=function(){function e(){this.onDateSelected=new t.EventEmitter}return e.prototype.ngOnInit=function(){this.fgDatePicker=new ac.FormGroup({dateFrom:new ac.FormControl,dateTo:new ac.FormControl})},e.prototype.filter=function(){this.onDateSelected.emit(this.fgDatePicker.value)},e.prototype.clearFilter=function(){this.fgDatePicker.setValue({dateFrom:null,dateTo:null}),this.onDateSelected.emit(null)},yc([t.Output()],e.prototype,"onDateSelected",void 0),e=yc([t.Component({selector:"c8y-date-picker",template:'<form [formGroup]="fgDatePicker">\n <c8y-form-group class="datepicker">\n <input\n formControlName="dateFrom"\n class="form-control"\n placeholder="{{ \'Date from\' | translate }}"\n bsDatepicker\n [bsConfig]="{ customTodayClass: \'today\' }"\n />\n </c8y-form-group>\n <c8y-form-group class="datepicker">\n <input\n formControlName="dateTo"\n class="form-control"\n placeholder="{{ \'Date to\' | translate }}"\n bsDatepicker\n [bsConfig]="{ customTodayClass: \'today\' }"\n />\n </c8y-form-group>\n <button\n *ngIf="fgDatePicker.get(\'dateFrom\').value || fgDatePicker.get(\'dateTo\').value"\n title="{{ \'Apply\' | translate }}"\n type="submit"\n class="btn btn-link"\n (click)="filter()"\n >\n <i c8y-icon="filter"></i>\n {{ \'Apply`filters`\' | translate }}\n </button>\n <button\n *ngIf="fgDatePicker.get(\'dateFrom\').value || fgDatePicker.get(\'dateTo\').value"\n title="{{ \'Clear\' | translate }}"\n type="button"\n class="btn btn-link"\n (click)="clearFilter()"\n >\n <i c8y-icon="times"></i>\n {{ \'Clear`filters`\' | translate }}\n </button>\n</form>\n'})],e)}(),Ym=function(){function e(){}return e=yc([t.NgModule({imports:[qd,c.CommonModule,ac.FormsModule,ac.ReactiveFormsModule,tc.BsDropdownModule.forRoot(),mc.BsDatepickerModule.forRoot(),Yu],exports:[Wm],declarations:[Wm]})],e)}(),Zm=function(){function e(){}var n;return n=e,e.forRoot=function(){return{ngModule:n,providers:Sc(Yu.providers(),Ap.providers())}},e=n=yc([t.NgModule({exports:[Xu,td,rd,id,Lp,Kd,Yu,dm,bm,Cp,Ap,Sd,wp,zd,ep,Um,Dp,ip,qd,ym,Zp,Km,Up,Jp,_m,qm,Sm,Dm,Ym]})],e)}(),Jm=function(){function e(e,t){this.injector=e,this.router=t}return Object.defineProperty(e.prototype,"routerStateSnapshot",{get:function(){return this.router.routerState.snapshot},enumerable:!0,configurable:!0}),e.prototype.resolve=function(e){var t=this,n=this.router.config.find((function(t){return e.routeConfig.path===t.path})).children;return a.from(n||[]).pipe(s.mergeMap((function(n){return a.from(t.getGuards(n)).pipe(s.map((function(n){return n.canActivate(e,t.routerStateSnapshot)})),s.mergeMap((function(e){return a.isObservable(e)?e:e&&"function"==typeof e.then?a.from(e):a.of(e)})),s.tap((function(e){Array.isArray(e)&&(n.tabs=e)})),s.every((function(e){return!!e})),s.filter((function(e){return e})),s.mergeMap((function(){return Array.isArray(n.tabs)?a.from(n.tabs):a.of(n)})),s.map((function(t){return t.label?{label:t.label,icon:t.icon,path:e.url.join("/")+"/"+t.path,priority:t.priority}:void 0})))})),s.filter((function(e){return!!e})),s.toArray())},e.prototype.getGuards=function(e){var t=this,n=(e.canActivate||[]).map((function(e){return t.injector.get(e)}));return e.data&&e.data.showIf&&n.push({canActivate:e.data.showIf}),n},e.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},e=yc([t.Injectable()],e)}();(Mm=e.ViewContext||(e.ViewContext={})).Device="device/:id",Mm.Group="group/:id",Mm.User="users/:id",Mm.Application="applications/:id",Mm.SubscribedApplications="subscribedApplications/:id",Mm.Tenant="tenants/:id";var Xm=function(){function t(){}return t.contextToService=function(e){return t.services.get(e)},t.services=new Map([[e.ViewContext.Device,l.InventoryService],[e.ViewContext.Group,l.InventoryService],[e.ViewContext.User,l.UserService],[e.ViewContext.Application,l.ApplicationService],[e.ViewContext.SubscribedApplications,l.ApplicationService],[e.ViewContext.Tenant,l.TenantService]]),t}(),Qm=function(){function e(e,t,n,s,o){this.tabsResolver=e,this.tabsService=t,this.router=n,this.apiService=s,this.injector=o,this.lastAddedTabs=[],this.refreshTrigger=new a.Subject}return e.prototype.init=function(e){var t=this;this.routerSubscription=this.router.events.pipe(s.filter((function(e){return e instanceof n.NavigationEnd}))).subscribe((function(){return t.redirectToFirstTab()})),this.dataSubscription=e.data.pipe(s.merge(this.updatedContext(e),this.refreshTrigger),s.switchMap((function(){return t.tabsResolver.resolve(e.snapshot)}))).subscribe((function(e){return t.updateTabs(e)}))},e.prototype.destroy=function(){var e=this;this.dataSubscription.unsubscribe(),this.routerSubscription.unsubscribe(),this.lastAddedTabs.forEach((function(t){return e.tabsService.remove(t)}))},e.prototype.refreshContext=function(){this.refreshTrigger.next()},e.prototype.updatedContext=function(e){var t=e.snapshot.data,n=Xm.contextToService(t.context);if(n){var s=this.injector.get(n).getDetailUrl(t.contextData).replace(/\d+/g,"?\\d*"),o=new RegExp(s,"i"),r=new RegExp(s+"/child","i");return this.apiService.hookResponse((function(e){var t=e.url,n=e.method,a=o.test(t)&&["POST","PUT"].includes(n),s=r.test(t)&&["POST","DELETE"].includes(n);return a||s}))}return a.NEVER},e.prototype.updateTabs=function(e){var t=this;void 0===e&&(e=[]),this.lastAddedTabs.forEach((function(e){return t.tabsService.remove(e)})),this.lastAddedTabs=e,e.forEach((function(e){return t.tabsService.add(e)})),this.redirectToFirstTab()},e.prototype.redirectToFirstTab=function(){var e=this;this.needsRedirect()&&this.tabsService.firstTab$.subscribe((function(t){t&&e.router.navigateByUrl(t.path,{replaceUrl:!0})}))},e.prototype.needsRedirect=function(){return 2===this.router.parseUrl(this.router.url).root.children[n.PRIMARY_OUTLET].segments.length},e.ctorParameters=function(){return[{type:Jm},{type:Vc},{type:n.Router},{type:r.ApiService},{type:t.Injector}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(Jm),t.ɵɵinject(Vc),t.ɵɵinject(n.Router),t.ɵɵinject(r.ApiService),t.ɵɵinject(t.INJECTOR))},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"})],e)}(),eg=new t.InjectionToken("RouteFactory"),tg=function(){function e(e,t,n,a){var s=this;this.router=t,this.tabsService=n,this.contextRouteService=a,Ic(e).subscribe((function(e){s.addRoute(e)}))}return e.prototype.refresh=function(){this.contextRouteService.refreshContext()},e.prototype.addRoute=function(e){this.addRoutes(Array.isArray(e)?e:[e])},e.prototype.addRoutes=function(e){var t=this,n=this.router.config.find((function(e){return"**"===e.path}));this.router.resetConfig(Sc(this.router.config.filter((function(e){return"**"!==e.path})),e.map((function(e){return t.convertRoute(t.router.config,e)})),[n]).filter(Boolean))},e.prototype.convertRoute=function(e,t){if(!t.context)return t;e.forEach((function(e){e.data&&e.data.context===t.context&&(e.children=Sc([t],e.children||[]))}))},e.ctorParameters=function(){return[{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[eg]}]},{type:n.Router},{type:Vc},{type:Qm}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(eg,8),t.ɵɵinject(n.Router),t.ɵɵinject(Vc),t.ɵɵinject(Qm))},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"}),vc(0,t.Optional()),vc(0,t.Inject(eg))],e)}(),ng=function(){function e(e,t){this.route=e,this.contextRouteService=t}return e.prototype.ngOnInit=function(){this.contextRouteService.init(this.route)},e.prototype.ngOnDestroy=function(){this.contextRouteService.destroy()},e.prototype.refreshTabs=function(){this.contextRouteService.refreshContext()},e.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:Qm}]},e=yc([t.Component({selector:"c8y-context-route",template:"<router-outlet></router-outlet>\n"})],e)}(),ag=function(){function e(e){this.client=e,this.callsSubject=new a.Subject,this.calls=this.callsSubject.asObservable(),this.hookIntoClientFetch()}return e.prototype.hookResponse=function(e){return this.callsSubject.pipe(s.filter((function(e){return"finish"===e.phase})),s.filter(e))},e.prototype.hookRequest=function(e){return this.callsSubject.pipe(s.filter((function(e){return"start"===e.phase})),s.filter(e))},e.prototype.onFinish=function(e){return jc(this,void 0,void 0,(function(){return bc(this,(function(t){return this.callsSubject.next(fc({phase:"finish"},e)),[2]}))}))},e.prototype.onStart=function(e){this.callsSubject.next(fc({phase:"start"},e))},e.prototype.resolveData=function(e){return jc(this,void 0,void 0,(function(){var t,n,a;return bc(this,(function(s){return t=e.response,n=e.method,"data"in t?[2,Promise.resolve({data:t.data,method:n})]:(a=function(e){return{data:e,method:n}},[2,t.clone().json().then(a,a)])}))}))},e.prototype.hookIntoClientFetch=function(){var e=this,t=this.client.fetch.bind(this.client);this.client.fetch=function(n,a){return void 0===a&&(a={method:"GET"}),jc(e,void 0,void 0,(function(){var e,s,o=this;return bc(this,(function(r){return e=a.method,this.onStart({options:a,method:e,url:n}),s=t(n,a),"function"==typeof a.responseInterceptor&&(s=s.then(a.responseInterceptor)),s.then((function(t){return o.onFinish({response:t,url:n,options:a,method:e})}),(function(t){return o.onFinish({response:t,url:n,options:a,method:e})})),[2,s]}))}))}},e.ctorParameters=function(){return[{type:l.FetchClient}]},e=yc([t.Injectable()],e)}(),sg=Object.freeze({__proto__:null,FetchClient:l.FetchClient,BasicAuth:l.BasicAuth,CookieAuth:l.CookieAuth,Realtime:l.Realtime,EventBinaryService:l.EventBinaryService,EventService:l.EventService,InventoryService:l.InventoryService,MeasurementService:l.MeasurementService,AlarmService:l.AlarmService,OperationBulkService:l.OperationBulkService,OperationService:l.OperationService,ApplicationService:l.ApplicationService,UserService:l.UserService,TenantService:l.TenantService,SystemOptionsService:l.SystemOptionsService,TenantOptionsService:l.TenantOptionsService,TenantSecurityOptionsService:l.TenantSecurityOptionsService,TenantLoginOptionsService:l.TenantLoginOptionsService,AuditService:l.AuditService,InventoryRoleService:l.InventoryRoleService,InventoryBinaryService:l.InventoryBinaryService,DeviceRegistrationService:l.DeviceRegistrationService,DeviceRegistrationBulkService:l.DeviceRegistrationBulkService,UserRoleService:l.UserRoleService,UserGroupService:l.UserGroupService,IdentityService:l.IdentityService,TrustedCertificateService:l.TrustedCertificateService});var og=Object.keys(sg).map((function(e){return t=sg[e],n=[l.FetchClient,l.Realtime],t===l.FetchClient&&(n=[l.CookieAuth]),t!==l.BasicAuth&&t!==l.CookieAuth||(n=[]),t===l.Realtime&&(n=[l.FetchClient]),{provide:t,useClass:t,deps:n};var t,n})).concat([{provide:ag,useClass:ag,deps:[l.FetchClient]}]),rg=(function(){function e(){}var n;n=e,e.providers=function(){return og},e.forRoot=function(){return{ngModule:n,providers:og}},e=n=yc([t.NgModule()],e)}(),function(){function e(e){this.injector=e,this.caches=new Map}return e.prototype.canActivate=function(e){var t=e.paramMap.get("id"),n=this.service(e);return this.clearDetailCached(n,t),this.detailCached(n,t).pipe(s.tap((function(t){return e.data=fc({},e.data,{contextData:t})})),s.map((function(){return!0})),s.catchError((function(e){return a.of(!1)})))},e.prototype.service=function(e){var t=Xm.contextToService(e.data.context);return this.injector.get(t)},e.prototype.detailCached=function(e,t){var n=this.getCache(e),o=n[t];if(!o){var r=e instanceof l.InventoryService?{withChildren:!1}:void 0;o=a.from(e.detail(t,r)).pipe(s.map((function(e){return e.data})),s.shareReplay(1)),n[t]=o}return o},e.prototype.clearDetailCached=function(e,t){delete this.getCache(e)[t]},e.prototype.getCache=function(e){var t=this.caches.get(e);return t||(t={},this.caches.set(e,t)),t},e.ctorParameters=function(){return[{type:t.Injector}]},e=yc([t.Injectable()],e)}()),lg=function(){function e(){}return e=yc([t.Component({selector:"empty",template:""})],e)}(),ig=[{path:"users/new",component:lg},{path:"tenants/new",component:lg}];for(var cg in e.ViewContext){var ug=e.ViewContext[cg];ig.push({path:ug,component:ng,canActivate:[rg],data:{context:ug,contextData:{}},resolve:{tabs:Jm}})}var dg=function(){function e(e){}var a;return a=e,e.providers=function(){return[rg,Jm,tg]},e.forRoot=function(){return{ngModule:a,providers:a.providers()}},e.ctorParameters=function(){return[{type:tg}]},e=a=yc([t.NgModule({declarations:[ng,lg],imports:[n.RouterModule.forRoot(ig),Cp,Yu],entryComponents:[ng,lg]})],e)}(),pg=function(){function e(){this.classes=""}return e.prototype.ngOnInit=function(){this.classes="card-block text-center "+o.kebabCase(this.label)},yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"label",void 0),e=yc([t.Component({selector:"c8y-quick-link",template:'<div [class]="classes" title="{{ label | translate }}">\r\n <h1 class="text-gray-darker">\r\n <i [c8yIcon]="icon" class="c8y-icon-duocolor"></i>\r\n </h1>\r\n <p class="text-muted">{{ label | translate }}</p>\r\n</div>\r\n'})],e)}(),mg=function(){function e(){}return e=yc([t.NgModule({declarations:[pg],imports:[Zm],exports:[pg],providers:[]})],e)}(),gg=function(){function e(e){this.realtime=e,this.subjects$=new Map,this.isActive=!0}return Object.defineProperty(e.prototype,"active",{get:function(){return this.isActive},enumerable:!0,configurable:!0}),e.prototype.onAll$=function(e){var t=this,n=this.getSubjectForChannel(e);return n.pipe(s.finalize((function(){1===n.observers.length&&n.observers[0].closed&&(n.stop(),t.subjects$.delete(n.channel))})))},e.prototype.start=function(){this.isActive||(this.subjects$.forEach((function(e){e.start()})),this.isActive=!0)},e.prototype.stop=function(){this.isActive&&(this.subjects$.forEach((function(e){e.stop()})),this.isActive=!1)},e.prototype.onCreate$=function(){return this.onAll$().pipe(s.filter((function(e){return"CREATE"===e.realtimeAction})),s.map((function(e){return e.data})))},e.prototype.onUpdate$=function(e){return this.onAll$(e).pipe(s.filter((function(e){return"UPDATE"===e.realtimeAction})),s.map((function(e){return e.data})))},e.prototype.onDelete$=function(e){return this.onAll$(e).pipe(s.filter((function(e){return"DELETE"===e.realtimeAction})),s.map((function(e){return Xi.coerceNumberProperty(e.data)})))},e.prototype.getIdString=function(e){var t;return t="object"==typeof e?e.id:e,String(t)},e.prototype.getChannel=function(e){return e?this.channel().replace("*",this.getIdString(e)):this.channel()},e.prototype.getSubjectForChannel=function(e){var t,n=this.getChannel(e);return this.subjects$.has(n)?t=this.subjects$.get(n):(t=new hg(n,this.realtime),this.subjects$.set(n,t)),t},e}(),hg=function(e){function t(t,n){var a=e.call(this)||this;return a.realtimeChannel=t,a.realtime=n,a.start(),a}return hc(t,e),Object.defineProperty(t.prototype,"channel",{get:function(){return this.realtimeChannel},enumerable:!0,configurable:!0}),t.prototype.start=function(){var e=this;this.realtimeSubscription||(this.realtimeSubscription=this.realtime.subscribe(this.realtimeChannel,(function(t){var n={channel:t.channel,data:t.data.data,id:t.id,realtimeAction:t.data.realtimeAction};e.next(n)})))},t.prototype.stop=function(){this.realtimeSubscription&&(this.realtime.unsubscribe(this.realtimeSubscription),this.realtimeSubscription=null)},t}(a.Subject),fg=function(e){function n(t){return e.call(this,t)||this}return hc(n,e),n.prototype.channel=function(){return"/bulkOperations/*"},n.ctorParameters=function(){return[{type:l.Realtime}]},n=yc([t.Injectable()],n)}(gg),yg=function(e){function n(t){return e.call(this,t)||this}return hc(n,e),n.prototype.channel=function(){return"/managedobjects/*"},n.ctorParameters=function(){return[{type:l.Realtime}]},n=yc([t.Injectable()],n)}(gg),vg=function(){};e.ActionBarService=Ac,e.ActionService=Nc,e.AlertService=Mc,e.AppStateService=$c,e.AuthenticationModule=zd,e.BootstrapComponent=Kc,e.BreadcrumbService=Yc,e.C8yStepper=zm,e.C8yStepperButtons=Hm,e.CachedLocaleDictionaryService=au,e.CellRendererContext=Xp,e.CellRendererDefDirective=Qp,e.CommonModule=Yu,e.ConfirmModalComponent=vd,e.ContextRouteComponent=ng,e.CoreModule=Zm,e.DashboardChildActionComponent=Bp,e.DashboardChildChange=Hp,e.DashboardChildComponent=Vp,e.DashboardChildTitleComponent=zp,e.DashboardComponent=Gp,e.DashboardModule=Jp,e.DataGridComponent=im,e.DataGridModule=dm,e.DatePickerComponent=Wm,e.DatePickerModule=Ym,e.DatePipe=Iu,e.DefaultValidationDirective=Pd,e.DeviceStatusComponent=fm,e.DeviceStatusModule=ym,e.DocsModule=Zp,e.DocsService=mp,e.DropAreaComponent=vm,e.DropAreaModule=bm,e.DynamicComponentComponent=Fp,e.DynamicComponentModule=Up,e.DynamicComponentService=$p,e.ES_MAX_TIME_MILLISECONDS=864e13,e.EmptyComponent=lg,e.FilePickerComponent=wm,e.FilePickerModule=Sm,e.FilterInputComponent=Rd,e.FilteringFormRendererContext=tm,e.FilteringFormRendererDefDirective=nm,e.FormGroupComponent=Td,e.FormsModule=qd,e.GuideDocsComponent=Yp,e.GuideHrefDirective=Wp,e.HOOK_ACTION=_c,e.HOOK_ACTION_BAR=Tc,e.HOOK_BREADCRUMB=Wc,e.HOOK_COMPONENT=qp,e.HOOK_COMPONENTS=Rp,e.HOOK_DOCS=pp,e.HOOK_NAVIGATOR_NODES=Bc,e.HOOK_ONCE_ROUTE=eg,e.HOOK_OPTIONS=Rc,e.HOOK_PATTERN_MESSAGES=Xc,e.HOOK_SEARCH=Yd,e.HOOK_TABS=Hc,e.HeaderBarComponent=gp,e.HeaderCellRendererDefDirective=em,e.HeaderModule=Cp,e.HeaderService=Gc,e.HighlightComponent=Xd,e.HumanizeAppNamePipe=xu,e.HumanizePipe=Eu,e.ICON_LIST=Wu,e.InputGroupListComponent=Ad,e.JsonValidationPrettifierDirective=Nd,e.ListGroupComponent=Cm,e.ListGroupModule=_m,e.ListItemComponent=xm,e.ListItemRadioComponent=Am,e.LoginService=ud,e.ManagedObjectRealtimeService=yg,e.MaxValidationDirective=xd,e.MessageDirective=Ed,e.MessagesComponent=kd,e.MinValidationDirective=Od,e.ModalModule=Sd,e.ModalService=bd,e.NavigatorIconComponent=vp,e.NavigatorItemComponent=yp,e.NavigatorNode=Fc,e.NavigatorNodeRoot=Uc,e.NavigatorService=zc,e.NewPasswordComponent=yd,e.OperationBulkRealtimeService=fg,e.OptionsService=qc,e.PasswordCheckListComponent=md,e.PasswordConfirm=gd,e.PasswordConfirmModalComponent=dd,e.PasswordService=pd,e.PasswordStrengthCheckerService=hd,e.PasswordStrengthComponent=fd,e.Permissions=Hu,e.PhoneValidationDirective=Cd,e.PopoverConfirmComponent=wd,e.QuickLinkModule=mg,e.RealtimeMessage=vg,e.RealtimeService=gg,e.RouterModule=dg,e.RouterService=tg,e.SearchModule=ep,e.SearchResultEmptyComponent=Qd,e.SearchService=Zd,e.SelectComponent=$m,e.SelectModalComponent=Lm,e.SelectModalModule=qm,e.SelectModule=Um,e.SmsChallengeComponent=Fd,e.StateService=kc,e.StepperModule=Km,e.TabsService=Vc,e.TextAreaRowHeightDirective=Dd,e.TitleComponent=fp,e.TotpChallengeComponent=$d,e.TotpSetupComponent=Ud,e.TranslateService=Cu,e.TypeaheadComponent=Fm,e.UserMenuService=tp,e.UserTotpRevokeComponent=lp,e.ValidationPattern=Id,e.WidgetsDashboardComponent=Kp,e._=function(e){return e},e.deviceAvailabilityIconMap=pm,e.fromFactories=Ic,e.fromTrigger=Cc,e.getActivatedRoute=Ec,e.gettext=Dc,e.initializeServices=Vu,e.memoize=Gu,e.minColumnGridTrackSize=80,e.operationStatusClasses=$u,e.operationStatusIcons=qu,e.ratiosByColumnTypes=sm,e.resolveInjectedFactories=Pc,e.routes=ig,e.sortByPriority=xc,e.stateToFactory=Oc,e.statusAlert=Ru,e.statusClasses=Lu,e.statusIcons=Mu,e.tooltips=gm,e.ɵ0=mm,e.ɵa=Lc,e.ɵb=cu,e.ɵba=Zu,e.ɵbb=td,e.ɵbc=Qu,e.ɵbd=ed,e.ɵbe=rd,e.ɵbf=ad,e.ɵbg=od,e.ɵbh=nd,e.ɵbi=sd,e.ɵbj=id,e.ɵbk=ld,e.ɵbl=Lp,e.ɵbm=Mp,e.ɵbn=hp,e.ɵbo=cp,e.ɵbp=up,e.ɵbq=Sp,e.ɵbr=ip,e.ɵbs=rp,e.ɵbt=op,e.ɵbu=ap,e.ɵbv=np,e.ɵbw=sp,e.ɵbx=_d,e.ɵby=Md,e.ɵbz=Ld,e.ɵc=uu,e.ɵca=jd,e.ɵcb=Bd,e.ɵcc=Wd,e.ɵcd=Jd,e.ɵce=Kd,e.ɵcf=Vd,e.ɵcg=Gd,e.ɵch=Hd,e.ɵci=wp,e.ɵcj=bp,e.ɵck=jp,e.ɵcl=Ap,e.ɵcm=Op,e.ɵcn=xp,e.ɵco=Ip,e.ɵcp=Pp,e.ɵcq=Ep,e.ɵcr=Tp,e.ɵcs=kp,e.ɵct=Dp,e.ɵcu=Np,e.ɵcv=_p,e.ɵcw=cm,e.ɵcx=um,e.ɵcy=am,e.ɵcz=Om,e.ɵd=du,e.ɵda=Im,e.ɵdb=Pm,e.ɵdc=Em,e.ɵdd=km,e.ɵde=Tm,e.ɵdf=Bm,e.ɵdg=Gm,e.ɵdh=Rm,e.ɵdi=Dm,e.ɵdj=Nm,e.ɵdl=Qm,e.ɵdm=Jm,e.ɵdn=rg,e.ɵdo=pg,e.ɵe=pu,e.ɵf=gu,e.ɵg=lu,e.ɵh=nu,e.ɵi=Jc,e.ɵj=Zc,e.ɵk=su,e.ɵl=ru,e.ɵm=eu,e.ɵn=Qc,e.ɵo=ku,e.ɵp=Tu,e.ɵq=_u,e.ɵr=Du,e.ɵs=Ou,e.ɵt=Pu,e.ɵu=Au,e.ɵv=Nu,e.ɵw=Fu,e.ɵx=zu,e.ɵy=Xu,e.ɵz=Ju,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
16
|
+
var gc=function(e,t){return(gc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function hc(e,t){function n(){this.constructor=e}gc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var fc=function(){return(fc=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)};function yc(e,t,n,a){var s,o=arguments.length,r=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,a);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}function vc(e,t){return function(n,a){t(n,a,e)}}function jc(e,t,n,a){return new(n||(n=Promise))((function(s,o){function r(e){try{i(a.next(e))}catch(e){o(e)}}function l(e){try{i(a.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}i((a=a.apply(e,t||[])).next())}))}function bc(e,t){var n,a,s,o,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,a=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(!(s=r.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){r=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){r.label=o[1];break}if(6===o[0]&&r.label<s[1]){r.label=s[1],s=o;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(o);break}s[2]&&r.ops.pop(),r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e],a=0}finally{n=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}function wc(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a,s,o=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(a=o.next()).done;)r.push(a.value)}catch(e){s={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return r}function Sc(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(wc(arguments[t]));return e}function Cc(e,t,a){return e.events.pipe(s.filter((function(e){return e instanceof n.NavigationEnd})),s.merge(t),s.startWith(1),s.switchMap((function(){return Ic(a,e)})))}function Ic(e,t,n){return void 0===n&&(n=!0),!Array.isArray(e)||e.length<1?a.of([]):a.defer((function(){var r=Pc(e).map((function(e){return function(e,t){var n;if(!e)return a.of([]);if("function"==typeof e.then||a.isObservable(e))if(t){var o=a.from(e),r=o.pipe(s.startWith([]));n=a.race(o,r)}else n=a.from(e);else n=a.of(e);return n.pipe(s.map((function(e){return(Array.isArray(e)?e:[e]).filter((function(e){return!!e}))})))}(Array.isArray(e)?e:e&&o.isFunction(e.get)?e.get(Ec(t)):[e],n)}));return a.combineLatest.apply(void 0,Sc(r))})).pipe(s.map((function(e){return xc([].concat.apply([],Sc(e)))})))}function Pc(e){return o.flatten(e.map((function(e){return o.isFunction(e)?e():[e]})))}function Oc(e){var t=e.pipe(s.map((function(e){return Array.from(e)})));return{get:function(){return t}}}function xc(e){return o.sortBy(e,"priority")}function Ec(e){if(e&&e.routerState&&e.routerState.root){for(var t=e.routerState.root;t.firstChild;)t=t.firstChild;return t}}var kc=function(){function e(){}return e.prototype.map=function(e){return this.state$.pipe(s.map(e),s.distinctUntilChanged())},e.prototype.emitNewState=function(){this.state$.next(this.state)},e}(),Tc=new t.InjectionToken("ActionBarFactory"),Ac=function(e){function o(t,n){var o=e.call(this)||this;return o.injector=t,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.items$=Cc(n,o.refreshTrigger,[function(){return o.injector.get(Tc,[])},Oc(o.state$)]).pipe(s.map((function(e){return xc(e)})),s.shareReplay(1)),o}return hc(o,e),Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.refresh=function(){this.refreshTrigger.next()},o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),_c=new t.InjectionToken("ActionFactory"),Nc=function(e){function o(t,n){var o=e.call(this)||this;return o.injector=t,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.items$=Cc(n,o.refreshTrigger,[function(){return o.injector.get(_c,[])},Oc(o.state$)]).pipe(s.map((function(e){return xc(e)})),s.shareReplay(1)),o}return hc(o,e),o.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc);function Dc(e){return e}var Mc=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.state$=new a.BehaviorSubject([]),t.MAX_ALERTS=3,t.ALERT_TIMEOUT=3e3,t}return hc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.add=function(e){this.addAlert(e)},n.prototype.addByText=function(e,t,n){this.addAlert({text:t,type:e,detailedData:n})},n.prototype.list=function(){return this.state},n.prototype.remove=function(e){var t=this;this.changeAlerts(this.state.filter((function(n){return!t.areSame(e,n)})))},n.prototype.update=function(e,t){var n=this;this.changeAlerts(this.state.map((function(a){return n.areSame(e,a)&&Object.assign(a,t),a})))},n.prototype.removeLastDanger=function(){var e=this.state.reverse().find((function(e){return"danger"===e.type}));this.changeAlerts(this.state.filter((function(t){return t!==e})))},n.prototype.saveSuccess=function(e){var t=this;return function(){var n=e+" saved successfully";t.addByText("success",n)}},n.prototype.createSuccess=function(e){var t=this;return function(){var n=e+" created successfully";t.addByText("success",n)}},n.prototype.clearAll=function(){this.changeAlerts([])},n.prototype.success=function(e,t){this.addByText("success",e,t)},n.prototype.danger=function(e,t){this.addByText("danger",e,t)},n.prototype.info=function(e,t){this.addByText("info",e,t)},n.prototype.warning=function(e,t){this.addByText("warning",e,t)},n.prototype.addServerFailure=function(e,t){void 0===t&&(t="danger");var n,a=e.data,s=e.res,o=a&&a.message?a.message:null;a&&("object"==typeof a?n=a.exceptionMessage:"string"==typeof a&&(n=a));var r=!(!o&&!n);o||(o="A server error occurred."),r||(n={status:s.status,statusText:s.statusText,url:s.url}),this.addAlert({type:t,text:o,detailedData:n})},n.prototype.areSame=function(e,t){return e.text===t.text&&e.type===t.type&&e.detailedData===t.detailedData&&e.onClose===t.onClose&&e.onDetail===t.onDetail},n.prototype.changeAlerts=function(e){this.state$.next(e)},n.prototype.addAlert=function(e){var t=this;if(!e.text&&!e.type)throw new Error("Cannot add empty alert");this.state.find((function(n){return t.areSame(e,n)}))||(this.changeAlerts(Sc(this.state,[e])),this.hideAutomaticallyIfNeeded(e),this.removeOldestIfMax())},n.prototype.hideAutomaticallyIfNeeded=function(e){var t=this,n="success"===e.type,a=!e.detailedData,s=n&&a?this.ALERT_TIMEOUT:0;void 0!==e.timeout&&(s=e.timeout),s&&setTimeout((function(){return t.remove(e)}),s)},n.prototype.removeOldestIfMax=function(){if(this.state.length>this.MAX_ALERTS){var e=wc(this.state).slice(1);this.changeAlerts(e)}},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n=yc([t.Injectable({providedIn:"root"})],n)}(kc),Lc=function(){},Rc=new t.InjectionToken("App options"),qc=function(e){function n(t,n,a){var s=e.call(this)||this;return s.systemOptionsService=n,s.tenantOptionService=a,s.setupOptions(t),s}return hc(n,e),n.prototype.get=function(e,t){var n=this[e];return void 0===n&&(n=this[o.camelCase(e)]),void 0!==n?n:t},n.prototype.set=function(e,t){this[o.camelCase(e)]=t},n.prototype.getSupportUrl=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return o.isUndefined(this.supportUrl)?(e=this,[4,this.getTenantOption("configuration","system.support.url")]):[3,2];case 1:e.supportUrl=t.sent(),t.label=2;case 2:return[2,!o.isUndefined(this.supportUrl)&&this.supportUrl]}}))}))},n.prototype.getActivateSupportUser=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return[4,this.getSystemOption("support-user","enabled",!0)];case 1:return[2,!e.sent()]}}))}))},n.prototype.getSystemOption=function(e,t,n){return jc(this,void 0,void 0,(function(){return bc(this,(function(a){return[2,this.getOptionFromService(e,t,this.systemOptionsService,n)]}))}))},n.prototype.getTenantOption=function(e,t,n){return jc(this,void 0,void 0,(function(){return bc(this,(function(a){return[2,this.getOptionFromService(e,t,this.tenantOptionService,n)]}))}))},n.prototype.setupOptions=function(e){var t=this;e&&(Array.isArray(e)||(e=[e]),e.forEach((function(e){e&&Object.keys(e).forEach((function(n){t[o.camelCase(n)]=e[n]}))})))},n.prototype.getOptionFromService=function(e,t,n,a){return jc(this,void 0,void 0,(function(){var s;return bc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,n.detail({category:e,key:t})];case 1:return s=o.sent().data,[2,this.parseOptionRawValue(s.value,a)];case 2:return o.sent(),[2,a];case 3:return[2]}}))}))},n.prototype.parseOptionRawValue=function(e,t){var n;try{n=JSON.parse(e)}catch(a){n=o.isUndefined(e)?t:e}return n},n.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[Rc]}]},{type:r.SystemOptionsService},{type:r.TenantOptionsService}]},n=yc([t.Injectable(),vc(0,t.Optional()),vc(0,t.Inject(Rc))],n)}(Lc),$c=function(e){function n(t,n,o,r){var l=e.call(this)||this;return l.applicationService=t,l.apiService=n,l.options=o,l.fetchClient=r,l.state$=new a.BehaviorSubject({app:{name:l.options.name,contextPath:l.getCurrentContextPath()||l.options.contextPath},supportUrl:l.options.supportUrl,lang:l.options.get("defaultLanguage","en"),langs:l.getLangs(),langsDetail:l.options.languages,loginOptions:l.options.loginOptions,activateSupportUserAvailable:void 0,versions:{backend:void 0,ui:l.options.versions||{ngx:void 0}},hidePowered:l.options.hidePowered,isLoading:!1,showRightDrawer:l.options.rightDrawer,loginExtraLink:l.options.get("login_extra_link"),newsletter:l.options.newsletter}),l.currentSupportUserName=new a.BehaviorSubject(null),l.currentUser=new a.BehaviorSubject(null),l.currentTenant=new a.BehaviorSubject(null),l.apiService.calls.pipe(s.filter((function(e){var t=e.url;return!/cep\/realtime/.test(t)})),s.map((function(e){return"start"===e.phase?1:-1})),s.scan((function(e,t){return e+t}),0),s.map((function(e){return e>0})),s.distinctUntilChanged()).subscribe((function(e){return l.state.isLoading=e})),l.assignApplicationKeyToDefaultHeaders(),l}return hc(n,e),n.prototype.assignApplicationKeyToDefaultHeaders=function(){t.isDevMode()||(this.fetchClient.defaultHeaders=fc({},this.fetchClient.defaultHeaders||{},{"X-Cumulocity-Application-Key":this.options.key}))},Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.getLangs=function(){var e=this.options.languages;return e?o.keys(e).filter((function(t){return e[t]})):[]},Object.defineProperty(n.prototype,"uiVersion",{get:function(){var e=this.state.versions.ui;return e.ngx||e.ng1},enumerable:!0,configurable:!0}),n.prototype.loadManifest=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.applicationService.detail(this.state.app.contextPath+"/manifest")];case 1:return e=t.sent().data.application,this.state.app.manifest=e,this.loadDefaultOptions(),[3,3];case 2:throw t.sent();case 3:return[2]}}))}))},n.prototype.isApplicationAvailable=function(e){return jc(this,void 0,void 0,(function(){return bc(this,(function(t){switch(t.label){case 0:return[4,this.applicationService.listByUser(void 0,{pageSize:100})];case 1:return[2,t.sent().data.some((function(t){return t.name===e}))]}}))}))},n.prototype.setUser=function(e){this.currentSupportUserName.next(e.supportUserName||null),this.currentUser.next(e.user)},n.prototype.getCurrentContextPath=function(){var e=window.location.pathname.match(/\/apps\/(public\/){0,1}(.+?)(\/|\?|#|$)/);return e&&e[2]},n.prototype.loadDefaultOptions=function(){return jc(this,void 0,void 0,(function(){var e,t,n;return bc(this,(function(a){switch(a.label){case 0:return e=this.state,[4,this.options.getSupportUrl()];case 1:return e.supportUrl=a.sent(),t=this.state,[4,this.options.getActivateSupportUser()];case 2:return t.activateSupportUserAvailable=a.sent(),n=this.state.versions,[4,this.options.getSystemOption("system","version")];case 3:n.backend=a.sent();try{this.showIncompatibleVersionsError()}catch(e){}return this.emitNewState(),[2]}}))}))},n.prototype.showIncompatibleVersionsError=function(){var e=this.state.versions.ui.ngx,t=this.state.versions.backend,n=e.replace(/[^\d.]/g,"").split(".").map(Number),a=t.replace(/[^\d.]/g,"").split(".").map(Number),s=Math.pow(10,Math.ceil(Math.log10(Math.max.apply(Math,Sc(n,a))+1))),o=function(e,t){return e+t},r=function(e,t){return e*(s/Math.pow(10,t))};if(n.map(r).reduce(o)>a.map(r).reduce(o)){var l="You are running version "+e+" of the UI and version "+t+" of backend!";console.log("%c "+l,"font-weight: bold; font-size: 30px; color: red;")}},n.ctorParameters=function(){return[{type:l.ApplicationService},{type:r.ApiService},{type:qc},{type:l.FetchClient}]},n=yc([t.Injectable()],n)}(kc),Fc=function(){function e(e){this.children=[],this.parents=[],this.routerLinkExact=!0,this.open=!1,this.hidden=!1,this.draggable=!1,this.droppable=!1,this.dragged=!1,this.draggedHover=!1,this.confirm=void 0,this._priority=0,this.update(e)}return Object.defineProperty(e.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id||"navigator_node_"+o.snakeCase(this.label)},set:function(e){this._id=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"priority",{get:function(){if(this._priority)return this._priority;var e=this.children.map((function(e){return e.priority||0}));return e.length&&e.length?Math.max.apply(Math,Sc(e)):0},set:function(e){this._priority=e},enumerable:!0,configurable:!0}),e.prototype.openOnStart=function(e){return!1},e.prototype.add=function(e){if(e===this)throw new Error("Adding node to itself");-1===this.children.indexOf(e)&&this.children.push(e),-1===e.parents.indexOf(this)&&e.parents.push(this),this.updateChildren()},e.prototype.remove=function(e){var t=this.children.indexOf(e),n=e.parents.indexOf(this);t>-1&&this.children.splice(t,1),n>-1&&e.parents.splice(n,1),this.updateChildren()},e.prototype.update=function(e){e&&(Object.assign(this,e),void 0!==e.hidden&&this.parents.forEach((function(e){e.updateHidden()})))},e.prototype.find=function(e){if("string"==typeof e){var t=e.toLocaleLowerCase();e=function(e){var n=e.label;return t===n.toLowerCase()}}if("object"==typeof e&&(e=o.matches(e)),"function"!=typeof e)throw new Error("Invalid search predicate");return this.children.reduce((function(t,n){return t||n.find(e)}),this.children.find(e))},e.prototype.empty=function(){this.children.length=0},e.prototype.click=function(e){void 0===e&&(e={})},e.prototype.drop=function(e){e.stopPropagation(),clearTimeout(this.expandDragTimeout)},e.prototype.dragStart=function(e){e.stopPropagation(),e.dataTransfer.setData("node","node"),this.dragged=!0},e.prototype.dragEnd=function(e){e.stopPropagation(),this.dragged=!1,e.dataTransfer.clearData()},Object.defineProperty(e.prototype,"canDrop",{get:function(){return this.droppable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canNavigate",{get:function(){return void 0!==this.path},enumerable:!0,configurable:!0}),e.prototype.dragEnter=function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.draggedHover=!0,this.open||(this.expandDragTimeout=setTimeout((function(){return t.expand()}),1e3))},e.prototype.dragLeave=function(e){e.preventDefault(),e.stopPropagation(),this.draggedHover=!1,clearTimeout(this.expandDragTimeout)},e.prototype.expand=function(){this.open||(this.open=!0,this.click({open:!0,expander:!0}))},e.prototype.traverse=function(e){this.children&&this.children.forEach((function(t){e(t),t.traverse(e)}))},e.prototype.destroy=function(){},e.prototype.updateChildren=function(){this.sort(),this.updateHidden()},e.prototype.sort=function(){this.children.sort((function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:(e.label||"").toLowerCase()<(t.label||"").toLowerCase()?-1:(e.label||"").toLowerCase()>(t.label||"").toLowerCase()?1:0}))},e.prototype.updateHidden=function(){void 0===this.path&&(this.hidden=!this.children.some((function(e){return!e.hidden})))},e}(),Uc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return hc(t,e),t.prototype.addRoot=function(e){var t,n=e.parent,a=this.createNode(e);return n&&("object"==typeof n?(t=this.find(n.label))&&t.update(n):"string"!=typeof n&&"function"!=typeof n||(t=this.find(n)),t||(t=this.createNode(n),this.find((function(e){return t===e}))||this.add(t))),(t||this).add(a),a},t.prototype.createNode=function(e){if(e instanceof Fc)return e;if("string"==typeof e)return new Fc({label:e});if("object"==typeof e)return new Fc(fc({},e,{parent:void 0}));throw new Error("Wrong type of node data")},t}(Fc),Bc=new t.InjectionToken("NavigatorNodesFactory"),zc=function(e){function o(t,n){var o=e.call(this)||this;o.injector=t,o.router=n,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.firstUrl=!0;var r=new Uc;return o.items$=Cc(n,o.refreshTrigger,[function(){return o.injector.get(Bc,[])},Oc(o.state$)]).pipe(s.map((function(e){var t=e.filter((function(e){return!e.parent})),n=e.filter((function(e){return e.parent})),a=xc(t).concat(xc(n));return r.empty(),a.forEach((function(e){return r.addRoot(e)})),r.children})),s.shareReplay(1)),o}return hc(o,e),o.prototype.openOnFirstUrl=function(e){return!(!this.firstUrl||!e.path)&&(this.router.isActive(e.path,e.routerLinkExact)||e.openOnStart(this.router.url))},Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.refresh=function(){this.refreshTrigger.next(1)},o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),Gc=function(e){function n(t,n){var o=e.call(this)||this;o.navigatorService=t,o.options=n,o.hasItemsInNavigator$=o.navigatorService.items$.pipe(s.map((function(e){return!!e.length})),s.distinctUntilChanged()),o.state$=new a.BehaviorSubject({title:void 0,nav:{open:!1}}),o.title=void 0,o.header$=o.map((function(e){return e})),o.navigatorOpen$=o.map((function(e){return e.nav.open})).pipe(s.combineLatest(o.hasItemsInNavigator$),s.map((function(e){var t=wc(e,2),n=t[0],a=t[1];return n&&a})));var r=document.querySelector("title");return o.title={elementRef:r,originalValue:r&&r.innerText},o}return hc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"navigatorHiddenOnStartup",{get:function(){return this.options.hideNavigator},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"largeWidth",{get:function(){return document.documentElement.clientWidth>1200},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldToggle",{get:function(){return this.largeWidth&&!this.navigatorHiddenOnStartup&&!this.state.nav.open},enumerable:!0,configurable:!0}),n.prototype.toggleNavigator=function(){this.state.nav.open=!this.state.nav.open,this.emitNewState()},n.prototype.closeNavigator=function(){this.state.nav.open=!1,this.emitNewState()},n.prototype.configNavigator=function(e){void 0===e&&(e={}),this.state.nav=Object.assign(this.state.nav,e),this.emitNewState()},n.prototype.changeTitle=function(e){this.state.title=e,this.emitNewState()},n.prototype.changePageTitle=function(e){this.title.elementRef.innerText=e?e+" / "+this.title.originalValue:""+this.title.originalValue},n.prototype.verifyIfNavOpen=function(){var e=this;this.hasItemsInNavigator$.pipe(s.debounceTime(300)).subscribe((function(t){return t&&e.shouldToggle&&e.toggleNavigator()}))},n.prototype.shouldShowBreadcrumbs=function(){return this.options.breadcrumbs},n.ctorParameters=function(){return[{type:zc},{type:qc}]},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n(t.ɵɵinject(zc),t.ɵɵinject(qc))},token:n,providedIn:"root"}),n=yc([t.Injectable({providedIn:"root"})],n)}(kc),Hc=new t.InjectionToken("TabsFactory"),Vc=function(e){function o(t,n,o,r){var l=e.call(this)||this;return l.injector=t,l.translateService=o,l.options=r,l.refreshTrigger=new a.Subject,l.state$=new a.BehaviorSubject(new Set),l.items$=Cc(n,l.refreshTrigger,[function(){return l.injector.get(Hc,[])},Oc(l.state$)]).pipe(s.map((function(e){return l.prepareTabs(e)})),s.shareReplay(1),s.distinctUntilChanged()),l.orientation$=l.items$.pipe(s.map((function(e){var t=e.find((function(e){return e.orientation}));return t?t.orientation:l.options.tabsHorizontal?"horizontal":"vertical"})),s.distinctUntilChanged()),l}return hc(o,e),o.prototype.prepareTabs=function(e){return this.sortTabs(e.map((function(e){return fc({},e,{template:e.template instanceof t.ViewContainerRef?e.template:void 0})})).filter((function(e,t,n){return t===n.findIndex((function(t){return t.path===e.path}))})))},o.prototype.sortTabs=function(e){var t=this;return e.sort((function(e,n){var a=(n.priority||0)-(e.priority||0),s=t.translateService.instant(e.label),o=t.translateService.instant(n.label),r=s.localeCompare(o);return a||r}))},o.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},Object.defineProperty(o.prototype,"firstTab$",{get:function(){return this.items$.pipe(s.map((function(e){return e[0]})),s.filter(Boolean),s.first())},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router},{type:i.TranslateService},{type:qc}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router),t.ɵɵinject(i.TranslateService),t.ɵɵinject(qc))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),Kc=function(){function e(e,t,n,a,o,r){var l=this;this.tabs=e,this.ui=t,this.navigator=n,this.actionBar=a,this.options=o,this.headerService=r,this.noAppsMargin$=this.headerService.map((function(e){var t=e.nav;return!t.open&&t.hiddenOnStartup})),this.tabsOrientation=this.options.tabsHorizontal?"horizontal":"vertical",this.ui.map((function(e){return e.lang})).pipe(s.distinctUntilChanged()).subscribe((function(){l.actionBar.refresh()}))}return Object.defineProperty(e.prototype,"showPoweredBy",{get:function(){return!this.options.get("hidePowered")},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:Vc},{type:$c},{type:zc},{type:Ac},{type:qc},{type:Gc}]},e=yc([t.Component({selector:"c8y-bootstrap",template:'<c8y-login *ngIf="!(ui.currentUser | async)"></c8y-login>\n\n<div *ngIf="ui.currentUser | async" [class.head-open]="header.headerOpen">\n <c8y-header-bar #header></c8y-header-bar>\n <c8y-navigator-outlet\n [nodes]="navigator.items$ | async"\n [open]="headerService.navigatorOpen$ | async"\n >\n <header class="title navigator-slot-top">\n <div class="tenant-brand"></div>\n <c8y-app-icon\n [name]="(ui.state$ | async).app.name"\n [contextPath]="(ui.state$ | async).app.contextPath"\n ></c8y-app-icon>\n <span>{{ (ui.state$ | async).app | humanizeAppName | async }}</span>\n </header>\n <div style="cursor:default" class="powered-by navigator-slot-bottom" *ngIf="showPoweredBy">\n <p translate>powered by Cumulocity</p>\n </div>\n </c8y-navigator-outlet>\n\n <div class="alerts">\n <c8y-alert-outlet></c8y-alert-outlet>\n </div>\n <c8y-tabs-outlet\n #tabsComponent\n [tabs]="tabs.items$ | async"\n [navigatorOpen]="headerService.navigatorOpen$ | async"\n [orientation]="tabs.orientation$ | async"\n >\n </c8y-tabs-outlet>\n <c8y-action-bar\n #actionBarComponent\n [navigatorOpen]="headerService.navigatorOpen$ | async"\n [hasTabs]="tabsComponent.hasTabs"\n [isTabsHorizontal]="tabsComponent.isHorizontal"\n [items]="actionBar.items$ | async"\n >\n </c8y-action-bar>\n\n <div\n class="mcontainer"\n [ngClass]="{\n open: headerService.navigatorOpen$ | async,\n \'no-apps-margin\': noAppsMargin$ | async,\n \'horizontal-tabs\': tabsComponent.isHorizontal,\n \'vertical-tabs\': !tabsComponent.isHorizontal,\n \'has-tabs\': tabsComponent.hasTabs,\n \'has-action-bar\': !actionBarComponent.hidden\n }"\n >\n <div class="container-fluid">\n <router-outlet></router-outlet>\n <ng-content select="#c8y-legacy-view"></ng-content>\n \x3c!-- legacy ng-view, will not be migrated atm --\x3e\n </div>\n </div>\n</div>\n<c8y-cookie-banner></c8y-cookie-banner>\n'})],e)}(),Wc=new t.InjectionToken("BreadcrumbFactory"),Yc=function(e){function o(t,n){var o=e.call(this)||this;return o.injector=t,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.items$=Cc(n,o.refreshTrigger,[function(){return o.injector.get(Wc,[])},Oc(o.state$)]).pipe(s.map((function(e){return o.sortByPreferredPath(e)})),s.shareReplay(1)),o}return hc(o,e),Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.prototype.refresh=function(){this.refreshTrigger.next(1)},o.prototype.selectPreferredByPath=function(e){this.preferredPath=e,this.refresh()},o.prototype.sortByPreferredPath=function(e){var t=this;return this.preferredPath?e.sort((function(e){return e.items.find((function(e){return!!e.path.match(t.preferredPath)}))?-1:1})):e},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),Zc=new t.InjectionToken("Languages"),Jc=new t.InjectionToken("Locale path"),Xc=new t.InjectionToken("Pattern Messages"),Qc=function(){function e(e){var t=this;this.patterns={},this.pipes={absoluteDate:function(e){return c.formatDate(e,"medium",t.translateService.currentLang)},translate:function(e){return t.translateService.instant(e)}},o.each(e,(function(e){Object.assign(t.patterns,e)}))}return e.prototype.translate=function(e){var t=this.translateWithPatterns(e);return t!==e?t:""},e.prototype.translateWithPatterns=function(e,t){var n=this;void 0===t&&(t=this.patterns);var a=e;return o.each(t,(function(e,t){var s,r=new RegExp(t,"g");if(r.test(a)){r.test(""),s=r.exec(a);for(var l=function(){var l=wc(s,1)[0],i=o.mapValues(e.placeholders,(function(e){var a=e.capture||e,s=l.replace(new RegExp(t,"g"),a);return e.translate&&(s=n.translateWithPatterns(s,e.translate)),s}));a=a.replace(l,n.translateWithParams(e,i)),s=r.exec(a)};null!==s;)l()}})),a},e.prototype.translateWithParams=function(e,t){void 0===t&&(t={});var n=this.translateService,a=n.defaultLang,s=n.currentLang,o=n.compiler,r=this.translateService.store.translations[s],l=this.translateService.store.translations[a],i=e.gettext,c=i;r&&(r[i]?c=r[i]:l&&l[i]&&(c=l[i]));for(var u,d=i,p=c,m=fc({},t,{noPatternMessages:!0}),g=RegExp("{{\\s*([^\\s]+)\\s*\\|\\s*([^\\s]+)\\s*}}","g");null!==(u=g.exec(i));){var h=wc(u,3),f=h[0],y=h[1],v=h[2];this.pipes[v]&&(d=d.replace(f,"{{"+y+"}}"),p=p.replace(f,"{{"+y+"}}"),m[y]=this.pipes[v](t[y]))}return r&&(r[d]=o.compile(p,s)),this.translateService.instant(d,m)},e.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[Xc]}]}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(Xc))},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"}),vc(0,t.Inject(Xc))],e)}(),eu=function(){function e(e,t){this.parser=e,this.patternMessagesService=t,this.cache={}}return e.prototype.handle=function(e){var t=e.key,n=e.interpolateParams,a=e.translateService;this.translateService=a;var s=this.getFromCache(t,n);if(!s){var o=this.getPatternMessageTranslation(t,n);s=o||this.parser.interpolate(t,n),this.addToCache(t,n,s)}return s},e.prototype.getFromCache=function(e,t){var n=this.translateService.currentLang;return(this.cache[n]||{})[this.getCacheKey(e,t)]},e.prototype.addToCache=function(e,t,n){var a=this.translateService.currentLang;(this.cache[a]=this.cache[a]||{})[this.getCacheKey(e,t)]=n},e.prototype.getCacheKey=function(e,t){return t?e+" "+JSON.stringify(t):e},e.prototype.getPatternMessageTranslation=function(e,t){if(!t||!t.noPatternMessages)return this.patternMessagesService.translateService||(this.patternMessagesService.translateService=this.translateService),this.patternMessagesService.translate(e)},e.ctorParameters=function(){return[{type:i.TranslateParser},{type:Qc}]},e=yc([t.Injectable()],e)}(),tu={updatesList:{capture:"$1",translate:{"status='(.+?)'":{gettext:'status="{{status | translate}}"',placeholders:{status:"$1"}},"generalStatus='(.+?)'":{gettext:'generalStatus="{{generalStatus | translate}}"',placeholders:{generalStatus:"$1"}},"progress='(.+?)'":{gettext:'progress="{{progress}}"',placeholders:{progress:"$1"}},"note=(.+?)":{gettext:'note="{{note}}"',placeholders:{note:"$1"}}}}},nu={"^Access is denied$":{gettext:"Access denied."},"^Alarm created$":{gettext:"Alarm created"},"^Alarm updated$":{gettext:"Alarm updated"},"^API is not available with the new domain$":{gettext:"Could not activate custom domain. DNS setup is incorrect."},"^Application with given name already exist$":{gettext:"Application with given name already exists."},"^Application with id (.+?) is already assigned to the tenant (.+?)$":{gettext:'This application is already assigned to tenant "{{tenant}}".',placeholders:{tenant:"$2"}},"^Apply software changes: (.+?)\\.?$":{gettext:"Apply software changes: {{ softwareChanges }}",placeholders:{softwareChanges:{capture:"$1",translate:{'install "(.+?)" \\(version: (.+?)\\)':{gettext:'install "{{ softwareName }}" (version: {{ softwareVersion }})',placeholders:{softwareName:"$1",softwareVersion:"$2"}},'install "([^"]+)"(?! \\(version: .+?\\))':{gettext:'install "{{ softwareName }}"',placeholders:{softwareName:"$1"}},'delete "(.+?)" \\(version: (.+?)\\)':{gettext:'delete "{{ softwareName }}" (version: {{ softwareVersion }})',placeholders:{softwareName:"$1",softwareVersion:"$2"}},'delete "([^"]+)"(?! \\(version: .+?\\))':{gettext:'delete "{{ softwareName }}"',placeholders:{softwareName:"$1"}}}}}},"^Assign device profile (.+?) to device (.+?)$":{gettext:"Assign device profile {{profileName}} to device {{deviceName}}",placeholders:{profileName:"$1",deviceName:"$2"}},"^(.+)pplication for tenant (.+) with properties \\( (.+?) \\) already exists$":{gettext:'Application for tenant "{{tenant}}" with the following values ({{valuesList}}) already exists.',placeholders:{tenant:"$2",valuesList:"$3"}},"^Authentication failed! : User account is locked$":{gettext:"Authentication failed due to: user account is locked."},"^Availability monitoring record$":{gettext:"Availability monitoring record"},"^Can not activate a certificate which is either expired or not yet valid$":{gettext:"Cannot activate a certificate which is either expired or not yet valid."},"^Cannot add certificate - certificate with (.+?) fingerprint already exists. : Certificate with (.+?) fingerprint already exists.":{gettext:"Could not add certificate. Certificate with {{fingerprint}} fingerprint already exists.",placeholders:{fingerprint:"$1"}},"^Cannot change password. : Provided token does not exist.$":{gettext:"Cannot change password: provided token is invalid."},"^Cannot deploy module (.*)$":{gettext:'Cannot deploy module due to error: "{{ errorMessage | translate }}".',placeholders:{errorMessage:"$1"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}}.',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}} near reserved keyword "{{keyword}}".',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6",keyword:"$7"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+), please check the where clause \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}}, check "where" clause.',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6"}},"^Cannot deploy module (.+?)! : Deployment failed in module '(.+?)' in expression '(.+?)' : Exception compiling script '(.+?)' of dialect '(.+?)': missing (.+?) before statement \\((.+?)\\) \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": exception compiling script "{{scriptName}}" of dialect "{{scriptDialect}}": missing "{{missingSyntax}}" before statement "{{affectedStatement}}".',placeholders:{moduleName:"$1",expression:"$3",scriptName:"$4",scriptDialect:"$5",missingSyntax:"$6",affectedStatement:"$7"}},"^Cannot execute bulk operation on empty group. Group with id='(\\d+?)' doesn't have child assets.$":{gettext:'Could not execute bulk operation on an empty group. Group with ID "{{groupId}}" has no child assets.',placeholders:{groupId:"$1"}},"^Cannot execute bulk operation on empty group. DynamicGroup with id='(\\d+?)' doesn't have child assets$":{gettext:'Could not execute bulk operation on an empty group. Smart group with ID "{{groupId}}" has no child assets.',placeholders:{groupId:"$1"}},"^Cannot parse X509 certificate. : Could not parse certificate: (.+?)$":{gettext:"Could not parse X.509 certificate: {{ failureReason | translate }}.",placeholders:{failureReason:"$1"}},"^Cannot reschedule bulk operation. All its operations are successful$":{gettext:"Cannot reschedule bulk operation. All its operations are already successful."},"^Cannot reset user password : Cannot find user with such email.$":{gettext:"Cannot reset password for user with such email: email not found."},"^Cannot update/delete application binary via this endpoint$":{gettext:"Cannot update/delete application binary via this endpoint"},"^Can't delete user because it is used by another managed object$":{gettext:"Cannot delete device with associated device owner because this owner is still assigned to other device(s). Try to remove only the device."},"^Cep module created$":{gettext:"CEP module created"},"^Cep module updated$":{gettext:"CEP module updated"},"^Cep module deleted$":{gettext:"CEP module deleted"},'^Cep module "(.+?)" created$':{gettext:'CEP module "{{name}}" created',placeholders:{name:"$1"}},'^Cep module "(.+?)" updated$':{gettext:'CEP module "{{name}}" updated',placeholders:{name:"$1"}},'^Cep module "(.+?)" deleted$':{gettext:'CEP module "{{name}}" deleted',placeholders:{name:"$1"}},"^Command state is invalid: (.+)$":{gettext:"Command state is invalid: {{violations}}",placeholders:{violations:{capture:"$1",translate:{"(\\w+?) - may not be null":{gettext:'"{{field}}" must not be null',placeholders:{field:"$1"}}}}}},"^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\\.$":{gettext:'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.',placeholders:{endpointName:"$1",keyType:"$2",fingerprint:"$3",host:"$4",port:"$5"}},'^Could not login to ssh server on endpoint "(.+)"\\. Provided credential for user "(.+)" is incorrect\\.$':{gettext:'Could not access SSH server on endpoint "{{endpointName}}". Provided credentials for user "{{userName}}" are incorrect.',placeholders:{endpointName:"$1",userName:"$2"}},"^Could not save object remoteAccessUpdate: (.+)$":{gettext:"{{errorMessages}}",placeholders:{errorMessages:{capture:"$1",translate:{"Could not recognize host-key format":{gettext:'Could not recognize "Host key" format'},"Could not recognize key-pair format":{gettext:'Could not recognize the format of "Public key" or "Private key"'}}}}},"^Could not update user. : Error persisting user (.+?)!$":{gettext:'Could not update user "{{username}}".',placeholders:{username:"$1"}},"ˆCreate bulk operation$":{gettext:"Create bulk operation"},"^Create bulk operation: (.+)$":{gettext:"Create bulk operation: {{updatesList}}",placeholders:tu},"^Creation ramp must be greater than (\\d+?)$":{gettext:"Bulk operation delay must be greater than {{minSeconds}} seconds.",placeholders:{minSeconds:"$1"}},"^Created container$":{gettext:"Container created."},"^Created pod: (.+)$":{gettext:'Pod "{{imageName}}" created.',placeholders:{imageName:"$1"}},"^CSV file contained empty dataset$":{gettext:"No entries found in uploaded CSV file."},"^Cycle detected for route (.+?)!$":{gettext:"Cycle detected for route {{route}}.",placeholders:{route:"$1"}},"^Data broker processing is currently overloaded and may stop forwarding your data\\. Please contact support\\.$":{gettext:"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\\.$":{gettext:"Data broker processing is not able to connect to destination tenant, thus data forwarding is not working. Please contact support."},"^Delete bulk operation$":{gettext:"Delete bulk operation"},"^Delete bulk operation: (.+)$":{gettext:"Delete bulk operation: {{updatesList}}",placeholders:tu},"^Device id '(.+?)' contains '(.+?)' character which is not permitted.$":{gettext:'ID "{{deviceId}}" contains invalid character: "{{invalidCharacter}}".',placeholders:{deviceId:"$1",invalidCharacter:"$2"}},"^Device name: '(.+?)', alarm text: '(.+?)'$":{gettext:'Device name: "{{deviceName}}", alarm text: "{{alarmText | translate}}"',placeholders:{deviceName:"$1",alarmText:"$2"}},"^Display name$":{gettext:"Login alias"},"^Domain name in uploaded certificate differs from the one in use$":{gettext:"Domain name in uploaded certificate differs from the one in use. Please deactivate the custom domain before uploading new certificate."},"^Domain name is already in use by another tenant!$":{gettext:"Domain name is already used by another tenant."},"^Duplicated connector for instanceUrl (.+?)!$":{gettext:"Target URL {{targetUrl}} already used by another connector.",placeholders:{targetUrl:"$1"}},"^Duplicated connector for name (.+?)!$":{gettext:'Connector name "{{name}}" already used by another connector.',placeholders:{name:"$1"}},"^Entry is outside of the target dir: (.+)$":{gettext:'File entry outside of the target directory: "{{path}}".',placeholders:{path:"$1"}},"^Error during password validation. : Password must have at least (\\d+?) characters and no more than (\\d+?) and must contain only Latin1 characters.$":{gettext:"Password is invalid. It must have at least {{minCharactersCount}} and no more than {{maxCharactersCount}} characters.",placeholders:{minCharactersCount:"$1",maxCharactersCount:"$2"}},"^Error during password validation. : Your password has been used already. Choose another.$":{gettext:"This password has already been used earlier. Use a different one."},"^Error in statement (.+?):(.+?)! : Incorrect syntax near '(.+?)' near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$":{gettext:'Error in statement {{moduleName}}:{{statementNumber}}. Incorrect syntax near expression "{{expression}}" near reserved keyword "{{keyword}}".',placeholders:{moduleName:"$1",statementNumber:"$2",expression:"$3",keyword:"$4"}},"^External id not found; external id = ID \\[type=(.+?), value=(.+?)\\]$":{gettext:'External ID not found for type "{{type}}" and value "{{value}}".',placeholders:{type:"$1",value:"$2"}},"^Error occurred when trying to find an Application for id ID (.+) : Could not find application by ID (\\d+)$":{gettext:"Could not find application by ID {{applicationId}}.",placeholders:{applicationId:"$2"}},'^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"}':{gettext:"Unable to find option by given key: sigfox-agent/provider.token"},"^Failed to delete application. : Cannot remove application assigned to other tenants.$":{gettext:"Could not delete application assigned to other tenants."},"^Failed to extract certificate from PKCS12$":{gettext:"Failed to extract certificate from PKCS12."},"^Failed to update domain at the platform$":{gettext:"Failed to update domain at the platform."},"^Finding device data from database failed : No managedObject for id '(.+?)'!$":{gettext:'Could not find managed object with ID "{{deviceId}}".',placeholders:{deviceId:"$1"}},"^Following mandatory fields should be included: (.+?)$":{gettext:"Following mandatory fields should be included: {{fields}}",placeholders:{fields:"$1"}},"^Global Role updated$":{gettext:"Global role updated"},"^Global Role (.+?) updated$":{gettext:'Global role "{{name}}" updated',placeholders:{name:"$1"}},"^Global Role (.+?) updated: (.+)$":{gettext:'Global role "{{name}}" updated: {{updatesList}}',placeholders:{name:"$1",updatesList:{capture:"$2",translate:{"applications \\[([^\\]]+?)\\] added":{gettext:"applications {{list}} added",placeholders:{list:"$1"}},"applications \\[([^\\]]+?)\\] removed":{gettext:"applications {{list}} removed",placeholders:{list:"$1"}},"roles \\[([^\\]]+?)\\] added":{gettext:"roles {{list}} added",placeholders:{list:"$1"}},"roles \\[([^\\]]+?)\\] removed":{gettext:"roles {{list}} removed",placeholders:{list:"$1"}}}}}},"^Global Roles$":{gettext:"Global roles"},"^Operation updated: (.+)$":{gettext:"Operation updated: {{updatesList}}",placeholders:{updatesList:{capture:"$1",translate:{"status='(.+?)'":{gettext:'status="{{status | translate}}"',placeholders:{status:"$1"}},"description='(.+?)'":{gettext:'description="{{description | translate}}"',placeholders:{description:"$1"}},"device name='(.+?)'":{gettext:'device name="{{deviceName}}"',placeholders:{deviceName:"$1"}},"failure reason='(.+?)'":{gettext:'failure reason="{{failureReason | translate}}"',placeholders:{failureReason:"$1"}}}}}},"^ID \\[type=(.+?), value=(.+?)\\] was already bound to different Global ID.$":{gettext:'External ID "{{value}}" of the type "{{type}}" already exists.',placeholders:{type:"$1",value:"$2"}},"^Invalid credentials! : Bad credentials$":{gettext:"Invalid credentials."},"^Invalid credentials! : No phone number provided$":{gettext:"Log into the management tenant first and enter your phone number."},"^Inventory Role removed$":{gettext:"Inventory role removed"},"^Inventory Role (.+?) removed":{gettext:'Inventory role "{{name}}" deleted.',placeholders:{name:"$1"}},"^Inventory Role updated$":{gettext:"Inventory role updated"},"^Inventory Role (.+?) updated":{gettext:'Inventory role "{{name}}" updated.',placeholders:{name:"$1"}},"^I/O error: Connection refused; nested exception is Connection refused : Connection refused":{gettext:"Connection refused"},"^I/O error: Read timed out; nested exception is Read timed out : Read timed out":{gettext:"Read timed out"},"^Log file requested$":{gettext:"Log file requested."},"^Managed object deleted$":{gettext:"Managed object deleted"},'^Managed object "(.+?)" deleted$':{gettext:'Managed object "{{name}}" deleted',placeholders:{name:"$1"}},"^Maximum file size exceeded$":{gettext:"Maximum file size exceeded."},"^Message with ID (.+?) doesn't exist in smart rest template (.+?)$":{gettext:'Message with ID "{{messageId}}" doesn\'t exist in SmartREST template with ID "{{templateId}}"',placeholders:{messageId:"$1",templateId:"$2"}},"^NewDeviceRequest for id = (.+?) already exists.$":{gettext:"Device registration request with ID {{id}} already exists.",placeholders:{id:"$1"}},"^No communication with device since (.+?)$":{gettext:"No communication with device since {{timestamp | absoluteDate}}.",placeholders:{timestamp:"$1"}},"^No data received from device within required interval.$":{gettext:"No data received from device within required interval."},"^No LoRa provider settings are found. Please configure the connectivity settings.$":{gettext:"No LoRa provider settings are found. Please configure the connectivity settings."},"^Not within any context!$":{gettext:"A problem occurred with microservice subscription."},"^Maximum age cannot be bigger than 10 years.$":{gettext:"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.$":{gettext:"Microservice application name is incorrect: only lower case letters, digits and dashes allowed. Maximum length: {{maxLength}}.",placeholders:{maxLength:"$1"}},"^Microservice not available.*$":{gettext:"Microservice is not available."},"^Operation created$":{gettext:"Operation created."},"^Operation updated$":{gettext:"Operation updated."},"^Operation created: status='(.+?)'.":{gettext:'Operation created: status="{{status | translate}}".',placeholders:{status:"$1"}},"^Option created$":{gettext:"Option created."},'^Option "(.+?)" created$':{gettext:'Option "{{option}}" created.',placeholders:{option:"$1"}},"^Option deleted$":{gettext:"Option deleted."},'^Option "(.+?)" deleted$':{gettext:'Option "{{option}}" deleted.',placeholders:{option:"$1"}},"^Owner field error. : Cannot introduce cyclic dependency.":{gettext:"Could not introduce cyclic ownership dependency."},"^Password change is temporary blocked.$":{gettext:"Password change is temporarily blocked."},"^Password cipher does not match":{gettext:"Password cipher does not match."},"^Platform application cannot be added to, nor removed from any tenant.$":{gettext:"Platform application cannot be added to, nor removed from any tenant."},"^Private key must be provided in KEY_PAIR credentials$":{gettext:'Private key must be provided when "Public / private keys" option is selected.'},"^Private key cipher does not match":{gettext:"Private key cipher does not match"},'^Protocol "(.+?)" does not support "(.+?)" credentials type$':{gettext:'Protocol "{{protocol}}" does not support "{{credentialsType}}" credentials type.',placeholders:{protocol:"$1",credentialsType:"$2"}},'^pulling image "(.+)"$':{gettext:'Pulling image: "{{imageName}}".',placeholders:{imageName:"$1"}},"^Real-time event processing is currently overloaded and may stop processing your events\\. Please contact support\\.$":{gettext:"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.$":{gettext:'Could not find the resource with ID "{{id}}".',placeholders:{id:"$1"}},"^Retrieve configuration snapshot from device (.+?)":{gettext:"Retrieve configuration snapshot from device {{deviceName}}",placeholders:{deviceName:"$1"}},"^Retrieve (.+?) configuration snapshot from device (.+?)":{gettext:"Retrieve {{configurationType}} configuration snapshot from device {{deviceName}}",placeholders:{configurationType:"$1",deviceName:"$2"}},"^Scaled up replica set (.+) to (\\d+)$":{gettext:'Replica set "{{replicaSetName}}" scaled up to "{{scaleNumber}}".',placeholders:{replicaSetName:"$1",scaleNumber:"$2"}},"^Send configuration snapshot (.+?) of configuration type (.+?) to device (.+?)":{gettext:"Send configuration snapshot {{snapshotName}} of configuration type {{configurationType}} to device {{deviceName}}",placeholders:{snapshotName:"$1",configurationType:"$2",deviceName:"$3"}},"^Send configuration snapshot (.+?) to device (.+?)":{gettext:"Send configuration snapshot {{snapshotName}} to device {{deviceName}}",placeholders:{snapshotName:"$1",deviceName:"$2"}},"^Simulator state is invalid: (.+)$":{gettext:"Simulator state is invalid: {{violations}}",placeholders:{violations:{capture:"$1",translate:{"(\\w+?) - may not be null":{gettext:'"{{field}}" should not be null',placeholders:{field:"$1"}},"(\\w+?) - must be less than or equal to (\\d+)":{gettext:'"{{field}}" must be less than or equal to {{maxValue}}',placeholders:{field:"$1",maxValue:"$2"}},"(\\w+?) - should not contain null values":{gettext:'"{{field}}" should not contain null values',placeholders:{field:"$1"}}}}}},"^Smart rest template (.+?) doesn't exist$":{gettext:'SmartREST template with id "{{templateId}}" doesn\'t exist',placeholders:{templateId:"$1"}},"^Smart rule created$":{gettext:"Smart rule created."},"^Smart rule updated$":{gettext:"Smart rule updated."},"^Smart rule enabled$":{gettext:"Smart rule activated."},"^Smart rule disabled$":{gettext:"Smart rule deactivated."},"^Smart rule deleted$":{gettext:"Smart rule deleted."},'^Smart rule "(.+?)" created$':{gettext:'Smart rule "{{name}}" created.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" updated$':{gettext:'Smart rule "{{name}}" updated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" enabled$':{gettext:'Smart rule "{{name}}" activated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" disabled$':{gettext:'Smart rule "{{name}}" deactivated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" deleted$':{gettext:'Smart rule "{{name}}" deleted.',placeholders:{name:"$1"}},"^Started container$":{gettext:"Container started."},"^Successfully assigned (.+) to (.+)$":{gettext:'"{{imageName}}" assigned to "{{address}}".',placeholders:{imageName:"$1",address:"$2"}},'^Successfully pulled image "(.+)"$':{gettext:'Image "{{imageName}}" pulled.',placeholders:{imageName:"$1"}},"^Tenant creation failed. : Tenant with given id already exists.$":{gettext:"Could not create a tenant. Tenant with given domain/URL already exists."},'^Tenant id cannot be a reserved sql keyword "(.+?)".$':{gettext:'Could not use a reserved SQL keyword "{{tenantId}}" as a domain name.',placeholders:{tenantId:"$1"}},'^Tenant "(.+?)" activated$':{gettext:'Tenant "{{tenant}}" activated.',placeholders:{tenant:"$1"}},"^Tenant (.+?) has sub-tenants, please remove them first!$":{gettext:'Could not remove tenant "{{tenant}}". Remove its subtenants first.',placeholders:{tenant:"$1"}},"^Tenant activated$":{gettext:"Tenant activated"},'^Tenant "(.+?)" created$':{gettext:'Tenant "{{tenant}}" created.',placeholders:{tenant:"$1"}},"^Tenant created$":{gettext:"Tenant created"},'^Tenant "(.+?)" deleted$':{gettext:'Tenant "{{tenant}}" deleted.',placeholders:{tenant:"$1"}},"^Tenant deleted$":{gettext:"Tenant deleted"},'^Tenant "(.+?)" suspended$':{gettext:'Tenant "{{tenant}}" suspended.',placeholders:{tenant:"$1"}},"^Tenant suspended$":{gettext:"Tenant suspended"},'^Tenant "(.+?)" updated: (.+?)$':{gettext:'Tenant "{{tenant}}" updated: {{properties}}.',placeholders:{tenant:"$1",properties:"$2"}},"^Tenant updated$":{gettext:"Tenant updated"},"^Too Many Requests$":{gettext:"Too many requests. Try again later."},"^User alias equals username '(.+)'$":{gettext:"Username and login alias must be different."},"^User created$":{gettext:"User created"},"^User (.+?) created$":{gettext:'User "{{name}}" created',placeholders:{name:"$1"}},"^User deleted$":{gettext:"User deleted"},"^User (.+?) deleted$":{gettext:'User "{{name}}" deleted',placeholders:{name:"$1"}},"^User updated$":{gettext:"User updated"},"^User (.+?) updated: (.+)$":{gettext:'User "{{name}}" updated: {{updatesList}}',placeholders:{name:"$1",updatesList:{capture:"$2",translate:{"delegatedBy='(.+?)'":{gettext:'delegated by: "{{delegate}}"',placeholders:{delegate:"$1"}},"owner='(.+?)'":{gettext:'owner: "{{owner}}"',placeholders:{owner:"$1"}},"inventory assignment \\[(.+?)\\] added":{gettext:"inventory assignment [{{inventoryAssignment}}] added",placeholders:{inventoryAssignment:"$1"}},"inventory assignment \\[(.+?)\\] removed":{gettext:"inventory assignment [{{inventoryAssignment}}] removed",placeholders:{inventoryAssignment:"$1"}},"applications \\[(.+?)\\] added$":{gettext:"applications [{{applicationsList}}] added",placeholders:{applicationsList:"$1"}},"applications \\[(.+?)\\] removed$":{gettext:"applications [{{applicationsList}}] removed",placeholders:{applicationsList:"$1"}},"global roles \\[(.+?)\\] added$":{gettext:"global roles [{{globalRolesList}}] added",placeholders:{globalRolesList:"$1"}},"global roles \\[(.+?)\\] removed$":{gettext:"global roles [{{globalRolesList}}] removed",placeholders:{globalRolesList:"$1"}}}}}},"^User with username '(.+?)' already exists! : Duplicated: (.+?)$":{gettext:'User "{{username}}" already exists.',placeholders:{username:"$1"}},"^User with username or alias '(.+)' already exists! : Duplicated: (.+)$":{gettext:'User with username or login alias "{{usernameOrAlias}}" already exists.',placeholders:{usernameOrAlias:"$1"}},"^User with email '(.+?)' already exists! : Duplicated: (.+?)$":{gettext:'User with email "{{email}}" already exists.',placeholders:{email:"$1"}},"^unable to find option with given key (.+?) : Could not find entity Option by ID (.+?)!$":{gettext:'Unable to get tenant option: "{{option}}".',placeholders:{option:"$2"}},"^unable to find option with given key (.+?) : There is no system property for key (.+?)$":{gettext:'Unable to get system option: "{{option}}".',placeholders:{option:"$2"}},"^Write failed with error code 16733 and error message 'trying to index text where term list is too big, max is 4mb _id: \"(.+?)\"'$":{gettext:"The uploaded image cannot be bigger than 4 MB. Please upload a smaller one."},"^Write failed with error code 17280 and error message 'WiredTigerIndex::insert: key too large to index, failing (.+?) { : \"(.+?)\" }'$":{gettext:"The chosen name is too long. Please try a shorter one."},"^You have reached devices limit. No more devices can be registered.$":{gettext:"You reached devices limit. No more devices can be registered."},'^(.+) succeeded for volume "(.+)"':{gettext:'Operation "{{operation}}" succeeded for volume "{{volume}}".',placeholders:{operation:"$1",volume:"$2"}},"^Exception on tenant (.+) in statement '(.+)': Invocation exception when invoking method '(.+)' of class '(.+)' passing parameters \\[(.+)\\] for statement '(.+)': (.+) : (.+)$":{gettext:'Exception on tenant {{tenantId}} in statement "{{moduleName}}": Invocation exception when invoking method "{{methodName}}" of class "{{classPath}}" passing parameters [{{parameters}}] for statement "{{statement}}": {{exceptionType}} : {{exceptionMessage}}.',placeholders:{tenantId:"$1",moduleName:"$2",methodName:"$3",classPath:"$4",parameters:"$5",statement:"$6",exceptionType:"$7",exceptionMessage:"$8"}},"^No nodes are available that match all of the predicates: (.+).$":{gettext:"No nodes are available that match all of the predicates: [{{predicates}}].",placeholders:{predicates:"$1"}},"^Readiness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$":{gettext:"Readiness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).",placeholders:{requestMethod:"$1",uri:"$2",protocol:"$3"}},"^Liveness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$":{gettext:"Liveness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).",placeholders:{requestMethod:"$1",uri:"$2",protocol:"$3"}},"^Error syncing pod$":{gettext:"Pod synchronization error."},"^Failed create pod sandbox.$":{gettext:"Pod sandbox creation failed."},'^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"\\}$':{gettext:'Exception on tenant {{tenantId}} in statement "{{statement}}": HTTP status code: {{httpStatusCode}} : {{message | translate}}',placeholders:{tenantId:"$1",statement:"$2",httpStatusCode:"$3",message:"$4"}},"^User '(.+)' is managed by a remote identity management service defined by an administrator, direct update is forbidden$":{gettext:'User "{{userName}}" is managed by a remote identity management service defined by an administrator, direct update is forbidden.',placeholders:{userName:"$1"}},'^Added new child device to "(.+)" \\(ID: (.+)\\).$':{gettext:'Added new child device to "{{parentDeviceName}}" (ID: {{parentDeviceId}}).',placeholders:{parentDeviceName:"$1",parentDeviceId:"$2"}},'^Updated child device of "(.+)" \\(ID: (.+)\\).$':{gettext:'Updated child device of "{{parentDeviceName}}" (ID: {{parentDeviceId}}).',placeholders:{parentDeviceName:"$1",parentDeviceId:"$2"}},'^Added child device "(.+)" \\(ID: (.+)\\).$':{gettext:'Added child device "{{name}}" (ID: {{id}}).',placeholders:{name:"$1",id:"$2"}},'^Removed child device "(.+)" \\(ID: (.+)\\).$':{gettext:'Removed child device "{{name}}" (ID: {{id}}).',placeholders:{name:"$1",id:"$2"}},'^Change value of "(.+)" to (.+) (.+).$':{gettext:'Change value of "{{name}}" to {{value}}{{unit}}.',placeholders:{name:"$1",value:"$2",unit:"$3"}},'^Change value of "(.+)" to (.+).$':{gettext:'Change value of "{{name}}" to {{value}}.',placeholders:{name:"$1",value:"$2"}},'^Change status of "(.+)" to "(.+)".$':{gettext:'Change status of "{{name}}" to "{{label}}".',placeholders:{name:"$1",label:"$2"}},'^Send message "(.+)".$':{gettext:'Send message "{{str}}".',placeholders:{str:"$1"}},"^Close relay (.+).$":{gettext:"Close relay {{number}}.",placeholders:{number:"$1"}},"^Open relay (.+).$":{gettext:"Open relay {{number}}.",placeholders:{number:"$1"}},"^Change trace status to (.+).$":{gettext:"Change trace status to {{state | translate}}.",placeholders:{state:"$1"}},"^Change relay status to (.+).$":{gettext:"Change relay status to {{status | translate}}.",placeholders:{status:"$1"}},"^Closing relay (.+).$":{gettext:"Closing relay {{number}}.",placeholders:{number:"$1"}},"^Opening relay (.+).$":{gettext:"Opening relay {{number}}.",placeholders:{number:"$1"}},"^Update bulk operation$":{gettext:"Update bulk operation"},"^Update bulk operation: (.+)$":{gettext:"Update bulk operation: {{updatesList}}",placeholders:tu},'^Update firmware to: "?(.+?)"? \\(version: (.+)\\)\\.?$':{gettext:'Update firmware to: "{{ name }}" (version: {{ version }})',placeholders:{name:"$1",version:"$2"}},'^Update firmware to: "?(.+?)"?\\.?$':{gettext:'Update firmware to: "{{ name }}"',placeholders:{name:"$1"}},"^Update configuration to (.+).$":{gettext:"Update configuration to: {{ name }}.",placeholders:{name:"$1"}},"^Apply device profile: (.+).?$":{gettext:"Apply device profile: {{ name }}",placeholders:{name:"$1"}},"^Execute generic command: (.+).?$":{gettext:"Execute generic command: {{command}}",placeholders:{command:"$1"}},"^Failed to refresh application. : Cannot refresh non local-hosted application.$":{gettext:"Could not reactivate the application as it is not hosted locally."},"^Failed to refresh application. : Cannot refresh application without active version id.$":{gettext:"Could not reactivate the application as it has no active version."},"^Scaled down replica set (.+) to (\\d+)$":{gettext:'Replica set "{{replicaSetName}}" scaled down to "{{scaleNumber}}".',placeholders:{replicaSetName:"$1",scaleNumber:"$2"}},"^Deleted pod: (.+)$":{gettext:'Pod "{{imageName}}" deleted.',placeholders:{imageName:"$1"}},'^Container image "(.+)" already present on machine$':{gettext:'Container image "{{imageName}}" already exists.',placeholders:{imageName:"$1"}},"^Error updating tenant! Cannot insert second configuration for Password code grant internal/Bad Request$":{gettext:"This login mode was already set by another administrator. Refresh the page to update the data."}},au=function(){function e(){this.cachedDictionary={}}return e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"})],e)}(),su=function(){function e(e,t,n,a,s){void 0===a&&(a=null),void 0===s&&(s=null),this.http=e,this.optionsService=t,this.cachedLocaleDictionaryService=n,this.path=a,this.languages=s}return e.prototype.getTranslation=function(e){var t=this,n=""+(this.path||"")+e+".json";return this.languages&&this.languages[e]&&this.languages[e].url&&(n=this.languages[e].url),this.http.get(n).pipe(s.map((function(n){return t.optionsService.langsDetails&&t.optionsService.langsDetails[e]?fc({},n[e],t.optionsService.langsDetails[e]):n[e]})),s.tap((function(n){t.cachedLocaleDictionaryService.cachedDictionary[e]=n})),s.map((function(e){return t.getDictionaryWithTrimmedKeys(e)})),s.catchError((function(){return a.of({})})))},e.prototype.getDictionaryWithTrimmedKeys=function(e){return o.mapKeys(e,(function(e,t){return ou(t)}))},e.ctorParameters=function(){return[{type:d.HttpClient},{type:qc},{type:au},{type:String,decorators:[{type:t.Inject,args:[Jc]}]},{type:void 0,decorators:[{type:t.Inject,args:[Zc]}]}]},e=yc([t.Injectable(),vc(3,t.Inject(Jc)),vc(4,t.Inject(Zc))],e)}();function ou(e){return e.replace(/(\r\n|\n|\r)/gm,"").replace(/\s{2,}/g," ").trim()}var ru=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return hc(n,e),n.prototype.getValue=function(e,t){var n=ou(t),a=o.get(e,[n]);a||t.split(".").length>1&&(a=o.get(e,t));return a},n=yc([t.Injectable()],n)}(i.TranslateDefaultParser),lu=function(){function e(e,n,a){var s=this;this.translateService=e,this.element=n,this._ref=a,this.htmlUpdateEvent=new t.EventEmitter,this.onTranslationChangeSub||(this.onTranslationChangeSub=this.translateService.onTranslationChange.subscribe((function(e){e.lang===s.translateService.currentLang&&s.checkNodes()}))),this.onLangChangeSub||(this.onLangChangeSub=this.translateService.onLangChange.subscribe((function(e){s.checkNodes()}))),this.onDefaultLangChangeSub||(this.onDefaultLangChangeSub=this.translateService.onDefaultLangChange.subscribe((function(e){s.checkNodes()})))}return Object.defineProperty(e.prototype,"translateParams",{set:function(e){o.isEqual(this.currentParams,e)||(this.currentParams=e,this.checkNodes())},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewChecked=function(){this.checkNodes()},e.prototype.checkNodes=function(){this.isLookupKeyMissing()&&(this.element.nativeElement.lookupKey=this.getLookupKey()),this.translateAndUpdateHtmlContent(),this.htmlUpdateEvent.emit()},e.prototype.ngOnDestroy=function(){this.onLangChangeSub&&this.onLangChangeSub.unsubscribe(),this.onDefaultLangChangeSub&&this.onDefaultLangChangeSub.unsubscribe(),this.onTranslationChangeSub&&this.onTranslationChangeSub.unsubscribe(),this.htmlUpdateEvent.complete()},e.prototype.getLookupKey=function(){return this.element.nativeElement.innerHTML.replace(/<!--.*?-->/gs,"").trim()},e.prototype.isLookupKeyMissing=function(){return!this.element.nativeElement.lookupKey},e.prototype.lookupKeyExist=function(){return this.element.nativeElement.lookupKey},e.prototype.translateAndUpdateHtmlContent=function(){this.lookupKeyExist()&&(this.element.nativeElement.innerHTML=this.translateService.instant(this.element.nativeElement.lookupKey,this.currentParams||{}))},e.ctorParameters=function(){return[{type:i.TranslateService},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},yc([t.Input()],e.prototype,"translateParams",null),e=yc([t.Directive({selector:"[forceHtmlTranslate]"})],e)}();try{require("@c8y/ngx-components/locales/de.po"),require("@c8y/ngx-components/locales/en.po"),require("@c8y/ngx-components/locales/es.po"),require("@c8y/ngx-components/locales/fr.po"),require("@c8y/ngx-components/locales/ja_JP.po")}catch(e){}var iu={en:"en-GB","en-EN":"en-GB"};function cu(e,t,n,a,s){return new su(e,t,n,a,s)}function uu(e){return e.localePath}function du(e){return e.languages}function pu(e){return{get lang(){return mu(e.state.lang||"en")},toLowerCase:function(){return this.lang.toLowerCase()},toString:function(){return this.lang}}}function mu(e){return iu[e]||e}var gu=function(){function e(){}var n;return n=e,e.providers=function(){return[{provide:t.LOCALE_ID,useFactory:pu,deps:[$c]},{provide:Xc,useValue:nu,multi:!0},{provide:Jc,useFactory:uu,deps:[qc]},{provide:Zc,useFactory:du,deps:[qc]},{provide:i.TranslateLoader,useFactory:cu,deps:[d.HttpClient,qc,au,Jc,Zc]},{provide:i.TranslateCompiler,useClass:i.TranslateFakeCompiler},{provide:i.TranslateParser,useClass:ru},{provide:i.MissingTranslationHandler,useClass:eu},i.TranslateStore,i.TranslateService,{provide:i.USE_STORE,useValue:void 0},{provide:i.USE_DEFAULT_LANG,useValue:void 0},{provide:i.USE_EXTEND,useValue:!1},{provide:i.DEFAULT_LANGUAGE,useValue:void 0}]},e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e=n=yc([t.NgModule({exports:[i.TranslateModule,lu],imports:[d.HttpClientModule],declarations:[lu]})],e)}();var hu=new Map;function fu(e){return new Promise((function(t,n){hu.has(e)?t(hu.get(e)):fetch("assets/locales/angular/"+e+".js").then((function(e){return e.text()})).then((function(n){var a=function(e){var t=e.split(/\n/).map((function(e){return e.trim()})).filter(Boolean).filter((function(e){return!e.match(/^\/?\*/)&&!e.match(/^\/\//)})).join("\n");return new Function("var exports = {};\nvar module = { exports: exports };\n"+t+"\nreturn exports;")()}(n);hu.set(e,a),t(a)})).catch(n)}))}var yu,vu,ju,bu,wu,Su,Cu=function(){function e(e,t,n){var a=this;this.ngxTranslate=e,this.ui=t,this.options=n,this.langsDetail=this.options.get("languages",{}),this.langs=o.keys(this.langsDetail).filter((function(e){return a.langsDetail[e]})),this.DEFAULT_SEPARATOR="_";var s=this.queryStringLang();s&&this.saveInLocalStorage(s)}var n;return n=e,e.defaultLang=function(){return window.localStorage.getItem(n.SAVE_LANGUAGE_KEY)},e.prototype.switchToLanguage=function(e){return jc(this,void 0,void 0,(function(){var t,n,a;return bc(this,(function(s){switch(s.label){case 0:t=e.replace("_","-"),s.label=1;case 1:return s.trys.push([1,3,,7]),[4,this.loadLocales(t)];case 2:return s.sent(),[3,7];case 3:return n=s.sent(),(a=t.split("-").shift())===t?[3,5]:[4,this.loadLocales(a)];case 4:return s.sent(),[3,6];case 5:throw n;case 6:return[3,7];case 7:return this.setLanguage(e),[2]}}))}))},e.prototype.loadLocales=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return[4,fu(mu(e))];case 1:return t=n.sent(),c.registerLocaleData(t.default),[2]}}))}))},e.prototype.setLanguage=function(e){var t=this;this.ngxTranslate.setDefaultLang(this.options.get("defaultLanguage","en")),this.ngxTranslate.use(e).subscribe((function(){t.ui.state$.next(fc({},t.ui.state,{lang:e}))}))},e.prototype.firstSupportedLanguage=function(){var e=this,t=[this.queryStringLang(),this.localStorageLang()].concat([this.options.get("defaultLanguage")]).concat(this.browserLangs()).concat(["en"]).filter(Boolean).find((function(t){return e.getSupported(t)}));return this.getSupported(t)},e.prototype.convertToLanguageCodePO=function(e){var t=e.indexOf("-")>-1?"-":this.DEFAULT_SEPARATOR,n=wc(e.split(t),2),a=n[0],s=n[1];return""+a+(s?""+this.DEFAULT_SEPARATOR+s:"")},e.prototype.getNativeLanguage=function(e){return((this.langsDetail||{})[e]||{}).nativeName||e},e.prototype.saveInLocalStorage=function(e){window.localStorage.setItem(n.SAVE_LANGUAGE_KEY,e)},e.prototype.getSupported=function(e){return this.langs.find((function(t){return t===e}))||this.langs.find((function(t){return t.startsWith(e)}))},e.prototype.queryStringLang=function(){return this.getQueryParameter("lang")},e.prototype.localStorageLang=function(){return window.localStorage.getItem(n.SAVE_LANGUAGE_KEY)},e.prototype.browserLangs=function(){var e=window.navigator;return["languages","language","browserLanguage","systemLanguage","userLanguage"].reduce((function(t,n){var a=e[n];return"string"==typeof a?t.push(a):Array.isArray(a)&&(t=t.concat(a)),t}),[])},e.prototype.getQueryParameter=function(e){var t;return window.location.search.substring(1).split("&").find((function(n){var a=wc(n.split("="),2),s=a[0],o=a[1];return s===e&&(t=o),t})),t},e.SAVE_LANGUAGE_KEY="c8y_language",e.ctorParameters=function(){return[{type:i.TranslateService},{type:$c},{type:qc}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(i.TranslateService),t.ɵɵinject($c),t.ɵɵinject(qc))},token:e,providedIn:"root"}),e=n=yc([t.Injectable({providedIn:"root"})],e)}(),Iu=function(e){function n(t,n){var a=e.call(this,t)||this;return a.translateService=n,a}return hc(n,e),n.prototype.transform=function(t,n,a,s){void 0===n&&(n="medium");var o=t,r=!1,l=!1;"number"!=typeof t||isNaN(t)||(o=Math.min(t,864e13),o=Math.max(o,-864e13),r=t<-864e13,l=t>864e13);var i=e.prototype.transform.call(this,o,n,a,s);return r?i=this.translateService.instant("before {{date}}",{date:i}):l&&(i=this.translateService.instant("after {{date}}",{date:i})),i},n.ctorParameters=function(){return[{type:String,decorators:[{type:t.Inject,args:[t.LOCALE_ID]}]},{type:i.TranslateService}]},n=yc([t.Pipe({name:"c8yDate"}),vc(0,t.Inject(t.LOCALE_ID))],n)}(c.DatePipe),Pu=function(){function e(e){this.element=e,this.useIntersection=!0,this.hidden=!1,this.class="c8y-list__item bg-transparent",this.maxIterations=10,this.onLoad=new t.EventEmitter,this.isLoading=!1,this.counter=0,this.showNoMoreDataHint=!1,this.LOAD_SAME_PAGE_THRESHOLD=50}return Object.defineProperty(e.prototype,"hostClass",{get:function(){return this.hidden||!this.hasMore&&!this.showNoMoreDataHint?"":this.class},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasMore",{get:function(){return this.paging&&(this.paging.totalPages>this.paging.currentPage||!!this.paging.nextPage)},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.useIntersection&&"IntersectionObserver"in window&&(this.intersectionObserver=new IntersectionObserver((function(t){return e.buttonInView(t[0])}),{root:this.container?this.container.nativeElement:null}),this.intersectionObserver.observe(this.element.nativeElement)),this.showNoMoreDataHint=this.shouldShowNoMoreDataHint()},e.prototype.ngOnDestroy=function(){this.intersectionObserver&&this.intersectionObserver.disconnect()},e.prototype.loadMore=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return this.isLoading=!0,e&&e.stopPropagation(),this.hasMore?[4,this.paging.next()]:[3,2];case 1:return t=n.sent(),this.counter++,this.paging=t.paging,this.onLoad.emit(t.data),this.intersectionLoading(),this.showNoMoreDataHint=this.shouldShowNoMoreDataHint(),[3,3];case 2:this.counter=0,this.isLoading=!1,n.label=3;case 3:return[2]}}))}))},e.prototype.intersectionLoading=function(){var e=this;this.useIntersection&&this.hasMore&&null!==this.loadUntilIntersected?(this.loadUntilIntersected=setTimeout((function(){return e.loadMore()}),this.getLoadingThreshold()),this.useIntersection=this.shouldSwitchMode()):(this.isLoading=!1,this.loadUntilIntersected=void 0)},e.prototype.getLoadingThreshold=function(){return this.LOAD_SAME_PAGE_THRESHOLD*this.counter},e.prototype.shouldShowNoMoreDataHint=function(){return(0!==this.counter||this.noMoreDataHint)&&!this.hasMore&&!this.hidden},e.prototype.shouldSwitchMode=function(){return this.counter<this.maxIterations||this.hidden},e.prototype.buttonInView=function(e){e.isIntersecting?this.loadMore():this.loadUntilIntersected?(clearTimeout(this.loadUntilIntersected),this.loadUntilIntersected=null,this.isLoading=!1):this.loadUntilIntersected=null},e.ctorParameters=function(){return[{type:t.ElementRef}]},yc([t.Input()],e.prototype,"paging",void 0),yc([t.Input()],e.prototype,"useIntersection",void 0),yc([t.Input()],e.prototype,"hidden",void 0),yc([t.Input()],e.prototype,"container",void 0),yc([t.Input()],e.prototype,"class",void 0),yc([t.Input()],e.prototype,"maxIterations",void 0),yc([t.Input()],e.prototype,"noMoreDataHint",void 0),yc([t.Input()],e.prototype,"loadNextLabel",void 0),yc([t.Input()],e.prototype,"loadingLabel",void 0),yc([t.Output()],e.prototype,"onLoad",void 0),yc([t.HostBinding("class")],e.prototype,"hostClass",null),e=yc([t.Component({selector:"c8y-load-more",template:'<button\n class="btn btn-default btn-block text-center"\n (click)="loadMore($event)"\n [ngClass]="{ \'btn-pending\': isLoading }"\n *ngIf="hasMore"\n [style.visibility]="hidden ? \'hidden\' : \'visible\'"\n [style.height]="hidden ? \'1px\' : null"\n title="{{ \'Load more\' | translate }}"\n>\n <ng-container *ngIf="!isLoading">\n <span *ngIf="loadNextLabel; else loadPage" [innerHTML]="loadNextLabel | translate"></span>\n <ng-template #loadPage>\n <span translate ngNonBindable [translateParams]="{ pageNo: paging.currentPage + 1 }">\n Load page {{ pageNo }}</span\n >\n </ng-template>\n </ng-container>\n <ng-container *ngIf="isLoading">\n <span *ngIf="loadingLabel; else loading" [innerHTML]="loadingLabel | translate"></span>\n <ng-template #loading>\n <span translate ngNonBindable [translateParams]="{ pageNo: paging.currentPage + 1 }">\n Page {{ pageNo }} is loading…\n </span>\n </ng-template>\n </ng-container>\n</button>\n\n<ng-container *ngIf="showNoMoreDataHint">\n <ng-container *ngTemplateOutlet="noMoreDataHint || finishHint"></ng-container>\n</ng-container>\n\n<ng-template #finishHint>\n <div class="legend form-block center">\n <i [c8yIcon]="\'flag-checkered\'" class="m-r-4"></i>\n {{ \'Last record\' | translate }}\n </div>\n</ng-template>\n'})],e)}(),Ou=function(){function e(e,t,n){this.tpl=e,this.vcr=t,this.componentFactoryResolver=n,this.cachedData=[],this.loadMoreMode="auto",this.dataPipe=a.pipe(s.tap()),this.maxIterations=10,this.unsubscribe$=new a.Subject}return Object.defineProperty(e.prototype,"shouldUseLoadMoreButton",{get:function(){return"auto"===this.loadMoreMode||"show"===this.loadMoreMode||"hidden"===this.loadMoreMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasMoreData",{get:function(){return this.loadMore&&this.loadMore.hasMore},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.cachedData.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForOf",{set:function(e){var t=this;e&&(this.obs$=(a.isObservable(e)?e:a.of(e)).pipe(s.map((function(e){if(null===e)return t.paging=null,[];var n=e.paging,a=e.data;return t.paging=n,a}))))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForLoadMore",{set:function(e){this.loadMoreMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForPipe",{set:function(e){e&&(this.dataPipe=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForNotFound",{set:function(e){this.notFoundTemplate=e,this.loadMore&&(this.loadMore.noMoreDataHint=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForMaxIterations",{set:function(e){this.maxIterations=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForRealtime",{set:function(e){this.realtime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForComparator",{set:function(e){this.comparator=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.handleRealtime()},e.prototype.ngOnChanges=function(e){var t=this;if(this.obs$&&(e.c8yForPipe||e.c8yForOf)){this.unsubscribePaging();var n=!this.hasMoreData&&!!e.c8yForPipe&&!e.c8yForOf;n&&(this.obs$=a.of(this.cachedData)),this.pagingSub=this.obs$.pipe(s.tap((function(e){n||(t.cachedData=e)}))).pipe((function(e){return t.dataPipe(e)})).subscribe((function(e){t.render(e,n)}))}},e.prototype.ngOnDestroy=function(){this.unsubscribePaging(),this.unsubscribe$.next(),this.unsubscribe$.complete()},e.prototype.handleRealtime=function(){var e=this;this.realtime&&(this.realtime.onCreate$().pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.insert(t)})),this.realtime.onUpdate$().pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.update(t)})),this.realtime.onDelete$().pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.remove(Xi.coerceNumberProperty(t))})))},e.prototype.render=function(e,t){var n=this;void 0===t&&(t=!1),this.vcr.clear(),e.forEach((function(e,t){var a={$implicit:e,index:t,length:n.length,hasMore:n.hasMoreData};n.vcr.createEmbeddedView(n.tpl,a)})),this.shouldUseLoadMoreButton&&(this.loadMore=this.createLoadMoreButtonComponent(t))},e.prototype.append=function(e){var t=this;e.forEach((function(e){var n=t.shouldUseLoadMoreButton?t.vcr.length-1:t.vcr.length,a={$implicit:e,index:n,length:t.length,hasMore:t.hasMoreData};t.vcr.createEmbeddedView(t.tpl,a,n)}))},e.prototype.loadMoreData=function(e){e.length>0&&this.append(e)},e.prototype.createLoadMoreButtonComponent=function(e){var t=this,n=this.componentFactoryResolver.resolveComponentFactory(Pu),a=this.vcr.createComponent(n).instance;return a.paging=this.paging,a.useIntersection="auto"===this.loadMoreMode||"hidden"===this.loadMoreMode,a.hidden="hidden"===this.loadMoreMode,a.maxIterations=this.maxIterations,a.noMoreDataHint=this.notFoundTemplate,this.pagingSub=a.onLoad.pipe(s.map((function(e){return t.checkForDuplicates(e)})),s.tap((function(e){t.cachedData=t.cachedData.concat(e)}))).pipe((function(e){return t.dataPipe(e)})).subscribe((function(e){return t.loadMoreData(e)})),e&&o.assign(a,this.loadMore),a},e.prototype.insert=function(e){var t=0;if(this.comparator&&this.cachedData.length){var n=void 0;do{var a=this.vcr.get(t),s=o.get(a,"context.$implicit");(n=e&&s?this.comparator(e,s):0)<=0&&t++}while(n<=0&&t<this.cachedData.length)}if(t<this.cachedData.length||0===this.cachedData.length){var r={$implicit:e,index:t,length:this.length,hasMore:this.hasMoreData};this.cachedData.splice(t,0,e);var l=this.tpl.createEmbeddedView(r);this.vcr.insert(l,t)}},e.prototype.update=function(e){this.forMatchingEmbeddedViewRef((function(t){return t&&e&&t.id===e.id}),(function(t){t.context.$implicit=e,t.markForCheck()}))},e.prototype.remove=function(e){this.forMatchingEmbeddedViewRef((function(t){return t&&Xi.coerceNumberProperty(t.id,NaN)===e}),(function(e){return e.destroy()}))},e.prototype.forMatchingEmbeddedViewRef=function(e,t){for(var n=0;n<this.vcr.length;n++){var a=this.vcr.get(n);e(o.get(a,"context.$implicit"))&&t(a)}},e.prototype.checkForDuplicates=function(e){var t=this;return this.realtime?e.filter((function(e){return!t.cachedData.some((function(t){return t.id===e.id}))})):e},e.prototype.unsubscribePaging=function(){this.pagingSub&&this.pagingSub.unsubscribe()},e.ctorParameters=function(){return[{type:t.TemplateRef},{type:t.ViewContainerRef},{type:t.ComponentFactoryResolver}]},yc([t.Input()],e.prototype,"c8yForOf",null),yc([t.Input()],e.prototype,"c8yForLoadMore",null),yc([t.Input()],e.prototype,"c8yForPipe",null),yc([t.Input()],e.prototype,"c8yForNotFound",null),yc([t.Input()],e.prototype,"c8yForMaxIterations",null),yc([t.Input()],e.prototype,"c8yForRealtime",null),yc([t.Input()],e.prototype,"c8yForComparator",null),e=yc([t.Directive({selector:"[c8yFor]"})],e)}(),xu=function(){function e(e){this.translateService=e,this.internalApps={administration:"Administration",cockpit:"Cockpit",devicemanagement:"Device management"}}return e.prototype.transform=function(e){void 0===e&&(e="Cumulocity");var t,n=this.getAppName(e);return t=this.isPublicApp(e)?"{{ appName | translate }} (public)":n,this.translateService.get(t,{appName:n})},e.prototype.getAppName=function(e){var t=this.getFirstDefined([Qi.get(e,"name"),Qi.get(e,"contextPath"),e])||"";return this.internalApps[t]||t},e.prototype.getFirstDefined=function(e){return Qi.find(e,Qi.negate(Qi.isUndefined))},e.prototype.isPublicApp=function(e){return Boolean(Qi.get(e,"public"))},e.ctorParameters=function(){return[{type:i.TranslateService}]},e=yc([t.Pipe({name:"humanizeAppName"})],e)}(),Eu=function(){function e(){}var n;return n=e,e.humanize=function(e){return void 0===e&&(e=""),e=e.replace(/\./g," ").replace(/c8y[\s,_]*/gi,"").replace(/_/g," ").replace(/([A-Z][a-z])/g," $1").replace(/^\$\.?/,"").replace(/^\s*/,"").replace(/\s*$/,"").replace(/\s+/g," "),o.upperFirst(e)},e.prototype.transform=function(e){return n.humanize(e)},e=n=yc([t.Pipe({name:"humanize"})],e)}(),ku=function(){function e(e,t){this.el=e,this.renderer=t,this.c8yMatch=/^c8y-/,this.klasses=[],this.currentClasses=""}return Object.defineProperty(e.prototype,"c8yIcon",{set:function(e){this.updateIcon(e)},enumerable:!0,configurable:!0}),e.prototype.isC8y=function(e){return this.c8yMatch.test(e)},e.prototype.getClasses=function(e){void 0===e&&(e="");var t="";if(e){var n=e.trim(),a=this.isC8y(n);t=(a?"c8y-icon":"fa fw")+" "+(a?n.replace(this.c8yMatch,"c8y-icon-"):"fa-"+n)}return t},e.prototype.updateIcon=function(e){var t=this,n=this.getClasses(e);n!==this.currentClasses&&(this.currentClasses.split(/\s/).filter((function(e){return e})).forEach((function(e){t.renderer.removeClass(t.el.nativeElement,e)})),n.split(/\s/).filter((function(e){return e})).forEach((function(e){t.renderer.addClass(t.el.nativeElement,e)})),this.currentClasses=n)},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},yc([t.Input()],e.prototype,"c8yIcon",null),e=yc([t.Directive({selector:"[c8yIcon]"})],e)}(),Tu=["home","th","bar-chart-o","tasks","tachometer","bell","puzzle-piece","map-marker","location-arrow","globe","power-off","desktop","laptop","mobile","signal","qrcode","file","file-text","folder","folder-open","archive","hdd-o","book","bookmark","tag","flag","search","heart","star","bolt","rocket","cog","cogs","wrench","ban","user","users","sign-in","sign-out","upload","download","cloud-upload","cloud-download","cloud","spinner","refresh","repeat","undo","lock","unlock","info","question","exclamation","bug","calendar","random","asterisk","key","link","chain-broken","external-link","picture-o","comment","bullhorn","phone","lightbulb-o","flask","sitemap","exchange","code-fork","keyboard-o","terminal","code","clipboard","pencil","envelope","inbox","reply","share","thumbs-up","thumbs-down","check","plus","expand","compress","arrows","arrow-up","arrow-down","arrow-left","arrow-right","th-list","bars","table","columns","filter","sort","sort-up","sort-down","ellipsis-h","ellipsis-v","rss","apple","windows","android","linux"],Au=function(){function e(){}return e.prototype.transform=function(e,t,n){return t.apply(n||this,Array.isArray(e)?e:[e])},e=yc([t.Pipe({name:"map"})],e)}(),_u=function(){function e(e,t,n,a){this.viewContainer=e,this.resolver=t,this.renderer=n,this.el=a,this.properties={}}return Object.defineProperty(e.prototype,"c8yOutlet",{set:function(e){if(e)if(this._element instanceof Element&&this.renderer.removeChild(this._element.parentElement,this._element),this.viewContainer.clear(),e instanceof t.TemplateRef)this.viewContainer.createEmbeddedView(e);else if(e instanceof Element){var n=this.renderer.parentNode(this.el.nativeElement);this.destroy(),this._element=e,this.renderer.insertBefore(n,this._element,this.el.nativeElement)}else{var a=this.resolver.resolveComponentFactory(e),s=this.viewContainer.createComponent(a);o.assign(s.instance,this.properties)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yOutletProperties",{set:function(e){this.properties=e},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.destroy()},e.prototype.destroy=function(){if(this._element){var e=this.renderer.parentNode(this._element);this.renderer.removeChild(e,this._element)}},e.ctorParameters=function(){return[{type:t.ViewContainerRef},{type:t.ComponentFactoryResolver},{type:t.Renderer2},{type:t.ElementRef}]},yc([t.Input()],e.prototype,"c8yOutlet",null),yc([t.Input()],e.prototype,"c8yOutletProperties",null),e=yc([t.Directive({selector:"[c8yOutlet]"})],e)}(),Nu=function(){function e(){this.message="Loading…",this.progress=null}return yc([t.Input()],e.prototype,"message",void 0),yc([t.Input()],e.prototype,"progress",void 0),e=yc([t.Component({selector:"c8y-progress-bar",template:'<div>\n <p *ngIf="message">\n {{ message | translate }}\n </p>\n <div class="progress progress-striped active" *ngIf="progress !== null">\n <div\n class="progress-bar"\n role="progressbar"\n [attr.aria-valuenow]="progress"\n aria-valuemin="0"\n aria-valuemax="100"\n [style.width]="progress + \'%\'"\n ></div>\n </div>\n <div class="spinner" *ngIf="progress === null" style="position: relative;">\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'})],e)}(),Du=function(){function e(){}return e.prototype.transform=function(e){var t=e.firstName,n=void 0===t?"":t,a=e.lastName,s=void 0===a?"":a,o=e.userName,r=void 0===o?"":o,l=n.trim().split(/\s+/).shift().substr(0,1),i=s.trim().split(/\s+/).pop();return(l=i?l?l+". ":"":n.split(/\s+/).shift())||i?l+i:r},e=yc([t.Pipe({name:"shortenUserName"})],e)}();(Su=e.Status||(e.Status={})).SUCCESS="success",Su.WARNING="warning",Su.DANGER="danger",Su.INFO="info";var Mu=((yu={})[e.Status.SUCCESS]="check-circle",yu[e.Status.WARNING]="exclamation-triangle",yu[e.Status.DANGER]="exclamation-circle",yu[e.Status.INFO]="info-circle",yu),Lu=((vu={})[e.Status.SUCCESS]="text-"+e.Status.SUCCESS,vu[e.Status.WARNING]="text-"+e.Status.WARNING,vu[e.Status.DANGER]="text-"+e.Status.DANGER,vu[e.Status.INFO]="text-"+e.Status.INFO,vu),Ru=((ju={})[e.Status.SUCCESS]="alert-"+e.Status.SUCCESS,ju[e.Status.WARNING]="alert-"+e.Status.WARNING,ju[e.Status.DANGER]="alert-"+e.Status.DANGER,ju[e.Status.INFO]="alert-"+e.Status.INFO,ju),qu=((bu={})[l.OperationStatus.PENDING]="clock-o",bu[l.OperationStatus.EXECUTING]="refresh",bu[l.OperationStatus.SUCCESSFUL]="check-circle",bu[l.OperationStatus.FAILED]="exclamation-circle",bu),$u=((wu={})[l.OperationStatus.PENDING]="text-info",wu[l.OperationStatus.EXECUTING]="text-info",wu[l.OperationStatus.SUCCESSFUL]="text-success",wu[l.OperationStatus.FAILED]="text-danger",wu),Fu=function(){function e(){}return e.prototype.ngOnInit=function(){this.statusIcons=qu,this.statusClasses=$u},yc([t.Input()],e.prototype,"operation",void 0),e=yc([t.Component({selector:"c8y-single-operation",template:'<div class="c8y-list--group" *ngIf="operation">\n <a href="#/device/{{ operation.deviceId }}/control" class="c8y-list__item">\n <div class="c8y-list__item__block">\n <div class="c8y-list__item__icon">\n <i\n [c8yIcon]="statusIcons[operation.status]"\n [ngClass]="statusClasses[operation.status]"\n [tooltip]="operation.status?.toString() | translate"\n placement="right"\n container="body"\n ></i>\n </div>\n <div class="c8y-list__item__body p-r-16">\n <div class="content-flex-40">\n <div class="col-8 text-break-word">{{ operation.description | translate }}</div>\n <div class="col-4 text-muted">\n <i c8yIcon="calendar" class="m-r-4"></i>\n <small>{{ operation.creationTime | c8yDate }}</small>\n </div>\n </div>\n </div>\n </div>\n </a>\n</div>\n'})],e)}(),Uu=function(){function e(){this.LOCAL_STORAGE_KEY="userPreferences",this.store={};try{var e=window.localStorage.getItem(this.LOCAL_STORAGE_KEY);e&&(this.store=JSON.parse(e)||{})}catch(e){}}return e.prototype.get=function(e){return a.of(this.store[e])},e.prototype.set=function(e,t){return this.store[e]=t,this.saveJsonStore()},e.prototype.saveJsonStore=function(){return window.localStorage.setItem(this.LOCAL_STORAGE_KEY,JSON.stringify(this.store))},e}(),Bu=function(){function e(e){this.inventory=e,this.TYPE="c8y_UserPreference"}return e.prototype.get=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return[4,this.inventory.list({fragmentType:e})];case 1:return[2,(t=n.sent().data).length?t[0][e]:void 0]}}))}))},e.prototype.set=function(e,t){return jc(this,void 0,void 0,(function(){var n,a,s,o;return bc(this,(function(r){switch(r.label){case 0:return[4,this.inventory.list({fragmentType:e})];case 1:return n=r.sent().data,(o={})[e]=t,o.type=this.TYPE,a=o,n.length?(a.id=n[0].id,s=this.inventory.update(a)):s=this.inventory.create(a),[2,s]}}))}))},e}(),zu=function(){function e(e,t,n){this.user=e,this.inventory=t,this.appState=n,this.LOCAL_STORAGE_KEY="userPreferences",this.storage={local:new Uu,inventory:new Bu(this.inventory)},this.currentUser=this.appState.currentUser}return e.prototype.get=function(e){var t=this;return this.currentUser.pipe(s.first(),s.switchMap((function(n){return t.getForUser(e,n)})))},e.prototype.set=function(e,t){var n=this;return new Promise((function(a,o){n.currentUser.pipe(s.first()).subscribe((function(s){a(n.setForUser(e,t,s))}),o)}))},e.prototype.getForUser=function(e,t){var n=this.getRawKey(e,t),s=this.getStorage(t);return a.from(s.get(n))},e.prototype.setForUser=function(e,t,n){var a=this.getRawKey(e,n),s=this.getStorage(n);return Promise.resolve(s.set(a,t))},e.prototype.getRawKey=function(e,t){return""+e+t.userName.replace(/\./g,"__")},e.prototype.getStorage=function(e){return this.user.hasAllRoles(e,["ROLE_INVENTORY_READ","ROLE_INVENTORY_ADMIN"])?this.storage.inventory:this.storage.local},e.ctorParameters=function(){return[{type:l.UserService},{type:l.InventoryService},{type:$c}]},e=yc([t.Injectable()],e)}();function Gu(e){return function(t,n,a){var s=a.value;a.value=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];var r="_"+n+"Memoized";return this[r]||(this[r]=o.memoize(s,e)),this[r].apply(this,t)}}}var Hu=function(){function e(e,t,n){this.appState=e,this.inventory=t,this.user=n}return e.prototype.canEdit=function(e,t){return this.checkIfCanEdit(e,t)},e.prototype.hasRole=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasRole(t,e)},e.prototype.hasAllRoles=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasAllRoles(t,e)},e.prototype.hasAnyRole=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasAnyRole(t,e)},e.prototype.checkIfOwner=function(e){return jc(this,void 0,void 0,(function(){var t,n,a;return bc(this,(function(s){switch(s.label){case 0:return[4,this.appState.currentUser.value.userName];case 1:return t=s.sent(),[4,this.inventory.detail(e.id)];case 2:return n=s.sent(),a=n.data,n.res,[2,t===a.owner]}}))}))},e.prototype.checkWithRequest=function(e){var t=e.name,n={id:e.id,name:t};return this.inventory.update(n).then((function(e){return!0})).catch((function(e){return!1}))},e.prototype.checkIfCanEdit=function(e,t){return jc(this,void 0,void 0,(function(){return bc(this,(function(n){switch(n.label){case 0:return[4,this.hasAnyRole(e)];case 1:return n.sent()?[2,!0]:[3,2];case 2:return[4,this.checkIfOwner(t)];case 3:return n.sent()?[2,!0]:[3,4];case 4:return[4,this.checkWithRequest(t)];case 5:if(n.sent())return[2,!0];n.label=6;case 6:return[2,!1]}}))}))},e.ctorParameters=function(){return[{type:$c},{type:l.InventoryService},{type:l.UserService}]},yc([Gu(o.property("id"))],e.prototype,"checkIfOwner",null),yc([Gu(o.property("id"))],e.prototype,"checkWithRequest",null),e=yc([t.Injectable()],e)}();function Vu(e,t,n){return function(){var a=e.queryStringLang(),o=e.firstSupportedLanguage();a&&e.getSupported(a)?e.switchToLanguage(a):t.currentUser.pipe(s.map((function(e){return e&&e.userName})),s.filter((function(e){return!!e})),s.distinctUntilChanged(),s.switchMap((function(){return n.get("language")})),s.startWith(o),s.filter((function(e){return!!e})),s.distinctUntilChanged()).subscribe((function(t){e.switchToLanguage(t)}))}}var Ku,Wu=new t.InjectionToken("iconList"),Yu=function(){function e(){}var n;return n=e,e.providers=function(){return Sc(r.DataModule.providers(),[{provide:Rc,useValue:window.C8Y_APP||{},multi:!0},{provide:t.APP_INITIALIZER,useFactory:Vu,deps:[Cu,$c,zu],multi:!0},{provide:Wu,useValue:Tu,multi:!1}],gu.providers(),[zu,qc,$c,Hu])},e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e=n=yc([t.NgModule({imports:[c.CommonModule,gu,u.TooltipModule],exports:[ku,_u,gu,c.CommonModule,xu,Eu,Du,Ou,Pu,Au,Nu,Fu,Iu],declarations:[ku,_u,Eu,xu,Du,Ou,Pu,Au,Nu,Fu,Iu],entryComponents:[Pu]})],e)}(),Zu=function(){function e(e){this.actionBarService=e,this.placement="left",this.priority=0,this.itemClass=""}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.actionBarService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.actionBarService.remove(this)},e.ctorParameters=function(){return[{type:Ac}]},yc([t.Input()],e.prototype,"placement",void 0),yc([t.Input()],e.prototype,"priority",void 0),yc([t.Input()],e.prototype,"itemClass",void 0),yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=yc([t.Component({selector:"c8y-action-bar-item",template:'<ng-template #template>\n <li class="{{itemClass}}">\n <ng-content></ng-content>\n </li>\n</ng-template>'})],e)}(),Ju=function(){function e(){this.navigatorOpen=!1,this.hasTabs=!1,this.isTabsHorizontal=!1,this.isPageToolbarExpanded=!1,this.uiActionBar=!0,this.items=[]}return Object.defineProperty(e.prototype,"hidden",{get:function(){return!(this.items&&this.items.length)},enumerable:!0,configurable:!0}),e.prototype.getSortedItems=function(e){return o.sortBy(o.filter(this.items,{placement:e}),this.byPriority)},e.prototype.byPriority=function(e){return-e.priority},yc([t.Input(),t.HostBinding("class.navigator-open")],e.prototype,"navigatorOpen",void 0),yc([t.Input(),t.HostBinding("class.has-tabs")],e.prototype,"hasTabs",void 0),yc([t.Input(),t.HostBinding("class.horizontal-tabs")],e.prototype,"isTabsHorizontal",void 0),yc([t.HostBinding("class.c8y-ui-action-bar")],e.prototype,"uiActionBar",void 0),yc([t.Input()],e.prototype,"items",void 0),yc([t.HostBinding()],e.prototype,"hidden",null),e=yc([t.Component({selector:"c8y-action-bar",template:'<div class="navbar-header">\n <button\n type="button"\n class="navbar-toggle collapsed"\n (click)="isPageToolbarExpanded = !isPageToolbarExpanded"\n >\n <span class="sr-only" translate>Toggle toolbar</span>\n <span class="icon-bar"></span>\n <span class="icon-bar"></span>\n <span class="icon-bar"></span>\n </button>\n</div>\n\n<div id="page-toolbar" class="navbar-collapse" [collapse]="!isPageToolbarExpanded">\n <ul class="nav navbar-nav navbar-left">\n <ng-container *ngFor="let item of getSortedItems(\'left\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n </ul>\n <ul class="nav navbar-nav navbar-right">\n <ng-container *ngFor="let item of getSortedItems(\'right\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n <li class="no-remove more-wrapper" *ngIf="getSortedItems(\'more\').length > 0">\n <div class="dropdown" dropdown>\n <button\n title="{{ \'More\' | translate }}…"\n class="dropdown-toggle c8y-dropdown"\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="false"\n >\n <span translate>More…</span>\n <i [c8yIcon]="\'caret-down\'"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <ng-container *ngFor="let item of getSortedItems(\'more\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n </li>\n </ul>\n</div>\n',host:{class:"c8y-ui-action-bar"}})],e)}(),Xu=function(){function e(){}return e=yc([t.NgModule({declarations:[Ju,Zu],imports:[tc.BsDropdownModule,Yu,ec.CollapseModule,n.RouterModule.forChild([])],exports:[Ju,Zu]})],e)}(),Qu=function(){function e(){this.isPageToolbarExpanded=!1,this.items=[]}return e.prototype.getByPriority=function(){return o.sortBy(this.items,this.byPriority)},e.prototype.invoke=function(e){e.action&&e.action.call()},e.prototype.byPriority=function(e){return-e.priority},yc([t.Input()],e.prototype,"items",void 0),e=yc([t.Component({selector:"c8y-action-outlet",template:'<div class="dropdown" dropdown *ngIf="items && items.length > 0">\n <button\n type="button"\n class="main-header-button dropdown-toggle c8y-dropdown"\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="true">\n <i [c8yIcon]="\'plus-circle\'" class="fa-2x"></i>\n </button>\n\n <ul class="dropdown-menu cog-dropdown" *dropdownMenu>\n <ng-container *ngFor="let item of getByPriority()">\n <ng-container *c8yOutlet="item.template"></ng-container>\n <li *ngIf="item.label">\n <button title="{{ item.label | translate }}" [attr.disabled]="item.disabled ? \'disabled\' : null" (click)="invoke(item)">\n <i *ngIf="item.icon" [c8yIcon]="item.icon"></i>{{item.label | translate}}\n </button>\n </li>\n </ng-container>\n </ul>\n</div>\n'})],e)}(),ed=function(){function e(e){this.actionService=e,this.disabled=!1,this.priority=0}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.actionService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.actionService.remove(this)},e.ctorParameters=function(){return[{type:Nc}]},yc([t.Input()],e.prototype,"disabled",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"priority",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=yc([t.Component({selector:"c8y-action",template:"<ng-template #template>\n <li>\n <ng-content></ng-content>\n </li>\n</ng-template>"})],e)}(),td=function(){function e(){}return e=yc([t.NgModule({declarations:[Qu,ed],imports:[Yu,tc.BsDropdownModule,n.RouterModule.forChild([])],exports:[Qu,ed]})],e)}(),nd=function(){function e(){}return e=yc([t.Component({selector:"c8y-alert-details",template:"<ng-content></ng-content>"})],e)}(),ad=function(){function e(e,t){this.position=e,this.alertService=t,this.detailDisplayedAlert={},this.isStatic=!1,this.isStatic="static"===this.position}return Object.defineProperty(e.prototype,"alerts",{get:function(){return this.alertService.state$},enumerable:!0,configurable:!0}),e.prototype.getClass=function(e){var t=[];return"danger"!==e.type&&t.push("interact"),t.push("alert-"+e.type),t.join(" ")},e.prototype.close=function(e){e.onClose&&e.onClose(),this.alertService.remove(e)},e.prototype.showDetails=function(e){if(e.onDetail)return e.onDetail();this.detailDisplayedAlert=Object.assign({},e),this.detailDisplayedAlert.mode="raw",this.setDetailsContent(e)},e.prototype.setDetailsContent=function(e){this.isTemplateRef(e.detailedData)||"string"==typeof e.detailedData?this.detailDisplayedAlert.contents=e.detailedData:this.detailDisplayedAlert.contents=JSON.stringify(e.detailedData,null,2)},e.prototype.hasDetails=function(e){return e.detailedData||e.onDetail},e.prototype.closeDetails=function(){this.detailDisplayedAlert={}},e.prototype.isDetailsShow=function(e){return this.alertService.areSame(e,this.detailDisplayedAlert)},e.prototype.isTemplateRef=function(e){return e instanceof t.TemplateRef},e.prototype.template=function(e){return this.isTemplateRef(e)?e:void 0},e.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["position"]}]},{type:Mc}]},yc([t.HostBinding("class.static")],e.prototype,"isStatic",void 0),e=yc([t.Component({selector:"c8y-alert-outlet",template:'<div\n class="alert animated fadeInRightBig"\n *ngFor="let alert of alerts | async"\n [ngClass]="[getClass(alert), isDetailsShow(alert) ? \'expanded\' : \'\']"\n>\n <button title="{{ \'Close\' | translate }}" type="button" class="close" (click)="close(alert)">\n <span aria-hidden="true">×</span>\n <span class="sr-only">{{ \'Close\' | translate }}</span>\n </button>\n\n <div *ngIf="!isTemplateRef(alert.text); else template(alert.text)">\n <strong *ngIf="!alert.allowHtml" [innerText]="alert.text | translate" class="message"></strong>\n <strong *ngIf="alert.allowHtml" [innerHTML]="alert.text | translate" class="message"></strong>\n </div>\n <p *ngIf="hasDetails(alert) && !isDetailsShow(alert)" class="text-muted top-m-sm">\n <button\n title="{{ \'Show details\' | translate }}"\n class="btn btn-clean"\n (click)="showDetails(alert)"\n >\n <i class="fa fa-chevron-down"></i>\n {{ \'Show details\' | translate }}\n </button>\n </p>\n <p *ngIf="hasDetails(alert) && isDetailsShow(alert)" class="text-muted top-m-sm">\n <button title="{{ \'Hide details\' | translate }}" class="btn btn-clean" (click)="closeDetails()">\n <i class="fa fa-chevron-up"></i>\n {{ \'Hide details\' | translate }}\n </button>\n </p>\n <div *ngIf="isDetailsShow(alert)">\n <div *ngIf="!isTemplateRef(detailDisplayedAlert.contents); else template(alert.detailedData)">\n <pre><code [innerText]="detailDisplayedAlert.contents | translate"></code></pre>\n </div>\n </div>\n</div>\n'}),vc(0,t.Attribute("position"))],e)}(),sd=function(){function e(){}return e=yc([t.Component({selector:"c8y-alert-text",template:"<ng-content></ng-content>"})],e)}(),od=function(){function e(e){this.alertService=e}return e.prototype.ngAfterViewInit=function(){var e=this;this.containDetailsComponent||(this.detailedData=null),this.viewInitTimeout=setTimeout((function(){return e.alertService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.alertService.remove(this)},e.ctorParameters=function(){return[{type:Mc}]},yc([t.Input()],e.prototype,"type",void 0),yc([t.Input()],e.prototype,"onDetail",void 0),yc([t.Input()],e.prototype,"onClose",void 0),yc([t.ViewChild("detailedData",{static:!1})],e.prototype,"detailedData",void 0),yc([t.ViewChild("text",{static:!1})],e.prototype,"text",void 0),yc([t.ContentChild(nd,{static:!1})],e.prototype,"containDetailsComponent",void 0),e=yc([t.Component({selector:"c8y-alert",template:'<ng-template #text>\r\n <ng-content select="c8y-alert-text"></ng-content>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n<ng-template #detailedData>\r\n <ng-content select="c8y-alert-details"></ng-content>\r\n</ng-template>'})],e)}(),rd=function(){function e(){}return e=yc([t.NgModule({imports:[Yu],exports:[ad,od,nd,sd],declarations:[ad,od,nd,sd]})],e)}(),ld=function(){function e(e){this.audit=e}return e.prototype.ngOnInit=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return this.source?(e=this,[4,this.audit.list({withTotalPages:!0,source:this.source})]):[3,2];case 1:e.records=t.sent(),t.label=2;case 2:return[2]}}))}))},e.ctorParameters=function(){return[{type:l.AuditService}]},yc([t.Input()],e.prototype,"source",void 0),e=yc([t.Component({selector:"c8y-audit-log",template:'<div class="inner-scroll">\n <ul class="timeline-list list-condensed m-t-16">\n <li class="timeline-list-item flex-row" *c8yFor="let record of records">\n <small class="timeline-item-date text-right">\n <span>{{ record.time | c8yDate }}</span>\n </small>\n <div class="timeline-item-content flex-row">\n <div class="list-item-body">\n <div class="row text-break-word">\n <div class="col-md-5">\n <span class="text-truncate">{{ record.activity | translate }}</span>\n <small class="text-muted">{{ record.user }}</small>\n </div>\n <div class="col-md-7">\n <div class="small text-truncate-wrap">{{ record.text | translate }}</div>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n</div>\n'})],e)}(),id=function(){function e(){}return e=yc([t.NgModule({declarations:[ld],imports:[Yu],exports:[ld]})],e)}();(Ku=e.LoginViews||(e.LoginViews={}))[Ku.None=0]="None",Ku[Ku.Credentials=1]="Credentials",Ku[Ku.RecoverPassword=2]="RecoverPassword",Ku[Ku.SmsChallenge=3]="SmsChallenge",Ku[Ku.ChangePassword=4]="ChangePassword",Ku[Ku.TotpChallenge=5]="TotpChallenge",Ku[Ku.TotpSetup=6]="TotpSetup",Ku[Ku.ProvidePhoneNumber=7]="ProvidePhoneNumber";var cd,ud=function(){function e(e,t,n,a,s,o,r,l,i,c,u){this.client=e,this.basicAuth=t,this.cookieAuth=n,this.ui=a,this.user=s,this.tenant=o,this.realtime=r,this.alert=l,this.api=i,this.tenantLoginOptionsService=c,this.location=u,this.rememberMe=!1,this.TOKEN_KEY="_tcy8",this.TFATOKEN_KEY="TFAToken",this.OAUTH2_INTERNAL_TYPE="OAUTH2_INTERNAL",this.isFirstLogin=!0,this.GREEN_MIN_LENGTH_DEFAULT=8,this.ERROR_MESSAGES={minlength:"Password must have at least 8 characters and no more than 32.",password_missmatch:"Password confirmation does not match.",maxlength:"Password must have at least 8 characters and no more than 32.",password_strength:"Your password is not strong enough. Please include numbers, lower and upper case characters",remote_error:"Server error occurred.",email:"Invalid email address.",password_change:"Your password is expired. Please set a new password.",password_reset_token_expired:"Password reset link expired. Please enter your email address to receive a new one.",tfa_pin_invalid:"The code you entered is invalid. Please try again.",pattern_phonenumber:'Invalid phone number format. Only digits, spaces, slashes ("/") and dashes ("-") allowed.',pattern_newPassword:"Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:'\",.<>{}[]\\/",international_number_required:"International phone number required, in the format +49 9 876 543 210.",phone_number_error:"Could not update phone number.",pinAlreadySent:"The verification code was already sent. For a new verification code, please click on the link above.",passwordConfirm:"Password confirmation does not match.",tfaExpired:"Two-factor authentication token expired."},this.SUCCESS_MESSAGES={password_changed:"Password changed. You can now log in using new password.",password_reset_requested:"Password reset request has been sent. Please check your email.",resend_sms:"Verification code SMS resent.",send_sms:"Verification code SMS sent."},this.passwordStrengthSetting={enforcePasswordStrength:!1,passwordStrengthValidity:!1,greenMinLength:this.GREEN_MIN_LENGTH_DEFAULT},this.localhostRegExp=new RegExp("localhost"),this.localhostIpRegExp=new RegExp("127.0.0.1"),this.showTenantRegExp=new RegExp("showTenant"),this.autoLogout(),this.initLoginOptions()}return e.prototype.getTenant=function(){return this.client.tenant},e.prototype.initLoginOptions=function(){var e=this.ui.state.loginOptions||[],t=function(e){var t=e.type,n=e.grantType;return"OAUTH2"===t&&"AUTHORIZATION_CODE"===n};this.loginMode=e.find((function(e){return"OAUTH2_INTERNAL"===e.type}))||e.find((function(e){return"BASIC"===e.type}))||e.find(t)||{type:"BASIC"},this.oauthOptions=e.find(t)||{}},e.prototype.redirectToOauth=function(){var e=this.oauthOptions.initRequest,t=(this.location?this.location._platformLocation:window).location.href,n=encodeURIComponent(t),a=(e.includes("?")?"&":"?")+"originUri="+n;window.location.href=""+e+a},e.prototype.autoLogout=function(){var e=this,t=/invalid\scredentials.*pin.*generate/i,n=function(e){return e&&"string"==typeof e.message&&t.test(e.message)};this.ui.currentUser.pipe(s.switchMap((function(t){return t?e.api.hookResponse((function(e){return 401===e.response.status})):a.EMPTY}))).subscribe((function(t){return jc(e,void 0,void 0,(function(){var e,a,s,o=this;return bc(this,(function(r){switch(r.label){case 0:return e=t.response,a=!1,n(e.data)?(a=!0,[3,3]):[3,1];case 1:return"function"!=typeof e.json?[3,3]:[4,e.clone().json()];case 2:s=r.sent(),n(s)&&(a=!0),r.label=3;case 3:return a&&(this.logout(!1),setTimeout((function(){return o.alert.danger(o.ERROR_MESSAGES.tfaExpired)}),500)),[2]}}))}))}))},e.prototype.getGreenMinLength=function(){var e=this.getLoginOption(),t=Number(o.get(e,"greenMinLength"));return this.passwordStrengthSetting.greenMinLength=isNaN(t)?this.GREEN_MIN_LENGTH_DEFAULT:t,this.passwordStrengthSetting.greenMinLength},e.prototype.getEnforcePasswordStrength=function(){var e=this.getLoginOption(),t=o.get(e,"enforceStrength");return o.isString(t)?this.passwordStrengthSetting.enforcePasswordStrength="true"===t:this.passwordStrengthSetting.enforcePasswordStrength=!!t,this.passwordStrengthSetting.enforcePasswordStrength},e.prototype.getPasswordStrengthValidity=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){return e=this.getLoginOption(),t=o.get(e,"strengthValidity"),o.isString(t)?this.passwordStrengthSetting.passwordStrengthValidity="true"===t:this.passwordStrengthSetting.passwordStrengthValidity=!!t,[2,this.passwordStrengthSetting.passwordStrengthValidity]}))}))},e.prototype.getPasswordStrengthEnforced=function(){return this.getEnforcePasswordStrength()||this.getPasswordStrengthValidity()},e.prototype.cleanMessages=function(){this.alert.clearAll()},e.prototype.addSuccessMessage=function(e){var t=this.SUCCESS_MESSAGES[e];t&&this.alert.add({text:t,type:"success",timeout:0})},e.prototype.getAuthStrategy=function(){var e=this.cookieAuth,t=this.getStoredToken(),n=this.getStoredTfaToken();return t&&(e=this.basicAuth,this.setCredentials({token:t,tfa:n},this.basicAuth)),e},e.prototype.useBasicAuth=function(e){return this.setCredentials(e,this.basicAuth),this.basicAuth},e.prototype.login=function(e,t){return void 0===e&&(e=this.getAuthStrategy()),jc(this,void 0,void 0,(function(){var n,a,s,o,r,l;return bc(this,(function(i){switch(i.label){case 0:return this.client.setAuth(e),[4,this.tenant.current()];case 1:return n=i.sent(),a=n.data,[4,this.switchLoginMode(t)];case 2:return i.sent()&&(e=this.cookieAuth),[4,this.user.current()];case 3:return s=i.sent(),o=s.data,[4,this.verifyAppAccess()];case 4:return i.sent(),r=this.getSupportUserName(t),(l=this.setCredentials({tenant:a.name,user:(r?r+"$":"")+o.userName},e))&&this.storeBasicAuthToken(l),[4,this.authFulfilled(a,o,r)];case 5:return i.sent(),[2]}}))}))},e.prototype.authFulfilled=function(e,t,n){return jc(this,void 0,void 0,(function(){var a;return bc(this,(function(s){switch(s.label){case 0:return e?[3,2]:[4,this.tenant.current()];case 1:a=s.sent().data,e=a,this.client.tenant=e.name,s.label=2;case 2:return t?[3,4]:[4,this.user.current()];case 3:a=s.sent().data,t=a,s.label=4;case 4:return n||(n=null),this.ui.setUser({user:t,supportUserName:n}),this.ui.currentTenant.next(e),[2]}}))}))},e.prototype.switchLoginMode=function(e){return jc(this,void 0,void 0,(function(){var t,n,a,s;return bc(this,(function(o){switch(o.label){case 0:return(t=this.isPasswordGrantLogin(e))&&e?(n=new URLSearchParams({grant_type:"PASSWORD",username:e.user,password:e.password,tfa_code:e.tfa}),a=new URLSearchParams(this.loginMode.initRequest.split("?").pop()),e.tenant=a.get("tenant_id"),[4,this.client.fetch("tenant/oauth?"+a.toString(),{method:"POST",body:n.toString(),headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8"}})]):[3,2];case 1:if(!(s=o.sent()).ok)throw{res:s};this.client.setAuth(this.cookieAuth),this.cleanLocalStorage(),this.basicAuth.logout(),o.label=2;case 2:return[2,t]}}))}))},e.prototype.isPasswordGrantLogin=function(e){return!(e&&e.user.includes("$")||!this.loginMode||this.loginMode.type!==this.OAUTH2_INTERNAL_TYPE)},e.prototype.isSupportUser=function(e){return!(!e||!e.user.includes("$"))},e.prototype.showTenant=function(){return!this.ui.state.loginOptions||this.isLocal()||this.isShowTenant()},e.prototype.logout=function(e){return void 0===e&&(e=!0),jc(this,void 0,void 0,(function(){var t,n;return bc(this,(function(a){switch(a.label){case 0:t=null,a.label=1;case 1:return a.trys.push([1,4,5,6]),[4,this.reset()];case 2:return n=wc.apply(void 0,[a.sent(),2]),n[0],[4,n[1].json()];case 3:return t=a.sent(),[3,6];case 4:return a.sent(),this.alert.removeLastDanger(),[3,6];case 5:return t&&t.url?this.redirect(t.url):e&&window.location.reload(),[7];case 6:return[2]}}))}))},e.prototype.reset=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){return this.cleanLocalStorage(),this.cleanSessionStorage(),this.realtime.disconnect(),this.ui.currentUser.next(null),[2,Promise.all([this.basicAuth.logout(),this.cookieAuth.logout()])]}))}))},e.prototype.saveTFAToken=function(e,t){t.setItem(this.TFATOKEN_KEY,e)},e.prototype.verifyAppAccess=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.ui.loadManifest()];case 1:return t.sent(),[3,3];case 2:if(!(e=t.sent()).res||404!==e.res.status||!this.isLocal())throw e;return[3,3];case 3:return[2]}}))}))},e.prototype.setCredentials=function(e,t){e.tenant&&(this.client.tenant=e.tenant);var n=this.basicAuth.updateCredentials({tenant:e.tenant,user:e.user}),a=fc({token:n},e);return t.updateCredentials(a)},e.prototype.isLocal=function(){var e=window.location.hostname;return this.localhostIpRegExp.test(e)||this.localhostRegExp.test(e)},e.prototype.saveToken=function(e,t){t.setItem(this.TOKEN_KEY,e)},e.prototype.storeBasicAuthToken=function(e){this.saveToken(e,sessionStorage),this.rememberMe&&this.saveToken(e,localStorage)},e.prototype.cleanLocalStorage=function(){localStorage.removeItem(this.TOKEN_KEY),localStorage.removeItem(this.TFATOKEN_KEY)},e.prototype.cleanSessionStorage=function(){sessionStorage.removeItem(this.TOKEN_KEY),sessionStorage.removeItem(this.TFATOKEN_KEY)},e.prototype.isShowTenant=function(){return this.showTenantRegExp.test(window.location.href)},e.prototype.redirect=function(e){window.location.href=e},e.prototype.getLoginOption=function(){return wc(this.ui.state.loginOptions||[],1)[0]},e.prototype.getSupportUserName=function(e){return void 0===e&&(e=this.getStoredCredentials()),e?e.user.match(/^(.+\/)?((.+)\$)?(.+)?$/)[3]:null},e.prototype.getStoredCredentials=function(){var e=this.getStoredToken();return e?this.decodeToken(e):null},e.prototype.getStoredToken=function(){return localStorage.getItem(this.TOKEN_KEY)||sessionStorage.getItem(this.TOKEN_KEY)},e.prototype.getStoredTfaToken=function(){return localStorage.getItem(this.TFATOKEN_KEY)||sessionStorage.getItem(this.TFATOKEN_KEY)},e.prototype.decodeToken=function(e){var t=decodeURIComponent(escape(window.atob(e))).match(/(([^/]*)\/)?([^/:]+):(.+)/);return{tenant:t[2],user:t[3],password:t[4]}},e.ctorParameters=function(){return[{type:l.FetchClient},{type:l.BasicAuth},{type:l.CookieAuth},{type:$c},{type:l.UserService},{type:l.TenantService},{type:l.Realtime},{type:Mc},{type:r.ApiService},{type:l.TenantLoginOptionsService},{type:c.LocationStrategy,decorators:[{type:t.Optional}]}]},e=yc([t.Injectable(),vc(10,t.Optional())],e)}(),dd=function(){function e(e,n,a,s,o){this.user=e,this.ui=n,this.client=a,this.alert=s,this.loginService=o,this.passwordConfirmedEmitter=new t.EventEmitter,this.loading=!1}return e.prototype.passwordConfirm=function(){return jc(this,void 0,void 0,(function(){var e,t,n,a,s;return bc(this,(function(r){switch(r.label){case 0:if(!this.password)return[3,5];e=this.ui.currentSupportUserName.value,t=this.ui.currentUser.value.id,n={password:this.password,user:(e?e+"$":"")+t,tenant:this.client.tenant},r.label=1;case 1:return r.trys.push([1,3,4,5]),this.loading=!0,a=o.clone(this.loginService.useBasicAuth({})),delete n.tfa,a.updateCredentials(n),[4,this.createNewClient(a,this.client.baseUrl).user.current()];case 2:return r.sent(),this.emitSuccessAndClose(),[3,5];case 3:return(s=r.sent()).res&&401===s.res.status&&s.data&&/pin|totp/i.test(s.data.message)?this.emitSuccessAndClose():this.alert.danger("Provided password doesn't match your current one."),[3,5];case 4:return this.loading=!1,[7];case 5:return[2]}}))}))},e.prototype.cancel=function(){this.passwordConfirmedEmitter.emit(!1),this.modal._dismiss()},e.prototype.createNewClient=function(e,t){return new l.Client(e,t)},e.prototype.emitSuccessAndClose=function(){this.passwordConfirmedEmitter.emit(!0),this.modal._dismiss()},e.ctorParameters=function(){return[{type:l.UserService},{type:$c},{type:l.FetchClient},{type:Mc},{type:ud}]},yc([t.Output()],e.prototype,"passwordConfirmedEmitter",void 0),yc([t.ViewChild("modal",{static:!1})],e.prototype,"modal",void 0),e=yc([t.Component({selector:"c8y-password-confirm-modal",template:'<c8y-modal [customFooter]="true" [title]="\'Confirm password\' | translate" #modal>\r\n <form #confirmForm="ngForm" (ngSubmit)="confirmForm.form.valid && passwordConfirm()">\r\n <c8y-form-group>\r\n <label translate for="currentPassword">Current password</label>\r\n <input\r\n id="currentPassword"\r\n [(ngModel)]="password"\r\n type="password"\r\n name="password"\r\n class="form-control"\r\n placeholder="{{ \'Current password\' | translate }}"\r\n required\r\n />\r\n </c8y-form-group>\r\n\r\n <div class="modal-footer">\r\n <button\r\n title="{{ \'Cancel\' | translate }}"\r\n class="btn btn-default"\r\n type="button"\r\n (click)="cancel()"\r\n translate\r\n >\r\n Cancel\r\n </button>\r\n <button\r\n title="{{ \'Save\' | translate }}"\r\n class="btn btn-primary"\r\n type="submit"\r\n [disabled]="!confirmForm.form.valid || loading"\r\n translate\r\n >\r\n Save\r\n </button>\r\n </div>\r\n </form>\r\n</c8y-modal>\r\n'})],e)}(),pd=function(){function e(e){this.modalService=e,this.GREEN={colorName:"green",color:"rgb(0, 128, 0)",description:"strong",passwordStrength:l.PasswordStrength.GREEN},this.YELLOW={colorName:"yellow",color:"rgb(255, 204, 51)",description:"medium",passwordStrength:l.PasswordStrength.YELLOW},this.RED={colorName:"red",color:"rgb(170, 0, 51)",description:"weak",passwordStrength:l.PasswordStrength.RED}}return e.prototype.confirmPassword=function(){return this.modalService.show(dd).content.passwordConfirmedEmitter.pipe(s.take(1))},e.prototype.hasLowerCase=function(e){return-1!==e.search(/[a-z]/)},e.prototype.hasUpperCase=function(e){return-1!==e.search(/[A-Z]/)},e.prototype.hasNumbers=function(e){return-1!==e.search(/[0-9]/)},e.prototype.hasSpecialChars=function(e){return-1!==e.search(/[^0-9a-zA-Z]+/)},e.prototype.getStrengthColor=function(e){var t=o.filter([this.hasLowerCase(e),this.hasUpperCase(e),this.hasNumbers(e),this.hasSpecialChars(e)]).length;return t>2?this.GREEN:t>=2?this.YELLOW:this.RED},e.ctorParameters=function(){return[{type:nc.BsModalService}]},e=yc([t.Injectable()],e)}(),md=function(){function e(e,t){var n=this;this.loginService=e,this.passwordStrengthChecker=t,this.minGreenLength=0,this.checklist=[{label:"Include lowercase characters (e.g. abcdef)",check:this.passwordStrengthChecker.hasLowerCase,icon:"",contextualColor:""},{label:"Include uppercase characters (e.g. ABCDEF)",check:this.passwordStrengthChecker.hasUpperCase,icon:"",contextualColor:""},{label:"Include numbers (e.g. 123456)",check:this.passwordStrengthChecker.hasNumbers,icon:"",contextualColor:""},{label:"Include symbols (e.g. !@#$%^)",check:this.passwordStrengthChecker.hasSpecialChars,icon:"",contextualColor:""},{label:"Must have at least {{length}} characters",check:function(e){return e.length>=n.minGreenLength},icon:"",contextualColor:""}]}return Object.defineProperty(e.prototype,"password",{set:function(e){"string"==typeof e&&this.onPasswordChange(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.minGreenLength=this.loginService.getGreenMinLength()},Object.defineProperty(e.prototype,"translateParams",{get:function(){return{length:this.minGreenLength}},enumerable:!0,configurable:!0}),e.prototype.onPasswordChange=function(e){this.checklist=o.map(this.checklist,(function(t){var n=t.check(e);return o.assign(t,{icon:n?"check":"",contextualColor:n?"":"text-muted"}),t}))},e.ctorParameters=function(){return[{type:ud},{type:pd}]},yc([t.Input("password")],e.prototype,"password",null),e=yc([t.Component({selector:"c8y-password-check-list",template:'<div>\n <span class="small">{{\'Please meet 4 out of 5 the conditions below\' | translate}}:</span>\n <ul class="list-unstyled">\n <li class="small" *ngFor="let requirement of checklist">\n <i style="color:lightgreen;" [c8yIcon]="requirement.icon"></i> \n <span\n [translate]="requirement.label"\n [translateParams]="this.translateParams"\n class="small {{requirement.contextualColor}}"\n ></span>\n </li>\n </ul>\n</div>\n'})],e)}(),gd=function(){function e(e){this.passwordConfirm=e}var n;return n=e,e.prototype.validate=function(e){var t=e.value,n=e.root.get(this.passwordConfirm);return n&&t!==n.value?{passwordConfirm:!0}:null},e.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["passwordConfirm"]}]}]},e=n=yc([t.Directive({selector:"[passwordConfirm]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]}),vc(0,t.Attribute("passwordConfirm"))],e)}(),hd=function(){function e(){this.GREEN={colorName:"green",color:"rgb(0, 128, 0)",description:"strong",passwordStrength:l.PasswordStrength.GREEN},this.YELLOW={colorName:"yellow",color:"rgb(255, 204, 51)",description:"medium",passwordStrength:l.PasswordStrength.YELLOW},this.RED={colorName:"red",color:"rgb(170, 0, 51)",description:"weak",passwordStrength:l.PasswordStrength.RED}}return e.prototype.hasLowerCase=function(e){return-1!==e.search(/[a-z]/)},e.prototype.hasUpperCase=function(e){return-1!==e.search(/[A-Z]/)},e.prototype.hasNumbers=function(e){return-1!==e.search(/[0-9]/)},e.prototype.hasSpecialChars=function(e){return-1!==e.search(/[^0-9a-zA-Z]+/)},e.prototype.getStrengthColor=function(e){var t=o.filter([this.hasLowerCase(e),this.hasUpperCase(e),this.hasNumbers(e),this.hasSpecialChars(e)]).length;return t>2?this.GREEN:t>=2?this.YELLOW:this.RED},e=yc([t.Injectable()],e)}(),fd=function(){function e(e){this.passwordStrengthCheckerService=e,this.strength=new t.EventEmitter,this.password=""}return Object.defineProperty(e.prototype,"password",{set:function(e){"string"==typeof e&&(this.model=this.passwordStrengthCheckerService.getStrengthColor(e),this.strength.emit(this.model))},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:pd}]},yc([t.Input("password")],e.prototype,"password",null),yc([t.Output()],e.prototype,"strength",void 0),e=yc([t.Component({selector:"c8y-password-strength",template:'<div class="password-strength">\r\n <span class="password-strength-label" translate>Password strength</span>\r\n <span class="pull-right ng-binding" [ngStyle]="{\'color\': model.color}">{{model.description | translate}}</span>\r\n <div>\r\n <div class="password-{{model.colorName}}" [ngStyle]="{\'background-color\': model.color}"></div>\r\n </div>\r\n</div>'})],e)}(),yd=function(){function e(e){this.loginService=e,this.password=new t.EventEmitter,this.model={},this.changePassword=!1,this.passwordEnforced=!1}return e.prototype.ngOnInit=function(){this.loadPasswordStrengthSettings(),this.minlength=this.loginService.getGreenMinLength()},e.prototype.newPasswordChanged=function(){this.password.emit({password:this.model.newPassword,passwordStrength:this.model.strength})},e.prototype.loadPasswordStrengthSettings=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return e=this,[4,this.loginService.getEnforcePasswordStrength()];case 1:return e.passwordEnforced=t.sent(),[2]}}))}))},e.prototype.showPasswordStrength=function(){return this.model.newPassword&&this.model.newPassword.length>=this.minlength},e.prototype.toggleChangePassword=function(){this.changePassword=!this.changePassword,this.changePassword||(this.password.emit({}),this.model={})},e.ctorParameters=function(){return[{type:ud}]},yc([t.Output()],e.prototype,"password",void 0),e=yc([t.Component({selector:"c8y-new-password",template:'<div class="form-group">\n <button type="button" class="btn btn-default" (click)="toggleChangePassword()">\n <ng-container *ngIf="!changePassword">\n {{ \'Change password\' | translate }}\n </ng-container>\n <ng-container *ngIf="changePassword">\n {{ \'Cancel password change\' | translate }}\n </ng-container>\n </button>\n</div>\n\n<div *ngIf="changePassword">\n <c8y-form-group>\n <label for="newPassword" translate>Password</label>\n <input\n id="newPassword"\n [(ngModel)]="model.newPassword"\n #newPassword="ngModel"\n (change)="newPasswordChanged()"\n type="password"\n name="newPassword"\n class="form-control"\n placeholder="{{ \'e.g. my_new_password\' | translate }}"\n required\n c8yDefaultValidation="password"\n autocomplete="new-password"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label for="newConfirmPassword" translate>Confirm password</label>\n <input\n id="newConfirmPassword"\n [(ngModel)]="model.newPasswordConfirm"\n #newPasswordConfirm="ngModel"\n type="password"\n name="newPasswordConfirm"\n class="form-control"\n placeholder="{{ \'e.g. my_new_password\' | translate }}"\n required\n passwordConfirm="newPassword"\n autocomplete="new-password"\n />\n </c8y-form-group>\n\n <c8y-password-strength\n [password]="model.newPassword"\n [hidden]="!showPasswordStrength()"\n (strength)="model.strength = $event"\n ></c8y-password-strength>\n\n <c8y-password-check-list\n [password]="model.newPassword"\n [hidden]="!passwordEnforced"\n ></c8y-password-check-list>\n</div>\n',viewProviders:[{provide:ac.ControlContainer,useExisting:ac.NgForm}]})],e)}(),vd=function(){function n(t){var n=this;this.modal=t,this.status=e.Status.INFO,this._labels={ok:"OK",cancel:"Cancel"},this.result=new Promise((function(e,t){n.dismiss=function(){t(),n.modal.hide()},n.close=function(){e(!0),n.modal.hide()}}))}return Object.defineProperty(n.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e||{},n=t.ok,a=void 0===n?"OK":n,s=t.cancel,o=void 0===s?"Cancel":s;this._labels={ok:a,cancel:o}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"classIcon",{get:function(){return"fa-"+Mu[this.status]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"classAlert",{get:function(){return Ru[this.status]},enumerable:!0,configurable:!0}),n.prototype.ngOnDestroy=function(){this.dismiss()},n.ctorParameters=function(){return[{type:nc.BsModalRef}]},yc([t.Input()],n.prototype,"title",void 0),yc([t.Input()],n.prototype,"body",void 0),yc([t.Input()],n.prototype,"status",void 0),yc([t.Input()],n.prototype,"labels",null),n=yc([t.Component({selector:"c8y-confirm-modal",template:'<div class="c8y-prompt alert" [ngClass]="[classAlert]">\n <h3 class="bottom-m-md" *ngIf="title">\n <i class="fa fw" [ngClass]="[classIcon]"></i>\n <span *ngIf="title">{{ title | translate }}</span>\n </h3>\n <p class="text-wrap" style="word-wrap:break-word;">{{ body | translate }}</p>\n <div class="alert-footer">\n <button\n title="{{ labels.cancel | translate }}"\n class="btn btn-default"\n *ngIf="labels.cancel !== null"\n (click)="dismiss()"\n >\n {{ labels.cancel | translate }}\n </button>\n <button title="{{ labels.ok | translate }}" class="btn btn-primary" (click)="close()">\n {{ labels.ok | translate }}\n </button>\n </div>\n</div>\n'})],n)}(),jd=function(){function e(e){this.modal=e,this.onDismiss=new t.EventEmitter,this.onClose=new t.EventEmitter,this.disabled=!1,this.customFooter=!1,this._labels={ok:"OK",cancel:"Cancel"}}return Object.defineProperty(e.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e.ok,n=e.cancel;this._labels={ok:t,cancel:n}},enumerable:!0,configurable:!0}),e.prototype._dismiss=function(){var e=this,t=this.dismiss;!t&&this.modal&&(t=function(){return e.modal.hide()}),t&&t(),this.onDismiss.emit(!0)},e.prototype._close=function(){var e=this,t=this.close;!t&&this.modal&&(t=function(){return e.modal.hide()}),t&&t(),this.onClose.emit(!0)},e.prototype.onEnterKeyDown=function(e){var t=Qi.isEmpty(this.labels.ok)!==Qi.isEmpty(this.labels.cancel),n=!this.customFooter&&this.labels.cancel,a=!this.customFooter&&!this.disabled&&this.labels.ok;t&&n&&this._dismiss(),t&&a&&this._close()},e.ctorParameters=function(){return[{type:nc.BsModalRef,decorators:[{type:t.Optional}]}]},yc([t.Output()],e.prototype,"onDismiss",void 0),yc([t.Output()],e.prototype,"onClose",void 0),yc([t.Input()],e.prototype,"disabled",void 0),yc([t.Input()],e.prototype,"close",void 0),yc([t.Input()],e.prototype,"dismiss",void 0),yc([t.Input()],e.prototype,"title",void 0),yc([t.Input()],e.prototype,"body",void 0),yc([t.Input()],e.prototype,"customFooter",void 0),yc([t.Input()],e.prototype,"labels",null),yc([t.HostListener("document:keydown.enter",["$event"])],e.prototype,"onEnterKeyDown",null),e=yc([t.Component({selector:"c8y-modal",template:'<div class="modal-header">\n <ng-content select="[c8y-modal-title]"></ng-content>\n <h3 [hidden]="!title">{{title | translate}}</h3>\n</div>\n<div class="modal-body">\n <p\n [hidden]="!title"\n class="text-center text-wrap"\n style="word-wrap:break-word;"\n >{{body}}</p>\n <ng-content></ng-content>\n</div>\n<div class="modal-footer" *ngIf="!customFooter">\n <ng-content select="[c8y-modal-footer]"></ng-content>\n <button\n title="{{ labels.cancel | translate }}" \n *ngIf="labels.cancel"\n class="btn btn-default"\n (click)="_dismiss()"\n >{{labels.cancel | translate}}</button>\n <button\n title="{{ labels.ok | translate }}" \n *ngIf="labels.ok"\n class="btn btn-primary"\n (click)="_close()"\n [disabled]="disabled"\n >{{labels.ok | translate}}</button>\n</div>\n'}),vc(0,t.Optional())],e)}(),bd=function(){function n(e){this.modalService=e}return n.prototype.confirm=function(t,n,a,s){return void 0===a&&(a=e.Status.INFO),void 0===s&&(s={}),jc(this,void 0,void 0,(function(){var e;return bc(this,(function(o){switch(o.label){case 0:return e={ok:s.ok||"Confirm",cancel:s.cancel||"Cancel"},[4,this.modalService.show(vd,{initialState:{title:t,body:n,labels:e,status:a}}).content.result];case 1:return[2,o.sent()]}}))}))},n.prototype.acknowledge=function(t,n,a,s){return void 0===a&&(a=e.Status.INFO),void 0===s&&(s="Confirm"),jc(this,void 0,void 0,(function(){var e;return bc(this,(function(o){switch(o.label){case 0:return e={ok:s,cancel:null},[4,this.modalService.show(vd,{initialState:{title:t,body:n,labels:e,status:a}}).content.result];case 1:return[2,o.sent()]}}))}))},n.ctorParameters=function(){return[{type:nc.BsModalService}]},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n(t.ɵɵinject(nc.BsModalService))},token:n,providedIn:"root"}),n=yc([t.Injectable({providedIn:"root"})],n)}(),wd=function(){function e(){this.buttons=[{label:"cancel",action:function(){return Promise.reject()}}],this.isOpen=!1,this.containerClass="",this.placement="right",this.outsideClick=!1}return e.prototype.show=function(e){return jc(this,void 0,void 0,(function(){var t,n=this;return bc(this,(function(a){switch(a.label){case 0:this.buttons=e||this.buttons,this.isOpen=!0,a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,new Promise((function(e,t){return n.click=function(n){return n().then(e).catch(t)}}))];case 2:return t=a.sent(),[3,5];case 3:throw a.sent();case 4:return this.isOpen=!1,[7];case 5:return[2,t]}}))}))},e.prototype.buttonStatus=function(e){return e?"btn-"+e:"btn-link btn-clean"},e.prototype.handleOutsideClick=function(){this.click((function(){return Promise.reject()}))},yc([t.ViewChild(sc.PopoverDirective,{static:!1})],e.prototype,"popover",void 0),yc([t.Input()],e.prototype,"buttons",void 0),yc([t.Input()],e.prototype,"message",void 0),yc([t.Input()],e.prototype,"title",void 0),yc([t.Input()],e.prototype,"isOpen",void 0),yc([t.Input()],e.prototype,"containerClass",void 0),yc([t.Input()],e.prototype,"placement",void 0),yc([t.Input()],e.prototype,"outsideClick",void 0),e=yc([t.Component({selector:"c8y-popover-confirm",template:'<span\n [popover]="popover"\n container="body"\n [isOpen]="isOpen"\n [popoverTitle]="title | translate"\n [placement]="placement"\n [containerClass]="containerClass"\n [outsideClick]="outsideClick"\n (onHidden)="handleOutsideClick()"\n></span>\n<ng-template #popover>\n <p class="bottom-m">\n {{ message | translate }}\n </p>\n <div class="popover-footer">\n <ng-container *ngFor="let button of buttons">\n <button\n title="{{ button.label | translate }}"\n class="btn btn-sm right-m-md"\n [ngClass]="buttonStatus(button.status)"\n (click)="click(button.action)"\n >\n {{ button.label | translate }}\n </button>\n </ng-container>\n </div>\n</ng-template>\n'})],e)}(),Sd=function(){function e(){}return e=yc([t.NgModule({imports:[nc.ModalModule.forRoot(),Yu,sc.PopoverModule.forRoot()],exports:[vd,jd,wd],declarations:[vd,jd,wd],providers:[bd],entryComponents:[vd]})],e)}(),Cd=function(){function e(){}var n;return n=e,e.prototype.validate=function(e){return this.validateInternationalPhoneNumber(e)?null:{internationalPhoneNumber:!0}},e.prototype.validateInternationalPhoneNumber=function(e){var t;try{var n=oc.parsePhoneNumberFromString(e.value);(t=n.isValid())&&e.value!==n.format("E.164")&&e.setValue(n.format("E.164"),{emitEvent:!1,emitModelToViewChange:!1})}catch(n){t=!e.value}return t},e=n=yc([t.Directive({selector:"[c8yPhoneValidation]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),Id=function(){function e(){}return e.get=function(e){return this.rules[e]},e.messages={deviceId:'Device ID must not contain spaces or slashes ("/").',domain:"Only lowercase letters, digits, hyphens and underscores allowed in the first part of the URI. Must start with a letter; hyphens and underscores only allowed in the middle. Must be a valid URI.",email:"Invalid email address.",internationalPhoneNumber:"International phone number required, in the format +49 9 876 543 210.",loginAlias:'Login alias must not contain slashes ("/", "\\") nor ("+"), (":"), ("$") signs.',max:"Max value: {{ value }}",min:"Min value: {{ value }}",opcuaBrowsePath:"Invalid OPC UA URI.",password:"Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:'\",.<>{}[]\\/",passwordConfirm:"Passwords do not match.",passwordStrength:"Password not good enough, password must be stronger (green).",phoneNumber:'Invalid phone number format. Only digits, spaces, slashes ("/") and dashes ("-") allowed.',required:"This field is required.",tenantId:"May contain lowercase letters, digits, hyphens and underscores. Must start with a letter; hyphens and underscores only allowed in the middle; minimum 2 characters.",urlSegment:"Slash, single or double dots and white space not allowed",user:'Username must not contain spaces nor slashes ("/", "\\") nor ("+"), (":"), ("$") signs.'},e.rules={deviceId:{pattern:/^[^\s/]*$/},domain:{pattern:/^[a-z]+[a-z0-9_-]*[a-z0-9]+\.{1}.+$/},groupName:{maxLength:254},hostname:{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])$/},ip:{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]?)$/},opcuaBrowsePath:{pattern:/^(opc.tcp|http|https):\/\/[^ "]+$/},password:{pattern:/^[a-zA-Z0-9`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]{8,32}$/},phoneNumber:{pattern:/^$|^(\+|0{2})[\d\s/-]{1,30}$/},tenantId:{pattern:/^[a-z]+[a-z0-9_-]*[a-z0-9]+$/},user:{pattern:/^[^\\/\s$:+]*$/},urlSegment:{pattern:/^(([.]{1,2})|([/])+|(([/]*)([.]{1,2})([/]*))|((.*)([/]|[ ]+)(.*))|(\s+))$/},loginAlias:{pattern:/^[^\\/$:+]*$/}},e}(),Pd=function(){function e(){this.c8yDefaultValidation=""}var n;return n=e,e.prototype.validate=function(e){var t;if(!e.value)return null;var n=Id.get(this.c8yDefaultValidation);if(!n)throw new Error("Pattern "+this.c8yDefaultValidation+" not found.");var a=!0;return n.pattern&&(a=n.pattern.test(e.value)),n.maxLength&&(a=e.value.length<n.maxLength),n.minLength&&(a=e.value.length>=n.minLength),a?null:((t={})[this.c8yDefaultValidation]=!0,t)},yc([t.Input()],e.prototype,"c8yDefaultValidation",void 0),e=n=yc([t.Directive({selector:"[c8yDefaultValidation]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),Od=function(){function e(){this.min=""}var n;return n=e,e.prototype.validate=function(e){var t=parseInt(this.min,10);if(o.isUndefined(e.value)||!this.min)return null;return null===e.value||!(e.value<t)?null:{min:{value:t}}},yc([t.Input()],e.prototype,"min",void 0),e=n=yc([t.Directive({selector:"[min]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),xd=function(){function e(){this.max=""}var n;return n=e,e.prototype.validate=function(e){var t=parseInt(this.max,10);if(o.isUndefined(e.value)||!this.max)return null;return!(e.value>t)?null:{max:{value:t}}},yc([t.Input()],e.prototype,"max",void 0),e=n=yc([t.Directive({selector:"[max]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),Ed=function(){function e(){}return yc([t.Input()],e.prototype,"name",void 0),yc([t.Input()],e.prototype,"text",void 0),e=yc([t.Directive({selector:"c8y-message"})],e)}(),kd=function(){function e(e){this.translateService=e,this.show={},this.defaults=Id.messages,this.messages=[],this.messageMap={}}return e.prototype.ngAfterContentInit=function(){this.messageMap=Object.assign({},this.defaults,this.customMessages.reduce((function(e,t){return e[t.name]=t.text,e}),{}))},e.prototype.changVisibility=function(e){this.show=e,this.ngOnChanges()},e.prototype.ngOnChanges=function(){var e=this;this.show?this.messages=Object.keys(this.show).map((function(t){return e.toMessage(t,e.show[t])})):this.messages=[]},e.prototype.toMessage=function(e,t){return this.translateService.instant(this.messageMap[e],t)},e.ctorParameters=function(){return[{type:i.TranslateService}]},yc([t.Input()],e.prototype,"show",void 0),yc([t.Input()],e.prototype,"defaults",void 0),yc([t.ContentChildren(Ed)],e.prototype,"customMessages",void 0),e=yc([t.Component({selector:"c8y-messages",template:'<small class="form-control-feedback-message">\n <div style="display:block" *ngFor="let msg of messages">\n {{msg | translate}}\n </div>\n <ng-content></ng-content>\n</small>\n'})],e)}(),Td=function(){function e(){this.hasError=!1,this.hasWarning=!1,this.hasSuccess=!1,this.novalidation=!1,this.VALIDATION_DEBOUNCE_MS=1e3}return Object.defineProperty(e.prototype,"error",{get:function(){return"error"===this.status||this.hasError},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"warning",{get:function(){return"warning"===this.status||this.hasWarning},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"success",{get:function(){return"success"===this.status||this.hasSuccess},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this.initNgModel()},e.prototype.initNgModel=function(){var e=this;this.model&&(this.model.valueAccessor.registerOnTouched((function(){e.model.control&&!e.model.control.dirty&&(e.model.control.markAsDirty(),e.model.control.updateValueAndValidity({onlySelf:!0}))})),this.subscription=a.merge(this.model.valueChanges,this.model.statusChanges).pipe(s.filter((function(){return e.model.dirty&&!e.novalidation})),s.debounce((function(){return e.hasError?a.timer(10):a.timer(e.VALIDATION_DEBOUNCE_MS)}))).subscribe((function(){return e.update()})))},e.prototype.update=function(){this.hasError="INVALID"===this.model.status,this.customErrorMessage?this.customErrorMessage.changVisibility(this.model.errors):this.errors=this.model.errors},e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},yc([t.Input()],e.prototype,"hasError",void 0),yc([t.Input()],e.prototype,"hasWarning",void 0),yc([t.Input()],e.prototype,"hasSuccess",void 0),yc([t.Input()],e.prototype,"novalidation",void 0),yc([t.Input()],e.prototype,"status",void 0),yc([t.HostBinding("class.has-error")],e.prototype,"error",null),yc([t.HostBinding("class.has-warning")],e.prototype,"warning",null),yc([t.HostBinding("class.has-success")],e.prototype,"success",null),yc([t.ContentChild(kd,{static:!1})],e.prototype,"customErrorMessage",void 0),yc([t.ContentChild(ac.NgModel,{static:!0})],e.prototype,"model",void 0),e=yc([t.Component({selector:"c8y-form-group",template:'<ng-content></ng-content>\n<c8y-messages *ngIf="!customErrorMessage" [show]="errors"></c8y-messages>\n',host:{class:"form-group"}})],e)}(),Ad=function(){function e(){this.plus=!0,this.minus=!0,this.onRemove=new t.EventEmitter,this.onAdd=new t.EventEmitter}return e.prototype.add=function(){this.onAdd.emit(this.index)},e.prototype.remove=function(){this.onRemove.emit(this.index)},yc([t.Input()],e.prototype,"plus",void 0),yc([t.Input()],e.prototype,"minus",void 0),yc([t.Input()],e.prototype,"index",void 0),yc([t.Output()],e.prototype,"onRemove",void 0),yc([t.Output()],e.prototype,"onAdd",void 0),e=yc([t.Component({selector:"c8y-input-group-list",template:'<ng-container>\n <div class="input-group">\n <ng-content></ng-content>\n <div class="input-group-btn">\n <button\n *ngIf="minus"\n title="{{ \'Remove\' | translate }}"\n class="btn btn-clean text-primary"\n (click)="remove()"\n >\n <i c8yIcon="minus-circle" class="text-danger"></i>\n </button>\n <button\n *ngIf="plus"\n title="{{ \'Add\' | translate }}"\n class="btn btn-clean text-primary"\n (click)="add()"\n >\n <i class="fa fa-plus-circle"></i>\n </button>\n </div>\n </div>\n</ng-container>\n'})],e)}(),_d=function(){function e(){}return e.prototype.ngAfterContentInit=function(){var e=this;this.listProjections.map((function(t){t!==e.listProjections.last&&setTimeout((function(){t.plus=!1}))})),this.listProjections.changes.subscribe((function(e){1!==e.length?e.map((function(t){setTimeout((function(){t.minus=!0})),t!==e.last&&setTimeout((function(){t.plus=!1})),t===e.last&&setTimeout((function(){t.plus=!0}))})):setTimeout((function(){e.first.plus=!0,e.first.minus=!1}))}))},yc([t.ContentChildren(Ad)],e.prototype,"listProjections",void 0),e=yc([t.Directive({selector:"[c8yInputGroupListContainer]"})],e)}(),Nd=function(){function e(e){this.invalidJSON=new t.EventEmitter,this.message="Must be a valid JSON object.",this.debounceTimeInMs=1e3,this.abstractCtrl=e.control}return e.prototype.ngOnInit=function(){var e=this;this.subscription=this.abstractCtrl.valueChanges.pipe(s.tap((function(){return e.clearValidationMessage()})),s.debounceTime(this.debounceTimeInMs),s.distinctUntilChanged()).subscribe((function(t){e.validateInputAndPrettify(t)}))},e.prototype.ngOnDestroy=function(){this.subscription&&!this.subscription.closed&&this.subscription.unsubscribe()},e.prototype.validateInputAndPrettify=function(e){if(e)try{var t=JSON.parse(e),n=JSON.stringify(t,void 0,2);this.abstractCtrl.setValue(n)}catch(e){this.setErrorAndValidationMessage()}},e.prototype.setErrorAndValidationMessage=function(){this.abstractCtrl.setErrors({invalidBodyTemplate:!0}),this.invalidJSON.emit(this.message)},e.prototype.clearValidationMessage=function(){this.invalidJSON.emit(void 0)},e.ctorParameters=function(){return[{type:ac.NgControl}]},yc([t.Output()],e.prototype,"invalidJSON",void 0),e=yc([t.Directive({selector:"textarea[prettyValidJson]"})],e)}(),Dd=function(){function e(e,t){this.elem=e,this.renderer=t,this.rows=1,this.minHeightPerRow=20}return e.prototype.ngAfterViewInit=function(){var e=Number(this.heightPerRow);this.heightPerRow&&e&&e>this.minHeightPerRow?this.setHeight(this.rows*e+"px"):this.setHeight(this.rows*this.minHeightPerRow+"px")},e.prototype.setHeight=function(e){this.renderer.setStyle(this.elem.nativeElement,"height",e)},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},yc([t.Input(),t.HostBinding("rows")],e.prototype,"rows",void 0),yc([t.Input("heightPerRow")],e.prototype,"heightPerRow",void 0),e=yc([t.Directive({selector:"textarea[heightPerRow]"})],e)}(),Md=function(){function e(e,t,n){this.el=e,this.renderer=t,this.translationService=n,this.shouldSkipRequiredHint=!1,this.shouldSkipRequiredHint=!!this.el.nativeElement.closest("[placeholder-no-required-hint]")}return e.prototype.ngAfterContentChecked=function(){if(this.el&&this.el.nativeElement&&void 0!==this.el.nativeElement.required){var e=this.el.nativeElement.required&&!this.shouldSkipRequiredHint,t=this.el.nativeElement.placeholder;this.placeholder===t&&this.req===e||this.updatePlaceholder(this.getTextForPlaceholder(t,e))}},e.prototype.getTextForPlaceholder=function(e,t){void 0===e&&(e=""),void 0===t&&(t=!1),this.req=t;var n="("+this.translationService.instant("required")+")",a=e.lastIndexOf(n);return a>0&&(e=e.slice(0,a-1)),0===a&&(e=""),t?e.trim()?e+" "+n:n:e},e.prototype.updatePlaceholder=function(e){this.renderer.setAttribute(this.el.nativeElement,"placeholder",e),this.placeholder=e},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:i.TranslateService}]},e=yc([t.Directive({selector:"input[required]"})],e)}(),Ld=function(){function e(){}return Object.defineProperty(e.prototype,"data",{get:function(){return this.ipRangeList},set:function(e){this.ipRangeList=e,0===this.ipRangeList.length&&this.add()},enumerable:!0,configurable:!0}),e.prototype.add=function(){this.ipRangeList.push({ip:"",cidr:void 0})},e.prototype.remove=function(e){this.ipRangeList.splice(e,1)},yc([t.Input()],e.prototype,"data",null),e=yc([t.Component({selector:"c8y-ip-range-input-list",template:'<c8y-form-group class="m-t-8 m-b-8">\n <ul c8yInputGroupListContainer class="list-unstyled">\n <li class="m-b-8" *ngFor="let item of data; let i = index">\n <c8y-input-group-list [index]="i" (onAdd)="add()" (onRemove)="remove($event)">\n <input\n type="text"\n name="ipAddress"\n class="form-control m-r-4"\n placeholder="{{ \'IP range start, e.g.\' | translate }} 192.168.0.1"\n style="flex-grow: 2;"\n [(ngModel)]="item.ip"\n [required]="true"\n #ipAddress\n />\n <input\n type="number"\n name="cidr"\n [min]="0"\n class="form-control"\n placeholder="{{ \'e.g.\' | translate }} 20"\n [(ngModel)]="item.cidr"\n [required]="true"\n #cidr\n />\n </c8y-input-group-list>\n </li>\n </ul>\n</c8y-form-group>\n'})],e)}(),Rd=function(){function e(){this.onSearch=new t.EventEmitter,this.filterChange$=new a.Subject,this.filterTerm="",this.CARRIAGE_RETURN_KEY=13,this.CARRIAGE_RETURN_CODE="Enter"}return e.prototype.ngOnInit=function(){var e=this;this.reset(),this.filterChange$.pipe(s.debounce((function(t){return t.code===e.CARRIAGE_RETURN_CODE||t.keyCode===e.CARRIAGE_RETURN_KEY?a.timer(10):a.timer(300)})),s.map((function(e){return e.target.value})),s.distinctUntilChanged()).subscribe((function(t){e.filterTerm=t,e.onSearch.emit(t)}))},e.prototype.reset=function(){this.filterTerm="",this.onSearch.emit("")},e.prototype.ngOnDestroy=function(){this.filterChange$.complete()},yc([t.Input()],e.prototype,"icon",void 0),yc([t.Output()],e.prototype,"onSearch",void 0),e=yc([t.Component({selector:"c8y-filter",template:'<div class="input-group input-group-search">\n <input\n class="form-control"\n placeholder="{{ \'Filter…\' | translate }}"\n type="text"\n [value]="filterTerm"\n (keyup)="filterChange$.next($event)"\n />\n <span class="input-group-btn">\n <button class="btn btn-clean" (click)="reset()">\n <i [c8yIcon]="filterTerm.length === 0 ? icon : \'close\'"></i>\n </button>\n </span>\n</div>\n'})],e)}(),qd=function(){function e(){}return e=yc([t.NgModule({imports:[Yu,ac.FormsModule],exports:[Cd,Pd,Od,xd,ac.FormsModule,Td,Ed,kd,Ad,_d,Nd,Dd,Md,Ld,Rd],declarations:[Cd,Pd,Od,xd,Td,Ed,kd,Ad,_d,Nd,Dd,Md,Ld,Rd]})],e)}(),$d=function(){function e(e,n,a){this.loginService=e,this.users=n,this.alert=a,this.verify=!0,this.onSuccess=new t.EventEmitter,this.model={token:""},this.loading=!1,this.hasError=!1}return e.prototype.verifyCode=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.loading=!0,this.hasError=!1,this.verify?[4,this.users.verifyTotpCode(this.model.token)]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.onSuccess.emit(this.model.token),[3,4];case 3:return e.sent(),this.hasError=!0,this.alert.removeLastDanger(),this.loading=!1,[3,4];case 4:return[2]}}))}))},e.ctorParameters=function(){return[{type:ud},{type:l.UserService},{type:Mc}]},yc([t.Input()],e.prototype,"verify",void 0),yc([t.Output()],e.prototype,"onSuccess",void 0),yc([t.Input()],e.prototype,"loading",void 0),yc([t.Input()],e.prototype,"hasError",void 0),e=yc([t.Component({selector:"c8y-totp-challenge",template:'<form\n #totpForm="ngForm"\n role="form"\n class="loginForm"\n (ngSubmit)="verifyCode()"\n novalidate\n>\n\n <c8y-form-group\n [hasError]="hasError"\n [novalidation]="true"\n >\n <label\n translate\n for="totpToken"\n >Verification code</label>\n <input\n id="totpToken"\n [(ngModel)]="model.token"\n name="totpToken"\n type="text"\n autocapitalize="off"\n autocorrect="off"\n autocomplete="off"\n class="form-control"\n placeholder="{{\'Verification code\' | translate}}"\n required\n >\n <c8y-messages>\n <c8y-message *ngIf="hasError" translate>\n Invalid verification code. In case of key loss, please contact your platform administrator.\n </c8y-message>\n </c8y-messages>\n <p id="helpinput" *ngIf="!hasError" class="help-block" translate>\n In case of key loss, please contact your platform administrator.\n </p>\n </c8y-form-group>\n\n <button\n title="{{ \'Verify\' | translate }}" \n [disabled]="!totpForm.form.valid || loading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >Verify</button>\n\n</form>\n',viewProviders:[{provide:ac.ControlContainer,useExisting:ac.NgForm}]})],e)}(),Fd=function(){function e(e,n,a){this.loginService=e,this.users=n,this.alert=a,this.onCancel=new t.EventEmitter,this.model={smsToken:""},this.isLoading=!1,this.resendTfa="0"}return e.prototype.verifyTFACode=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return this.isLoading=!0,this.useOAuthInternal()?[4,this.verifyCodeWithOauth()]:[3,2];case 1:return e.sent(),[3,4];case 2:return[4,this.verifyCodeWithBasicAuth()];case 3:e.sent(),e.label=4;case 4:return this.isLoading=!1,[2]}}))}))},e.prototype.resendTFASms=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,3,4]),this.isLoading=!0,[4,this.users.verifyTFACode(this.resendTfa)];case 1:return t.sent(),[3,4];case 2:return 403===(e=t.sent()).res.status?(this.loginService.cleanMessages(),this.loginService.addSuccessMessage("resend_sms")):this.alert.addServerFailure(e),[3,4];case 3:return this.isLoading=!1,[7];case 4:return[2]}}))}))},e.prototype.useOAuthInternal=function(){return this.loginService.isPasswordGrantLogin(this.credentials)},e.prototype.verifyCodeWithOauth=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=this.credentials,[4,this.loginService.switchLoginMode(fc({},e,{tfa:this.model.smsToken}))];case 1:return n.sent(),[4,this.loginService.verifyAppAccess()];case 2:return n.sent(),[4,this.loginService.authFulfilled()];case 3:return n.sent(),[3,5];case 4:return t=n.sent(),401===(t.res&&t.res.status)?this.alert.danger("Invalid code"):this.alert.addServerFailure(t),[3,5];case 5:return[2]}}))}))},e.prototype.verifyCodeWithBasicAuth=function(){return jc(this,void 0,void 0,(function(){var e,t,n;return bc(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.users.verifyTFACode(this.model.smsToken)];case 1:return e=a.sent().res,t=e.headers.get("tfatoken"),this.credentials.tfa=t,this.loginWithTFA(t),[3,3];case 2:return n=a.sent(),403===(n.res&&n.res.status)?this.alert.danger("Invalid code"):this.alert.addServerFailure(n),[3,3];case 3:return[2]}}))}))},e.prototype.loginWithTFA=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.loginService.login(this.loginService.useBasicAuth({tfa:e}),this.credentials)];case 1:return n.sent(),this.loginService.saveTFAToken(e,sessionStorage),this.loginService.rememberMe&&this.loginService.saveTFAToken(e,localStorage),[3,3];case 2:return t=n.sent(),this.alert.addServerFailure(t),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:ud},{type:l.UserService},{type:Mc}]},yc([t.Input()],e.prototype,"credentials",void 0),yc([t.Output()],e.prototype,"onCancel",void 0),e=yc([t.Component({selector:"c8y-sms-challenge",template:'<form #twoFactorForm="ngForm" role="form" class="loginForm" (ngSubmit)="verifyTFACode()" novalidate>\n <div class="legend form-block center" translate>Insert the code received via SMS</div>\n\n <c8y-form-group>\n <label translate>Verification code</label>\n <input\n [(ngModel)]="model.smsToken"\n #sms_token="ngModel"\n type="text"\n name="sms_token"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Verification code\' | translate }}"\n required\n />\n </c8y-form-group>\n\n <button\n title="{{ \'Verify\' | translate }}"\n [disabled]="!twoFactorForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Verify\n </button>\n\n <div class="top-m-sm">\n <a\n title="{{ \'Login\' | translate }}"\n class="btn btn-link btn-sm pull-right"\n (click)="onCancel.emit()"\n translate\n >Login</a\n >\n <a\n title="{{ \'Send new code\' | translate }}"\n [ngClass]="{ disabled: isLoading }"\n class="btn btn-link btn-sm"\n (click)="resendTFASms()"\n translate\n >Send new code</a\n >\n </div>\n</form>\n'})],e)}(),Ud=function(){function e(e,t){this.user=e,this.alert=t}return Object.defineProperty(e.prototype,"qrCodeImage",{get:function(){return this.totpSecret?this.totpSecret.secretQrUrl:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"secret",{get:function(){return this.totpSecret?this.totpSecret.rawSecret:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qrData",{get:function(){var e=this.qrCodeImage.split("chl=")[1];return e?decodeURIComponent(e):(this.alert.danger("Failed to generate a QR code."),"")},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.user.generateTotpSecret()];case 1:return e=n.sent().data,this.totpSecret=e,[3,3];case 2:return t=n.sent(),this.alert.addServerFailure(t),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:l.UserService},{type:Mc}]},e=yc([t.Component({selector:"c8y-totp-setup",template:'<div class="text-center">\n <p\n class="lead bottom-m-md"\n translate\n >\n Scan this QR code with your smartphone using the Google Authenticator app.\n </p>\n\n\n <qrcode\n *ngIf="totpSecret"\n [width]="300"\n [qrdata]="qrData"\n [cssClass]="\'bottom-m-md\'"\n [errorCorrectionLevel]="\'M\'"\n ></qrcode>\n <p class="text-center text-muted">\n {{secret}}\n </p>\n</div>\n'})],e)}(),Bd=function(){function n(e,n,a){this.loginService=e,this.alert=n,this.userService=a,this.onCancel=new t.EventEmitter,this.onChangeView=new t.EventEmitter,this.requestInProgress=!1,this.sendTfa="0"}return n.prototype.sendTFASms=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.userService.verifyTFACode(this.sendTfa)];case 1:return t.sent(),[3,3];case 2:if(403!==(e=t.sent()).res.status)throw e;return this.loginService.cleanMessages(),this.loginService.addSuccessMessage("send_sms"),[3,3];case 3:return[2]}}))}))},n.prototype.save=function(){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),this.requestInProgress=!0,[4,this.userService.savePhoneNumber(this.phoneNumber)];case 1:return n.sent(),[4,this.sendTFASms()];case 2:return n.sent(),this.onChangeView.emit({view:e.LoginViews.SmsChallenge,credentials:this.credentials}),[3,5];case 3:return t=n.sent(),this.alert.addServerFailure(t),[3,5];case 4:return this.requestInProgress=!1,[7];case 5:return[2]}}))}))},n.ctorParameters=function(){return[{type:ud},{type:Mc},{type:l.UserService}]},yc([t.Input()],n.prototype,"credentials",void 0),yc([t.Output()],n.prototype,"onCancel",void 0),yc([t.Output()],n.prototype,"onChangeView",void 0),n=yc([t.Component({selector:"c8y-provide-phone-number",template:'<form\n #twoFactorForm="ngForm"\n role="form"\n class="loginForm"\n (ngSubmit)="save()"\n novalidate\n>\n <c8y-form-group>\n <label translate>Provide your phone number</label>\n\n <input\n class="form-control"\n [(ngModel)]="phoneNumber"\n #contactPhone="ngModel"\n type="text"\n name="phone"\n autocomplete="off"\n placeholder="{{ \'e.g. +49 9 876 543 210`LOCALIZE`\' | translate }}"\n c8yPhoneValidation\n c8yDefaultValidation="phoneNumber"\n required\n />\n </c8y-form-group>\n\n <button\n title="{{ \'Save and continue\' | translate }}"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n [disabled]="requestInProgress || twoFactorForm.invalid"\n >\n {{ \'Save and continue\' | translate }}\n </button>\n\n <div class="”m-t-16”">\n <a\n title="{{ \'Login\' | translate }}"\n class="btn btn-link pull-right"\n href="#"\n (click)="onCancel.emit()"\n >\n {{ \'Login\' | translate }}\n </a>\n </div>\n</form>\n'})],n)}(),zd=function(){function e(){}return e=yc([t.NgModule({declarations:[$d,gd,fd,md,yd,dd,Fd,Ud,Bd],imports:[qd,u.TooltipModule,Yu,Sd,rc.QRCodeModule],exports:[$d,fd,md,gd,yd,dd,Fd,Ud,Bd],entryComponents:[dd],providers:[hd,pd]})],e)}(),Gd=function(){function e(){}return yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"translate",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"path",void 0),yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=yc([t.Component({selector:"c8y-breadcrumb-item",template:"<ng-template #template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),Hd=function(){function e(){this.showAll=!1,this.breadcrumbs=[]}return e.prototype.normalizePath=function(e){return e.replace(/^#\/?/,"")},yc([t.Input()],e.prototype,"breadcrumbs",void 0),e=yc([t.Component({selector:"c8y-breadcrumb-outlet",template:'<div\n class="breadcrumbs-container"\n [ngClass]="{\n multiple: breadcrumbs.length > 1,\n open: showAll\n }"\n *ngIf="breadcrumbs && breadcrumbs.length > 0"\n>\n <button\n *ngIf="breadcrumbs.length > 1"\n class="btn-show-all-breadcrumbs pull-left"\n (click)="showAll = !showAll"\n >\n <i\n *ngIf="!showAll"\n [c8yIcon]="\'caret-right\'"\n tooltip="{{ \'Show all breadcrumbs\' | translate }}"\n container="body"\n placement="top"\n ></i>\n <i\n *ngIf="showAll"\n [c8yIcon]="\'caret-down\'"\n tooltip="{{ \'Collapse breadcrumbs\' | translate }}"\n container="body"\n placement="top"\n ></i>\n </button>\n\n <ul class="breadcrumbs text-muted" *ngFor="let breadcrumb of breadcrumbs; let first = first">\n <ng-container *ngIf="first || showAll">\n <li class="text-muted" *ngFor="let item of breadcrumb.items; let firstItem = first">\n <span *ngIf="!firstItem"> > </span>\n <ng-container *c8yOutlet="item.template"></ng-container>\n <ng-container *ngIf="item.label">\n <a\n [routerLink]="normalizePath(item.path)"\n class="word-break"\n title="{{ item.label | translate }}"\n >\n <i [c8yIcon]="item.icon" *ngIf="firstItem" class="right-m-xs"></i>\n <span>{{ item.label | translate }}</span>\n </a>\n </ng-container>\n </li>\n </ng-container>\n </ul>\n</div>\n'})],e)}(),Vd=function(){function e(e){this.breadcrumbService=e}return e.prototype.ngAfterViewInit=function(){var e=this;this.items=this.contentChildItems.toArray(),this.viewInitTimeout=setTimeout((function(){return e.breadcrumbService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.breadcrumbService.remove(this)},e.ctorParameters=function(){return[{type:Yc}]},yc([t.ContentChildren(Gd)],e.prototype,"contentChildItems",void 0),e=yc([t.Component({selector:"c8y-breadcrumb",template:"<ng-template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),Kd=function(){function e(){}return e=yc([t.NgModule({declarations:[Vd,Gd,Hd],imports:[n.RouterModule.forChild([]),Yu,u.TooltipModule.forRoot()],exports:[Vd,Gd,Hd]})],e)}(),Wd=function(){function e(e){this.alertService=e,this.search=[]}return e.prototype.openSearch=function(){var e=this;setTimeout((function(){return e.focusInputBox()}),100)},e.prototype.getByPriority=function(){return Qi.sortBy(this.search,this.byPriority)},e.prototype.closeDropdown=function(e){e.hide()},e.prototype.verifyNotEmpty=function(e){e&&""!==e||this.alertService.add({text:"Type something to execute a search.",type:"warning"})},e.prototype.byPriority=function(e){return-e.priority},e.prototype.focusInputBox=function(){var e=document.querySelector("#search-header-menu input");e&&e.focus()},e.ctorParameters=function(){return[{type:Mc}]},yc([t.Input()],e.prototype,"search",void 0),e=yc([t.Component({selector:"c8y-search-outlet",template:'<ng-container *ngIf="search">\n <div class="dropdown" dropdown #dropdown="bs-dropdown" *ngFor="let item of getByPriority()">\n <button\n title="{{ \'Search\' | translate }}"\n type="button"\n class="main-header-button dropdown-toggle c8y-dropdown"\n (click)="openSearch()"\n dropdownToggle\n >\n <i [c8yIcon]="item.icon" class="fa-2x"></i>\n </button>\n\n <div\n id="search-header-menu"\n class="search-header-menu dropdown-menu dropdown-menu-center"\n *dropdownMenu\n >\n <form\n (ngSubmit)="verifyNotEmpty(item.term); item.onSearch(); closeDropdown(dropdown)"\n novalidate\n #searchForm="ngForm"\n >\n <div class="input-group input-group-search" *ngIf="!item.template">\n <input\n type="search"\n class="form-control input-lg"\n required="required"\n [placeholder]="\'Search for groups or assets…\'|translate"\n (click)="$event.stopPropagation()"\n [(ngModel)]="item.term"\n name="searchTerm"\n />\n\n <span class="input-group-btn">\n <button type="submit" class="btn btn-link" (click)="$event.stopPropagation()">\n <i [c8yIcon]="\'arrow-right\'"></i>\n </button>\n </span>\n </div>\n\n <ng-container *c8yOutlet="item.template"></ng-container>\n </form>\n </div>\n </div>\n</ng-container>\n'})],e)}(),Yd=new t.InjectionToken("SearchFactory"),Zd=function(e){function o(t,n){var o=e.call(this)||this;return o.injector=t,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.items$=Cc(n,o.refreshTrigger,[function(){return o.injector.get(Yd,[])},Oc(o.state$)]).pipe(s.map((function(e){return xc(e)})),s.shareReplay(1)),o}return hc(o,e),o.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),Jd=function(){function e(e){this.searchService=e,this.icon="search",this.priority=0,this.search=new t.EventEmitter,this.term=""}return e.prototype.onSearch=function(){this.search.emit(this)},e.prototype.ngAfterViewInit=function(){var e=this;this.template=void 0,this.viewInitTimeout=setTimeout((function(){return e.searchService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.searchService.remove(this)},e.ctorParameters=function(){return[{type:Zd}]},yc([t.Input()],e.prototype,"name",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"priority",void 0),yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),yc([t.Output()],e.prototype,"search",void 0),yc([t.Input()],e.prototype,"term",void 0),e=yc([t.Component({selector:"c8y-search",template:"<ng-template #template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),Xd=function(){function e(){this.pattern="",this.text="",this.elementClass="text-info",this.highlightedText=""}return e.prototype.ngOnChanges=function(){var e=o.escape(this.text||""),t=o.escape(this.pattern||""),n=o.escapeRegExp(t).replace(/\\\*/g,".*");this.highlightedText=e.replace(new RegExp(n,"i"),'<strong class="'+this.elementClass+'">$&</strong>')},yc([t.ViewChild("text",{read:t.ElementRef,static:!0})],e.prototype,"container",void 0),yc([t.Input()],e.prototype,"pattern",void 0),yc([t.Input()],e.prototype,"text",void 0),yc([t.Input()],e.prototype,"elementClass",void 0),e=yc([t.Component({selector:"c8y-highlight",template:'<span [innerHTML]="highlightedText"></span>'})],e)}(),Qd=function(){function e(){this.NO_RESULT_FOUND="No results found.",this.msg=this.NO_RESULT_FOUND}return Object.defineProperty(e.prototype,"_message",{set:function(e){e&&e.length>0?this.msg=e:this.msg=this.NO_RESULT_FOUND},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this.msg},enumerable:!0,configurable:!0}),yc([t.Input("message")],e.prototype,"_message",null),e=yc([t.Component({selector:"c8y-search-result-empty",template:'<div class="no-results">\n <div class="c8y-empty-state">\n <h1 c8yIcon="search"></h1>\n <div class="p-t-8">\n <p><strong>{{ message | translate }}</strong></p>\n <small translate>Refine your search terms.</small>\n </div>\n </div>\n</div>\n'})],e)}(),ep=function(){function e(){}return e=yc([t.NgModule({declarations:[Wd,Jd,Xd,Qd],imports:[ac.FormsModule,tc.BsDropdownModule,Yu,n.RouterModule.forChild([])],exports:[Wd,Jd,Xd,Qd]})],e)}(),tp=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.state$=new a.BehaviorSubject({userMenuItems:new Set}),t}return hc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.add=function(e){this.state.userMenuItems.add(e),this.emitNewState()},n.prototype.remove=function(e){this.state.userMenuItems.delete(e),this.emitNewState()},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n=yc([t.Injectable({providedIn:"root"})],n)}(kc),np=function(){function e(e){this.userService=e,this.priority=0,this.click=new t.EventEmitter}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.userService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.userService.remove(this)},e.prototype.onClick=function(){this.click.emit(this)},e.ctorParameters=function(){return[{type:tp}]},yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"link",void 0),yc([t.Input()],e.prototype,"target",void 0),yc([t.Input()],e.prototype,"priority",void 0),yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),yc([t.Output()],e.prototype,"click",void 0),e=yc([t.Component({selector:"c8y-user-menu-item",template:'<ng-template #template>\n <li (click)="onClick()">\n <a style="cursor: pointer" [attr.href]="link" [attr.target]="target">\n <i [c8yIcon]="icon"></i>\n {{label | translate}}\n <ng-content></ng-content>\n </a>\n </li>\n</ng-template>'})],e)}(),ap=function(){function e(e,t,n,a,o,r,l,i,c){var u=this;this.modal=e,this.user=t,this.ui=n,this.auth=a,this.client=o,this.alert=r,this.translate=l,this.userPreferences=i,this.modalService=c,this.loading=!1,this.lang=this.ui.state.lang,this.modalService.onHide.pipe(s.take(1)).subscribe((function(e){null!==e&&void 0!==u.changedLang&&u.translate.switchToLanguage(u.lang)}))}return e.prototype.ngOnInit=function(){this.updateUserInAppState()},e.prototype.onDismiss=function(){void 0!==this.changedLang&&this.translate.switchToLanguage(this.lang),this.modal.hide()},e.prototype.onLanguage=function(e){this.changedLang=e,this.translate.switchToLanguage(this.changedLang)},e.prototype.updateAndClose=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:this.loading=!0,n.label=1;case 1:return n.trys.push([1,6,7,8]),[4,this.user.updateCurrent(e)];case 2:return n.sent(),e.password&&this.updateCredentials(e.password),[4,this.updateUserInAppState()];case 3:return n.sent(),this.changedLang&&this.changedLang!==this.lang?[4,this.persistLanguage(this.changedLang)]:[3,5];case 4:n.sent(),n.label=5;case 5:return this.modal.hide(),this.alert.success("User saved."),[3,8];case 6:return t=n.sent(),this.alert.addServerFailure(t),[3,8];case 7:return this.loading=!1,[7];case 8:return[2]}}))}))},e.prototype.persistLanguage=function(e){return jc(this,void 0,void 0,(function(){return bc(this,(function(t){return this.translate.saveInLocalStorage(e),this.userPreferences.set("language",e),[2]}))}))},e.prototype.updateUserInAppState=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return[4,this.user.current()];case 1:return e=t.sent(),this.ui.currentUser.next(e.data),[2]}}))}))},e.prototype.updateCredentials=function(e){var t={password:e,user:this.ui.currentUser.value.id,tenant:this.client.tenant};this.auth.updateCredentials(t)},e.ctorParameters=function(){return[{type:nc.BsModalRef},{type:l.UserService},{type:$c},{type:l.BasicAuth},{type:l.FetchClient},{type:Mc},{type:Cu},{type:zu},{type:nc.BsModalService}]},e=yc([t.Component({selector:"c8y-user-edit-modal",template:'<c8y-modal\n [customFooter]="true"\n [title]="\'Edit user\' | translate"\n (onDismiss)="onDismiss()"\n>\n <c8y-user-edit\n [lang]="lang"\n [user]="ui.currentUser | async"\n [loading]="loading"\n (onLanguage)="onLanguage($event)"\n (onUser)="updateAndClose($event)"\n (onCancel)="onDismiss()"\n >\n </c8y-user-edit>\n</c8y-modal>'})],e)}(),sp=function(){function n(e,t,n,a){this.user=e,this.modalService=t,this.modal=n,this.loginService=a}return n.prototype.totpSetupVerified=function(t){return jc(this,void 0,void 0,(function(){return bc(this,(function(t){switch(t.label){case 0:return[4,this.user.activateTotp()];case 1:t.sent(),this.modal.hide(),t.label=2;case 2:return t.trys.push([2,5,,6]),[4,this.modalService.acknowledge("Logout required","You must log out in order to apply your changes",e.Status.WARNING,"Log out")];case 3:return t.sent(),[4,this.loginService.logout()];case 4:return t.sent(),[3,6];case 5:return t.sent(),[3,6];case 6:return[2]}}))}))},n.prototype.close=function(){this.modal.hide()},n.ctorParameters=function(){return[{type:l.UserService},{type:bd},{type:nc.BsModalRef},{type:ud}]},n=yc([t.Component({selector:"c8y-user-totp-setup",template:'<c8y-modal [customFooter]="true">\n <ng-container c8y-modal-title>\n <button\n title="{{ \'Close\' | translate }}"\n (click)="close()"\n type="button"\n class="close"\n ><span aria-hidden="true">×</span></button>\n <h3 class="text-center" translate>Set up two-factor authentication</h3>\n </ng-container>\n <c8y-totp-setup></c8y-totp-setup>\n <c8y-totp-challenge (onSuccess)="totpSetupVerified($event)"></c8y-totp-challenge>\n</c8y-modal>\n'})],n)}(),op=function(){function e(e,n,a,s,o,r,l,i,c){this.state=e,this.translate=n,this.passwordService=a,this.modalConfirmService=s,this.bsModalService=o,this.alert=r,this.userService=l,this.tenantLoginOptionsService=i,this.tenantService=c,this.loading=!1,this.onUser=new t.EventEmitter,this.onLanguage=new t.EventEmitter,this.onCancel=new t.EventEmitter,this.userHasActiveTotp=!1,this.userCanSetupTotp=!1,this.isPhoneRequired=!1}return Object.defineProperty(e.prototype,"user",{get:function(){return this._user},set:function(e){this._user=o.clone(e),this.userIsExternal="OAUTH2"===e.customProperties.userOrigin,this.isPhoneRequired=this.isPhoneRequired&&e.twoFactorAuthenticationEnabled},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){return jc(this,void 0,void 0,(function(){var e,t,n,a;return bc(this,(function(s){switch(s.label){case 0:return[4,this.tenantService.current()];case 1:return e=s.sent().data,[4,this.tenantService.getTfaSettings(e)];case 2:return t=s.sent(),n=t.enabledOnSystemLevel,a=t.enabledOnTenantLevel,this.isTfaEnabled=n||a,[4,this.initializeTotpSettings()];case 3:return s.sent(),this.user.twoFactorAuthenticationEnabled&&!this.userCanSetupTotp&&(this.isPhoneRequired=!0),[2]}}))}))},Object.defineProperty(e.prototype,"langs",{get:function(){return this.state.state.langs},enumerable:!0,configurable:!0}),e.prototype.setupTotp=function(){this.bsModalService.show(sp,{class:"modal-sm"}),this.cancel()},e.prototype.cancel=function(){this.onCancel.emit()},e.prototype.save=function(){this.loading||(this._user.password?this.saveAfterPasswordConfirmation():this.onUser.emit(this._user))},e.prototype.onNewPasswordChanged=function(e){this._user.password=e.password},e.prototype.initializeTotpSettings=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=this,[4,this.canUserSetupTotp()];case 1:return e.userCanSetupTotp=n.sent(),this.userCanSetupTotp?[4,this.userService.getActivityTotp()]:[3,3];case 2:t=n.sent().data,this.userHasActiveTotp=t.isActive,n.label=3;case 3:return[3,5];case 4:return n.sent(),this.alert.removeLastDanger(),[3,5];case 5:return[2]}}))}))},e.prototype.canUserSetupTotp=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return[4,this.tenantLoginOptionsService.detail()];case 1:return[2,e.sent().data.loginOptions.some((function(e){var t=e.tfaStrategy;return"totp"===(void 0===t?"":t).toLowerCase()}))]}}))}))},e.prototype.saveAfterPasswordConfirmation=function(){var e=this;this.passwordService.confirmPassword().subscribe((function(t){t&&e.onUser.emit(e._user)}))},e.ctorParameters=function(){return[{type:$c},{type:Cu},{type:pd},{type:bd},{type:nc.BsModalService},{type:Mc},{type:l.UserService},{type:l.TenantLoginOptionsService},{type:l.TenantService}]},yc([t.Input()],e.prototype,"lang",void 0),yc([t.Input()],e.prototype,"loading",void 0),yc([t.Input()],e.prototype,"user",null),yc([t.Output()],e.prototype,"onUser",void 0),yc([t.Output()],e.prototype,"onLanguage",void 0),yc([t.Output()],e.prototype,"onCancel",void 0),e=yc([t.Component({selector:"c8y-user-edit",template:'<form #userForm="ngForm" (ngSubmit)="userForm.form.valid && save()">\n <div class="alert alert-warning" role="alert" *ngIf="userIsExternal" translate>\n You cannot edit the user since it is managed via your authorization server.\n </div>\n <c8y-form-group>\n <label translate for="userName">Username (e.g. email)</label>\n <input\n id="userName"\n class="form-control"\n [(ngModel)]="user.userName"\n name="userName"\n autocomplete="off"\n required\n maxlength="254"\n placeholder="{{ \'e.g. joe.doe@example.com`LOCALIZE`\' | translate }}"\n [disabled]="user.id"\n c8yDefaultValidation="user"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate for="displayName">Login alias</label>\n <input\n id="displayName"\n class="form-control"\n [(ngModel)]="user.displayName"\n name="displayName"\n autocomplete="off"\n maxlength="254"\n placeholder="{{ \'e.g. joe.doe`LOCALIZE`\' | translate }}"\n [disabled]="userIsExternal"\n c8yDefaultValidation="loginAlias"\n />\n </c8y-form-group>\n\n <c8y-form-group [hasWarning]="!user.email">\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`LOCALIZE`\' | translate }}"\n [(ngModel)]="user.email"\n email\n [required]="user.newsletter"\n [disabled]="userIsExternal"\n />\n <c8y-messages>\n <c8y-message *ngIf="!user.email" translate\n >Note that email is required to reset password.</c8y-message\n >\n </c8y-messages>\n </c8y-form-group>\n\n <div class="row" style="margin-left:-15px; margin-right:-15px">\n <div class="col-sm-6">\n <c8y-form-group>\n <label translate for="userFirstName">First name</label>\n <input\n id="userFirstName"\n class="form-control"\n autocomplete="off"\n maxlength="50"\n name="firstName"\n [(ngModel)]="user.firstName"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n </div>\n <div class="col-sm-6">\n <c8y-form-group>\n <label translate for="userLastName">Last name</label>\n <input\n id="userLastName"\n class="form-control"\n autocomplete="off"\n maxlength="50"\n name="lastName"\n [(ngModel)]="user.lastName"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n </div>\n </div>\n\n <c8y-form-group>\n <label translate for="userTelephone">Telephone</label>\n <input\n id="userTelephone"\n class="form-control"\n autocomplete="off"\n name="phone"\n maxlength="254"\n [(ngModel)]="user.phone"\n placeholder="{{ \'e.g. +49 9 876 543 210`LOCALIZE`\' | translate }}"\n c8yPhoneValidation\n c8yDefaultValidation="phoneNumber"\n [required]="isPhoneRequired"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate for="userLang">Language</label>\n <div class="c8y-select-wrapper">\n <select\n id="userLang"\n class="form-control"\n #selectLang\n name="lang"\n [(ngModel)]="lang"\n (change)="onLanguage.emit(selectLang.value)"\n [disabled]="userIsExternal"\n >\n <option *ngFor="let lang of langs" [value]="lang">{{\n translate.getNativeLanguage(lang)\n }}</option>\n </select>\n <span></span>\n </div>\n </c8y-form-group>\n\n <div class="form-group" *ngIf="!userIsExternal">\n <label class="control-label">{{ \'Login options\' | translate }}</label>\n <c8y-new-password (password)="onNewPasswordChanged($event)"></c8y-new-password>\n <button\n title="{{ \'Set up two-factor authentication\' | translate }}"\n class="btn btn-default"\n type="button"\n (click)="setupTotp()"\n translate\n *ngIf="userCanSetupTotp && !userHasActiveTotp && isTfaEnabled"\n >\n Set up two-factor authentication\n </button>\n </div>\n\n <c8y-form-group *ngIf="!!(state.state$ | async).newsletter">\n <label translate>Newsletter</label>\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n name="newsletter"\n [(ngModel)]="user.newsletter"\n [disabled]="userIsExternal"\n />\n <span></span>\n {{ \'Send me information about outages, maintenance or updates.\' | translate }}\n </label>\n </c8y-form-group>\n\n <div class="modal-footer">\n <button\n title="{{ \'Cancel\' | translate }}"\n class="btn btn-default"\n type="button"\n (click)="cancel()"\n translate\n >\n Cancel\n </button>\n <button\n title="{{ \'Save\' | translate }}"\n class="btn btn-primary"\n type="submit"\n [disabled]="!userForm.form.valid || userForm.form.pristine || loading || userIsExternal"\n translate\n >\n Save\n </button>\n </div>\n</form>\n'})],e)}(),rp=function(){function n(e,t,n,a,s,o,r,l,i){this.ui=e,this.bsModalService=t,this.modalService=n,this.loginService=a,this.translateService=s,this.tenantService=o,this.alertService=r,this.user=l,this.optionsService=i}return n.prototype.copyIt=function(e){var t,n={handleEvent:function(t){t.clipboardData.setData("text/plain",e),t.preventDefault()}};document.addEventListener("copy",n);try{t=document.execCommand("copy")}catch(e){t=!1}t?this.alertService.addByText("success","Copied to clipboard."):this.alertService.addByText("danger","Could not copy to clipboard."),document.removeEventListener("copy",n)},n.prototype.editUser=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){return this.bsModalService.show(ap),[2]}))}))},n.prototype.logout=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return[4,this.loginService.logout()];case 1:return e.sent(),[2]}}))}))},n.prototype.activateSupportAccess=function(){return jc(this,void 0,void 0,(function(){var t,n,a,s,o;return bc(this,(function(r){switch(r.label){case 0:t="Activate support user access",n=this.optionsService.get("companyName","Cumulocity"),"You are about to allow a support user from {{companyName}} to access your tenant to help you with your issue.","You are about to allow a support user to access your tenant to help you with your issue.","Do you want to proceed?",a=[this.translateService.instant(n?"You are about to allow a support user from {{companyName}} to access your tenant to help you with your issue.":"You are about to allow a support user to access your tenant to help you with your issue.",{companyName:n}),this.translateService.instant("Do you want to proceed?")].join(" "),s={ok:"Activate access",cancel:"Cancel"},o="Support user access activated.",r.label=1;case 1:return r.trys.push([1,5,,6]),[4,this.modalService.confirm(t,a,e.Status.DANGER,s)];case 2:return r.sent(),[4,this.tenantService.enableSupportUser()];case 3:return r.sent(),[4,this.refreshCurrentUser()];case 4:return r.sent(),this.alertService.success(o),[3,6];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},n.prototype.deactivateSupportAccess=function(){return jc(this,void 0,void 0,(function(){var t,n,a,s,o,r,l,i,c;return bc(this,(function(u){switch(u.label){case 0:return t="Deactivate support user access",n=this.optionsService.get("companyName","Cumulocity"),a="You are about to block a support user from {{companyName}} from accessing your tenant to help you with your issue.",s="You are about to block a support user from accessing your tenant to help you with your issue.",[4,this.user.current()];case 1:return o=u.sent().data,[4,this.user.hasRole(o,"ROLE_TENANT_ADMIN")];case 2:r=u.sent(),"Deactivating support access as tenant admin will disable all other support requests on your tenant.","Do you want to proceed?",l=[this.translateService.instant(n?a:s,{companyName:n}),r?this.translateService.instant("Deactivating support access as tenant admin will disable all other support requests on your tenant."):"",this.translateService.instant("Do you want to proceed?")].filter(Boolean).join(" "),i={ok:"Deactivate access",cancel:"Cancel"},c="Support user access deactivated.",u.label=3;case 3:return u.trys.push([3,7,,8]),[4,this.modalService.confirm(t,l,e.Status.DANGER,i)];case 4:return u.sent(),[4,this.tenantService.disableSupportUser()];case 5:return u.sent(),[4,this.refreshCurrentUser()];case 6:return u.sent(),this.alertService.success(c),[3,8];case 7:return u.sent(),[3,8];case 8:return[2]}}))}))},n.prototype.getSortedItems=function(){return o.sortBy(Array.from(this.items),this.byPriority)},n.prototype.refreshCurrentUser=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return[4,this.user.current()];case 1:return e=t.sent(),this.ui.currentUser.next(e.data),[2]}}))}))},n.prototype.byPriority=function(e){return-e.priority},n.ctorParameters=function(){return[{type:$c},{type:nc.BsModalService},{type:bd},{type:ud},{type:i.TranslateService},{type:l.TenantService},{type:Mc},{type:l.UserService},{type:qc}]},yc([t.Input()],n.prototype,"items",void 0),n=yc([t.Component({selector:"c8y-user-menu-outlet",template:'<div\n dropdown\n class="dropdown"\n>\n <button\n class="main-header-button c8y-dropdown dropdown-toggle"\n dropdownToggle\n style="white-space: nowrap"\n >\n <span\n class="hidden-xs text-truncate right-m"\n style="vertical-align: text-bottom; max-width: 104px; display: inline-block"\n title="{{ui.currentUser | async | shortenUserName}}"\n >\n {{ui.currentUser | async | shortenUserName}}\n </span>\n <i\n [c8yIcon]="\'c8y-user\'"\n class="fa-2x"\n ></i>\n </button>\n <ul\n *dropdownMenu\n class="dropdown-menu dropdown-menu-right"\n style="max-width: 240px;"\n >\n <ng-container *ngFor="let item of getSortedItems()">\n <ng-container *ngIf="item.template">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n <ng-container *ngIf="!item.template">\n <li (click)="item.click()">\n <a style="cursor: pointer" [attr.href]="item.link" [attr.target]="item.target">\n <i [c8yIcon]="item.icon"></i>\n {{item.label | translate}}\n </a>\n </li>\n </ng-container>\n </ng-container>\n <li\n *ngIf="!(ui.state$ | async).hidePowered"\n role="separator"\n class="divider"\n ></li>\n <li\n class="dropdown-header bg-gray-white"\n style="white-space: normal; margin-top: -1px;"\n *ngIf="!(ui.state$ | async).hidePowered"\n >\n <div class="flex-row">\n <i\n [c8yIcon]="\'info-circle\'"\n class="text-info flex-item-v-start"\n style="margin: 1px 6px 0 -3px; font-size: 14px;"\n ></i>\n <span class="text-muted text-truncate">\n {{\'Tenant ID\' | translate}}: <strong>\n <span class="text-primary" (click)="$event.stopPropagation(); copyIt(ui.currentTenant.value.name)"\n style="cursor: pointer">\n {{ui.currentTenant.value.name}} <i [c8yIcon]="\'clipboard\'"></i></span>\n </strong><br>\n {{\'Backend\' | translate}}: <strong>{{(ui.state$ | async).versions.backend}}</strong><br>\n {{\'UI\' | translate }}: <strong>{{ui.uiVersion}}</strong>\n </span>\n </div>\n </li>\n </ul>\n</div>\n\n\x3c!-- the default items --\x3e\n<c8y-user-menu-item\n [icon]="\'user\'"\n [label]="\'User settings\' | translate"\n [priority]="20"\n (click)="editUser()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n [icon]="\'sign-out\'"\n [label]="\'Logout\' | translate"\n (click)="logout()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="!(ui.currentUser | async).supportUserEnabled && ((ui.state$ | async).activateSupportUserAvailable)"\n [icon]="\'phone\'"\n [label]="\'Activate support\' | translate"\n (click)="activateSupportAccess()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="(ui.currentUser | async).supportUserEnabled && ((ui.state$ | async).activateSupportUserAvailable)"\n [icon]="\'phone\'"\n [label]="\'Deactivate support\' | translate"\n (click)="deactivateSupportAccess()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="(ui.state$ | async).supportUrl"\n [icon]="\'question-circle\'"\n [link]="(ui.state$ | async).supportUrl"\n [target]="\'_blank\'"\n [label]="\'Request support\' | translate"\n></c8y-user-menu-item>\n'})],n)}(),lp=function(){function e(e,n){this.users=e,this.alert=n,this.revokeEmitter=new t.EventEmitter}return e.prototype.revoke=function(){return jc(this,void 0,void 0,(function(){var e;return bc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.users.totpRevokeSecret(this.user)];case 1:return t.sent(),this.alert.success("User TOTP secret revoked."),this.revokeEmitter.next(),[3,3];case 2:return e=t.sent(),this.alert.addServerFailure(e),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:l.UserService},{type:Mc}]},yc([t.Input()],e.prototype,"user",void 0),yc([t.Output("revoke")],e.prototype,"revokeEmitter",void 0),e=yc([t.Component({selector:"c8y-user-totp-revoke",template:'<button\n type="button"\n class="btn btn-default"\n [popover]="confirm"\n [popoverTitle]="\'Revoke TOTP secret\' | translate"\n #popover="bs-popover"\n placement="right"\n>\n <i c8yIcon="key"></i> {{ \'Revoke TOTP secret\' | translate }}\n</button>\n\n<ng-template #confirm>\n <p class="m-b-16" translate>\n This action will revoke the user\'s stored TOTP secret which will require a new setup.\n </p>\n <button\n title="{{ \'Revoke\' | translate }}"\n type="button"\n class="btn btn-danger"\n (click)="revoke(); popover.hide()"\n translate\n >\n Revoke\n </button>\n <button\n title="{{ \'Cancel\' | translate }}"\n type="button"\n class="btn btn-default"\n (click)="popover.hide()"\n translate\n >\n Cancel\n </button>\n</ng-template>\n'})],e)}(),ip=function(){function e(){}return e=yc([t.NgModule({declarations:[rp,op,ap,np,sp,lp],imports:[qd,Yu,Sd,tc.BsDropdownModule,zd,rd,n.RouterModule,u.TooltipModule.forRoot(),sc.PopoverModule],exports:[rp,np,op,ap,sp,lp],entryComponents:[ap,sp,lp]})],e)}(),cp=function(){function e(e){this.options=e,this.name="",this.model={appIcon:"",showIcon:!0,iconClass:["c8y-icon"],appNameAbbr:"",iconStyle:{}},this.c8yAppIconsList={analyticsbuilder:"analytics-builder","analytics-builder":"analytics-builder",cockpit:"cockpit",devicemanagement:"device-management",administration:"administration",apamaepl:"apama-epl"},this.white=!1,this.defaultIconStyle={"background-repeat":"no-repeat","background-size":"contain",height:"36px",width:"36px"}}return e.prototype.ngOnChanges=function(e){this.model.appIcon=this.iconFromAppDefinition()||this.findStaticIcon();var t=this.iconUrlFromAppDefinition();t&&(this.model.iconStyle=o.assign(this.defaultIconStyle,{"background-image":t})),this.model.showIcon=!!this.model.appIcon||!o.isEmpty(this.model.iconStyle),this.model.iconClass=["c8y-icon",this.model.appIcon,this.white?"c8y-icon-white":"c8y-icon-duocolor"].filter((function(e){return!!e})),this.model.appNameAbbr=this.name.substr(0,2)},e.prototype.findStaticIcon=function(){var e=this.contextPath||this.name,t=o.find(o.keys(this.c8yAppIconsList),(function(t){return e.indexOf(t)>-1})),n=this.c8yAppIconsList[t];return n?"c8y-icon-"+n:void 0},e.prototype.iconFromAppDefinition=function(){var e=this.app||this.options,t=["icon","class"];return o.get(e,t)||o.get(e,Sc(["manifest"],t))},e.prototype.iconUrlFromAppDefinition=function(){var e=this.app||this.options,t=["icon","url"];return o.get(e,t)||o.get(e,Sc(["manifest"],t))},e.ctorParameters=function(){return[{type:qc}]},yc([t.Input()],e.prototype,"contextPath",void 0),yc([t.Input()],e.prototype,"name",void 0),yc([t.Input()],e.prototype,"app",void 0),e=yc([t.Component({selector:"c8y-app-icon",template:'<i *ngIf="model.showIcon" [ngClass]="model.iconClass" [ngStyle]="model.iconStyle"></i>\n<span *ngIf="!model.showIcon" class="app-noicon"> {{model.appNameAbbr}}</span>\n',host:{class:"c8y-app-icon"}})],e)}(),up=function(){function e(e,t){var n=this;this.ui=e,this.applications=t;var o=this.ui,r=o.currentUser,l=o.currentTenant;a.combineLatest(r,l).pipe(s.first()).subscribe((function(e){var t=wc(e,2),a=t[0],s=t[1];n.tenant=s,n.listAppsForUser(a)}))}return Object.defineProperty(e.prototype,"hideCloudApps",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.isActive=function(e){return e.contextPath===this.ui.state.app.contextPath},e.prototype.getHref=function(e){return this.applications.getHref(e)},e.prototype.listAppsForUser=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return e?[4,this.applications.listByUser(e,{pageSize:1e3})]:[3,2];case 1:t=n.sent().data,this.apps=this.orderApps(this.filterApps(t)),n.label=2;case 2:return[2]}}))}))},e.prototype.filterApps=function(e){return e=this.filterVisible(e),e=this.filterCloud(e),e=this.filterDuplicates(e)},e.prototype.filterVisible=function(e){var t=["HOSTED","EXTERNAL"];return e.filter((function(e){return o.includes(t,e.type)&&!e.noAppSwitcher&&!o.get(e,"manifest.noAppSwitcher")}))},e.prototype.filterCloud=function(e){var t=this.hideCloudApps,n=function(e){return!!e.cloud};return t||(this.oneCloudApps=this.orderApps(e.filter(n))),e.filter((function(e){return!n(e)}))},e.prototype.filterDuplicates=function(e){var t=this;return e.filter((function(n){return!e.some((function(e){return n!==e&&n.contextPath&&n.contextPath===e.contextPath&&n.owner.tenant.id!==t.tenant.name}))}))},e.prototype.orderApps=function(e){return o.orderBy(e,(function(e){return e.name.toLowerCase()}))},e.ctorParameters=function(){return[{type:$c},{type:l.ApplicationService}]},e=yc([t.Component({selector:"c8y-app-switcher",template:'<div class="app-switcher-dropdown" dropdown>\n <button\n class="main-header-button c8y-dropdown dropdown-toggle"\n id="appSwitcherDropdown"\n dropdownToggle\n >\n <i class="fa-2x fa fw fa-th"></i>\n </button>\n <div\n *dropdownMenu\n class="app-switcher-dropdown-menu dropdown-menu"\n aria-labelledby="appSwitcherDropdown"\n >\n <div class="app-switcher-sagcloud" *ngIf="oneCloudApps && oneCloudApps.length > 0">\n <a\n title="{{ app.name | humanizeAppName | async }}"\n class="appLink"\n *ngFor="let app of oneCloudApps"\n [href]="getHref(app)"\n >\n <c8y-app-icon [app]="app" [name]="app.name" [contextPath]="app.contextPath"></c8y-app-icon>\n <span class="text-truncate-wrap">{{ app | humanizeAppName | async }}</span>\n </a>\n </div>\n <div class="app-switcher">\n <a\n title="{{ app.name | humanizeAppName | async }}"\n class="appLink"\n [ngClass]="isActive(app) ? \'active\' : \'\'"\n *ngFor="let app of apps"\n [href]="getHref(app)"\n >\n <c8y-app-icon [app]="app" [name]="app.name" [contextPath]="app.contextPath"></c8y-app-icon>\n <span class="text-truncate-wrap">{{ app | humanizeAppName | async }}</span>\n </a>\n </div>\n </div>\n</div>\n'})],e)}(),dp=[{icon:"c8y-c8y-data",label:"Concepts guide`KEEP_ORIGINAL`",url:"/concepts/introduction",type:"doc"},{icon:"c8y-user",label:"User guide`KEEP_ORIGINAL`",url:"/users-guide/getting-started",type:"doc"},{icon:"c8y-device-management",label:"Device guides`KEEP_ORIGINAL`",url:"/devices/overview",type:"doc"},{icon:"c8y-book",label:"Cumulocity IoT Edge`KEEP_ORIGINAL`",url:"/edge/overview",type:"doc"},{icon:"c8y-tools",label:"Microservice SDK guide`KEEP_ORIGINAL`",url:"/microservice-sdk/introduction",type:"doc"},{icon:"c8y-tools",label:"Device SDK guide`KEEP_ORIGINAL`",url:"/device-sdk/introduction",type:"doc"},{icon:"c8y-smart-rest",label:"Web SDK guide`KEEP_ORIGINAL`",url:"/web/introduction",type:"doc"},{icon:"c8y-data-explorer",label:"Streaming analytics guide`KEEP_ORIGINAL`",url:"/apama/introduction",type:"doc"},{icon:"c8y-bookmark",label:"Reference guide`KEEP_ORIGINAL`",url:"/reference/rest-implementation",type:"doc"},{icon:"gavel",label:"Legal notices",url:"https://documentation.softwareag.com/legal/",type:"doc"}],pp=new t.InjectionToken("Hook docs"),mp=function(){function e(e,t,n,a){void 0===n&&(n=[]),this.options=e,this.app=t,n||(n=[]),n.push(this);var o=this.app.map((function(e){return e.supportUrl}));this.items$=Cc(a,o,n).pipe(s.startWith([]),s.shareReplay(1))}return e.prototype.getBaseUrl=function(){return this.options.get("docsBaseUrl","https://www.cumulocity.com/guides")},Object.defineProperty(e.prototype,"templateStr",{get:function(){return this.options.get("guideHrefTemplate","${docsBaseUrl}${partialUrl}")},enumerable:!0,configurable:!0}),e.prototype.getUserGuideLink=function(e){return/^https?:/.test(e)?e:null===this.getBaseUrl?null:this.getLink(this.templateStr,e)},e.prototype.list=function(){return this.items$.pipe(s.filter((function(e){return!!e.length})),s.first()).toPromise()},e.prototype.refresh=function(){},e.prototype.get=function(){var e=this,t=this.options.get("docs",{}),n=t.links,a=t.noDefault,s=t.excludeDefault,r=void 0===s?[]:s,l=this.app.state.supportUrl,i=a?[]:dp.map((function(t){return fc({},t,{url:e.getUserGuideLink(t.url)})})).filter((function(e){var t=e.url;return!r.some((function(e){return new RegExp(e).test(t)}))}));return n&&(n.map((function(e){if(o.isUndefined(e.type))return e.type="doc",e})),i=i.concat(n)),l&&i.push({icon:"comments",label:"Forum support",url:l,type:"doc"}),i},e.prototype.getLink=function(e,t){if(e)return e.replace(/\${docsBaseUrl}/,this.getBaseUrl()).replace(/\${partialUrl}/,this.prefixWithSlash(t))},e.prototype.prefixWithSlash=function(e){return void 0===e&&(e=""),""+(!(e&&/^\//.test(e))?"/":"")+e},e.ctorParameters=function(){return[{type:qc},{type:$c},{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[pp]}]},{type:n.Router}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(qc),t.ɵɵinject($c),t.ɵɵinject(pp,8),t.ɵɵinject(n.Router))},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"}),vc(2,t.Optional()),vc(2,t.Inject(pp))],e)}(),gp=function(){function e(e,t,n,a,s,o,r){this.headerService=e,this.actionService=t,this.breadcrumbService=n,this.searchService=a,this.appState=s,this.userMenuService=o,this.docs=r,this.canToggle$=this.headerService.hasItemsInNavigator$,this.appState$=this.appState.state$,this.drawerOpen=!1,this.headerOpen=!1}return e.prototype.ngAfterViewInit=function(){this.headerService.verifyIfNavOpen()},e.prototype.toggle=function(){this.headerOpen=!this.headerOpen},e.ctorParameters=function(){return[{type:Gc},{type:Nc},{type:Yc},{type:Zd},{type:$c},{type:tp},{type:mp}]},e=yc([t.Component({selector:"c8y-header-bar",template:'<div\n class="app-main-header"\n [ngClass]="{\n open: headerService.navigatorOpen$ | async,\n drawerOpen: drawerOpen\n }"\n>\n <div class="header-bar">\n <button\n *ngIf="canToggle$ | async"\n type="button"\n class="navigator-toggle main-header-button"\n title="{{ \'Toggle navigator\' | translate }}"\n (click)="headerService.toggleNavigator()"\n >\n <i [c8yIcon]="\'angle-double-right\'"></i>\n </button>\n <div class="app-view">\n <c8y-app-icon\n [name]="(appState$ | async).app.name"\n [contextPath]="(appState$ | async).app.contextPath"\n ></c8y-app-icon>\n\n <span class="page-header">\n <c8y-title-outlet></c8y-title-outlet>\n <c8y-breadcrumb-outlet\n [breadcrumbs]="breadcrumbService.items$ | async"\n class="app-breadcrumbs"\n ></c8y-breadcrumb-outlet>\n </span>\n </div>\n <c8y-search-outlet\n title="{{ \'Search\' | translate }}"\n [search]="searchService.items$ | async"\n class="main-header-item"\n ></c8y-search-outlet>\n <c8y-action-outlet\n title="{{ \'Add\' | translate }}"\n [items]="actionService.items$ | async"\n class="main-header-item"\n ></c8y-action-outlet>\n <c8y-app-switcher\n title="{{ \'Application switcher\' | translate }}"\n class="main-header-item"\n ></c8y-app-switcher>\n <c8y-user-menu-outlet\n [items]="(userMenuService.state$ | async).userMenuItems"\n class="main-header-item"\n ></c8y-user-menu-outlet>\n\n <button\n title="{{ \'Toggle side drawer\' | translate }}"\n class="drawer-toggle main-header-button"\n *ngIf="(appState$ | async).showRightDrawer"\n (click)="drawerOpen = !drawerOpen"\n >\n <i [c8yIcon]="\'angle-double-left\'"></i>\n </button>\n </div>\n <div class="head-toggler">\n <button title="{{ \'Toggle\' | translate }}" type="button" (click)="toggle()">\n <i [c8yIcon]="\'angle-double-right\'"></i>\n </button>\n </div>\n <c8y-right-drawer\n *ngIf="(appState$ | async).showRightDrawer"\n [app]="(appState$ | async).app"\n [quickLinks]="docs.items$ | async"\n [helpAndSupport]="docs.items$ | async"\n >\n </c8y-right-drawer>\n <div class="loading-bar" [ngClass]="{ active: (appState$ | async).isLoading }"></div>\n</div>\n'})],e)}(),hp=function(){function e(e,t,n){var a=this;this.headerService=e,this.element=t,this.zone=n,this.title=void 0;var o=this.headerService.map((function(e){return e.title}));o.subscribe((function(e){return a.title=e})),this.zone.runOutsideAngular((function(){o.pipe(s.debounceTime(100),s.map((function(){return a.element.nativeElement.querySelector("h1")})),s.filter((function(e){return null!==e})),s.map((function(e){return e.innerText})),s.filter(Boolean)).subscribe((function(t){return e.changePageTitle(t)}))}))}return e.ctorParameters=function(){return[{type:Gc},{type:t.ElementRef},{type:t.NgZone}]},e=yc([t.Component({selector:"c8y-title-outlet",template:'<div class="c8y-ui-title">\n <div class="title" *c8yOutlet="title"></div>\n</div>\n'})],e)}(),fp=function(){function e(e){this.headerService=e}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.headerService.changeTitle(e.template)}))},e.prototype.ngOnDestroy=function(){this.headerService.state.title===this.template&&(clearTimeout(this.viewInitTimeout),this.headerService.changeTitle())},e.ctorParameters=function(){return[{type:Gc}]},yc([t.ViewChild("template",{static:!0})],e.prototype,"template",void 0),e=yc([t.Component({selector:"c8y-title",template:'<ng-template #template>\n <h1 class="text-truncate">\n <ng-content></ng-content>\n </h1>\n</ng-template>\n\n'})],e)}(),yp=function(){function e(e){this.service=e,this.priority=0,this.nodeData=new Fc}return e.prototype.ngOnInit=function(){var e=this;this.ngOnChanges(),setTimeout((function(){return e.service.add(e.nodeData)}))},e.prototype.ngOnChanges=function(){this.nodeData.icon=this.icon,this.nodeData.label=this.label,this.nodeData.path=this.path,this.nodeData.priority=this.priority,this.nodeData.iconTemplate=this.icon?void 0:this.template,this.nodeData.icon=this.icon},e.prototype.ngOnDestroy=function(){this.service.remove(this.nodeData)},e.ctorParameters=function(){return[{type:zc}]},yc([t.ViewChild("iconTpl",{static:!0})],e.prototype,"template",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"path",void 0),yc([t.Input()],e.prototype,"priority",void 0),e=yc([t.Component({selector:"c8y-navigator-item",template:"<ng-template #iconTpl><ng-content></ng-content></ng-template>"})],e)}(),vp=function(){function e(){}return Object.defineProperty(e.prototype,"icon",{get:function(){return this.node.icon||"cog"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClass",{get:function(){return"fa-"+this.icon},enumerable:!0,configurable:!0}),yc([t.Input()],e.prototype,"node",void 0),e=yc([t.Component({selector:"c8y-navigator-icon",template:'<i class="icon" [c8yIcon]="icon"></i>'})],e)}(),jp=function(){function e(e,n){this.componentFactoryResolver=e,this.navigator=n,this.nodeClick=new t.EventEmitter}var a;return a=e,e.prototype.ngAfterViewInit=function(){var e=this;this.childrenNodes.forEach((function(t){return t.parentNode=e})),this.viewInitTimeout=setTimeout((function(){e.updateIcon(),e.openOnFirstUrl(),e.expandParentIfActive(),e.node.confirm=e.confirm}))},e.prototype.openOnFirstUrl=function(){this.navigator.openOnFirstUrl(this.node)&&!this.node.open&&this.expandCollapse(!0)},Object.defineProperty(e.prototype,"expandTitle",{get:function(){return this.node.open?"Collapse":"Expand"},enumerable:!0,configurable:!0}),e.prototype.click=function(e,t){var n,a;void 0===e&&(e="link"),"expander"===e?(t&&(t.stopPropagation(),t.preventDefault()),a=!this.node.open):a=!(!this.routerLinkActive||!this.routerLinkActive.isActive)||!this.node.open,a!==this.node.open&&this.expandCollapse(a,!1,((n={})[e]=!0,n.$event=t,n)),this.nodeClick.emit(e)},e.prototype.expandCollapse=function(e,t,n){void 0===n&&(n={}),this.node.open=e,t&&this.childrenNodes.forEach((function(n){return n.expandCollapse(e,t)})),n.open=e,this.node.click(n)},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.node.destroy()},e.prototype.expandParentIfActive=function(){this.routerLinkActive&&this.routerLinkActive.isActive&&this.parentNode&&this.parentNode.expandCollapse(!0)},e.prototype.updateIcon=function(){this.node.iconTemplate?this.updateIconTemplate():this.updateIconComponent()},e.prototype.updateIconComponent=function(){var e=vp;this.node&&this.node.iconComponent&&(e=this.node.iconComponent),this.iconSlot.clear();var t=this.componentFactoryResolver.resolveComponentFactory(e);this.iconSlot.createComponent(t).instance.node=this.node},e.prototype.updateIconTemplate=function(){this.iconSlot.clear(),this.iconSlot.createEmbeddedView(this.node.iconTemplate)},e.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:zc}]},yc([t.ViewChild("icon",{read:t.ViewContainerRef,static:!1})],e.prototype,"iconSlot",void 0),yc([t.Input()],e.prototype,"node",void 0),yc([t.Input()],e.prototype,"isRoot",void 0),yc([t.ViewChild(n.RouterLinkActive,{static:!1})],e.prototype,"routerLinkActive",void 0),yc([t.ViewChildren(a)],e.prototype,"childrenNodes",void 0),yc([t.Output()],e.prototype,"nodeClick",void 0),yc([t.ViewChild(wd,{static:!1})],e.prototype,"confirm",void 0),e=a=yc([t.Component({selector:"c8y-navigator-node-display",template:'<div\n class="slot"\n [hidden]="node.hidden"\n (dragstart)="node.dragStart($event)"\n (dragend)="node.dragEnd($event)"\n (drop)="node.drop($event)"\n [draggable]="node.draggable"\n [ngClass]="{ dragged: node.dragged }"\n>\n <ng-container>\n <a\n class="link"\n draggable="false"\n (dragover)="node.canDrop && $event.preventDefault()"\n (dragenter)="node.canDrop && node.dragEnter($event)"\n (dragleave)="node.canDrop && node.dragLeave($event)"\n title="{{node.label | translate}}"\n [attr.id]="isRoot ? node.id : undefined"\n [routerLink]="node.canNavigate ? node.path : undefined"\n [routerLinkActive]="node.canNavigate ? \'active\' : \'\'"\n [routerLinkActiveOptions]="{exact:node.routerLinkExact}"\n (click)="click(node.canNavigate ? \'link\' : \'expander\', $event)"\n [ngClass]="{\'root-link\':isRoot, open: node.open, parent: node.hasChildren, \'dragged-hover\': node.draggedHover && !node.dragged}"\n >\n <ng-container *ngTemplateOutlet="inner"></ng-container>\n </a>\n </ng-container>\n\n <div\n class="children panel-expand expand"\n *ngIf="node.children.length"\n [collapse]="!node.open"\n [isAnimated]="true"\n >\n <c8y-navigator-node-display\n *ngFor="let childNode of node.children"\n [node]="childNode"\n (nodeClick)="nodeClick.emit($event)"\n >\n </c8y-navigator-node-display>\n </div>\n</div>\n\n<ng-template #inner>\n \x3c!-- loader --\x3e\n <i\n class="fa-spin loadingIndicator"\n [c8yIcon]="\'circle-o-notch\'"\n *ngIf="node.loading && !isRoot"\n >\n </i>\n\n \x3c!-- icon --\x3e\n <div (click)="click(\'icon\', $event)">\n <ng-container #icon></ng-container>\n </div>\n\n \x3c!--title --\x3e\n <span>{{node.label | translate}}</span>\n\n <i\n class="expander"\n [c8yIcon]="\'chevron-down\'"\n *ngIf="node.hasChildren"\n (click)="click(\'expander\', $event)"\n title="{{expandTitle}}"\n >\n </i>\n\n <c8y-popover-confirm\n outsideClick="true"\n containerClass="navigator-popover"\n ></c8y-popover-confirm>\n</ng-template>\n'})],e)}(),bp=function(){function e(e){this.headerService=e,this.open=!0}return e.prototype.collapseNavigator=function(e){"link"!==e||this.headerService.largeWidth||this.headerService.closeNavigator()},e.prototype.trackByPathOrLabel=function(e,t){return t.path?t.path:t.label},e.ctorParameters=function(){return[{type:Gc}]},yc([t.Input()],e.prototype,"nodes",void 0),yc([t.Input()],e.prototype,"open",void 0),e=yc([t.Component({selector:"c8y-navigator-outlet, c8y-ui-navigator",template:'<nav class="navigator" *ngIf="nodes && nodes.length > 0" [ngClass]="{ open: open }">\n <ng-content select=".navigator-slot-top"></ng-content>\n <ul class="navigatorContent">\n <c8y-navigator-node-display (nodeClick)="collapseNavigator($event)" [node]="node" *ngFor="let node of nodes trackBy trackByPathOrLabel" [isRoot]="true"></c8y-navigator-node-display>\n </ul>\n <ng-content select=".navigator-slot-bottom"></ng-content>\n</nav>\n'})],e)}(),wp=function(){function e(){}return e=yc([t.NgModule({declarations:[bp,jp,yp,vp],imports:[n.RouterModule,ec.CollapseModule.forRoot(),Yu,Sd],exports:[bp,yp],entryComponents:[vp]})],e)}(),Sp=function(){function e(){this.quickLinks=[],this.helpAndSupport=[]}return Object.defineProperty(e.prototype,"_quickLinks",{set:function(e){e&&(this.quickLinks=e.filter((function(e){return"quicklink"===e.type})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_helpAndSupport",{set:function(e){e&&(this.helpAndSupport=e.filter((function(e){return"doc"===e.type})))},enumerable:!0,configurable:!0}),yc([t.Input("quickLinks")],e.prototype,"_quickLinks",null),yc([t.Input("helpAndSupport")],e.prototype,"_helpAndSupport",null),yc([t.Input()],e.prototype,"app",void 0),e=yc([t.Component({selector:"c8y-right-drawer",template:'<div class="c8y-right-drawer">\n\n <div class="summary">\n <h4 class="text-light">{{\'Welcome to\' | translate}} {{app | humanizeAppName | async}}</h4>\n </div>\n\n <div *ngIf="quickLinks.length">\n <div class="legend form-block" translate>Quick links</div>\n <div class="quick-links-drawer">\n <ng-container *ngFor="let quickLink of quickLinks">\n <a class="quick-link"\n [href]="quickLink.url || \'#\'"\n (click)="quickLink.click && $event.preventDefault(); quickLink.click();">\n <h2 *ngIf="quickLink.icon"><i class="{{quickLink.icon}}"></i></h2>\n <img \n *ngIf="quickLink.iconSrc" \n [src]="quickLink.iconSrc" \n style="max-width:50px;" \n class="img-responsive center-block"\n onerror="this.style.display = \'none\'">\n {{quickLink.label | translate}}\n </a>\n </ng-container>\n </div>\n </div>\n\n <div *ngIf="helpAndSupport.length">\n <div class="legend form-block top-m-lg" translate>Help & support</div>\n <div class="help-support" *ngFor="let link of helpAndSupport">\n <a class="help-and-support-link text-truncate" target="_blank" rel="noopener noreferrer" [href]="link.url">\n <i [c8yIcon]="link.icon"></i>\n <span title="{{link.label | translate}}" style="display: inline;">{{link.label | translate}}</span>\n </a>\n </div>\n </div>\n\n</div>\n'})],e)}(),Cp=function(){function e(){}return e=yc([t.NgModule({declarations:[fp,gp,hp,cp,up,Sp],imports:[tc.BsDropdownModule,ip,ep,Yu,td,Kd,wp],exports:[gp,fp,hp,cp,up,Sp]})],e)}(),Ip=function(){function n(e,n,a,s,o){this.loginService=e,this.users=n,this.passwordStrengthCheckerService=a,this.options=s,this.alert=o,this.onChangeView=new t.EventEmitter,this.passwordPattern=/^[a-zA-Z0-9`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]{8,32}$/,this.isLoading=!1,this.model={tenantId:"",email:"",newPassword:"",newPasswordConfirm:"",passwordStrengthEnforced:!1},this.emailReadOnly=!1,this.TOKEN_PARAM="token",this.EMAIL_PARAM="email"}return n.prototype.ngOnInit=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){return this.model.tenantId=this.loginService.getTenant(),this.model.email=this.options.get(this.EMAIL_PARAM,""),this.emailReadOnly=!!this.model.email,this.model.passwordStrengthEnforced=this.loginService.getEnforcePasswordStrength(),[2]}))}))},n.prototype.changePassword=function(){return jc(this,void 0,void 0,(function(){var t,n,a;return bc(this,(function(s){switch(s.label){case 0:t=this.passwordStrengthCheckerService.getStrengthColor(this.model.newPassword),n={token:this.credentials.token,email:this.model.email,newPassword:this.model.newPassword,passwordStrength:t.passwordStrength},s.label=1;case 1:return s.trys.push([1,3,4,5]),this.isLoading=!0,[4,this.users.resetPassword(n,this.model.tenantId)];case 2:return 200===s.sent().res.status&&(this.loginService.addSuccessMessage("password_changed"),this.credentials.token=void 0,this.options.set(this.TOKEN_PARAM,void 0),this.onChangeView.emit({view:e.LoginViews.Credentials})),[3,5];case 3:return a=s.sent(),this.alert.addServerFailure(a),[3,5];case 4:return this.loginService.reset(),this.isLoading=!1,[7];case 5:return[2]}}))}))},n.ctorParameters=function(){return[{type:ud},{type:l.UserService},{type:pd},{type:qc},{type:Mc}]},yc([t.Input()],n.prototype,"credentials",void 0),yc([t.Output()],n.prototype,"onChangeView",void 0),n=yc([t.Component({selector:"c8y-change-password",template:'<form\n role="form"\n class="loginForm"\n (ngSubmit)="changePassword()"\n #changePasswordForm="ngForm"\n novalidate\n>\n\n <div\n class="legend form-block center"\n translate\n >\n Change password\n </div>\n\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenantId"\n #tenantId="ngModel"\n type="text"\n name="tenantId"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Tenant ID\' | translate }}"\n required\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Email address</label>\n <input\n [(ngModel)]="model.email"\n #email="ngModel"\n type="text"\n name="email"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Email address\' | translate }}"\n email\n required\n [readonly]="emailReadOnly"\n />\n </c8y-form-group>\n\n <div class="row content-flex-50">\n <div class="col-7">\n <c8y-form-group>\n <label translate>New password</label>\n <input\n [(ngModel)]="model.newPassword"\n #newPassword="ngModel"\n type="password"\n name="newPassword"\n class="form-control"\n placeholder="{{ \'New password\' | translate }}"\n [pattern]="passwordPattern"\n autocomplete="new-password"\n [passwordStrengthEnforced]="model.passwordStrengthEnforced"\n required\n />\n <c8y-messages>\n <c8y-message\n name="pattern"\n [text]="loginService.ERROR_MESSAGES.pattern_newPassword"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Confirm password</label>\n <input\n [(ngModel)]="model.newPasswordConfirm"\n #newPasswordConfirm="ngModel"\n type="password"\n name="newPasswordConfirm"\n class="form-control"\n placeholder="{{ \'Confirm password\' | translate }}"\n passwordConfirm="newPassword"\n autocomplete="new-password"\n required\n />\n <c8y-messages>\n <c8y-message\n name="passwordConfirm"\n [text]="loginService.ERROR_MESSAGES.passwordConfirm"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </div>\n <div class="col-5">\n <c8y-password-strength\n [password]="model.newPassword"\n [hidden]="!model.newPassword"\n ></c8y-password-strength>\n <c8y-password-check-list\n class="m-t-32"\n [password]="model.newPassword"\n [hidden]="!model.newPassword || !model.passwordStrengthEnforced"\n ></c8y-password-check-list>\n </div>\n </div>\n\n <button\n title="{{ \'Set password\' | translate }}"\n [disabled]="!changePasswordForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Set password\n </button>\n</form>\n'})],n)}(),Pp=function(){function n(n,a,s){this.loginService=n,this.alert=a,this.ui=s,this.onChangeView=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.model={},this.isLoading=!1,this.showLoginForm=!1,this.showBasicAuth=!1,this.oauthOptions={},this.PASSWORD_RESET_HEADER_NAME="passwordresettoken",this.NO_PHONE_HEADER_NAME="NoPhoneHeader"}return n.prototype.ngOnInit=function(){var e=this.loginService,t=e.oauthOptions,n=e.loginMode;this.model.tenant=this.loginService.getTenant(),this.showLoginForm=void 0===n.visibleOnLoginPage||n.visibleOnLoginPage,this.showBasicAuth="BASIC"===n.type,this.oauthOptions=t},n.prototype.redirectToOauth=function(){this.loginService.redirectToOauth()},n.prototype.login=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),this.isLoading=!0,e=this.loginService.useBasicAuth(this.model),[4,this.loginService.login(e,this.model)];case 1:return n.sent(),[3,4];case 2:return(t=n.sent()).res&&t.res.headers&&t.res.headers.get(this.PASSWORD_RESET_HEADER_NAME)?this.handlePasswordReset(t.res):t.res&&401===t.res.status&&/pin/i.test(t.data.message)?this.handleSmsChallenge(t.data.message):t.res&&401===t.res.status&&/TOTP/i.test(t.data.message)?this.handleTotpChallenge(t.data.message):t.res&&t.res.headers&&t.res.headers.get(this.NO_PHONE_HEADER_NAME)&&!this.loginService.isSupportUser(this.model)?this.handleNoPhoneNumberProvided():(this.loginService.reset(),this.alert.addServerFailure(t)),[3,4];case 3:return this.isLoading=!1,[7];case 4:return[2]}}))}))},n.prototype.handlePasswordReset=function(t){this.alert.removeLastDanger(),this.model.token=t.headers.get(this.PASSWORD_RESET_HEADER_NAME),this.onChangeView.emit({view:e.LoginViews.ChangePassword,credentials:this.model})},n.prototype.handleTotpChallenge=function(t){/TOTP setup required/i.test(t)?this.onChangeView.emit({view:e.LoginViews.TotpSetup,credentials:this.model}):this.onChangeView.emit({view:e.LoginViews.TotpChallenge,credentials:this.model})},n.prototype.handleSmsChallenge=function(t){/pin has already been generated/i.test(t)&&this.alert.warning("The verification code was already sent. For a new verification code, please click on the link above."),this.alert.removeLastDanger(),this.onChangeView.emit({view:e.LoginViews.SmsChallenge,credentials:this.model})},n.prototype.handleNoPhoneNumberProvided=function(){this.onChangeView.emit({view:e.LoginViews.ProvidePhoneNumber,credentials:this.model}),this.alert.warning("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.ctorParameters=function(){return[{type:ud},{type:Mc},{type:$c}]},yc([t.Output()],n.prototype,"onChangeView",void 0),n=yc([t.Component({selector:"c8y-credentials",template:'<div id="oauth" *ngIf="oauthOptions.initRequest && oauthOptions.visibleOnLoginPage">\n <button\n title="{{ oauthOptions.buttonName | translate }}"\n (click)="redirectToOauth()"\n class="btn btn-block btn-lg form-group"\n >\n <i [c8yIcon]="\'sign-in\'" class="pull-left"></i>\n {{ oauthOptions.buttonName | translate }}\n </button>\n</div>\n\n<form\n role="form"\n class="loginForm"\n (ngSubmit)="login()"\n #loginForm="ngForm"\n *ngIf="showLoginForm"\n novalidate\n>\n <div\n class="legend form-block center"\n *ngIf="!(oauthOptions.initRequest && oauthOptions.visibleOnLoginPage); else orLegend"\n translate\n >\n Login\n </div>\n <ng-template #orLegend>\n <div class="legend form-block center" translate>or</div>\n </ng-template>\n\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label for="tenant" translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenant"\n #tenant="ngModel"\n type="text"\n name="tenant"\n id="tenant"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Tenant ID\' | translate }}"\n required\n />\n </c8y-form-group>\n <c8y-form-group>\n <label for="user" translate>Username</label>\n <input\n [(ngModel)]="model.user"\n #user="ngModel"\n type="text"\n name="user"\n id="user"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Username\' | translate }}"\n required\n />\n </c8y-form-group>\n <c8y-form-group>\n <label for="password" translate>Password</label>\n <input\n [(ngModel)]="model.password"\n #password="ngModel"\n type="password"\n name="password"\n id="password"\n class="form-control"\n placeholder="{{ \'Password\' | translate }}"\n required\n />\n </c8y-form-group>\n <div class="form-group" *ngIf="showBasicAuth">\n <label class="c8y-checkbox">\n <input\n title="{{ \'Remember me\' | translate }}"\n type="checkbox"\n name="remember"\n [(ngModel)]="loginService.rememberMe"\n /><span></span>\n {{ \'Remember me\' | translate }}\n </label>\n </div>\n <button\n title="{{ \'Log in\' | translate }}"\n [disabled]="!loginForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n >\n {{ \'Log in\' | translate }}\n </button>\n <div class="text-center top-m-sm">\n <a\n title="{{ \'Forgot password?\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onChangeView.emit({ view: LOGIN_VIEWS.RecoverPassword })"\n >{{ \'Forgot password?\' | translate }}</a\n >\n </div>\n <div class="text-center top-m-sm" *ngIf="!!(ui.state$ | async).loginExtraLink">\n <a\n title="{{ (ui.state$ | async).loginExtraLink.label }}"\n [href]="(ui.state$ | async).loginExtraLink.url"\n class="btn btn-link btn-sm"\n >\n {{ (ui.state$ | async).loginExtraLink.label }}</a\n >\n </div>\n</form>\n'})],n)}(),Op=function(){function n(t,n,a){this.loginService=t,this.options=n,this.alert=a,this.currentView=e.LoginViews.None,this.LOGIN_VIEWS=e.LoginViews,this.disabled=!1,this.credentials={},this.displayAlerts=!1,this.TOKEN_PARAM="token"}return n.prototype.ngOnInit=function(){var e=this.getResetPasswordToken();this.loginService.isFirstLogin&&(e?(this.credentials.token=e,this.reset()):this.loginAutomatically()),this.loginService.isFirstLogin=!1},n.prototype.handleLoginTemplate=function(e){this.currentView=e.view,this.credentials=e.credentials||{}},n.prototype.onkeyup=function(e){"Enter"!==e.key&&this.loginService.cleanMessages()},n.prototype.reset=function(){this.loginService.reset(),this.setView(),this.loginService.cleanMessages()},n.prototype.loginAutomatically=function(){return jc(this,void 0,void 0,(function(){var e,t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.loginService.login()];case 1:return n.sent(),[3,3];case 2:return e=n.sent(),"OAUTH2"===(t=this.loginService.loginMode.type)?this.loginService.redirectToOauth():(this.reset(),"OAUTH2_INTERNAL"===t&&"https:"!==window.location.protocol?this.alert.danger("Current login mode only supports HTTPS."):e.res&&403===e.res.status&&this.alert.addServerFailure(e)),[3,3];case 3:return[2]}}))}))},n.prototype.setView=function(){this.credentials&&this.credentials.token?this.handleLoginTemplate({view:e.LoginViews.ChangePassword,credentials:this.credentials}):this.handleLoginTemplate({view:e.LoginViews.Credentials})},n.prototype.getResetPasswordToken=function(){var e=this.options.get(this.TOKEN_PARAM);return e&&this.options.set(this.TOKEN_PARAM,void 0),e},n.ctorParameters=function(){return[{type:ud},{type:qc},{type:Mc}]},yc([t.Input()],n.prototype,"name",void 0),yc([t.HostListener("keyup",["$event"])],n.prototype,"onkeyup",null),n=yc([t.Component({selector:"c8y-login",template:'<div\n class="loading card fadeInUp animated shadow5"\n *ngIf="currentView !== LOGIN_VIEWS.None"\n [ngSwitch]="currentView"\n>\n <div class="card-block">\n <img class="mainlogo">\n <c8y-credentials\n *ngSwitchCase="LOGIN_VIEWS.Credentials"\n (onChangeView)="handleLoginTemplate($event)"\n ></c8y-credentials>\n <c8y-recover-password\n *ngSwitchCase="LOGIN_VIEWS.RecoverPassword"\n (onChangeView)="handleLoginTemplate($event)"\n ></c8y-recover-password>\n <c8y-change-password\n *ngSwitchCase="LOGIN_VIEWS.ChangePassword"\n (onChangeView)="handleLoginTemplate($event)"\n [credentials]="credentials"\n ></c8y-change-password>\n <c8y-totp-auth\n *ngSwitchCase="LOGIN_VIEWS.TotpChallenge"\n (onCancel)="reset()"\n [view]="currentView"\n [credentials]="credentials"\n >\n </c8y-totp-auth>\n <c8y-totp-auth\n *ngSwitchCase="LOGIN_VIEWS.TotpSetup"\n (onCancel)="reset()"\n [view]="currentView"\n [credentials]="credentials"\n >\n </c8y-totp-auth>\n <c8y-sms-challenge\n *ngSwitchCase="LOGIN_VIEWS.SmsChallenge"\n (onCancel)="reset()"\n [credentials]="credentials"\n ></c8y-sms-challenge>\n\n\n <c8y-provide-phone-number\n *ngSwitchCase="LOGIN_VIEWS.ProvidePhoneNumber"\n (onCancel)="reset()"\n (onChangeView)="handleLoginTemplate($event)"\n [credentials]="credentials"\n ></c8y-provide-phone-number>\n\n <c8y-alert-outlet position="static"></c8y-alert-outlet>\n </div>\n</div>\n'})],n)}(),xp=function(){function n(n,a){this.users=n,this.loginService=a,this.onChangeView=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.isLoading=!1,this.model={email:"",tenantId:""}}return n.prototype.ngOnInit=function(){this.model.tenantId=this.loginService.getTenant()},n.prototype.resetPassword=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return e.trys.push([0,,2,3]),this.isLoading=!0,[4,this.users.sendPasswordResetMail(this.model.email,this.model.tenantId)];case 1:return 200===e.sent().res.status&&this.loginService.addSuccessMessage("password_reset_requested"),[3,3];case 2:return this.loginService.reset(),this.isLoading=!1,[7];case 3:return[2]}}))}))},n.ctorParameters=function(){return[{type:l.UserService},{type:ud}]},yc([t.Output()],n.prototype,"onChangeView",void 0),n=yc([t.Component({selector:"c8y-recover-password",template:'<form #resetForm="ngForm" role="form" class="loginForm" (ngSubmit)="resetPassword()" novalidate>\n <div class="legend form-block center" translate>Forgot password?</div>\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenantId"\n #tenantId="ngModel"\n type="text"\n name="tenantId"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Tenant ID\' | translate }}"\n required\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Email address</label>\n <input\n [(ngModel)]="model.email"\n #email="ngModel"\n type="text"\n name="email"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Email address\' | translate }}"\n email\n required\n />\n </c8y-form-group>\n\n <button\n title="{{ \'Reset password\' | translate }}"\n [disabled]="!resetForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Reset password\n </button>\n <div class="text-center top-m-sm">\n <p>\n <a\n title="{{ \'Login\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onChangeView.emit({ view: LOGIN_VIEWS.Credentials })"\n translate\n >Login</a\n >\n </p>\n </div>\n</form>\n'})],n)}(),Ep=function(){function n(n,a,s){this.loginService=n,this.userService=a,this.alert=s,this.onCancel=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.loading=!1,this.hasError=!1}return Object.defineProperty(n.prototype,"isSetup",{get:function(){return this.view===e.LoginViews.TotpSetup},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){return jc(this,void 0,void 0,(function(){return bc(this,(function(e){switch(e.label){case 0:return this.view!==this.LOGIN_VIEWS.TotpSetup?[3,2]:[4,this.loginService.switchLoginMode(this.credentials)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},n.prototype.onTotpSuccess=function(e){return jc(this,void 0,void 0,(function(){var t;return bc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,6,7,8]),this.loading=!0,this.hasError=!1,this.credentials.tfa=e,this.isSetup?[4,this.userService.activateTotp()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,this.loginService.switchLoginMode(this.credentials)];case 3:return n.sent(),[4,this.loginService.verifyAppAccess()];case 4:return n.sent(),[4,this.loginService.authFulfilled()];case 5:return n.sent(),[3,8];case 6:return t=n.sent(),this.alert.removeLastDanger(),t.data&&"Access is denied"===t.data.message&&this.alert.addServerFailure(t),t.data&&"Authentication failed! : User account is locked"===t.data.message?this.alert.addServerFailure(t):this.hasError=!0,[3,8];case 7:return this.loading=!1,[7];case 8:return[2]}}))}))},n.ctorParameters=function(){return[{type:ud},{type:l.UserService},{type:Mc}]},yc([t.Input()],n.prototype,"credentials",void 0),yc([t.Input()],n.prototype,"view",void 0),yc([t.Output()],n.prototype,"onCancel",void 0),n=yc([t.Component({selector:"c8y-totp-auth",template:'<div\n class="legend form-block center"\n translate\n>Two-factor authentication</div>\n\n<c8y-totp-setup *ngIf="isSetup"></c8y-totp-setup>\n<c8y-totp-challenge\n [loading]="loading"\n [hasError]="hasError"\n [verify]="view === LOGIN_VIEWS.TotpSetup"\n (onSuccess)="onTotpSuccess($event)"\n></c8y-totp-challenge>\n\n<div class="top-m-sm text-center">\n <a\n title="{{ \'Cancel\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onCancel.emit()"\n translate\n >Cancel</a>\n</div>\n'})],n)}(),kp=function(){function e(e){this.passwordService=e}return e.prototype.isStrong=function(e){return this.isPasswordGreen(this.passwordService.getStrengthColor(e).passwordStrength)},e.prototype.isPasswordGreen=function(e){return e===l.PasswordStrength.GREEN},e.ctorParameters=function(){return[{type:pd}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(pd))},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"})],e)}(),Tp=function(){function e(e){this.passwordService=e}var n;return n=e,Object.defineProperty(e.prototype,"passwordStrengthEnforced",{set:function(e){this.forced=e},enumerable:!0,configurable:!0}),e.prototype.validate=function(e){var t=this.passwordService.isStrong(e.value||"");return this.forced&&!t?{passwordStrength:!0}:null},e.ctorParameters=function(){return[{type:kp}]},yc([t.Input()],e.prototype,"passwordStrengthEnforced",null),e=n=yc([t.Directive({selector:"[passwordStrengthEnforced]",providers:[{provide:ac.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),Ap=function(){function e(){}var n;return n=e,e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e.providers=function(){return[ud]},e=n=yc([t.NgModule({declarations:[Op,xp,Ip,Pp,Ep,Tp],imports:[ac.FormsModule,u.TooltipModule,Yu,zd,rd,qd],exports:[Op]})],e)}(),_p=function(){function e(e){this.tabs=e,this.label=""}return e.prototype.ngAfterContentInit=function(){var e=this;setTimeout((function(){return e.tabs.add(e)}))},e.prototype.ngOnDestroy=function(){this.tabs.remove(this)},e.ctorParameters=function(){return[{type:Vc}]},yc([t.ViewChild("tpl",{static:!1})],e.prototype,"template",void 0),yc([t.Input()],e.prototype,"path",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"priority",void 0),yc([t.Input()],e.prototype,"orientation",void 0),e=yc([t.Component({selector:"c8y-tab",template:"<ng-template #tpl><ng-content></ng-content></ng-template>"})],e)}(),Np=function(){function e(e,t,n){this.router=e,this.renderer=t,this.el=n,this.tabs=[],this.orientation="vertical",this.navigatorOpen=!1,this.showLeft=!1,this.showRight=!1}return Object.defineProperty(e.prototype,"isNavigatorOpen",{get:function(){return this.navigatorOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTabs",{get:function(){return this.tabs&&this.tabs.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHorizontal",{get:function(){return"horizontal"===this.orientation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return"horizontal"!==this.orientation},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.scrollSubscription&&this.scrollSubscription.unsubscribe()},e.prototype.ngAfterContentInit=function(){"horizontal"===this.orientation&&this.scrollSubscribe()},e.prototype.isActive=function(e){return!(!e||!e.path)&&this.router.isActive(e.path,!1)},e.prototype.navigateTo=function(e){this.router.navigate([e])},e.prototype.scroll=function(e){void 0===e&&(e="right");var t=this.getDimensions(),n=t.widthScroll,a=t.width,s=t.scrollLeft+a*("left"===e?-1:1);s<0&&(s=0),s>n-a&&(s=n-a),this.container.nativeElement.scrollLeft=s},e.prototype.scrollSubscribe=function(){var e,t=this;this.scrollSubscription=a.merge(a.fromEvent(this.container.nativeElement,"scroll"),a.fromEventPattern((function(n){e=t.renderer.listen("window","resize",n)}),(function(){return e()}))).pipe(s.debounceTime(250)).subscribe((function(){return t.updateScroll()}))},e.prototype.updateScroll=function(){var e=this.getDimensions(),t=e.widthScroll,n=e.width,a=e.scrollLeft;this.showLeft=!!a,this.showRight=t>n+a},e.prototype.getDimensions=function(){var e=this.tabsContainer.nativeElement,t=this.container.nativeElement;return{widthScroll:e.scrollWidth,width:t.clientWidth,scrollLeft:t.scrollLeft}},e.ctorParameters=function(){return[{type:n.Router},{type:t.Renderer2},{type:t.ElementRef}]},yc([t.Input()],e.prototype,"tabs",void 0),yc([t.Input()],e.prototype,"orientation",void 0),yc([t.Input()],e.prototype,"navigatorOpen",void 0),yc([t.HostBinding("class.navigator-open")],e.prototype,"isNavigatorOpen",null),yc([t.HostBinding("class.page-tabs")],e.prototype,"hasTabs",null),yc([t.HostBinding("class.page-tabs-horizontal")],e.prototype,"isHorizontal",null),yc([t.HostBinding("class.page-tabs-vertical")],e.prototype,"isVertical",null),yc([t.ViewChild("container",{read:t.ElementRef,static:!0})],e.prototype,"container",void 0),yc([t.ViewChild("left",{read:t.ElementRef,static:!1})],e.prototype,"leftBtn",void 0),yc([t.ViewChild("right",{read:t.ElementRef,static:!1})],e.prototype,"rightBtn",void 0),yc([t.ViewChild("tabsContainer",{read:t.ElementRef,static:!1})],e.prototype,"tabsContainer",void 0),e=yc([t.Component({selector:"c8y-tabs-outlet,c8y-ui-tabs",template:'<div #container class="tabContainer hidden-xs">\n <button class="tabs-slider tabs-slider-left" #left *ngIf="showLeft" (click)="scroll(\'left\')">\n <i [c8yIcon]="\'chevron-left\'"></i>\n </button>\n <button class="tabs-slider tabs-slider-right" #right *ngIf="showRight" (click)="scroll(\'right\')">\n <i [c8yIcon]="\'chevron-right\'"></i>\n </button>\n <ul class="nav nav-tabs nav-tabsc8y" #tabsContainer>\n <li [ngClass]="{\'active\': rla.isActive}" *ngFor="let tab of tabs">\n <a [routerLink]="tab.path" routerLinkActive #rla="routerLinkActive" title="{{tab?.label | translate}}">\n <i [c8yIcon]="tab?.icon" *ngIf="!tab.template && tab?.icon"></i>\n <span class="txt" *ngIf="!tab.template">{{tab?.label | translate}}</span>\n <ng-container *ngTemplateOutlet="tab.template"></ng-container>\n </a>\n </li>\n </ul>\n</div>\n\n<div class="visible-xs mobile-tabs">\n <div class="c8y-select-wrapper">\n <select (change)="navigateTo($event.target.value)" #select>\n <option *ngFor="let tab of tabs" [value]="tab.path" [selected]="isActive(tab)">\n {{tab?.label | translate}}\n </option>\n </select>\n </div>\n</div>\n'})],e)}(),Dp=function(){function e(){}return e=yc([t.NgModule({declarations:[Np,_p],imports:[Yu,n.RouterModule.forChild([])],exports:[Np,_p]})],e)}(),Mp=function(){function e(e){this.options=e,this.storageKey="acceptCookieNotice",this.acceptValue="1"}return e.prototype.ngOnInit=function(){this.settings=this.options.get("cookieBanner"),this.settings&&this.settings.cookieBannerText&&!localStorage.getItem(this.storageKey)&&(this.showBanner=!0)},e.prototype.acceptCookies=function(){localStorage.setItem(this.storageKey,this.acceptValue),this.showBanner=!1},e.ctorParameters=function(){return[{type:qc}]},e=yc([t.Component({selector:"c8y-cookie-banner",template:'<div class="c8y-cookie-banner">\n <div class="container">\n <div class="row p-t-16 p-b-16" *ngIf="showBanner">\n <div class="col-md-2" *ngIf="settings.cookieBannerTitle">\n <h3>{{ settings.cookieBannerTitle | translate }}</h3>\n <div class="p-b-16 visible-sm visible-xs"></div>\n </div>\n <div class="col-md-7">\n <div class="cookie-banner-content text-pre">\n {{ settings.cookieBannerText | translate }}\n </div>\n </div>\n <div class="col-md-3">\n <div class="row">\n <div class="col-sm-6 col-md-12">\n <div class="p-b-16 visible-sm visible-xs"></div>\n <button class="btn btn-primary btn-block" (click)="acceptCookies()">\n {{ \'Agree and proceed\' | translate }}\n </button>\n </div>\n <div class="col-sm-6 col-md-12">\n <div class="p-b-16"></div>\n <a\n class="btn btn-default btn-block"\n href="{{ settings.policyUrl }}"\n target="_blank"\n *ngIf="settings.policyUrl"\n >\n {{ \'Privacy policy\' | translate }}\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>'})],e)}(),Lp=function(){function e(){}return e=yc([t.NgModule({declarations:[Kc,Mp],imports:[Yu,Cp,Ap,n.RouterModule,Dp,Xu,rd,wp,u.TooltipModule],exports:[Kc],entryComponents:[Kc]})],e)}(),Rp=new t.InjectionToken("Hook Dynamic Component"),qp=new t.InjectionToken("Hook Dynamic Component @deprecated"),$p=function(e){function o(t,n){var s=e.call(this)||this;return s.injector=t,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.items$=Ic([function(){return s.injector.get(Rp,[])},function(){return s.getComponentsViaDeprecatedHook()}],n,!1),s.items$.subscribe((function(e){e.forEach((function(e){s.state.add(e)})),s.emitNewState()})),s}return hc(o,e),o.prototype.getComponentsViaDeprecatedHook=function(){var e=this.injector.get(qp,[]);return e&&e.length&&"production"!==__MODE__&&console.warn("HOOK_COMPONENT is now deprecated. Use HOOK_COMPONENTS instead."),e},o.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(o.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),o.prototype.getById$=function(e){return this.state$.pipe(s.filter((function(e){return e.size>0})),s.mergeMap((function(t){return a.of(Array.from(t).find((function(t){return t.id===e})))})),s.take(1))},o.prototype.add=function(e){this.state.add(e),this.emitNewState()},o.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},o.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},o.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new o(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:o,providedIn:"root"}),o=yc([t.Injectable({providedIn:"root"})],o)}(kc),Fp=function(){function e(e,t){this.componentFactoryResolver=e,this.dynamicComponentService=t,this.mode="component",this.notFoundError=!0,this.expandErrorDetails=!1}return e.prototype.callLifeCycleHooks=function(){return this.callOnBeforeSaveHook()},e.prototype.ngOnChanges=function(){var e=this;this.dynamicComponentService.getById$(this.componentId).subscribe((function(t){return e.loadComponent(t)}))},e.prototype.loadComponent=function(e){try{this.error=void 0;var t=this.componentFactoryResolver.resolveComponentFactory("component"===this.mode?e.component:e.configComponent);this.host.clear(),this.componentRef=this.host.createComponent(t),this.componentRef.instance.config=this.config}catch(e){this.error=e}},e.prototype.callOnBeforeSaveHook=function(){if(!this.componentRef)return a.of(!0);var e=this.componentRef.instance.onBeforeSave;if(e){var t=e(this.config);return o.isUndefined(t)?a.of(!0):a.isObservable(t)?t:a.of(t)}return a.of(!0)},e.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:$p}]},yc([t.Input()],e.prototype,"componentId",void 0),yc([t.Input()],e.prototype,"config",void 0),yc([t.Input()],e.prototype,"mode",void 0),yc([t.Input()],e.prototype,"notFoundError",void 0),yc([t.ViewChild("host",{read:t.ViewContainerRef,static:!0})],e.prototype,"host",void 0),e=yc([t.Component({selector:"c8y-dynamic-component",template:'<ng-template #host></ng-template>\n\n<div class="alert alert-warning m-8" role="alert" *ngIf="notFoundError && error">\n <strong class="message">\n {{\n \'This widget cannot be rendered because the current application does not support the following component:\'\n | translate\n }}\n {{ componentId }}.\n </strong>\n <p class="text-muted top-m-sm">\n <button class="btn btn-clean" (click)="expandErrorDetails = !expandErrorDetails">\n <i class="fa fa-chevron-down"></i>\n <span *ngIf="!expandErrorDetails" translate>Show details</span>\n <span *ngIf="expandErrorDetails" translate>Hide details</span>\n </button>\n </p>\n <div [collapse]="!expandErrorDetails" [isAnimated]="true">\n <pre>\n {{ error }}\n </pre>\n </div>\n</div>\n'})],e)}(),Up=function(){function e(){}return e=yc([t.NgModule({declarations:[Fp],imports:[c.CommonModule,ec.CollapseModule,n.RouterModule.forChild([]),gu],exports:[Fp],providers:[$p]})],e)}(),Bp=function(){function e(){}return yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=yc([t.Component({selector:"c8y-dashboard-child-action",template:"<ng-template #template>\n <li>\n <ng-content></ng-content>\n </li>\n</ng-template>\n"})],e)}(),zp=function(){function e(){}return e=yc([t.Component({selector:"c8y-dashboard-child-title",template:'<div class="card-title">\n <ng-content></ng-content>\n</div>\n'})],e)}(),Gp=function(){function e(e,n){this.element=e,this.sanitizer=n,this.columns=12,this.gap=12,this.rows="auto",this.dashboardChange=new t.EventEmitter,this.lastRow=1,this.DEFAULT_ROW_SIZE=68}return Object.defineProperty(e.prototype,"columnSize",{get:function(){return this.dashboardRect.width/this.columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSize",{get:function(){return"auto"===this.rows?this.DEFAULT_ROW_SIZE:this.calculateRowSize()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inlineStyle",{get:function(){return this.sanitizer.bypassSecurityTrustStyle("\n -ms-grid-columns: (1fr)["+this.columns+"];\n grid-template-columns: repeat("+this.columns+", 1fr);\n "+("auto"!==this.rows?"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)["+("auto"===this.rows?this.lastRow:this.rows)+"];\n margin: -"+this.gap+"px;\n ")},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this.onResize(),this.getLastRow()},e.prototype.onResize=function(){this.updateRectSize()},e.prototype.getLastRow=function(){var e=1;this.children.forEach((function(t){e<t.y+t.width&&(e=t.y+t.width)})),this.lastRow=e+1},e.prototype.updateRectSize=function(){var e=this.element.nativeElement;this.dashboardRect=e.getBoundingClientRect()},e.prototype.emitChange=function(e){this.dashboardChange.emit({source:e,children:this.children.toArray()})},e.prototype.calculateRowSize=function(){return this.dashboardRect.height/this.rows},e.ctorParameters=function(){return[{type:t.ElementRef},{type:ic.DomSanitizer}]},yc([t.ContentChildren(t.forwardRef((function(){return Vp})))],e.prototype,"children",void 0),yc([t.Input()],e.prototype,"columns",void 0),yc([t.Input()],e.prototype,"gap",void 0),yc([t.Input()],e.prototype,"rows",void 0),yc([t.Output()],e.prototype,"dashboardChange",void 0),yc([t.HostBinding("attr.style")],e.prototype,"inlineStyle",null),yc([t.HostListener("window:resize")],e.prototype,"onResize",null),e=yc([t.Component({selector:"c8y-dashboard",template:"<ng-content></ng-content>\n",host:{class:"c8y-grid-dashboard dashboard-grid"},changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),Hp=function(){function e(e){this.MIN_WIDTH=2,this.MIN_HEIGHT=1,this.PIXEL_SIZE_THRESHOLD=10,this.diffX=0,this.diffY=0,this.dashboard=e.dashboard,this.children=e.dashboard.children?e.dashboard.children.filter((function(t){return e!==t})):[],this.child=e}return Object.defineProperty(e.prototype,"resize$",{get:function(){var e=this;return this.child.dragSource.moved.pipe(s.map((function(t){return e.getPixelSize(t)})),s.tap((function(t){return e.setPixelSize(t)})),s.map((function(t){return e.getDimensionSize(t)})),s.distinctUntilChanged((function(e,t){return e.width===t.width&&e.height===t.height})),s.map((function(t){return e.setDimension(t)})),this.arrangePipe())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drag$",{get:function(){var e=this;return this.child.dragSource.moved.pipe(s.map((function(t){return e.getDimensionPosition(t)})),s.filter((function(t){return t.x>=0&&t.x<=e.dashboard.columns-e.child.width&&t.y>=0})),s.distinctUntilChanged((function(e,t){return e.x===t.x&&e.y===t.y})),this.arrangePipe())},enumerable:!0,configurable:!0}),e.prototype.findFreeDimension=function(){var e=-1,t=0,n=!1,a=this.child,s=a.width,o=a.height;if(s>this.dashboard.columns)throw new Error("The child does not fit on the current dashboard.");do{for(t=0,e++;t+s<=this.dashboard.columns;){if(0===this.getCollided({x:t,y:e,width:s,height:o}).length){n=!0;break}t++}}while(!n);return{x:t,y:e,width:s,height:o}},e.prototype.collapseUpAll=function(){return o.sortBy(Sc([this.child],this.children),["y"]).forEach((function(t){var n=new e(t),a=n.collapseUp(t);n.setDimension(a)}))},e.prototype.arrangeAll=function(t){var n=t.current,a=t.scan,s=t.spacing,r=t.origin;return this.getCollided(n,o.sortBy(a,["y"])).map((function(t){return new e(t).setDimension(fc({},t,{y:s})),{current:t,scan:a.filter((function(e){return e!==t})),spacing:t.y+t.height,origin:r}}))},e.prototype.arrangePipe=function(){var e=this;return a.pipe(s.map((function(t){return{current:t,scan:e.children,spacing:t.y+t.height,origin:fc({},t)}})),s.expand((function(t){return e.arrangeAll(t)})),s.map((function(e){return e.origin})),s.map((function(t){return e.setDimension(t,!0)})),s.tap((function(){return e.collapseUpAll()})),s.tap((function(){return e.dashboard.getLastRow()})))},e.prototype.collapseUp=function(e){for(var t=e.y;t>0&&0===this.getCollided(fc({},e,{y:t-1})).length;)t--;return fc({},e,{y:t})},e.prototype.setDimension=function(e,t){if(void 0===t&&(t=!1),!(t&&this.getCollided(e).length>0))return this.child.x=e.x,this.child.y=e.y,e.width>=this.MIN_WIDTH&&e.x+e.width<=this.dashboard.columns?this.child.width=e.width:e.width<this.MIN_WIDTH?e.width=this.MIN_WIDTH:e.width=this.dashboard.columns-e.x,e.height>=this.MIN_HEIGHT?this.child.height=e.height:e.height=this.MIN_WIDTH,e},e.prototype.setPixelSize=function(e){var t=e.width,n=e.height;t>=this.dashboard.columnSize*this.MIN_WIDTH-this.dashboard.gap&&(this.child.pxWidth=t+this.PIXEL_SIZE_THRESHOLD),n>=this.dashboard.rowSize*this.MIN_HEIGHT-this.dashboard.gap&&(this.child.pxHeight=n+this.PIXEL_SIZE_THRESHOLD)},e.prototype.getPixelSize=function(e){var t=e.source.element.nativeElement.parentNode;if(!this.diffX){var n=t.getBoundingClientRect();this.diffX=n.left,this.diffY=n.top}var a=e.pointerPosition,s=a.x,o=a.y;return{width:Math.round(s-this.diffX),height:Math.round(o-this.diffY),pointer:{x:s,y:o}}},e.prototype.getDimensionSize=function(e){var t=this.child,n=t.x,a=t.y,s=this.dashboard.dashboardRect,o=this.dashboard.columnSize,r=this.dashboard.rowSize+this.dashboard.gap;return{x:n,y:a,width:Math.round((e.pointer.x-s.left+this.dashboard.gap)/o)-n,height:Math.round((e.pointer.y-s.top+this.dashboard.gap)/r)-a}},e.prototype.getDimensionPosition=function(e){var t=e.source.element.nativeElement.nextElementSibling;if(!this.diffX){var n=t.getBoundingClientRect();this.diffX=e.pointerPosition.x-n.left,this.diffY=e.pointerPosition.y-n.top}var a=e.pointerPosition.x-this.diffX,s=e.pointerPosition.y-this.diffY,o=this.child,r=o.width,l=o.height,i=this.dashboard.dashboardRect,c=this.dashboard.columnSize,u=this.dashboard.rowSize+this.dashboard.gap/2;return{x:Math.round((a-i.left)/c),y:Math.round((s-i.top)/u),width:r,height:l}},e.prototype.doesCollide=function(e,t){return void 0!==t.x&&!(e.y+e.height-1<t.y||e.y>t.y+t.height-1||e.x+e.width-1<t.x||e.x>t.x+t.width-1)},e.prototype.getCollided=function(e,t){var n=this;return void 0===t&&(t=this.children),t.filter((function(t){return n.doesCollide(e,t)}))},e}(),Vp=function(){function e(e,n,a){this.dashboard=e,this.sanitizer=n,this.element=a,this.actions=[],this.isResize=!1,this.isDragging=!1,this.klasses={},this._pxWidth="100%",this._pxHeight="100%",this.width=1,this.height=1,this.margin=12,this.isFrozen=!1,this.useIntersection=!1,this.changeStart=new t.EventEmitter,this.changeEnd=new t.EventEmitter,this.class={},this.intersected=!1}return Object.defineProperty(e.prototype,"pxWidth",{set:function(e){this._pxWidth=e+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pxHeight",{set:function(e){this._pxHeight=e+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inlineStyle",{get:function(){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 ")},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){this.klasses=fc({card:!0,"card-dashboard":!0,disabled:this.isFrozen,"on-resize":this.isResize},this.class)},e.prototype.ngOnInit=function(){var e=this;if(void 0!==this.x&&void 0!==this.y||setTimeout((function(){return e.setDynamicDimension()})),this.useIntersection&&"IntersectionObserver"in window){var t=new IntersectionObserver((function(n){return e.intersected=e.childInView(n[0],t)}));t.observe(this.element.nativeElement)}else this.intersected=!0},e.prototype.setDynamicDimension=function(){var e=new Hp(this).findFreeDimension(),t=e.x,n=e.y;this.x=t,this.y=n},e.prototype.resizeStarted=function(e){this.isResize=!0,this.dashboard.updateRectSize(),this.dragSource=e.source;var t=new Hp(this);this.changeSubscription=t.resize$.subscribe(),this.changeStart.emit(this),this.ngOnChanges()},e.prototype.dragStarted=function(e){this.isDragging=!0,this.dashboard.updateRectSize(),this.dragSource=e.source;var t=new Hp(this);this.changeSubscription=t.drag$.subscribe(),this.changeStart.emit(this)},e.prototype.reset=function(e){this.isResize=!1,this.isDragging=!1,this._pxWidth="100%",this._pxHeight="100%",this.ngOnChanges(),e&&e.source.reset(),this.changeSubscription&&(this.changeSubscription.unsubscribe(),this.dashboard.emitChange(this),this.changeEnd.emit(this))},e.prototype.getOrder=function(){return""+Math.round(100*(this.y+(this.x+1)/100))},e.prototype.childInView=function(e,t){return!!e.isIntersecting&&(t.unobserve(e.target),!0)},e.ctorParameters=function(){return[{type:Gp,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return Gp}))]}]},{type:ic.DomSanitizer},{type:t.ElementRef}]},yc([t.ContentChildren(Bp)],e.prototype,"actions",void 0),yc([t.Input()],e.prototype,"x",void 0),yc([t.Input()],e.prototype,"y",void 0),yc([t.Input()],e.prototype,"width",void 0),yc([t.Input()],e.prototype,"height",void 0),yc([t.Input()],e.prototype,"data",void 0),yc([t.Input()],e.prototype,"margin",void 0),yc([t.Input()],e.prototype,"isFrozen",void 0),yc([t.Input()],e.prototype,"useIntersection",void 0),yc([t.Output()],e.prototype,"changeStart",void 0),yc([t.Output()],e.prototype,"changeEnd",void 0),yc([t.Input()],e.prototype,"class",void 0),yc([t.HostBinding("attr.style")],e.prototype,"inlineStyle",null),e=yc([t.Component({selector:"c8y-dashboard-child",template:'<div cdkDropList>\n <div *ngIf="isResize" class="card-placeholder"></div>\n <div\n [ngClass]="klasses"\n cdkDrag\n [ngStyle]="{ width: _pxWidth, height: _pxHeight }"\n (cdkDragStarted)="dragStarted($event)"\n (cdkDragEnded)="reset($event)"\n [cdkDragDisabled]="isFrozen"\n >\n <div\n class="card-header-actions card-header-grid"\n [ngClass]="{ \'drag-handle\': !isFrozen, draggableCursor: !isFrozen }"\n cdkDragHandle\n >\n <ng-content select="c8y-dashboard-child-title"></ng-content>\n <div class="header-actions" *ngIf="!isFrozen && actions.length > 0">\n <div class="optionsBtn dropdown" dropdown container="body">\n <a\n title="{{ \'Settings\' | translate }}"\n href=""\n class="btnIcon c8y-dropdown"\n (click)="(false)"\n dropdownToggle\n >\n <i [c8yIcon]="\'cog\'"></i>\n </a>\n <ul\n class="dropdown-menu dropdown-menu-right"\n style="right: -41px;top: 3px;"\n *dropdownMenu\n >\n <ng-container *ngFor="let action of actions">\n <ng-container *ngTemplateOutlet="action.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n </div>\n </div>\n <div class="card-inner-scroll">\n <ng-content></ng-content>\n </div>\n <div\n *ngIf="!isFrozen && !isDragging"\n class="resize-handle"\n cdkDrag\n [cdkDragDisabled]="isFrozen"\n (cdkDragStarted)="resizeStarted($event)"\n (cdkDragEnded)="reset($event)"\n ></div>\n <div class="resize-icon" *ngIf="!isFrozen && !isDragging"></div>\n\n <div *cdkDragPlaceholder class="card-placeholder"></div>\n </div>\n</div>\n',host:{class:"dashboard-grid-child"}}),vc(0,t.Inject(t.forwardRef((function(){return Gp}))))],e)}(),Kp=function(){function e(){this.settings={isFrozen:!1,isDisabled:!1,widgetMargin:12,translateWidgetTitle:!1,defaultHeight:4,defaultWidth:4,allowFullscreen:!1,canDelete:!0,isLoading:!1},this.onAddWidget=new t.EventEmitter,this.onEditWidget=new t.EventEmitter,this.onDeleteWidget=new t.EventEmitter,this.onChangeDashboard=new t.EventEmitter,this.onEditDashboard=new t.EventEmitter,this.onDeleteDashboard=new t.EventEmitter,this.onFreeze=new t.EventEmitter,this.onChangeStart=new t.EventEmitter,this.onChangeEnd=new t.EventEmitter}return Object.defineProperty(e.prototype,"_settings",{set:function(e){this.settings=fc({},this.settings,e)},enumerable:!0,configurable:!0}),e.prototype.toggleFullscreen=function(){var e=document.body,t=document;this.fullScreen()?t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitExitFullscreen&&t.webkitExitFullscreen():e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)},e.prototype.fullScreen=function(){var e=document;return!!(e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement)},yc([t.Input()],e.prototype,"widgets",void 0),yc([t.Input()],e.prototype,"context",void 0),yc([t.Input()],e.prototype,"contextDashboard",void 0),yc([t.Input("settings")],e.prototype,"_settings",null),yc([t.Output()],e.prototype,"onAddWidget",void 0),yc([t.Output()],e.prototype,"onEditWidget",void 0),yc([t.Output()],e.prototype,"onDeleteWidget",void 0),yc([t.Output()],e.prototype,"onChangeDashboard",void 0),yc([t.Output()],e.prototype,"onEditDashboard",void 0),yc([t.Output()],e.prototype,"onDeleteDashboard",void 0),yc([t.Output()],e.prototype,"onFreeze",void 0),yc([t.Output()],e.prototype,"onChangeStart",void 0),yc([t.Output()],e.prototype,"onChangeEnd",void 0),e=yc([t.Component({selector:"c8y-widgets-dashboard",template:'<c8y-title *ngIf="!!settings.title">\n {{ settings.title | translate }}\n</c8y-title>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="onAddWidget.observers.length">\n <button\n class="btn btn-link"\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onAddWidget.emit()"\n >\n <i c8yIcon="plus-circle"></i> {{ \'Add widget\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="onEditDashboard.observers.length">\n <button\n class="btn btn-link"\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onEditDashboard.emit()"\n >\n <i c8yIcon="pencil"></i> {{ \'Edit\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="settings.allowFullscreen">\n <button class="btn btn-link" (click)="toggleFullscreen()">\n <i [c8yIcon]="fullScreen() ? \'compress\' : \'expand\'"></i> {{ \'Full screen\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]="\'right\'"\n itemClass="navbar-form"\n *ngIf="onFreeze.observers.length"\n>\n <button\n title="{{ \'Lock/unlock this dashboard\' | translate }}"\n class="btn btn-default"\n [ngClass]="{ active: settings.isFrozen }"\n (click)="onFreeze.emit(settings)"\n [disabled]="settings.isDisabled"\n uib-btn-checkbox\n >\n <i [c8yIcon]="settings.isFrozen ? \'lock\' : \'unlock\'"></i>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]="\'more\'"\n [priority]="-3000"\n *ngIf="settings.canDelete && onDeleteDashboard.observers.length"\n>\n <button (click)="onDeleteDashboard.emit()" [disabled]="settings.isFrozen || settings.isDisabled">\n <i c8yIcon="trash"></i> <span translate>Delete dashboard</span>\n </button>\n</c8y-action-bar-item>\n\n\x3c!-- empty state --\x3e\n<div class="c8y-empty-state text-center" *ngIf="!settings.isLoading && widgets.length === 0">\n <h1 class="c8y-icon c8y-icon-device c8y-icon-duocolor"></h1>\n <h3 translate>No widgets to display.</h3>\n <div *ngIf="!settings.isFrozen && onAddWidget.observers.length">\n <p translate>Add widgets to this dashboard.</p>\n <div>\n <button\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onAddWidget.emit()"\n class="btn btn-primary"\n translate\n >\n Add widget\n </button>\n </div>\n <p c8y-guide-docs>\n <small forceHtmlTranslate ngNonBindable\n >Find out more in the\n <a c8y-guide-href="users-guide/cockpit/#dashboards">User guide`KEEP_ORIGINAL`</a>.</small\n >\n </p>\n </div>\n</div>\n\x3c!-- /.empty settings --\x3e\n\n<div class="col-xs-12 text-center" *ngIf="settings.isLoading">\n <div class="spinner" style="position: relative;">\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<c8y-dashboard\n (dashboardChange)="onChangeDashboard.emit($event)"\n #dashboard\n *ngIf="!settings.isLoading"\n>\n <c8y-dashboard-child\n *ngFor="let widget of widgets"\n [x]="widget._x"\n [y]="widget._y"\n [width]="widget._width || settings.defaultWidth"\n [height]="widget._height || settings.defaultHeight"\n [margin]="settings.widgetMargin"\n [isFrozen]="settings.isFrozen || settings.isDisabled"\n [class]="widget.classes"\n [data]="widget"\n [useIntersection]="true"\n (changeStart)="onChangeStart.emit({ widget: widget, source: child, dashboard: dashboard })"\n (changeEnd)="onChangeEnd.emit({ widget: widget, source: child, dashboard: dashboard })"\n #child\n >\n <c8y-dashboard-child-title>\n <span *ngIf="settings.translateWidgetTitle"> {{ widget.title | translate }}</span>\n <span *ngIf="!settings.translateWidgetTitle">\n {{ widget.title }}\n </span>\n </c8y-dashboard-child-title>\n <c8y-dashboard-child-action *ngIf="onEditWidget.observers.length">\n <button (click)="onEditWidget.emit({ widget: widget, source: child, dashboard: dashboard })">\n <i c8yIcon="pencil"></i> <span translate>Edit</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dashboard-child-action *ngIf="onDeleteWidget.observers.length">\n <button\n (click)="onDeleteWidget.emit({ widget: widget, source: child, dashboard: dashboard })"\n >\n <i c8yIcon="trash"></i> <span translate>Remove</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dynamic-component\n [componentId]="widget.componentId || widget.name"\n [config]="\n widget.templateUrl || widget.widgetComponent\n ? { child: widget, dashboard: contextDashboard, context: context }\n : widget.config\n "\n *ngIf="child.intersected"\n ></c8y-dynamic-component>\n </c8y-dashboard-child>\n</c8y-dashboard>\n',host:{style:"\n display: block;\n ",class:"dashboard c8y-grid-dashboard"}})],e)}(),Wp=function(){function e(e){this.elementRef=e,this.htmlAnchor=this.elementRef.nativeElement,this.htmlAnchor.hasAttribute("target")||this.htmlAnchor.setAttribute("target","_blank")}return Object.defineProperty(e.prototype,"baseHref",{set:function(e){this.htmlAnchor.href=e+"/"+this.c8yGuideHref},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:t.ElementRef}]},yc([t.Input("c8y-guide-href")],e.prototype,"c8yGuideHref",void 0),e=yc([t.Directive({selector:"[c8y-guide-href]"})],e)}(),Yp=function(){function e(e,t,n){this.docs=e,this.el=t,this.renderer=n,this.destroyed$=new a.ReplaySubject(1)}return e.prototype.ngOnInit=function(){this.baseUrl=this.docs.getBaseUrl()},e.prototype.ngAfterContentInit=function(){var e=this;this.translateDirective?this.translateDirective.htmlUpdateEvent.pipe(s.takeUntil(this.destroyed$)).subscribe((function(){e.replaceAnchorAttributes()})):this.replaceAnchorAttributes()},e.prototype.replaceAnchorAttributes=function(){var e=this;this.findGuideAnchors(this.el.nativeElement).forEach((function(t){var n=e.baseUrl+"/"+t.getAttribute("c8y-guide-href");e.renderer.setAttribute(t,"href",n),t.hasAttribute("target")||e.renderer.setAttribute(t,"target","_blank")}))},e.prototype.findGuideAnchors=function(e){var t=this,n=[];return"A"===e.nodeName&&e.attributes.getNamedItem("c8y-guide-href")?n.push(e):e.childNodes&&e.childNodes.length>0&&e.childNodes.forEach((function(e){var a=t.findGuideAnchors(e);a&&(n=Sc(n,a))})),n},e.prototype.ngAfterViewInit=function(){var e=this;this.links.forEach((function(t){t.baseHref=e.baseUrl}))},e.prototype.ngOnDestroy=function(){this.destroyed$.next(!0),this.destroyed$.complete()},e.ctorParameters=function(){return[{type:mp},{type:t.ElementRef},{type:t.Renderer2}]},yc([t.ContentChildren(Wp,{descendants:!0})],e.prototype,"links",void 0),yc([t.ContentChild(lu,{static:!1})],e.prototype,"translateDirective",void 0),e=yc([t.Component({selector:"[c8y-guide-docs]",template:'<ng-container *ngIf="!!baseUrl">\n <ng-content></ng-content>\n</ng-container>\n'})],e)}(),Zp=function(){function e(){}return e=yc([t.NgModule({declarations:[Wp,Yp],imports:[c.CommonModule],exports:[Wp,Yp],providers:[mp]})],e)}(),Jp=function(){function e(){}return e=yc([t.NgModule({declarations:[Vp,Gp,zp,Bp,Kp],imports:[Yu,Xu,Up,lc.DragDropModule,tc.BsDropdownModule.forRoot(),Cp,Zp],exports:[Gp,Vp,zp,Bp,Kp]})],e)}(),Xp=function(){},Qp=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=yc([t.Directive({selector:"[c8yCellRendererDef]"})],e)}(),em=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=yc([t.Directive({selector:"[c8yHeaderCellRendererDef]"})],e)}(),tm=function(){},nm=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=yc([t.Directive({selector:"[c8yFilteringFormRendererDef]"})],e)}(),am=function(){function e(){}return yc([t.Input()],e.prototype,"name",void 0),yc([t.ContentChild(Qp,{static:!1})],e.prototype,"cellRendererDef",void 0),yc([t.ContentChild(em,{static:!1})],e.prototype,"headerCellRendererDef",void 0),yc([t.ContentChild(nm,{static:!1})],e.prototype,"filteringFormRendererDef",void 0),e=yc([t.Directive({selector:"c8y-column"})],e)}(),sm={icon:1,numeric:1,"text-short":1.67,"text-long":3.33};(cd=e.FilteringActionType||(e.FilteringActionType={})).ApplyFilter="APPLY_FILTER",cd.ResetFilter="RESET_FILTER";var om=function(){function e(){this.loadingSubject=new a.BehaviorSubject(!1),this.dataSourceSubject=new a.BehaviorSubject([]),this.dataStatsSubject=new a.BehaviorSubject({size:0,filteredSize:0,currentPage:0,currentPageSize:0,firstPageSize:0}),this.dataSelectionSubject=new a.BehaviorSubject({filteredDataIds:[]}),this.resultListSubject=new a.Subject,this.loading$=this.loadingSubject.asObservable(),this.data$=this.dataSourceSubject.asObservable(),this.stats$=this.dataStatsSubject.asObservable(),this.selection$=this.dataSelectionSubject.asObservable(),this.resultList$=this.resultListSubject.asObservable()}return e.prototype.connect=function(e){return this.data$},e.prototype.disconnect=function(e){this.loadingSubject.complete(),this.dataSourceSubject.complete(),this.dataStatsSubject.complete(),this.dataSelectionSubject.complete()},e.prototype.loadData=function(e){var t=this,n=e.rows,r=e.columns,l=e.pagination,i=e.searchText,c=e.serverSideDataCallback,u=e.selectable,d=e.selectionPrimaryKey,p=e.infiniteScroll,m=e.reload,g=void 0!==m&&m,h=this.toObservable(n).pipe(s.map((function(e){var n=0,a=[],s=o.flow((function(e){return t.doClientSideSearch({data:e,columns:r,searchText:i})}),(function(e){return t.doClientSideFiltering({data:e,columns:r})}),(function(e){return t.doClientSideSorting({data:e,columns:r})}),(function(e){return n=e.length,a=u?e.map((function(e){return e[d]})):a,e}),(function(e){return t.doClientSidePagination({data:e,pagination:l})}))(e);return t.dataStatsSubject.next({size:e.length,filteredSize:n,currentPage:l.currentPage,currentPageSize:s.length,firstPageSize:l.pageSize}),t.dataSelectionSubject.next({filteredDataIds:a}),s}))),f=a.defer((function(){return t.toObservable(c({columns:r,searchText:i,pagination:l,selection:{enabled:u,primaryKey:d}}))})).pipe(s.map((function(e){var n=e.data,a=e.paging,s=e.size,o=e.filteredSize,r=e.filteredDataIds;return t.dataStatsSubject.next({size:s,filteredSize:o,currentPage:a.currentPage,currentPageSize:n.length,nextPage:a.nextPage,firstPageSize:a.pageSize}),t.dataSelectionSubject.next({filteredDataIds:r||[]}),t.resultListSubject.next(e),n}))),y="function"==typeof c?f:h;a.of([]).pipe(s.tap((function(){return t.loadingSubject.next(!0)})),s.switchMap((function(){return y})),s.catchError((function(e){return t.dataStatsSubject.next({size:0,filteredSize:0,currentPage:0,currentPageSize:0,firstPageSize:0}),t.dataSelectionSubject.next({filteredDataIds:[]}),a.of([])})),s.finalize((function(){return t.loadingSubject.next(!1)}))).subscribe((function(e){var n=p&&!g?Sc(t.dataSourceSubject.value,e):e;t.dataSourceSubject.next(n)}))},e.prototype.resolveValue=function(e,t){return o.get(e,t)},e.prototype.resolveFunction=function(e){return"function"==typeof e?e():e},e.prototype.normalizeNil=function(e){return o.isNil(e)?"":e},e.prototype.doClientSideFiltering=function(e){var t=this,n=e.data;return e.columns.reduce((function(e,n){var a=n.filterPredicate;return"string"==typeof a?t.doClientSideSearch({data:e,columns:[n],searchText:a}):"function"==typeof a?e.filter((function(e){return a(e,n.path)})):e}),n)},e.prototype.doClientSideSearch=function(e){var t=this,n=e.data,a=e.columns,s=e.searchText,r=a.map((function(e){return e.path})).filter((function(e){return!o.isNil(e)})),l=this.createRegexSearch(s);return n.filter((function(e){var n=o.flow((function(e){return o.pick(e,r)}),(function(e){return o.mapValues(e,t.resolveFunction)}),(function(e){return o.omitBy(e,o.isNil)}))(e);return Object.values(n).some((function(e){return l.test(e.toString())}))}))},e.prototype.doClientSideSorting=function(e){var t=e.data,n=e.columns.filter((function(e){return!!e.sortOrder})),a={paths:n.map((function(e){return e.path})),orders:n.map((function(e){return e.sortOrder}))};return o.orderBy(t,a.paths,a.orders)},e.prototype.doClientSidePagination=function(e){var t=e.data,n=e.pagination;return n?o.get(o.chunk(t,n.pageSize),n.currentPage-1,[]):t},e.prototype.createRegexSearch=function(e){return RegExp(function(e){void 0===e&&(e="");return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"i")},e.prototype.toObservable=function(e){return a.isObservable(e)?e:e instanceof Promise?a.from(e):a.of(e)},e}();var rm,lm,im=function(){function n(e,n,s,o){this.sanitizer=e,this.hostRef=n,this.cd=s,this.cfr=o,this.title="Items",this.loadMoreItemsLabel="Load more items",this.loadingItemsLabel="Loading items…",this.noMatchingItemsLabel="No matching items.",this.dataSource=new om,this.filteringLabelsParams={filteredItemsCount:0,allItemsCount:0},this.paginationLabelParams={pageFirstItemIdx:0,pageLastItemIdx:0,itemsTotal:0},this.possiblePageSizes=[10,15,20,30,50],this.minPossiblePageSize=Math.min.apply(Math,Sc(this.possiblePageSizes)),this.selectable=!1,this.selectionPrimaryKey="id",this.displayOptions={striped:!0,bordered:!1,gridHeader:!0},this.rowMouseOver=new t.EventEmitter,this.rowMouseLeave=new t.EventEmitter,this.rowClick=new t.EventEmitter,this.itemsSelect=new t.EventEmitter,this.columnNames=[],this.styles={tableCursor:"auto",gridTemplateColumns:void 0,gridInfiniteScrollColumn:void 0},this.searchText$=new t.EventEmitter,this.searchText="",this.filteringApplied=!1,this.totalPagesCount=1/0,this.selectedItemIds=[],this.currentPageSelectionState={allSelected:!1,allDeselected:!0},this.builtInActionType={Edit:"EDIT",Delete:"DELETE",Export:"EXPORT"},this.resizeHandleMouseDown$=new t.EventEmitter,this.resizeHandleContainerMouseMove$=new t.EventEmitter,this.resizeHandleContainerMouseUp$=new t.EventEmitter,this.unsubscribe$=new a.Subject}return Object.defineProperty(n.prototype,"_columns",{set:function(e){this.columns=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_rows",{set:function(e){this.rows=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_pagination",{set:function(e){this.pagination=e;var t=o.get(this.pagination,"pageSize");t&&!this.possiblePageSizes.find((function(e){return e===t}))&&(this.pagination=fc({},this.pagination,{pageSize:10}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_infiniteScroll",{set:function(e){this.infiniteScroll=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_serverSideDataCallback",{set:function(e){this.serverSideDataCallback=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_selectable",{set:function(e){this.selectable=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_selectionPrimaryKey",{set:function(e){this.selectionPrimaryKey=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_displayOptions",{set:function(e){this.displayOptions=fc({},this.displayOptions,e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_actionControls",{set:function(e){this.actionControls=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_bulkActionControls",{set:function(e){this.bulkActionControls=e||[]},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){var e=this;this.searchText$.pipe(s.takeUntil(this.unsubscribe$),s.debounceTime(300),s.distinctUntilChanged(),s.tap((function(t){e.searchText=t}))).subscribe((function(){e.reload()})),this.selectable&&a.combineLatest(this.dataSource.data$,this.itemsSelect.asObservable()).pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(t){var n=wc(t,1)[0],a=0===n.length;e.currentPageSelectionState={allSelected:!a&&n.every((function(t){return e.isItemSelected(t)})),allDeselected:!!a||n.every((function(t){return!e.isItemSelected(t)}))}})),this.dataSource.stats$.pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(t){e.createLoadMoreComponent(t),e.updateFilteringLabelsParams(t),e.updatePaginationLabelParams(t)}))},n.prototype.ngOnChanges=function(){this.updateColumns(),this.loadData()},n.prototype.ngAfterViewInit=function(){this.updateGridColumnsSize(),this.thEls=this.thRefs.toArray().map((function(e){return e.nativeElement})),this.setupResizeHandle()},n.prototype.ngOnDestroy=function(){this.unsubscribe$.next(),this.unsubscribe$.complete()},n.prototype.trackByName=function(e,t){return t.name},n.prototype.resolveCellValue=function(e,t){var n=this;return o.flow([function(e){return n.dataSource.resolveValue(e,t)},this.dataSource.resolveFunction,this.dataSource.normalizeNil])(e)},n.prototype.changeSortOrder=function(e){var t=this.columns.find((function(t){return t.name===e}));if(t){var n=t.sortOrder;n?"asc"===n?this.updateSorting([e],"desc"):this.updateSorting([e],""):this.updateSorting([e],"asc")}},n.prototype.updateSorting=function(e,t){this.columns=this.columns.map((function(n){return e.includes(n.name)?fc({},n,{sortOrder:t}):n})),this.reload()},n.prototype.applyFilter=function(t,n,a){this.updateFiltering([t],{type:e.FilteringActionType.ApplyFilter,payload:{filteringModifier:a}}),n.hide()},n.prototype.resetFilter=function(t,n){this.updateFiltering([t],{type:e.FilteringActionType.ResetFilter}),n.hide()},n.prototype.clearFilters=function(){this.updateFiltering(this.columns.map((function(e){return e.name})),{type:e.FilteringActionType.ResetFilter})},n.prototype.updateFiltering=function(t,n){this.columns=this.columns.map((function(a){return t.includes(a.name)?fc({},a,n.type===e.FilteringActionType.ApplyFilter?n.payload.filteringModifier:{filterPredicate:void 0,externalFilterQuery:void 0}):a})),this.updateFilteringApplied(),this.reload()},n.prototype.updateFilteringApplied=function(){this.filteringApplied=this.columns.some(this.isColumnFilteringApplied)},n.prototype.isColumnFilteringApplied=function(e){var t=e.filterable,n=e.filterPredicate,a=e.externalFilterQuery;return!(!t||!n&&!a)},n.prototype.updatePagination=function(e){var t=e.itemsPerPage,n=e.page;this.pagination=fc({},this.pagination,{pageSize:t,currentPage:n}),this.loadData()},n.prototype.reload=function(){this.pagination=fc({},this.pagination,{currentPage:1}),this.recreateLoadMoreComponent=!0,this.loadData(!0),this.scrollToTop()},n.prototype.loadNextPage=function(){var e=this;return this.pagination=fc({},this.pagination,{currentPage:this.pagination.nextPage}),this.loadData(),this.dataSource.resultList$.pipe(s.take(1)).toPromise().then((function(t){return fc({},t,{paging:fc({},t.paging,{next:e.loadNextPage.bind(e)})})}))},n.prototype.getCellRendererSpec=function(e){var t=e.value,n=e.row,a=e.columnName;return this._getCellRendererSpec({type:"CELL",value:t,row:n,columnName:a})},n.prototype.getHeaderCellRendererSpec=function(e){var t=e.value,n=e.columnName;return this._getCellRendererSpec({type:"HEADER",value:t,row:void 0,columnName:n})},n.prototype.getFilteringFormRendererSpec=function(e){var t=e.column,n=e.dropdown;return{renderer:o.get(this.getColumnRenderer(t),"filteringFormRendererDef.template")||t.filteringFormRendererComponent,context:{property:t,applyFilter:this.applyFilter.bind(this,t.name,n),resetFilter:this.resetFilter.bind(this,t.name,n)}}},n.prototype.setAllItemsSelected=function(e){var t=this;this.dataSource.selection$.pipe(s.first()).subscribe((function(n){var a=n.filteredDataIds;return t.setItemsSelected(a,e)}))},n.prototype.setAllItemsInCurrentPageSelected=function(e){var t=this;this.dataSource.data$.pipe(s.first()).subscribe((function(n){return t.setItemsSelected(n,e)}))},n.prototype.setItemsSelected=function(e,t){var n=this,a=e.map((function(e){return"object"==typeof e?e[n.selectionPrimaryKey]:e}));this.selectedItemIds=t?o.union(this.selectedItemIds,a):o.without.apply(void 0,Sc([this.selectedItemIds],a)),this.itemsSelect.emit(this.selectedItemIds)},n.prototype.isItemSelected=function(e){return this.selectedItemIds.includes(e[this.selectionPrimaryKey])},n.prototype.onColumnDrop=function(e){var t=e.previousIndex,n=e.currentIndex;if(t!==n){var a=this.columns.splice(t,1);this.columns.splice(n,0,a[0])}this.updateColumnNames(),this.updateGridColumnsSize()},n.prototype.updateGridColumnsSize=function(){this.styles=fc({},this.styles,{gridTemplateColumns:this.sanitizer.bypassSecurityTrustStyle(this.columns.filter((function(e){return e.visible})).map((function(e){return e.gridTrackSize})).join(" ")),gridInfiniteScrollColumn:this.sanitizer.bypassSecurityTrustStyle("1 / span "+this.columns.length)})},n.prototype.updateColumns=function(){var e={gridTrackSize:"42px",sortable:!1,positionFixed:!0};this.columns=Sc([this.selectable?fc({},e,{name:"checkbox"}):void 0],this.columns,[this.actionControls.length>0?fc({},e,{name:"actions"}):void 0]).filter(Boolean).map(this.withColumnDefaults),this.updateColumnNames(),this.updateGridColumnsSize(),this.updateFilteringApplied()},n.prototype.withColumnDefaults=function(e){var t=e.dataType||"text-short",n=e.headerCSSClassName,a=e.cellCSSClassName;return fc({visible:!0,positionFixed:!1,sortable:!0,sortOrder:"",filterable:!1},e,{dataType:t,gridTrackSize:e.gridTrackSize||"minmax(80px, "+sm[t]+"fr)",headerCSSClassName:("string"==typeof n?n.split(" "):n)||[],cellCSSClassName:("string"==typeof a?a.split(" "):a)||[]})},n.prototype.updateColumnNames=function(){this.columnNames=this.columns.map((function(e){return e.name}))},n.prototype.setupResizeHandle=function(){var e=this;this.resizeHandleMouseDown$.pipe(s.takeUntil(this.unsubscribe$),s.tap((function(){return e.clearMouseHighlights()})),s.mergeMap((function(t){var n=t.event,a=t.targetColumnName;return e.columns=e.columns.map((function(e){return e.name===a?fc({},e,{headerCSSClassName:o.union(e.headerCSSClassName,["header--being-resized"])}):e})),e.headerBeingResized={columnName:a,el:n.target.parentNode},e.styles=fc({},e.styles,{tableCursor:"col-resize"}),e.resizeHandleContainerMouseMove$.pipe(s.tap((function(){return e.clearMouseHighlights()})),s.takeUntil(e.resizeHandleContainerMouseUp$))}))).subscribe((function(t){requestAnimationFrame((function(){e.columns=e.columns.map((function(n,a){if(n.name===e.headerBeingResized.columnName){var s=e.hostRef.nativeElement,r=s.getBoundingClientRect().left,l=s.scrollLeft-r+t.clientX-(e.headerBeingResized.el.offsetLeft||0);return fc({},n,{gridTrackSize:Math.max(80,l)+"px"})}return n.gridTrackSize.startsWith("minmax")?fc({},n,{gridTrackSize:o.parseInt(e.thEls[a].clientWidth)+"px"}):n})),e.updateGridColumnsSize()}))})),this.resizeHandleContainerMouseUp$.pipe(s.takeUntil(this.unsubscribe$)).subscribe((function(){e.headerBeingResized&&(e.columns=e.columns.map((function(t){return t.name===e.headerBeingResized.columnName?fc({},t,{headerCSSClassName:o.without(t.headerCSSClassName,"header--being-resized")}):t})),e.headerBeingResized=void 0,e.styles=fc({},e.styles,{tableCursor:"auto"}))}))},n.prototype.clearMouseHighlights=function(){window.getSelection&&window.getSelection().removeAllRanges()},n.prototype._getCellRendererSpec=function(e){var t=e.type,n=e.value,a=e.row,s=e.columnName,r=this.columns.find((function(e){return e.name===s})),l=this.getColumnRenderer(r),i=o.get(l,("HEADER"===t?"headerCellRendererDef":"cellRendererDef")+".template"),c=r.cellRendererComponent,u=r.headerCellRendererComponent;return{renderer:i||("HEADER"===t?u:c),context:{value:n,item:a,property:r}}},n.prototype.getColumnRenderer=function(e){return this.columnRenderers.toArray().find((function(t){return t.name===e.name}))},n.prototype.loadData=function(e){void 0===e&&(e=!1);var t=this,n=t.rows,a=t.columns,s=t.pagination,o=t.searchText,r=t.serverSideDataCallback,l=t.selectable,i=t.selectionPrimaryKey,c=t.infiniteScroll;this.dataSource.loadData({rows:n,columns:a,pagination:s,searchText:o,serverSideDataCallback:r,selectable:l,selectionPrimaryKey:i,infiniteScroll:c,reload:e})},n.prototype.updateFilteringLabelsParams=function(e){this.filteringLabelsParams={filteredItemsCount:e.filteredSize,allItemsCount:e.size}},n.prototype.updatePaginationLabelParams=function(e){this.pagination.nextPage=e.nextPage;var t=(e.currentPage-1)*e.firstPageSize+1;this.paginationLabelParams={pageFirstItemIdx:t,pageLastItemIdx:t+(e.currentPageSize-1),itemsTotal:e.filteredSize}},n.prototype.createLoadMoreComponent=function(e){if(this.infiniteScroll&&e&&e.nextPage&&(!this.loadMoreComponent||this.recreateLoadMoreComponent)){this.recreateLoadMoreComponent=!1,this.infiniteScrollContainer.clear();var t=this.cfr.resolveComponentFactory(Pu),n=this.infiniteScrollContainer.createComponent(t).instance;n.useIntersection="auto"===this.infiniteScroll||"hidden"===this.infiniteScroll,n.hidden="hidden"===this.infiniteScroll,n.paging={nextPage:e.nextPage,next:this.loadNextPage.bind(this)},n.loadNextLabel=this.loadMoreItemsLabel,n.loadingLabel=this.loadingItemsLabel,this.loadMoreComponent=n}else this.loadMoreComponent&&!e.nextPage&&(this.loadMoreComponent.paging={nextPage:null})},n.prototype.scrollToTop=function(){this.infiniteScroll&&(this.scrollContainer.nativeElement.scrollTop=0)},n.ctorParameters=function(){return[{type:ic.DomSanitizer},{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:t.ComponentFactoryResolver}]},yc([t.Input()],n.prototype,"title",void 0),yc([t.Input()],n.prototype,"loadMoreItemsLabel",void 0),yc([t.Input()],n.prototype,"loadingItemsLabel",void 0),yc([t.Input()],n.prototype,"noMatchingItemsLabel",void 0),yc([t.Input("columns")],n.prototype,"_columns",null),yc([t.Input("rows")],n.prototype,"_rows",null),yc([t.Input("pagination")],n.prototype,"_pagination",null),yc([t.Input("infiniteScroll")],n.prototype,"_infiniteScroll",null),yc([t.Input("serverSideDataCallback")],n.prototype,"_serverSideDataCallback",null),yc([t.Input("selectable")],n.prototype,"_selectable",null),yc([t.Input("selectionPrimaryKey")],n.prototype,"_selectionPrimaryKey",null),yc([t.Input("displayOptions")],n.prototype,"_displayOptions",null),yc([t.Input("actionControls")],n.prototype,"_actionControls",null),yc([t.Input("bulkActionControls")],n.prototype,"_bulkActionControls",null),yc([t.Output()],n.prototype,"rowMouseOver",void 0),yc([t.Output()],n.prototype,"rowMouseLeave",void 0),yc([t.Output()],n.prototype,"rowClick",void 0),yc([t.Output()],n.prototype,"itemsSelect",void 0),yc([t.ContentChildren(am)],n.prototype,"columnRenderers",void 0),yc([t.ViewChild("scroll",{static:!0})],n.prototype,"scrollContainer",void 0),yc([t.ViewChild("infiniteScrollContainer",{static:!1,read:t.ViewContainerRef})],n.prototype,"infiniteScrollContainer",void 0),yc([t.ViewChildren(cc.CdkHeaderCell,{read:t.ElementRef})],n.prototype,"thRefs",void 0),n=yc([t.Component({selector:"c8y-data-grid",template:'<div class="table-data-grid-scroll" #scroll>\n <div *ngIf="displayOptions.gridHeader" class="table-data-grid-header separator">\n <h4 class="m-r-16">{{ title | translate }}</h4>\n <span *ngIf="!filteringApplied">\n <span class="label label-warning m-r-4" translate>No filters</span>\n <small\n *ngIf="!!filteringLabelsParams.allItemsCount"\n class="m-r-4"\n ngNonBindable\n translate\n [translateParams]="filteringLabelsParams"\n >{{ filteredItemsCount }} of {{ allItemsCount }} items</small\n >\n </span>\n <span *ngIf="filteringApplied">\n <ng-container *ngIf="!!filteringLabelsParams.allItemsCount">\n <span class="badge badge-info m-r-4">\n {{ (dataSource.stats$ | async).filteredSize }}\n </span>\n <small ngNonBindable translate [translateParams]="filteringLabelsParams"\n >of {{ allItemsCount }} items</small\n >\n </ng-container>\n <button class="m-l-8 btn btn-xs btn-default m-r-4" (click)="clearFilters()" translate>\n Clear filters\n </button>\n </span>\n <span class="hidden-xs hidden-sm">\n <button\n class="btn-clean text-primary"\n popover="{{ \'Click the column headers to apply filters.\' | translate }}"\n placement="right"\n triggers="focus"\n >\n <i c8yIcon="question-circle-o"></i>\n </button>\n </span>\n\n <div class="flex-item-right">\n <div class="btnbar flex-row">\n <div class="dropdown" dropdown [insideClick]="true">\n <button class="btnbar-btn c8y-dropdown" dropdownToggle>\n <i c8yIcon="columns" class="m-r-4"></i> <span translate>Configure columns</span>\n </button>\n\n <ul\n *dropdownMenu\n class="dropdown-menu"\n (click)="$event.stopPropagation()"\n >\n <li class="bg-white">\n <div cdkDropList (cdkDropListDropped)="onColumnDrop($event)" class="list-group m-0">\n <div *ngFor="let column of columns" cdkDrag cdkDragLockAxis="y">\n <ng-container *ngIf="!column.positionFixed">\n <div class="list-group-item draggable-after">\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n [(ngModel)]="column.visible"\n (change)="updateGridColumnsSize()"\n />\n <span></span> \n {{ (column.header | translate) || column.name }}\n </label>\n </div>\n </ng-container>\n </div>\n </div>\n </li>\n </ul>\n </div>\n\n <button\n class="btnbar-btn"\n [disabled]="dataSource.loading$ | async"\n (click)="searchText = \'\'; reload()"\n >\n <i c8yIcon="refresh" class="m-r-4"></i>\n <span>{{ \'Reload\' | translate }}</span>\n </button>\n\n <div *ngIf="!serverSideDataCallback" class="input-group input-group-search">\n <input\n type="search"\n class="form-control"\n placeholder="{{ \'Search…\' | translate }}"\n [ngModel]="searchText"\n (input)="searchText$.emit($event.target.value)"\n />\n <div class="input-group-addon">\n <i c8yIcon="search" *ngIf="searchText.length === 0"></i>\n <i\n c8yIcon="times"\n class="pointer"\n *ngIf="searchText.length > 0"\n (click)="searchText = \'\'; searchText$.emit(\'\')"\n ></i>\n </div>\n </div>\n </div>\n </div>\n <div\n class="table-data-grid-header-bulk-actions animated slideInDown fast"\n *ngIf="selectedItemIds.length !== 0"\n >\n <h4>\n <span ngNonBindable translate [translateParams]="{ count: selectedItemIds.length }">\n {{ count }} selected items.\n </span>\n <br class="visible-xs" />\n <small *ngIf="selectedItemIds.length >= pagination.pageSize">\n <a (click)="setAllItemsSelected(true)" style="cursor: pointer">\n <span\n ngNonBindable\n translate\n [translateParams]="{ count: (dataSource.stats$ | async).filteredSize }"\n >\n Select all {{ count }} items\n </span>\n </a>\n </small>\n </h4>\n <div class="flex-item-right">\n <div class="btnbar flex-row">\n <ng-container\n *ngFor="let bulkActionControl of bulkActionControls"\n [ngSwitch]="bulkActionControl.type"\n >\n <button\n *ngSwitchCase="builtInActionType.Export"\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="sign-out"></i> <span translate>Export</span>\n </button>\n\n <button\n *ngSwitchCase="builtInActionType.Delete"\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="trash"></i> <span translate>Delete</span>\n </button>\n\n <button\n *ngSwitchDefault\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="{{ bulkActionControl.icon }}"></i>\n {{ bulkActionControl.text | translate }}\n </button>\n </ng-container>\n\n <button class="btnbar-btn" (click)="setAllItemsSelected(false)">\n <i c8yIcon="times"></i> <span translate>Cancel</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <table\n class="table table-hover table-filtered-sorted table-data-grid"\n cdk-table\n [dataSource]="dataSource"\n [trackBy]="trackByName"\n [class.table-striped]="displayOptions.striped"\n [class.table-bordered]="displayOptions.bordered"\n [class.table-data-grid-with-checkboxes]="selectable"\n [class.table-data-grid-with-actions]="actionControls.length > 0"\n [style.grid-template-columns]="styles.gridTemplateColumns"\n (mousemove)="resizeHandleContainerMouseMove$.emit($event)"\n (mouseup)="resizeHandleContainerMouseUp$.emit($event)"\n >\n <ng-container *ngFor="let column of columns; trackBy: trackByName" [cdkColumnDef]="column.name">\n <ng-container [ngSwitch]="column.name">\n <ng-container *ngSwitchCase="\'checkbox\'">\n <th cdk-header-cell *cdkHeaderCellDef data-type="icon">\n <div>\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n [checked]="currentPageSelectionState.allSelected"\n [indeterminate]="\n !(\n currentPageSelectionState.allSelected ||\n currentPageSelectionState.allDeselected\n )\n "\n (change)="setAllItemsInCurrentPageSelected($event.target.checked)"\n />\n <span></span>\n </label>\n </div>\n </th>\n\n <td cdk-cell *cdkCellDef="let row">\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n [checked]="isItemSelected(row)"\n (change)="setItemsSelected([row], $event.target.checked)"\n />\n <span></span>\n </label>\n </td>\n </ng-container>\n\n <ng-container *ngSwitchCase="\'actions\'">\n <th cdk-header-cell *cdkHeaderCellDef data-type="icon"></th>\n\n <td cdk-cell *cdkCellDef="let row">\n <ng-container *ngIf="actionControls.length <= 2">\n <ng-container\n *ngFor="let actionControl of actionControls"\n [ngSwitch]="actionControl.type"\n >\n <button\n *ngSwitchCase="builtInActionType.Edit"\n class="btn btn-icon btn-xs btn-primary"\n title="{{ \'Edit\' | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="pencil"></i>\n </button>\n <button\n *ngSwitchCase="builtInActionType.Delete"\n class="btn btn-dot showOnHover"\n title="{{ \'Delete\' | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i class="text-danger" c8yIcon="minus-circle"></i>\n </button>\n <button\n *ngSwitchDefault\n class="btn btn-icon btn-xs btn-primary"\n title="{{ actionControl.text | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="{{ actionControl.icon }}"></i>\n </button>\n </ng-container>\n </ng-container>\n\n <div *ngIf="actionControls.length > 2" class="dropdown" dropdown>\n <button\n class="dropdown-toggle c8y-dropdown"\n title="{{ \'Actions\' | translate }}"\n dropdownToggle\n >\n <i c8yIcon="ellipsis-v"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <li *ngFor="let actionControl of actionControls" [ngSwitch]="actionControl.type">\n <button\n *ngSwitchCase="builtInActionType.Edit"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="pencil"></i> {{ \'Edit\' | translate }}\n </button>\n <button\n *ngSwitchCase="builtInActionType.Delete"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="trash"></i> {{ \'Delete\' | translate }}\n </button>\n <button\n *ngSwitchCase="builtInActionType.Export"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="download"></i> {{ \'Export\' | translate }}\n </button>\n <button *ngSwitchDefault (click)="actionControl.callback(row, reload.bind(this))">\n <i c8yIcon="{{ actionControl.icon }}"></i> {{ actionControl.text | translate }}\n </button>\n </li>\n </ul>\n </div>\n </td>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [ngClass]="column.headerCSSClassName"\n [attr.data-type]="column.dataType"\n [class.sorted]="column.sortOrder"\n [class.filtered]="column | map: isColumnFilteringApplied"\n [class.hidden]="!column.visible"\n >\n <div *ngIf="!column.filterable" [title]="(column.header | translate) || column.name">\n <ng-container\n *ngIf="\n (\n [{\n columnName: column.name,\n value: ((column.header | translate) || column.name)\n }]\n | map:getHeaderCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n </div>\n <div\n *ngIf="column.filterable"\n class="dropdown"\n dropdown\n #dropdown="bs-dropdown"\n [insideClick]="true"\n container="body"\n >\n <button\n class="btn-header c8y-dropdown"\n dropdownToggle\n [title]="(column.header | translate) || column.name"\n >\n <ng-container\n *ngIf="\n (\n [{\n columnName: column.name,\n value: ((column.header | translate) || column.name)\n }]\n | map:getHeaderCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n <i c8yIcon="filter" title="{{ \'Filter\' | translate }}"></i>\n </button>\n\n <ul *dropdownMenu class="dropdown-menu " (click)="$event.stopPropagation()">\n <li class="data-grid__dropdown">\n <ng-container\n *ngIf="\n (\n [{\n column: column,\n dropdown: dropdown\n }]\n | map:getFilteringFormRendererSpec:this\n ) as filteringFormRendererSpec\n "\n >\n <c8y-filtering-form-renderer [spec]="filteringFormRendererSpec">\n </c8y-filtering-form-renderer>\n </ng-container>\n </li>\n </ul>\n </div>\n\n <button\n *ngIf="column.sortable"\n class="btn-sort"\n title="{{ \'Sort\' | translate }}"\n (click)="changeSortOrder(column.name)"\n >\n <ng-container [ngSwitch]="column.sortOrder">\n <i *ngSwitchCase="\'asc\'" c8yIcon="long-arrow-up"></i>\n <i *ngSwitchCase="\'desc\'" c8yIcon="long-arrow-down"></i>\n <i *ngSwitchDefault c8yIcon="exchange"></i>\n </ng-container>\n </button>\n\n <span\n class="resize-handle"\n (mousedown)="\n resizeHandleMouseDown$.emit({ event: $event, targetColumnName: column.name })\n "\n >\n </span>\n </th>\n\n <td\n cdk-cell\n *cdkCellDef="let row"\n [ngClass]="column.cellCSSClassName"\n [attr.data-cell-title]="column.header | translate"\n [class.hidden]="!column.visible"\n >\n <ng-container\n *ngIf="\n (\n [{\n value: resolveCellValue(row, column.path),\n row: row,\n columnName: column.name\n }]\n | map:getCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n </td>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-container cdkColumnDef="infiniteScrollFooter">\n <td cdk-footer-cell *cdkFooterCellDef [style.grid-column]="styles.gridInfiniteScrollColumn">\n <template #infiniteScrollContainer></template>\n </td>\n </ng-container>\n\n <tr cdk-header-row *cdkHeaderRowDef="columnNames"></tr>\n\n <tr\n cdk-row\n *cdkRowDef="let row; columns: columnNames"\n (mouseover)="rowMouseOver.emit(row)"\n (mouseleave)="rowMouseLeave.emit(row)"\n (click)="rowClick.emit(row)"\n ></tr>\n\n <ng-container *ngIf="infiniteScroll">\n <tr cdk-footer-row *cdkFooterRowDef="[\'infiniteScrollFooter\']"></tr>\n </ng-container>\n </table>\n\n <div *ngIf="(dataSource.loading$ | async) && !loadMoreComponent" class="text-center">\n <c8y-progress-bar [message]="loadingItemsLabel"></c8y-progress-bar>\n </div>\n\n <div\n class="row m-0 p-t-40 p-b-40"\n *ngIf="!(dataSource.loading$ | async) && (dataSource.stats$ | async).filteredSize === 0"\n >\n <div class="col-md-4 col-md-offset-4">\n <div class="c8y-empty-state">\n <h1 c8yIcon="search"></h1>\n <div>\n <p>\n <strong>{{ noMatchingItemsLabel | translate }}</strong>\n </p>\n <small>{{ \'Refine your search terms\' | translate }}</small>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngIf="pagination && !infiniteScroll" class="table-data-grid-footer separator">\n <div class="col-sm-4 no-gutter">\n <div *ngIf="(dataSource.stats$ | async).currentPageSize > 0" class="counter">\n <span class="text-muted" ngNonBindable translate [translateParams]="paginationLabelParams"\n >{{ pageFirstItemIdx }} - {{ pageLastItemIdx }} of {{ itemsTotal }}</span\n >\n </div>\n </div>\n\n <div class="col-sm-4 no-gutter text-center">\n <div\n *ngIf="(dataSource.stats$ | async).filteredSize > minPossiblePageSize"\n class="form-group form-inline"\n >\n <label class="m-r-4" translate>Items per page</label>\n <div class="c8y-select-wrapper">\n <select\n class="form-control"\n [ngModel]="pagination.pageSize"\n (ngModelChange)="\n updatePagination({ itemsPerPage: $event, page: pagination.currentPage })\n "\n >\n <option *ngFor="let pageSize of possiblePageSizes" [ngValue]="pageSize">\n {{ pageSize }}\n </option>\n </select>\n </div>\n </div>\n </div>\n\n <div class="col-sm-4 no-gutter text-right">\n <pagination\n [class.hidden]="totalPagesCount <= 1"\n [ngModel]="pagination.currentPage"\n (pageChanged)="updatePagination($event)"\n [totalItems]="(dataSource.stats$ | async).filteredSize"\n [itemsPerPage]="pagination.pageSize"\n (numPages)="totalPagesCount = $event"\n [maxSize]="5"\n [boundaryLinks]="false"\n previousText=" "\n nextText=" "\n ></pagination>\n </div>\n </div>\n</div>\n'})],n)}(),cm=function(){function e(e,t){this.injector=e,this.cd=t}return Object.defineProperty(e.prototype,"_spec",{set:function(e){this.spec=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){this.prevSpec||(this.prevSpec=this.spec);var e=this.spec.renderer;e instanceof t.TemplateRef?this.rendererType="TEMPLATE":e instanceof t.Type&&(this.rendererType="COMPONENT",this.rendererInjector=t.Injector.create({providers:[{provide:Xp,useValue:this.spec.context}],parent:this.injector}))},e.prototype.ngDoCheck=function(){!this.spec.context.value===this.prevSpec.context.value&&(this.prevSpec=this.spec,this.cd.markForCheck())},e.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef}]},yc([t.Input("spec")],e.prototype,"_spec",null),e=yc([t.Component({selector:"c8y-cell-renderer",template:'<ng-container *ngIf="spec.renderer">\n <ng-container\n *ngIf="rendererType === \'TEMPLATE\'"\n [ngTemplateOutlet]="spec.renderer"\n [ngTemplateOutletContext]="{ $implicit: spec.context }"\n >\n </ng-container>\n\n <ng-container\n *ngIf="rendererType === \'COMPONENT\'"\n [ngComponentOutlet]="spec.renderer"\n [ngComponentOutletInjector]="rendererInjector"\n >\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf="!spec.renderer">\n {{ spec.context.value }}\n</ng-container>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),um=function(){function e(e,t){this.injector=e,this.cd=t,this.defaultRendererFilterText=""}return Object.defineProperty(e.prototype,"_spec",{set:function(e){this.spec=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){var e=this.spec,n=e.renderer,a=e.context;n instanceof t.TemplateRef?this.rendererType="TEMPLATE":n instanceof t.Type&&(this.rendererType="COMPONENT",this.rendererInjector=t.Injector.create({providers:[{provide:tm,useValue:this.spec.context}],parent:this.injector}));var s=a.property.filterPredicate;"string"==typeof s&&(this.defaultRendererFilterText=s)},e.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef}]},yc([t.Input("spec")],e.prototype,"_spec",null),e=yc([t.Component({selector:"c8y-filtering-form-renderer",template:'<ng-container *ngIf="spec.renderer">\n <ng-container\n *ngIf="rendererType === \'TEMPLATE\'"\n [ngTemplateOutlet]="spec.renderer"\n [ngTemplateOutletContext]="{ $implicit: spec.context }"\n >\n </ng-container>\n\n <ng-container\n *ngIf="rendererType === \'COMPONENT\'"\n [ngComponentOutlet]="spec.renderer"\n [ngComponentOutletInjector]="rendererInjector"\n >\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf="!spec.renderer">\n <div class="form-group">\n <label translate>Filter text</label>\n <input\n class="form-control"\n [(ngModel)]="defaultRendererFilterText"\n (keyup.enter)="\n spec.context.applyFilter({\n filterPredicate: defaultRendererFilterText\n })\n "\n />\n </div>\n <div class="flex-row">\n <button\n class="btn btn-default btn-sm flex-grow m-r-8"\n (click)="defaultRendererFilterText = \'\'; spec.context.resetFilter()"\n translate\n >\n Reset\n </button>\n <button\n class="btn btn-primary btn-sm flex-grow"\n (click)="\n spec.context.applyFilter({\n filterPredicate: defaultRendererFilterText\n })\n "\n translate\n >\n Apply\n </button>\n </div>\n</ng-container>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),dm=function(){function e(){}return e=yc([t.NgModule({imports:[c.CommonModule,cc.CdkTableModule,lc.DragDropModule,ac.FormsModule,ac.ReactiveFormsModule,Yu,tc.BsDropdownModule.forRoot(),sc.PopoverModule.forRoot(),uc.PaginationModule.forRoot()],declarations:[Qp,em,cm,nm,um,am,im],exports:[Qp,em,nm,am,im],entryComponents:[im]})],e)}(),pm={sendData:{AVAILABLE:{icon:"long-arrow-right",class:"statusOk"},UNAVAILABLE:{icon:"long-arrow-right",class:"statusNok"},UNKNOWN:{icon:"long-arrow-right",class:"statusUnknown"},NOT_MONITORED:{icon:"long-arrow-right",class:"statusUnknown"}},push:{CONNECTED:{icon:"long-arrow-left",class:"statusOk"},DISCONNECTED:{icon:"long-arrow-left",class:"statusUnknown"},UNKNOWN:{icon:"long-arrow-left",class:"statusUnknown"},MAINTENANCE:{icon:"wrench",class:"statusAlert"}},device:{MAINTENANCE:{icon:"wrench",class:"statusAlert"}}},mm=function(e,t){var n=c.formatDate(new Date(e),"medium",t.currentLang);return t.instant("Device last request:\n{{date}}",{date:n})},gm={sendStatusConnected:mm,sendStatusDisconnected:"Connection not monitored",pushStatusConnected:"Connection to device established",pushStatusDisconnected:"Connection to device not established (not supported by device or no connectivity)",maintenance:"Device is under maintenance"};(rm=e.PushStatusLabels||(e.PushStatusLabels={}))[rm.CONNECTED="Push connection: active"]="CONNECTED",rm[rm.DISCONNECTED="Push connection: inactive"]="DISCONNECTED",rm[rm.UNKNOWN="Push connection: inactive"]="UNKNOWN",(lm=e.SendStatusLabels||(e.SendStatusLabels={}))[lm.AVAILABLE="Send connection: online"]="AVAILABLE",lm[lm.NOT_MONITORED="Send connection: not monitored"]="NOT_MONITORED",lm[lm.UNAVAILABLE="Send connection: offline"]="UNAVAILABLE",lm[lm.UNKNOWN="Send connection status unknown"]="UNKNOWN",lm[lm.MAINTENANCE="Device is under maintenance"]="MAINTENANCE";var hm,fm=function(){function n(e){this.translateService=e}return Object.defineProperty(n.prototype,"node",{set:function(e){this._mo=e.mo||e},enumerable:!0,configurable:!0}),n.prototype.get=function(){return this._mo},n.prototype.ngOnChanges=function(){this.setStatusProperites()},n.prototype.ngAfterContentInit=function(){this.setStatusProperites()},n.prototype.setStatusProperites=function(){this.requiredAvailability=o.get(this._mo,"c8y_RequiredAvailability"),this.availabilityStatus=o.get(this._mo,"c8y_Availability.status"),this.pushStatus=o.get(this._mo,"c8y_Connection.status")||"UNKNOWN",this.sendStatus=this.availabilityStatus||(this.requiredAvailability?"UNKNOWN":"NOT_MONITORED")},n.prototype.status=function(){return"MAINTENANCE"===this.availabilityStatus||"MAINTENANCE"===this.pushStatus?this.getMaintenanceStatus():this.getSendPushStatus()},n.prototype.getMaintenanceStatus=function(){return{sendStatus:!1,pushStatus:!1,maintenanceStatus:{icon:pm.device.MAINTENANCE.icon,class:pm.device.MAINTENANCE.class,tooltip:gm.maintenance}}},n.prototype.getSendPushStatus=function(){return{sendStatus:{icon:pm.sendData[this.sendStatus].icon,class:pm.sendData[this.sendStatus].class,status:this.sendStatus,label:e.SendStatusLabels[this.sendStatus],tooltip:this.getSendStatusTooltip(this._mo)},pushStatus:{icon:pm.push[this.pushStatus].icon,class:pm.push[this.pushStatus].class,status:this.pushStatus,label:e.PushStatusLabels[this.pushStatus],tooltip:this.getPushStatusTooltip("CONNECTED"===this.pushStatus)},maintenanceStatus:!1}},n.prototype.getSendStatusTooltip=function(e){var t=e&&e.c8y_Availability,n=t&&t.lastMessage;return n?gm.sendStatusConnected(n,this.translateService):gm.sendStatusDisconnected},n.prototype.getPushStatusTooltip=function(e){return e?gm.pushStatusConnected:gm.pushStatusDisconnected},n.ctorParameters=function(){return[{type:i.TranslateService}]},yc([t.Input("mo")],n.prototype,"node",null),n=yc([t.Component({selector:"device-status",template:'\x3c!-- ATTENTION: keep text format in `tooltip` attribute --\x3e\n<div class="statusContainer"\n title="{{status().sendStatus.tooltip | translate}}\n{{status().pushStatus.tooltip | translate}}"\n placement="left"\n >\n <div\n *ngIf="!!status().sendStatus"\n class="sendStatus"\n [c8yIcon]="status().sendStatus.icon"\n [ngClass]="status().sendStatus.class"\n ></div>\n <div\n *ngIf="!!status().pushStatus"\n class="pushStatus"\n [c8yIcon]="status().pushStatus.icon"\n [ngClass]="status().pushStatus.class"\n >\n </div>\n\n <div *ngIf="!!status().maintenanceStatus"\n class="maintenanceStatus"\n tooltip="{{status().maintenanceStatus.tooltip | translate}}"\n container="body"\n placement="auto"\n [c8yIcon]="status().maintenanceStatus.icon"\n [ngClass]="status().maintenanceStatus.class"></div>\n</div>\n'})],n)}(),ym=function(){function e(){}return e=yc([t.NgModule({imports:[Yu,u.TooltipModule],exports:[fm],declarations:[fm]})],e)}(),vm=function(){function e(){this.title="Upload file",this.message="Drop file here",this.icon="plus-square",this.loadingMessage="Uploading…",this.alwaysShow=!1,this.clickToOpen=!0,this.loading=!1,this.progress=-1,this.dropped=new t.EventEmitter,this.maxAllowedFiles=1/0,this.isOver=!1,this.errors=!1}return e.prototype.ngOnInit=function(){this.alwaysShow=this.alwaysShow||0===this.area.nativeElement.children.length,this.files&&this.files.length>0&&this.onFilesSelected(this.files)},e.prototype.toggle=function(e){this.zone.nativeElement.style.height=this.area.nativeElement.offsetHeight+"px",this.onOver()},e.prototype.showPicker=function(e){this.preventDefault(e),this.picker.nativeElement.value="",this.picker.nativeElement.click()},e.prototype.onOver=function(){this.isOver||(this.isOver=!0,document.addEventListener("dragover",this.preventDefault),document.addEventListener("drop",this.preventDefault))},e.prototype.onPick=function(e){this.errors=!1,this.preventDefault(e),this.onFilesSelected(e.target.files)},e.prototype.onDrop=function(e){this.preventDefault(e),this.onFilesSelected(e.dataTransfer.files),this.stopDragging()},e.prototype.onFilesSelected=function(e){this.files=e,this.filesNameString=this.getFilesNamesAsString(e),this.errors=!1,this.isFilesArrayEmpty()||this.isTooManyFiles()?(this.errors=!0,this.errorMessage="Too many files selected."):this.hasEmptyFiles()?(this.errors=!0,this.errorMessage="File must not be empty, select another one."):this.dropped.emit(this.compose(e))},e.prototype.getFilesNamesAsString=function(e){return o.map(e,(function(e){return e.name})).join(", ")},e.prototype.isFilesArrayEmpty=function(){return 0===o.get(this,"files.length",0)},e.prototype.isTooManyFiles=function(){return o.get(this,"files.length",0)>this.maxAllowedFiles},e.prototype.hasEmptyFiles=function(){var e=!0;return this.isFilesArrayEmpty()||(e=this.isAnyFileEmpty()),e},e.prototype.isAnyFileEmpty=function(){return o.some(Array.from(this.files),["size",0])},e.prototype.shouldShowFilesList=function(){return this.alwaysShow&&!this.isFilesArrayEmpty()&&!this.hasEmptyFiles()&&!this.isTooManyFiles()},e.prototype.stopDragging=function(){document.removeEventListener("dragover",this.preventDefault),document.removeEventListener("drop",this.preventDefault),this.isOver=!1},e.prototype.onDelete=function(){delete this.files,delete this.filesNameString,this.clearErrors(),this.dropped.emit(void 0)},e.prototype.clearErrors=function(){delete this.errorMessage,this.errors=!1},e.prototype.preventDefault=function(e){e&&e.preventDefault()},e.prototype.compose=function(e){var t=this;return Array.from(e).map((function(e){return{file:e,readAsJson:function(){return jc(t,void 0,void 0,(function(){var t,n;return bc(this,(function(a){switch(a.label){case 0:return n=(t=JSON).parse,[4,this.read(e,hm.TEXT)];case 1:return[2,n.apply(t,[a.sent()])]}}))}))},readAsText:function(){return jc(t,void 0,void 0,(function(){return bc(this,(function(t){return[2,this.read(e,hm.TEXT)]}))}))},readAsArrayBuffer:function(){return jc(t,void 0,void 0,(function(){return bc(this,(function(t){return[2,this.read(e,hm.ARRAY_BUFFER)]}))}))},readAsBinaryString:function(){return jc(t,void 0,void 0,(function(){return bc(this,(function(t){return[2,this.read(e,hm.BINARY_STRING)]}))}))},readAsDataURL:function(){return jc(t,void 0,void 0,(function(){return bc(this,(function(t){return[2,this.read(e,hm.DATA_URL)]}))}))}}}))},e.prototype.read=function(e,t){return jc(this,void 0,void 0,(function(){var n=this;return bc(this,(function(a){return[2,new Promise((function(a,s){var o=new FileReader;switch(t){case hm.TEXT:o.readAsText(e);break;case hm.ARRAY_BUFFER:o.readAsArrayBuffer(e);break;case hm.BINARY_STRING:o.readAsBinaryString(e);break;case hm.DATA_URL:o.readAsDataURL(e)}o.onload=function(){return n.onLoad(o,a,s)}}))]}))}))},e.prototype.onLoad=function(e,t,n){2===e.readyState&&(e.error&&n(e.error),t(e.result))},yc([t.Input()],e.prototype,"title",void 0),yc([t.Input()],e.prototype,"message",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"loadingMessage",void 0),yc([t.Input()],e.prototype,"alwaysShow",void 0),yc([t.Input()],e.prototype,"clickToOpen",void 0),yc([t.Input()],e.prototype,"loading",void 0),yc([t.Input()],e.prototype,"progress",void 0),yc([t.Output()],e.prototype,"dropped",void 0),yc([t.Input()],e.prototype,"maxAllowedFiles",void 0),yc([t.Input()],e.prototype,"files",void 0),yc([t.ViewChild("area",{static:!0})],e.prototype,"area",void 0),yc([t.ViewChild("zone",{static:!1})],e.prototype,"zone",void 0),yc([t.ViewChild("picker",{static:!1})],e.prototype,"picker",void 0),e=yc([t.Component({selector:"c8y-drop-area",template:'<div\n class="drop-zone"\n *ngIf="!shouldShowFilesList()"\n [ngClass]="{ \'has-errors\': errors }"\n [style.pointerEvents]="loading ? \'none\' : \'auto\'"\n #zone\n (dragleave)="stopDragging()"\n (drop)="onDrop($event)"\n (dragover)="onOver()"\n [style.display]="isOver || alwaysShow || loading ? \'block\' : \'none\'"\n (click)="showPicker($event)"\n>\n <div class="file-placeholder" [ngClass]="{ \'drag-over\': isOver }">\n <div *ngIf="loading" class="hint-placeholder" style="width: 300px;">\n <p>\n {{ loadingMessage | translate }}\n </p>\n <div class="progress progress-striped active" *ngIf="progress !== -1">\n <div\n class="progress-bar"\n role="progressbar"\n aria-valuenow="0"\n aria-valuemin="0"\n aria-valuemax="100"\n [style.width]="progress + \'%\'"\n ></div>\n </div>\n <div class="spinner" *ngIf="progress === -1" style="position: relative;">\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 <div *ngIf="!loading" class="hint-placeholder pointer">\n <i class="fa fw fa-{{ icon }}"></i>\n <p *ngIf="!errors">\n <b>{{ message | translate }}</b>\n <br />\n <span *ngIf="alwaysShow && clickToOpen" translate>or click to browse your computer.</span>\n </p>\n <div *ngIf="errors" class="has-errors">\n <p class="form-control-feedback-message">\n {{ errorMessage | translate }}\n </p>\n </div>\n </div>\n </div>\n</div>\n\n<div class="drop-zone" *ngIf="shouldShowFilesList()"\n [style.display]="isOver || alwaysShow || loading ? \'block\' : \'none\'">\n <div class="file-placeholder p-4">\n <div class="flex-row p-4">\n <i c8yIcon="file-o" class="m-r-8"></i>\n <span title="{{ filesNameString }}" class="text-truncate">\n {{ filesNameString }}\n </span>\n <button\n title="{{ \'Remove\' | translate }}"\n class="btn btn-clean showOnHover flex-item-right"\n >\n <i c8yIcon="minus-circle" class="text-danger" (click)="onDelete()"></i>\n </button>\n </div>\n </div>\n</div>\n\n<input\n #picker\n *ngIf="clickToOpen"\n (change)="onPick($event)"\n multiple\n type="file"\n style="opacity: 0; filter: alpha(opacity = 0); height: 0px"\n/>\n<div #area [hidden]="isOver || loading" (dragover)="toggle($event)">\n <ng-content></ng-content>\n</div>\n'})],e)}();!function(e){e[e.TEXT=0]="TEXT",e[e.DATA_URL=1]="DATA_URL",e[e.ARRAY_BUFFER=2]="ARRAY_BUFFER",e[e.BINARY_STRING=3]="BINARY_STRING"}(hm||(hm={}));var jm,bm=function(){function e(){}return e=yc([t.NgModule({imports:[Yu],exports:[vm],declarations:[vm]})],e)}(),wm=function(){function e(){this.onFilesPicked=new t.EventEmitter,this.maxAllowedFiles=1/0,this.uploadChoice="uploadBinary"}return e.prototype.ngOnInit=function(){this.fileBinary&&(this.droppedFiles=[this.fileBinary])},e.prototype.onFileDropped=function(e){this.onFilesPicked.emit({droppedFiles:e})},e.prototype.clearInputFromUrl=function(){delete this.fileUrl,this.fileToSave={url:void 0},this.onFilesPicked.emit(this.fileToSave)},e.prototype.clearSelectedFiles=function(){this.dropArea.onDelete(),this.fileToSave={droppedFiles:void 0},this.onFilesPicked.emit(this.fileToSave)},e.prototype.onFileUrlChange=function(e){this.fileToSave={url:e},this.onFilesPicked.emit(this.fileToSave)},yc([t.ViewChild(vm,{static:!0})],e.prototype,"dropArea",void 0),yc([t.Output()],e.prototype,"onFilesPicked",void 0),yc([t.Input()],e.prototype,"maxAllowedFiles",void 0),yc([t.Input()],e.prototype,"uploadChoice",void 0),yc([t.Input()],e.prototype,"fileUrl",void 0),yc([t.Input()],e.prototype,"fileBinary",void 0),e=yc([t.Component({selector:"c8y-file-picker",template:'<div class="form-group">\n <label class="c8y-radio radio-inline">\n <input\n #radio\n type="radio"\n value="uploadBinary"\n name="uploadChoice"\n [(ngModel)]="uploadChoice"\n (click)="clearInputFromUrl()"\n />\n <span></span> <span>{{ \'Upload a binary\' | translate }}</span>\n </label>\n <label class="c8y-radio radio-inline">\n <input\n #radio\n type="radio"\n value="uploadUrl"\n name="uploadChoice"\n [(ngModel)]="uploadChoice"\n (click)="clearSelectedFiles()"\n />\n <span></span> <span>{{ \'Use a URL\' | translate }}</span>\n </label>\n</div>\n\n<div [hidden]="uploadChoice !== \'uploadBinary\'">\n <c8y-form-group class="m-0">\n <c8y-drop-area\n class="drop-area-sm"\n (dropped)="onFileDropped($event)"\n [title]="\'Drop file or click to browse\' | translate"\n [maxAllowedFiles]="maxAllowedFiles"\n [files]="droppedFiles"\n >\n </c8y-drop-area>\n </c8y-form-group>\n</div>\n\n<div [hidden]="uploadChoice !== \'uploadUrl\'">\n <c8y-form-group class="m-0">\n <div class="m-b-4 p-b-8">\n <div class="input-group">\n <span class="input-group-addon">\n <i c8yIcon="globe"></i>\n </span>\n <input\n type="text"\n class="form-control"\n name="fileUrl"\n [(ngModel)]="fileUrl"\n (ngModelChange)="onFileUrlChange($event)"\n placeholder="{{ \'e.g.\' | translate }} http://example.com/binary.zip"\n required\n />\n </div>\n </div>\n </c8y-form-group>\n</div>\n'})],e)}(),Sm=function(){function e(){}return e=yc([t.NgModule({imports:[qd,c.CommonModule,bm,ac.FormsModule,Yu],exports:[wm],declarations:[wm]})],e)}(),Cm=function(){function e(){}return e=yc([t.Component({selector:"c8y-list-group",template:"<ng-content></ng-content>\n\n",host:{class:"c8y-list__group"}})],e)}(),Im=function(){function e(){this.click=new t.EventEmitter}return yc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),yc([t.Input()],e.prototype,"label",void 0),yc([t.Input()],e.prototype,"icon",void 0),yc([t.Output()],e.prototype,"click",void 0),e=yc([t.Component({selector:"c8y-list-item-action, c8y-li-action",template:'<ng-template #template>\n <li>\n <button title="{{ label | translate }}" (click)="click.emit($event)">\n <i [c8yIcon]="icon" *ngIf="icon"></i> \n <span *ngIf="label">{{ label | translate }}</span>\n <ng-content></ng-content>\n </button>\n </li>\n</ng-template>\n'})],e)}(),Pm=function(){function e(){}return yc([t.Input()],e.prototype,"item",void 0),e=yc([t.Component({selector:"c8y-list-item-collapse, c8y-li-collapse",template:"<ng-content></ng-content>\n"})],e)}(),Om=function(){function e(){}return yc([t.Input()],e.prototype,"footer",void 0),e=yc([t.Component({selector:"c8y-list-item-footer, c8y-li-footer",template:'<span *ngIf="footer">{{footer}}</span>\n<ng-content></ng-content>\n'})],e)}(),xm=function(){function e(e){this.element=e,this.active=!1,this.collapsed=!0,this.collapsedChange=new t.EventEmitter,this.showFooter=!1,this.showActions=!1,this.showCollapse=!1,this.dropdownUp=!1,this.pulse$=new a.Subject,this.destroy$=new a.Subject,this.ACTION_ITEM_HEIGHT=40}return e.prototype.ngOnInit=function(){var e=this;this.pulse$.pipe(s.filter((function(e){return!!e})),s.tap((function(){return e.element.nativeElement.classList.remove("c8y-list--pulse")})),s.delay(100),s.tap((function(){return e.element.nativeElement.classList.add("c8y-list--pulse")})),s.takeUntil(this.destroy$)).subscribe()},e.prototype.ngAfterContentChecked=function(){this.actions=this.itemActions.toArray(),this.showFooter=null!=this.itemFooter,this.showActions=this.itemActions.length>0,this.showCollapse=null!=this.itemCollapse},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.prototype.showDropdownUp=function(){var e=this.element.nativeElement.getBoundingClientRect();this.dropdownUp=e.bottom+this.itemActions.length*this.ACTION_ITEM_HEIGHT>window.innerHeight},e.prototype.toggleCollapsed=function(){this.collapsed=!this.collapsed,this.collapsedChange.emit(this.collapsed)},e.prototype.pulse=function(){this.pulse$.next(!0)},e.ctorParameters=function(){return[{type:t.ElementRef}]},yc([t.Input(),t.HostBinding("class.active")],e.prototype,"active",void 0),yc([t.Input()],e.prototype,"collapsed",void 0),yc([t.Output()],e.prototype,"collapsedChange",void 0),yc([t.ContentChild(Om,{static:!1})],e.prototype,"itemFooter",void 0),yc([t.ContentChildren(Im)],e.prototype,"itemActions",void 0),yc([t.ContentChild(Pm,{static:!1})],e.prototype,"itemCollapse",void 0),e=yc([t.Component({selector:"c8y-list-item, c8y-li",template:'<div [ngClass]="{ \'expanded\': !collapsed }">\n <div class="c8y-list__item__block">\n <ng-content select="c8y-list-item-radio, c8y-li-radio"></ng-content>\n <ng-content select="c8y-list-item-checkbox, c8y-li-checkbox"></ng-content>\n\n <ng-content select="c8y-list-item-icon, c8y-li-icon"></ng-content>\n\n <div class="c8y-list__item__body text-truncate-wrap">\n <ng-content select="c8y-list-item-body, c8y-li-body"></ng-content>\n <ng-content></ng-content>\n <div class="c8y-list__item__footer" *ngIf="showFooter">\n <ng-content select="c8y-list-item-footer, c8y-li-footer"></ng-content>\n </div>\n </div>\n\n <div class="c8y-list__item__actions" *ngIf="showCollapse || showActions">\n <button\n class="collapse-btn"\n title="{{ \'Expand\' | translate }}"\n type="button"\n (click)="toggleCollapsed()"\n [attr.aria-expanded]="!collapsed"\n *ngIf="showCollapse"\n >\n <i [c8yIcon]="\'chevron-down\'"></i>\n </button>\n <div\n class="dropdown"\n dropdown\n [dropup]="dropdownUp"\n *ngIf="showActions"\n (onShown)="showDropdownUp()"\n >\n <button\n class="dropdown-toggle c8y-dropdown"\n dropdownToggle\n title="{{ \'Actions\' | translate }}"\n type="button"\n aria-haspopup="true"\n >\n <i [c8yIcon]="\'ellipsis-v\'"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <ng-content select="c8y-list-item-action, c8y-li-action"></ng-content>\n <ng-container *ngFor="let action of actions">\n <ng-container *ngTemplateOutlet="action.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n\n <ng-content select="c8y-list-item-action, c8y-li-action" *ngIf="showActions"></ng-content>\n </div>\n </div>\n\n <div *ngIf="showCollapse" [collapse]="collapsed" [isAnimated]="true">\n <div class="c8y-list__item__collapse--container">\n <ng-content select="c8y-list-item-collapse, c8y-li-collapse"></ng-content>\n </div>\n </div>\n</div>\n',host:{class:"c8y-list__item"}})],e)}(),Em=function(){function e(){}return yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"status",void 0),e=yc([t.Component({selector:"c8y-list-item-icon, c8y-li-icon",template:'<i [c8yIcon]="icon" [ngClass]="status" *ngIf="icon"></i>\n<ng-content></ng-content>',host:{class:"c8y-list__item__icon"}})],e)}(),km=function(){function e(){}return yc([t.Input()],e.prototype,"body",void 0),e=yc([t.Component({selector:"c8y-list-item-body, c8y-li-body",template:'<span *ngIf="body">{{body}}</span>\n<ng-content></ng-content>\n'})],e)}(),Tm=function(){function e(){this.selected=!1,this.onSelect=new t.EventEmitter}return e.prototype.ngOnChanges=function(e){e.selected&&!e.selected.firstChange&&this.onSelect.emit(e.selected.currentValue)},yc([t.Input()],e.prototype,"selected",void 0),yc([t.Output()],e.prototype,"onSelect",void 0),e=yc([t.Component({selector:"c8y-list-item-checkbox, c8y-li-checkbox",template:'<label class="c8y-checkbox">\n <input\n type="checkbox"\n [checked]="selected"\n (change)="onSelect.emit($event.target.checked); (false)"\n />\n <span></span>\n</label>\n<ng-content></ng-content>\n',host:{class:"c8y-list__item__check"}})],e)}(),Am=function(){function e(){this.selected=!1,this.name="list_item_radio",this.disabled=!1,this.onSelect=new t.EventEmitter}return e.prototype.ngOnChanges=function(e){e.selected&&!e.selected.firstChange&&this.onSelect.emit(e.selected.currentValue)},e.prototype.reset=function(){this.radio.nativeElement.checked=!1},yc([t.ViewChild("radio",{static:!0})],e.prototype,"radio",void 0),yc([t.Input()],e.prototype,"selected",void 0),yc([t.Input()],e.prototype,"name",void 0),yc([t.Input()],e.prototype,"disabled",void 0),yc([t.Output()],e.prototype,"onSelect",void 0),e=yc([t.Component({selector:"c8y-list-item-radio, c8y-li-radio",template:'<label class="c8y-radio">\n <input\n #radio\n type="radio"\n [name]="name"\n [checked]="selected"\n (change)="onSelect.emit($event.target.checked); (false)"\n [disabled]="disabled"\n />\n <span></span>\n</label>\n<ng-content></ng-content>\n',host:{class:"c8y-list__item__radio"}})],e)}(),_m=function(){function e(){}return e=yc([t.NgModule({imports:[Yu,ec.CollapseModule.forRoot(),tc.BsDropdownModule],declarations:[Cm,xm,Em,km,Om,Im,Pm,Tm,Am],exports:[Cm,xm,Em,km,Om,Im,Pm,Tm,Am]})],e)}(),Nm=function(){function e(){}return Object.defineProperty(e.prototype,"active",{get:function(){return!!this.service&&this.service.active},enumerable:!0,configurable:!0}),e.prototype.toggle=function(){this.service&&(this.active?this.service.stop():this.service.start())},yc([t.Input()],e.prototype,"service",void 0),e=yc([t.Component({selector:"c8y-realtime-btn",template:'<button\n type="button"\n class="btn btn-link c8y-realtime"\n title="{{ \'Toggle realtime\' | translate }}"\n (click)="toggle()"\n>\n <span class="c8y-pulse" [ngClass]="{ active: active, inactive: !active }"></span>\n <span translate>Realtime</span>\n</button>\n'})],e)}(),Dm=function(){function e(){}return e=yc([t.NgModule({imports:[Yu],declarations:[Nm],exports:[Nm]})],e)}();(jm=e.ModalSelectionMode||(e.ModalSelectionMode={})).SINGLE="single",jm.MULTI="multi";var Mm,Lm=function(){function n(n){var o=this;this.bsModalRef=n,this.subTitle="Select from the list of items matching the device type",this.mode=e.ModalSelectionMode.MULTI,this.disableSelected=!0,this.showFilter=!0,this.areMoreEntries=!1,this.result=new t.EventEmitter,this.search=new t.EventEmitter,this.selected=!1,this.filterTerm="",this.listItems=[],this.debouncer=new a.Subject,this._labels={ok:"Confirm",cancel:"Cancel"},this.debouncer.pipe(s.debounceTime(500)).subscribe((function(e){o.search.emit(e)}))}return Object.defineProperty(n.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e||{},n=t.ok,a=void 0===n?this.labels.ok:n,s=t.cancel,o=void 0===s?this.labels.cancel:s;this._labels={ok:a,cancel:o}},enumerable:!0,configurable:!0}),n.prototype.ngOnChanges=function(e){return jc(this,void 0,void 0,(function(){var t,n,a=this;return bc(this,(function(s){switch(s.label){case 0:return e.items&&e.items.currentValue?(t=e.items.currentValue.map((function(e){return jc(a,void 0,void 0,(function(){var t,n;return bc(this,(function(a){switch(a.label){case 0:return t=e,[4,e.options];case 1:return t.options=a.sent(),(n=e.options.find((function(e){return e.selected})))&&(e.selectedId=n.obj.id,this.disableSelected&&e.options.map((function(e){return o.assign(e,{disabled:!0})}))),[2,e]}}))}))})),n=this,[4,Promise.all(t)]):[3,2];case 1:n.listItems=s.sent(),s.label=2;case 2:return[2]}}))}))},n.prototype.updatePipe=function(e){this.debouncer.next(e),this.filterTerm=e},n.prototype.updateChoice=function(e){var t=e.item,n=e.id;"single"===this.mode&&this.listItems.map((function(e){return e.selectedId=void 0})),t.selectedId=n,this.selected=!0},n.prototype.dismiss=function(){this.bsModalRef.hide()},n.prototype.select=function(){var e=this.getOutput(),t="single"===this.mode?e[0]:e;this.result.emit(t),this.bsModalRef.hide()},n.prototype.ngOnDestroy=function(){this.debouncer.complete(),this.result.complete(),this.search.complete()},n.prototype.getOutput=function(){return this.listItems.filter((function(e){return e.selectedId})).map((function(e){return e.options.find((function(t){return e.selectedId===t.obj.id}))})).map((function(e){return e.obj}))},n.ctorParameters=function(){return[{type:dc.BsModalRef}]},yc([t.Input()],n.prototype,"icon",void 0),yc([t.Input()],n.prototype,"title",void 0),yc([t.Input()],n.prototype,"subTitle",void 0),yc([t.Input()],n.prototype,"items",void 0),yc([t.Input()],n.prototype,"mode",void 0),yc([t.Input()],n.prototype,"disableSelected",void 0),yc([t.Input()],n.prototype,"showFilter",void 0),yc([t.Input()],n.prototype,"areMoreEntries",void 0),yc([t.Input()],n.prototype,"labels",null),yc([t.Output()],n.prototype,"result",void 0),yc([t.Output()],n.prototype,"search",void 0),n=yc([t.Component({selector:"c8y-select-modal",template:'<div class="viewport-modal">\n <div class="modal-header dialog-header">\n <span c8yIcon="{{ icon }}"></span>\n <h4 class="text-uppercase">\n {{ title | translate }}\n </h4>\n </div>\n <div class="p-16 text-center separator-bottom">\n <p class="m-b-8">{{ subTitle | translate }}</p>\n <c8y-filter *ngIf="showFilter" [icon]="\'search\'" (onSearch)="updatePipe($event)"></c8y-filter>\n </div>\n <div class="modal-inner-scroll">\n <div class="p-l-16 p-r-16">\n <div class="panel m-t-8 m-b-8" *ngIf="!items || items.length === 0">\n <div class="c8y-empty-state text-left">\n <h1 c8yIcon="{{ icon }} " class="c8y-icon-duocolor"></h1>\n <p translate>No items to display.</p>\n </div>\n </div>\n </div>\n <c8y-list-group>\n <c8y-li *ngFor="let item of listItems | selectModalFilterPipe: filterTerm">\n <c8y-li-icon>\n <i c8yIcon="{{ icon }}"></i>\n </c8y-li-icon>\n\n <c8y-li-body class="content-flex-30">\n <div class="col-9">\n <div *ngFor="let bodyPart of item.body" [ngClass]="bodyPart.class">\n <c8y-highlight\n [title]="bodyPart.value"\n [pattern]="filterTerm"\n [text]="bodyPart.value"\n ></c8y-highlight>\n </div>\n </div>\n\n <div class="col-3 text-right" *ngIf="item.additionalInformation">\n <div [ngClass]="item.additionalInformation.class">\n {{ item.additionalInformation.value }}\n </div>\n </div>\n </c8y-li-body>\n\n <c8y-li-collapse>\n <c8y-list-group>\n <c8y-li *ngFor="let option of item.options">\n <c8y-li-radio\n [name]="mode === \'single\' ? \'single\' : item.groupId"\n [selected]="option.selected"\n (onSelect)="updateChoice({ item: item, id: option.obj.id })"\n [disabled]="option.disabled"\n >\n </c8y-li-radio>\n <c8y-li-body class="content-flex-50">\n <div\n *ngFor="let optionPart of option.body; let i = index"\n [ngClass]="optionPart.class"\n >\n <c8y-highlight [pattern]="filterTerm" [text]="optionPart.value"></c8y-highlight>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-list-group>\n </c8y-li-collapse>\n </c8y-li>\n <div *ngIf="areMoreEntries">\n <div class="alert alert-info m-t-16 m-r-8 m-l-8" translate>\n Some entries might not be shown. Try narrowing search criteria.\n </div>\n </div>\n </c8y-list-group>\n </div>\n\n <div class="modal-footer">\n <button\n title="{{ labels.cancel | translate }}"\n *ngIf="labels.cancel"\n class="btn btn-default"\n (click)="dismiss()"\n >\n {{ labels.cancel | translate }}\n </button>\n <button\n title="{{ labels.ok | translate }}"\n class="btn btn-primary"\n (click)="select()"\n [disabled]="!selected"\n >\n {{ labels.ok | translate }}\n </button>\n </div>\n</div>\n'})],n)}(),Rm=function(){function e(){}return e.prototype.transform=function(e,t){var n=this;return 0===t.trim().length?e:e.filter((function(e){return n.extractValues(e).filter((function(e){return n.filterContainString(e,t)})).length>0}))},e.prototype.filterContainString=function(e,t){var n=t.toLowerCase().trim();return e&&e.toLowerCase().indexOf(n)>-1},e.prototype.extractValues=function(e){var t=this,n=[];return e.value&&n.push(e.value),Object.keys(e).forEach((function(a){Array.isArray(e[a])&&e[a].forEach((function(e){return n.concat(t.extractValues(e))})),e[a]instanceof Object&&(n=n.concat(t.extractValues(e[a])))})),n},e=yc([t.Pipe({name:"selectModalFilterPipe"})],e)}(),qm=function(){function e(){}return e=yc([t.NgModule({imports:[tc.BsDropdownModule.forRoot(),Yu,_m,ep,qd],exports:[Lm,Rm],declarations:[Lm,Rm]})],e)}(),$m=function(){function e(){this.placeholder="Select item",this.applyLabel="Apply",this.onChange=new t.EventEmitter,this.textFilter="",this.labelText="",this.isOpen=!1,this.filteredItems=[],this.searchFilter=null,this.sizeToShowFilter=5,this.labelsForSelectAll={all:"All",allFiltered:"All filtered"},this.showAllLabel=!1,this.itemsSelected=new Set,this.stopClicks=!1}return e.prototype.preventClick=function(e){this.stopClicks&&e.stopPropagation(),this.stopClicks=this.isOpen},e.prototype.isOpenChange=function(e){this.isOpen=e,e?(this.updateSelected(),this.searchFilter=null):this.stopClicks=!1},e.prototype.outterSelected=function(e){var t=this.selected,n=function(){return!1};return"function"==typeof t?n=t:Array.isArray(t)&&(n=function(e){return t.indexOf(e)>-1}),n(e)},e.prototype.isSelected=function(e){return this.itemsSelected.has(e)},e.prototype.isAllItemsSelected=function(){return this.itemsSelected.size===this.items.length},e.prototype.isAllFilteredSelected=function(){return this.itemsSelected.size===this.filteredItems.length},e.prototype.applyChanges=function(){var e=Array.from(this.itemsSelected.values());this.onChange.emit(e),this.dropdown.hide()},e.prototype.selectAll=function(e){var t=this;this.filteredItems.forEach((function(n){return t.onChangeItem(e,n)}))},e.prototype.onChangeItem=function(e,t){e?this.itemsSelected.add(t):this.itemsSelected.delete(t)},e.prototype.updateFiltered=function(e){if(e){var t=new RegExp(e,"i");this.filteredItems=this.items.filter((function(e){var n=e.name;return t.test(n)}))}else this.filteredItems=this.items},e.prototype.getSelectAllToggleStatus=function(){var e=this.getLabel(),t=this.isAllSelected();return{label:e,checked:t,indeterminate:!t&&this.itemsSelected.size>0}},e.prototype.ngOnChanges=function(e){this.isOpen||(e.items||e.selected||e.applyLabel)&&(this.updateSelected(),this.updateLabel(),this.showAllLabel=this.isAllItemsSelected())},e.prototype.updateLabel=function(){var e=this,t=this.items.filter((function(t){return e.outterSelected(t)}));"string"==typeof this.selectedLabel?this.labelText=this.selectedLabel:"function"==typeof this.selectedLabel?this.labelText=this.selectedLabel(t):this.labelText=t.map((function(e){return e.name})).join(", ")},e.prototype.updateSelected=function(){var e=this,t=this.itemsSelected,n=this.items;t.clear(),n.forEach((function(n){e.outterSelected(n)&&t.add(n)})),this.filteredItems=n},e.prototype.isAllSelected=function(){return this.getLabel()===this.labelsForSelectAll.allFiltered?this.isAllFilteredSelected():this.isAllItemsSelected()},e.prototype.getLabel=function(){return this.searchFilter?this.labelsForSelectAll.allFiltered:this.labelsForSelectAll.all},yc([t.Input()],e.prototype,"placeholder",void 0),yc([t.Input()],e.prototype,"selectedLabel",void 0),yc([t.Input()],e.prototype,"applyLabel",void 0),yc([t.Input()],e.prototype,"items",void 0),yc([t.Input()],e.prototype,"selected",void 0),yc([t.Output()],e.prototype,"onChange",void 0),yc([t.ViewChild(tc.BsDropdownDirective,{static:!1})],e.prototype,"dropdown",void 0),yc([t.HostListener("click",["$event"])],e.prototype,"preventClick",null),e=yc([t.Component({selector:"c8y-select",template:'<div\n class="c8y-child-assets-selector dropdown fit-h"\n (isOpenChange)="isOpenChange($event)"\n dropdown\n #dropdown\n>\n <button\n type="button"\n class="btn dropdown-toggle c8y-dropdown"\n title="{{ labelText || placeholder | translate }}"\n dropdownToggle\n >\n <span class="text-truncate" *ngIf="labelText">\n <ng-container *ngIf="showAllLabel">{{ \'All\' | translate }}</ng-container>\n <ng-container *ngIf="!showAllLabel">{{ labelText | translate }}</ng-container>\n </span>\n <span class="text-truncate text-muted" *ngIf="!labelText">{{ placeholder | translate }}</span>\n </button>\n\n <ul class="dropdown-menu multiselect-container" *dropdownMenu>\n <li *ngIf="items.length > sizeToShowFilter" class="multiselect-item">\n <div class="input-group input-group-search">\n <input\n type="search"\n class="form-control"\n placeholder="{{ \'Filter\' | translate }}…"\n (keyup)="updateFiltered($event.target.value)"\n [(ngModel)]="searchFilter"\n />\n <span class="input-group-addon">\n <i class="fa fa-search" *ngIf="!textFilter"></i>\n <i class="fa fa-times text-muted" *ngIf="textFilter" (click)="textFilter = \'\'"></i>\n </span>\n </div>\n </li>\n\n <li class="multiselect-item">\n <label\n [title]="getSelectAllToggleStatus().label "\n class="c8y-checkbox input-sm"\n ng-click="vm.toggleSelectAll(); $event.preventDefault()"\n >\n <input\n type="checkbox"\n [checked]="getSelectAllToggleStatus().checked"\n (change)="selectAll($event.target.checked)"\n [indeterminate]="getSelectAllToggleStatus().indeterminate"\n style="margin-top:0;"\n /><span></span> <span span class="label-text ">{{ getSelectAllToggleStatus().label }}</span>\n </label>\n </li>\n\n <li class="multiselect-item-container">\n <ul class="list-unstyled">\n <li class="multiselect-item" *ngFor="let item of filteredItems">\n <label class="c8y-checkbox input-sm text-truncate">\n <input\n type="checkbox"\n [checked]="isSelected(item)"\n (change)="onChangeItem($event.target.checked, item)"\n style="margin-top:0"\n />\n <span></span>\n <span class="label-text " title="{{ item.name | translate }}">{{\n item.name | translate\n }}</span>\n </label>\n </li>\n </ul>\n </li>\n <li class="divider"></li>\n <li>\n <button\n title="{{ applyLabel | translate }}"\n class="btn btn-primary btn-block"\n (click)="applyChanges()"\n >\n {{ applyLabel | translate }}\n </button>\n </li>\n </ul>\n</div>\n'})],e)}(),Fm=function(){function e(){this.required=!1,this.disabled=!1,this.allowFreeEntries=!0,this.displayProperty="name",this.name=this.displayProperty,this.selected={id:null},this.selectedChange=new t.EventEmitter,this.onSearch=new t.EventEmitter,this.KEYCODE_UP=38,this.KEYCODE_DOWN=40,this.KEYCODE_TAB=9,this.KEYCODE_ENTER=13,this.KEYCODE_ESC=27}var n;return n=e,e.prototype.writeValue=function(e){this.selected=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.doBlur=function(){this.onTouched&&this.onTouched()},e.prototype.getDisplayProperty=function(){return o.get(this.selected,this.displayProperty,"")},e.prototype.onShown=function(){this.searchControl.nativeElement.focus()},e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},e.prototype.ngAfterViewInit=function(){var e=this;this.subscription=a.fromEvent(this.searchControl.nativeElement,"keydown").pipe(s.map((function(t){return e.handleKeyboard(t)})),s.filter((function(e){return e})),s.debounceTime(200),s.map((function(e){return e.target.value})),s.distinctUntilChanged()).subscribe((function(t){e.selected={id:null},o.set(e.selected,e.displayProperty,t||""),e.onChange(e.selected),e.selectedChange.emit(e.selected),e.onSearch.emit(t)}))},e.prototype.handleKeyboard=function(e){var t=e.keyCode;if(![this.KEYCODE_ENTER,this.KEYCODE_DOWN,this.KEYCODE_TAB,this.KEYCODE_UP].includes(t))return t===this.KEYCODE_ESC?(e.stopPropagation(),this.dropdown.hide(),void this.searchControl.nativeElement.blur()):(this.dropdown.show(),e);var n=this.list.toArray(),a=o.findIndex(n,(function(e){return e.active}));if(t===this.KEYCODE_ENTER||t===this.KEYCODE_TAB)a>-1&&(e.preventDefault(),n[a].element.nativeElement.click()),this.dropdown.hide(),this.searchControl.nativeElement.blur();else{this.dropdown.show();var s=t===this.KEYCODE_DOWN?1:-1;a>-1&&(n[a].active=!1),n[a+s]&&(n[a+s].active=!0)}},e.prototype.validate=function(e){return this.required&&!this.getDisplayProperty()?{required:!0}:!this.allowFreeEntries&&this.selected&&null===this.selected.id?{notExisting:!0}:null},yc([t.ViewChild("searchControl",{static:!1})],e.prototype,"searchControl",void 0),yc([t.ViewChild("dropdown",{static:!1})],e.prototype,"dropdown",void 0),yc([t.ContentChildren(xm)],e.prototype,"list",void 0),yc([t.Input()],e.prototype,"required",void 0),yc([t.Input()],e.prototype,"disabled",void 0),yc([t.Input()],e.prototype,"allowFreeEntries",void 0),yc([t.Input()],e.prototype,"placeholder",void 0),yc([t.Input()],e.prototype,"displayProperty",void 0),yc([t.Input()],e.prototype,"name",void 0),yc([t.Input()],e.prototype,"selected",void 0),yc([t.Output()],e.prototype,"selectedChange",void 0),yc([t.Output()],e.prototype,"onSearch",void 0),e=n=yc([t.Component({selector:"c8y-typeahead",template:'<div\n class="c8y-child-assets-selector dropdown"\n dropdown\n #dropdown="bs-dropdown"\n [autoClose]="true"\n (onShown)="onShown()"\n [isDisabled]="disabled"\n>\n <div class="input-group input-group-dropdown" dropdownToggle>\n <input\n #searchControl\n type="text"\n class="form-control text-truncate p-r-24"\n [required]="required"\n [ngModel]="selected ? getDisplayProperty() : \'\'"\n [placeholder]="placeholder | translate"\n (blur)="doBlur()"\n [name]="name"\n [disabled]="disabled"\n title="{{ placeholder | translate }}"\n />\n\n <span\n class="label label-info"\n style="position: absolute; right: 40px; top: 10px; z-index: 10;"\n translate\n *ngIf="\n selected\n ? selected.id === null && getDisplayProperty()?.length > 0 && allowFreeEntries\n : false\n "\n >New</span\n >\n\n <span class="input-group-btn">\n <button type="button" class="btn btn-clean" [disabled]="disabled">\n <i class="dropdown-caret"></i>\n </button>\n </span>\n </div>\n\n <c8y-list-group class="dropdown-menu" *dropdownMenu>\n <ng-content select="c8y-li, c8y-list-item, button, a"></ng-content>\n </c8y-list-group>\n</div>\n',providers:[{provide:ac.NG_VALUE_ACCESSOR,multi:!0,useExisting:t.forwardRef((function(){return n}))},{provide:ac.NG_VALIDATORS,useExisting:t.forwardRef((function(){return n})),multi:!0}]})],e)}(),Um=function(){function e(){}return e=yc([t.NgModule({imports:[tc.BsDropdownModule.forRoot(),Yu,_m,qd],exports:[$m,Fm],declarations:[$m,Fm]})],e)}(),Bm=function(){function e(e){this.templateRef=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},yc([t.Input("c8yStepperIcon")],e.prototype,"name",void 0),e=yc([t.Directive({selector:"ng-template[c8yStepperIcon]"})],e)}(),zm=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.disableDefaultIcons={edit:!0,done:!0},n.onStepChange=new t.EventEmitter,n._iconOverrides={},n._stepIndex=new a.Subject,n}var s;return hc(n,e),s=n,n.prototype.ngAfterContentInit=function(){var e=this;this._icons.forEach((function(t){var n=t.name,a=t.templateRef;return e._iconOverrides[n]=a})),this._stepIndexSubscription=this._stepIndex.subscribe((function(t){return e.onStepChange.emit(t)}))},n.prototype.ngOnDestroy=function(){this._stepIndexSubscription&&!this._stepIndexSubscription.closed&&this._stepIndexSubscription.unsubscribe()},n.prototype.getIndicatorType=function(e,t){var n=t;switch(this._getIndicatorType(e,t)){case pc.STEP_STATE.EDIT:this.disableDefaultIcons.edit||(n=pc.STEP_STATE.EDIT);break;case pc.STEP_STATE.DONE:n=this.disableDefaultIcons.done?"_done":pc.STEP_STATE.DONE}return n},n.prototype.setIndex=function(e){this._stepIndex.next(e)},yc([t.Input()],n.prototype,"disableDefaultIcons",void 0),yc([t.Input()],n.prototype,"customClasses",void 0),yc([t.Output()],n.prototype,"onStepChange",void 0),yc([t.ContentChildren(Bm,{descendants:!0})],n.prototype,"_icons",void 0),n=s=yc([t.Component({selector:"c8y-stepper",template:'<ul class="c8y-stepper" [ngClass]="customClasses">\n <li *ngFor="let step of steps; let i = index">\n <c8y-stepper-progress\n [iconOverrides]="_iconOverrides"\n [state]="getIndicatorType(i, step.state)"\n [index]="i"\n [selected]="selectedIndex === i"\n (onStepClicked)="setIndex($event)"\n title="{{ step.label | translate }}"\n [ngClass]="{\'active\': selectedIndex === i}"\n >\n </c8y-stepper-progress>\n <div class="c8y-step__label" title="{{ step.label | translate }}">\n {{ step.label | translate }}\n </div>\n </li>\n</ul>\n<ng-container [ngTemplateOutlet]="selected.content"></ng-container>\n',providers:[{provide:pc.CdkStepper,useExisting:s}]})],n)}(pc.CdkStepper),Gm=function(){function e(){this.onStepClicked=new t.EventEmitter}return e.prototype.stepSelected=function(){this.onStepClicked.emit(this.index)},yc([t.Input()],e.prototype,"iconOverrides",void 0),yc([t.Input()],e.prototype,"index",void 0),yc([t.Input()],e.prototype,"selected",void 0),yc([t.Input()],e.prototype,"state",void 0),yc([t.Output()],e.prototype,"onStepClicked",void 0),e=yc([t.Component({selector:"c8y-stepper-progress",template:'<button\n type="button"\n class="c8y-step"\n [ngClass]="{ active: selected, \'step-done\': state === \'done\' || state === \'_done\' }"\n [ngSwitch]="!!(iconOverrides && iconOverrides[state])"\n (click)="stepSelected()"\n>\n <ng-container *ngSwitchCase="true" [ngTemplateOutlet]="iconOverrides[state]"></ng-container>\n <ng-container *ngSwitchDefault [ngSwitch]="state">\n <span *ngSwitchCase="\'edit\'">\n <span [c8yIcon]="\'edit\'"></span>\n </span>\n <span *ngSwitchCase="\'done\'">\n <span [c8yIcon]="\'check\'"></span>\n </span>\n <span *ngSwitchDefault> {{ index + 1 }} </span>\n </ng-container>\n</button>\n'})],e)}(),Hm=function(){function e(e,n){this.stepper=e,this.step=n,this.pending=!1,this.disabled=!1,this.onCancel=new t.EventEmitter,this.onNext=new t.EventEmitter,this.onBack=new t.EventEmitter,this.onCustom=new t.EventEmitter,this.showBtns={cancel:!1,back:!1,next:!1,custom:!1}}return e.prototype.ngAfterContentInit=function(){var e=this;this.showBtns.cancel=this.onCancel.observers.length>0,this.showBtns.custom=this.onCustom.observers.length>0,this.stepper&&this.stepper.steps&&this.step&&(this.showBtns.back=this.stepper.steps.first!==this.step,this.showBtns.next=this.stepper.steps.last!==this.step),this.step&&this.step.stepControl&&(this.disabled=this.step.stepControl.invalid,this.statusChangeSubscription=this.step.stepControl.statusChanges.subscribe((function(t){e.disabled=e.step.stepControl.invalid})))},e.prototype.ngOnChanges=function(e){e&&e.pending&&(this.disabled=e.pending.currentValue)},e.prototype.ngOnDestroy=function(){this.statusChangeSubscription&&!this.statusChangeSubscription.closed&&this.statusChangeSubscription.unsubscribe()},e.prototype.cancel=function(){this.onCancel.emit()},e.prototype.next=function(){this.onNext.observers.length>0?this.onNext.emit({stepper:this.stepper,step:this.step}):this.stepper.next()},e.prototype.back=function(){this.stepper.selected.completed=!1,this.onBack.observers.length>0?this.onBack.emit({stepper:this.stepper,step:this.step}):this.stepper.previous()},e.prototype.custom=function(){this.onCustom.emit()},e.ctorParameters=function(){return[{type:zm,decorators:[{type:t.Host}]},{type:pc.CdkStep,decorators:[{type:t.Host}]}]},yc([t.Input()],e.prototype,"labels",void 0),yc([t.Input()],e.prototype,"pending",void 0),yc([t.Input()],e.prototype,"disabled",void 0),yc([t.Output()],e.prototype,"onCancel",void 0),yc([t.Output()],e.prototype,"onNext",void 0),yc([t.Output()],e.prototype,"onBack",void 0),yc([t.Output()],e.prototype,"onCustom",void 0),e=yc([t.Component({selector:"c8y-stepper-buttons",template:'<div class="text-center">\n <button *ngIf="showBtns.cancel" (click)="cancel()" type="button" class="btn btn-default">\n <span *ngIf="labels?.cancel; else cancelLabel">{{ labels?.cancel | translate }}</span>\n <ng-template #cancelLabel>\n <span>{{ \'Cancel\' | translate }}</span>\n </ng-template>\n </button>\n <button\n *ngIf="showBtns.back"\n type="button"\n (click)="back()"\n class="btn btn-default"\n [disabled]="pending"\n >\n <span *ngIf="labels?.back; else backLabel">{{ labels?.back | translate }}</span>\n <ng-template #backLabel>\n <span>{{ \'Back\' | translate }}</span>\n </ng-template>\n </button>\n <button\n *ngIf="showBtns.custom"\n (click)="custom()"\n type="button"\n class="btn"\n [ngClass]="{\n \'btn-default\': showBtns.next,\n \'btn-primary\': !showBtns.next,\n \'btn-pending\': pending\n }"\n [disabled]="pending || disabled"\n >\n <span *ngIf="labels?.custom; else customLabel">{{ labels?.custom | translate }}</span>\n <ng-template #customLabel>\n <span>{{ \'Complete\' | translate }}</span>\n </ng-template>\n </button>\n <button\n (click)="next()"\n *ngIf="showBtns.next"\n type="button"\n class="btn btn-primary"\n [ngClass]="{ \'btn-pending\': pending }"\n [disabled]="disabled"\n >\n <span *ngIf="labels?.next; else nextLabel">{{ labels?.next | translate }}</span>\n <ng-template #nextLabel>\n <span>{{ \'Next\' | translate }}</span>\n </ng-template>\n </button>\n</div>\n'}),vc(0,t.Host()),vc(1,t.Host())],e)}(),Vm={displayDefaultIndicatorType:!1},Km=function(){function e(){}return e=yc([t.NgModule({imports:[Yu,pc.CdkStepperModule,u.TooltipModule],declarations:[zm,Bm,Gm,Hm],exports:[zm,pc.CdkStep,Bm,Hm],providers:[{provide:pc.STEPPER_GLOBAL_OPTIONS,useValue:Vm}]})],e)}(),Wm=function(){function e(){this.onDateSelected=new t.EventEmitter}return e.prototype.ngOnInit=function(){this.fgDatePicker=new ac.FormGroup({dateFrom:new ac.FormControl,dateTo:new ac.FormControl})},e.prototype.filter=function(){this.onDateSelected.emit(this.fgDatePicker.value)},e.prototype.clearFilter=function(){this.fgDatePicker.setValue({dateFrom:null,dateTo:null}),this.onDateSelected.emit(null)},yc([t.Output()],e.prototype,"onDateSelected",void 0),e=yc([t.Component({selector:"c8y-date-picker",template:'<form [formGroup]="fgDatePicker">\n <c8y-form-group class="datepicker">\n <input\n formControlName="dateFrom"\n class="form-control"\n placeholder="{{ \'Date from\' | translate }}"\n bsDatepicker\n [bsConfig]="{ customTodayClass: \'today\' }"\n />\n </c8y-form-group>\n <c8y-form-group class="datepicker">\n <input\n formControlName="dateTo"\n class="form-control"\n placeholder="{{ \'Date to\' | translate }}"\n bsDatepicker\n [bsConfig]="{ customTodayClass: \'today\' }"\n />\n </c8y-form-group>\n <button\n *ngIf="fgDatePicker.get(\'dateFrom\').value || fgDatePicker.get(\'dateTo\').value"\n title="{{ \'Apply\' | translate }}"\n type="submit"\n class="btn btn-link"\n (click)="filter()"\n >\n <i c8y-icon="filter"></i>\n {{ \'Apply`filters`\' | translate }}\n </button>\n <button\n *ngIf="fgDatePicker.get(\'dateFrom\').value || fgDatePicker.get(\'dateTo\').value"\n title="{{ \'Clear\' | translate }}"\n type="button"\n class="btn btn-link"\n (click)="clearFilter()"\n >\n <i c8y-icon="times"></i>\n {{ \'Clear`filters`\' | translate }}\n </button>\n</form>\n'})],e)}(),Ym=function(){function e(){}return e=yc([t.NgModule({imports:[qd,c.CommonModule,ac.FormsModule,ac.ReactiveFormsModule,tc.BsDropdownModule.forRoot(),mc.BsDatepickerModule.forRoot(),Yu],exports:[Wm],declarations:[Wm]})],e)}(),Zm=function(){function e(){}var n;return n=e,e.forRoot=function(){return{ngModule:n,providers:Sc(Yu.providers(),Ap.providers())}},e=n=yc([t.NgModule({exports:[Xu,td,rd,id,Lp,Kd,Yu,dm,bm,Cp,Ap,Sd,wp,zd,ep,Um,Dp,ip,qd,ym,Zp,Km,Up,Jp,_m,qm,Sm,Dm,Ym]})],e)}(),Jm=function(){function e(e,t){this.injector=e,this.router=t}return Object.defineProperty(e.prototype,"routerStateSnapshot",{get:function(){return this.router.routerState.snapshot},enumerable:!0,configurable:!0}),e.prototype.resolve=function(e){var t=this,n=this.router.config.find((function(t){return e.routeConfig.path===t.path})).children;return a.from(n||[]).pipe(s.mergeMap((function(n){return a.from(t.getGuards(n)).pipe(s.map((function(n){return n.canActivate(e,t.routerStateSnapshot)})),s.mergeMap((function(e){return a.isObservable(e)?e:e&&"function"==typeof e.then?a.from(e):a.of(e)})),s.tap((function(e){Array.isArray(e)&&(n.tabs=e)})),s.every((function(e){return!!e})),s.filter((function(e){return e})),s.mergeMap((function(){return Array.isArray(n.tabs)?a.from(n.tabs):a.of(n)})),s.map((function(t){return t.label?{label:t.label,icon:t.icon,path:e.url.join("/")+"/"+t.path,priority:t.priority}:void 0})))})),s.filter((function(e){return!!e})),s.toArray())},e.prototype.getGuards=function(e){var t=this,n=(e.canActivate||[]).map((function(e){return t.injector.get(e)}));return e.data&&e.data.showIf&&n.push({canActivate:e.data.showIf}),n},e.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},e=yc([t.Injectable()],e)}();(Mm=e.ViewContext||(e.ViewContext={})).Device="device/:id",Mm.Group="group/:id",Mm.User="users/:id",Mm.Application="applications/:id",Mm.SubscribedApplications="subscribedApplications/:id",Mm.Tenant="tenants/:id";var Xm=function(){function t(){}return t.contextToService=function(e){return t.services.get(e)},t.services=new Map([[e.ViewContext.Device,l.InventoryService],[e.ViewContext.Group,l.InventoryService],[e.ViewContext.User,l.UserService],[e.ViewContext.Application,l.ApplicationService],[e.ViewContext.SubscribedApplications,l.ApplicationService],[e.ViewContext.Tenant,l.TenantService]]),t}(),Qm=function(){function e(e,t,n,s,o){this.tabsResolver=e,this.tabsService=t,this.router=n,this.apiService=s,this.injector=o,this.lastAddedTabs=[],this.refreshTrigger=new a.Subject}return e.prototype.init=function(e){var t=this;this.routerSubscription=this.router.events.pipe(s.filter((function(e){return e instanceof n.NavigationEnd}))).subscribe((function(){return t.redirectToFirstTab()})),this.dataSubscription=e.data.pipe(s.merge(this.updatedContext(e),this.refreshTrigger),s.switchMap((function(){return t.tabsResolver.resolve(e.snapshot)}))).subscribe((function(e){return t.updateTabs(e)}))},e.prototype.destroy=function(){var e=this;this.dataSubscription.unsubscribe(),this.routerSubscription.unsubscribe(),this.lastAddedTabs.forEach((function(t){return e.tabsService.remove(t)}))},e.prototype.refreshContext=function(){this.refreshTrigger.next()},e.prototype.updatedContext=function(e){var t=e.snapshot.data,n=Xm.contextToService(t.context);if(n){var s=this.injector.get(n).getDetailUrl(t.contextData).replace(/\d+/g,"?\\d*"),o=new RegExp(s,"i"),r=new RegExp(s+"/child","i");return this.apiService.hookResponse((function(e){var t=e.url,n=e.method,a=o.test(t)&&["POST","PUT"].includes(n),s=r.test(t)&&["POST","DELETE"].includes(n);return a||s}))}return a.NEVER},e.prototype.updateTabs=function(e){var t=this;void 0===e&&(e=[]),this.lastAddedTabs.forEach((function(e){return t.tabsService.remove(e)})),this.lastAddedTabs=e,e.forEach((function(e){return t.tabsService.add(e)})),this.redirectToFirstTab()},e.prototype.redirectToFirstTab=function(){var e=this;this.needsRedirect()&&this.tabsService.firstTab$.subscribe((function(t){t&&e.router.navigateByUrl(t.path,{replaceUrl:!0})}))},e.prototype.needsRedirect=function(){return 2===this.router.parseUrl(this.router.url).root.children[n.PRIMARY_OUTLET].segments.length},e.ctorParameters=function(){return[{type:Jm},{type:Vc},{type:n.Router},{type:r.ApiService},{type:t.Injector}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(Jm),t.ɵɵinject(Vc),t.ɵɵinject(n.Router),t.ɵɵinject(r.ApiService),t.ɵɵinject(t.INJECTOR))},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"})],e)}(),eg=new t.InjectionToken("RouteFactory"),tg=function(){function e(e,t,n,a){var s=this;this.router=t,this.tabsService=n,this.contextRouteService=a,Ic(e).subscribe((function(e){s.addRoute(e)}))}return e.prototype.refresh=function(){this.contextRouteService.refreshContext()},e.prototype.addRoute=function(e){this.addRoutes(Array.isArray(e)?e:[e])},e.prototype.addRoutes=function(e){var t=this,n=this.router.config.find((function(e){return"**"===e.path}));this.router.resetConfig(Sc(this.router.config.filter((function(e){return"**"!==e.path})),e.map((function(e){return t.convertRoute(t.router.config,e)})),[n]).filter(Boolean))},e.prototype.convertRoute=function(e,t){if(!t.context)return t;e.forEach((function(e){e.data&&e.data.context===t.context&&(e.children=Sc([t],e.children||[]))}))},e.ctorParameters=function(){return[{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[eg]}]},{type:n.Router},{type:Vc},{type:Qm}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(eg,8),t.ɵɵinject(n.Router),t.ɵɵinject(Vc),t.ɵɵinject(Qm))},token:e,providedIn:"root"}),e=yc([t.Injectable({providedIn:"root"}),vc(0,t.Optional()),vc(0,t.Inject(eg))],e)}(),ng=function(){function e(e,t){this.route=e,this.contextRouteService=t}return e.prototype.ngOnInit=function(){this.contextRouteService.init(this.route)},e.prototype.ngOnDestroy=function(){this.contextRouteService.destroy()},e.prototype.refreshTabs=function(){this.contextRouteService.refreshContext()},e.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:Qm}]},e=yc([t.Component({selector:"c8y-context-route",template:"<router-outlet></router-outlet>\n"})],e)}(),ag=function(){function e(e){this.client=e,this.callsSubject=new a.Subject,this.calls=this.callsSubject.asObservable(),this.hookIntoClientFetch()}return e.prototype.hookResponse=function(e){return this.callsSubject.pipe(s.filter((function(e){return"finish"===e.phase})),s.filter(e))},e.prototype.hookRequest=function(e){return this.callsSubject.pipe(s.filter((function(e){return"start"===e.phase})),s.filter(e))},e.prototype.onFinish=function(e){return jc(this,void 0,void 0,(function(){return bc(this,(function(t){return this.callsSubject.next(fc({phase:"finish"},e)),[2]}))}))},e.prototype.onStart=function(e){this.callsSubject.next(fc({phase:"start"},e))},e.prototype.resolveData=function(e){return jc(this,void 0,void 0,(function(){var t,n,a;return bc(this,(function(s){return t=e.response,n=e.method,"data"in t?[2,Promise.resolve({data:t.data,method:n})]:(a=function(e){return{data:e,method:n}},[2,t.clone().json().then(a,a)])}))}))},e.prototype.hookIntoClientFetch=function(){var e=this,t=this.client.fetch.bind(this.client);this.client.fetch=function(n,a){return void 0===a&&(a={method:"GET"}),jc(e,void 0,void 0,(function(){var e,s,o=this;return bc(this,(function(r){return e=a.method,this.onStart({options:a,method:e,url:n}),s=t(n,a),"function"==typeof a.responseInterceptor&&(s=s.then(a.responseInterceptor)),s.then((function(t){return o.onFinish({response:t,url:n,options:a,method:e})}),(function(t){return o.onFinish({response:t,url:n,options:a,method:e})})),[2,s]}))}))}},e.ctorParameters=function(){return[{type:l.FetchClient}]},e=yc([t.Injectable()],e)}(),sg=Object.freeze({__proto__:null,FetchClient:l.FetchClient,BasicAuth:l.BasicAuth,CookieAuth:l.CookieAuth,Realtime:l.Realtime,EventBinaryService:l.EventBinaryService,EventService:l.EventService,InventoryService:l.InventoryService,MeasurementService:l.MeasurementService,AlarmService:l.AlarmService,OperationBulkService:l.OperationBulkService,OperationService:l.OperationService,ApplicationService:l.ApplicationService,UserService:l.UserService,TenantService:l.TenantService,SystemOptionsService:l.SystemOptionsService,TenantOptionsService:l.TenantOptionsService,TenantSecurityOptionsService:l.TenantSecurityOptionsService,TenantLoginOptionsService:l.TenantLoginOptionsService,AuditService:l.AuditService,InventoryRoleService:l.InventoryRoleService,InventoryBinaryService:l.InventoryBinaryService,DeviceRegistrationService:l.DeviceRegistrationService,DeviceRegistrationBulkService:l.DeviceRegistrationBulkService,UserRoleService:l.UserRoleService,UserGroupService:l.UserGroupService,IdentityService:l.IdentityService,TrustedCertificateService:l.TrustedCertificateService});var og=Object.keys(sg).map((function(e){return t=sg[e],n=[l.FetchClient,l.Realtime],t===l.FetchClient&&(n=[l.CookieAuth]),t!==l.BasicAuth&&t!==l.CookieAuth||(n=[]),t===l.Realtime&&(n=[l.FetchClient]),{provide:t,useClass:t,deps:n};var t,n})).concat([{provide:ag,useClass:ag,deps:[l.FetchClient]}]),rg=(function(){function e(){}var n;n=e,e.providers=function(){return og},e.forRoot=function(){return{ngModule:n,providers:og}},e=n=yc([t.NgModule()],e)}(),function(){function e(e){this.injector=e,this.caches=new Map}return e.prototype.canActivate=function(e){var t=e.paramMap.get("id"),n=this.service(e);return this.clearDetailCached(n,t),this.detailCached(n,t).pipe(s.tap((function(t){return e.data=fc({},e.data,{contextData:t})})),s.map((function(){return!0})),s.catchError((function(e){return a.of(!1)})))},e.prototype.service=function(e){var t=Xm.contextToService(e.data.context);return this.injector.get(t)},e.prototype.detailCached=function(e,t){var n=this.getCache(e),o=n[t];if(!o){var r=e instanceof l.InventoryService?{withChildren:!1}:void 0;o=a.from(e.detail(t,r)).pipe(s.map((function(e){return e.data})),s.shareReplay(1)),n[t]=o}return o},e.prototype.clearDetailCached=function(e,t){delete this.getCache(e)[t]},e.prototype.getCache=function(e){var t=this.caches.get(e);return t||(t={},this.caches.set(e,t)),t},e.ctorParameters=function(){return[{type:t.Injector}]},e=yc([t.Injectable()],e)}()),lg=function(){function e(){}return e=yc([t.Component({selector:"empty",template:""})],e)}(),ig=[{path:"users/new",component:lg},{path:"tenants/new",component:lg}];for(var cg in e.ViewContext){var ug=e.ViewContext[cg];ig.push({path:ug,component:ng,canActivate:[rg],data:{context:ug,contextData:{}},resolve:{tabs:Jm}})}var dg=function(){function e(e){}var a;return a=e,e.providers=function(){return[rg,Jm,tg]},e.forRoot=function(){return{ngModule:a,providers:a.providers()}},e.ctorParameters=function(){return[{type:tg}]},e=a=yc([t.NgModule({declarations:[ng,lg],imports:[n.RouterModule.forRoot(ig),Cp,Yu],entryComponents:[ng,lg]})],e)}(),pg=function(){function e(){this.classes=""}return e.prototype.ngOnInit=function(){this.classes="card-block text-center "+o.kebabCase(this.label)},yc([t.Input()],e.prototype,"icon",void 0),yc([t.Input()],e.prototype,"label",void 0),e=yc([t.Component({selector:"c8y-quick-link",template:'<div [class]="classes" title="{{ label | translate }}">\r\n <h1 class="text-gray-darker">\r\n <i [c8yIcon]="icon" class="c8y-icon-duocolor"></i>\r\n </h1>\r\n <p class="text-muted">{{ label | translate }}</p>\r\n</div>\r\n'})],e)}(),mg=function(){function e(){}return e=yc([t.NgModule({declarations:[pg],imports:[Zm],exports:[pg],providers:[]})],e)}(),gg=function(){function e(e){this.realtime=e,this.subjects$=new Map,this.isActive=!0}return Object.defineProperty(e.prototype,"active",{get:function(){return this.isActive},enumerable:!0,configurable:!0}),e.prototype.onAll$=function(e){var t=this,n=this.getSubjectForChannel(e);return n.pipe(s.finalize((function(){1===n.observers.length&&n.observers[0].closed&&(n.stop(),t.subjects$.delete(n.channel))})))},e.prototype.start=function(){this.isActive||(this.subjects$.forEach((function(e){e.start()})),this.isActive=!0)},e.prototype.stop=function(){this.isActive&&(this.subjects$.forEach((function(e){e.stop()})),this.isActive=!1)},e.prototype.onCreate$=function(){return this.onAll$().pipe(s.filter((function(e){return"CREATE"===e.realtimeAction})),s.map((function(e){return e.data})))},e.prototype.onUpdate$=function(e){return this.onAll$(e).pipe(s.filter((function(e){return"UPDATE"===e.realtimeAction})),s.map((function(e){return e.data})))},e.prototype.onDelete$=function(e){return this.onAll$(e).pipe(s.filter((function(e){return"DELETE"===e.realtimeAction})),s.map((function(e){return Xi.coerceNumberProperty(e.data)})))},e.prototype.getIdString=function(e){var t;return t="object"==typeof e?e.id:e,String(t)},e.prototype.getChannel=function(e){return e?this.channel().replace("*",this.getIdString(e)):this.channel()},e.prototype.getSubjectForChannel=function(e){var t,n=this.getChannel(e);return this.subjects$.has(n)?t=this.subjects$.get(n):(t=new hg(n,this.realtime),this.subjects$.set(n,t)),t},e}(),hg=function(e){function t(t,n){var a=e.call(this)||this;return a.realtimeChannel=t,a.realtime=n,a.start(),a}return hc(t,e),Object.defineProperty(t.prototype,"channel",{get:function(){return this.realtimeChannel},enumerable:!0,configurable:!0}),t.prototype.start=function(){var e=this;this.realtimeSubscription||(this.realtimeSubscription=this.realtime.subscribe(this.realtimeChannel,(function(t){var n={channel:t.channel,data:t.data.data,id:t.id,realtimeAction:t.data.realtimeAction};e.next(n)})))},t.prototype.stop=function(){this.realtimeSubscription&&(this.realtime.unsubscribe(this.realtimeSubscription),this.realtimeSubscription=null)},t}(a.Subject),fg=function(e){function n(t){return e.call(this,t)||this}return hc(n,e),n.prototype.channel=function(){return"/bulkOperations/*"},n.ctorParameters=function(){return[{type:l.Realtime}]},n=yc([t.Injectable()],n)}(gg),yg=function(e){function n(t){return e.call(this,t)||this}return hc(n,e),n.prototype.channel=function(){return"/managedobjects/*"},n.ctorParameters=function(){return[{type:l.Realtime}]},n=yc([t.Injectable()],n)}(gg),vg=function(){};e.ActionBarService=Ac,e.ActionService=Nc,e.AlertService=Mc,e.AppStateService=$c,e.AuthenticationModule=zd,e.BootstrapComponent=Kc,e.BreadcrumbService=Yc,e.C8yStepper=zm,e.C8yStepperButtons=Hm,e.CachedLocaleDictionaryService=au,e.CellRendererContext=Xp,e.CellRendererDefDirective=Qp,e.CommonModule=Yu,e.ConfirmModalComponent=vd,e.ContextRouteComponent=ng,e.CoreModule=Zm,e.DashboardChildActionComponent=Bp,e.DashboardChildChange=Hp,e.DashboardChildComponent=Vp,e.DashboardChildTitleComponent=zp,e.DashboardComponent=Gp,e.DashboardModule=Jp,e.DataGridComponent=im,e.DataGridModule=dm,e.DatePickerComponent=Wm,e.DatePickerModule=Ym,e.DatePipe=Iu,e.DefaultValidationDirective=Pd,e.DeviceStatusComponent=fm,e.DeviceStatusModule=ym,e.DocsModule=Zp,e.DocsService=mp,e.DropAreaComponent=vm,e.DropAreaModule=bm,e.DynamicComponentComponent=Fp,e.DynamicComponentModule=Up,e.DynamicComponentService=$p,e.ES_MAX_TIME_MILLISECONDS=864e13,e.EmptyComponent=lg,e.FilePickerComponent=wm,e.FilePickerModule=Sm,e.FilterInputComponent=Rd,e.FilteringFormRendererContext=tm,e.FilteringFormRendererDefDirective=nm,e.FormGroupComponent=Td,e.FormsModule=qd,e.GuideDocsComponent=Yp,e.GuideHrefDirective=Wp,e.HOOK_ACTION=_c,e.HOOK_ACTION_BAR=Tc,e.HOOK_BREADCRUMB=Wc,e.HOOK_COMPONENT=qp,e.HOOK_COMPONENTS=Rp,e.HOOK_DOCS=pp,e.HOOK_NAVIGATOR_NODES=Bc,e.HOOK_ONCE_ROUTE=eg,e.HOOK_OPTIONS=Rc,e.HOOK_PATTERN_MESSAGES=Xc,e.HOOK_SEARCH=Yd,e.HOOK_TABS=Hc,e.HeaderBarComponent=gp,e.HeaderCellRendererDefDirective=em,e.HeaderModule=Cp,e.HeaderService=Gc,e.HighlightComponent=Xd,e.HumanizeAppNamePipe=xu,e.HumanizePipe=Eu,e.ICON_LIST=Wu,e.InputGroupListComponent=Ad,e.JsonValidationPrettifierDirective=Nd,e.ListGroupComponent=Cm,e.ListGroupModule=_m,e.ListItemComponent=xm,e.ListItemRadioComponent=Am,e.LoginService=ud,e.ManagedObjectRealtimeService=yg,e.MaxValidationDirective=xd,e.MessageDirective=Ed,e.MessagesComponent=kd,e.MinValidationDirective=Od,e.ModalModule=Sd,e.ModalService=bd,e.NavigatorIconComponent=vp,e.NavigatorItemComponent=yp,e.NavigatorNode=Fc,e.NavigatorNodeRoot=Uc,e.NavigatorService=zc,e.NewPasswordComponent=yd,e.OperationBulkRealtimeService=fg,e.OptionsService=qc,e.PasswordCheckListComponent=md,e.PasswordConfirm=gd,e.PasswordConfirmModalComponent=dd,e.PasswordService=pd,e.PasswordStrengthCheckerService=hd,e.PasswordStrengthComponent=fd,e.Permissions=Hu,e.PhoneValidationDirective=Cd,e.PopoverConfirmComponent=wd,e.QuickLinkModule=mg,e.RealtimeMessage=vg,e.RealtimeService=gg,e.RouterModule=dg,e.RouterService=tg,e.SearchModule=ep,e.SearchResultEmptyComponent=Qd,e.SearchService=Zd,e.SelectComponent=$m,e.SelectModalComponent=Lm,e.SelectModalModule=qm,e.SelectModule=Um,e.SmsChallengeComponent=Fd,e.StateService=kc,e.StepperModule=Km,e.TabsService=Vc,e.TextAreaRowHeightDirective=Dd,e.TitleComponent=fp,e.TotpChallengeComponent=$d,e.TotpSetupComponent=Ud,e.TranslateService=Cu,e.TypeaheadComponent=Fm,e.UserMenuService=tp,e.UserTotpRevokeComponent=lp,e.ValidationPattern=Id,e.WidgetsDashboardComponent=Kp,e._=function(e){return e},e.deviceAvailabilityIconMap=pm,e.fromFactories=Ic,e.fromTrigger=Cc,e.getActivatedRoute=Ec,e.gettext=Dc,e.initializeServices=Vu,e.memoize=Gu,e.minColumnGridTrackSize=80,e.operationStatusClasses=$u,e.operationStatusIcons=qu,e.ratiosByColumnTypes=sm,e.resolveInjectedFactories=Pc,e.routes=ig,e.sortByPriority=xc,e.stateToFactory=Oc,e.statusAlert=Ru,e.statusClasses=Lu,e.statusIcons=Mu,e.tooltips=gm,e.ɵ0=mm,e.ɵa=Lc,e.ɵb=cu,e.ɵba=Zu,e.ɵbb=td,e.ɵbc=Qu,e.ɵbd=ed,e.ɵbe=rd,e.ɵbf=ad,e.ɵbg=od,e.ɵbh=nd,e.ɵbi=sd,e.ɵbj=id,e.ɵbk=ld,e.ɵbl=Lp,e.ɵbm=Mp,e.ɵbn=hp,e.ɵbo=cp,e.ɵbp=up,e.ɵbq=Sp,e.ɵbr=ip,e.ɵbs=rp,e.ɵbt=op,e.ɵbu=ap,e.ɵbv=np,e.ɵbw=sp,e.ɵbx=_d,e.ɵby=Md,e.ɵbz=Ld,e.ɵc=uu,e.ɵca=jd,e.ɵcb=Bd,e.ɵcc=Wd,e.ɵcd=Jd,e.ɵce=Kd,e.ɵcf=Vd,e.ɵcg=Gd,e.ɵch=Hd,e.ɵci=wp,e.ɵcj=bp,e.ɵck=jp,e.ɵcl=Ap,e.ɵcm=Op,e.ɵcn=xp,e.ɵco=Ip,e.ɵcp=Pp,e.ɵcq=Ep,e.ɵcr=Tp,e.ɵcs=kp,e.ɵct=Dp,e.ɵcu=Np,e.ɵcv=_p,e.ɵcw=cm,e.ɵcx=um,e.ɵcy=am,e.ɵcz=Om,e.ɵd=du,e.ɵda=Im,e.ɵdb=Pm,e.ɵdc=Em,e.ɵdd=km,e.ɵde=Tm,e.ɵdf=Bm,e.ɵdg=Gm,e.ɵdh=Rm,e.ɵdi=Dm,e.ɵdj=Nm,e.ɵdl=Qm,e.ɵdm=Jm,e.ɵdn=rg,e.ɵdo=pg,e.ɵe=pu,e.ɵf=gu,e.ɵg=lu,e.ɵh=nu,e.ɵi=Jc,e.ɵj=Zc,e.ɵk=su,e.ɵl=ru,e.ɵm=eu,e.ɵn=Qc,e.ɵo=ku,e.ɵp=Tu,e.ɵq=_u,e.ɵr=Du,e.ɵs=Ou,e.ɵt=Pu,e.ɵu=Au,e.ɵv=Nu,e.ɵw=Fu,e.ɵx=zu,e.ɵy=Xu,e.ɵz=Ju,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
17
17
|
//# sourceMappingURL=c8y-ngx-components.umd.min.js.map
|