"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

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

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

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

var _nfcPcsc = require("nfc-pcsc");

var _indexModule = require("./../../../index.module.d");

var _package = _interopRequireDefault(require("./../../../../../../package.json"));

var _os = _interopRequireDefault(require("os"));

var _osUtils = _interopRequireDefault(require("os-utils"));

var _lodash = _interopRequireDefault(require("lodash"));

var _detectRpi = _interopRequireDefault(require("detect-rpi"));

var _diskusage = _interopRequireDefault(require("diskusage"));

function bytesToSize(bytes) {
  var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
  if (bytes === 0) return '0 Byte';
  var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
  return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
}

function print() {
  var mDisk = _diskusage["default"].checkSync('/');

  new _indexModule.Functions.Hardware.Printer.Escpos().then( /*#__PURE__*/function () {
    var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(printer) {
      return _regenerator["default"].wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              _context.next = 2;
              return printer.font('a').align('ct').size(0, 0).style('b').text("DKA Developer Test").style('').size(0, 0).text('_________________________').feed(2).text('Operasi Sistem :').style('').text("".concat(_osUtils["default"].platform())).feed(2).text('CPU Digunakan :').style('').text("".concat(_osUtils["default"].cpuCount())).feed(2).text('Status RAM :').style('').text("Tersedia : ".concat(_osUtils["default"].totalmem(), ":").concat(_osUtils["default"].freememPercentage(), " %, Total Memori : ").concat(_osUtils["default"].totalmem(), " ")).feed(2).text('Waktu Aktif :').style('').text("".concat(_os["default"].uptime())).feed(2).text('Arsitektur :').style('').text("".concat(_os["default"].arch())).feed(2).text('Node Version :').style('').text("".concat(JSON.stringify(process.versions))).feed(2).text('DKA Framework Version :').style('').text("".concat(_package["default"].version)).feed(2).text('Module List :').style('').text("".concat(process.env.PROCESSOR_REVISION)).feed(2).text('Hdd Info :').style('').text("Free : ".concat(bytesToSize(mDisk.free), " | total : ").concat(bytesToSize(mDisk.total), " | Tersedia : ").concat(bytesToSize(mDisk.available))).text('_________________________').size(0, 0).text('DKA IOT Manless System V.2').feed(2).cut().close();

            case 2:
            case "end":
              return _context.stop();
          }
        }
      }, _callee);
    }));

    return function (_x) {
      return _ref.apply(this, arguments);
    };
  }())["catch"]( /*#__PURE__*/function () {
    var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(err) {
      return _regenerator["default"].wrap(function _callee2$(_context2) {
        while (1) {
          switch (_context2.prev = _context2.next) {
            case 0:
              console.log(err);

            case 1:
            case "end":
              return _context2.stop();
          }
        }
      }, _callee2);
    }));

    return function (_x2) {
      return _ref2.apply(this, arguments);
    };
  }());
}

