@hxui/angular
Version:
* * *
1 lines • 163 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("@angular/common"),require("@angular/platform-browser"),require("@angular/animations"),require("lodash"),require("rxjs/index"),require("rxjs/internal/operators"),require("rxjs/operators"),require("@angular/cdk/portal"),require("@angular/cdk/overlay"),require("@angular/forms"),require("moment"),require("@angular/cdk/bidi"),require("@angular/cdk/a11y"),require("array-sort-by"),require("@angular/common/http"),require("@angular/router"),require("@angular/platform-browser/animations")):"function"==typeof define&&define.amd?define("@hxui/angular",["exports","@angular/core","rxjs","@angular/common","@angular/platform-browser","@angular/animations","lodash","rxjs/index","rxjs/internal/operators","rxjs/operators","@angular/cdk/portal","@angular/cdk/overlay","@angular/forms","moment","@angular/cdk/bidi","@angular/cdk/a11y","array-sort-by","@angular/common/http","@angular/router","@angular/platform-browser/animations"],e):e((t.hxui=t.hxui||{},t.hxui.angular={}),t.ng.core,t.rxjs,t.ng.common,t.ng.platformBrowser,t.ng.animations,null,t.rxjs.index,t.rxjs["internal/operators"],t.rxjs.operators,t.ng.cdk.portal,t.ng.cdk.overlay,t.ng.forms,null,t.ng.cdk.bidi,t.ng.cdk.a11y,null,t.ng.common.http,t.ng.router,t.ng.platformBrowser.animations)}(this,function(t,g,l,n,e,i,o,c,s,a,r,h,p,u,d,f,m,y,v,b){"use strict";m=m&&m.hasOwnProperty("default")?m["default"]:m;var x=function(){function t(t){this.el=t}return t.prototype.getContainerElement=function(){return this.el.nativeElement},t.decorators=[{type:g.Directive,args:[{selector:"[hxaToastrContainer]",exportAs:"hxaToastrContainer"}]}],t.ctorParameters=function(){return[{type:g.ElementRef}]},t}(),_=function(){function t(){}return t.decorators=[{type:g.NgModule,args:[{declarations:[x],exports:[x]}]}],t}(),w=function(t,e){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var C=function(){return(C=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function T(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function D(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,s=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(i=s.next()).done;)a.push(i.value)}catch(r){o={error:r}}finally{try{i&&!i.done&&(n=s["return"])&&n.call(s)}finally{if(o)throw o.error}}return a}var I={CENTER_CENTER:0,TOP_CENTER:1,BOTTOM_CENTER:2,TOP_FULL_WIDTH:3,BOTTOM_FULL_WIDTH:4,TOP_LEFT:5,TOP_RIGHT:6,BOTTOM_LEFT:7,BOTTOM_RIGHT:8};I[I.CENTER_CENTER]="CENTER_CENTER",I[I.TOP_CENTER]="TOP_CENTER",I[I.BOTTOM_CENTER]="BOTTOM_CENTER",I[I.TOP_FULL_WIDTH]="TOP_FULL_WIDTH",I[I.BOTTOM_FULL_WIDTH]="BOTTOM_FULL_WIDTH",I[I.TOP_LEFT]="TOP_LEFT",I[I.TOP_RIGHT]="TOP_RIGHT",I[I.BOTTOM_LEFT]="BOTTOM_LEFT",I[I.BOTTOM_RIGHT]="BOTTOM_RIGHT";var k=function(){function t(t,e,n,i,o,s){var a=this;this.toastId=t,this.config=e,this.message=n,this.title=i,this.toastType=o,this.toastRef=s,this._onTap=new l.Subject,this._onAction=new l.Subject,this.toastRef.afterClosed().subscribe(function(){a._onAction.complete(),a._onTap.complete()})}return t.prototype.triggerTap=function(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()},t.prototype.onTap=function(){return this._onTap.asObservable()},t.prototype.triggerAction=function(t){this._onAction.next(t)},t.prototype.onAction=function(){return this._onAction.asObservable()},t}(),O={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,resetTimeoutOnDuplicate:!1,iconClasses:{none:"",error:"is-error",info:"is-info",success:"is-success",warning:"is-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"hx-alert",position:I.TOP_RIGHT,titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},P=new g.InjectionToken("ToastrConfig"),R=function(){function t(t,e){this.component=t,this.injector=e}return t.prototype.attach=function(t,e){return(this._attachedHost=t).attach(this,e)},t.prototype.detach=function(){var t=this._attachedHost;if(t)return this._attachedHost=undefined,t.detach()},Object.defineProperty(t.prototype,"isAttached",{get:function(){return null!=this._attachedHost},enumerable:!0,configurable:!0}),t.prototype.setAttachedHost=function(t){this._attachedHost=t},t}(),S=function(){function t(){}return t.prototype.attach=function(t,e){return this._attachedPortal=t,this.attachComponentPortal(t,e)},t.prototype.detach=function(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=undefined,this._disposeFn&&(this._disposeFn(),this._disposeFn=undefined)},t.prototype.setDisposeFn=function(t){this._disposeFn=t},t}(),z=function(o){function t(t,e,n){var i=o.call(this)||this;return i._hostDomElement=t,i._componentFactoryResolver=e,i._appRef=n,i}return function e(t,e){function n(){this.constructor=t}w(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(t,o),t.prototype.attachComponentPortal=function(t,e){var n,i=this,o=this._componentFactoryResolver.resolveComponentFactory(t.component);return n=o.create(t.injector),this._appRef.attachView(n.hostView),this.setDisposeFn(function(){i._appRef.detachView(n.hostView),n.destroy()}),e?this._hostDomElement.insertBefore(this._getComponentRootNode(n),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(n)),n},t.prototype._getComponentRootNode=function(t){return t.hostView.rootNodes[0]},t}(S),E=function(){function t(t){this._document=t}return t.prototype.ngOnDestroy=function(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)},t.prototype.getContainerElement=function(){return this._containerElement||this._createContainer(),this._containerElement},t.prototype._createContainer=function(){var t=this._document.createElement("div");t.classList.add("overlay-container"),this._document.body.appendChild(t),this._containerElement=t},t.decorators=[{type:g.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:undefined,decorators:[{type:g.Inject,args:[n.DOCUMENT]}]}]},t.ngInjectableDef=g.defineInjectable({factory:function(){return new t(g.inject(n.DOCUMENT))},token:t,providedIn:"root"}),t}(),M=function(){function t(t){this._portalHost=t}return t.prototype.attach=function(t,e){return void 0===e&&(e=!0),this._portalHost.attach(t,e)},t.prototype.detach=function(){return this._portalHost.detach()},t}(),F=function(){function t(t,e,n,i){this._overlayContainer=t,this._componentFactoryResolver=e,this._appRef=n,this._document=i,this._paneElements=new Map}return t.prototype.create=function(t,e){return this._createOverlayRef(this.getPaneElement(t,e))},t.prototype.getPaneElement=function(t,e){return void 0===t&&(t=I.TOP_RIGHT),this._paneElements.get(e)||this._paneElements.set(e,{}),this._paneElements.get(e)[t]||(this._paneElements.get(e)[t]=this._createPaneElement(t,e)),this._paneElements.get(e)[t]},t.prototype._createPaneElement=function(t,e){var n=this._document.createElement("div");return n.id="hxa-toastr-container",n.classList.add("hxa-toastr-container"),n.classList.add("hxui-reset"),n.style.position="fixed",n.style["z-index"]=1e3,t===I.CENTER_CENTER?(n.style.top="50%",n.style.left="50%",n.style.transform="translate(-50%, -50%)"):t===I.TOP_CENTER?(n.style.top="0",n.style.right="0",n.style.width="100%"):t===I.BOTTOM_CENTER?(n.style.bottom="0",n.style.right="0",n.style.width="100%"):t===I.TOP_FULL_WIDTH?(n.style.top="0",n.style.right="0",n.style.width="100%"):t===I.BOTTOM_FULL_WIDTH?(n.style.bottom="0",n.style.right="0",n.style.width="100%"):t===I.TOP_LEFT?(n.style.top="2rem",n.style.left="2rem"):t===I.TOP_RIGHT?(n.style.top="2rem",n.style.right="2rem"):t===I.BOTTOM_RIGHT?(n.style.bottom="2rem",n.style.right="2rem"):t===I.BOTTOM_LEFT&&(n.style.bottom="2rem",n.style.left="2rem"),e?e.getContainerElement().appendChild(n):this._overlayContainer.getContainerElement().appendChild(n),n},t.prototype._createPortalHost=function(t){return new z(t,this._componentFactoryResolver,this._appRef)},t.prototype._createOverlayRef=function(t){return new M(this._createPortalHost(t))},t.decorators=[{type:g.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:E},{type:g.ComponentFactoryResolver},{type:g.ApplicationRef},{type:undefined,decorators:[{type:g.Inject,args:[n.DOCUMENT]}]}]},t.ngInjectableDef=g.defineInjectable({factory:function(){return new t(g.inject(E),g.inject(g.ComponentFactoryResolver),g.inject(g.ApplicationRef),g.inject(n.DOCUMENT))},token:t,providedIn:"root"}),t}(),A=function(){function t(t){this._overlayRef=t,this._afterClosed=new l.Subject,this._activate=new l.Subject,this._manualClose=new l.Subject,this._resetTimeout=new l.Subject}return t.prototype.manualClose=function(){this._manualClose.next(),this._manualClose.complete()},t.prototype.manualClosed=function(){return this._manualClose.asObservable()},t.prototype.timeoutReset=function(){return this._resetTimeout.asObservable()},t.prototype.close=function(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete()},t.prototype.afterClosed=function(){return this._afterClosed.asObservable()},t.prototype.isInactive=function(){return this._activate.isStopped},t.prototype.activate=function(){this._activate.next(),this._activate.complete()},t.prototype.afterActivate=function(){return this._activate.asObservable()},t.prototype.resetTimeout=function(){this._resetTimeout.next()},t}(),L=function(){function t(t,e){this._toastPackage=t,this._parentInjector=e}return t.prototype.get=function(t,e,n){return t===k?this._toastPackage:this._parentInjector.get(t,e,n)},t}(),j=function(){function t(t,e,n,i,o){this.overlay=e,this._injector=n,this.sanitizer=i,this.ngZone=o,this.currentlyActive=0,this.toasts=[],this.index=0,this.toastrConfig=C({},t["default"],t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=C({},t["default"].iconClasses,t.config.iconClasses))}return t.prototype.show=function(t,e,n,i){return void 0===n&&(n={}),void 0===i&&(i=""),this._preBuildNotification(i,t,e,this.applyConfig(n))},t.prototype.success=function(t,e,n){void 0===n&&(n={});var i=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(i,t,e,this.applyConfig(n))},t.prototype.error=function(t,e,n){void 0===n&&(n={});var i=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(i,t,e,this.applyConfig(n))},t.prototype.info=function(t,e,n){void 0===n&&(n={});var i=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(i,t,e,this.applyConfig(n))},t.prototype.warning=function(t,e,n){void 0===n&&(n={});var i=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(i,t,e,this.applyConfig(n))},t.prototype.clear=function(t){var e,n;try{for(var i=T(this.toasts),o=i.next();!o.done;o=i.next()){var s=o.value;if(t!==undefined){if(s.toastId===t)return void s.toastRef.manualClose()}else s.toastRef.manualClose()}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.remove=function(t){var e=this._findToast(t);if(!e)return!1;if(e.activeToast.toastRef.close(),this.toasts.splice(e.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length)return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){var n=this.toasts[this.currentlyActive].toastRef;n.isInactive()||(this.currentlyActive=this.currentlyActive+1,n.activate())}return!0},t.prototype.findDuplicate=function(t,e){for(var n=0;n<this.toasts.length;n++){var i=this.toasts[n];if(i.message===t)return e&&i.toastRef.componentInstance.resetTimeout&&i.toastRef.resetTimeout(),i}return null},t.prototype.applyConfig=function(t){return void 0===t&&(t={}),C({},this.toastrConfig,t)},t.prototype._findToast=function(t){for(var e=0;e<this.toasts.length;e++)if(this.toasts[e].toastId===t)return{index:e,activeToast:this.toasts[e]};return null},t.prototype._preBuildNotification=function(t,e,n,i){var o=this;return i.onActivateTick?this.ngZone.run(function(){return o._buildNotification(t,e,n,i)}):this._buildNotification(t,e,n,i)},t.prototype._buildNotification=function(t,e,n,i){var o=this;if(!i.toastComponent)throw new Error("toastComponent required");if(e&&this.toastrConfig.preventDuplicates){var s=this.findDuplicate(e,this.toastrConfig.resetTimeoutOnDuplicate);if(null!==s)return s}this.previousToastMessage=e;var a=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(a=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));var r=this.overlay.create(i.position,this.overlayContainer);this.index=this.index+1;var l=e;e&&i.enableHtml&&(l=this.sanitizer.sanitize(g.SecurityContext.HTML,e));var c=new A(r),h=new k(this.index,i,l,n,t,c),p=new L(h,this._injector),u=new R(i.toastComponent,p),d=r.attach(u,this.toastrConfig.newestOnTop);c.componentInstance=d._component;var f={toastId:this.index,message:e||"",toastRef:c,onShown:c.afterActivate(),onHidden:c.afterClosed(),onTap:h.onTap(),onAction:h.onAction(),portal:d};return a||setTimeout(function(){f.toastRef.activate(),o.currentlyActive=o.currentlyActive+1}),this.toasts.push(f),f},t.decorators=[{type:g.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:undefined,decorators:[{type:g.Inject,args:[P]}]},{type:F},{type:g.Injector},{type:e.DomSanitizer},{type:g.NgZone}]},t.ngInjectableDef=g.defineInjectable({factory:function(){return new t(g.inject(P),g.inject(F),g.inject(g.INJECTOR),g.inject(e.DomSanitizer),g.inject(g.NgZone))},token:t,providedIn:"root"}),t}(),H=function(){function t(t,e,n){var i=this;this.toastrService=t,this.toastPackage=e,this.ngZone=n,this.width=-1,this.toastClasses="",this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}},this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=e.toastType+" "+e.config.toastClass,this.sub=e.toastRef.afterActivate().subscribe(function(){i.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(function(){i.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(function(){i.resetTimeout()})}return t.prototype.ngOnDestroy=function(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)},t.prototype.activateToast=function(){var t=this;this.state=C({},this.state,{value:"active"}),!this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout(function(){return t.remove()},this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(function(){return t.updateProgress()},10))},t.prototype.updateProgress=function(){if(0!==this.width&&100!==this.width&&this.options.timeOut){var t=(new Date).getTime(),e=this.hideTime-t;this.width=e/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),100<=this.width&&(this.width=100)}},t.prototype.resetTimeout=function(){var t=this;clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=C({},this.state,{value:"active"}),this.outsideTimeout(function(){return t.remove()},this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(function(){return t.updateProgress()},10)},t.prototype.remove=function(){var t=this;"removed"!==this.state.value&&(clearTimeout(this.timeout),this.state=C({},this.state,{value:"removed"}),this.outsideTimeout(function(){return t.toastrService.remove(t.toastPackage.toastId)},+this.toastPackage.config.easeTime))},t.prototype.tapToast=function(){"removed"!==this.state.value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())},t.prototype.stickAround=function(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)},t.prototype.delayedHideToast=function(){var t=this;this.options.disableTimeOut||0===this.options.extendedTimeOut||"removed"===this.state.value||(this.outsideTimeout(function(){return t.remove()},this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(function(){return t.updateProgress()},10))},t.prototype.outsideTimeout=function(t,e){var n=this;this.ngZone?this.ngZone.runOutsideAngular(function(){return n.timeout=setTimeout(function(){return n.runInsideAngular(t)},e)}):this.timeout=setTimeout(function(){return t()},e)},t.prototype.outsideInterval=function(t,e){var n=this;this.ngZone?this.ngZone.runOutsideAngular(function(){return n.intervalId=setInterval(function(){return n.runInsideAngular(t)},e)}):this.intervalId=setInterval(function(){return t()},e)},t.prototype.runInsideAngular=function(t){this.ngZone?this.ngZone.run(function(){return t()}):t()},t.decorators=[{type:g.Component,args:[{selector:"[hxa-toastr-component]",template:'\n\n <span class="hx-icon-control mr-2">\n <i class="hx-icon is-medium icon-information" *ngIf="toastPackage.toastType === \'is-info\' || toastPackage.toastType === \'\'"></i>\n <i class="hx-icon is-medium icon-check" *ngIf="toastPackage.toastType === \'is-success\'"></i>\n <i class="hx-icon is-medium icon-warning" *ngIf="toastPackage.toastType === \'is-warning\' || toastPackage.toastType === \'is-danger\'"></i>\n </span>\n <div class="hx-flex-1">\n <div *ngIf="title" [class]="options.titleClass" [attr.aria-label]="title">\n {{ title }}\n </div>\n <div *ngIf="message && options.enableHtml" role="alertdialog" aria-live="polite"\n [class]="options.messageClass" [innerHTML]="message">\n </div>\n <div *ngIf="message && !options.enableHtml" role="alertdialog" aria-live="polite"\n [class]="options.messageClass" [attr.aria-label]="message">\n {{ message }}\n </div>\n </div>\n <div *ngIf="options.progressBar">\n <div class="toast-progress" [style.width]="width + \'%\'"></div>\n </div>\n <span *ngIf="options.closeButton" class="hx-icon-control ml-8">\n <button (click)="remove()" aria-label="Close" class="hx-delete"> <span aria-hidden="true">×</span></button>\n </span>\n ',animations:[i.trigger("flyInOut",[i.state("inactive",i.style({display:"none",opacity:0})),i.state("active",i.style({})),i.state("removed",i.style({opacity:0})),i.transition("inactive => active",i.animate("{{ easeTime }}ms {{ easing }}")),i.transition("active => removed",i.animate("{{ easeTime }}ms {{ easing }}"))])],preserveWhitespaces:!1}]}],t.ctorParameters=function(){return[{type:j},{type:k},{type:g.NgZone}]},t.propDecorators={toastClasses:[{type:g.HostBinding,args:["class"]}],state:[{type:g.HostBinding,args:["@flyInOut"]}],tapToast:[{type:g.HostListener,args:["click"]}],stickAround:[{type:g.HostListener,args:["mouseenter"]}],delayedHideToast:[{type:g.HostListener,args:["mouseleave"]}]},t}(),N=C({},O,{toastComponent:H}),B=function(){function e(){}return e.forRoot=function(t){return void 0===t&&(t={}),{ngModule:e,providers:[{provide:P,useValue:{"default":N,config:t}}]}},e.decorators=[{type:g.NgModule,args:[{imports:[n.CommonModule],declarations:[H],exports:[H],entryComponents:[H]}]}],e}(),V=function(){function t(){}return t.forRoot=function(t){return void 0===t&&(t={}),{ngModule:B,providers:[{provide:P,useValue:{"default":O,config:t}}]}},t.decorators=[{type:g.NgModule,args:[{imports:[n.CommonModule]}]}],t}(),Y=function(){function t(t){this.el=t,this.styleLabel()}return t.prototype.onFocus=function(){this.styleLabelAsFloating()},t.prototype.onBlur=function(){this.styleLabel()},t.prototype.styleLabel=function(){0===this.el.nativeElement.value.trim().length&&0===this.el.nativeElement.placeholder.trim().length?this.styleLabelAsPlaceholder():this.styleLabelAsFloating()},t.prototype.styleLabelAsPlaceholder=function(){this.isPlaceholder=!0,this.isLabel=!1},t.prototype.styleLabelAsFloating=function(){this.isPlaceholder=!1,this.isLabel=!0},t.decorators=[{type:g.Directive,args:[{selector:"[hxaTextInput]"}]}],t.ctorParameters=function(){return[{type:g.ElementRef}]},t.propDecorators={isPlaceholder:[{type:g.HostBinding,args:["class.has-label-placeholder"]}],isLabel:[{type:g.HostBinding,args:["class.has-label-floating"]}],onFocus:[{type:g.HostListener,args:["focus"]}],onBlur:[{type:g.HostListener,args:["blur"]}]},t}(),W=function(){function t(){}return t.decorators=[{type:g.NgModule,args:[{imports:[n.CommonModule],declarations:[Y],exports:[Y]}]}],t}(),U={None:0,Success:1,Warning:2,Danger:3,Info:4};U[U.None]="None",U[U.Success]="Success",U[U.Warning]="Warning",U[U.Danger]="Danger",U[U.Info]="Info";var X={Default:0,Small:1,Large:2};X[X.Default]="Default",X[X.Small]="Small",X[X.Large]="Large";var G={Hidden:0,Visible:1};G[G.Hidden]="Hidden",G[G.Visible]="Visible";var q=function(){function t(){this.size=X.Default,this.context=U.None,this.contextEnum=U,this.sizeEnum=X}return t.prototype.ngOnInit=function(){},t.decorators=[{type:g.Component,args:[{selector:"hxa-loader, hxa-loaders",template:'<div class="hx-loader"\n [class.is-small]="size === sizeEnum.Small"\n [class.is-primary]="context === contextEnum.Success"\n [class.is-warning]="context === contextEnum.Warning"\n [class.is-danger]="context === contextEnum.Danger"\n [class.is-info]="context === contextEnum.Info"><div></div><div></div><div></div><div></div></div>\n',styles:[""]}]}],t.ctorParameters=function(){return[]},t.propDecorators={size:[{type:g.Input}],context:[{type:g.Input}]},t}(),Z=function(){function t(){}return t.decorators=[{type:g.NgModule,args:[{imports:[n.CommonModule],declarations:[q],exports:[q]}]}],t}(),K={SingleSelect:0,Search:1};K[K.SingleSelect]="SingleSelect",K[K.Search]="Search";var J=function(){function t(){this.FilterType=K,this.activePane="left",this.data=[],this.onFilter=new g.EventEmitter,this.onSearchFilter=new g.EventEmitter}return t.prototype.ngOnInit=function(){},t.prototype.clearSearch=function(t){t.value="",this.onSearchFilter.emit({filter:t,value:t.value})},t.prototype.changeFilterSelection=function(t){this.selectedFilter=t,this.activePane="right"},t.prototype.selectFilterOption=function(t){this.onFilter.emit({filter:this.selectedFilter,option:t}),this.back()},t.prototype.searchFilter=function(t){this.onSearchFilter.emit({filter:t})},t.prototype.back=function(){this.activePane="left"},t.prototype.onSlideDone=function(t){"left"===t.toState&&(this.selectedFilter=null)},t.prototype.totalActiveFilters=function(){var n=0;return this.data.forEach(function(t,e){t.isDefaultOptionActive()||n++}),n},t.prototype.trackByFn=function(t,e){return t},t.decorators=[{type:g.Component,args:[{selector:"hxa-filters-collapsed",template:'<div class="hx-dropdown ml-1 collapsedFilter" #dropdown="hx-dropdown" hxaDropdown [autoClose]="false" >\n <button id="collapsedFilterTrigger" type="button" class="hx-button hx-button-dropdown" hxaDropdownToggle>\n <span>{{(totalActiveFilters() > 0)? \'Filtered (\'+totalActiveFilters()+\')\' : \'Filters\' }}</span>\n <span class="hx-icon-control"><i class="icon icon-caret-down"></i></span>\n </button>\n <div class="hx-dropdown-menu has-limited-width collapsedFilter__menu panes" *hxaDropdownMenu>\n <ul class="panes__inner" [@slide]="activePane" (@slide.done)="onSlideDone($event)">\n <li id="filterSelections" class="panes__item">\n <ng-container *ngFor="let filter of data;trackBy: trackByFn;let lastItem = last;">\n\n <div class="hx-dropdown-header itemHeader">{{filter.label}}</div>\n\n \x3c!-- single select --\x3e\n <ng-container *ngIf="filter.type === FilterType.SingleSelect">\n <ul class="hx-list-group">\n <li>\n <a [id]="filter?.id + \'-trigger\'" (click)="changeFilterSelection(filter)" title="{{filter.selected?.label}}">\n <div class="hx-list-action" *ngIf="filter.selected?.icon">\n <i class="{{filter.selected?.icon}}"></i>\n </div>\n <div class="hx-list-content pl-1 is-text-ellipsed is-text-weight-bolder">{{filter.selected?.label}}</div>\n <div class="hx-list-action">\n <i class="icon icon-angle-right"></i>\n </div>\n </a>\n </li>\n </ul>\n </ng-container>\n\n \x3c!-- search filter --\x3e\n <div *ngIf="filter.type === FilterType.Search" class="pl-3 pr-4">\n <div [id]="filter.id" class="hx-input-group">\n <i class="hx-icon icon-search mt-1"></i>\n <div class="hx-input-control my-0">\n <input class="hx-input"\n type="search"\n (input)="searchFilter(filter)"\n [(ngModel)]="filter.value">\n <label class="hx-label"></label>\n <div class="hx-help"></div>\n </div>\n <div class="hx-input-actions" *ngIf="filter.value">\n <div class="hx-button-group">\n <button class="hx-button is-flat" (click)="clearSearch(filter)"><span class="hx-icon-control"><i class="icon icon-close-empty"></i></span></button>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </li>\n <li id="filterOptions" class="panes__item">\n <div class="hx-toolbar is-xsmall">\n <button id="paneBack" class="hx-button is-flat" (click)="back()"><i class="hx-icon icon-arrow-left"></i></button>\n <span>{{selectedFilter?.label}}</span>\n </div>\n <ul [id]="selectedFilter?.id + \'-options\'" class="hx-list-group options">\n <li class="options__item" *ngFor="let option of selectedFilter?.options;trackBy: trackByFn">\n <a hxaDropdownItem (click)="selectFilterOption(option)" title="{{option?.label}}">\n <div class="hx-list-action" *ngIf="option?.icon">\n <i class="{{option?.icon}}"></i>\n </div>\n <div class="hx-list-content pl-1 is-text-ellipsed">{{option?.label}}</div>\n </a>\n </li>\n </ul>\n </li>\n </ul>\n </div>\n</div>\n',styles:[".collapsedFilter__menu.panes{width:15rem;overflow:hidden}.collapsedFilter__menu.panes .panes__inner{display:flex;list-style:none;padding:0;margin-top:0}.collapsedFilter__menu.panes .panes__item{min-width:15rem;max-width:15rem}.collapsedFilter__menu.panes .panes__item>ul{max-height:20rem;overflow-y:auto;overflow-x:hidden}.collapsedFilter__menu.panes .panes__item>ul>li:last-child:not(:first-child) a{border-bottom:none}"],animations:[i.trigger("slide",[i.state("left",i.style({transform:"translateX(0)"})),i.state("right",i.style({transform:"translateX(-100%)"})),i.transition("* => *",i.animate(200))])]}]}],t.ctorParameters=function(){return[]},t.propDecorators={dropdown:[{type:g.ViewChild,args:["dropdown"]}],data:[{type:g.Input}],onFilter:[{type:g.Output}],onSearchFilter:[{type:g.Output}]},t}(),Q=function(){function t(t){this.defaultIndex=0,this.charLimit=2,Object.assign(this,t),this.type!==K.Search&&this.setSelectedOption(),this.isIconised()}return t.prototype.setSelectedOption=function(t){t?(t.selected=!0,this.selected=t):this.options.length&&!this.selected&&(this.selected=this.options.find(function(t){return t.selected}))},t.prototype.setDefaultOption=function(){this.options.length&&(this.selected=this.options[this.defaultIndex])},t.prototype.isDefaultOptionActive=function(){return this.type===K.SingleSelect?this.selected===this.options[this.defaultIndex]:this.type===K.Search?""===this.value||this.value===undefined:void 0},t.prototype.isIconised=function(){return!!this.options&&void 0!==this.options.find(function(t){return"undefined"!=typeof t.icon&&""!==t.icon})},t}(),tt=function(){function t(){this.debounce=800}return t.decorators=[{type:g.Injectable}],t}(),et=function(){function t(t){this.conf=t,this.FilterType=K,this.data=[],this.onFilterOptionChanged$=new c.Subject,this.searchFilter$=new c.Subject,this.subscriptions=new c.Subscription,this._filters=[],this._oldFilters=[],this._collapsed=!1,Object.assign(this,t)}return Object.defineProperty(t.prototype,"collapsed",{get:function(){return this._collapsed},set:function(t){this._collapsed=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._filters},set:function(t){this._filters=t,this.setData()},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var e=this;this.subscriptions.add(this.searchFilter$.pipe(s.debounceTime(this.conf.debounce)).subscribe(function(t){return e.onFilterOptionChanged$.next(t)}))},t.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},t.prototype.ngDoCheck=function(){o.isEqual(this._filters,this._oldFilters)||(this._oldFilters=o.cloneDeep(this._filters),this.setData())},t.prototype.resetFilters=function(t){var e,n;void 0===t&&(t=!1);try{for(var i=T(this.data),o=i.next();!o.done;o=i.next()){var s=o.value;s.type===K.SingleSelect?(s.setDefaultOption(),t||this.onFilterOptionChanged$.next(s)):s.type===K.Search&&this.clearSearch(s,t)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.clearSearch=function(t,e){void 0===e&&(e=!1),t.value="",e||this.onFilterOptionChanged$.next(t)},t.prototype.onFilterOptionSelected=function(t,e){t.setSelectedOption(e),this.onFilterOptionChanged$.next(t)},t.prototype.onSearchFilterChange=function(t){(0===t.value.length||t.value.length>=t.charLimit)&&this.searchFilter$.next(t)},t.prototype.onCollapsedFilter=function(t){this.onFilterOptionSelected(t.filter,t.option)},t.prototype.onCollapsedSearch=function(t){this.onSearchFilterChange(t.filter)},t.prototype.trackByFn=function(t,e){return t},t.prototype.setData=function(){var n=this;this.data=[],this._filters&&this._filters.forEach(function(t,e){n.data.push(new Q(o.cloneDeep(t)))})},t.decorators=[{type:g.Component,args:[{selector:"hxa-filters",template:'<div class="hx-flex hx-flex-align-center">\n\n <i class="hx-icon icon-filter-outline mx-1"></i>\n\n \x3c!-- collapsed filters --\x3e\n <hxa-filters-collapsed (onFilter)="onCollapsedFilter($event)" (onSearchFilter)="onCollapsedSearch($event)" [data]="data" *ngIf="collapsed"></hxa-filters-collapsed>\n\n \x3c!-- expanded filters --\x3e\n <ng-container *ngIf="!collapsed">\n <ng-container *ngFor="let filter of data;trackBy: trackByFn;let lastItem = last;">\n\n \x3c!-- single select filter --\x3e\n <div [id]="filter?.id" class="hx-dropdown mx-1 expandedFilter" hxaDropdown [minWidthRelativeTo]="filter?.id + \'-trigger\'" *ngIf="filter?.type === FilterType.SingleSelect">\n <a [id]="filter?.id + \'-trigger\'" class="hx-button hx-button-dropdown expandedFilter__button" hxaDropdownToggle>\n <span class="is-text-weight-light">{{filter?.label}}: </span>\n <span class="hx-icon-control" *ngIf="filter?.selected?.icon"><i class="{{filter?.selected?.icon}} mr-1"></i></span>\n <span class="is-text-weight-bolder is-text-ellipsed" title="{{filter?.selected?.label}}">{{filter?.selected?.label}}</span>\n <span class="hx-icon-control"><i class="hx-icon icon-caret-down"></i></span>\n </a>\n <div [id]="filter?.id + \'-options\'" class="hx-dropdown-menu has-limited-width has-limited-height expandedFilter__menu" [class.hx-dropdown-icon]="filter.isIconised()" *hxaDropdownMenu>\n <a hxaDropdownItem *ngFor="let option of filter?.options;trackBy: trackByFn" (click)="onFilterOptionSelected(filter,option)" class="hx-dropdown-item is-text-ellipsed" title="{{option?.label}}"> <span class="hx-icon-control" *ngIf="option?.icon"><i class="{{option?.icon}}"></i></span> {{option?.label}}</a>\n </div>\n </div>\n\n \x3c!-- search filter --\x3e\n <div [id]="filter.id" *ngIf="filter.type === FilterType.Search" class="hx-input-group ml-4" [class.mx-1]="!lastItem">\n <i class="hx-icon icon-search mt-1"></i>\n <div class="hx-input-control my-0">\n <input class="hx-input"\n type="search"\n placeholder="{{filter.label}}"\n (input)="onSearchFilterChange(filter)"\n [(ngModel)]="filter.value">\n <label class="hx-label"></label>\n <div class="hx-help"></div>\n </div>\n <div class="hx-input-actions" *ngIf="filter.value">\n \x3c!--<div id="searchLoadingIndicator" class="hx-loader is-small" *ngIf="patientSearchService.showPatientSearchLoader"><div></div><div></div><div></div><div></div></div>--\x3e\n <div class="hx-button-group">\n <button class="hx-button is-flat" (click)="clearSearch(filter)"><span class="hx-icon-control"><i class="icon icon-close-empty"></i></span></button>\n </div>\n </div>\n </div>\n </ng-container>\n </ng-container>\n</div>\n',styles:[":host .expandedFilter__button{max-width:15rem}:host .expandedFilter__menu{width:100%;max-height:20rem;max-width:15rem;overflow-x:hidden;overflow-y:auto}"]}]}],t.ctorParameters=function(){return[{type:tt}]},t.propDecorators={carousel:[{type:g.ViewChild,args:["carousel"]}],collapsed:[{type:g.Input}],filters:[{type:g.Input}]},t}(),nt=function(){function t(t){this.templateRef=t}return t.prototype.ngOnInit=function(){},t.decorators=[{type:g.Directive,args:[{selector:"[hxDropdownMenu],[hxaDropdownMenu]",exportAs:"hx-dropdown-menu"}]}],t.ctorParameters=function(){return[{type:g.TemplateRef}]},t}(),it=function(){function t(){this.autoClose=!0,this.showDelay=0,this.hideDelay=0}return t.decorators=[{type:g.Injectable}],t}(),ot=function(){function t(t,e,n,i){this._elementRef=t,this._viewContainerRef=e,this.overlay=n,this._config=i,this._destroyed=new c.Subject,this.isOpen=!1,this.placement="bottom",this._autoClose=this._config.autoClose,this.isOpenChange=new g.EventEmitter,this.onShown=new g.EventEmitter,this.onHidden=new g.EventEmitter,this.isDisabled=!1,this.showDelay=this._config.showDelay,this.hideDelay=this._config.hideDelay}return Object.defineProperty(t.prototype,"autoClose",{get:function(){return this._autoClose},set:function(t){this._autoClose=t},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.ngAfterContentInit=function(){},t.prototype.ngOnDestroy=function(){this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=null),this._destroyed.next(),this._destroyed.complete()},t.prototype.toggle=function(t){return this.isOpen||!1===t?this.hide():this.show()},t.prototype.show=function(t){if(void 0===t&&(t=this.showDelay),!this.isDisabled&&!this.isOpen){var e=this._createOverlay();this._detach(),e.attach(this._portal),this._setWidthsRelativeTo(e),this.isOpen=!0,this.isOpenChange.emit(this.isOpen),this.onShown.emit()}},t.prototype.hide=function(t){void 0===t&&(t=this.hideDelay),this._detach(),this.isOpen=!1,this.isOpenChange.emit(this.isOpen),this.onHidden.emit()},t.prototype._createOverlay=function(){var e=this;if(this._overlayRef)return this._overlayRef;this._portal=new r.TemplatePortal(this.menu.templateRef,this._viewContainerRef);var t=this.overlay.position().flexibleConnectedTo(this._elementRef).withFlexibleDimensions(!1).withDefaultOffsetX(0).withPositions([{originX:"start",originY:"top",overlayX:"start",overlayY:"top"}]).withTransformOriginOn(".hxa-dropdown-control");return this._overlayRef=this.overlay.create({positionStrategy:t,panelClass:["hxui-reset","hxa-dropdown-panel","is-open",this.minWidthRelativeTo?"is-fluid-min-width":"not-fuild-min-width"],hasBackdrop:!0,backdropClass:"cdk-overlay-transparent-backdrop"}),this._updatePosition(),this._overlayRef.detachments().pipe(a.takeUntil(this._destroyed)).subscribe(function(){return e._detach()}),this._overlayRef.backdropClick().subscribe(function(){return e.hide()}),this._overlayRef.getConfig().positionStrategy.positionChanges.pipe(a.takeUntil(this._destroyed)).subscribe(function(t){"start"===t.connectionPair.originX?e.placement="left":"end"===t.connectionPair.originX?e.placement="right":"top"===t.connectionPair.originY?e.placement="top":"bottom"===t.connectionPair.originY&&(e.placement="bottom")}),this._overlayRef},t.prototype._detach=function(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach()},t.prototype._setWidthsRelativeTo=function(t){if(this.maxWidthRelativeTo&&this.minWidthRelativeTo){var e=document.getElementById(this.maxWidthRelativeTo);t.updateSize({minWidth:e.clientWidth,maxWidth:e.clientWidth})}else if(this.maxWidthRelativeTo){e=document.getElementById(this.maxWidthRelativeTo);t.updateSize({maxWidth:e.clientWidth})}else if(this.minWidthRelativeTo){e=document.getElementById(this.minWidthRelativeTo);console.log(this.menu.templateRef),t.updateSize({minWidth:e.clientWidth})}},t.prototype._updatePosition=function(){var t=this._overlayRef.getConfig().positionStrategy,e=this._getOrigin(),n=this._getOverlayPosition();t.withPositions([C({},e.main,n.main),C({},e.fallback,n.fallback)])},t.prototype._getOrigin=function(){var t,e=this.placement;"top"===e||"bottom"===e?t={originX:"start",originY:"top"===e?"top":"bottom"}:"left"===e?t={originX:"start",originY:"center"}:"right"===e?t={originX:"end",originY:"center"}:console.error("Position error",e);var n=this._invertPosition(t.originX,t.originY);return{main:t,fallback:{originX:n.x,originY:n.y}}},t.prototype._getOverlayPosition=function(){var t,e=this.placement;"top"===e?t={overlayX:"start",overlayY:"bottom"}:"bottom"===e?t={overlayX:"start",overlayY:"top"}:"left"===e?t={overlayX:"end",overlayY:"center"}:"right"===e?t={overlayX:"start",overlayY:"center"}:console.error("Could not find a position",e);var n=this._invertPosition(t.overlayX,t.overlayY);return{main:t,fallback:{overlayX:n.x,overlayY:n.y}}},t.prototype._invertPosition=function(t,e){return"top"===this.placement||"bottom"===this.placement?"top"===e?e="bottom":"bottom"===e&&(e="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:e}},t.decorators=[{type:g.Directive,args:[{selector:"[hxaDropdown],[hxDropdown]",exportAs:"hx-dropdown, hxa-dropdown"}]}],t.ctorParameters=function(){return[{type:g.ElementRef},{type:g.ViewContainerRef},{type:h.Overlay},{type:it}]},t.propDecorators={menu:[{type:g.ContentChild,args:[nt]}],placement:[{type:g.Input}],autoClose:[{type:g.Input}],isOpenChange:[{type:g.Output}],onShown:[{type:g.Output}],onHidden:[{type:g.Output}],isDisabled:[{type:g.Input}],showDelay:[{type:g.Input}],hideDelay:[{type:g.Input}],maxWidthRelativeTo:[{type:g.Input}],minWidthRelativeTo:[{type:g.Input}]},t}(),st=function(){function t(t,e){this.elementRef=t,this.dropdown=e,this.isOpenChange=new g.EventEmitter}return t.prototype.onClick=function(t){this.dropdown.show()},t.prototype.onEsc=function(){this.dropdown.hide()},t.prototype.ngOnDestroy=function(){},t.decorators=[{type:g.Directive,args:[{selector:"[hxDropdownToggle],[hxaDropdownToggle]",exportAs:"hx-dropdown-toggle"}]}],t.ctorParameters=function(){return[{type:g.ElementRef},{type:ot}]},t.propDecorators={isDisabled:[{type:g.HostBinding,args:["attr.disabled"]}],isOpen:[{type:g.HostBinding,args:["class.is-active"]}],onClick:[{type:g.HostListener,args:["click",["$event"]]}],onEsc:[{type:g.HostListener,args:["keyup.esc"]}]},t}(),at=function(){function t(t,e){this.elementRef=t,this.dropdown=e}return t.prototype.onClick=function(t){this.dropdown.autoClose&&this.dropdown.hide()},t.decorators=[{type:g.Directive,args:[{selector:"[hxDropdownItem],[hxaDropdownItem]"}]}],t.ctorParameters=function(){return[{type:g.ElementRef},{type:ot}]},t.propDecorators={onClick:[{type:g.HostListener,args:["click",["$event"]]}]},t}(),rt=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[{provide:it,useValue:t||{autoClose:!0}}]}},e.decorators=[{type:g.NgModule,args:[{declarations:[nt,st,ot,at],exports:[nt,st,ot,at]}]}],e}(),lt=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[tt]}},t.decorators=[{type:g.NgModule,args:[{imports:[n.CommonModule,rt,p.FormsModule],declarations:[et,J],exports:[et,J]}]}],t}(),ct=function(){function t(){}return t.prototype.position=function(t,e){var n;void 0===e&&(e=!0);var i={width:0,height:0,top:0,bottom:0,left:0,right:0};if("fixed"===this.getStyle(t,"position"))n=t.getBoundingClientRect();else{var o=this.offsetParent(t);n=this.offset(t,!1),o!==document.documentElement&&(i=this.offset(o,!1)),i.top+=o.clientTop,i.left+=o.clientLeft}return n.top-=i.top,n.bottom-=i.top,n.left-=i.left,n.right-=i.left,e&&(n.top=Math.round(n.top),n.bottom=Math.round(n.bottom),n.left=Math.round(n.left),n.right=Math.round(n.right)),n},t.prototype.offset=function(t,e){void 0===e&&(e=!0);var n=t.getBoundingClientRect(),i=window.pageYOffset-document.documentElement.clientTop,o=window.pageXOffset-document.documentElement.clientLeft,s={height:n.height||t.offsetHeight,width:n.width||t.offsetWidth,top:n.top+i,bottom:n.bottom+i,left:n.left+o,right:n.right+o};return e&&(s.height=Math.round(s.height),s.width=Math.round(s.width),s.top=Math.round(s.top),s.bottom=Math.round(s.bottom),s.left=Math.round(s.left),s.right=Math.round(s.right)),s},t.prototype.positionElements=function(t,e,n,i){var o=i?this.offset(t,!1):this.position(t,!1),s={left:o.left,center:o.left+o.width/2-e.offsetWidth/2,right:o.left+o.width},a={top:o.top,center:o.top+o.height/2-e.offsetHeight/2,bottom:o.top+o.height},r=e.getBoundingClientRect(),l=n.split(" ")[0]||"top",c=n.split(" ")[1]||"center",h={height:r.height||e.offsetHeight,width:r.width||e.offsetWidth,top:0,bottom:r.height||e.offsetHeight,left:0,right:r.width||e.offsetWidth};switch(l){case"top":h.top=o.top-e.offsetHeight,h.bottom+=o.top-e.offsetHeight,h.left=s[c],h.right+=s[c];break;case"bottom":h.top=a[l],h.bottom+=a[l],h.left=s[c],h.right+=s[c];break;case"left":h.top=a[c],h.bottom+=a[c],h.left=o.left-e.offsetWidth,h.right+=o.left-e.offsetWidth;break;case"right":h.top=a[c],h.bottom+=a[c],h.left=s[l],h.right+=s[l]}return h.top=Math.round(h.top),h.bottom=Math.round(h.bottom),h.left=Math.round(h.left),h.right=Math.round(h.right),h},t.prototype.getStyle=function(t,e){return window.getComputedStyle(t)[e]},t.prototype.isStaticPositioned=function(t){return"static"===(this.getStyle(t,"position")||"static")},t.prototype.offsetParent=function(t){for(var e=t.offsetParent||document.documentElement;e&&e!==document.documentElement&&this.isStaticPositioned(e);)e=e.offsetParent;return e||document.documentElement},t}(),ht=new ct;function pt(t,e,n,i){var o=ht.positionElements(t,e,n,i);e.style.top=o.top+"px",e.style.left=o.left+"px"}var ut=function(){function t(){}return t.prototype.position=function(t){var e=t.element,n=t.target,i=t.attachment,o=t.appendToBody;pt(this._getHtmlElement(n),this._getHtmlElement(e),i,o)},t.prototype.isElementBelowTheFold=function(t){var e=t.getBoundingClientRect();return e.top+e.height>document.body.clientHeight},t.prototype._getHtmlElement=function(t){return"string"==typeof t?document.querySelector(t):t instanceof g.ElementRef?t.nativeElement:t},t.decorators=[{type:g.Injectable}],t}(),dt=function ft(){},gt=function(){function t(t){this.element=t}return t.prototype.onInput=function(){this.resize()},t.prototype.ngAfterViewInit=function(){var t=this.element.nativeElement.style;t.overflow="hidden",t.height="auto"},t.prototype.resize=function(){var t=this.element.nativeElement;t.style.height!==t.scrollHeight+"px"&&(t.style.overflow="hidden",t.style.height="auto",t.style.height=t.scrollHeight+"px")},t.decorators=[{type:g.Directive,args:[{selector:"textarea[autogrow]"}]}],t.ctorParameters=function(){return[{type:g.ElementRef}]},t.propDecorators={onInput:[{type:g.HostListener,args:["input",["$event.target"]]}]},t}(),mt=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[]}},t.decorators=[{type:g.NgModule,args:[{declarations:[gt],exports:[gt]}]}],t}(),yt=function(){function t(){this.placement="bottom",this.showDelay=0,this.hideDelay=0,this.selectedDueDateInterval=undefined}return t.decorators=[{type:g.Injectable}],t}(),vt=function(){function t(t,e){this._changeDetectionRef=t,this.datePickerConfig=e,this.OpenDiv=!0,this.showCalendar=!0,this.activeVariable=!0,this.placement="bottom",this.allowInterval=!1,this.selectedDueDateInterval="0 day(s)",this.visibilityEnum=G,this.visibility=G.Hidden,this.days=new Array,this.week=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],this.cellCount=41,this._onHide=new c.Subject}return t.prototype.renderCalendar=function(){for(var t=0;t<=this.cellCount;t++){var e=new Date(this.viewDate.getFullYear(),this.viewDate.getMonth()),n=0===e.getDay()?7:e.getDay();this.days[t]=new Date(e.setDate(2-n+t))}},t.prototype.previousMonth=function(){this.viewDate=new Date(this.viewDate.getFullYear(),this.viewDate.getMonth()-1),this.renderCalendar()},t.prototype.nextMonth=function(){this.viewDate=new Date(this.viewDate.getFullYear(),this.viewDate.getMonth()+1),this.renderCalendar()},t.prototype.isCurrentMonth=function(t){return t.getMonth()===this.viewDate.getMonth()},t.prototype.isCurrentDay=function(t){return t.getTime()===this.presentDate.getTime()},t.prototype.isSelectedDay=function(t){return!!this.selectedDate&&t.getTime()===this.selectedDate.getTime()},t.prototype.isInvalidDay=function(e){return this.validators.map(function(t){return t(e)}).reduce(function(t,e){return t||e},!1)},t.prototype.setSelectedDate=function(t){this.isInvalidDay(t)||(this.selectedDate=t,this.onDateSelected(t))},t.prototype.ngOnChanges=function(t){t.selectedDate.currentValue&&(this.viewDate=new Date(this.selectedDate.getFullYear(),this.selectedDate.getMonth()))},t.prototype.ngOnInit=function(){var t=this.selectedDate?this.selectedDate:new Date;this.presentDate=new Date(t.getFullYear(),t.getMonth(),t.getDate()),this.viewDate=this.viewDate||new Date(t.getFullYear(),t.getMonth()),this.renderCalendar(),"tab1"===this.datePickerConfig.tabSelected&&(this.activeVariable1=!1,this.activeVariable=!0),"tab2"===this.datePickerConfig.tabSelected&&(this.activeVariable1=!0,this.activeVariable=!1)},t.prototype.show=function(t){var e=this;this._hideTimeoutId&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=window.setTimeout(function(){e._changeDetectionRef.markForCheck(),e.visibility=G.Visible},t),this.allowInterval?(this.OpenDiv=!0,this.showCalendar=!1):(this.OpenDiv=!1,this.showCalendar=!0)},t.prototype.hide=function(t){var e=this;this._showTimeoutId&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=window.setTimeout(function(){e.visibility=G.Hidden,e._onHide.next()},t)},t.prototype.afterHidden=function(){return this._onHide.asObservable()},t.prototype.isVisible=function(){return this.visibility===G.Visible},t.prototype.onTabSelect=function(t){this.datePickerConfig.tabSelected=t},t.decorators=[{type:g.Component,args:[{selector:"hxa-datepicker",template:'<div class="hxui-reset" *ngIf="OpenDiv">\n <div class="hxa-tabs">\n <hx-tabset class="hxa-tabset">\n <hx-tab heading="Set interval" (select)="onTabSelect(\'tab1\')" [active]="activeVariable">\n <hxa-datepicker-interval></hxa-datepicker-interval>\n </hx-tab>\n <hx-tab heading="Specific date" (select)="onTabSelect(\'tab2\')" [active]="activeVariable1">\n <div class="hxui-reset">\n <div class="hx-card hxa-datepicker-container">\n <div class="hx-card-header hxa-datepicker-header">\n <div class="hxa-datepicker-month">\n <div class="hxa-datepicker-icon" title="Previous Month" (click)="previousMonth()">\n <a class="hx-button is-transparent"><i class="hx-icon icon-angle-left"></i></a>\n </div>\n <div class="hxa-datepicker-month-title">\n <span>{{viewDate.toLocaleString("en-au", { month: "long", year: "numeric" })}}</span></div>\n <div class="hxa-datepicker-icon" title="Next Month" (click)="nextMonth()">\n <a class="hx-button is-transparent"><i class="hx-icon icon-angle-right"></i></a>\n </div>\n </div>\n <div class="hxa-datepicker-week">\n <div class="hxa-datepicker-weekday" *ngFor="let weekday of week">\n {{weekday | slice:0:3}}\n </div>\n </div>\n </div>\n <div class="hxa-datepicker-contents">\n <div class="hxa-datepicker-day" *ngFor="let day of days"\n [ngClass]="{\'hxa-datepicker-day-siblingmonth\': !isCurrentMonth(day),\n \'hxa-datepicker-day-currentday\': isCurrentDay(day),\n \'hxa-datepicker-day-selectedday\': isSelectedDay(day),\n \'hxa-datepicker-day-invalidday\': isInvalidDay(day)}"\n (click)="setSelectedDate(day)">\n <a class="hx-button is-transparent">{{day.getDate()}}</a>\n </div>\n </div>\n </div>\n </div>\n </hx-tab>\n </hx-tabset>\n </div>\n</div>\n<div class="hxui-reset" *ngIf="showCalendar">\n <div class="hx-card hxa-datepicker-container">\n <div class="hx-card-header hxa-datepicker-header">\n <div class="hxa-datepicke