Your IP : 3.19.188.232
import{a as X,b as v,c as H,d as w,e as N,f as R,g as k,h as C,i as L,j as z,k as j,l as $,m as B,n as U,o as q,p as G}from"./chunk-LEQN3D2Q.js";import{A as I,B as O,D as b,E as P,P as Q,s,t as Y,v as M,w as E,x as J,y as K}from"./chunk-WUJDRKKX.js";import{c as _,f as A,oc as W}from"./chunk-SXUPRFOU.js";function g(n,t){let{years:o=0,months:e=0,weeks:r=0,days:a=0,hours:f=0,minutes:i=0,seconds:m=0}=t,u=s(n),l=e||o?G(u,e+o*12):u,p=a||r?q(l,a+r*7):l,c=i+f*60,d=(m+c*60)*1e3;return E(n,p.getTime()+d)}function D(n,t){let o=s(n),e=s(t),r=o.getTime()-e.getTime();return r<0?-1:r>0?1:r}function V(n,t){let o=s(n),e=s(t),r=o.getFullYear()-e.getFullYear(),a=o.getMonth()-e.getMonth();return r*12+a}function Z(n,t){let o=s(n),e=s(t);return o.getFullYear()-e.getFullYear()}function et(n,t){let o=s(n),e=s(t),r=tt(o,e),a=Math.abs(P(o,e));o.setDate(o.getDate()-r*a);let f=+(tt(o,e)===-r),i=r*(a-f);return i===0?0:i}function tt(n,t){let o=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return o<0?-1:o>0?1:o}function x(n){return t=>{let e=(n?Math[n]:Math.trunc)(t);return e===0?0:e}}function y(n,t){return+s(n)-+s(t)}function ot(n,t,o){let e=y(n,t)/K;return x(o?.roundingMethod)(e)}function nt(n,t,o){let e=y(n,t)/J;return x(o?.roundingMethod)(e)}function rt(n){let t=s(n);return t.setHours(23,59,59,999),t}function st(n){let t=s(n),o=t.getMonth();return t.setFullYear(t.getFullYear(),o+1,0),t.setHours(23,59,59,999),t}function it(n){let t=s(n);return+rt(t)==+st(t)}function F(n,t){let o=s(n),e=s(t),r=D(o,e),a=Math.abs(V(o,e)),f;if(a<1)f=0;else{o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-r*a);let i=D(o,e)===-r;it(s(n))&&a===1&&D(n,e)===1&&(i=!1),f=r*(a-Number(i))}return f===0?0:f}function T(n,t,o){let e=y(n,t)/1e3;return x(o?.roundingMethod)(e)}function at(n,t){let o=s(n),e=s(t),r=D(o,e),a=Math.abs(Z(o,e));o.setFullYear(1584),e.setFullYear(1584);let f=D(o,e)===-r,i=r*(a-+f);return i===0?0:i}function ft(n,t,o){let e=Y(),r=o?.locale??e.locale??M,a=2520,f=D(n,t);if(isNaN(f))throw new RangeError("Invalid time value");let i=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:f}),m,u;f>0?(m=s(t),u=s(n)):(m=s(n),u=s(t));let l=T(u,m),p=(b(u)-b(m))/1e3,c=Math.round((l-p)/60),h;if(c<2)return o?.includeSeconds?l<5?r.formatDistance("lessThanXSeconds",5,i):l<10?r.formatDistance("lessThanXSeconds",10,i):l<20?r.formatDistance("lessThanXSeconds",20,i):l<40?r.formatDistance("halfAMinute",0,i):l<60?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",1,i):c===0?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",c,i);if(c<45)return r.formatDistance("xMinutes",c,i);if(c<90)return r.formatDistance("aboutXHours",1,i);if(c<O){let d=Math.round(c/60);return r.formatDistance("aboutXHours",d,i)}else{if(c<a)return r.formatDistance("xDays",1,i);if(c<I){let d=Math.round(c/O);return r.formatDistance("xDays",d,i)}else if(c<I*2)return h=Math.round(c/I),r.formatDistance("aboutXMonths",h,i)}if(h=F(u,m),h<12){let d=Math.round(c/I);return r.formatDistance("xMonths",d,i)}else{let d=h%12,S=Math.trunc(h/12);return d<3?r.formatDistance("aboutXYears",S,i):d<9?r.formatDistance("overXYears",S,i):r.formatDistance("almostXYears",S+1,i)}}var mt=["years","months","weeks","days","hours","minutes","seconds"];function ct(n,t){let o=Y(),e=t?.locale??o.locale??M,r=t?.format??mt,a=t?.zero??!1,f=t?.delimiter??" ";return e.formatDistance?r.reduce((m,u)=>{let l=`x${u.replace(/(^.)/,c=>c.toUpperCase())}`,p=n[u];return p!==void 0&&(a||n[u])?m.concat(e.formatDistance(l,p)):m},[]).join(f):""}function ut(n){let t=s(n.start),o=s(n.end),e={},r=at(o,t);r&&(e.years=r);let a=g(t,{years:e.years}),f=F(o,a);f&&(e.months=f);let i=g(a,{months:e.months}),m=et(o,i);m&&(e.days=m);let u=g(i,{days:e.days}),l=ot(o,u);l&&(e.hours=l);let p=g(u,{hours:e.hours}),c=nt(o,p);c&&(e.minutes=c);let h=g(p,{minutes:e.minutes}),d=T(o,h);return d&&(e.seconds=d),e}var lt={en:M,ru:j,be:X,de:v,es:H,fr:w,id:N,it:R,nl:k,pl:C,pt:L,pt_BR:z,tr:$,ua:B,zh:U},Ae=(()=>{let t=class t{constructor(e){this.appService=e,this.appService.desktop$.subscribe(r=>{this.locale=lt[r.$lang]||M})}formatDistance(e){return ft(e,new Date,{addSuffix:!0,locale:this.locale})}format(e,r){return Q(e,r)}formatDuration(e,r=new Date){let a=ut({start:e,end:r}),f=["years","months","weeks","days","hours","minutes","seconds"],i=f.find(u=>a[u]>0)??"seconds",m=a[i];return ct({[i]:m},{format:f,locale:this.locale})}};t.\u0275fac=function(r){return new(r||t)(A(W))},t.\u0275prov=_({token:t,factory:t.\u0275fac,providedIn:"root"});let n=t;return n})();export{Ae as a};