import{t as c,a3 as a,a4 as g}from"./client-BmVmnFEC.js";function M(n,e){const t=c(n);if(isNaN(e))return a(n,NaN);if(!e)return t;const o=t.getDate(),s=a(n,t.getTime());s.setMonth(t.getMonth()+e+1,0);const r=s.getDate();return o>=r?s:(t.setFullYear(s.getFullYear(),s.getMonth(),o),t)}function D(n,e){const t=c(n),o=c(e),s=l(t,o),r=Math.abs(g(t,o));t.setDate(t.getDate()-s*r);const i=+(l(t,o)===-s),u=s*(r-i);return u===0?0:u}function l(n,e){const t=n.getFullYear()-e.getFullYear()||n.getMonth()-e.getMonth()||n.getDate()-e.getDate()||n.getHours()-e.getHours()||n.getMinutes()-e.getMinutes()||n.getSeconds()-e.getSeconds()||n.getMilliseconds()-e.getMilliseconds();return t<0?-1:t>0?1:t}function h(n){const e=c(n),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}export{M as a,D as d,h as e};