
      import { Temporal } from "@js-temporal/polyfill";
      import { URLPattern } from "urlpattern-polyfill";
      globalThis.addEventListener = () => {};
    
import { Follow, Person } from "../type-JlnIhtH5.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-CRZrzyXm.js";
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-AugJPLCs.js";
import "../semver-dArNLkR9.js";
import "../client-C3LXvzgW.js";
import "../lookup-HkB8wBuC.js";
import "../types-BIgY6c-l.js";
import "../actor-ByBNJSWI.js";
import "../key-B90BCoJg.js";
import "../http-BAWnFKIC.js";
import "../authdocloader-Fd9MO0DV.js";
import "../ld-JP8y-E2v.js";
import "../owner-CNBDu6Ls.js";
import "../proof-ygmNitay.js";
import "../inbox-D2G1qO9A.js";
import "../builder-BTryr62J.js";
import "../collection-CSzG2j1P.js";
import "../keycache-Duhx-dKS.js";
import "../retry-D4GJ670a.js";
import "../send-xA5rO1BB.js";
import { test } from "../testing-BANLO1B1.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