"use strict";const n=require("./index.cjs81.js");require("./index.cjs82.js");const o=require("./index.cjs39.js");require("./index.cjs40.js");require("./index.cjs41.js");require("./index.cjs42.js");require("./index.cjs43.js");require("./index.cjs44.js");require("./index.cjs45.js");require("./index.cjs46.js");require("./index.cjs47.js");require("./index.cjs48.js");require("./index.cjs49.js");require("./index.cjs50.js");require("./index.cjs51.js");require("./index.cjs52.js");require("./index.cjs53.js");require("./index.cjs54.js");require("./index.cjs55.js");require("./index.cjs56.js");require("./index.cjs57.js");require("./index.cjs58.js");require("./index.cjs59.js");require("./index.cjs60.js");require("./index.cjs61.js");require("./index.cjs62.js");require("./index.cjs63.js");require("./index.cjs64.js");require("./index.cjs65.js");require("./index.cjs66.js");const u="en",h=31;class i{static Calendars;static DateFormats;static Defaults;locale;name;constructor(t=u,e=i.Calendars.gregorian){this.locale=t,this.name=e}addDate(t,e){const r=this.moment(t);return this.isHijri()?r.add(e,"iDate"):r.add(e,"date")}addMonth(t,e){const r=this.moment(t);return this.isHijri()?r.add(e,"iMonth"):r.add(e,"month")}addYear(t,e){const r=this.moment(t);return this.isHijri()?r.add(e,"iYear"):r.add(e,"year")}convertToDate({year:t,month:e,date:r}){let a=this.moment().hours(0).minutes(0).seconds(0);return this.isHijri()?a=a.iYear(t||this.getDefaultYear()).iMonth(e||this.getDefaultMonth()).iDate(r||this.getDefaultDate()):a=a.year(t||this.getDefaultYear()).month(e||this.getDefaultMonth()).date(r||this.getDefaultDate()),a}daysInMonth(t,e){const r=t||this.getDefaultYear(),a=e||this.getDefaultMonth(),s=this.convertToDate({year:r,month:a,date:this.getDefaultDate()});return(this.isHijri()?s.iDaysInMonth():s.daysInMonth())||h}format(t,e=i.DateFormats.gregorian){return this.moment(t).format(i.DateFormats[this.name][e])}getDefaultDate(){return i.Defaults[this.name].date}getDefaultMonth(){return i.Defaults[this.name].month}getDefaultYear(){return i.Defaults[this.name].year}isHijri(){return this.name===i.Calendars.hijri}listMonths(){const t=this.moment().localeData();return this.isHijri()?t._iMonths:t.months()}parseNegative(t){const e=t.match(/^-(\d{4})(-\d{2}-\d{2})$/);if(!e)return t;const[r,a,s]=e;return`-${a.padStart(6,"0")}${s}`}moment(t=null){const e=o.isString(t)?this.parseNegative(t):t,r=e?n(e):n();return r.locale(this.locale),r}parseDate(t){const e=this.moment(t);return{year:this.isHijri()?e.iYear():e.year(),month:this.isHijri()?e.iMonth():e.month(),date:this.isHijri()?e.iDate():e.date()}}}i.Calendars={gregorian:"gregorian",hijri:"hijri"};i.DateFormats={[i.Calendars.gregorian]:{0:"YYYY",1:"MMMM YYYY",2:"L"},[i.Calendars.hijri]:{0:"iYYYY",1:"iMMMM iYYYY",2:"iM/iD/iYYYY"}};i.Defaults={[i.Calendars.gregorian]:{year:0,month:0,date:1},[i.Calendars.hijri]:{year:1410,month:0,date:1}};module.exports=i;
//# sourceMappingURL=index.cjs23.js.map
