import c from "./index-classCallCheck.js";
import f from "./index-createClass.js";
import s from "./index-assertThisInitialized.js";
import l from "./index-inherits.js";
import h from "./index-createSuper.js";
import o from "./index-defineProperty.js";
import { parseNDigits as v, parseNumericPattern as _, isLeapYearIndex as T } from "./index-utils12.js";
import { Parser as P } from "./index-Parser4.js";
import { numericPatterns as C } from "./index-constants4.js";
var D = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], N = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], H = /* @__PURE__ */ (function(u) {
  l(i, u);
  var n = h(i);
  function i() {
    var a;
    c(this, i);
    for (var r = arguments.length, e = new Array(r), t = 0; t < r; t++)
      e[t] = arguments[t];
    return a = n.call.apply(n, [this].concat(e)), o(s(a), "priority", 90), o(s(a), "subPriority", 1), o(s(a), "incompatibleTokens", ["Y", "R", "q", "Q", "w", "I", "D", "i", "e", "c", "t", "T"]), a;
  }
  return f(i, [{
    key: "parse",
    value: function(r, e, t) {
      switch (e) {
        case "d":
          return _(C.date, r);
        case "do":
          return t.ordinalNumber(r, {
            unit: "date"
          });
        default:
          return v(e.length, r);
      }
    }
  }, {
    key: "validate",
    value: function(r, e) {
      var t = r.getUTCFullYear(), p = T(t), m = r.getUTCMonth();
      return p ? e >= 1 && e <= N[m] : e >= 1 && e <= D[m];
    }
  }, {
    key: "set",
    value: function(r, e, t) {
      return r.setUTCDate(t), r.setUTCHours(0, 0, 0, 0), r;
    }
  }]), i;
})(P);
export {
  H as DateParser
};
