"use strict";const c=require("date-fns");function m(t){const n=new Date,o=c.differenceInSeconds(n,t),r=c.differenceInMinutes(n,t),i=c.differenceInHours(n,t),s=c.differenceInDays(n,t);if(s>0)return`${s}d`;if(i>0){const e=r-i*60;return`${i}h${e>0?`${e}m`:""}`}if(r>0){const e=o-r*60;return`${r}m${e>0?`${e}s`:""}`}return`${o}s`}const f={E:10n**18n,EB:10n**18n,P:10n**15n,PB:10n**15n,T:10n**12n,TB:10n**12n,G:10n**9n,GB:10n**9n,M:10n**6n,MB:10n**6n,k:10n**3n,KB:10n**3n,Ei:2n**60n,Pi:2n**50n,Ti:2n**40n,Gi:2n**30n,Mi:2n**20n,Ki:2n**10n,B:1n};function M({from:t,to:n="MB",round:o}){const i=/^(\d+(?:\.\d+)?)([EPTGMkEiPiTiGiMiKiB]*)$/.exec(t);if(!i)return"";const[,s,e]=i;let[l,u=""]=s.split(".");u=u.padEnd(6,"0");const B=BigInt(l)*10n**6n+BigInt(u),a=f[e]||1n,d=f[n];return`${B*a/10n**6n/d}${n}`}exports.convertByteUnits=M;exports.formatTimeDifference=m;
