import{a as B}from"./chunk-MJMWESWV.js";import{b as y}from"./chunk-PQUUPIVM.js";import{c as F}from"./chunk-ES7DY2DS.js";import{r as a}from"./chunk-52PVRKG2.js";import{Fb as x,Fd as z,Hb as l,Zc as w,ka as T,la as E,pa as v,sb as c}from"./chunk-PJGPU3FT.js";var I=(()=>{class r{constructor(t){this.translate=t}formatElapsedTimeDigits(t,e){let i=Math.floor(t/1e3),s=Math.floor(i/60),d=Math.floor(s/60),$=Math.floor(d/24),S=Math.floor($/30),V=Math.floor(S/12),P=i%60,M=s%60,n=a.zeroPadBefore(a.numToStr(d),2),o=a.zeroPadBefore(a.numToStr(M),2),f=a.zeroPadBefore(a.numToStr(P),2);switch(e){case"minutes":return`${n}:${o}`;case"full":default:return`${n}:${o}:${f}`}}formatElapsedTime(t,e="full",i="long",s=!1){let d=Math.floor(t/1e3),$=Math.floor(d/60),S=Math.floor($/60),V=Math.floor(S/24),P=Math.floor(V/30),M=Math.floor(P/12),n=d%60,o=$%60,f=S%24,D=V%30,j=P%12,m=n&&s?"":this.translateUnit(n,"second",i),u=o&&s?"":this.translateUnit(o,"minute",i),p=f&&s?"":this.translateUnit(f,"hour",i),g=D&&s?"":this.translateUnit(D,"day",i),b=j&&s?"":this.translateUnit(j,"month",i),U=M&&s?"":this.translateUnit(M,"year",i);switch(e){case"seconds":return m;case"minutes":return n===0?`${u}`:`${u} ${m}`;case"hours":return o===0&&n===0?`${p}`:`${p} ${u} ${m}`;case"days":return f===0&&o===0&&n===0?`${g}`:`${g} ${p} ${u} ${m}`;case"months":return D===0&&f===0&&o===0&&n===0?`${b}`:`${b} ${g} ${p} ${u} ${m}`;case"years":return j===0&&D===0&&f===0&&o===0&&n===0?`${U}`:`${U} ${b} ${g} ${p} ${u} ${m}`;case"=years":return U;case"=months":return b;case"=days":return g;case"=hours":return p;case"=minutes":return u;case"=seconds":return m;case"full":default:let h="";return M>0&&(h+=U+" "),P>0&&(h+=b+" "),V>0&&(h+=g+" "),S>0&&(h+=p+" "),$>0&&(h+=u+" "),n>0&&(h+=m+" "),h.trim()}}translateUnit(t,e,i){let s=`TimeUnit${i==="short"?"Short":""}${B.capitalFirst(e)}`;return this.translate.instant(s,{value:t})}static{this.\u0275fac=function(e){return new(e||r)(v(F))}}static{this.\u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var k=(()=>{class r{constructor(t,e,i){this.formatterService=t,this.translate=e,this.cdr=i,this.lastValue="",this.langChangeSub=null}transform(t,e,i,s){return this.langChangeSub||(this.langChangeSub=this.translate.onLangChange.subscribe(()=>{this.lastValue=this.updateValue(t,e,i,s),this.cdr.markForCheck()})),this.lastValue=this.updateValue(t,e,i,s),this.lastValue}updateValue(t,e,i,s){return a.isSet(t)?this.formatterService.formatElapsedTime(t,e,i,s):""}ngOnDestroy(){this.langChangeSub?.unsubscribe()}static{this.\u0275fac=function(e){return new(e||r)(c(I,16),c(F,16),c(w,16))}}static{this.\u0275pipe=l({name:"pawFormatElapsed",type:r,pure:!1,standalone:!1})}}return r})();var G=(()=>{class r{constructor(t){this.formatterService=t}transform(t,e){return a.isSet(t)?this.formatterService.formatElapsedTimeDigits(t,e):""}static{this.\u0275fac=function(e){return new(e||r)(c(I,16))}}static{this.\u0275pipe=l({name:"pawFormatElapsedDigits",type:r,pure:!0,standalone:!1})}}return r})();var X=(()=>{class r{transform(t,e,i){return y.decimal(t,e,i)}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275pipe=l({name:"pawFormatDecimal",type:r,pure:!0,standalone:!1})}}return r})();var tt=(()=>{class r{constructor(t,e){this.translate=t,this.cdr=e,this.lastValue="",this.langChangeSub=null}transform(t){return this.langChangeSub||(this.langChangeSub=this.translate.onLangChange.subscribe(()=>{this.lastValue=this.updateValue(t),this.cdr.markForCheck()})),this.lastValue=this.updateValue(t),this.lastValue}updateValue(t){return a.isSet(t)?a.isString(t)?y.dateFromIso(t):y.dateFromIso(t.toISOString()):""}ngOnDestroy(){this.langChangeSub?.unsubscribe()}static{this.\u0275fac=function(e){return new(e||r)(c(F,16),c(w,16))}}static{this.\u0275pipe=l({name:"pawFormatDate",type:r,pure:!1,standalone:!1})}}return r})();var pt=(()=>{class r{static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275mod=x({type:r})}static{this.\u0275inj=E({imports:[z]})}}return r})();export{X as a,I as b,k as c,G as d,tt as e,pt as f};
