/**
 * ldesign v0.2.13
 * (c) 2022/11/2 9:9 built by swimly
 * @license MIT
 */

import { _ as _defineProperty } from './dep-3965f55d.js';
import { d as dayjs } from './dep-6cf5affb.js';
import { c as commonjsGlobal } from './dep-1e2e1637.js';
import { _ as _baseSlice, i as isArrayLike_1, a as _isIndex } from './dep-d8386488.js';
import { e as eq_1, i as isSymbol_1 } from './dep-90a4bbce.js';
import { i as isObject_1 } from './dep-2342fbb3.js';
import './dep-cd87e657.js';

function _objectDestructuringEmpty(obj) {
  if (obj == null) throw new TypeError("Cannot destructure " + obj);
}
function _extends() {
  _extends = Object.assign ? Object.assign.bind() : function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends.apply(this, arguments);
}
var isBetween = {
  exports: {}
};
(function (module, exports) {
  !function (e, i) {
    module.exports = i();
  }(commonjsGlobal, function () {
    return function (e, i, t) {
      i.prototype.isBetween = function (e2, i2, s, f) {
        var n = t(e2),
          o = t(i2),
          r = "(" === (f = f || "()")[0],
          u = ")" === f[1];
        return (r ? this.isAfter(n, s) : !this.isBefore(n, s)) && (u ? this.isBefore(o, s) : !this.isAfter(o, s)) || (r ? this.isBefore(n, s) : !this.isAfter(n, s)) && (u ? this.isAfter(o, s) : !this.isBefore(o, s));
      };
    };
  });
})(isBetween);
var dayJsIsBetween = isBetween.exports;
var weekYear$1 = {
  exports: {}
};
(function (module, exports) {
  !function (e, t) {
    module.exports = t();
  }(commonjsGlobal, function () {
    return function (e, t) {
      t.prototype.weekYear = function () {
        var e2 = this.month(),
          t2 = this.week(),
          n = this.year();
        return 1 === t2 && 11 === e2 ? n + 1 : 0 === e2 && t2 >= 52 ? n - 1 : n;
      };
    };
  });
})(weekYear$1);
var weekYear = weekYear$1.exports;
var localeData$1 = {
  exports: {}
};
(function (module, exports) {
  !function (n, e) {
    module.exports = e();
  }(commonjsGlobal, function () {
    return function (n, e, t) {
      var r = e.prototype,
        o = function o2(n2) {
          return n2 && (n2.indexOf ? n2 : n2.s);
        },
        u = function u2(n2, e2, t2, r2, _u) {
          var i2 = n2.name ? n2 : n2.$locale(),
            a2 = o(i2[e2]),
            s2 = o(i2[t2]),
            f = a2 || s2.map(function (n3) {
              return n3.slice(0, r2);
            });
          if (!_u) return f;
          var d = i2.weekStart;
          return f.map(function (n3, e3) {
            return f[(e3 + (d || 0)) % 7];
          });
        },
        i = function i2() {
          return t.Ls[t.locale()];
        },
        a = function a2(n2, e2) {
          return n2.formats[e2] || function (n3) {
            return n3.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (n4, e3, t2) {
              return e3 || t2.slice(1);
            });
          }(n2.formats[e2.toUpperCase()]);
        },
        s = function s2() {
          var n2 = this;
          return {
            months: function months(e2) {
              return e2 ? e2.format("MMMM") : u(n2, "months");
            },
            monthsShort: function monthsShort(e2) {
              return e2 ? e2.format("MMM") : u(n2, "monthsShort", "months", 3);
            },
            firstDayOfWeek: function firstDayOfWeek() {
              return n2.$locale().weekStart || 0;
            },
            weekdays: function weekdays(e2) {
              return e2 ? e2.format("dddd") : u(n2, "weekdays");
            },
            weekdaysMin: function weekdaysMin(e2) {
              return e2 ? e2.format("dd") : u(n2, "weekdaysMin", "weekdays", 2);
            },
            weekdaysShort: function weekdaysShort(e2) {
              return e2 ? e2.format("ddd") : u(n2, "weekdaysShort", "weekdays", 3);
            },
            longDateFormat: function longDateFormat(e2) {
              return a(n2.$locale(), e2);
            },
            meridiem: this.$locale().meridiem,
            ordinal: this.$locale().ordinal
          };
        };
      r.localeData = function () {
        return s.bind(this)();
      }, t.localeData = function () {
        var n2 = i();
        return {
          firstDayOfWeek: function firstDayOfWeek() {
            return n2.weekStart || 0;
          },
          weekdays: function weekdays() {
            return t.weekdays();
          },
          weekdaysShort: function weekdaysShort() {
            return t.weekdaysShort();
          },
          weekdaysMin: function weekdaysMin() {
            return t.weekdaysMin();
          },
          months: function months() {
            return t.months();
          },
          monthsShort: function monthsShort() {
            return t.monthsShort();
          },
          longDateFormat: function longDateFormat(e2) {
            return a(n2, e2);
          },
          meridiem: n2.meridiem,
          ordinal: n2.ordinal
        };
      }, t.months = function () {
        return u(i(), "months");
      }, t.monthsShort = function () {
        return u(i(), "monthsShort", "months", 3);
      }, t.weekdays = function (n2) {
        return u(i(), "weekdays", null, null, n2);
      }, t.weekdaysShort = function (n2) {
        return u(i(), "weekdaysShort", "weekdays", 3, n2);
      }, t.weekdaysMin = function (n2) {
        return u(i(), "weekdaysMin", "weekdays", 2, n2);
      };
    };
  });
})(localeData$1);
var localeData = localeData$1.exports;
var weekOfYear$1 = {
  exports: {}
};
(function (module, exports) {
  !function (e, t) {
    module.exports = t();
  }(commonjsGlobal, function () {
    var e = "week",
      t = "year";
    return function (i, n, r) {
      var f = n.prototype;
      f.week = function (i2) {
        if (void 0 === i2 && (i2 = null), null !== i2) return this.add(7 * (i2 - this.week()), "day");
        var n2 = this.$locale().yearStart || 1;
        if (11 === this.month() && this.date() > 25) {
          var f2 = r(this).startOf(t).add(1, t).date(n2),
            s = r(this).endOf(e);
          if (f2.isBefore(s)) return 1;
        }
        var a = r(this).startOf(t).date(n2).startOf(e).subtract(1, "millisecond"),
          o = this.diff(a, e, true);
        return o < 0 ? r(this).startOf("week").week() : Math.ceil(o);
      }, f.weeks = function (e2) {
        return void 0 === e2 && (e2 = null), this.week(e2);
      };
    };
  });
})(weekOfYear$1);
var weekOfYear = weekOfYear$1.exports;
var quarterOfYear$1 = {
  exports: {}
};
(function (module, exports) {
  !function (t, n) {
    module.exports = n();
  }(commonjsGlobal, function () {
    var t = "month",
      n = "quarter";
    return function (e, i) {
      var r = i.prototype;
      r.quarter = function (t2) {
        return this.$utils().u(t2) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (t2 - 1));
      };
      var s = r.add;
      r.add = function (e2, i2) {
        return e2 = Number(e2), this.$utils().p(i2) === n ? this.add(3 * e2, t) : s.bind(this)(e2, i2);
      };
      var u = r.startOf;
      r.startOf = function (e2, i2) {
        var r2 = this.$utils(),
          s2 = !!r2.u(i2) || i2;
        if (r2.p(e2) === n) {
          var o = this.quarter() - 1;
          return s2 ? this.month(3 * o).startOf(t).startOf("day") : this.month(3 * o + 2).endOf(t).endOf("day");
        }
        return u.bind(this)(e2, i2);
      };
    };
  });
})(quarterOfYear$1);
var quarterOfYear = quarterOfYear$1.exports;
var isoWeek$1 = {
  exports: {}
};
(function (module, exports) {
  !function (e, t) {
    module.exports = t();
  }(commonjsGlobal, function () {
    var e = "day";
    return function (t, i, s) {
      var a = function a2(t2) {
          return t2.add(4 - t2.isoWeekday(), e);
        },
        d = i.prototype;
      d.isoWeekYear = function () {
        return a(this).year();
      }, d.isoWeek = function (t2) {
        if (!this.$utils().u(t2)) return this.add(7 * (t2 - this.isoWeek()), e);
        var i2,
          d2,
          n2,
          o,
          r = a(this),
          u = (i2 = this.isoWeekYear(), d2 = this.$u, n2 = (d2 ? s.utc : s)().year(i2).startOf("year"), o = 4 - n2.isoWeekday(), n2.isoWeekday() > 4 && (o += 7), n2.add(o, e));
        return r.diff(u, "week") + 1;
      }, d.isoWeekday = function (e2) {
        return this.$utils().u(e2) ? this.day() || 7 : this.day(this.day() % 7 ? e2 : e2 - 7);
      };
      var n = d.startOf;
      d.startOf = function (e2, t2) {
        var i2 = this.$utils(),
          s2 = !!i2.u(t2) || t2;
        return "isoweek" === i2.p(e2) ? s2 ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : n.bind(this)(e2, t2);
      };
    };
  });
})(isoWeek$1);
var isoWeek = isoWeek$1.exports;
var advancedFormat$1 = {
  exports: {}
};
(function (module, exports) {
  !function (e, t) {
    module.exports = t();
  }(commonjsGlobal, function () {
    return function (e, t) {
      var r = t.prototype,
        n = r.format;
      r.format = function (e2) {
        var t2 = this,
          r2 = this.$locale();
        if (!this.isValid()) return n.bind(this)(e2);
        var s = this.$utils(),
          a = (e2 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function (e3) {
            switch (e3) {
              case "Q":
                return Math.ceil((t2.$M + 1) / 3);
              case "Do":
                return r2.ordinal(t2.$D);
              case "gggg":
                return t2.weekYear();
              case "GGGG":
                return t2.isoWeekYear();
              case "wo":
                return r2.ordinal(t2.week(), "W");
              case "w":
              case "ww":
                return s.s(t2.week(), "w" === e3 ? 1 : 2, "0");
              case "W":
              case "WW":
                return s.s(t2.isoWeek(), "W" === e3 ? 1 : 2, "0");
              case "k":
              case "kk":
                return s.s(String(0 === t2.$H ? 24 : t2.$H), "k" === e3 ? 1 : 2, "0");
              case "X":
                return Math.floor(t2.$d.getTime() / 1e3);
              case "x":
                return t2.$d.getTime();
              case "z":
                return "[" + t2.offsetName() + "]";
              case "zzz":
                return "[" + t2.offsetName("long") + "]";
              default:
                return e3;
            }
          });
        return n.bind(this)(a);
      };
    };
  });
})(advancedFormat$1);
var advancedFormat = advancedFormat$1.exports;
var customParseFormat$1 = {
  exports: {}
};
(function (module, exports) {
  !function (e, t) {
    module.exports = t();
  }(commonjsGlobal, function () {
    var e = {
        LTS: "h:mm:ss A",
        LT: "h:mm A",
        L: "MM/DD/YYYY",
        LL: "MMMM D, YYYY",
        LLL: "MMMM D, YYYY h:mm A",
        LLLL: "dddd, MMMM D, YYYY h:mm A"
      },
      t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,
      n = /\d\d/,
      r = /\d\d?/,
      i = /\d*[^-_:/,()\s\d]+/,
      o = {},
      s = function s2(e2) {
        return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
      };
    var a = function a2(e2) {
        return function (t2) {
          this[e2] = +t2;
        };
      },
      f = [/[+-]\d\d:?(\d\d)?|Z/, function (e2) {
        (this.zone || (this.zone = {})).offset = function (e3) {
          if (!e3) return 0;
          if ("Z" === e3) return 0;
          var t2 = e3.match(/([+-]|\d\d)/g),
            n2 = 60 * t2[1] + (+t2[2] || 0);
          return 0 === n2 ? 0 : "+" === t2[0] ? -n2 : n2;
        }(e2);
      }],
      h = function h2(e2) {
        var t2 = o[e2];
        return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
      },
      u = function u2(e2, t2) {
        var n2,
          r2 = o.meridiem;
        if (r2) {
          for (var i2 = 1; i2 <= 24; i2 += 1) {
            if (e2.indexOf(r2(i2, 0, t2)) > -1) {
              n2 = i2 > 12;
              break;
            }
          }
        } else n2 = e2 === (t2 ? "pm" : "PM");
        return n2;
      },
      d = {
        A: [i, function (e2) {
          this.afternoon = u(e2, false);
        }],
        a: [i, function (e2) {
          this.afternoon = u(e2, true);
        }],
        S: [/\d/, function (e2) {
          this.milliseconds = 100 * +e2;
        }],
        SS: [n, function (e2) {
          this.milliseconds = 10 * +e2;
        }],
        SSS: [/\d{3}/, function (e2) {
          this.milliseconds = +e2;
        }],
        s: [r, a("seconds")],
        ss: [r, a("seconds")],
        m: [r, a("minutes")],
        mm: [r, a("minutes")],
        H: [r, a("hours")],
        h: [r, a("hours")],
        HH: [r, a("hours")],
        hh: [r, a("hours")],
        D: [r, a("day")],
        DD: [n, a("day")],
        Do: [i, function (e2) {
          var t2 = o.ordinal,
            n2 = e2.match(/\d+/);
          if (this.day = n2[0], t2) for (var r2 = 1; r2 <= 31; r2 += 1) {
            t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
          }
        }],
        M: [r, a("month")],
        MM: [n, a("month")],
        MMM: [i, function (e2) {
          var t2 = h("months"),
            n2 = (h("monthsShort") || t2.map(function (e3) {
              return e3.slice(0, 3);
            })).indexOf(e2) + 1;
          if (n2 < 1) throw new Error();
          this.month = n2 % 12 || n2;
        }],
        MMMM: [i, function (e2) {
          var t2 = h("months").indexOf(e2) + 1;
          if (t2 < 1) throw new Error();
          this.month = t2 % 12 || t2;
        }],
        Y: [/[+-]?\d+/, a("year")],
        YY: [n, function (e2) {
          this.year = s(e2);
        }],
        YYYY: [/\d{4}/, a("year")],
        Z: f,
        ZZ: f
      };
    function c(n2) {
      var r2, i2;
      r2 = n2, i2 = o && o.formats;
      for (var s2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (t2, n3, r3) {
          var o2 = r3 && r3.toUpperCase();
          return n3 || i2[r3] || e[r3] || i2[o2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (e2, t3, n4) {
            return t3 || n4.slice(1);
          });
        })).match(t), a2 = s2.length, f2 = 0; f2 < a2; f2 += 1) {
        var h2 = s2[f2],
          u2 = d[h2],
          c2 = u2 && u2[0],
          l = u2 && u2[1];
        s2[f2] = l ? {
          regex: c2,
          parser: l
        } : h2.replace(/^\[|\]$/g, "");
      }
      return function (e2) {
        for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
          var i3 = s2[n3];
          if ("string" == typeof i3) r3 += i3.length;else {
            var o2 = i3.regex,
              f3 = i3.parser,
              h3 = e2.slice(r3),
              u3 = o2.exec(h3)[0];
            f3.call(t2, u3), e2 = e2.replace(u3, "");
          }
        }
        return function (e3) {
          var t3 = e3.afternoon;
          if (void 0 !== t3) {
            var n4 = e3.hours;
            t3 ? n4 < 12 && (e3.hours += 12) : 12 === n4 && (e3.hours = 0), delete e3.afternoon;
          }
        }(t2), t2;
      };
    }
    return function (e2, t2, n2) {
      n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (s = e2.parseTwoDigitYear);
      var r2 = t2.prototype,
        i2 = r2.parse;
      r2.parse = function (e3) {
        var t3 = e3.date,
          r3 = e3.utc,
          s2 = e3.args;
        this.$u = r3;
        var a2 = s2[1];
        if ("string" == typeof a2) {
          var f2 = true === s2[2],
            h2 = true === s2[3],
            u2 = f2 || h2,
            d2 = s2[2];
          h2 && (d2 = s2[2]), o = this.$locale(), !f2 && d2 && (o = n2.Ls[d2]), this.$d = function (e4, t4, n3) {
            try {
              if (["x", "X"].indexOf(t4) > -1) return new Date(("X" === t4 ? 1e3 : 1) * e4);
              var r4 = c(t4)(e4),
                i3 = r4.year,
                o2 = r4.month,
                s3 = r4.day,
                a3 = r4.hours,
                f3 = r4.minutes,
                h3 = r4.seconds,
                u3 = r4.milliseconds,
                d3 = r4.zone,
                l2 = new Date(),
                m2 = s3 || (i3 || o2 ? 1 : l2.getDate()),
                M2 = i3 || l2.getFullYear(),
                Y = 0;
              i3 && !o2 || (Y = o2 > 0 ? o2 - 1 : l2.getMonth());
              var p = a3 || 0,
                v = f3 || 0,
                D = h3 || 0,
                g = u3 || 0;
              return d3 ? new Date(Date.UTC(M2, Y, m2, p, v, D, g + 60 * d3.offset * 1e3)) : n3 ? new Date(Date.UTC(M2, Y, m2, p, v, D, g)) : new Date(M2, Y, m2, p, v, D, g);
            } catch (e5) {
              return new Date("");
            }
          }(t3, a2, r3), this.init(), d2 && true !== d2 && (this.$L = this.locale(d2).$L), u2 && t3 != this.format(a2) && (this.$d = new Date("")), o = {};
        } else if (a2 instanceof Array) for (var l = a2.length, m = 1; m <= l; m += 1) {
          s2[1] = a2[m - 1];
          var M = n2.apply(this, s2);
          if (M.isValid()) {
            this.$d = M.$d, this.$L = M.$L, this.init();
            break;
          }
          m === l && (this.$d = new Date(""));
        } else i2.call(this, e3);
      };
    };
  });
})(customParseFormat$1);
var customParseFormat = customParseFormat$1.exports;
var eq = eq_1,
  isArrayLike = isArrayLike_1,
  isIndex = _isIndex,
  isObject$1 = isObject_1;
