import{f as Y,g as v,h,i as J,j as y}from"./chunk-JTDXTMDS.js";import{m as Z}from"./chunk-6VC7H3CZ.js";import{$ as Q,aa as X}from"./chunk-QSMHDGIB.js";import{Ab as R,Bb as E,D as O,Db as A,Fb as c,Ja as M,Tb as a,Ub as d,Wc as U,Xb as F,Xc as B,_ as N,cc as u,da as D,dc as b,ea as z,ec as g,g as I,ga as j,gd as G,h as _,hb as k,mb as p,pc as f,qc as T,rb as l,rc as L,uc as V,va as P,vc as H,wc as q}from"./chunk-QMYHTLAJ.js";import{a as w,b as S}from"./chunk-K4ALXBGI.js";var W=["overlay"],$=["*"];function ee(t,s){t&1&&g(0,"div")}function te(t,s){if(t&1&&(u(0,"div"),c(1,ee,1,0,"div",6),b()),t&2){let e=f(2);F(e.spinner.class),d("color",e.spinner.color),p(),a("ngForOf",e.spinner.divArray)}}function ie(t,s){if(t&1&&(g(0,"div",7),U(1,"safeHtml")),t&2){let e=f(2);a("innerHTML",B(1,1,e.template),k)}}function ne(t,s){if(t&1&&(u(0,"div",2,0),c(2,te,2,5,"div",3)(3,ie,2,3,"div",4),u(4,"div",5),L(5),b()()),t&2){let e=f();d("background-color",e.spinner.bdColor)("z-index",e.spinner.zIndex)("position",e.spinner.fullScreen?"fixed":"absolute"),a("@.disabled",e.disableAnimation)("@fadeIn","in"),p(2),a("ngIf",!e.template),p(),a("ngIf",e.template),p(),d("z-index",e.spinner.zIndex)}}var se={"ball-8bits":16,"ball-atom":4,"ball-beat":3,"ball-circus":5,"ball-climbing-dot":4,"ball-clip-rotate":1,"ball-clip-rotate-multiple":2,"ball-clip-rotate-pulse":2,"ball-elastic-dots":5,"ball-fall":3,"ball-fussion":4,"ball-grid-beat":9,"ball-grid-pulse":9,"ball-newton-cradle":4,"ball-pulse":3,"ball-pulse-rise":5,"ball-pulse-sync":3,"ball-rotate":1,"ball-running-dots":5,"ball-scale":1,"ball-scale-multiple":3,"ball-scale-pulse":2,"ball-scale-ripple":1,"ball-scale-ripple-multiple":3,"ball-spin":8,"ball-spin-clockwise":8,"ball-spin-clockwise-fade":8,"ball-spin-clockwise-fade-rotating":8,"ball-spin-fade":8,"ball-spin-fade-rotating":8,"ball-spin-rotate":2,"ball-square-clockwise-spin":8,"ball-square-spin":8,"ball-triangle-path":3,"ball-zig-zag":2,"ball-zig-zag-deflect":2,cog:1,"cube-transition":2,fire:3,"line-scale":5,"line-scale-party":5,"line-scale-pulse-out":5,"line-scale-pulse-out-rapid":5,"line-spin-clockwise-fade":8,"line-spin-clockwise-fade-rotating":8,"line-spin-fade":8,"line-spin-fade-rotating":8,pacman:6,"square-jelly-box":2,"square-loader":1,"square-spin":1,timer:1,"triangle-skew-spin":1},C={BD_COLOR:"rgba(51,51,51,0.8)",SPINNER_COLOR:"#fff",Z_INDEX:99999},x="primary",o=class t{constructor(s){Object.assign(this,s)}static create(s){return!s?.template&&!s?.type&&console.warn(`[ngx-spinner]: Property "type" is missed. Please, provide animation type to <ngx-spinner> component
        and ensure css is added to angular.json file`),new t(s)}},re=(()=>{class t{constructor(){this.spinnerObservable=new _(null)}getSpinner(e){return this.spinnerObservable.asObservable().pipe(O(i=>i&&i.name===e))}show(e=x,i){return new Promise((n,r)=>{setTimeout(()=>{i&&Object.keys(i).length?(i.name=e,this.spinnerObservable.next(new o(S(w({},i),{show:!0}))),n(!0)):(this.spinnerObservable.next(new o({name:e,show:!0})),n(!0))},10)})}hide(e=x,i=10){return new Promise((n,r)=>{setTimeout(()=>{this.spinnerObservable.next(new o({name:e,show:!1})),n(!0)},i)})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),K=new j("NGX_SPINNER_CONFIG"),ae=(()=>{class t{constructor(e){this.sanitizer=e}transform(e){return e?this.sanitizer.bypassSecurityTrustHtml(e):""}static{this.\u0275fac=function(i){return new(i||t)(l(Z,16))}}static{this.\u0275pipe=A({name:"safeHtml",type:t,pure:!0})}}return t})(),Ie=(()=>{class t{constructor(e,i,n,r){this.spinnerService=e,this.changeDetector=i,this.elementRef=n,this.globalConfig=r,this.disableAnimation=!1,this.spinner=new o,this.ngUnsubscribe=new I,this.setDefaultOptions=()=>{let{type:m}=this.globalConfig??{};this.spinner=o.create({name:this.name,bdColor:this.bdColor,size:this.size,color:this.color,type:this.type??m,fullScreen:this.fullScreen,divArray:this.divArray,divCount:this.divCount,show:this.show,zIndex:this.zIndex,template:this.template,showSpinner:this.showSpinner})},this.bdColor=C.BD_COLOR,this.zIndex=C.Z_INDEX,this.color=C.SPINNER_COLOR,this.size="large",this.fullScreen=!0,this.name=x,this.template=null,this.showSpinner=!1,this.divArray=[],this.divCount=0,this.show=!1}initObservable(){this.spinnerService.getSpinner(this.name).pipe(N(this.ngUnsubscribe)).subscribe(e=>{this.setDefaultOptions(),Object.assign(this.spinner,e),e.show&&this.onInputChange(),this.changeDetector.detectChanges()})}ngOnInit(){this.setDefaultOptions(),this.initObservable()}isSpinnerZone(e){return e===this.elementRef.nativeElement.parentElement?!0:e.parentNode&&this.isSpinnerZone(e.parentNode)}ngOnChanges(e){for(let i in e)if(i){let n=e[i];if(n.isFirstChange())return;typeof n.currentValue<"u"&&n.currentValue!==n.previousValue&&n.currentValue!==""&&(this.spinner[i]=n.currentValue,i==="showSpinner"&&(n.currentValue?this.spinnerService.show(this.spinner.name,this.spinner):this.spinnerService.hide(this.spinner.name)),i==="name"&&this.initObservable())}}getClass(e,i){this.spinner.divCount=se[e],this.spinner.divArray=Array(this.spinner.divCount).fill(0).map((r,m)=>m);let n="";switch(i.toLowerCase()){case"small":n="la-sm";break;case"medium":n="la-2x";break;case"large":n="la-3x";break;default:break}return"la-"+e+" "+n}onInputChange(){this.spinner.class=this.getClass(this.spinner.type,this.spinner.size)}ngOnDestroy(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()}static{this.\u0275fac=function(i){return new(i||t)(l(re),l(G),l(M),l(K,8))}}static{this.\u0275cmp=R({type:t,selectors:[["ngx-spinner"]],viewQuery:function(i,n){if(i&1&&V(W,5),i&2){let r;H(r=q())&&(n.spinnerDOM=r.first)}},inputs:{bdColor:"bdColor",size:"size",color:"color",type:"type",fullScreen:"fullScreen",name:"name",zIndex:"zIndex",template:"template",showSpinner:"showSpinner",disableAnimation:"disableAnimation"},features:[P],ngContentSelectors:$,decls:1,vars:1,consts:[["overlay",""],["class","ngx-spinner-overlay",3,"background-color","z-index","position",4,"ngIf"],[1,"ngx-spinner-overlay"],[3,"class","color",4,"ngIf"],[3,"innerHTML",4,"ngIf"],[1,"loading-text"],[4,"ngFor","ngForOf"],[3,"innerHTML"]],template:function(i,n){i&1&&(T(),c(0,ne,6,12,"div",1)),i&2&&a("ngIf",n.spinner.show)},dependencies:[ae,X,Q],styles:[".ngx-spinner-overlay[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%}.ngx-spinner-overlay[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:not(.loading-text){top:50%;left:50%;margin:0;position:absolute;transform:translate(-50%,-50%)}.loading-text[_ngcontent-%COMP%]{position:absolute;top:60%;left:50%;transform:translate(-50%,-60%)}"],data:{animation:[Y("fadeIn",[J("in",h({opacity:1})),y(":enter",[h({opacity:0}),v(300)]),y(":leave",v(200,h({opacity:0})))])]},changeDetection:0})}}return t})(),_e=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[{provide:K,useValue:e}]}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=E({type:t})}static{this.\u0275inj=z({})}}return t})();export{re as a,Ie as b,_e as c};
