
      import { Temporal } from "@js-temporal/polyfill";
      import { URLPattern } from "urlpattern-polyfill";
      globalThis.addEventListener = () => {};
    
import { Follow, Person } from "../lookup-B25HiNR_.js";
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
import { assert } from "../assert-MZs1qjMx.js";
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-D0ByqW8h.js";
import "../client-pY7-3icS.js";
import "../types-C2XVl6gj.js";
import "../actor-eJqgtXKv.js";
import "../key-DP6qvTbJ.js";
import "../http-BE4MNK5A.js";
import "../ld-HxSfVcFy.js";
import "../owner-BWOLrzit.js";
import "../proof-BYodbwm8.js";
import "../docloader-BFOyc5--.js";
import "../kv-cache-D7LFlByV.js";
import "../inbox-CC7Xf1dl.js";
import "../builder-CknaHxxc.js";
import "../collection-BzWsN9pB.js";
import "../keycache-wXn_gxMw.js";
import "../negotiation-C4nFufNk.js";
import "../retry-CfF8Gn4d.js";
import "../send-CC6itx2j.js";
import { test } from "../testing-BbJqK9NR.js";

//#region src/compat/transformers.test.ts
const federation = new FederationImpl({ kv: new MemoryKvStore() });
const context = federation.createContext(new URL("http://example.com/"));
test("autoIdAssigner", async () => {
	const activity = new Follow({
		actor: new URL("http://example.com/actors/1"),
		object: new Person({
			id: new URL("http://example.com/actors/2"),
			name: "Bob",
			preferredUsername: "bob"
		})
	});
	const result = autoIdAssigner(activity, context);
	const { id } = result;
	assertInstanceOf(id, URL);
	assertEquals(id.origin, "http://example.com");
	assertEquals(id.pathname, "/");
	assertEquals(id.search, "");
	assert(id.hash.match(/^#Follow\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/));
	assertEquals(await result.toJsonLd(), await new Follow({
		id,
		actor: new URL("http://example.com/actors/1"),
		object: new Person({
			id: new URL("http://example.com/actors/2"),
			name: "Bob",
			preferredUsername: "bob"
		})
	}).toJsonLd());
});
test("actorDehydrator()", async () => {
	const activity = new Follow({
		id: new URL("http://example.com/activities/1"),
		actor: new Person({
			id: new URL("http://example.com/actors/1"),
			name: "Alice",
			preferredUsername: "alice"
		}),
		object: new Person({
			id: new URL("http://example.com/actors/2"),
			name: "Bob",
			preferredUsername: "bob"
		})
	});
	const result = actorDehydrator(activity, context);
	assertEquals(await result.toJsonLd(), await new Follow({
		id: new URL("http://example.com/activities/1"),
		actor: new URL("http://example.com/actors/1"),
		object: new Person({
			id: new URL("http://example.com/actors/2"),
			name: "Bob",
			preferredUsername: "bob"
		})
	}).toJsonLd());
});

//#endregion