function isIterateeCall$1(value, index, object) {
  if (!isObject$1(object)) {
    return false;
  }
  var type = typeof index;
  if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
    return eq(object[index], value);
  }
  return false;
}
var _isIterateeCall = isIterateeCall$1;
var reWhitespace = /\s/;
function trimmedEndIndex$1(string) {
  var index = string.length;
  while (index-- && reWhitespace.test(string.charAt(index))) {}
  return index;
}
var _trimmedEndIndex = trimmedEndIndex$1;
var trimmedEndIndex = _trimmedEndIndex;
var reTrimStart = /^\s+/;
function baseTrim$1(string) {
  return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
}
var _baseTrim = baseTrim$1;
var baseTrim = _baseTrim,
  isObject = isObject_1,
  isSymbol = isSymbol_1;
var NAN = 0 / 0;
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
var reIsBinary = /^0b[01]+$/i;
var reIsOctal = /^0o[0-7]+$/i;
var freeParseInt = parseInt;
function toNumber$1(value) {
  if (typeof value == "number") {
    return value;
  }
  if (isSymbol(value)) {
    return NAN;
  }
  if (isObject(value)) {
    var other = typeof value.valueOf == "function" ? value.valueOf() : value;
    value = isObject(other) ? other + "" : other;
  }
  if (typeof value != "string") {
    return value === 0 ? value : +value;
  }
  value = baseTrim(value);
  var isBinary = reIsBinary.test(value);
  return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
}
var toNumber_1 = toNumber$1;
var toNumber = toNumber_1;
var INFINITY = 1 / 0,
  MAX_INTEGER = 17976931348623157e292;
