import l from "./index-classCallCheck.js";
import q from "./index-createClass.js";
import s from "./index-assertThisInitialized.js";
import c from "./index-inherits.js";
import p from "./index-createSuper.js";
import i from "./index-defineProperty.js";
import { Parser as f } from "./index-Parser4.js";
import { parseNDigits as d } from "./index-utils12.js";
var T = /* @__PURE__ */ (function(u) {
  c(n, u);
  var o = p(n);
  function n() {
    var a;
    l(this, n);
    for (var r = arguments.length, t = new Array(r), e = 0; e < r; e++)
      t[e] = arguments[e];
    return a = o.call.apply(o, [this].concat(t)), i(s(a), "priority", 120), i(s(a), "incompatibleTokens", ["Y", "R", "Q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]), a;
  }
  return q(n, [{
    key: "parse",
    value: function(r, t, e) {
      switch (t) {
        // 1, 2, 3, 4
        case "q":
        case "qq":
          return d(t.length, r);
        // 1st, 2nd, 3rd, 4th
        case "qo":
          return e.ordinalNumber(r, {
            unit: "quarter"
          });
        // Q1, Q2, Q3, Q4
        case "qqq":
          return e.quarter(r, {
            width: "abbreviated",
            context: "standalone"
          }) || e.quarter(r, {
            width: "narrow",
            context: "standalone"
          });
        // 1, 2, 3, 4 (narrow quarter; could be not numerical)
        case "qqqqq":
          return e.quarter(r, {
            width: "narrow",
            context: "standalone"
          });
        // 1st quarter, 2nd quarter, ...
        case "qqqq":
        default:
          return e.quarter(r, {
            width: "wide",
            context: "standalone"
          }) || e.quarter(r, {
            width: "abbreviated",
            context: "standalone"
          }) || e.quarter(r, {
            width: "narrow",
            context: "standalone"
          });
      }
    }
  }, {
    key: "validate",
    value: function(r, t) {
      return t >= 1 && t <= 4;
    }
  }, {
    key: "set",
    value: function(r, t, e) {
      return r.setUTCMonth((e - 1) * 3, 1), r.setUTCHours(0, 0, 0, 0), r;
    }
  }]), n;
})(f);
export {
  T as StandAloneQuarterParser
};
