import m from "./index-classCallCheck.js";
import p from "./index-createClass.js";
import f from "./index-assertThisInitialized.js";
import y from "./index-inherits.js";
import d from "./index-createSuper.js";
import c from "./index-defineProperty.js";
import { Parser as w } from "./index-Parser4.js";
import { mapValue as n, parseNDigits as h } from "./index-utils12.js";
import v from "./index-setUTCISODay.js";
var O = /* @__PURE__ */ (function(l) {
  y(e, l);
  var s = d(e);
  function e() {
    var o;
    m(this, e);
    for (var r = arguments.length, i = new Array(r), t = 0; t < r; t++)
      i[t] = arguments[t];
    return o = s.call.apply(s, [this].concat(i)), c(f(o), "priority", 90), c(f(o), "incompatibleTokens", ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "E", "e", "c", "t", "T"]), o;
  }
  return p(e, [{
    key: "parse",
    value: function(r, i, t) {
      var a = function(u) {
        return u === 0 ? 7 : u;
      };
      switch (i) {
        // 2
        case "i":
        case "ii":
          return h(i.length, r);
        // 2nd
        case "io":
          return t.ordinalNumber(r, {
            unit: "day"
          });
        // Tue
        case "iii":
          return n(t.day(r, {
            width: "abbreviated",
            context: "formatting"
          }) || t.day(r, {
            width: "short",
            context: "formatting"
          }) || t.day(r, {
            width: "narrow",
            context: "formatting"
          }), a);
        // T
        case "iiiii":
          return n(t.day(r, {
            width: "narrow",
            context: "formatting"
          }), a);
        // Tu
        case "iiiiii":
          return n(t.day(r, {
            width: "short",
            context: "formatting"
          }) || t.day(r, {
            width: "narrow",
            context: "formatting"
          }), a);
        // Tuesday
        case "iiii":
        default:
          return n(t.day(r, {
            width: "wide",
            context: "formatting"
          }) || t.day(r, {
            width: "abbreviated",
            context: "formatting"
          }) || t.day(r, {
            width: "short",
            context: "formatting"
          }) || t.day(r, {
            width: "narrow",
            context: "formatting"
          }), a);
      }
    }
  }, {
    key: "validate",
    value: function(r, i) {
      return i >= 1 && i <= 7;
    }
  }, {
    key: "set",
    value: function(r, i, t) {
      return r = v(r, t), r.setUTCHours(0, 0, 0, 0), r;
    }
  }]), e;
})(w);
export {
  O as ISODayParser
};