function toFinite$1(value) {
  if (!value) {
    return value === 0 ? value : 0;
  }
  value = toNumber(value);
  if (value === INFINITY || value === -INFINITY) {
    var sign = value < 0 ? -1 : 1;
    return sign * MAX_INTEGER;
  }
  return value === value ? value : 0;
}
var toFinite_1 = toFinite$1;
var toFinite = toFinite_1;
function toInteger$1(value) {
  var result = toFinite(value),
    remainder = result % 1;
  return result === result ? remainder ? result - remainder : result : 0;
}
var toInteger_1 = toInteger$1;
var baseSlice = _baseSlice,
  isIterateeCall = _isIterateeCall,
  toInteger = toInteger_1;
var nativeCeil = Math.ceil,
  nativeMax = Math.max;
function chunk(array, size, guard) {
  if (guard ? isIterateeCall(array, size, guard) : size === void 0) {
    size = 1;
  } else {
    size = nativeMax(toInteger(size), 0);
  }
  var length = array == null ? 0 : array.length;
  if (!length || size < 1) {
    return [];
  }
  var index = 0,
    resIndex = 0,
    result = Array(nativeCeil(length / size));
  while (index < length) {
    result[resIndex++] = baseSlice(array, index, index += size);
  }
  return result;
}
var chunk_1 = chunk;
function ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    enumerableOnly && (symbols = symbols.filter(function (sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    })), keys.push.apply(keys, symbols);
  }
  return keys;
}
function _objectSpread(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = null != arguments[i] ? arguments[i] : {};
    i % 2 ? ownKeys(Object(source), true).forEach(function (key) {
      _defineProperty(target, key, source[key]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
    });
  }
  return target;
}
dayjs.extend(isoWeek);
dayjs.extend(weekYear);
dayjs.extend(localeData);
dayjs.extend(weekOfYear);
dayjs.extend(quarterOfYear);
dayjs.extend(advancedFormat);
dayjs.extend(customParseFormat);
dayjs.extend(dayJsIsBetween);
function firstUpperCase(str) {
  if (!str) return str;
  return str[0].toUpperCase().concat(str.substring(1, str.length));
}
function getFirstDayOfMonth(_ref) {
  var {
    year,
    month
  } = _ref;
  return new Date(year, month, 1);
}
function getDaysInMonth(_ref2) {
  var {
    year,
    month
  } = _ref2;
  return new Date(year, month + 1, 0).getDate();
}
function getLastDayOfMonth(_ref3) {
  var {
    year,
    month
  } = _ref3;
  return new Date(year, month, getDaysInMonth({
    year,
    month
  }));
}
function isSameYear(date1, date2) {
  return date1.getFullYear() === date2.getFullYear();
}
function isSameQuarter(date1, date2) {
  return isSameYear(date1, date2) && dayjs(date1).quarter() === dayjs(date2).quarter();
}
function isSameMonth(date1, date2) {
  return isSameYear(date1, date2) && date1.getMonth() === date2.getMonth();
}
function isSameWeek(date1, date2) {
  return isSameMonth(date1, date2) && dayjs(date1).week() === dayjs(date2).week();
}
function isSameDate(date1, date2) {
  return isSameMonth(date1, date2) && date1.getDate() === date2.getDate();
}
function compareAsc(date1, date2) {
  var d1 = date1.getTime();
  var d2 = date2.getTime();
  if (d1 < d2) return -1;
  if (d1 > d2) return 1;
  return 0;
}
function isSame(date1, date2) {
  var type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "date";
  var func = {
    isSameYear,
    isSameQuarter,
    isSameMonth,
    isSameWeek,
    isSameDate
  };
  return func["isSame".concat(firstUpperCase(type))](date1, date2);
}
function outOfRanges(d, min, max) {
  return min && compareAsc(d, min) === -1 || max && compareAsc(d, max) === 1;
}
function getToday() {
  var now = new Date();
  return new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0);
}
function subtractMonth(date, num) {
  return dayjs(date).subtract(num, "month").toDate();
}
function addMonth(date, num) {
  return dayjs(date).add(num, "month").toDate();
}
function getWeeks(_ref4, _ref5) {
  var {
    year,
    month
  } = _ref4;
  var {
    firstDayOfWeek,
    showWeekOfYear = false,
    disableDate = () => false,
    minDate,
    maxDate
  } = _ref5;
  var prependDay = getFirstDayOfMonth({
    year,
    month
  });
  var appendDay = getLastDayOfMonth({
    year,
    month
  });
  var maxDays = getDaysInMonth({
    year,
    month
  });
  var daysArr = [];
  var i = 1;
  var today = getToday();
  for (i; i <= maxDays; i++) {
    var currentDay = new Date(year, month, i);
    daysArr.push({
      text: i,
      active: false,
      value: currentDay,
      disabled: typeof disableDate === "function" && disableDate(currentDay) || outOfRanges(currentDay, minDate, maxDate),
      now: isSame(today, currentDay),
      firstDayOfMonth: i === 1,
      lastDayOfMonth: i === maxDays,
      type: "current-month"
    });
  }
  if (prependDay.getDay() !== firstDayOfWeek) {
    prependDay.setDate(0);
    while (true) {
      daysArr.unshift({
        text: prependDay.getDate().toString(),
        active: false,
        value: new Date(prependDay),
        disabled: typeof disableDate === "function" && disableDate(prependDay) || outOfRanges(prependDay, minDate, maxDate),
        additional: true,
        type: "prev-month"
      });
      prependDay.setDate(prependDay.getDate() - 1);
      if (prependDay.getDay() === Math.abs(firstDayOfWeek + 6) % 7) break;
    }
  }
  var LEN = 42;
  while (daysArr.length < LEN) {
    appendDay.setDate(appendDay.getDate() + 1);
    daysArr.push({
      text: appendDay.getDate(),
      active: false,
      value: new Date(appendDay),
      disabled: typeof disableDate === "function" && disableDate(appendDay) || outOfRanges(appendDay, minDate, maxDate),
      additional: true,
      type: "next-month"
    });
  }
  var dataList = chunk_1(daysArr, 7);
  if (showWeekOfYear) {
    dataList.forEach(d => {
      d.unshift(_objectSpread(_objectSpread({}, d[0]), {}, {
        active: false,
        value: d[0].value,
        text: dayjs(d[0].value).week()
      }));
    });
  }
  return dataList;
}
function getQuarters(year, _ref6) {
  var {
    disableDate = () => false,
    minDate,
    maxDate,
    quarterLocal
  } = _ref6;
  var quarterArr = [];
  var today = getToday();
  for (var i = 1; i <= 4; i++) {
    var date = dayjs(new Date(year, 0)).quarter(i).toDate();
    quarterArr.push({
      value: date,
      now: isSame(date, today, "quarter"),
      disabled: typeof disableDate === "function" && disableDate(date) || outOfRanges(date, minDate, maxDate),
      active: false,
      text: quarterLocal[i - 1]
    });
  }
  return chunk_1(quarterArr, 4);
}
function getYears(year, _ref7) {
  var {
    disableDate = () => false,
    minDate,
    maxDate
  } = _ref7;
  var startYear = parseInt((year / 10).toString(), 10) * 10;
  var endYear = startYear + 9;
  var yearArr = [];
  var today = getToday();
  for (var i = startYear; i <= endYear; i++) {
    var date = new Date(i, 1);
    yearArr.push({
      value: date,
      now: isSame(date, today, "year"),
      disabled: typeof disableDate === "function" && disableDate(date) || outOfRanges(date, minDate, maxDate),
      active: false,
      text: "".concat(date.getFullYear())
    });
  }
  return chunk_1(yearArr, 3);
}
function getMonths(year, params) {
  var {
    disableDate = () => false,
    minDate,
    maxDate,
    monthLocal
  } = params;
  var MonthArr = [];
  var today = getToday();
  for (var i = 0; i <= 11; i++) {
    var date = new Date(year, i);
    MonthArr.push({
      value: date,
      now: isSame(date, today, "month"),
      disabled: typeof disableDate === "function" && disableDate(date) || outOfRanges(date, minDate, maxDate),
      active: false,
      text: monthLocal[date.getMonth()]
    });
  }
  return chunk_1(MonthArr, 3);
}
function flagActive(data, _ref8) {
  var args = _extends({}, (_objectDestructuringEmpty(_ref8), _ref8));
  var {
    start,
    end,
    hoverStart,
    hoverEnd,
    type = "date",
    isRange = false
  } = args;
  if (type === "week") return data;
  if (!isRange) {
    return data.map(row => row.map(item => {
      var _item = item;
      _item.active = start && isSame(item.value, start, type) && !_item.additional;
      return _item;
    }));
  }
  return data.map(row => row.map(item => {
    var _item = item;
    var date = item.value;
    var isStart = start && isSame(start, date, type);
    var isHoverStart = hoverStart && isSame(hoverStart, date, type);
    var isEnd = end && isSame(end, date, type);
    var isHoverEnd = hoverEnd && isSame(hoverEnd, date, type);
    _item.active = (isStart || isEnd) && !_item.additional;
    if (start && end) {
      _item.highlight = dayjs(date).isBetween(start, end, type, "[]") && !_item.additional;
      _item.startOfRange = isStart;
      _item.endOfRange = isEnd;
    }
    if (hoverStart && hoverEnd) {
      _item.hoverHighlight = dayjs(date).isBetween(hoverStart, hoverEnd, type, "[]") && !_item.additional;
      _item.hoverStartOfRange = isHoverStart;
      _item.hoverEndOfRange = isHoverEnd;
    }
    return _item;
  }));
}
function extractTimeFormat() {
  var dateFormat = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
  var res = dateFormat.match(/(a\s)?h{1,2}:m{1,2}(:s{1,2})?(\sa)?/i);
  if (!res) return null;
  return res[0];
}
function extractTimeObj() {
  var timeFormat = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
  var matchedMeridiem = timeFormat.match(/[ap]m/i) || [""];
  var timeReg = /\d{1,2}:\d{1,2}(:\d{1,2})?(:\d{1,3})?/;
  var matchedTimeStr = timeFormat.match(timeReg) || ["0:0:0:0"];
  var [hours = 0, minutes = 0, seconds = 0, milliseconds = 0] = matchedTimeStr[0].split(":");
  return {
    hours: +hours,
    minutes: +minutes,
    seconds: +seconds,
    milliseconds: +milliseconds,
    meridiem: matchedMeridiem[0]
  };
}

export { addMonth as a, extractTimeFormat as b, getQuarters as c, getMonths as d, extractTimeObj as e, getYears as f, getWeeks as g, flagActive as h, subtractMonth as s };
//# sourceMappingURL=dep-4464fd83.js.map