var Nfc = function Nfc(config) {
  var _this = this;

  (0, _classCallCheck2["default"])(this, Nfc);
  (0, _defineProperty2["default"])(this, "reader", null);
  (0, _defineProperty2["default"])(this, "restart", false);
  (0, _defineProperty2["default"])(this, "reads", /*#__PURE__*/function () {
    var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(blockNumber, callback) {
      return _regenerator["default"].wrap(function _callee12$(_context12) {
        while (1) {
          switch (_context12.prev = _context12.next) {
            case 0:
              _this.nfc.on('reader', /*#__PURE__*/function () {
                var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(reader) {
                  return _regenerator["default"].wrap(function _callee11$(_context11) {
                    while (1) {
                      switch (_context11.prev = _context11.next) {
                        case 0:
                          reader.aid = 'F222222222';
                          console.log("".concat(reader.reader.name, "  device attached"));
                          _context11.next = 4;
                          return reader.on('card', /*#__PURE__*/function () {
                            var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(card) {
                              return _regenerator["default"].wrap(function _callee9$(_context9) {
                                while (1) {
                                  switch (_context9.prev = _context9.next) {
                                    case 0:
                                      _context9.next = 2;
                                      return reader.loadAuthenticationKey(_this.config.blockHeader, 'ffffffffffff').then( /*#__PURE__*/function () {
                                        var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(res) {
                                          return _regenerator["default"].wrap(function _callee7$(_context7) {
                                            while (1) {
                                              switch (_context7.prev = _context7.next) {
                                                case 0:
                                                  console.log("Device Load Authentification");

                                                  if (blockNumber === 1 || blockNumber === 2) {
                                                    reader.authenticate(blockNumber, _this.config.keyType, 'ffffffffffff').then( /*#__PURE__*/function () {
                                                      var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(res) {
                                                        return _regenerator["default"].wrap(function _callee5$(_context5) {
                                                          while (1) {
                                                            switch (_context5.prev = _context5.next) {
                                                              case 0:
                                                                console.log("Device Authenticated Success");
                                                                reader.read(blockNumber, _this.config.dataLength).then( /*#__PURE__*/function () {
                                                                  var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(res) {
                                                                    var convertionData;
                                                                    return _regenerator["default"].wrap(function _callee3$(_context3) {
                                                                      while (1) {
                                                                        switch (_context3.prev = _context3.next) {
                                                                          case 0:
                                                                            convertionData = Buffer.from(res).toString('utf-8');
                                                                            convertionData !== "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ? callback({
                                                                              status: true,
                                                                              code: 200,
                                                                              msg: "Data Card Is Ready",
                                                                              data: convertionData.replace(/[^\x00-\x7F]/g, "")
                                                                            }) : callback({
                                                                              status: false,
                                                                              code: 500,
                                                                              msg: "Illegal Card"
                                                                            });

                                                                          case 2:
                                                                          case "end":
                                                                            return _context3.stop();
                                                                        }
                                                                      }
                                                                    }, _callee3);
                                                                  }));

                                                                  return function (_x9) {
                                                                    return _ref8.apply(this, arguments);
                                                                  };
                                                                }())["catch"]( /*#__PURE__*/function () {
                                                                  var _ref9 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(err) {
                                                                    return _regenerator["default"].wrap(function _callee4$(_context4) {
                                                                      while (1) {
                                                                        switch (_context4.prev = _context4.next) {
                                                                          case 0:
                                                                            callback({
                                                                              status: false,
                                                                              code: 500,
                                                                              msg: "error, error get data card",
                                                                              err: err
                                                                            });

                                                                          case 1:
                                                                          case "end":
                                                                            return _context4.stop();
                                                                        }
                                                                      }
                                                                    }, _callee4);
                                                                  }));

                                                                  return function (_x10) {
                                                                    return _ref9.apply(this, arguments);
                                                                  };
                                                                }());

                                                              case 2:
                                                              case "end":
                                                                return _context5.stop();
                                                            }
                                                          }
                                                        }, _callee5);
                                                      }));

                                                      return function (_x8) {
                                                        return _ref7.apply(this, arguments);
                                                      };
                                                    }())["catch"]( /*#__PURE__*/function () {
                                                      var _ref10 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(err) {
                                                        return _regenerator["default"].wrap(function _callee6$(_context6) {
                                                          while (1) {
                                                            switch (_context6.prev = _context6.next) {
                                                              case 0:
                                                              case "end":
                                                                return _context6.stop();
                                                            }
                                                          }
                                                        }, _callee6);
                                                      }));

                                                      return function (_x11) {
                                                        return _ref10.apply(this, arguments);
                                                      };
                                                    }());
                                                  } else {
                                                    callback({
                                                      status: false,
                                                      code: 500,
                                                      msg: "Error !, KeyType Must range 1 and 2"
                                                    });
                                                  }

                                                case 2:
                                                case "end":
                                                  return _context7.stop();
                                              }
                                            }
                                          }, _callee7);
                                        }));

                                        return function (_x7) {
                                          return _ref6.apply(this, arguments);
                                        };
                                      }())["catch"]( /*#__PURE__*/function () {
                                        var _ref11 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(err) {
                                          return _regenerator["default"].wrap(function _callee8$(_context8) {
                                            while (1) {
                                              switch (_context8.prev = _context8.next) {
                                                case 0:
                                                case "end":
                                                  return _context8.stop();
                                              }
                                            }
                                          }, _callee8);
                                        }));

                                        return function (_x12) {
                                          return _ref11.apply(this, arguments);
                                        };
                                      }());

                                    case 2:
                                    case "end":
                                      return _context9.stop();
                                  }
                                }
                              }, _callee9);
                            }));

                            return function (_x6) {
                              return _ref5.apply(this, arguments);
                            };
                          }());

                        case 4:
                          _context11.next = 6;
                          return reader.on('error', /*#__PURE__*/function () {
                            var _ref12 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(err) {
                              return _regenerator["default"].wrap(function _callee10$(_context10) {
                                while (1) {
                                  switch (_context10.prev = _context10.next) {
                                    case 0:
                                    case "end":
                                      return _context10.stop();
                                  }
                                }
                              }, _callee10);
                            }));

                            return function (_x13) {
                              return _ref12.apply(this, arguments);
                            };
                          }());

                        case 6:
                        case "end":
                          return _context11.stop();
                      }
                    }
                  }, _callee11);
                }));

                return function (_x5) {
                  return _ref4.apply(this, arguments);
                };
              }());

            case 1:
            case "end":
              return _context12.stop();
          }
        }
      }, _callee12);
    }));

    return function (_x3, _x4) {
      return _ref3.apply(this, arguments);
    };
  }());
  (0, _defineProperty2["default"])(this, "read", /*#__PURE__*/function () {
    var _ref13 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(callback) {
      return _regenerator["default"].wrap(function _callee16$(_context16) {
        while (1) {
          switch (_context16.prev = _context16.next) {
            case 0:
              if (!(0, _detectRpi["default"])()) {
                _context16.next = 5;
                break;
              }

              _context16.next = 3;
              return _this.nfc.on('reader', /*#__PURE__*/function () {
                var _ref14 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(reader) {
                  return _regenerator["default"].wrap(function _callee15$(_context15) {
                    while (1) {
                      switch (_context15.prev = _context15.next) {
                        case 0:
                          console.log("".concat(reader.reader.name, "  device attached"));
                          _context15.next = 3;
                          return reader.on('card', /*#__PURE__*/function () {
                            var _ref15 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(card) {
                              return _regenerator["default"].wrap(function _callee13$(_context13) {
                                while (1) {
                                  switch (_context13.prev = _context13.next) {
                                    case 0:
                                      if (!(card.uid !== _this.config.developer.uidViewSystem.find(function (element) {
                                        return element === card.uid;
                                      }))) {
                                        _context13.next = 5;
                                        break;
                                      }

                                      _context13.next = 3;
                                      return callback({
                                        status: true,
                                        code: 200,
                                        msg: "Successfully To Read Card",
                                        data: card
                                      });

                                    case 3:
                                      _context13.next = 11;
                                      break;

                                    case 5:
                                      if (!(_this.config.developer.mode === "print")) {
                                        _context13.next = 10;
                                        break;
                                      }

                                      _context13.next = 8;
                                      return print();

                                    case 8:
                                      _context13.next = 11;
                                      break;

                                    case 10:
                                      console.log({
                                        os: _osUtils["default"].platform()
                                      });

                                    case 11:
                                    case "end":
                                      return _context13.stop();
                                  }
                                }
                              }, _callee13);
                            }));

                            return function (_x16) {
                              return _ref15.apply(this, arguments);
                            };
                          }());

                        case 3:
                          _context15.next = 5;
                          return reader.on('error', /*#__PURE__*/function () {
                            var _ref16 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(err) {
                              return _regenerator["default"].wrap(function _callee14$(_context14) {
                                while (1) {
                                  switch (_context14.prev = _context14.next) {
                                    case 0:
                                      _context14.next = 2;
                                      return callback({
                                        status: false,
                                        code: 500,
                                        msg: "Fatal Error, Check Error Code",
                                        error: err
                                      });

                                    case 2:
                                    case "end":
                                      return _context14.stop();
                                  }
                                }
                              }, _callee14);
                            }));

                            return function (_x17) {
                              return _ref16.apply(this, arguments);
                            };
                          }());

                        case 5:
                        case "end":
                          return _context15.stop();
                      }
                    }
                  }, _callee15);
                }));

                return function (_x15) {
                  return _ref14.apply(this, arguments);
                };
              }());

            case 3:
              _context16.next = 6;
              break;

            case 5:
              callback({
                status: false,
                code: 500,
                msg: "this Device Not Raspberry Devices"
              });

            case 6:
            case "end":
              return _context16.stop();
          }
        }
      }, _callee16);
    }));

    return function (_x14) {
      return _ref13.apply(this, arguments);
    };
  }());
  (0, _defineProperty2["default"])(this, "raw", /*#__PURE__*/function () {
    var _ref17 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee20(callback) {
      return _regenerator["default"].wrap(function _callee20$(_context20) {
        while (1) {
          switch (_context20.prev = _context20.next) {
            case 0:
              _this.nfc.on('reader', /*#__PURE__*/function () {
                var _ref18 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee19(reader) {
                  return _regenerator["default"].wrap(function _callee19$(_context19) {
                    while (1) {
                      switch (_context19.prev = _context19.next) {
                        case 0:
                          //reader.autoProcessing = false;
                          reader.aid = '00A4040000';
                          console.log("".concat(reader.reader.name, "  device attached"));
                          _context19.next = 4;
                          return reader.on('card', /*#__PURE__*/function () {
                            var _ref19 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17(card) {
                              return _regenerator["default"].wrap(function _callee17$(_context17) {
                                while (1) {
                                  switch (_context17.prev = _context17.next) {
                                    case 0:
                                      _context17.next = 2;
                                      return callback({
                                        status: true,
                                        code: 200,
                                        msg: "Successfully To Read Card",
                                        data: card
                                      });

                                    case 2:
                                    case "end":
                                      return _context17.stop();
                                  }
                                }
                              }, _callee17);
                            }));

                            return function (_x20) {
                              return _ref19.apply(this, arguments);
                            };
                          }());

                        case 4:
                          _context19.next = 6;
                          return reader.on('error', /*#__PURE__*/function () {
                            var _ref20 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18(err) {
                              return _regenerator["default"].wrap(function _callee18$(_context18) {
                                while (1) {
                                  switch (_context18.prev = _context18.next) {
                                    case 0:
                                      _context18.next = 2;
                                      return callback({
                                        status: false,
                                        code: 500,
                                        msg: "Fatal Error, Check Error Code",
                                        error: err
                                      });

                                    case 2:
                                    case "end":
                                      return _context18.stop();
                                  }
                                }
                              }, _callee18);
                            }));

                            return function (_x21) {
                              return _ref20.apply(this, arguments);
                            };
                          }());

                        case 6:
                        case "end":
                          return _context19.stop();
                      }
                    }
                  }, _callee19);
                }));

                return function (_x19) {
                  return _ref18.apply(this, arguments);
                };
              }());

            case 1:
            case "end":
              return _context20.stop();
          }
        }
      }, _callee20);
    }));

    return function (_x18) {
      return _ref17.apply(this, arguments);
    };
  }());
  (0, _defineProperty2["default"])(this, "write", /*#__PURE__*/function () {
    var _ref21 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee29(blockNumber, data, callback) {
      return _regenerator["default"].wrap(function _callee29$(_context29) {
        while (1) {
          switch (_context29.prev = _context29.next) {
            case 0:
              _this.nfc.on('reader', /*#__PURE__*/function () {
                var _ref22 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee28(reader) {
                  return _regenerator["default"].wrap(function _callee28$(_context28) {
                    while (1) {
                      switch (_context28.prev = _context28.next) {
                        case 0:
                          _context28.next = 2;
                          return reader.on('card', /*#__PURE__*/function () {
                            var _ref23 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee27(card) {
                              return _regenerator["default"].wrap(function _callee27$(_context27) {
                                while (1) {
                                  switch (_context27.prev = _context27.next) {
                                    case 0:
                                      if (!(blockNumber === 1 || blockNumber === 2)) {
                                        _context27.next = 5;
                                        break;
                                      }

                                      _context27.next = 3;
                                      return reader.loadAuthenticationKey(_this.config.blockHeader, 'ffffffffffff').then( /*#__PURE__*/function () {
                                        var _ref24 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee25(res) {
                                          return _regenerator["default"].wrap(function _callee25$(_context25) {
                                            while (1) {
                                              switch (_context25.prev = _context25.next) {
                                                case 0:
                                                  reader.authenticate(blockNumber, _this.config.keyType, 'ffffffffffff').then( /*#__PURE__*/function () {
                                                    var _ref25 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee23(res) {
                                                      var mDataHex;
                                                      return _regenerator["default"].wrap(function _callee23$(_context23) {
                                                        while (1) {
                                                          switch (_context23.prev = _context23.next) {
                                                            case 0:
                                                              _context23.next = 2;
                                                              return Buffer.alloc(16);

                                                            case 2:
                                                              mDataHex = _context23.sent;
                                                              _context23.next = 5;
                                                              return mDataHex.fill(0);

                                                            case 5:
                                                              _context23.next = 7;
                                                              return mDataHex.write(data);

                                                            case 7:
                                                              reader.write(blockNumber, mDataHex, _this.config.dataLength).then( /*#__PURE__*/function () {
                                                                var _ref26 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee21(res) {
                                                                  return _regenerator["default"].wrap(function _callee21$(_context21) {
                                                                    while (1) {
                                                                      switch (_context21.prev = _context21.next) {
                                                                        case 0:
                                                                          callback({
                                                                            status: true,
                                                                            code: 200,
                                                                            msg: "Successfully, to Create Data",
                                                                            data: {
                                                                              data: data,
                                                                              blockNumber: blockNumber
                                                                            }
                                                                          });

                                                                        case 1:
                                                                        case "end":
                                                                          return _context21.stop();
                                                                      }
                                                                    }
                                                                  }, _callee21);
                                                                }));

                                                                return function (_x29) {
                                                                  return _ref26.apply(this, arguments);
                                                                };
                                                              }())["catch"]( /*#__PURE__*/function () {
                                                                var _ref27 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee22(err) {
                                                                  return _regenerator["default"].wrap(function _callee22$(_context22) {
                                                                    while (1) {
                                                                      switch (_context22.prev = _context22.next) {
                                                                        case 0:
                                                                          callback({
                                                                            status: false,
                                                                            code: 500,
                                                                            msg: "failed to Create Data to Card",
                                                                            err: err
                                                                          });

                                                                        case 1:
                                                                        case "end":
                                                                          return _context22.stop();
                                                                      }
                                                                    }
                                                                  }, _callee22);
                                                                }));

                                                                return function (_x30) {
                                                                  return _ref27.apply(this, arguments);
                                                                };
                                                              }());

                                                            case 8:
                                                            case "end":
                                                              return _context23.stop();
                                                          }
                                                        }
                                                      }, _callee23);
                                                    }));

                                                    return function (_x28) {
                                                      return _ref25.apply(this, arguments);
                                                    };
                                                  }())["catch"]( /*#__PURE__*/function () {
                                                    var _ref28 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee24(err) {
                                                      return _regenerator["default"].wrap(function _callee24$(_context24) {
                                                        while (1) {
                                                          switch (_context24.prev = _context24.next) {
                                                            case 0:
                                                              callback({
                                                                status: false,
                                                                code: 500,
                                                                msg: "successfully For Load Auth Key. But Faild to Authentification",
                                                                err: err
                                                              });

                                                            case 1:
                                                            case "end":
                                                              return _context24.stop();
                                                          }
                                                        }
                                                      }, _callee24);
                                                    }));

                                                    return function (_x31) {
                                                      return _ref28.apply(this, arguments);
                                                    };
                                                  }());

                                                case 1:
                                                case "end":
                                                  return _context25.stop();
                                              }
                                            }
                                          }, _callee25);
                                        }));

                                        return function (_x27) {
                                          return _ref24.apply(this, arguments);
                                        };
                                      }())["catch"]( /*#__PURE__*/function () {
                                        var _ref29 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee26(err) {
                                          return _regenerator["default"].wrap(function _callee26$(_context26) {
                                            while (1) {
                                              switch (_context26.prev = _context26.next) {
                                                case 0:
                                                  callback({
                                                    status: false,
                                                    code: 500,
                                                    msg: "Error !, Failed Load Authentifation Key",
                                                    error: err
                                                  });

                                                case 1:
                                                case "end":
                                                  return _context26.stop();
                                              }
                                            }
                                          }, _callee26);
                                        }));

                                        return function (_x32) {
                                          return _ref29.apply(this, arguments);
                                        };
                                      }());

                                    case 3:
                                      _context27.next = 6;
                                      break;

                                    case 5:
                                      callback({
                                        status: false,
                                        code: 500,
                                        msg: "Error !, KeyType Must range 1 and 2"
                                      });

                                    case 6:
                                    case "end":
                                      return _context27.stop();
                                  }
                                }
                              }, _callee27);
                            }));

                            return function (_x26) {
                              return _ref23.apply(this, arguments);
                            };
                          }());

                        case 2:
                        case "end":
                          return _context28.stop();
                      }
                    }
                  }, _callee28);
                }));

                return function (_x25) {
                  return _ref22.apply(this, arguments);
                };
              }());

            case 1:
            case "end":
              return _context29.stop();
          }
        }
      }, _callee29);
    }));

    return function (_x22, _x23, _x24) {
      return _ref21.apply(this, arguments);
    };
  }());
  this.config = _lodash["default"].extend({
    secretKey: null,
    keyType: _indexModule.Options.NFC_KEY_TYPE_A,
    blockHeader: 0,
    dataLength: 16,
    developer: {
      uidViewSystem: ['d95ed68b'],
      mode: 'print'
    }
  }, config);
  this.nfc = new _nfcPcsc.NFC();
};

var _default = Nfc;
exports["default"] = _default;
//# sourceMappingURL=index.js.map