const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.js');
const require_index = require('../../../../../node_modules/.pnpm/class-transformer@0.5.1/node_modules/class-transformer/cjs/index.js');
const require_index$1 = require('../../../../../node_modules/.pnpm/class-validator@0.14.1/node_modules/class-validator/cjs/index.js');
const require_decorateMetadata = require('../../../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.js');
const require_decorate = require('../../../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js');
const require_TransportDecorator = require('./TransportDecorator.js');

//#region ../didcomm/src/decorators/transport/TransportDecoratorExtension.ts
var import_cjs = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index.require_cjs());
var import_cjs$1 = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index$1.require_cjs());
function TransportDecorated(Base) {
	var _ref;
	class TransportDecoratorExtension extends Base {
		setReturnRouting(type, thread) {
			this.transport = new require_TransportDecorator.TransportDecorator({
				returnRoute: type,
				returnRouteThread: thread
			});
		}
		hasReturnRouting(threadId) {
			if (!this.transport || !this.transport.returnRoute || this.transport.returnRoute === require_TransportDecorator.ReturnRouteTypes.none) return false;
			if (this.transport.returnRoute === require_TransportDecorator.ReturnRouteTypes.all) return true;
			if (this.transport.returnRoute === require_TransportDecorator.ReturnRouteTypes.thread && this.transport.returnRouteThread === threadId) return true;
			return false;
		}
		hasAnyReturnRoute() {
			const returnRoute = this.transport?.returnRoute;
			return returnRoute === require_TransportDecorator.ReturnRouteTypes.all || returnRoute === require_TransportDecorator.ReturnRouteTypes.thread;
		}
	}
	require_decorate.__decorate([
		(0, import_cjs.Expose)({ name: "~transport" }),
		(0, import_cjs.Type)(() => require_TransportDecorator.TransportDecorator),
		(0, import_cjs$1.ValidateNested)(),
		(0, import_cjs$1.IsOptional)(),
		(0, import_cjs$1.IsInstance)(require_TransportDecorator.TransportDecorator),
		require_decorateMetadata.__decorateMetadata("design:type", typeof (_ref = typeof require_TransportDecorator.TransportDecorator !== "undefined" && require_TransportDecorator.TransportDecorator) === "function" ? _ref : Object)
	], TransportDecoratorExtension.prototype, "transport", void 0);
	return TransportDecoratorExtension;
}

//#endregion
exports.TransportDecorated = TransportDecorated;