"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _typeof = require("@babel/runtime/helpers/typeof");

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "HorizontalKeypad", {
  enumerable: true,
  get: function get() {
    return _horizontalKeypad["default"];
  }
});
exports.keys = exports.addBrackets = void 0;
Object.defineProperty(exports, "keysForGrade", {
  enumerable: true,
  get: function get() {
    return _grades.keysForGrade;
  }
});
exports.updateSpans = exports.removeBrackets = exports.mq = void 0;

var _grades = require("./keys/grades");

var keys = _interopRequireWildcard(require("./keys"));

exports.keys = keys;

var _horizontalKeypad = _interopRequireDefault(require("./horizontal-keypad"));

var mq = _interopRequireWildcard(require("./mq"));

exports.mq = mq;

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(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; }

var addLeftBracket = function addLeftBracket(s) {
  return s.indexOf('\\(') === 0 ? s : "\\(".concat(s);
};

var addRightBracket = function addRightBracket(s) {
  return s.indexOf('\\)') === s.length - 2 ? s : "".concat(s, "\\)");
};

var rmLeftBracket = function rmLeftBracket(s) {
  return s.indexOf('\\(') === 0 ? s.substring(2) : s;
};

var rmRightBracket = function rmRightBracket(s) {
  return s.indexOf('\\)') === s.length - 2 ? s.substring(0, s.length - 2) : s;
};

var addBrackets = function addBrackets(s) {
  return addRightBracket(addLeftBracket(s));
};

exports.addBrackets = addBrackets;

var removeBrackets = function removeBrackets(s) {
  return rmRightBracket(rmLeftBracket(s));
}; // increase the font of parallel notation


exports.removeBrackets = removeBrackets;

var updateSpans = function updateSpans() {
  var spans = Array.from(document.querySelectorAll('span[mathquill-command-id]'));
  (spans || []).forEach(function (span) {
    if (span && span.innerText === '∥' && span.className !== 'mq-editable-field') {
      span.style.fontSize = '32px';
    }
  });
};

exports.updateSpans = updateSpans;
//# sourceMappingURL=index.js.map