import p from "./index-classCallCheck.js";
import f from "./index-createClass.js";
import s from "./index-assertThisInitialized.js";
import c from "./index-inherits.js";
import l from "./index-createSuper.js";
import o from "./index-defineProperty.js";
import { Parser as h } from "./index-Parser4.js";
import { numericPatterns as y } from "./index-constants4.js";
import { parseNDigits as v, parseNumericPattern as D, isLeapYearIndex as Y } from "./index-utils12.js";
var L = /* @__PURE__ */ (function(u) {
  c(i, u);
  var n = l(i);
  function i() {
    var a;
    p(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", "M", "L", "w", "I", "d", "E", "i", "e", "c", "t", "T"]), a;
  }
  return f(i, [{
    key: "parse",
    value: function(r, e, t) {
      switch (e) {
        case "D":
        case "DD":
          return D(y.dayOfYear, 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(), m = Y(t);
      return m ? e >= 1 && e <= 366 : e >= 1 && e <= 365;
    }
  }, {
    key: "set",
    value: function(r, e, t) {
      return r.setUTCMonth(0, t), r.setUTCHours(0, 0, 0, 0), r;
    }
  }]), i;
})(h);
export {
  L as DayOfYearParser
};
