"use strict";
/* eslint-disable-next-line no-unused-vars */
function __export(m) {
/* eslint-disable-next-line no-prototype-builtins */
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable-next-line no-unused-vars */
var jtv = require('@mojotech/json-type-validation');
/* eslint-disable-next-line no-unused-vars */
var damlTypes = require('@daml/types');

var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = require('../../../../DA/Internal/Template');

var Fairmint_OpenCapTable_Types_Core = require('../../../../Fairmint/OpenCapTable/Types/Core/module');
var Fairmint_OpenCapTable_Types_Monetary = require('../../../../Fairmint/OpenCapTable/Types/Monetary/module');
var Fairmint_OpenCapTable_Types_Stock = require('../../../../Fairmint/OpenCapTable/Types/Stock/module');
var Fairmint_OpenCapTable_Types_Vesting = require('../../../../Fairmint/OpenCapTable/Types/Vesting/module');


exports.EquityCompensationIssuanceOcfData = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({id: damlTypes.Text.decoder, custom_id: damlTypes.Text.decoder, date: damlTypes.Time.decoder, compensation_type: Fairmint_OpenCapTable_Types_Vesting.OcfCompensationType.decoder, quantity: damlTypes.Numeric(10).decoder, security_id: damlTypes.Text.decoder, stakeholder_id: damlTypes.Text.decoder, comments: damlTypes.List(damlTypes.Text).decoder, security_law_exemptions: damlTypes.List(Fairmint_OpenCapTable_Types_Stock.OcfSecurityExemption).decoder, vestings: damlTypes.List(Fairmint_OpenCapTable_Types_Vesting.OcfVesting).decoder, termination_exercise_windows: damlTypes.List(Fairmint_OpenCapTable_Types_Vesting.OcfTerminationWindow).decoder, base_price: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), board_approval_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), consideration_text: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), early_exercisable: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Bool).decoder), exercise_price: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), expiration_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), stock_class_id: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), stock_plan_id: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), stockholder_approval_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), vesting_terms_id: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), }); }),
  encode: function (__typed__) {
  return {
    id: damlTypes.Text.encode(__typed__.id),
    custom_id: damlTypes.Text.encode(__typed__.custom_id),
    date: damlTypes.Time.encode(__typed__.date),
    compensation_type: Fairmint_OpenCapTable_Types_Vesting.OcfCompensationType.encode(__typed__.compensation_type),
    quantity: damlTypes.Numeric(10).encode(__typed__.quantity),
    security_id: damlTypes.Text.encode(__typed__.security_id),
    stakeholder_id: damlTypes.Text.encode(__typed__.stakeholder_id),
    comments: damlTypes.List(damlTypes.Text).encode(__typed__.comments),
    security_law_exemptions: damlTypes.List(Fairmint_OpenCapTable_Types_Stock.OcfSecurityExemption).encode(__typed__.security_law_exemptions),
    vestings: damlTypes.List(Fairmint_OpenCapTable_Types_Vesting.OcfVesting).encode(__typed__.vestings),
    termination_exercise_windows: damlTypes.List(Fairmint_OpenCapTable_Types_Vesting.OcfTerminationWindow).encode(__typed__.termination_exercise_windows),
    base_price: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.base_price),
    board_approval_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.board_approval_date),
    consideration_text: damlTypes.Optional(damlTypes.Text).encode(__typed__.consideration_text),
    early_exercisable: damlTypes.Optional(damlTypes.Bool).encode(__typed__.early_exercisable),
    exercise_price: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.exercise_price),
    expiration_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.expiration_date),
    stock_class_id: damlTypes.Optional(damlTypes.Text).encode(__typed__.stock_class_id),
    stock_plan_id: damlTypes.Optional(damlTypes.Text).encode(__typed__.stock_plan_id),
    stockholder_approval_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.stockholder_approval_date),
    vesting_terms_id: damlTypes.Optional(damlTypes.Text).encode(__typed__.vesting_terms_id),
  };
}
,
};



exports.EquityCompensationIssuance = damlTypes.assembleTemplate(
{
  templateId: '#OpenCapTable-v34:Fairmint.OpenCapTable.OCF.EquityCompensationIssuance:EquityCompensationIssuance',
  templateIdWithPackageId: '0eb2e2e43d1d241492077e84452c7ffb63dd34a9af49ddec0dba636351f6486b:Fairmint.OpenCapTable.OCF.EquityCompensationIssuance:EquityCompensationIssuance',
  keyDecoder: damlTypes.lazyMemo(function () { return jtv.constant(undefined); }),
  keyEncode: function () { throw 'EncodeError'; },
  decoder: damlTypes.lazyMemo(function () { return jtv.object({context: Fairmint_OpenCapTable_Types_Core.Context.decoder, issuance_data: exports.EquityCompensationIssuanceOcfData.decoder, }); }),
  encode: function (__typed__) {
  return {
    context: Fairmint_OpenCapTable_Types_Core.Context.encode(__typed__.context),
    issuance_data: exports.EquityCompensationIssuanceOcfData.encode(__typed__.issuance_data),
  };
}
,
  Archive: {
    template: function () { return exports.EquityCompensationIssuance; },
    choiceName: 'Archive',
    argumentDecoder: damlTypes.lazyMemo(function () { return pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69.DA.Internal.Template.Archive.decoder; }),
    argumentEncode: function (__typed__) { return pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69.DA.Internal.Template.Archive.encode(__typed__); },
    resultDecoder: damlTypes.lazyMemo(function () { return damlTypes.Unit.decoder; }),
    resultEncode: function (__typed__) { return damlTypes.Unit.encode(__typed__); },
  },
}

);


damlTypes.registerTemplate(exports.EquityCompensationIssuance, ['0eb2e2e43d1d241492077e84452c7ffb63dd34a9af49ddec0dba636351f6486b', '#OpenCapTable-v34']);

