"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.AuthenticatorSetActiveStateEvent = exports.AuthenticatorRemovedEvent = exports.AuthenticatorAddedEvent = void 0;
var _m0 = _interopRequireWildcard(require("protobufjs/minimal"));
var _helpers = require("../../../helpers");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
//@ts-nocheck

/** AuthenticatorAddedEvent is an event triggered on Authenticator addition */

/** AuthenticatorAddedEvent is an event triggered on Authenticator addition */

/** AuthenticatorRemovedEvent is an event triggered on Authenticator removal */

/** AuthenticatorRemovedEvent is an event triggered on Authenticator removal */

/**
 * AuthenticatorSetActiveStateEvent is an event triggered on Authenticator
 * active state change
 */

/**
 * AuthenticatorSetActiveStateEvent is an event triggered on Authenticator
 * active state change
 */

function createBaseAuthenticatorAddedEvent() {
  return {
    sender: "",
    authenticatorType: "",
    authenticatorId: ""
  };
}
var AuthenticatorAddedEvent = exports.AuthenticatorAddedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.sender !== "") {
      writer.uint32(10).string(message.sender);
    }
    if (message.authenticatorType !== "") {
      writer.uint32(18).string(message.authenticatorType);
    }
    if (message.authenticatorId !== "") {
      writer.uint32(26).string(message.authenticatorId);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseAuthenticatorAddedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.sender = reader.string();
          break;
        case 2:
          message.authenticatorType = reader.string();
          break;
        case 3:
          message.authenticatorId = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      sender: (0, _helpers.isSet)(object.sender) ? String(object.sender) : "",
      authenticatorType: (0, _helpers.isSet)(object.authenticatorType) ? String(object.authenticatorType) : "",
      authenticatorId: (0, _helpers.isSet)(object.authenticatorId) ? String(object.authenticatorId) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.sender !== undefined && (obj.sender = message.sender);
    message.authenticatorType !== undefined && (obj.authenticatorType = message.authenticatorType);
    message.authenticatorId !== undefined && (obj.authenticatorId = message.authenticatorId);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$sender, _object$authenticator, _object$authenticator2;
    var message = createBaseAuthenticatorAddedEvent();
    message.sender = (_object$sender = object.sender) !== null && _object$sender !== void 0 ? _object$sender : "";
    message.authenticatorType = (_object$authenticator = object.authenticatorType) !== null && _object$authenticator !== void 0 ? _object$authenticator : "";
    message.authenticatorId = (_object$authenticator2 = object.authenticatorId) !== null && _object$authenticator2 !== void 0 ? _object$authenticator2 : "";
    return message;
  }
};
function createBaseAuthenticatorRemovedEvent() {
  return {
    sender: "",
    authenticatorId: ""
  };
}
var AuthenticatorRemovedEvent = exports.AuthenticatorRemovedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.sender !== "") {
      writer.uint32(10).string(message.sender);
    }
    if (message.authenticatorId !== "") {
      writer.uint32(18).string(message.authenticatorId);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseAuthenticatorRemovedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.sender = reader.string();
          break;
        case 2:
          message.authenticatorId = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      sender: (0, _helpers.isSet)(object.sender) ? String(object.sender) : "",
      authenticatorId: (0, _helpers.isSet)(object.authenticatorId) ? String(object.authenticatorId) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.sender !== undefined && (obj.sender = message.sender);
    message.authenticatorId !== undefined && (obj.authenticatorId = message.authenticatorId);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$sender2, _object$authenticator3;
    var message = createBaseAuthenticatorRemovedEvent();
    message.sender = (_object$sender2 = object.sender) !== null && _object$sender2 !== void 0 ? _object$sender2 : "";
    message.authenticatorId = (_object$authenticator3 = object.authenticatorId) !== null && _object$authenticator3 !== void 0 ? _object$authenticator3 : "";
    return message;
  }
};
function createBaseAuthenticatorSetActiveStateEvent() {
  return {
    sender: "",
    isSmartAccountActive: false
  };
}
var AuthenticatorSetActiveStateEvent = exports.AuthenticatorSetActiveStateEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.sender !== "") {
      writer.uint32(10).string(message.sender);
    }
    if (message.isSmartAccountActive === true) {
      writer.uint32(16).bool(message.isSmartAccountActive);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseAuthenticatorSetActiveStateEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.sender = reader.string();
          break;
        case 2:
          message.isSmartAccountActive = reader.bool();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      sender: (0, _helpers.isSet)(object.sender) ? String(object.sender) : "",
      isSmartAccountActive: (0, _helpers.isSet)(object.isSmartAccountActive) ? Boolean(object.isSmartAccountActive) : false
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.sender !== undefined && (obj.sender = message.sender);
    message.isSmartAccountActive !== undefined && (obj.isSmartAccountActive = message.isSmartAccountActive);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$sender3, _object$isSmartAccoun;
    var message = createBaseAuthenticatorSetActiveStateEvent();
    message.sender = (_object$sender3 = object.sender) !== null && _object$sender3 !== void 0 ? _object$sender3 : "";
    message.isSmartAccountActive = (_object$isSmartAccoun = object.isSmartAccountActive) !== null && _object$isSmartAccoun !== void 0 ? _object$isSmartAccoun : false;
    return message;
  }
};