

const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
const require_zod = require('../../../utils/zod.js');
const require_okpJwk = require('../jwk/kty/okp/okpJwk.js');
const require_common = require('./common.js');
const require_KmsKeyAgreementEncryptOptions = require('./KmsKeyAgreementEncryptOptions.js');
const require_KmsEncryptOptions = require('./KmsEncryptOptions.js');
let zod = require("zod");
zod = require_rolldown_runtime.__toESM(zod);

//#region src/modules/kms/options/KmsKeyAgreementDecryptOptions.ts
const zKmsKeyAgreementDecryptEcdhEsKw = zod.z.object({
	keyId: require_common.zKmsKeyId,
	algorithm: zod.z.enum([
		"ECDH-ES+A128KW",
		"ECDH-ES+A192KW",
		"ECDH-ES+A256KW"
	]),
	externalPublicJwk: require_KmsKeyAgreementEncryptOptions.zKmsJwkPublicEcdh,
	encryptedKey: require_KmsEncryptOptions.zKmsEncryptedKey,
	apu: zod.z.optional(require_zod.zAnyUint8Array),
	apv: zod.z.optional(require_zod.zAnyUint8Array)
});
const zKmsKeyAgreementDecryptEcdhHsalsa20 = zod.z.object({
	keyId: require_common.zKmsKeyId,
	algorithm: zod.z.literal("ECDH-HSALSA20"),
	externalPublicJwk: require_okpJwk.zKmsJwkPublicOkp.extend({ crv: require_okpJwk.zKmsJwkPublicOkp.shape.crv.extract(["X25519"]) }).optional()
});
const zKmsKeyAgreementDecryptOptions = zod.z.discriminatedUnion("algorithm", [
	require_KmsKeyAgreementEncryptOptions.zKmsKeyAgreementEcdhEs,
	zKmsKeyAgreementDecryptEcdhEsKw,
	zKmsKeyAgreementDecryptEcdhHsalsa20
]).describe("Options for key agreement based on an assymetric key.");

//#endregion
exports.zKmsKeyAgreementDecryptOptions = zKmsKeyAgreementDecryptOptions;