"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.VerticalLineSupersmushing = exports.Underscore = exports.HorizontalLine = exports.Hierarchy = exports.EqualCharacter = void 0;
exports.fromHeader = fromHeader;

var A = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect-ts/core/Collections/Immutable/Array"));

var C = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect-ts/core/Collections/Immutable/Chunk"));

var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect-ts/core/Either"));

var _Function = /*#__PURE__*/require("@effect-ts/core/Function");

var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect-ts/core/Option"));

var _Utils = /*#__PURE__*/require("@effect-ts/core/Utils");

var FullLayout = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("../../FigHeader/FullLayout/index.js"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

// ets_tracing: off
// -----------------------------------------------------------------------------
// Constructors
// -----------------------------------------------------------------------------
const EqualCharacter = {
  _tag: "EqualCharacter"
};
exports.EqualCharacter = EqualCharacter;
const Underscore = {
  _tag: "Underscore"
};
exports.Underscore = Underscore;
const Hierarchy = {
  _tag: "Hierarchy"
};
exports.Hierarchy = Hierarchy;
const HorizontalLine = {
  _tag: "HorizontalLine"
};
exports.HorizontalLine = HorizontalLine;
const VerticalLineSupersmushing = {
  _tag: "VerticalLineSupersmushing"
};
/**
 * Interprets the header settings and returns the selected `VerticalSmushingRule`s.
 *
 * @param header The `FigHeader` where the vertical layout is defined.
 * @returns A `FigletResult` containing a list of `VerticalSmushingRule`s, or
 * a list of `FigletException`s accumulated during parsing.
 */

exports.VerticalLineSupersmushing = VerticalLineSupersmushing;

function fromHeader(header) {
  return E.right(O.getOrElse_(O.map_(header.fullLayout, settings => C.from(A.collect_(A.intersection_(FullLayout.equalFullLayout)(C.toArray(settings), C.toArray(FullLayout.verticalSmushingRules)), (0, _Utils.matchTag)({
    EqualCharacterVerticalSmushing: () => O.some(EqualCharacter),
    UnderscoreVerticalSmushing: () => O.some(Underscore),
    HierarchyVerticalSmushing: () => O.some(Hierarchy),
    HorizontalLineVerticalSmushing: () => O.some(HorizontalLine),
    VerticalLineSupersmushing: () => O.some(VerticalLineSupersmushing)
  }, () => O.emptyOf())))), () => C.empty()));
}
//# sourceMappingURL=index.js.map