UNPKG

@stratio/egeo

Version:

Stratio egeo library of components in Angular 2

2 lines 166 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/core"),require("rxjs/BehaviorSubject"),require("rxjs/Subject"),require("lodash/index"),require("rxjs/Observable"),require("rxjs/add/operator/map"),require("@angular/forms"),require("@angular/router"),require("angular2-virtual-scroll"),require("rxjs/add/operator/debounceTime")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core","rxjs/BehaviorSubject","rxjs/Subject","lodash/index","rxjs/Observable","rxjs/add/operator/map","@angular/forms","@angular/router","angular2-virtual-scroll","rxjs/add/operator/debounceTime"],e):e(t.egeo=t.egeo||{},t.ng.common,t.ng.core,t.Rx,t.Rx,t.lodash,t.Rx,t.Rx.Observable.prototype,t.ng.forms,t.ng.router,t["angular2-virtual-scroll"])}(this,function(t,e,o,n,i,r,s,a,l,c,p){"use strict";function u(t,e){function o(){this.constructor=t}x(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}function h(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s}function d(t){return function(e,o){var n=Reflect.getOwnMetadata(k,e.constructor)||{};n[o]=n.hasOwnProperty(o)&&n[o]||{type:0},n[o].required=!0,void 0!==t&&(n[o].requireCondition=t),Reflect.defineMetadata(k,n,e.constructor)}}function m(t){return function(e,o){var n=Reflect.getOwnMetadata(k,e.constructor)||{};n[o]=n.hasOwnProperty(o)&&n[o]||{type:0},n[o].deprecated=!0,void 0!==t&&(n[o].initialValue=t),Reflect.defineMetadata(k,n,e.constructor)}}function g(t){return function(t){var e=t.prototype.ngOnInit;t.prototype.ngOnInit=void 0!==e?function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];f(t,this),b(t,this),e.apply(this,o)}:function(){f(t,this),b(t,this)}}}function f(t,e){var o=Reflect.getOwnMetadata(k,t);void 0!==o&&Object.keys(o).forEach(function(n){o[n].deprecated&&(void 0!==e[n]?console.warn(O.toDash(t.name)+": field "+n+" is a deprecated field"):o[n].initialValue&&(e[n]=o[n].initialValue))})}function b(t,e){var o=Reflect.getOwnMetadata(k,t);if(void 0!==o){var n=y(Object.keys(o),o,e);O.validateInputs(e,n,t.name)}}function y(t,e,o){return t.reduce(function(t,n){return void 0!==e[n].requireCondition?v(o,e[n].requireCondition)&&t.push(n):e[n].required&&t.push(n),t},[])}function v(t,e){return"function"==typeof t[e]?t[e].apply(t):t[e]}var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])},w={};w.SUCCESS=0,w.WARNING=1,w.ERROR=2,w[w.SUCCESS]="SUCCESS",w[w.WARNING]="WARNING",w[w.ERROR]="ERROR";var C=function(){function t(){}return t}(),_=function(){function t(t,e,o,n,r,s,a){this.id=t,this.title=e,this.message=o,this.severity=n,this.timeout=r,this.extendedTimeout=s,this.link=a,this._readed=!1,this._opacity=0,this._opacityState=new i.Subject,this._removeEvent=new i.Subject}return Object.defineProperty(t.prototype,"opacity",{get:function(){return this._opacityState.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"removeAlertEvent",{get:function(){return this._removeEvent.asObservable()},enumerable:!0,configurable:!0}),t.prototype.notify=function(){this.setVisible(!0)},t.prototype.pauseNotify=function(){this._opacity=1,this._readed=!0,this.clearAnimation(),this.stopLife(),this._opacityState.next(this._opacity)},t.prototype.continueNotify=function(){this.startLife()},t.prototype.cancel=function(){this.setVisible(!1)},t.prototype.setVisible=function(t){var e=this;this.clearAnimation(),this._changeVisibilityInterval=window.setInterval(function(){return e.modifyVisibility(t)},50)},t.prototype.modifyVisibility=function(t){this._opacity+=t?.1:-.1,(this._opacity>=1||this._opacity<=0)&&(this.clearAnimation(),t?this.startLife():this.notifyForRemove()),this._opacityState.next(this._opacity)},t.prototype.notifyForRemove=function(){this._opacityState.complete(),this._removeEvent.next(this),this._removeEvent.complete()},t.prototype.clearAnimation=function(){window.clearInterval(this._changeVisibilityInterval)},t.prototype.stopLife=function(){window.clearTimeout(this._lifeTimeout)},t.prototype.startLife=function(){var t=this,e=this._readed?this.extendedTimeout:this.timeout;this._lifeTimeout=window.setTimeout(function(){return t.setVisible(!1)},e)},t}(),I=function(){function t(){this._alertsList=[],this._nextId=0,this._alertsStream=new n.BehaviorSubject([])}return Object.defineProperty(t.prototype,"alertList",{get:function(){return this._alertsStream.asObservable()},enumerable:!0,configurable:!0}),t.prototype.notifyAlert=function(t,e,o,n,i,r){var s=this;i=void 0!==i?i:5e3,r=void 0!==r?r:4e3;var a=new _(this._nextId,t,e,o,i,r,n);a.removeAlertEvent.subscribe(function(t){return s.onNotifyRemove(t)}),this.insertAlert(a),this._nextId++},t.prototype.insertAlert=function(t){this._alertsList.push(t),this._alertsStream.next(this._alertsList)},t.prototype.onNotifyRemove=function(t){var e=this._alertsList.findIndex(function(e){return e.id===t.id});this._alertsList.splice(e,1),this._alertsStream.next(this._alertsList)},t}();I.decorators=[{type:o.Injectable}],I.ctorParameters=function(){return[]};var O=function(){function t(){}return t.isDefined=function(t){return void 0!==t&&null!==t},t.validateInputs=function(t,e,o){var n=this;e.forEach(function(e){if(!n.isDefined(t[e]))throw new Error(n.toDash(o)+": field "+e+" is a required field")})},t.toDash=function(t){try{return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()}).substring(1)}catch(e){return t}},t}(),k=Symbol("EgeoLibraryMetadata"),S={};S.INFO=0,S.WARNING=1,S.NEUTRAL=2,S[S.INFO]="INFO",S[S.WARNING]="WARNING",S[S.NEUTRAL]="NEUTRAL";var E={};E.COMPACT=0,E.REGULAR=1,E.LARGE=2,E[E.COMPACT]="COMPACT",E[E.REGULAR]="REGULAR",E[E.LARGE]="LARGE";var T={};T.BIG=0,T.MEDIUM=1,T[T.BIG]="BIG",T[T.MEDIUM]="MEDIUM";var P={};P.YES=0,P.NO=1,P.CLOSE=2,P[P.YES]="YES",P[P.NO]="NO",P[P.CLOSE]="CLOSE",t.ɵbm=function(){function t(t){this.cfr=t,this.close=new o.EventEmitter,this.click=new o.EventEmitter}return t.prototype.getModalSize=function(){switch(this.modalConfig.modalWidth){case E.COMPACT:return{"min-width":"700px","max-width":"700px","max-heigth":"500px"};case E.REGULAR:return{"min-width":"950px","max-width":"950px","max-heigth":"500px"};case E.LARGE:return{"min-width":"1240px","max-width":"1240px","min-heigth":"600px","max-heigth":"600px"};default:return{"min-width":"700px","max-width":"700px","max-heigth":"500px"}}},t.prototype.getTitleClass=function(){switch(this.modalConfig.modalType){case S.NEUTRAL:return"st-modal-neutral";case S.INFO:return"st-modal-info";case S.WARNING:return"st-modal-warning";default:return"st-modal-neutral"}},t.prototype.hasContextualTitle=function(){return void 0!==this.modalConfig.contextualTitle&&this.modalConfig.contextualTitle.length>0},Object.defineProperty(t.prototype,"contextualTitle",{get:function(){return this.modalConfig.contextualTitle},enumerable:!0,configurable:!0}),t.prototype.getHeaderHeight=function(){return this.hasContextualTitle()?"90px":"80px"},t.prototype.hasIcon=function(){return this.modalConfig.modalType!==S.NEUTRAL},t.prototype.getIcon=function(){return this.modalConfig.modalType===S.INFO?"icon-info1":this.modalConfig.modalType===S.WARNING?"icon-alert":""},t.prototype.getTitle=function(){return this.modalConfig.modalTitle},t.prototype.hasButtons=function(){return this.modalConfig.buttons&&this.modalConfig.buttons.length>0},t.prototype.getButtonIcon=function(t,e){if(e&&e.icon){if(e.iconLeft&&t)return e.icon;if(!e.iconLeft&&!t)return e.icon}return""},t.prototype.getButtonSubtype=function(t){return t&&t.primary?"subtype1":"subtype2"},t.prototype.getButtons=function(){return r.cloneDeep(this.modalConfig.buttons||[]).reverse()},t.prototype.isMessageModal=function(){return this.modalConfig.message&&this.modalConfig.message.length>0},t.prototype.isComplexMessageModal=function(){return this.modalConfig.html&&this.modalConfig.html.length>0},t.prototype.getHTML=function(){return this.modalConfig.html},Object.defineProperty(t.prototype,"message",{get:function(){return this.modalConfig.message},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mainTextSize",{get:function(){switch(this.modalConfig.mainText){case T.BIG:return"sth-modal-message-big";case T.MEDIUM:return"sth-modal-message-medium";default:return""}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"qaTag",{get:function(){if(this.modalConfig&&this.modalConfig.qaTag)return this.modalConfig.qaTag;throw new Error("[ERROR]: StModal => qa tag is a required field")},enumerable:!0,configurable:!0}),t.prototype.clickButton=function(t,e){this.click.emit(e.response)},t.prototype.closeModal=function(t){this.close.emit(t)},t.prototype.ngOnInit=function(){!this.component||this.modalConfig.html||this.modalConfig.message||this.loadBody()},t.prototype.ngOnDestroy=function(){this.componentRef&&this.componentRef.destroy()},t.prototype.loadBody=function(){if(!this.componentRef){this.target.clear();var t=this.cfr.resolveComponentFactory(this.component);this.componentRef=this.target.createComponent(t),this.bindModalInputs()}},t.prototype.bindModalInputs=function(){for(var t in this.modalConfig.inputs)this.modalConfig.inputs.hasOwnProperty(t)&&(this.componentRef.instance[t]=this.modalConfig.inputs[t]);for(var t in this.modalConfig.outputs)this.modalConfig.outputs.hasOwnProperty(t)&&this.componentRef.instance[t].subscribe(this.modalConfig.outputs[t]);this.componentRef.changeDetectorRef.detectChanges()},t}(),t.ɵbm.decorators=[{type:o.Component,args:[{selector:"st-modal",template:'<div class="st-modal sth-modal"><div class="st-modal-content sth-modal-content" [ngStyle]="getModalSize()"><div class="sth-modal-header st-modal-header" [ngClass]="getTitleClass()" [ngStyle]="{height: getHeaderHeight()}"><div class="st-modal-contextual sth-modal-contextual" *ngIf="hasContextualTitle()">{{contextualTitle}}</div><div class="st-modal-title sth-modal-title"><i *ngIf="hasIcon()" [ngClass]="getIcon()"></i><p id="st-modal-title">{{getTitle()}}</p></div><div (click)="closeModal($event)" class="st-modal-close-button sth-modal-close-button" id="st-modal-close-button"><i class="icon-circle-cross"></i></div></div><div class="st-modal-body sth-modal-body" [ngClass]="mainTextSize"><div *ngIf="isMessageModal()" class="message"><p id="st-modal-message-plain">{{message}}</p></div><div *ngIf="isComplexMessageModal()" [innerHTML]="getHTML()" id="st-modal-message-html"></div><div #stModalBody id="st-modal-message-component"></div><div *ngIf="hasButtons()" class="st-modal-buttons"><st-button *ngFor="let button of getButtons(); let idx = index" [text]="button.label" [leftIcon]="getButtonIcon(true, button)" [rightIcon]="getButtonIcon(false, button)" [qaTag]="\'st-modal-button-\' + idx" [subtypeClass]="getButtonSubtype(button)" [inputType]="button" (onClick)="clickButton(idx, button)"></st-button></div></div></div></div>',styles:[".st-modal{height:100vh;left:0;top:0;position:fixed;width:100%;z-index:999999;display:-webkit-box;display:-ms-flexbox;display:flex}.st-modal-content{-ms-flex-item-align:center;align-self:center;-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-name:fadeIn;animation-name:fadeIn;margin:auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.st-modal-header{width:100%;position:relative;display:-webkit-box;display:-ms-flexbox;display:flex}.st-modal-close-button{position:absolute;right:15px;top:15px}.st-modal-title{-ms-flex-item-align:end;align-self:flex-end;margin:0 0 7px 30px;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow:hidden;text-overflow:ellipsis;max-width:87%}.st-modal-title i{margin-right:10px}.st-modal-title p{text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.st-modal-body{padding:30px 30px 50px 30px}.st-modal-buttons{margin-top:50px;margin-left:auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.st-modal-buttons st-button{margin-left:10px}.st-modal-contextual{height:35px;padding:10px 14px;position:absolute;top:0;left:30px}"],changeDetection:o.ChangeDetectionStrategy.OnPush}]}],t.ɵbm.ctorParameters=function(){return[{type:o.ComponentFactoryResolver}]},t.ɵbm.propDecorators={modalConfig:[{type:o.Input}],close:[{type:o.Output}],click:[{type:o.Output}],component:[{type:o.Input}],target:[{type:o.ViewChild,args:["stModalBody",{read:o.ViewContainerRef}]}]},h([d()],t.ɵbm.prototype,"modalConfig",void 0),t.ɵbm=h([g()],t.ɵbm);var M=function(){function e(t){this._cfr=t,this._containerRef=void 0,this.dynamicModal=void 0}return Object.defineProperty(e.prototype,"container",{set:function(t){this._containerRef=t},enumerable:!0,configurable:!0}),e.prototype.show=function(t,e){var o=this.canCreateModal(t,e);if(o&&o.length>0)throw new Error(o.join(" "));return this.notifyButtonInteraction=new i.Subject,this.createModal(this.createConfig(t),e),this.notifyButtonInteraction.asObservable()},e.prototype.showDeleteConfirmation=function(t,e,o,n,i,r){var s=[{icon:"icon-trash",iconLeft:!0,label:o,primary:!0,response:P.YES},{icon:"icon-circle-cross",iconLeft:!0,label:n,primary:!1,response:P.NO}];return this.show({qaTag:i||"delete-confirmation",modalType:r||S.WARNING,modalWidth:E.COMPACT,mainText:T.BIG,message:t,modalTitle:e,buttons:s})},e.prototype.close=function(){this.destroy()},e.prototype.createModal=function(e,o){var n=this._cfr.resolveComponentFactory(t.ɵbm);n&&(this._containerRef.clear(),this.dynamicModal=this._containerRef.createComponent(n),this.bindVars(e,o))},e.prototype.destroy=function(){this.dynamicModal&&(this.dynamicModal.destroy(),this.dynamicModal=void 0,this.notifyButtonInteraction.next(P.CLOSE),this.notifyButtonInteraction.complete())},e.prototype.bindVars=function(t,e){var o=this;this.dynamicModal.instance.component=e,this.dynamicModal.instance.close.subscribe(function(t){return o.onClose(t)}),this.dynamicModal.instance.click.subscribe(function(e){return o.notify(e,t.closeOnAccept)}),this.dynamicModal.instance.modalConfig=t,this.dynamicModal.changeDetectorRef.detectChanges()},e.prototype.onClose=function(t){this.close()},e.prototype.notify=function(t,e){this.notifyButtonInteraction.next(t),e&&t===P.YES&&this.close()},e.prototype.canCreateModal=function(t,e){var o=[];return this._containerRef||o.push("[ERROR]: StModalService => Cant find container, are you sure you declarate in MAIN APP component in html and typescript?"),void 0!==this.dynamicModal&&o.push("[ERROR]: StModalService => Can't create modal beacause already exists one. Are you sure that you call close method?)"),e||t.message||t.html||o.push("[ERROR]: StModalService => Can't find message, html or component to show in modal"),o},e.prototype.createConfig=function(t){if(void 0===t.qaTag||0===t.qaTag.length)throw new Error("[ERROR]: StModalService => qaTag is a required field");return{inputs:void 0!==t.inputs?t.inputs:{},outputs:void 0!==t.outputs?t.outputs:{},modalTitle:void 0!==t.modalTitle&&t.modalTitle.length>0?t.modalTitle:"DEFAULT TITLE",modalType:void 0!==t.modalType?t.modalType:S.NEUTRAL,modalWidth:void 0!==t.modalWidth?t.modalWidth:E.COMPACT,buttons:void 0!==t.buttons?t.buttons:[],closeOnAccept:void 0===t.closeOnAccept||t.closeOnAccept,mainText:void 0!==t.mainText?t.mainText:T.MEDIUM,message:t.message,html:t.html,contextualTitle:t.contextualTitle,qaTag:t.qaTag}},e}();M.decorators=[{type:o.Injectable}],M.ctorParameters=function(){return[{type:o.ComponentFactoryResolver}]};var D=function(){function t(){}return t.prototype.newPage=function(t,e,o){return this.initItem=1===e?0:o*(e-1),o>=t.length?Object.assign([],t):this.initItem>=t.length?(this.initItem=t.length-(o+1),Object.assign([],r.takeRight(t,o))):(this.lastItem=this.initItem+o,Object.assign([],t.slice(this.initItem,this.lastItem)))},t}();D.decorators=[{type:o.Injectable}],D.ctorParameters=function(){return[]};var A=function(){function t(){}return t.prototype.getKeys=function(t,e,o){return this.searchInDeep(t,e,o)},t.prototype.setKeys=function(t,e){e.forEach(function(e){return r.set(t,e.path,e.resolved)})},t.prototype.translate=function(t,e){var o=this,n=this.getKeys(t,"translate");if(n&&n.length>0){var i=this.extractTranslationKeys(n);return e.get(i).map(function(e){return o.remapObjectWithTranslations(e,n,t)})}return s.Observable.create(function(e){e.next(t),e.complete()})},t.prototype.translateArrayOfKeys=function(t,e){var o=this;return e.get(t).map(function(e){return o.remapArrayWithTranslations(e,t)})},t.prototype.remapArrayWithTranslations=function(t,e){return e.map(function(e){return t[e]?t[e]:e})},t.prototype.remapObjectWithTranslations=function(t,e,o){var n=this,i=r.cloneDeep(o);return(t||r.keys(t).length>0)&&r.forEach(e,function(e,o){r.set(i,e.path,n.getTranslationFromTranslatedKey(t,e))}),i},t.prototype.getTranslationFromTranslatedKey=function(t,e){var o=e&&e.toResolve&&e.toResolve.key?e.toResolve.key:"";return t[o]?t[o]:o},t.prototype.extractTranslationKeys=function(t){return t.map(function(t){return r.values(r.omit(t.toResolve,"translate"))[0]})},t.prototype.searchInDeep=function(t,e,o,n){var i=this;void 0===n&&(n="");var s=[];r.has(t,e)&&(void 0!==o?t[e]===o&&s.push({path:n,toResolve:t}):s.push({path:n,toResolve:t}));var a=0;return r.forEach(t,function(r,l){"object"==typeof r&&(s=s.concat(i.searchInDeep(r,e,o,i.getPath(n,t,a,l)))),a++}),s},t.prototype.getPath=function(t,e,o,n){return t=this.isArray(e)?t+"["+o+"]":""===t?n:t+"."+n},t.prototype.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},t}();A.decorators=[{type:o.Injectable}],A.ctorParameters=function(){return[]};var R=function(){function t(){this.listeners=[]}return t.prototype.notify=function(t,e){for(var o=0,n=this.listeners;o<n.length;o++){(0,n[o])(t,e)}},t.prototype.listen=function(t){this.listeners.push(t)},t}();R.decorators=[{type:o.Injectable}],R.ctorParameters=function(){return[]};var q=function(){function t(){}return t.prototype.transform=function(t,e,o){var n=this;return this.checkParams(e),t&&t.length>0?t.filter(function(t){return n.contains(t,e,o)}):[]},t.prototype.contains=function(t,e,o){return!!(this.isDefined(t)&&this.isString(e)&&this.isString(o)&&this.isString(t[e]))&&t[e].toUpperCase().search(o.toUpperCase())>-1},t.prototype.isDefined=function(t){return void 0!==t&&null!==t},t.prototype.isString=function(t){return this.isDefined(t)&&"string"==typeof t},t.prototype.checkParams=function(t){if(!this.isString(t))throw new Error('PIPE: stFilterList: "field" is a required and string parameter')},t}();q.decorators=[{type:o.Pipe,args:[{name:"stFilterList"}]}],q.ctorParameters=function(){return[]};var N=function(){function t(){}return t.prototype.transform=function(t){return t?Object.keys(t).map(function(e){return{key:e,value:t[e]}}):[]},t}();N.decorators=[{type:o.Pipe,args:[{name:"stObjectToArray"}]}],N.ctorParameters=function(){return[]};var L=function(){function t(){}return t}();L.decorators=[{type:o.NgModule,args:[{imports:[e.CommonModule],declarations:[q,N],exports:[q,N]}]}],L.ctorParameters=function(){return[]};var F=function(){function t(t){this._cd=t,this.showInConsole=!1,this.opacity=0}return t.prototype.ngOnInit=function(){var t=this;this.alert.opacity.subscribe(function(e){return t.changeOpacity(e)}),this.alert.notify(),this.showInConsole&&this.notifyConsole()},t.prototype.enter=function(){this.alert.pauseNotify()},t.prototype.leave=function(){this.alert.continueNotify()},t.prototype.closeAlert=function(){this.alert.cancel()},t.prototype.getIcon=function(){switch(this.alert.severity){case w.ERROR:return"icon-ban";case w.WARNING:return"icon-alert";case w.SUCCESS:return"icon-circle-check";default:return""}},t.prototype.getSeverityColor=function(){switch(this.alert.severity){case w.ERROR:return"sth-alert-box-error";case w.WARNING:return"sth-alert-box-warning";case w.SUCCESS:return"sth-alert-box-success";default:return""}},t.prototype.goTo=function(){window.open(this.alert.link.link)},t.prototype.changeOpacity=function(t){this.opacity=t,this._cd.markForCheck()},t.prototype.notifyConsole=function(){switch(this.alert.severity){case w.ERROR:console.error("ERROR-"+this.alert.title+": "+this.alert.message);break;case w.WARNING:console.warn("WARNING-"+this.alert.title+": "+this.alert.message);break;case w.SUCCESS:console.log("SUCCESS-"+this.alert.title+": "+this.alert.message);break;default:console.error("ERROR: severity not found for "+this.alert.title+": "+this.alert.message)}},t}();F.decorators=[{type:o.Component,args:[{selector:"st-alert-box",template:'<div class="sth-alert-box" [ngClass]="getSeverityColor()" (mouseenter)="enter()" (mouseleave)="leave()" [ngStyle]="{opacity: opacity}"><span class="sth-alert-box-close-button" (click)="closeAlert()"><i class="icon-circle-cross"></i></span><div class="sth-alert-box-ico-type"><i [ngClass]="getIcon()"></i></div><div class="sth-alert-box-message"><header class="sth-alert-box-message-header"><p class="sth-alert-box-message-header-title">{{alert.title}}</p></header><div class="sth-alert-box-message-body"><p>{{alert.message}}</p><footer *ngIf="alert.link" class="sth-alert-box-message-footer"><a (click)="goTo()">{{alert.link.title}}</a></footer></div></div></div>',changeDetection:o.ChangeDetectionStrategy.OnPush}]}],F.ctorParameters=function(){return[{type:o.ChangeDetectorRef}]},F.propDecorators={alert:[{type:o.Input}],showInConsole:[{type:o.Input}]};var B=function(){function t(t,e){this._cd=t,this.alertService=e,this.showInConsole=!1,this.qaTag="st-alert-manager"}return t}();B.decorators=[{type:o.Component,args:[{selector:"st-alerts",template:'<div [attr.id]="qaTag" class="st-alerts"><st-alert-box class="st-alert-box" *ngFor="let alert of (alertService.alertList | async)" [alert]="alert" [showInConsole]="showInConsole"></st-alert-box></div>',styles:[".st-alert-box{margin-top:15px;display:block}.st-alerts{width:288px;position:fixed;right:15px;top:0;z-index:99999}"],changeDetection:o.ChangeDetectionStrategy.OnPush}]}],B.ctorParameters=function(){return[{type:o.ChangeDetectorRef},{type:I}]},B.propDecorators={showInConsole:[{type:o.Input}],qaTag:[{type:o.Input}]};var j=function(){function t(){}return t}();j.decorators=[{type:o.NgModule,args:[{imports:[e.CommonModule],declarations:[B,F],exports:[B]}]}],j.ctorParameters=function(){return[]};var V=function(){function t(){this.options=[],this.select=new o.EventEmitter}return t.prototype.generateCrumbs=function(){return this.options.length<=6?this.options.slice():this.options.slice(0,1).concat(["..."]).concat(this.options.slice(-4))},t.prototype.onSelect=function(t){if(t+1<this.options.length)if(this.options.length<=6||0===t)this.select.emit(t);else{this.options.length-(6-t),this.select.emit(t)}},t}();V.decorators=[{type:o.Component,args:[{selector:"st-breadcrumbs",template:'<ul class="st-breadcrumbs"><ng-content select="st-breadcrumbs-item"></ng-content><div *ngIf="options.length"><st-breadcrumbs-item *ngFor="let item of generateCrumbs(); let last=last; let i = index" (click)="onSelect(i)" [active]="last" [qaTag]="qaTag + \'-\' + i">{{item}}</st-breadcrumbs-item></div></ul>',styles:["ul{list-style:none;margin:0;padding:0}"]}]}],V.ctorParameters=function(){return[]},V.propDecorators={options:[{type:o.Input}],qaTag:[{type:o.Input}],select:[{type:o.Output}]};var z=function(){function t(){}return t}();z.decorators=[{type:o.Component,args:[{selector:"st-breadcrumbs-item",template:'<li class="st-breadcrumbs__item sth-breadcrumbs__item" [ngClass]="{\'last\': active}"><span class="st-breadcrumbs__item--text sth-breadcrumbs__item--text" [attr.id]="qaTag"><ng-content></ng-content></span><span class="st-breadcrumbs__item--arrow sth-breadcrumbs__item--arrow" *ngIf="!active">></span></li>',styles:[".st-breadcrumbs__item{display:inline}.st-breadcrumbs__item--text{cursor:pointer}.last .st-breadcrumbs__item--text{cursor:default;background-color:transparent}.last .st-breadcrumbs__item--arrow{display:none}"]}]}],z.ctorParameters=function(){return[]},z.propDecorators={qaTag:[{type:o.Input}],active:[{type:o.Input}]};var G=function(){function t(){}return t}();G.decorators=[{type:o.NgModule,args:[{imports:[e.CommonModule],exports:[V,z],declarations:[V,z]}]}],G.ctorParameters=function(){return[]};var $=function(){function t(){this.inputType="button",this.isDisabled=!1,this.subtypeClass="default",this.text="Click Me",this.typeClass="btnMain",this.onClick=new o.EventEmitter,this.internalText=""}return t.prototype.ngOnInit=function(){"btnTool"!==this.typeClass&&(this.internalText=this.text)},t.prototype.getButtonTypeClass=function(){if("btnMain"===this.typeClass)switch(this.subtypeClass){case"subtype1":return"button-sq1";case"subtype2":return"button-sq2";case"subtype3":return"button-sq3";case"subtype4":return"button-sq4";default:return"button-sq1"}else if("btnLink"===this.typeClass)if("themeB"===this.themeClass)switch(this.subtypeClass){case"subtype1":return"button-lk3";case"subtype2":return"button-lk4";default:return"button-lk3"}else switch(this.subtypeClass){case"subtype1":return"button-lk1";case"subtype2":return"button-lk2";default:return"button-lk1"}else if("btnTool"===this.typeClass)if("themeB"===this.themeClass)switch(this.subtypeClass){case"subtype1":return"button-rd4";case"subtype2":return"button-rd5";case"subtype3":return"button-rd6";default:return"button-rd4"}else switch(this.subtypeClass){case"subtype1":return"button-rd1";case"subtype2":return"button-rd2";case"subtype3":return"button-rd3";case"subtype4":return"button-rd7";default:return"button-rd1"}return"button-sq1"},t.prototype.onClickEvent=function(t){this.onClick.emit(t)},t}();$.decorators=[{type:o.Component,args:[{selector:"st-button",template:'<button [attr.type]="inputType" class="button" [attr.id]="qaTag" [attr.disabled]="isDisabled ? true : null" [ngClass]="getButtonTypeClass()" (click)="onClickEvent($event)" [title]="text"><i [ngClass]="leftIcon" *ngIf="leftIcon"></i> <span class="st-button__text">{{internalText}}</span> <i [ngClass]="rightIcon" *ngIf="rightIcon"></i></button>'}]}],$.ctorParameters=function(){return[]},$.propDecorators={inputType:[{type:o.Input}],isDisabled:[{type:o.Input}],leftIcon:[{type:o.Input}],qaTag:[{type:o.Input}],rightIcon:[{type:o.Input}],subtypeClass:[{type:o.Input}],text:[{type:o.Input}],themeClass:[{type:o.Input}],typeClass:[{type:o.Input}],onClick:[{type:o.Output}]};var H=function(){function t(){}return t}();H.decorators=[{type:o.NgModule,args:[{imports:[e.CommonModule],declarations:[$],exports:[$]}]}],H.ctorParameters=function(){return[]};var U={provide:l.NG_VALUE_ACCESSOR,useExisting:o.forwardRef(function(){return W}),multi:!0},W=function(){function t(t){this._changeDetectorRef=t,this.change=new o.EventEmitter,this._checked=!1,this._controlValueAccessorChangeFn=function(t){},this.onTouched=function(){}}return Object.defineProperty(t.prototype,"checked",{get:function(){return this._checked},set:function(t){t!==this.checked&&(this._checked=t,this._changeDetectorRef.markForCheck())},enumerable:!0,configurable:!0}),t.prototype.handleClick=function(){this.readonly||this.disabled||(this._checked=!this._checked,this._controlValueAccessorChangeFn(this._checked),this.change.emit({checked:this.checked,value:this.value}))},t.prototype.handleChange=function(t){t.stopPropagation()},t.prototype.writeValue=function(t){this._checked=t},t.prototype.registerOnChange=function(t){this._controlValueAccessorChangeFn=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t,this._changeDetectorRef.markForCheck()},t}();W.decorators=[{type:o.Component,args:[{selector:"st-checkbox",template:'<label class="st-checkbox sth-checkbox" [ngClass]="{\'disabled\' : disabled}"><div class="sth-checkbox-container"><input type="checkbox" [id]="qaTag" [name]="name" [required]="required" [checked]="checked" [disabled]="disabled" [value]="value" [hidden]="true" [readonly]="readonly" (click)="handleClick()" (change)="handleChange($event)"></div><div class="custom-checkbox sth-checkbox-custom" [ngClass]="{\'icon-check2\' : checked}"></div><span class="sth-checkbox-label label"><ng-content></ng-content></span></label>',providers:[U],styles:[".st-checkbox{cursor:pointer}.st-checkbox .label{padding-left:15px}.st-checkbox .custom-checkbox{width:15px;height:15px;display:inline-block;position:relative;top:2px}.st-checkbox .custom-checkbox:before{position:absolute;top:-2px;left:-1px}"],changeDetection:o.ChangeDetectionStrategy.OnPush}]}],W.ctorParameters=function(){return[{type:o.ChangeDetectorRef}]},W.propDecorators={checked:[{type:o.Input}],name:[{type:o.Input}],qaTag:[{type:o.Input}],disabled:[{type:o.Input}],required:[{type:o.Input}],readonly:[{type:o.Input}],value:[{type:o.Input}],change:[{type:o.Output}]};var Q=function(){function t(){}return t}();Q.decorators=[{type:o.NgModule,args:[{imports:[e.CommonModule],declarations:[W],exports:[W]}]}],Q.ctorParameters=function(){return[]};var K=function(){function t(){this.change=new o.EventEmitter}return t.prototype.ngOnInit=function(){if(void 0===this.item)throw new Error("Attribute item is required")},t.prototype.onChangeItem=function(){this.change.emit(this.item)},t}();K.decorators=[{type:o.Component,args:[{selector:"st-dropdown-menu-item",template:'<li tabindex="0" [attr.id]="qaTag + \'item\' + item.value" class="sth-dropdown-menu-item" (click)="onChangeItem()" (keyup.enter)="onChangeItem()"><i *ngIf="item.icon" [ngClass]="item.icon"></i> <span>{{item.label}}</span></li>',styles:["li{padding:7px 14px;cursor:pointer}li span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}li i{padding-right:5px}"]}]}],K.ctorParameters=function(){return[]},K.propDecorators={item:[{type:o.Input}],qaTag:[{type:o.Input}],change:[{type:o.Output}]};var Y=function(){function t(t){this.cd=t,this.active=!1,this.placement="bottom-start",this.emptyListMessage="",this.change=new o.EventEmitter,this.itemsGroup=[]}return t.prototype.ngOnInit=function(){if(void 0===this.items)throw new Error("Attribute items is required");this.checkGroup()},t.prototype.ngOnChanges=function(t){t.items&&this.checkGroup()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout(function(){t.updateWidth()},0)},t.prototype.checkGroup=function(){this.isDropDownGroup(this.items)&&(this.itemsGroup=this.items)},t.prototype.isDropDownGroup=function(t){return t&&t.length>0&&void 0!==t[0].title},t.prototype.onChange=function(t){this.change.emit(t)},t.prototype.onResize=function(t){this.updateWidth()},t.prototype.updateWidth=function(){if(this.buttonElement&&this.buttonElement.nativeElement){var t=this.buttonElement.nativeElement;t.children&&t.children.length>0?this.widthMenu=t.children[0].getBoundingClientRect().width+"px":this.widthMenu=t.getBoundingClientRect().width+"px"}this.cd.markForCheck()},t}();Y.decorators=[{type:o.Component,args:[{selector:"st-dropdown-menu", template:'<st-pop [hidden]="false" [placement]="placement"><div pop-button #buttonId><ng-content></ng-content></div><div pop-content [style.z-index]="9"><div class="sth-dropdown-menu dropdown-menu" *ngIf="active" [ngClass]="{\'active\': active}" [style.minWidth]="widthMenu"><ul *ngIf="!itemsGroup.length" [attr.aria-hidden]="!active" aria-label="submenu"><st-dropdown-menu-item (change)="onChange($event)" *ngFor="let i of items" [item]="i"></st-dropdown-menu-item><div *ngIf="!items || items.length === 0" class="without-results sth-dropdown-menu-without-results" [style.maxWidth]="widthMenu">{{emptyListMessage}}</div></ul><div *ngIf="itemsGroup.length"><ul *ngFor="let item of itemsGroup" [attr.aria-hidden]="!active" aria-label="submenu"><li class="sth-dropdown-menu-parent"><h3><span>{{ item.title }}</span></h3><ul><st-dropdown-menu-item (change)="onChange($event)" *ngFor="let i of item.items" [item]="i"></st-dropdown-menu-item><div *ngIf="!items || !item.items || items.length === 0" class="without-results sth-dropdown-menu-without-results" [style.maxWidth]="widthMenu">{{emptyListMessage}}</div></ul></li></ul></div></div></div></st-pop>',styles:[".dropdown-menu{-webkit-box-shadow:0 3px 2px 0 rgba(1,1,1,.07);box-shadow:0 3px 2px 0 rgba(1,1,1,.07);border:1px solid rgba(1,1,1,.07);padding:7px 0;max-height:265px;overflow:auto;z-index:9}.dropdown-menu.active{display:block}.dropdown-menu li,.dropdown-menu ul{margin:0;padding:0;list-style:none}.dropdown-menu ul h3{padding:7px 14px;margin:10px 0 0 0}.dropdown-menu ul h3 span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dropdown-menu .without-results{padding:15px 10px}"],changeDetection:o.ChangeDetectionStrategy.OnPush}]}],Y.ctorParameters=function(){return[{type:o.ChangeDetectorRef}]},Y.propDecorators={qaTag:[{type:o.Input}],active:[{type:o.Input}],items:[{type:o.Input}],placement:[{type:o.Input}],emptyListMessage:[{type:o.Input}],change:[{type:o.Output}],buttonElement:[{type:o.ViewChild,args:["buttonId"]}],onResize:[{type:o.HostListener,args:["window:resize",["$event"]]}]};var Z=function(){function t(t){this.el=t,this.placement="bottom-start",this.hidden=!0}return t.prototype.ngOnInit=function(){this.calculatePosition()},t.prototype.ngOnChanges=function(t){this.calculatePosition()},t.prototype.calculatePosition=function(){var t=this.el.nativeElement.querySelector("[pop-button]"),e=this.el.nativeElement.querySelector("[pop-content]"),o=t&&t.firstElementChild?t.firstElementChild:void 0;if(o){var n=this.getCoords(o);e.style.position="absolute",e.style.transform="translate3d("+n.x+"px, "+n.y+"px, "+n.z+"px)"}},t.prototype.getCoords=function(t){var e={x:0,y:0,z:0},o=t.getBoundingClientRect();return r.startsWith(this.placement,"top")?(e.y=-1*o.height,e.x="top"===this.placement?e.x=o.width/2:e.x,e.x="top-end"===this.placement?e.x=o.width:e.x):r.startsWith(this.placement,"bottom")&&(e.x="bottom"===this.placement?e.x=o.width/2:e.x,e.x="bottom-end"===this.placement?e.x=o.width:e.x),e},t}();Z.decorators=[{type:o.Component,args:[{selector:"st-pop",template:'<ng-content select="[pop-button]"></ng-content><div [hidden]="hidden"><ng-content select="[pop-content]"></ng-content></div>',changeDetection:o.ChangeDetectionStrategy.OnPush}]}],Z.ctorParameters=function(){return[{type:o.ElementRef}]},Z.propDecorators={placement:[{type:o.Input}],hidden:[{type:o.Input}]};var J=function(){function t(){}return t}();J.decorators=[{type:o.NgModule,args:[{imports:[e.CommonModule],exports:[Z],declarations:[Z],providers:[]}]}],J.ctorParameters=function(){return[]};var X=function(){function t(){}return t}();X.decorators=[{type:o.NgModule,args:[{imports:[e.CommonModule,J],declarations:[Y,K],exports:[Y]}]}],X.ctorParameters=function(){return[]};var tt=function(){function t(t,e,o){this._renderer=t,this._cd=e,this._elementRef=o}return t.prototype.ngOnDestroy=function(){},t.prototype.openElement=function(){var t=this;this.isActive?this.closeElement():(this.isActive=!this.isActive,setTimeout(function(){t.globalListener=t._renderer.listenGlobal("document","click",t.onClickOutside.bind(t)),t.forceClose=t._renderer.listenGlobal("document","stForceClose",t.onForceClose.bind(t))}))},t.prototype.closeElement=function(){this.isActive&&(this.isActive=!this.isActive,this._cd.markForCheck(),void 0!==this.globalListener&&"function"==typeof this.globalListener&&(this.globalListener(),this.forceClose()))},t.prototype.forceCloseOther=function(){var t=new Event("stForceClose",{bubbles:!0});this._renderer.invokeElementMethod(this._elementRef.nativeElement,"dispatchEvent",[t])},t.prototype.onClickOutside=function(t){this._elementRef.nativeElement.contains(t.target)||this.closeElement()},t.prototype.onForceClose=function(t){this.closeElement()},t}();t.ɵm=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.renderer=e,r.cd=n,r.click=new o.EventEmitter,r.change=new o.EventEmitter,r}return u(e,t),e.prototype.ngOnInit=function(){this.checkFirstSelected(),this.findSelected()},e.prototype.ngOnChanges=function(t){t.items&&(this.checkFirstSelected(),this.findSelected())},e.prototype.ngOnDestroy=function(){this.closeElement()},e.prototype.changeOption=function(t){this.active=!this.active,this.updateSelected(t),this.default||(this.button=t.label),this.change.emit(t),this.closeElement()},e.prototype.onClickEvent=function(t){this.openElement(),this.click.emit(!0),t.stopPropagation()},e.prototype.hideMenu=function(t){t&&(t.keyCode&&27!==t.keyCode||t.key&&"Escape"!==t.key)||this.closeElement()},e.prototype.findSelected=function(){if(this.isStDropdownItem(this.items)){var t=this.items.find(function(t){return!0===t.selected});t&&(this.button=t.label,this.cd.markForCheck())}else if(this.items&&this.items.length>0){var e=this.items.map(function(t){return t.items.find(function(t){return!0===t.selected})}).filter(function(t){return void 0!==t});e.length>0&&(this.button=e[0].label,this.cd.markForCheck())}},e.prototype.isStDropdownItem=function(t){if(t&&t.length>0)return void 0===t[0].items},e.prototype.updateSelected=function(t){if(this.isStDropdownItem(this.items)){var e=Object.assign([],this.items.find(function(t){return!0===t.selected}));if(e&&(e.selected=!1),t){var o=Object.assign([],this.items.find(function(e){return e===t}));o&&(o.selected=!0)}}else this.items&&this.items.length>0&&this.items.map(function(e){var o=Object.assign([],e.items.find(function(t){return!0===t.selected}));if(o&&(o.selected=!1),t){var n=Object.assign([],e.items.find(function(e){return e===t}));n&&(n.selected=!0)}})},e.prototype.checkFirstSelected=function(){this.firstSelected&&(this.isStDropdownItem(this.items)?(this.updateSelected(),this.items[0].selected=!0):this.items&&this.items.length>0&&(this.updateSelected(),this.items.map(function(t){t.items[0].selected=!0})))},e}(tt),t.ɵm.decorators=[{type:o.Component,args:[{selector:"st-dropdown",template:'<st-dropdown-menu [items]="items" [attr.id]="qaTag + \'menu\'" (change)="changeOption($event)" [ngClass]="themeClass" class="sth-dropdown-menu" [active]="isActive" [placement]="\'top-start\'"><div class="sth-dropdown-container" [style.width]="width + \'px\'"><button tabindex="0" [style.width]="width + \'px\'" [attr.aria-expanded]="isActive" [attr.id]="qaTag + \'button\'" aria-haspopup="true" class="button sth-dropdown-button" [ngClass]="themeClass" #buttonId (click)="onClickEvent($event)" [disabled]="disabled"><span>{{button}}</span> <i class="icon-arrow4_down"></i></button></div></st-dropdown-menu>',styles:[".sth-dropdown-container{position:relative}.sth-dropdown-container .button{cursor:pointer;padding:0 30px 0 11px;line-height:12px;height:35px;display:block;text-align:left;position:relative;outline:0;width:100%}.sth-dropdown-container .button span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;word-wrap:break-word;display:inline-block;width:100%;padding:11px 0}.sth-dropdown-container .button i{padding-left:20px;position:absolute;top:50%;margin-top:-7px;right:11px;float:right}.sth-dropdown-container .button:disabled{opacity:.5}.sth-dropdown-container .menu{z-index:1000;width:inherit;display:block}"],changeDetection:o.ChangeDetectionStrategy.OnPush}]}],t.ɵm.ctorParameters=function(){return[{type:o.Renderer},{type:o.ChangeDetectorRef},{type:o.ElementRef,decorators:[{type:o.ViewChild,args:["buttonId"]}]}]},t.ɵm.propDecorators={button:[{type:o.Input}],active:[{type:o.Input}],items:[{type:o.Input}],default:[{type:o.Input}],firstSelected:[{type:o.Input}],disabled:[{type:o.Input}],width:[{type:o.Input}],qaTag:[{type:o.Input}],themeClass:[{type:o.Input}],click:[{type:o.Output}],change:[{type:o.Output}],buttonElement:[{type:o.ViewChild,args:["buttonId"]}],hideMenu:[{type:o.HostListener,args:["document:keydown",["$event"]]}]},h([d()],t.ɵm.prototype,"items",void 0),t.ɵm=h([g()],t.ɵm);var et=function(){function t(){}return t}();et.decorators=[{type:o.NgModule,args:[{imports:[e.CommonModule,X],declarations:[t.ɵm],exports:[t.ɵm]}]}],et.ctorParameters=function(){return[]};var ot=function(){function t(t){this.router=t,this.links=[],this.link=new o.EventEmitter}return t.prototype.goToLink=function(t){t.url&&window.open(t.url,"_blank"),t.router&&this.router.navigate([t.router]),this.link.emit(t)},t}();ot.decorators=[{type:o.Component,args:[{selector:"st-footer",template:'<footer class="footer sth-footer"><div class="content"><p class="text sth-footer-text" *ngIf="rightsText">{{ rightsText }}</p><ul class="sth-footer-links links" *ngIf="links.length"><li *ngFor="let link of links; let index = index"><span class="separator">|</span> <span class="link" (click)="goToLink(link)" [attr.id]="qaTag + \'-link-\' + index">{{ link.title }}</span></li></ul></div><div class="logo sth-footer-logo" *ngIf="image"><img [src]="image"></div></footer>',styles:[".footer{width:100%;height:129px;padding:25px 30px}.footer .content{margin-bottom:10px}.footer .text{display:inline-block;margin:0;padding:0}.footer .links{display:inline;list-style:none;margin:0;padding:0}.footer .links li{display:inline-block;cursor:pointer}.footer .links .separator{margin:0 5px}.footer .logo{width:100px;height:45px;margin:0;position:relative}.footer .logo img{width:auto;max-height:100%}"],changeDetection:o.ChangeDetectionStrategy.OnPush}]}],ot.ctorParameters=function(){return[{type:c.Router}]},ot.propDecorators={rightsText:[{type:o.Input}],links:[{type:o.Input}],qaTag:[{type:o.Input}],image:[{type:o.Input}],link:[{type:o.Output}]};var nt=function(){function t(){}return t}();nt.decorators=[{type:o.NgModule,args:[{imports:[e.CommonModule,c.RouterModule],exports:[ot],declarations:[ot],providers:[]}]}],nt.ctorParameters=function(){return[]};var it=function(){function t(){}return t.prototype.ngOnChanges=function(t){"min"in t&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return null==this.min?null:this._validator(t)},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.prototype._createValidator=function(){this._validator=l.Validators.min(parseInt(this.min,0))},t}();it.decorators=[{type:o.Directive,args:[{selector:"[min][formControlName],[min][formControl],[min][ngModel]",providers:[{provide:l.NG_VALIDATORS,useExisting:o.forwardRef(function(){return it}),multi:!0}],host:{"[attr.min]":"min ? min : null"}}]}],it.ctorParameters=function(){return[]},it.propDecorators={min:[{type:o.Input}]};var rt=function(){function t(){}return t.prototype.ngOnChanges=function(t){"max"in t&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return null==this.max?null:this._validator(t)},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.prototype._createValidator=function(){this._validator=l.Validators.max(parseInt(this.max,0))},t}();rt.decorators=[{type:o.Directive,args:[{selector:"[max][formControlName],[max][formControl],[max][ngModel]",providers:[{provide:l.NG_VALIDATORS,useExisting:o.forwardRef(function(){return rt}),multi:!0}],host:{"[attr.max]":"max ? max : null"}}]}],rt.ctorParameters=function(){return[]},rt.propDecorators={max:[{type:o.Input}]};var st=[it,rt],at=function(){function t(){}return t}();at.decorators=[{type:o.NgModule,args:[{declarations:st,exports:st}]}],at.ctorParameters=function(){return[]};var lt={};lt.FOCUS=0,lt.ERROR=1,lt.DISABLED=2,lt[lt.FOCUS]="FOCUS",lt[lt.ERROR]="ERROR",lt[lt.DISABLED]="DISABLED",t.ɵs=function(){function t(){this.label="",this.showTooltipOnClick=!0,this.labelPosition="top"}return t.prototype.getStatusClass=function(){switch(this.status){case lt.DISABLED:return"disabled";case lt.ERROR:return"error";case lt.FOCUS:return"active";default:return""}},t.prototype.onTooltipClick=function(t){t.stopPropagation(),t.preventDefault()},t.prototype.getPositionClass=function(){return"st-form-label__label--"+this.labelPosition+" sth-form-label__label--"+this.labelPosition},t}(),t.ɵs.decorators=[{type:o.Component,args:[{selector:"st-form-label",template:'<label class="sth-form-label" [ngClass]="getStatusClass()" [attr.id]="qaTag" [attr.for]="name"><div class="st-form-label__label" [ngClass]="getPositionClass()"><span>{{label}}</span><st-tooltip *ngIf="contextualHelp" class="st-form-label__tooltip" [text]="contextualHelp" [showOnClick]="showTooltipOnClick" (click)="onTooltipClick($event)" [qaTag]="qaTag + \'-contextual-help\'"><span class="icon-help2"></span></st-tooltip></div><ng-content></ng-content></label>',styles:[".st-form-label__label{vertical-align:top;position:relative;display:inline-block}.st-form-label__label--top{width:100%}.st-form-label__label--left{padding-right:12px;float:left;width:auto}.st-form-label__label--right{padding-left:12px;float:right}.disabled{opacity:.5}.st-form-label__tooltip{display:inline-block;vertical-align:bottom}"],changeDetection:o.ChangeDetectionStrategy.OnPush}]}],t.ɵs.ctorParameters=function(){return[]},t.ɵs.propDecorators={label:[{type:o.Input}],qaTag:[{type:o.Input}],contextualHelp:[{type:o.Input}],status:[{type:o.Input}],name:[{type:o.Input}],showTooltipOnClick:[{type:o.Input}],labelPosition:[{type:o.Input}]},h([d()],t.ɵs.prototype,"qaTag",void 0),t.ɵs=h([g()],t.ɵs);var ct=function(t){function e(e,o,n){var i=t.call(this,o,n,e)||this;return i.elementRef=e,i.renderer=o,i.cd=n,i.text="",i}return u(e,t),e.prototype.openTooltip=function(){this.openElement()},e.prototype.openTooltipOnHover=function(){this.showOnClick||(this.forceCloseOther(),this.isActive=!0)},e.prototype.closeTooltipOnHover=function(){this.showOnClick||(this.isActive=!1)},e.prototype.ngOnDestroy=function(){this.closeElement()},e}(tt);ct.decorators=[{type:o.Component,args:[{selector:"st-tooltip",template:'<span class="st-tooltip"><span class="st-tooltip-content sth-tooltip-content" [ngClass]="{\'on-hover\':!showOnClick, \'on-click\':showOnClick && isActive}" (click)="openTooltip()" (mouseenter)="openTooltipOnHover()" (mouseleave)="closeTooltipOnHover()"><a [attr.id]="qaTag" class="st-tooltip-content-link sth-tooltip-content-link"><ng-content></ng-content></a><span class="st-tooltip-content-text sth-tooltip-content-text">{{text}}</span></span></span>',styles:[".st-tooltip-content{display:block;cursor:pointer;width:100%;float:left}.st-tooltip-content-text{position:absolute;width:100%;max-width:240px;padding:6px;line-height:20px;visibility:hidden;border-radius:0}.st-tooltip-content-text:before{content:'';position:absolute;top:100%;left:12px;width:0;height:0}.st-tooltip-content-text:after{content:'';position:absolute;top:100%;left:13px;width:0;height:0}.st-tooltip-content.on-click .st-tooltip-content-text,.st-tooltip-content:hover.on-hover .st-tooltip-content-text{visibility:visible;opacity:1;bottom:25px;left:0;z-index:999}"],changeDetection:o.ChangeDetectionStrategy.OnPush}]}],ct.ctorParameters=function(){return[{type:o.ElementRef},{type:o.Renderer},{type:o.ChangeDetectorRef}]},ct.propDecorators={text:[{type:o.Input}],showOnClick:[{type:o.Input}],qaTag:[{type:o.Input}]};var pt=function(){function t(){}return t}();pt.decorators=[{type:o.NgModule,args:[{imports:[e.CommonModule],declarations:[ct],exports:[ct]}]}],pt.ctorParameters=function(){return[]};var ut=function(){function t(){}return t}();ut.decorators=[{type:o.NgModule,args:[{imports:[e.CommonModule,pt],declarations:[t.ɵs],exports:[t.ɵs]}]}],ut.ctorParameters=function(){return[]};var ht=function(){function t(){this.form=new l.FormGroup({}),this.model={}}return t.prototype.ngOnInit=function(){var t=this;Object.keys(this.schema.properties).forEach(function(e){var o,n=t.schema.properties[e];n.default&&void 0===t.model[e]&&(t.model[e]=n.default),o=new l.FormControl(t.model[e]||""),t.form.addControl(e,o)})},t.prototype.isRequired=function(t){return t&&this.schema.required&&-1!==this.schema.required.indexOf(t)},t}();ht.decorators=[{type:o.Component,args:[{selector:"st-form",template:'<form [formGroup]="form" novalidate><st-form-field [schema]="property" *ngFor="let property of schema.properties | stObjectToArray" [formControl]="form.controls[property.key]" [required]="isRequired(property.key)" ngDefaultControl></st-form-field></form>',changeDetection:o.ChangeDetectionStrategy.OnPush}]}],ht.ctorParameters=function(){return[]},ht.propDecorators={schema:[{type:o.Input}],form:[{type:o.Input}],model:[{type:o.Input}]},t.ɵw=function(){function t(){this.required=!1,this.formControl=new l.FormControl}return t.prototype.ngOnInit=function(){var t=[];this.type="string"===this.schema.value.type?"text":this.schema.value.type,this.required&&t.push(l.Validators.required),this.schema.value.pattern&&t.push(l.Validators.pattern(this.schema.value.pattern)),this.formControl.validator=l.Validators.compose(t),this.errorMessages||(this.errorMessages={generic:"Error",required:"This field is required",minLength:"The field min length is "+this.schema.value.minLength,maxLength:"The field max length is "+this.schema.value.maxLength,min:"The number has to be higher than "+this.min,max:"The number has to be minor than "+this.max,pattern:"Invalid value"})},t.prototype.writeValue=function(t){this.onChange(t)},t.prototype.registerOnChange=function(t){this.registeredOnChange=t},t.prototype.registerOnTouched=function(t){},t.prototype.onChange=function(t){this.registeredOnChange&&this.registeredOnChange(t)},Object.defineProperty(t.prototype,"min",{get:function(){return this.schema.value.exclusiveMinimum?this.schema.value.minimum+1:this.schema.value.minimum},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"max",{get:function(){return this.schema.value.exclusiveMaximum?this.schema.value.maximum-1:this.schema.value.maximum},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.schema.key},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){re