text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.bitwiseOperations = exports.opEqualVerify = exports.opEqual = void 0;
  const combinators_1 = require("./combinators");
  const flow_control_1 = require("./flow-control");
  const opcodes_1 = require("./opcodes");
  const types_1 = require("./types");
  const areEqual = (a, b) => {
      if (a.length !== b.length) {
          return false;
      }
      // eslint-disable-next-line functional/no-let, functional/no-loop-statement, no-plusplus
      for (let i = 0; i < a.length; i++) {
          if (a[i] !== b[i]) {
              return false;
          }
      }
      return true;
  };
  exports.opEqual = () => (state) => combinators_1.useTwoStackItems(state, (nextState, [element1, element2]) => combinators_1.pushToStack(nextState, types_1.booleanToScriptNumber(areEqual(element1, element2))));
  exports.opEqualVerify = () => combinators_1.combineOperations(exports.opEqual(), flow_control_1.opVerify());
  exports.bitwiseOperations = () => ({
      [opcodes_1.OpcodesCommon.OP_EQUAL]: exports.opEqual(),
      [opcodes_1.OpcodesCommon.OP_EQUALVERIFY]: exports.opEqualVerify(),
  });
  //# sourceMappingURL=bitwise.js.map